Skip to content

Commit dccc911

Browse files
authored
Autotools: Refactor PHP_TIME_R_TYPE check (#14823)
- Synced CS - Cache variable ac_cv_time_r_type renamed to php_cv_time_r_type
1 parent cc7cfce commit dccc911

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

build/php.m4

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,10 @@ dnl
10641064
dnl Check type of reentrant time-related functions. Type can be: irix, hpux or
10651065
dnl POSIX.
10661066
dnl
1067-
AC_DEFUN([PHP_TIME_R_TYPE],[
1068-
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
1069-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1067+
AC_DEFUN([PHP_TIME_R_TYPE],
1068+
[AC_CACHE_CHECK([for type of reentrant time-related functions],
1069+
[php_cv_time_r_type],
1070+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
10701071
#include <time.h>
10711072
10721073
int main(void) {
@@ -1080,10 +1081,9 @@ r = (int) asctime_r(&t, buf, 26);
10801081
if (r == s && s == 0) return (0);
10811082
return (1);
10821083
}
1083-
]])],[
1084-
ac_cv_time_r_type=hpux
1085-
],[
1086-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1084+
]])],
1085+
[php_cv_time_r_type=hpux],
1086+
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
10871087
#include <time.h>
10881088
int main(void) {
10891089
struct tm t, *s;
@@ -1095,21 +1095,17 @@ int main(void) {
10951095
if (p == buf && s == &t) return (0);
10961096
return (1);
10971097
}
1098-
]])],[
1099-
ac_cv_time_r_type=irix
1100-
],[
1101-
ac_cv_time_r_type=POSIX
1102-
],[
1103-
ac_cv_time_r_type=POSIX
1104-
])
1105-
],[
1106-
ac_cv_time_r_type=POSIX
1107-
])
1108-
])
1109-
case $ac_cv_time_r_type in
1110-
hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;;
1111-
irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;;
1112-
esac
1098+
]])],
1099+
[php_cv_time_r_type=irix],
1100+
[php_cv_time_r_type=POSIX],
1101+
[php_cv_time_r_type=POSIX])],
1102+
[php_cv_time_r_type=POSIX])
1103+
])
1104+
AS_CASE([php_cv_time_r_type],
1105+
[hpux], [AC_DEFINE([PHP_HPUX_TIME_R], [1],
1106+
[Define to 1 if you have HP-UX 10.x.-style reentrant time functions.])]
1107+
[irix], [AC_DEFINE([PHP_IRIX_TIME_R], [1],
1108+
[Define to 1 you have IRIX-style reentrant time functions.])])
11131109
])
11141110

11151111
dnl

0 commit comments

Comments
 (0)