[php-src] master: Create modules directory in a centralized location (#13411)

From: Date: Thu, 21 Mar 2024 16:43:54 +0000
Subject: [php-src] master: Create modules directory in a centralized location (#13411)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-127819@lists.php.net to get a copy of this message
Author: Peter Kokot (petk) Committer: GitHub (web-flow) Pusher: petk Date: 2024-03-21T17:43:49+01:00 Commit: https://github.com/php/php-src/commit/530e0d68ebee5b21ad10311115c392072b8b4168 Raw diff: https://github.com/php/php-src/commit/530e0d68ebee5b21ad10311115c392072b8b4168.diff Create modules directory in a centralized location (#13411) Shared objects of extensions during the *nix build are copied to the modules directory. It is a practice established since the early days of the PHP build system. Other build systems may have similar concept of "library destination directory". On Windows, they are put into the root build directory. Such directory simplifies collection of the shared extensions during testing, or when running the cli executable at the end of the build process. This change ensures that the directory is consistently created in a single location, for both the primary PHP build process and when utilizing phpize within community extensions. The AC_CONFIG_COMMANDS_PRE is executed at the end of the configuration phase, before creating the config.status script, where also build directories and global Makefile are created. The pwd is executed using the recommended $(...) instead of the obsolete backticks. Autoconf automatically locates the proper shell and re-executes the configure script if such case is found that $(...) is not supported (the initial /bin/sh on Solaris 10, for example). Changed paths: M build/php.m4 M configure.ac M scripts/phpize.m4 Diff: diff --git a/build/php.m4 b/build/php.m4 index 7422469835958..dd1a4a7b51885 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -128,6 +128,15 @@ AC_DEFUN([PHP_INIT_BUILD_SYSTEM],[ AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl > Makefile.objects > Makefile.fragments +dnl Run at the end of the configuration, before creating the config.status. +AC_CONFIG_COMMANDS_PRE( +[dnl Directory for storing shared objects of extensions. +PHP_ADD_BUILD_DIR([modules]) +phplibdir="$(pwd)/modules" +PHP_SUBST([phplibdir]) +PHP_GEN_BUILD_DIRS +PHP_GEN_GLOBAL_MAKEFILE +])dnl ]) dnl @@ -136,6 +145,7 @@ dnl dnl Generates the global makefile. dnl AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[ + AC_MSG_NOTICE([creating Makefile]) cat >Makefile <<EOF srcdir = $abs_srcdir builddir = $abs_builddir @@ -881,6 +891,7 @@ dnl dnl PHP_GEN_BUILD_DIRS dnl AC_DEFUN([PHP_GEN_BUILD_DIRS],[ + AC_MSG_NOTICE([creating build directories]) $php_shtool mkdir -p $BUILD_DIR ]) diff --git a/configure.ac b/configure.ac index efd5aff48751d..1e6e28af798fb 100644 --- a/configure.ac +++ b/configure.ac @@ -1380,8 +1380,6 @@ case eval echo $datadir in ;; esac -phplibdir=pwd/modules -$php_shtool mkdir -p $phplibdir phptempdir=pwd/libs old_exec_prefix=$exec_prefix @@ -1508,7 +1506,6 @@ PHP_SUBST_OLD(program_suffix) PHP_SUBST(includedir) PHP_SUBST(libdir) PHP_SUBST(mandir) -PHP_SUBST(phplibdir) PHP_SUBST(phptempdir) PHP_SUBST(prefix) PHP_SUBST(localstatedir) @@ -1750,9 +1747,6 @@ PHP_ADD_BUILD_DIR(Zend Zend/asm Zend/Optimizer) PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts) PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Zend/Makefile.frag,$abs_srcdir/Zend,Zend) -PHP_GEN_BUILD_DIRS -PHP_GEN_GLOBAL_MAKEFILE - AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ]) dnl Make directories when building in a separate build directory. diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 index ca75c41642dfe..468771de7a6f8 100644 --- a/scripts/phpize.m4 +++ b/scripts/phpize.m4 @@ -162,7 +162,6 @@ AC_PROG_LIBTOOL all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)' install_targets="install-modules install-headers" -phplibdir="pwd/modules" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" CFLAGS_CLEAN='$(CFLAGS) -D_GNU_SOURCE' CXXFLAGS_CLEAN='$(CXXFLAGS)' @@ -188,7 +187,6 @@ PHP_SUBST(prefix) PHP_SUBST(exec_prefix) PHP_SUBST(libdir) PHP_SUBST(prefix) -PHP_SUBST(phplibdir) PHP_SUBST(phpincludedir) PHP_SUBST(CC) @@ -210,11 +208,6 @@ PHP_SUBST(SHELL) PHP_SUBST(INSTALL_HEADERS) PHP_SUBST(BUILD_CC) -PHP_GEN_BUILD_DIRS -PHP_GEN_GLOBAL_MAKEFILE - -test -d modules || $php_shtool mkdir modules - AC_CONFIG_HEADERS([config.h]) AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([config.h.in])])

« previous php.cvs (#127819) next »