Skip to content

Commit eb923bf

Browse files
author
Jani Taskinen
committed
MFH: - Changed AC_ARG_* options to PHP_ARG_* options.
MFH: - Some cleanups here and there MFH: - Enabled PHP_CHECK_CONFIGURE_OPTIONS (checks for unknown configure MFH: options) # Note to Marcus: ext/dba/config.m4 needs to be "converted" to use # the PHP_ARG_* options. I did't touch it needs quite a lot of work to keep # it's current behaviour regarding "enabled-by-default" parts of it. # # Hint: By using the PHP_ARG_* options you have the "default" option.. ;)
1 parent 4ef905a commit eb923bf

File tree

21 files changed

+678
-884
lines changed

21 files changed

+678
-884
lines changed

configure.in

Lines changed: 65 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## $Id$ -*- autoconf -*-
1+
## $Id$ -*- autoconf -*-
22
dnl ## Process this file with autoconf to produce a configure script.
33

44
divert(1)
@@ -10,8 +10,6 @@ dnl ## options and check for the basic compile tools.
1010
dnl ## Diversion 2 is the initial checking of OS features, programs,
1111
dnl ## libraries and so on.
1212

13-
14-
1513
dnl ## In diversion 3 we check for compile-time options to the PHP
1614
dnl ## core and how to deal with different system dependencies. This
1715
dnl ## includes what regex library is used and whether debugging or short
@@ -131,9 +129,8 @@ AC_AIX
131129
AC_PROG_LN_S
132130

133131
dnl Support systems with system libraries in e.g. /usr/lib64
134-
AC_ARG_WITH(libdir,
135-
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],
136-
[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib])
132+
PHP_ARG_WITH(libdir, for system library directory,
133+
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],lib,no)
137134

138135
dnl check for -R, etc. switch
139136
PHP_RUNPATH_SWITCH
@@ -707,9 +704,9 @@ else
707704
ZEND_DEBUG=no
708705
fi
709706

710-
PHP_ARG_WITH(layout,[layout of installed files],
711-
[ --with-layout=TYPE Set how installed files will be laid out. Type is
712-
one of "PHP" or "GNU" [TYPE=PHP]], PHP, no)
707+
PHP_ARG_WITH(layout, layout of installed files,
708+
[ --with-layout=TYPE Set how installed files will be laid out. Type can
709+
be either PHP or GNU [PHP]], PHP, no)
713710

714711
case $PHP_LAYOUT in
715712
GNU)
@@ -720,7 +717,7 @@ case $PHP_LAYOUT in
720717
;;
721718
esac
722719

723-
PHP_ARG_WITH(config-file-path,[path to configuration file],
720+
PHP_ARG_WITH(config-file-path, path to configuration file,
724721
[ --with-config-file-path=PATH
725722
Set the path in which to look for php.ini [PREFIX/lib]], DEFAULT, no)
726723

@@ -735,12 +732,14 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
735732
esac
736733
fi
737734

738-
PHP_ARG_WITH(config-file-scan-dir,[where to scan for configuration files],
735+
AC_MSG_CHECKING([where to scan for configuration files])
736+
PHP_ARG_WITH(config-file-scan-dir,,
739737
[ --with-config-file-scan-dir=PATH
740738
Set the path where to scan for configuration files], DEFAULT, no)
741739
if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
742740
PHP_CONFIG_FILE_SCAN_DIR=
743741
fi
742+
AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DIR])
744743

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

@@ -754,28 +753,19 @@ else
754753
fi
755754

756755
AC_MSG_CHECKING([for safe mode exec dir])
757-
AC_ARG_WITH(exec-dir,
756+
PHP_ARG_WITH(exec-dir,,
758757
[ --with-exec-dir[=DIR] Only allow executables in DIR under safe-mode
759-
[/usr/local/php/bin]],
760-
[
761-
if test "$withval" != "no"; then
762-
if test "$withval" = "yes"; then
763-
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
764-
AC_MSG_RESULT([/usr/local/php/bin])
765-
else
766-
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ])
767-
AC_MSG_RESULT([$withval])
768-
fi
769-
else
770-
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
771-
AC_MSG_RESULT([/usr/local/php/bin])
772-
fi
773-
],[
774-
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin", [ ])
758+
[/usr/local/php/bin]], no, no)
759+
760+
if test "$PHP_EXEC_DIR" != "no" && test "$PHP_EXEC_DIR" != "yes" ; then
761+
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR, "$PHP_EXEC_DIR", [ ])
762+
AC_MSG_RESULT([$PHP_EXEC_DIR])
763+
else
764+
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR, "/usr/local/php/bin", [ ])
775765
AC_MSG_RESULT([/usr/local/php/bin])
776-
])
766+
fi
777767

778-
PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler,
768+
PHP_ARG_ENABLE(sigchild, whether to enable PHP's own SIGCHLD handler,
779769
[ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no)
780770

781771
if test "$PHP_SIGCHILD" = "yes"; then
@@ -784,7 +774,7 @@ else
784774
AC_DEFINE(PHP_SIGCHILD, 0, [ ])
785775
fi
786776

787-
PHP_ARG_ENABLE(magic-quotes,whether to enable magic quotes by default,
777+
PHP_ARG_ENABLE(magic-quotes, whether to enable magic quotes by default,
788778
[ --enable-magic-quotes Enable magic quotes by default.], no, no)
789779

790780
if test "$PHP_MAGIC_QUOTES" = "yes"; then
@@ -809,20 +799,19 @@ if test "$PHP_LIBGCC" = "yes"; then
809799
PHP_ADD_LIBRARY(gcc, yes)
810800
fi
811801

812-
PHP_ARG_ENABLE(short-tags,whether to enable short tags by default,
813-
[ --disable-short-tags Disable the short-form <? start tag by default],yes, no)
802+
PHP_ARG_ENABLE(short-tags, whether to enable short tags by default,
803+
[ --disable-short-tags Disable the short-form <? start tag by default], yes, no)
814804

815805
if test "$PHP_SHORT_TAGS" = "yes"; then
816-
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,"1",[ ])
806+
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "1", [ ])
817807
else
818-
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,"0",[ ])
808+
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "0", [ ])
819809
fi
820810

821-
PHP_ARG_ENABLE(dmalloc,whether to enable dmalloc,
811+
PHP_ARG_ENABLE(dmalloc, whether to enable dmalloc,
822812
[ --enable-dmalloc Enable dmalloc], no, no)
823813

824814
if test "$PHP_DMALLOC" = "yes"; then
825-
826815
AC_CHECK_LIB(dmalloc, dmalloc_error, [
827816
PHP_ADD_LIBRARY(dmalloc)
828817
AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc])
@@ -832,25 +821,23 @@ if test "$PHP_DMALLOC" = "yes"; then
832821
])
833822
fi
834823

835-
PHP_ARG_ENABLE(ipv6,whether to enable IPv6 support,
824+
PHP_ARG_ENABLE(ipv6, whether to enable IPv6 support,
836825
[ --disable-ipv6 Disable IPv6 support], yes, no)
837826

838827
if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
839-
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
828+
AC_DEFINE(HAVE_IPV6, 1, [Whether to enable IPv6 support])
840829
fi
841830

842831
AC_MSG_CHECKING([how big to make fd sets])
843-
AC_ARG_ENABLE(fd-setsize,
844-
[ --enable-fd-setsize Set size of descriptor sets],[
845-
if test "x$enableval" != "xyes"; then
846-
CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$enableval"
847-
AC_MSG_RESULT(using $enableval)
848-
else
849-
AC_MSG_RESULT(using system default)
850-
fi
851-
],[
852-
AC_MSG_RESULT(using system default)
853-
])
832+
PHP_ARG_ENABLE(fd-setsize,,
833+
[ --enable-fd-setsize Set size of descriptor sets], no, no)
834+
835+
if test "$PHP_FD_SETSIZE" != "yes"; then
836+
CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE"
837+
AC_MSG_RESULT([using $PHP_FD_SETSIZE])
838+
else
839+
AC_MSG_RESULT([using system default])
840+
fi
854841

855842
divert(5)
856843

@@ -932,7 +919,7 @@ if test -z "$with_pear" && test "$enable_pear" = "no"; then
932919
fi
933920

934921
# If CLI is disabled -> disable PEAR
935-
if test "$PHP_SAPI_CLI" = "no"; then
922+
if test "$PHP_CLI" = "no"; then
936923
with_pear=no
937924
fi
938925

@@ -1146,7 +1133,7 @@ case $host_alias in
11461133
;;
11471134
esac
11481135

1149-
if test "$PHP_SAPI_CLI" != "no"; then
1136+
if test "$PHP_CLI" != "no"; then
11501137
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
11511138
PHP_INSTALL_CLI_TARGET="install-cli"
11521139
PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c getopt.c,, cli)
@@ -1365,6 +1352,14 @@ scripts/phpize scripts/man1/phpize.1 \
13651352
scripts/php-config scripts/man1/php-config.1 \
13661353
$PHP_OUTPUT_FILES"
13671354

1355+
dnl
1356+
dnl Check for unknown configure options
1357+
dnl
1358+
PHP_CHECK_CONFIGURE_OPTIONS
1359+
1360+
dnl
1361+
dnl Generate build files
1362+
dnl
13681363
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
13691364
13701365
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
@@ -1426,17 +1421,15 @@ dnl fi
14261421
14271422
# Warn about CGI version with no extra security options.
14281423
if test "$PHP_SAPI" = "cgi"; then
1429-
if test "$REDIRECT" = "0"; then
1430-
if test "$DISCARD_PATH" = "0"; then
1431-
echo "+--------------------------------------------------------------------+"
1432-
echo "| *** WARNING *** |"
1433-
echo "| |"
1434-
echo "| You will be compiling the CGI version of PHP without any |"
1435-
echo "| redirection checking. By putting this cgi binary somewhere in |"
1436-
echo "| your web space, users may be able to circumvent existing .htaccess |"
1437-
echo "| security by loading files directly through the parser. See |"
1438-
echo "| http://www.php.net/manual/security.php for more details. |"
1439-
fi
1424+
if test "$PHP_FORCE_CGI_REDIRECT" = "no" && test "$PHP_DISCARD_PATH" = "no"; then
1425+
echo "+--------------------------------------------------------------------+"
1426+
echo "| *** WARNING *** |"
1427+
echo "| |"
1428+
echo "| You will be compiling the CGI version of PHP without any |"
1429+
echo "| redirection checking. By putting this cgi binary somewhere in |"
1430+
echo "| your web space, users may be able to circumvent existing .htaccess |"
1431+
echo "| security by loading files directly through the parser. See |"
1432+
echo "| http://www.php.net/manual/security.php for more details. |"
14401433
fi
14411434
fi
14421435
@@ -1498,6 +1491,15 @@ Thank you for using PHP.
14981491
14991492
X
15001493
1494+
# Output unknown configure options
1495+
if test "$PHP_UNKNOWN_CONFIGURE_OPTIONS"; then
1496+
echo "Notice: Following unknown configure options were used:
1497+
$PHP_UNKNOWN_CONFIGURE_OPTIONS
1498+
1499+
Check '[$]0 --help' for available options
1500+
"
1501+
fi
1502+
15011503
fi
15021504
])
15031505

0 commit comments

Comments
 (0)