autoconf
[Top][All Lists]
Advanced

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

Re: Finding dependencies in lib64 or lib


From: Ralf Corsepius
Subject: Re: Finding dependencies in lib64 or lib
Date: Thu, 11 Feb 2010 15:27:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Thunderbird/3.0.1

On 02/11/2010 03:14 PM, Daniel Pocock wrote:
Ralf Corsepius wrote:
On 02/11/2010 12:37 PM, Daniel Pocock wrote:

Hi,

I've been looking over configure.in for the Ganglia project.

The project depends on some other libs, and their locations can be
specified with configure arguments, for example:

--with-libconfuse=/usr/local

The original configure.in would then try -L/usr/local/lib

However, there are platforms where 64 bit libraries should be in
*/lib64, e.g. the search for libconfuse should try /usr/local/lib64 on
those platforms.

My initial solution is to test $host

LIB_SUFFIX=lib
case $host in
x86_64-redhat-linux*)
    LIB_SUFFIX=lib64
esac

but a proper solution
A proper solution is not to try tricks like the one above, but to let
the user specify the directory he needs, if he needs special settings.

In most cases he won't have to, because on e.g. on redhat-based systems,
/usr/lib64 is in of GCC's default library search path.
It is not quite so simple

It is

- the third party library may be installed
elsewhere, e.g. /opt/confuse-2.6/lib64

configure LDFLAGS=-L/opt/confuse-2.6/lib64
The --with-libconfuse option only accepts the base directory (e.g.
--with-libconfuse=/opt/confuse-2.6)
Well, your approach is broken :)

On a wider scale, it is even more broken than you might think:

The fact some systems use "lib64" actually is arbitrary. The, what you call "LIB_SUFFIX" is a more or less arbitrary chosen convention of the OS vendor.

Many embedded system's compilers e.g. use many multilibs, with many different library names. Even some *nix'sh OSes do so (E.g. some sparc Solaris variants did (do? I don't have access to Solaris machines anymore) so).

  and configure has to decide whether
to append /lib or /lib64 to find the right dependencies.

On some systems (e.g. a host used for building 32 and 64 bit packages),
there may be two versions of libconfuse installed, e.g.

/opt/confuse-2.6/lib/libconfuse.so (32 bit)
configure LDFLAGS=-L/opt/confuse-2.6/lib \
  CPPFLAGS=-I/opt/confuse-2.6/include \
  CFLAGS="-g -O2 -m32" \
--libdir=/opt/confuse-2.6/lib
...

/opt/confuse-2.6/lib64/libconfuse.so (64 bit)

and our original configure.in would never look in the 64 bit directory.

configure LDFLAGS=-L/opt/confuse-2.6/lib64 \
  CPPFLAGS=-I/opt/confuse-2.6/include \
  CFLAGS="-g -O2 -m64" \
--libdir=/opt/confuse-2.6/lib64
...

Ralf





reply via email to

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