Skip to content

Commit 1ceadae

Browse files
authored
Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments and syncs the CS across the php-src Autotools build system.
1 parent f0788da commit 1ceadae

File tree

53 files changed

+346
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+346
-213
lines changed

docs-old/self-contained-extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ PHP_ARG_ENABLE([foobar],
8484
[Enable foobar])])
8585
8686
if test "$PHP_FOOBAR" != "no"; then
87-
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
87+
PHP_NEW_EXTENSION([foobar], [foo.c bar.c], [$ext_shared])
8888
fi
8989
```
9090

@@ -145,7 +145,7 @@ an existing module called `foo`.
145145
automatically be able to use `--with-foo=shared[,..]` or
146146
`--enable-foo=shared[,..]`.
147147

148-
2. In `config.m4`, use `PHP_NEW_EXTENSION(foo,.., $ext_shared)` to enable
148+
2. In `config.m4`, use `PHP_NEW_EXTENSION([foo],.., [$ext_shared])` to enable
149149
building the extension.
150150

151151
3. Add the following lines to your C source file:

docs-old/unix-build-system.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Makefile.ins are abandoned. The files which are to be compiled are specified in
3838
the `config.m4` now using the following macro:
3939

4040
```m4
41-
PHP_NEW_EXTENSION(foo, foo.c bar.c baz.cpp, $ext_shared)
41+
PHP_NEW_EXTENSION([foo], [foo.c bar.c baz.cpp], [$ext_shared])
4242
```
4343

4444
E.g. this enables the extension foo which consists of three source-code modules,
@@ -61,7 +61,7 @@ here as well. If you need to specify separate include directories, do it this
6161
way:
6262

6363
```m4
64-
PHP_NEW_EXTENSION(foo, foo.c mylib/bar.c mylib/gregor.c,,,-I@ext_srcdir@/lib)
64+
PHP_NEW_EXTENSION([foo], [foo.c mylib/bar.c mylib/gregor.c],,, [-I@ext_srcdir@/lib])
6565
```
6666

6767
E.g. this builds the three files which are located relative to the extension

ext/bcmath/config.m4

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ PHP_ARG_ENABLE([bcmath],
55

66
if test "$PHP_BCMATH" != "no"; then
77
PHP_NEW_EXTENSION([bcmath], m4_normalize([
8-
bcmath.c
9-
libbcmath/src/add.c
10-
libbcmath/src/compare.c
11-
libbcmath/src/convert.c
12-
libbcmath/src/div.c
13-
libbcmath/src/divmod.c
14-
libbcmath/src/doaddsub.c
15-
libbcmath/src/floor_or_ceil.c
16-
libbcmath/src/init.c
17-
libbcmath/src/int2num.c
18-
libbcmath/src/nearzero.c
19-
libbcmath/src/neg.c
20-
libbcmath/src/num2long.c
21-
libbcmath/src/num2str.c
22-
libbcmath/src/raise.c
23-
libbcmath/src/raisemod.c
24-
libbcmath/src/recmul.c
25-
libbcmath/src/rmzero.c
26-
libbcmath/src/round.c
27-
libbcmath/src/sqrt.c
28-
libbcmath/src/str2num.c
29-
libbcmath/src/sub.c
30-
libbcmath/src/zero.c
31-
]),
32-
[$ext_shared],,
33-
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
8+
bcmath.c
9+
libbcmath/src/add.c
10+
libbcmath/src/compare.c
11+
libbcmath/src/convert.c
12+
libbcmath/src/div.c
13+
libbcmath/src/divmod.c
14+
libbcmath/src/doaddsub.c
15+
libbcmath/src/floor_or_ceil.c
16+
libbcmath/src/init.c
17+
libbcmath/src/int2num.c
18+
libbcmath/src/nearzero.c
19+
libbcmath/src/neg.c
20+
libbcmath/src/num2long.c
21+
libbcmath/src/num2str.c
22+
libbcmath/src/raise.c
23+
libbcmath/src/raisemod.c
24+
libbcmath/src/recmul.c
25+
libbcmath/src/rmzero.c
26+
libbcmath/src/round.c
27+
libbcmath/src/sqrt.c
28+
libbcmath/src/str2num.c
29+
libbcmath/src/sub.c
30+
libbcmath/src/zero.c
31+
]),
32+
[$ext_shared],,
33+
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
3434
PHP_ADD_BUILD_DIR([$ext_builddir/libbcmath/src])
3535
AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath])
3636
fi

ext/bz2/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ if test "$PHP_BZ2" != "no"; then
3232
[AC_MSG_ERROR([bz2 module requires libbz2 >= 1.0.0])],
3333
[-L$BZIP_DIR/$PHP_LIBDIR])
3434

35-
PHP_NEW_EXTENSION(bz2, bz2.c bz2_filter.c, $ext_shared)
35+
PHP_NEW_EXTENSION([bz2], [bz2.c bz2_filter.c], [$ext_shared])
3636
PHP_SUBST([BZ2_SHARED_LIBADD])
3737
fi

ext/calendar/config.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ PHP_ARG_ENABLE([calendar],
55

66
if test "$PHP_CALENDAR" = "yes"; then
77
AC_DEFINE(HAVE_CALENDAR,1,[ ])
8-
PHP_NEW_EXTENSION(calendar, calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c, $ext_shared)
8+
PHP_NEW_EXTENSION([calendar],
9+
[calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c],
10+
[$ext_shared])
911
fi

ext/ctype/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ PHP_ARG_ENABLE([ctype],
66

77
if test "$PHP_CTYPE" != "no"; then
88
AC_DEFINE(HAVE_CTYPE, 1, [ ])
9-
PHP_NEW_EXTENSION(ctype, ctype.c, $ext_shared)
9+
PHP_NEW_EXTENSION([ctype], [ctype.c], [$ext_shared])
1010
fi

ext/date/config0.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRM
1212
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c
1313
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
1414

15-
PHP_NEW_EXTENSION(date, php_date.c $timelib_sources, no,, $PHP_DATE_CFLAGS)
15+
PHP_NEW_EXTENSION([date],
16+
[php_date.c $timelib_sources],
17+
[no],,
18+
[$PHP_DATE_CFLAGS])
1619

1720
PHP_ADD_BUILD_DIR([$ext_builddir/lib], [1])
1821
PHP_ADD_INCLUDE([$ext_builddir/lib])

ext/dba/config.m4

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,27 @@ if test "$HAVE_DBA" = "1"; then
701701
AC_MSG_RESULT([yes])
702702
fi
703703
AC_DEFINE(HAVE_DBA, 1, [ ])
704-
PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db1.c dba_db2.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.c dba_qdbm.c dba_tcadb.c dba_lmdb.c $cdb_sources $flat_sources $ini_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
704+
PHP_NEW_EXTENSION([dba], m4_normalize([
705+
dba_cdb.c
706+
dba_db1.c
707+
dba_db2.c
708+
dba_db3.c
709+
dba_db4.c
710+
dba_dbm.c
711+
dba_flatfile.c
712+
dba_gdbm.c
713+
dba_inifile.c
714+
dba_lmdb.c
715+
dba_ndbm.c
716+
dba_qdbm.c
717+
dba_tcadb.c
718+
dba.c
719+
$cdb_sources
720+
$flat_sources
721+
$ini_sources
722+
]),
723+
[$ext_shared],,
724+
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
705725
PHP_ADD_BUILD_DIR([$ext_builddir/libcdb])
706726
PHP_ADD_BUILD_DIR([$ext_builddir/libflatfile])
707727
PHP_ADD_BUILD_DIR([$ext_builddir/libinifile])

ext/dl_test/config.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ PHP_ARG_ENABLE([dl-test],
44
[Enable dl_test extension])])
55

66
if test "$PHP_DL_TEST" != "no"; then
7-
PHP_NEW_EXTENSION(dl_test, dl_test.c, [shared],, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
7+
PHP_NEW_EXTENSION([dl_test],
8+
[dl_test.c],
9+
[shared],,
10+
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
811
fi

ext/enchant/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ if test "$PHP_ENCHANT" != "no"; then
3535

3636
AC_DEFINE(HAVE_ENCHANT, 1, [ ])
3737

38-
PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
38+
PHP_NEW_EXTENSION([enchant], [enchant.c], [$ext_shared])
3939
PHP_SUBST([ENCHANT_SHARED_LIBADD])
4040
fi

0 commit comments

Comments
 (0)