Skip to content

Commit aa80bd6

Browse files
committed
Require Autoconf 2.70 or newer
Autoconf versions 2.70 started supporting C11 standards. 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. - Removed ac_cv_header_sys_types_h_makedev hack for AC_HEADER_MAJOR macro when using Autoconf versions prior to 2.70. This also enables using --runstatedir configure option in the future.
1 parent 52e9436 commit aa80bd6

File tree

7 files changed

+25
-31
lines changed

7 files changed

+25
-31
lines changed

UPGRADING.INTERNALS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ PHP 8.6 INTERNALS UPGRADE NOTES
7575
2. Build system changes
7676
========================
7777

78+
- Abstract:
7879
. build/gen_stub.php may now generate a _decl.h file in addition to
7980
the _arginfo.h file, if the stub declares enums and is annotated with
8081
@generate-c-enums. For each enum the file will contain a C enum. Enum values
8182
can be compared to the result of zend_enum_fetch_case_id(zend_object*).
8283

84+
- Unix build system changes:
85+
. Autoconf minimum required version upgraded to 2.70.
86+
8387
========================
8488
3. Module changes
8589
========================

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: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ m4_include([Zend/Zend.m4])
1616
dnl Basic autoconf initialization, generation of config.nice.
1717
dnl ----------------------------------------------------------------------------
1818

19-
AC_PREREQ([2.68])
19+
AC_PREREQ([2.70])
2020
AC_INIT([PHP],[8.6.0-dev],[https://github.com/php/php-src/issues],[php],[https://www.php.net])
2121
AC_CONFIG_SRCDIR([main/php_version.h])
2222
AC_CONFIG_AUX_DIR([build])
@@ -113,11 +113,14 @@ dnl ----------------------------------------------------------------------------
113113

114114
PKG_PROG_PKG_CONFIG
115115
AC_PROG_CC([cc gcc])
116+
117+
dnl Check if C compiler accepts C11.
118+
AS_CASE([$ac_prog_cc_stdc], [c99|c89|no],
119+
[AC_MSG_ERROR([C compiler would not accept C11 code.])])
120+
116121
PHP_DETECT_ICC
117122
PHP_DETECT_SUNCC
118123

119-
dnl AC_PROG_CC_C99 is obsolete with autoconf >= 2.70 yet necessary for <= 2.69.
120-
m4_version_prereq([2.70],,[AC_PROG_CC_C99])
121124
AC_PROG_CPP
122125
AC_USE_SYSTEM_EXTENSIONS
123126
AC_PROG_LN_S
@@ -128,17 +131,6 @@ AS_VAR_IF([cross_compiling], [yes],
128131
AC_MSG_RESULT([$BUILD_CC])],
129132
[BUILD_CC=$CC])
130133

131-
dnl The macro AC_PROG_CC_C99 sets the shell variable ac_cv_prog_cc_c99 to 'no'
132-
dnl if the compiler does not support C99.i.e. does not support any of _Bool,
133-
dnl flexible arrays, inline, long long int, mixed code and declarations,
134-
dnl named initialization of structs, restrict, varargs macros, variable
135-
dnl declarations in for loops and variable length arrays.
136-
dnl
137-
dnl https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
138-
if test "$ac_cv_prog_cc_c99" = no; then
139-
AC_MSG_ERROR([C compiler would not accept C99 code])
140-
fi
141-
142134
dnl Support systems with system libraries in e.g. /usr/lib64.
143135
PHP_ARG_WITH([libdir],
144136
[for system library directory],
@@ -370,7 +362,7 @@ dnl Then headers.
370362
dnl ----------------------------------------------------------------------------
371363

372364
dnl QNX requires unix.h to allow functions in libunix to work properly.
373-
AC_CHECK_HEADERS(m4_normalize([
365+
AC_CHECK_HEADERS([
374366
dirent.h
375367
sys/param.h
376368
sys/types.h
@@ -418,7 +410,7 @@ AC_CHECK_HEADERS(m4_normalize([
418410
nmmintrin.h
419411
wmmintrin.h
420412
immintrin.h
421-
]),,, [dnl
413+
],,, [dnl
422414
#ifdef HAVE_SYS_PARAM_H
423415
#include <sys/param.h>
424416
#endif
@@ -441,8 +433,6 @@ PHP_BROKEN_GETCWD
441433
AS_VAR_IF([GCC], [yes], [PHP_BROKEN_GCC_STRLEN_OPT])
442434

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

448438
dnl Checks for typedefs, structures, and compiler characteristics.
@@ -535,7 +525,7 @@ PHP_CHECK_VARIABLE_ATTRIBUTE([aligned])
535525
dnl Checks for library functions.
536526
dnl ----------------------------------------------------------------------------
537527

538-
AC_CHECK_FUNCS(m4_normalize([
528+
AC_CHECK_FUNCS([
539529
alphasort
540530
asctime_r
541531
asprintf
@@ -596,7 +586,7 @@ AC_CHECK_FUNCS(m4_normalize([
596586
usleep
597587
utime
598588
vasprintf
599-
]))
589+
])
600590

601591
PHP_ARG_ENABLE([system-glob],
602592
[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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ m4_include([build/php_cxx_compile_stdcxx.m4])
99
m4_include([build/php.m4])
1010
m4_include([build/pkg.m4])
1111

12-
AC_PREREQ([2.68])
12+
AC_PREREQ([2.70])
1313
AC_INIT
1414
AC_CONFIG_SRCDIR([config.m4])
1515
AC_CONFIG_AUX_DIR([build])

0 commit comments

Comments
 (0)