This patch makes Zend includes its "own" set of libraries, so
that external support libs used by PHP extensions are linked once
when building PHP lib. I simply define ZEND_LIBS. I cannot tell what
impact this would otherwise have. I'm not that familiar with the PHP code.
I guess, AC_SUBST(ZEND_LIBS) has to be used in PHP's configure.in as well.

Index: Makefile.am
===================================================================
RCS file: /repository/Zend/Makefile.am,v
retrieving revision 1.43
diff -u -r1.43 Makefile.am
--- Makefile.am 2001/09/19 08:26:11     1.43
+++ Makefile.am 2001/12/16 02:15:47
@@ -15,7 +15,7 @@
        zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
        zend_ini.c zend_qsort.c
 
-libZend_la_LDFLAGS = @EXTRA_LIBS@
+libZend_la_LDFLAGS = @ZEND_LIBS@
 
 # automake isn't too clever about "non-standard" use of lex and yacc
 
Index: configure.in
===================================================================
RCS file: /repository/Zend/configure.in,v
retrieving revision 1.31
diff -u -r1.31 configure.in
--- configure.in        2000/12/02 13:26:41     1.31
+++ configure.in        2001/12/16 02:15:47
@@ -35,9 +35,9 @@
 LIBZEND_ENABLE_DEBUG
 LIBZEND_OTHER_CHECKS
 
-EXTRA_LIBS="$LIBS"
+ZEND_LIBS="$LIBS"
 LIBS=""
-AC_SUBST(EXTRA_LIBS)
+AC_SUBST(ZEND_LIBS)
 AC_OUTPUT(Makefile)
 
 # Local Variables:

-------

--
  Adam

not On Fri, Dec 14, 2001 at 07:44:28PM +0200, Jani Taskinen wrote:
> 
> Does this happen with latest CVS?
> 
> --Jani
> 
> 
> On Fri, 14 Dec 2001, Adam Dickmeiss wrote:
> 
> >I have the following problem. On UNIX, PHP fails to link with
> >a static library generated by Libtool. Problem occurs with PHP 4.1.0
> >but not PHP 4.0.6. The YAZ extension, for example, which I maintain
> >generates by default a static Libtool library only. So After doing
> >   cd yaz-1.8.3
> >   ./configure --prefix=/usr
> >   make
> >   make install
> >
> >two files are created, namely /usr/lib/libyaz.a and /lib/lib/libyaz.la.
> >
> >For PHP I do :
> >   ./configure --with-yaz [other options]
> >
> >and get the folloing make output:
> >..
> >/bin/sh ../libtool --silent --mode=link gcc  -g -O2 -prefer-pic  -o libZend.la  
>-ldl -lyaz -lcrypt -lresolv -lm -ldl -lnsl  -lresolv
> >-lcrypt  zend_language_parser.lo zend_language_scanner.lo zend_ini_parser.lo 
>zend_ini_scanner.lo zend_alloc.lo zend_compile.lo zend_c
> >onstants.lo zend_dynamic_array.lo zend_execute.lo zend_execute_API.lo 
>zend_highlight.lo zend_llist.lo zend_opcode.lo zend_operators.l
> >o zend_ptr_stack.lo zend_stack.lo zend_variables.lo zend.lo zend_API.lo 
>zend_extensions.lo zend_hash.lo zend_list.lo zend_indent.lo z
> >end_builtin_functions.lo zend_sprintf.lo zend_ini.lo
> >make[1]: Leaving directory `/home/adam/proj/php-4.1.0/Zend'
> >...
> >/bin/sh /home/adam/proj/php-4.1.0/libtool --silent --mode=link gcc  -I. 
>-I/home/adam/proj/php-4.1.0/ -I/home/adam/proj/php-4.1.0/main
> > -I/home/adam/proj/php-4.1.0 -I/home/adam/proj/apache/include 
>-I/home/adam/proj/php-4.1.0/Zend -I/home/adam/proj/php-4.1.0/ext/mysql/
> >libmysql -I/home/adam/proj/php-4.1.0/ext/xml/expat  -DLINUX=22 -DUSE_HSREGEX 
>-DUSE_EXPAT -I/home/adam/proj/php-4.1.0/TSRM -g -O2 -pre
> >fer-pic   -o libphp4.la -rpath /home/adam/proj/php-4.1.0/libs -avoid-version   
>stub.lo  Zend/libZend.la sapi/apache/libsapi.la main/l
> >ibmain.la regex/libregex.la ext/mysql/libmysql.la ext/pcre/libpcre.la 
>ext/posix/libposix.la ext/session/libsession.la ext/standard/li
> >bstandard.la ext/xml/libxml.la ext/yaz/libyaz.la TSRM/libtsrm.la -ldl -lyaz -lcrypt 
>-lresolv -lm -ldl -lnsl -lresolv -lcrypt
> >/usr/lib/libyaz.a(odr_bool.o): In function `odr_bool':
> >/home/adam/proj/yaz/odr/odr_bool.c(.text+0x0): multiple definition of `odr_bool'
> >Zend/.libs/libZend.al(odr_bool.o)(.text+0x0):/home/adam/proj/yaz/odr/odr_bool.c: 
>first defined here
> >/usr/lib/libyaz.a(ber_bool.o): In function `ber_boolean':
> >[many more multiple symbols]
> >
> >The log indicates that all YAZ symbols are included twice. Apparenly the
> >Zend link step includes YAZ verbatim even though NO symbols should be needed
> >to built that.
> >
> >Solutions / work-arounds:
> >
> >1) removing /usr/lib/libyaz.la makes it work. Suddenly, the Zend link step
> >   doesn't include YAZ so everything is fine. Libtool bug?
> >
> >2) removing the linkage of yaz from the Zend link step obviously makes it
> >   work too.
> >
> >3) build shared YAZ objects is a fix too. (./configure --enabled-shared for YAZ).
> >
> >The problem doesn't occur with PHP 4.0.6. Probably due to the fact that
> >it uses libtool 1.3.5.
> >
> >The problem currently only exists with YAZ (I guess most other packages
> >are shared objects ONLY). But it would really be convenient if extensions
> >could use static libraries as well.
> >
> >If this is a libtool bug and there's no easy fix for that, my suggestion would be
> >that Zend doesn't link with YAZ or other extension libraries. Fix 2) above.
> >
> >-- Adam
> >
> >

-- 
Adam Dickmeiss  mailto:[EMAIL PROTECTED]  http://www.indexdata.dk
Index Data      T: +45 33410100           Mob.: 212 212 66

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to