Skip to content

Commit 52f901a

Browse files
petkDavid Ellingsworth
authored and
David Ellingsworth
committed
Autotools: Normalize ext/opcache sources (php#15083)
- m4_normalize can simplify the list of source files - PHP_NEW_EXTENSION arguments quoted and excessive shell double quotes character removed (macro already adds double quotes) - Removed redundant shell variable parameter expansions - Minor Autoconf CS syncs
1 parent e4d6d0d commit 52f901a

File tree

1 file changed

+38
-24
lines changed

1 file changed

+38
-24
lines changed

ext/opcache/config.m4

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,23 @@ if test "$PHP_OPCACHE" != "no"; then
5050

5151
if test "$PHP_OPCACHE_JIT" = "yes" ; then
5252
AC_DEFINE(HAVE_JIT, 1, [Define to enable JIT])
53-
ZEND_JIT_SRC="jit/zend_jit.c jit/zend_jit_vm_helpers.c jit/ir/ir.c jit/ir/ir_strtab.c \
54-
jit/ir/ir_cfg.c jit/ir/ir_sccp.c jit/ir/ir_gcm.c jit/ir/ir_ra.c jit/ir/ir_save.c \
55-
jit/ir/ir_dump.c jit/ir/ir_gdb.c jit/ir/ir_perf.c jit/ir/ir_check.c \
56-
jit/ir/ir_patch.c jit/ir/ir_emit.c"
53+
ZEND_JIT_SRC=m4_normalize(["
54+
jit/ir/ir_cfg.c
55+
jit/ir/ir_check.c
56+
jit/ir/ir_dump.c
57+
jit/ir/ir_emit.c
58+
jit/ir/ir_gcm.c
59+
jit/ir/ir_gdb.c
60+
jit/ir/ir_patch.c
61+
jit/ir/ir_perf.c
62+
jit/ir/ir_ra.c
63+
jit/ir/ir_save.c
64+
jit/ir/ir_sccp.c
65+
jit/ir/ir_strtab.c
66+
jit/ir/ir.c
67+
jit/zend_jit_vm_helpers.c
68+
jit/zend_jit.c
69+
"])
5770

5871
dnl Find out which ABI we are using.
5972
case $host_alias in
@@ -96,10 +109,8 @@ if test "$PHP_OPCACHE" != "no"; then
96109
PHP_SUBST([DASM_FLAGS])
97110
PHP_SUBST([DASM_ARCH])
98111

99-
JIT_CFLAGS="-I@ext_builddir@/jit/ir -D${IR_TARGET} -DIR_PHP"
100-
if test "$ZEND_DEBUG" = "yes"; then
101-
JIT_CFLAGS="${JIT_CFLAGS} -DIR_DEBUG"
102-
fi
112+
JIT_CFLAGS="-I@ext_builddir@/jit/ir -D$IR_TARGET -DIR_PHP"
113+
AS_VAR_IF([ZEND_DEBUG], [yes], [JIT_CFLAGS="$JIT_CFLAGS -DIR_DEBUG"])
103114
fi
104115

105116
AC_CHECK_FUNCS([mprotect shm_create_largepage])
@@ -321,22 +332,25 @@ int main(void) {
321332
])
322333
LIBS="$LIBS_save"
323334

324-
PHP_NEW_EXTENSION(opcache,
325-
ZendAccelerator.c \
326-
zend_accelerator_blacklist.c \
327-
zend_accelerator_debug.c \
328-
zend_accelerator_hash.c \
329-
zend_accelerator_module.c \
330-
zend_persist.c \
331-
zend_persist_calc.c \
332-
zend_file_cache.c \
333-
zend_shared_alloc.c \
334-
zend_accelerator_util_funcs.c \
335-
shared_alloc_shm.c \
336-
shared_alloc_mmap.c \
337-
shared_alloc_posix.c \
338-
$ZEND_JIT_SRC,
339-
shared,,"-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 ${JIT_CFLAGS}",,yes)
335+
PHP_NEW_EXTENSION([opcache], m4_normalize([
336+
shared_alloc_mmap.c
337+
shared_alloc_posix.c
338+
shared_alloc_shm.c
339+
zend_accelerator_blacklist.c
340+
zend_accelerator_debug.c
341+
zend_accelerator_hash.c
342+
zend_accelerator_module.c
343+
zend_accelerator_util_funcs.c
344+
zend_file_cache.c
345+
zend_persist_calc.c
346+
zend_persist.c
347+
zend_shared_alloc.c
348+
ZendAccelerator.c
349+
$ZEND_JIT_SRC
350+
]),
351+
[shared],,
352+
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $JIT_CFLAGS],,
353+
[yes])
340354

341355
PHP_ADD_EXTENSION_DEP(opcache, pcre)
342356

0 commit comments

Comments
 (0)