My .la
file has full pathnames in both the dependency_libs=
section and the libdir=
section which makes it difficult to copy my libraries to a different machine (same arch but different path structure). What is the solution to this, besides having some script to hack the .la
file to adjust for the paths on the new machine?
==Details==
When I ./configure; make; make install
my libfoo
, depending on how I use the --prefix
, --exec-prefix
, and DESTDIR=
flags, I'll get an entry in the libfoo.la
file that reads libdir=/dir1/lib
and I'll have the actual .so
files in the same dir as libfoo.la
. All is well (in terms of linking something with libfoo
as it is) until I package these up and put them on another machine.
Let's say I have libbar
on my second machine which depends on libfoo
. When I use my -L/dir2/lib
flag to look for -lfoo
, the libbar
compilation/linking fails because of the libfoo.la
file is expecting foo to be installed in /dir1/lib
(from the first machine) when it's actually in /dir2/lib
. I then need to replace all of the dir1
's with the correct path, both of which can be long and complicated.
The dependency_libs=
line also comes into play in a similar manner.
How do I avoid this problem?