[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Abusing libtool for library checks?
From: |
Lars Hecking |
Subject: |
Abusing libtool for library checks? |
Date: |
Tue, 22 Oct 2002 13:15:14 +0100 |
User-agent: |
Mutt/1.5.1i |
Similar questions may have been asked before, but not always with a
satisfatory answer IMHO.
I want to check for a certain library. E.g. I would use something like
AC_ARC_WITH(foo,
[ --with-foo[=PREFIX] .... ] ...)
where PREFIX is used to search for libfoo in PREFIX/lib, and related
headers in PREFIX/include. If these directories exist, I can modify
CPPFLAGS/LDFLAGS accordingly, proceed with AC_CHECK_LIB(foo,func...), and
so on.
However, this often fails with shared libraries. E.g. on Solaris < 8, there
is no way to configure the dynamic linker to search non-standard locations
(or there was a conscious decision to not add the library location to ld.so's
search path; that's why --with-foo accepts a path argument). One either has
to specify appropriate LDFLAGS in the environment, or hardcode -R/rpath into
configure. The former requires that the user has sufficient knowledge to
supply the correct LDFLAGS, the latter requires a lot of effort on the
maintainer's side to keep configure portable across platforms.
Most packages I checked roll their own code for this (php-4.x/aclocal.m4
makes interesting reading ;-). But I was wondering whether it is possible
to use libtool for such library checks, as it already has all the
system-specific information about linker flags etc. Has anyone considered
or even tried this before? It is a bit different from library/convenience
library creation.
Environment: autoconf 2.54/automake 1.7.1/libtool 1.4.2 (yes, I have seen
the light, for a new project anyhow :)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Abusing libtool for library checks?,
Lars Hecking <=