From 3ac9e5db2b1fa344c22a1f3d87e4b9677a41a76c Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 20 Mar 2024 08:06:28 +0100 Subject: [PATCH 1/2] Create modules directory in a centralized location 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). --- build/php.m4 | 12 ++++++++++++ configure.ac | 6 ------ scripts/phpize.m4 | 7 ------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/build/php.m4 b/build/php.m4 index 7422469835958..03e411c80828d 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -128,6 +128,16 @@ 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 +dnl Directory for storing shared objects of extensions. +PHP_ADD_BUILD_DIR([modules])dnl +phplibdir="$(pwd)/modules" +PHP_SUBST([phplibdir])dnl +dnl Create build directories and generate global Makefile. +PHP_GEN_BUILD_DIRS[]dnl +PHP_GEN_GLOBAL_MAKEFILE[]dnl +])dnl ]) dnl @@ -136,6 +146,7 @@ dnl dnl Generates the global makefile. dnl AC_DEFUN([PHP_GEN_GLOBAL_MAKEFILE],[ + AC_MSG_NOTICE([creating Makefile]) cat >Makefile < Date: Thu, 21 Mar 2024 13:59:26 +0100 Subject: [PATCH 2/2] [skip ci] Remove redunant dnl and comments --- build/php.m4 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build/php.m4 b/build/php.m4 index 03e411c80828d..dd1a4a7b51885 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -129,14 +129,13 @@ 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 -dnl Directory for storing shared objects of extensions. -PHP_ADD_BUILD_DIR([modules])dnl +AC_CONFIG_COMMANDS_PRE( +[dnl Directory for storing shared objects of extensions. +PHP_ADD_BUILD_DIR([modules]) phplibdir="$(pwd)/modules" -PHP_SUBST([phplibdir])dnl -dnl Create build directories and generate global Makefile. -PHP_GEN_BUILD_DIRS[]dnl -PHP_GEN_GLOBAL_MAKEFILE[]dnl +PHP_SUBST([phplibdir]) +PHP_GEN_BUILD_DIRS +PHP_GEN_GLOBAL_MAKEFILE ])dnl ])