libtool: bump to 2.4.6
[openwrt/staging/jow.git] / tools / libtool / patches / 100-libdir-fixes.patch
1 From 67ffe8e8582a7ba1f1d1307a419098e6dd88bdaf Mon Sep 17 00:00:00 2001
2 From: Eneas U de Queiroz <cotequeiroz@gmail.com>
3 Date: Tue, 20 Jul 2021 16:41:11 -0300
4 Subject: openwrt: cross-compilation path adjustments
5
6 Comments from the patch:
7
8 Adding 'libdir' from the .la file to our library search paths
9 breaks crosscompilation horribly. We cheat here and don't add
10 it, instead adding the path where we found the .la. -CL
11
12 OE sets installed=no in staging. We need to look in $objdir and $absdir,
13 preferring $objdir. RP 31/04/2008
14
15 This was originally commited to openwrt by Jo-Philipp Wich
16 <jow@openwrt.org>.
17
18 (adjusted to v2.4.6)
19 Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
20
21 --- a/build-aux/ltmain.in
22 +++ b/build-aux/ltmain.in
23 @@ -6049,8 +6049,14 @@ func_mode_link ()
24 absdir=$abs_ladir
25 libdir=$abs_ladir
26 else
27 - dir=$lt_sysroot$libdir
28 - absdir=$lt_sysroot$libdir
29 + # Adding 'libdir' from the .la file to our library search paths
30 + # breaks crosscompilation horribly. We cheat here and don't add
31 + # it, instead adding the path where we found the .la. -CL
32 + dir="$lt_sysroot$abs_ladir"
33 + absdir="$abs_ladir"
34 + libdir="$abs_ladir"
35 + #dir=$lt_sysroot$libdir
36 + #absdir=$lt_sysroot$libdir
37 fi
38 test yes = "$hardcode_automatic" && avoidtemprpath=yes
39 else
40 @@ -6448,8 +6454,6 @@ func_mode_link ()
41 add=$libdir/$linklib
42 fi
43 else
44 - # We cannot seem to hardcode it, guess we'll fake it.
45 - add_dir=-L$libdir
46 # Try looking first in the location we're being installed to.
47 if test -n "$inst_prefix_dir"; then
48 case $libdir in
49 @@ -6604,7 +6608,17 @@ func_mode_link ()
50 fi
51 ;;
52 *)
53 - path=-L$absdir/$objdir
54 + # OE sets installed=no in staging. We need to look in $objdir and $absdir,
55 + # preferring $objdir. RP 31/04/2008
56 + if test -f "$absdir/$objdir/$depdepl" ; then
57 + depdepl="$absdir/$objdir/$depdepl"
58 + path="-L$absdir/$objdir"
59 + elif test -f "$absdir/$depdepl" ; then
60 + depdepl="$absdir/$depdepl"
61 + path="-L$absdir"
62 + else
63 + path="-L$absdir/$objdir"
64 + fi
65 ;;
66 esac
67 else