[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with LIBS generated by a macro
From: |
Ralf Wildenhues |
Subject: |
Re: Problem with LIBS generated by a macro |
Date: |
Sun, 31 Oct 2010 10:05:05 +0100 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Hello Sergio,
* Sergio Belkin wrote on Sat, Oct 30, 2010 at 11:55:17PM CEST:
> I've autoconfiscated a project that link against libresolv and
> libtpthread, and optionally against ssl, mysqlclient and pq. I am
> working on Fedora 13 (i686).
>
> I've found a macro AX_EXT_HAVE_LIB
> (http://www.gnu.org/software/autoconf-archive/ax_ext_have_lib.html)
> that "is identical to AC_SEARCH_LIBS with the exception that will add
> -L<directory> when looking, and use a different variable for each
> directory. " It seems great for me!
>
> The problem is that at the end only take the last library found, in my
> case "pq".
>
> It seems that macro override the earlier value of "LIBS" variable.
This looks like a bug in the AX_EXT_HAVE_LIB macro to me, as it is
documented to only add to LIBS but not remove existing entries.
> I've examined the configure script but it's a bit tricky, you may
> read a snippet about the macro on http://pastebin.com/vHKYp0UR
>
> I've tried modifying macro, replacing the final LIBS="$new_libs" por
> LIBS="$new_libs $LIBS" which you may read on
> http://pastebin.com/DNCCfgnU
>
> But now LIBS ends as: '-lpq -lmysqlclient -lssl -lpthread -lresolv
> -lssl -lpthread -lresolv '
>
> It seems harmless but it's too ugly, isn't it?
Not necessarily.
I suggest you report this to the autoconf-archive-maintainers list,
or their bug tracker, so that the macro can be fixed.
Cheers,
Ralf