Skip to content

Commit 84e1920

Browse files
authored
Autotools: Add phpized configure log and help separators (php#15251)
- This quotes all PHP_CONFIGURE_PART arguments - When configuring and building extensions with phpize, this makes the './configure --help' and './configure' log output a bit more readable as it separates the extension configuration, Libtool configuration and the rest of the Autoconf and phpize configuration options. - The ./configure output separators bold tags are moved to the PHP_INIT_BUILD_SYSTEM macro to be available also in phpized extensions - The obsolete ticks `...` converted to the recommended $(...); Autoconf configure re-executes itself in shells where the $(...) still wouldn't work ok. For example, the default, initial, non-updated shell on Solaris 10. - Empty new lines in help separators synced (Autoconf default separators don't include additional empty newline after the separator title); so the PHP_HELP_SEPARATOR additional empty line is also removed (see './configure --help' output)
1 parent 74eff98 commit 84e1920

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

build/php.m4

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ dnl PHP_HELP_SEPARATOR(title)
99
dnl
1010
dnl Adds separator title into the configure --help display.
1111
dnl
12-
AC_DEFUN([PHP_HELP_SEPARATOR],[
13-
AC_ARG_ENABLE([],[
14-
$1
15-
],[])
16-
])
12+
AC_DEFUN([PHP_HELP_SEPARATOR], [AC_ARG_ENABLE([], [
13+
$1], [])])
1714

1815
dnl
1916
dnl PHP_CONFIGURE_PART(title)
@@ -123,11 +120,14 @@ AC_DEFUN([PHP_CANONICAL_HOST_TARGET],[
123120
dnl
124121
dnl PHP_INIT_BUILD_SYSTEM
125122
dnl
126-
dnl Creates build directories and Makefile placeholders.
123+
dnl Initializes PHP build system configuration, creates build directories and
124+
dnl adds Makefile placeholders.
127125
dnl
128126
AC_DEFUN([PHP_INIT_BUILD_SYSTEM],
129127
[AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
130128
php_shtool=$srcdir/build/shtool
129+
T_MD=$($php_shtool echo -n -e %B)
130+
T_ME=$($php_shtool echo -n -e %b)
131131
> Makefile.objects
132132
> Makefile.fragments
133133
dnl Run at the end of the configuration, before creating the config.status.

configure.ac

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ dnl ----------------------------------------------------------------------------
100100

101101
PHP_INIT_BUILD_SYSTEM
102102

103-
T_MD=`$php_shtool echo -n -e %B`
104-
T_ME=`$php_shtool echo -n -e %b`
105-
106103
dnl We want this one before the checks, so the checks can modify CFLAGS.
107104
AS_VAR_IF([CFLAGS],, [auto_cflags=1])
108105

@@ -274,7 +271,7 @@ SAPI_SHARED=libs/$SAPI_LIBNAME_SHARED
274271
SAPI_STATIC=libs/$SAPI_LIBNAME_STATIC
275272
SAPI_LIBTOOL=libphp.la
276273

277-
PHP_CONFIGURE_PART(Configuring SAPI modules)
274+
PHP_CONFIGURE_PART([Configuring SAPI modules])
278275

279276
esyscmd(./build/config-stubs sapi)
280277

@@ -312,7 +309,7 @@ AS_VAR_IF([enable_zts], [yes], [
312309
dnl Starting system checks.
313310
dnl ----------------------------------------------------------------------------
314311

315-
PHP_CONFIGURE_PART(Running system checks)
312+
PHP_CONFIGURE_PART([Running system checks])
316313

317314
dnl Find sendmail binary.
318315
PHP_PROG_SENDMAIL
@@ -754,7 +751,7 @@ AS_VAR_IF([PHP_VALGRIND], [no],, [
754751

755752
dnl General settings.
756753
dnl ----------------------------------------------------------------------------
757-
PHP_CONFIGURE_PART(General settings)
754+
PHP_CONFIGURE_PART([General settings])
758755

759756
PHP_HELP_SEPARATOR([General settings:])
760757

@@ -1067,7 +1064,6 @@ dnl Extension configuration.
10671064
dnl ----------------------------------------------------------------------------
10681065

10691066
PHP_HELP_SEPARATOR([[Extensions:
1070-
10711067
--with-EXTENSION=[shared[,PATH]]
10721068
10731069
NOTE: Not all extensions can be built as 'shared'.
@@ -1078,7 +1074,7 @@ PHP_HELP_SEPARATOR([[Extensions:
10781074
o foobar package install prefix is /usr/local/foobar/
10791075
]])
10801076

1081-
PHP_CONFIGURE_PART(Configuring extensions)
1077+
PHP_CONFIGURE_PART([Configuring extensions])
10821078

10831079
dnl Check if all enabled by default extensions should be disabled.
10841080
AC_ARG_ENABLE([all],
@@ -1152,7 +1148,7 @@ dnl PEAR
11521148
dnl ----------------------------------------------------------------------------
11531149

11541150
PHP_HELP_SEPARATOR([PEAR:])
1155-
PHP_CONFIGURE_PART(Configuring PEAR)
1151+
PHP_CONFIGURE_PART([Configuring PEAR])
11561152

11571153
dnl If CLI is disabled disable PEAR.
11581154
AS_VAR_IF([PHP_CLI], [no], [with_pear=no])
@@ -1192,7 +1188,7 @@ dnl Configuring Zend and TSRM.
11921188
dnl ----------------------------------------------------------------------------
11931189

11941190
PHP_HELP_SEPARATOR([Zend:])
1195-
PHP_CONFIGURE_PART(Configuring Zend)
1191+
PHP_CONFIGURE_PART([Configuring Zend])
11961192

11971193
AC_ARG_ENABLE([fiber-asm],
11981194
[AS_HELP_STRING([--disable-fiber-asm],
@@ -1578,7 +1574,7 @@ dnl Libtool creation.
15781574
dnl
15791575

15801576
PHP_HELP_SEPARATOR([Libtool:])
1581-
PHP_CONFIGURE_PART(Configuring libtool)
1577+
PHP_CONFIGURE_PART([Configuring libtool])
15821578

15831579
dnl Silence warning: `ar: 'u' modifier ignored since 'D' is the default`
15841580
dnl See https://github.com/php/php-src/pull/3017
@@ -1602,7 +1598,7 @@ PHP_SET_LIBTOOL_VARIABLE([--preserve-dup-deps])
16021598

16031599
CC=$old_CC
16041600

1605-
PHP_CONFIGURE_PART(Generating files)
1601+
PHP_CONFIGURE_PART([Generating files])
16061602

16071603
CXXFLAGS_CLEAN=$CXXFLAGS
16081604
CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"

scripts/phpize.m4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,17 @@ PHP_BUILD_SHARED
139139
dnl Required programs.
140140
PHP_PROG_AWK
141141

142+
PHP_HELP_SEPARATOR([Extension:])
143+
PHP_CONFIGURE_PART([Configuring extension])
144+
142145
sinclude(config.m4)
143146

144147
enable_static=no
145148
enable_shared=yes
146149

150+
PHP_HELP_SEPARATOR([Libtool:])
151+
PHP_CONFIGURE_PART([Configuring libtool])
152+
147153
dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by
148154
dnl PHP_REQUIRE_CXX). Otherwise AC_PROG_LIBTOOL fails if there is no working C++
149155
dnl compiler.
@@ -197,6 +203,8 @@ PHP_SUBST([SHELL])
197203
PHP_SUBST([INSTALL_HEADERS])
198204
PHP_SUBST([BUILD_CC])
199205

206+
PHP_CONFIGURE_PART([Generating files])
207+
200208
AC_CONFIG_HEADERS([config.h])
201209

202210
AC_CONFIG_COMMANDS_PRE([PHP_PATCH_CONFIG_HEADERS([config.h.in])])

0 commit comments

Comments
 (0)