]>
Commit | Line | Data |
---|---|---|
b90bc135 | 1 | diff -urN aspell-0.50.2.orig/ltmain.sh aspell-0.50.2/ltmain.sh |
2 | --- aspell-0.50.2.orig/ltmain.sh Sun Oct 6 15:12:12 2002 | |
3 | +++ aspell-0.50.2/ltmain.sh Sun Oct 6 15:32:35 2002 | |
4 | @@ -807,6 +807,7 @@ | |
5 | linker_flags= | |
6 | dllsearchpath= | |
7 | lib_search_path=`pwd` | |
8 | + inst_prefix_dir= | |
9 | ||
10 | avoid_version=no | |
11 | dlfiles= | |
12 | @@ -902,6 +903,11 @@ | |
3c207d30 JB |
13 | prev= |
14 | continue | |
15 | ;; | |
16 | + inst_prefix) | |
17 | + inst_prefix_dir="$arg" | |
18 | + prev= | |
19 | + continue | |
20 | + ;; | |
21 | release) | |
22 | release="-$arg" | |
23 | prev= | |
b90bc135 | 24 | @@ -1146,6 +1152,10 @@ |
25 | fi | |
26 | continue | |
27 | ;; | |
28 | + -inst-prefix-dir) | |
29 | + prev=inst_prefix | |
30 | + continue | |
31 | + ;; | |
32 | ||
33 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* | |
34 | # so, if we see these flags be careful not to treat them like -L | |
35 | @@ -2237,6 +2247,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 | @@ -2256,11 +2267,24 @@ | |
44 | add_dir="-L$libdir" | |
45 | add="-l$name" | |
46 | fi | |
47 | + | |
48 | + if test -n "$inst_prefix_dir"; then | |
49 | + case "$libdir" in | |
50 | + [\\/]*) | |
51 | + add_prefix_dir="-L$inst_prefix_dir$libdir" | |
52 | + ;; | |
53 | + esac | |
54 | + fi | |
55 | + | |
56 | + # add_prefix_dir must be appended instead, otherwise it can | |
57 | + # possibly be overrided by any hardcoded -L/... path in deplibs | |
58 | ||
59 | if test "$linkmode" = prog; then | |
60 | + test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir" | |
61 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" | |
62 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" | |
63 | else | |
64 | + test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir" | |
65 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | |
66 | test -n "$add" && deplibs="$add $deplibs" | |
67 | fi | |
68 | @@ -4420,7 +4444,7 @@ | |
69 | fi | |
70 | done | |
71 | # Quote the link command for shipping. | |
72 | - relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" | |
73 | + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" | |
74 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | |
75 | ||
76 | # Only create the output if not a dry run. | |
77 | @@ -4721,6 +4745,24 @@ | |
78 | dir="$dir$objdir" | |
79 | ||
80 | if test -n "$relink_command"; then | |
81 | + # Determine the prefix the user has applied to our future dir. | |
82 | + inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` | |
83 | + | |
84 | + # Don't allow the user to place us outside of our expected | |
85 | + # location b/c this prevents finding dependent libraries that | |
86 | + # are installed to the same prefix. | |
87 | + if test "$inst_prefix_dir" = "$destdir"; then | |
88 | + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | |
89 | + exit 1 | |
90 | + fi | |
91 | + | |
92 | + if test -n "$inst_prefix_dir"; then | |
93 | + # Stick the inst_prefix_dir data into the link command. | |
94 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` | |
95 | + else | |
96 | + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` | |
97 | + fi | |
98 | + | |
99 | $echo "$modename: warning: relinking \`$file'" 1>&2 | |
100 | $show "$relink_command" | |
101 | if $run eval "$relink_command"; then : |