From 7e47bf1e65086d6bb69bd9e9c79ccb179c5302b4 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 13 Nov 2015 14:27:59 +0800 Subject: [PATCH] Revert "Remove assumption that extensions are in ext/ext-name" This reverts commit 82b73fd1e3c53228bb31b75a446114b5fd0cd240. Conflicts: build/genif.sh build/order_by_dep.awk --- acinclude.m4 | 19 +++++++++---------- build/config-stubs | 4 +--- build/genif.sh | 3 +-- build/order_by_dep.awk | 14 ++++++-------- configure.in | 6 +++--- sapi/phpdbg/config.m4 | 13 ++++++++----- 6 files changed, 28 insertions(+), 31 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index ff2fad66f4..4ec5f87c81 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 extension. +dnl "extname" is the name of the ext/ subdir where the extension resides. 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,23 +953,22 @@ 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($ext_dir,$2,$ac_extra,) - EXT_STATIC="$EXT_STATIC $1;$ext_dir" + PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) + EXT_STATIC="$EXT_STATIC $1" if test "$3" != "nocli"; then - EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir" + EXT_CLI_STATIC="$EXT_CLI_STATIC $1" 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($ext_dir,$2,$ac_extra,shared_objects_$1,yes) + PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes) case $host_alias in *netware*[)] PHP_SHARED_MODULE(php$1,shared_objects_$1, $ext_builddir, $6, $7) @@ -987,14 +986,14 @@ dnl ---------------------------------------------- CLI static module [PHP_]translit($1,a-z_-,A-Z__)[_SHARED]=no case "$PHP_SAPI" in cgi|embed[)] - 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,) + EXT_STATIC="$EXT_STATIC $1" ;; *[)] - PHP_ADD_SOURCES($ext_dir,$2,$ac_extra,cli) + PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli) ;; esac - EXT_CLI_STATIC="$EXT_CLI_STATIC $1;$ext_dir" + EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi PHP_ADD_BUILD_DIR($ext_builddir) diff --git a/build/config-stubs b/build/config-stubs index 765eb541b0..28208085a7 100755 --- a/build/config-stubs +++ b/build/config-stubs @@ -4,7 +4,5 @@ dir=$1; shift for stubfile in $dir/*/config0.m4 $dir/*/config.m4 $dir/*/config9.m4; do - echo "config_m4_src=$stubfile -config_m4_dir=`dirname $stubfile` -sinclude($stubfile)" + echo "sinclude($stubfile)" done diff --git a/build/genif.sh b/build/genif.sh index e2bc6ac89d..14e19b7d9a 100644 --- a/build/genif.sh +++ b/build/genif.sh @@ -24,8 +24,7 @@ cd $srcdir module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`" for ext in ${1+"$@"} ; do - ext_dir=`echo "$ext" | cut -d ';' -f 2` - header_list="$header_list $ext_dir/*.h*" + header_list="$header_list ext/$ext/*.h*" done includes=`$awk -f ./build/print_include.awk $header_list` diff --git a/build/order_by_dep.awk b/build/order_by_dep.awk index 281898ecee..0fdd960652 100644 --- a/build/order_by_dep.awk +++ b/build/order_by_dep.awk @@ -6,12 +6,12 @@ BEGIN { SUBSEP=":"; } -function get_deps(module_name, module_dir, depline, cmd) +function get_deps(module_name, depline, cmd) { # this could probably be made *much* better RS=orig_rs; FS="[(,) \t]+" - cmd = "grep PHP_ADD_EXTENSION_DEP " module_dir "/config*.m4" + cmd = "grep PHP_ADD_EXTENSION_DEP ext/" module_name "/config*.m4" while (cmd | getline) { # printf("GOT: %s,%s,%s,%s,%s\n", $1, $2, $3, $4, $5); if (!length($5)) { @@ -63,16 +63,14 @@ function count(arr, n, i) return n; } -/^[a-zA-Z0-9_;-]+/ { - split($1, mod, ";"); - +/^[a-zA-Z0-9_-]+/ { # mini hack for pedantic awk - gsub("[^a-zA-Z0-9_-]", "", mod[1]) + gsub("[^a-zA-Z0-9_-]", "", $1) # add each item to array - mods[mod_count++] = mod[1] + mods[mod_count++] = $1 # see if it has any module deps - get_deps(mod[1], mod[2]); + get_deps($1); } END { # order it correctly diff --git a/configure.in b/configure.in index 0d62c488b1..c3388a4bbe 100644 --- a/configure.in +++ b/configure.in @@ -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],[$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_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_ALWAYS_SHARED],[])dnl dnl Setting up the PHP version based on the information above. diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4 index b7d1244669..1e4714e77a 100644 --- a/sapi/phpdbg/config.m4 +++ b/sapi/phpdbg/config.m4 @@ -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], no) +[ --enable-phpdbg-webhelper Build phpdbg web SAPI support], yes, yes) PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build, [ --enable-phpdbg-debug Build phpdbg in debug mode], no, no) @@ -21,6 +21,13 @@ 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" @@ -65,10 +72,6 @@ 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: -- 2.40.0