Re: config.m4 Macros and static libs

From: Date: Thu, 17 Sep 2009 23:57:11 +0000
Subject: Re: config.m4 Macros and static libs
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6634@lists.php.net to get a copy of this message
So, since I am still stuck with this, does anybody have a useful pointer to some Documentation, how to resolve the issue, or should the M4 Macro be considered broken. Or could someone advise some other place to turn to, where I can find someone, who might be able, to help me work out this issue? Regards -Sven -------- Original-Nachricht -------- Betreff: Re: [PECL-DEV] config.m4 Macros and static libs Datum: Mon, 7 Sep 2009 21:45:39 +0200 (CEST) Von: Sven Eschenberg <sven@whgl.uni-frankfurt.de> Antwort an: sven@whgl.uni-frankfurt.de An: pecl-dev@lists.php.net Referenzen: <4AA41333.1030803@whgl.uni-frankfurt.de> <4AA4C605.5090406@iki.fi> 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 (#6634) next »