libtool
[Top][All Lists]
Advanced

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

Re: use of libtool for linking executables - rpath problem


From: Paul Davis
Subject: Re: use of libtool for linking executables - rpath problem
Date: Mon, 19 Nov 2001 14:08:00 -0500

>> The 7th is to have the shared library use pkg-config, allowing other
>> tools to find out about it without relying on the linker configuration.
>> Its much cleaner than any of the other choices you mention, and
>> thankfully, has nothing to do with libtool (phew!)
>
>Can you please elaborate more: How is this going to provide the
>platform and compiler specific rpath option?

do you know what pkgconfig is? 

your library would start with a file that looked that this:

----------------------------------------------------------------------
address@hidden@
address@hidden@
address@hidden@
address@hidden@/ardour

Name: libardour
Version: @VERSION@
Description: libardour, a library for building professional digital audio 
applications
Requires: libpbd, libmidi++, libaudioengine >= 1.6.0 , libxml-2.0 >= 2.4.6
Libs: -L${libdir} -lardour @NON_PKG_LIBS@
Cflags: -I${includedir} @NON_PKG_CFLAGS@
----------------------------------------------------------------------

this would be processed by *its* configure script to look like:

----------------------------------------------------------------------
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/ardour

Name: libardour
Version: 0.408.0
Description: libardour, a library for building professional digital audio 
applications
Requires: libpbd, libmidi++, libaudioengine >= 1.6.0 , libxml-2.0 >= 2.4.6
Libs: -L${libdir} -lardour -lsndfile -lgdbm -L/usr/local/lib -lsigc -lpthread 
-L/usr/local/lib -lglib
Cflags: -I${includedir} -I/usr/local/lib/sigc++/include -I/usr/local/include 
-I/usr/local/lib/glib/include -I/usr/local/include
----------------------------------------------------------------------

"make install" will put that file where pkg-config can find it. after
that, its then possible to do:

1) from the shell:

   pkg-config --libs libardour
   
   pkg-config --cflags libardour

2) from another configure script:

   PKG_CHECK_MODULES(ARDOUR,libardour >= someversion)

   resulting in the setting of 

   ARDOUR_LIBS
   ARDOUR_CFLAGS

   to the output of pkg-config --libs libardour and 
   pkg-config --cflags libardour

thus allowing an application to discover precisely what it needs to
know in order to link to, in this case, libardour.

of course, its up to you decide if you want to specify -rpath info, or
rely on the user to set LD_LIBRARY_PATH and/or configure ld.so, but
pkg-config will reflect those choices faithfully.

go read about pkg-config. check google for a URL - i don't have one handy.

its the greatest thing since, well, definitely since all those silly
*.m4 files most of us writing libraries end up with.

--p



reply via email to

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