summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-07-30 01:50:24 +0200
committerPeter Kokot <peterkokot@gmail.com>2018-07-30 02:36:38 +0200
commit4371945b8b71e000ee060b9da668a6eea032df32 (patch)
tree53881f0f9b52f523fc87cdd7b93c272572ca3b61 /acinclude.m4
parentaac5cdc7d7d4323f9cf93736e2107d22405e09a6 (diff)
downloadphp-git-4371945b8b71e000ee060b9da668a6eea032df32.tar.gz
Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK: http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2 These macros should be replaced with the current AC_FOO_IFELSE instead: - AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE - AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM - AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require 2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which are all greater than above mentioned 2.50 version therefore systems should be well supported by now. This patch was created with the help of autoupdate script: autoupdate <file> Reference docs: - https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html - https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m4203
1 files changed, 98 insertions, 105 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index e04545ad05..6c99085457 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -301,7 +301,7 @@ AC_MSG_CHECKING([if compiler supports -R])
AC_CACHE_VAL(php_cv_cc_dashr,[
SAVE_LIBS=$LIBS
LIBS="-R /usr/$PHP_LIBDIR $LIBS"
- AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_dashr=yes],[php_cv_cc_dashr=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_dashr])
if test $php_cv_cc_dashr = "yes"; then
@@ -311,7 +311,7 @@ else
AC_CACHE_VAL(php_cv_cc_rpath,[
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
- AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],[php_cv_cc_rpath=yes],[php_cv_cc_rpath=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$php_cv_cc_rpath])
if test $php_cv_cc_rpath = "yes"; then
@@ -1060,7 +1060,7 @@ AC_DEFUN([_PHP_CHECK_SIZEOF], [
LIBS=
old_LDFLAGS=$LDFLAGS
LDFLAGS=
- AC_TRY_RUN([#include <stdio.h>
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
@@ -1080,7 +1080,7 @@ int main()
fprintf(fp, "%d\n", sizeof($1));
return(0);
}
- ], [
+ ]])], [
eval $php_cache_value=`cat conftestval`
], [
eval $php_cache_value=0
@@ -1155,7 +1155,7 @@ dnl Type can be: irix, hpux or POSIX
dnl
AC_DEFUN([PHP_TIME_R_TYPE],[
AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>
main() {
@@ -1169,10 +1169,10 @@ r = (int) asctime_r(&t, buf, 26);
if (r == s && s == 0) return (0);
return (1);
}
-],[
+]])],[
ac_cv_time_r_type=hpux
],[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <time.h>
main() {
struct tm t, *s;
@@ -1184,7 +1184,7 @@ main() {
if (p == buf && s == &t) return (0);
return (1);
}
- ],[
+ ]])],[
ac_cv_time_r_type=irix
],[
ac_cv_time_r_type=POSIX
@@ -1205,7 +1205,7 @@ dnl
dnl PHP_DOES_PWRITE_WORK
dnl internal
AC_DEFUN([PHP_DOES_PWRITE_WORK],[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -1222,7 +1222,7 @@ $1
exit(0);
}
- ],[
+ ]])],[
ac_cv_pwrite=yes
],[
ac_cv_pwrite=no
@@ -1235,7 +1235,7 @@ dnl PHP_DOES_PREAD_WORK
dnl internal
AC_DEFUN([PHP_DOES_PREAD_WORK],[
echo test > conftest_in
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -1251,7 +1251,7 @@ $1
if (pread(fd, buf, 2, -1) != -1 || errno != EINVAL) exit(1);
exit(0);
}
- ],[
+ ]])],[
ac_cv_pread=yes
],[
ac_cv_pread=no
@@ -1310,27 +1310,27 @@ dnl PHP_MISSING_TIME_R_DECL
dnl
AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
AC_MSG_CHECKING([for missing declarations of reentrant functions])
- AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = localtime_r]])],[
:
],[
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct tm *(*func)() = gmtime_r]])],[
:
],[
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = asctime_r]])],[
:
],[
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
])
- AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[char *(*func)() = ctime_r]])],[
:
],[
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
])
- AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[char *(*func)() = strtok_r]])],[
:
],[
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
@@ -1346,7 +1346,7 @@ AC_DEFUN([PHP_READDIR_R_TYPE],[
AC_CHECK_FUNC(readdir_r,ac_cv_func_readdir_r=yes,ac_cv_func_readdir=no)
if test "$ac_cv_func_readdir_r" = "yes"; then
AC_CACHE_CHECK(for type of readdir_r, ac_cv_what_readdir_r,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _REENTRANT
#include <sys/types.h>
#include <dirent.h>
@@ -1370,7 +1370,7 @@ main() {
close(dir);
exit(1);
}
- ],[
+ ]])],[
ac_cv_what_readdir_r=POSIX
],[
AC_PREPROC_IFELSE([
@@ -1402,9 +1402,9 @@ dnl PHP_TM_GMTOFF
dnl
AC_DEFUN([PHP_TM_GMTOFF],[
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
- ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <$ac_cv_struct_tm>]], [[struct tm tm; tm.tm_gmtoff;]])],
+ [ac_cv_struct_tm_gmtoff=yes], [ac_cv_struct_tm_gmtoff=no])])
if test "$ac_cv_struct_tm_gmtoff" = yes; then
AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])
@@ -1416,12 +1416,10 @@ dnl PHP_STRUCT_FLOCK
dnl
AC_DEFUN([PHP_STRUCT_FLOCK],[
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#include <fcntl.h>
- ],
- [struct flock x;],
- [
+ ]], [[struct flock x;]])],[
ac_cv_struct_flock=yes
],[
ac_cv_struct_flock=no
@@ -1437,12 +1435,12 @@ dnl PHP_SOCKLEN_T
dnl
AC_DEFUN([PHP_SOCKLEN_T],[
AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-],[
+]],[[
socklen_t x;
-],[
+]])],[
ac_cv_socklen_t=yes
],[
ac_cv_socklen_t=no
@@ -1459,7 +1457,7 @@ dnl See if we have broken header files like SunOS has.
dnl
AC_DEFUN([PHP_MISSING_FCLOSE_DECL],[
AC_MSG_CHECKING([for fclose declaration])
- AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[int (*func)() = fclose]])],[
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
AC_MSG_RESULT([ok])
],[
@@ -1475,7 +1473,7 @@ dnl Check for broken sprintf(), C99 conformance
dnl
AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[
ac_cv_broken_sprintf=no
],[
ac_cv_broken_sprintf=yes
@@ -1497,7 +1495,7 @@ dnl Check for broken snprintf(), C99 conformance
dnl
AC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[
AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define NULL (0L)
main() {
char buf[20];
@@ -1512,7 +1510,7 @@ main() {
res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8);
exit(res);
}
- ],[
+ ]])],[
ac_cv_broken_snprintf=no
],[
ac_cv_broken_snprintf=yes
@@ -1609,9 +1607,9 @@ dnl
AC_DEFUN([PHP_SOCKADDR_CHECKS], [
dnl Check for struct sockaddr_storage exists
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage,
- [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
- [struct sockaddr_storage s; s],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]],
+ [[struct sockaddr_storage s; s]])],
[ac_cv_sockaddr_storage=yes], [ac_cv_sockaddr_storage=no])
])
if test "$ac_cv_sockaddr_storage" = "yes"; then
@@ -1619,9 +1617,8 @@ AC_DEFUN([PHP_SOCKADDR_CHECKS], [
fi
dnl Check if field sa_len exists in struct sockaddr
AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[
- AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>],
- [static struct sockaddr sa; int n = (int) sa.sa_len; return n;],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <sys/socket.h>]], [[static struct sockaddr sa; int n = (int) sa.sa_len; return n;]])],
[ac_cv_sockaddr_sa_len=yes], [ac_cv_sockaddr_sa_len=no])
])
if test "$ac_cv_sockaddr_sa_len" = "yes"; then
@@ -1634,15 +1631,15 @@ dnl PHP_DECLARED_TIMEZONE
dnl
AC_DEFUN([PHP_DECLARED_TIMEZONE],[
AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-],[
+]],[[
time_t foo = (time_t) timezone;
-],[
+]])],[
ac_cv_declared_timezone=yes
],[
ac_cv_declared_timezone=no
@@ -1657,11 +1654,11 @@ dnl PHP_EBCDIC
dnl
AC_DEFUN([PHP_EBCDIC], [
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
- AC_TRY_RUN( [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void) {
return (unsigned char)'A' != (unsigned char)0xC1;
}
-],[
+]])],[
ac_cv_ebcdic=yes
],[
ac_cv_ebcdic=no
@@ -1697,7 +1694,7 @@ dnl
AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND], [
AC_MSG_CHECKING([for broken libc stdio])
AC_CACHE_VAL(_cv_have_broken_glibc_fopen_append,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
int main(int argc, char *argv[])
{
@@ -1721,19 +1718,19 @@ int main(int argc, char *argv[])
return 1;
return 0;
}
-],
+]])],
[_cv_have_broken_glibc_fopen_append=no],
-[_cv_have_broken_glibc_fopen_append=yes ],
-[AC_TRY_COMPILE([
+[_cv_have_broken_glibc_fopen_append=yes],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <features.h>
-],[
+]], [[
#if !__GLIBC_PREREQ(2,2)
choke me
#endif
-],
+]])],
[_cv_have_broken_glibc_fopen_append=yes],
-[_cv_have_broken_glibc_fopen_append=no ])]
-)])
+[_cv_have_broken_glibc_fopen_append=no])
+])])
if test "$_cv_have_broken_glibc_fopen_append" = "yes"; then
AC_MSG_RESULT(yes)
@@ -1753,17 +1750,17 @@ AC_DEFUN([PHP_FOPENCOOKIE], [
dnl this comes in two flavors:
dnl newer glibcs (since 2.1.2 ? )
dnl have a type called cookie_io_functions_t
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <stdio.h>
-], [cookie_io_functions_t cookie;], [have_cookie_io_functions_t=yes], [])
+]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[])
if test "$have_cookie_io_functions_t" = "yes"; then
cookie_io_functions_t=cookie_io_functions_t
have_fopen_cookie=yes
dnl even newer glibcs have a different seeker definition...
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#define _GNU_SOURCE
#include <stdio.h>
@@ -1791,7 +1788,7 @@ main() {
exit(1);
}
-], [
+]])], [
cookie_io_functions_use_off64_t=yes
], [
cookie_io_functions_use_off64_t=no
@@ -1803,10 +1800,10 @@ main() {
dnl older glibc versions (up to 2.1.2 ?)
dnl call it _IO_cookie_io_functions_t
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <stdio.h>
-], [ _IO_cookie_io_functions_t cookie; ], [have_IO_cookie_io_functions_t=yes], [])
+]], [[_IO_cookie_io_functions_t cookie;]])], [have_IO_cookie_io_functions_t=yes], [])
if test "$have_cookie_io_functions_t" = "yes" ; then
cookie_io_functions_t=_IO_cookie_io_functions_t
have_fopen_cookie=yes
@@ -1899,7 +1896,7 @@ AC_DEFUN([PHP_CHECK_FUNC_LIB],[
if test "$found" = "yes"; then
ac_libs=$LIBS
LIBS="$LIBS -l$2"
- AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[main() { return (0); }]])],[found=yes],[found=no],[found=no])
LIBS=$ac_libs
fi
@@ -1947,14 +1944,14 @@ dnl
AC_DEFUN([PHP_TEST_BUILD], [
old_LIBS=$LIBS
LIBS="$4 $LIBS"
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
$5
char $1();
int main() {
$1();
return 0;
}
- ], [
+ ]])],[
LIBS=$old_LIBS
$2
],[
@@ -2024,8 +2021,7 @@ AC_DEFUN([PHP_C_BIGENDIAN],
[AC_CACHE_CHECK([whether byte ordering is bigendian], ac_cv_c_bigendian_php,
[
ac_cv_c_bigendian_php=unknown
- AC_TRY_RUN(
- [
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main(void)
{
short one = 1;
@@ -2037,7 +2033,7 @@ int main(void)
return(1);
}
}
- ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
+ ]])], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
])
if test $ac_cv_c_bigendian_php = yes; then
AC_DEFINE(WORDS_BIGENDIAN, [], [Define if processor uses big-endian word])
@@ -2797,36 +2793,33 @@ AC_DEFUN([PHP_CRYPT_R_STYLE],
[
AC_CACHE_CHECK([which data struct is used by crypt_r], php_cv_crypt_r_style,[
php_cv_crypt_r_style=none
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#include <crypt.h>
-],[
+]], [[
CRYPTD buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=cryptd)
+]])],[php_cv_crypt_r_style=cryptd],[])
if test "$php_cv_crypt_r_style" = "none"; then
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#include <crypt.h>
-],[
+]],[[
struct crypt_data buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=struct_crypt_data)
+]])],[php_cv_crypt_r_style=struct_crypt_data],[])
fi
if test "$php_cv_crypt_r_style" = "none"; then
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _REENTRANT 1
#define _GNU_SOURCE
#include <crypt.h>
-],[
+]],[[
struct crypt_data buffer;
crypt_r("passwd", "hash", &buffer);
-],
-php_cv_crypt_r_style=struct_crypt_data_gnu_source)
+]])],[php_cv_crypt_r_style=struct_crypt_data_gnu_source],[])
fi
])
@@ -2849,7 +2842,7 @@ dnl PHP_TEST_WRITE_STDOUT
dnl
AC_DEFUN([PHP_TEST_WRITE_STDOUT],[
AC_CACHE_CHECK(whether writing to stdout works,ac_cv_write_stdout,[
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -2863,7 +2856,7 @@ main()
n = write(1, TEXT, sizeof(TEXT)-1);
return (!(n == sizeof(TEXT)-1));
}
- ],[
+ ]])],[
ac_cv_write_stdout=yes
],[
ac_cv_write_stdout=no
@@ -3009,9 +3002,9 @@ dnl PHP_CHECK_BUILTIN_EXPECT
AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
AC_MSG_CHECKING([for __builtin_expect])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_expect(1,1) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_expect=1
AC_MSG_RESULT([yes])
], [
@@ -3027,9 +3020,9 @@ dnl PHP_CHECK_BUILTIN_CLZ
AC_DEFUN([PHP_CHECK_BUILTIN_CLZ], [
AC_MSG_CHECKING([for __builtin_clz])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_clz(1) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_clz=1
AC_MSG_RESULT([yes])
], [
@@ -3045,9 +3038,9 @@ dnl PHP_CHECK_BUILTIN_CTZL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZL], [
AC_MSG_CHECKING([for __builtin_ctzl])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_ctzl(2L) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_ctzl=1
AC_MSG_RESULT([yes])
], [
@@ -3063,9 +3056,9 @@ dnl PHP_CHECK_BUILTIN_CTZLL
AC_DEFUN([PHP_CHECK_BUILTIN_CTZLL], [
AC_MSG_CHECKING([for __builtin_ctzll])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_ctzll(2LL) ? 1 : 0;
- ], [
+ ]])], [
have_builtin_ctzll=1
AC_MSG_RESULT([yes])
], [
@@ -3081,10 +3074,10 @@ dnl PHP_CHECK_BUILTIN_SMULL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SMULL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_smull_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_smull_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_smull_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3101,10 +3094,10 @@ dnl PHP_CHECK_BUILTIN_SMULLL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SMULLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_smulll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_smulll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_smulll_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3121,10 +3114,10 @@ dnl PHP_CHECK_BUILTIN_SADDL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SADDL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_saddl_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_saddl_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_saddl_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3141,10 +3134,10 @@ dnl PHP_CHECK_BUILTIN_SADDLL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SADDLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_saddll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_saddll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_saddll_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3161,10 +3154,10 @@ dnl PHP_CHECK_BUILTIN_SSUBL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SSUBL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_ssubl_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long tmpvar;
return __builtin_ssubl_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_ssubl_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3181,10 +3174,10 @@ dnl PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW
AC_DEFUN([PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW], [
AC_MSG_CHECKING([for __builtin_ssubll_overflow])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
long long tmpvar;
return __builtin_ssubll_overflow(3, 7, &tmpvar);
- ], [
+ ]])], [
have_builtin_ssubll_overflow=1
AC_MSG_RESULT([yes])
], [
@@ -3201,9 +3194,9 @@ dnl PHP_CHECK_BUILTIN_CPU_INIT
AC_DEFUN([PHP_CHECK_BUILTIN_CPU_INIT], [
AC_MSG_CHECKING([for __builtin_cpu_init])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_cpu_init()? 1 : 0;
- ], [
+ ]])], [
have_builtin_cpu_init=1
AC_MSG_RESULT([yes])
], [
@@ -3220,9 +3213,9 @@ dnl PHP_CHECK_BUILTIN_CPU_SUPPORTS
AC_DEFUN([PHP_CHECK_BUILTIN_CPU_SUPPORTS], [
AC_MSG_CHECKING([for __builtin_cpu_supports])
- AC_TRY_LINK(, [
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
return __builtin_cpu_supports("sse")? 1 : 0;
- ], [
+ ]])], [
have_builtin_cpu_supports=1
AC_MSG_RESULT([yes])
], [
@@ -3241,16 +3234,16 @@ AC_DEFUN([PHP_CHECK_CPU_SUPPORTS], [
have_ext_instructions=0
if test $have_builtin_cpu_supports = 1; then
AC_MSG_CHECKING([for $1 instructions supports])
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
int main() {
return __builtin_cpu_supports("$1")? 0 : 1;
}
- ], [
+ ]])], [
have_ext_instructions=1
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
- ])
+ ], [])
fi
AC_DEFINE_UNQUOTED(AS_TR_CPP([PHP_HAVE_$1_INSTRUCTIONS]),
[$have_ext_instructions], [Whether the compiler supports $1 instructions])