Subject: Re: rpath flags vs wrapper scripts
To: None <tech-pkg@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-pkg
Date: 10/31/2005 13:16:07
On Sun, Oct 30, 2005 at 08:51:57PM -0500, Dan McMahill wrote:
>
> I think I'm missing something here. libtool is used for building
> libwcalc already. If someone wants to link to libwcalc, it seems like
> they should be able to just do
>
> cc -o foo foo.c `wcalc-config --libs`
>
> but that doesn't quite work unless you can get the correct rpath flags
> into wcalc-config. I took a look at x11/gtk/patch-af and the -Wl,-Rpath
> is just hard patched into gtk-config, but I wonder if that is a portable
> thing or not.
I wouldn't hard code the value, but take a look at the
hardcode_libdir_flag_spec in libtool.m4. That should be the variable you
need. Or use pkg-config magic.
> It seems that `pkg-config gtk+-2.0 --libs` also gives rpath flags
> because they are listed in /usr/pkg/lib/pkgconfig/gtk+-2.0.pc. Further
> digging shows that the magic variable PKGCONFIG_OVERRIDE is what adds
> the rpath flags. So I guess I could use pkg-config for libwcalc instead
> of wcalc-config.
Use pkg-config instead of yet another wrapper script, it saves the life
of many dolphins :-)
Joerg