mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- Improved php-config:
. Added --configure-options option to get configure line for current build . Added --php-sapis option which shows SAPIs available . Fixed problem with missing php binary when CLI is not build but CGI is. - Fixed broken sed issues in phpize script
This commit is contained in:
parent
e9658dfc4d
commit
68724e2489
5 changed files with 84 additions and 24 deletions
10
acinclude.m4
10
acinclude.m4
|
@ -2590,8 +2590,8 @@ dnl
|
||||||
AC_DEFUN([PHP_CONFIG_NICE],[
|
AC_DEFUN([PHP_CONFIG_NICE],[
|
||||||
AC_REQUIRE([AC_PROG_EGREP])
|
AC_REQUIRE([AC_PROG_EGREP])
|
||||||
AC_REQUIRE([LT_AC_PROG_SED])
|
AC_REQUIRE([LT_AC_PROG_SED])
|
||||||
PHP_SUBST(EGREP)
|
PHP_SUBST_OLD(EGREP)
|
||||||
PHP_SUBST(SED)
|
PHP_SUBST_OLD(SED)
|
||||||
test -f $1 && mv $1 $1.old
|
test -f $1 && mv $1 $1.old
|
||||||
rm -f $1.old
|
rm -f $1.old
|
||||||
cat >$1<<EOF
|
cat >$1<<EOF
|
||||||
|
@ -2620,18 +2620,20 @@ EOF
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
echo "'[$]arg' \\" >> $1
|
echo "'[$]arg' \\" >> $1
|
||||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '[$]arg'"
|
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'"
|
||||||
else
|
else
|
||||||
if test `expr -- $arg : "'--.*"` = 0; then
|
if test `expr -- $arg : "'--.*"` = 0; then
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
echo "[$]arg \\" >> $1
|
echo "[$]arg \\" >> $1
|
||||||
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]arg"
|
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo '"[$]@"' >> $1
|
echo '"[$]@"' >> $1
|
||||||
chmod +x $1
|
chmod +x $1
|
||||||
|
CONFIGURE_COMMAND="$CONFIGURE_COMMAND $CONFIGURE_OPTIONS"
|
||||||
PHP_SUBST_OLD(CONFIGURE_COMMAND)
|
PHP_SUBST_OLD(CONFIGURE_COMMAND)
|
||||||
|
PHP_SUBST_OLD(CONFIGURE_OPTIONS)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
|
|
|
@ -1077,8 +1077,13 @@ if test "$PHP_SAPI_CLI" != "no"; then
|
||||||
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
|
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
|
||||||
PHP_INSTALL_CLI_TARGET="install-cli"
|
PHP_INSTALL_CLI_TARGET="install-cli"
|
||||||
PHP_ADD_SOURCES(sapi/cli, php_cli.c php_cli_readline.c getopt.c,, 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
|
fi
|
||||||
|
|
||||||
|
PHP_SUBST_OLD(PHP_INSTALLED_SAPIS)
|
||||||
|
|
||||||
PHP_SUBST(PHP_CLI_TARGET)
|
PHP_SUBST(PHP_CLI_TARGET)
|
||||||
PHP_SUBST(PHP_SAPI_OBJS)
|
PHP_SUBST(PHP_SAPI_OBJS)
|
||||||
PHP_SUBST(PHP_CLI_OBJS)
|
PHP_SUBST(PHP_CLI_OBJS)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.TH php\-config 1 "2006" "The PHP Group" "Scripting Language"
|
.TH php\-config 1 "2006" "The PHP Group" "Scripting Language"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
.TP 15
|
.TP 15
|
||||||
php\-config \- get information about PHP configuration
|
php\-config \- get information about PHP configuration and compile options
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B php\-config
|
.B php\-config
|
||||||
[options]
|
[options]
|
||||||
|
@ -37,7 +37,15 @@ Directory prefix where header files are installed by default
|
||||||
.TP
|
.TP
|
||||||
.PD 0
|
.PD 0
|
||||||
.B \-\-php-binary
|
.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
|
.TP
|
||||||
.PD 0
|
.PD 0
|
||||||
.B \-\-version
|
.B \-\-version
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
|
SED="@SED@"
|
||||||
prefix="@prefix@"
|
prefix="@prefix@"
|
||||||
exec_prefix="@exec_prefix@"
|
exec_prefix="@exec_prefix@"
|
||||||
version="@PHP_VERSION@"
|
version="@PHP_VERSION@"
|
||||||
version_id="@PHP_VERSION_ID@"
|
vernum="@PHP_VERSION_ID@"
|
||||||
includedir="@includedir@/php"
|
include_dir="@includedir@/php"
|
||||||
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
|
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext -I$includedir/ext/date/lib"
|
||||||
ldflags="@PHP_LDFLAGS@"
|
ldflags="@PHP_LDFLAGS@"
|
||||||
libs="@EXTRA_LIBS@"
|
libs="@EXTRA_LIBS@"
|
||||||
|
@ -12,7 +13,32 @@ extension_dir='@EXTENSION_DIR@'
|
||||||
program_prefix="@program_prefix@"
|
program_prefix="@program_prefix@"
|
||||||
program_suffix="@program_suffix@"
|
program_suffix="@program_suffix@"
|
||||||
exe_extension="@EXEEXT@"
|
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
|
case "$1" in
|
||||||
--prefix)
|
--prefix)
|
||||||
|
@ -26,15 +52,33 @@ case "$1" in
|
||||||
--extension-dir)
|
--extension-dir)
|
||||||
echo $extension_dir;;
|
echo $extension_dir;;
|
||||||
--include-dir)
|
--include-dir)
|
||||||
echo $includedir;;
|
echo $include_dir;;
|
||||||
--php-binary)
|
--php-binary)
|
||||||
echo $php_binary;;
|
echo $php_binary;;
|
||||||
|
--php-sapis)
|
||||||
|
echo $php_sapis;;
|
||||||
|
--configure-options)
|
||||||
|
echo $configure_options;;
|
||||||
--version)
|
--version)
|
||||||
echo $version;;
|
echo $version;;
|
||||||
--vernum)
|
--vernum)
|
||||||
echo $version_id;;
|
echo $vernum;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version|--vernum]"
|
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;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ exec_prefix="`eval echo @exec_prefix@`"
|
||||||
phpdir="`eval echo @libdir@`/build"
|
phpdir="`eval echo @libdir@`/build"
|
||||||
includedir="`eval echo @includedir@`/php"
|
includedir="`eval echo @includedir@`/php"
|
||||||
builddir="`pwd`"
|
builddir="`pwd`"
|
||||||
|
SED="@SED@"
|
||||||
|
|
||||||
FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool libtool.m4"
|
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"
|
FILES="acinclude.m4 Makefile.global config.sub config.guess ltmain.sh run-tests*.php"
|
||||||
|
@ -56,9 +57,9 @@ phpize_check_configm4()
|
||||||
phpize_get_api_numbers()
|
phpize_get_api_numbers()
|
||||||
{
|
{
|
||||||
# extracting API NOs:
|
# extracting API NOs:
|
||||||
PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|sed 's/#define PHP_API_VERSION//'`
|
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_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//'`
|
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()
|
phpize_print_api_numbers()
|
||||||
|
@ -131,7 +132,7 @@ phpize_copy_files()
|
||||||
|
|
||||||
phpize_replace_prefix()
|
phpize_replace_prefix()
|
||||||
{
|
{
|
||||||
sed \
|
$SED \
|
||||||
-e "s#@prefix@#$prefix#" \
|
-e "s#@prefix@#$prefix#" \
|
||||||
< "$phpdir/phpize.m4" > configure.in
|
< "$phpdir/phpize.m4" > configure.in
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue