[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help linking shared libraries / rpath

From: David Byron
Subject: help linking shared libraries / rpath
Date: Fri, 16 Feb 2007 09:08:53 -0800

I'm using autoconf (and automake) to build a couple of static libraries and
some executables -- one executable that actually gets installed, and some
for testing.  Some of these executables depend on "external" libraries (e.g.
boost, xerces).  I've created configure-time args to specify the location of
these libraries.

I'm getting stumped on how to set rpath.  Basically, if someone specifies
--with-foo=foo_path I do this:

FOO_LIB="-L$foo_path/lib -lfoo"

and then I add $FOO_INCLUDE to AM_CPPFLAGS and $FOO_LIB to AM_LDADD in the's where they're used.

I don't know whether foo is gonna be static or shared on any particular
platform.  If it's shared, I (think I) want to set rpath at build time.  So
far I've read:


- a discussion of -rpath and -rpath-link at:


- and most hopefully the thread starting at:

but I looked in the autoconf 2.61 docs and didn't see a mention of
AC_LIB_LINKFLAGS.  I'm using automake 1.10 with Ralf W's fix for generating

Am I supposed to be using libtool to link potentially shared libraries even
if I'm not building any?  I could use some education here.

If it's useful, the primary platforms I'm interested in are SunOS 5.9 (and
potentially other versions) and linux 2.4 and 2.6.  HP/UX is coming soon.  I
plan to use gcc on all these platforms, but if there's a solution that
doesn't depend on this I'd love to hear about it.

Thanks much for your help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]