Skip to content

Commit 413f2cd

Browse files
authored
Refactor root build directories (#13785)
This adds all root build directories in one call. PEAR directory is created only when enabled and duplicated Zend directory creation is removed, because it was intended for the zend_config.h when building out-of-source or using the config.status manually before the PHP_ADD_BUILD_DIR was introduced in the build system.
1 parent f00e05e commit 413f2cd

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

build/php.m4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,11 @@ AC_DEFUN([PHP_SELECT_SAPI],[
877877
])
878878

879879
dnl
880-
dnl PHP_ADD_BUILD_DIR
880+
dnl PHP_ADD_BUILD_DIR(dirs [, create])
881+
dnl
882+
dnl Add build directories and directories required for the out-of-source builds.
883+
dnl When "create" is given, the provided "dirs" are created immediately upon
884+
dnl macro invocation, instead of deferring it to the PHP_GEN_BUILD_DIRS.
881885
dnl
882886
AC_DEFUN([PHP_ADD_BUILD_DIR],[
883887
ifelse($2,,[

configure.ac

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,7 @@ if test "$PHP_PEAR" != "no"; then
12281228
esac
12291229
fi
12301230

1231+
PHP_ADD_BUILD_DIR([pear])
12311232
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
12321233
fi
12331234

@@ -1747,19 +1748,21 @@ PHP_ADD_SOURCES(Zend, \
17471748
Optimizer/zend_dump.c \
17481749
, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
17491750

1750-
PHP_ADD_BUILD_DIR(main main/streams)
1751-
PHP_ADD_BUILD_DIR(TSRM)
1752-
PHP_ADD_BUILD_DIR(Zend Zend/asm Zend/Optimizer)
1753-
17541751
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts)
17551752
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Zend/Makefile.frag,$abs_srcdir/Zend,Zend)
17561753

17571754
AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
17581755

1759-
dnl Make directories when building in a separate build directory.
1760-
$php_shtool mkdir -p pear
1761-
$php_shtool mkdir -p scripts
1762-
$php_shtool mkdir -p scripts/man1
1756+
PHP_ADD_BUILD_DIR([m4_normalize([
1757+
main
1758+
main/streams
1759+
scripts
1760+
scripts/man1
1761+
TSRM
1762+
Zend
1763+
Zend/asm
1764+
Zend/Optimizer
1765+
])])
17631766

17641767
ALL_OUTPUT_FILES="main/build-defs.h \
17651768
scripts/phpize scripts/man1/phpize.1 \
@@ -1794,8 +1797,6 @@ fi
17941797
17951798
dnl Create configuration headers.
17961799
dnl ----------------------------------------------------------------------------
1797-
test -d Zend || $php_shtool mkdir Zend
1798-
17991800
cat >Zend/zend_config.h <<FEO
18001801
#include <../main/php_config.h>
18011802
FEO

0 commit comments

Comments
 (0)