Skip to content

Commit 6c8768e

Browse files
committed
Require Autoconf 2.71 or newer
This updates the minimum required Autoconf version to 2.71. - Autoconf versions 2.70 started supporting C11 standards. - Autoconf 2.71 was released soon after 2.70 providing some bugfixes. Changes: - Removed obsolete AC_PROG_CC_C99 macro. In Autoconf 2.70 and later this is done by the AC_PROG_CC macro. - m4_normalize is not needed for AC_CHECK_HEADERS and AC_CHECK_FUNCTIONS macros anymore, as the argument is normalized internally by Autoconf in these newer versions. - Adjusted C11 check in configure.ac and added check also in phpize mode. Extensions using PHP headers should be also built with some C11-compliant compiler. - Removed ac_cv_header_sys_types_h_makedev hack for AC_HEADER_MAJOR macro when using Autoconf versions prior to 2.70. - Replaced AC_CONFIG_MACRO_DIR with preferred AC_CONFIG_MACRO_DIRS. This also enables using --runstatedir configure option in the future.
1 parent a135ac7 commit 6c8768e

7 files changed

Lines changed: 28 additions & 32 deletions

File tree

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ PHP 8.6 INTERNALS UPGRADE NOTES
9999
. --with-pic is now --enable-pic. The old flag will result in an error.
100100
. Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use
101101
HAVE_STRUCT_STAT_ST_BLOCKS).
102+
. Autoconf minimum required version upgraded to 2.71.
102103

103104
- Windows build system changes:
104105
. Function SETUP_OPENSSL() doesn't accept 6th argument anymore and doesn't

Zend/Zend.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ dnl
133133
AC_DEFUN([ZEND_INIT], [dnl
134134
AC_REQUIRE([AC_PROG_CC])
135135
136-
AC_CHECK_HEADERS(m4_normalize([
136+
AC_CHECK_HEADERS([
137137
cpuid.h
138138
libproc.h
139-
]))
139+
])
140140
141141
dnl Check for library functions.
142-
AC_CHECK_FUNCS(m4_normalize([
142+
AC_CHECK_FUNCS([
143143
getpid
144144
gettid
145145
kill
@@ -150,7 +150,7 @@ AC_CHECK_FUNCS(m4_normalize([
150150
pthread_getattr_np
151151
pthread_stackseg_np
152152
strnlen
153-
]))
153+
])
154154
155155
AC_CHECK_DECL([clock_gettime_nsec_np],
156156
[AC_DEFINE([HAVE_CLOCK_GETTIME_NSEC_NP], [1],

configure.ac

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ m4_include([Zend/Zend.m4])
2222
dnl Basic autoconf initialization, generation of config.nice.
2323
dnl ----------------------------------------------------------------------------
2424

25-
AC_PREREQ([2.68])
25+
AC_PREREQ([2.71])
2626
AC_INIT([PHP],[8.6.0-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net])
2727
AC_CONFIG_SRCDIR([main/php_version.h])
28-
AC_CONFIG_MACRO_DIR([build])
28+
AC_CONFIG_MACRO_DIRS([build])
2929
AC_CONFIG_AUX_DIR([build])
3030
AC_PRESERVE_HELP_ORDER
3131

@@ -120,11 +120,14 @@ dnl ----------------------------------------------------------------------------
120120

121121
PKG_PROG_PKG_CONFIG
122122
AC_PROG_CC([cc gcc])
123+
124+
dnl Check if C compiler accepts C11.
125+
AS_CASE([$ac_prog_cc_stdc], [c99|c89|no],
126+
[AC_MSG_ERROR([C compiler would not accept C11 code.])])
127+
123128
PHP_DETECT_ICC
124129
PHP_DETECT_SUNCC
125130

126-
dnl AC_PROG_CC_C99 is obsolete with autoconf >= 2.70 yet necessary for <= 2.69.
127-
m4_version_prereq([2.70],,[AC_PROG_CC_C99])
128131
AC_PROG_CPP
129132
AC_USE_SYSTEM_EXTENSIONS
130133
AC_PROG_LN_S
@@ -135,17 +138,6 @@ AS_VAR_IF([cross_compiling], [yes],
135138
AC_MSG_RESULT([$BUILD_CC])],
136139
[BUILD_CC=$CC])
137140

138-
dnl The macro AC_PROG_CC_C99 sets the shell variable ac_cv_prog_cc_c99 to 'no'
139-
dnl if the compiler does not support C99.i.e. does not support any of _Bool,
140-
dnl flexible arrays, inline, long long int, mixed code and declarations,
141-
dnl named initialization of structs, restrict, varargs macros, variable
142-
dnl declarations in for loops and variable length arrays.
143-
dnl
144-
dnl https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
145-
if test "$ac_cv_prog_cc_c99" = no; then
146-
AC_MSG_ERROR([C compiler would not accept C99 code])
147-
fi
148-
149141
dnl Support systems with system libraries in e.g. /usr/lib64.
150142
PHP_ARG_WITH([libdir],
151143
[for system library directory],
@@ -377,7 +369,7 @@ dnl Then headers.
377369
dnl ----------------------------------------------------------------------------
378370

379371
dnl QNX requires unix.h to allow functions in libunix to work properly.
380-
AC_CHECK_HEADERS(m4_normalize([
372+
AC_CHECK_HEADERS([
381373
dirent.h
382374
sys/param.h
383375
sys/types.h
@@ -425,7 +417,7 @@ AC_CHECK_HEADERS(m4_normalize([
425417
nmmintrin.h
426418
wmmintrin.h
427419
immintrin.h
428-
]),,, [dnl
420+
],,, [dnl
429421
#ifdef HAVE_SYS_PARAM_H
430422
#include <sys/param.h>
431423
#endif
@@ -448,8 +440,6 @@ PHP_BROKEN_GETCWD
448440
AS_VAR_IF([GCC], [yes], [PHP_BROKEN_GCC_STRLEN_OPT])
449441

450442
dnl Detect the headers required to use makedev, major, and minor.
451-
dnl Autoconf <= 2.69 didn't check glibc 2.25 deprecated macros in sys/types.h.
452-
m4_version_prereq([2.70],,[ac_cv_header_sys_types_h_makedev=no])
453443
AC_HEADER_MAJOR
454444

455445
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -542,7 +532,7 @@ PHP_CHECK_VARIABLE_ATTRIBUTE([aligned])
542532
dnl Checks for library functions.
543533
dnl ----------------------------------------------------------------------------
544534

545-
AC_CHECK_FUNCS(m4_normalize([
535+
AC_CHECK_FUNCS([
546536
alphasort
547537
asctime_r
548538
asprintf
@@ -603,7 +593,7 @@ AC_CHECK_FUNCS(m4_normalize([
603593
usleep
604594
utime
605595
vasprintf
606-
]))
596+
])
607597

608598
PHP_ARG_ENABLE([system-glob],
609599
[whether to use the system glob function],

ext/ldap/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ if test "$PHP_LDAP" != "no"; then
132132

133133
dnl Solaris 2.8 claims to be 2004 API, but doesn't have ldap_parse_reference()
134134
dnl nor ldap_start_tls_s()
135-
AC_CHECK_FUNCS(m4_normalize([
135+
AC_CHECK_FUNCS([
136136
ldap_control_find
137137
ldap_extended_operation
138138
ldap_extended_operation_s
@@ -143,7 +143,7 @@ if test "$PHP_LDAP" != "no"; then
143143
ldap_refresh_s
144144
ldap_start_tls_s
145145
ldap_whoami_s
146-
]))
146+
])
147147

148148
dnl Sanity check
149149
AC_CHECK_FUNC([ldap_sasl_bind_s],,

ext/pcntl/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if test "$PHP_PCNTL" != "no"; then
99
[AC_MSG_FAILURE([ext/pcntl: required function $function() not found.])])
1010
done
1111

12-
AC_CHECK_FUNCS(m4_normalize([
12+
AC_CHECK_FUNCS([
1313
forkx
1414
getcpuid
1515
getpriority
@@ -26,7 +26,7 @@ if test "$PHP_PCNTL" != "no"; then
2626
waitid
2727
wait6
2828
syscall
29-
]))
29+
])
3030

3131
AC_CHECK_FUNCS([WIFCONTINUED],,
3232
[AC_CHECK_DECL([WIFCONTINUED], [AC_DEFINE([HAVE_WIFCONTINUED], [1])],,

ext/posix/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if test "$PHP_POSIX" = "yes"; then
1212
[$ext_shared],,
1313
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
1414

15-
AC_CHECK_FUNCS(m4_normalize([
15+
AC_CHECK_FUNCS([
1616
ctermid
1717
eaccess
1818
getgrgid_r
@@ -28,7 +28,7 @@ if test "$PHP_POSIX" = "yes"; then
2828
seteuid
2929
setrlimit
3030
setsid
31-
]))
31+
])
3232

3333
dnl Check for makedev. If it's defined as a macro, AC_CHECK_FUNCS won't work.
3434
dnl Required headers are included by the AC_HEADER_MAJOR logic.

scripts/phpize.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ m4_include([build/php_cxx_compile_stdcxx.m4])
1515
m4_include([build/php.m4])
1616
m4_include([build/pkg.m4])
1717

18-
AC_PREREQ([2.68])
18+
AC_PREREQ([2.71])
1919
AC_INIT
2020
AC_CONFIG_SRCDIR([config.m4])
2121
AC_CONFIG_AUX_DIR([build])
@@ -36,6 +36,11 @@ PHP_INIT_BUILD_SYSTEM
3636

3737
PKG_PROG_PKG_CONFIG
3838
AC_PROG_CC([cc gcc])
39+
40+
dnl Check if C compiler accepts C11.
41+
AS_CASE([$ac_prog_cc_stdc], [c99|c89|no],
42+
[AC_MSG_ERROR([C compiler would not accept C11 code.])])
43+
3944
PHP_DETECT_ICC
4045
PHP_DETECT_SUNCC
4146

0 commit comments

Comments
 (0)