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