]>
Commit | Line | Data |
---|---|---|
853ff239 AF |
1 | --- libtool-1.4.3/ltmain.sh.wiget Thu Oct 24 16:57:17 2002 |
2 | +++ libtool-1.4.3/ltmain.sh Thu Oct 24 16:57:17 2002 | |
3 | @@ -768,6 +768,7 @@ | |
a78d25c2 AM |
4 | linker_flags= |
5 | dllsearchpath= | |
6 | lib_search_path=`pwd` | |
9b8d6a58 | 7 | + inst_prefix_dir="$DESTDIR" |
a78d25c2 AM |
8 | |
9 | avoid_version=no | |
10 | dlfiles= | |
853ff239 | 11 | @@ -898,6 +899,11 @@ |
a78d25c2 AM |
12 | prev= |
13 | continue | |
14 | ;; | |
15 | + inst_prefix) | |
16 | + inst_prefix_dir="$arg" | |
17 | + prev= | |
18 | + continue | |
19 | + ;; | |
20 | release) | |
21 | release="-$arg" | |
22 | prev= | |
853ff239 | 23 | @@ -999,6 +1005,11 @@ |
a78d25c2 AM |
24 | continue |
25 | ;; | |
26 | ||
27 | + -inst-prefix-dir) | |
28 | + prev=inst_prefix | |
29 | + continue | |
30 | + ;; | |
31 | + | |
32 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* | |
33 | # so, if we see these flags be careful not to treat them like -L | |
34 | -L[A-Z][A-Z]*:*) | |
853ff239 | 35 | @@ -1887,6 +1898,7 @@ |
a78d25c2 AM |
36 | |
37 | if test "$linkmode" = prog || test "$mode" = relink; then | |
38 | add_shlibpath= | |
39 | + add_prefix_dir= | |
40 | add_dir= | |
41 | add= | |
42 | # Finalize command for both is simple: just hardcode it. | |
853ff239 | 43 | @@ -1907,10 +1919,22 @@ |
a78d25c2 AM |
44 | add="-l$name" |
45 | fi | |
46 | ||
47 | + if test -n "$inst_prefix_dir"; then | |
48 | + case "$libdir" in | |
49 | + [\\/]*) | |
50 | + add_prefix_dir="-L$inst_prefix_dir$libdir" | |
51 | + ;; | |
52 | + esac | |
53 | + fi | |
54 | + | |
55 | + # add_prefix_dir must be appended instead, otherwise it can | |
56 | + # possibly be overrided by any hardcoded -L/... path in deplibs | |
57 | if test "$linkmode" = prog; then | |
58 | + test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir" | |
59 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" | |
60 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" | |
61 | else | |
62 | + test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir" | |
63 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | |
64 | test -n "$add" && deplibs="$add $deplibs" | |
65 | fi | |
853ff239 | 66 | @@ -4229,6 +4253,24 @@ |
a78d25c2 AM |
67 | dir="$dir$objdir" |
68 | ||
69 | if test -n "$relink_command"; then | |
70 | + # Determine the prefix the user has applied to our future dir. | |
71 | + inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` | |
72 | + | |
73 | + # Don't allow the user to place us outside of our expected | |
74 | + # location b/c this prevents finding dependent libraries that | |
75 | + # are installed to the same prefix. | |
76 | + if test "$inst_prefix_dir" = "$destdir"; then | |
77 | + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | |
78 | + exit 1 | |
79 | + fi | |
80 | + | |
81 | + if test -n "$inst_prefix_dir"; then | |
82 | + # Stick the inst_prefix_dir data into the link command. | |
83 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` | |
84 | + else | |
85 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` | |
86 | + fi | |
87 | + | |
88 | $echo "$modename: warning: relinking \`$file'" 1>&2 | |
89 | $show "$relink_command" | |
90 | if $run eval "$relink_command"; then : |