Skip to content

Commit 9df6a1e

Browse files
committed
Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help strings [1] so watching out if columns are aligned manually is not anymore. [1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
1 parent 2580a7b commit 9df6a1e

File tree

83 files changed

+923
-482
lines changed

Some content is hidden

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

83 files changed

+923
-482
lines changed

README.SELF-CONTAINED-EXTENSIONS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ CREATING THE M4 CONFIGURATION FILE
7979
macro calls.
8080

8181
------------------------------------------------------------------------------
82-
PHP_ARG_ENABLE(foobar,whether to enable foobar,
83-
[ --enable-foobar Enable foobar])
82+
PHP_ARG_ENABLE([foobar],
83+
[whether to enable foobar],
84+
[AS_HELP_STRING([--enable-foobar],
85+
[Enable foobar])])
8486

8587
if test "$PHP_FOOBAR" != "no"; then
8688
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)

TSRM/tsrm.m4

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,23 @@ AC_DEFUN([TSRM_THREADS_CHECKS],[
6868
dnl For the thread implementations, we always use --with-*
6969
dnl to maintain consistency
7070
71-
AC_ARG_WITH(tsrm-pth,
72-
[ --with-tsrm-pth[=pth-config]
73-
Use GNU Pth],[
74-
TSRM_PTH=$withval
75-
],[
76-
TSRM_PTH=no
77-
])
78-
79-
AC_ARG_WITH(tsrm-st,
80-
[ --with-tsrm-st Use SGI's State Threads],[
81-
TSRM_ST=$withval
82-
],[
83-
TSRM_ST=no
84-
])
85-
86-
AC_ARG_WITH(tsrm-pthreads,
87-
[ --with-tsrm-pthreads Use POSIX threads (default)],[
88-
TSRM_PTHREADS=$withval
89-
],[
90-
TSRM_PTHREADS=yes
91-
])
71+
AC_ARG_WITH([tsrm-pth],
72+
[AS_HELP_STRING([[--with-tsrm-pth[=pth-config]]],
73+
[Use GNU Pth])],
74+
[TSRM_PTH=$withval],
75+
[TSRM_PTH=no])
76+
77+
AC_ARG_WITH([tsrm-st],
78+
[AS_HELP_STRING([--with-tsrm-st],
79+
[Use SGI's State Threads])],
80+
[TSRM_ST=$withval],
81+
[TSRM_ST=no])
82+
83+
AC_ARG_WITH([tsrm-pthreads],
84+
[AS_HELP_STRING([--with-tsrm-pthreads],
85+
[Use POSIX threads (default)])],
86+
[TSRM_PTHREADS=$withval],
87+
[TSRM_PTHREADS=yes])
9288
9389
test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
9490

Zend/Zend.m4

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,17 @@ int main()
8383

8484
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
8585
86-
AC_ARG_ENABLE(maintainer-zts,
87-
[ --enable-maintainer-zts Enable thread safety - for code maintainers only!!],[
88-
ZEND_MAINTAINER_ZTS=$enableval
89-
],[
90-
ZEND_MAINTAINER_ZTS=no
91-
])
92-
93-
AC_ARG_ENABLE(inline-optimization,
94-
[ --disable-inline-optimization
95-
If building zend_execute.lo fails, try this switch],[
96-
ZEND_INLINE_OPTIMIZATION=$enableval
97-
],[
98-
ZEND_INLINE_OPTIMIZATION=yes
99-
])
86+
AC_ARG_ENABLE([maintainer-zts],
87+
[AS_HELP_STRING([--enable-maintainer-zts],
88+
[Enable thread safety - for code maintainers only!!])],
89+
[ZEND_MAINTAINER_ZTS=$enableval],
90+
[ZEND_MAINTAINER_ZTS=no])
91+
92+
AC_ARG_ENABLE([inline-optimization],
93+
[AS_HELP_STRING([--disable-inline-optimization],
94+
[If building zend_execute.lo fails, try this switch])],
95+
[ZEND_INLINE_OPTIMIZATION=$enableval],
96+
[ZEND_INLINE_OPTIMIZATION=yes])
10097
10198
AC_MSG_CHECKING(whether to enable thread-safety)
10299
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
@@ -197,13 +194,11 @@ AC_MSG_RESULT(done)
197194
198195
AC_CHECK_FUNCS(mremap)
199196
200-
201-
AC_ARG_ENABLE(zend-signals,
202-
[ --disable-zend-signals whether to enable zend signal handling],[
203-
ZEND_SIGNALS=$enableval
204-
],[
205-
ZEND_SIGNALS=yes
206-
])
197+
AC_ARG_ENABLE([zend-signals],
198+
[AS_HELP_STRING([--disable-zend-signals],
199+
[whether to enable zend signal handling])],
200+
[ZEND_SIGNALS=$enableval],
201+
[ZEND_SIGNALS=yes])
207202
208203
AC_CHECK_FUNC(sigaction, [
209204
AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
@@ -236,13 +231,12 @@ else
236231
AC_MSG_RESULT(no)
237232
fi
238233

239-
AC_ARG_ENABLE(gcc-global-regs,
240-
[ --disable-gcc-global-regs
241-
whether to enable GCC global register variables],[
242-
ZEND_GCC_GLOBAL_REGS=$enableval
243-
],[
244-
ZEND_GCC_GLOBAL_REGS=yes
245-
])
234+
AC_ARG_ENABLE([gcc-global-regs],
235+
[AS_HELP_STRING([--disable-gcc-global-regs],
236+
[whether to enable GCC global register variables])],
237+
[ZEND_GCC_GLOBAL_REGS=$enableval],
238+
[ZEND_GCC_GLOBAL_REGS=yes])
239+
246240
AC_MSG_CHECKING(for global register variables support)
247241
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
248242
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[

configure.ac

Lines changed: 106 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,19 @@ AC_USE_SYSTEM_EXTENSIONS
180180
AC_PROG_LN_S
181181

182182
dnl Support systems with system libraries in e.g. /usr/lib64
183-
PHP_ARG_WITH(libdir, for system library directory,
184-
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],lib,no)
185-
186-
PHP_ARG_ENABLE(rpath, whether to enable runpaths,
187-
[ --disable-rpath Disable passing additional runtime library
188-
search paths], yes, no)
183+
PHP_ARG_WITH([libdir],
184+
[for system library directory],
185+
[AS_HELP_STRING([--with-libdir=NAME],
186+
[Look for libraries in .../NAME rather than .../lib])],
187+
[lib],
188+
[no])
189+
190+
PHP_ARG_ENABLE([rpath],
191+
[whether to enable runpaths],
192+
[AS_HELP_STRING([--disable-rpath],
193+
[Disable passing additional runtime library search paths])],
194+
[yes],
195+
[no])
189196

190197
dnl check for -R, etc. switch
191198
PHP_RUNPATH_SWITCH
@@ -204,8 +211,12 @@ case $php_cv_bison_version in
204211
;;
205212
esac
206213

207-
PHP_ARG_ENABLE(re2c-cgoto, whether to enable computed goto gcc extension with re2c,
208-
[ --enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension], no, no)
214+
PHP_ARG_ENABLE([re2c-cgoto],
215+
[whether to enable computed goto gcc extension with re2c],
216+
[AS_HELP_STRING([--enable-re2c-cgoto],
217+
[Enable -g flag to re2c to use computed goto gcc extension])],
218+
[no],
219+
[no])
209220

210221
if test "$PHP_RE2C_CGOTO" = "no"; then
211222
RE2C_FLAGS=""
@@ -764,8 +775,12 @@ if test "$ac_cv__compiler_c99_vla" = yes; then
764775
fi
765776

766777
dnl Check valgrind support
767-
PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
768-
[ --with-valgrind=DIR Enable valgrind support], yes, no)
778+
PHP_ARG_WITH([valgrind],
779+
[whether to enable valgrind support],
780+
[AS_HELP_STRING([--with-valgrind=DIR],
781+
[Enable valgrind support])],
782+
[yes],
783+
[no])
769784

770785
if test "$PHP_VALGRIND" != "no"; then
771786

@@ -799,8 +814,12 @@ PHP_CONFIGURE_PART(General settings)
799814

800815
PHP_HELP_SEPARATOR([General settings:])
801816

802-
PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
803-
[ --enable-gcov Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!], no, no)
817+
PHP_ARG_ENABLE([gcov],
818+
[whether to include gcov symbols],
819+
[AS_HELP_STRING([--enable-gcov],
820+
[Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!])],
821+
[no],
822+
[no])
804823

805824
if test "$PHP_GCOV" = "yes"; then
806825

@@ -880,8 +899,12 @@ if test "$PHP_GCOV" = "yes"; then
880899
CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
881900
fi
882901

883-
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
884-
[ --enable-debug Compile with debugging symbols], no, no)
902+
PHP_ARG_ENABLE([debug],
903+
[whether to include debugging symbols],
904+
[AS_HELP_STRING([--enable-debug],
905+
[Compile with debugging symbols])],
906+
[no],
907+
[no])
885908

886909
if test "$PHP_DEBUG" = "yes"; then
887910
PHP_DEBUG=1
@@ -909,9 +932,12 @@ else
909932
ZEND_DEBUG=no
910933
fi
911934

912-
PHP_ARG_WITH(layout, layout of installed files,
913-
[ --with-layout=TYPE Set how installed files will be laid out. Type can
914-
be either PHP or GNU @<:@PHP@:>@], PHP, no)
935+
PHP_ARG_WITH([layout],
936+
[layout of installed files],
937+
[AS_HELP_STRING([--with-layout=TYPE],
938+
[Set how installed files will be laid out. Type can be either PHP or GNU [PHP]])],
939+
[PHP],
940+
[no])
915941

916942
case $PHP_LAYOUT in
917943
GNU)
@@ -922,9 +948,12 @@ case $PHP_LAYOUT in
922948
;;
923949
esac
924950

925-
PHP_ARG_WITH(config-file-path, path to configuration file,
926-
[ --with-config-file-path=PATH
927-
Set the path in which to look for php.ini @<:@PREFIX/lib@:>@], DEFAULT, no)
951+
PHP_ARG_WITH([config-file-path],
952+
[path to configuration file],
953+
[AS_HELP_STRING([--with-config-file-path=PATH],
954+
[Set the path in which to look for php.ini [PREFIX/lib]])],
955+
[DEFAULT],
956+
[no])
928957

929958
if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
930959
case $PHP_LAYOUT in
@@ -938,27 +967,38 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
938967
fi
939968

940969
AC_MSG_CHECKING([where to scan for configuration files])
941-
PHP_ARG_WITH(config-file-scan-dir,,
942-
[ --with-config-file-scan-dir=PATH
943-
Set the path where to scan for configuration files], DEFAULT, no)
970+
PHP_ARG_WITH([config-file-scan-dir],,
971+
[AS_HELP_STRING([--with-config-file-scan-dir=PATH],
972+
[Set the path where to scan for configuration files])],
973+
[DEFAULT],
974+
[no])
975+
944976
if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
945977
PHP_CONFIG_FILE_SCAN_DIR=
946978
fi
947979
AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DIR])
948980

949981
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
950982

951-
PHP_ARG_ENABLE(sigchild, whether to enable PHP's own SIGCHLD handler,
952-
[ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no)
983+
PHP_ARG_ENABLE([sigchild],
984+
[whether to enable PHP's own SIGCHLD handler],
985+
[AS_HELP_STRING([--enable-sigchild],
986+
[Enable PHP's own SIGCHLD handler])],
987+
[no],
988+
[no])
953989

954990
if test "$PHP_SIGCHILD" = "yes"; then
955991
AC_DEFINE(PHP_SIGCHILD, 1, [ ])
956992
else
957993
AC_DEFINE(PHP_SIGCHILD, 0, [ ])
958994
fi
959995

960-
PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
961-
[ --enable-libgcc Enable explicitly linking against libgcc], no, no)
996+
PHP_ARG_ENABLE([libgcc],
997+
[whether to explicitly link against libgcc],
998+
[AS_HELP_STRING([--enable-libgcc],
999+
[Enable explicitly linking against libgcc])],
1000+
[no],
1001+
[no])
9621002

9631003
if test "$PHP_LIBGCC" = "yes"; then
9641004
PHP_LIBGCC_LIBPATH(gcc)
@@ -969,17 +1009,25 @@ if test "$PHP_LIBGCC" = "yes"; then
9691009
PHP_ADD_LIBRARY(gcc, yes)
9701010
fi
9711011

972-
PHP_ARG_ENABLE(short-tags, whether to enable short tags by default,
973-
[ --disable-short-tags Disable the short-form <? start tag by default], yes, no)
1012+
PHP_ARG_ENABLE([short-tags],
1013+
[whether to enable short tags by default],
1014+
[AS_HELP_STRING([--disable-short-tags],
1015+
[Disable the short-form <? start tag by default])],
1016+
[yes],
1017+
[no])
9741018

9751019
if test "$PHP_SHORT_TAGS" = "yes"; then
9761020
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "1", [ ])
9771021
else
9781022
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "0", [ ])
9791023
fi
9801024

981-
PHP_ARG_ENABLE(dmalloc, whether to enable dmalloc,
982-
[ --enable-dmalloc Enable dmalloc], no, no)
1025+
PHP_ARG_ENABLE([dmalloc],
1026+
[whether to enable dmalloc],
1027+
[AS_HELP_STRING([--enable-dmalloc],
1028+
[Enable dmalloc])],
1029+
[no],
1030+
[no])
9831031

9841032
if test "$PHP_DMALLOC" = "yes"; then
9851033
AC_CHECK_LIB(dmalloc, dmalloc_error, [
@@ -991,8 +1039,12 @@ if test "$PHP_DMALLOC" = "yes"; then
9911039
])
9921040
fi
9931041

994-
PHP_ARG_ENABLE(ipv6, whether to enable IPv6 support,
995-
[ --disable-ipv6 Disable IPv6 support], yes, no)
1042+
PHP_ARG_ENABLE([ipv6],
1043+
[whether to enable IPv6 support],
1044+
[AS_HELP_STRING([--disable-ipv6],
1045+
[Disable IPv6 support])],
1046+
[yes],
1047+
[no])
9961048

9971049
if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
9981050
AC_DEFINE(HAVE_IPV6, 1, [Whether to enable IPv6 support])
@@ -1002,8 +1054,12 @@ dnl ##
10021054
dnl ## DTRACE CHECKS
10031055
dnl ## Note: this has to be done after SAPI configuration!
10041056
dnl ##
1005-
PHP_ARG_ENABLE(dtrace, whether to enable DTrace support,
1006-
[ --enable-dtrace Enable DTrace support], no, no)
1057+
PHP_ARG_ENABLE([dtrace],
1058+
[whether to enable DTrace support],
1059+
[AS_HELP_STRING([--enable-dtrace],
1060+
[Enable DTrace support])],
1061+
[no],
1062+
[no])
10071063

10081064
if test "$PHP_DTRACE" = "yes"; then
10091065
AC_CHECK_HEADERS([sys/sdt.h], [
@@ -1018,8 +1074,11 @@ if test "$PHP_DTRACE" = "yes"; then
10181074
fi
10191075

10201076
AC_MSG_CHECKING([how big to make fd sets])
1021-
PHP_ARG_ENABLE(fd-setsize,,
1022-
[ --enable-fd-setsize Set size of descriptor sets], no, no)
1077+
PHP_ARG_ENABLE([fd-setsize],,
1078+
[AS_HELP_STRING([--enable-fd-setsize],
1079+
[Set size of descriptor sets])],
1080+
[no],
1081+
[no])
10231082

10241083
if test "$PHP_FD_SETSIZE" != "no"; then
10251084
if test "0$PHP_FD_SETSIZE" -gt 0 2>/dev/null; then
@@ -1053,11 +1112,10 @@ dnl
10531112
dnl Check if all enabled by default extensions should be disabled
10541113
dnl
10551114

1056-
AC_ARG_ENABLE(all,
1057-
[ --disable-all Disable all extensions which are enabled by default
1058-
], [
1059-
PHP_ENABLE_ALL=$enableval
1060-
])
1115+
AC_ARG_ENABLE([all],
1116+
[AS_HELP_STRING([--disable-all],
1117+
[Disable all extensions which are enabled by default])],
1118+
[PHP_ENABLE_ALL=$enableval])
10611119

10621120
# reading config stubs
10631121
esyscmd(./build/config-stubs ext)
@@ -1115,8 +1173,12 @@ if test "$PHP_CLI" = "no"; then
11151173
with_pear=no
11161174
fi
11171175

1118-
PHP_ARG_WITH(pear, [whether to install PEAR],
1119-
[ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php@:>@], no, yes)
1176+
PHP_ARG_WITH([pear],
1177+
[whether to install PEAR],
1178+
[AS_HELP_STRING([[--with-pear[=DIR]]],
1179+
[Install PEAR in DIR [PREFIX/lib/php]])],
1180+
[no],
1181+
[yes])
11201182

11211183
if test "$PHP_PEAR" != "no"; then
11221184

0 commit comments

Comments
 (0)