From eb76a830081c1f86c8af3a94ca9026fdae0f7335 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 11 Feb 2024 22:14:46 +0100 Subject: [PATCH] Remove PHP atomic includes and PHP_DEFINE M4 macro (#13372) PHP_DEFINE was introduced with the PHP 5 build system 9d9d39a0de3bec962c343051011f5a2ed7d7b242 and then refactored via 350de12bc24472ccf20ff9a8b39a6da0185c070d. This was once used to put defined constants into a single file to have more fine-graned dependencies (atomic includes). Since no known PHP extension is using this and it makes very little sense to use this, this M4 macro can be removed in favor of the Autoconf native way using AC_DEFINE and the usual included files php_config.h and config.h. - Generated unused include directory removed - Remove include dir from DEFS - Remove also include dir from PDO checks --- .gitignore | 1 - UPGRADING.INTERNALS | 1 + build/Makefile.global | 3 +-- build/php.m4 | 17 +---------------- configure.ac | 2 +- docs/unix-build-system.md | 2 -- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 52cfc579366..cf11cd0ac20 100644 --- a/.gitignore +++ b/.gitignore @@ -79,7 +79,6 @@ Makefile.fragments Makefile.objects # Directories for shared object files and headers generated by `./configure` -include/ libs/ modules/ diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index d393e66a4a0..3cbeb7af4d4 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -63,6 +63,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES - Symbol DARWIN has been removed (use __APPLE__ to target Darwin systems). - Symbol MISSING_FCLOSE_DECL and M4 macro PHP_MISSING_FCLOSE_DECL removed. - Symbol HAVE_BSD_ICONV has been removed. + - M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h). c. Windows build system changes - The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have diff --git a/build/Makefile.global b/build/Makefile.global index fe7d6a2cb0a..8fa7ecb109d 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -2,7 +2,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p INSTALL = $(top_srcdir)/build/shtool install -c INSTALL_DATA = $(INSTALL) -m 644 -DEFS = -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) +DEFS = -I$(top_builddir)/main -I$(top_srcdir) COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) all: $(all_targets) @@ -135,7 +135,6 @@ distclean: clean if test "$(srcdir)" != "$(builddir)"; then \ rm -f ext/phar/phar/phar.inc; \ fi - $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f prof-gen: CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-generate all diff --git a/build/php.m4 b/build/php.m4 index a6707abed45..e7f9e55a380 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -69,15 +69,6 @@ AC_DEFUN([PHP_EXPAND_PATH],[ fi ]) -dnl -dnl PHP_DEFINE(WHAT [, value[, directory]]) -dnl -dnl Creates builddir/include/what.h and in there #define WHAT value. -dnl -AC_DEFUN([PHP_DEFINE],[ - [echo "#define ]$1[]ifelse([$2],,[ 1],[ $2])[" > ]ifelse([$3],,[include],[$3])[/php_]translit($1,A-Z,a-z)[.h] -]) - dnl dnl PHP_SUBST(varname) dnl @@ -135,12 +126,8 @@ dnl Creates build directories and Makefile placeholders. dnl AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl -test -d include || $php_shtool mkdir include > Makefile.objects > Makefile.fragments -dnl We need to play tricks here to avoid matching the grep line itself. -pattern=define -$EGREP $pattern'.*include/php' $srcdir/configure|$SED 's/.*>//'|xargs touch 2>/dev/null ]) dnl @@ -2115,9 +2102,7 @@ dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) dnl AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [ - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then + if test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then pdo_cv_inc_path=$abs_srcdir/ext elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then pdo_cv_inc_path=$phpincludedir/ext diff --git a/configure.ac b/configure.ac index 410c0168906..70334bf55ee 100644 --- a/configure.ac +++ b/configure.ac @@ -1692,7 +1692,7 @@ PHP_SUBST(all_targets) PHP_SUBST(install_targets) PHP_SUBST(install_binary_targets) -PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/]) +PHP_INSTALL_HEADERS([Zend/ TSRM/ main/ main/streams/]) PHP_INSTALL_HEADERS([Zend/Optimizer], [ \ zend_call_graph.h \ zend_cfg.h \ diff --git a/docs/unix-build-system.md b/docs/unix-build-system.md index 4df945a62b0..f1d0b45e344 100644 --- a/docs/unix-build-system.md +++ b/docs/unix-build-system.md @@ -7,8 +7,6 @@ especially noticeable on slower systems * slow recursive make replaced with one global Makefile * eases integration of proper dependencies -* adds PHP_DEFINE(what[, value]) which creates a single include-file per what. - This will allow more fine-grained dependencies. * abandoning the "one library per directory" concept * improved integration of the CLI * several new targets: