[Top][All Lists]

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

Re: gmp-4.0.1: Inter-library dependencies vs. DESTDIR installation

From: Christian Cornelssen
Subject: Re: gmp-4.0.1: Inter-library dependencies vs. DESTDIR installation
Date: Tue, 7 May 2002 10:07:49 +0200 (CEST)

Dear Kevin,

On Tue, 7 May 2002, Kevin Ryde wrote:

> Be nice if libtool could address this itself eventually.  For now I'll
> add the following few words to the "Known build problems" in the
> manual.
> `DESTDIR' and shared `libgmpxx'
>      `make install DESTDIR=/my/staging/area' or the same with a `prefix'
>      override to install to a temporary directory may fail when
>      building a shared version of `libgmpxx'.
>      If `libgmp' is already installed in its final location then
>      there's no problem, but if not then unfortunately libtool doesn't
>      know to look in the temporary directory for `libgmp' when
>      relinking `libgmpxx'.
>      A workaround, at least for SVR4 style systems such as GNU/Linux,
>      is to insert a suitable `-L' in the `relink_command' of
>      `libgmpxx.la' after building but before installing.  This can be
>      automated with something like
>           sed '/^relink_command/s:libgmp.la:-L /my/staging/area libgmp.la:' \
>               <libgmpxx.la >libgmpxx.new
>           mv libgmpxx.new libgmpxx.la

Libtool relinks because it wants to safely avoid cases where paths to
build directories are coded into installed binaries.  Therefore, the
problem is not just that -lgmp cannot be found; if found, it must also
reside in a non-temporary directory, at least in systems where library
paths are hardcoded into the binaries.  If using the -L option results
in an "ldd" on the pseudo-installed libgmpxx.so showing libgmp.so.3 in
an unwanted directory, that trick is not recommendable. If that is
why you require a SVR4 style system, forget my blurb... :-)

Anyway, when using -L does _not_ lead to hardcoded library paths, the
system is likely to support omitting -lgmp completely. This would
correspond to removing the `libgmp.la' from libgmpxx_la_LIBADD.
However, whether both solutions apply to the same set of operating
systems is just my estimate. Call it a guess if you like, or (better)
tell me about counterexamples :-)

But let me recall Libtool's operation when linking program
executables. With the --enable-fast-install configuration option, the
binaries are prepared for getting dynamically linked with the
_installed_ libraries, regardless of whether these exist yet. My
interpretation is that Libtool _can_ link with to-be-installed
libraries; essentially we have a demand for an --enable-fast-install
feature for libraries here. To put it simpler, libtool is able to
determine where `-lgmp' should be found because the installation
directory is stored in `libgmp.la'. If it does not exist (yet), then
Libtool could simply try to omit the `-lgmp' in the relinking command.

Best regards,

Christian Cornelssen

reply via email to

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