Replace PHP_OUTPUT with AC_CONFIG_FILES (#15186)

This is a follow-up of GH-15177
(c96f08aa70)
and GH-15185
(9467ffb43c)

The PHP_OUTPUT macro was introduced in the very early phase of the build
system due to AC_OUTPUT handling issues in the old Autoconf versions
before the AC_CONFIG_FILES, AC_CONFIG_COMMANDS etc were introduced with
the AC_OUTPUT signature without arguments. The PHP_OUTPUT was also
helping Makefile.in back then being properly generated based on whether
all files were generated or only some (when using the obsolete
CONFIG_FILES=... ./config.status invocation instead of the new
./config.status --file=...). Another issue is that PHP_OUTPUT can't be
used by extensions when using phpize.

This replaces the PHP_OUTPUT invocations with default AC_CONFIG_FILES.

The obsolete "REDO_ALL" feature at the config.status invocation is also
removed with a simpler unconditional generation.

In phar extension the "ext/phar" is replaced with $ext_dir variable to
be able to use phpize.
This commit is contained in:
Peter Kokot 2024-08-03 21:52:14 +02:00 committed by GitHub
parent 16d9bd0aae
commit 4f07cdc584
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 24 additions and 26 deletions

View file

@ -174,6 +174,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
- M4 macro PHP_SETUP_LIBXML doesn't define the redundant HAVE_LIBXML symbol - M4 macro PHP_SETUP_LIBXML doesn't define the redundant HAVE_LIBXML symbol
anymore. anymore.
- M4 macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol anymore. - M4 macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol anymore.
- M4 macro PHP_OUTPUT is obsolete (use AC_CONFIG_FILES).
- TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS M4 macro have been removed. - TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS M4 macro have been removed.
- Added pkg-config support to find libpq for the pdo_pgsql and pgsql - Added pkg-config support to find libpq for the pdo_pgsql and pgsql
extensions. The libpq paths can be customized with the PGSQL_CFLAGS and extensions. The libpq paths can be customized with the PGSQL_CFLAGS and

View file

@ -94,10 +94,12 @@ dnl
dnl PHP_OUTPUT(file) dnl PHP_OUTPUT(file)
dnl dnl
dnl Adds "file" to the list of files generated by AC_OUTPUT. This macro can be dnl Adds "file" to the list of files generated by AC_OUTPUT. This macro can be
dnl used several times. dnl used several times. This macro is obsolete as of PHP 8.4 in favor of the
dnl default AC_CONFIG_FILES.
dnl dnl
AC_DEFUN([PHP_OUTPUT], AC_DEFUN([PHP_OUTPUT],
[AS_VAR_APPEND([PHP_OUTPUT_FILES], [" m4_normalize([$1])"])]) [m4_warn([obsolete], [The macro 'PHP_OUTPUT' is obsolete. Use AC_CONFIG_FILES.])
AC_CONFIG_FILES([$1])])
dnl ---------------------------------------------------------------------------- dnl ----------------------------------------------------------------------------
dnl Build system base macros. dnl Build system base macros.

View file

@ -1829,13 +1829,13 @@ PHP_ADD_BUILD_DIR(m4_normalize([
Zend/Optimizer Zend/Optimizer
])) ]))
ALL_OUTPUT_FILES="main/build-defs.h \ AC_CONFIG_FILES([
scripts/phpize scripts/man1/phpize.1 \ main/build-defs.h
scripts/php-config scripts/man1/php-config.1 \ scripts/man1/php-config.1
$PHP_OUTPUT_FILES" scripts/man1/phpize.1
scripts/php-config
dnl Generate build files. scripts/phpize
AC_CONFIG_FILES([$ALL_OUTPUT_FILES]) ])
AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([main/php_config.h.in])]) AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([main/php_config.h.in])])
@ -1855,24 +1855,16 @@ Thank you for using PHP.
X X
],[ ],[
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
REDO_ALL=yes
fi
dnl Create configuration headers. dnl Create configuration headers.
dnl ---------------------------------------------------------------------------- dnl ----------------------------------------------------------------------------
cat >Zend/zend_config.h <<FEO cat >Zend/zend_config.h <<FEO
#include <../main/php_config.h> #include <../main/php_config.h>
FEO FEO
dnl Run this only when generating all the files.
if test -n "\$REDO_ALL"; then
echo "creating main/internal_functions.c" echo "creating main/internal_functions.c"
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
echo "creating main/internal_functions_cli.c" echo "creating main/internal_functions_cli.c"
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
fi
]) ])
AC_OUTPUT AC_OUTPUT

View file

@ -35,5 +35,8 @@ if test "$PHP_PHAR" != "no"; then
PHP_INSTALL_HEADERS([ext/phar], [php_phar.h]) PHP_INSTALL_HEADERS([ext/phar], [php_phar.h])
PHP_OUTPUT([ext/phar/phar.1 ext/phar/phar.phar.1]) AC_CONFIG_FILES([
$ext_dir/phar.1
$ext_dir/phar.phar.1
])
fi fi

View file

@ -58,5 +58,5 @@ if test "$PHP_CGI" != "no"; then
PHP_SUBST([SAPI_CGI_PATH]) PHP_SUBST([SAPI_CGI_PATH])
PHP_SUBST([BUILD_CGI]) PHP_SUBST([BUILD_CGI])
PHP_OUTPUT([sapi/cgi/php-cgi.1]) AC_CONFIG_FILES([sapi/cgi/php-cgi.1])
fi fi

View file

@ -55,7 +55,7 @@ if test "$PHP_CLI" != "no"; then
PHP_SUBST([SAPI_CLI_PATH]) PHP_SUBST([SAPI_CLI_PATH])
PHP_SUBST([BUILD_CLI]) PHP_SUBST([BUILD_CLI])
PHP_OUTPUT([sapi/cli/php.1]) AC_CONFIG_FILES([sapi/cli/php.1])
PHP_INSTALL_HEADERS([sapi/cli], [cli.h]) PHP_INSTALL_HEADERS([sapi/cli], [cli.h])
fi fi

View file

@ -508,7 +508,7 @@ if test "$PHP_FPM" != "no"; then
PHP_ADD_BUILD_DIR([sapi/fpm/fpm]) PHP_ADD_BUILD_DIR([sapi/fpm/fpm])
PHP_ADD_BUILD_DIR([sapi/fpm/fpm/events]) PHP_ADD_BUILD_DIR([sapi/fpm/fpm/events])
PHP_OUTPUT([ AC_CONFIG_FILES([
sapi/fpm/init.d.php-fpm sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.8 sapi/fpm/php-fpm.8
sapi/fpm/php-fpm.conf sapi/fpm/php-fpm.conf

View file

@ -102,5 +102,5 @@ if test "$PHP_PHPDBG" != "no"; then
PHP_SUBST([BUILD_PHPDBG]) PHP_SUBST([BUILD_PHPDBG])
PHP_SUBST([BUILD_PHPDBG_SHARED]) PHP_SUBST([BUILD_PHPDBG_SHARED])
PHP_OUTPUT([sapi/phpdbg/phpdbg.1]) AC_CONFIG_FILES([sapi/phpdbg/phpdbg.1])
fi fi