Skip to content

Commit 7076f50

Browse files
committed
Replace PHP_OUTPUT with AC_CONFIG_FILES
This is a follow-up of phpGH-15177 (c96f08a) and phpGH-15185 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 28a7c62 commit 7076f50

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
@@ -1824,13 +1824,13 @@ PHP_ADD_BUILD_DIR(m4_normalize([
18241824
Zend/Optimizer
18251825
]))
18261826

1827-
ALL_OUTPUT_FILES="main/build-defs.h \
1828-
scripts/phpize scripts/man1/phpize.1 \
1829-
scripts/php-config scripts/man1/php-config.1 \
1830-
$PHP_OUTPUT_FILES"
1831-
1832-
dnl Generate build files.
1833-
AC_CONFIG_FILES([$ALL_OUTPUT_FILES])
1827+
AC_CONFIG_FILES([
1828+
main/build-defs.h
1829+
scripts/man1/php-config.1
1830+
scripts/man1/phpize.1
1831+
scripts/php-config
1832+
scripts/phpize
1833+
])
18341834

18351835
AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([main/php_config.h.in])])
18361836

@@ -1850,24 +1850,16 @@ Thank you for using PHP.
18501850
18511851
X
18521852
],[
1853-
1854-
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
1855-
REDO_ALL=yes
1856-
fi
1857-
18581853
dnl Create configuration headers.
18591854
dnl ----------------------------------------------------------------------------
18601855
cat >Zend/zend_config.h <<FEO
18611856
#include <../main/php_config.h>
18621857
FEO
18631858
1864-
dnl Run this only when generating all the files.
1865-
if test -n "\$REDO_ALL"; then
1866-
echo "creating main/internal_functions.c"
1867-
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
1859+
echo "creating main/internal_functions.c"
1860+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
18681861
1869-
echo "creating main/internal_functions_cli.c"
1870-
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
1871-
fi
1862+
echo "creating main/internal_functions_cli.c"
1863+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
18721864
])
18731865
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
@@ -101,5 +101,5 @@ if test "$PHP_PHPDBG" != "no"; then
101101
PHP_SUBST([BUILD_PHPDBG])
102102
PHP_SUBST([BUILD_PHPDBG_SHARED])
103103

104-
PHP_OUTPUT([sapi/phpdbg/phpdbg.1])
104+
AC_CONFIG_FILES([sapi/phpdbg/phpdbg.1])
105105
fi

0 commit comments

Comments
 (0)