b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 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 | Signed-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 |