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
Copy Markdown
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.
  • Replaced AC_CONFIG_MACRO_DIR with preferred AC_CONFIG_MACRO_DIRS.

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

Current known target systems with Autoconf versions <= 2.69:

  • AIX (Autoconf 2.69)
  • RHEL 8, RHEL 9, AlmaLinux 8, RockyLinux 8: Autoconf 2.69 (some has Autoconf 2.71provided as a separate package or EPEL repository).
  • Solaris 10: Autoconf 2.69 via OpenCSW
  • Solaris 11.4: Autoconf 2.69 (updated 2.71 available as of 11.4.81 update)

Autoconf versions can be also observed at:

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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...

@petk
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@remicollet
Copy link
Copy Markdown
Member

remicollet commented Mar 21, 2026

Additional notes: EPEL-8 and EPEL-9 have an autoconf2.7x package providing autoconf/autoheader version 2.71

So, a workaround exists for users, but not for the distro itself

@TimWolla
Copy link
Copy Markdown
Member

So, a workaround exists for users, but not for the distro itself

@remicollet Will RHEL 8/9 itself even provide PHP 8.6? I suspect no? In that case find it reasonable for users who want the latest and great PHP version to also install a newer autoconf from EPEL.

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.
@petk petk force-pushed the patch-autoconf-version branch from aa16914 to 6c8768e Compare March 25, 2026 15:34
@petk
Copy link
Copy Markdown
Member Author

petk commented Mar 25, 2026

Before I forget about it: Added here also AC_CONFIG_MACRO_DIR > AC_CONFIG_MACRO_DIRS change and rebased against current master branch which includes updated libtool files.

@petk
Copy link
Copy Markdown
Member Author

petk commented Mar 25, 2026

I've added these mentioned legacy systems to the list in the PR for now to have a bit of an overview.

Overall, I think we need to be a bit more pragmatic here than just observe what is the default Autoconf version on some system. On these systems also other default versions of packages are outdated and building PHP there would require a lot of custom builds of dependencies already. And building PHP that is downloaded from php.net as a tar archive doesn't need Autoconf (configure script is there already generated). But the issue might occur when building extensions with pecl, pie or separately via phpize, which all require Autoconf installed.

Well, we can also wait with this for another year (or two). I wouldn't wait longer, for example, Solaris 11 EOL in year 2037 sounds like something unrealistic.

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