Skip to content

Commit 4f07cdc

Browse files
authored
Replace PHP_OUTPUT with AC_CONFIG_FILES (#15186)
This is a follow-up of GH-15177 (c96f08a) and GH-15185 (9467ffb) 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.
1 parent 16d9bd0 commit 4f07cdc

File tree

8 files changed

+24
-26
lines changed

8 files changed

+24
-26
lines changed

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
174174
- M4 macro PHP_SETUP_LIBXML doesn't define the redundant HAVE_LIBXML symbol
175175
anymore.
176176
- M4 macro PHP_SETUP_ICONV doesn't define the HAVE_ICONV symbol anymore.
177+
- M4 macro PHP_OUTPUT is obsolete (use AC_CONFIG_FILES).
177178
- TSRM/tsrm.m4 file and its TSRM_CHECK_PTHREADS M4 macro have been removed.
178179
- Added pkg-config support to find libpq for the pdo_pgsql and pgsql
179180
extensions. The libpq paths can be customized with the PGSQL_CFLAGS and

build/php.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ dnl
9494
dnl PHP_OUTPUT(file)
9595
dnl
9696
dnl Adds "file" to the list of files generated by AC_OUTPUT. This macro can be
97-
dnl used several times.
97+
dnl used several times. This macro is obsolete as of PHP 8.4 in favor of the
98+
dnl default AC_CONFIG_FILES.
9899
dnl
99100
AC_DEFUN([PHP_OUTPUT],
100-
[AS_VAR_APPEND([PHP_OUTPUT_FILES], [" m4_normalize([$1])"])])
101+
[m4_warn([obsolete], [The macro 'PHP_OUTPUT' is obsolete. Use AC_CONFIG_FILES.])
102+
AC_CONFIG_FILES([$1])])
101103

102104
dnl ----------------------------------------------------------------------------
103105
dnl Build system base macros.

configure.ac

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,13 +1829,13 @@ PHP_ADD_BUILD_DIR(m4_normalize([
18291829
Zend/Optimizer
18301830
]))
18311831

1832-
ALL_OUTPUT_FILES="main/build-defs.h \
1833-
scripts/phpize scripts/man1/phpize.1 \
1834-
scripts/php-config scripts/man1/php-config.1 \
1835-
$PHP_OUTPUT_FILES"
1836-
1837-
dnl Generate build files.
1838-
AC_CONFIG_FILES([$ALL_OUTPUT_FILES])
1832+
AC_CONFIG_FILES([
1833+
main/build-defs.h
1834+
scripts/man1/php-config.1
1835+
scripts/man1/phpize.1
1836+
scripts/php-config
1837+
scripts/phpize
1838+
])
18391839

18401840
AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([main/php_config.h.in])])
18411841

@@ -1855,24 +1855,16 @@ Thank you for using PHP.
18551855
18561856
X
18571857
],[
1858-
1859-
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
1860-
REDO_ALL=yes
1861-
fi
1862-
18631858
dnl Create configuration headers.
18641859
dnl ----------------------------------------------------------------------------
18651860
cat >Zend/zend_config.h <<FEO
18661861
#include <../main/php_config.h>
18671862
FEO
18681863
1869-
dnl Run this only when generating all the files.
1870-
if test -n "\$REDO_ALL"; then
1871-
echo "creating main/internal_functions.c"
1872-
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
1864+
echo "creating main/internal_functions.c"
1865+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
18731866
1874-
echo "creating main/internal_functions_cli.c"
1875-
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
1876-
fi
1867+
echo "creating main/internal_functions_cli.c"
1868+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
18771869
])
18781870
AC_OUTPUT

ext/phar/config.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ if test "$PHP_PHAR" != "no"; then
3535

3636
PHP_INSTALL_HEADERS([ext/phar], [php_phar.h])
3737

38-
PHP_OUTPUT([ext/phar/phar.1 ext/phar/phar.phar.1])
38+
AC_CONFIG_FILES([
39+
$ext_dir/phar.1
40+
$ext_dir/phar.phar.1
41+
])
3942
fi

sapi/cgi/config9.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ if test "$PHP_CGI" != "no"; then
5858
PHP_SUBST([SAPI_CGI_PATH])
5959
PHP_SUBST([BUILD_CGI])
6060

61-
PHP_OUTPUT([sapi/cgi/php-cgi.1])
61+
AC_CONFIG_FILES([sapi/cgi/php-cgi.1])
6262
fi

sapi/cli/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if test "$PHP_CLI" != "no"; then
5555
PHP_SUBST([SAPI_CLI_PATH])
5656
PHP_SUBST([BUILD_CLI])
5757

58-
PHP_OUTPUT([sapi/cli/php.1])
58+
AC_CONFIG_FILES([sapi/cli/php.1])
5959

6060
PHP_INSTALL_HEADERS([sapi/cli], [cli.h])
6161
fi

sapi/fpm/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ if test "$PHP_FPM" != "no"; then
508508

509509
PHP_ADD_BUILD_DIR([sapi/fpm/fpm])
510510
PHP_ADD_BUILD_DIR([sapi/fpm/fpm/events])
511-
PHP_OUTPUT([
511+
AC_CONFIG_FILES([
512512
sapi/fpm/init.d.php-fpm
513513
sapi/fpm/php-fpm.8
514514
sapi/fpm/php-fpm.conf

sapi/phpdbg/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ if test "$PHP_PHPDBG" != "no"; then
102102
PHP_SUBST([BUILD_PHPDBG])
103103
PHP_SUBST([BUILD_PHPDBG_SHARED])
104104

105-
PHP_OUTPUT([sapi/phpdbg/phpdbg.1])
105+
AC_CONFIG_FILES([sapi/phpdbg/phpdbg.1])
106106
fi

0 commit comments

Comments
 (0)