Skip to content

Commit f3c48f1

Browse files
authored
Autotools: Append hash and opcache build directories (#15132)
When building in out-of-source directory, instead of creating these build directories right away, this appends them to the list and creates them at the end of configure phase. These don't need to be created immediately as no files are generated in these extensions before the configure phase is finished. Also, the PHP_ADD_BUILD_DIR is moved after the PHP_NEW_EXTENSION when the more common $ext_builddir variable is available (the ext/<extension> isn't available when building with phpize).
1 parent 1ceadae commit f3c48f1

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

ext/hash/config.m4

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if test $ac_cv_c_bigendian_php = yes; then
1212
EXT_HASH_SHA3_SOURCES="hash_sha3.c"
1313
AC_DEFINE(HAVE_SLOW_HASH3, 1, [Define if hash3 algo is available])
1414
AC_MSG_WARN([Using SHA3 slow implementation on bigendian])
15+
SHA3_DIR=
1516
else
1617
AC_CHECK_SIZEOF([long])
1718
AC_MSG_CHECKING([if we're at 64-bit platform])
@@ -30,12 +31,8 @@ else
3031
])
3132
EXT_HASH_SHA3_SOURCES="$SHA3_OPT_SRC $SHA3_DIR/KeccakHash.c $SHA3_DIR/KeccakSponge.c hash_sha3.c"
3233
PHP_HASH_CFLAGS="$PHP_HASH_CFLAGS -I@ext_srcdir@/$SHA3_DIR -DKeccakP200_excluded -DKeccakP400_excluded -DKeccakP800_excluded -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
33-
34-
PHP_ADD_BUILD_DIR([ext/hash/$SHA3_DIR], [1])
3534
fi
3635

37-
PHP_ADD_BUILD_DIR([ext/hash/murmur], [1])
38-
3936
EXT_HASH_SOURCES="hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c \
4037
hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c hash_adler32.c \
4138
hash_crc32.c hash_fnv.c hash_joaat.c $EXT_HASH_SHA3_SOURCES
@@ -47,4 +44,6 @@ EXT_HASH_HEADERS="php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h \
4744
php_hash_xxhash.h xxhash/xxhash.h"
4845

4946
PHP_NEW_EXTENSION(hash, $EXT_HASH_SOURCES, 0,,$PHP_HASH_CFLAGS)
47+
PHP_ADD_BUILD_DIR([$ext_builddir/murmur])
48+
AS_VAR_IF([SHA3_DIR],,, [PHP_ADD_BUILD_DIR([$ext_builddir/$SHA3_DIR])])
5049
PHP_INSTALL_HEADERS([ext/hash], [$EXT_HASH_HEADERS])

ext/opcache/config.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ int main(void) {
357357
fi
358358

359359
if test "$PHP_OPCACHE_JIT" = "yes"; then
360-
PHP_ADD_BUILD_DIR([$ext_builddir/jit], [1])
361-
PHP_ADD_BUILD_DIR([$ext_builddir/jit/ir], [1])
360+
PHP_ADD_BUILD_DIR([$ext_builddir/jit])
361+
PHP_ADD_BUILD_DIR([$ext_builddir/jit/ir])
362362
PHP_ADD_MAKEFILE_FRAGMENT([$ext_srcdir/jit/Makefile.frag])
363363
fi
364364
PHP_SUBST([OPCACHE_SHARED_LIBADD])

0 commit comments

Comments
 (0)