]>
Commit | Line | Data |
---|---|---|
a78d25c2 AM |
1 | --- libtool-1.4.1/ltmain.sh.relink Wed Oct 3 02:05:35 2001 |
2 | +++ libtool-1.4.1/ltmain.sh Wed Oct 3 05:16:14 2001 | |
3 | @@ -754,6 +754,7 @@ | |
4 | linker_flags= | |
5 | dllsearchpath= | |
6 | lib_search_path=`pwd` | |
7 | + inst_prefix_dir= | |
8 | ||
9 | avoid_version=no | |
10 | dlfiles= | |
11 | @@ -884,6 +885,11 @@ | |
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= | |
23 | @@ -985,6 +991,11 @@ | |
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]*:*) | |
35 | @@ -1866,6 +1877,7 @@ | |
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. | |
43 | @@ -1886,10 +1898,22 @@ | |
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 | |
66 | @@ -3856,7 +3880,7 @@ | |
67 | fi | |
68 | done | |
69 | # Quote the link command for shipping. | |
70 | - relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" | |
71 | + relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@" | |
72 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | |
73 | ||
74 | # Only create the output if not a dry run. | |
75 | @@ -4157,6 +4181,24 @@ | |
76 | dir="$dir$objdir" | |
77 | ||
78 | if test -n "$relink_command"; then | |
79 | + # Determine the prefix the user has applied to our future dir. | |
80 | + inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` | |
81 | + | |
82 | + # Don't allow the user to place us outside of our expected | |
83 | + # location b/c this prevents finding dependent libraries that | |
84 | + # are installed to the same prefix. | |
85 | + if test "$inst_prefix_dir" = "$destdir"; then | |
86 | + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | |
87 | + exit 1 | |
88 | + fi | |
89 | + | |
90 | + if test -n "$inst_prefix_dir"; then | |
91 | + # Stick the inst_prefix_dir data into the link command. | |
92 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` | |
93 | + else | |
94 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` | |
95 | + fi | |
96 | + | |
97 | $echo "$modename: warning: relinking \`$file'" 1>&2 | |
98 | $show "$relink_command" | |
99 | if $run eval "$relink_command"; then : |