Skip to content

Commit 6857c7c

Browse files
authored
Autotools: Expand m4_normalize sooner (#15018)
Quoted m4_normalize will expand and change its argument later in the macro call when M4 is processing the *.m4 sources. Without quotes the already normalized string is passed to the macro directly. In these specific cases generated configure script is the same. This is more for consistency to have this synced and not repeat the pattern too much in the future when copy/pasting. Note, that many AC_* macros require similar behavior already (for example, AC_CHECK_FUNCS.)
1 parent 442ae96 commit 6857c7c

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

build/php.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ AC_DEFUN([PHP_PROG_RE2C],[
17411741
esac
17421742
17431743
PHP_SUBST([RE2C])
1744-
AS_VAR_SET([RE2C_FLAGS], [m4_normalize(["$2"])])
1744+
AS_VAR_SET([RE2C_FLAGS], m4_normalize(["$2"]))
17451745
PHP_SUBST([RE2C_FLAGS])
17461746
])
17471747

@@ -1998,17 +1998,17 @@ AS_VAR_IF([found_pgsql], [yes], [dnl
19981998
PHP_EVAL_INCLINE([$PGSQL_CFLAGS])
19991999
PHP_EVAL_LIBLINE([$PGSQL_LIBS], [$1])
20002000
dnl PostgreSQL minimum version sanity check.
2001-
PHP_CHECK_LIBRARY([pq], [PQencryptPasswordConn],, [AC_MSG_ERROR([m4_normalize([
2001+
PHP_CHECK_LIBRARY([pq], [PQencryptPasswordConn],, [AC_MSG_ERROR(m4_normalize([
20022002
PostgreSQL check failed: libpq 10.0 or later is required, please see
20032003
config.log for details.
2004-
])])],
2004+
]))],
20052005
[$PGSQL_LIBS])
20062006
$2],
2007-
[m4_default([$3], [AC_MSG_ERROR([m4_normalize([
2007+
[m4_default([$3], [AC_MSG_ERROR(m4_normalize([
20082008
Cannot find libpq-fe.h or pq library (libpq). Please specify the correct
20092009
PostgreSQL installation path with environment variables PGSQL_CFLAGS and
20102010
PGSQL_LIBS or provide the PostgreSQL installation directory.
2011-
])])])])
2011+
]))])])
20122012
])
20132013

20142014
dnl ----------------------------------------------------------------------------

configure.ac

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -861,10 +861,10 @@ fi
861861

862862
AS_VAR_IF([PHP_THREAD_SAFETY], [yes], [
863863
AS_VAR_IF([pthreads_working], [yes], [],
864-
[AC_MSG_ERROR([m4_normalize([
864+
[AC_MSG_ERROR(m4_normalize([
865865
Unable to verify system support for POSIX Threads, which are required for
866866
PHP thread safety (ZTS) build.
867-
])])])
867+
]))])
868868
869869
AC_MSG_CHECKING([for POSIX threads])
870870
AC_MSG_RESULT([yes])
@@ -1170,10 +1170,10 @@ AS_VAR_IF([PHP_PEAR], [no],, [
11701170
AC_MSG_WARN([The --with-pear option is deprecated])
11711171
11721172
dnl PEAR dependencies.
1173-
AS_VAR_IF([PHP_XML], [no], [AC_MSG_ERROR([m4_normalize([
1173+
AS_VAR_IF([PHP_XML], [no], [AC_MSG_ERROR(m4_normalize([
11741174
PEAR requires XML to be enabled. Add '--enable-xml' to the configure line,
11751175
or disable PEAR (--without-pear).
1176-
])])])
1176+
]))])
11771177
11781178
install_pear=install-pear
11791179
@@ -1535,11 +1535,11 @@ if test "$PHP_MEMORY_SANITIZER" = "yes"; then
15351535
fi
15361536

15371537
AS_VAR_IF([PHP_ADDRESS_SANITIZER], [yes],
1538-
[AS_VAR_IF([PHP_VALGRIND], [no],, [AC_MSG_ERROR([m4_normalize([
1538+
[AS_VAR_IF([PHP_VALGRIND], [no],, [AC_MSG_ERROR(m4_normalize([
15391539
Valgrind and address sanitizer are not compatible. Either disable Valgrind
15401540
(remove --with-valgrind) or disable address sanitizer (remove
15411541
--enable-address-sanitizer).
1542-
])])])
1542+
]))])
15431543
15441544
AX_CHECK_COMPILE_FLAG([-fsanitize=address], [
15451545
CFLAGS="$CFLAGS -fsanitize=address -DZEND_TRACK_ARENA_ALLOC"
@@ -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], m4_normalize([
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],
@@ -1772,7 +1772,7 @@ PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/Zend/Makefile.frag],
17721772

17731773
AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
17741774

1775-
PHP_ADD_BUILD_DIR([m4_normalize([
1775+
PHP_ADD_BUILD_DIR(m4_normalize([
17761776
main
17771777
main/streams
17781778
scripts
@@ -1781,7 +1781,7 @@ PHP_ADD_BUILD_DIR([m4_normalize([
17811781
Zend
17821782
Zend/asm
17831783
Zend/Optimizer
1784-
])])
1784+
]))
17851785

17861786
ALL_OUTPUT_FILES="main/build-defs.h \
17871787
scripts/phpize scripts/man1/phpize.1 \

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], m4_normalize([
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if test "$PHP_DOM" != "no"; then
4141
namednodemap.c xpath_callbacks.c \
4242
$LEXBOR_SOURCES],
4343
$ext_shared,,$PHP_LEXBOR_CFLAGS)
44-
PHP_ADD_BUILD_DIR([m4_normalize([
44+
PHP_ADD_BUILD_DIR(m4_normalize([
4545
$ext_builddir/parentnode
4646
$ext_builddir/$LEXBOR_DIR/core
4747
$ext_builddir/$LEXBOR_DIR/css/selectors
@@ -56,14 +56,14 @@ if test "$PHP_DOM" != "no"; then
5656
$ext_builddir/$LEXBOR_DIR/ports/posix/lexbor/core
5757
$ext_builddir/$LEXBOR_DIR/selectors-adapted
5858
$ext_builddir/$LEXBOR_DIR/tag
59-
])])
59+
]))
6060
PHP_SUBST([DOM_SHARED_LIBADD])
61-
PHP_INSTALL_HEADERS([ext/dom], [m4_normalize([
61+
PHP_INSTALL_HEADERS([ext/dom], m4_normalize([
6262
dom_ce.h
6363
namespace_compat.h
6464
xml_common.h
6565
xpath_callbacks.h
66-
])])
66+
]))
6767
PHP_ADD_EXTENSION_DEP(dom, libxml)
6868
])
6969
fi

ext/intl/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if test "$PHP_INTL" != "no"; then
100100
PHP_ADD_SOURCES_X(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS, shared_objects_intl, yes)
101101
fi
102102

103-
PHP_ADD_BUILD_DIR([m4_normalize([
103+
PHP_ADD_BUILD_DIR(m4_normalize([
104104
$ext_builddir/breakiterator
105105
$ext_builddir/calendar
106106
$ext_builddir/collator
@@ -118,5 +118,5 @@ if test "$PHP_INTL" != "no"; then
118118
$ext_builddir/timezone
119119
$ext_builddir/transliterator
120120
$ext_builddir/uchar
121-
])])
121+
]))
122122
fi

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], m4_normalize([
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
@@ -377,7 +377,7 @@ AS_VAR_IF([php_cv_func_getifaddrs], [yes],
377377
dnl
378378
dnl Setup extension sources
379379
dnl
380-
PHP_NEW_EXTENSION([standard], [m4_normalize([
380+
PHP_NEW_EXTENSION([standard], m4_normalize([
381381
array.c
382382
assert.c
383383
base64.c
@@ -441,7 +441,7 @@ PHP_NEW_EXTENSION([standard], [m4_normalize([
441441
var_unserializer.c
442442
var.c
443443
versioning.c
444-
])],,,
444+
]),,,
445445
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
446446

447447
PHP_ADD_BUILD_DIR([$ext_builddir/libavifinfo])

sapi/apache2handler/config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ if test "$PHP_APXS2" != "no"; then
3434

3535
APXS_INCLUDEDIR=`$APXS -q INCLUDEDIR`
3636
APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
37-
AS_IF([test ! -x "$APXS_HTTPD"], [AC_MSG_ERROR([m4_normalize([
37+
AS_IF([test ! -x "$APXS_HTTPD"], [AC_MSG_ERROR(m4_normalize([
3838
$APXS_HTTPD executable not found. Please, install Apache HTTP Server
3939
command-line utility.
40-
])])])
40+
]))])
4141

4242
APXS_CFLAGS=`$APXS -q CFLAGS`
4343
APU_BINDIR=`$APXS -q APU_BINDIR`

0 commit comments

Comments
 (0)