From 3f994c0eeb20e79d4d485d2135b67b7398a3f636 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 29 Jun 2024 17:36:33 +0200 Subject: [PATCH] Normalize AC_CHECK_HEADER* arguments The m4_normalize is for Autoconf < 2.70 (on 2.70 and later versions a blank-or-newline separated items can be expanded without using backslash-newline). The order of headers in configure.ac is left as is because the first few headers depend on checking other headers (for those includes the 4th argument). --- configure.ac | 106 ++++++++++++++++++++--------------------- ext/random/config.m4 | 9 ++-- ext/standard/config.m4 | 5 +- ext/sysvmsg/config.m4 | 6 +-- 4 files changed, 60 insertions(+), 66 deletions(-) diff --git a/configure.ac b/configure.ac index 2ddd2e1129e9..33371f58bc5f 100644 --- a/configure.ac +++ b/configure.ac @@ -373,55 +373,55 @@ dnl Then headers. dnl ---------------------------------------------------------------------------- dnl QNX requires unix.h to allow functions in libunix to work properly. -AC_CHECK_HEADERS([ \ -dirent.h \ -sys/param.h \ -sys/types.h \ -sys/time.h \ -netinet/in.h \ -alloca.h \ -arpa/inet.h \ -arpa/nameser.h \ -dns.h \ -fcntl.h \ -grp.h \ -ieeefp.h \ -langinfo.h \ -linux/sock_diag.h \ -poll.h \ -pty.h \ -pwd.h \ -resolv.h \ -strings.h \ -syslog.h \ -sysexits.h \ -sys/ioctl.h \ -sys/file.h \ -sys/mman.h \ -sys/mount.h \ -sys/poll.h \ -sys/resource.h \ -sys/select.h \ -sys/socket.h \ -sys/stat.h \ -sys/statfs.h \ -sys/statvfs.h \ -sys/vfs.h \ -sys/sysexits.h \ -sys/uio.h \ -sys/wait.h \ -sys/loadavg.h \ -unistd.h \ -unix.h \ -utime.h \ -sys/utsname.h \ -sys/ipc.h \ -dlfcn.h \ -tmmintrin.h \ -nmmintrin.h \ -wmmintrin.h \ -immintrin.h -],[],[],[ +AC_CHECK_HEADERS(m4_normalize([ + dirent.h + sys/param.h + sys/types.h + sys/time.h + netinet/in.h + alloca.h + arpa/inet.h + arpa/nameser.h + dns.h + fcntl.h + grp.h + ieeefp.h + langinfo.h + linux/sock_diag.h + poll.h + pty.h + pwd.h + resolv.h + strings.h + syslog.h + sysexits.h + sys/ioctl.h + sys/file.h + sys/mman.h + sys/mount.h + sys/poll.h + sys/resource.h + sys/select.h + sys/socket.h + sys/stat.h + sys/statfs.h + sys/statvfs.h + sys/vfs.h + sys/sysexits.h + sys/uio.h + sys/wait.h + sys/loadavg.h + unistd.h + unix.h + utime.h + sys/utsname.h + sys/ipc.h + dlfcn.h + tmmintrin.h + nmmintrin.h + wmmintrin.h + immintrin.h +]),,, [dnl #ifdef HAVE_SYS_PARAM_H #include #endif @@ -1336,11 +1336,9 @@ else if test "$fiber_os" = 'mac'; then AC_DEFINE([_XOPEN_SOURCE], 1, [ ]) fi - AC_CHECK_HEADER(ucontext.h, [ - AC_DEFINE([ZEND_FIBER_UCONTEXT], 1, [ ]) - ], [ - AC_MSG_ERROR([fibers not available on this platform]) - ]) + AC_CHECK_HEADER([ucontext.h], + [AC_DEFINE([ZEND_FIBER_UCONTEXT], [1], [ ])], + [AC_MSG_ERROR([fibers not available on this platform])]) fi ZEND_INIT diff --git a/ext/random/config.m4 b/ext/random/config.m4 index 58f079c10229..abaa912bb51b 100644 --- a/ext/random/config.m4 +++ b/ext/random/config.m4 @@ -6,11 +6,10 @@ dnl dnl Check for CCRandomGenerateBytes dnl header absent in previous macOs releases dnl -AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h], [], [], -[ - #include - #include - #include +AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h],,, [dnl + #include + #include + #include ]) dnl diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 02d939f051e3..f0e008a6049d 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -61,7 +61,7 @@ PHP_ARG_WITH([external-libcrypt], if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then PHP_CHECK_FUNC(crypt, crypt) PHP_CHECK_FUNC(crypt_r, crypt) - AC_CHECK_HEADERS(crypt.h) + AC_CHECK_HEADERS([crypt.h]) if test "$ac_cv_func_crypt_r" = "yes"; then PHP_CRYPT_R_STYLE fi @@ -384,8 +384,7 @@ dnl dnl Check net/if.h for net_get_interfaces. Darwin and BSD-like systems need dnl sys/socket.h to be included with net/if.h. dnl -AC_CHECK_HEADERS([net/if.h],[], [], -[ +AC_CHECK_HEADERS([net/if.h],,, [dnl #ifdef HAVE_SYS_SOCKET_H #include #endif diff --git a/ext/sysvmsg/config.m4 b/ext/sysvmsg/config.m4 index 7ad70186fa16..4fed1dda9079 100644 --- a/ext/sysvmsg/config.m4 +++ b/ext/sysvmsg/config.m4 @@ -4,10 +4,8 @@ PHP_ARG_ENABLE([sysvmsg], [Enable sysvmsg support])]) if test "$PHP_SYSVMSG" != "no"; then - AC_CHECK_HEADER([sys/msg.h], - [], - [AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing]) - ]) + AC_CHECK_HEADER([sys/msg.h],, + [AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing])]) AC_DEFINE(HAVE_SYSVMSG, 1, [ ]) PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared)