Re: linking php extension to third party library
| From: | Shao Zhang | Date: | Fri, 24 Aug 2001 01:24:47 +0000 |
| Subject: | Re: linking php extension to third party library | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-64206@lists.php.net to get a copy of this message | ||
On [Thu, 23 Aug 2001 10:33:11 +0200 (CEST)], sniper@iki.fi (Jani Taskinen) wrote:
> Just do what the macro does:
>
> LIBS="$LIBS /with/full/path/to/lib.a"
>
> ie. just don't add -l there.
Thanks. I actually tried this before, and I got the following error:
/bin/sh /work/3-sw/sm91-PHP/php-4.0.6/libtool --silent --mode=link gcc -I.
-I/work/3-sw/sm91-PHP/php-4.0.6/ -I/work/3-sw/sm91-PHP/php-4.0.6/main
-I/work/3-sw/sm91-PHP/php-4.0.6 -I/work/3-sw/sm91-PHP/php-4.0.6/Zend
-I/work/3-sw/sm91-PHP/php-4.0.6/ext/mysql/libmysql -I/work/3-sw/sp2-gwTelco/E-szhang/
-I/work/3-sw/sm91-PHP/php-4.0.6/ext/xml/expat/xmltok
-I/work/3-sw/sm91-PHP/php-4.0.6/ext/xml/expat/xmlparse -I/work/3-sw/sm91-PHP/php-4.0.6/TSRM
-DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g -O2 -o libphp4.la -rpath /work/3-sw/sm91-PHP/php-4.0.6/libs
-L/work/3-sw/sp2-gwTelco/E-szhang/build.out/i386-freebsd/sm1000-OaApi -R
/work/3-sw/sp2-gwTelco/E-szhang/build.out/i386-freebsd/sm1000-OaApi stub.lo Zend/libZend.la
sapi/cgi/libsapi.la main/libmain.la regex/libregex.la ext/mysql/libmysql.la ext/pcre/libpcre.la
ext/posix/libposix.la ext/rbn_mim/librbn_mim.la ext/session/libsession.la
ext/standard/libstandard.la ext/xml/libxml.la TSRM/libtsrm.la -lpam -loa -lcrypt -lm
/work/3-sw/sp2-gwTelco/E-szhang/build.out/i386-freebsd/sm5-CoreLib/lib.a
libtool: link: cannot build libtool library `libphp4.la' from non-libtool objects:
/work/3-sw/sp2-gwTelco/E-szhang/build.out/i386-freebsd/sm5-CoreLib/lib.a
However, if I rename lib.a to something libCore.a, then using the
PHP_ADD_LIBRARY_WITH_PATH macro works.
Regards,
Shao.
>
> --Jani
>
>
>
>
> On 23 Aug 2001, Shao Zhang wrote:
>
> >Hi,
> >
> >I need to link one of my php extension to a third party library. The library
> >is named "lib.a", I cannot copy/rename this file as it is auto generated and
> >shared by others.
> >
> >I can link my php extension to libfoo.a by adding this line to my config.m4:
> >PHP_ADD_LIBRARY_WITH_PATH(foo,
> >"/work/3-sw/sp2-gwTelco/E-szhang/build.out/i386-freebsd/sm1000-OaApi")
> >
> >But I ran out of ideas when the library does not have a name, just lib.a.
> >
> >Thanks for any help in advance.
> >
> >Regards,
> >
> >Shao.
> >
> >
>
--
Shao Zhang Tel: (02) 9209 4838
Software Engineer Fax: (02) 9209 4992
Redfern Broadband Networks (RBN) Mail: szhang@rbni.com