Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37315 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24213 invoked from network); 29 Apr 2008 23:14:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Apr 2008 23:14:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=cthompson@nexopia.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cthompson@nexopia.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain nexopia.com designates 216.234.161.191 as permitted sender) X-PHP-List-Original-Sender: cthompson@nexopia.com X-Host-Fingerprint: 216.234.161.191 unknown Linux 2.5 (sometimes 2.4) (4) Received: from [216.234.161.191] ([216.234.161.191:57413] helo=mail.nexopia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/F6-26601-DBBA7184 for ; Tue, 29 Apr 2008 19:14:07 -0400 Received: from host-29.dev.office.nexopia.com (office.lan.nexopia.com [68.148.124.243]) (Authenticated sender: cthompson@nexopia.com) by mail.nexopia.com (Postfix) with ESMTP id 216FE92BA for ; Tue, 29 Apr 2008 17:14:03 -0600 (MDT) Message-ID: <4817ABBB.2020804@nexopia.com> Date: Tue, 29 Apr 2008 17:14:03 -0600 User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/6990/Tue Apr 29 16:24:06 2008 on mail.lan.nexopia.com X-Virus-Status: Clean Subject: OS X, enable embed problem, patch From: cthompson@nexopia.com (Christopher Thompson) Please be gentle, I have very little experience developing on OS X. To be honest, the whole dylib thing seems messy and confusing to me, compared to the fairly straight-forward Linux style .so approach. Expected behavior: Able to configure and build on OS X with: ./configure --enable-embed Actual behavior: http://bugs.php.net/bug.php?id=44462 Suspected problem: Trying to build .so instead of .dylib on OS X. Suggested solution: See patch below. This makes it possible to do: ./configure --enable-embed=dylib I did this instead of fixing --enable-embed=shared because the build process appears to be fundamentally different. NOTE! Once applying the patch, you need to do: aclocal autoconf ./configure --enable-embed=dylib If you don't do aclocal to regenerate the necessary files, things break. diff -urN php-5.2.5.clean/Makefile.global php-5.2.5/Makefile.global --- php-5.2.5.clean/Makefile.global 2007-08-03 08:01:56.000000000 -0600 +++ php-5.2.5/Makefile.global 2008-04-29 16:44:36.000000000 -0600 @@ -17,6 +17,10 @@ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1 +libphp$(PHP_MAJOR_VERSION).dylib: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) + $(LIBTOOL) --mode=link $(CC) -dynamiclib -install_name $(INSTALL_ROOT)$(prefix)/lib/$@ -current_version $(PHP_VERSION) -compatibility_version $(PHP_MAJOR_VERSION) -undefined dynamic_lookup $(PHP_RPATHS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ + -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1 + libs/libphp$(PHP_MAJOR_VERSION).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) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so diff -urN php-5.2.5.clean/acinclude.m4 php-5.2.5/acinclude.m4 --- php-5.2.5.clean/acinclude.m4 2007-08-20 08:28:45.000000000 -0600 +++ php-5.2.5/acinclude.m4 2008-04-29 16:44:44.000000000 -0600 @@ -799,6 +799,15 @@ ]) dnl +dnl PHP_BUILD_DYLIB +dnl +AC_DEFUN([PHP_BUILD_DYLIB],[ + PHP_BUILD_PROGRAM + OVERALL_TARGET=libphp[]$PHP_MAJOR_VERSION[.dylib] + php_build_target=static +]) + +dnl dnl PHP_BUILD_BUNDLE dnl AC_DEFUN([PHP_BUILD_BUNDLE],[ @@ -885,6 +894,7 @@ case "$2" in static[)] PHP_BUILD_STATIC;; shared[)] PHP_BUILD_SHARED;; + dylib[)] PHP_BUILD_DYLIB;; bundle[)] PHP_BUILD_BUNDLE;; program[)] PHP_BUILD_PROGRAM($5);; esac diff -urN php-5.2.5.clean/configure.in php-5.2.5/configure.in --- php-5.2.5.clean/configure.in 2007-11-08 07:44:11.000000000 -0600 +++ php-5.2.5/configure.in 2008-04-29 16:44:52.000000000 -0600 @@ -252,6 +252,7 @@ dnl paths to the targets are relative to the build directory SAPI_SHARED=libs/libphp[]$PHP_MAJOR_VERSION[.]$SHLIB_DL_SUFFIX_NAME SAPI_STATIC=libs/libphp[]$PHP_MAJOR_VERSION[.a] +SAPI_DYLIB=libs/libphp[]$PHP_MAJOR_VERSION[.]$SHLIB_SUFFIX_NAME SAPI_LIBTOOL=libphp[]$PHP_MAJOR_VERSION[.la] PHP_CONFIGURE_PART(Configuring SAPI modules) diff -urN php-5.2.5.clean/sapi/embed/config.m4 php-5.2.5/sapi/embed/config.m4 --- php-5.2.5.clean/sapi/embed/config.m4 2007-07-11 17:20:36.000000000 -0600 +++ php-5.2.5/sapi/embed/config.m4 2008-04-29 16:45:06.000000000 -0600 @@ -4,7 +4,7 @@ PHP_ARG_ENABLE(embed,, [ --enable-embed[=TYPE] EXPERIMENTAL: Enable building of embedded SAPI library - TYPE is either 'shared' or 'static'. [TYPE=shared]], no, no) + TYPE is 'shared', 'static', or 'dylib'. [TYPE=shared]], no, no) AC_MSG_CHECKING([for embedded SAPI library support]) @@ -18,6 +18,10 @@ PHP_EMBED_TYPE=static INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib" ;; + dylib) + PHP_EMBED_TYPE=dylib + INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_DYLIB \$(INSTALL_ROOT)\$(prefix)/lib" + ;; *) PHP_EMBED_TYPE=no ;;