Skip to content

Commit

Permalink
Add AS_HELP_STRING to *nix build configure options
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petk committed Mar 7, 2019
1 parent 2580a7b commit 9df6a1e
Show file tree
Hide file tree
Showing 83 changed files with 923 additions and 482 deletions.
6 changes: 4 additions & 2 deletions README.SELF-CONTAINED-EXTENSIONS
Expand Up @@ -79,8 +79,10 @@ CREATING THE M4 CONFIGURATION FILE
macro calls.

------------------------------------------------------------------------------
PHP_ARG_ENABLE(foobar,whether to enable foobar,
[ --enable-foobar Enable foobar])
PHP_ARG_ENABLE([foobar],
[whether to enable foobar],
[AS_HELP_STRING([--enable-foobar],
[Enable foobar])])

if test "$PHP_FOOBAR" != "no"; then
PHP_NEW_EXTENSION(foobar, foo.c bar.c, $ext_shared)
Expand Down
38 changes: 17 additions & 21 deletions TSRM/tsrm.m4
Expand Up @@ -68,27 +68,23 @@ AC_DEFUN([TSRM_THREADS_CHECKS],[
dnl For the thread implementations, we always use --with-*
dnl to maintain consistency
AC_ARG_WITH(tsrm-pth,
[ --with-tsrm-pth[=pth-config]
Use GNU Pth],[
TSRM_PTH=$withval
],[
TSRM_PTH=no
])
AC_ARG_WITH(tsrm-st,
[ --with-tsrm-st Use SGI's State Threads],[
TSRM_ST=$withval
],[
TSRM_ST=no
])
AC_ARG_WITH(tsrm-pthreads,
[ --with-tsrm-pthreads Use POSIX threads (default)],[
TSRM_PTHREADS=$withval
],[
TSRM_PTHREADS=yes
])
AC_ARG_WITH([tsrm-pth],
[AS_HELP_STRING([[--with-tsrm-pth[=pth-config]]],
[Use GNU Pth])],
[TSRM_PTH=$withval],
[TSRM_PTH=no])
AC_ARG_WITH([tsrm-st],
[AS_HELP_STRING([--with-tsrm-st],
[Use SGI's State Threads])],
[TSRM_ST=$withval],
[TSRM_ST=no])
AC_ARG_WITH([tsrm-pthreads],
[AS_HELP_STRING([--with-tsrm-pthreads],
[Use POSIX threads (default)])],
[TSRM_PTHREADS=$withval],
[TSRM_PTHREADS=yes])
test "$TSRM_PTH" = "yes" && TSRM_PTH=pth-config
Expand Down
50 changes: 22 additions & 28 deletions Zend/Zend.m4
Expand Up @@ -83,20 +83,17 @@ int main()

AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE(maintainer-zts,
[ --enable-maintainer-zts Enable thread safety - for code maintainers only!!],[
ZEND_MAINTAINER_ZTS=$enableval
],[
ZEND_MAINTAINER_ZTS=no
])
AC_ARG_ENABLE(inline-optimization,
[ --disable-inline-optimization
If building zend_execute.lo fails, try this switch],[
ZEND_INLINE_OPTIMIZATION=$enableval
],[
ZEND_INLINE_OPTIMIZATION=yes
])
AC_ARG_ENABLE([maintainer-zts],
[AS_HELP_STRING([--enable-maintainer-zts],
[Enable thread safety - for code maintainers only!!])],
[ZEND_MAINTAINER_ZTS=$enableval],
[ZEND_MAINTAINER_ZTS=no])
AC_ARG_ENABLE([inline-optimization],
[AS_HELP_STRING([--disable-inline-optimization],
[If building zend_execute.lo fails, try this switch])],
[ZEND_INLINE_OPTIMIZATION=$enableval],
[ZEND_INLINE_OPTIMIZATION=yes])
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
Expand Down Expand Up @@ -197,13 +194,11 @@ AC_MSG_RESULT(done)
AC_CHECK_FUNCS(mremap)
AC_ARG_ENABLE(zend-signals,
[ --disable-zend-signals whether to enable zend signal handling],[
ZEND_SIGNALS=$enableval
],[
ZEND_SIGNALS=yes
])
AC_ARG_ENABLE([zend-signals],
[AS_HELP_STRING([--disable-zend-signals],
[whether to enable zend signal handling])],
[ZEND_SIGNALS=$enableval],
[ZEND_SIGNALS=yes])
AC_CHECK_FUNC(sigaction, [
AC_DEFINE(HAVE_SIGACTION, 1, [Whether sigaction() is available])
Expand Down Expand Up @@ -236,13 +231,12 @@ else
AC_MSG_RESULT(no)
fi

AC_ARG_ENABLE(gcc-global-regs,
[ --disable-gcc-global-regs
whether to enable GCC global register variables],[
ZEND_GCC_GLOBAL_REGS=$enableval
],[
ZEND_GCC_GLOBAL_REGS=yes
])
AC_ARG_ENABLE([gcc-global-regs],
[AS_HELP_STRING([--disable-gcc-global-regs],
[whether to enable GCC global register variables])],
[ZEND_GCC_GLOBAL_REGS=$enableval],
[ZEND_GCC_GLOBAL_REGS=yes])

AC_MSG_CHECKING(for global register variables support)
if test "$ZEND_GCC_GLOBAL_REGS" != "no"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down
150 changes: 106 additions & 44 deletions configure.ac
Expand Up @@ -180,12 +180,19 @@ AC_USE_SYSTEM_EXTENSIONS
AC_PROG_LN_S

dnl Support systems with system libraries in e.g. /usr/lib64
PHP_ARG_WITH(libdir, for system library directory,
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],lib,no)

PHP_ARG_ENABLE(rpath, whether to enable runpaths,
[ --disable-rpath Disable passing additional runtime library
search paths], yes, no)
PHP_ARG_WITH([libdir],
[for system library directory],
[AS_HELP_STRING([--with-libdir=NAME],
[Look for libraries in .../NAME rather than .../lib])],
[lib],
[no])

PHP_ARG_ENABLE([rpath],
[whether to enable runpaths],
[AS_HELP_STRING([--disable-rpath],
[Disable passing additional runtime library search paths])],
[yes],
[no])

dnl check for -R, etc. switch
PHP_RUNPATH_SWITCH
Expand All @@ -204,8 +211,12 @@ case $php_cv_bison_version in
;;
esac

PHP_ARG_ENABLE(re2c-cgoto, whether to enable computed goto gcc extension with re2c,
[ --enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension], no, no)
PHP_ARG_ENABLE([re2c-cgoto],
[whether to enable computed goto gcc extension with re2c],
[AS_HELP_STRING([--enable-re2c-cgoto],
[Enable -g flag to re2c to use computed goto gcc extension])],
[no],
[no])

if test "$PHP_RE2C_CGOTO" = "no"; then
RE2C_FLAGS=""
Expand Down Expand Up @@ -764,8 +775,12 @@ if test "$ac_cv__compiler_c99_vla" = yes; then
fi

dnl Check valgrind support
PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
[ --with-valgrind=DIR Enable valgrind support], yes, no)
PHP_ARG_WITH([valgrind],
[whether to enable valgrind support],
[AS_HELP_STRING([--with-valgrind=DIR],
[Enable valgrind support])],
[yes],
[no])

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

Expand Down Expand Up @@ -799,8 +814,12 @@ PHP_CONFIGURE_PART(General settings)

PHP_HELP_SEPARATOR([General settings:])

PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
[ --enable-gcov Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!], no, no)
PHP_ARG_ENABLE([gcov],
[whether to include gcov symbols],
[AS_HELP_STRING([--enable-gcov],
[Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!])],
[no],
[no])

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

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

PHP_ARG_ENABLE(debug, whether to include debugging symbols,
[ --enable-debug Compile with debugging symbols], no, no)
PHP_ARG_ENABLE([debug],
[whether to include debugging symbols],
[AS_HELP_STRING([--enable-debug],
[Compile with debugging symbols])],
[no],
[no])

if test "$PHP_DEBUG" = "yes"; then
PHP_DEBUG=1
Expand Down Expand Up @@ -909,9 +932,12 @@ else
ZEND_DEBUG=no
fi

PHP_ARG_WITH(layout, layout of installed files,
[ --with-layout=TYPE Set how installed files will be laid out. Type can
be either PHP or GNU @<:@PHP@:>@], PHP, no)
PHP_ARG_WITH([layout],
[layout of installed files],
[AS_HELP_STRING([--with-layout=TYPE],
[Set how installed files will be laid out. Type can be either PHP or GNU [PHP]])],
[PHP],
[no])

case $PHP_LAYOUT in
GNU)
Expand All @@ -922,9 +948,12 @@ case $PHP_LAYOUT in
;;
esac

PHP_ARG_WITH(config-file-path, path to configuration file,
[ --with-config-file-path=PATH
Set the path in which to look for php.ini @<:@PREFIX/lib@:>@], DEFAULT, no)
PHP_ARG_WITH([config-file-path],
[path to configuration file],
[AS_HELP_STRING([--with-config-file-path=PATH],
[Set the path in which to look for php.ini [PREFIX/lib]])],
[DEFAULT],
[no])

if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
case $PHP_LAYOUT in
Expand All @@ -938,27 +967,38 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
fi

AC_MSG_CHECKING([where to scan for configuration files])
PHP_ARG_WITH(config-file-scan-dir,,
[ --with-config-file-scan-dir=PATH
Set the path where to scan for configuration files], DEFAULT, no)
PHP_ARG_WITH([config-file-scan-dir],,
[AS_HELP_STRING([--with-config-file-scan-dir=PATH],
[Set the path where to scan for configuration files])],
[DEFAULT],
[no])

if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
PHP_CONFIG_FILE_SCAN_DIR=
fi
AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DIR])

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

PHP_ARG_ENABLE(sigchild, whether to enable PHP's own SIGCHLD handler,
[ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no)
PHP_ARG_ENABLE([sigchild],
[whether to enable PHP's own SIGCHLD handler],
[AS_HELP_STRING([--enable-sigchild],
[Enable PHP's own SIGCHLD handler])],
[no],
[no])

if test "$PHP_SIGCHILD" = "yes"; then
AC_DEFINE(PHP_SIGCHILD, 1, [ ])
else
AC_DEFINE(PHP_SIGCHILD, 0, [ ])
fi

PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
[ --enable-libgcc Enable explicitly linking against libgcc], no, no)
PHP_ARG_ENABLE([libgcc],
[whether to explicitly link against libgcc],
[AS_HELP_STRING([--enable-libgcc],
[Enable explicitly linking against libgcc])],
[no],
[no])

if test "$PHP_LIBGCC" = "yes"; then
PHP_LIBGCC_LIBPATH(gcc)
Expand All @@ -969,17 +1009,25 @@ if test "$PHP_LIBGCC" = "yes"; then
PHP_ADD_LIBRARY(gcc, yes)
fi

PHP_ARG_ENABLE(short-tags, whether to enable short tags by default,
[ --disable-short-tags Disable the short-form <? start tag by default], yes, no)
PHP_ARG_ENABLE([short-tags],
[whether to enable short tags by default],
[AS_HELP_STRING([--disable-short-tags],
[Disable the short-form <? start tag by default])],
[yes],
[no])

if test "$PHP_SHORT_TAGS" = "yes"; then
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "1", [ ])
else
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "0", [ ])
fi

PHP_ARG_ENABLE(dmalloc, whether to enable dmalloc,
[ --enable-dmalloc Enable dmalloc], no, no)
PHP_ARG_ENABLE([dmalloc],
[whether to enable dmalloc],
[AS_HELP_STRING([--enable-dmalloc],
[Enable dmalloc])],
[no],
[no])

if test "$PHP_DMALLOC" = "yes"; then
AC_CHECK_LIB(dmalloc, dmalloc_error, [
Expand All @@ -991,8 +1039,12 @@ if test "$PHP_DMALLOC" = "yes"; then
])
fi

PHP_ARG_ENABLE(ipv6, whether to enable IPv6 support,
[ --disable-ipv6 Disable IPv6 support], yes, no)
PHP_ARG_ENABLE([ipv6],
[whether to enable IPv6 support],
[AS_HELP_STRING([--disable-ipv6],
[Disable IPv6 support])],
[yes],
[no])

if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE(HAVE_IPV6, 1, [Whether to enable IPv6 support])
Expand All @@ -1002,8 +1054,12 @@ dnl ##
dnl ## DTRACE CHECKS
dnl ## Note: this has to be done after SAPI configuration!
dnl ##
PHP_ARG_ENABLE(dtrace, whether to enable DTrace support,
[ --enable-dtrace Enable DTrace support], no, no)
PHP_ARG_ENABLE([dtrace],
[whether to enable DTrace support],
[AS_HELP_STRING([--enable-dtrace],
[Enable DTrace support])],
[no],
[no])

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

AC_MSG_CHECKING([how big to make fd sets])
PHP_ARG_ENABLE(fd-setsize,,
[ --enable-fd-setsize Set size of descriptor sets], no, no)
PHP_ARG_ENABLE([fd-setsize],,
[AS_HELP_STRING([--enable-fd-setsize],
[Set size of descriptor sets])],
[no],
[no])

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

AC_ARG_ENABLE(all,
[ --disable-all Disable all extensions which are enabled by default
], [
PHP_ENABLE_ALL=$enableval
])
AC_ARG_ENABLE([all],
[AS_HELP_STRING([--disable-all],
[Disable all extensions which are enabled by default])],
[PHP_ENABLE_ALL=$enableval])

# reading config stubs
esyscmd(./build/config-stubs ext)
Expand Down Expand Up @@ -1115,8 +1173,12 @@ if test "$PHP_CLI" = "no"; then
with_pear=no
fi

PHP_ARG_WITH(pear, [whether to install PEAR],
[ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php@:>@], no, yes)
PHP_ARG_WITH([pear],
[whether to install PEAR],
[AS_HELP_STRING([[--with-pear[=DIR]]],
[Install PEAR in DIR [PREFIX/lib/php]])],
[no],
[yes])

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

Expand Down

0 comments on commit 9df6a1e

Please sign in to comment.