[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Libtool doesn't set -rpath automatically when needed?
From: |
Benoit SIGOURE |
Subject: |
Libtool doesn't set -rpath automatically when needed? |
Date: |
Fri, 2 Nov 2007 22:34:13 +0100 |
Hi list,
On GNU/Linux Debian with GCC 4.1 / Debian's libtool 1.5.22-4
(1.1220.2.365 2005/12/18 22:14:06), I have Boost installed under /usr/
local/lib (pre-built binaries: http://www.tsunanet.net/~tsuna/
boost_1_34_1-i486-linux-gcc41.tar.gz) and when I link with `-
lboost_thread-gcc41-mt-1_34_1 -pthread' I can't run the executable
without manually setting LD_LIBRARY_PATH. Shouldn't libtool do
something about this? I know that Boost doesn't come with .la files
but since /usr/local/lib isn't in sys_lib_search_path_spec, shouldn't
it use -rpath and friends when available/required?
What would be the best solution to handle this issue? Write my own
check to see how to set the rpath (-rpath/-Wl,-rpath/-R/etc.) and
check if linking against -lboost_thread* requires a -rpath or not,
and if it does, automagically add it to BOOST_THREADS_LDFLAGS? That
sounds tedious. And how is it going to work on, say, OSX, where
there is no -rpath/-R? Moreover, I don't see how to do such a check
while preserving cross-compilation capabilities (since checking
whether -rpath works or not requires to run the binary somehow,
doesn't it? Or maybe analyzing the output of `ldd'? But it surely
isn't something standard, for instance on OSX it's `otool -L' and it
requires the package odcctools...).
Any suggestion would be appreciated.
Thanks.
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
PGP.sig
Description: This is a digitally signed message part
- Libtool doesn't set -rpath automatically when needed?,
Benoit SIGOURE <=