--- embedaddon/php/acinclude.m4 2012/02/21 23:47:51 1.1.1.1 +++ embedaddon/php/acinclude.m4 2012/05/29 12:34:34 1.1.1.2 @@ -1,5 +1,5 @@ dnl -dnl $Id: acinclude.m4,v 1.1.1.1 2012/02/21 23:47:51 misho Exp $ +dnl $Id: acinclude.m4,v 1.1.1.2 2012/05/29 12:34:34 misho Exp $ dnl dnl This file contains local autoconf functions. dnl @@ -194,7 +194,7 @@ dnl the path is interpreted relative to the top build- dnl dnl which array to append to? AC_DEFUN([PHP_ADD_SOURCES],[ - PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,cli,PHP_CLI_OBJS,ifelse($4,sapi,PHP_SAPI_OBJS,ifelse($4,cgi,PHP_CGI_OBJS,ifelse($4,fpm,PHP_FPM_OBJS,PHP_GLOBAL_OBJS))))) + PHP_ADD_SOURCES_X($1, $2, $3, ifelse($4,sapi,PHP_SAPI_OBJS,PHP_GLOBAL_OBJS)) ]) dnl @@ -762,6 +762,7 @@ AC_DEFUN([PHP_REQUIRE_CXX],[ if test -z "$php_cxx_done"; then AC_PROG_CXX AC_PROG_CXXCPP + PHP_ADD_LIBRARY(stdc++) php_cxx_done=yes fi ]) @@ -772,7 +773,7 @@ dnl AC_DEFUN([PHP_BUILD_SHARED],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libphp[]$PHP_MAJOR_VERSION[.la] - php_build_target=shared + php_sapi_module=shared php_c_pre=$shared_c_pre php_c_meta=$shared_c_meta @@ -789,7 +790,7 @@ dnl AC_DEFUN([PHP_BUILD_STATIC],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libphp[]$PHP_MAJOR_VERSION[.la] - php_build_target=static + php_sapi_module=static ]) dnl @@ -798,14 +799,13 @@ dnl AC_DEFUN([PHP_BUILD_BUNDLE],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libs/libphp[]$PHP_MAJOR_VERSION[.bundle] - php_build_target=static + php_sapi_module=static ]) dnl dnl PHP_BUILD_PROGRAM dnl AC_DEFUN([PHP_BUILD_PROGRAM],[ - OVERALL_TARGET=[]ifelse($1,,php,$1) php_c_pre='$(LIBTOOL) --mode=compile $(CC)' php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' php_c_post= @@ -826,8 +826,6 @@ AC_DEFUN([PHP_BUILD_PROGRAM],[ shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) '$pic_setting shared_cxx_post= shared_lo=lo - - php_build_target=program ]) dnl @@ -873,32 +871,45 @@ EOF dnl dnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags [, build-target]]]) dnl -dnl Selects the SAPI name and type (static, shared, programm) +dnl Selects the SAPI name and type (static, shared, bundle, program) dnl and optionally also the source-files for the SAPI-specific dnl objects. dnl AC_DEFUN([PHP_SELECT_SAPI],[ - if test "$PHP_SAPI" != "default"; then -AC_MSG_ERROR([ + if test "$2" = "program"; then + PHP_BINARIES="$PHP_BINARIES $1" + elif test "$PHP_SAPI" != "none"; then + AC_MSG_ERROR([ +--------------------------------------------------------------------+ | *** ATTENTION *** | | | | You've configured multiple SAPIs to be build. You can build only | -| one SAPI module and CLI binary at the same time. | +| one SAPI module plus CGI, CLI and FPM binaries at the same time. | +--------------------------------------------------------------------+ ]) - fi + else + PHP_SAPI=$1 + fi - PHP_SAPI=$1 - - case "$2" in - static[)] PHP_BUILD_STATIC;; - shared[)] PHP_BUILD_SHARED;; - bundle[)] PHP_BUILD_BUNDLE;; - program[)] PHP_BUILD_PROGRAM($5);; - esac - - ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])]) + PHP_ADD_BUILD_DIR([sapi/$1]) + + PHP_INSTALLED_SAPIS="$PHP_INSTALLED_SAPIS $1" + + ifelse($2,program,[ + PHP_BUILD_PROGRAM + install_binaries="install-binaries" + install_binary_targets="$install_binary_targets install-$1" + PHP_SUBST(PHP_[]translit($1,a-z0-9-,A-Z0-9_)[]_OBJS) + ifelse($3,,,[PHP_ADD_SOURCES_X([sapi/$1],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_)[]_OBJS)]) + ],[ + case "$2" in + static[)] PHP_BUILD_STATIC;; + shared[)] PHP_BUILD_SHARED;; + bundle[)] PHP_BUILD_BUNDLE;; + esac + install_sapi="install-sapi" + ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])]) + ]) ]) dnl deprecated @@ -2654,19 +2665,19 @@ EOF CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0" fi for arg in $ac_configure_args; do - if test `expr -- $arg : "'.*"` = 0; then - if test `expr -- $arg : "--.*"` = 0; then - break; - fi - echo "'[$]arg' \\" >> $1 - CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" - else - if test `expr -- $arg : "'--.*"` = 0; then - break; - fi - echo "[$]arg \\" >> $1 - CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" - fi + if test `expr -- $arg : "'.*"` = 0; then + if test `expr -- $arg : "--.*"` = 0; then + break; + fi + echo "'[$]arg' \\" >> $1 + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'" + else + if test `expr -- $arg : "'--.*"` = 0; then + break; + fi + echo "[$]arg \\" >> $1 + CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg" + fi done echo '"[$]@"' >> $1 chmod +x $1 @@ -2734,17 +2745,17 @@ dnl dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) dnl AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ - AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [ + AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [ AC_MSG_CHECKING([for PDO includes]) if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext + pdo_cv_inc_path=$abs_srcdir/ext elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$abs_srcdir/ext + pdo_cv_inc_path=$abs_srcdir/ext elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then - pdo_inc_path=$prefix/include/php/ext + pdo_cv_inc_path=$prefix/include/php/ext fi ]) - if test -n "$pdo_inc_path"; then + if test -n "$pdo_cv_inc_path"; then ifelse([$1],[],:,[$1]) else ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2]) @@ -2872,3 +2883,71 @@ main() fi ]) +dnl +dnl PHP_INIT_DTRACE(providerdesc, header-file, sources [, module]) +dnl +AC_DEFUN([PHP_INIT_DTRACE],[ +dnl Set paths properly when called from extension + case "$4" in + ""[)] ac_srcdir="$abs_srcdir/"; unset ac_bdir;; + /*[)] ac_srcdir=`echo "$4"|cut -c 2-`"/"; ac_bdir=$ac_srcdir;; + *[)] ac_srcdir="$abs_srcdir/$1/"; ac_bdir="$4/";; + esac + +dnl providerdesc + ac_provsrc=$1 + old_IFS=[$]IFS + IFS=. + set $ac_provsrc + ac_provobj=[$]1 + IFS=$old_IFS + +dnl header-file + ac_hdrobj=$2 + +dnl Add providerdesc.o into global objects when needed + case $host_alias in + *freebsd*) + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" + PHP_LDFLAGS="$PHP_LDFLAGS -lelf" + ;; + *solaris*) + PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o" + ;; + esac + +dnl DTrace objects + old_IFS=[$]IFS + for ac_src in $3; do + IFS=. + set $ac_src + ac_obj=[$]1 + IFS=$old_IFS + + PHP_DTRACE_OBJS="[$]PHP_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo" + done; + + case [$]php_sapi_module in + shared[)] + for ac_lo in $PHP_DTRACE_OBJS; do + dtrace_objs="[$]dtrace_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`" + done; + ;; + *[)] + dtrace_objs='$(PHP_DTRACE_OBJS:.lo=.o)' + ;; + esac + +dnl Generate Makefile.objects entries + cat>>Makefile.objects<