Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34707 invoked from network); 30 Apr 2008 07:52:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Apr 2008 07:52:07 -0000 Authentication-Results: pb1.pair.com header.from=buildsmart@daleenterprise.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=buildsmart@daleenterprise.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daleenterprise.com designates 67.78.11.229 as permitted sender) X-PHP-List-Original-Sender: buildsmart@daleenterprise.com X-Host-Fingerprint: 67.78.11.229 daleenterprise.com Received: from [67.78.11.229] ([67.78.11.229:65338] helo=daleenterprise.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/CF-28930-42528184 for ; Wed, 30 Apr 2008 03:52:07 -0400 Received: from localhost (localhost [127.0.0.1]) by daleenterprise.com (Postfix) with ESMTP id 18F7375481D; Wed, 30 Apr 2008 03:52:02 -0400 (EDT) Received: from daleenterprise.com ([127.0.0.1]) by localhost (daleenterprise.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29783-01; Wed, 30 Apr 2008 03:51:55 -0400 (EDT) Received: from [10.1.100.11] (daleenterprise.com [10.1.100.11]) by daleenterprise.com (Postfix) with ESMTP id 51C5B754806; Wed, 30 Apr 2008 03:51:55 -0400 (EDT) In-Reply-To: <4817ABBB.2020804@nexopia.com> References: <4817ABBB.2020804@nexopia.com> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-33--693519938" Message-ID: Cc: internals@lists.php.net Date: Wed, 30 Apr 2008 03:51:53 -0400 To: Christopher Thompson Content-Transfer-Encoding: 7bit X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) MTA-Interface: amavisd-new-2.3.3 (2005-08-22) + Maia Mailguard 1.1.0 at daleenterprise.com X-Spam-Scanned: using SpamAssassin 3.1.7 (2006-10-05) at daleenterprise.com X-Virus-Scanned: using ClamAV 0.88.6 (2006-11-05) at daleenterprise.com Subject: Re: [PHP-DEV] OS X, enable embed problem, patch From: buildsmart@daleenterprise.com (BuildSmart) --Apple-Mail-33--693519938 Content-Type: multipart/alternative; boundary=Apple-Mail-32--693520102 --Apple-Mail-32--693520102 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed This is taken care of by "auto" tools. If you are experiencing build issues of public releases then you're doing something wrong. I build PHP for a living in OS X and I've encountered no build issues what-so-ever related to building with dylib linking but the resulting binary will (should) still be libphp.so because apache expects this. If you need some help I can spare a few moments and examine your build environment and offer you some pointers/advice that should help you to develop better binary builds. Out of curiosity, why are you enabling embedded in this manner, there are very few reason that PHP needs to be built this way and the environment and dependancies need to be established for the build to be successful. When building for embedding purposes you really want a static build (libphp.a rather than libphp.so) so I'm having a hard time understanding what exactly it is you're trying to achieve. -- Dale On Apr 29, 2008, at 19:14 PM, 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 > > -- Dale --Apple-Mail-32--693520102 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 This is taken care of by "auto" tools.

If you are experiencing = build issues of public releases then you're doing something = wrong.

I = build PHP for a living in OS X and I've encountered no build issues = what-so-ever related to building with dylib linking but the resulting = binary will (should) still be libphp.so because apache expects = this.

If you = need some help I can spare a few moments and examine your build = environment and offer you some pointers/advice that should help you to = develop better binary builds.

Out of=A0curiosity, why = are you enabling embedded in this manner, there are very few reason that = PHP needs to be built this way and the environment and dependancies need = to be established for the build to be = successful.

When building for embedding = purposes you really want a static build (libphp.a rather than libphp.so) = so I'm having a hard time understanding what exactly it is you're trying = to=A0achieve.

=A0-- Dale

On Apr 29, 2008, = at 19:14 PM, Christopher Thompson wrote:

Please be gentle, I have very little experience = developing on OS X.=A0 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:

Suspected problem:
Trying = to build .so instead of .dylib on OS X.

Suggested = solution:
See patch below.=A0 This makes it possible to = do:
./configure = --enable-embed=3Ddylib
I did this instead of = fixing --enable-embed=3Dshared because the build process appears to be = fundamentally different.

NOTE!=A0 Once applying the patch, you = need to do:
aclocal
autoconf
./configure = --enable-embed=3Ddylib
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 @@
=A0 = $(LIBTOOL) --mode=3Dlink $(CC) $(CFLAGS) $(EXTRA_CFLAGS) = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) = $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o = $@
=A0 = -@$(LIBTOOL) --silent --mode=3Dinstall cp $@ = $(phptempdir)/$@ >/dev/null 2>&1

+ $(LIBTOOL) --mode=3Dlink $(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=3D.o) $(PHP_SAPI_OBJS:.lo=3D.o) $(EXTRA_LIBS) = $(ZEND_EXTRA_LIBS) -o $@
+ = -@$(LIBTOOL) --silent --mode=3Dinstall cp $@ $(phptempdir)/$@ = >/dev/null 2>&1
+
=A0libs/libphp$(PHP_MAJOR_VERSION).= bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
=A0 $(CC) $(MH_BUNDLE_FLAGS) = $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) = $(PHP_GLOBAL_OBJS:.lo=3D.o) $(PHP_SAPI_OBJS:.lo=3D.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 @@
=A0])

=A0dnl
+dnl PHP_BUILD_DYLIB
+=A0 PHP_BUILD_PROGRAM
+=A0 = OVERALL_TARGET=3Dlibphp[]$PHP_MAJOR_VERSION[.dylib]
+=A0 = php_build_target=3Dstatic
+])
+
+dnl
=A0dnl = PHP_BUILD_BUNDLE
=A0dnl
=A0AC_DEFUN([PHP_BUILD_BUNDLE],[
@@ -885,6 +894,7 @@
=A0=A0 case "$2" in
=A0=A0 = static[)] PHP_BUILD_STATIC;;
=A0=A0 shared[)] = PHP_BUILD_SHARED;;
+=A0 dylib[)]=A0 PHP_BUILD_DYLIB;;
=A0=A0 = bundle[)] PHP_BUILD_BUNDLE;;
=A0=A0 program[)] = PHP_BUILD_PROGRAM($5);;
=A0=A0 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 @@
=A0dnl paths to the targets are = relative to the build directory
=A0SAPI_SHARED=3Dlibs/libphp[]$PHP_= MAJOR_VERSION[.]$SHLIB_DL_SUFFIX_NAME
=A0SAPI_STATIC=3Dlibs/libphp[]$PHP_= MAJOR_VERSION[.a]
=A0SAPI_LIBTOOL=3Dlibphp[]$PHP_MAJO= R_VERSION[.la]

=A0PHP_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 @@

=A0PHP_ARG_ENABLE(embed,,
=A0[=A0 --enable-embed[=3DTYPE] = =A0 EXPERIMENTAL: Enable = building of embedded SAPI library
-=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 TYPE is either 'shared' or 'static'. [TYPE=3Dshared]], = no, no)
+=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 TYPE is 'shared', 'static', or 'dylib'. = [TYPE=3Dshared]], no, no)

=A0AC_MSG_CHECKING([for embedded = SAPI library support])
@@ -18,6 +18,10 @@
=A0=A0 =A0 =A0 = PHP_EMBED_TYPE=3Dstatic
=A0=A0 =A0 =A0 = INSTALL_IT=3D"\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; = \$(INSTALL) -m 0644 $SAPI_STATIC = \$(INSTALL_ROOT)\$(prefix)/lib"
=A0=A0 =A0 =A0 ;;
+=A0 =A0 = dylib)
+=A0 =A0 =A0 = PHP_EMBED_TYPE=3Ddylib
+=A0 =A0 =A0 = INSTALL_IT=3D"\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; = \$(INSTALL) -m 0644 $SAPI_DYLIB = \$(INSTALL_ROOT)\$(prefix)/lib"
+=A0 =A0 =A0 ;;
=A0=A0 =A0 = *)
=A0=A0 =A0 =A0 = PHP_EMBED_TYPE=3Dno
=A0=A0 =A0 =A0 ;;


--=A0
PHP = Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



-- Dale


=

= --Apple-Mail-32--693520102-- --Apple-Mail-33--693519938 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFIGCUa0hzWbkf0eKgRAtJQAJ4+sVaBnZ6CFYu119hxRnBxyEBL6gCfZdsK OugoCFmQGHYaoy/EcGyRH5g= =guzb -----END PGP SIGNATURE----- --Apple-Mail-33--693519938--