Skip to content

Commit 3dfb1b5

Browse files
committed
Autotools: Normalize 2nd arg in PHP_ADD_SOURCES_X
By using `m4_normalize(m4_expand([...]))`, the arguments can be split into newlines without using backslashes and it makes working with lists of files a bit easier. Tested: - variables inside the argument - M4 macro expansions - dnl comments - newlines, leading and trailing spaces and tabs, sequences of backslash-then-newline, multiple spaces, tabs, newlines, backslash-then-newline, empty spaces - quoted/unquoted arguments - ...
1 parent 9d25296 commit 3dfb1b5

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

build/php.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ dnl how to build .. shared or static?
239239
240240
dnl Iterate over the sources.
241241
old_IFS=[$]IFS
242-
for ac_src in $2; do
242+
for ac_src in m4_normalize(m4_expand([$2])); do
243243
244244
dnl Remove the suffix.
245245
IFS=.

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
16781678
PHP_ADD_SOURCES(/main, internal_functions.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, sapi)
16791679
PHP_ADD_SOURCES_X(/main, internal_functions_cli.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_BINARY_OBJS)
16801680

1681-
PHP_ADD_SOURCES([Zend], m4_normalize([
1681+
PHP_ADD_SOURCES([Zend], [
16821682
Optimizer/block_pass.c
16831683
Optimizer/compact_literals.c
16841684
Optimizer/compact_vars.c
@@ -1760,7 +1760,7 @@ PHP_ADD_SOURCES([Zend], m4_normalize([
17601760
zend_vm_opcodes.c
17611761
zend_weakrefs.c
17621762
zend.c
1763-
]),
1763+
],
17641764
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $fiber_asm_cflag])
17651765

17661766
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/scripts/Makefile.frag],

ext/bcmath/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PHP_ARG_ENABLE([bcmath],
44
[Enable bc style precision math functions])])
55

66
if test "$PHP_BCMATH" != "no"; then
7-
PHP_NEW_EXTENSION([bcmath], m4_normalize([
7+
PHP_NEW_EXTENSION([bcmath], [
88
bcmath.c
99
libbcmath/src/add.c
1010
libbcmath/src/compare.c
@@ -28,7 +28,7 @@ if test "$PHP_BCMATH" != "no"; then
2828
libbcmath/src/str2num.c
2929
libbcmath/src/sub.c
3030
libbcmath/src/zero.c
31-
]),
31+
],
3232
[$ext_shared],,
3333
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
3434
PHP_ADD_BUILD_DIR([$ext_builddir/libbcmath/src])

ext/dom/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if test "$PHP_DOM" != "no"; then
191191
$LEXBOR_DIR/selectors-adapted/selectors.c
192192
$LEXBOR_DIR/tag/tag.c
193193
"])
194-
PHP_NEW_EXTENSION([dom], m4_normalize([
194+
PHP_NEW_EXTENSION([dom], [
195195
attr.c
196196
cdatasection.c
197197
characterdata.c
@@ -228,7 +228,7 @@ if test "$PHP_DOM" != "no"; then
228228
xpath_callbacks.c
229229
xpath.c
230230
$LEXBOR_SOURCES
231-
]),
231+
],
232232
[$ext_shared],,
233233
[$PHP_LEXBOR_CFLAGS])
234234
PHP_ADD_BUILD_DIR(m4_normalize([

ext/mysqlnd/config9.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then
3838
PHP_SETUP_OPENSSL(MYSQLND_SHARED_LIBADD, [AC_DEFINE(MYSQLND_HAVE_SSL,1,[Enable mysqlnd code that uses OpenSSL directly])])
3939
fi
4040

41-
PHP_NEW_EXTENSION([mysqlnd], m4_normalize([
41+
PHP_NEW_EXTENSION([mysqlnd], [
4242
mysqlnd_alloc.c
4343
mysqlnd_auth.c
4444
mysqlnd_block_alloc.c
@@ -61,7 +61,7 @@ if test "$PHP_MYSQLND" != "no" || test "$PHP_MYSQLND_ENABLED" = "yes"; then
6161
mysqlnd_vio.c
6262
mysqlnd_wireprotocol.c
6363
php_mysqlnd.c
64-
]),
64+
],
6565
[$ext_shared],,
6666
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
6767

ext/standard/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ AS_VAR_IF([php_cv_func_getifaddrs], [yes],
396396
dnl
397397
dnl Setup extension sources
398398
dnl
399-
PHP_NEW_EXTENSION([standard], m4_normalize([
399+
PHP_NEW_EXTENSION([standard], [
400400
array.c
401401
assert.c
402402
base64.c
@@ -460,7 +460,7 @@ PHP_NEW_EXTENSION([standard], m4_normalize([
460460
var_unserializer.c
461461
var.c
462462
versioning.c
463-
]),,,
463+
],,,
464464
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
465465

466466
PHP_ADD_BUILD_DIR([$ext_builddir/libavifinfo])

0 commit comments

Comments
 (0)