Hello,

I have an issue with libtool and cross compile.

When merging a library which uses libtool, it creates the .la file
with libdir= variable, usually it will contain /usr/lib.

When merging another package that also uses libtool and depends on the
library, it takes the libdir value from the .la file and link the .so
using absolute path. So it will be use /usr/lib/<lib>.so

Because of this behavior of libtool, trying to override the library
location by LDFLAGS="-L<whatever>" does not work.

I also tried to specify LDFLAGS="-Wl,--sysroot -Wl,${SYSROOT}" and
LDFALGS="-Wl,-rpath-link -Wl,${SYSROOT}/usr/lib" without luck.

Eventually I ended up with patching every package I use with the
following patch in order to make it work:
--- ltmain.sh.org       2007-11-23 12:28:49.000000000 +0200
+++ ltmain.sh   2007-11-23 12:29:07.000000000 +0200
@@ -7069,7 +7069,7 @@ dlopen='$dlfiles'
 dlpreopen='$dlprefiles'

 # Directory that this library needs to be installed in:
-libdir='$install_libdir'"
+libdir='$ROOT$install_libdir'"
          if test "$installed" = no && test "$need_relink" = yes; then
            $ECHO >> $output "\
 relink_command=\"$relink_command\""


But I don't believe I am the first one who has this problem, and the
idea of patching each package seems not right. I expect the <cross>-ld
to pre-append the cross root to every absolute path.

Best Regards,
Alon Bar-Lev.
-- 
[EMAIL PROTECTED] mailing list

Reply via email to