Re: config.m4 Macros and static libs

From: Date: Mon, 07 Sep 2009 19:45:39 +0000
Subject: Re: config.m4 Macros and static libs
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6624@lists.php.net to get a copy of this message
Did you really think I didn't try it in the first place? Why would I start digging into the m4 file with the PHP_* Macros, though I am not really familiar with M4. Anyway, it seems the check might work, if there wasn't the second lib as dependency. Here is what I am doing right now: PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,[ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $OMAPI_DIR/lib, OMAPI_STATIC_LIBADD) AC_DEFINE(HAVE_OMAPILIB,1,we have the DHCPCTL lib.[]) ],[ AC_MSG_ERROR([dhcpctl lib not found.]) ],[ -L$OMAPI_DIR/lib -lomapi ]) PHP_SUBST(OMAPI_STATIC_LIBADD) Unfortunately dhcpctl needs the omapi lib. Now, config log says: configure:4706: cc -o conftest -g -O2 -lomapi conftest.c -ldhcpctl >&5 /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../lib64/libdhcpctl.a(dhcpctl.o): In function `dhcpctl_object_remove': (.text+0x76): undefined reference to `omapi_message_new' Obviously -lomapi is passed, but yet I get unresolved symbols. Both libs reside in the same system lib path, which means both should be found accordingly. Could this be related to the ordering of parameters passed to gcc? Regards -Sven On Mon, September 7, 2009 10:36, Jani Taskinen wrote: > On 09/06/2009 10:53 PM, Sven Eschenberg wrote: >> Dear List, >> >> My request is a little arkward, since I am not too familiar with the gnu >> build tools. I want to write a PECL extension for PHP that exploits the >> features of a specific lib. Unfortunately the lib is only available as >> static lib (actually it's two libs - anyhow, this shouldn't change too >> much). >> As far as I could gather from the m4 file that defines the PHP_* Macros, >> the PHP_CHECK_LIBRARY Macro only works for shared libs. What would be > > Fail. It doesn't care what your library is as long as it's found. :) > > Try before you ask? It's not that hard. And if you have actual problem > with some errors or something, THEN ask.. > > --Jani > > > > -- > PECL development discussion Mailing List (http://pecl.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.pecl.dev (#6624) next »