Gentoo Archives: gentoo-alt

From: "Askar Bektassov (Аскар Бектасов)" <askar.bektassov@×××××.com>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] dev-lang/php-5.4.0_rc7 with apache2 flag does not build libphp5.dylib
Date: Fri, 02 Mar 2012 21:08:33
Message-Id: CAJkPO_TEQ-UOEfxVSowpOB5WQx-caCxqGMMB7-f0uqa9GQx=2w@mail.gmail.com
In Reply to: Re: [gentoo-alt] dev-lang/php-5.4.0_rc7 with apache2 flag does not build libphp5.dylib by Fabian Groffen
1 On Fri, Mar 2, 2012 at 8:50 AM, Fabian Groffen <grobian@g.o> wrote:
2 > On 02-03-2012 00:30:25 +0100, Askar Bektassov (Аскар Бектасов) wrote:
3 >> I am trying to build dev-lang/php-5.4.0_rc7 with apache2 support on Lion OS
4 >> X, however at installation stage the emerge breaks claiming that it does not
5 >> find
6 >>
7 >> ${WORKDIR}//sapis-build/apache2/.lib/libphp5.dylib
8 >>
9 >> when I went inside ${WORKDIR}//sapis-build/apache2 directory I realised that
10 >> the files that have been compiled at the build stage are different
11 >>
12 >> ${WORKDIR}//sapis-build/apache2/lib/libphp5.bundle
13 >>
14 >> ${WORKDIR}//sapis-build/apache2/lib/libphp5.so
15 >>
16 >> and I did not find any rule in the Makefile to build libphp5.dylib. So my
17 >> question is, does this mean that there is a bug in the ebuild process or
18 >> this is a matter of building process of the php package that does not
19 >> envisage building dylib files for apache2 module?
20 >
21 > It would be interesting to see the output of scanmacho on those two
22 > files.  I'd expect an MH_BUNDLE, and I am affraid an MH_DYLIB for the
23 > .so.
24 >
25 >
26 > --
27 > Fabian Groffen
28 > Gentoo on a different level
29
30 Ciao Fabian,
31
32 thanks for your assistance. Unfortunately, is not like you expected
33
34   $ scanmacho libphp5.*
35   ARCH   TYPE   FILE
36   x86_64 MH_BUNDLE libphp5.bundle
37   x86_64 MH_BUNDLE libphp5.so
38
39 so, I went through the Makefile
40
41   [...]
42   OVERALL_TARGET = libs/libphp5.bundle
43   all_targets = $(OVERALL_TARGET) $(PHP_MODULES) $(PHP_ZEND_EX) $(PHP_BINARIES)
44   [...]
45   all: $(all_targets)
46   [...]
47   libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
48      $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS)\
49      $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o)\
50      $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@\
51      && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
52
53 seemingly, libphp5.so is just a mere copy of the libphp5.bundle, and
54 apparently this is a correct behavior in accordance with the following
55 statement
56
57 "Loadable modules are called "bundles" in Mach-O speak. They have the
58 file type MH_BUNDLE. Since no component involved cares about it, they
59 can carry any extension. The extension .bundle is recommended by
60 Apple, but most ported software uses .so for the sake of
61 compatibility". It is not possible to link against bundles as if they
62 were shared libraries. However, it is possible that a bundle is linked
63 against real shared libraries; those will be loaded automatically when
64 the bundle is loaded."
65
66 http://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx
67
68 If the above is correct, I may update the bug
69 (https://bugs.gentoo.org/show_bug.cgi?id=405967) with the proposed
70 workaround attached herewith.
71
72 Cheers,
73 --
74 Askar Bektassov
75 (Аскар Бектасов)

Attachments

File name MIME type
php-5.4.0_rc7.patch application/octet-stream