Skip to content

Commit f26b365

Browse files
committed
Replace PHP_OUTPUT with AC_CONFIG_FILES
This is a follow-up of phpGH-15177 (c96f08a). The PHP_OUTPUT macro was introduced in the very early phase of the build system due to AC_OUTPUT handling issue in the old Autoconf versions before the AC_CONFIG_FILES and AC_CONFIG_COMMANDS were introduced and the AC_OUTPUT signature with arguments was deprecated. The PHP_OUTPUT was also helping Makefile.in back then being properly generated based on whether all files were generated or only some. Another issue is that it also can't be used by extensions when using phpize. This removes the obsolete REDO_ALL feature at the config.status call with simpler unconditional generation In phar extension the "ext/phar" is replaced with $ext_dir variable to be able to use phpize.
1 parent c96f08a commit f26b365

File tree

8 files changed

+22
-25
lines changed

8 files changed

+22
-25
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: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,12 @@ 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-
18321827
dnl Generate build files.
1833-
AC_CONFIG_FILES([$ALL_OUTPUT_FILES])
1828+
AC_CONFIG_FILES([
1829+
main/build-defs.h
1830+
scripts/phpize scripts/man1/phpize.1
1831+
scripts/php-config scripts/man1/php-config.1
1832+
])
18341833

18351834
AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([main/php_config.h.in])])
18361835

@@ -1850,24 +1849,16 @@ Thank you for using PHP.
18501849
18511850
X
18521851
],[
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-
18581852
dnl Create configuration headers.
18591853
dnl ----------------------------------------------------------------------------
18601854
cat >Zend/zend_config.h <<FEO
18611855
#include <../main/php_config.h>
18621856
FEO
18631857
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
1858+
echo "creating main/internal_functions.c"
1859+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_STATIC" > main/internal_functions.c
18681860
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
1861+
echo "creating main/internal_functions_cli.c"
1862+
AWK="$AWK" sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in "$EXT_CLI_STATIC" > main/internal_functions_cli.c
18721863
])
18731864
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)