]> git.pld-linux.org Git - packages/libtool.git/blame - libtool-relink.patch
add one missing chunk from old patch and patch ltmain.in too
[packages/libtool.git] / libtool-relink.patch
CommitLineData
485bc36f
AF
1--- libtool-1.4.3/ltmain.sh.wiget Tue Nov 19 13:34:10 2002
2+++ libtool-1.4.3/ltmain.sh Tue Nov 19 13:34:56 2002
853ff239 3@@ -768,6 +768,7 @@
a78d25c2
AM
4 linker_flags=
5 dllsearchpath=
6 lib_search_path=`pwd`
485bc36f 7+ inst_prefix_dir=
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
485bc36f
AF
66@@ -3928,7 +3952,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@@ -4229,6 +4253,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 :
100--- libtool-1.4.3/ltmain.in.wiget Tue Nov 19 13:34:10 2002
101+++ libtool-1.4.3/ltmain.in Tue Nov 19 13:35:15 2002
102@@ -768,6 +768,7 @@
103 linker_flags=
104 dllsearchpath=
105 lib_search_path=`pwd`
106+ inst_prefix_dir=
107
108 avoid_version=no
109 dlfiles=
110@@ -898,6 +899,11 @@
111 prev=
112 continue
113 ;;
114+ inst_prefix)
115+ inst_prefix_dir="$arg"
116+ prev=
117+ continue
118+ ;;
119 release)
120 release="-$arg"
121 prev=
122@@ -999,6 +1005,11 @@
123 continue
124 ;;
125
126+ -inst-prefix-dir)
127+ prev=inst_prefix
128+ continue
129+ ;;
130+
131 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
132 # so, if we see these flags be careful not to treat them like -L
133 -L[A-Z][A-Z]*:*)
134@@ -1887,6 +1898,7 @@
135
136 if test $linkmode = prog || test "$mode" = relink; then
137 add_shlibpath=
138+ add_prefix_dir=
139 add_dir=
140 add=
141 # Finalize command for both is simple: just hardcode it.
142@@ -1907,10 +1919,22 @@
143 add="-l$name"
144 fi
145
146+ if test -n "$inst_prefix_dir"; then
147+ case "$libdir" in
148+ [\\/]*)
149+ add_prefix_dir="-L$inst_prefix_dir$libdir"
150+ ;;
151+ esac
152+ fi
153+
154+ # add_prefix_dir must be appended instead, otherwise it can
155+ # possibly be overrided by any hardcoded -L/... path in deplibs
156 if test $linkmode = prog; then
157+ test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir"
158 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
159 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
160 else
161+ test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir"
162 test -n "$add_dir" && deplibs="$add_dir $deplibs"
163 test -n "$add" && deplibs="$add $deplibs"
164 fi
165@@ -3928,7 +3952,7 @@
166 fi
167 done
168 # Quote the link command for shipping.
169- relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
170+ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
171 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
172
173 # Only create the output if not a dry run.
853ff239 174@@ -4229,6 +4253,24 @@
a78d25c2
AM
175 dir="$dir$objdir"
176
177 if test -n "$relink_command"; then
178+ # Determine the prefix the user has applied to our future dir.
179+ inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
180+
181+ # Don't allow the user to place us outside of our expected
182+ # location b/c this prevents finding dependent libraries that
183+ # are installed to the same prefix.
184+ if test "$inst_prefix_dir" = "$destdir"; then
185+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
186+ exit 1
187+ fi
188+
189+ if test -n "$inst_prefix_dir"; then
190+ # Stick the inst_prefix_dir data into the link command.
191+ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
192+ else
193+ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
194+ fi
195+
196 $echo "$modename: warning: relinking \`$file'" 1>&2
197 $show "$relink_command"
198 if $run eval "$relink_command"; then :
This page took 0.060444 seconds and 4 git commands to generate.