From: Marko Karppinen Date: Sat, 30 Mar 2002 03:17:25 +0000 (+0000) Subject: Enable --with-apxs build on Mac OS X. We build an MH_BUNDLE instead of X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~959 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=676afb33b852f6bad14d8a882ae6cbef8ce603f9;p=php Enable --with-apxs build on Mac OS X. We build an MH_BUNDLE instead of an MH_DYLIB. As all PPC code is relocatable, we don't use the libtool based shared build but go a static route. Goodbye libtool! # I'm committing this to enable widespear testing. # Anyone have any ideas on how to easily backport this to 4.2.0? --- diff --git a/Makefile.global b/Makefile.global index 2799f41a66..7f221571c7 100644 --- a/Makefile.global +++ b/Makefile.global @@ -14,6 +14,9 @@ build-modules: $(PHP_MODULES) libphp4.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ +libs/libphp4.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) + $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp4.so + php: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(LIBTOOL) --mode=link $(CC) -export-dynamic $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ diff --git a/acinclude.m4 b/acinclude.m4 index b1e4612610..066ca1d778 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -782,6 +782,15 @@ AC_DEFUN(PHP_BUILD_STATIC,[ php_build_target=static ]) +dnl +dnl PHP_BUILD_BUNDLE +dnl +AC_DEFUN(PHP_BUILD_BUNDLE,[ + PHP_BUILD_PROGRAM + OVERALL_TARGET=libs/libphp4.bundle + php_build_target=static +]) + dnl dnl PHP_BUILD_PROGRAM dnl @@ -1092,6 +1101,7 @@ AC_DEFUN(PHP_SELECT_SAPI,[ case "$2" in static) PHP_BUILD_STATIC;; shared) PHP_BUILD_SHARED;; + bundle) PHP_BUILD_BUNDLE;; program) PHP_BUILD_PROGRAM;; esac diff --git a/sapi/apache/config.m4 b/sapi/apache/config.m4 index 62ad45ebcd..57f1236520 100644 --- a/sapi/apache/config.m4 +++ b/sapi/apache/config.m4 @@ -38,8 +38,24 @@ AC_ARG_WITH(apxs, -D*) CPPFLAGS="$CPPFLAGS $flag";; esac done + case $host_alias in + *aix*) + APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" + PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c) + ;; + *darwin*) + APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` + MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD" + PHP_SUBST(MH_BUNDLE_FLAGS) + SAPI_SHARED=libs/libphp4.so + PHP_SELECT_SAPI(apache, bundle, sapi_apache.c mod_php4.c php_apache.c) + ;; + *) + PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c) + ;; + esac PHP_ADD_INCLUDE($APXS_INCLUDEDIR) - PHP_SELECT_SAPI(apache, shared, sapi_apache.c mod_php4.c php_apache.c) # Test whether apxs support -S option $APXS -q -S CFLAGS="$APXS_CFLAGS" CFLAGS >/dev/null 2>&1 @@ -57,17 +73,6 @@ AC_ARG_WITH(apxs, AC_DEFINE(HAVE_AP_CONFIG_H,1,[ ]) AC_DEFINE(HAVE_AP_COMPAT_H,1,[ ]) AC_MSG_RESULT(yes) - case $host_alias in - *aix*) - APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR` - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" - ;; - *darwin*) - APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET` - MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD" - PHP_SUBST(MH_BUNDLE_FLAGS) - ;; - esac ],[ AC_MSG_RESULT(no) ])