tools: clean up Makefiles / make ccache work
[openwrt/openwrt.git] / tools / libtool / files / libtool-v1.5.patch
1 --- a/ltmain.sh
2 +++ b/ltmain.sh
3 @@ -35,7 +35,7 @@ progpath="$0"
4
5 # The name of this program:
6 progname=`echo "$progpath" | $SED $basename`
7 -modename="$progname"
8 +modename="OpenWrt-$progname-patched-1.5"
9
10 # Global variables:
11 EXIT_SUCCESS=0
12 @@ -297,8 +297,8 @@ func_infer_tag ()
13 # line option must be used.
14 if test -z "$tagname"; then
15 $echo "$modename: unable to infer tagged configuration"
16 - $echo "$modename: specify a tag with \`--tag'" 1>&2
17 - exit $EXIT_FAILURE
18 + $echo "$modename: defaulting to \`CC'"
19 + $echo "$modename: if this is not correct, specify a tag with \`--tag'"
20 # else
21 # $echo "$modename: using $tagname tagged configuration"
22 fi
23 @@ -2462,8 +2462,14 @@ EOF
24 absdir="$abs_ladir"
25 libdir="$abs_ladir"
26 else
27 - dir="$libdir"
28 - absdir="$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="$libdir"
36 + #absdir="$libdir"
37 fi
38 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
39 else
40 @@ -2602,7 +2608,7 @@ EOF
41 { test "$use_static_libs" = no || test -z "$old_library"; }; then
42 if test "$installed" = no; then
43 notinst_deplibs="$notinst_deplibs $lib"
44 - need_relink=yes
45 + need_relink=no
46 fi
47 # This is a shared library
48
49 @@ -2804,7 +2810,6 @@ EOF
50 if test "$hardcode_direct" = yes; then
51 add="$libdir/$linklib"
52 elif test "$hardcode_minus_L" = yes; then
53 - add_dir="-L$libdir"
54 add="-l$name"
55 elif test "$hardcode_shlibpath_var" = yes; then
56 case :$finalize_shlibpath: in
57 @@ -2820,8 +2825,6 @@ EOF
58 add="$libdir/$linklib"
59 fi
60 else
61 - # We cannot seem to hardcode it, guess we'll fake it.
62 - add_dir="-L$libdir"
63 # Try looking first in the location we're being installed to.
64 if test -n "$inst_prefix_dir"; then
65 case $libdir in
66 @@ -5687,6 +5690,10 @@ fi\
67 # Replace all uninstalled libtool libraries with the installed ones
68 newdependency_libs=
69 for deplib in $dependency_libs; do
70 + # Replacing uninstalled with installed can easily break crosscompilation,
71 + # since the installed path is generally the wrong architecture. -CL
72 + newdependency_libs="$newdependency_libs $deplib"
73 + continue
74 case $deplib in
75 *.la)
76 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
77 @@ -5999,8 +6006,12 @@ relink_command=\"$relink_command\""
78 dir="$dir$objdir"
79
80 if test -n "$relink_command"; then
81 + # Strip any trailing slash from the destination.
82 + s_libdir=`$echo "X$libdir" | $Xsed -e 's%/$%%'`
83 + s_destdir=`$echo "X$destdir" | $Xsed -e 's%/$%%'`
84 +
85 # Determine the prefix the user has applied to our future dir.
86 - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
87 + inst_prefix_dir=`$echo "$s_destdir" | $SED "s%$s_libdir\$%%"`
88
89 # Don't allow the user to place us outside of our expected
90 # location b/c this prevents finding dependent libraries that
91 @@ -6008,10 +6019,13 @@ relink_command=\"$relink_command\""
92 # At present, this check doesn't affect windows .dll's that
93 # are installed into $libdir/../bin (currently, that works fine)
94 # but it's something to keep an eye on.
95 - if test "$inst_prefix_dir" = "$destdir"; then
96 - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
97 - exit $EXIT_FAILURE
98 - fi
99 + #
100 + # This breaks install into our staging area. -PB
101 + #
102 + # if test "$inst_prefix_dir" = "$destdir"; then
103 + # $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
104 + # exit $EXIT_FAILURE
105 + # fi
106
107 if test -n "$inst_prefix_dir"; then
108 # Stick the inst_prefix_dir data into the link command.
109 @@ -6020,6 +6034,9 @@ relink_command=\"$relink_command\""
110 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
111 fi
112
113 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
114 + relink_command=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
115 +
116 $echo "$modename: warning: relinking \`$file'" 1>&2
117 $show "$relink_command"
118 if $run eval "$relink_command"; then :