Skip to content

Commit b1c34a9

Browse files
authored
Normalize AC_CHECK_HEADER* arguments (#14723)
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).
1 parent 52ed06d commit b1c34a9

File tree

4 files changed

+60
-66
lines changed

4 files changed

+60
-66
lines changed

configure.ac

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -373,55 +373,55 @@ dnl Then headers.
373373
dnl ----------------------------------------------------------------------------
374374

375375
dnl QNX requires unix.h to allow functions in libunix to work properly.
376-
AC_CHECK_HEADERS([ \
377-
dirent.h \
378-
sys/param.h \
379-
sys/types.h \
380-
sys/time.h \
381-
netinet/in.h \
382-
alloca.h \
383-
arpa/inet.h \
384-
arpa/nameser.h \
385-
dns.h \
386-
fcntl.h \
387-
grp.h \
388-
ieeefp.h \
389-
langinfo.h \
390-
linux/sock_diag.h \
391-
poll.h \
392-
pty.h \
393-
pwd.h \
394-
resolv.h \
395-
strings.h \
396-
syslog.h \
397-
sysexits.h \
398-
sys/ioctl.h \
399-
sys/file.h \
400-
sys/mman.h \
401-
sys/mount.h \
402-
sys/poll.h \
403-
sys/resource.h \
404-
sys/select.h \
405-
sys/socket.h \
406-
sys/stat.h \
407-
sys/statfs.h \
408-
sys/statvfs.h \
409-
sys/vfs.h \
410-
sys/sysexits.h \
411-
sys/uio.h \
412-
sys/wait.h \
413-
sys/loadavg.h \
414-
unistd.h \
415-
unix.h \
416-
utime.h \
417-
sys/utsname.h \
418-
sys/ipc.h \
419-
dlfcn.h \
420-
tmmintrin.h \
421-
nmmintrin.h \
422-
wmmintrin.h \
423-
immintrin.h
424-
],[],[],[
376+
AC_CHECK_HEADERS(m4_normalize([
377+
dirent.h
378+
sys/param.h
379+
sys/types.h
380+
sys/time.h
381+
netinet/in.h
382+
alloca.h
383+
arpa/inet.h
384+
arpa/nameser.h
385+
dns.h
386+
fcntl.h
387+
grp.h
388+
ieeefp.h
389+
langinfo.h
390+
linux/sock_diag.h
391+
poll.h
392+
pty.h
393+
pwd.h
394+
resolv.h
395+
strings.h
396+
syslog.h
397+
sysexits.h
398+
sys/ioctl.h
399+
sys/file.h
400+
sys/mman.h
401+
sys/mount.h
402+
sys/poll.h
403+
sys/resource.h
404+
sys/select.h
405+
sys/socket.h
406+
sys/stat.h
407+
sys/statfs.h
408+
sys/statvfs.h
409+
sys/vfs.h
410+
sys/sysexits.h
411+
sys/uio.h
412+
sys/wait.h
413+
sys/loadavg.h
414+
unistd.h
415+
unix.h
416+
utime.h
417+
sys/utsname.h
418+
sys/ipc.h
419+
dlfcn.h
420+
tmmintrin.h
421+
nmmintrin.h
422+
wmmintrin.h
423+
immintrin.h
424+
]),,, [dnl
425425
#ifdef HAVE_SYS_PARAM_H
426426
#include <sys/param.h>
427427
#endif
@@ -1331,11 +1331,9 @@ else
13311331
if test "$fiber_os" = 'mac'; then
13321332
AC_DEFINE([_XOPEN_SOURCE], 1, [ ])
13331333
fi
1334-
AC_CHECK_HEADER(ucontext.h, [
1335-
AC_DEFINE([ZEND_FIBER_UCONTEXT], 1, [ ])
1336-
], [
1337-
AC_MSG_ERROR([fibers not available on this platform])
1338-
])
1334+
AC_CHECK_HEADER([ucontext.h],
1335+
[AC_DEFINE([ZEND_FIBER_UCONTEXT], [1], [ ])],
1336+
[AC_MSG_ERROR([fibers not available on this platform])])
13391337
fi
13401338

13411339
ZEND_INIT

ext/random/config.m4

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ dnl
66
dnl Check for CCRandomGenerateBytes
77
dnl header absent in previous macOs releases
88
dnl
9-
AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h], [], [],
10-
[
11-
#include <sys/types.h>
12-
#include <Availability.h>
13-
#include <CommonCrypto/CommonCryptoError.h>
9+
AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h],,, [dnl
10+
#include <sys/types.h>
11+
#include <Availability.h>
12+
#include <CommonCrypto/CommonCryptoError.h>
1413
])
1514

1615
dnl

ext/standard/config.m4

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PHP_ARG_WITH([external-libcrypt],
6161
if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then
6262
PHP_CHECK_FUNC(crypt, crypt)
6363
PHP_CHECK_FUNC(crypt_r, crypt)
64-
AC_CHECK_HEADERS(crypt.h)
64+
AC_CHECK_HEADERS([crypt.h])
6565
if test "$ac_cv_func_crypt_r" = "yes"; then
6666
PHP_CRYPT_R_STYLE
6767
fi
@@ -384,8 +384,7 @@ dnl
384384
dnl Check net/if.h for net_get_interfaces. Darwin and BSD-like systems need
385385
dnl sys/socket.h to be included with net/if.h.
386386
dnl
387-
AC_CHECK_HEADERS([net/if.h],[], [],
388-
[
387+
AC_CHECK_HEADERS([net/if.h],,, [dnl
389388
#ifdef HAVE_SYS_SOCKET_H
390389
#include <sys/socket.h>
391390
#endif

ext/sysvmsg/config.m4

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ PHP_ARG_ENABLE([sysvmsg],
44
[Enable sysvmsg support])])
55

66
if test "$PHP_SYSVMSG" != "no"; then
7-
AC_CHECK_HEADER([sys/msg.h],
8-
[],
9-
[AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing])
10-
])
7+
AC_CHECK_HEADER([sys/msg.h],,
8+
[AC_MSG_ERROR([Cannot enable System V IPC support, sys/msg.h is missing])])
119

1210
AC_DEFINE(HAVE_SYSVMSG, 1, [ ])
1311
PHP_NEW_EXTENSION(sysvmsg, sysvmsg.c, $ext_shared)

0 commit comments

Comments
 (0)