Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25240 invoked from network); 30 Apr 2008 07:02:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 07:02:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.29 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 74.125.46.29 yw-out-2324.google.com Received: from [74.125.46.29] ([74.125.46.29:46615] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/5E-28930-E9918184 for ; Wed, 30 Apr 2008 03:02:54 -0400 Received: by yw-out-2324.google.com with SMTP id 5so206927ywh.83 for ; Wed, 30 Apr 2008 00:02:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=68apWfYuBQRxP+e6MQjAJlD/c5gs7wHzl6oaoJui+24=; b=HfbVrBr/4GLLAwMqhzb2HZe9ZOi9OaQBpNrLshAxEoFD0mNBM11oSOKkQbENsX+sgRNrXXcQgDnpuZgRam6vn0qB4tbl/RxsDovGNgDipGZR6OmBFv6YVTBZq/CU79a/EBnLYwDeZ2SmK6WyRv3P1H25/WBvyEg9txkvA8bquA0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=vjTYnsLsooqGubDSn0+Cb/S/SEYetel+HRlu/9bFGpdu4jWPqFrlTsqhUlhHGp0H55tLu9DMKu8jGT81qb9KMw4gmpAup+5Eyj8MwJThYFpJ+1qXq4OsF4bBYo4VwMaMbaKk2OLnIlVvc4G/xgZoIhZmyKouyz5JXoNAQVf2LIw= Received: by 10.150.82.10 with SMTP id f10mr673065ybb.150.1209538971503; Wed, 30 Apr 2008 00:02:51 -0700 (PDT) Received: by 10.150.158.8 with HTTP; Wed, 30 Apr 2008 00:02:51 -0700 (PDT) Message-ID: Date: Wed, 30 Apr 2008 11:02:51 +0400 To: "Christopher Thompson" Cc: internals@lists.php.net In-Reply-To: <4817ABBB.2020804@nexopia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4817ABBB.2020804@nexopia.com> Subject: Re: [PHP-DEV] OS X, enable embed problem, patch From: indeyets@gmail.com ("Alexey Zakhlestin") shouldn't autotools take care about these differences? On 4/30/08, Christopher Thompson wrote: > 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 > ;; > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Alexey Zakhlestin http://blog.milkfarmsoft.com/