Skip to content

Require Autoconf 2.71 or newer#21159

Open
petk wants to merge 1 commit intophp:masterfrom
petk:patch-autoconf-version
Open

Require Autoconf 2.71 or newer#21159
petk wants to merge 1 commit intophp:masterfrom
petk:patch-autoconf-version

Conversation

@petk
Copy link
Member

@petk petk commented Feb 7, 2026

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.

This also enables using --runstatedir configure option in the future.

@petk petk requested a review from devnexen as a code owner February 7, 2026 16:38
@petk petk force-pushed the patch-autoconf-version branch 3 times, most recently from aa80bd6 to 10f3dff Compare February 9, 2026 13:16
@petk petk changed the title Require Autoconf 2.70 or newer Require Autoconf 2.71 or newer Feb 9, 2026
@petk
Copy link
Member Author

petk commented Feb 9, 2026

Updating it to 2.71 instead since 2.71 was released only one month after 2.70 and it includes some important bug fixes.

Edit: If anyone would like to review this, more than welcome. I've added for now only those that have changed build system files semi-recently...

@NattyNarwhal
Copy link
Member

Seems to work fine on macOS/arm and linux/ppc64. Testing this PR on AIX (had to upgrade from 2.69...) and it seems OK so far, but builds are pretty slow on that system.

@petk petk force-pushed the patch-autoconf-version branch from 10f3dff to 27e3ee6 Compare February 10, 2026 15:24
@petk
Copy link
Member Author

petk commented Feb 10, 2026

had to upgrade from 2.69...

Yes, I'm now also worried how this might affect building extensions. When building PHP extension on a system where some old Autoconf is installed by default this will cause issues. For php-src it shouldn't be so much of a problem.

I can also wait with this update for another year or two or go with two separate versions (like it was once already done in the past). Requiring 2.71 for php-src and 2.68 for extensions (in that phpize.m4 file).

I'm also rechecking all systems and their Autoconf versions...

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.

This also enables using --runstatedir configure option in the future.
@petk petk force-pushed the patch-autoconf-version branch from b5e0b07 to aa16914 Compare February 18, 2026 15:58
@petk
Copy link
Member Author

petk commented Feb 18, 2026

Added here now also C11 check in phpize because when PHP extensions use PHP headers they should also be built with some C11-compliant compiler.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong feeling regarding my comment, I'm happy either way.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No technical review, but I'm happy officially enforcing C11.

@petk
Copy link
Member Author

petk commented Mar 20, 2026

I'm just adding a note here in case Autoconf 2.71 version will be too much for some system that we're unaware at this point. Instead of this PR, the following can be done to make the C11 check working when Autoconf 2.70+ is installed but skipped if Autoconf 2.69 or lower is installed:

--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,10 @@ dnl ----------------------------------------------------------------------------
 
 PKG_PROG_PKG_CONFIG
 AC_PROG_CC([cc gcc])
+
+m4_version_prereq([2.70], [AS_CASE([$ac_prog_cc_stdc], [c99|c89|no],
+  [AC_MSG_ERROR([C compiler would not accept C11 code.])])])
+
 PHP_DETECT_ICC
 PHP_DETECT_SUNCC

However, with this, exactly those old problematic compilers are most likely used on a system, where Autoconf 2.69 is used so the user won't notice that C11 is needed then.

Edit: Or, if such case will pop up, this trick can be also used in phpize. For example: building and installing PHP with Autoconf 2.71+ but using "phpize" on the same system where default Autoconf is 2.69.

@bukka
Copy link
Member

bukka commented Mar 20, 2026

Isn't 2.69 still default on RHEL 8? If so or if it's still anywhere on any supported distro, then I'm -1 on this.

@remicollet
Copy link
Member

Isn't 2.69 still default on RHEL 8? If so or if it's still anywhere on any supported distro, then I'm -1 on this.

  • RHEL-8 has 2.69 (and CentOS, AlmaLinux, RockyLinux and other clones)
  • RHEL-9 has 2.69
  • RHEL-10 has 2.71
  • Fedora has 2.72

So, I'm also -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants