sniper Fri Jun 29 01:10:35 2007 UTC Modified files: (Branch: PHP_5_2) /php-src acinclude.m4 configure.in /php-src/scripts php-config.in phpize.in /php-src/scripts/man1 php-config.1.in Log: MFH:- Improved php-config: MFH: . Added --configure-options option to get configure line for current build MFH: . Added --php-sapis option which shows SAPIs available MFH: . Fixed problem with missing php binary when CLI is not build but CGI is. MFH:- Fixed broken sed issues in phpize script http://cvs.php.net/viewvc.cgi/php-src/acinclude.m4?r1=1.332.2.14.2.16&r2=1.332.2.14.2.17&diff_format=u Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.332.2.14.2.16 php-src/acinclude.m4:1.332.2.14.2.17 --- php-src/acinclude.m4:1.332.2.14.2.16 Wed Jun 27 14:40:08 2007 +++ php-src/acinclude.m4 Fri Jun 29 01:10:35 2007 @@ -1,5 +1,5 @@ dnl -dnl $Id: acinclude.m4,v 1.332.2.14.2.16 2007/06/27 14:40:08 sniper Exp $ +dnl $Id: acinclude.m4,v 1.332.2.14.2.17 2007/06/29 01:10:35 sniper Exp $ dnl dnl This file contains local autoconf functions. dnl @@ -2523,8 +2523,8 @@ AC_DEFUN([PHP_CONFIG_NICE],[ AC_REQUIRE([AC_PROG_EGREP]) AC_REQUIRE([LT_AC_PROG_SED]) - PHP_SUBST(EGREP) - PHP_SUBST(SED) + PHP_SUBST_OLD(EGREP) + PHP_SUBST_OLD(SED) test -f $1 && mv $1 $1.old rm -f $1.old cat >$1<<EOF @@ -2553,18 +2553,20 @@ break; fi echo "'[$]arg' \\" >> $1 - CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'" + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" else if test `expr -- $arg : "'--.*"` = 0; then break; fi echo "[$]arg \\" >> $1 - CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]arg" + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" fi done echo '"[$]@"' >> $1 chmod +x $1 + CONFIGURE_COMMAND="$CONFIGURE_COMMAND $CONFIGURE_OPTIONS" PHP_SUBST_OLD(CONFIGURE_COMMAND) + PHP_SUBST_OLD(CONFIGURE_OPTIONS) ]) dnl http://cvs.php.net/viewvc.cgi/php-src/configure.in?r1=1.579.2.52.2.59&r2=1.579.2.52.2.60&diff_format=u Index: php-src/configure.in diff -u php-src/configure.in:1.579.2.52.2.59 php-src/configure.in:1.579.2.52.2.60 --- php-src/configure.in:1.579.2.52.2.59 Wed Jun 27 14:40:08 2007 +++ php-src/configure.in Fri Jun 29 01:10:35 2007 @@ -1,4 +1,4 @@ - ## $Id: configure.in,v 1.579.2.52.2.59 2007/06/27 14:40:08 sniper Exp $ -*- autoconf -*- + ## $Id: configure.in,v 1.579.2.52.2.60 2007/06/29 01:10:35 sniper Exp $ -*- autoconf -*- dnl ## Process this file with autoconf to produce a configure script. divert(1) @@ -1178,8 +1178,13 @@ PHP_CLI_TARGET="\$(SAPI_CLI_PATH)" PHP_INSTALL_CLI_TARGET="install-cli" PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c getopt.c,, cli) + PHP_INSTALLED_SAPIS="cli $PHP_SAPI" +else + PHP_INSTALLED_SAPIS="$PHP_SAPI" fi +PHP_SUBST_OLD(PHP_INSTALLED_SAPIS) + PHP_SUBST(PHP_CLI_TARGET) PHP_SUBST(PHP_SAPI_OBJS) PHP_SUBST(PHP_CLI_OBJS) http://cvs.php.net/viewvc.cgi/php-src/scripts/php-config.in?r1=1.3.2.2.2.2&r2=1.3.2.2.2.3&diff_format=u Index: php-src/scripts/php-config.in diff -u php-src/scripts/php-config.in:1.3.2.2.2.2 php-src/scripts/php-config.in:1.3.2.2.2.3 --- php-src/scripts/php-config.in:1.3.2.2.2.2 Thu Jul 27 08:53:16 2006 +++ php-src/scripts/php-config.in Fri Jun 29 01:10:35 2007 @@ -1,10 +1,11 @@ #! /bin/sh +SED="@SED@" prefix="@prefix@" exec_prefix="@exec_prefix@" version="@PHP_VERSION@" -version_id="@PHP_VERSION_ID@" -includedir="@includedir@/php" +vernum="@PHP_VERSION_ID@" +include_dir="@includedir@/php" includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib" ldflags="@PHP_LDFLAGS@" libs="@EXTRA_LIBS@" @@ -12,30 +13,73 @@ program_prefix="@program_prefix@" program_suffix="@program_suffix@" exe_extension="@EXEEXT@" -php_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}" +php_cli_binary=NONE +php_cgi_binary=NONE +configure_options="@CONFIGURE_OPTIONS@" +php_sapis="@PHP_INSTALLED_SAPIS@" + +# Set php_cli_binary and php_cgi_binary if available +for sapi in $php_sapis; do + case $sapi in + cli) + php_cli_binary="@bindir@/${program_prefix}php${program_suffix}${exe_extension}" + ;; + cgi) + php_cgi_binary="@bindir@/${program_prefix}php-cgi${program_suffix}${exe_extension}" + ;; + esac +done + +# Determine which (if any) php binary is available +if test "$php_cli_binary" != "NONE"; then + php_binary="$php_cli_binary" +else + php_binary="$php_cgi_binary" +fi + +# Remove quotes +configure_options="`echo $configure_options | $SED -e "s#'##g"`" case "$1" in --prefix) - echo $prefix;; + echo $prefix;; --includes) - echo $includes;; + echo $includes;; --ldflags) - echo $ldflags;; + echo $ldflags;; --libs) - echo $libs;; + echo $libs;; --extension-dir) - echo $extension_dir;; + echo $extension_dir;; --include-dir) - echo $includedir;; + echo $include_dir;; --php-binary) - echo $php_binary;; + echo $php_binary;; +--php-sapis) + echo $php_sapis;; +--configure-options) + echo $configure_options;; --version) - echo $version;; + echo $version;; --vernum) - echo $version_id;; + echo $vernum;; *) - echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version|--vernum]" - exit 1;; + cat << EOF +Usage: $0 [OPTION] +Options: + --prefix [$prefix] + --includes [$includes] + --ldflags [$ldflags] + --libs [$libs] + --extension-dir [$extension_dir] + --include-dir [$include_dir] + --php-binary [$php_binary] + --php-sapis [$php_sapis] + --configure-options [$configure_options] + --version [$version] + --vernum [$vernum] +EOF + exit 1;; esac exit 0 http://cvs.php.net/viewvc.cgi/php-src/scripts/phpize.in?r1=1.28.2.3&r2=1.28.2.3.2.1&diff_format=u Index: php-src/scripts/phpize.in diff -u php-src/scripts/phpize.in:1.28.2.3 php-src/scripts/phpize.in:1.28.2.3.2.1 --- php-src/scripts/phpize.in:1.28.2.3 Mon Dec 12 11:51:45 2005 +++ php-src/scripts/phpize.in Fri Jun 29 01:10:35 2007 @@ -6,6 +6,7 @@ phpdir="`eval echo @[EMAIL PROTECTED]/build" includedir="`eval echo @[EMAIL PROTECTED]/php" builddir="`pwd`" +SED="@SED@" FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4" FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php" @@ -56,9 +57,9 @@ phpize_get_api_numbers() { # extracting API NOs: - PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'` - ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO//'` - ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|sed 's/#define ZEND_EXTENSION_API_NO//'` + PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'` + ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'` + ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'` } phpize_print_api_numbers() @@ -131,7 +132,7 @@ phpize_replace_prefix() { - sed \ + $SED \ -e "[EMAIL PROTECTED]@#$prefix#" \ < "$phpdir/phpize.m4" > configure.in } http://cvs.php.net/viewvc.cgi/php-src/scripts/man1/php-config.1.in?r1=1.3.2.2.2.1&r2=1.3.2.2.2.2&diff_format=u Index: php-src/scripts/man1/php-config.1.in diff -u php-src/scripts/man1/php-config.1.in:1.3.2.2.2.1 php-src/scripts/man1/php-config.1.in:1.3.2.2.2.2 --- php-src/scripts/man1/php-config.1.in:1.3.2.2.2.1 Thu Jul 27 08:53:16 2006 +++ php-src/scripts/man1/php-config.1.in Fri Jun 29 01:10:35 2007 @@ -1,7 +1,7 @@ .TH php\-config 1 "2006" "The PHP Group" "Scripting Language" .SH NAME .TP 15 -php\-config \- get information about PHP configuration +php\-config \- get information about PHP configuration and compile options .SH SYNOPSIS .B php\-config [options] @@ -37,7 +37,15 @@ .TP .PD 0 .B \-\-php-binary -Full path to php CLI/CGI binary +Full path to php CLI or CGI binary +.TP +.PD 0 +.B \-\-php-sapis +Show all SAPI modules available +.TP +.PD 0 +.B \-\-configure-options +Configure options to recreate configuration of current PHP installation .TP .PD 0 .B \-\-version
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php