Revert pushed by mistake

Revert "Revert "Remove assumption that extensions are in ext/ext-name""

This reverts commit 7e47bf1e65.
This commit is contained in:
Xinchen Hui 2015-11-16 18:04:10 +08:00
parent 5bdc5f4e2b
commit ae196280bb
6 changed files with 31 additions and 28 deletions

View File

@ -940,7 +940,7 @@ dnl PHP_NEW_EXTENSION(extname, sources [, shared [, sapi_class [, extra-cflags [
dnl
dnl Includes an extension in the build.
dnl
dnl "extname" is the name of the ext/ subdir where the extension resides.
dnl "extname" is the name of the extension.
dnl "sources" is a list of files relative to the subdir which are used
dnl to build the extension.
dnl "shared" can be set to "shared" or "yes" to build the extension as
@ -953,22 +953,23 @@ dnl "zend_ext" indicates a zend extension.
AC_DEFUN([PHP_NEW_EXTENSION],[
ext_builddir=[]PHP_EXT_BUILDDIR($1)
ext_srcdir=[]PHP_EXT_SRCDIR($1)
ext_dir=[]PHP_EXT_DIR($1)
ifelse($5,,ac_extra=,[ac_extra=`echo "$5"|$SED s#@ext_srcdir@#$ext_srcdir#g|$SED s#@ext_builddir@#$ext_builddir#g`])
if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; then
dnl ---------------------------------------------- Static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1"
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
if test "$3" != "nocli"; then
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
fi
else
if test "$3" = "shared" || test "$3" = "yes"; then
dnl ---------------------------------------------- Shared module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=yes
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
PHP_ADD_SOURCES_X($ext_dir,$2,$ac_extra,shared_objects_$1,yes)
case $host_alias in
*netware*[)]
PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7)
@ -986,14 +987,14 @@ dnl ---------------------------------------------- CLI static module
[PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no
case "$PHP_SAPI" in
cgi|embed[)]
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1"
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,)
EXT_STATIC="$EXT_STATIC $1;$ext_dir"
;;
*[)]
PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli)
PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,cli)
;;
esac
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir"
fi
PHP_ADD_BUILD_DIR($ext_builddir)

View File

@ -4,5 +4,7 @@
dir=$1; shift
for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do
echo "sinclude($stubfile)"
echo "config_m4_src=$stubfile
config_m4_dir=`dirname $stubfile`
sinclude($stubfile)"
done

View File

@ -24,7 +24,8 @@ cd $srcdir
module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
for ext in ${1+"$@"} ; do
header_list="$header_list ext/$ext/*.h*"
ext_dir=`echo "$ext" | cut -d ';' -f 2`
header_list="$header_list $ext_dir/*.h*"
done
includes=`$awk -f ./build/print_include.awk $header_list`

View File

@ -6,12 +6,12 @@ BEGIN {
SUBSEP=":";
}
function get_deps(module_name, depline, cmd)
function get_deps(module_name, module_dir, depline, cmd)
{
# this could probably be made *much* better
RS=orig_rs;
FS="[(,) \t]+"
cmd = "grep PHP_ADD_EXTENSION_DEP ext/" module_name "/config*.m4"
cmd = "grep PHP_ADD_EXTENSION_DEP " module_dir "/config*.m4"
while (cmd | getline) {
# printf("GOT: %s,%s,%s,%s,%s\n", $1, $2, $3, $4, $5);
if (!length($5)) {
@ -63,14 +63,16 @@ function count(arr, n, i)
return n;
}
/^[a-zA-Z0-9_-]+/ {
/^[a-zA-Z0-9_;-]+/ {
split($1, mod, ";");
# mini hack for pedantic awk
gsub("[^a-zA-Z0-9_-]", "", $1)
gsub("[^a-zA-Z0-9_-]", "", mod[1])
# add each item to array
mods[mod_count++] = $1
mods[mod_count++] = mod[1]
# see if it has any module deps
get_deps($1);
get_deps(mod[1], mod[2]);
}
END {
# order it correctly

View File

@ -131,9 +131,9 @@ PHP_SUBST(PHP_RELEASE_VERSION)
PHP_SUBST(PHP_EXTRA_VERSION)
dnl Define where extension directories are located in the configure context
AC_DEFUN([PHP_EXT_BUILDDIR],[ext/$1])dnl
AC_DEFUN([PHP_EXT_DIR],[ext/$1])dnl
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir/ext/$1])dnl
AC_DEFUN([PHP_EXT_BUILDDIR],[$config_m4_dir])dnl
AC_DEFUN([PHP_EXT_DIR],[$config_m4_dir])dnl
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir/$config_m4_dir])dnl
AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl
dnl Setting up the PHP version based on the information above.

View File

@ -6,7 +6,7 @@ PHP_ARG_ENABLE(phpdbg, for phpdbg support,
[ --enable-phpdbg Build phpdbg], yes, yes)
PHP_ARG_ENABLE(phpdbg-webhelper, for phpdbg web SAPI support,
[ --enable-phpdbg-webhelper Build phpdbg web SAPI support], yes, yes)
[ --enable-phpdbg-webhelper Build phpdbg web SAPI support], no)
PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
[ --enable-phpdbg-debug Build phpdbg in debug mode], no, no)
@ -21,13 +21,6 @@ if test "$BUILD_PHPDBG" == "" && test "$PHP_PHPDBG" != "no"; then
AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
fi
if test "$PHP_PHPDBG_WEBHELPER" != "no"; then
if ! test -d $abs_srcdir/ext/phpdbg_webhelper; then
ln -s ../sapi/phpdbg $abs_srcdir/ext/phpdbg_webhelper
fi
PHP_NEW_EXTENSION(phpdbg_webhelper, phpdbg_rinit_hook.c phpdbg_webdata_transfer.c, $ext_shared)
fi
PHP_PHPDBG_CFLAGS="-D_GNU_SOURCE"
PHP_PHPDBG_FILES="phpdbg.c phpdbg_parser.c phpdbg_lexer.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c phpdbg_info.c phpdbg_cmd.c phpdbg_set.c phpdbg_frame.c phpdbg_watch.c phpdbg_btree.c phpdbg_sigsafe.c phpdbg_wait.c phpdbg_io.c phpdbg_eol.c phpdbg_out.c"
@ -72,6 +65,10 @@ if test "$BUILD_PHPDBG" == "" && test "$PHP_PHPDBG" != "no"; then
PHP_SUBST(BUILD_PHPDBG_SHARED)
fi
if test "$PHP_PHPDBG_WEBHELPER" != "no"; then
PHP_NEW_EXTENSION(phpdbg_webhelper, phpdbg_rinit_hook.c phpdbg_webdata_transfer.c, $ext_shared)
fi
dnl ## Local Variables:
dnl ## tab-width: 4
dnl ## End: