diff options
| author | Peter Kokot <peterkokot@gmail.com> | 2018-07-30 01:50:24 +0200 |
|---|---|---|
| committer | Peter Kokot <peterkokot@gmail.com> | 2018-07-30 02:36:38 +0200 |
| commit | 4371945b8b71e000ee060b9da668a6eea032df32 (patch) | |
| tree | 53881f0f9b52f523fc87cdd7b93c272572ca3b61 /sapi | |
| parent | aac5cdc7d7d4323f9cf93736e2107d22405e09a6 (diff) | |
| download | php-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 'sapi')
| -rw-r--r-- | sapi/cli/config.m4 | 9 | ||||
| -rw-r--r-- | sapi/fpm/config.m4 | 91 |
2 files changed, 45 insertions, 55 deletions
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 index 7382963959..93c9e7b702 100644 --- a/sapi/cli/config.m4 +++ b/sapi/cli/config.m4 @@ -9,12 +9,11 @@ AC_CHECK_FUNCS(setproctitle) AC_CHECK_HEADERS([sys/pstat.h]) AC_CACHE_CHECK([for PS_STRINGS], [cli_cv_var_PS_STRINGS], -[AC_TRY_LINK( -[#include <machine/vmparam.h> +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <machine/vmparam.h> #include <sys/exec.h> -], -[PS_STRINGS->ps_nargvstr = 1; -PS_STRINGS->ps_argvstr = "foo";], +]], +[[PS_STRINGS->ps_nargvstr = 1; +PS_STRINGS->ps_argvstr = "foo";]])], [cli_cv_var_PS_STRINGS=yes], [cli_cv_var_PS_STRINGS=no])]) if test "$cli_cv_var_PS_STRINGS" = yes ; then diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index 9bbc27aa00..3eb39c913c 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -21,7 +21,7 @@ AC_DEFUN([AC_FPM_PRCTL], [ AC_MSG_CHECKING([for prctl]) - AC_TRY_COMPILE([ #include <sys/prctl.h> ], [prctl(0, 0, 0, 0, 0);], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/prctl.h>]], [[prctl(0, 0, 0, 0, 0);]])], [ AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?]) AC_MSG_RESULT([yes]) ], [ @@ -35,7 +35,7 @@ AC_DEFUN([AC_FPM_CLOCK], AC_MSG_CHECKING([for clock_gettime]) - AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [ have_clock_gettime=yes AC_MSG_RESULT([yes]) ], [ @@ -48,7 +48,7 @@ AC_DEFUN([AC_FPM_CLOCK], SAVED_LIBS="$LIBS" LIBS="$LIBS -lrt" - AC_TRY_LINK([ #include <time.h> ], [struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);]])], [ have_clock_gettime=yes AC_MSG_RESULT([yes]) ], [ @@ -66,7 +66,7 @@ AC_DEFUN([AC_FPM_CLOCK], if test "$have_clock_gettime" = "no"; then AC_MSG_CHECKING([for clock_get_time]) - AC_TRY_RUN([ #include <mach/mach.h> + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <mach/mach.h> #include <mach/clock.h> #include <mach/mach_error.h> @@ -86,12 +86,12 @@ AC_DEFUN([AC_FPM_CLOCK], return 0; } - ], [ + ]])], [ have_clock_get_time=yes AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) - ]) + ], []) fi if test "$have_clock_get_time" = "yes"; then @@ -106,9 +106,9 @@ AC_DEFUN([AC_FPM_TRACE], AC_MSG_CHECKING([for ptrace]) - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> - #include <sys/ptrace.h> ], [ptrace(0, 0, (void *) 0, 0);], [ + #include <sys/ptrace.h> ]], [[ptrace(0, 0, (void *) 0, 0);]])], [ have_ptrace=yes AC_MSG_RESULT([yes]) ], [ @@ -118,7 +118,7 @@ AC_DEFUN([AC_FPM_TRACE], if test "$have_ptrace" = "yes"; then AC_MSG_CHECKING([whether ptrace works]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <unistd.h> #include <signal.h> #include <sys/wait.h> @@ -185,7 +185,7 @@ AC_DEFUN([AC_FPM_TRACE], return 0; } } - ], [ + ]])], [ AC_MSG_RESULT([yes]) ], [ have_ptrace=no @@ -205,11 +205,11 @@ AC_DEFUN([AC_FPM_TRACE], if test "$have_broken_ptrace" = "yes"; then AC_MSG_CHECKING([for mach_vm_read]) - AC_TRY_COMPILE([ #include <mach/mach.h> + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mach/mach.h> #include <mach/mach_vm.h> - ], [ + ]], [[ mach_vm_read((vm_map_t)0, (mach_vm_address_t)0, (mach_vm_size_t)0, (vm_offset_t *)0, (mach_msg_type_number_t*)0); - ], [ + ]])], [ have_mach_vm_read=yes AC_MSG_RESULT([yes]) ], [ @@ -234,7 +234,7 @@ AC_DEFUN([AC_FPM_TRACE], if test -n "$proc_mem_file" ; then AC_MSG_CHECKING([for proc mem file]) - AC_TRY_RUN([ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 #include <stdint.h> @@ -260,7 +260,7 @@ AC_DEFUN([AC_FPM_TRACE], close(fd); return v1 != v2; } - ], [ + ]])], [ AC_MSG_RESULT([$proc_mem_file]) ], [ proc_mem_file="" @@ -294,17 +294,14 @@ AC_DEFUN([AC_FPM_TRACE], AC_DEFUN([AC_FPM_BUILTIN_ATOMIC], [ AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) - AC_TRY_LINK(, - [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ int variable = 1; return (__sync_bool_compare_and_swap(&variable, 1, 2) && __sync_add_and_fetch(&variable, 1)) ? 1 : 0; - ], - [ + ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) - ], - [ + ], [ AC_MSG_RESULT([no]) ]) ]) @@ -315,7 +312,7 @@ AC_DEFUN([AC_FPM_LQ], AC_MSG_CHECKING([for TCP_INFO]) - AC_TRY_COMPILE([ #include <netinet/tcp.h> ], [struct tcp_info ti; int x = TCP_INFO;], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/tcp.h>]], [[struct tcp_info ti; int x = TCP_INFO;]])], [ have_lq=tcp_info AC_MSG_RESULT([yes]) ], [ @@ -329,7 +326,7 @@ AC_DEFUN([AC_FPM_LQ], if test "$have_lq" = "no" ; then AC_MSG_CHECKING([for SO_LISTENQLEN]) - AC_TRY_COMPILE([ #include <sys/socket.h> ], [int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[int x = SO_LISTENQLIMIT; int y = SO_LISTENQLEN;]])], [ have_lq=so_listenq AC_MSG_RESULT([yes]) ], [ @@ -347,7 +344,7 @@ AC_DEFUN([AC_FPM_SYSCONF], [ AC_MSG_CHECKING([for sysconf]) - AC_TRY_COMPILE([ #include <unistd.h> ], [sysconf(_SC_CLK_TCK);], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]], [[sysconf(_SC_CLK_TCK);]])],[ AC_DEFINE([HAVE_SYSCONF], 1, [do we have sysconf?]) AC_MSG_RESULT([yes]) ], [ @@ -360,7 +357,7 @@ AC_DEFUN([AC_FPM_TIMES], [ AC_MSG_CHECKING([for times]) - AC_TRY_COMPILE([ #include <sys/times.h> ], [struct tms t; times(&t);], [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/times.h>]], [[struct tms t; times(&t);]])],[ AC_DEFINE([HAVE_TIMES], 1, [do we have times?]) AC_MSG_RESULT([yes]) ], [ @@ -373,18 +370,17 @@ AC_DEFUN([AC_FPM_KQUEUE], [ AC_MSG_CHECKING([for kqueue]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> - ], [ + ]], [[ int kfd; struct kevent k; kfd = kqueue(); /* 0 -> STDIN_FILENO */ EV_SET(&k, 0, EVFILT_READ , EV_ADD | EV_CLEAR, 0, 0, NULL); - ], [ + ]])], [ AC_DEFINE([HAVE_KQUEUE], 1, [do we have kqueue?]) AC_MSG_RESULT([yes]) ], [ @@ -397,17 +393,16 @@ AC_DEFUN([AC_FPM_PORT], [ AC_MSG_CHECKING([for port framework]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <port.h> - ], [ + ]], [[ int port; port = port_create(); if (port < 0) { return 1; } - ], [ + ]])], [ AC_DEFINE([HAVE_PORT], 1, [do we have port framework?]) AC_MSG_RESULT([yes]) ], [ @@ -420,11 +415,10 @@ AC_DEFUN([AC_FPM_DEVPOLL], [ AC_MSG_CHECKING([for /dev/poll]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> #include <sys/devpoll.h> - ], [ + ]], [[ int n, dp; struct dvpoll dvp; dp = 0; @@ -432,7 +426,7 @@ AC_DEFUN([AC_FPM_DEVPOLL], dvp.dp_nfds = 0; dvp.dp_timeout = 0; n = ioctl(dp, DP_POLL, &dvp) - ], [ + ]])], [ AC_DEFINE([HAVE_DEVPOLL], 1, [do we have /dev/poll?]) AC_MSG_RESULT([yes]) ], [ @@ -445,10 +439,9 @@ AC_DEFUN([AC_FPM_EPOLL], [ AC_MSG_CHECKING([for epoll]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/epoll.h> - ], [ + ]], [[ int epollfd; struct epoll_event e; @@ -468,7 +461,7 @@ AC_DEFUN([AC_FPM_EPOLL], if (epoll_wait(epollfd, &e, 1, 1) < 0) { return 1; } - ], [ + ]])], [ AC_DEFINE([HAVE_EPOLL], 1, [do we have epoll?]) AC_MSG_RESULT([yes]) ], [ @@ -481,10 +474,9 @@ AC_DEFUN([AC_FPM_POLL], [ AC_MSG_CHECKING([for poll]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <poll.h> - ], [ + ]], [[ struct pollfd fds[2]; fds[0].fd = 0; @@ -494,7 +486,7 @@ AC_DEFUN([AC_FPM_POLL], fds[1].events = POLLIN; poll(fds, 2, 1); - ], [ + ]])], [ AC_DEFINE([HAVE_POLL], 1, [do we have poll?]) AC_MSG_RESULT([yes]) ], [ @@ -507,8 +499,7 @@ AC_DEFUN([AC_FPM_SELECT], [ AC_MSG_CHECKING([for select]) - AC_TRY_COMPILE( - [ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* According to POSIX.1-2001 */ #include <sys/select.h> @@ -516,7 +507,7 @@ AC_DEFUN([AC_FPM_SELECT], #include <sys/time.h> #include <sys/types.h> #include <unistd.h> - ], [ + ]], [[ fd_set fds; struct timeval t; t.tv_sec = 0; @@ -525,7 +516,7 @@ AC_DEFUN([AC_FPM_SELECT], /* 0 -> STDIN_FILENO */ FD_SET(0, &fds); select(FD_SETSIZE, &fds, NULL, NULL, &t); - ], [ + ]])], [ AC_DEFINE([HAVE_SELECT], 1, [do we have select?]) AC_MSG_RESULT([yes]) ], [ @@ -541,7 +532,7 @@ AC_DEFUN([AC_FPM_APPARMOR], SAVED_LIBS="$LIBS" LIBS="$LIBS -lapparmor" - AC_TRY_LINK([ #include <sys/apparmor.h> ], [change_hat("test", 0);], [ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/apparmor.h>]], [[change_hat("test", 0);]])], [ AC_DEFINE([HAVE_APPARMOR], 1, [do we have apparmor support?]) AC_MSG_RESULT([yes]) ], [ |
