annotate ltmain.sh @ 51:206448c00b55 stable-1-0-12

Allow multiple contexts with independent add/remove commands.
author Carl Byington <carl@five-ten-sg.com>
date Sat, 24 Jan 2009 15:52:20 -0800
parents 551433a01cab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
551433a01cab initial coding
carl
parents:
diff changeset
1 # ltmain.sh - Provide generalized library-building support services.
551433a01cab initial coding
carl
parents:
diff changeset
2 # NOTE: Changing this file will not affect anything until you rerun configure.
551433a01cab initial coding
carl
parents:
diff changeset
3 #
551433a01cab initial coding
carl
parents:
diff changeset
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
551433a01cab initial coding
carl
parents:
diff changeset
5 # Free Software Foundation, Inc.
551433a01cab initial coding
carl
parents:
diff changeset
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
551433a01cab initial coding
carl
parents:
diff changeset
7 #
551433a01cab initial coding
carl
parents:
diff changeset
8 # This program is free software; you can redistribute it and/or modify
551433a01cab initial coding
carl
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
551433a01cab initial coding
carl
parents:
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
551433a01cab initial coding
carl
parents:
diff changeset
11 # (at your option) any later version.
551433a01cab initial coding
carl
parents:
diff changeset
12 #
551433a01cab initial coding
carl
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
551433a01cab initial coding
carl
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
551433a01cab initial coding
carl
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
551433a01cab initial coding
carl
parents:
diff changeset
16 # General Public License for more details.
551433a01cab initial coding
carl
parents:
diff changeset
17 #
551433a01cab initial coding
carl
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
551433a01cab initial coding
carl
parents:
diff changeset
19 # along with this program; if not, write to the Free Software
551433a01cab initial coding
carl
parents:
diff changeset
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
551433a01cab initial coding
carl
parents:
diff changeset
21 #
551433a01cab initial coding
carl
parents:
diff changeset
22 # As a special exception to the GNU General Public License, if you
551433a01cab initial coding
carl
parents:
diff changeset
23 # distribute this file as part of a program that contains a
551433a01cab initial coding
carl
parents:
diff changeset
24 # configuration script generated by Autoconf, you may include it under
551433a01cab initial coding
carl
parents:
diff changeset
25 # the same distribution terms that you use for the rest of that program.
551433a01cab initial coding
carl
parents:
diff changeset
26
551433a01cab initial coding
carl
parents:
diff changeset
27 # Check that we have a working $echo.
551433a01cab initial coding
carl
parents:
diff changeset
28 if test "X$1" = X--no-reexec; then
551433a01cab initial coding
carl
parents:
diff changeset
29 # Discard the --no-reexec flag, and continue.
551433a01cab initial coding
carl
parents:
diff changeset
30 shift
551433a01cab initial coding
carl
parents:
diff changeset
31 elif test "X$1" = X--fallback-echo; then
551433a01cab initial coding
carl
parents:
diff changeset
32 # Avoid inline document here, it may be left over
551433a01cab initial coding
carl
parents:
diff changeset
33 :
551433a01cab initial coding
carl
parents:
diff changeset
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
551433a01cab initial coding
carl
parents:
diff changeset
35 # Yippee, $echo works!
551433a01cab initial coding
carl
parents:
diff changeset
36 :
551433a01cab initial coding
carl
parents:
diff changeset
37 else
551433a01cab initial coding
carl
parents:
diff changeset
38 # Restart under the correct shell, and then maybe $echo will work.
551433a01cab initial coding
carl
parents:
diff changeset
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
551433a01cab initial coding
carl
parents:
diff changeset
40 fi
551433a01cab initial coding
carl
parents:
diff changeset
41
551433a01cab initial coding
carl
parents:
diff changeset
42 if test "X$1" = X--fallback-echo; then
551433a01cab initial coding
carl
parents:
diff changeset
43 # used as fallback echo
551433a01cab initial coding
carl
parents:
diff changeset
44 shift
551433a01cab initial coding
carl
parents:
diff changeset
45 cat <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
46 $*
551433a01cab initial coding
carl
parents:
diff changeset
47 EOF
551433a01cab initial coding
carl
parents:
diff changeset
48 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
49 fi
551433a01cab initial coding
carl
parents:
diff changeset
50
551433a01cab initial coding
carl
parents:
diff changeset
51 # The name of this program.
551433a01cab initial coding
carl
parents:
diff changeset
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
53 modename="$progname"
551433a01cab initial coding
carl
parents:
diff changeset
54
551433a01cab initial coding
carl
parents:
diff changeset
55 # Constants.
551433a01cab initial coding
carl
parents:
diff changeset
56 PROGRAM=ltmain.sh
551433a01cab initial coding
carl
parents:
diff changeset
57 PACKAGE=libtool
551433a01cab initial coding
carl
parents:
diff changeset
58 VERSION=1.5a
551433a01cab initial coding
carl
parents:
diff changeset
59 TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
551433a01cab initial coding
carl
parents:
diff changeset
60
551433a01cab initial coding
carl
parents:
diff changeset
61 default_mode=
551433a01cab initial coding
carl
parents:
diff changeset
62 help="Try \`$progname --help' for more information."
551433a01cab initial coding
carl
parents:
diff changeset
63 magic="%%%MAGIC variable%%%"
551433a01cab initial coding
carl
parents:
diff changeset
64 mkdir="mkdir"
551433a01cab initial coding
carl
parents:
diff changeset
65 mv="mv -f"
551433a01cab initial coding
carl
parents:
diff changeset
66 rm="rm -f"
551433a01cab initial coding
carl
parents:
diff changeset
67
551433a01cab initial coding
carl
parents:
diff changeset
68 # Sed substitution that helps us do robust quoting. It backslashifies
551433a01cab initial coding
carl
parents:
diff changeset
69 # metacharacters that are still active within double-quoted strings.
551433a01cab initial coding
carl
parents:
diff changeset
70 Xsed="${SED}"' -e 1s/^X//'
551433a01cab initial coding
carl
parents:
diff changeset
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
551433a01cab initial coding
carl
parents:
diff changeset
72 # test EBCDIC or ASCII
551433a01cab initial coding
carl
parents:
diff changeset
73 case `echo A|tr A '\301'` in
551433a01cab initial coding
carl
parents:
diff changeset
74 A) # EBCDIC based system
551433a01cab initial coding
carl
parents:
diff changeset
75 SP2NL="tr '\100' '\n'"
551433a01cab initial coding
carl
parents:
diff changeset
76 NL2SP="tr '\r\n' '\100\100'"
551433a01cab initial coding
carl
parents:
diff changeset
77 ;;
551433a01cab initial coding
carl
parents:
diff changeset
78 *) # Assume ASCII based system
551433a01cab initial coding
carl
parents:
diff changeset
79 SP2NL="tr '\040' '\012'"
551433a01cab initial coding
carl
parents:
diff changeset
80 NL2SP="tr '\015\012' '\040\040'"
551433a01cab initial coding
carl
parents:
diff changeset
81 ;;
551433a01cab initial coding
carl
parents:
diff changeset
82 esac
551433a01cab initial coding
carl
parents:
diff changeset
83
551433a01cab initial coding
carl
parents:
diff changeset
84 # NLS nuisances.
551433a01cab initial coding
carl
parents:
diff changeset
85 # Only set LANG and LC_ALL to C if already set.
551433a01cab initial coding
carl
parents:
diff changeset
86 # These must not be set unconditionally because not all systems understand
551433a01cab initial coding
carl
parents:
diff changeset
87 # e.g. LANG=C (notably SCO).
551433a01cab initial coding
carl
parents:
diff changeset
88 # We save the old values to restore during execute mode.
551433a01cab initial coding
carl
parents:
diff changeset
89 if test "${LC_ALL+set}" = set; then
551433a01cab initial coding
carl
parents:
diff changeset
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
551433a01cab initial coding
carl
parents:
diff changeset
91 fi
551433a01cab initial coding
carl
parents:
diff changeset
92 if test "${LANG+set}" = set; then
551433a01cab initial coding
carl
parents:
diff changeset
93 save_LANG="$LANG"; LANG=C; export LANG
551433a01cab initial coding
carl
parents:
diff changeset
94 fi
551433a01cab initial coding
carl
parents:
diff changeset
95
551433a01cab initial coding
carl
parents:
diff changeset
96 # Make sure IFS has a sensible default
551433a01cab initial coding
carl
parents:
diff changeset
97 : ${IFS=" "}
551433a01cab initial coding
carl
parents:
diff changeset
98
551433a01cab initial coding
carl
parents:
diff changeset
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
100 $echo "$modename: not configured to build any kind of library" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
102 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
103 fi
551433a01cab initial coding
carl
parents:
diff changeset
104
551433a01cab initial coding
carl
parents:
diff changeset
105 # Global variables.
551433a01cab initial coding
carl
parents:
diff changeset
106 mode=$default_mode
551433a01cab initial coding
carl
parents:
diff changeset
107 nonopt=
551433a01cab initial coding
carl
parents:
diff changeset
108 prev=
551433a01cab initial coding
carl
parents:
diff changeset
109 prevopt=
551433a01cab initial coding
carl
parents:
diff changeset
110 run=
551433a01cab initial coding
carl
parents:
diff changeset
111 show="$echo"
551433a01cab initial coding
carl
parents:
diff changeset
112 show_help=
551433a01cab initial coding
carl
parents:
diff changeset
113 execute_dlfiles=
551433a01cab initial coding
carl
parents:
diff changeset
114 lo2o="s/\\.lo\$/.${objext}/"
551433a01cab initial coding
carl
parents:
diff changeset
115 o2lo="s/\\.${objext}\$/.lo/"
551433a01cab initial coding
carl
parents:
diff changeset
116
551433a01cab initial coding
carl
parents:
diff changeset
117 #####################################
551433a01cab initial coding
carl
parents:
diff changeset
118 # Shell function definitions:
551433a01cab initial coding
carl
parents:
diff changeset
119 # This seems to be the best place for them
551433a01cab initial coding
carl
parents:
diff changeset
120
551433a01cab initial coding
carl
parents:
diff changeset
121 # Need a lot of goo to handle *both* DLLs and import libs
551433a01cab initial coding
carl
parents:
diff changeset
122 # Has to be a shell function in order to 'eat' the argument
551433a01cab initial coding
carl
parents:
diff changeset
123 # that is supplied when $file_magic_command is called.
551433a01cab initial coding
carl
parents:
diff changeset
124 win32_libid () {
551433a01cab initial coding
carl
parents:
diff changeset
125 win32_libid_type="unknown"
551433a01cab initial coding
carl
parents:
diff changeset
126 win32_fileres=`file -L $1 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
127 case $win32_fileres in
551433a01cab initial coding
carl
parents:
diff changeset
128 *ar\ archive\ import\ library*) # definitely import
551433a01cab initial coding
carl
parents:
diff changeset
129 win32_libid_type="x86 archive import"
551433a01cab initial coding
carl
parents:
diff changeset
130 ;;
551433a01cab initial coding
carl
parents:
diff changeset
131 *ar\ archive*) # could be an import, or static
551433a01cab initial coding
carl
parents:
diff changeset
132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
551433a01cab initial coding
carl
parents:
diff changeset
133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
551433a01cab initial coding
carl
parents:
diff changeset
134 win32_nmres=`eval $NM -f posix -A $1 | \
551433a01cab initial coding
carl
parents:
diff changeset
135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
551433a01cab initial coding
carl
parents:
diff changeset
136 if test "X$win32_nmres" = "Ximport" ; then
551433a01cab initial coding
carl
parents:
diff changeset
137 win32_libid_type="x86 archive import"
551433a01cab initial coding
carl
parents:
diff changeset
138 else
551433a01cab initial coding
carl
parents:
diff changeset
139 win32_libid_type="x86 archive static"
551433a01cab initial coding
carl
parents:
diff changeset
140 fi
551433a01cab initial coding
carl
parents:
diff changeset
141 fi
551433a01cab initial coding
carl
parents:
diff changeset
142 ;;
551433a01cab initial coding
carl
parents:
diff changeset
143 *DLL*)
551433a01cab initial coding
carl
parents:
diff changeset
144 win32_libid_type="x86 DLL"
551433a01cab initial coding
carl
parents:
diff changeset
145 ;;
551433a01cab initial coding
carl
parents:
diff changeset
146 *executable*) # but shell scripts are "executable" too...
551433a01cab initial coding
carl
parents:
diff changeset
147 case $win32_fileres in
551433a01cab initial coding
carl
parents:
diff changeset
148 *MS\ Windows\ PE\ Intel*)
551433a01cab initial coding
carl
parents:
diff changeset
149 win32_libid_type="x86 DLL"
551433a01cab initial coding
carl
parents:
diff changeset
150 ;;
551433a01cab initial coding
carl
parents:
diff changeset
151 esac
551433a01cab initial coding
carl
parents:
diff changeset
152 ;;
551433a01cab initial coding
carl
parents:
diff changeset
153 esac
551433a01cab initial coding
carl
parents:
diff changeset
154 $echo $win32_libid_type
551433a01cab initial coding
carl
parents:
diff changeset
155 }
551433a01cab initial coding
carl
parents:
diff changeset
156
551433a01cab initial coding
carl
parents:
diff changeset
157 # End of Shell function definitions
551433a01cab initial coding
carl
parents:
diff changeset
158 #####################################
551433a01cab initial coding
carl
parents:
diff changeset
159
551433a01cab initial coding
carl
parents:
diff changeset
160 # Parse our command line options once, thoroughly.
551433a01cab initial coding
carl
parents:
diff changeset
161 while test "$#" -gt 0
551433a01cab initial coding
carl
parents:
diff changeset
162 do
551433a01cab initial coding
carl
parents:
diff changeset
163 arg="$1"
551433a01cab initial coding
carl
parents:
diff changeset
164 shift
551433a01cab initial coding
carl
parents:
diff changeset
165
551433a01cab initial coding
carl
parents:
diff changeset
166 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
167 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
551433a01cab initial coding
carl
parents:
diff changeset
168 *) optarg= ;;
551433a01cab initial coding
carl
parents:
diff changeset
169 esac
551433a01cab initial coding
carl
parents:
diff changeset
170
551433a01cab initial coding
carl
parents:
diff changeset
171 # If the previous option needs an argument, assign it.
551433a01cab initial coding
carl
parents:
diff changeset
172 if test -n "$prev"; then
551433a01cab initial coding
carl
parents:
diff changeset
173 case $prev in
551433a01cab initial coding
carl
parents:
diff changeset
174 execute_dlfiles)
551433a01cab initial coding
carl
parents:
diff changeset
175 execute_dlfiles="$execute_dlfiles $arg"
551433a01cab initial coding
carl
parents:
diff changeset
176 ;;
551433a01cab initial coding
carl
parents:
diff changeset
177 tag)
551433a01cab initial coding
carl
parents:
diff changeset
178 tagname="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
179
551433a01cab initial coding
carl
parents:
diff changeset
180 # Check whether tagname contains only valid characters
551433a01cab initial coding
carl
parents:
diff changeset
181 case $tagname in
551433a01cab initial coding
carl
parents:
diff changeset
182 *[!-_A-Za-z0-9,/]*)
551433a01cab initial coding
carl
parents:
diff changeset
183 $echo "$progname: invalid tag name: $tagname" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
184 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
185 ;;
551433a01cab initial coding
carl
parents:
diff changeset
186 esac
551433a01cab initial coding
carl
parents:
diff changeset
187
551433a01cab initial coding
carl
parents:
diff changeset
188 case $tagname in
551433a01cab initial coding
carl
parents:
diff changeset
189 CC)
551433a01cab initial coding
carl
parents:
diff changeset
190 # Don't test for the "default" C tag, as we know, it's there, but
551433a01cab initial coding
carl
parents:
diff changeset
191 # not specially marked.
551433a01cab initial coding
carl
parents:
diff changeset
192 ;;
551433a01cab initial coding
carl
parents:
diff changeset
193 *)
551433a01cab initial coding
carl
parents:
diff changeset
194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
195 taglist="$taglist $tagname"
551433a01cab initial coding
carl
parents:
diff changeset
196 # Evaluate the configuration.
551433a01cab initial coding
carl
parents:
diff changeset
197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
551433a01cab initial coding
carl
parents:
diff changeset
198 else
551433a01cab initial coding
carl
parents:
diff changeset
199 $echo "$progname: ignoring unknown tag $tagname" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
200 fi
551433a01cab initial coding
carl
parents:
diff changeset
201 ;;
551433a01cab initial coding
carl
parents:
diff changeset
202 esac
551433a01cab initial coding
carl
parents:
diff changeset
203 ;;
551433a01cab initial coding
carl
parents:
diff changeset
204 *)
551433a01cab initial coding
carl
parents:
diff changeset
205 eval "$prev=\$arg"
551433a01cab initial coding
carl
parents:
diff changeset
206 ;;
551433a01cab initial coding
carl
parents:
diff changeset
207 esac
551433a01cab initial coding
carl
parents:
diff changeset
208
551433a01cab initial coding
carl
parents:
diff changeset
209 prev=
551433a01cab initial coding
carl
parents:
diff changeset
210 prevopt=
551433a01cab initial coding
carl
parents:
diff changeset
211 continue
551433a01cab initial coding
carl
parents:
diff changeset
212 fi
551433a01cab initial coding
carl
parents:
diff changeset
213
551433a01cab initial coding
carl
parents:
diff changeset
214 # Have we seen a non-optional argument yet?
551433a01cab initial coding
carl
parents:
diff changeset
215 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
216 --help)
551433a01cab initial coding
carl
parents:
diff changeset
217 show_help=yes
551433a01cab initial coding
carl
parents:
diff changeset
218 ;;
551433a01cab initial coding
carl
parents:
diff changeset
219
551433a01cab initial coding
carl
parents:
diff changeset
220 --version)
551433a01cab initial coding
carl
parents:
diff changeset
221 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
551433a01cab initial coding
carl
parents:
diff changeset
222 $echo
551433a01cab initial coding
carl
parents:
diff changeset
223 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
551433a01cab initial coding
carl
parents:
diff changeset
224 $echo "This is free software; see the source for copying conditions. There is NO"
551433a01cab initial coding
carl
parents:
diff changeset
225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
551433a01cab initial coding
carl
parents:
diff changeset
226 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
227 ;;
551433a01cab initial coding
carl
parents:
diff changeset
228
551433a01cab initial coding
carl
parents:
diff changeset
229 --config)
551433a01cab initial coding
carl
parents:
diff changeset
230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
551433a01cab initial coding
carl
parents:
diff changeset
231 # Now print the configurations for the tags.
551433a01cab initial coding
carl
parents:
diff changeset
232 for tagname in $taglist; do
551433a01cab initial coding
carl
parents:
diff changeset
233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
551433a01cab initial coding
carl
parents:
diff changeset
234 done
551433a01cab initial coding
carl
parents:
diff changeset
235 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
236 ;;
551433a01cab initial coding
carl
parents:
diff changeset
237
551433a01cab initial coding
carl
parents:
diff changeset
238 --debug)
551433a01cab initial coding
carl
parents:
diff changeset
239 $echo "$progname: enabling shell trace mode"
551433a01cab initial coding
carl
parents:
diff changeset
240 set -x
551433a01cab initial coding
carl
parents:
diff changeset
241 ;;
551433a01cab initial coding
carl
parents:
diff changeset
242
551433a01cab initial coding
carl
parents:
diff changeset
243 --dry-run | -n)
551433a01cab initial coding
carl
parents:
diff changeset
244 run=:
551433a01cab initial coding
carl
parents:
diff changeset
245 ;;
551433a01cab initial coding
carl
parents:
diff changeset
246
551433a01cab initial coding
carl
parents:
diff changeset
247 --features)
551433a01cab initial coding
carl
parents:
diff changeset
248 $echo "host: $host"
551433a01cab initial coding
carl
parents:
diff changeset
249 if test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
250 $echo "enable shared libraries"
551433a01cab initial coding
carl
parents:
diff changeset
251 else
551433a01cab initial coding
carl
parents:
diff changeset
252 $echo "disable shared libraries"
551433a01cab initial coding
carl
parents:
diff changeset
253 fi
551433a01cab initial coding
carl
parents:
diff changeset
254 if test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
255 $echo "enable static libraries"
551433a01cab initial coding
carl
parents:
diff changeset
256 else
551433a01cab initial coding
carl
parents:
diff changeset
257 $echo "disable static libraries"
551433a01cab initial coding
carl
parents:
diff changeset
258 fi
551433a01cab initial coding
carl
parents:
diff changeset
259 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
260 ;;
551433a01cab initial coding
carl
parents:
diff changeset
261
551433a01cab initial coding
carl
parents:
diff changeset
262 --finish) mode="finish" ;;
551433a01cab initial coding
carl
parents:
diff changeset
263
551433a01cab initial coding
carl
parents:
diff changeset
264 --mode) prevopt="--mode" prev=mode ;;
551433a01cab initial coding
carl
parents:
diff changeset
265 --mode=*) mode="$optarg" ;;
551433a01cab initial coding
carl
parents:
diff changeset
266
551433a01cab initial coding
carl
parents:
diff changeset
267 --preserve-dup-deps) duplicate_deps="yes" ;;
551433a01cab initial coding
carl
parents:
diff changeset
268
551433a01cab initial coding
carl
parents:
diff changeset
269 --quiet | --silent)
551433a01cab initial coding
carl
parents:
diff changeset
270 show=:
551433a01cab initial coding
carl
parents:
diff changeset
271 ;;
551433a01cab initial coding
carl
parents:
diff changeset
272
551433a01cab initial coding
carl
parents:
diff changeset
273 --tag) prevopt="--tag" prev=tag ;;
551433a01cab initial coding
carl
parents:
diff changeset
274 --tag=*)
551433a01cab initial coding
carl
parents:
diff changeset
275 set tag "$optarg" ${1+"$@"}
551433a01cab initial coding
carl
parents:
diff changeset
276 shift
551433a01cab initial coding
carl
parents:
diff changeset
277 prev=tag
551433a01cab initial coding
carl
parents:
diff changeset
278 ;;
551433a01cab initial coding
carl
parents:
diff changeset
279
551433a01cab initial coding
carl
parents:
diff changeset
280 -dlopen)
551433a01cab initial coding
carl
parents:
diff changeset
281 prevopt="-dlopen"
551433a01cab initial coding
carl
parents:
diff changeset
282 prev=execute_dlfiles
551433a01cab initial coding
carl
parents:
diff changeset
283 ;;
551433a01cab initial coding
carl
parents:
diff changeset
284
551433a01cab initial coding
carl
parents:
diff changeset
285 -*)
551433a01cab initial coding
carl
parents:
diff changeset
286 $echo "$modename: unrecognized option \`$arg'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
287 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
288 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
289 ;;
551433a01cab initial coding
carl
parents:
diff changeset
290
551433a01cab initial coding
carl
parents:
diff changeset
291 *)
551433a01cab initial coding
carl
parents:
diff changeset
292 nonopt="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
293 break
551433a01cab initial coding
carl
parents:
diff changeset
294 ;;
551433a01cab initial coding
carl
parents:
diff changeset
295 esac
551433a01cab initial coding
carl
parents:
diff changeset
296 done
551433a01cab initial coding
carl
parents:
diff changeset
297
551433a01cab initial coding
carl
parents:
diff changeset
298 if test -n "$prevopt"; then
551433a01cab initial coding
carl
parents:
diff changeset
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
300 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
301 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
302 fi
551433a01cab initial coding
carl
parents:
diff changeset
303
551433a01cab initial coding
carl
parents:
diff changeset
304 # If this variable is set in any of the actions, the command in it
551433a01cab initial coding
carl
parents:
diff changeset
305 # will be execed at the end. This prevents here-documents from being
551433a01cab initial coding
carl
parents:
diff changeset
306 # left over by shells.
551433a01cab initial coding
carl
parents:
diff changeset
307 exec_cmd=
551433a01cab initial coding
carl
parents:
diff changeset
308
551433a01cab initial coding
carl
parents:
diff changeset
309 if test -z "$show_help"; then
551433a01cab initial coding
carl
parents:
diff changeset
310
551433a01cab initial coding
carl
parents:
diff changeset
311 # Infer the operation mode.
551433a01cab initial coding
carl
parents:
diff changeset
312 if test -z "$mode"; then
551433a01cab initial coding
carl
parents:
diff changeset
313 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
314 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
315 case $nonopt in
551433a01cab initial coding
carl
parents:
diff changeset
316 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
551433a01cab initial coding
carl
parents:
diff changeset
317 mode=link
551433a01cab initial coding
carl
parents:
diff changeset
318 for arg
551433a01cab initial coding
carl
parents:
diff changeset
319 do
551433a01cab initial coding
carl
parents:
diff changeset
320 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
321 -c)
551433a01cab initial coding
carl
parents:
diff changeset
322 mode=compile
551433a01cab initial coding
carl
parents:
diff changeset
323 break
551433a01cab initial coding
carl
parents:
diff changeset
324 ;;
551433a01cab initial coding
carl
parents:
diff changeset
325 esac
551433a01cab initial coding
carl
parents:
diff changeset
326 done
551433a01cab initial coding
carl
parents:
diff changeset
327 ;;
551433a01cab initial coding
carl
parents:
diff changeset
328 *db | *dbx | *strace | *truss)
551433a01cab initial coding
carl
parents:
diff changeset
329 mode=execute
551433a01cab initial coding
carl
parents:
diff changeset
330 ;;
551433a01cab initial coding
carl
parents:
diff changeset
331 *install*|cp|mv)
551433a01cab initial coding
carl
parents:
diff changeset
332 mode=install
551433a01cab initial coding
carl
parents:
diff changeset
333 ;;
551433a01cab initial coding
carl
parents:
diff changeset
334 *rm)
551433a01cab initial coding
carl
parents:
diff changeset
335 mode=uninstall
551433a01cab initial coding
carl
parents:
diff changeset
336 ;;
551433a01cab initial coding
carl
parents:
diff changeset
337 *)
551433a01cab initial coding
carl
parents:
diff changeset
338 # If we have no mode, but dlfiles were specified, then do execute mode.
551433a01cab initial coding
carl
parents:
diff changeset
339 test -n "$execute_dlfiles" && mode=execute
551433a01cab initial coding
carl
parents:
diff changeset
340
551433a01cab initial coding
carl
parents:
diff changeset
341 # Just use the default operation mode.
551433a01cab initial coding
carl
parents:
diff changeset
342 if test -z "$mode"; then
551433a01cab initial coding
carl
parents:
diff changeset
343 if test -n "$nonopt"; then
551433a01cab initial coding
carl
parents:
diff changeset
344 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
345 else
551433a01cab initial coding
carl
parents:
diff changeset
346 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
347 fi
551433a01cab initial coding
carl
parents:
diff changeset
348 fi
551433a01cab initial coding
carl
parents:
diff changeset
349 ;;
551433a01cab initial coding
carl
parents:
diff changeset
350 esac
551433a01cab initial coding
carl
parents:
diff changeset
351 fi
551433a01cab initial coding
carl
parents:
diff changeset
352
551433a01cab initial coding
carl
parents:
diff changeset
353 # Only execute mode is allowed to have -dlopen flags.
551433a01cab initial coding
carl
parents:
diff changeset
354 if test -n "$execute_dlfiles" && test "$mode" != execute; then
551433a01cab initial coding
carl
parents:
diff changeset
355 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
356 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
357 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
358 fi
551433a01cab initial coding
carl
parents:
diff changeset
359
551433a01cab initial coding
carl
parents:
diff changeset
360 # Change the help message to a mode-specific one.
551433a01cab initial coding
carl
parents:
diff changeset
361 generic_help="$help"
551433a01cab initial coding
carl
parents:
diff changeset
362 help="Try \`$modename --help --mode=$mode' for more information."
551433a01cab initial coding
carl
parents:
diff changeset
363
551433a01cab initial coding
carl
parents:
diff changeset
364 # These modes are in order of execution frequency so that they run quickly.
551433a01cab initial coding
carl
parents:
diff changeset
365 case $mode in
551433a01cab initial coding
carl
parents:
diff changeset
366 # libtool compile mode
551433a01cab initial coding
carl
parents:
diff changeset
367 compile)
551433a01cab initial coding
carl
parents:
diff changeset
368 modename="$modename: compile"
551433a01cab initial coding
carl
parents:
diff changeset
369 # Get the compilation command and the source file.
551433a01cab initial coding
carl
parents:
diff changeset
370 base_compile=
551433a01cab initial coding
carl
parents:
diff changeset
371 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
551433a01cab initial coding
carl
parents:
diff changeset
372 suppress_output=
551433a01cab initial coding
carl
parents:
diff changeset
373 arg_mode=normal
551433a01cab initial coding
carl
parents:
diff changeset
374 libobj=
551433a01cab initial coding
carl
parents:
diff changeset
375
551433a01cab initial coding
carl
parents:
diff changeset
376 for arg
551433a01cab initial coding
carl
parents:
diff changeset
377 do
551433a01cab initial coding
carl
parents:
diff changeset
378 case "$arg_mode" in
551433a01cab initial coding
carl
parents:
diff changeset
379 arg )
551433a01cab initial coding
carl
parents:
diff changeset
380 # do not "continue". Instead, add this to base_compile
551433a01cab initial coding
carl
parents:
diff changeset
381 lastarg="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
382 arg_mode=normal
551433a01cab initial coding
carl
parents:
diff changeset
383 ;;
551433a01cab initial coding
carl
parents:
diff changeset
384
551433a01cab initial coding
carl
parents:
diff changeset
385 target )
551433a01cab initial coding
carl
parents:
diff changeset
386 libobj="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
387 arg_mode=normal
551433a01cab initial coding
carl
parents:
diff changeset
388 continue
551433a01cab initial coding
carl
parents:
diff changeset
389 ;;
551433a01cab initial coding
carl
parents:
diff changeset
390
551433a01cab initial coding
carl
parents:
diff changeset
391 normal )
551433a01cab initial coding
carl
parents:
diff changeset
392 # Accept any command-line options.
551433a01cab initial coding
carl
parents:
diff changeset
393 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
394 -o)
551433a01cab initial coding
carl
parents:
diff changeset
395 if test -n "$libobj" ; then
551433a01cab initial coding
carl
parents:
diff changeset
396 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
397 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
398 fi
551433a01cab initial coding
carl
parents:
diff changeset
399 arg_mode=target
551433a01cab initial coding
carl
parents:
diff changeset
400 continue
551433a01cab initial coding
carl
parents:
diff changeset
401 ;;
551433a01cab initial coding
carl
parents:
diff changeset
402
551433a01cab initial coding
carl
parents:
diff changeset
403 -static)
551433a01cab initial coding
carl
parents:
diff changeset
404 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
405 continue
551433a01cab initial coding
carl
parents:
diff changeset
406 ;;
551433a01cab initial coding
carl
parents:
diff changeset
407
551433a01cab initial coding
carl
parents:
diff changeset
408 -prefer-pic)
551433a01cab initial coding
carl
parents:
diff changeset
409 pic_mode=yes
551433a01cab initial coding
carl
parents:
diff changeset
410 continue
551433a01cab initial coding
carl
parents:
diff changeset
411 ;;
551433a01cab initial coding
carl
parents:
diff changeset
412
551433a01cab initial coding
carl
parents:
diff changeset
413 -prefer-non-pic)
551433a01cab initial coding
carl
parents:
diff changeset
414 pic_mode=no
551433a01cab initial coding
carl
parents:
diff changeset
415 continue
551433a01cab initial coding
carl
parents:
diff changeset
416 ;;
551433a01cab initial coding
carl
parents:
diff changeset
417
551433a01cab initial coding
carl
parents:
diff changeset
418 -Xcompiler)
551433a01cab initial coding
carl
parents:
diff changeset
419 arg_mode=arg # the next one goes into the "base_compile" arg list
551433a01cab initial coding
carl
parents:
diff changeset
420 continue # The current "srcfile" will either be retained or
551433a01cab initial coding
carl
parents:
diff changeset
421 ;; # replaced later. I would guess that would be a bug.
551433a01cab initial coding
carl
parents:
diff changeset
422
551433a01cab initial coding
carl
parents:
diff changeset
423 -Wc,*)
551433a01cab initial coding
carl
parents:
diff changeset
424 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
551433a01cab initial coding
carl
parents:
diff changeset
425 lastarg=
551433a01cab initial coding
carl
parents:
diff changeset
426 save_ifs="$IFS"; IFS=','
551433a01cab initial coding
carl
parents:
diff changeset
427 for arg in $args; do
551433a01cab initial coding
carl
parents:
diff changeset
428 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
429
551433a01cab initial coding
carl
parents:
diff changeset
430 # Double-quote args containing other shell metacharacters.
551433a01cab initial coding
carl
parents:
diff changeset
431 # Many Bourne shells cannot handle close brackets correctly
551433a01cab initial coding
carl
parents:
diff changeset
432 # in scan sets, so we specify it separately.
551433a01cab initial coding
carl
parents:
diff changeset
433 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
434 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
435 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
436 ;;
551433a01cab initial coding
carl
parents:
diff changeset
437 esac
551433a01cab initial coding
carl
parents:
diff changeset
438 lastarg="$lastarg $arg"
551433a01cab initial coding
carl
parents:
diff changeset
439 done
551433a01cab initial coding
carl
parents:
diff changeset
440 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
441 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
551433a01cab initial coding
carl
parents:
diff changeset
442
551433a01cab initial coding
carl
parents:
diff changeset
443 # Add the arguments to base_compile.
551433a01cab initial coding
carl
parents:
diff changeset
444 base_compile="$base_compile $lastarg"
551433a01cab initial coding
carl
parents:
diff changeset
445 continue
551433a01cab initial coding
carl
parents:
diff changeset
446 ;;
551433a01cab initial coding
carl
parents:
diff changeset
447
551433a01cab initial coding
carl
parents:
diff changeset
448 * )
551433a01cab initial coding
carl
parents:
diff changeset
449 # Accept the current argument as the source file.
551433a01cab initial coding
carl
parents:
diff changeset
450 # The previous "srcfile" becomes the current argument.
551433a01cab initial coding
carl
parents:
diff changeset
451 #
551433a01cab initial coding
carl
parents:
diff changeset
452 lastarg="$srcfile"
551433a01cab initial coding
carl
parents:
diff changeset
453 srcfile="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
454 ;;
551433a01cab initial coding
carl
parents:
diff changeset
455 esac # case $arg
551433a01cab initial coding
carl
parents:
diff changeset
456 ;;
551433a01cab initial coding
carl
parents:
diff changeset
457 esac # case $arg_mode
551433a01cab initial coding
carl
parents:
diff changeset
458
551433a01cab initial coding
carl
parents:
diff changeset
459 # Aesthetically quote the previous argument.
551433a01cab initial coding
carl
parents:
diff changeset
460 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
461
551433a01cab initial coding
carl
parents:
diff changeset
462 case $lastarg in
551433a01cab initial coding
carl
parents:
diff changeset
463 # Double-quote args containing other shell metacharacters.
551433a01cab initial coding
carl
parents:
diff changeset
464 # Many Bourne shells cannot handle close brackets correctly
551433a01cab initial coding
carl
parents:
diff changeset
465 # in scan sets, so we specify it separately.
551433a01cab initial coding
carl
parents:
diff changeset
466 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
467 lastarg="\"$lastarg\""
551433a01cab initial coding
carl
parents:
diff changeset
468 ;;
551433a01cab initial coding
carl
parents:
diff changeset
469 esac
551433a01cab initial coding
carl
parents:
diff changeset
470
551433a01cab initial coding
carl
parents:
diff changeset
471 base_compile="$base_compile $lastarg"
551433a01cab initial coding
carl
parents:
diff changeset
472 done # for arg
551433a01cab initial coding
carl
parents:
diff changeset
473
551433a01cab initial coding
carl
parents:
diff changeset
474 case $arg_mode in
551433a01cab initial coding
carl
parents:
diff changeset
475 arg)
551433a01cab initial coding
carl
parents:
diff changeset
476 $echo "$modename: you must specify an argument for -Xcompile"
551433a01cab initial coding
carl
parents:
diff changeset
477 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
478 ;;
551433a01cab initial coding
carl
parents:
diff changeset
479 target)
551433a01cab initial coding
carl
parents:
diff changeset
480 $echo "$modename: you must specify a target with \`-o'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
481 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
482 ;;
551433a01cab initial coding
carl
parents:
diff changeset
483 *)
551433a01cab initial coding
carl
parents:
diff changeset
484 # Get the name of the library object.
551433a01cab initial coding
carl
parents:
diff changeset
485 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
486 ;;
551433a01cab initial coding
carl
parents:
diff changeset
487 esac
551433a01cab initial coding
carl
parents:
diff changeset
488
551433a01cab initial coding
carl
parents:
diff changeset
489 # Recognize several different file suffixes.
551433a01cab initial coding
carl
parents:
diff changeset
490 # If the user specifies -o file.o, it is replaced with file.lo
551433a01cab initial coding
carl
parents:
diff changeset
491 xform='[cCFSifmso]'
551433a01cab initial coding
carl
parents:
diff changeset
492 case $libobj in
551433a01cab initial coding
carl
parents:
diff changeset
493 *.ada) xform=ada ;;
551433a01cab initial coding
carl
parents:
diff changeset
494 *.adb) xform=adb ;;
551433a01cab initial coding
carl
parents:
diff changeset
495 *.ads) xform=ads ;;
551433a01cab initial coding
carl
parents:
diff changeset
496 *.asm) xform=asm ;;
551433a01cab initial coding
carl
parents:
diff changeset
497 *.c++) xform=c++ ;;
551433a01cab initial coding
carl
parents:
diff changeset
498 *.cc) xform=cc ;;
551433a01cab initial coding
carl
parents:
diff changeset
499 *.ii) xform=ii ;;
551433a01cab initial coding
carl
parents:
diff changeset
500 *.class) xform=class ;;
551433a01cab initial coding
carl
parents:
diff changeset
501 *.cpp) xform=cpp ;;
551433a01cab initial coding
carl
parents:
diff changeset
502 *.cxx) xform=cxx ;;
551433a01cab initial coding
carl
parents:
diff changeset
503 *.f90) xform=f90 ;;
551433a01cab initial coding
carl
parents:
diff changeset
504 *.for) xform=for ;;
551433a01cab initial coding
carl
parents:
diff changeset
505 *.java) xform=java ;;
551433a01cab initial coding
carl
parents:
diff changeset
506 esac
551433a01cab initial coding
carl
parents:
diff changeset
507
551433a01cab initial coding
carl
parents:
diff changeset
508 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
551433a01cab initial coding
carl
parents:
diff changeset
509
551433a01cab initial coding
carl
parents:
diff changeset
510 case $libobj in
551433a01cab initial coding
carl
parents:
diff changeset
511 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
551433a01cab initial coding
carl
parents:
diff changeset
512 *)
551433a01cab initial coding
carl
parents:
diff changeset
513 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
514 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
515 ;;
551433a01cab initial coding
carl
parents:
diff changeset
516 esac
551433a01cab initial coding
carl
parents:
diff changeset
517
551433a01cab initial coding
carl
parents:
diff changeset
518 # Infer tagged configuration to use if any are available and
551433a01cab initial coding
carl
parents:
diff changeset
519 # if one wasn't chosen via the "--tag" command line option.
551433a01cab initial coding
carl
parents:
diff changeset
520 # Only attempt this if the compiler in the base compile
551433a01cab initial coding
carl
parents:
diff changeset
521 # command doesn't match the default compiler.
551433a01cab initial coding
carl
parents:
diff changeset
522 if test -n "$available_tags" && test -z "$tagname"; then
551433a01cab initial coding
carl
parents:
diff changeset
523 case $base_compile in
551433a01cab initial coding
carl
parents:
diff changeset
524 # Blanks in the command may have been stripped by the calling shell,
551433a01cab initial coding
carl
parents:
diff changeset
525 # but not from the CC environment variable when configure was run.
551433a01cab initial coding
carl
parents:
diff changeset
526 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
527 # Blanks at the start of $base_compile will cause this to fail
551433a01cab initial coding
carl
parents:
diff changeset
528 # if we don't check for them as well.
551433a01cab initial coding
carl
parents:
diff changeset
529 *)
551433a01cab initial coding
carl
parents:
diff changeset
530 for z in $available_tags; do
551433a01cab initial coding
carl
parents:
diff changeset
531 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
532 # Evaluate the configuration.
551433a01cab initial coding
carl
parents:
diff changeset
533 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
551433a01cab initial coding
carl
parents:
diff changeset
534 case "$base_compile " in
551433a01cab initial coding
carl
parents:
diff changeset
535 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
551433a01cab initial coding
carl
parents:
diff changeset
536 # The compiler in the base compile command matches
551433a01cab initial coding
carl
parents:
diff changeset
537 # the one in the tagged configuration.
551433a01cab initial coding
carl
parents:
diff changeset
538 # Assume this is the tagged configuration we want.
551433a01cab initial coding
carl
parents:
diff changeset
539 tagname=$z
551433a01cab initial coding
carl
parents:
diff changeset
540 break
551433a01cab initial coding
carl
parents:
diff changeset
541 ;;
551433a01cab initial coding
carl
parents:
diff changeset
542 esac
551433a01cab initial coding
carl
parents:
diff changeset
543 fi
551433a01cab initial coding
carl
parents:
diff changeset
544 done
551433a01cab initial coding
carl
parents:
diff changeset
545 # If $tagname still isn't set, then no tagged configuration
551433a01cab initial coding
carl
parents:
diff changeset
546 # was found and let the user know that the "--tag" command
551433a01cab initial coding
carl
parents:
diff changeset
547 # line option must be used.
551433a01cab initial coding
carl
parents:
diff changeset
548 if test -z "$tagname"; then
551433a01cab initial coding
carl
parents:
diff changeset
549 $echo "$modename: unable to infer tagged configuration"
551433a01cab initial coding
carl
parents:
diff changeset
550 $echo "$modename: specify a tag with \`--tag'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
551 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
552 # else
551433a01cab initial coding
carl
parents:
diff changeset
553 # $echo "$modename: using $tagname tagged configuration"
551433a01cab initial coding
carl
parents:
diff changeset
554 fi
551433a01cab initial coding
carl
parents:
diff changeset
555 ;;
551433a01cab initial coding
carl
parents:
diff changeset
556 esac
551433a01cab initial coding
carl
parents:
diff changeset
557 fi
551433a01cab initial coding
carl
parents:
diff changeset
558
551433a01cab initial coding
carl
parents:
diff changeset
559 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
560 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
561 if test "X$xdir" = "X$obj"; then
551433a01cab initial coding
carl
parents:
diff changeset
562 xdir=
551433a01cab initial coding
carl
parents:
diff changeset
563 else
551433a01cab initial coding
carl
parents:
diff changeset
564 xdir=$xdir/
551433a01cab initial coding
carl
parents:
diff changeset
565 fi
551433a01cab initial coding
carl
parents:
diff changeset
566 lobj=${xdir}$objdir/$objname
551433a01cab initial coding
carl
parents:
diff changeset
567
551433a01cab initial coding
carl
parents:
diff changeset
568 if test -z "$base_compile"; then
551433a01cab initial coding
carl
parents:
diff changeset
569 $echo "$modename: you must specify a compilation command" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
570 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
571 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
572 fi
551433a01cab initial coding
carl
parents:
diff changeset
573
551433a01cab initial coding
carl
parents:
diff changeset
574 # Delete any leftover library objects.
551433a01cab initial coding
carl
parents:
diff changeset
575 if test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
576 removelist="$obj $lobj $libobj ${libobj}T"
551433a01cab initial coding
carl
parents:
diff changeset
577 else
551433a01cab initial coding
carl
parents:
diff changeset
578 removelist="$lobj $libobj ${libobj}T"
551433a01cab initial coding
carl
parents:
diff changeset
579 fi
551433a01cab initial coding
carl
parents:
diff changeset
580
551433a01cab initial coding
carl
parents:
diff changeset
581 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
582 trap "$run $rm $removelist; exit 1" 1 2 15
551433a01cab initial coding
carl
parents:
diff changeset
583
551433a01cab initial coding
carl
parents:
diff changeset
584 # On Cygwin there's no "real" PIC flag so we must build both object types
551433a01cab initial coding
carl
parents:
diff changeset
585 case $host_os in
551433a01cab initial coding
carl
parents:
diff changeset
586 cygwin* | mingw* | pw32* | os2*)
551433a01cab initial coding
carl
parents:
diff changeset
587 pic_mode=default
551433a01cab initial coding
carl
parents:
diff changeset
588 ;;
551433a01cab initial coding
carl
parents:
diff changeset
589 esac
551433a01cab initial coding
carl
parents:
diff changeset
590 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
551433a01cab initial coding
carl
parents:
diff changeset
591 # non-PIC code in shared libraries is not supported
551433a01cab initial coding
carl
parents:
diff changeset
592 pic_mode=default
551433a01cab initial coding
carl
parents:
diff changeset
593 fi
551433a01cab initial coding
carl
parents:
diff changeset
594
551433a01cab initial coding
carl
parents:
diff changeset
595 # Calculate the filename of the output object if compiler does
551433a01cab initial coding
carl
parents:
diff changeset
596 # not support -o with -c
551433a01cab initial coding
carl
parents:
diff changeset
597 if test "$compiler_c_o" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
598 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
551433a01cab initial coding
carl
parents:
diff changeset
599 lockfile="$output_obj.lock"
551433a01cab initial coding
carl
parents:
diff changeset
600 removelist="$removelist $output_obj $lockfile"
551433a01cab initial coding
carl
parents:
diff changeset
601 trap "$run $rm $removelist; exit 1" 1 2 15
551433a01cab initial coding
carl
parents:
diff changeset
602 else
551433a01cab initial coding
carl
parents:
diff changeset
603 output_obj=
551433a01cab initial coding
carl
parents:
diff changeset
604 need_locks=no
551433a01cab initial coding
carl
parents:
diff changeset
605 lockfile=
551433a01cab initial coding
carl
parents:
diff changeset
606 fi
551433a01cab initial coding
carl
parents:
diff changeset
607
551433a01cab initial coding
carl
parents:
diff changeset
608 # Lock this critical section if it is needed
551433a01cab initial coding
carl
parents:
diff changeset
609 # We use this script file to make the link, it avoids creating a new file
551433a01cab initial coding
carl
parents:
diff changeset
610 if test "$need_locks" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
611 until $run ln "$0" "$lockfile" 2>/dev/null; do
551433a01cab initial coding
carl
parents:
diff changeset
612 $show "Waiting for $lockfile to be removed"
551433a01cab initial coding
carl
parents:
diff changeset
613 sleep 2
551433a01cab initial coding
carl
parents:
diff changeset
614 done
551433a01cab initial coding
carl
parents:
diff changeset
615 elif test "$need_locks" = warn; then
551433a01cab initial coding
carl
parents:
diff changeset
616 if test -f "$lockfile"; then
551433a01cab initial coding
carl
parents:
diff changeset
617 $echo "\
551433a01cab initial coding
carl
parents:
diff changeset
618 *** ERROR, $lockfile exists and contains:
551433a01cab initial coding
carl
parents:
diff changeset
619 `cat $lockfile 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
620
551433a01cab initial coding
carl
parents:
diff changeset
621 This indicates that another process is trying to use the same
551433a01cab initial coding
carl
parents:
diff changeset
622 temporary object file, and libtool could not work around it because
551433a01cab initial coding
carl
parents:
diff changeset
623 your compiler does not support \`-c' and \`-o' together. If you
551433a01cab initial coding
carl
parents:
diff changeset
624 repeat this compilation, it may succeed, by chance, but you had better
551433a01cab initial coding
carl
parents:
diff changeset
625 avoid parallel builds (make -j) in this platform, or get a better
551433a01cab initial coding
carl
parents:
diff changeset
626 compiler."
551433a01cab initial coding
carl
parents:
diff changeset
627
551433a01cab initial coding
carl
parents:
diff changeset
628 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
629 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
630 fi
551433a01cab initial coding
carl
parents:
diff changeset
631 $echo $srcfile > "$lockfile"
551433a01cab initial coding
carl
parents:
diff changeset
632 fi
551433a01cab initial coding
carl
parents:
diff changeset
633
551433a01cab initial coding
carl
parents:
diff changeset
634 if test -n "$fix_srcfile_path"; then
551433a01cab initial coding
carl
parents:
diff changeset
635 eval srcfile=\"$fix_srcfile_path\"
551433a01cab initial coding
carl
parents:
diff changeset
636 fi
551433a01cab initial coding
carl
parents:
diff changeset
637
551433a01cab initial coding
carl
parents:
diff changeset
638 $run $rm "$libobj" "${libobj}T"
551433a01cab initial coding
carl
parents:
diff changeset
639
551433a01cab initial coding
carl
parents:
diff changeset
640 # Create a libtool object file (analogous to a ".la" file),
551433a01cab initial coding
carl
parents:
diff changeset
641 # but don't create it if we're doing a dry run.
551433a01cab initial coding
carl
parents:
diff changeset
642 test -z "$run" && cat > ${libobj}T <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
643 # $libobj - a libtool object file
551433a01cab initial coding
carl
parents:
diff changeset
644 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
551433a01cab initial coding
carl
parents:
diff changeset
645 #
551433a01cab initial coding
carl
parents:
diff changeset
646 # Please DO NOT delete this file!
551433a01cab initial coding
carl
parents:
diff changeset
647 # It is necessary for linking the library.
551433a01cab initial coding
carl
parents:
diff changeset
648
551433a01cab initial coding
carl
parents:
diff changeset
649 # Name of the PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
650 EOF
551433a01cab initial coding
carl
parents:
diff changeset
651
551433a01cab initial coding
carl
parents:
diff changeset
652 # Only build a PIC object if we are building libtool libraries.
551433a01cab initial coding
carl
parents:
diff changeset
653 if test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
654 # Without this assignment, base_compile gets emptied.
551433a01cab initial coding
carl
parents:
diff changeset
655 fbsd_hideous_sh_bug=$base_compile
551433a01cab initial coding
carl
parents:
diff changeset
656
551433a01cab initial coding
carl
parents:
diff changeset
657 if test "$pic_mode" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
658 command="$base_compile $srcfile $pic_flag"
551433a01cab initial coding
carl
parents:
diff changeset
659 else
551433a01cab initial coding
carl
parents:
diff changeset
660 # Don't build PIC code
551433a01cab initial coding
carl
parents:
diff changeset
661 command="$base_compile $srcfile"
551433a01cab initial coding
carl
parents:
diff changeset
662 fi
551433a01cab initial coding
carl
parents:
diff changeset
663
551433a01cab initial coding
carl
parents:
diff changeset
664 if test ! -d "${xdir}$objdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
665 $show "$mkdir ${xdir}$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
666 $run $mkdir ${xdir}$objdir
551433a01cab initial coding
carl
parents:
diff changeset
667 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
668 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
669 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
670 fi
551433a01cab initial coding
carl
parents:
diff changeset
671 fi
551433a01cab initial coding
carl
parents:
diff changeset
672
551433a01cab initial coding
carl
parents:
diff changeset
673 if test -z "$output_obj"; then
551433a01cab initial coding
carl
parents:
diff changeset
674 # Place PIC objects in $objdir
551433a01cab initial coding
carl
parents:
diff changeset
675 command="$command -o $lobj"
551433a01cab initial coding
carl
parents:
diff changeset
676 fi
551433a01cab initial coding
carl
parents:
diff changeset
677
551433a01cab initial coding
carl
parents:
diff changeset
678 $run $rm "$lobj" "$output_obj"
551433a01cab initial coding
carl
parents:
diff changeset
679
551433a01cab initial coding
carl
parents:
diff changeset
680 $show "$command"
551433a01cab initial coding
carl
parents:
diff changeset
681 if $run eval "$command"; then :
551433a01cab initial coding
carl
parents:
diff changeset
682 else
551433a01cab initial coding
carl
parents:
diff changeset
683 test -n "$output_obj" && $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
684 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
685 fi
551433a01cab initial coding
carl
parents:
diff changeset
686
551433a01cab initial coding
carl
parents:
diff changeset
687 if test "$need_locks" = warn &&
551433a01cab initial coding
carl
parents:
diff changeset
688 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
551433a01cab initial coding
carl
parents:
diff changeset
689 $echo "\
551433a01cab initial coding
carl
parents:
diff changeset
690 *** ERROR, $lockfile contains:
551433a01cab initial coding
carl
parents:
diff changeset
691 `cat $lockfile 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
692
551433a01cab initial coding
carl
parents:
diff changeset
693 but it should contain:
551433a01cab initial coding
carl
parents:
diff changeset
694 $srcfile
551433a01cab initial coding
carl
parents:
diff changeset
695
551433a01cab initial coding
carl
parents:
diff changeset
696 This indicates that another process is trying to use the same
551433a01cab initial coding
carl
parents:
diff changeset
697 temporary object file, and libtool could not work around it because
551433a01cab initial coding
carl
parents:
diff changeset
698 your compiler does not support \`-c' and \`-o' together. If you
551433a01cab initial coding
carl
parents:
diff changeset
699 repeat this compilation, it may succeed, by chance, but you had better
551433a01cab initial coding
carl
parents:
diff changeset
700 avoid parallel builds (make -j) in this platform, or get a better
551433a01cab initial coding
carl
parents:
diff changeset
701 compiler."
551433a01cab initial coding
carl
parents:
diff changeset
702
551433a01cab initial coding
carl
parents:
diff changeset
703 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
704 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
705 fi
551433a01cab initial coding
carl
parents:
diff changeset
706
551433a01cab initial coding
carl
parents:
diff changeset
707 # Just move the object if needed, then go on to compile the next one
551433a01cab initial coding
carl
parents:
diff changeset
708 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
551433a01cab initial coding
carl
parents:
diff changeset
709 $show "$mv $output_obj $lobj"
551433a01cab initial coding
carl
parents:
diff changeset
710 if $run $mv $output_obj $lobj; then :
551433a01cab initial coding
carl
parents:
diff changeset
711 else
551433a01cab initial coding
carl
parents:
diff changeset
712 error=$?
551433a01cab initial coding
carl
parents:
diff changeset
713 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
714 exit $error
551433a01cab initial coding
carl
parents:
diff changeset
715 fi
551433a01cab initial coding
carl
parents:
diff changeset
716 fi
551433a01cab initial coding
carl
parents:
diff changeset
717
551433a01cab initial coding
carl
parents:
diff changeset
718 # Append the name of the PIC object to the libtool object file.
551433a01cab initial coding
carl
parents:
diff changeset
719 test -z "$run" && cat >> ${libobj}T <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
720 pic_object='$objdir/$objname'
551433a01cab initial coding
carl
parents:
diff changeset
721
551433a01cab initial coding
carl
parents:
diff changeset
722 EOF
551433a01cab initial coding
carl
parents:
diff changeset
723
551433a01cab initial coding
carl
parents:
diff changeset
724 # Allow error messages only from the first compilation.
551433a01cab initial coding
carl
parents:
diff changeset
725 suppress_output=' >/dev/null 2>&1'
551433a01cab initial coding
carl
parents:
diff changeset
726 else
551433a01cab initial coding
carl
parents:
diff changeset
727 # No PIC object so indicate it doesn't exist in the libtool
551433a01cab initial coding
carl
parents:
diff changeset
728 # object file.
551433a01cab initial coding
carl
parents:
diff changeset
729 test -z "$run" && cat >> ${libobj}T <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
730 pic_object=none
551433a01cab initial coding
carl
parents:
diff changeset
731
551433a01cab initial coding
carl
parents:
diff changeset
732 EOF
551433a01cab initial coding
carl
parents:
diff changeset
733 fi
551433a01cab initial coding
carl
parents:
diff changeset
734
551433a01cab initial coding
carl
parents:
diff changeset
735 # Only build a position-dependent object if we build old libraries.
551433a01cab initial coding
carl
parents:
diff changeset
736 if test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
737 if test "$pic_mode" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
738 # Don't build PIC code
551433a01cab initial coding
carl
parents:
diff changeset
739 command="$base_compile $srcfile"
551433a01cab initial coding
carl
parents:
diff changeset
740 else
551433a01cab initial coding
carl
parents:
diff changeset
741 command="$base_compile $srcfile $pic_flag"
551433a01cab initial coding
carl
parents:
diff changeset
742 fi
551433a01cab initial coding
carl
parents:
diff changeset
743 if test "$compiler_c_o" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
744 command="$command -o $obj"
551433a01cab initial coding
carl
parents:
diff changeset
745 fi
551433a01cab initial coding
carl
parents:
diff changeset
746
551433a01cab initial coding
carl
parents:
diff changeset
747 # Suppress compiler output if we already did a PIC compilation.
551433a01cab initial coding
carl
parents:
diff changeset
748 command="$command$suppress_output"
551433a01cab initial coding
carl
parents:
diff changeset
749 $run $rm "$obj" "$output_obj"
551433a01cab initial coding
carl
parents:
diff changeset
750 $show "$command"
551433a01cab initial coding
carl
parents:
diff changeset
751 if $run eval "$command"; then :
551433a01cab initial coding
carl
parents:
diff changeset
752 else
551433a01cab initial coding
carl
parents:
diff changeset
753 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
754 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
755 fi
551433a01cab initial coding
carl
parents:
diff changeset
756
551433a01cab initial coding
carl
parents:
diff changeset
757 if test "$need_locks" = warn &&
551433a01cab initial coding
carl
parents:
diff changeset
758 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
551433a01cab initial coding
carl
parents:
diff changeset
759 $echo "\
551433a01cab initial coding
carl
parents:
diff changeset
760 *** ERROR, $lockfile contains:
551433a01cab initial coding
carl
parents:
diff changeset
761 `cat $lockfile 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
762
551433a01cab initial coding
carl
parents:
diff changeset
763 but it should contain:
551433a01cab initial coding
carl
parents:
diff changeset
764 $srcfile
551433a01cab initial coding
carl
parents:
diff changeset
765
551433a01cab initial coding
carl
parents:
diff changeset
766 This indicates that another process is trying to use the same
551433a01cab initial coding
carl
parents:
diff changeset
767 temporary object file, and libtool could not work around it because
551433a01cab initial coding
carl
parents:
diff changeset
768 your compiler does not support \`-c' and \`-o' together. If you
551433a01cab initial coding
carl
parents:
diff changeset
769 repeat this compilation, it may succeed, by chance, but you had better
551433a01cab initial coding
carl
parents:
diff changeset
770 avoid parallel builds (make -j) in this platform, or get a better
551433a01cab initial coding
carl
parents:
diff changeset
771 compiler."
551433a01cab initial coding
carl
parents:
diff changeset
772
551433a01cab initial coding
carl
parents:
diff changeset
773 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
774 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
775 fi
551433a01cab initial coding
carl
parents:
diff changeset
776
551433a01cab initial coding
carl
parents:
diff changeset
777 # Just move the object if needed
551433a01cab initial coding
carl
parents:
diff changeset
778 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
551433a01cab initial coding
carl
parents:
diff changeset
779 $show "$mv $output_obj $obj"
551433a01cab initial coding
carl
parents:
diff changeset
780 if $run $mv $output_obj $obj; then :
551433a01cab initial coding
carl
parents:
diff changeset
781 else
551433a01cab initial coding
carl
parents:
diff changeset
782 error=$?
551433a01cab initial coding
carl
parents:
diff changeset
783 $run $rm $removelist
551433a01cab initial coding
carl
parents:
diff changeset
784 exit $error
551433a01cab initial coding
carl
parents:
diff changeset
785 fi
551433a01cab initial coding
carl
parents:
diff changeset
786 fi
551433a01cab initial coding
carl
parents:
diff changeset
787
551433a01cab initial coding
carl
parents:
diff changeset
788 # Append the name of the non-PIC object the libtool object file.
551433a01cab initial coding
carl
parents:
diff changeset
789 # Only append if the libtool object file exists.
551433a01cab initial coding
carl
parents:
diff changeset
790 test -z "$run" && cat >> ${libobj}T <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
791 # Name of the non-PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
792 non_pic_object='$objname'
551433a01cab initial coding
carl
parents:
diff changeset
793
551433a01cab initial coding
carl
parents:
diff changeset
794 EOF
551433a01cab initial coding
carl
parents:
diff changeset
795 else
551433a01cab initial coding
carl
parents:
diff changeset
796 # Append the name of the non-PIC object the libtool object file.
551433a01cab initial coding
carl
parents:
diff changeset
797 # Only append if the libtool object file exists.
551433a01cab initial coding
carl
parents:
diff changeset
798 test -z "$run" && cat >> ${libobj}T <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
799 # Name of the non-PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
800 non_pic_object=none
551433a01cab initial coding
carl
parents:
diff changeset
801
551433a01cab initial coding
carl
parents:
diff changeset
802 EOF
551433a01cab initial coding
carl
parents:
diff changeset
803 fi
551433a01cab initial coding
carl
parents:
diff changeset
804
551433a01cab initial coding
carl
parents:
diff changeset
805 $run $mv "${libobj}T" "${libobj}"
551433a01cab initial coding
carl
parents:
diff changeset
806
551433a01cab initial coding
carl
parents:
diff changeset
807 # Unlock the critical section if it was locked
551433a01cab initial coding
carl
parents:
diff changeset
808 if test "$need_locks" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
809 $run $rm "$lockfile"
551433a01cab initial coding
carl
parents:
diff changeset
810 fi
551433a01cab initial coding
carl
parents:
diff changeset
811
551433a01cab initial coding
carl
parents:
diff changeset
812 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
813 ;;
551433a01cab initial coding
carl
parents:
diff changeset
814
551433a01cab initial coding
carl
parents:
diff changeset
815 # libtool link mode
551433a01cab initial coding
carl
parents:
diff changeset
816 link | relink)
551433a01cab initial coding
carl
parents:
diff changeset
817 modename="$modename: link"
551433a01cab initial coding
carl
parents:
diff changeset
818 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
819 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
820 # It is impossible to link a dll without this setting, and
551433a01cab initial coding
carl
parents:
diff changeset
821 # we shouldn't force the makefile maintainer to figure out
551433a01cab initial coding
carl
parents:
diff changeset
822 # which system we are compiling for in order to pass an extra
551433a01cab initial coding
carl
parents:
diff changeset
823 # flag for every libtool invocation.
551433a01cab initial coding
carl
parents:
diff changeset
824 # allow_undefined=no
551433a01cab initial coding
carl
parents:
diff changeset
825
551433a01cab initial coding
carl
parents:
diff changeset
826 # FIXME: Unfortunately, there are problems with the above when trying
551433a01cab initial coding
carl
parents:
diff changeset
827 # to make a dll which has undefined symbols, in which case not
551433a01cab initial coding
carl
parents:
diff changeset
828 # even a static library is built. For now, we need to specify
551433a01cab initial coding
carl
parents:
diff changeset
829 # -no-undefined on the libtool link line when we can be certain
551433a01cab initial coding
carl
parents:
diff changeset
830 # that all symbols are satisfied, otherwise we get a static library.
551433a01cab initial coding
carl
parents:
diff changeset
831 allow_undefined=yes
551433a01cab initial coding
carl
parents:
diff changeset
832 ;;
551433a01cab initial coding
carl
parents:
diff changeset
833 *)
551433a01cab initial coding
carl
parents:
diff changeset
834 allow_undefined=yes
551433a01cab initial coding
carl
parents:
diff changeset
835 ;;
551433a01cab initial coding
carl
parents:
diff changeset
836 esac
551433a01cab initial coding
carl
parents:
diff changeset
837 libtool_args="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
838 base_compile="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
839 compile_command="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
840 finalize_command="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
841
551433a01cab initial coding
carl
parents:
diff changeset
842 compile_rpath=
551433a01cab initial coding
carl
parents:
diff changeset
843 finalize_rpath=
551433a01cab initial coding
carl
parents:
diff changeset
844 compile_shlibpath=
551433a01cab initial coding
carl
parents:
diff changeset
845 finalize_shlibpath=
551433a01cab initial coding
carl
parents:
diff changeset
846 convenience=
551433a01cab initial coding
carl
parents:
diff changeset
847 old_convenience=
551433a01cab initial coding
carl
parents:
diff changeset
848 deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
849 old_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
850 add_flags=
551433a01cab initial coding
carl
parents:
diff changeset
851 compiler_flags=
551433a01cab initial coding
carl
parents:
diff changeset
852 linker_flags=
551433a01cab initial coding
carl
parents:
diff changeset
853 dllsearchpath=
551433a01cab initial coding
carl
parents:
diff changeset
854 lib_search_path=`pwd`
551433a01cab initial coding
carl
parents:
diff changeset
855 inst_prefix_dir=
551433a01cab initial coding
carl
parents:
diff changeset
856
551433a01cab initial coding
carl
parents:
diff changeset
857 avoid_version=no
551433a01cab initial coding
carl
parents:
diff changeset
858 dlfiles=
551433a01cab initial coding
carl
parents:
diff changeset
859 dlprefiles=
551433a01cab initial coding
carl
parents:
diff changeset
860 dlself=no
551433a01cab initial coding
carl
parents:
diff changeset
861 export_dynamic=no
551433a01cab initial coding
carl
parents:
diff changeset
862 export_symbols=
551433a01cab initial coding
carl
parents:
diff changeset
863 export_symbols_regex=
551433a01cab initial coding
carl
parents:
diff changeset
864 generated=
551433a01cab initial coding
carl
parents:
diff changeset
865 libobjs=
551433a01cab initial coding
carl
parents:
diff changeset
866 ltlibs=
551433a01cab initial coding
carl
parents:
diff changeset
867 module=no
551433a01cab initial coding
carl
parents:
diff changeset
868 no_install=no
551433a01cab initial coding
carl
parents:
diff changeset
869 objs=
551433a01cab initial coding
carl
parents:
diff changeset
870 non_pic_objects=
551433a01cab initial coding
carl
parents:
diff changeset
871 prefer_static_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
872 preload=no
551433a01cab initial coding
carl
parents:
diff changeset
873 prev=
551433a01cab initial coding
carl
parents:
diff changeset
874 prevarg=
551433a01cab initial coding
carl
parents:
diff changeset
875 release=
551433a01cab initial coding
carl
parents:
diff changeset
876 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
877 xrpath=
551433a01cab initial coding
carl
parents:
diff changeset
878 perm_rpath=
551433a01cab initial coding
carl
parents:
diff changeset
879 temp_rpath=
551433a01cab initial coding
carl
parents:
diff changeset
880 thread_safe=no
551433a01cab initial coding
carl
parents:
diff changeset
881 vinfo=
551433a01cab initial coding
carl
parents:
diff changeset
882 vinfo_number=no
551433a01cab initial coding
carl
parents:
diff changeset
883
551433a01cab initial coding
carl
parents:
diff changeset
884 # We need to know -static, to get the right output filenames.
551433a01cab initial coding
carl
parents:
diff changeset
885 for arg
551433a01cab initial coding
carl
parents:
diff changeset
886 do
551433a01cab initial coding
carl
parents:
diff changeset
887 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
888 -all-static | -static)
551433a01cab initial coding
carl
parents:
diff changeset
889 if test "X$arg" = "X-all-static"; then
551433a01cab initial coding
carl
parents:
diff changeset
890 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
551433a01cab initial coding
carl
parents:
diff changeset
891 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
892 fi
551433a01cab initial coding
carl
parents:
diff changeset
893 if test -n "$link_static_flag"; then
551433a01cab initial coding
carl
parents:
diff changeset
894 dlopen_self=$dlopen_self_static
551433a01cab initial coding
carl
parents:
diff changeset
895 fi
551433a01cab initial coding
carl
parents:
diff changeset
896 else
551433a01cab initial coding
carl
parents:
diff changeset
897 if test -z "$pic_flag" && test -n "$link_static_flag"; then
551433a01cab initial coding
carl
parents:
diff changeset
898 dlopen_self=$dlopen_self_static
551433a01cab initial coding
carl
parents:
diff changeset
899 fi
551433a01cab initial coding
carl
parents:
diff changeset
900 fi
551433a01cab initial coding
carl
parents:
diff changeset
901 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
902 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
903 prefer_static_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
904 break
551433a01cab initial coding
carl
parents:
diff changeset
905 ;;
551433a01cab initial coding
carl
parents:
diff changeset
906 esac
551433a01cab initial coding
carl
parents:
diff changeset
907 done
551433a01cab initial coding
carl
parents:
diff changeset
908
551433a01cab initial coding
carl
parents:
diff changeset
909 # See if our shared archives depend on static archives.
551433a01cab initial coding
carl
parents:
diff changeset
910 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
911
551433a01cab initial coding
carl
parents:
diff changeset
912 # Go through the arguments, transforming them on the way.
551433a01cab initial coding
carl
parents:
diff changeset
913 while test "$#" -gt 0; do
551433a01cab initial coding
carl
parents:
diff changeset
914 arg="$1"
551433a01cab initial coding
carl
parents:
diff changeset
915 base_compile="$base_compile $arg"
551433a01cab initial coding
carl
parents:
diff changeset
916 shift
551433a01cab initial coding
carl
parents:
diff changeset
917 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
918 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
919 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
551433a01cab initial coding
carl
parents:
diff changeset
920 ;;
551433a01cab initial coding
carl
parents:
diff changeset
921 *) qarg=$arg ;;
551433a01cab initial coding
carl
parents:
diff changeset
922 esac
551433a01cab initial coding
carl
parents:
diff changeset
923 libtool_args="$libtool_args $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
924
551433a01cab initial coding
carl
parents:
diff changeset
925 # If the previous option needs an argument, assign it.
551433a01cab initial coding
carl
parents:
diff changeset
926 if test -n "$prev"; then
551433a01cab initial coding
carl
parents:
diff changeset
927 case $prev in
551433a01cab initial coding
carl
parents:
diff changeset
928 output)
551433a01cab initial coding
carl
parents:
diff changeset
929 compile_command="$compile_command @OUTPUT@"
551433a01cab initial coding
carl
parents:
diff changeset
930 finalize_command="$finalize_command @OUTPUT@"
551433a01cab initial coding
carl
parents:
diff changeset
931 ;;
551433a01cab initial coding
carl
parents:
diff changeset
932 esac
551433a01cab initial coding
carl
parents:
diff changeset
933
551433a01cab initial coding
carl
parents:
diff changeset
934 case $prev in
551433a01cab initial coding
carl
parents:
diff changeset
935 dlfiles|dlprefiles)
551433a01cab initial coding
carl
parents:
diff changeset
936 if test "$preload" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
937 # Add the symbol object into the linking commands.
551433a01cab initial coding
carl
parents:
diff changeset
938 compile_command="$compile_command @SYMFILE@"
551433a01cab initial coding
carl
parents:
diff changeset
939 finalize_command="$finalize_command @SYMFILE@"
551433a01cab initial coding
carl
parents:
diff changeset
940 preload=yes
551433a01cab initial coding
carl
parents:
diff changeset
941 fi
551433a01cab initial coding
carl
parents:
diff changeset
942 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
943 *.la | *.lo) ;; # We handle these cases below.
551433a01cab initial coding
carl
parents:
diff changeset
944 force)
551433a01cab initial coding
carl
parents:
diff changeset
945 if test "$dlself" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
946 dlself=needless
551433a01cab initial coding
carl
parents:
diff changeset
947 export_dynamic=yes
551433a01cab initial coding
carl
parents:
diff changeset
948 fi
551433a01cab initial coding
carl
parents:
diff changeset
949 prev=
551433a01cab initial coding
carl
parents:
diff changeset
950 continue
551433a01cab initial coding
carl
parents:
diff changeset
951 ;;
551433a01cab initial coding
carl
parents:
diff changeset
952 self)
551433a01cab initial coding
carl
parents:
diff changeset
953 if test "$prev" = dlprefiles; then
551433a01cab initial coding
carl
parents:
diff changeset
954 dlself=yes
551433a01cab initial coding
carl
parents:
diff changeset
955 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
956 dlself=yes
551433a01cab initial coding
carl
parents:
diff changeset
957 else
551433a01cab initial coding
carl
parents:
diff changeset
958 dlself=needless
551433a01cab initial coding
carl
parents:
diff changeset
959 export_dynamic=yes
551433a01cab initial coding
carl
parents:
diff changeset
960 fi
551433a01cab initial coding
carl
parents:
diff changeset
961 prev=
551433a01cab initial coding
carl
parents:
diff changeset
962 continue
551433a01cab initial coding
carl
parents:
diff changeset
963 ;;
551433a01cab initial coding
carl
parents:
diff changeset
964 *)
551433a01cab initial coding
carl
parents:
diff changeset
965 if test "$prev" = dlfiles; then
551433a01cab initial coding
carl
parents:
diff changeset
966 dlfiles="$dlfiles $arg"
551433a01cab initial coding
carl
parents:
diff changeset
967 else
551433a01cab initial coding
carl
parents:
diff changeset
968 dlprefiles="$dlprefiles $arg"
551433a01cab initial coding
carl
parents:
diff changeset
969 fi
551433a01cab initial coding
carl
parents:
diff changeset
970 prev=
551433a01cab initial coding
carl
parents:
diff changeset
971 continue
551433a01cab initial coding
carl
parents:
diff changeset
972 ;;
551433a01cab initial coding
carl
parents:
diff changeset
973 esac
551433a01cab initial coding
carl
parents:
diff changeset
974 ;;
551433a01cab initial coding
carl
parents:
diff changeset
975 expsyms)
551433a01cab initial coding
carl
parents:
diff changeset
976 export_symbols="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
977 if test ! -f "$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
978 $echo "$modename: symbol file \`$arg' does not exist"
551433a01cab initial coding
carl
parents:
diff changeset
979 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
980 fi
551433a01cab initial coding
carl
parents:
diff changeset
981 prev=
551433a01cab initial coding
carl
parents:
diff changeset
982 continue
551433a01cab initial coding
carl
parents:
diff changeset
983 ;;
551433a01cab initial coding
carl
parents:
diff changeset
984 expsyms_regex)
551433a01cab initial coding
carl
parents:
diff changeset
985 export_symbols_regex="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
986 prev=
551433a01cab initial coding
carl
parents:
diff changeset
987 continue
551433a01cab initial coding
carl
parents:
diff changeset
988 ;;
551433a01cab initial coding
carl
parents:
diff changeset
989 inst_prefix)
551433a01cab initial coding
carl
parents:
diff changeset
990 inst_prefix_dir="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
991 prev=
551433a01cab initial coding
carl
parents:
diff changeset
992 continue
551433a01cab initial coding
carl
parents:
diff changeset
993 ;;
551433a01cab initial coding
carl
parents:
diff changeset
994 release)
551433a01cab initial coding
carl
parents:
diff changeset
995 release="-$arg"
551433a01cab initial coding
carl
parents:
diff changeset
996 prev=
551433a01cab initial coding
carl
parents:
diff changeset
997 continue
551433a01cab initial coding
carl
parents:
diff changeset
998 ;;
551433a01cab initial coding
carl
parents:
diff changeset
999 objectlist)
551433a01cab initial coding
carl
parents:
diff changeset
1000 if test -f "$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1001 save_arg=$arg
551433a01cab initial coding
carl
parents:
diff changeset
1002 moreargs=
551433a01cab initial coding
carl
parents:
diff changeset
1003 for fil in `cat $save_arg`
551433a01cab initial coding
carl
parents:
diff changeset
1004 do
551433a01cab initial coding
carl
parents:
diff changeset
1005 # moreargs="$moreargs $fil"
551433a01cab initial coding
carl
parents:
diff changeset
1006 arg=$fil
551433a01cab initial coding
carl
parents:
diff changeset
1007 # A libtool-controlled object.
551433a01cab initial coding
carl
parents:
diff changeset
1008
551433a01cab initial coding
carl
parents:
diff changeset
1009 # Check to see that this really is a libtool object.
551433a01cab initial coding
carl
parents:
diff changeset
1010 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
1011 pic_object=
551433a01cab initial coding
carl
parents:
diff changeset
1012 non_pic_object=
551433a01cab initial coding
carl
parents:
diff changeset
1013
551433a01cab initial coding
carl
parents:
diff changeset
1014 # Read the .lo file
551433a01cab initial coding
carl
parents:
diff changeset
1015 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
1016 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1017 */* | *\\*) . $arg ;;
551433a01cab initial coding
carl
parents:
diff changeset
1018 *) . ./$arg ;;
551433a01cab initial coding
carl
parents:
diff changeset
1019 esac
551433a01cab initial coding
carl
parents:
diff changeset
1020
551433a01cab initial coding
carl
parents:
diff changeset
1021 if test -z "$pic_object" || \
551433a01cab initial coding
carl
parents:
diff changeset
1022 test -z "$non_pic_object" ||
551433a01cab initial coding
carl
parents:
diff changeset
1023 test "$pic_object" = none && \
551433a01cab initial coding
carl
parents:
diff changeset
1024 test "$non_pic_object" = none; then
551433a01cab initial coding
carl
parents:
diff changeset
1025 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1026 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1027 fi
551433a01cab initial coding
carl
parents:
diff changeset
1028
551433a01cab initial coding
carl
parents:
diff changeset
1029 # Extract subdirectory from the argument.
551433a01cab initial coding
carl
parents:
diff changeset
1030 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1031 if test "X$xdir" = "X$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1032 xdir=
551433a01cab initial coding
carl
parents:
diff changeset
1033 else
551433a01cab initial coding
carl
parents:
diff changeset
1034 xdir="$xdir/"
551433a01cab initial coding
carl
parents:
diff changeset
1035 fi
551433a01cab initial coding
carl
parents:
diff changeset
1036
551433a01cab initial coding
carl
parents:
diff changeset
1037 if test "$pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
1038 # Prepend the subdirectory the object is found in.
551433a01cab initial coding
carl
parents:
diff changeset
1039 pic_object="$xdir$pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1040
551433a01cab initial coding
carl
parents:
diff changeset
1041 if test "$prev" = dlfiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1042 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
1043 dlfiles="$dlfiles $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1044 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1045 continue
551433a01cab initial coding
carl
parents:
diff changeset
1046 else
551433a01cab initial coding
carl
parents:
diff changeset
1047 # If libtool objects are unsupported, then we need to preload.
551433a01cab initial coding
carl
parents:
diff changeset
1048 prev=dlprefiles
551433a01cab initial coding
carl
parents:
diff changeset
1049 fi
551433a01cab initial coding
carl
parents:
diff changeset
1050 fi
551433a01cab initial coding
carl
parents:
diff changeset
1051
551433a01cab initial coding
carl
parents:
diff changeset
1052 # CHECK ME: I think I busted this. -Ossama
551433a01cab initial coding
carl
parents:
diff changeset
1053 if test "$prev" = dlprefiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1054 # Preload the old-style object.
551433a01cab initial coding
carl
parents:
diff changeset
1055 dlprefiles="$dlprefiles $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1056 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1057 fi
551433a01cab initial coding
carl
parents:
diff changeset
1058
551433a01cab initial coding
carl
parents:
diff changeset
1059 # A PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
1060 libobjs="$libobjs $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1061 arg="$pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1062 fi
551433a01cab initial coding
carl
parents:
diff changeset
1063
551433a01cab initial coding
carl
parents:
diff changeset
1064 # Non-PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
1065 if test "$non_pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
1066 # Prepend the subdirectory the object is found in.
551433a01cab initial coding
carl
parents:
diff changeset
1067 non_pic_object="$xdir$non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1068
551433a01cab initial coding
carl
parents:
diff changeset
1069 # A standard non-PIC object
551433a01cab initial coding
carl
parents:
diff changeset
1070 non_pic_objects="$non_pic_objects $non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1071 if test -z "$pic_object" || test "$pic_object" = none ; then
551433a01cab initial coding
carl
parents:
diff changeset
1072 arg="$non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1073 fi
551433a01cab initial coding
carl
parents:
diff changeset
1074 fi
551433a01cab initial coding
carl
parents:
diff changeset
1075 else
551433a01cab initial coding
carl
parents:
diff changeset
1076 # Only an error if not doing a dry-run.
551433a01cab initial coding
carl
parents:
diff changeset
1077 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
1078 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1079 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1080 else
551433a01cab initial coding
carl
parents:
diff changeset
1081 # Dry-run case.
551433a01cab initial coding
carl
parents:
diff changeset
1082
551433a01cab initial coding
carl
parents:
diff changeset
1083 # Extract subdirectory from the argument.
551433a01cab initial coding
carl
parents:
diff changeset
1084 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1085 if test "X$xdir" = "X$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1086 xdir=
551433a01cab initial coding
carl
parents:
diff changeset
1087 else
551433a01cab initial coding
carl
parents:
diff changeset
1088 xdir="$xdir/"
551433a01cab initial coding
carl
parents:
diff changeset
1089 fi
551433a01cab initial coding
carl
parents:
diff changeset
1090
551433a01cab initial coding
carl
parents:
diff changeset
1091 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
1092 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
1093 libobjs="$libobjs $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1094 non_pic_objects="$non_pic_objects $non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1095 fi
551433a01cab initial coding
carl
parents:
diff changeset
1096 fi
551433a01cab initial coding
carl
parents:
diff changeset
1097 done
551433a01cab initial coding
carl
parents:
diff changeset
1098 else
551433a01cab initial coding
carl
parents:
diff changeset
1099 $echo "$modename: link input file \`$save_arg' does not exist"
551433a01cab initial coding
carl
parents:
diff changeset
1100 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1101 fi
551433a01cab initial coding
carl
parents:
diff changeset
1102 arg=$save_arg
551433a01cab initial coding
carl
parents:
diff changeset
1103 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1104 continue
551433a01cab initial coding
carl
parents:
diff changeset
1105 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1106 rpath | xrpath)
551433a01cab initial coding
carl
parents:
diff changeset
1107 # We need an absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
1108 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1109 [\\/]* | [A-Za-z]:[\\/]*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1110 *)
551433a01cab initial coding
carl
parents:
diff changeset
1111 $echo "$modename: only absolute run-paths are allowed" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1112 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1113 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1114 esac
551433a01cab initial coding
carl
parents:
diff changeset
1115 if test "$prev" = rpath; then
551433a01cab initial coding
carl
parents:
diff changeset
1116 case "$rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
1117 *" $arg "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1118 *) rpath="$rpath $arg" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1119 esac
551433a01cab initial coding
carl
parents:
diff changeset
1120 else
551433a01cab initial coding
carl
parents:
diff changeset
1121 case "$xrpath " in
551433a01cab initial coding
carl
parents:
diff changeset
1122 *" $arg "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1123 *) xrpath="$xrpath $arg" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1124 esac
551433a01cab initial coding
carl
parents:
diff changeset
1125 fi
551433a01cab initial coding
carl
parents:
diff changeset
1126 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1127 continue
551433a01cab initial coding
carl
parents:
diff changeset
1128 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1129 xcompiler)
551433a01cab initial coding
carl
parents:
diff changeset
1130 compiler_flags="$compiler_flags $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1131 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1132 compile_command="$compile_command $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1133 finalize_command="$finalize_command $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1134 continue
551433a01cab initial coding
carl
parents:
diff changeset
1135 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1136 xlinker)
551433a01cab initial coding
carl
parents:
diff changeset
1137 linker_flags="$linker_flags $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1138 compiler_flags="$compiler_flags $wl$qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1139 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1140 compile_command="$compile_command $wl$qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1141 finalize_command="$finalize_command $wl$qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1142 continue
551433a01cab initial coding
carl
parents:
diff changeset
1143 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1144 xcclinker)
551433a01cab initial coding
carl
parents:
diff changeset
1145 linker_flags="$linker_flags $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1146 compiler_flags="$compiler_flags $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1147 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1148 compile_command="$compile_command $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1149 finalize_command="$finalize_command $qarg"
551433a01cab initial coding
carl
parents:
diff changeset
1150 continue
551433a01cab initial coding
carl
parents:
diff changeset
1151 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1152 *)
551433a01cab initial coding
carl
parents:
diff changeset
1153 eval "$prev=\"\$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
1154 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1155 continue
551433a01cab initial coding
carl
parents:
diff changeset
1156 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1157 esac
551433a01cab initial coding
carl
parents:
diff changeset
1158 fi # test -n "$prev"
551433a01cab initial coding
carl
parents:
diff changeset
1159
551433a01cab initial coding
carl
parents:
diff changeset
1160 prevarg="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
1161
551433a01cab initial coding
carl
parents:
diff changeset
1162 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1163 -all-static)
551433a01cab initial coding
carl
parents:
diff changeset
1164 if test -n "$link_static_flag"; then
551433a01cab initial coding
carl
parents:
diff changeset
1165 compile_command="$compile_command $link_static_flag"
551433a01cab initial coding
carl
parents:
diff changeset
1166 finalize_command="$finalize_command $link_static_flag"
551433a01cab initial coding
carl
parents:
diff changeset
1167 fi
551433a01cab initial coding
carl
parents:
diff changeset
1168 continue
551433a01cab initial coding
carl
parents:
diff changeset
1169 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1170
551433a01cab initial coding
carl
parents:
diff changeset
1171 -allow-undefined)
551433a01cab initial coding
carl
parents:
diff changeset
1172 # FIXME: remove this flag sometime in the future.
551433a01cab initial coding
carl
parents:
diff changeset
1173 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1174 continue
551433a01cab initial coding
carl
parents:
diff changeset
1175 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1176
551433a01cab initial coding
carl
parents:
diff changeset
1177 -avoid-version)
551433a01cab initial coding
carl
parents:
diff changeset
1178 avoid_version=yes
551433a01cab initial coding
carl
parents:
diff changeset
1179 continue
551433a01cab initial coding
carl
parents:
diff changeset
1180 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1181
551433a01cab initial coding
carl
parents:
diff changeset
1182 -dlopen)
551433a01cab initial coding
carl
parents:
diff changeset
1183 prev=dlfiles
551433a01cab initial coding
carl
parents:
diff changeset
1184 continue
551433a01cab initial coding
carl
parents:
diff changeset
1185 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1186
551433a01cab initial coding
carl
parents:
diff changeset
1187 -dlpreopen)
551433a01cab initial coding
carl
parents:
diff changeset
1188 prev=dlprefiles
551433a01cab initial coding
carl
parents:
diff changeset
1189 continue
551433a01cab initial coding
carl
parents:
diff changeset
1190 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1191
551433a01cab initial coding
carl
parents:
diff changeset
1192 -export-dynamic)
551433a01cab initial coding
carl
parents:
diff changeset
1193 export_dynamic=yes
551433a01cab initial coding
carl
parents:
diff changeset
1194 continue
551433a01cab initial coding
carl
parents:
diff changeset
1195 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1196
551433a01cab initial coding
carl
parents:
diff changeset
1197 -export-symbols | -export-symbols-regex)
551433a01cab initial coding
carl
parents:
diff changeset
1198 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
551433a01cab initial coding
carl
parents:
diff changeset
1199 $echo "$modename: more than one -exported-symbols argument is not allowed"
551433a01cab initial coding
carl
parents:
diff changeset
1200 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1201 fi
551433a01cab initial coding
carl
parents:
diff changeset
1202 if test "X$arg" = "X-export-symbols"; then
551433a01cab initial coding
carl
parents:
diff changeset
1203 prev=expsyms
551433a01cab initial coding
carl
parents:
diff changeset
1204 else
551433a01cab initial coding
carl
parents:
diff changeset
1205 prev=expsyms_regex
551433a01cab initial coding
carl
parents:
diff changeset
1206 fi
551433a01cab initial coding
carl
parents:
diff changeset
1207 continue
551433a01cab initial coding
carl
parents:
diff changeset
1208 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1209
551433a01cab initial coding
carl
parents:
diff changeset
1210 -inst-prefix-dir)
551433a01cab initial coding
carl
parents:
diff changeset
1211 prev=inst_prefix
551433a01cab initial coding
carl
parents:
diff changeset
1212 continue
551433a01cab initial coding
carl
parents:
diff changeset
1213 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1214
551433a01cab initial coding
carl
parents:
diff changeset
1215 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
551433a01cab initial coding
carl
parents:
diff changeset
1216 # so, if we see these flags be careful not to treat them like -L
551433a01cab initial coding
carl
parents:
diff changeset
1217 -L[A-Z][A-Z]*:*)
551433a01cab initial coding
carl
parents:
diff changeset
1218 case $with_gcc/$host in
551433a01cab initial coding
carl
parents:
diff changeset
1219 no/*-*-irix* | /*-*-irix*)
551433a01cab initial coding
carl
parents:
diff changeset
1220 compile_command="$compile_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1221 finalize_command="$finalize_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1222 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1223 esac
551433a01cab initial coding
carl
parents:
diff changeset
1224 continue
551433a01cab initial coding
carl
parents:
diff changeset
1225 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1226
551433a01cab initial coding
carl
parents:
diff changeset
1227 -L*)
551433a01cab initial coding
carl
parents:
diff changeset
1228 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
551433a01cab initial coding
carl
parents:
diff changeset
1229 # We need an absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
1230 case $dir in
551433a01cab initial coding
carl
parents:
diff changeset
1231 [\\/]* | [A-Za-z]:[\\/]*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1232 *)
551433a01cab initial coding
carl
parents:
diff changeset
1233 absdir=`cd "$dir" && pwd`
551433a01cab initial coding
carl
parents:
diff changeset
1234 if test -z "$absdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
1235 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1236 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1237 fi
551433a01cab initial coding
carl
parents:
diff changeset
1238 dir="$absdir"
551433a01cab initial coding
carl
parents:
diff changeset
1239 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1240 esac
551433a01cab initial coding
carl
parents:
diff changeset
1241 case "$deplibs " in
551433a01cab initial coding
carl
parents:
diff changeset
1242 *" -L$dir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1243 *)
551433a01cab initial coding
carl
parents:
diff changeset
1244 deplibs="$deplibs -L$dir"
551433a01cab initial coding
carl
parents:
diff changeset
1245 lib_search_path="$lib_search_path $dir"
551433a01cab initial coding
carl
parents:
diff changeset
1246 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1247 esac
551433a01cab initial coding
carl
parents:
diff changeset
1248 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
1249 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
1250 case :$dllsearchpath: in
551433a01cab initial coding
carl
parents:
diff changeset
1251 *":$dir:"*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1252 *) dllsearchpath="$dllsearchpath:$dir";;
551433a01cab initial coding
carl
parents:
diff changeset
1253 esac
551433a01cab initial coding
carl
parents:
diff changeset
1254 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1255 esac
551433a01cab initial coding
carl
parents:
diff changeset
1256 continue
551433a01cab initial coding
carl
parents:
diff changeset
1257 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1258
551433a01cab initial coding
carl
parents:
diff changeset
1259 -l*)
551433a01cab initial coding
carl
parents:
diff changeset
1260 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
551433a01cab initial coding
carl
parents:
diff changeset
1261 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
1262 *-*-cygwin* | *-*-pw32* | *-*-beos*)
551433a01cab initial coding
carl
parents:
diff changeset
1263 # These systems don't actually have a C or math library (as such)
551433a01cab initial coding
carl
parents:
diff changeset
1264 continue
551433a01cab initial coding
carl
parents:
diff changeset
1265 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1266 *-*-freebsd*-gnu*)
551433a01cab initial coding
carl
parents:
diff changeset
1267 # prevent being parsed by the freebsd regexp below
551433a01cab initial coding
carl
parents:
diff changeset
1268 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1269 *-*-mingw* | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
1270 # These systems don't actually have a C library (as such)
551433a01cab initial coding
carl
parents:
diff changeset
1271 test "X$arg" = "X-lc" && continue
551433a01cab initial coding
carl
parents:
diff changeset
1272 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1273 *-*-openbsd* | *-*-freebsd*)
551433a01cab initial coding
carl
parents:
diff changeset
1274 # Do not include libc due to us having libc/libc_r.
551433a01cab initial coding
carl
parents:
diff changeset
1275 test "X$arg" = "X-lc" && continue
551433a01cab initial coding
carl
parents:
diff changeset
1276 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1277 *-*-rhapsody* | *-*-darwin1.[012])
551433a01cab initial coding
carl
parents:
diff changeset
1278 # Rhapsody C and math libraries are in the System framework
551433a01cab initial coding
carl
parents:
diff changeset
1279 deplibs="$deplibs -framework System"
551433a01cab initial coding
carl
parents:
diff changeset
1280 continue
551433a01cab initial coding
carl
parents:
diff changeset
1281 esac
551433a01cab initial coding
carl
parents:
diff changeset
1282 elif test "X$arg" = "X-lc_r"; then
551433a01cab initial coding
carl
parents:
diff changeset
1283 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
1284 *-*-freebsd*-gnu*)
551433a01cab initial coding
carl
parents:
diff changeset
1285 # prevent being parsed by the freebsd regexp below
551433a01cab initial coding
carl
parents:
diff changeset
1286 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1287 *-*-openbsd*)
551433a01cab initial coding
carl
parents:
diff changeset
1288 # Do not include libc_r directly, use -pthread flag.
551433a01cab initial coding
carl
parents:
diff changeset
1289 continue
551433a01cab initial coding
carl
parents:
diff changeset
1290 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1291 esac
551433a01cab initial coding
carl
parents:
diff changeset
1292 fi
551433a01cab initial coding
carl
parents:
diff changeset
1293 deplibs="$deplibs $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1294 continue
551433a01cab initial coding
carl
parents:
diff changeset
1295 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1296
551433a01cab initial coding
carl
parents:
diff changeset
1297 -module)
551433a01cab initial coding
carl
parents:
diff changeset
1298 module=yes
551433a01cab initial coding
carl
parents:
diff changeset
1299 continue
551433a01cab initial coding
carl
parents:
diff changeset
1300 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1301
551433a01cab initial coding
carl
parents:
diff changeset
1302 # gcc -m* arguments should be passed to the linker via $compiler_flags
551433a01cab initial coding
carl
parents:
diff changeset
1303 # in order to pass architecture information to the linker
551433a01cab initial coding
carl
parents:
diff changeset
1304 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
551433a01cab initial coding
carl
parents:
diff changeset
1305 # but this is not reliable with gcc because gcc may use -mfoo to
551433a01cab initial coding
carl
parents:
diff changeset
1306 # select a different linker, different libraries, etc, while
551433a01cab initial coding
carl
parents:
diff changeset
1307 # -Wl,-mfoo simply passes -mfoo to the linker.
551433a01cab initial coding
carl
parents:
diff changeset
1308 -m*)
551433a01cab initial coding
carl
parents:
diff changeset
1309 # Unknown arguments in both finalize_command and compile_command need
551433a01cab initial coding
carl
parents:
diff changeset
1310 # to be aesthetically quoted because they are evaled later.
551433a01cab initial coding
carl
parents:
diff changeset
1311 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
1312 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1313 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
1314 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
1315 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1316 esac
551433a01cab initial coding
carl
parents:
diff changeset
1317 compile_command="$compile_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1318 finalize_command="$finalize_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1319 if test "$with_gcc" = "yes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
1320 compiler_flags="$compiler_flags $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1321 fi
551433a01cab initial coding
carl
parents:
diff changeset
1322 continue
551433a01cab initial coding
carl
parents:
diff changeset
1323 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1324
551433a01cab initial coding
carl
parents:
diff changeset
1325 -shrext)
551433a01cab initial coding
carl
parents:
diff changeset
1326 prev=shrext
551433a01cab initial coding
carl
parents:
diff changeset
1327 continue
551433a01cab initial coding
carl
parents:
diff changeset
1328 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1329
551433a01cab initial coding
carl
parents:
diff changeset
1330 -no-fast-install)
551433a01cab initial coding
carl
parents:
diff changeset
1331 fast_install=no
551433a01cab initial coding
carl
parents:
diff changeset
1332 continue
551433a01cab initial coding
carl
parents:
diff changeset
1333 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1334
551433a01cab initial coding
carl
parents:
diff changeset
1335 -no-install)
551433a01cab initial coding
carl
parents:
diff changeset
1336 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
1337 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
1338 # The PATH hackery in wrapper scripts is required on Windows
551433a01cab initial coding
carl
parents:
diff changeset
1339 # in order for the loader to find any dlls it needs.
551433a01cab initial coding
carl
parents:
diff changeset
1340 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1341 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1342 fast_install=no
551433a01cab initial coding
carl
parents:
diff changeset
1343 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1344 *) no_install=yes ;;
551433a01cab initial coding
carl
parents:
diff changeset
1345 esac
551433a01cab initial coding
carl
parents:
diff changeset
1346 continue
551433a01cab initial coding
carl
parents:
diff changeset
1347 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1348
551433a01cab initial coding
carl
parents:
diff changeset
1349 -no-undefined)
551433a01cab initial coding
carl
parents:
diff changeset
1350 allow_undefined=no
551433a01cab initial coding
carl
parents:
diff changeset
1351 continue
551433a01cab initial coding
carl
parents:
diff changeset
1352 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1353
551433a01cab initial coding
carl
parents:
diff changeset
1354 -objectlist)
551433a01cab initial coding
carl
parents:
diff changeset
1355 prev=objectlist
551433a01cab initial coding
carl
parents:
diff changeset
1356 continue
551433a01cab initial coding
carl
parents:
diff changeset
1357 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1358
551433a01cab initial coding
carl
parents:
diff changeset
1359 -o) prev=output ;;
551433a01cab initial coding
carl
parents:
diff changeset
1360
551433a01cab initial coding
carl
parents:
diff changeset
1361 -release)
551433a01cab initial coding
carl
parents:
diff changeset
1362 prev=release
551433a01cab initial coding
carl
parents:
diff changeset
1363 continue
551433a01cab initial coding
carl
parents:
diff changeset
1364 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1365
551433a01cab initial coding
carl
parents:
diff changeset
1366 -rpath)
551433a01cab initial coding
carl
parents:
diff changeset
1367 prev=rpath
551433a01cab initial coding
carl
parents:
diff changeset
1368 continue
551433a01cab initial coding
carl
parents:
diff changeset
1369 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1370
551433a01cab initial coding
carl
parents:
diff changeset
1371 -R)
551433a01cab initial coding
carl
parents:
diff changeset
1372 prev=xrpath
551433a01cab initial coding
carl
parents:
diff changeset
1373 continue
551433a01cab initial coding
carl
parents:
diff changeset
1374 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1375
551433a01cab initial coding
carl
parents:
diff changeset
1376 -R*)
551433a01cab initial coding
carl
parents:
diff changeset
1377 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
551433a01cab initial coding
carl
parents:
diff changeset
1378 # We need an absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
1379 case $dir in
551433a01cab initial coding
carl
parents:
diff changeset
1380 [\\/]* | [A-Za-z]:[\\/]*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1381 *)
551433a01cab initial coding
carl
parents:
diff changeset
1382 $echo "$modename: only absolute run-paths are allowed" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1383 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1384 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1385 esac
551433a01cab initial coding
carl
parents:
diff changeset
1386 case "$xrpath " in
551433a01cab initial coding
carl
parents:
diff changeset
1387 *" $dir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1388 *) xrpath="$xrpath $dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1389 esac
551433a01cab initial coding
carl
parents:
diff changeset
1390 continue
551433a01cab initial coding
carl
parents:
diff changeset
1391 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1392
551433a01cab initial coding
carl
parents:
diff changeset
1393 -static)
551433a01cab initial coding
carl
parents:
diff changeset
1394 # The effects of -static are defined in a previous loop.
551433a01cab initial coding
carl
parents:
diff changeset
1395 # We used to do the same as -all-static on platforms that
551433a01cab initial coding
carl
parents:
diff changeset
1396 # didn't have a PIC flag, but the assumption that the effects
551433a01cab initial coding
carl
parents:
diff changeset
1397 # would be equivalent was wrong. It would break on at least
551433a01cab initial coding
carl
parents:
diff changeset
1398 # Digital Unix and AIX.
551433a01cab initial coding
carl
parents:
diff changeset
1399 continue
551433a01cab initial coding
carl
parents:
diff changeset
1400 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1401
551433a01cab initial coding
carl
parents:
diff changeset
1402 -thread-safe)
551433a01cab initial coding
carl
parents:
diff changeset
1403 thread_safe=yes
551433a01cab initial coding
carl
parents:
diff changeset
1404 continue
551433a01cab initial coding
carl
parents:
diff changeset
1405 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1406
551433a01cab initial coding
carl
parents:
diff changeset
1407 -version-info)
551433a01cab initial coding
carl
parents:
diff changeset
1408 prev=vinfo
551433a01cab initial coding
carl
parents:
diff changeset
1409 continue
551433a01cab initial coding
carl
parents:
diff changeset
1410 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1411 -version-number)
551433a01cab initial coding
carl
parents:
diff changeset
1412 prev=vinfo
551433a01cab initial coding
carl
parents:
diff changeset
1413 vinfo_number=yes
551433a01cab initial coding
carl
parents:
diff changeset
1414 continue
551433a01cab initial coding
carl
parents:
diff changeset
1415 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1416
551433a01cab initial coding
carl
parents:
diff changeset
1417 -Wc,*)
551433a01cab initial coding
carl
parents:
diff changeset
1418 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
551433a01cab initial coding
carl
parents:
diff changeset
1419 arg=
551433a01cab initial coding
carl
parents:
diff changeset
1420 save_ifs="$IFS"; IFS=','
551433a01cab initial coding
carl
parents:
diff changeset
1421 for flag in $args; do
551433a01cab initial coding
carl
parents:
diff changeset
1422 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
1423 case $flag in
551433a01cab initial coding
carl
parents:
diff changeset
1424 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
1425 flag="\"$flag\""
551433a01cab initial coding
carl
parents:
diff changeset
1426 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1427 esac
551433a01cab initial coding
carl
parents:
diff changeset
1428 arg="$arg $wl$flag"
551433a01cab initial coding
carl
parents:
diff changeset
1429 compiler_flags="$compiler_flags $flag"
551433a01cab initial coding
carl
parents:
diff changeset
1430 done
551433a01cab initial coding
carl
parents:
diff changeset
1431 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
1432 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
551433a01cab initial coding
carl
parents:
diff changeset
1433 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1434
551433a01cab initial coding
carl
parents:
diff changeset
1435 -Wl,*)
551433a01cab initial coding
carl
parents:
diff changeset
1436 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
551433a01cab initial coding
carl
parents:
diff changeset
1437 arg=
551433a01cab initial coding
carl
parents:
diff changeset
1438 save_ifs="$IFS"; IFS=','
551433a01cab initial coding
carl
parents:
diff changeset
1439 for flag in $args; do
551433a01cab initial coding
carl
parents:
diff changeset
1440 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
1441 case $flag in
551433a01cab initial coding
carl
parents:
diff changeset
1442 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
1443 flag="\"$flag\""
551433a01cab initial coding
carl
parents:
diff changeset
1444 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1445 esac
551433a01cab initial coding
carl
parents:
diff changeset
1446 arg="$arg $wl$flag"
551433a01cab initial coding
carl
parents:
diff changeset
1447 compiler_flags="$compiler_flags $wl$flag"
551433a01cab initial coding
carl
parents:
diff changeset
1448 linker_flags="$linker_flags $flag"
551433a01cab initial coding
carl
parents:
diff changeset
1449 done
551433a01cab initial coding
carl
parents:
diff changeset
1450 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
1451 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
551433a01cab initial coding
carl
parents:
diff changeset
1452 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1453
551433a01cab initial coding
carl
parents:
diff changeset
1454 -Xcompiler)
551433a01cab initial coding
carl
parents:
diff changeset
1455 prev=xcompiler
551433a01cab initial coding
carl
parents:
diff changeset
1456 continue
551433a01cab initial coding
carl
parents:
diff changeset
1457 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1458
551433a01cab initial coding
carl
parents:
diff changeset
1459 -Xlinker)
551433a01cab initial coding
carl
parents:
diff changeset
1460 prev=xlinker
551433a01cab initial coding
carl
parents:
diff changeset
1461 continue
551433a01cab initial coding
carl
parents:
diff changeset
1462 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1463
551433a01cab initial coding
carl
parents:
diff changeset
1464 -XCClinker)
551433a01cab initial coding
carl
parents:
diff changeset
1465 prev=xcclinker
551433a01cab initial coding
carl
parents:
diff changeset
1466 continue
551433a01cab initial coding
carl
parents:
diff changeset
1467 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1468
551433a01cab initial coding
carl
parents:
diff changeset
1469 # Some other compiler flag.
551433a01cab initial coding
carl
parents:
diff changeset
1470 -* | +*)
551433a01cab initial coding
carl
parents:
diff changeset
1471 # Unknown arguments in both finalize_command and compile_command need
551433a01cab initial coding
carl
parents:
diff changeset
1472 # to be aesthetically quoted because they are evaled later.
551433a01cab initial coding
carl
parents:
diff changeset
1473 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
1474 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1475 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
1476 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
1477 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1478 esac
551433a01cab initial coding
carl
parents:
diff changeset
1479 add_flags="$add_flags $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1480 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1481
551433a01cab initial coding
carl
parents:
diff changeset
1482 *.$objext)
551433a01cab initial coding
carl
parents:
diff changeset
1483 # A standard object.
551433a01cab initial coding
carl
parents:
diff changeset
1484 objs="$objs $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1485 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1486
551433a01cab initial coding
carl
parents:
diff changeset
1487 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
1488 # A libtool-controlled object.
551433a01cab initial coding
carl
parents:
diff changeset
1489
551433a01cab initial coding
carl
parents:
diff changeset
1490 # Check to see that this really is a libtool object.
551433a01cab initial coding
carl
parents:
diff changeset
1491 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
1492 pic_object=
551433a01cab initial coding
carl
parents:
diff changeset
1493 non_pic_object=
551433a01cab initial coding
carl
parents:
diff changeset
1494
551433a01cab initial coding
carl
parents:
diff changeset
1495 # Read the .lo file
551433a01cab initial coding
carl
parents:
diff changeset
1496 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
1497 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1498 */* | *\\*) . $arg ;;
551433a01cab initial coding
carl
parents:
diff changeset
1499 *) . ./$arg ;;
551433a01cab initial coding
carl
parents:
diff changeset
1500 esac
551433a01cab initial coding
carl
parents:
diff changeset
1501
551433a01cab initial coding
carl
parents:
diff changeset
1502 if test -z "$pic_object" || \
551433a01cab initial coding
carl
parents:
diff changeset
1503 test -z "$non_pic_object" ||
551433a01cab initial coding
carl
parents:
diff changeset
1504 test "$pic_object" = none && \
551433a01cab initial coding
carl
parents:
diff changeset
1505 test "$non_pic_object" = none; then
551433a01cab initial coding
carl
parents:
diff changeset
1506 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1507 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1508 fi
551433a01cab initial coding
carl
parents:
diff changeset
1509
551433a01cab initial coding
carl
parents:
diff changeset
1510 # Extract subdirectory from the argument.
551433a01cab initial coding
carl
parents:
diff changeset
1511 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1512 if test "X$xdir" = "X$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1513 xdir=
551433a01cab initial coding
carl
parents:
diff changeset
1514 else
551433a01cab initial coding
carl
parents:
diff changeset
1515 xdir="$xdir/"
551433a01cab initial coding
carl
parents:
diff changeset
1516 fi
551433a01cab initial coding
carl
parents:
diff changeset
1517
551433a01cab initial coding
carl
parents:
diff changeset
1518 if test "$pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
1519 # Prepend the subdirectory the object is found in.
551433a01cab initial coding
carl
parents:
diff changeset
1520 pic_object="$xdir$pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1521
551433a01cab initial coding
carl
parents:
diff changeset
1522 if test "$prev" = dlfiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1523 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
1524 dlfiles="$dlfiles $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1525 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1526 continue
551433a01cab initial coding
carl
parents:
diff changeset
1527 else
551433a01cab initial coding
carl
parents:
diff changeset
1528 # If libtool objects are unsupported, then we need to preload.
551433a01cab initial coding
carl
parents:
diff changeset
1529 prev=dlprefiles
551433a01cab initial coding
carl
parents:
diff changeset
1530 fi
551433a01cab initial coding
carl
parents:
diff changeset
1531 fi
551433a01cab initial coding
carl
parents:
diff changeset
1532
551433a01cab initial coding
carl
parents:
diff changeset
1533 # CHECK ME: I think I busted this. -Ossama
551433a01cab initial coding
carl
parents:
diff changeset
1534 if test "$prev" = dlprefiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1535 # Preload the old-style object.
551433a01cab initial coding
carl
parents:
diff changeset
1536 dlprefiles="$dlprefiles $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1537 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1538 fi
551433a01cab initial coding
carl
parents:
diff changeset
1539
551433a01cab initial coding
carl
parents:
diff changeset
1540 # A PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
1541 libobjs="$libobjs $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1542 arg="$pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1543 fi
551433a01cab initial coding
carl
parents:
diff changeset
1544
551433a01cab initial coding
carl
parents:
diff changeset
1545 # Non-PIC object.
551433a01cab initial coding
carl
parents:
diff changeset
1546 if test "$non_pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
1547 # Prepend the subdirectory the object is found in.
551433a01cab initial coding
carl
parents:
diff changeset
1548 non_pic_object="$xdir$non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1549
551433a01cab initial coding
carl
parents:
diff changeset
1550 # A standard non-PIC object
551433a01cab initial coding
carl
parents:
diff changeset
1551 non_pic_objects="$non_pic_objects $non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1552 if test -z "$pic_object" || test "$pic_object" = none ; then
551433a01cab initial coding
carl
parents:
diff changeset
1553 arg="$non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1554 fi
551433a01cab initial coding
carl
parents:
diff changeset
1555 fi
551433a01cab initial coding
carl
parents:
diff changeset
1556 else
551433a01cab initial coding
carl
parents:
diff changeset
1557 # Only an error if not doing a dry-run.
551433a01cab initial coding
carl
parents:
diff changeset
1558 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
1559 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1560 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1561 else
551433a01cab initial coding
carl
parents:
diff changeset
1562 # Dry-run case.
551433a01cab initial coding
carl
parents:
diff changeset
1563
551433a01cab initial coding
carl
parents:
diff changeset
1564 # Extract subdirectory from the argument.
551433a01cab initial coding
carl
parents:
diff changeset
1565 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1566 if test "X$xdir" = "X$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1567 xdir=
551433a01cab initial coding
carl
parents:
diff changeset
1568 else
551433a01cab initial coding
carl
parents:
diff changeset
1569 xdir="$xdir/"
551433a01cab initial coding
carl
parents:
diff changeset
1570 fi
551433a01cab initial coding
carl
parents:
diff changeset
1571
551433a01cab initial coding
carl
parents:
diff changeset
1572 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
1573 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
1574 libobjs="$libobjs $pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1575 non_pic_objects="$non_pic_objects $non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
1576 fi
551433a01cab initial coding
carl
parents:
diff changeset
1577 fi
551433a01cab initial coding
carl
parents:
diff changeset
1578 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1579
551433a01cab initial coding
carl
parents:
diff changeset
1580 *.$libext)
551433a01cab initial coding
carl
parents:
diff changeset
1581 # An archive.
551433a01cab initial coding
carl
parents:
diff changeset
1582 deplibs="$deplibs $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1583 old_deplibs="$old_deplibs $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1584 continue
551433a01cab initial coding
carl
parents:
diff changeset
1585 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1586
551433a01cab initial coding
carl
parents:
diff changeset
1587 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
1588 # A libtool-controlled library.
551433a01cab initial coding
carl
parents:
diff changeset
1589
551433a01cab initial coding
carl
parents:
diff changeset
1590 if test "$prev" = dlfiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1591 # This library was specified with -dlopen.
551433a01cab initial coding
carl
parents:
diff changeset
1592 dlfiles="$dlfiles $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1593 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1594 elif test "$prev" = dlprefiles; then
551433a01cab initial coding
carl
parents:
diff changeset
1595 # The library was specified with -dlpreopen.
551433a01cab initial coding
carl
parents:
diff changeset
1596 dlprefiles="$dlprefiles $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1597 prev=
551433a01cab initial coding
carl
parents:
diff changeset
1598 else
551433a01cab initial coding
carl
parents:
diff changeset
1599 deplibs="$deplibs $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1600 fi
551433a01cab initial coding
carl
parents:
diff changeset
1601 continue
551433a01cab initial coding
carl
parents:
diff changeset
1602 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1603
551433a01cab initial coding
carl
parents:
diff changeset
1604 # Some other compiler argument.
551433a01cab initial coding
carl
parents:
diff changeset
1605 *)
551433a01cab initial coding
carl
parents:
diff changeset
1606 # Unknown arguments in both finalize_command and compile_command need
551433a01cab initial coding
carl
parents:
diff changeset
1607 # to be aesthetically quoted because they are evaled later.
551433a01cab initial coding
carl
parents:
diff changeset
1608 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
1609 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
1610 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
551433a01cab initial coding
carl
parents:
diff changeset
1611 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
1612 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1613 esac
551433a01cab initial coding
carl
parents:
diff changeset
1614 add_flags="$add_flags $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1615 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1616 esac # arg
551433a01cab initial coding
carl
parents:
diff changeset
1617
551433a01cab initial coding
carl
parents:
diff changeset
1618 # Now actually substitute the argument into the commands.
551433a01cab initial coding
carl
parents:
diff changeset
1619 if test -n "$arg"; then
551433a01cab initial coding
carl
parents:
diff changeset
1620 compile_command="$compile_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1621 finalize_command="$finalize_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1622 fi
551433a01cab initial coding
carl
parents:
diff changeset
1623 done # argument parsing loop
551433a01cab initial coding
carl
parents:
diff changeset
1624
551433a01cab initial coding
carl
parents:
diff changeset
1625 if test -n "$prev"; then
551433a01cab initial coding
carl
parents:
diff changeset
1626 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1627 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1628 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1629 fi
551433a01cab initial coding
carl
parents:
diff changeset
1630
551433a01cab initial coding
carl
parents:
diff changeset
1631 # Infer tagged configuration to use if any are available and
551433a01cab initial coding
carl
parents:
diff changeset
1632 # if one wasn't chosen via the "--tag" command line option.
551433a01cab initial coding
carl
parents:
diff changeset
1633 # Only attempt this if the compiler in the base link
551433a01cab initial coding
carl
parents:
diff changeset
1634 # command doesn't match the default compiler.
551433a01cab initial coding
carl
parents:
diff changeset
1635 if test -n "$available_tags" && test -z "$tagname"; then
551433a01cab initial coding
carl
parents:
diff changeset
1636 case $base_compile in
551433a01cab initial coding
carl
parents:
diff changeset
1637 # Blanks in the command may have been stripped by the calling shell,
551433a01cab initial coding
carl
parents:
diff changeset
1638 # but not from the CC environment variable when configure was run.
551433a01cab initial coding
carl
parents:
diff changeset
1639 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1640 # Blanks at the start of $base_compile will cause this to fail
551433a01cab initial coding
carl
parents:
diff changeset
1641 # if we don't check for them as well.
551433a01cab initial coding
carl
parents:
diff changeset
1642 *)
551433a01cab initial coding
carl
parents:
diff changeset
1643 for z in $available_tags; do
551433a01cab initial coding
carl
parents:
diff changeset
1644 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
1645 # Evaluate the configuration.
551433a01cab initial coding
carl
parents:
diff changeset
1646 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
551433a01cab initial coding
carl
parents:
diff changeset
1647 case $base_compile in
551433a01cab initial coding
carl
parents:
diff changeset
1648 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
551433a01cab initial coding
carl
parents:
diff changeset
1649 # The compiler in $compile_command matches
551433a01cab initial coding
carl
parents:
diff changeset
1650 # the one in the tagged configuration.
551433a01cab initial coding
carl
parents:
diff changeset
1651 # Assume this is the tagged configuration we want.
551433a01cab initial coding
carl
parents:
diff changeset
1652 tagname=$z
551433a01cab initial coding
carl
parents:
diff changeset
1653 break
551433a01cab initial coding
carl
parents:
diff changeset
1654 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1655 esac
551433a01cab initial coding
carl
parents:
diff changeset
1656 fi
551433a01cab initial coding
carl
parents:
diff changeset
1657 done
551433a01cab initial coding
carl
parents:
diff changeset
1658 # If $tagname still isn't set, then no tagged configuration
551433a01cab initial coding
carl
parents:
diff changeset
1659 # was found and let the user know that the "--tag" command
551433a01cab initial coding
carl
parents:
diff changeset
1660 # line option must be used.
551433a01cab initial coding
carl
parents:
diff changeset
1661 if test -z "$tagname"; then
551433a01cab initial coding
carl
parents:
diff changeset
1662 $echo "$modename: unable to infer tagged configuration"
551433a01cab initial coding
carl
parents:
diff changeset
1663 $echo "$modename: specify a tag with \`--tag'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1664 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1665 # else
551433a01cab initial coding
carl
parents:
diff changeset
1666 # $echo "$modename: using $tagname tagged configuration"
551433a01cab initial coding
carl
parents:
diff changeset
1667 fi
551433a01cab initial coding
carl
parents:
diff changeset
1668 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1669 esac
551433a01cab initial coding
carl
parents:
diff changeset
1670 fi
551433a01cab initial coding
carl
parents:
diff changeset
1671
551433a01cab initial coding
carl
parents:
diff changeset
1672 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
1673 eval arg=\"$export_dynamic_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
1674 compile_command="$compile_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1675 finalize_command="$finalize_command $arg"
551433a01cab initial coding
carl
parents:
diff changeset
1676 fi
551433a01cab initial coding
carl
parents:
diff changeset
1677
551433a01cab initial coding
carl
parents:
diff changeset
1678 oldlibs=
551433a01cab initial coding
carl
parents:
diff changeset
1679 # calculate the name of the file, without its directory
551433a01cab initial coding
carl
parents:
diff changeset
1680 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1681 libobjs_save="$libobjs"
551433a01cab initial coding
carl
parents:
diff changeset
1682
551433a01cab initial coding
carl
parents:
diff changeset
1683 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
1684 # get the directories listed in $shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
1685 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
551433a01cab initial coding
carl
parents:
diff changeset
1686 else
551433a01cab initial coding
carl
parents:
diff changeset
1687 shlib_search_path=
551433a01cab initial coding
carl
parents:
diff changeset
1688 fi
551433a01cab initial coding
carl
parents:
diff changeset
1689 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
1690 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
1691
551433a01cab initial coding
carl
parents:
diff changeset
1692 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1693 if test "X$output_objdir" = "X$output"; then
551433a01cab initial coding
carl
parents:
diff changeset
1694 output_objdir="$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
1695 else
551433a01cab initial coding
carl
parents:
diff changeset
1696 output_objdir="$output_objdir/$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
1697 fi
551433a01cab initial coding
carl
parents:
diff changeset
1698 # Create the object directory.
551433a01cab initial coding
carl
parents:
diff changeset
1699 if test ! -d "$output_objdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
1700 $show "$mkdir $output_objdir"
551433a01cab initial coding
carl
parents:
diff changeset
1701 $run $mkdir $output_objdir
551433a01cab initial coding
carl
parents:
diff changeset
1702 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
1703 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
1704 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
1705 fi
551433a01cab initial coding
carl
parents:
diff changeset
1706 fi
551433a01cab initial coding
carl
parents:
diff changeset
1707
551433a01cab initial coding
carl
parents:
diff changeset
1708 # Determine the type of output
551433a01cab initial coding
carl
parents:
diff changeset
1709 case $output in
551433a01cab initial coding
carl
parents:
diff changeset
1710 "")
551433a01cab initial coding
carl
parents:
diff changeset
1711 $echo "$modename: you must specify an output file" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1712 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1713 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1714 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1715 *.$libext) linkmode=oldlib ;;
551433a01cab initial coding
carl
parents:
diff changeset
1716 *.lo | *.$objext) linkmode=obj ;;
551433a01cab initial coding
carl
parents:
diff changeset
1717 *.la) linkmode=lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
1718 *) linkmode=prog ;; # Anything else should be a program.
551433a01cab initial coding
carl
parents:
diff changeset
1719 esac
551433a01cab initial coding
carl
parents:
diff changeset
1720
551433a01cab initial coding
carl
parents:
diff changeset
1721 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
1722 *cygwin* | *mingw* | *pw32*)
551433a01cab initial coding
carl
parents:
diff changeset
1723 # don't eliminate duplcations in $postdeps and $predeps
551433a01cab initial coding
carl
parents:
diff changeset
1724 duplicate_compiler_generated_deps=yes
551433a01cab initial coding
carl
parents:
diff changeset
1725 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1726 *)
551433a01cab initial coding
carl
parents:
diff changeset
1727 duplicate_compiler_generated_deps=$duplicate_deps
551433a01cab initial coding
carl
parents:
diff changeset
1728 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1729 esac
551433a01cab initial coding
carl
parents:
diff changeset
1730 specialdeplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1731
551433a01cab initial coding
carl
parents:
diff changeset
1732 libs=
551433a01cab initial coding
carl
parents:
diff changeset
1733 # Find all interdependent deplibs by searching for libraries
551433a01cab initial coding
carl
parents:
diff changeset
1734 # that are linked more than once (e.g. -la -lb -la)
551433a01cab initial coding
carl
parents:
diff changeset
1735 for deplib in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
1736 if test "X$duplicate_deps" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
1737 case "$libs " in
551433a01cab initial coding
carl
parents:
diff changeset
1738 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1739 esac
551433a01cab initial coding
carl
parents:
diff changeset
1740 fi
551433a01cab initial coding
carl
parents:
diff changeset
1741 libs="$libs $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
1742 done
551433a01cab initial coding
carl
parents:
diff changeset
1743
551433a01cab initial coding
carl
parents:
diff changeset
1744 if test "$linkmode" = lib; then
551433a01cab initial coding
carl
parents:
diff changeset
1745 libs="$predeps $libs $compiler_lib_search_path $postdeps"
551433a01cab initial coding
carl
parents:
diff changeset
1746
551433a01cab initial coding
carl
parents:
diff changeset
1747 # Compute libraries that are listed more than once in $predeps
551433a01cab initial coding
carl
parents:
diff changeset
1748 # $postdeps and mark them as special (i.e., whose duplicates are
551433a01cab initial coding
carl
parents:
diff changeset
1749 # not to be eliminated).
551433a01cab initial coding
carl
parents:
diff changeset
1750 pre_post_deps=
551433a01cab initial coding
carl
parents:
diff changeset
1751 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
1752 for pre_post_dep in $predeps $postdeps; do
551433a01cab initial coding
carl
parents:
diff changeset
1753 case "$pre_post_deps " in
551433a01cab initial coding
carl
parents:
diff changeset
1754 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1755 esac
551433a01cab initial coding
carl
parents:
diff changeset
1756 pre_post_deps="$pre_post_deps $pre_post_dep"
551433a01cab initial coding
carl
parents:
diff changeset
1757 done
551433a01cab initial coding
carl
parents:
diff changeset
1758 fi
551433a01cab initial coding
carl
parents:
diff changeset
1759 pre_post_deps=
551433a01cab initial coding
carl
parents:
diff changeset
1760 fi
551433a01cab initial coding
carl
parents:
diff changeset
1761
551433a01cab initial coding
carl
parents:
diff changeset
1762 deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1763 newdependency_libs=
551433a01cab initial coding
carl
parents:
diff changeset
1764 newlib_search_path=
551433a01cab initial coding
carl
parents:
diff changeset
1765 need_relink=no # whether we're linking any uninstalled libtool libraries
551433a01cab initial coding
carl
parents:
diff changeset
1766 notinst_deplibs= # not-installed libtool libraries
551433a01cab initial coding
carl
parents:
diff changeset
1767 notinst_path= # paths that contain not-installed libtool libraries
551433a01cab initial coding
carl
parents:
diff changeset
1768 case $linkmode in
551433a01cab initial coding
carl
parents:
diff changeset
1769 lib)
551433a01cab initial coding
carl
parents:
diff changeset
1770 passes="conv link"
551433a01cab initial coding
carl
parents:
diff changeset
1771 for file in $dlfiles $dlprefiles; do
551433a01cab initial coding
carl
parents:
diff changeset
1772 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
1773 *.la) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1774 *)
551433a01cab initial coding
carl
parents:
diff changeset
1775 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1776 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1777 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1778 esac
551433a01cab initial coding
carl
parents:
diff changeset
1779 done
551433a01cab initial coding
carl
parents:
diff changeset
1780 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1781 prog)
551433a01cab initial coding
carl
parents:
diff changeset
1782 compile_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1783 finalize_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1784 alldeplibs=no
551433a01cab initial coding
carl
parents:
diff changeset
1785 newdlfiles=
551433a01cab initial coding
carl
parents:
diff changeset
1786 newdlprefiles=
551433a01cab initial coding
carl
parents:
diff changeset
1787 passes="conv scan dlopen dlpreopen link"
551433a01cab initial coding
carl
parents:
diff changeset
1788 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1789 *) passes="conv"
551433a01cab initial coding
carl
parents:
diff changeset
1790 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1791 esac
551433a01cab initial coding
carl
parents:
diff changeset
1792 for pass in $passes; do
551433a01cab initial coding
carl
parents:
diff changeset
1793 if test "$linkmode,$pass" = "lib,link" ||
551433a01cab initial coding
carl
parents:
diff changeset
1794 test "$linkmode,$pass" = "prog,scan"; then
551433a01cab initial coding
carl
parents:
diff changeset
1795 libs="$deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1796 deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1797 fi
551433a01cab initial coding
carl
parents:
diff changeset
1798 if test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
1799 case $pass in
551433a01cab initial coding
carl
parents:
diff changeset
1800 dlopen) libs="$dlfiles" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1801 dlpreopen) libs="$dlprefiles" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1802 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1803 esac
551433a01cab initial coding
carl
parents:
diff changeset
1804 fi
551433a01cab initial coding
carl
parents:
diff changeset
1805 if test "$pass" = dlopen; then
551433a01cab initial coding
carl
parents:
diff changeset
1806 # Collect dlpreopened libraries
551433a01cab initial coding
carl
parents:
diff changeset
1807 save_deplibs="$deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1808 deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
1809 fi
551433a01cab initial coding
carl
parents:
diff changeset
1810 for deplib in $libs; do
551433a01cab initial coding
carl
parents:
diff changeset
1811 lib=
551433a01cab initial coding
carl
parents:
diff changeset
1812 found=no
551433a01cab initial coding
carl
parents:
diff changeset
1813 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
1814 -l*)
551433a01cab initial coding
carl
parents:
diff changeset
1815 if test "$linkmode" != lib && test "$linkmode" != prog; then
551433a01cab initial coding
carl
parents:
diff changeset
1816 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1817 continue
551433a01cab initial coding
carl
parents:
diff changeset
1818 fi
551433a01cab initial coding
carl
parents:
diff changeset
1819 if test "$pass" = conv && test "$allow_undefined" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
1820 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1821 continue
551433a01cab initial coding
carl
parents:
diff changeset
1822 fi
551433a01cab initial coding
carl
parents:
diff changeset
1823 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
551433a01cab initial coding
carl
parents:
diff changeset
1824 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
551433a01cab initial coding
carl
parents:
diff changeset
1825 for search_ext in .la $shrext .so .a; do
551433a01cab initial coding
carl
parents:
diff changeset
1826 # Search the libtool library
551433a01cab initial coding
carl
parents:
diff changeset
1827 lib="$searchdir/lib${name}${search_ext}"
551433a01cab initial coding
carl
parents:
diff changeset
1828 if test -f "$lib"; then
551433a01cab initial coding
carl
parents:
diff changeset
1829 if test "$search_ext" = ".la"; then
551433a01cab initial coding
carl
parents:
diff changeset
1830 found=yes
551433a01cab initial coding
carl
parents:
diff changeset
1831 else
551433a01cab initial coding
carl
parents:
diff changeset
1832 found=no
551433a01cab initial coding
carl
parents:
diff changeset
1833 fi
551433a01cab initial coding
carl
parents:
diff changeset
1834 break 2
551433a01cab initial coding
carl
parents:
diff changeset
1835 fi
551433a01cab initial coding
carl
parents:
diff changeset
1836 done
551433a01cab initial coding
carl
parents:
diff changeset
1837 done
551433a01cab initial coding
carl
parents:
diff changeset
1838 if test "$found" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
1839 # deplib doesn't seem to be a libtool library
551433a01cab initial coding
carl
parents:
diff changeset
1840 if test "$linkmode,$pass" = "prog,link"; then
551433a01cab initial coding
carl
parents:
diff changeset
1841 compile_deplibs="$deplib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1842 finalize_deplibs="$deplib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1843 else
551433a01cab initial coding
carl
parents:
diff changeset
1844 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1845 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
1846 fi
551433a01cab initial coding
carl
parents:
diff changeset
1847 continue
551433a01cab initial coding
carl
parents:
diff changeset
1848 else # deplib is a libtool library
551433a01cab initial coding
carl
parents:
diff changeset
1849 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
551433a01cab initial coding
carl
parents:
diff changeset
1850 # We need to do some special things here, and not later.
551433a01cab initial coding
carl
parents:
diff changeset
1851 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
1852 case " $predeps $postdeps " in
551433a01cab initial coding
carl
parents:
diff changeset
1853 *" $deplib "*)
551433a01cab initial coding
carl
parents:
diff changeset
1854 if (${SED} -e '2q' $lib |
551433a01cab initial coding
carl
parents:
diff changeset
1855 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
1856 library_names=
551433a01cab initial coding
carl
parents:
diff changeset
1857 old_library=
551433a01cab initial coding
carl
parents:
diff changeset
1858 case $lib in
551433a01cab initial coding
carl
parents:
diff changeset
1859 */* | *\\*) . $lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
1860 *) . ./$lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
1861 esac
551433a01cab initial coding
carl
parents:
diff changeset
1862 for l in $old_library $library_names; do
551433a01cab initial coding
carl
parents:
diff changeset
1863 ll="$l"
551433a01cab initial coding
carl
parents:
diff changeset
1864 done
551433a01cab initial coding
carl
parents:
diff changeset
1865 if test "X$ll" = "X$old_library" ; then # only static version available
551433a01cab initial coding
carl
parents:
diff changeset
1866 found=no
551433a01cab initial coding
carl
parents:
diff changeset
1867 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1868 test "X$ladir" = "X$lib" && ladir="."
551433a01cab initial coding
carl
parents:
diff changeset
1869 lib=$ladir/$old_library
551433a01cab initial coding
carl
parents:
diff changeset
1870 if test "$linkmode,$pass" = "prog,link"; then
551433a01cab initial coding
carl
parents:
diff changeset
1871 compile_deplibs="$deplib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1872 finalize_deplibs="$deplib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1873 else
551433a01cab initial coding
carl
parents:
diff changeset
1874 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1875 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
1876 fi
551433a01cab initial coding
carl
parents:
diff changeset
1877 continue
551433a01cab initial coding
carl
parents:
diff changeset
1878 fi
551433a01cab initial coding
carl
parents:
diff changeset
1879 fi
551433a01cab initial coding
carl
parents:
diff changeset
1880 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1881 *) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1882 esac
551433a01cab initial coding
carl
parents:
diff changeset
1883 fi
551433a01cab initial coding
carl
parents:
diff changeset
1884 fi
551433a01cab initial coding
carl
parents:
diff changeset
1885 ;; # -l
551433a01cab initial coding
carl
parents:
diff changeset
1886 -L*)
551433a01cab initial coding
carl
parents:
diff changeset
1887 case $linkmode in
551433a01cab initial coding
carl
parents:
diff changeset
1888 lib)
551433a01cab initial coding
carl
parents:
diff changeset
1889 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1890 test "$pass" = conv && continue
551433a01cab initial coding
carl
parents:
diff changeset
1891 newdependency_libs="$deplib $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
1892 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
551433a01cab initial coding
carl
parents:
diff changeset
1893 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1894 prog)
551433a01cab initial coding
carl
parents:
diff changeset
1895 if test "$pass" = conv; then
551433a01cab initial coding
carl
parents:
diff changeset
1896 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1897 continue
551433a01cab initial coding
carl
parents:
diff changeset
1898 fi
551433a01cab initial coding
carl
parents:
diff changeset
1899 if test "$pass" = scan; then
551433a01cab initial coding
carl
parents:
diff changeset
1900 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1901 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
551433a01cab initial coding
carl
parents:
diff changeset
1902 else
551433a01cab initial coding
carl
parents:
diff changeset
1903 compile_deplibs="$deplib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1904 finalize_deplibs="$deplib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1905 fi
551433a01cab initial coding
carl
parents:
diff changeset
1906 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1907 *)
551433a01cab initial coding
carl
parents:
diff changeset
1908 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1909 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1910 esac # linkmode
551433a01cab initial coding
carl
parents:
diff changeset
1911 continue
551433a01cab initial coding
carl
parents:
diff changeset
1912 ;; # -L
551433a01cab initial coding
carl
parents:
diff changeset
1913 -R*)
551433a01cab initial coding
carl
parents:
diff changeset
1914 if test "$pass" = link; then
551433a01cab initial coding
carl
parents:
diff changeset
1915 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
551433a01cab initial coding
carl
parents:
diff changeset
1916 # Make sure the xrpath contains only unique directories.
551433a01cab initial coding
carl
parents:
diff changeset
1917 case "$xrpath " in
551433a01cab initial coding
carl
parents:
diff changeset
1918 *" $dir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
1919 *) xrpath="$xrpath $dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1920 esac
551433a01cab initial coding
carl
parents:
diff changeset
1921 fi
551433a01cab initial coding
carl
parents:
diff changeset
1922 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1923 continue
551433a01cab initial coding
carl
parents:
diff changeset
1924 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1925 *.la) lib="$deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
1926 *.$libext)
551433a01cab initial coding
carl
parents:
diff changeset
1927 if test "$pass" = conv; then
551433a01cab initial coding
carl
parents:
diff changeset
1928 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1929 continue
551433a01cab initial coding
carl
parents:
diff changeset
1930 fi
551433a01cab initial coding
carl
parents:
diff changeset
1931 case $linkmode in
551433a01cab initial coding
carl
parents:
diff changeset
1932 lib)
551433a01cab initial coding
carl
parents:
diff changeset
1933 if test "$deplibs_check_method" != pass_all; then
551433a01cab initial coding
carl
parents:
diff changeset
1934 $echo
551433a01cab initial coding
carl
parents:
diff changeset
1935 $echo "*** Warning: Trying to link with static lib archive $deplib."
551433a01cab initial coding
carl
parents:
diff changeset
1936 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
1937 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
1938 $echo "*** shared version of the library, which you do not appear to have"
551433a01cab initial coding
carl
parents:
diff changeset
1939 $echo "*** because the file extensions .$libext of this argument makes me believe"
551433a01cab initial coding
carl
parents:
diff changeset
1940 $echo "*** that it is just a static archive that I should not used here."
551433a01cab initial coding
carl
parents:
diff changeset
1941 else
551433a01cab initial coding
carl
parents:
diff changeset
1942 $echo
551433a01cab initial coding
carl
parents:
diff changeset
1943 $echo "*** Warning: Linking the shared library $output against the"
551433a01cab initial coding
carl
parents:
diff changeset
1944 $echo "*** static library $deplib is not portable!"
551433a01cab initial coding
carl
parents:
diff changeset
1945 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1946 fi
551433a01cab initial coding
carl
parents:
diff changeset
1947 continue
551433a01cab initial coding
carl
parents:
diff changeset
1948 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1949 prog)
551433a01cab initial coding
carl
parents:
diff changeset
1950 if test "$pass" != link; then
551433a01cab initial coding
carl
parents:
diff changeset
1951 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1952 else
551433a01cab initial coding
carl
parents:
diff changeset
1953 compile_deplibs="$deplib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1954 finalize_deplibs="$deplib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1955 fi
551433a01cab initial coding
carl
parents:
diff changeset
1956 continue
551433a01cab initial coding
carl
parents:
diff changeset
1957 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1958 esac # linkmode
551433a01cab initial coding
carl
parents:
diff changeset
1959 ;; # *.$libext
551433a01cab initial coding
carl
parents:
diff changeset
1960 *.lo | *.$objext)
551433a01cab initial coding
carl
parents:
diff changeset
1961 if test "$pass" = conv; then
551433a01cab initial coding
carl
parents:
diff changeset
1962 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1963 elif test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
1964 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
1965 # If there is no dlopen support or we're linking statically,
551433a01cab initial coding
carl
parents:
diff changeset
1966 # we need to preload.
551433a01cab initial coding
carl
parents:
diff changeset
1967 newdlprefiles="$newdlprefiles $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
1968 compile_deplibs="$deplib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1969 finalize_deplibs="$deplib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
1970 else
551433a01cab initial coding
carl
parents:
diff changeset
1971 newdlfiles="$newdlfiles $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
1972 fi
551433a01cab initial coding
carl
parents:
diff changeset
1973 fi
551433a01cab initial coding
carl
parents:
diff changeset
1974 continue
551433a01cab initial coding
carl
parents:
diff changeset
1975 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1976 %DEPLIBS%)
551433a01cab initial coding
carl
parents:
diff changeset
1977 alldeplibs=yes
551433a01cab initial coding
carl
parents:
diff changeset
1978 continue
551433a01cab initial coding
carl
parents:
diff changeset
1979 ;;
551433a01cab initial coding
carl
parents:
diff changeset
1980 esac # case $deplib
551433a01cab initial coding
carl
parents:
diff changeset
1981 if test "$found" = yes || test -f "$lib"; then :
551433a01cab initial coding
carl
parents:
diff changeset
1982 else
551433a01cab initial coding
carl
parents:
diff changeset
1983 $echo "$modename: cannot find the library \`$lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1984 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1985 fi
551433a01cab initial coding
carl
parents:
diff changeset
1986
551433a01cab initial coding
carl
parents:
diff changeset
1987 # Check to see that this really is a libtool archive.
551433a01cab initial coding
carl
parents:
diff changeset
1988 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
551433a01cab initial coding
carl
parents:
diff changeset
1989 else
551433a01cab initial coding
carl
parents:
diff changeset
1990 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
1991 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
1992 fi
551433a01cab initial coding
carl
parents:
diff changeset
1993
551433a01cab initial coding
carl
parents:
diff changeset
1994 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
1995 test "X$ladir" = "X$lib" && ladir="."
551433a01cab initial coding
carl
parents:
diff changeset
1996
551433a01cab initial coding
carl
parents:
diff changeset
1997 dlname=
551433a01cab initial coding
carl
parents:
diff changeset
1998 dlopen=
551433a01cab initial coding
carl
parents:
diff changeset
1999 dlpreopen=
551433a01cab initial coding
carl
parents:
diff changeset
2000 libdir=
551433a01cab initial coding
carl
parents:
diff changeset
2001 library_names=
551433a01cab initial coding
carl
parents:
diff changeset
2002 old_library=
551433a01cab initial coding
carl
parents:
diff changeset
2003 # If the library was installed with an old release of libtool,
551433a01cab initial coding
carl
parents:
diff changeset
2004 # it will not redefine variables installed, or shouldnotlink
551433a01cab initial coding
carl
parents:
diff changeset
2005 installed=yes
551433a01cab initial coding
carl
parents:
diff changeset
2006 shouldnotlink=no
551433a01cab initial coding
carl
parents:
diff changeset
2007
551433a01cab initial coding
carl
parents:
diff changeset
2008 # Read the .la file
551433a01cab initial coding
carl
parents:
diff changeset
2009 case $lib in
551433a01cab initial coding
carl
parents:
diff changeset
2010 */* | *\\*) . $lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
2011 *) . ./$lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
2012 esac
551433a01cab initial coding
carl
parents:
diff changeset
2013
551433a01cab initial coding
carl
parents:
diff changeset
2014 if test "$linkmode,$pass" = "lib,link" ||
551433a01cab initial coding
carl
parents:
diff changeset
2015 test "$linkmode,$pass" = "prog,scan" ||
551433a01cab initial coding
carl
parents:
diff changeset
2016 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
551433a01cab initial coding
carl
parents:
diff changeset
2017 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
551433a01cab initial coding
carl
parents:
diff changeset
2018 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
551433a01cab initial coding
carl
parents:
diff changeset
2019 fi
551433a01cab initial coding
carl
parents:
diff changeset
2020
551433a01cab initial coding
carl
parents:
diff changeset
2021 if test "$pass" = conv; then
551433a01cab initial coding
carl
parents:
diff changeset
2022 # Only check for convenience libraries
551433a01cab initial coding
carl
parents:
diff changeset
2023 deplibs="$lib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2024 tmp_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2025 for deplib in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2026 #echo "Adding $deplib to \$deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2027 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2028 if test "X$duplicate_deps" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2029 case "$tmp_libs " in
551433a01cab initial coding
carl
parents:
diff changeset
2030 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2031 esac
551433a01cab initial coding
carl
parents:
diff changeset
2032 fi
551433a01cab initial coding
carl
parents:
diff changeset
2033 tmp_libs="$tmp_libs $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
2034 done
551433a01cab initial coding
carl
parents:
diff changeset
2035 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2036 if test -z "$old_library"; then
551433a01cab initial coding
carl
parents:
diff changeset
2037 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2038 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2039 fi
551433a01cab initial coding
carl
parents:
diff changeset
2040 # It is a libtool convenience library, so add in its objects.
551433a01cab initial coding
carl
parents:
diff changeset
2041 convenience="$convenience $ladir/$objdir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2042 old_convenience="$old_convenience $ladir/$objdir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2043 elif test "$linkmode" != prog && test "$linkmode" != lib; then
551433a01cab initial coding
carl
parents:
diff changeset
2044 $echo "$modename: \`$lib' is not a convenience library" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2045 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2046 fi
551433a01cab initial coding
carl
parents:
diff changeset
2047 continue
551433a01cab initial coding
carl
parents:
diff changeset
2048 fi # $pass = conv
551433a01cab initial coding
carl
parents:
diff changeset
2049
551433a01cab initial coding
carl
parents:
diff changeset
2050
551433a01cab initial coding
carl
parents:
diff changeset
2051 # Get the name of the library we link against.
551433a01cab initial coding
carl
parents:
diff changeset
2052 linklib=
551433a01cab initial coding
carl
parents:
diff changeset
2053 for l in $old_library $library_names; do
551433a01cab initial coding
carl
parents:
diff changeset
2054 linklib="$l"
551433a01cab initial coding
carl
parents:
diff changeset
2055 done
551433a01cab initial coding
carl
parents:
diff changeset
2056 if test -z "$linklib"; then
551433a01cab initial coding
carl
parents:
diff changeset
2057 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2058 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2059 fi
551433a01cab initial coding
carl
parents:
diff changeset
2060
551433a01cab initial coding
carl
parents:
diff changeset
2061 # This library was specified with -dlopen.
551433a01cab initial coding
carl
parents:
diff changeset
2062 if test "$pass" = dlopen; then
551433a01cab initial coding
carl
parents:
diff changeset
2063 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2064 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2065 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2066 fi
551433a01cab initial coding
carl
parents:
diff changeset
2067 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2068 # If there is no dlname, no dlopen support or we're linking
551433a01cab initial coding
carl
parents:
diff changeset
2069 # statically, we need to preload. We also need to preload any
551433a01cab initial coding
carl
parents:
diff changeset
2070 # dependent libraries so libltdl's deplib preloader doesn't
551433a01cab initial coding
carl
parents:
diff changeset
2071 # bomb out in the load deplibs phase.
551433a01cab initial coding
carl
parents:
diff changeset
2072 dlprefiles="$dlprefiles $lib $dependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2073 else
551433a01cab initial coding
carl
parents:
diff changeset
2074 newdlfiles="$newdlfiles $lib"
551433a01cab initial coding
carl
parents:
diff changeset
2075 fi
551433a01cab initial coding
carl
parents:
diff changeset
2076 continue
551433a01cab initial coding
carl
parents:
diff changeset
2077 fi # $pass = dlopen
551433a01cab initial coding
carl
parents:
diff changeset
2078
551433a01cab initial coding
carl
parents:
diff changeset
2079 # We need an absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
2080 case $ladir in
551433a01cab initial coding
carl
parents:
diff changeset
2081 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2082 *)
551433a01cab initial coding
carl
parents:
diff changeset
2083 abs_ladir=`cd "$ladir" && pwd`
551433a01cab initial coding
carl
parents:
diff changeset
2084 if test -z "$abs_ladir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2085 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2086 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2087 abs_ladir="$ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2088 fi
551433a01cab initial coding
carl
parents:
diff changeset
2089 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2090 esac
551433a01cab initial coding
carl
parents:
diff changeset
2091 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
2092
551433a01cab initial coding
carl
parents:
diff changeset
2093 # Find the relevant object directory and library name.
551433a01cab initial coding
carl
parents:
diff changeset
2094 if test "X$installed" = Xyes; then
551433a01cab initial coding
carl
parents:
diff changeset
2095 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
551433a01cab initial coding
carl
parents:
diff changeset
2096 $echo "$modename: warning: library \`$lib' was moved." 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2097 dir="$ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2098 absdir="$abs_ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2099 libdir="$abs_ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2100 else
551433a01cab initial coding
carl
parents:
diff changeset
2101 dir="$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2102 absdir="$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2103 fi
551433a01cab initial coding
carl
parents:
diff changeset
2104 else
551433a01cab initial coding
carl
parents:
diff changeset
2105 dir="$ladir/$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
2106 absdir="$abs_ladir/$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
2107 # Remove this search path later
551433a01cab initial coding
carl
parents:
diff changeset
2108 notinst_path="$notinst_path $abs_ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2109 fi # $installed = yes
551433a01cab initial coding
carl
parents:
diff changeset
2110 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
551433a01cab initial coding
carl
parents:
diff changeset
2111
551433a01cab initial coding
carl
parents:
diff changeset
2112 # This library was specified with -dlpreopen.
551433a01cab initial coding
carl
parents:
diff changeset
2113 if test "$pass" = dlpreopen; then
551433a01cab initial coding
carl
parents:
diff changeset
2114 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2115 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2116 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2117 fi
551433a01cab initial coding
carl
parents:
diff changeset
2118 # Prefer using a static library (so that no silly _DYNAMIC symbols
551433a01cab initial coding
carl
parents:
diff changeset
2119 # are required to link).
551433a01cab initial coding
carl
parents:
diff changeset
2120 if test -n "$old_library"; then
551433a01cab initial coding
carl
parents:
diff changeset
2121 newdlprefiles="$newdlprefiles $dir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2122 # Otherwise, use the dlname, so that lt_dlopen finds it.
551433a01cab initial coding
carl
parents:
diff changeset
2123 elif test -n "$dlname"; then
551433a01cab initial coding
carl
parents:
diff changeset
2124 newdlprefiles="$newdlprefiles $dir/$dlname"
551433a01cab initial coding
carl
parents:
diff changeset
2125 else
551433a01cab initial coding
carl
parents:
diff changeset
2126 newdlprefiles="$newdlprefiles $dir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2127 fi
551433a01cab initial coding
carl
parents:
diff changeset
2128 fi # $pass = dlpreopen
551433a01cab initial coding
carl
parents:
diff changeset
2129
551433a01cab initial coding
carl
parents:
diff changeset
2130 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2131 # Link the convenience library
551433a01cab initial coding
carl
parents:
diff changeset
2132 if test "$linkmode" = lib; then
551433a01cab initial coding
carl
parents:
diff changeset
2133 deplibs="$dir/$old_library $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2134 elif test "$linkmode,$pass" = "prog,link"; then
551433a01cab initial coding
carl
parents:
diff changeset
2135 compile_deplibs="$dir/$old_library $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2136 finalize_deplibs="$dir/$old_library $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2137 else
551433a01cab initial coding
carl
parents:
diff changeset
2138 deplibs="$lib $deplibs" # used for prog,scan pass
551433a01cab initial coding
carl
parents:
diff changeset
2139 fi
551433a01cab initial coding
carl
parents:
diff changeset
2140 continue
551433a01cab initial coding
carl
parents:
diff changeset
2141 fi
551433a01cab initial coding
carl
parents:
diff changeset
2142
551433a01cab initial coding
carl
parents:
diff changeset
2143
551433a01cab initial coding
carl
parents:
diff changeset
2144 if test "$linkmode" = prog && test "$pass" != link; then
551433a01cab initial coding
carl
parents:
diff changeset
2145 newlib_search_path="$newlib_search_path $ladir"
551433a01cab initial coding
carl
parents:
diff changeset
2146 deplibs="$lib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2147
551433a01cab initial coding
carl
parents:
diff changeset
2148 linkalldeplibs=no
551433a01cab initial coding
carl
parents:
diff changeset
2149 if test "$link_all_deplibs" != no || test -z "$library_names" ||
551433a01cab initial coding
carl
parents:
diff changeset
2150 test "$build_libtool_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2151 linkalldeplibs=yes
551433a01cab initial coding
carl
parents:
diff changeset
2152 fi
551433a01cab initial coding
carl
parents:
diff changeset
2153
551433a01cab initial coding
carl
parents:
diff changeset
2154 tmp_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2155 for deplib in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2156 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
2157 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
551433a01cab initial coding
carl
parents:
diff changeset
2158 esac
551433a01cab initial coding
carl
parents:
diff changeset
2159 # Need to link against all dependency_libs?
551433a01cab initial coding
carl
parents:
diff changeset
2160 if test "$linkalldeplibs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2161 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2162 else
551433a01cab initial coding
carl
parents:
diff changeset
2163 # Need to hardcode shared library paths
551433a01cab initial coding
carl
parents:
diff changeset
2164 # or/and link against static libraries
551433a01cab initial coding
carl
parents:
diff changeset
2165 newdependency_libs="$deplib $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2166 fi
551433a01cab initial coding
carl
parents:
diff changeset
2167 if test "X$duplicate_deps" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2168 case "$tmp_libs " in
551433a01cab initial coding
carl
parents:
diff changeset
2169 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2170 esac
551433a01cab initial coding
carl
parents:
diff changeset
2171 fi
551433a01cab initial coding
carl
parents:
diff changeset
2172 tmp_libs="$tmp_libs $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
2173 done # for deplib
551433a01cab initial coding
carl
parents:
diff changeset
2174 continue
551433a01cab initial coding
carl
parents:
diff changeset
2175 fi # $linkmode = prog...
551433a01cab initial coding
carl
parents:
diff changeset
2176
551433a01cab initial coding
carl
parents:
diff changeset
2177 if test "$linkmode,$pass" = "prog,link"; then
551433a01cab initial coding
carl
parents:
diff changeset
2178 if test -n "$library_names" &&
551433a01cab initial coding
carl
parents:
diff changeset
2179 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
551433a01cab initial coding
carl
parents:
diff changeset
2180 # We need to hardcode the library path
551433a01cab initial coding
carl
parents:
diff changeset
2181 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
2182 # Make sure the rpath contains only unique directories.
551433a01cab initial coding
carl
parents:
diff changeset
2183 case "$temp_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2184 *" $dir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2185 *" $absdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2186 *) temp_rpath="$temp_rpath $dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2187 esac
551433a01cab initial coding
carl
parents:
diff changeset
2188 fi
551433a01cab initial coding
carl
parents:
diff changeset
2189
551433a01cab initial coding
carl
parents:
diff changeset
2190 # Hardcode the library path.
551433a01cab initial coding
carl
parents:
diff changeset
2191 # Skip directories that are in the system default run-time
551433a01cab initial coding
carl
parents:
diff changeset
2192 # search path.
551433a01cab initial coding
carl
parents:
diff changeset
2193 case " $sys_lib_dlsearch_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2194 *" $absdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2195 *)
551433a01cab initial coding
carl
parents:
diff changeset
2196 case "$compile_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2197 *" $absdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2198 *) compile_rpath="$compile_rpath $absdir"
551433a01cab initial coding
carl
parents:
diff changeset
2199 esac
551433a01cab initial coding
carl
parents:
diff changeset
2200 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2201 esac
551433a01cab initial coding
carl
parents:
diff changeset
2202 case " $sys_lib_dlsearch_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2203 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2204 *)
551433a01cab initial coding
carl
parents:
diff changeset
2205 case "$finalize_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2206 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2207 *) finalize_rpath="$finalize_rpath $libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2208 esac
551433a01cab initial coding
carl
parents:
diff changeset
2209 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2210 esac
551433a01cab initial coding
carl
parents:
diff changeset
2211 fi # $linkmode,$pass = prog,link...
551433a01cab initial coding
carl
parents:
diff changeset
2212
551433a01cab initial coding
carl
parents:
diff changeset
2213 if test "$alldeplibs" = yes &&
551433a01cab initial coding
carl
parents:
diff changeset
2214 { test "$deplibs_check_method" = pass_all ||
551433a01cab initial coding
carl
parents:
diff changeset
2215 { test "$build_libtool_libs" = yes &&
551433a01cab initial coding
carl
parents:
diff changeset
2216 test -n "$library_names"; }; }; then
551433a01cab initial coding
carl
parents:
diff changeset
2217 # We only need to search for static libraries
551433a01cab initial coding
carl
parents:
diff changeset
2218 continue
551433a01cab initial coding
carl
parents:
diff changeset
2219 fi
551433a01cab initial coding
carl
parents:
diff changeset
2220 fi
551433a01cab initial coding
carl
parents:
diff changeset
2221
551433a01cab initial coding
carl
parents:
diff changeset
2222 link_static=no # Whether the deplib will be linked statically
551433a01cab initial coding
carl
parents:
diff changeset
2223 if test -n "$library_names" &&
551433a01cab initial coding
carl
parents:
diff changeset
2224 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
551433a01cab initial coding
carl
parents:
diff changeset
2225 if test "$installed" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2226 notinst_deplibs="$notinst_deplibs $lib"
551433a01cab initial coding
carl
parents:
diff changeset
2227 need_relink=yes
551433a01cab initial coding
carl
parents:
diff changeset
2228 fi
551433a01cab initial coding
carl
parents:
diff changeset
2229 # This is a shared library
551433a01cab initial coding
carl
parents:
diff changeset
2230
551433a01cab initial coding
carl
parents:
diff changeset
2231 # Warn about portability, can't link against -module's on some systems (darwin)
551433a01cab initial coding
carl
parents:
diff changeset
2232 if test "$shouldnotlink" = yes && test "$pass" = link ; then
551433a01cab initial coding
carl
parents:
diff changeset
2233 $echo
551433a01cab initial coding
carl
parents:
diff changeset
2234 if test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
2235 $echo "*** Warning: Linking the executable $output against the loadable module"
551433a01cab initial coding
carl
parents:
diff changeset
2236 else
551433a01cab initial coding
carl
parents:
diff changeset
2237 $echo "*** Warning: Linking the shared library $output against the loadable module"
551433a01cab initial coding
carl
parents:
diff changeset
2238 fi
551433a01cab initial coding
carl
parents:
diff changeset
2239 $echo "*** $linklib is not portable!"
551433a01cab initial coding
carl
parents:
diff changeset
2240 fi
551433a01cab initial coding
carl
parents:
diff changeset
2241 if test "$linkmode" = lib &&
551433a01cab initial coding
carl
parents:
diff changeset
2242 test "$hardcode_into_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2243 # Hardcode the library path.
551433a01cab initial coding
carl
parents:
diff changeset
2244 # Skip directories that are in the system default run-time
551433a01cab initial coding
carl
parents:
diff changeset
2245 # search path.
551433a01cab initial coding
carl
parents:
diff changeset
2246 case " $sys_lib_dlsearch_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2247 *" $absdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2248 *)
551433a01cab initial coding
carl
parents:
diff changeset
2249 case "$compile_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2250 *" $absdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2251 *) compile_rpath="$compile_rpath $absdir"
551433a01cab initial coding
carl
parents:
diff changeset
2252 esac
551433a01cab initial coding
carl
parents:
diff changeset
2253 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2254 esac
551433a01cab initial coding
carl
parents:
diff changeset
2255 case " $sys_lib_dlsearch_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2256 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2257 *)
551433a01cab initial coding
carl
parents:
diff changeset
2258 case "$finalize_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2259 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2260 *) finalize_rpath="$finalize_rpath $libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2261 esac
551433a01cab initial coding
carl
parents:
diff changeset
2262 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2263 esac
551433a01cab initial coding
carl
parents:
diff changeset
2264 fi
551433a01cab initial coding
carl
parents:
diff changeset
2265
551433a01cab initial coding
carl
parents:
diff changeset
2266 if test -n "$old_archive_from_expsyms_cmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
2267 # figure out the soname
551433a01cab initial coding
carl
parents:
diff changeset
2268 set dummy $library_names
551433a01cab initial coding
carl
parents:
diff changeset
2269 realname="$2"
551433a01cab initial coding
carl
parents:
diff changeset
2270 shift; shift
551433a01cab initial coding
carl
parents:
diff changeset
2271 libname=`eval \\$echo \"$libname_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
2272 # use dlname if we got it. it's perfectly good, no?
551433a01cab initial coding
carl
parents:
diff changeset
2273 if test -n "$dlname"; then
551433a01cab initial coding
carl
parents:
diff changeset
2274 soname="$dlname"
551433a01cab initial coding
carl
parents:
diff changeset
2275 elif test -n "$soname_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
2276 # bleh windows
551433a01cab initial coding
carl
parents:
diff changeset
2277 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
2278 *cygwin* | mingw*)
551433a01cab initial coding
carl
parents:
diff changeset
2279 major=`expr $current - $age`
551433a01cab initial coding
carl
parents:
diff changeset
2280 versuffix="-$major"
551433a01cab initial coding
carl
parents:
diff changeset
2281 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2282 esac
551433a01cab initial coding
carl
parents:
diff changeset
2283 eval soname=\"$soname_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
2284 else
551433a01cab initial coding
carl
parents:
diff changeset
2285 soname="$realname"
551433a01cab initial coding
carl
parents:
diff changeset
2286 fi
551433a01cab initial coding
carl
parents:
diff changeset
2287
551433a01cab initial coding
carl
parents:
diff changeset
2288 # Make a new name for the extract_expsyms_cmds to use
551433a01cab initial coding
carl
parents:
diff changeset
2289 soroot="$soname"
551433a01cab initial coding
carl
parents:
diff changeset
2290 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
551433a01cab initial coding
carl
parents:
diff changeset
2291 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
551433a01cab initial coding
carl
parents:
diff changeset
2292
551433a01cab initial coding
carl
parents:
diff changeset
2293 # If the library has no export list, then create one now
551433a01cab initial coding
carl
parents:
diff changeset
2294 if test -f "$output_objdir/$soname-def"; then :
551433a01cab initial coding
carl
parents:
diff changeset
2295 else
551433a01cab initial coding
carl
parents:
diff changeset
2296 $show "extracting exported symbol list from \`$soname'"
551433a01cab initial coding
carl
parents:
diff changeset
2297 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
2298 eval cmds=\"$extract_expsyms_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
2299 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
2300 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
2301 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
2302 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
2303 done
551433a01cab initial coding
carl
parents:
diff changeset
2304 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
2305 fi
551433a01cab initial coding
carl
parents:
diff changeset
2306
551433a01cab initial coding
carl
parents:
diff changeset
2307 # Create $newlib
551433a01cab initial coding
carl
parents:
diff changeset
2308 if test -f "$output_objdir/$newlib"; then :; else
551433a01cab initial coding
carl
parents:
diff changeset
2309 $show "generating import library for \`$soname'"
551433a01cab initial coding
carl
parents:
diff changeset
2310 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
2311 eval cmds=\"$old_archive_from_expsyms_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
2312 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
2313 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
2314 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
2315 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
2316 done
551433a01cab initial coding
carl
parents:
diff changeset
2317 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
2318 fi
551433a01cab initial coding
carl
parents:
diff changeset
2319 # make sure the library variables are pointing to the new library
551433a01cab initial coding
carl
parents:
diff changeset
2320 dir=$output_objdir
551433a01cab initial coding
carl
parents:
diff changeset
2321 linklib=$newlib
551433a01cab initial coding
carl
parents:
diff changeset
2322 fi # test -n "$old_archive_from_expsyms_cmds"
551433a01cab initial coding
carl
parents:
diff changeset
2323
551433a01cab initial coding
carl
parents:
diff changeset
2324 if test "$linkmode" = prog || test "$mode" != relink; then
551433a01cab initial coding
carl
parents:
diff changeset
2325 add_shlibpath=
551433a01cab initial coding
carl
parents:
diff changeset
2326 add_dir=
551433a01cab initial coding
carl
parents:
diff changeset
2327 add=
551433a01cab initial coding
carl
parents:
diff changeset
2328 lib_linked=yes
551433a01cab initial coding
carl
parents:
diff changeset
2329 case $hardcode_action in
551433a01cab initial coding
carl
parents:
diff changeset
2330 immediate | unsupported)
551433a01cab initial coding
carl
parents:
diff changeset
2331 if test "$hardcode_direct" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2332 add="$dir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2333 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
2334 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2335 *-*-darwin* )
551433a01cab initial coding
carl
parents:
diff changeset
2336 # if the lib is a module then we can not link against it, someone
551433a01cab initial coding
carl
parents:
diff changeset
2337 # is ignoring the new warnings I added
551433a01cab initial coding
carl
parents:
diff changeset
2338 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
551433a01cab initial coding
carl
parents:
diff changeset
2339 $echo "** Warning, lib $linklib is a module, not a shared library"
551433a01cab initial coding
carl
parents:
diff changeset
2340 if test -z "$old_library" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2341 $echo
551433a01cab initial coding
carl
parents:
diff changeset
2342 $echo "** And there doesn't seem to be a static archive available"
551433a01cab initial coding
carl
parents:
diff changeset
2343 $echo "** The link will probably fail, sorry"
551433a01cab initial coding
carl
parents:
diff changeset
2344 else
551433a01cab initial coding
carl
parents:
diff changeset
2345 add="$dir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2346 fi
551433a01cab initial coding
carl
parents:
diff changeset
2347 fi
551433a01cab initial coding
carl
parents:
diff changeset
2348 esac
551433a01cab initial coding
carl
parents:
diff changeset
2349 elif test "$hardcode_minus_L" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2350 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
2351 *-*-sunos*) add_shlibpath="$dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2352 esac
551433a01cab initial coding
carl
parents:
diff changeset
2353 add_dir="-L$dir"
551433a01cab initial coding
carl
parents:
diff changeset
2354 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2355 elif test "$hardcode_shlibpath_var" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2356 add_shlibpath="$dir"
551433a01cab initial coding
carl
parents:
diff changeset
2357 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2358 else
551433a01cab initial coding
carl
parents:
diff changeset
2359 lib_linked=no
551433a01cab initial coding
carl
parents:
diff changeset
2360 fi
551433a01cab initial coding
carl
parents:
diff changeset
2361 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2362 relink)
551433a01cab initial coding
carl
parents:
diff changeset
2363 if test "$hardcode_direct" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2364 add="$dir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2365 elif test "$hardcode_minus_L" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2366 add_dir="-L$dir"
551433a01cab initial coding
carl
parents:
diff changeset
2367 # Try looking first in the location we're being installed to.
551433a01cab initial coding
carl
parents:
diff changeset
2368 if test -n "$inst_prefix_dir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2369 case "$libdir" in
551433a01cab initial coding
carl
parents:
diff changeset
2370 [\\/]*)
551433a01cab initial coding
carl
parents:
diff changeset
2371 add_dir="-L$inst_prefix_dir$libdir $add_dir"
551433a01cab initial coding
carl
parents:
diff changeset
2372 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2373 esac
551433a01cab initial coding
carl
parents:
diff changeset
2374 fi
551433a01cab initial coding
carl
parents:
diff changeset
2375 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2376 elif test "$hardcode_shlibpath_var" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2377 add_shlibpath="$dir"
551433a01cab initial coding
carl
parents:
diff changeset
2378 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2379 else
551433a01cab initial coding
carl
parents:
diff changeset
2380 lib_linked=no
551433a01cab initial coding
carl
parents:
diff changeset
2381 fi
551433a01cab initial coding
carl
parents:
diff changeset
2382 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2383 *) lib_linked=no ;;
551433a01cab initial coding
carl
parents:
diff changeset
2384 esac
551433a01cab initial coding
carl
parents:
diff changeset
2385
551433a01cab initial coding
carl
parents:
diff changeset
2386 if test "$lib_linked" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2387 $echo "$modename: configuration error: unsupported hardcode properties"
551433a01cab initial coding
carl
parents:
diff changeset
2388 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2389 fi
551433a01cab initial coding
carl
parents:
diff changeset
2390
551433a01cab initial coding
carl
parents:
diff changeset
2391 if test -n "$add_shlibpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
2392 case :$compile_shlibpath: in
551433a01cab initial coding
carl
parents:
diff changeset
2393 *":$add_shlibpath:"*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2394 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2395 esac
551433a01cab initial coding
carl
parents:
diff changeset
2396 fi
551433a01cab initial coding
carl
parents:
diff changeset
2397 if test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
2398 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2399 test -n "$add" && compile_deplibs="$add $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2400 else
551433a01cab initial coding
carl
parents:
diff changeset
2401 test -n "$add_dir" && deplibs="$add_dir $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2402 test -n "$add" && deplibs="$add $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2403 if test "$hardcode_direct" != yes && \
551433a01cab initial coding
carl
parents:
diff changeset
2404 test "$hardcode_minus_L" != yes && \
551433a01cab initial coding
carl
parents:
diff changeset
2405 test "$hardcode_shlibpath_var" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2406 case :$finalize_shlibpath: in
551433a01cab initial coding
carl
parents:
diff changeset
2407 *":$libdir:"*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2408 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2409 esac
551433a01cab initial coding
carl
parents:
diff changeset
2410 fi
551433a01cab initial coding
carl
parents:
diff changeset
2411 fi
551433a01cab initial coding
carl
parents:
diff changeset
2412 fi
551433a01cab initial coding
carl
parents:
diff changeset
2413
551433a01cab initial coding
carl
parents:
diff changeset
2414 if test "$linkmode" = prog || test "$mode" = relink; then
551433a01cab initial coding
carl
parents:
diff changeset
2415 add_shlibpath=
551433a01cab initial coding
carl
parents:
diff changeset
2416 add_dir=
551433a01cab initial coding
carl
parents:
diff changeset
2417 add=
551433a01cab initial coding
carl
parents:
diff changeset
2418 # Finalize command for both is simple: just hardcode it.
551433a01cab initial coding
carl
parents:
diff changeset
2419 if test "$hardcode_direct" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2420 add="$libdir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2421 elif test "$hardcode_minus_L" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2422 add_dir="-L$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2423 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2424 elif test "$hardcode_shlibpath_var" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2425 case :$finalize_shlibpath: in
551433a01cab initial coding
carl
parents:
diff changeset
2426 *":$libdir:"*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2427 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2428 esac
551433a01cab initial coding
carl
parents:
diff changeset
2429 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2430 elif test "$hardcode_automatic" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2431 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2432 add="$inst_prefix_dir$libdir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2433 else
551433a01cab initial coding
carl
parents:
diff changeset
2434 add="$libdir/$linklib"
551433a01cab initial coding
carl
parents:
diff changeset
2435 fi
551433a01cab initial coding
carl
parents:
diff changeset
2436 else
551433a01cab initial coding
carl
parents:
diff changeset
2437 # We cannot seem to hardcode it, guess we'll fake it.
551433a01cab initial coding
carl
parents:
diff changeset
2438 add_dir="-L$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
2439 # Try looking first in the location we're being installed to.
551433a01cab initial coding
carl
parents:
diff changeset
2440 if test -n "$inst_prefix_dir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2441 case "$libdir" in
551433a01cab initial coding
carl
parents:
diff changeset
2442 [\\/]*)
551433a01cab initial coding
carl
parents:
diff changeset
2443 add_dir="-L$inst_prefix_dir$libdir $add_dir"
551433a01cab initial coding
carl
parents:
diff changeset
2444 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2445 esac
551433a01cab initial coding
carl
parents:
diff changeset
2446 fi
551433a01cab initial coding
carl
parents:
diff changeset
2447 add="-l$name"
551433a01cab initial coding
carl
parents:
diff changeset
2448 fi
551433a01cab initial coding
carl
parents:
diff changeset
2449
551433a01cab initial coding
carl
parents:
diff changeset
2450 if test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
2451 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2452 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2453 else
551433a01cab initial coding
carl
parents:
diff changeset
2454 test -n "$add_dir" && deplibs="$add_dir $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2455 test -n "$add" && deplibs="$add $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2456 fi
551433a01cab initial coding
carl
parents:
diff changeset
2457 fi
551433a01cab initial coding
carl
parents:
diff changeset
2458 elif test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
2459 # Here we assume that one of hardcode_direct or hardcode_minus_L
551433a01cab initial coding
carl
parents:
diff changeset
2460 # is not unsupported. This is valid on all known static and
551433a01cab initial coding
carl
parents:
diff changeset
2461 # shared platforms.
551433a01cab initial coding
carl
parents:
diff changeset
2462 if test "$hardcode_direct" != unsupported; then
551433a01cab initial coding
carl
parents:
diff changeset
2463 test -n "$old_library" && linklib="$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2464 compile_deplibs="$dir/$linklib $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2465 finalize_deplibs="$dir/$linklib $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2466 else
551433a01cab initial coding
carl
parents:
diff changeset
2467 compile_deplibs="-l$name -L$dir $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2468 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2469 fi
551433a01cab initial coding
carl
parents:
diff changeset
2470 elif test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2471 # Not a shared library
551433a01cab initial coding
carl
parents:
diff changeset
2472 if test "$deplibs_check_method" != pass_all; then
551433a01cab initial coding
carl
parents:
diff changeset
2473 # We're trying link a shared library against a static one
551433a01cab initial coding
carl
parents:
diff changeset
2474 # but the system doesn't support it.
551433a01cab initial coding
carl
parents:
diff changeset
2475
551433a01cab initial coding
carl
parents:
diff changeset
2476 # Just print a warning and add the library to dependency_libs so
551433a01cab initial coding
carl
parents:
diff changeset
2477 # that the program can be linked against the static library.
551433a01cab initial coding
carl
parents:
diff changeset
2478 $echo
551433a01cab initial coding
carl
parents:
diff changeset
2479 $echo "*** Warning: This system can not link to static lib archive $lib."
551433a01cab initial coding
carl
parents:
diff changeset
2480 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
2481 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
2482 $echo "*** shared version of the library, which you do not appear to have."
551433a01cab initial coding
carl
parents:
diff changeset
2483 if test "$module" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2484 $echo "*** But as you try to build a module library, libtool will still create "
551433a01cab initial coding
carl
parents:
diff changeset
2485 $echo "*** a static module, that should work as long as the dlopening application"
551433a01cab initial coding
carl
parents:
diff changeset
2486 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
551433a01cab initial coding
carl
parents:
diff changeset
2487 if test -z "$global_symbol_pipe"; then
551433a01cab initial coding
carl
parents:
diff changeset
2488 $echo
551433a01cab initial coding
carl
parents:
diff changeset
2489 $echo "*** However, this would only work if libtool was able to extract symbol"
551433a01cab initial coding
carl
parents:
diff changeset
2490 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
551433a01cab initial coding
carl
parents:
diff changeset
2491 $echo "*** not find such a program. So, this module is probably useless."
551433a01cab initial coding
carl
parents:
diff changeset
2492 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
551433a01cab initial coding
carl
parents:
diff changeset
2493 fi
551433a01cab initial coding
carl
parents:
diff changeset
2494 if test "$build_old_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2495 build_libtool_libs=module
551433a01cab initial coding
carl
parents:
diff changeset
2496 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
2497 else
551433a01cab initial coding
carl
parents:
diff changeset
2498 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
2499 fi
551433a01cab initial coding
carl
parents:
diff changeset
2500 fi
551433a01cab initial coding
carl
parents:
diff changeset
2501 else
551433a01cab initial coding
carl
parents:
diff changeset
2502 convenience="$convenience $dir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2503 old_convenience="$old_convenience $dir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
2504 deplibs="$dir/$old_library $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2505 link_static=yes
551433a01cab initial coding
carl
parents:
diff changeset
2506 fi
551433a01cab initial coding
carl
parents:
diff changeset
2507 fi # link shared/static library?
551433a01cab initial coding
carl
parents:
diff changeset
2508
551433a01cab initial coding
carl
parents:
diff changeset
2509 if test "$linkmode" = lib; then
551433a01cab initial coding
carl
parents:
diff changeset
2510 #if test -n "$dependency_libs" &&
551433a01cab initial coding
carl
parents:
diff changeset
2511 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
551433a01cab initial coding
carl
parents:
diff changeset
2512 # test "$link_static" = yes; }; then
551433a01cab initial coding
carl
parents:
diff changeset
2513 # Extract -R from dependency_libs
551433a01cab initial coding
carl
parents:
diff changeset
2514 temp_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
2515 for libdir in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2516 case $libdir in
551433a01cab initial coding
carl
parents:
diff changeset
2517 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
551433a01cab initial coding
carl
parents:
diff changeset
2518 case " $xrpath " in
551433a01cab initial coding
carl
parents:
diff changeset
2519 *" $temp_xrpath "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2520 *) xrpath="$xrpath $temp_xrpath";;
551433a01cab initial coding
carl
parents:
diff changeset
2521 esac;;
551433a01cab initial coding
carl
parents:
diff changeset
2522 *) temp_deplibs="$temp_deplibs $libdir";;
551433a01cab initial coding
carl
parents:
diff changeset
2523 esac
551433a01cab initial coding
carl
parents:
diff changeset
2524 done
551433a01cab initial coding
carl
parents:
diff changeset
2525 dependency_libs="$temp_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2526 #fi
551433a01cab initial coding
carl
parents:
diff changeset
2527
551433a01cab initial coding
carl
parents:
diff changeset
2528 newlib_search_path="$newlib_search_path $absdir"
551433a01cab initial coding
carl
parents:
diff changeset
2529 # Link against this library
551433a01cab initial coding
carl
parents:
diff changeset
2530 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2531 # ... and its dependency_libs
551433a01cab initial coding
carl
parents:
diff changeset
2532 tmp_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2533 for deplib in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2534 newdependency_libs="$deplib $newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2535 if test "X$duplicate_deps" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2536 case "$tmp_libs " in
551433a01cab initial coding
carl
parents:
diff changeset
2537 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2538 esac
551433a01cab initial coding
carl
parents:
diff changeset
2539 fi
551433a01cab initial coding
carl
parents:
diff changeset
2540 tmp_libs="$tmp_libs $deplib"
551433a01cab initial coding
carl
parents:
diff changeset
2541 done
551433a01cab initial coding
carl
parents:
diff changeset
2542
551433a01cab initial coding
carl
parents:
diff changeset
2543 if test "$link_all_deplibs" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
2544 # Add the search paths of all dependency libraries
551433a01cab initial coding
carl
parents:
diff changeset
2545 for deplib in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2546 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
2547 -L*) path="$deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2548 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
2549 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
2550 test "X$dir" = "X$deplib" && dir="."
551433a01cab initial coding
carl
parents:
diff changeset
2551 # We need an absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
2552 case $dir in
551433a01cab initial coding
carl
parents:
diff changeset
2553 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2554 *)
551433a01cab initial coding
carl
parents:
diff changeset
2555 absdir=`cd "$dir" && pwd`
551433a01cab initial coding
carl
parents:
diff changeset
2556 if test -z "$absdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2557 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2558 absdir="$dir"
551433a01cab initial coding
carl
parents:
diff changeset
2559 fi
551433a01cab initial coding
carl
parents:
diff changeset
2560 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2561 esac
551433a01cab initial coding
carl
parents:
diff changeset
2562 if grep "^installed=no" $deplib > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
2563 path="$absdir/$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
2564 else
551433a01cab initial coding
carl
parents:
diff changeset
2565 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
551433a01cab initial coding
carl
parents:
diff changeset
2566 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2567 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2568 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2569 fi
551433a01cab initial coding
carl
parents:
diff changeset
2570 if test "$absdir" != "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
2571 # Sure, some shells/systems don't implement the -ef.
551433a01cab initial coding
carl
parents:
diff changeset
2572 # Those will have to live with the warning.
551433a01cab initial coding
carl
parents:
diff changeset
2573 test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
551433a01cab initial coding
carl
parents:
diff changeset
2574 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2575 fi
551433a01cab initial coding
carl
parents:
diff changeset
2576 path="$absdir"
551433a01cab initial coding
carl
parents:
diff changeset
2577 fi
551433a01cab initial coding
carl
parents:
diff changeset
2578 depdepl=
551433a01cab initial coding
carl
parents:
diff changeset
2579 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
2580 *-*-darwin*)
551433a01cab initial coding
carl
parents:
diff changeset
2581 # we do not want to link against static libs, but need to link against shared
551433a01cab initial coding
carl
parents:
diff changeset
2582 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
551433a01cab initial coding
carl
parents:
diff changeset
2583 if test -n "$deplibrary_names" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2584 for tmp in $deplibrary_names ; do
551433a01cab initial coding
carl
parents:
diff changeset
2585 depdepl=$tmp
551433a01cab initial coding
carl
parents:
diff changeset
2586 done
551433a01cab initial coding
carl
parents:
diff changeset
2587 if test -f "$path/$depdepl" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2588 depdepl="$path/$depdepl"
551433a01cab initial coding
carl
parents:
diff changeset
2589 fi
551433a01cab initial coding
carl
parents:
diff changeset
2590 # do not add paths which are already there
551433a01cab initial coding
carl
parents:
diff changeset
2591 case " $newlib_search_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2592 *" $path "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2593 *) newlib_search_path="$newlib_search_path $path";;
551433a01cab initial coding
carl
parents:
diff changeset
2594 esac
551433a01cab initial coding
carl
parents:
diff changeset
2595 path=""
551433a01cab initial coding
carl
parents:
diff changeset
2596 fi
551433a01cab initial coding
carl
parents:
diff changeset
2597 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2598 *)
551433a01cab initial coding
carl
parents:
diff changeset
2599 path="-L$path"
551433a01cab initial coding
carl
parents:
diff changeset
2600 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2601 esac
551433a01cab initial coding
carl
parents:
diff changeset
2602
551433a01cab initial coding
carl
parents:
diff changeset
2603 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2604 -l*)
551433a01cab initial coding
carl
parents:
diff changeset
2605 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
2606 *-*-darwin*)
551433a01cab initial coding
carl
parents:
diff changeset
2607 # Again, we only want to link against shared libraries
551433a01cab initial coding
carl
parents:
diff changeset
2608 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
551433a01cab initial coding
carl
parents:
diff changeset
2609 for tmp in $newlib_search_path ; do
551433a01cab initial coding
carl
parents:
diff changeset
2610 if test -f "$tmp/lib$tmp_libs.dylib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2611 eval depdepl="$tmp/lib$tmp_libs.dylib"
551433a01cab initial coding
carl
parents:
diff changeset
2612 break
551433a01cab initial coding
carl
parents:
diff changeset
2613 fi
551433a01cab initial coding
carl
parents:
diff changeset
2614 done
551433a01cab initial coding
carl
parents:
diff changeset
2615 path=""
551433a01cab initial coding
carl
parents:
diff changeset
2616 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2617 *) continue ;;
551433a01cab initial coding
carl
parents:
diff changeset
2618 esac
551433a01cab initial coding
carl
parents:
diff changeset
2619 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2620 *) continue ;;
551433a01cab initial coding
carl
parents:
diff changeset
2621 esac
551433a01cab initial coding
carl
parents:
diff changeset
2622 case " $deplibs " in
551433a01cab initial coding
carl
parents:
diff changeset
2623 *" $depdepl "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2624 *) deplibs="$deplibs $depdepl" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2625 esac
551433a01cab initial coding
carl
parents:
diff changeset
2626 case " $deplibs " in
551433a01cab initial coding
carl
parents:
diff changeset
2627 *" $path "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2628 *) deplibs="$deplibs $path" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2629 esac
551433a01cab initial coding
carl
parents:
diff changeset
2630 done
551433a01cab initial coding
carl
parents:
diff changeset
2631 fi # link_all_deplibs != no
551433a01cab initial coding
carl
parents:
diff changeset
2632 fi # linkmode = lib
551433a01cab initial coding
carl
parents:
diff changeset
2633 done # for deplib in $libs
551433a01cab initial coding
carl
parents:
diff changeset
2634 dependency_libs="$newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2635 if test "$pass" = dlpreopen; then
551433a01cab initial coding
carl
parents:
diff changeset
2636 # Link the dlpreopened libraries before other libraries
551433a01cab initial coding
carl
parents:
diff changeset
2637 for deplib in $save_deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
2638 deplibs="$deplib $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2639 done
551433a01cab initial coding
carl
parents:
diff changeset
2640 fi
551433a01cab initial coding
carl
parents:
diff changeset
2641 if test "$pass" != dlopen; then
551433a01cab initial coding
carl
parents:
diff changeset
2642 if test "$pass" != conv; then
551433a01cab initial coding
carl
parents:
diff changeset
2643 # Make sure lib_search_path contains only unique directories.
551433a01cab initial coding
carl
parents:
diff changeset
2644 lib_search_path=
551433a01cab initial coding
carl
parents:
diff changeset
2645 for dir in $newlib_search_path; do
551433a01cab initial coding
carl
parents:
diff changeset
2646 case "$lib_search_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2647 *" $dir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2648 *) lib_search_path="$lib_search_path $dir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2649 esac
551433a01cab initial coding
carl
parents:
diff changeset
2650 done
551433a01cab initial coding
carl
parents:
diff changeset
2651 newlib_search_path=
551433a01cab initial coding
carl
parents:
diff changeset
2652 fi
551433a01cab initial coding
carl
parents:
diff changeset
2653
551433a01cab initial coding
carl
parents:
diff changeset
2654 if test "$linkmode,$pass" != "prog,link"; then
551433a01cab initial coding
carl
parents:
diff changeset
2655 vars="deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2656 else
551433a01cab initial coding
carl
parents:
diff changeset
2657 vars="compile_deplibs finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2658 fi
551433a01cab initial coding
carl
parents:
diff changeset
2659 for var in $vars dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2660 # Add libraries to $var in reverse order
551433a01cab initial coding
carl
parents:
diff changeset
2661 eval tmp_libs=\"\$$var\"
551433a01cab initial coding
carl
parents:
diff changeset
2662 new_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2663 for deplib in $tmp_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2664 # FIXME: Pedantically, this is the right thing to do, so
551433a01cab initial coding
carl
parents:
diff changeset
2665 # that some nasty dependency loop isn't accidentally
551433a01cab initial coding
carl
parents:
diff changeset
2666 # broken:
551433a01cab initial coding
carl
parents:
diff changeset
2667 #new_libs="$deplib $new_libs"
551433a01cab initial coding
carl
parents:
diff changeset
2668 # Pragmatically, this seems to cause very few problems in
551433a01cab initial coding
carl
parents:
diff changeset
2669 # practice:
551433a01cab initial coding
carl
parents:
diff changeset
2670 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
2671 -L*) new_libs="$deplib $new_libs" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2672 -R*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2673 *)
551433a01cab initial coding
carl
parents:
diff changeset
2674 # And here is the reason: when a library appears more
551433a01cab initial coding
carl
parents:
diff changeset
2675 # than once as an explicit dependence of a library, or
551433a01cab initial coding
carl
parents:
diff changeset
2676 # is implicitly linked in more than once by the
551433a01cab initial coding
carl
parents:
diff changeset
2677 # compiler, it is considered special, and multiple
551433a01cab initial coding
carl
parents:
diff changeset
2678 # occurrences thereof are not removed. Compare this
551433a01cab initial coding
carl
parents:
diff changeset
2679 # with having the same library being listed as a
551433a01cab initial coding
carl
parents:
diff changeset
2680 # dependency of multiple other libraries: in this case,
551433a01cab initial coding
carl
parents:
diff changeset
2681 # we know (pedantically, we assume) the library does not
551433a01cab initial coding
carl
parents:
diff changeset
2682 # need to be listed more than once, so we keep only the
551433a01cab initial coding
carl
parents:
diff changeset
2683 # last copy. This is not always right, but it is rare
551433a01cab initial coding
carl
parents:
diff changeset
2684 # enough that we require users that really mean to play
551433a01cab initial coding
carl
parents:
diff changeset
2685 # such unportable linking tricks to link the library
551433a01cab initial coding
carl
parents:
diff changeset
2686 # using -Wl,-lname, so that libtool does not consider it
551433a01cab initial coding
carl
parents:
diff changeset
2687 # for duplicate removal.
551433a01cab initial coding
carl
parents:
diff changeset
2688 case " $specialdeplibs " in
551433a01cab initial coding
carl
parents:
diff changeset
2689 *" $deplib "*) new_libs="$deplib $new_libs" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2690 *)
551433a01cab initial coding
carl
parents:
diff changeset
2691 case " $new_libs " in
551433a01cab initial coding
carl
parents:
diff changeset
2692 *" $deplib "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2693 *) new_libs="$deplib $new_libs" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2694 esac
551433a01cab initial coding
carl
parents:
diff changeset
2695 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2696 esac
551433a01cab initial coding
carl
parents:
diff changeset
2697 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2698 esac
551433a01cab initial coding
carl
parents:
diff changeset
2699 done
551433a01cab initial coding
carl
parents:
diff changeset
2700 tmp_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2701 for deplib in $new_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
2702 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
2703 -L*)
551433a01cab initial coding
carl
parents:
diff changeset
2704 case " $tmp_libs " in
551433a01cab initial coding
carl
parents:
diff changeset
2705 *" $deplib "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2706 *) tmp_libs="$tmp_libs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2707 esac
551433a01cab initial coding
carl
parents:
diff changeset
2708 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2709 *) tmp_libs="$tmp_libs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
2710 esac
551433a01cab initial coding
carl
parents:
diff changeset
2711 done
551433a01cab initial coding
carl
parents:
diff changeset
2712 eval $var=\"$tmp_libs\"
551433a01cab initial coding
carl
parents:
diff changeset
2713 done # for var
551433a01cab initial coding
carl
parents:
diff changeset
2714 fi
551433a01cab initial coding
carl
parents:
diff changeset
2715 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
551433a01cab initial coding
carl
parents:
diff changeset
2716 tmp_libs=
551433a01cab initial coding
carl
parents:
diff changeset
2717 for i in $dependency_libs ; do
551433a01cab initial coding
carl
parents:
diff changeset
2718 case " $predeps $postdeps $compiler_lib_search_path " in
551433a01cab initial coding
carl
parents:
diff changeset
2719 *" $i "*)
551433a01cab initial coding
carl
parents:
diff changeset
2720 i=""
551433a01cab initial coding
carl
parents:
diff changeset
2721 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2722 esac
551433a01cab initial coding
carl
parents:
diff changeset
2723 if test -n "$i" ; then
551433a01cab initial coding
carl
parents:
diff changeset
2724 tmp_libs="$tmp_libs $i"
551433a01cab initial coding
carl
parents:
diff changeset
2725 fi
551433a01cab initial coding
carl
parents:
diff changeset
2726 done
551433a01cab initial coding
carl
parents:
diff changeset
2727 dependency_libs=$tmp_libs
551433a01cab initial coding
carl
parents:
diff changeset
2728 done # for pass
551433a01cab initial coding
carl
parents:
diff changeset
2729 if test "$linkmode" = prog; then
551433a01cab initial coding
carl
parents:
diff changeset
2730 dlfiles="$newdlfiles"
551433a01cab initial coding
carl
parents:
diff changeset
2731 dlprefiles="$newdlprefiles"
551433a01cab initial coding
carl
parents:
diff changeset
2732 fi
551433a01cab initial coding
carl
parents:
diff changeset
2733
551433a01cab initial coding
carl
parents:
diff changeset
2734 case $linkmode in
551433a01cab initial coding
carl
parents:
diff changeset
2735 oldlib)
551433a01cab initial coding
carl
parents:
diff changeset
2736 if test -n "$deplibs"; then
551433a01cab initial coding
carl
parents:
diff changeset
2737 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2738 fi
551433a01cab initial coding
carl
parents:
diff changeset
2739
551433a01cab initial coding
carl
parents:
diff changeset
2740 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
2741 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2742 fi
551433a01cab initial coding
carl
parents:
diff changeset
2743
551433a01cab initial coding
carl
parents:
diff changeset
2744 if test -n "$rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
2745 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2746 fi
551433a01cab initial coding
carl
parents:
diff changeset
2747
551433a01cab initial coding
carl
parents:
diff changeset
2748 if test -n "$xrpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
2749 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2750 fi
551433a01cab initial coding
carl
parents:
diff changeset
2751
551433a01cab initial coding
carl
parents:
diff changeset
2752 if test -n "$vinfo"; then
551433a01cab initial coding
carl
parents:
diff changeset
2753 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2754 fi
551433a01cab initial coding
carl
parents:
diff changeset
2755
551433a01cab initial coding
carl
parents:
diff changeset
2756 if test -n "$release"; then
551433a01cab initial coding
carl
parents:
diff changeset
2757 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2758 fi
551433a01cab initial coding
carl
parents:
diff changeset
2759
551433a01cab initial coding
carl
parents:
diff changeset
2760 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
551433a01cab initial coding
carl
parents:
diff changeset
2761 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2762 fi
551433a01cab initial coding
carl
parents:
diff changeset
2763
551433a01cab initial coding
carl
parents:
diff changeset
2764 # Now set the variables for building old libraries.
551433a01cab initial coding
carl
parents:
diff changeset
2765 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
2766 oldlibs="$output"
551433a01cab initial coding
carl
parents:
diff changeset
2767 objs="$objs$old_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
2768 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2769
551433a01cab initial coding
carl
parents:
diff changeset
2770 lib)
551433a01cab initial coding
carl
parents:
diff changeset
2771 # Make sure we only generate libraries of the form `libNAME.la'.
551433a01cab initial coding
carl
parents:
diff changeset
2772 case $outputname in
551433a01cab initial coding
carl
parents:
diff changeset
2773 lib*)
551433a01cab initial coding
carl
parents:
diff changeset
2774 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
551433a01cab initial coding
carl
parents:
diff changeset
2775 eval shared_ext=\"$shrext\"
551433a01cab initial coding
carl
parents:
diff changeset
2776 eval libname=\"$libname_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
2777 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2778 *)
551433a01cab initial coding
carl
parents:
diff changeset
2779 if test "$module" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
2780 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2781 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2782 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2783 fi
551433a01cab initial coding
carl
parents:
diff changeset
2784 if test "$need_lib_prefix" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
2785 # Add the "lib" prefix for modules if required
551433a01cab initial coding
carl
parents:
diff changeset
2786 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
551433a01cab initial coding
carl
parents:
diff changeset
2787 eval shared_ext=\"$shrext\"
551433a01cab initial coding
carl
parents:
diff changeset
2788 eval libname=\"$libname_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
2789 else
551433a01cab initial coding
carl
parents:
diff changeset
2790 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
551433a01cab initial coding
carl
parents:
diff changeset
2791 fi
551433a01cab initial coding
carl
parents:
diff changeset
2792 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2793 esac
551433a01cab initial coding
carl
parents:
diff changeset
2794
551433a01cab initial coding
carl
parents:
diff changeset
2795 if test -n "$objs"; then
551433a01cab initial coding
carl
parents:
diff changeset
2796 if test "$deplibs_check_method" != pass_all; then
551433a01cab initial coding
carl
parents:
diff changeset
2797 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
551433a01cab initial coding
carl
parents:
diff changeset
2798 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2799 else
551433a01cab initial coding
carl
parents:
diff changeset
2800 $echo
551433a01cab initial coding
carl
parents:
diff changeset
2801 $echo "*** Warning: Linking the shared library $output against the non-libtool"
551433a01cab initial coding
carl
parents:
diff changeset
2802 $echo "*** objects $objs is not portable!"
551433a01cab initial coding
carl
parents:
diff changeset
2803 libobjs="$libobjs $objs"
551433a01cab initial coding
carl
parents:
diff changeset
2804 fi
551433a01cab initial coding
carl
parents:
diff changeset
2805 fi
551433a01cab initial coding
carl
parents:
diff changeset
2806
551433a01cab initial coding
carl
parents:
diff changeset
2807 if test "$dlself" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
2808 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2809 fi
551433a01cab initial coding
carl
parents:
diff changeset
2810
551433a01cab initial coding
carl
parents:
diff changeset
2811 set dummy $rpath
551433a01cab initial coding
carl
parents:
diff changeset
2812 if test "$#" -gt 2; then
551433a01cab initial coding
carl
parents:
diff changeset
2813 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2814 fi
551433a01cab initial coding
carl
parents:
diff changeset
2815 install_libdir="$2"
551433a01cab initial coding
carl
parents:
diff changeset
2816
551433a01cab initial coding
carl
parents:
diff changeset
2817 oldlibs=
551433a01cab initial coding
carl
parents:
diff changeset
2818 if test -z "$rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
2819 if test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
2820 # Building a libtool convenience library.
551433a01cab initial coding
carl
parents:
diff changeset
2821 # Some compilers have problems with a `.al' extension so
551433a01cab initial coding
carl
parents:
diff changeset
2822 # convenience libraries should have the same extension an
551433a01cab initial coding
carl
parents:
diff changeset
2823 # archive normally would.
551433a01cab initial coding
carl
parents:
diff changeset
2824 oldlibs="$output_objdir/$libname.$libext $oldlibs"
551433a01cab initial coding
carl
parents:
diff changeset
2825 build_libtool_libs=convenience
551433a01cab initial coding
carl
parents:
diff changeset
2826 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
2827 fi
551433a01cab initial coding
carl
parents:
diff changeset
2828
551433a01cab initial coding
carl
parents:
diff changeset
2829 if test -n "$vinfo"; then
551433a01cab initial coding
carl
parents:
diff changeset
2830 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2831 fi
551433a01cab initial coding
carl
parents:
diff changeset
2832
551433a01cab initial coding
carl
parents:
diff changeset
2833 if test -n "$release"; then
551433a01cab initial coding
carl
parents:
diff changeset
2834 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2835 fi
551433a01cab initial coding
carl
parents:
diff changeset
2836 else
551433a01cab initial coding
carl
parents:
diff changeset
2837
551433a01cab initial coding
carl
parents:
diff changeset
2838 # Parse the version information argument.
551433a01cab initial coding
carl
parents:
diff changeset
2839 save_ifs="$IFS"; IFS=':'
551433a01cab initial coding
carl
parents:
diff changeset
2840 set dummy $vinfo 0 0 0
551433a01cab initial coding
carl
parents:
diff changeset
2841 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
2842
551433a01cab initial coding
carl
parents:
diff changeset
2843 if test -n "$8"; then
551433a01cab initial coding
carl
parents:
diff changeset
2844 $echo "$modename: too many parameters to \`-version-info'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2845 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2846 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2847 fi
551433a01cab initial coding
carl
parents:
diff changeset
2848
551433a01cab initial coding
carl
parents:
diff changeset
2849 # convert absolute version numbers to libtool ages
551433a01cab initial coding
carl
parents:
diff changeset
2850 # this retains compatibility with .la files and attempts
551433a01cab initial coding
carl
parents:
diff changeset
2851 # to make the code below a bit more comprehensible
551433a01cab initial coding
carl
parents:
diff changeset
2852
551433a01cab initial coding
carl
parents:
diff changeset
2853 case $vinfo_number in
551433a01cab initial coding
carl
parents:
diff changeset
2854 yes)
551433a01cab initial coding
carl
parents:
diff changeset
2855 number_major="$2"
551433a01cab initial coding
carl
parents:
diff changeset
2856 number_minor="$3"
551433a01cab initial coding
carl
parents:
diff changeset
2857 number_revision="$4"
551433a01cab initial coding
carl
parents:
diff changeset
2858 #
551433a01cab initial coding
carl
parents:
diff changeset
2859 # There are really only two kinds -- those that
551433a01cab initial coding
carl
parents:
diff changeset
2860 # use the current revision as the major version
551433a01cab initial coding
carl
parents:
diff changeset
2861 # and those that subtract age and use age as
551433a01cab initial coding
carl
parents:
diff changeset
2862 # a minor version. But, then there is irix
551433a01cab initial coding
carl
parents:
diff changeset
2863 # which has an extra 1 added just for fun
551433a01cab initial coding
carl
parents:
diff changeset
2864 #
551433a01cab initial coding
carl
parents:
diff changeset
2865 case $version_type in
551433a01cab initial coding
carl
parents:
diff changeset
2866 darwin|linux|osf|windows)
551433a01cab initial coding
carl
parents:
diff changeset
2867 current=`expr $number_major + $number_minor`
551433a01cab initial coding
carl
parents:
diff changeset
2868 age="$number_minor"
551433a01cab initial coding
carl
parents:
diff changeset
2869 revision="$number_revision"
551433a01cab initial coding
carl
parents:
diff changeset
2870 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2871 freebsd-aout|freebsd-elf|sunos)
551433a01cab initial coding
carl
parents:
diff changeset
2872 current="$number_major"
551433a01cab initial coding
carl
parents:
diff changeset
2873 revision="$number_minor"
551433a01cab initial coding
carl
parents:
diff changeset
2874 age="0"
551433a01cab initial coding
carl
parents:
diff changeset
2875 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2876 irix|nonstopux)
551433a01cab initial coding
carl
parents:
diff changeset
2877 current=`expr $number_major + $number_minor - 1`
551433a01cab initial coding
carl
parents:
diff changeset
2878 age="$number_minor"
551433a01cab initial coding
carl
parents:
diff changeset
2879 revision="$number_minor"
551433a01cab initial coding
carl
parents:
diff changeset
2880 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2881 esac
551433a01cab initial coding
carl
parents:
diff changeset
2882 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2883 no)
551433a01cab initial coding
carl
parents:
diff changeset
2884 current="$2"
551433a01cab initial coding
carl
parents:
diff changeset
2885 revision="$3"
551433a01cab initial coding
carl
parents:
diff changeset
2886 age="$4"
551433a01cab initial coding
carl
parents:
diff changeset
2887 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2888 esac
551433a01cab initial coding
carl
parents:
diff changeset
2889
551433a01cab initial coding
carl
parents:
diff changeset
2890 # Check that each of the things are valid numbers.
551433a01cab initial coding
carl
parents:
diff changeset
2891 case $current in
551433a01cab initial coding
carl
parents:
diff changeset
2892 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2893 *)
551433a01cab initial coding
carl
parents:
diff changeset
2894 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2895 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2896 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2897 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2898 esac
551433a01cab initial coding
carl
parents:
diff changeset
2899
551433a01cab initial coding
carl
parents:
diff changeset
2900 case $revision in
551433a01cab initial coding
carl
parents:
diff changeset
2901 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2902 *)
551433a01cab initial coding
carl
parents:
diff changeset
2903 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2904 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2905 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2906 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2907 esac
551433a01cab initial coding
carl
parents:
diff changeset
2908
551433a01cab initial coding
carl
parents:
diff changeset
2909 case $age in
551433a01cab initial coding
carl
parents:
diff changeset
2910 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2911 *)
551433a01cab initial coding
carl
parents:
diff changeset
2912 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2913 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2914 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2915 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2916 esac
551433a01cab initial coding
carl
parents:
diff changeset
2917
551433a01cab initial coding
carl
parents:
diff changeset
2918 if test "$age" -gt "$current"; then
551433a01cab initial coding
carl
parents:
diff changeset
2919 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2920 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
2921 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
2922 fi
551433a01cab initial coding
carl
parents:
diff changeset
2923
551433a01cab initial coding
carl
parents:
diff changeset
2924 # Calculate the version variables.
551433a01cab initial coding
carl
parents:
diff changeset
2925 major=
551433a01cab initial coding
carl
parents:
diff changeset
2926 versuffix=
551433a01cab initial coding
carl
parents:
diff changeset
2927 verstring=
551433a01cab initial coding
carl
parents:
diff changeset
2928 case $version_type in
551433a01cab initial coding
carl
parents:
diff changeset
2929 none) ;;
551433a01cab initial coding
carl
parents:
diff changeset
2930
551433a01cab initial coding
carl
parents:
diff changeset
2931 darwin)
551433a01cab initial coding
carl
parents:
diff changeset
2932 # Like Linux, but with the current version available in
551433a01cab initial coding
carl
parents:
diff changeset
2933 # verstring for coding it into the library header
551433a01cab initial coding
carl
parents:
diff changeset
2934 major=.`expr $current - $age`
551433a01cab initial coding
carl
parents:
diff changeset
2935 versuffix="$major.$age.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2936 # Darwin ld doesn't like 0 for these options...
551433a01cab initial coding
carl
parents:
diff changeset
2937 minor_current=`expr $current + 1`
551433a01cab initial coding
carl
parents:
diff changeset
2938 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2939 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2940
551433a01cab initial coding
carl
parents:
diff changeset
2941 freebsd-aout)
551433a01cab initial coding
carl
parents:
diff changeset
2942 major=".$current"
551433a01cab initial coding
carl
parents:
diff changeset
2943 versuffix=".$current.$revision";
551433a01cab initial coding
carl
parents:
diff changeset
2944 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2945
551433a01cab initial coding
carl
parents:
diff changeset
2946 freebsd-elf)
551433a01cab initial coding
carl
parents:
diff changeset
2947 major=".$current"
551433a01cab initial coding
carl
parents:
diff changeset
2948 versuffix=".$current";
551433a01cab initial coding
carl
parents:
diff changeset
2949 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2950
551433a01cab initial coding
carl
parents:
diff changeset
2951 irix | nonstopux)
551433a01cab initial coding
carl
parents:
diff changeset
2952 major=`expr $current - $age + 1`
551433a01cab initial coding
carl
parents:
diff changeset
2953
551433a01cab initial coding
carl
parents:
diff changeset
2954 case $version_type in
551433a01cab initial coding
carl
parents:
diff changeset
2955 nonstopux) verstring_prefix=nonstopux ;;
551433a01cab initial coding
carl
parents:
diff changeset
2956 *) verstring_prefix=sgi ;;
551433a01cab initial coding
carl
parents:
diff changeset
2957 esac
551433a01cab initial coding
carl
parents:
diff changeset
2958 verstring="$verstring_prefix$major.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2959
551433a01cab initial coding
carl
parents:
diff changeset
2960 # Add in all the interfaces that we are compatible with.
551433a01cab initial coding
carl
parents:
diff changeset
2961 loop=$revision
551433a01cab initial coding
carl
parents:
diff changeset
2962 while test "$loop" -ne 0; do
551433a01cab initial coding
carl
parents:
diff changeset
2963 iface=`expr $revision - $loop`
551433a01cab initial coding
carl
parents:
diff changeset
2964 loop=`expr $loop - 1`
551433a01cab initial coding
carl
parents:
diff changeset
2965 verstring="$verstring_prefix$major.$iface:$verstring"
551433a01cab initial coding
carl
parents:
diff changeset
2966 done
551433a01cab initial coding
carl
parents:
diff changeset
2967
551433a01cab initial coding
carl
parents:
diff changeset
2968 # Before this point, $major must not contain `.'.
551433a01cab initial coding
carl
parents:
diff changeset
2969 major=.$major
551433a01cab initial coding
carl
parents:
diff changeset
2970 versuffix="$major.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2971 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2972
551433a01cab initial coding
carl
parents:
diff changeset
2973 linux)
551433a01cab initial coding
carl
parents:
diff changeset
2974 major=.`expr $current - $age`
551433a01cab initial coding
carl
parents:
diff changeset
2975 versuffix="$major.$age.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2976 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2977
551433a01cab initial coding
carl
parents:
diff changeset
2978 osf)
551433a01cab initial coding
carl
parents:
diff changeset
2979 major=.`expr $current - $age`
551433a01cab initial coding
carl
parents:
diff changeset
2980 versuffix=".$current.$age.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2981 verstring="$current.$age.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2982
551433a01cab initial coding
carl
parents:
diff changeset
2983 # Add in all the interfaces that we are compatible with.
551433a01cab initial coding
carl
parents:
diff changeset
2984 loop=$age
551433a01cab initial coding
carl
parents:
diff changeset
2985 while test "$loop" -ne 0; do
551433a01cab initial coding
carl
parents:
diff changeset
2986 iface=`expr $current - $loop`
551433a01cab initial coding
carl
parents:
diff changeset
2987 loop=`expr $loop - 1`
551433a01cab initial coding
carl
parents:
diff changeset
2988 verstring="$verstring:${iface}.0"
551433a01cab initial coding
carl
parents:
diff changeset
2989 done
551433a01cab initial coding
carl
parents:
diff changeset
2990
551433a01cab initial coding
carl
parents:
diff changeset
2991 # Make executables depend on our current version.
551433a01cab initial coding
carl
parents:
diff changeset
2992 verstring="$verstring:${current}.0"
551433a01cab initial coding
carl
parents:
diff changeset
2993 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2994
551433a01cab initial coding
carl
parents:
diff changeset
2995 sunos)
551433a01cab initial coding
carl
parents:
diff changeset
2996 major=".$current"
551433a01cab initial coding
carl
parents:
diff changeset
2997 versuffix=".$current.$revision"
551433a01cab initial coding
carl
parents:
diff changeset
2998 ;;
551433a01cab initial coding
carl
parents:
diff changeset
2999
551433a01cab initial coding
carl
parents:
diff changeset
3000 windows)
551433a01cab initial coding
carl
parents:
diff changeset
3001 # Use '-' rather than '.', since we only want one
551433a01cab initial coding
carl
parents:
diff changeset
3002 # extension on DOS 8.3 filesystems.
551433a01cab initial coding
carl
parents:
diff changeset
3003 major=`expr $current - $age`
551433a01cab initial coding
carl
parents:
diff changeset
3004 versuffix="-$major"
551433a01cab initial coding
carl
parents:
diff changeset
3005 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3006
551433a01cab initial coding
carl
parents:
diff changeset
3007 *)
551433a01cab initial coding
carl
parents:
diff changeset
3008 $echo "$modename: unknown library version type \`$version_type'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3009 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3010 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
3011 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3012 esac
551433a01cab initial coding
carl
parents:
diff changeset
3013
551433a01cab initial coding
carl
parents:
diff changeset
3014 # Clear the version info if we defaulted, and they specified a release.
551433a01cab initial coding
carl
parents:
diff changeset
3015 if test -z "$vinfo" && test -n "$release"; then
551433a01cab initial coding
carl
parents:
diff changeset
3016 major=
551433a01cab initial coding
carl
parents:
diff changeset
3017 case $version_type in
551433a01cab initial coding
carl
parents:
diff changeset
3018 darwin)
551433a01cab initial coding
carl
parents:
diff changeset
3019 # we can't check for "0.0" in archive_cmds due to quoting
551433a01cab initial coding
carl
parents:
diff changeset
3020 # problems, so we reset it completely
551433a01cab initial coding
carl
parents:
diff changeset
3021 verstring=
551433a01cab initial coding
carl
parents:
diff changeset
3022 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3023 *)
551433a01cab initial coding
carl
parents:
diff changeset
3024 verstring="0.0"
551433a01cab initial coding
carl
parents:
diff changeset
3025 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3026 esac
551433a01cab initial coding
carl
parents:
diff changeset
3027 if test "$need_version" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
3028 versuffix=
551433a01cab initial coding
carl
parents:
diff changeset
3029 else
551433a01cab initial coding
carl
parents:
diff changeset
3030 versuffix=".0.0"
551433a01cab initial coding
carl
parents:
diff changeset
3031 fi
551433a01cab initial coding
carl
parents:
diff changeset
3032 fi
551433a01cab initial coding
carl
parents:
diff changeset
3033
551433a01cab initial coding
carl
parents:
diff changeset
3034 # Remove version info from name if versioning should be avoided
551433a01cab initial coding
carl
parents:
diff changeset
3035 if test "$avoid_version" = yes && test "$need_version" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
3036 major=
551433a01cab initial coding
carl
parents:
diff changeset
3037 versuffix=
551433a01cab initial coding
carl
parents:
diff changeset
3038 verstring=""
551433a01cab initial coding
carl
parents:
diff changeset
3039 fi
551433a01cab initial coding
carl
parents:
diff changeset
3040
551433a01cab initial coding
carl
parents:
diff changeset
3041 # Check to see if the archive will have undefined symbols.
551433a01cab initial coding
carl
parents:
diff changeset
3042 if test "$allow_undefined" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3043 if test "$allow_undefined_flag" = unsupported; then
551433a01cab initial coding
carl
parents:
diff changeset
3044 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3045 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
3046 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
3047 fi
551433a01cab initial coding
carl
parents:
diff changeset
3048 else
551433a01cab initial coding
carl
parents:
diff changeset
3049 # Don't allow undefined symbols.
551433a01cab initial coding
carl
parents:
diff changeset
3050 allow_undefined_flag="$no_undefined_flag"
551433a01cab initial coding
carl
parents:
diff changeset
3051 fi
551433a01cab initial coding
carl
parents:
diff changeset
3052 fi
551433a01cab initial coding
carl
parents:
diff changeset
3053
551433a01cab initial coding
carl
parents:
diff changeset
3054 if test "$mode" != relink; then
551433a01cab initial coding
carl
parents:
diff changeset
3055 # Remove our outputs, but don't remove object files since they
551433a01cab initial coding
carl
parents:
diff changeset
3056 # may have been created when compiling PIC objects.
551433a01cab initial coding
carl
parents:
diff changeset
3057 removelist=
551433a01cab initial coding
carl
parents:
diff changeset
3058 tempremovelist=`$echo "$output_objdir/*"`
551433a01cab initial coding
carl
parents:
diff changeset
3059 for p in $tempremovelist; do
551433a01cab initial coding
carl
parents:
diff changeset
3060 case $p in
551433a01cab initial coding
carl
parents:
diff changeset
3061 *.$objext)
551433a01cab initial coding
carl
parents:
diff changeset
3062 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3063 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
551433a01cab initial coding
carl
parents:
diff changeset
3064 removelist="$removelist $p"
551433a01cab initial coding
carl
parents:
diff changeset
3065 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3066 *) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3067 esac
551433a01cab initial coding
carl
parents:
diff changeset
3068 done
551433a01cab initial coding
carl
parents:
diff changeset
3069 if test -n "$removelist"; then
551433a01cab initial coding
carl
parents:
diff changeset
3070 $show "${rm}r $removelist"
551433a01cab initial coding
carl
parents:
diff changeset
3071 $run ${rm}r $removelist
551433a01cab initial coding
carl
parents:
diff changeset
3072 fi
551433a01cab initial coding
carl
parents:
diff changeset
3073 fi
551433a01cab initial coding
carl
parents:
diff changeset
3074
551433a01cab initial coding
carl
parents:
diff changeset
3075 # Now set the variables for building old libraries.
551433a01cab initial coding
carl
parents:
diff changeset
3076 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
551433a01cab initial coding
carl
parents:
diff changeset
3077 oldlibs="$oldlibs $output_objdir/$libname.$libext"
551433a01cab initial coding
carl
parents:
diff changeset
3078
551433a01cab initial coding
carl
parents:
diff changeset
3079 # Transform .lo files to .o files.
551433a01cab initial coding
carl
parents:
diff changeset
3080 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
3081 fi
551433a01cab initial coding
carl
parents:
diff changeset
3082
551433a01cab initial coding
carl
parents:
diff changeset
3083 # Eliminate all temporary directories.
551433a01cab initial coding
carl
parents:
diff changeset
3084 for path in $notinst_path; do
551433a01cab initial coding
carl
parents:
diff changeset
3085 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
551433a01cab initial coding
carl
parents:
diff changeset
3086 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
551433a01cab initial coding
carl
parents:
diff changeset
3087 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
551433a01cab initial coding
carl
parents:
diff changeset
3088 done
551433a01cab initial coding
carl
parents:
diff changeset
3089
551433a01cab initial coding
carl
parents:
diff changeset
3090 if test -n "$xrpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3091 # If the user specified any rpath flags, then add them.
551433a01cab initial coding
carl
parents:
diff changeset
3092 temp_xrpath=
551433a01cab initial coding
carl
parents:
diff changeset
3093 for libdir in $xrpath; do
551433a01cab initial coding
carl
parents:
diff changeset
3094 temp_xrpath="$temp_xrpath -R$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
3095 case "$finalize_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
3096 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3097 *) finalize_rpath="$finalize_rpath $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3098 esac
551433a01cab initial coding
carl
parents:
diff changeset
3099 done
551433a01cab initial coding
carl
parents:
diff changeset
3100 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3101 dependency_libs="$temp_xrpath $dependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
3102 fi
551433a01cab initial coding
carl
parents:
diff changeset
3103 fi
551433a01cab initial coding
carl
parents:
diff changeset
3104
551433a01cab initial coding
carl
parents:
diff changeset
3105 # Make sure dlfiles contains only unique files that won't be dlpreopened
551433a01cab initial coding
carl
parents:
diff changeset
3106 old_dlfiles="$dlfiles"
551433a01cab initial coding
carl
parents:
diff changeset
3107 dlfiles=
551433a01cab initial coding
carl
parents:
diff changeset
3108 for lib in $old_dlfiles; do
551433a01cab initial coding
carl
parents:
diff changeset
3109 case " $dlprefiles $dlfiles " in
551433a01cab initial coding
carl
parents:
diff changeset
3110 *" $lib "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3111 *) dlfiles="$dlfiles $lib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3112 esac
551433a01cab initial coding
carl
parents:
diff changeset
3113 done
551433a01cab initial coding
carl
parents:
diff changeset
3114
551433a01cab initial coding
carl
parents:
diff changeset
3115 # Make sure dlprefiles contains only unique files
551433a01cab initial coding
carl
parents:
diff changeset
3116 old_dlprefiles="$dlprefiles"
551433a01cab initial coding
carl
parents:
diff changeset
3117 dlprefiles=
551433a01cab initial coding
carl
parents:
diff changeset
3118 for lib in $old_dlprefiles; do
551433a01cab initial coding
carl
parents:
diff changeset
3119 case "$dlprefiles " in
551433a01cab initial coding
carl
parents:
diff changeset
3120 *" $lib "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3121 *) dlprefiles="$dlprefiles $lib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3122 esac
551433a01cab initial coding
carl
parents:
diff changeset
3123 done
551433a01cab initial coding
carl
parents:
diff changeset
3124
551433a01cab initial coding
carl
parents:
diff changeset
3125 if test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3126 if test -n "$rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3127 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
3128 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
551433a01cab initial coding
carl
parents:
diff changeset
3129 # these systems don't actually have a c library (as such)!
551433a01cab initial coding
carl
parents:
diff changeset
3130 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3131 *-*-rhapsody* | *-*-darwin1.[012])
551433a01cab initial coding
carl
parents:
diff changeset
3132 # Rhapsody C library is in the System framework
551433a01cab initial coding
carl
parents:
diff changeset
3133 deplibs="$deplibs -framework System"
551433a01cab initial coding
carl
parents:
diff changeset
3134 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3135 *-*-netbsd*)
551433a01cab initial coding
carl
parents:
diff changeset
3136 # Don't link with libc until the a.out ld.so is fixed.
551433a01cab initial coding
carl
parents:
diff changeset
3137 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3138 *-*-freebsd*-gnu*)
551433a01cab initial coding
carl
parents:
diff changeset
3139 # Prevent $arg from being parsed by the freebsd regexp below.
551433a01cab initial coding
carl
parents:
diff changeset
3140 if test "$build_libtool_need_lc" = "yes"; then
551433a01cab initial coding
carl
parents:
diff changeset
3141 deplibs="$deplibs -lc"
551433a01cab initial coding
carl
parents:
diff changeset
3142 fi
551433a01cab initial coding
carl
parents:
diff changeset
3143 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3144 *-*-openbsd* | *-*-freebsd*)
551433a01cab initial coding
carl
parents:
diff changeset
3145 # Do not include libc due to us having libc/libc_r.
551433a01cab initial coding
carl
parents:
diff changeset
3146 test "X$arg" = "X-lc" && continue
551433a01cab initial coding
carl
parents:
diff changeset
3147 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3148 *)
551433a01cab initial coding
carl
parents:
diff changeset
3149 # Add libc to deplibs on all other systems if necessary.
551433a01cab initial coding
carl
parents:
diff changeset
3150 if test "$build_libtool_need_lc" = "yes"; then
551433a01cab initial coding
carl
parents:
diff changeset
3151 deplibs="$deplibs -lc"
551433a01cab initial coding
carl
parents:
diff changeset
3152 fi
551433a01cab initial coding
carl
parents:
diff changeset
3153 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3154 esac
551433a01cab initial coding
carl
parents:
diff changeset
3155 fi
551433a01cab initial coding
carl
parents:
diff changeset
3156
551433a01cab initial coding
carl
parents:
diff changeset
3157 # Transform deplibs into only deplibs that can be linked in shared.
551433a01cab initial coding
carl
parents:
diff changeset
3158 name_save=$name
551433a01cab initial coding
carl
parents:
diff changeset
3159 libname_save=$libname
551433a01cab initial coding
carl
parents:
diff changeset
3160 release_save=$release
551433a01cab initial coding
carl
parents:
diff changeset
3161 versuffix_save=$versuffix
551433a01cab initial coding
carl
parents:
diff changeset
3162 major_save=$major
551433a01cab initial coding
carl
parents:
diff changeset
3163 # I'm not sure if I'm treating the release correctly. I think
551433a01cab initial coding
carl
parents:
diff changeset
3164 # release should show up in the -l (ie -lgmp5) so we don't want to
551433a01cab initial coding
carl
parents:
diff changeset
3165 # add it in twice. Is that correct?
551433a01cab initial coding
carl
parents:
diff changeset
3166 release=""
551433a01cab initial coding
carl
parents:
diff changeset
3167 versuffix=""
551433a01cab initial coding
carl
parents:
diff changeset
3168 major=""
551433a01cab initial coding
carl
parents:
diff changeset
3169 newdeplibs=
551433a01cab initial coding
carl
parents:
diff changeset
3170 droppeddeps=no
551433a01cab initial coding
carl
parents:
diff changeset
3171 case $deplibs_check_method in
551433a01cab initial coding
carl
parents:
diff changeset
3172 pass_all)
551433a01cab initial coding
carl
parents:
diff changeset
3173 # Don't check for shared/static. Everything works.
551433a01cab initial coding
carl
parents:
diff changeset
3174 # This might be a little naive. We might want to check
551433a01cab initial coding
carl
parents:
diff changeset
3175 # whether the library exists or not. But this is on
551433a01cab initial coding
carl
parents:
diff changeset
3176 # osf3 & osf4 and I'm not really sure... Just
551433a01cab initial coding
carl
parents:
diff changeset
3177 # implementing what was already the behavior.
551433a01cab initial coding
carl
parents:
diff changeset
3178 newdeplibs=$deplibs
551433a01cab initial coding
carl
parents:
diff changeset
3179 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3180 test_compile)
551433a01cab initial coding
carl
parents:
diff changeset
3181 # This code stresses the "libraries are programs" paradigm to its
551433a01cab initial coding
carl
parents:
diff changeset
3182 # limits. Maybe even breaks it. We compile a program, linking it
551433a01cab initial coding
carl
parents:
diff changeset
3183 # against the deplibs as a proxy for the library. Then we can check
551433a01cab initial coding
carl
parents:
diff changeset
3184 # whether they linked in statically or dynamically with ldd.
551433a01cab initial coding
carl
parents:
diff changeset
3185 $rm conftest.c
551433a01cab initial coding
carl
parents:
diff changeset
3186 cat > conftest.c <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
3187 int main() { return 0; }
551433a01cab initial coding
carl
parents:
diff changeset
3188 EOF
551433a01cab initial coding
carl
parents:
diff changeset
3189 $rm conftest
551433a01cab initial coding
carl
parents:
diff changeset
3190 $LTCC -o conftest conftest.c $deplibs
551433a01cab initial coding
carl
parents:
diff changeset
3191 if test "$?" -eq 0 ; then
551433a01cab initial coding
carl
parents:
diff changeset
3192 ldd_output=`ldd conftest`
551433a01cab initial coding
carl
parents:
diff changeset
3193 for i in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
3194 name="`expr $i : '-l\(.*\)'`"
551433a01cab initial coding
carl
parents:
diff changeset
3195 # If $name is empty we are operating on a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3196 if test "$name" != "" && test "$name" -ne "0"; then
551433a01cab initial coding
carl
parents:
diff changeset
3197 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3198 case " $predeps $postdeps " in
551433a01cab initial coding
carl
parents:
diff changeset
3199 *" $i "*)
551433a01cab initial coding
carl
parents:
diff changeset
3200 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3201 i=""
551433a01cab initial coding
carl
parents:
diff changeset
3202 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3203 esac
551433a01cab initial coding
carl
parents:
diff changeset
3204 fi
551433a01cab initial coding
carl
parents:
diff changeset
3205 if test -n "$i" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3206 libname=`eval \\$echo \"$libname_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3207 deplib_matches=`eval \\$echo \"$library_names_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3208 set dummy $deplib_matches
551433a01cab initial coding
carl
parents:
diff changeset
3209 deplib_match=$2
551433a01cab initial coding
carl
parents:
diff changeset
3210 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
551433a01cab initial coding
carl
parents:
diff changeset
3211 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3212 else
551433a01cab initial coding
carl
parents:
diff changeset
3213 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3214 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3215 $echo "*** Warning: dynamic linker does not accept needed library $i."
551433a01cab initial coding
carl
parents:
diff changeset
3216 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
3217 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
3218 $echo "*** shared version of the library, which I believe you do not have"
551433a01cab initial coding
carl
parents:
diff changeset
3219 $echo "*** because a test_compile did reveal that the linker did not use it for"
551433a01cab initial coding
carl
parents:
diff changeset
3220 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
551433a01cab initial coding
carl
parents:
diff changeset
3221 fi
551433a01cab initial coding
carl
parents:
diff changeset
3222 fi
551433a01cab initial coding
carl
parents:
diff changeset
3223 else
551433a01cab initial coding
carl
parents:
diff changeset
3224 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3225 fi
551433a01cab initial coding
carl
parents:
diff changeset
3226 done
551433a01cab initial coding
carl
parents:
diff changeset
3227 else
551433a01cab initial coding
carl
parents:
diff changeset
3228 # Error occurred in the first compile. Let's try to salvage
551433a01cab initial coding
carl
parents:
diff changeset
3229 # the situation: Compile a separate program for each library.
551433a01cab initial coding
carl
parents:
diff changeset
3230 for i in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
3231 name="`expr $i : '-l\(.*\)'`"
551433a01cab initial coding
carl
parents:
diff changeset
3232 # If $name is empty we are operating on a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3233 if test "$name" != "" && test "$name" != "0"; then
551433a01cab initial coding
carl
parents:
diff changeset
3234 $rm conftest
551433a01cab initial coding
carl
parents:
diff changeset
3235 $LTCC -o conftest conftest.c $i
551433a01cab initial coding
carl
parents:
diff changeset
3236 # Did it work?
551433a01cab initial coding
carl
parents:
diff changeset
3237 if test "$?" -eq 0 ; then
551433a01cab initial coding
carl
parents:
diff changeset
3238 ldd_output=`ldd conftest`
551433a01cab initial coding
carl
parents:
diff changeset
3239 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3240 case " $predeps $postdeps " in
551433a01cab initial coding
carl
parents:
diff changeset
3241 *" $i "*)
551433a01cab initial coding
carl
parents:
diff changeset
3242 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3243 i=""
551433a01cab initial coding
carl
parents:
diff changeset
3244 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3245 esac
551433a01cab initial coding
carl
parents:
diff changeset
3246 fi
551433a01cab initial coding
carl
parents:
diff changeset
3247 if test -n "$i" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3248 libname=`eval \\$echo \"$libname_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3249 deplib_matches=`eval \\$echo \"$library_names_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3250 set dummy $deplib_matches
551433a01cab initial coding
carl
parents:
diff changeset
3251 deplib_match=$2
551433a01cab initial coding
carl
parents:
diff changeset
3252 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
551433a01cab initial coding
carl
parents:
diff changeset
3253 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3254 else
551433a01cab initial coding
carl
parents:
diff changeset
3255 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3256 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3257 $echo "*** Warning: dynamic linker does not accept needed library $i."
551433a01cab initial coding
carl
parents:
diff changeset
3258 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
3259 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
3260 $echo "*** shared version of the library, which you do not appear to have"
551433a01cab initial coding
carl
parents:
diff changeset
3261 $echo "*** because a test_compile did reveal that the linker did not use this one"
551433a01cab initial coding
carl
parents:
diff changeset
3262 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
551433a01cab initial coding
carl
parents:
diff changeset
3263 fi
551433a01cab initial coding
carl
parents:
diff changeset
3264 fi
551433a01cab initial coding
carl
parents:
diff changeset
3265 else
551433a01cab initial coding
carl
parents:
diff changeset
3266 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3267 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3268 $echo "*** Warning! Library $i is needed by this library but I was not able to"
551433a01cab initial coding
carl
parents:
diff changeset
3269 $echo "*** make it link in! You will probably need to install it or some"
551433a01cab initial coding
carl
parents:
diff changeset
3270 $echo "*** library that it depends on before this library will be fully"
551433a01cab initial coding
carl
parents:
diff changeset
3271 $echo "*** functional. Installing it before continuing would be even better."
551433a01cab initial coding
carl
parents:
diff changeset
3272 fi
551433a01cab initial coding
carl
parents:
diff changeset
3273 else
551433a01cab initial coding
carl
parents:
diff changeset
3274 newdeplibs="$newdeplibs $i"
551433a01cab initial coding
carl
parents:
diff changeset
3275 fi
551433a01cab initial coding
carl
parents:
diff changeset
3276 done
551433a01cab initial coding
carl
parents:
diff changeset
3277 fi
551433a01cab initial coding
carl
parents:
diff changeset
3278 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3279 file_magic*)
551433a01cab initial coding
carl
parents:
diff changeset
3280 set dummy $deplibs_check_method
551433a01cab initial coding
carl
parents:
diff changeset
3281 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
551433a01cab initial coding
carl
parents:
diff changeset
3282 for a_deplib in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
3283 name="`expr $a_deplib : '-l\(.*\)'`"
551433a01cab initial coding
carl
parents:
diff changeset
3284 # If $name is empty we are operating on a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3285 if test "$name" != "" && test "$name" != "0"; then
551433a01cab initial coding
carl
parents:
diff changeset
3286 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3287 case " $predeps $postdeps " in
551433a01cab initial coding
carl
parents:
diff changeset
3288 *" $a_deplib "*)
551433a01cab initial coding
carl
parents:
diff changeset
3289 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3290 a_deplib=""
551433a01cab initial coding
carl
parents:
diff changeset
3291 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3292 esac
551433a01cab initial coding
carl
parents:
diff changeset
3293 fi
551433a01cab initial coding
carl
parents:
diff changeset
3294 if test -n "$a_deplib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3295 libname=`eval \\$echo \"$libname_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3296 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
551433a01cab initial coding
carl
parents:
diff changeset
3297 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
3298 for potent_lib in $potential_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
3299 # Follow soft links.
551433a01cab initial coding
carl
parents:
diff changeset
3300 if ls -lLd "$potent_lib" 2>/dev/null \
551433a01cab initial coding
carl
parents:
diff changeset
3301 | grep " -> " >/dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
3302 continue
551433a01cab initial coding
carl
parents:
diff changeset
3303 fi
551433a01cab initial coding
carl
parents:
diff changeset
3304 # The statement above tries to avoid entering an
551433a01cab initial coding
carl
parents:
diff changeset
3305 # endless loop below, in case of cyclic links.
551433a01cab initial coding
carl
parents:
diff changeset
3306 # We might still enter an endless loop, since a link
551433a01cab initial coding
carl
parents:
diff changeset
3307 # loop can be closed while we follow links,
551433a01cab initial coding
carl
parents:
diff changeset
3308 # but so what?
551433a01cab initial coding
carl
parents:
diff changeset
3309 potlib="$potent_lib"
551433a01cab initial coding
carl
parents:
diff changeset
3310 while test -h "$potlib" 2>/dev/null; do
551433a01cab initial coding
carl
parents:
diff changeset
3311 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
551433a01cab initial coding
carl
parents:
diff changeset
3312 case $potliblink in
551433a01cab initial coding
carl
parents:
diff changeset
3313 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
551433a01cab initial coding
carl
parents:
diff changeset
3314 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
551433a01cab initial coding
carl
parents:
diff changeset
3315 esac
551433a01cab initial coding
carl
parents:
diff changeset
3316 done
551433a01cab initial coding
carl
parents:
diff changeset
3317 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
551433a01cab initial coding
carl
parents:
diff changeset
3318 | ${SED} 10q \
551433a01cab initial coding
carl
parents:
diff changeset
3319 | $EGREP "$file_magic_regex" > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
3320 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3321 a_deplib=""
551433a01cab initial coding
carl
parents:
diff changeset
3322 break 2
551433a01cab initial coding
carl
parents:
diff changeset
3323 fi
551433a01cab initial coding
carl
parents:
diff changeset
3324 done
551433a01cab initial coding
carl
parents:
diff changeset
3325 done
551433a01cab initial coding
carl
parents:
diff changeset
3326 fi
551433a01cab initial coding
carl
parents:
diff changeset
3327 if test -n "$a_deplib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3328 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3329 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3330 $echo "*** Warning: linker path does not have real file for library $a_deplib."
551433a01cab initial coding
carl
parents:
diff changeset
3331 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
3332 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
3333 $echo "*** shared version of the library, which you do not appear to have"
551433a01cab initial coding
carl
parents:
diff changeset
3334 $echo "*** because I did check the linker path looking for a file starting"
551433a01cab initial coding
carl
parents:
diff changeset
3335 if test -z "$potlib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3336 $echo "*** with $libname but no candidates were found. (...for file magic test)"
551433a01cab initial coding
carl
parents:
diff changeset
3337 else
551433a01cab initial coding
carl
parents:
diff changeset
3338 $echo "*** with $libname and none of the candidates passed a file format test"
551433a01cab initial coding
carl
parents:
diff changeset
3339 $echo "*** using a file magic. Last file checked: $potlib"
551433a01cab initial coding
carl
parents:
diff changeset
3340 fi
551433a01cab initial coding
carl
parents:
diff changeset
3341 fi
551433a01cab initial coding
carl
parents:
diff changeset
3342 else
551433a01cab initial coding
carl
parents:
diff changeset
3343 # Add a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3344 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3345 fi
551433a01cab initial coding
carl
parents:
diff changeset
3346 done # Gone through all deplibs.
551433a01cab initial coding
carl
parents:
diff changeset
3347 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3348 match_pattern*)
551433a01cab initial coding
carl
parents:
diff changeset
3349 set dummy $deplibs_check_method
551433a01cab initial coding
carl
parents:
diff changeset
3350 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
551433a01cab initial coding
carl
parents:
diff changeset
3351 for a_deplib in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
3352 name="`expr $a_deplib : '-l\(.*\)'`"
551433a01cab initial coding
carl
parents:
diff changeset
3353 # If $name is empty we are operating on a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3354 if test -n "$name" && test "$name" != "0"; then
551433a01cab initial coding
carl
parents:
diff changeset
3355 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3356 case " $predeps $postdeps " in
551433a01cab initial coding
carl
parents:
diff changeset
3357 *" $a_deplib "*)
551433a01cab initial coding
carl
parents:
diff changeset
3358 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3359 a_deplib=""
551433a01cab initial coding
carl
parents:
diff changeset
3360 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3361 esac
551433a01cab initial coding
carl
parents:
diff changeset
3362 fi
551433a01cab initial coding
carl
parents:
diff changeset
3363 if test -n "$a_deplib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3364 libname=`eval \\$echo \"$libname_spec\"`
551433a01cab initial coding
carl
parents:
diff changeset
3365 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
551433a01cab initial coding
carl
parents:
diff changeset
3366 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
551433a01cab initial coding
carl
parents:
diff changeset
3367 for potent_lib in $potential_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
3368 potlib="$potent_lib" # see symlink-check above in file_magic test
551433a01cab initial coding
carl
parents:
diff changeset
3369 if eval $echo \"$potent_lib\" 2>/dev/null \
551433a01cab initial coding
carl
parents:
diff changeset
3370 | ${SED} 10q \
551433a01cab initial coding
carl
parents:
diff changeset
3371 | $EGREP "$match_pattern_regex" > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
3372 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3373 a_deplib=""
551433a01cab initial coding
carl
parents:
diff changeset
3374 break 2
551433a01cab initial coding
carl
parents:
diff changeset
3375 fi
551433a01cab initial coding
carl
parents:
diff changeset
3376 done
551433a01cab initial coding
carl
parents:
diff changeset
3377 done
551433a01cab initial coding
carl
parents:
diff changeset
3378 fi
551433a01cab initial coding
carl
parents:
diff changeset
3379 if test -n "$a_deplib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3380 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3381 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3382 $echo "*** Warning: linker path does not have real file for library $a_deplib."
551433a01cab initial coding
carl
parents:
diff changeset
3383 $echo "*** I have the capability to make that library automatically link in when"
551433a01cab initial coding
carl
parents:
diff changeset
3384 $echo "*** you link to this library. But I can only do this if you have a"
551433a01cab initial coding
carl
parents:
diff changeset
3385 $echo "*** shared version of the library, which you do not appear to have"
551433a01cab initial coding
carl
parents:
diff changeset
3386 $echo "*** because I did check the linker path looking for a file starting"
551433a01cab initial coding
carl
parents:
diff changeset
3387 if test -z "$potlib" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3388 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
551433a01cab initial coding
carl
parents:
diff changeset
3389 else
551433a01cab initial coding
carl
parents:
diff changeset
3390 $echo "*** with $libname and none of the candidates passed a file format test"
551433a01cab initial coding
carl
parents:
diff changeset
3391 $echo "*** using a regex pattern. Last file checked: $potlib"
551433a01cab initial coding
carl
parents:
diff changeset
3392 fi
551433a01cab initial coding
carl
parents:
diff changeset
3393 fi
551433a01cab initial coding
carl
parents:
diff changeset
3394 else
551433a01cab initial coding
carl
parents:
diff changeset
3395 # Add a -L argument.
551433a01cab initial coding
carl
parents:
diff changeset
3396 newdeplibs="$newdeplibs $a_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3397 fi
551433a01cab initial coding
carl
parents:
diff changeset
3398 done # Gone through all deplibs.
551433a01cab initial coding
carl
parents:
diff changeset
3399 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3400 none | unknown | *)
551433a01cab initial coding
carl
parents:
diff changeset
3401 newdeplibs=""
551433a01cab initial coding
carl
parents:
diff changeset
3402 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
551433a01cab initial coding
carl
parents:
diff changeset
3403 -e 's/ -[LR][^ ]*//g'`
551433a01cab initial coding
carl
parents:
diff changeset
3404 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3405 for i in $predeps $postdeps ; do
551433a01cab initial coding
carl
parents:
diff changeset
3406 # can't use Xsed below, because $i might contain '/'
551433a01cab initial coding
carl
parents:
diff changeset
3407 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
551433a01cab initial coding
carl
parents:
diff changeset
3408 done
551433a01cab initial coding
carl
parents:
diff changeset
3409 fi
551433a01cab initial coding
carl
parents:
diff changeset
3410 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
551433a01cab initial coding
carl
parents:
diff changeset
3411 | grep . >/dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
3412 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3413 if test "X$deplibs_check_method" = "Xnone"; then
551433a01cab initial coding
carl
parents:
diff changeset
3414 $echo "*** Warning: inter-library dependencies are not supported in this platform."
551433a01cab initial coding
carl
parents:
diff changeset
3415 else
551433a01cab initial coding
carl
parents:
diff changeset
3416 $echo "*** Warning: inter-library dependencies are not known to be supported."
551433a01cab initial coding
carl
parents:
diff changeset
3417 fi
551433a01cab initial coding
carl
parents:
diff changeset
3418 $echo "*** All declared inter-library dependencies are being dropped."
551433a01cab initial coding
carl
parents:
diff changeset
3419 droppeddeps=yes
551433a01cab initial coding
carl
parents:
diff changeset
3420 fi
551433a01cab initial coding
carl
parents:
diff changeset
3421 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3422 esac
551433a01cab initial coding
carl
parents:
diff changeset
3423 versuffix=$versuffix_save
551433a01cab initial coding
carl
parents:
diff changeset
3424 major=$major_save
551433a01cab initial coding
carl
parents:
diff changeset
3425 release=$release_save
551433a01cab initial coding
carl
parents:
diff changeset
3426 libname=$libname_save
551433a01cab initial coding
carl
parents:
diff changeset
3427 name=$name_save
551433a01cab initial coding
carl
parents:
diff changeset
3428
551433a01cab initial coding
carl
parents:
diff changeset
3429 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
3430 *-*-rhapsody* | *-*-darwin1.[012])
551433a01cab initial coding
carl
parents:
diff changeset
3431 # On Rhapsody replace the C library is the System framework
551433a01cab initial coding
carl
parents:
diff changeset
3432 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
551433a01cab initial coding
carl
parents:
diff changeset
3433 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3434 esac
551433a01cab initial coding
carl
parents:
diff changeset
3435
551433a01cab initial coding
carl
parents:
diff changeset
3436 if test "$droppeddeps" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3437 if test "$module" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3438 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3439 $echo "*** Warning: libtool could not satisfy all declared inter-library"
551433a01cab initial coding
carl
parents:
diff changeset
3440 $echo "*** dependencies of module $libname. Therefore, libtool will create"
551433a01cab initial coding
carl
parents:
diff changeset
3441 $echo "*** a static module, that should work as long as the dlopening"
551433a01cab initial coding
carl
parents:
diff changeset
3442 $echo "*** application is linked with the -dlopen flag."
551433a01cab initial coding
carl
parents:
diff changeset
3443 if test -z "$global_symbol_pipe"; then
551433a01cab initial coding
carl
parents:
diff changeset
3444 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3445 $echo "*** However, this would only work if libtool was able to extract symbol"
551433a01cab initial coding
carl
parents:
diff changeset
3446 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
551433a01cab initial coding
carl
parents:
diff changeset
3447 $echo "*** not find such a program. So, this module is probably useless."
551433a01cab initial coding
carl
parents:
diff changeset
3448 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
551433a01cab initial coding
carl
parents:
diff changeset
3449 fi
551433a01cab initial coding
carl
parents:
diff changeset
3450 if test "$build_old_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
3451 oldlibs="$output_objdir/$libname.$libext"
551433a01cab initial coding
carl
parents:
diff changeset
3452 build_libtool_libs=module
551433a01cab initial coding
carl
parents:
diff changeset
3453 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
3454 else
551433a01cab initial coding
carl
parents:
diff changeset
3455 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
3456 fi
551433a01cab initial coding
carl
parents:
diff changeset
3457 else
551433a01cab initial coding
carl
parents:
diff changeset
3458 $echo "*** The inter-library dependencies that have been dropped here will be"
551433a01cab initial coding
carl
parents:
diff changeset
3459 $echo "*** automatically added whenever a program is linked with this library"
551433a01cab initial coding
carl
parents:
diff changeset
3460 $echo "*** or is declared to -dlopen it."
551433a01cab initial coding
carl
parents:
diff changeset
3461
551433a01cab initial coding
carl
parents:
diff changeset
3462 if test "$allow_undefined" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
3463 $echo
551433a01cab initial coding
carl
parents:
diff changeset
3464 $echo "*** Since this library must not contain undefined symbols,"
551433a01cab initial coding
carl
parents:
diff changeset
3465 $echo "*** because either the platform does not support them or"
551433a01cab initial coding
carl
parents:
diff changeset
3466 $echo "*** it was explicitly requested with -no-undefined,"
551433a01cab initial coding
carl
parents:
diff changeset
3467 $echo "*** libtool will only create a static version of it."
551433a01cab initial coding
carl
parents:
diff changeset
3468 if test "$build_old_libs" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
3469 oldlibs="$output_objdir/$libname.$libext"
551433a01cab initial coding
carl
parents:
diff changeset
3470 build_libtool_libs=module
551433a01cab initial coding
carl
parents:
diff changeset
3471 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
3472 else
551433a01cab initial coding
carl
parents:
diff changeset
3473 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
3474 fi
551433a01cab initial coding
carl
parents:
diff changeset
3475 fi
551433a01cab initial coding
carl
parents:
diff changeset
3476 fi
551433a01cab initial coding
carl
parents:
diff changeset
3477 fi
551433a01cab initial coding
carl
parents:
diff changeset
3478 # Done checking deplibs!
551433a01cab initial coding
carl
parents:
diff changeset
3479 deplibs=$newdeplibs
551433a01cab initial coding
carl
parents:
diff changeset
3480 fi
551433a01cab initial coding
carl
parents:
diff changeset
3481
551433a01cab initial coding
carl
parents:
diff changeset
3482 # All the library-specific variables (install_libdir is set above).
551433a01cab initial coding
carl
parents:
diff changeset
3483 library_names=
551433a01cab initial coding
carl
parents:
diff changeset
3484 old_library=
551433a01cab initial coding
carl
parents:
diff changeset
3485 dlname=
551433a01cab initial coding
carl
parents:
diff changeset
3486
551433a01cab initial coding
carl
parents:
diff changeset
3487 # Test again, we may have decided not to build it any more
551433a01cab initial coding
carl
parents:
diff changeset
3488 if test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3489 if test "$hardcode_into_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3490 # Hardcode the library paths
551433a01cab initial coding
carl
parents:
diff changeset
3491 hardcode_libdirs=
551433a01cab initial coding
carl
parents:
diff changeset
3492 dep_rpath=
551433a01cab initial coding
carl
parents:
diff changeset
3493 rpath="$finalize_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
3494 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
551433a01cab initial coding
carl
parents:
diff changeset
3495 for libdir in $rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
3496 if test -n "$hardcode_libdir_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3497 if test -n "$hardcode_libdir_separator"; then
551433a01cab initial coding
carl
parents:
diff changeset
3498 if test -z "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
3499 hardcode_libdirs="$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
3500 else
551433a01cab initial coding
carl
parents:
diff changeset
3501 # Just accumulate the unique libdirs.
551433a01cab initial coding
carl
parents:
diff changeset
3502 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
551433a01cab initial coding
carl
parents:
diff changeset
3503 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
551433a01cab initial coding
carl
parents:
diff changeset
3504 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3505 *)
551433a01cab initial coding
carl
parents:
diff changeset
3506 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
3507 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3508 esac
551433a01cab initial coding
carl
parents:
diff changeset
3509 fi
551433a01cab initial coding
carl
parents:
diff changeset
3510 else
551433a01cab initial coding
carl
parents:
diff changeset
3511 eval flag=\"$hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3512 dep_rpath="$dep_rpath $flag"
551433a01cab initial coding
carl
parents:
diff changeset
3513 fi
551433a01cab initial coding
carl
parents:
diff changeset
3514 elif test -n "$runpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
3515 case "$perm_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
3516 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3517 *) perm_rpath="$perm_rpath $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3518 esac
551433a01cab initial coding
carl
parents:
diff changeset
3519 fi
551433a01cab initial coding
carl
parents:
diff changeset
3520 done
551433a01cab initial coding
carl
parents:
diff changeset
3521 # Substitute the hardcoded libdirs into the rpath.
551433a01cab initial coding
carl
parents:
diff changeset
3522 if test -n "$hardcode_libdir_separator" &&
551433a01cab initial coding
carl
parents:
diff changeset
3523 test -n "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
3524 libdir="$hardcode_libdirs"
551433a01cab initial coding
carl
parents:
diff changeset
3525 if test -n "$hardcode_libdir_flag_spec_ld"; then
551433a01cab initial coding
carl
parents:
diff changeset
3526 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
551433a01cab initial coding
carl
parents:
diff changeset
3527 else
551433a01cab initial coding
carl
parents:
diff changeset
3528 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3529 fi
551433a01cab initial coding
carl
parents:
diff changeset
3530 fi
551433a01cab initial coding
carl
parents:
diff changeset
3531 if test -n "$runpath_var" && test -n "$perm_rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3532 # We should set the runpath_var.
551433a01cab initial coding
carl
parents:
diff changeset
3533 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
3534 for dir in $perm_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
3535 rpath="$rpath$dir:"
551433a01cab initial coding
carl
parents:
diff changeset
3536 done
551433a01cab initial coding
carl
parents:
diff changeset
3537 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
551433a01cab initial coding
carl
parents:
diff changeset
3538 fi
551433a01cab initial coding
carl
parents:
diff changeset
3539 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
3540 fi
551433a01cab initial coding
carl
parents:
diff changeset
3541
551433a01cab initial coding
carl
parents:
diff changeset
3542 shlibpath="$finalize_shlibpath"
551433a01cab initial coding
carl
parents:
diff changeset
3543 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
551433a01cab initial coding
carl
parents:
diff changeset
3544 if test -n "$shlibpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3545 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
551433a01cab initial coding
carl
parents:
diff changeset
3546 fi
551433a01cab initial coding
carl
parents:
diff changeset
3547
551433a01cab initial coding
carl
parents:
diff changeset
3548 # Get the real and link names of the library.
551433a01cab initial coding
carl
parents:
diff changeset
3549 eval shared_ext=\"$shrext\"
551433a01cab initial coding
carl
parents:
diff changeset
3550 eval library_names=\"$library_names_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3551 set dummy $library_names
551433a01cab initial coding
carl
parents:
diff changeset
3552 realname="$2"
551433a01cab initial coding
carl
parents:
diff changeset
3553 shift; shift
551433a01cab initial coding
carl
parents:
diff changeset
3554
551433a01cab initial coding
carl
parents:
diff changeset
3555 if test -n "$soname_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3556 eval soname=\"$soname_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3557 else
551433a01cab initial coding
carl
parents:
diff changeset
3558 soname="$realname"
551433a01cab initial coding
carl
parents:
diff changeset
3559 fi
551433a01cab initial coding
carl
parents:
diff changeset
3560 if test -z "$dlname"; then
551433a01cab initial coding
carl
parents:
diff changeset
3561 dlname=$soname
551433a01cab initial coding
carl
parents:
diff changeset
3562 fi
551433a01cab initial coding
carl
parents:
diff changeset
3563
551433a01cab initial coding
carl
parents:
diff changeset
3564 lib="$output_objdir/$realname"
551433a01cab initial coding
carl
parents:
diff changeset
3565 for link
551433a01cab initial coding
carl
parents:
diff changeset
3566 do
551433a01cab initial coding
carl
parents:
diff changeset
3567 linknames="$linknames $link"
551433a01cab initial coding
carl
parents:
diff changeset
3568 done
551433a01cab initial coding
carl
parents:
diff changeset
3569
551433a01cab initial coding
carl
parents:
diff changeset
3570 # Use standard objects if they are pic
551433a01cab initial coding
carl
parents:
diff changeset
3571 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
3572
551433a01cab initial coding
carl
parents:
diff changeset
3573 # Prepare the list of exported symbols
551433a01cab initial coding
carl
parents:
diff changeset
3574 if test -z "$export_symbols"; then
551433a01cab initial coding
carl
parents:
diff changeset
3575 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
551433a01cab initial coding
carl
parents:
diff changeset
3576 $show "generating symbol list for \`$libname.la'"
551433a01cab initial coding
carl
parents:
diff changeset
3577 export_symbols="$output_objdir/$libname.exp"
551433a01cab initial coding
carl
parents:
diff changeset
3578 $run $rm $export_symbols
551433a01cab initial coding
carl
parents:
diff changeset
3579 eval cmds=\"$export_symbols_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3580 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
3581 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
3582 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3583 if len=`expr "X$cmd" : ".*"` &&
551433a01cab initial coding
carl
parents:
diff changeset
3584 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
551433a01cab initial coding
carl
parents:
diff changeset
3585 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
3586 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3587 skipped_export=false
551433a01cab initial coding
carl
parents:
diff changeset
3588 else
551433a01cab initial coding
carl
parents:
diff changeset
3589 # The command line is too long to execute in one step.
551433a01cab initial coding
carl
parents:
diff changeset
3590 $show "using reloadable object file for export list..."
551433a01cab initial coding
carl
parents:
diff changeset
3591 skipped_export=:
551433a01cab initial coding
carl
parents:
diff changeset
3592 fi
551433a01cab initial coding
carl
parents:
diff changeset
3593 done
551433a01cab initial coding
carl
parents:
diff changeset
3594 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3595 if test -n "$export_symbols_regex"; then
551433a01cab initial coding
carl
parents:
diff changeset
3596 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
551433a01cab initial coding
carl
parents:
diff changeset
3597 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
551433a01cab initial coding
carl
parents:
diff changeset
3598 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
551433a01cab initial coding
carl
parents:
diff changeset
3599 $run eval '$mv "${export_symbols}T" "$export_symbols"'
551433a01cab initial coding
carl
parents:
diff changeset
3600 fi
551433a01cab initial coding
carl
parents:
diff changeset
3601 fi
551433a01cab initial coding
carl
parents:
diff changeset
3602 fi
551433a01cab initial coding
carl
parents:
diff changeset
3603
551433a01cab initial coding
carl
parents:
diff changeset
3604 if test -n "$export_symbols" && test -n "$include_expsyms"; then
551433a01cab initial coding
carl
parents:
diff changeset
3605 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
551433a01cab initial coding
carl
parents:
diff changeset
3606 fi
551433a01cab initial coding
carl
parents:
diff changeset
3607
551433a01cab initial coding
carl
parents:
diff changeset
3608 tmp_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
3609 for test_deplib in $deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
3610 case " $convenience " in
551433a01cab initial coding
carl
parents:
diff changeset
3611 *" $test_deplib "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
3612 *)
551433a01cab initial coding
carl
parents:
diff changeset
3613 tmp_deplibs="$tmp_deplibs $test_deplib"
551433a01cab initial coding
carl
parents:
diff changeset
3614 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3615 esac
551433a01cab initial coding
carl
parents:
diff changeset
3616 done
551433a01cab initial coding
carl
parents:
diff changeset
3617 deplibs="$tmp_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
3618
551433a01cab initial coding
carl
parents:
diff changeset
3619 if test -n "$convenience"; then
551433a01cab initial coding
carl
parents:
diff changeset
3620 if test -n "$whole_archive_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3621 save_libobjs=$libobjs
551433a01cab initial coding
carl
parents:
diff changeset
3622 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3623 else
551433a01cab initial coding
carl
parents:
diff changeset
3624 gentop="$output_objdir/${outputname}x"
551433a01cab initial coding
carl
parents:
diff changeset
3625 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3626 $run ${rm}r "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3627 $show "$mkdir $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3628 $run $mkdir "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3629 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
3630 if test "$status" -ne 0 && test ! -d "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
3631 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
3632 fi
551433a01cab initial coding
carl
parents:
diff changeset
3633 generated="$generated $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3634
551433a01cab initial coding
carl
parents:
diff changeset
3635 for xlib in $convenience; do
551433a01cab initial coding
carl
parents:
diff changeset
3636 # Extract the objects.
551433a01cab initial coding
carl
parents:
diff changeset
3637 case $xlib in
551433a01cab initial coding
carl
parents:
diff changeset
3638 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3639 *) xabs=`pwd`"/$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3640 esac
551433a01cab initial coding
carl
parents:
diff changeset
3641 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
3642 xdir="$gentop/$xlib"
551433a01cab initial coding
carl
parents:
diff changeset
3643
551433a01cab initial coding
carl
parents:
diff changeset
3644 $show "${rm}r $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3645 $run ${rm}r "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3646 $show "$mkdir $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3647 $run $mkdir "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3648 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
3649 if test "$status" -ne 0 && test ! -d "$xdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
3650 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
3651 fi
551433a01cab initial coding
carl
parents:
diff changeset
3652 # We will extract separately just the conflicting names and we will no
551433a01cab initial coding
carl
parents:
diff changeset
3653 # longer touch any unique names. It is faster to leave these extract
551433a01cab initial coding
carl
parents:
diff changeset
3654 # automatically by $AR in one run.
551433a01cab initial coding
carl
parents:
diff changeset
3655 $show "(cd $xdir && $AR x $xabs)"
551433a01cab initial coding
carl
parents:
diff changeset
3656 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3657 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
551433a01cab initial coding
carl
parents:
diff changeset
3658 :
551433a01cab initial coding
carl
parents:
diff changeset
3659 else
551433a01cab initial coding
carl
parents:
diff changeset
3660 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3661 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3662 $AR t "$xabs" | sort | uniq -cd | while read -r count name
551433a01cab initial coding
carl
parents:
diff changeset
3663 do
551433a01cab initial coding
carl
parents:
diff changeset
3664 i=1
551433a01cab initial coding
carl
parents:
diff changeset
3665 while test "$i" -le "$count"
551433a01cab initial coding
carl
parents:
diff changeset
3666 do
551433a01cab initial coding
carl
parents:
diff changeset
3667 # Put our $i before any first dot (extension)
551433a01cab initial coding
carl
parents:
diff changeset
3668 # Never overwrite any file
551433a01cab initial coding
carl
parents:
diff changeset
3669 name_to="$name"
551433a01cab initial coding
carl
parents:
diff changeset
3670 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
551433a01cab initial coding
carl
parents:
diff changeset
3671 do
551433a01cab initial coding
carl
parents:
diff changeset
3672 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
551433a01cab initial coding
carl
parents:
diff changeset
3673 done
551433a01cab initial coding
carl
parents:
diff changeset
3674 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
551433a01cab initial coding
carl
parents:
diff changeset
3675 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3676 i=`expr $i + 1`
551433a01cab initial coding
carl
parents:
diff changeset
3677 done
551433a01cab initial coding
carl
parents:
diff changeset
3678 done
551433a01cab initial coding
carl
parents:
diff changeset
3679 fi
551433a01cab initial coding
carl
parents:
diff changeset
3680
551433a01cab initial coding
carl
parents:
diff changeset
3681 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
3682 done
551433a01cab initial coding
carl
parents:
diff changeset
3683 fi
551433a01cab initial coding
carl
parents:
diff changeset
3684 fi
551433a01cab initial coding
carl
parents:
diff changeset
3685
551433a01cab initial coding
carl
parents:
diff changeset
3686 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3687 eval flag=\"$thread_safe_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3688 linker_flags="$linker_flags $flag"
551433a01cab initial coding
carl
parents:
diff changeset
3689 fi
551433a01cab initial coding
carl
parents:
diff changeset
3690
551433a01cab initial coding
carl
parents:
diff changeset
3691 # Make a backup of the uninstalled library when relinking
551433a01cab initial coding
carl
parents:
diff changeset
3692 if test "$mode" = relink; then
551433a01cab initial coding
carl
parents:
diff changeset
3693 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3694 fi
551433a01cab initial coding
carl
parents:
diff changeset
3695
551433a01cab initial coding
carl
parents:
diff changeset
3696 # Add all flags from the command line. We here create a library,
551433a01cab initial coding
carl
parents:
diff changeset
3697 # but those flags were only added to compile_command and
551433a01cab initial coding
carl
parents:
diff changeset
3698 # finalize_command, which are only used when creating executables.
551433a01cab initial coding
carl
parents:
diff changeset
3699 # So do it by hand here.
551433a01cab initial coding
carl
parents:
diff changeset
3700 compiler_flags="$compiler_flags $add_flags"
551433a01cab initial coding
carl
parents:
diff changeset
3701 # Only add it to commands which use CC, instead of LD, i.e.
551433a01cab initial coding
carl
parents:
diff changeset
3702 # only to $compiler_flags
551433a01cab initial coding
carl
parents:
diff changeset
3703 #linker_flags="$linker_flags $add_flags"
551433a01cab initial coding
carl
parents:
diff changeset
3704
551433a01cab initial coding
carl
parents:
diff changeset
3705 # Do each of the archive commands.
551433a01cab initial coding
carl
parents:
diff changeset
3706 if test "$module" = yes && test -n "$module_cmds" ; then
551433a01cab initial coding
carl
parents:
diff changeset
3707 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
3708 eval cmds=\"$module_expsym_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3709 else
551433a01cab initial coding
carl
parents:
diff changeset
3710 eval cmds=\"$module_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3711 fi
551433a01cab initial coding
carl
parents:
diff changeset
3712 else
551433a01cab initial coding
carl
parents:
diff changeset
3713 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
3714 eval cmds=\"$archive_expsym_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3715 else
551433a01cab initial coding
carl
parents:
diff changeset
3716 eval cmds=\"$archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3717 fi
551433a01cab initial coding
carl
parents:
diff changeset
3718 fi
551433a01cab initial coding
carl
parents:
diff changeset
3719
551433a01cab initial coding
carl
parents:
diff changeset
3720 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
551433a01cab initial coding
carl
parents:
diff changeset
3721 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
551433a01cab initial coding
carl
parents:
diff changeset
3722 :
551433a01cab initial coding
carl
parents:
diff changeset
3723 else
551433a01cab initial coding
carl
parents:
diff changeset
3724 # The command line is too long to link in one step, link piecewise.
551433a01cab initial coding
carl
parents:
diff changeset
3725 $echo "creating reloadable object files..."
551433a01cab initial coding
carl
parents:
diff changeset
3726
551433a01cab initial coding
carl
parents:
diff changeset
3727 # Save the value of $output and $libobjs because we want to
551433a01cab initial coding
carl
parents:
diff changeset
3728 # use them later. If we have whole_archive_flag_spec, we
551433a01cab initial coding
carl
parents:
diff changeset
3729 # want to use save_libobjs as it was before
551433a01cab initial coding
carl
parents:
diff changeset
3730 # whole_archive_flag_spec was expanded, because we can't
551433a01cab initial coding
carl
parents:
diff changeset
3731 # assume the linker understands whole_archive_flag_spec.
551433a01cab initial coding
carl
parents:
diff changeset
3732 # This may have to be revisited, in case too many
551433a01cab initial coding
carl
parents:
diff changeset
3733 # convenience libraries get linked in and end up exceeding
551433a01cab initial coding
carl
parents:
diff changeset
3734 # the spec.
551433a01cab initial coding
carl
parents:
diff changeset
3735 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3736 save_libobjs=$libobjs
551433a01cab initial coding
carl
parents:
diff changeset
3737 fi
551433a01cab initial coding
carl
parents:
diff changeset
3738 save_output=$output
551433a01cab initial coding
carl
parents:
diff changeset
3739
551433a01cab initial coding
carl
parents:
diff changeset
3740 # Clear the reloadable object creation command queue and
551433a01cab initial coding
carl
parents:
diff changeset
3741 # initialize k to one.
551433a01cab initial coding
carl
parents:
diff changeset
3742 test_cmds=
551433a01cab initial coding
carl
parents:
diff changeset
3743 concat_cmds=
551433a01cab initial coding
carl
parents:
diff changeset
3744 objlist=
551433a01cab initial coding
carl
parents:
diff changeset
3745 delfiles=
551433a01cab initial coding
carl
parents:
diff changeset
3746 last_robj=
551433a01cab initial coding
carl
parents:
diff changeset
3747 k=1
551433a01cab initial coding
carl
parents:
diff changeset
3748 output=$output_objdir/$save_output-${k}.$objext
551433a01cab initial coding
carl
parents:
diff changeset
3749 # Loop over the list of objects to be linked.
551433a01cab initial coding
carl
parents:
diff changeset
3750 for obj in $save_libobjs
551433a01cab initial coding
carl
parents:
diff changeset
3751 do
551433a01cab initial coding
carl
parents:
diff changeset
3752 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
551433a01cab initial coding
carl
parents:
diff changeset
3753 if test "X$objlist" = X ||
551433a01cab initial coding
carl
parents:
diff changeset
3754 { len=`expr "X$test_cmds" : ".*"` &&
551433a01cab initial coding
carl
parents:
diff changeset
3755 test "$len" -le "$max_cmd_len"; }; then
551433a01cab initial coding
carl
parents:
diff changeset
3756 objlist="$objlist $obj"
551433a01cab initial coding
carl
parents:
diff changeset
3757 else
551433a01cab initial coding
carl
parents:
diff changeset
3758 # The command $test_cmds is almost too long, add a
551433a01cab initial coding
carl
parents:
diff changeset
3759 # command to the queue.
551433a01cab initial coding
carl
parents:
diff changeset
3760 if test "$k" -eq 1 ; then
551433a01cab initial coding
carl
parents:
diff changeset
3761 # The first file doesn't have a previous command to add.
551433a01cab initial coding
carl
parents:
diff changeset
3762 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
551433a01cab initial coding
carl
parents:
diff changeset
3763 else
551433a01cab initial coding
carl
parents:
diff changeset
3764 # All subsequent reloadable object files will link in
551433a01cab initial coding
carl
parents:
diff changeset
3765 # the last one created.
551433a01cab initial coding
carl
parents:
diff changeset
3766 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
551433a01cab initial coding
carl
parents:
diff changeset
3767 fi
551433a01cab initial coding
carl
parents:
diff changeset
3768 last_robj=$output_objdir/$save_output-${k}.$objext
551433a01cab initial coding
carl
parents:
diff changeset
3769 k=`expr $k + 1`
551433a01cab initial coding
carl
parents:
diff changeset
3770 output=$output_objdir/$save_output-${k}.$objext
551433a01cab initial coding
carl
parents:
diff changeset
3771 objlist=$obj
551433a01cab initial coding
carl
parents:
diff changeset
3772 len=1
551433a01cab initial coding
carl
parents:
diff changeset
3773 fi
551433a01cab initial coding
carl
parents:
diff changeset
3774 done
551433a01cab initial coding
carl
parents:
diff changeset
3775 # Handle the remaining objects by creating one last
551433a01cab initial coding
carl
parents:
diff changeset
3776 # reloadable object file. All subsequent reloadable object
551433a01cab initial coding
carl
parents:
diff changeset
3777 # files will link in the last one created.
551433a01cab initial coding
carl
parents:
diff changeset
3778 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
551433a01cab initial coding
carl
parents:
diff changeset
3779 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
551433a01cab initial coding
carl
parents:
diff changeset
3780
551433a01cab initial coding
carl
parents:
diff changeset
3781 if ${skipped_export-false}; then
551433a01cab initial coding
carl
parents:
diff changeset
3782 $show "generating symbol list for \`$libname.la'"
551433a01cab initial coding
carl
parents:
diff changeset
3783 export_symbols="$output_objdir/$libname.exp"
551433a01cab initial coding
carl
parents:
diff changeset
3784 $run $rm $export_symbols
551433a01cab initial coding
carl
parents:
diff changeset
3785 libobjs=$output
551433a01cab initial coding
carl
parents:
diff changeset
3786 # Append the command to create the export file.
551433a01cab initial coding
carl
parents:
diff changeset
3787 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3788 fi
551433a01cab initial coding
carl
parents:
diff changeset
3789
551433a01cab initial coding
carl
parents:
diff changeset
3790 # Set up a command to remove the reloadale object files
551433a01cab initial coding
carl
parents:
diff changeset
3791 # after they are used.
551433a01cab initial coding
carl
parents:
diff changeset
3792 i=0
551433a01cab initial coding
carl
parents:
diff changeset
3793 while test "$i" -lt "$k"
551433a01cab initial coding
carl
parents:
diff changeset
3794 do
551433a01cab initial coding
carl
parents:
diff changeset
3795 i=`expr $i + 1`
551433a01cab initial coding
carl
parents:
diff changeset
3796 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
551433a01cab initial coding
carl
parents:
diff changeset
3797 done
551433a01cab initial coding
carl
parents:
diff changeset
3798
551433a01cab initial coding
carl
parents:
diff changeset
3799 $echo "creating a temporary reloadable object file: $output"
551433a01cab initial coding
carl
parents:
diff changeset
3800
551433a01cab initial coding
carl
parents:
diff changeset
3801 # Loop through the commands generated above and execute them.
551433a01cab initial coding
carl
parents:
diff changeset
3802 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
3803 for cmd in $concat_cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
3804 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3805 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
3806 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3807 done
551433a01cab initial coding
carl
parents:
diff changeset
3808 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3809
551433a01cab initial coding
carl
parents:
diff changeset
3810 libobjs=$output
551433a01cab initial coding
carl
parents:
diff changeset
3811 # Restore the value of output.
551433a01cab initial coding
carl
parents:
diff changeset
3812 output=$save_output
551433a01cab initial coding
carl
parents:
diff changeset
3813
551433a01cab initial coding
carl
parents:
diff changeset
3814 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3815 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3816 fi
551433a01cab initial coding
carl
parents:
diff changeset
3817 # Expand the library linking commands again to reset the
551433a01cab initial coding
carl
parents:
diff changeset
3818 # value of $libobjs for piecewise linking.
551433a01cab initial coding
carl
parents:
diff changeset
3819
551433a01cab initial coding
carl
parents:
diff changeset
3820 # Do each of the archive commands.
551433a01cab initial coding
carl
parents:
diff changeset
3821 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
3822 eval cmds=\"$archive_expsym_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3823 else
551433a01cab initial coding
carl
parents:
diff changeset
3824 eval cmds=\"$archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3825 fi
551433a01cab initial coding
carl
parents:
diff changeset
3826
551433a01cab initial coding
carl
parents:
diff changeset
3827 # Append the command to remove the reloadable object files
551433a01cab initial coding
carl
parents:
diff changeset
3828 # to the just-reset $cmds.
551433a01cab initial coding
carl
parents:
diff changeset
3829 eval cmds=\"\$cmds~$rm $delfiles\"
551433a01cab initial coding
carl
parents:
diff changeset
3830 fi
551433a01cab initial coding
carl
parents:
diff changeset
3831 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
3832 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
3833 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3834 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
3835 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3836 done
551433a01cab initial coding
carl
parents:
diff changeset
3837 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3838
551433a01cab initial coding
carl
parents:
diff changeset
3839 # Restore the uninstalled library and exit
551433a01cab initial coding
carl
parents:
diff changeset
3840 if test "$mode" = relink; then
551433a01cab initial coding
carl
parents:
diff changeset
3841 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3842 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
3843 fi
551433a01cab initial coding
carl
parents:
diff changeset
3844
551433a01cab initial coding
carl
parents:
diff changeset
3845 # Create links to the real library.
551433a01cab initial coding
carl
parents:
diff changeset
3846 for linkname in $linknames; do
551433a01cab initial coding
carl
parents:
diff changeset
3847 if test "$realname" != "$linkname"; then
551433a01cab initial coding
carl
parents:
diff changeset
3848 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
551433a01cab initial coding
carl
parents:
diff changeset
3849 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3850 fi
551433a01cab initial coding
carl
parents:
diff changeset
3851 done
551433a01cab initial coding
carl
parents:
diff changeset
3852
551433a01cab initial coding
carl
parents:
diff changeset
3853 # If -module or -export-dynamic was specified, set the dlname.
551433a01cab initial coding
carl
parents:
diff changeset
3854 if test "$module" = yes || test "$export_dynamic" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
3855 # On all known operating systems, these are identical.
551433a01cab initial coding
carl
parents:
diff changeset
3856 dlname="$soname"
551433a01cab initial coding
carl
parents:
diff changeset
3857 fi
551433a01cab initial coding
carl
parents:
diff changeset
3858 fi
551433a01cab initial coding
carl
parents:
diff changeset
3859 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3860
551433a01cab initial coding
carl
parents:
diff changeset
3861 obj)
551433a01cab initial coding
carl
parents:
diff changeset
3862 if test -n "$deplibs"; then
551433a01cab initial coding
carl
parents:
diff changeset
3863 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3864 fi
551433a01cab initial coding
carl
parents:
diff changeset
3865
551433a01cab initial coding
carl
parents:
diff changeset
3866 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
3867 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3868 fi
551433a01cab initial coding
carl
parents:
diff changeset
3869
551433a01cab initial coding
carl
parents:
diff changeset
3870 if test -n "$rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3871 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3872 fi
551433a01cab initial coding
carl
parents:
diff changeset
3873
551433a01cab initial coding
carl
parents:
diff changeset
3874 if test -n "$xrpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
3875 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3876 fi
551433a01cab initial coding
carl
parents:
diff changeset
3877
551433a01cab initial coding
carl
parents:
diff changeset
3878 if test -n "$vinfo"; then
551433a01cab initial coding
carl
parents:
diff changeset
3879 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3880 fi
551433a01cab initial coding
carl
parents:
diff changeset
3881
551433a01cab initial coding
carl
parents:
diff changeset
3882 if test -n "$release"; then
551433a01cab initial coding
carl
parents:
diff changeset
3883 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3884 fi
551433a01cab initial coding
carl
parents:
diff changeset
3885
551433a01cab initial coding
carl
parents:
diff changeset
3886 case $output in
551433a01cab initial coding
carl
parents:
diff changeset
3887 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
3888 if test -n "$objs$old_deplibs"; then
551433a01cab initial coding
carl
parents:
diff changeset
3889 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3890 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
3891 fi
551433a01cab initial coding
carl
parents:
diff changeset
3892 libobj="$output"
551433a01cab initial coding
carl
parents:
diff changeset
3893 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
3894 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3895 *)
551433a01cab initial coding
carl
parents:
diff changeset
3896 libobj=
551433a01cab initial coding
carl
parents:
diff changeset
3897 obj="$output"
551433a01cab initial coding
carl
parents:
diff changeset
3898 ;;
551433a01cab initial coding
carl
parents:
diff changeset
3899 esac
551433a01cab initial coding
carl
parents:
diff changeset
3900
551433a01cab initial coding
carl
parents:
diff changeset
3901 # Delete the old objects.
551433a01cab initial coding
carl
parents:
diff changeset
3902 $run $rm $obj $libobj
551433a01cab initial coding
carl
parents:
diff changeset
3903
551433a01cab initial coding
carl
parents:
diff changeset
3904 # Objects from convenience libraries. This assumes
551433a01cab initial coding
carl
parents:
diff changeset
3905 # single-version convenience libraries. Whenever we create
551433a01cab initial coding
carl
parents:
diff changeset
3906 # different ones for PIC/non-PIC, this we'll have to duplicate
551433a01cab initial coding
carl
parents:
diff changeset
3907 # the extraction.
551433a01cab initial coding
carl
parents:
diff changeset
3908 reload_conv_objs=
551433a01cab initial coding
carl
parents:
diff changeset
3909 gentop=
551433a01cab initial coding
carl
parents:
diff changeset
3910 # reload_cmds runs $LD directly, so let us get rid of
551433a01cab initial coding
carl
parents:
diff changeset
3911 # -Wl from whole_archive_flag_spec
551433a01cab initial coding
carl
parents:
diff changeset
3912 wl=
551433a01cab initial coding
carl
parents:
diff changeset
3913
551433a01cab initial coding
carl
parents:
diff changeset
3914 if test -n "$convenience"; then
551433a01cab initial coding
carl
parents:
diff changeset
3915 if test -n "$whole_archive_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
3916 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
3917 else
551433a01cab initial coding
carl
parents:
diff changeset
3918 gentop="$output_objdir/${obj}x"
551433a01cab initial coding
carl
parents:
diff changeset
3919 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3920 $run ${rm}r "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3921 $show "$mkdir $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3922 $run $mkdir "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3923 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
3924 if test "$status" -ne 0 && test ! -d "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
3925 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
3926 fi
551433a01cab initial coding
carl
parents:
diff changeset
3927 generated="$generated $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3928
551433a01cab initial coding
carl
parents:
diff changeset
3929 for xlib in $convenience; do
551433a01cab initial coding
carl
parents:
diff changeset
3930 # Extract the objects.
551433a01cab initial coding
carl
parents:
diff changeset
3931 case $xlib in
551433a01cab initial coding
carl
parents:
diff changeset
3932 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3933 *) xabs=`pwd`"/$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
3934 esac
551433a01cab initial coding
carl
parents:
diff changeset
3935 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
3936 xdir="$gentop/$xlib"
551433a01cab initial coding
carl
parents:
diff changeset
3937
551433a01cab initial coding
carl
parents:
diff changeset
3938 $show "${rm}r $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3939 $run ${rm}r "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3940 $show "$mkdir $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3941 $run $mkdir "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
3942 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
3943 if test "$status" -ne 0 && test ! -d "$xdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
3944 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
3945 fi
551433a01cab initial coding
carl
parents:
diff changeset
3946 # We will extract separately just the conflicting names and we will no
551433a01cab initial coding
carl
parents:
diff changeset
3947 # longer touch any unique names. It is faster to leave these extract
551433a01cab initial coding
carl
parents:
diff changeset
3948 # automatically by $AR in one run.
551433a01cab initial coding
carl
parents:
diff changeset
3949 $show "(cd $xdir && $AR x $xabs)"
551433a01cab initial coding
carl
parents:
diff changeset
3950 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3951 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
551433a01cab initial coding
carl
parents:
diff changeset
3952 :
551433a01cab initial coding
carl
parents:
diff changeset
3953 else
551433a01cab initial coding
carl
parents:
diff changeset
3954 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3955 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
3956 $AR t "$xabs" | sort | uniq -cd | while read -r count name
551433a01cab initial coding
carl
parents:
diff changeset
3957 do
551433a01cab initial coding
carl
parents:
diff changeset
3958 i=1
551433a01cab initial coding
carl
parents:
diff changeset
3959 while test "$i" -le "$count"
551433a01cab initial coding
carl
parents:
diff changeset
3960 do
551433a01cab initial coding
carl
parents:
diff changeset
3961 # Put our $i before any first dot (extension)
551433a01cab initial coding
carl
parents:
diff changeset
3962 # Never overwrite any file
551433a01cab initial coding
carl
parents:
diff changeset
3963 name_to="$name"
551433a01cab initial coding
carl
parents:
diff changeset
3964 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
551433a01cab initial coding
carl
parents:
diff changeset
3965 do
551433a01cab initial coding
carl
parents:
diff changeset
3966 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
551433a01cab initial coding
carl
parents:
diff changeset
3967 done
551433a01cab initial coding
carl
parents:
diff changeset
3968 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
551433a01cab initial coding
carl
parents:
diff changeset
3969 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3970 i=`expr $i + 1`
551433a01cab initial coding
carl
parents:
diff changeset
3971 done
551433a01cab initial coding
carl
parents:
diff changeset
3972 done
551433a01cab initial coding
carl
parents:
diff changeset
3973 fi
551433a01cab initial coding
carl
parents:
diff changeset
3974
551433a01cab initial coding
carl
parents:
diff changeset
3975 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
3976 done
551433a01cab initial coding
carl
parents:
diff changeset
3977 fi
551433a01cab initial coding
carl
parents:
diff changeset
3978 fi
551433a01cab initial coding
carl
parents:
diff changeset
3979
551433a01cab initial coding
carl
parents:
diff changeset
3980 # Create the old-style object.
551433a01cab initial coding
carl
parents:
diff changeset
3981 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
551433a01cab initial coding
carl
parents:
diff changeset
3982
551433a01cab initial coding
carl
parents:
diff changeset
3983 output="$obj"
551433a01cab initial coding
carl
parents:
diff changeset
3984 eval cmds=\"$reload_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
3985 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
3986 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
3987 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3988 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
3989 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
3990 done
551433a01cab initial coding
carl
parents:
diff changeset
3991 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
3992
551433a01cab initial coding
carl
parents:
diff changeset
3993 # Exit if we aren't doing a library object file.
551433a01cab initial coding
carl
parents:
diff changeset
3994 if test -z "$libobj"; then
551433a01cab initial coding
carl
parents:
diff changeset
3995 if test -n "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
3996 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
3997 $run ${rm}r $gentop
551433a01cab initial coding
carl
parents:
diff changeset
3998 fi
551433a01cab initial coding
carl
parents:
diff changeset
3999
551433a01cab initial coding
carl
parents:
diff changeset
4000 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
4001 fi
551433a01cab initial coding
carl
parents:
diff changeset
4002
551433a01cab initial coding
carl
parents:
diff changeset
4003 if test "$build_libtool_libs" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4004 if test -n "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
4005 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4006 $run ${rm}r $gentop
551433a01cab initial coding
carl
parents:
diff changeset
4007 fi
551433a01cab initial coding
carl
parents:
diff changeset
4008
551433a01cab initial coding
carl
parents:
diff changeset
4009 # Create an invalid libtool object if no PIC, so that we don't
551433a01cab initial coding
carl
parents:
diff changeset
4010 # accidentally link it into a program.
551433a01cab initial coding
carl
parents:
diff changeset
4011 # $show "echo timestamp > $libobj"
551433a01cab initial coding
carl
parents:
diff changeset
4012 # $run eval "echo timestamp > $libobj" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4013 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
4014 fi
551433a01cab initial coding
carl
parents:
diff changeset
4015
551433a01cab initial coding
carl
parents:
diff changeset
4016 if test -n "$pic_flag" || test "$pic_mode" != default; then
551433a01cab initial coding
carl
parents:
diff changeset
4017 # Only do commands if we really have different PIC objects.
551433a01cab initial coding
carl
parents:
diff changeset
4018 reload_objs="$libobjs $reload_conv_objs"
551433a01cab initial coding
carl
parents:
diff changeset
4019 output="$libobj"
551433a01cab initial coding
carl
parents:
diff changeset
4020 eval cmds=\"$reload_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
4021 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
4022 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
4023 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
4024 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
4025 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4026 done
551433a01cab initial coding
carl
parents:
diff changeset
4027 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
4028 fi
551433a01cab initial coding
carl
parents:
diff changeset
4029
551433a01cab initial coding
carl
parents:
diff changeset
4030 if test -n "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
4031 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4032 $run ${rm}r $gentop
551433a01cab initial coding
carl
parents:
diff changeset
4033 fi
551433a01cab initial coding
carl
parents:
diff changeset
4034
551433a01cab initial coding
carl
parents:
diff changeset
4035 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
4036 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4037
551433a01cab initial coding
carl
parents:
diff changeset
4038 prog)
551433a01cab initial coding
carl
parents:
diff changeset
4039 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4040 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
551433a01cab initial coding
carl
parents:
diff changeset
4041 esac
551433a01cab initial coding
carl
parents:
diff changeset
4042 if test -n "$vinfo"; then
551433a01cab initial coding
carl
parents:
diff changeset
4043 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4044 fi
551433a01cab initial coding
carl
parents:
diff changeset
4045
551433a01cab initial coding
carl
parents:
diff changeset
4046 if test -n "$release"; then
551433a01cab initial coding
carl
parents:
diff changeset
4047 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4048 fi
551433a01cab initial coding
carl
parents:
diff changeset
4049
551433a01cab initial coding
carl
parents:
diff changeset
4050 if test "$preload" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4051 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
551433a01cab initial coding
carl
parents:
diff changeset
4052 test "$dlopen_self_static" = unknown; then
551433a01cab initial coding
carl
parents:
diff changeset
4053 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
551433a01cab initial coding
carl
parents:
diff changeset
4054 fi
551433a01cab initial coding
carl
parents:
diff changeset
4055 fi
551433a01cab initial coding
carl
parents:
diff changeset
4056
551433a01cab initial coding
carl
parents:
diff changeset
4057 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4058 *-*-rhapsody* | *-*-darwin1.[012])
551433a01cab initial coding
carl
parents:
diff changeset
4059 # On Rhapsody replace the C library is the System framework
551433a01cab initial coding
carl
parents:
diff changeset
4060 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
551433a01cab initial coding
carl
parents:
diff changeset
4061 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
551433a01cab initial coding
carl
parents:
diff changeset
4062 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4063 esac
551433a01cab initial coding
carl
parents:
diff changeset
4064
551433a01cab initial coding
carl
parents:
diff changeset
4065 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4066 *darwin*)
551433a01cab initial coding
carl
parents:
diff changeset
4067 # Don't allow lazy linking, it breaks C++ global constructors
551433a01cab initial coding
carl
parents:
diff changeset
4068 if test "$tagname" = CXX ; then
551433a01cab initial coding
carl
parents:
diff changeset
4069 compile_command="$compile_command ${wl}-bind_at_load"
551433a01cab initial coding
carl
parents:
diff changeset
4070 finalize_command="$finalize_command ${wl}-bind_at_load"
551433a01cab initial coding
carl
parents:
diff changeset
4071 fi
551433a01cab initial coding
carl
parents:
diff changeset
4072 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4073 esac
551433a01cab initial coding
carl
parents:
diff changeset
4074
551433a01cab initial coding
carl
parents:
diff changeset
4075 compile_command="$compile_command $compile_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
4076 finalize_command="$finalize_command $finalize_deplibs"
551433a01cab initial coding
carl
parents:
diff changeset
4077
551433a01cab initial coding
carl
parents:
diff changeset
4078 if test -n "$rpath$xrpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4079 # If the user specified any rpath flags, then add them.
551433a01cab initial coding
carl
parents:
diff changeset
4080 for libdir in $rpath $xrpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4081 # This is the magic to use -rpath.
551433a01cab initial coding
carl
parents:
diff changeset
4082 case "$finalize_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
4083 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4084 *) finalize_rpath="$finalize_rpath $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4085 esac
551433a01cab initial coding
carl
parents:
diff changeset
4086 done
551433a01cab initial coding
carl
parents:
diff changeset
4087 fi
551433a01cab initial coding
carl
parents:
diff changeset
4088
551433a01cab initial coding
carl
parents:
diff changeset
4089 # Now hardcode the library paths
551433a01cab initial coding
carl
parents:
diff changeset
4090 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
4091 hardcode_libdirs=
551433a01cab initial coding
carl
parents:
diff changeset
4092 for libdir in $compile_rpath $finalize_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4093 if test -n "$hardcode_libdir_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
4094 if test -n "$hardcode_libdir_separator"; then
551433a01cab initial coding
carl
parents:
diff changeset
4095 if test -z "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
4096 hardcode_libdirs="$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
4097 else
551433a01cab initial coding
carl
parents:
diff changeset
4098 # Just accumulate the unique libdirs.
551433a01cab initial coding
carl
parents:
diff changeset
4099 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
551433a01cab initial coding
carl
parents:
diff changeset
4100 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
551433a01cab initial coding
carl
parents:
diff changeset
4101 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4102 *)
551433a01cab initial coding
carl
parents:
diff changeset
4103 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
4104 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4105 esac
551433a01cab initial coding
carl
parents:
diff changeset
4106 fi
551433a01cab initial coding
carl
parents:
diff changeset
4107 else
551433a01cab initial coding
carl
parents:
diff changeset
4108 eval flag=\"$hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
4109 rpath="$rpath $flag"
551433a01cab initial coding
carl
parents:
diff changeset
4110 fi
551433a01cab initial coding
carl
parents:
diff changeset
4111 elif test -n "$runpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
4112 case "$perm_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
4113 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4114 *) perm_rpath="$perm_rpath $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4115 esac
551433a01cab initial coding
carl
parents:
diff changeset
4116 fi
551433a01cab initial coding
carl
parents:
diff changeset
4117 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4118 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
4119 case :$dllsearchpath: in
551433a01cab initial coding
carl
parents:
diff changeset
4120 *":$libdir:"*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4121 *) dllsearchpath="$dllsearchpath:$libdir";;
551433a01cab initial coding
carl
parents:
diff changeset
4122 esac
551433a01cab initial coding
carl
parents:
diff changeset
4123 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4124 esac
551433a01cab initial coding
carl
parents:
diff changeset
4125 done
551433a01cab initial coding
carl
parents:
diff changeset
4126 # Substitute the hardcoded libdirs into the rpath.
551433a01cab initial coding
carl
parents:
diff changeset
4127 if test -n "$hardcode_libdir_separator" &&
551433a01cab initial coding
carl
parents:
diff changeset
4128 test -n "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
4129 libdir="$hardcode_libdirs"
551433a01cab initial coding
carl
parents:
diff changeset
4130 eval rpath=\" $hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
4131 fi
551433a01cab initial coding
carl
parents:
diff changeset
4132 compile_rpath="$rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4133
551433a01cab initial coding
carl
parents:
diff changeset
4134 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
4135 hardcode_libdirs=
551433a01cab initial coding
carl
parents:
diff changeset
4136 for libdir in $finalize_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4137 if test -n "$hardcode_libdir_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
4138 if test -n "$hardcode_libdir_separator"; then
551433a01cab initial coding
carl
parents:
diff changeset
4139 if test -z "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
4140 hardcode_libdirs="$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
4141 else
551433a01cab initial coding
carl
parents:
diff changeset
4142 # Just accumulate the unique libdirs.
551433a01cab initial coding
carl
parents:
diff changeset
4143 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
551433a01cab initial coding
carl
parents:
diff changeset
4144 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
551433a01cab initial coding
carl
parents:
diff changeset
4145 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4146 *)
551433a01cab initial coding
carl
parents:
diff changeset
4147 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
551433a01cab initial coding
carl
parents:
diff changeset
4148 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4149 esac
551433a01cab initial coding
carl
parents:
diff changeset
4150 fi
551433a01cab initial coding
carl
parents:
diff changeset
4151 else
551433a01cab initial coding
carl
parents:
diff changeset
4152 eval flag=\"$hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
4153 rpath="$rpath $flag"
551433a01cab initial coding
carl
parents:
diff changeset
4154 fi
551433a01cab initial coding
carl
parents:
diff changeset
4155 elif test -n "$runpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
4156 case "$finalize_perm_rpath " in
551433a01cab initial coding
carl
parents:
diff changeset
4157 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4158 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4159 esac
551433a01cab initial coding
carl
parents:
diff changeset
4160 fi
551433a01cab initial coding
carl
parents:
diff changeset
4161 done
551433a01cab initial coding
carl
parents:
diff changeset
4162 # Substitute the hardcoded libdirs into the rpath.
551433a01cab initial coding
carl
parents:
diff changeset
4163 if test -n "$hardcode_libdir_separator" &&
551433a01cab initial coding
carl
parents:
diff changeset
4164 test -n "$hardcode_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
4165 libdir="$hardcode_libdirs"
551433a01cab initial coding
carl
parents:
diff changeset
4166 eval rpath=\" $hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
4167 fi
551433a01cab initial coding
carl
parents:
diff changeset
4168 finalize_rpath="$rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4169
551433a01cab initial coding
carl
parents:
diff changeset
4170 if test -n "$libobjs" && test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4171 # Transform all the library objects into standard objects.
551433a01cab initial coding
carl
parents:
diff changeset
4172 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
4173 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
4174 fi
551433a01cab initial coding
carl
parents:
diff changeset
4175
551433a01cab initial coding
carl
parents:
diff changeset
4176 dlsyms=
551433a01cab initial coding
carl
parents:
diff changeset
4177 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
4178 if test -n "$NM" && test -n "$global_symbol_pipe"; then
551433a01cab initial coding
carl
parents:
diff changeset
4179 dlsyms="${outputname}S.c"
551433a01cab initial coding
carl
parents:
diff changeset
4180 else
551433a01cab initial coding
carl
parents:
diff changeset
4181 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4182 fi
551433a01cab initial coding
carl
parents:
diff changeset
4183 fi
551433a01cab initial coding
carl
parents:
diff changeset
4184
551433a01cab initial coding
carl
parents:
diff changeset
4185 if test -n "$dlsyms"; then
551433a01cab initial coding
carl
parents:
diff changeset
4186 case $dlsyms in
551433a01cab initial coding
carl
parents:
diff changeset
4187 "") ;;
551433a01cab initial coding
carl
parents:
diff changeset
4188 *.c)
551433a01cab initial coding
carl
parents:
diff changeset
4189 # Discover the nlist of each of the dlfiles.
551433a01cab initial coding
carl
parents:
diff changeset
4190 nlist="$output_objdir/${outputname}.nm"
551433a01cab initial coding
carl
parents:
diff changeset
4191
551433a01cab initial coding
carl
parents:
diff changeset
4192 $show "$rm $nlist ${nlist}S ${nlist}T"
551433a01cab initial coding
carl
parents:
diff changeset
4193 $run $rm "$nlist" "${nlist}S" "${nlist}T"
551433a01cab initial coding
carl
parents:
diff changeset
4194
551433a01cab initial coding
carl
parents:
diff changeset
4195 # Parse the name list into a source file.
551433a01cab initial coding
carl
parents:
diff changeset
4196 $show "creating $output_objdir/$dlsyms"
551433a01cab initial coding
carl
parents:
diff changeset
4197
551433a01cab initial coding
carl
parents:
diff changeset
4198 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
551433a01cab initial coding
carl
parents:
diff changeset
4199 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
551433a01cab initial coding
carl
parents:
diff changeset
4200 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
551433a01cab initial coding
carl
parents:
diff changeset
4201
551433a01cab initial coding
carl
parents:
diff changeset
4202 #ifdef __cplusplus
551433a01cab initial coding
carl
parents:
diff changeset
4203 extern \"C\" {
551433a01cab initial coding
carl
parents:
diff changeset
4204 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4205
551433a01cab initial coding
carl
parents:
diff changeset
4206 /* Prevent the only kind of declaration conflicts we can make. */
551433a01cab initial coding
carl
parents:
diff changeset
4207 #define lt_preloaded_symbols some_other_symbol
551433a01cab initial coding
carl
parents:
diff changeset
4208
551433a01cab initial coding
carl
parents:
diff changeset
4209 /* External symbol declarations for the compiler. */\
551433a01cab initial coding
carl
parents:
diff changeset
4210 "
551433a01cab initial coding
carl
parents:
diff changeset
4211
551433a01cab initial coding
carl
parents:
diff changeset
4212 if test "$dlself" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4213 $show "generating symbol list for \`$output'"
551433a01cab initial coding
carl
parents:
diff changeset
4214
551433a01cab initial coding
carl
parents:
diff changeset
4215 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
551433a01cab initial coding
carl
parents:
diff changeset
4216
551433a01cab initial coding
carl
parents:
diff changeset
4217 # Add our own program objects to the symbol list.
551433a01cab initial coding
carl
parents:
diff changeset
4218 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
4219 for arg in $progfiles; do
551433a01cab initial coding
carl
parents:
diff changeset
4220 $show "extracting global C symbols from \`$arg'"
551433a01cab initial coding
carl
parents:
diff changeset
4221 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
551433a01cab initial coding
carl
parents:
diff changeset
4222 done
551433a01cab initial coding
carl
parents:
diff changeset
4223
551433a01cab initial coding
carl
parents:
diff changeset
4224 if test -n "$exclude_expsyms"; then
551433a01cab initial coding
carl
parents:
diff changeset
4225 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
551433a01cab initial coding
carl
parents:
diff changeset
4226 $run eval '$mv "$nlist"T "$nlist"'
551433a01cab initial coding
carl
parents:
diff changeset
4227 fi
551433a01cab initial coding
carl
parents:
diff changeset
4228
551433a01cab initial coding
carl
parents:
diff changeset
4229 if test -n "$export_symbols_regex"; then
551433a01cab initial coding
carl
parents:
diff changeset
4230 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
551433a01cab initial coding
carl
parents:
diff changeset
4231 $run eval '$mv "$nlist"T "$nlist"'
551433a01cab initial coding
carl
parents:
diff changeset
4232 fi
551433a01cab initial coding
carl
parents:
diff changeset
4233
551433a01cab initial coding
carl
parents:
diff changeset
4234 # Prepare the list of exported symbols
551433a01cab initial coding
carl
parents:
diff changeset
4235 if test -z "$export_symbols"; then
551433a01cab initial coding
carl
parents:
diff changeset
4236 export_symbols="$output_objdir/$output.exp"
551433a01cab initial coding
carl
parents:
diff changeset
4237 $run $rm $export_symbols
551433a01cab initial coding
carl
parents:
diff changeset
4238 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
551433a01cab initial coding
carl
parents:
diff changeset
4239 else
551433a01cab initial coding
carl
parents:
diff changeset
4240 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
551433a01cab initial coding
carl
parents:
diff changeset
4241 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
551433a01cab initial coding
carl
parents:
diff changeset
4242 $run eval 'mv "$nlist"T "$nlist"'
551433a01cab initial coding
carl
parents:
diff changeset
4243 fi
551433a01cab initial coding
carl
parents:
diff changeset
4244 fi
551433a01cab initial coding
carl
parents:
diff changeset
4245
551433a01cab initial coding
carl
parents:
diff changeset
4246 for arg in $dlprefiles; do
551433a01cab initial coding
carl
parents:
diff changeset
4247 $show "extracting global C symbols from \`$arg'"
551433a01cab initial coding
carl
parents:
diff changeset
4248 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
4249 $run eval '$echo ": $name " >> "$nlist"'
551433a01cab initial coding
carl
parents:
diff changeset
4250 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
551433a01cab initial coding
carl
parents:
diff changeset
4251 done
551433a01cab initial coding
carl
parents:
diff changeset
4252
551433a01cab initial coding
carl
parents:
diff changeset
4253 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
4254 # Make sure we have at least an empty file.
551433a01cab initial coding
carl
parents:
diff changeset
4255 test -f "$nlist" || : > "$nlist"
551433a01cab initial coding
carl
parents:
diff changeset
4256
551433a01cab initial coding
carl
parents:
diff changeset
4257 if test -n "$exclude_expsyms"; then
551433a01cab initial coding
carl
parents:
diff changeset
4258 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
551433a01cab initial coding
carl
parents:
diff changeset
4259 $mv "$nlist"T "$nlist"
551433a01cab initial coding
carl
parents:
diff changeset
4260 fi
551433a01cab initial coding
carl
parents:
diff changeset
4261
551433a01cab initial coding
carl
parents:
diff changeset
4262 # Try sorting and uniquifying the output.
551433a01cab initial coding
carl
parents:
diff changeset
4263 if grep -v "^: " < "$nlist" |
551433a01cab initial coding
carl
parents:
diff changeset
4264 if sort -k 3 </dev/null >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
4265 sort -k 3
551433a01cab initial coding
carl
parents:
diff changeset
4266 else
551433a01cab initial coding
carl
parents:
diff changeset
4267 sort +2
551433a01cab initial coding
carl
parents:
diff changeset
4268 fi |
551433a01cab initial coding
carl
parents:
diff changeset
4269 uniq > "$nlist"S; then
551433a01cab initial coding
carl
parents:
diff changeset
4270 :
551433a01cab initial coding
carl
parents:
diff changeset
4271 else
551433a01cab initial coding
carl
parents:
diff changeset
4272 grep -v "^: " < "$nlist" > "$nlist"S
551433a01cab initial coding
carl
parents:
diff changeset
4273 fi
551433a01cab initial coding
carl
parents:
diff changeset
4274
551433a01cab initial coding
carl
parents:
diff changeset
4275 if test -f "$nlist"S; then
551433a01cab initial coding
carl
parents:
diff changeset
4276 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
551433a01cab initial coding
carl
parents:
diff changeset
4277 else
551433a01cab initial coding
carl
parents:
diff changeset
4278 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
551433a01cab initial coding
carl
parents:
diff changeset
4279 fi
551433a01cab initial coding
carl
parents:
diff changeset
4280
551433a01cab initial coding
carl
parents:
diff changeset
4281 $echo >> "$output_objdir/$dlsyms" "\
551433a01cab initial coding
carl
parents:
diff changeset
4282
551433a01cab initial coding
carl
parents:
diff changeset
4283 #undef lt_preloaded_symbols
551433a01cab initial coding
carl
parents:
diff changeset
4284
551433a01cab initial coding
carl
parents:
diff changeset
4285 #if defined (__STDC__) && __STDC__
551433a01cab initial coding
carl
parents:
diff changeset
4286 # define lt_ptr void *
551433a01cab initial coding
carl
parents:
diff changeset
4287 #else
551433a01cab initial coding
carl
parents:
diff changeset
4288 # define lt_ptr char *
551433a01cab initial coding
carl
parents:
diff changeset
4289 # define const
551433a01cab initial coding
carl
parents:
diff changeset
4290 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4291
551433a01cab initial coding
carl
parents:
diff changeset
4292 /* The mapping between symbol names and symbols. */
551433a01cab initial coding
carl
parents:
diff changeset
4293 const struct {
551433a01cab initial coding
carl
parents:
diff changeset
4294 const char *name;
551433a01cab initial coding
carl
parents:
diff changeset
4295 lt_ptr address;
551433a01cab initial coding
carl
parents:
diff changeset
4296 }
551433a01cab initial coding
carl
parents:
diff changeset
4297 lt_preloaded_symbols[] =
551433a01cab initial coding
carl
parents:
diff changeset
4298 {\
551433a01cab initial coding
carl
parents:
diff changeset
4299 "
551433a01cab initial coding
carl
parents:
diff changeset
4300
551433a01cab initial coding
carl
parents:
diff changeset
4301 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
551433a01cab initial coding
carl
parents:
diff changeset
4302
551433a01cab initial coding
carl
parents:
diff changeset
4303 $echo >> "$output_objdir/$dlsyms" "\
551433a01cab initial coding
carl
parents:
diff changeset
4304 {0, (lt_ptr) 0}
551433a01cab initial coding
carl
parents:
diff changeset
4305 };
551433a01cab initial coding
carl
parents:
diff changeset
4306
551433a01cab initial coding
carl
parents:
diff changeset
4307 /* This works around a problem in FreeBSD linker */
551433a01cab initial coding
carl
parents:
diff changeset
4308 #ifdef FREEBSD_WORKAROUND
551433a01cab initial coding
carl
parents:
diff changeset
4309 static const void *lt_preloaded_setup() {
551433a01cab initial coding
carl
parents:
diff changeset
4310 return lt_preloaded_symbols;
551433a01cab initial coding
carl
parents:
diff changeset
4311 }
551433a01cab initial coding
carl
parents:
diff changeset
4312 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4313
551433a01cab initial coding
carl
parents:
diff changeset
4314 #ifdef __cplusplus
551433a01cab initial coding
carl
parents:
diff changeset
4315 }
551433a01cab initial coding
carl
parents:
diff changeset
4316 #endif\
551433a01cab initial coding
carl
parents:
diff changeset
4317 "
551433a01cab initial coding
carl
parents:
diff changeset
4318 fi
551433a01cab initial coding
carl
parents:
diff changeset
4319
551433a01cab initial coding
carl
parents:
diff changeset
4320 pic_flag_for_symtable=
551433a01cab initial coding
carl
parents:
diff changeset
4321 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4322 # compiling the symbol table file with pic_flag works around
551433a01cab initial coding
carl
parents:
diff changeset
4323 # a FreeBSD bug that causes programs to crash when -lm is
551433a01cab initial coding
carl
parents:
diff changeset
4324 # linked before any other PIC object. But we must not use
551433a01cab initial coding
carl
parents:
diff changeset
4325 # pic_flag when linking with -static. The problem exists in
551433a01cab initial coding
carl
parents:
diff changeset
4326 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
551433a01cab initial coding
carl
parents:
diff changeset
4327 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
551433a01cab initial coding
carl
parents:
diff changeset
4328 case "$compile_command " in
551433a01cab initial coding
carl
parents:
diff changeset
4329 *" -static "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4330 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
551433a01cab initial coding
carl
parents:
diff changeset
4331 esac;;
551433a01cab initial coding
carl
parents:
diff changeset
4332 *-*-hpux*)
551433a01cab initial coding
carl
parents:
diff changeset
4333 case "$compile_command " in
551433a01cab initial coding
carl
parents:
diff changeset
4334 *" -static "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4335 *) pic_flag_for_symtable=" $pic_flag";;
551433a01cab initial coding
carl
parents:
diff changeset
4336 esac
551433a01cab initial coding
carl
parents:
diff changeset
4337 esac
551433a01cab initial coding
carl
parents:
diff changeset
4338
551433a01cab initial coding
carl
parents:
diff changeset
4339 # Now compile the dynamic symbol file.
551433a01cab initial coding
carl
parents:
diff changeset
4340 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
551433a01cab initial coding
carl
parents:
diff changeset
4341 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4342
551433a01cab initial coding
carl
parents:
diff changeset
4343 # Clean up the generated files.
551433a01cab initial coding
carl
parents:
diff changeset
4344 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
551433a01cab initial coding
carl
parents:
diff changeset
4345 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
551433a01cab initial coding
carl
parents:
diff changeset
4346
551433a01cab initial coding
carl
parents:
diff changeset
4347 # Transform the symbol file into the correct name.
551433a01cab initial coding
carl
parents:
diff changeset
4348 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
551433a01cab initial coding
carl
parents:
diff changeset
4349 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
551433a01cab initial coding
carl
parents:
diff changeset
4350 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4351 *)
551433a01cab initial coding
carl
parents:
diff changeset
4352 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4353 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
4354 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4355 esac
551433a01cab initial coding
carl
parents:
diff changeset
4356 else
551433a01cab initial coding
carl
parents:
diff changeset
4357 # We keep going just in case the user didn't refer to
551433a01cab initial coding
carl
parents:
diff changeset
4358 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
551433a01cab initial coding
carl
parents:
diff changeset
4359 # really was required.
551433a01cab initial coding
carl
parents:
diff changeset
4360
551433a01cab initial coding
carl
parents:
diff changeset
4361 # Nullify the symbol file.
551433a01cab initial coding
carl
parents:
diff changeset
4362 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
551433a01cab initial coding
carl
parents:
diff changeset
4363 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
551433a01cab initial coding
carl
parents:
diff changeset
4364 fi
551433a01cab initial coding
carl
parents:
diff changeset
4365
551433a01cab initial coding
carl
parents:
diff changeset
4366 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
551433a01cab initial coding
carl
parents:
diff changeset
4367 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
551433a01cab initial coding
carl
parents:
diff changeset
4368 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
551433a01cab initial coding
carl
parents:
diff changeset
4369 # This does not apply on AIX for ia64, which uses a SysV linker.
551433a01cab initial coding
carl
parents:
diff changeset
4370 case "$host" in
551433a01cab initial coding
carl
parents:
diff changeset
4371 ia64-*-aix5*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
4372 *-*-aix4* | *-*-aix5*)
551433a01cab initial coding
carl
parents:
diff changeset
4373 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
551433a01cab initial coding
carl
parents:
diff changeset
4374 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
551433a01cab initial coding
carl
parents:
diff changeset
4375 esac
551433a01cab initial coding
carl
parents:
diff changeset
4376
551433a01cab initial coding
carl
parents:
diff changeset
4377 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4378 # Replace the output file specification.
551433a01cab initial coding
carl
parents:
diff changeset
4379 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
551433a01cab initial coding
carl
parents:
diff changeset
4380 link_command="$compile_command$compile_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4381
551433a01cab initial coding
carl
parents:
diff changeset
4382 # We have no uninstalled library dependencies, so finalize right now.
551433a01cab initial coding
carl
parents:
diff changeset
4383 $show "$link_command"
551433a01cab initial coding
carl
parents:
diff changeset
4384 $run eval "$link_command"
551433a01cab initial coding
carl
parents:
diff changeset
4385 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
4386
551433a01cab initial coding
carl
parents:
diff changeset
4387 # Delete the generated files.
551433a01cab initial coding
carl
parents:
diff changeset
4388 if test -n "$dlsyms"; then
551433a01cab initial coding
carl
parents:
diff changeset
4389 $show "$rm $output_objdir/${outputname}S.${objext}"
551433a01cab initial coding
carl
parents:
diff changeset
4390 $run $rm "$output_objdir/${outputname}S.${objext}"
551433a01cab initial coding
carl
parents:
diff changeset
4391 fi
551433a01cab initial coding
carl
parents:
diff changeset
4392
551433a01cab initial coding
carl
parents:
diff changeset
4393 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
4394 fi
551433a01cab initial coding
carl
parents:
diff changeset
4395
551433a01cab initial coding
carl
parents:
diff changeset
4396 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
4397 # We should set the shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
4398 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
4399 for dir in $temp_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4400 case $dir in
551433a01cab initial coding
carl
parents:
diff changeset
4401 [\\/]* | [A-Za-z]:[\\/]*)
551433a01cab initial coding
carl
parents:
diff changeset
4402 # Absolute path.
551433a01cab initial coding
carl
parents:
diff changeset
4403 rpath="$rpath$dir:"
551433a01cab initial coding
carl
parents:
diff changeset
4404 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4405 *)
551433a01cab initial coding
carl
parents:
diff changeset
4406 # Relative path: add a thisdir entry.
551433a01cab initial coding
carl
parents:
diff changeset
4407 rpath="$rpath\$thisdir/$dir:"
551433a01cab initial coding
carl
parents:
diff changeset
4408 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4409 esac
551433a01cab initial coding
carl
parents:
diff changeset
4410 done
551433a01cab initial coding
carl
parents:
diff changeset
4411 temp_rpath="$rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4412 fi
551433a01cab initial coding
carl
parents:
diff changeset
4413
551433a01cab initial coding
carl
parents:
diff changeset
4414 if test -n "$compile_shlibpath$finalize_shlibpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4415 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
551433a01cab initial coding
carl
parents:
diff changeset
4416 fi
551433a01cab initial coding
carl
parents:
diff changeset
4417 if test -n "$finalize_shlibpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4418 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
551433a01cab initial coding
carl
parents:
diff changeset
4419 fi
551433a01cab initial coding
carl
parents:
diff changeset
4420
551433a01cab initial coding
carl
parents:
diff changeset
4421 compile_var=
551433a01cab initial coding
carl
parents:
diff changeset
4422 finalize_var=
551433a01cab initial coding
carl
parents:
diff changeset
4423 if test -n "$runpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
4424 if test -n "$perm_rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4425 # We should set the runpath_var.
551433a01cab initial coding
carl
parents:
diff changeset
4426 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
4427 for dir in $perm_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4428 rpath="$rpath$dir:"
551433a01cab initial coding
carl
parents:
diff changeset
4429 done
551433a01cab initial coding
carl
parents:
diff changeset
4430 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
551433a01cab initial coding
carl
parents:
diff changeset
4431 fi
551433a01cab initial coding
carl
parents:
diff changeset
4432 if test -n "$finalize_perm_rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4433 # We should set the runpath_var.
551433a01cab initial coding
carl
parents:
diff changeset
4434 rpath=
551433a01cab initial coding
carl
parents:
diff changeset
4435 for dir in $finalize_perm_rpath; do
551433a01cab initial coding
carl
parents:
diff changeset
4436 rpath="$rpath$dir:"
551433a01cab initial coding
carl
parents:
diff changeset
4437 done
551433a01cab initial coding
carl
parents:
diff changeset
4438 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
551433a01cab initial coding
carl
parents:
diff changeset
4439 fi
551433a01cab initial coding
carl
parents:
diff changeset
4440 fi
551433a01cab initial coding
carl
parents:
diff changeset
4441
551433a01cab initial coding
carl
parents:
diff changeset
4442 if test "$no_install" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4443 # We don't need to create a wrapper script.
551433a01cab initial coding
carl
parents:
diff changeset
4444 link_command="$compile_var$compile_command$compile_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4445 # Replace the output file specification.
551433a01cab initial coding
carl
parents:
diff changeset
4446 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
551433a01cab initial coding
carl
parents:
diff changeset
4447 # Delete the old output file.
551433a01cab initial coding
carl
parents:
diff changeset
4448 $run $rm $output
551433a01cab initial coding
carl
parents:
diff changeset
4449 # Link the executable and exit
551433a01cab initial coding
carl
parents:
diff changeset
4450 $show "$link_command"
551433a01cab initial coding
carl
parents:
diff changeset
4451 $run eval "$link_command" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4452 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
4453 fi
551433a01cab initial coding
carl
parents:
diff changeset
4454
551433a01cab initial coding
carl
parents:
diff changeset
4455 if test "$hardcode_action" = relink; then
551433a01cab initial coding
carl
parents:
diff changeset
4456 # Fast installation is not supported
551433a01cab initial coding
carl
parents:
diff changeset
4457 link_command="$compile_var$compile_command$compile_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4458 relink_command="$finalize_var$finalize_command$finalize_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4459
551433a01cab initial coding
carl
parents:
diff changeset
4460 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4461 $echo "$modename: \`$output' will be relinked during installation" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4462 else
551433a01cab initial coding
carl
parents:
diff changeset
4463 if test "$fast_install" != no; then
551433a01cab initial coding
carl
parents:
diff changeset
4464 link_command="$finalize_var$compile_command$finalize_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4465 if test "$fast_install" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4466 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
551433a01cab initial coding
carl
parents:
diff changeset
4467 else
551433a01cab initial coding
carl
parents:
diff changeset
4468 # fast_install is set to needless
551433a01cab initial coding
carl
parents:
diff changeset
4469 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
4470 fi
551433a01cab initial coding
carl
parents:
diff changeset
4471 else
551433a01cab initial coding
carl
parents:
diff changeset
4472 link_command="$compile_var$compile_command$compile_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4473 relink_command="$finalize_var$finalize_command$finalize_rpath"
551433a01cab initial coding
carl
parents:
diff changeset
4474 fi
551433a01cab initial coding
carl
parents:
diff changeset
4475 fi
551433a01cab initial coding
carl
parents:
diff changeset
4476
551433a01cab initial coding
carl
parents:
diff changeset
4477 # Replace the output file specification.
551433a01cab initial coding
carl
parents:
diff changeset
4478 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
551433a01cab initial coding
carl
parents:
diff changeset
4479
551433a01cab initial coding
carl
parents:
diff changeset
4480 # Delete the old output files.
551433a01cab initial coding
carl
parents:
diff changeset
4481 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
551433a01cab initial coding
carl
parents:
diff changeset
4482
551433a01cab initial coding
carl
parents:
diff changeset
4483 $show "$link_command"
551433a01cab initial coding
carl
parents:
diff changeset
4484 $run eval "$link_command" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4485
551433a01cab initial coding
carl
parents:
diff changeset
4486 # Now create the wrapper script.
551433a01cab initial coding
carl
parents:
diff changeset
4487 $show "creating $output"
551433a01cab initial coding
carl
parents:
diff changeset
4488
551433a01cab initial coding
carl
parents:
diff changeset
4489 # Quote the relink command for shipping.
551433a01cab initial coding
carl
parents:
diff changeset
4490 if test -n "$relink_command"; then
551433a01cab initial coding
carl
parents:
diff changeset
4491 # Preserve any variables that may affect compiler behavior
551433a01cab initial coding
carl
parents:
diff changeset
4492 for var in $variables_saved_for_relink; do
551433a01cab initial coding
carl
parents:
diff changeset
4493 if eval test -z \"\${$var+set}\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4494 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
4495 elif eval var_value=\$$var; test -z "$var_value"; then
551433a01cab initial coding
carl
parents:
diff changeset
4496 relink_command="$var=; export $var; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
4497 else
551433a01cab initial coding
carl
parents:
diff changeset
4498 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
4499 relink_command="$var=\"$var_value\"; export $var; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
4500 fi
551433a01cab initial coding
carl
parents:
diff changeset
4501 done
551433a01cab initial coding
carl
parents:
diff changeset
4502 relink_command="(cd `pwd`; $relink_command)"
551433a01cab initial coding
carl
parents:
diff changeset
4503 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
4504 fi
551433a01cab initial coding
carl
parents:
diff changeset
4505
551433a01cab initial coding
carl
parents:
diff changeset
4506 # Quote $echo for shipping.
551433a01cab initial coding
carl
parents:
diff changeset
4507 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
551433a01cab initial coding
carl
parents:
diff changeset
4508 case $0 in
551433a01cab initial coding
carl
parents:
diff changeset
4509 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
551433a01cab initial coding
carl
parents:
diff changeset
4510 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
551433a01cab initial coding
carl
parents:
diff changeset
4511 esac
551433a01cab initial coding
carl
parents:
diff changeset
4512 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
4513 else
551433a01cab initial coding
carl
parents:
diff changeset
4514 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
4515 fi
551433a01cab initial coding
carl
parents:
diff changeset
4516
551433a01cab initial coding
carl
parents:
diff changeset
4517 # Only actually do things if our run command is non-null.
551433a01cab initial coding
carl
parents:
diff changeset
4518 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
4519 # win32 will think the script is a binary if it has
551433a01cab initial coding
carl
parents:
diff changeset
4520 # a .exe suffix, so we strip it off here.
551433a01cab initial coding
carl
parents:
diff changeset
4521 case $output in
551433a01cab initial coding
carl
parents:
diff changeset
4522 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
551433a01cab initial coding
carl
parents:
diff changeset
4523 esac
551433a01cab initial coding
carl
parents:
diff changeset
4524 # test for cygwin because mv fails w/o .exe extensions
551433a01cab initial coding
carl
parents:
diff changeset
4525 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4526 *cygwin*)
551433a01cab initial coding
carl
parents:
diff changeset
4527 exeext=.exe
551433a01cab initial coding
carl
parents:
diff changeset
4528 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
551433a01cab initial coding
carl
parents:
diff changeset
4529 *) exeext= ;;
551433a01cab initial coding
carl
parents:
diff changeset
4530 esac
551433a01cab initial coding
carl
parents:
diff changeset
4531 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4532 *cygwin* | *mingw* )
551433a01cab initial coding
carl
parents:
diff changeset
4533 cwrappersource=`$echo ${objdir}/lt-${output}.c`
551433a01cab initial coding
carl
parents:
diff changeset
4534 cwrapper=`$echo ${output}.exe`
551433a01cab initial coding
carl
parents:
diff changeset
4535 $rm $cwrappersource $cwrapper
551433a01cab initial coding
carl
parents:
diff changeset
4536 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
551433a01cab initial coding
carl
parents:
diff changeset
4537
551433a01cab initial coding
carl
parents:
diff changeset
4538 cat > $cwrappersource <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
4539
551433a01cab initial coding
carl
parents:
diff changeset
4540 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
551433a01cab initial coding
carl
parents:
diff changeset
4541 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
551433a01cab initial coding
carl
parents:
diff changeset
4542
551433a01cab initial coding
carl
parents:
diff changeset
4543 The $output program cannot be directly executed until all the libtool
551433a01cab initial coding
carl
parents:
diff changeset
4544 libraries that it depends on are installed.
551433a01cab initial coding
carl
parents:
diff changeset
4545
551433a01cab initial coding
carl
parents:
diff changeset
4546 This wrapper executable should never be moved out of the build directory.
551433a01cab initial coding
carl
parents:
diff changeset
4547 If it is, it will not operate correctly.
551433a01cab initial coding
carl
parents:
diff changeset
4548
551433a01cab initial coding
carl
parents:
diff changeset
4549 Currently, it simply execs the wrapper *script* "/bin/sh $output",
551433a01cab initial coding
carl
parents:
diff changeset
4550 but could eventually absorb all of the scripts functionality and
551433a01cab initial coding
carl
parents:
diff changeset
4551 exec $objdir/$outputname directly.
551433a01cab initial coding
carl
parents:
diff changeset
4552 */
551433a01cab initial coding
carl
parents:
diff changeset
4553 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4554 cat >> $cwrappersource<<"EOF"
551433a01cab initial coding
carl
parents:
diff changeset
4555 #include <stdio.h>
551433a01cab initial coding
carl
parents:
diff changeset
4556 #include <stdlib.h>
551433a01cab initial coding
carl
parents:
diff changeset
4557 #include <unistd.h>
551433a01cab initial coding
carl
parents:
diff changeset
4558 #include <malloc.h>
551433a01cab initial coding
carl
parents:
diff changeset
4559 #include <stdarg.h>
551433a01cab initial coding
carl
parents:
diff changeset
4560 #include <assert.h>
551433a01cab initial coding
carl
parents:
diff changeset
4561
551433a01cab initial coding
carl
parents:
diff changeset
4562 #if defined(PATH_MAX)
551433a01cab initial coding
carl
parents:
diff changeset
4563 # define LT_PATHMAX PATH_MAX
551433a01cab initial coding
carl
parents:
diff changeset
4564 #elif defined(MAXPATHLEN)
551433a01cab initial coding
carl
parents:
diff changeset
4565 # define LT_PATHMAX MAXPATHLEN
551433a01cab initial coding
carl
parents:
diff changeset
4566 #else
551433a01cab initial coding
carl
parents:
diff changeset
4567 # define LT_PATHMAX 1024
551433a01cab initial coding
carl
parents:
diff changeset
4568 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4569
551433a01cab initial coding
carl
parents:
diff changeset
4570 #ifndef DIR_SEPARATOR
551433a01cab initial coding
carl
parents:
diff changeset
4571 #define DIR_SEPARATOR '/'
551433a01cab initial coding
carl
parents:
diff changeset
4572 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4573
551433a01cab initial coding
carl
parents:
diff changeset
4574 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
551433a01cab initial coding
carl
parents:
diff changeset
4575 defined (__OS2__)
551433a01cab initial coding
carl
parents:
diff changeset
4576 #define HAVE_DOS_BASED_FILE_SYSTEM
551433a01cab initial coding
carl
parents:
diff changeset
4577 #ifndef DIR_SEPARATOR_2
551433a01cab initial coding
carl
parents:
diff changeset
4578 #define DIR_SEPARATOR_2 '\\'
551433a01cab initial coding
carl
parents:
diff changeset
4579 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4580 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4581
551433a01cab initial coding
carl
parents:
diff changeset
4582 #ifndef DIR_SEPARATOR_2
551433a01cab initial coding
carl
parents:
diff changeset
4583 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
551433a01cab initial coding
carl
parents:
diff changeset
4584 #else /* DIR_SEPARATOR_2 */
551433a01cab initial coding
carl
parents:
diff changeset
4585 # define IS_DIR_SEPARATOR(ch) \
551433a01cab initial coding
carl
parents:
diff changeset
4586 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
551433a01cab initial coding
carl
parents:
diff changeset
4587 #endif /* DIR_SEPARATOR_2 */
551433a01cab initial coding
carl
parents:
diff changeset
4588
551433a01cab initial coding
carl
parents:
diff changeset
4589 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
551433a01cab initial coding
carl
parents:
diff changeset
4590 #define XFREE(stale) do { \
551433a01cab initial coding
carl
parents:
diff changeset
4591 if (stale) { free ((void *) stale); stale = 0; } \
551433a01cab initial coding
carl
parents:
diff changeset
4592 } while (0)
551433a01cab initial coding
carl
parents:
diff changeset
4593
551433a01cab initial coding
carl
parents:
diff changeset
4594 const char *program_name = NULL;
551433a01cab initial coding
carl
parents:
diff changeset
4595
551433a01cab initial coding
carl
parents:
diff changeset
4596 void * xmalloc (size_t num);
551433a01cab initial coding
carl
parents:
diff changeset
4597 char * xstrdup (const char *string);
551433a01cab initial coding
carl
parents:
diff changeset
4598 char * basename (const char *name);
551433a01cab initial coding
carl
parents:
diff changeset
4599 char * fnqualify(const char *path);
551433a01cab initial coding
carl
parents:
diff changeset
4600 char * strendzap(char *str, const char *pat);
551433a01cab initial coding
carl
parents:
diff changeset
4601 void lt_fatal (const char *message, ...);
551433a01cab initial coding
carl
parents:
diff changeset
4602
551433a01cab initial coding
carl
parents:
diff changeset
4603 int
551433a01cab initial coding
carl
parents:
diff changeset
4604 main (int argc, char *argv[])
551433a01cab initial coding
carl
parents:
diff changeset
4605 {
551433a01cab initial coding
carl
parents:
diff changeset
4606 char **newargz;
551433a01cab initial coding
carl
parents:
diff changeset
4607 int i;
551433a01cab initial coding
carl
parents:
diff changeset
4608
551433a01cab initial coding
carl
parents:
diff changeset
4609 program_name = (char *) xstrdup ((char *) basename (argv[0]));
551433a01cab initial coding
carl
parents:
diff changeset
4610 newargz = XMALLOC(char *, argc+2);
551433a01cab initial coding
carl
parents:
diff changeset
4611 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4612
551433a01cab initial coding
carl
parents:
diff changeset
4613 cat >> $cwrappersource <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
4614 newargz[0] = "$SHELL";
551433a01cab initial coding
carl
parents:
diff changeset
4615 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4616
551433a01cab initial coding
carl
parents:
diff changeset
4617 cat >> $cwrappersource <<"EOF"
551433a01cab initial coding
carl
parents:
diff changeset
4618 newargz[1] = fnqualify(argv[0]);
551433a01cab initial coding
carl
parents:
diff changeset
4619 /* we know the script has the same name, without the .exe */
551433a01cab initial coding
carl
parents:
diff changeset
4620 /* so make sure newargz[1] doesn't end in .exe */
551433a01cab initial coding
carl
parents:
diff changeset
4621 strendzap(newargz[1],".exe");
551433a01cab initial coding
carl
parents:
diff changeset
4622 for (i = 1; i < argc; i++)
551433a01cab initial coding
carl
parents:
diff changeset
4623 newargz[i+1] = xstrdup(argv[i]);
551433a01cab initial coding
carl
parents:
diff changeset
4624 newargz[argc+1] = NULL;
551433a01cab initial coding
carl
parents:
diff changeset
4625 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4626
551433a01cab initial coding
carl
parents:
diff changeset
4627 cat >> $cwrappersource <<EOF
551433a01cab initial coding
carl
parents:
diff changeset
4628 execv("$SHELL",newargz);
551433a01cab initial coding
carl
parents:
diff changeset
4629 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4630
551433a01cab initial coding
carl
parents:
diff changeset
4631 cat >> $cwrappersource <<"EOF"
551433a01cab initial coding
carl
parents:
diff changeset
4632 }
551433a01cab initial coding
carl
parents:
diff changeset
4633
551433a01cab initial coding
carl
parents:
diff changeset
4634 void *
551433a01cab initial coding
carl
parents:
diff changeset
4635 xmalloc (size_t num)
551433a01cab initial coding
carl
parents:
diff changeset
4636 {
551433a01cab initial coding
carl
parents:
diff changeset
4637 void * p = (void *) malloc (num);
551433a01cab initial coding
carl
parents:
diff changeset
4638 if (!p)
551433a01cab initial coding
carl
parents:
diff changeset
4639 lt_fatal ("Memory exhausted");
551433a01cab initial coding
carl
parents:
diff changeset
4640
551433a01cab initial coding
carl
parents:
diff changeset
4641 return p;
551433a01cab initial coding
carl
parents:
diff changeset
4642 }
551433a01cab initial coding
carl
parents:
diff changeset
4643
551433a01cab initial coding
carl
parents:
diff changeset
4644 char *
551433a01cab initial coding
carl
parents:
diff changeset
4645 xstrdup (const char *string)
551433a01cab initial coding
carl
parents:
diff changeset
4646 {
551433a01cab initial coding
carl
parents:
diff changeset
4647 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
551433a01cab initial coding
carl
parents:
diff changeset
4648 ;
551433a01cab initial coding
carl
parents:
diff changeset
4649 }
551433a01cab initial coding
carl
parents:
diff changeset
4650
551433a01cab initial coding
carl
parents:
diff changeset
4651 char *
551433a01cab initial coding
carl
parents:
diff changeset
4652 basename (const char *name)
551433a01cab initial coding
carl
parents:
diff changeset
4653 {
551433a01cab initial coding
carl
parents:
diff changeset
4654 const char *base;
551433a01cab initial coding
carl
parents:
diff changeset
4655
551433a01cab initial coding
carl
parents:
diff changeset
4656 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
551433a01cab initial coding
carl
parents:
diff changeset
4657 /* Skip over the disk name in MSDOS pathnames. */
551433a01cab initial coding
carl
parents:
diff changeset
4658 if (isalpha (name[0]) && name[1] == ':')
551433a01cab initial coding
carl
parents:
diff changeset
4659 name += 2;
551433a01cab initial coding
carl
parents:
diff changeset
4660 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4661
551433a01cab initial coding
carl
parents:
diff changeset
4662 for (base = name; *name; name++)
551433a01cab initial coding
carl
parents:
diff changeset
4663 if (IS_DIR_SEPARATOR (*name))
551433a01cab initial coding
carl
parents:
diff changeset
4664 base = name + 1;
551433a01cab initial coding
carl
parents:
diff changeset
4665 return (char *) base;
551433a01cab initial coding
carl
parents:
diff changeset
4666 }
551433a01cab initial coding
carl
parents:
diff changeset
4667
551433a01cab initial coding
carl
parents:
diff changeset
4668 char *
551433a01cab initial coding
carl
parents:
diff changeset
4669 fnqualify(const char *path)
551433a01cab initial coding
carl
parents:
diff changeset
4670 {
551433a01cab initial coding
carl
parents:
diff changeset
4671 size_t size;
551433a01cab initial coding
carl
parents:
diff changeset
4672 char *p;
551433a01cab initial coding
carl
parents:
diff changeset
4673 char tmp[LT_PATHMAX + 1];
551433a01cab initial coding
carl
parents:
diff changeset
4674
551433a01cab initial coding
carl
parents:
diff changeset
4675 assert(path != NULL);
551433a01cab initial coding
carl
parents:
diff changeset
4676
551433a01cab initial coding
carl
parents:
diff changeset
4677 /* Is it qualified already? */
551433a01cab initial coding
carl
parents:
diff changeset
4678 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
551433a01cab initial coding
carl
parents:
diff changeset
4679 if (isalpha (path[0]) && path[1] == ':')
551433a01cab initial coding
carl
parents:
diff changeset
4680 return xstrdup (path);
551433a01cab initial coding
carl
parents:
diff changeset
4681 #endif
551433a01cab initial coding
carl
parents:
diff changeset
4682 if (IS_DIR_SEPARATOR (path[0]))
551433a01cab initial coding
carl
parents:
diff changeset
4683 return xstrdup (path);
551433a01cab initial coding
carl
parents:
diff changeset
4684
551433a01cab initial coding
carl
parents:
diff changeset
4685 /* prepend the current directory */
551433a01cab initial coding
carl
parents:
diff changeset
4686 /* doesn't handle '~' */
551433a01cab initial coding
carl
parents:
diff changeset
4687 if (getcwd (tmp, LT_PATHMAX) == NULL)
551433a01cab initial coding
carl
parents:
diff changeset
4688 lt_fatal ("getcwd failed");
551433a01cab initial coding
carl
parents:
diff changeset
4689 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
551433a01cab initial coding
carl
parents:
diff changeset
4690 p = XMALLOC(char, size);
551433a01cab initial coding
carl
parents:
diff changeset
4691 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
551433a01cab initial coding
carl
parents:
diff changeset
4692 return p;
551433a01cab initial coding
carl
parents:
diff changeset
4693 }
551433a01cab initial coding
carl
parents:
diff changeset
4694
551433a01cab initial coding
carl
parents:
diff changeset
4695 char *
551433a01cab initial coding
carl
parents:
diff changeset
4696 strendzap(char *str, const char *pat)
551433a01cab initial coding
carl
parents:
diff changeset
4697 {
551433a01cab initial coding
carl
parents:
diff changeset
4698 size_t len, patlen;
551433a01cab initial coding
carl
parents:
diff changeset
4699
551433a01cab initial coding
carl
parents:
diff changeset
4700 assert(str != NULL);
551433a01cab initial coding
carl
parents:
diff changeset
4701 assert(pat != NULL);
551433a01cab initial coding
carl
parents:
diff changeset
4702
551433a01cab initial coding
carl
parents:
diff changeset
4703 len = strlen(str);
551433a01cab initial coding
carl
parents:
diff changeset
4704 patlen = strlen(pat);
551433a01cab initial coding
carl
parents:
diff changeset
4705
551433a01cab initial coding
carl
parents:
diff changeset
4706 if (patlen <= len)
551433a01cab initial coding
carl
parents:
diff changeset
4707 {
551433a01cab initial coding
carl
parents:
diff changeset
4708 str += len - patlen;
551433a01cab initial coding
carl
parents:
diff changeset
4709 if (strcmp(str, pat) == 0)
551433a01cab initial coding
carl
parents:
diff changeset
4710 *str = '\0';
551433a01cab initial coding
carl
parents:
diff changeset
4711 }
551433a01cab initial coding
carl
parents:
diff changeset
4712 return str;
551433a01cab initial coding
carl
parents:
diff changeset
4713 }
551433a01cab initial coding
carl
parents:
diff changeset
4714
551433a01cab initial coding
carl
parents:
diff changeset
4715 static void
551433a01cab initial coding
carl
parents:
diff changeset
4716 lt_error_core (int exit_status, const char * mode,
551433a01cab initial coding
carl
parents:
diff changeset
4717 const char * message, va_list ap)
551433a01cab initial coding
carl
parents:
diff changeset
4718 {
551433a01cab initial coding
carl
parents:
diff changeset
4719 fprintf (stderr, "%s: %s: ", program_name, mode);
551433a01cab initial coding
carl
parents:
diff changeset
4720 vfprintf (stderr, message, ap);
551433a01cab initial coding
carl
parents:
diff changeset
4721 fprintf (stderr, ".\n");
551433a01cab initial coding
carl
parents:
diff changeset
4722
551433a01cab initial coding
carl
parents:
diff changeset
4723 if (exit_status >= 0)
551433a01cab initial coding
carl
parents:
diff changeset
4724 exit (exit_status);
551433a01cab initial coding
carl
parents:
diff changeset
4725 }
551433a01cab initial coding
carl
parents:
diff changeset
4726
551433a01cab initial coding
carl
parents:
diff changeset
4727 void
551433a01cab initial coding
carl
parents:
diff changeset
4728 lt_fatal (const char *message, ...)
551433a01cab initial coding
carl
parents:
diff changeset
4729 {
551433a01cab initial coding
carl
parents:
diff changeset
4730 va_list ap;
551433a01cab initial coding
carl
parents:
diff changeset
4731 va_start (ap, message);
551433a01cab initial coding
carl
parents:
diff changeset
4732 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
551433a01cab initial coding
carl
parents:
diff changeset
4733 va_end (ap);
551433a01cab initial coding
carl
parents:
diff changeset
4734 }
551433a01cab initial coding
carl
parents:
diff changeset
4735 EOF
551433a01cab initial coding
carl
parents:
diff changeset
4736 # we should really use a build-platform specific compiler
551433a01cab initial coding
carl
parents:
diff changeset
4737 # here, but OTOH, the wrappers (shell script and this C one)
551433a01cab initial coding
carl
parents:
diff changeset
4738 # are only useful if you want to execute the "real" binary.
551433a01cab initial coding
carl
parents:
diff changeset
4739 # Since the "real" binary is built for $host, then this
551433a01cab initial coding
carl
parents:
diff changeset
4740 # wrapper might as well be built for $host, too.
551433a01cab initial coding
carl
parents:
diff changeset
4741 $run $LTCC -s -o $cwrapper $cwrappersource
551433a01cab initial coding
carl
parents:
diff changeset
4742 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4743 esac
551433a01cab initial coding
carl
parents:
diff changeset
4744 $rm $output
551433a01cab initial coding
carl
parents:
diff changeset
4745 trap "$rm $output; exit 1" 1 2 15
551433a01cab initial coding
carl
parents:
diff changeset
4746
551433a01cab initial coding
carl
parents:
diff changeset
4747 $echo > $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4748 #! $SHELL
551433a01cab initial coding
carl
parents:
diff changeset
4749
551433a01cab initial coding
carl
parents:
diff changeset
4750 # $output - temporary wrapper script for $objdir/$outputname
551433a01cab initial coding
carl
parents:
diff changeset
4751 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
551433a01cab initial coding
carl
parents:
diff changeset
4752 #
551433a01cab initial coding
carl
parents:
diff changeset
4753 # The $output program cannot be directly executed until all the libtool
551433a01cab initial coding
carl
parents:
diff changeset
4754 # libraries that it depends on are installed.
551433a01cab initial coding
carl
parents:
diff changeset
4755 #
551433a01cab initial coding
carl
parents:
diff changeset
4756 # This wrapper script should never be moved out of the build directory.
551433a01cab initial coding
carl
parents:
diff changeset
4757 # If it is, it will not operate correctly.
551433a01cab initial coding
carl
parents:
diff changeset
4758
551433a01cab initial coding
carl
parents:
diff changeset
4759 # Sed substitution that helps us do robust quoting. It backslashifies
551433a01cab initial coding
carl
parents:
diff changeset
4760 # metacharacters that are still active within double-quoted strings.
551433a01cab initial coding
carl
parents:
diff changeset
4761 Xsed='${SED} -e 1s/^X//'
551433a01cab initial coding
carl
parents:
diff changeset
4762 sed_quote_subst='$sed_quote_subst'
551433a01cab initial coding
carl
parents:
diff changeset
4763
551433a01cab initial coding
carl
parents:
diff changeset
4764 # The HP-UX ksh and POSIX shell print the target directory to stdout
551433a01cab initial coding
carl
parents:
diff changeset
4765 # if CDPATH is set.
551433a01cab initial coding
carl
parents:
diff changeset
4766 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
551433a01cab initial coding
carl
parents:
diff changeset
4767
551433a01cab initial coding
carl
parents:
diff changeset
4768 relink_command=\"$relink_command\"
551433a01cab initial coding
carl
parents:
diff changeset
4769
551433a01cab initial coding
carl
parents:
diff changeset
4770 # This environment variable determines our operation mode.
551433a01cab initial coding
carl
parents:
diff changeset
4771 if test \"\$libtool_install_magic\" = \"$magic\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4772 # install mode needs the following variable:
551433a01cab initial coding
carl
parents:
diff changeset
4773 notinst_deplibs='$notinst_deplibs'
551433a01cab initial coding
carl
parents:
diff changeset
4774 else
551433a01cab initial coding
carl
parents:
diff changeset
4775 # When we are sourced in execute mode, \$file and \$echo are already set.
551433a01cab initial coding
carl
parents:
diff changeset
4776 if test \"\$libtool_execute_magic\" != \"$magic\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4777 echo=\"$qecho\"
551433a01cab initial coding
carl
parents:
diff changeset
4778 file=\"\$0\"
551433a01cab initial coding
carl
parents:
diff changeset
4779 # Make sure echo works.
551433a01cab initial coding
carl
parents:
diff changeset
4780 if test \"X\$1\" = X--no-reexec; then
551433a01cab initial coding
carl
parents:
diff changeset
4781 # Discard the --no-reexec flag, and continue.
551433a01cab initial coding
carl
parents:
diff changeset
4782 shift
551433a01cab initial coding
carl
parents:
diff changeset
4783 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
551433a01cab initial coding
carl
parents:
diff changeset
4784 # Yippee, \$echo works!
551433a01cab initial coding
carl
parents:
diff changeset
4785 :
551433a01cab initial coding
carl
parents:
diff changeset
4786 else
551433a01cab initial coding
carl
parents:
diff changeset
4787 # Restart under the correct shell, and then maybe \$echo will work.
551433a01cab initial coding
carl
parents:
diff changeset
4788 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
551433a01cab initial coding
carl
parents:
diff changeset
4789 fi
551433a01cab initial coding
carl
parents:
diff changeset
4790 fi\
551433a01cab initial coding
carl
parents:
diff changeset
4791 "
551433a01cab initial coding
carl
parents:
diff changeset
4792 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4793
551433a01cab initial coding
carl
parents:
diff changeset
4794 # Find the directory that this script lives in.
551433a01cab initial coding
carl
parents:
diff changeset
4795 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
551433a01cab initial coding
carl
parents:
diff changeset
4796 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
551433a01cab initial coding
carl
parents:
diff changeset
4797
551433a01cab initial coding
carl
parents:
diff changeset
4798 # Follow symbolic links until we get to the real thisdir.
551433a01cab initial coding
carl
parents:
diff changeset
4799 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
551433a01cab initial coding
carl
parents:
diff changeset
4800 while test -n \"\$file\"; do
551433a01cab initial coding
carl
parents:
diff changeset
4801 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
551433a01cab initial coding
carl
parents:
diff changeset
4802
551433a01cab initial coding
carl
parents:
diff changeset
4803 # If there was a directory component, then change thisdir.
551433a01cab initial coding
carl
parents:
diff changeset
4804 if test \"x\$destdir\" != \"x\$file\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4805 case \"\$destdir\" in
551433a01cab initial coding
carl
parents:
diff changeset
4806 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4807 *) thisdir=\"\$thisdir/\$destdir\" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4808 esac
551433a01cab initial coding
carl
parents:
diff changeset
4809 fi
551433a01cab initial coding
carl
parents:
diff changeset
4810
551433a01cab initial coding
carl
parents:
diff changeset
4811 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
551433a01cab initial coding
carl
parents:
diff changeset
4812 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
551433a01cab initial coding
carl
parents:
diff changeset
4813 done
551433a01cab initial coding
carl
parents:
diff changeset
4814
551433a01cab initial coding
carl
parents:
diff changeset
4815 # Try to get the absolute directory name.
551433a01cab initial coding
carl
parents:
diff changeset
4816 absdir=\`cd \"\$thisdir\" && pwd\`
551433a01cab initial coding
carl
parents:
diff changeset
4817 test -n \"\$absdir\" && thisdir=\"\$absdir\"
551433a01cab initial coding
carl
parents:
diff changeset
4818 "
551433a01cab initial coding
carl
parents:
diff changeset
4819
551433a01cab initial coding
carl
parents:
diff changeset
4820 if test "$fast_install" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
4821 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4822 program=lt-'$outputname'$exeext
551433a01cab initial coding
carl
parents:
diff changeset
4823 progdir=\"\$thisdir/$objdir\"
551433a01cab initial coding
carl
parents:
diff changeset
4824
551433a01cab initial coding
carl
parents:
diff changeset
4825 if test ! -f \"\$progdir/\$program\" || \\
551433a01cab initial coding
carl
parents:
diff changeset
4826 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
551433a01cab initial coding
carl
parents:
diff changeset
4827 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
551433a01cab initial coding
carl
parents:
diff changeset
4828
551433a01cab initial coding
carl
parents:
diff changeset
4829 file=\"\$\$-\$program\"
551433a01cab initial coding
carl
parents:
diff changeset
4830
551433a01cab initial coding
carl
parents:
diff changeset
4831 if test ! -d \"\$progdir\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4832 $mkdir \"\$progdir\"
551433a01cab initial coding
carl
parents:
diff changeset
4833 else
551433a01cab initial coding
carl
parents:
diff changeset
4834 $rm \"\$progdir/\$file\"
551433a01cab initial coding
carl
parents:
diff changeset
4835 fi"
551433a01cab initial coding
carl
parents:
diff changeset
4836
551433a01cab initial coding
carl
parents:
diff changeset
4837 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4838
551433a01cab initial coding
carl
parents:
diff changeset
4839 # relink executable if necessary
551433a01cab initial coding
carl
parents:
diff changeset
4840 if test -n \"\$relink_command\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4841 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
551433a01cab initial coding
carl
parents:
diff changeset
4842 else
551433a01cab initial coding
carl
parents:
diff changeset
4843 $echo \"\$relink_command_output\" >&2
551433a01cab initial coding
carl
parents:
diff changeset
4844 $rm \"\$progdir/\$file\"
551433a01cab initial coding
carl
parents:
diff changeset
4845 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
4846 fi
551433a01cab initial coding
carl
parents:
diff changeset
4847 fi
551433a01cab initial coding
carl
parents:
diff changeset
4848
551433a01cab initial coding
carl
parents:
diff changeset
4849 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
551433a01cab initial coding
carl
parents:
diff changeset
4850 { $rm \"\$progdir/\$program\";
551433a01cab initial coding
carl
parents:
diff changeset
4851 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
551433a01cab initial coding
carl
parents:
diff changeset
4852 $rm \"\$progdir/\$file\"
551433a01cab initial coding
carl
parents:
diff changeset
4853 fi"
551433a01cab initial coding
carl
parents:
diff changeset
4854 else
551433a01cab initial coding
carl
parents:
diff changeset
4855 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4856 program='$outputname'
551433a01cab initial coding
carl
parents:
diff changeset
4857 progdir=\"\$thisdir/$objdir\"
551433a01cab initial coding
carl
parents:
diff changeset
4858 "
551433a01cab initial coding
carl
parents:
diff changeset
4859 fi
551433a01cab initial coding
carl
parents:
diff changeset
4860
551433a01cab initial coding
carl
parents:
diff changeset
4861 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4862
551433a01cab initial coding
carl
parents:
diff changeset
4863 if test -f \"\$progdir/\$program\"; then"
551433a01cab initial coding
carl
parents:
diff changeset
4864
551433a01cab initial coding
carl
parents:
diff changeset
4865 # Export our shlibpath_var if we have one.
551433a01cab initial coding
carl
parents:
diff changeset
4866 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4867 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4868 # Add our own library path to $shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
4869 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
551433a01cab initial coding
carl
parents:
diff changeset
4870
551433a01cab initial coding
carl
parents:
diff changeset
4871 # Some systems cannot cope with colon-terminated $shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
4872 # The second colon is a workaround for a bug in BeOS R4 sed
551433a01cab initial coding
carl
parents:
diff changeset
4873 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
551433a01cab initial coding
carl
parents:
diff changeset
4874
551433a01cab initial coding
carl
parents:
diff changeset
4875 export $shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
4876 "
551433a01cab initial coding
carl
parents:
diff changeset
4877 fi
551433a01cab initial coding
carl
parents:
diff changeset
4878
551433a01cab initial coding
carl
parents:
diff changeset
4879 # fixup the dll searchpath if we need to.
551433a01cab initial coding
carl
parents:
diff changeset
4880 if test -n "$dllsearchpath"; then
551433a01cab initial coding
carl
parents:
diff changeset
4881 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4882 # Add the dll search path components to the executable PATH
551433a01cab initial coding
carl
parents:
diff changeset
4883 PATH=$dllsearchpath:\$PATH
551433a01cab initial coding
carl
parents:
diff changeset
4884 "
551433a01cab initial coding
carl
parents:
diff changeset
4885 fi
551433a01cab initial coding
carl
parents:
diff changeset
4886
551433a01cab initial coding
carl
parents:
diff changeset
4887 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4888 if test \"\$libtool_execute_magic\" != \"$magic\"; then
551433a01cab initial coding
carl
parents:
diff changeset
4889 # Run the actual program with our arguments.
551433a01cab initial coding
carl
parents:
diff changeset
4890 "
551433a01cab initial coding
carl
parents:
diff changeset
4891 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
4892 # Backslashes separate directories on plain windows
551433a01cab initial coding
carl
parents:
diff changeset
4893 *-*-mingw | *-*-os2*)
551433a01cab initial coding
carl
parents:
diff changeset
4894 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4895 exec \$progdir\\\\\$program \${1+\"\$@\"}
551433a01cab initial coding
carl
parents:
diff changeset
4896 "
551433a01cab initial coding
carl
parents:
diff changeset
4897 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4898
551433a01cab initial coding
carl
parents:
diff changeset
4899 *)
551433a01cab initial coding
carl
parents:
diff changeset
4900 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4901 exec \$progdir/\$program \${1+\"\$@\"}
551433a01cab initial coding
carl
parents:
diff changeset
4902 "
551433a01cab initial coding
carl
parents:
diff changeset
4903 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4904 esac
551433a01cab initial coding
carl
parents:
diff changeset
4905 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
4906 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
551433a01cab initial coding
carl
parents:
diff changeset
4907 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
4908 fi
551433a01cab initial coding
carl
parents:
diff changeset
4909 else
551433a01cab initial coding
carl
parents:
diff changeset
4910 # The program doesn't exist.
551433a01cab initial coding
carl
parents:
diff changeset
4911 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4912 \$echo \"This script is just a wrapper for \$program.\" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4913 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4914 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
4915 fi
551433a01cab initial coding
carl
parents:
diff changeset
4916 fi\
551433a01cab initial coding
carl
parents:
diff changeset
4917 "
551433a01cab initial coding
carl
parents:
diff changeset
4918 chmod +x $output
551433a01cab initial coding
carl
parents:
diff changeset
4919 fi
551433a01cab initial coding
carl
parents:
diff changeset
4920 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
4921 ;;
551433a01cab initial coding
carl
parents:
diff changeset
4922 esac
551433a01cab initial coding
carl
parents:
diff changeset
4923
551433a01cab initial coding
carl
parents:
diff changeset
4924 # See if we need to build an old-fashioned archive.
551433a01cab initial coding
carl
parents:
diff changeset
4925 for oldlib in $oldlibs; do
551433a01cab initial coding
carl
parents:
diff changeset
4926
551433a01cab initial coding
carl
parents:
diff changeset
4927 if test "$build_libtool_libs" = convenience; then
551433a01cab initial coding
carl
parents:
diff changeset
4928 oldobjs="$libobjs_save"
551433a01cab initial coding
carl
parents:
diff changeset
4929 addlibs="$convenience"
551433a01cab initial coding
carl
parents:
diff changeset
4930 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
4931 else
551433a01cab initial coding
carl
parents:
diff changeset
4932 if test "$build_libtool_libs" = module; then
551433a01cab initial coding
carl
parents:
diff changeset
4933 oldobjs="$libobjs_save"
551433a01cab initial coding
carl
parents:
diff changeset
4934 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
4935 else
551433a01cab initial coding
carl
parents:
diff changeset
4936 oldobjs="$old_deplibs $non_pic_objects"
551433a01cab initial coding
carl
parents:
diff changeset
4937 fi
551433a01cab initial coding
carl
parents:
diff changeset
4938 addlibs="$old_convenience"
551433a01cab initial coding
carl
parents:
diff changeset
4939 fi
551433a01cab initial coding
carl
parents:
diff changeset
4940
551433a01cab initial coding
carl
parents:
diff changeset
4941 if test -n "$addlibs"; then
551433a01cab initial coding
carl
parents:
diff changeset
4942 gentop="$output_objdir/${outputname}x"
551433a01cab initial coding
carl
parents:
diff changeset
4943 $show "${rm}r $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4944 $run ${rm}r "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4945 $show "$mkdir $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4946 $run $mkdir "$gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4947 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
4948 if test "$status" -ne 0 && test ! -d "$gentop"; then
551433a01cab initial coding
carl
parents:
diff changeset
4949 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
4950 fi
551433a01cab initial coding
carl
parents:
diff changeset
4951 generated="$generated $gentop"
551433a01cab initial coding
carl
parents:
diff changeset
4952
551433a01cab initial coding
carl
parents:
diff changeset
4953 # Add in members from convenience archives.
551433a01cab initial coding
carl
parents:
diff changeset
4954 for xlib in $addlibs; do
551433a01cab initial coding
carl
parents:
diff changeset
4955 # Extract the objects.
551433a01cab initial coding
carl
parents:
diff changeset
4956 case $xlib in
551433a01cab initial coding
carl
parents:
diff changeset
4957 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4958 *) xabs=`pwd`"/$xlib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
4959 esac
551433a01cab initial coding
carl
parents:
diff changeset
4960 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
4961 xdir="$gentop/$xlib"
551433a01cab initial coding
carl
parents:
diff changeset
4962
551433a01cab initial coding
carl
parents:
diff changeset
4963 $show "${rm}r $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
4964 $run ${rm}r "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
4965 $show "$mkdir $xdir"
551433a01cab initial coding
carl
parents:
diff changeset
4966 $run $mkdir "$xdir"
551433a01cab initial coding
carl
parents:
diff changeset
4967 status=$?
551433a01cab initial coding
carl
parents:
diff changeset
4968 if test "$status" -ne 0 && test ! -d "$xdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
4969 exit $status
551433a01cab initial coding
carl
parents:
diff changeset
4970 fi
551433a01cab initial coding
carl
parents:
diff changeset
4971 # We will extract separately just the conflicting names and we will no
551433a01cab initial coding
carl
parents:
diff changeset
4972 # longer touch any unique names. It is faster to leave these extract
551433a01cab initial coding
carl
parents:
diff changeset
4973 # automatically by $AR in one run.
551433a01cab initial coding
carl
parents:
diff changeset
4974 $show "(cd $xdir && $AR x $xabs)"
551433a01cab initial coding
carl
parents:
diff changeset
4975 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4976 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
551433a01cab initial coding
carl
parents:
diff changeset
4977 :
551433a01cab initial coding
carl
parents:
diff changeset
4978 else
551433a01cab initial coding
carl
parents:
diff changeset
4979 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4980 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
4981 $AR t "$xabs" | sort | uniq -cd | while read -r count name
551433a01cab initial coding
carl
parents:
diff changeset
4982 do
551433a01cab initial coding
carl
parents:
diff changeset
4983 i=1
551433a01cab initial coding
carl
parents:
diff changeset
4984 while test "$i" -le "$count"
551433a01cab initial coding
carl
parents:
diff changeset
4985 do
551433a01cab initial coding
carl
parents:
diff changeset
4986 # Put our $i before any first dot (extension)
551433a01cab initial coding
carl
parents:
diff changeset
4987 # Never overwrite any file
551433a01cab initial coding
carl
parents:
diff changeset
4988 name_to="$name"
551433a01cab initial coding
carl
parents:
diff changeset
4989 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
551433a01cab initial coding
carl
parents:
diff changeset
4990 do
551433a01cab initial coding
carl
parents:
diff changeset
4991 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
551433a01cab initial coding
carl
parents:
diff changeset
4992 done
551433a01cab initial coding
carl
parents:
diff changeset
4993 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
551433a01cab initial coding
carl
parents:
diff changeset
4994 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
4995 i=`expr $i + 1`
551433a01cab initial coding
carl
parents:
diff changeset
4996 done
551433a01cab initial coding
carl
parents:
diff changeset
4997 done
551433a01cab initial coding
carl
parents:
diff changeset
4998 fi
551433a01cab initial coding
carl
parents:
diff changeset
4999
551433a01cab initial coding
carl
parents:
diff changeset
5000 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
551433a01cab initial coding
carl
parents:
diff changeset
5001 done
551433a01cab initial coding
carl
parents:
diff changeset
5002 fi
551433a01cab initial coding
carl
parents:
diff changeset
5003
551433a01cab initial coding
carl
parents:
diff changeset
5004 compiler_flags="$compiler_flags $add_flags"
551433a01cab initial coding
carl
parents:
diff changeset
5005
551433a01cab initial coding
carl
parents:
diff changeset
5006 # Do each command in the archive commands.
551433a01cab initial coding
carl
parents:
diff changeset
5007 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
5008 eval cmds=\"$old_archive_from_new_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5009 else
551433a01cab initial coding
carl
parents:
diff changeset
5010 eval cmds=\"$old_archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5011
551433a01cab initial coding
carl
parents:
diff changeset
5012 if len=`expr "X$cmds" : ".*"` &&
551433a01cab initial coding
carl
parents:
diff changeset
5013 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
551433a01cab initial coding
carl
parents:
diff changeset
5014 :
551433a01cab initial coding
carl
parents:
diff changeset
5015 else
551433a01cab initial coding
carl
parents:
diff changeset
5016 # the command line is too long to link in one step, link in parts
551433a01cab initial coding
carl
parents:
diff changeset
5017 $echo "using piecewise archive linking..."
551433a01cab initial coding
carl
parents:
diff changeset
5018 save_RANLIB=$RANLIB
551433a01cab initial coding
carl
parents:
diff changeset
5019 RANLIB=:
551433a01cab initial coding
carl
parents:
diff changeset
5020 objlist=
551433a01cab initial coding
carl
parents:
diff changeset
5021 concat_cmds=
551433a01cab initial coding
carl
parents:
diff changeset
5022 save_oldobjs=$oldobjs
551433a01cab initial coding
carl
parents:
diff changeset
5023 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
551433a01cab initial coding
carl
parents:
diff changeset
5024 # encoded into archives. This makes 'ar r' malfunction in
551433a01cab initial coding
carl
parents:
diff changeset
5025 # this piecewise linking case whenever conflicting object
551433a01cab initial coding
carl
parents:
diff changeset
5026 # names appear in distinct ar calls; check, warn and compensate.
551433a01cab initial coding
carl
parents:
diff changeset
5027 if (for obj in $save_oldobjs
551433a01cab initial coding
carl
parents:
diff changeset
5028 do
551433a01cab initial coding
carl
parents:
diff changeset
5029 $echo "X$obj" | $Xsed -e 's%^.*/%%'
551433a01cab initial coding
carl
parents:
diff changeset
5030 done | sort | sort -uc >/dev/null 2>&1); then
551433a01cab initial coding
carl
parents:
diff changeset
5031 :
551433a01cab initial coding
carl
parents:
diff changeset
5032 else
551433a01cab initial coding
carl
parents:
diff changeset
5033 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5034 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5035 AR_FLAGS=cq
551433a01cab initial coding
carl
parents:
diff changeset
5036 fi
551433a01cab initial coding
carl
parents:
diff changeset
5037 # Is there a better way of finding the last object in the list?
551433a01cab initial coding
carl
parents:
diff changeset
5038 for obj in $save_oldobjs
551433a01cab initial coding
carl
parents:
diff changeset
5039 do
551433a01cab initial coding
carl
parents:
diff changeset
5040 last_oldobj=$obj
551433a01cab initial coding
carl
parents:
diff changeset
5041 done
551433a01cab initial coding
carl
parents:
diff changeset
5042 for obj in $save_oldobjs
551433a01cab initial coding
carl
parents:
diff changeset
5043 do
551433a01cab initial coding
carl
parents:
diff changeset
5044 oldobjs="$objlist $obj"
551433a01cab initial coding
carl
parents:
diff changeset
5045 objlist="$objlist $obj"
551433a01cab initial coding
carl
parents:
diff changeset
5046 eval test_cmds=\"$old_archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5047 if len=`expr "X$test_cmds" : ".*"` &&
551433a01cab initial coding
carl
parents:
diff changeset
5048 test "$len" -le "$max_cmd_len"; then
551433a01cab initial coding
carl
parents:
diff changeset
5049 :
551433a01cab initial coding
carl
parents:
diff changeset
5050 else
551433a01cab initial coding
carl
parents:
diff changeset
5051 # the above command should be used before it gets too long
551433a01cab initial coding
carl
parents:
diff changeset
5052 oldobjs=$objlist
551433a01cab initial coding
carl
parents:
diff changeset
5053 if test "$obj" = "$last_oldobj" ; then
551433a01cab initial coding
carl
parents:
diff changeset
5054 RANLIB=$save_RANLIB
551433a01cab initial coding
carl
parents:
diff changeset
5055 fi
551433a01cab initial coding
carl
parents:
diff changeset
5056 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
551433a01cab initial coding
carl
parents:
diff changeset
5057 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5058 objlist=
551433a01cab initial coding
carl
parents:
diff changeset
5059 fi
551433a01cab initial coding
carl
parents:
diff changeset
5060 done
551433a01cab initial coding
carl
parents:
diff changeset
5061 RANLIB=$save_RANLIB
551433a01cab initial coding
carl
parents:
diff changeset
5062 oldobjs=$objlist
551433a01cab initial coding
carl
parents:
diff changeset
5063 if test "X$oldobjs" = "X" ; then
551433a01cab initial coding
carl
parents:
diff changeset
5064 eval cmds=\"\$concat_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5065 else
551433a01cab initial coding
carl
parents:
diff changeset
5066 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5067 fi
551433a01cab initial coding
carl
parents:
diff changeset
5068 fi
551433a01cab initial coding
carl
parents:
diff changeset
5069 fi
551433a01cab initial coding
carl
parents:
diff changeset
5070 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
5071 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
5072 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5073 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
5074 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5075 done
551433a01cab initial coding
carl
parents:
diff changeset
5076 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5077 done
551433a01cab initial coding
carl
parents:
diff changeset
5078
551433a01cab initial coding
carl
parents:
diff changeset
5079 if test -n "$generated"; then
551433a01cab initial coding
carl
parents:
diff changeset
5080 $show "${rm}r$generated"
551433a01cab initial coding
carl
parents:
diff changeset
5081 $run ${rm}r$generated
551433a01cab initial coding
carl
parents:
diff changeset
5082 fi
551433a01cab initial coding
carl
parents:
diff changeset
5083
551433a01cab initial coding
carl
parents:
diff changeset
5084 # Now create the libtool archive.
551433a01cab initial coding
carl
parents:
diff changeset
5085 case $output in
551433a01cab initial coding
carl
parents:
diff changeset
5086 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
5087 old_library=
551433a01cab initial coding
carl
parents:
diff changeset
5088 test "$build_old_libs" = yes && old_library="$libname.$libext"
551433a01cab initial coding
carl
parents:
diff changeset
5089 $show "creating $output"
551433a01cab initial coding
carl
parents:
diff changeset
5090
551433a01cab initial coding
carl
parents:
diff changeset
5091 # Preserve any variables that may affect compiler behavior
551433a01cab initial coding
carl
parents:
diff changeset
5092 for var in $variables_saved_for_relink; do
551433a01cab initial coding
carl
parents:
diff changeset
5093 if eval test -z \"\${$var+set}\"; then
551433a01cab initial coding
carl
parents:
diff changeset
5094 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
5095 elif eval var_value=\$$var; test -z "$var_value"; then
551433a01cab initial coding
carl
parents:
diff changeset
5096 relink_command="$var=; export $var; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
5097 else
551433a01cab initial coding
carl
parents:
diff changeset
5098 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5099 relink_command="$var=\"$var_value\"; export $var; $relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
5100 fi
551433a01cab initial coding
carl
parents:
diff changeset
5101 done
551433a01cab initial coding
carl
parents:
diff changeset
5102 # Quote the link command for shipping.
551433a01cab initial coding
carl
parents:
diff changeset
5103 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
551433a01cab initial coding
carl
parents:
diff changeset
5104 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5105 if test "$hardcode_automatic" = yes ; then
551433a01cab initial coding
carl
parents:
diff changeset
5106 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
5107 fi
551433a01cab initial coding
carl
parents:
diff changeset
5108 # Only create the output if not a dry run.
551433a01cab initial coding
carl
parents:
diff changeset
5109 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
5110 for installed in no yes; do
551433a01cab initial coding
carl
parents:
diff changeset
5111 if test "$installed" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
5112 if test -z "$install_libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5113 break
551433a01cab initial coding
carl
parents:
diff changeset
5114 fi
551433a01cab initial coding
carl
parents:
diff changeset
5115 output="$output_objdir/$outputname"i
551433a01cab initial coding
carl
parents:
diff changeset
5116 # Replace all uninstalled libtool libraries with the installed ones
551433a01cab initial coding
carl
parents:
diff changeset
5117 newdependency_libs=
551433a01cab initial coding
carl
parents:
diff changeset
5118 for deplib in $dependency_libs; do
551433a01cab initial coding
carl
parents:
diff changeset
5119 case $deplib in
551433a01cab initial coding
carl
parents:
diff changeset
5120 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
5121 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5122 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
551433a01cab initial coding
carl
parents:
diff changeset
5123 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5124 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5125 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5126 fi
551433a01cab initial coding
carl
parents:
diff changeset
5127 newdependency_libs="$newdependency_libs $libdir/$name"
551433a01cab initial coding
carl
parents:
diff changeset
5128 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5129 *) newdependency_libs="$newdependency_libs $deplib" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5130 esac
551433a01cab initial coding
carl
parents:
diff changeset
5131 done
551433a01cab initial coding
carl
parents:
diff changeset
5132 dependency_libs="$newdependency_libs"
551433a01cab initial coding
carl
parents:
diff changeset
5133 newdlfiles=
551433a01cab initial coding
carl
parents:
diff changeset
5134 for lib in $dlfiles; do
551433a01cab initial coding
carl
parents:
diff changeset
5135 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5136 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
551433a01cab initial coding
carl
parents:
diff changeset
5137 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5138 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5139 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5140 fi
551433a01cab initial coding
carl
parents:
diff changeset
5141 newdlfiles="$newdlfiles $libdir/$name"
551433a01cab initial coding
carl
parents:
diff changeset
5142 done
551433a01cab initial coding
carl
parents:
diff changeset
5143 dlfiles="$newdlfiles"
551433a01cab initial coding
carl
parents:
diff changeset
5144 newdlprefiles=
551433a01cab initial coding
carl
parents:
diff changeset
5145 for lib in $dlprefiles; do
551433a01cab initial coding
carl
parents:
diff changeset
5146 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5147 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
551433a01cab initial coding
carl
parents:
diff changeset
5148 if test -z "$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5149 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5150 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5151 fi
551433a01cab initial coding
carl
parents:
diff changeset
5152 newdlprefiles="$newdlprefiles $libdir/$name"
551433a01cab initial coding
carl
parents:
diff changeset
5153 done
551433a01cab initial coding
carl
parents:
diff changeset
5154 dlprefiles="$newdlprefiles"
551433a01cab initial coding
carl
parents:
diff changeset
5155 fi
551433a01cab initial coding
carl
parents:
diff changeset
5156 $rm $output
551433a01cab initial coding
carl
parents:
diff changeset
5157 # place dlname in correct position for cygwin
551433a01cab initial coding
carl
parents:
diff changeset
5158 tdlname=$dlname
551433a01cab initial coding
carl
parents:
diff changeset
5159 case $host,$output,$installed,$module,$dlname in
551433a01cab initial coding
carl
parents:
diff changeset
5160 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
551433a01cab initial coding
carl
parents:
diff changeset
5161 esac
551433a01cab initial coding
carl
parents:
diff changeset
5162 $echo > $output "\
551433a01cab initial coding
carl
parents:
diff changeset
5163 # $outputname - a libtool library file
551433a01cab initial coding
carl
parents:
diff changeset
5164 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
551433a01cab initial coding
carl
parents:
diff changeset
5165 #
551433a01cab initial coding
carl
parents:
diff changeset
5166 # Please DO NOT delete this file!
551433a01cab initial coding
carl
parents:
diff changeset
5167 # It is necessary for linking the library.
551433a01cab initial coding
carl
parents:
diff changeset
5168
551433a01cab initial coding
carl
parents:
diff changeset
5169 # The name that we can dlopen(3).
551433a01cab initial coding
carl
parents:
diff changeset
5170 dlname='$tdlname'
551433a01cab initial coding
carl
parents:
diff changeset
5171
551433a01cab initial coding
carl
parents:
diff changeset
5172 # Names of this library.
551433a01cab initial coding
carl
parents:
diff changeset
5173 library_names='$library_names'
551433a01cab initial coding
carl
parents:
diff changeset
5174
551433a01cab initial coding
carl
parents:
diff changeset
5175 # The name of the static archive.
551433a01cab initial coding
carl
parents:
diff changeset
5176 old_library='$old_library'
551433a01cab initial coding
carl
parents:
diff changeset
5177
551433a01cab initial coding
carl
parents:
diff changeset
5178 # Libraries that this one depends upon.
551433a01cab initial coding
carl
parents:
diff changeset
5179 dependency_libs='$dependency_libs'
551433a01cab initial coding
carl
parents:
diff changeset
5180
551433a01cab initial coding
carl
parents:
diff changeset
5181 # Version information for $libname.
551433a01cab initial coding
carl
parents:
diff changeset
5182 current=$current
551433a01cab initial coding
carl
parents:
diff changeset
5183 age=$age
551433a01cab initial coding
carl
parents:
diff changeset
5184 revision=$revision
551433a01cab initial coding
carl
parents:
diff changeset
5185
551433a01cab initial coding
carl
parents:
diff changeset
5186 # Is this an already installed library?
551433a01cab initial coding
carl
parents:
diff changeset
5187 installed=$installed
551433a01cab initial coding
carl
parents:
diff changeset
5188
551433a01cab initial coding
carl
parents:
diff changeset
5189 # Should we warn about portability when linking against -modules?
551433a01cab initial coding
carl
parents:
diff changeset
5190 shouldnotlink=$module
551433a01cab initial coding
carl
parents:
diff changeset
5191
551433a01cab initial coding
carl
parents:
diff changeset
5192 # Files to dlopen/dlpreopen
551433a01cab initial coding
carl
parents:
diff changeset
5193 dlopen='$dlfiles'
551433a01cab initial coding
carl
parents:
diff changeset
5194 dlpreopen='$dlprefiles'
551433a01cab initial coding
carl
parents:
diff changeset
5195
551433a01cab initial coding
carl
parents:
diff changeset
5196 # Directory that this library needs to be installed in:
551433a01cab initial coding
carl
parents:
diff changeset
5197 libdir='$install_libdir'"
551433a01cab initial coding
carl
parents:
diff changeset
5198 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
551433a01cab initial coding
carl
parents:
diff changeset
5199 $echo >> $output "\
551433a01cab initial coding
carl
parents:
diff changeset
5200 relink_command=\"$relink_command\""
551433a01cab initial coding
carl
parents:
diff changeset
5201 fi
551433a01cab initial coding
carl
parents:
diff changeset
5202 done
551433a01cab initial coding
carl
parents:
diff changeset
5203 fi
551433a01cab initial coding
carl
parents:
diff changeset
5204
551433a01cab initial coding
carl
parents:
diff changeset
5205 # Do a symbolic link so that the libtool archive can be found in
551433a01cab initial coding
carl
parents:
diff changeset
5206 # LD_LIBRARY_PATH before the program is installed.
551433a01cab initial coding
carl
parents:
diff changeset
5207 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
551433a01cab initial coding
carl
parents:
diff changeset
5208 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5209 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5210 esac
551433a01cab initial coding
carl
parents:
diff changeset
5211 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5212 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5213
551433a01cab initial coding
carl
parents:
diff changeset
5214 # libtool install mode
551433a01cab initial coding
carl
parents:
diff changeset
5215 install)
551433a01cab initial coding
carl
parents:
diff changeset
5216 modename="$modename: install"
551433a01cab initial coding
carl
parents:
diff changeset
5217
551433a01cab initial coding
carl
parents:
diff changeset
5218 # There may be an optional sh(1) argument at the beginning of
551433a01cab initial coding
carl
parents:
diff changeset
5219 # install_prog (especially on Windows NT).
551433a01cab initial coding
carl
parents:
diff changeset
5220 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
551433a01cab initial coding
carl
parents:
diff changeset
5221 # Allow the use of GNU shtool's install command.
551433a01cab initial coding
carl
parents:
diff changeset
5222 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
551433a01cab initial coding
carl
parents:
diff changeset
5223 # Aesthetically quote it.
551433a01cab initial coding
carl
parents:
diff changeset
5224 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5225 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
5226 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
551433a01cab initial coding
carl
parents:
diff changeset
5227 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
5228 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5229 esac
551433a01cab initial coding
carl
parents:
diff changeset
5230 install_prog="$arg "
551433a01cab initial coding
carl
parents:
diff changeset
5231 arg="$1"
551433a01cab initial coding
carl
parents:
diff changeset
5232 shift
551433a01cab initial coding
carl
parents:
diff changeset
5233 else
551433a01cab initial coding
carl
parents:
diff changeset
5234 install_prog=
551433a01cab initial coding
carl
parents:
diff changeset
5235 arg="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
5236 fi
551433a01cab initial coding
carl
parents:
diff changeset
5237
551433a01cab initial coding
carl
parents:
diff changeset
5238 # The real first argument should be the name of the installation program.
551433a01cab initial coding
carl
parents:
diff changeset
5239 # Aesthetically quote it.
551433a01cab initial coding
carl
parents:
diff changeset
5240 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5241 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
5242 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
551433a01cab initial coding
carl
parents:
diff changeset
5243 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
5244 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5245 esac
551433a01cab initial coding
carl
parents:
diff changeset
5246 install_prog="$install_prog$arg"
551433a01cab initial coding
carl
parents:
diff changeset
5247
551433a01cab initial coding
carl
parents:
diff changeset
5248 # We need to accept at least all the BSD install flags.
551433a01cab initial coding
carl
parents:
diff changeset
5249 dest=
551433a01cab initial coding
carl
parents:
diff changeset
5250 files=
551433a01cab initial coding
carl
parents:
diff changeset
5251 opts=
551433a01cab initial coding
carl
parents:
diff changeset
5252 prev=
551433a01cab initial coding
carl
parents:
diff changeset
5253 install_type=
551433a01cab initial coding
carl
parents:
diff changeset
5254 isdir=no
551433a01cab initial coding
carl
parents:
diff changeset
5255 stripme=
551433a01cab initial coding
carl
parents:
diff changeset
5256 for arg
551433a01cab initial coding
carl
parents:
diff changeset
5257 do
551433a01cab initial coding
carl
parents:
diff changeset
5258 if test -n "$dest"; then
551433a01cab initial coding
carl
parents:
diff changeset
5259 files="$files $dest"
551433a01cab initial coding
carl
parents:
diff changeset
5260 dest="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
5261 continue
551433a01cab initial coding
carl
parents:
diff changeset
5262 fi
551433a01cab initial coding
carl
parents:
diff changeset
5263
551433a01cab initial coding
carl
parents:
diff changeset
5264 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
5265 -d) isdir=yes ;;
551433a01cab initial coding
carl
parents:
diff changeset
5266 -f) prev="-f" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5267 -g) prev="-g" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5268 -m) prev="-m" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5269 -o) prev="-o" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5270 -s)
551433a01cab initial coding
carl
parents:
diff changeset
5271 stripme=" -s"
551433a01cab initial coding
carl
parents:
diff changeset
5272 continue
551433a01cab initial coding
carl
parents:
diff changeset
5273 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5274 -*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5275
551433a01cab initial coding
carl
parents:
diff changeset
5276 *)
551433a01cab initial coding
carl
parents:
diff changeset
5277 # If the previous option needed an argument, then skip it.
551433a01cab initial coding
carl
parents:
diff changeset
5278 if test -n "$prev"; then
551433a01cab initial coding
carl
parents:
diff changeset
5279 prev=
551433a01cab initial coding
carl
parents:
diff changeset
5280 else
551433a01cab initial coding
carl
parents:
diff changeset
5281 dest="$arg"
551433a01cab initial coding
carl
parents:
diff changeset
5282 continue
551433a01cab initial coding
carl
parents:
diff changeset
5283 fi
551433a01cab initial coding
carl
parents:
diff changeset
5284 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5285 esac
551433a01cab initial coding
carl
parents:
diff changeset
5286
551433a01cab initial coding
carl
parents:
diff changeset
5287 # Aesthetically quote the argument.
551433a01cab initial coding
carl
parents:
diff changeset
5288 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5289 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
5290 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
551433a01cab initial coding
carl
parents:
diff changeset
5291 arg="\"$arg\""
551433a01cab initial coding
carl
parents:
diff changeset
5292 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5293 esac
551433a01cab initial coding
carl
parents:
diff changeset
5294 install_prog="$install_prog $arg"
551433a01cab initial coding
carl
parents:
diff changeset
5295 done
551433a01cab initial coding
carl
parents:
diff changeset
5296
551433a01cab initial coding
carl
parents:
diff changeset
5297 if test -z "$install_prog"; then
551433a01cab initial coding
carl
parents:
diff changeset
5298 $echo "$modename: you must specify an install program" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5299 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5300 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5301 fi
551433a01cab initial coding
carl
parents:
diff changeset
5302
551433a01cab initial coding
carl
parents:
diff changeset
5303 if test -n "$prev"; then
551433a01cab initial coding
carl
parents:
diff changeset
5304 $echo "$modename: the \`$prev' option requires an argument" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5305 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5306 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5307 fi
551433a01cab initial coding
carl
parents:
diff changeset
5308
551433a01cab initial coding
carl
parents:
diff changeset
5309 if test -z "$files"; then
551433a01cab initial coding
carl
parents:
diff changeset
5310 if test -z "$dest"; then
551433a01cab initial coding
carl
parents:
diff changeset
5311 $echo "$modename: no file or destination specified" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5312 else
551433a01cab initial coding
carl
parents:
diff changeset
5313 $echo "$modename: you must specify a destination" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5314 fi
551433a01cab initial coding
carl
parents:
diff changeset
5315 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5316 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5317 fi
551433a01cab initial coding
carl
parents:
diff changeset
5318
551433a01cab initial coding
carl
parents:
diff changeset
5319 # Strip any trailing slash from the destination.
551433a01cab initial coding
carl
parents:
diff changeset
5320 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5321
551433a01cab initial coding
carl
parents:
diff changeset
5322 # Check to see that the destination is a directory.
551433a01cab initial coding
carl
parents:
diff changeset
5323 test -d "$dest" && isdir=yes
551433a01cab initial coding
carl
parents:
diff changeset
5324 if test "$isdir" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
5325 destdir="$dest"
551433a01cab initial coding
carl
parents:
diff changeset
5326 destname=
551433a01cab initial coding
carl
parents:
diff changeset
5327 else
551433a01cab initial coding
carl
parents:
diff changeset
5328 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5329 test "X$destdir" = "X$dest" && destdir=.
551433a01cab initial coding
carl
parents:
diff changeset
5330 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5331
551433a01cab initial coding
carl
parents:
diff changeset
5332 # Not a directory, so check to see that there is only one file specified.
551433a01cab initial coding
carl
parents:
diff changeset
5333 set dummy $files
551433a01cab initial coding
carl
parents:
diff changeset
5334 if test "$#" -gt 2; then
551433a01cab initial coding
carl
parents:
diff changeset
5335 $echo "$modename: \`$dest' is not a directory" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5336 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5337 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5338 fi
551433a01cab initial coding
carl
parents:
diff changeset
5339 fi
551433a01cab initial coding
carl
parents:
diff changeset
5340 case $destdir in
551433a01cab initial coding
carl
parents:
diff changeset
5341 [\\/]* | [A-Za-z]:[\\/]*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5342 *)
551433a01cab initial coding
carl
parents:
diff changeset
5343 for file in $files; do
551433a01cab initial coding
carl
parents:
diff changeset
5344 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5345 *.lo) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5346 *)
551433a01cab initial coding
carl
parents:
diff changeset
5347 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5348 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5349 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5350 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5351 esac
551433a01cab initial coding
carl
parents:
diff changeset
5352 done
551433a01cab initial coding
carl
parents:
diff changeset
5353 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5354 esac
551433a01cab initial coding
carl
parents:
diff changeset
5355
551433a01cab initial coding
carl
parents:
diff changeset
5356 # This variable tells wrapper scripts just to set variables rather
551433a01cab initial coding
carl
parents:
diff changeset
5357 # than running their programs.
551433a01cab initial coding
carl
parents:
diff changeset
5358 libtool_install_magic="$magic"
551433a01cab initial coding
carl
parents:
diff changeset
5359
551433a01cab initial coding
carl
parents:
diff changeset
5360 staticlibs=
551433a01cab initial coding
carl
parents:
diff changeset
5361 future_libdirs=
551433a01cab initial coding
carl
parents:
diff changeset
5362 current_libdirs=
551433a01cab initial coding
carl
parents:
diff changeset
5363 for file in $files; do
551433a01cab initial coding
carl
parents:
diff changeset
5364
551433a01cab initial coding
carl
parents:
diff changeset
5365 # Do each installation.
551433a01cab initial coding
carl
parents:
diff changeset
5366 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5367 *.$libext)
551433a01cab initial coding
carl
parents:
diff changeset
5368 # Do the static libraries later.
551433a01cab initial coding
carl
parents:
diff changeset
5369 staticlibs="$staticlibs $file"
551433a01cab initial coding
carl
parents:
diff changeset
5370 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5371
551433a01cab initial coding
carl
parents:
diff changeset
5372 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
5373 # Check to see that this really is a libtool archive.
551433a01cab initial coding
carl
parents:
diff changeset
5374 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
551433a01cab initial coding
carl
parents:
diff changeset
5375 else
551433a01cab initial coding
carl
parents:
diff changeset
5376 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5377 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5378 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5379 fi
551433a01cab initial coding
carl
parents:
diff changeset
5380
551433a01cab initial coding
carl
parents:
diff changeset
5381 library_names=
551433a01cab initial coding
carl
parents:
diff changeset
5382 old_library=
551433a01cab initial coding
carl
parents:
diff changeset
5383 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
5384 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5385 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5386 */* | *\\*) . $file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5387 *) . ./$file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5388 esac
551433a01cab initial coding
carl
parents:
diff changeset
5389
551433a01cab initial coding
carl
parents:
diff changeset
5390 # Add the libdir to current_libdirs if it is the destination.
551433a01cab initial coding
carl
parents:
diff changeset
5391 if test "X$destdir" = "X$libdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5392 case "$current_libdirs " in
551433a01cab initial coding
carl
parents:
diff changeset
5393 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5394 *) current_libdirs="$current_libdirs $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5395 esac
551433a01cab initial coding
carl
parents:
diff changeset
5396 else
551433a01cab initial coding
carl
parents:
diff changeset
5397 # Note the libdir as a future libdir.
551433a01cab initial coding
carl
parents:
diff changeset
5398 case "$future_libdirs " in
551433a01cab initial coding
carl
parents:
diff changeset
5399 *" $libdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5400 *) future_libdirs="$future_libdirs $libdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5401 esac
551433a01cab initial coding
carl
parents:
diff changeset
5402 fi
551433a01cab initial coding
carl
parents:
diff changeset
5403
551433a01cab initial coding
carl
parents:
diff changeset
5404 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
551433a01cab initial coding
carl
parents:
diff changeset
5405 test "X$dir" = "X$file/" && dir=
551433a01cab initial coding
carl
parents:
diff changeset
5406 dir="$dir$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
5407
551433a01cab initial coding
carl
parents:
diff changeset
5408 if test -n "$relink_command"; then
551433a01cab initial coding
carl
parents:
diff changeset
5409 # Determine the prefix the user has applied to our future dir.
551433a01cab initial coding
carl
parents:
diff changeset
5410 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
551433a01cab initial coding
carl
parents:
diff changeset
5411
551433a01cab initial coding
carl
parents:
diff changeset
5412 # Don't allow the user to place us outside of our expected
551433a01cab initial coding
carl
parents:
diff changeset
5413 # location b/c this prevents finding dependent libraries that
551433a01cab initial coding
carl
parents:
diff changeset
5414 # are installed to the same prefix.
551433a01cab initial coding
carl
parents:
diff changeset
5415 # At present, this check doesn't affect windows .dll's that
551433a01cab initial coding
carl
parents:
diff changeset
5416 # are installed into $libdir/../bin (currently, that works fine)
551433a01cab initial coding
carl
parents:
diff changeset
5417 # but it's something to keep an eye on.
551433a01cab initial coding
carl
parents:
diff changeset
5418 if test "$inst_prefix_dir" = "$destdir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5419 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5420 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5421 fi
551433a01cab initial coding
carl
parents:
diff changeset
5422
551433a01cab initial coding
carl
parents:
diff changeset
5423 if test -n "$inst_prefix_dir"; then
551433a01cab initial coding
carl
parents:
diff changeset
5424 # Stick the inst_prefix_dir data into the link command.
551433a01cab initial coding
carl
parents:
diff changeset
5425 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
551433a01cab initial coding
carl
parents:
diff changeset
5426 else
551433a01cab initial coding
carl
parents:
diff changeset
5427 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
551433a01cab initial coding
carl
parents:
diff changeset
5428 fi
551433a01cab initial coding
carl
parents:
diff changeset
5429
551433a01cab initial coding
carl
parents:
diff changeset
5430 $echo "$modename: warning: relinking \`$file'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5431 $show "$relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
5432 if $run eval "$relink_command"; then :
551433a01cab initial coding
carl
parents:
diff changeset
5433 else
551433a01cab initial coding
carl
parents:
diff changeset
5434 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5435 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5436 fi
551433a01cab initial coding
carl
parents:
diff changeset
5437 fi
551433a01cab initial coding
carl
parents:
diff changeset
5438
551433a01cab initial coding
carl
parents:
diff changeset
5439 # See the names of the shared library.
551433a01cab initial coding
carl
parents:
diff changeset
5440 set dummy $library_names
551433a01cab initial coding
carl
parents:
diff changeset
5441 if test -n "$2"; then
551433a01cab initial coding
carl
parents:
diff changeset
5442 realname="$2"
551433a01cab initial coding
carl
parents:
diff changeset
5443 shift
551433a01cab initial coding
carl
parents:
diff changeset
5444 shift
551433a01cab initial coding
carl
parents:
diff changeset
5445
551433a01cab initial coding
carl
parents:
diff changeset
5446 srcname="$realname"
551433a01cab initial coding
carl
parents:
diff changeset
5447 test -n "$relink_command" && srcname="$realname"T
551433a01cab initial coding
carl
parents:
diff changeset
5448
551433a01cab initial coding
carl
parents:
diff changeset
5449 # Install the shared library and build the symlinks.
551433a01cab initial coding
carl
parents:
diff changeset
5450 $show "$install_prog $dir/$srcname $destdir/$realname"
551433a01cab initial coding
carl
parents:
diff changeset
5451 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5452 if test -n "$stripme" && test -n "$striplib"; then
551433a01cab initial coding
carl
parents:
diff changeset
5453 $show "$striplib $destdir/$realname"
551433a01cab initial coding
carl
parents:
diff changeset
5454 $run eval "$striplib $destdir/$realname" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5455 fi
551433a01cab initial coding
carl
parents:
diff changeset
5456
551433a01cab initial coding
carl
parents:
diff changeset
5457 if test "$#" -gt 0; then
551433a01cab initial coding
carl
parents:
diff changeset
5458 # Delete the old symlinks, and create new ones.
551433a01cab initial coding
carl
parents:
diff changeset
5459 for linkname
551433a01cab initial coding
carl
parents:
diff changeset
5460 do
551433a01cab initial coding
carl
parents:
diff changeset
5461 if test "$linkname" != "$realname"; then
551433a01cab initial coding
carl
parents:
diff changeset
5462 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
551433a01cab initial coding
carl
parents:
diff changeset
5463 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
551433a01cab initial coding
carl
parents:
diff changeset
5464 fi
551433a01cab initial coding
carl
parents:
diff changeset
5465 done
551433a01cab initial coding
carl
parents:
diff changeset
5466 fi
551433a01cab initial coding
carl
parents:
diff changeset
5467
551433a01cab initial coding
carl
parents:
diff changeset
5468 # Do each command in the postinstall commands.
551433a01cab initial coding
carl
parents:
diff changeset
5469 lib="$destdir/$realname"
551433a01cab initial coding
carl
parents:
diff changeset
5470 eval cmds=\"$postinstall_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5471 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
5472 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
5473 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5474 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
5475 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5476 done
551433a01cab initial coding
carl
parents:
diff changeset
5477 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5478 fi
551433a01cab initial coding
carl
parents:
diff changeset
5479
551433a01cab initial coding
carl
parents:
diff changeset
5480 # Install the pseudo-library for information purposes.
551433a01cab initial coding
carl
parents:
diff changeset
5481 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5482 instname="$dir/$name"i
551433a01cab initial coding
carl
parents:
diff changeset
5483 $show "$install_prog $instname $destdir/$name"
551433a01cab initial coding
carl
parents:
diff changeset
5484 $run eval "$install_prog $instname $destdir/$name" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5485
551433a01cab initial coding
carl
parents:
diff changeset
5486 # Maybe install the static library, too.
551433a01cab initial coding
carl
parents:
diff changeset
5487 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
5488 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5489
551433a01cab initial coding
carl
parents:
diff changeset
5490 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
5491 # Install (i.e. copy) a libtool object.
551433a01cab initial coding
carl
parents:
diff changeset
5492
551433a01cab initial coding
carl
parents:
diff changeset
5493 # Figure out destination file name, if it wasn't already specified.
551433a01cab initial coding
carl
parents:
diff changeset
5494 if test -n "$destname"; then
551433a01cab initial coding
carl
parents:
diff changeset
5495 destfile="$destdir/$destname"
551433a01cab initial coding
carl
parents:
diff changeset
5496 else
551433a01cab initial coding
carl
parents:
diff changeset
5497 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5498 destfile="$destdir/$destfile"
551433a01cab initial coding
carl
parents:
diff changeset
5499 fi
551433a01cab initial coding
carl
parents:
diff changeset
5500
551433a01cab initial coding
carl
parents:
diff changeset
5501 # Deduce the name of the destination old-style object file.
551433a01cab initial coding
carl
parents:
diff changeset
5502 case $destfile in
551433a01cab initial coding
carl
parents:
diff changeset
5503 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
5504 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
5505 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5506 *.$objext)
551433a01cab initial coding
carl
parents:
diff changeset
5507 staticdest="$destfile"
551433a01cab initial coding
carl
parents:
diff changeset
5508 destfile=
551433a01cab initial coding
carl
parents:
diff changeset
5509 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5510 *)
551433a01cab initial coding
carl
parents:
diff changeset
5511 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5512 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5513 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5514 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5515 esac
551433a01cab initial coding
carl
parents:
diff changeset
5516
551433a01cab initial coding
carl
parents:
diff changeset
5517 # Install the libtool object if requested.
551433a01cab initial coding
carl
parents:
diff changeset
5518 if test -n "$destfile"; then
551433a01cab initial coding
carl
parents:
diff changeset
5519 $show "$install_prog $file $destfile"
551433a01cab initial coding
carl
parents:
diff changeset
5520 $run eval "$install_prog $file $destfile" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5521 fi
551433a01cab initial coding
carl
parents:
diff changeset
5522
551433a01cab initial coding
carl
parents:
diff changeset
5523 # Install the old object if enabled.
551433a01cab initial coding
carl
parents:
diff changeset
5524 if test "$build_old_libs" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
5525 # Deduce the name of the old-style object file.
551433a01cab initial coding
carl
parents:
diff changeset
5526 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
551433a01cab initial coding
carl
parents:
diff changeset
5527
551433a01cab initial coding
carl
parents:
diff changeset
5528 $show "$install_prog $staticobj $staticdest"
551433a01cab initial coding
carl
parents:
diff changeset
5529 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5530 fi
551433a01cab initial coding
carl
parents:
diff changeset
5531 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5532 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5533
551433a01cab initial coding
carl
parents:
diff changeset
5534 *)
551433a01cab initial coding
carl
parents:
diff changeset
5535 # Figure out destination file name, if it wasn't already specified.
551433a01cab initial coding
carl
parents:
diff changeset
5536 if test -n "$destname"; then
551433a01cab initial coding
carl
parents:
diff changeset
5537 destfile="$destdir/$destname"
551433a01cab initial coding
carl
parents:
diff changeset
5538 else
551433a01cab initial coding
carl
parents:
diff changeset
5539 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5540 destfile="$destdir/$destfile"
551433a01cab initial coding
carl
parents:
diff changeset
5541 fi
551433a01cab initial coding
carl
parents:
diff changeset
5542
551433a01cab initial coding
carl
parents:
diff changeset
5543 # If the file is missing, and there is a .exe on the end, strip it
551433a01cab initial coding
carl
parents:
diff changeset
5544 # because it is most likely a libtool script we actually want to
551433a01cab initial coding
carl
parents:
diff changeset
5545 # install
551433a01cab initial coding
carl
parents:
diff changeset
5546 stripped_ext=""
551433a01cab initial coding
carl
parents:
diff changeset
5547 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5548 *.exe)
551433a01cab initial coding
carl
parents:
diff changeset
5549 if test ! -f "$file"; then
551433a01cab initial coding
carl
parents:
diff changeset
5550 file=`$echo $file|${SED} 's,.exe$,,'`
551433a01cab initial coding
carl
parents:
diff changeset
5551 stripped_ext=".exe"
551433a01cab initial coding
carl
parents:
diff changeset
5552 fi
551433a01cab initial coding
carl
parents:
diff changeset
5553 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5554 esac
551433a01cab initial coding
carl
parents:
diff changeset
5555
551433a01cab initial coding
carl
parents:
diff changeset
5556 # Do a test to see if this is really a libtool program.
551433a01cab initial coding
carl
parents:
diff changeset
5557 case $host in
551433a01cab initial coding
carl
parents:
diff changeset
5558 *cygwin*|*mingw*)
551433a01cab initial coding
carl
parents:
diff changeset
5559 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
551433a01cab initial coding
carl
parents:
diff changeset
5560 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5561 *)
551433a01cab initial coding
carl
parents:
diff changeset
5562 wrapper=$file
551433a01cab initial coding
carl
parents:
diff changeset
5563 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5564 esac
551433a01cab initial coding
carl
parents:
diff changeset
5565 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
5566 notinst_deplibs=
551433a01cab initial coding
carl
parents:
diff changeset
5567 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
5568
551433a01cab initial coding
carl
parents:
diff changeset
5569 # To insure that "foo" is sourced, and not "foo.exe",
551433a01cab initial coding
carl
parents:
diff changeset
5570 # finese the cygwin/MSYS system by explicitly sourcing "foo."
551433a01cab initial coding
carl
parents:
diff changeset
5571 # which disallows the automatic-append-.exe behavior.
551433a01cab initial coding
carl
parents:
diff changeset
5572 case $build in
551433a01cab initial coding
carl
parents:
diff changeset
5573 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
551433a01cab initial coding
carl
parents:
diff changeset
5574 *) wrapperdot=${wrapper} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5575 esac
551433a01cab initial coding
carl
parents:
diff changeset
5576 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5577 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5578 */* | *\\*) . ${wrapperdot} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5579 *) . ./${wrapperdot} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5580 esac
551433a01cab initial coding
carl
parents:
diff changeset
5581
551433a01cab initial coding
carl
parents:
diff changeset
5582 # Check the variables that should have been set.
551433a01cab initial coding
carl
parents:
diff changeset
5583 if test -z "$notinst_deplibs"; then
551433a01cab initial coding
carl
parents:
diff changeset
5584 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5585 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5586 fi
551433a01cab initial coding
carl
parents:
diff changeset
5587
551433a01cab initial coding
carl
parents:
diff changeset
5588 finalize=yes
551433a01cab initial coding
carl
parents:
diff changeset
5589 for lib in $notinst_deplibs; do
551433a01cab initial coding
carl
parents:
diff changeset
5590 # Check to see that each library is installed.
551433a01cab initial coding
carl
parents:
diff changeset
5591 libdir=
551433a01cab initial coding
carl
parents:
diff changeset
5592 if test -f "$lib"; then
551433a01cab initial coding
carl
parents:
diff changeset
5593 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5594 case $lib in
551433a01cab initial coding
carl
parents:
diff changeset
5595 */* | *\\*) . $lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
5596 *) . ./$lib ;;
551433a01cab initial coding
carl
parents:
diff changeset
5597 esac
551433a01cab initial coding
carl
parents:
diff changeset
5598 fi
551433a01cab initial coding
carl
parents:
diff changeset
5599 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
551433a01cab initial coding
carl
parents:
diff changeset
5600 if test -n "$libdir" && test ! -f "$libfile"; then
551433a01cab initial coding
carl
parents:
diff changeset
5601 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5602 finalize=no
551433a01cab initial coding
carl
parents:
diff changeset
5603 fi
551433a01cab initial coding
carl
parents:
diff changeset
5604 done
551433a01cab initial coding
carl
parents:
diff changeset
5605
551433a01cab initial coding
carl
parents:
diff changeset
5606 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
5607 # To insure that "foo" is sourced, and not "foo.exe",
551433a01cab initial coding
carl
parents:
diff changeset
5608 # finese the cygwin/MSYS system by explicitly sourcing "foo."
551433a01cab initial coding
carl
parents:
diff changeset
5609 # which disallows the automatic-append-.exe behavior.
551433a01cab initial coding
carl
parents:
diff changeset
5610 case $build in
551433a01cab initial coding
carl
parents:
diff changeset
5611 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
551433a01cab initial coding
carl
parents:
diff changeset
5612 *) wrapperdot=${wrapper} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5613 esac
551433a01cab initial coding
carl
parents:
diff changeset
5614 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5615 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5616 */* | *\\*) . ${wrapperdot} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5617 *) . ./${wrapperdot} ;;
551433a01cab initial coding
carl
parents:
diff changeset
5618 esac
551433a01cab initial coding
carl
parents:
diff changeset
5619
551433a01cab initial coding
carl
parents:
diff changeset
5620 outputname=
551433a01cab initial coding
carl
parents:
diff changeset
5621 if test "$fast_install" = no && test -n "$relink_command"; then
551433a01cab initial coding
carl
parents:
diff changeset
5622 if test "$finalize" = yes && test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
5623 tmpdir="/tmp"
551433a01cab initial coding
carl
parents:
diff changeset
5624 test -n "$TMPDIR" && tmpdir="$TMPDIR"
551433a01cab initial coding
carl
parents:
diff changeset
5625 tmpdir="$tmpdir/libtool-$$"
551433a01cab initial coding
carl
parents:
diff changeset
5626 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
551433a01cab initial coding
carl
parents:
diff changeset
5627 else
551433a01cab initial coding
carl
parents:
diff changeset
5628 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5629 continue
551433a01cab initial coding
carl
parents:
diff changeset
5630 fi
551433a01cab initial coding
carl
parents:
diff changeset
5631 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5632 outputname="$tmpdir/$file"
551433a01cab initial coding
carl
parents:
diff changeset
5633 # Replace the output file specification.
551433a01cab initial coding
carl
parents:
diff changeset
5634 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
551433a01cab initial coding
carl
parents:
diff changeset
5635
551433a01cab initial coding
carl
parents:
diff changeset
5636 $show "$relink_command"
551433a01cab initial coding
carl
parents:
diff changeset
5637 if $run eval "$relink_command"; then :
551433a01cab initial coding
carl
parents:
diff changeset
5638 else
551433a01cab initial coding
carl
parents:
diff changeset
5639 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5640 ${rm}r "$tmpdir"
551433a01cab initial coding
carl
parents:
diff changeset
5641 continue
551433a01cab initial coding
carl
parents:
diff changeset
5642 fi
551433a01cab initial coding
carl
parents:
diff changeset
5643 file="$outputname"
551433a01cab initial coding
carl
parents:
diff changeset
5644 else
551433a01cab initial coding
carl
parents:
diff changeset
5645 $echo "$modename: warning: cannot relink \`$file'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5646 fi
551433a01cab initial coding
carl
parents:
diff changeset
5647 else
551433a01cab initial coding
carl
parents:
diff changeset
5648 # Install the binary that we compiled earlier.
551433a01cab initial coding
carl
parents:
diff changeset
5649 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
551433a01cab initial coding
carl
parents:
diff changeset
5650 fi
551433a01cab initial coding
carl
parents:
diff changeset
5651 fi
551433a01cab initial coding
carl
parents:
diff changeset
5652
551433a01cab initial coding
carl
parents:
diff changeset
5653 # remove .exe since cygwin /usr/bin/install will append another
551433a01cab initial coding
carl
parents:
diff changeset
5654 # one anyways
551433a01cab initial coding
carl
parents:
diff changeset
5655 case $install_prog,$host in
551433a01cab initial coding
carl
parents:
diff changeset
5656 */usr/bin/install*,*cygwin*)
551433a01cab initial coding
carl
parents:
diff changeset
5657 case $file:$destfile in
551433a01cab initial coding
carl
parents:
diff changeset
5658 *.exe:*.exe)
551433a01cab initial coding
carl
parents:
diff changeset
5659 # this is ok
551433a01cab initial coding
carl
parents:
diff changeset
5660 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5661 *.exe:*)
551433a01cab initial coding
carl
parents:
diff changeset
5662 destfile=$destfile.exe
551433a01cab initial coding
carl
parents:
diff changeset
5663 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5664 *:*.exe)
551433a01cab initial coding
carl
parents:
diff changeset
5665 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
551433a01cab initial coding
carl
parents:
diff changeset
5666 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5667 esac
551433a01cab initial coding
carl
parents:
diff changeset
5668 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5669 esac
551433a01cab initial coding
carl
parents:
diff changeset
5670 $show "$install_prog$stripme $file $destfile"
551433a01cab initial coding
carl
parents:
diff changeset
5671 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5672 test -n "$outputname" && ${rm}r "$tmpdir"
551433a01cab initial coding
carl
parents:
diff changeset
5673 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5674 esac
551433a01cab initial coding
carl
parents:
diff changeset
5675 done
551433a01cab initial coding
carl
parents:
diff changeset
5676
551433a01cab initial coding
carl
parents:
diff changeset
5677 for file in $staticlibs; do
551433a01cab initial coding
carl
parents:
diff changeset
5678 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5679
551433a01cab initial coding
carl
parents:
diff changeset
5680 # Set up the ranlib parameters.
551433a01cab initial coding
carl
parents:
diff changeset
5681 oldlib="$destdir/$name"
551433a01cab initial coding
carl
parents:
diff changeset
5682
551433a01cab initial coding
carl
parents:
diff changeset
5683 $show "$install_prog $file $oldlib"
551433a01cab initial coding
carl
parents:
diff changeset
5684 $run eval "$install_prog \$file \$oldlib" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5685
551433a01cab initial coding
carl
parents:
diff changeset
5686 if test -n "$stripme" && test -n "$striplib"; then
551433a01cab initial coding
carl
parents:
diff changeset
5687 $show "$old_striplib $oldlib"
551433a01cab initial coding
carl
parents:
diff changeset
5688 $run eval "$old_striplib $oldlib" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5689 fi
551433a01cab initial coding
carl
parents:
diff changeset
5690
551433a01cab initial coding
carl
parents:
diff changeset
5691 # Do each command in the postinstall commands.
551433a01cab initial coding
carl
parents:
diff changeset
5692 eval cmds=\"$old_postinstall_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5693 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
5694 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
5695 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5696 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
5697 $run eval "$cmd" || exit $?
551433a01cab initial coding
carl
parents:
diff changeset
5698 done
551433a01cab initial coding
carl
parents:
diff changeset
5699 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5700 done
551433a01cab initial coding
carl
parents:
diff changeset
5701
551433a01cab initial coding
carl
parents:
diff changeset
5702 if test -n "$future_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
5703 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5704 fi
551433a01cab initial coding
carl
parents:
diff changeset
5705
551433a01cab initial coding
carl
parents:
diff changeset
5706 if test -n "$current_libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
5707 # Maybe just do a dry run.
551433a01cab initial coding
carl
parents:
diff changeset
5708 test -n "$run" && current_libdirs=" -n$current_libdirs"
551433a01cab initial coding
carl
parents:
diff changeset
5709 exec_cmd='$SHELL $0 --finish$current_libdirs'
551433a01cab initial coding
carl
parents:
diff changeset
5710 else
551433a01cab initial coding
carl
parents:
diff changeset
5711 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5712 fi
551433a01cab initial coding
carl
parents:
diff changeset
5713 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5714
551433a01cab initial coding
carl
parents:
diff changeset
5715 # libtool finish mode
551433a01cab initial coding
carl
parents:
diff changeset
5716 finish)
551433a01cab initial coding
carl
parents:
diff changeset
5717 modename="$modename: finish"
551433a01cab initial coding
carl
parents:
diff changeset
5718 libdirs="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
5719 admincmds=
551433a01cab initial coding
carl
parents:
diff changeset
5720
551433a01cab initial coding
carl
parents:
diff changeset
5721 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
551433a01cab initial coding
carl
parents:
diff changeset
5722 for dir
551433a01cab initial coding
carl
parents:
diff changeset
5723 do
551433a01cab initial coding
carl
parents:
diff changeset
5724 libdirs="$libdirs $dir"
551433a01cab initial coding
carl
parents:
diff changeset
5725 done
551433a01cab initial coding
carl
parents:
diff changeset
5726
551433a01cab initial coding
carl
parents:
diff changeset
5727 for libdir in $libdirs; do
551433a01cab initial coding
carl
parents:
diff changeset
5728 if test -n "$finish_cmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
5729 # Do each command in the finish commands.
551433a01cab initial coding
carl
parents:
diff changeset
5730 eval cmds=\"$finish_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
5731 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
5732 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
5733 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5734 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
5735 $run eval "$cmd" || admincmds="$admincmds
551433a01cab initial coding
carl
parents:
diff changeset
5736 $cmd"
551433a01cab initial coding
carl
parents:
diff changeset
5737 done
551433a01cab initial coding
carl
parents:
diff changeset
5738 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
5739 fi
551433a01cab initial coding
carl
parents:
diff changeset
5740 if test -n "$finish_eval"; then
551433a01cab initial coding
carl
parents:
diff changeset
5741 # Do the single finish_eval.
551433a01cab initial coding
carl
parents:
diff changeset
5742 eval cmds=\"$finish_eval\"
551433a01cab initial coding
carl
parents:
diff changeset
5743 $run eval "$cmds" || admincmds="$admincmds
551433a01cab initial coding
carl
parents:
diff changeset
5744 $cmds"
551433a01cab initial coding
carl
parents:
diff changeset
5745 fi
551433a01cab initial coding
carl
parents:
diff changeset
5746 done
551433a01cab initial coding
carl
parents:
diff changeset
5747 fi
551433a01cab initial coding
carl
parents:
diff changeset
5748
551433a01cab initial coding
carl
parents:
diff changeset
5749 # Exit here if they wanted silent mode.
551433a01cab initial coding
carl
parents:
diff changeset
5750 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5751
551433a01cab initial coding
carl
parents:
diff changeset
5752 $echo "----------------------------------------------------------------------"
551433a01cab initial coding
carl
parents:
diff changeset
5753 $echo "Libraries have been installed in:"
551433a01cab initial coding
carl
parents:
diff changeset
5754 for libdir in $libdirs; do
551433a01cab initial coding
carl
parents:
diff changeset
5755 $echo " $libdir"
551433a01cab initial coding
carl
parents:
diff changeset
5756 done
551433a01cab initial coding
carl
parents:
diff changeset
5757 $echo
551433a01cab initial coding
carl
parents:
diff changeset
5758 $echo "If you ever happen to want to link against installed libraries"
551433a01cab initial coding
carl
parents:
diff changeset
5759 $echo "in a given directory, LIBDIR, you must either use libtool, and"
551433a01cab initial coding
carl
parents:
diff changeset
5760 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
551433a01cab initial coding
carl
parents:
diff changeset
5761 $echo "flag during linking and do at least one of the following:"
551433a01cab initial coding
carl
parents:
diff changeset
5762 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
5763 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
551433a01cab initial coding
carl
parents:
diff changeset
5764 $echo " during execution"
551433a01cab initial coding
carl
parents:
diff changeset
5765 fi
551433a01cab initial coding
carl
parents:
diff changeset
5766 if test -n "$runpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
5767 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
551433a01cab initial coding
carl
parents:
diff changeset
5768 $echo " during linking"
551433a01cab initial coding
carl
parents:
diff changeset
5769 fi
551433a01cab initial coding
carl
parents:
diff changeset
5770 if test -n "$hardcode_libdir_flag_spec"; then
551433a01cab initial coding
carl
parents:
diff changeset
5771 libdir=LIBDIR
551433a01cab initial coding
carl
parents:
diff changeset
5772 eval flag=\"$hardcode_libdir_flag_spec\"
551433a01cab initial coding
carl
parents:
diff changeset
5773
551433a01cab initial coding
carl
parents:
diff changeset
5774 $echo " - use the \`$flag' linker flag"
551433a01cab initial coding
carl
parents:
diff changeset
5775 fi
551433a01cab initial coding
carl
parents:
diff changeset
5776 if test -n "$admincmds"; then
551433a01cab initial coding
carl
parents:
diff changeset
5777 $echo " - have your system administrator run these commands:$admincmds"
551433a01cab initial coding
carl
parents:
diff changeset
5778 fi
551433a01cab initial coding
carl
parents:
diff changeset
5779 if test -f /etc/ld.so.conf; then
551433a01cab initial coding
carl
parents:
diff changeset
5780 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
551433a01cab initial coding
carl
parents:
diff changeset
5781 fi
551433a01cab initial coding
carl
parents:
diff changeset
5782 $echo
551433a01cab initial coding
carl
parents:
diff changeset
5783 $echo "See any operating system documentation about shared libraries for"
551433a01cab initial coding
carl
parents:
diff changeset
5784 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
551433a01cab initial coding
carl
parents:
diff changeset
5785 $echo "----------------------------------------------------------------------"
551433a01cab initial coding
carl
parents:
diff changeset
5786 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5787 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5788
551433a01cab initial coding
carl
parents:
diff changeset
5789 # libtool execute mode
551433a01cab initial coding
carl
parents:
diff changeset
5790 execute)
551433a01cab initial coding
carl
parents:
diff changeset
5791 modename="$modename: execute"
551433a01cab initial coding
carl
parents:
diff changeset
5792
551433a01cab initial coding
carl
parents:
diff changeset
5793 # The first argument is the command name.
551433a01cab initial coding
carl
parents:
diff changeset
5794 cmd="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
5795 if test -z "$cmd"; then
551433a01cab initial coding
carl
parents:
diff changeset
5796 $echo "$modename: you must specify a COMMAND" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5797 $echo "$help"
551433a01cab initial coding
carl
parents:
diff changeset
5798 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5799 fi
551433a01cab initial coding
carl
parents:
diff changeset
5800
551433a01cab initial coding
carl
parents:
diff changeset
5801 # Handle -dlopen flags immediately.
551433a01cab initial coding
carl
parents:
diff changeset
5802 for file in $execute_dlfiles; do
551433a01cab initial coding
carl
parents:
diff changeset
5803 if test ! -f "$file"; then
551433a01cab initial coding
carl
parents:
diff changeset
5804 $echo "$modename: \`$file' is not a file" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5805 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5806 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5807 fi
551433a01cab initial coding
carl
parents:
diff changeset
5808
551433a01cab initial coding
carl
parents:
diff changeset
5809 dir=
551433a01cab initial coding
carl
parents:
diff changeset
5810 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5811 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
5812 # Check to see that this really is a libtool archive.
551433a01cab initial coding
carl
parents:
diff changeset
5813 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
551433a01cab initial coding
carl
parents:
diff changeset
5814 else
551433a01cab initial coding
carl
parents:
diff changeset
5815 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5816 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5817 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5818 fi
551433a01cab initial coding
carl
parents:
diff changeset
5819
551433a01cab initial coding
carl
parents:
diff changeset
5820 # Read the libtool library.
551433a01cab initial coding
carl
parents:
diff changeset
5821 dlname=
551433a01cab initial coding
carl
parents:
diff changeset
5822 library_names=
551433a01cab initial coding
carl
parents:
diff changeset
5823
551433a01cab initial coding
carl
parents:
diff changeset
5824 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5825 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5826 */* | *\\*) . $file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5827 *) . ./$file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5828 esac
551433a01cab initial coding
carl
parents:
diff changeset
5829
551433a01cab initial coding
carl
parents:
diff changeset
5830 # Skip this library if it cannot be dlopened.
551433a01cab initial coding
carl
parents:
diff changeset
5831 if test -z "$dlname"; then
551433a01cab initial coding
carl
parents:
diff changeset
5832 # Warn if it was a shared library.
551433a01cab initial coding
carl
parents:
diff changeset
5833 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
551433a01cab initial coding
carl
parents:
diff changeset
5834 continue
551433a01cab initial coding
carl
parents:
diff changeset
5835 fi
551433a01cab initial coding
carl
parents:
diff changeset
5836
551433a01cab initial coding
carl
parents:
diff changeset
5837 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5838 test "X$dir" = "X$file" && dir=.
551433a01cab initial coding
carl
parents:
diff changeset
5839
551433a01cab initial coding
carl
parents:
diff changeset
5840 if test -f "$dir/$objdir/$dlname"; then
551433a01cab initial coding
carl
parents:
diff changeset
5841 dir="$dir/$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
5842 else
551433a01cab initial coding
carl
parents:
diff changeset
5843 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5844 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5845 fi
551433a01cab initial coding
carl
parents:
diff changeset
5846 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5847
551433a01cab initial coding
carl
parents:
diff changeset
5848 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
5849 # Just add the directory containing the .lo file.
551433a01cab initial coding
carl
parents:
diff changeset
5850 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5851 test "X$dir" = "X$file" && dir=.
551433a01cab initial coding
carl
parents:
diff changeset
5852 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5853
551433a01cab initial coding
carl
parents:
diff changeset
5854 *)
551433a01cab initial coding
carl
parents:
diff changeset
5855 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5856 continue
551433a01cab initial coding
carl
parents:
diff changeset
5857 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5858 esac
551433a01cab initial coding
carl
parents:
diff changeset
5859
551433a01cab initial coding
carl
parents:
diff changeset
5860 # Get the absolute pathname.
551433a01cab initial coding
carl
parents:
diff changeset
5861 absdir=`cd "$dir" && pwd`
551433a01cab initial coding
carl
parents:
diff changeset
5862 test -n "$absdir" && dir="$absdir"
551433a01cab initial coding
carl
parents:
diff changeset
5863
551433a01cab initial coding
carl
parents:
diff changeset
5864 # Now add the directory to shlibpath_var.
551433a01cab initial coding
carl
parents:
diff changeset
5865 if eval "test -z \"\$$shlibpath_var\""; then
551433a01cab initial coding
carl
parents:
diff changeset
5866 eval "$shlibpath_var=\"\$dir\""
551433a01cab initial coding
carl
parents:
diff changeset
5867 else
551433a01cab initial coding
carl
parents:
diff changeset
5868 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
551433a01cab initial coding
carl
parents:
diff changeset
5869 fi
551433a01cab initial coding
carl
parents:
diff changeset
5870 done
551433a01cab initial coding
carl
parents:
diff changeset
5871
551433a01cab initial coding
carl
parents:
diff changeset
5872 # This variable tells wrapper scripts just to set shlibpath_var
551433a01cab initial coding
carl
parents:
diff changeset
5873 # rather than running their programs.
551433a01cab initial coding
carl
parents:
diff changeset
5874 libtool_execute_magic="$magic"
551433a01cab initial coding
carl
parents:
diff changeset
5875
551433a01cab initial coding
carl
parents:
diff changeset
5876 # Check if any of the arguments is a wrapper script.
551433a01cab initial coding
carl
parents:
diff changeset
5877 args=
551433a01cab initial coding
carl
parents:
diff changeset
5878 for file
551433a01cab initial coding
carl
parents:
diff changeset
5879 do
551433a01cab initial coding
carl
parents:
diff changeset
5880 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5881 -*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5882 *)
551433a01cab initial coding
carl
parents:
diff changeset
5883 # Do a test to see if this is really a libtool program.
551433a01cab initial coding
carl
parents:
diff changeset
5884 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
5885 # If there is no directory component, then add one.
551433a01cab initial coding
carl
parents:
diff changeset
5886 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
5887 */* | *\\*) . $file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5888 *) . ./$file ;;
551433a01cab initial coding
carl
parents:
diff changeset
5889 esac
551433a01cab initial coding
carl
parents:
diff changeset
5890
551433a01cab initial coding
carl
parents:
diff changeset
5891 # Transform arg to wrapped name.
551433a01cab initial coding
carl
parents:
diff changeset
5892 file="$progdir/$program"
551433a01cab initial coding
carl
parents:
diff changeset
5893 fi
551433a01cab initial coding
carl
parents:
diff changeset
5894 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5895 esac
551433a01cab initial coding
carl
parents:
diff changeset
5896 # Quote arguments (to preserve shell metacharacters).
551433a01cab initial coding
carl
parents:
diff changeset
5897 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
551433a01cab initial coding
carl
parents:
diff changeset
5898 args="$args \"$file\""
551433a01cab initial coding
carl
parents:
diff changeset
5899 done
551433a01cab initial coding
carl
parents:
diff changeset
5900
551433a01cab initial coding
carl
parents:
diff changeset
5901 if test -z "$run"; then
551433a01cab initial coding
carl
parents:
diff changeset
5902 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
5903 # Export the shlibpath_var.
551433a01cab initial coding
carl
parents:
diff changeset
5904 eval "export $shlibpath_var"
551433a01cab initial coding
carl
parents:
diff changeset
5905 fi
551433a01cab initial coding
carl
parents:
diff changeset
5906
551433a01cab initial coding
carl
parents:
diff changeset
5907 # Restore saved environment variables
551433a01cab initial coding
carl
parents:
diff changeset
5908 if test "${save_LC_ALL+set}" = set; then
551433a01cab initial coding
carl
parents:
diff changeset
5909 LC_ALL="$save_LC_ALL"; export LC_ALL
551433a01cab initial coding
carl
parents:
diff changeset
5910 fi
551433a01cab initial coding
carl
parents:
diff changeset
5911 if test "${save_LANG+set}" = set; then
551433a01cab initial coding
carl
parents:
diff changeset
5912 LANG="$save_LANG"; export LANG
551433a01cab initial coding
carl
parents:
diff changeset
5913 fi
551433a01cab initial coding
carl
parents:
diff changeset
5914
551433a01cab initial coding
carl
parents:
diff changeset
5915 # Now prepare to actually exec the command.
551433a01cab initial coding
carl
parents:
diff changeset
5916 exec_cmd="\$cmd$args"
551433a01cab initial coding
carl
parents:
diff changeset
5917 else
551433a01cab initial coding
carl
parents:
diff changeset
5918 # Display what would be done.
551433a01cab initial coding
carl
parents:
diff changeset
5919 if test -n "$shlibpath_var"; then
551433a01cab initial coding
carl
parents:
diff changeset
5920 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
551433a01cab initial coding
carl
parents:
diff changeset
5921 $echo "export $shlibpath_var"
551433a01cab initial coding
carl
parents:
diff changeset
5922 fi
551433a01cab initial coding
carl
parents:
diff changeset
5923 $echo "$cmd$args"
551433a01cab initial coding
carl
parents:
diff changeset
5924 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
5925 fi
551433a01cab initial coding
carl
parents:
diff changeset
5926 ;;
551433a01cab initial coding
carl
parents:
diff changeset
5927
551433a01cab initial coding
carl
parents:
diff changeset
5928 # libtool clean and uninstall mode
551433a01cab initial coding
carl
parents:
diff changeset
5929 clean | uninstall)
551433a01cab initial coding
carl
parents:
diff changeset
5930 modename="$modename: $mode"
551433a01cab initial coding
carl
parents:
diff changeset
5931 rm="$nonopt"
551433a01cab initial coding
carl
parents:
diff changeset
5932 files=
551433a01cab initial coding
carl
parents:
diff changeset
5933 rmforce=
551433a01cab initial coding
carl
parents:
diff changeset
5934 exit_status=0
551433a01cab initial coding
carl
parents:
diff changeset
5935
551433a01cab initial coding
carl
parents:
diff changeset
5936 # This variable tells wrapper scripts just to set variables rather
551433a01cab initial coding
carl
parents:
diff changeset
5937 # than running their programs.
551433a01cab initial coding
carl
parents:
diff changeset
5938 libtool_install_magic="$magic"
551433a01cab initial coding
carl
parents:
diff changeset
5939
551433a01cab initial coding
carl
parents:
diff changeset
5940 for arg
551433a01cab initial coding
carl
parents:
diff changeset
5941 do
551433a01cab initial coding
carl
parents:
diff changeset
5942 case $arg in
551433a01cab initial coding
carl
parents:
diff changeset
5943 -f) rm="$rm $arg"; rmforce=yes ;;
551433a01cab initial coding
carl
parents:
diff changeset
5944 -*) rm="$rm $arg" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5945 *) files="$files $arg" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5946 esac
551433a01cab initial coding
carl
parents:
diff changeset
5947 done
551433a01cab initial coding
carl
parents:
diff changeset
5948
551433a01cab initial coding
carl
parents:
diff changeset
5949 if test -z "$rm"; then
551433a01cab initial coding
carl
parents:
diff changeset
5950 $echo "$modename: you must specify an RM program" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5951 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
5952 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
5953 fi
551433a01cab initial coding
carl
parents:
diff changeset
5954
551433a01cab initial coding
carl
parents:
diff changeset
5955 rmdirs=
551433a01cab initial coding
carl
parents:
diff changeset
5956
551433a01cab initial coding
carl
parents:
diff changeset
5957 origobjdir="$objdir"
551433a01cab initial coding
carl
parents:
diff changeset
5958 for file in $files; do
551433a01cab initial coding
carl
parents:
diff changeset
5959 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5960 if test "X$dir" = "X$file"; then
551433a01cab initial coding
carl
parents:
diff changeset
5961 dir=.
551433a01cab initial coding
carl
parents:
diff changeset
5962 objdir="$origobjdir"
551433a01cab initial coding
carl
parents:
diff changeset
5963 else
551433a01cab initial coding
carl
parents:
diff changeset
5964 objdir="$dir/$origobjdir"
551433a01cab initial coding
carl
parents:
diff changeset
5965 fi
551433a01cab initial coding
carl
parents:
diff changeset
5966 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
551433a01cab initial coding
carl
parents:
diff changeset
5967 test "$mode" = uninstall && objdir="$dir"
551433a01cab initial coding
carl
parents:
diff changeset
5968
551433a01cab initial coding
carl
parents:
diff changeset
5969 # Remember objdir for removal later, being careful to avoid duplicates
551433a01cab initial coding
carl
parents:
diff changeset
5970 if test "$mode" = clean; then
551433a01cab initial coding
carl
parents:
diff changeset
5971 case " $rmdirs " in
551433a01cab initial coding
carl
parents:
diff changeset
5972 *" $objdir "*) ;;
551433a01cab initial coding
carl
parents:
diff changeset
5973 *) rmdirs="$rmdirs $objdir" ;;
551433a01cab initial coding
carl
parents:
diff changeset
5974 esac
551433a01cab initial coding
carl
parents:
diff changeset
5975 fi
551433a01cab initial coding
carl
parents:
diff changeset
5976
551433a01cab initial coding
carl
parents:
diff changeset
5977 # Don't error if the file doesn't exist and rm -f was used.
551433a01cab initial coding
carl
parents:
diff changeset
5978 if (test -L "$file") >/dev/null 2>&1 \
551433a01cab initial coding
carl
parents:
diff changeset
5979 || (test -h "$file") >/dev/null 2>&1 \
551433a01cab initial coding
carl
parents:
diff changeset
5980 || test -f "$file"; then
551433a01cab initial coding
carl
parents:
diff changeset
5981 :
551433a01cab initial coding
carl
parents:
diff changeset
5982 elif test -d "$file"; then
551433a01cab initial coding
carl
parents:
diff changeset
5983 exit_status=1
551433a01cab initial coding
carl
parents:
diff changeset
5984 continue
551433a01cab initial coding
carl
parents:
diff changeset
5985 elif test "$rmforce" = yes; then
551433a01cab initial coding
carl
parents:
diff changeset
5986 continue
551433a01cab initial coding
carl
parents:
diff changeset
5987 fi
551433a01cab initial coding
carl
parents:
diff changeset
5988
551433a01cab initial coding
carl
parents:
diff changeset
5989 rmfiles="$file"
551433a01cab initial coding
carl
parents:
diff changeset
5990
551433a01cab initial coding
carl
parents:
diff changeset
5991 case $name in
551433a01cab initial coding
carl
parents:
diff changeset
5992 *.la)
551433a01cab initial coding
carl
parents:
diff changeset
5993 # Possibly a libtool archive, so verify it.
551433a01cab initial coding
carl
parents:
diff changeset
5994 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
5995 . $dir/$name
551433a01cab initial coding
carl
parents:
diff changeset
5996
551433a01cab initial coding
carl
parents:
diff changeset
5997 # Delete the libtool libraries and symlinks.
551433a01cab initial coding
carl
parents:
diff changeset
5998 for n in $library_names; do
551433a01cab initial coding
carl
parents:
diff changeset
5999 rmfiles="$rmfiles $objdir/$n"
551433a01cab initial coding
carl
parents:
diff changeset
6000 done
551433a01cab initial coding
carl
parents:
diff changeset
6001 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
551433a01cab initial coding
carl
parents:
diff changeset
6002 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
551433a01cab initial coding
carl
parents:
diff changeset
6003
551433a01cab initial coding
carl
parents:
diff changeset
6004 if test "$mode" = uninstall; then
551433a01cab initial coding
carl
parents:
diff changeset
6005 if test -n "$library_names"; then
551433a01cab initial coding
carl
parents:
diff changeset
6006 # Do each command in the postuninstall commands.
551433a01cab initial coding
carl
parents:
diff changeset
6007 eval cmds=\"$postuninstall_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
6008 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
6009 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
6010 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
6011 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
6012 $run eval "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
6013 if test "$?" -ne 0 && test "$rmforce" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
6014 exit_status=1
551433a01cab initial coding
carl
parents:
diff changeset
6015 fi
551433a01cab initial coding
carl
parents:
diff changeset
6016 done
551433a01cab initial coding
carl
parents:
diff changeset
6017 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
6018 fi
551433a01cab initial coding
carl
parents:
diff changeset
6019
551433a01cab initial coding
carl
parents:
diff changeset
6020 if test -n "$old_library"; then
551433a01cab initial coding
carl
parents:
diff changeset
6021 # Do each command in the old_postuninstall commands.
551433a01cab initial coding
carl
parents:
diff changeset
6022 eval cmds=\"$old_postuninstall_cmds\"
551433a01cab initial coding
carl
parents:
diff changeset
6023 save_ifs="$IFS"; IFS='~'
551433a01cab initial coding
carl
parents:
diff changeset
6024 for cmd in $cmds; do
551433a01cab initial coding
carl
parents:
diff changeset
6025 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
6026 $show "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
6027 $run eval "$cmd"
551433a01cab initial coding
carl
parents:
diff changeset
6028 if test "$?" -ne 0 && test "$rmforce" != yes; then
551433a01cab initial coding
carl
parents:
diff changeset
6029 exit_status=1
551433a01cab initial coding
carl
parents:
diff changeset
6030 fi
551433a01cab initial coding
carl
parents:
diff changeset
6031 done
551433a01cab initial coding
carl
parents:
diff changeset
6032 IFS="$save_ifs"
551433a01cab initial coding
carl
parents:
diff changeset
6033 fi
551433a01cab initial coding
carl
parents:
diff changeset
6034 # FIXME: should reinstall the best remaining shared library.
551433a01cab initial coding
carl
parents:
diff changeset
6035 fi
551433a01cab initial coding
carl
parents:
diff changeset
6036 fi
551433a01cab initial coding
carl
parents:
diff changeset
6037 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6038
551433a01cab initial coding
carl
parents:
diff changeset
6039 *.lo)
551433a01cab initial coding
carl
parents:
diff changeset
6040 # Possibly a libtool object, so verify it.
551433a01cab initial coding
carl
parents:
diff changeset
6041 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
6042
551433a01cab initial coding
carl
parents:
diff changeset
6043 # Read the .lo file
551433a01cab initial coding
carl
parents:
diff changeset
6044 . $dir/$name
551433a01cab initial coding
carl
parents:
diff changeset
6045
551433a01cab initial coding
carl
parents:
diff changeset
6046 # Add PIC object to the list of files to remove.
551433a01cab initial coding
carl
parents:
diff changeset
6047 if test -n "$pic_object" \
551433a01cab initial coding
carl
parents:
diff changeset
6048 && test "$pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
6049 rmfiles="$rmfiles $dir/$pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
6050 fi
551433a01cab initial coding
carl
parents:
diff changeset
6051
551433a01cab initial coding
carl
parents:
diff changeset
6052 # Add non-PIC object to the list of files to remove.
551433a01cab initial coding
carl
parents:
diff changeset
6053 if test -n "$non_pic_object" \
551433a01cab initial coding
carl
parents:
diff changeset
6054 && test "$non_pic_object" != none; then
551433a01cab initial coding
carl
parents:
diff changeset
6055 rmfiles="$rmfiles $dir/$non_pic_object"
551433a01cab initial coding
carl
parents:
diff changeset
6056 fi
551433a01cab initial coding
carl
parents:
diff changeset
6057 fi
551433a01cab initial coding
carl
parents:
diff changeset
6058 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6059
551433a01cab initial coding
carl
parents:
diff changeset
6060 *)
551433a01cab initial coding
carl
parents:
diff changeset
6061 if test "$mode" = clean ; then
551433a01cab initial coding
carl
parents:
diff changeset
6062 noexename=$name
551433a01cab initial coding
carl
parents:
diff changeset
6063 case $file in
551433a01cab initial coding
carl
parents:
diff changeset
6064 *.exe)
551433a01cab initial coding
carl
parents:
diff changeset
6065 file=`$echo $file|${SED} 's,.exe$,,'`
551433a01cab initial coding
carl
parents:
diff changeset
6066 noexename=`$echo $name|${SED} 's,.exe$,,'`
551433a01cab initial coding
carl
parents:
diff changeset
6067 # $file with .exe has already been added to rmfiles,
551433a01cab initial coding
carl
parents:
diff changeset
6068 # add $file without .exe
551433a01cab initial coding
carl
parents:
diff changeset
6069 rmfiles="$rmfiles $file"
551433a01cab initial coding
carl
parents:
diff changeset
6070 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6071 esac
551433a01cab initial coding
carl
parents:
diff changeset
6072 # Do a test to see if this is a libtool program.
551433a01cab initial coding
carl
parents:
diff changeset
6073 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
551433a01cab initial coding
carl
parents:
diff changeset
6074 relink_command=
551433a01cab initial coding
carl
parents:
diff changeset
6075 . $dir/$noexename
551433a01cab initial coding
carl
parents:
diff changeset
6076
551433a01cab initial coding
carl
parents:
diff changeset
6077 # note $name still contains .exe if it was in $file originally
551433a01cab initial coding
carl
parents:
diff changeset
6078 # as does the version of $file that was added into $rmfiles
551433a01cab initial coding
carl
parents:
diff changeset
6079 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
551433a01cab initial coding
carl
parents:
diff changeset
6080 if test "$fast_install" = yes && test -n "$relink_command"; then
551433a01cab initial coding
carl
parents:
diff changeset
6081 rmfiles="$rmfiles $objdir/lt-$name"
551433a01cab initial coding
carl
parents:
diff changeset
6082 fi
551433a01cab initial coding
carl
parents:
diff changeset
6083 if test "X$noexename" != "X$name" ; then
551433a01cab initial coding
carl
parents:
diff changeset
6084 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
551433a01cab initial coding
carl
parents:
diff changeset
6085 fi
551433a01cab initial coding
carl
parents:
diff changeset
6086 fi
551433a01cab initial coding
carl
parents:
diff changeset
6087 fi
551433a01cab initial coding
carl
parents:
diff changeset
6088 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6089 esac
551433a01cab initial coding
carl
parents:
diff changeset
6090 $show "$rm $rmfiles"
551433a01cab initial coding
carl
parents:
diff changeset
6091 $run $rm $rmfiles || exit_status=1
551433a01cab initial coding
carl
parents:
diff changeset
6092 done
551433a01cab initial coding
carl
parents:
diff changeset
6093 objdir="$origobjdir"
551433a01cab initial coding
carl
parents:
diff changeset
6094
551433a01cab initial coding
carl
parents:
diff changeset
6095 # Try to remove the ${objdir}s in the directories where we deleted files
551433a01cab initial coding
carl
parents:
diff changeset
6096 for dir in $rmdirs; do
551433a01cab initial coding
carl
parents:
diff changeset
6097 if test -d "$dir"; then
551433a01cab initial coding
carl
parents:
diff changeset
6098 $show "rmdir $dir"
551433a01cab initial coding
carl
parents:
diff changeset
6099 $run rmdir $dir >/dev/null 2>&1
551433a01cab initial coding
carl
parents:
diff changeset
6100 fi
551433a01cab initial coding
carl
parents:
diff changeset
6101 done
551433a01cab initial coding
carl
parents:
diff changeset
6102
551433a01cab initial coding
carl
parents:
diff changeset
6103 exit $exit_status
551433a01cab initial coding
carl
parents:
diff changeset
6104 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6105
551433a01cab initial coding
carl
parents:
diff changeset
6106 "")
551433a01cab initial coding
carl
parents:
diff changeset
6107 $echo "$modename: you must specify a MODE" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6108 $echo "$generic_help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6109 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
6110 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6111 esac
551433a01cab initial coding
carl
parents:
diff changeset
6112
551433a01cab initial coding
carl
parents:
diff changeset
6113 if test -z "$exec_cmd"; then
551433a01cab initial coding
carl
parents:
diff changeset
6114 $echo "$modename: invalid operation mode \`$mode'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6115 $echo "$generic_help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6116 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
6117 fi
551433a01cab initial coding
carl
parents:
diff changeset
6118 fi # test -z "$show_help"
551433a01cab initial coding
carl
parents:
diff changeset
6119
551433a01cab initial coding
carl
parents:
diff changeset
6120 if test -n "$exec_cmd"; then
551433a01cab initial coding
carl
parents:
diff changeset
6121 eval exec $exec_cmd
551433a01cab initial coding
carl
parents:
diff changeset
6122 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
6123 fi
551433a01cab initial coding
carl
parents:
diff changeset
6124
551433a01cab initial coding
carl
parents:
diff changeset
6125 # We need to display help for each of the modes.
551433a01cab initial coding
carl
parents:
diff changeset
6126 case $mode in
551433a01cab initial coding
carl
parents:
diff changeset
6127 "") $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6128 "Usage: $modename [OPTION]... [MODE-ARG]...
551433a01cab initial coding
carl
parents:
diff changeset
6129
551433a01cab initial coding
carl
parents:
diff changeset
6130 Provide generalized library-building support services.
551433a01cab initial coding
carl
parents:
diff changeset
6131
551433a01cab initial coding
carl
parents:
diff changeset
6132 --config show all configuration variables
551433a01cab initial coding
carl
parents:
diff changeset
6133 --debug enable verbose shell tracing
551433a01cab initial coding
carl
parents:
diff changeset
6134 -n, --dry-run display commands without modifying any files
551433a01cab initial coding
carl
parents:
diff changeset
6135 --features display basic configuration information and exit
551433a01cab initial coding
carl
parents:
diff changeset
6136 --finish same as \`--mode=finish'
551433a01cab initial coding
carl
parents:
diff changeset
6137 --help display this help message and exit
551433a01cab initial coding
carl
parents:
diff changeset
6138 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
551433a01cab initial coding
carl
parents:
diff changeset
6139 --quiet same as \`--silent'
551433a01cab initial coding
carl
parents:
diff changeset
6140 --silent don't print informational messages
551433a01cab initial coding
carl
parents:
diff changeset
6141 --tag=TAG use configuration variables from tag TAG
551433a01cab initial coding
carl
parents:
diff changeset
6142 --version print version information
551433a01cab initial coding
carl
parents:
diff changeset
6143
551433a01cab initial coding
carl
parents:
diff changeset
6144 MODE must be one of the following:
551433a01cab initial coding
carl
parents:
diff changeset
6145
551433a01cab initial coding
carl
parents:
diff changeset
6146 clean remove files from the build directory
551433a01cab initial coding
carl
parents:
diff changeset
6147 compile compile a source file into a libtool object
551433a01cab initial coding
carl
parents:
diff changeset
6148 execute automatically set library path, then run a program
551433a01cab initial coding
carl
parents:
diff changeset
6149 finish complete the installation of libtool libraries
551433a01cab initial coding
carl
parents:
diff changeset
6150 install install libraries or executables
551433a01cab initial coding
carl
parents:
diff changeset
6151 link create a library or an executable
551433a01cab initial coding
carl
parents:
diff changeset
6152 uninstall remove libraries from an installed directory
551433a01cab initial coding
carl
parents:
diff changeset
6153
551433a01cab initial coding
carl
parents:
diff changeset
6154 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
551433a01cab initial coding
carl
parents:
diff changeset
6155 a more detailed description of MODE.
551433a01cab initial coding
carl
parents:
diff changeset
6156
551433a01cab initial coding
carl
parents:
diff changeset
6157 Report bugs to <bug-libtool@gnu.org>."
551433a01cab initial coding
carl
parents:
diff changeset
6158 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
6159 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6160
551433a01cab initial coding
carl
parents:
diff changeset
6161 clean)
551433a01cab initial coding
carl
parents:
diff changeset
6162 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6163 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
551433a01cab initial coding
carl
parents:
diff changeset
6164
551433a01cab initial coding
carl
parents:
diff changeset
6165 Remove files from the build directory.
551433a01cab initial coding
carl
parents:
diff changeset
6166
551433a01cab initial coding
carl
parents:
diff changeset
6167 RM is the name of the program to use to delete files associated with each FILE
551433a01cab initial coding
carl
parents:
diff changeset
6168 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
551433a01cab initial coding
carl
parents:
diff changeset
6169 to RM.
551433a01cab initial coding
carl
parents:
diff changeset
6170
551433a01cab initial coding
carl
parents:
diff changeset
6171 If FILE is a libtool library, object or program, all the files associated
551433a01cab initial coding
carl
parents:
diff changeset
6172 with it are deleted. Otherwise, only FILE itself is deleted using RM."
551433a01cab initial coding
carl
parents:
diff changeset
6173 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6174
551433a01cab initial coding
carl
parents:
diff changeset
6175 compile)
551433a01cab initial coding
carl
parents:
diff changeset
6176 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6177 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
551433a01cab initial coding
carl
parents:
diff changeset
6178
551433a01cab initial coding
carl
parents:
diff changeset
6179 Compile a source file into a libtool library object.
551433a01cab initial coding
carl
parents:
diff changeset
6180
551433a01cab initial coding
carl
parents:
diff changeset
6181 This mode accepts the following additional options:
551433a01cab initial coding
carl
parents:
diff changeset
6182
551433a01cab initial coding
carl
parents:
diff changeset
6183 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
551433a01cab initial coding
carl
parents:
diff changeset
6184 -prefer-pic try to building PIC objects only
551433a01cab initial coding
carl
parents:
diff changeset
6185 -prefer-non-pic try to building non-PIC objects only
551433a01cab initial coding
carl
parents:
diff changeset
6186 -static always build a \`.o' file suitable for static linking
551433a01cab initial coding
carl
parents:
diff changeset
6187
551433a01cab initial coding
carl
parents:
diff changeset
6188 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
551433a01cab initial coding
carl
parents:
diff changeset
6189 from the given SOURCEFILE.
551433a01cab initial coding
carl
parents:
diff changeset
6190
551433a01cab initial coding
carl
parents:
diff changeset
6191 The output file name is determined by removing the directory component from
551433a01cab initial coding
carl
parents:
diff changeset
6192 SOURCEFILE, then substituting the C source code suffix \`.c' with the
551433a01cab initial coding
carl
parents:
diff changeset
6193 library object suffix, \`.lo'."
551433a01cab initial coding
carl
parents:
diff changeset
6194 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6195
551433a01cab initial coding
carl
parents:
diff changeset
6196 execute)
551433a01cab initial coding
carl
parents:
diff changeset
6197 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6198 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
551433a01cab initial coding
carl
parents:
diff changeset
6199
551433a01cab initial coding
carl
parents:
diff changeset
6200 Automatically set library path, then run a program.
551433a01cab initial coding
carl
parents:
diff changeset
6201
551433a01cab initial coding
carl
parents:
diff changeset
6202 This mode accepts the following additional options:
551433a01cab initial coding
carl
parents:
diff changeset
6203
551433a01cab initial coding
carl
parents:
diff changeset
6204 -dlopen FILE add the directory containing FILE to the library path
551433a01cab initial coding
carl
parents:
diff changeset
6205
551433a01cab initial coding
carl
parents:
diff changeset
6206 This mode sets the library path environment variable according to \`-dlopen'
551433a01cab initial coding
carl
parents:
diff changeset
6207 flags.
551433a01cab initial coding
carl
parents:
diff changeset
6208
551433a01cab initial coding
carl
parents:
diff changeset
6209 If any of the ARGS are libtool executable wrappers, then they are translated
551433a01cab initial coding
carl
parents:
diff changeset
6210 into their corresponding uninstalled binary, and any of their required library
551433a01cab initial coding
carl
parents:
diff changeset
6211 directories are added to the library path.
551433a01cab initial coding
carl
parents:
diff changeset
6212
551433a01cab initial coding
carl
parents:
diff changeset
6213 Then, COMMAND is executed, with ARGS as arguments."
551433a01cab initial coding
carl
parents:
diff changeset
6214 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6215
551433a01cab initial coding
carl
parents:
diff changeset
6216 finish)
551433a01cab initial coding
carl
parents:
diff changeset
6217 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6218 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
551433a01cab initial coding
carl
parents:
diff changeset
6219
551433a01cab initial coding
carl
parents:
diff changeset
6220 Complete the installation of libtool libraries.
551433a01cab initial coding
carl
parents:
diff changeset
6221
551433a01cab initial coding
carl
parents:
diff changeset
6222 Each LIBDIR is a directory that contains libtool libraries.
551433a01cab initial coding
carl
parents:
diff changeset
6223
551433a01cab initial coding
carl
parents:
diff changeset
6224 The commands that this mode executes may require superuser privileges. Use
551433a01cab initial coding
carl
parents:
diff changeset
6225 the \`--dry-run' option if you just want to see what would be executed."
551433a01cab initial coding
carl
parents:
diff changeset
6226 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6227
551433a01cab initial coding
carl
parents:
diff changeset
6228 install)
551433a01cab initial coding
carl
parents:
diff changeset
6229 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6230 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
551433a01cab initial coding
carl
parents:
diff changeset
6231
551433a01cab initial coding
carl
parents:
diff changeset
6232 Install executables or libraries.
551433a01cab initial coding
carl
parents:
diff changeset
6233
551433a01cab initial coding
carl
parents:
diff changeset
6234 INSTALL-COMMAND is the installation command. The first component should be
551433a01cab initial coding
carl
parents:
diff changeset
6235 either the \`install' or \`cp' program.
551433a01cab initial coding
carl
parents:
diff changeset
6236
551433a01cab initial coding
carl
parents:
diff changeset
6237 The rest of the components are interpreted as arguments to that command (only
551433a01cab initial coding
carl
parents:
diff changeset
6238 BSD-compatible install options are recognized)."
551433a01cab initial coding
carl
parents:
diff changeset
6239 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6240
551433a01cab initial coding
carl
parents:
diff changeset
6241 link)
551433a01cab initial coding
carl
parents:
diff changeset
6242 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6243 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
551433a01cab initial coding
carl
parents:
diff changeset
6244
551433a01cab initial coding
carl
parents:
diff changeset
6245 Link object files or libraries together to form another library, or to
551433a01cab initial coding
carl
parents:
diff changeset
6246 create an executable program.
551433a01cab initial coding
carl
parents:
diff changeset
6247
551433a01cab initial coding
carl
parents:
diff changeset
6248 LINK-COMMAND is a command using the C compiler that you would use to create
551433a01cab initial coding
carl
parents:
diff changeset
6249 a program from several object files.
551433a01cab initial coding
carl
parents:
diff changeset
6250
551433a01cab initial coding
carl
parents:
diff changeset
6251 The following components of LINK-COMMAND are treated specially:
551433a01cab initial coding
carl
parents:
diff changeset
6252
551433a01cab initial coding
carl
parents:
diff changeset
6253 -all-static do not do any dynamic linking at all
551433a01cab initial coding
carl
parents:
diff changeset
6254 -avoid-version do not add a version suffix if possible
551433a01cab initial coding
carl
parents:
diff changeset
6255 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
551433a01cab initial coding
carl
parents:
diff changeset
6256 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
551433a01cab initial coding
carl
parents:
diff changeset
6257 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
551433a01cab initial coding
carl
parents:
diff changeset
6258 -export-symbols SYMFILE
551433a01cab initial coding
carl
parents:
diff changeset
6259 try to export only the symbols listed in SYMFILE
551433a01cab initial coding
carl
parents:
diff changeset
6260 -export-symbols-regex REGEX
551433a01cab initial coding
carl
parents:
diff changeset
6261 try to export only the symbols matching REGEX
551433a01cab initial coding
carl
parents:
diff changeset
6262 -LLIBDIR search LIBDIR for required installed libraries
551433a01cab initial coding
carl
parents:
diff changeset
6263 -lNAME OUTPUT-FILE requires the installed library libNAME
551433a01cab initial coding
carl
parents:
diff changeset
6264 -module build a library that can dlopened
551433a01cab initial coding
carl
parents:
diff changeset
6265 -no-fast-install disable the fast-install mode
551433a01cab initial coding
carl
parents:
diff changeset
6266 -no-install link a not-installable executable
551433a01cab initial coding
carl
parents:
diff changeset
6267 -no-undefined declare that a library does not refer to external symbols
551433a01cab initial coding
carl
parents:
diff changeset
6268 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
551433a01cab initial coding
carl
parents:
diff changeset
6269 -objectlist FILE Use a list of object files found in FILE to specify objects
551433a01cab initial coding
carl
parents:
diff changeset
6270 -release RELEASE specify package release information
551433a01cab initial coding
carl
parents:
diff changeset
6271 -rpath LIBDIR the created library will eventually be installed in LIBDIR
551433a01cab initial coding
carl
parents:
diff changeset
6272 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
551433a01cab initial coding
carl
parents:
diff changeset
6273 -static do not do any dynamic linking of libtool libraries
551433a01cab initial coding
carl
parents:
diff changeset
6274 -version-info CURRENT[:REVISION[:AGE]]
551433a01cab initial coding
carl
parents:
diff changeset
6275 specify library version info [each variable defaults to 0]
551433a01cab initial coding
carl
parents:
diff changeset
6276
551433a01cab initial coding
carl
parents:
diff changeset
6277 All other options (arguments beginning with \`-') are ignored.
551433a01cab initial coding
carl
parents:
diff changeset
6278
551433a01cab initial coding
carl
parents:
diff changeset
6279 Every other argument is treated as a filename. Files ending in \`.la' are
551433a01cab initial coding
carl
parents:
diff changeset
6280 treated as uninstalled libtool libraries, other files are standard or library
551433a01cab initial coding
carl
parents:
diff changeset
6281 object files.
551433a01cab initial coding
carl
parents:
diff changeset
6282
551433a01cab initial coding
carl
parents:
diff changeset
6283 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
551433a01cab initial coding
carl
parents:
diff changeset
6284 only library objects (\`.lo' files) may be specified, and \`-rpath' is
551433a01cab initial coding
carl
parents:
diff changeset
6285 required, except when creating a convenience library.
551433a01cab initial coding
carl
parents:
diff changeset
6286
551433a01cab initial coding
carl
parents:
diff changeset
6287 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
551433a01cab initial coding
carl
parents:
diff changeset
6288 using \`ar' and \`ranlib', or on Windows using \`lib'.
551433a01cab initial coding
carl
parents:
diff changeset
6289
551433a01cab initial coding
carl
parents:
diff changeset
6290 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
551433a01cab initial coding
carl
parents:
diff changeset
6291 is created, otherwise an executable program is created."
551433a01cab initial coding
carl
parents:
diff changeset
6292 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6293
551433a01cab initial coding
carl
parents:
diff changeset
6294 uninstall)
551433a01cab initial coding
carl
parents:
diff changeset
6295 $echo \
551433a01cab initial coding
carl
parents:
diff changeset
6296 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
551433a01cab initial coding
carl
parents:
diff changeset
6297
551433a01cab initial coding
carl
parents:
diff changeset
6298 Remove libraries from an installation directory.
551433a01cab initial coding
carl
parents:
diff changeset
6299
551433a01cab initial coding
carl
parents:
diff changeset
6300 RM is the name of the program to use to delete files associated with each FILE
551433a01cab initial coding
carl
parents:
diff changeset
6301 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
551433a01cab initial coding
carl
parents:
diff changeset
6302 to RM.
551433a01cab initial coding
carl
parents:
diff changeset
6303
551433a01cab initial coding
carl
parents:
diff changeset
6304 If FILE is a libtool library, all the files associated with it are deleted.
551433a01cab initial coding
carl
parents:
diff changeset
6305 Otherwise, only FILE itself is deleted using RM."
551433a01cab initial coding
carl
parents:
diff changeset
6306 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6307
551433a01cab initial coding
carl
parents:
diff changeset
6308 *)
551433a01cab initial coding
carl
parents:
diff changeset
6309 $echo "$modename: invalid operation mode \`$mode'" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6310 $echo "$help" 1>&2
551433a01cab initial coding
carl
parents:
diff changeset
6311 exit 1
551433a01cab initial coding
carl
parents:
diff changeset
6312 ;;
551433a01cab initial coding
carl
parents:
diff changeset
6313 esac
551433a01cab initial coding
carl
parents:
diff changeset
6314
551433a01cab initial coding
carl
parents:
diff changeset
6315 $echo
551433a01cab initial coding
carl
parents:
diff changeset
6316 $echo "Try \`$modename --help' for more information about other modes."
551433a01cab initial coding
carl
parents:
diff changeset
6317
551433a01cab initial coding
carl
parents:
diff changeset
6318 exit 0
551433a01cab initial coding
carl
parents:
diff changeset
6319
551433a01cab initial coding
carl
parents:
diff changeset
6320 # The TAGs below are defined such that we never get into a situation
551433a01cab initial coding
carl
parents:
diff changeset
6321 # in which we disable both kinds of libraries. Given conflicting
551433a01cab initial coding
carl
parents:
diff changeset
6322 # choices, we go for a static library, that is the most portable,
551433a01cab initial coding
carl
parents:
diff changeset
6323 # since we can't tell whether shared libraries were disabled because
551433a01cab initial coding
carl
parents:
diff changeset
6324 # the user asked for that or because the platform doesn't support
551433a01cab initial coding
carl
parents:
diff changeset
6325 # them. This is particularly important on AIX, because we don't
551433a01cab initial coding
carl
parents:
diff changeset
6326 # support having both static and shared libraries enabled at the same
551433a01cab initial coding
carl
parents:
diff changeset
6327 # time on that platform, so we default to a shared-only configuration.
551433a01cab initial coding
carl
parents:
diff changeset
6328 # If a disable-shared tag is given, we'll fallback to a static-only
551433a01cab initial coding
carl
parents:
diff changeset
6329 # configuration. But we'll never go from static-only to shared-only.
551433a01cab initial coding
carl
parents:
diff changeset
6330
551433a01cab initial coding
carl
parents:
diff changeset
6331 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
551433a01cab initial coding
carl
parents:
diff changeset
6332 build_libtool_libs=no
551433a01cab initial coding
carl
parents:
diff changeset
6333 build_old_libs=yes
551433a01cab initial coding
carl
parents:
diff changeset
6334 # ### END LIBTOOL TAG CONFIG: disable-shared
551433a01cab initial coding
carl
parents:
diff changeset
6335
551433a01cab initial coding
carl
parents:
diff changeset
6336 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
551433a01cab initial coding
carl
parents:
diff changeset
6337 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
551433a01cab initial coding
carl
parents:
diff changeset
6338 # ### END LIBTOOL TAG CONFIG: disable-static
551433a01cab initial coding
carl
parents:
diff changeset
6339
551433a01cab initial coding
carl
parents:
diff changeset
6340 # Local Variables:
551433a01cab initial coding
carl
parents:
diff changeset
6341 # mode:shell-script
551433a01cab initial coding
carl
parents:
diff changeset
6342 # sh-indentation:2
551433a01cab initial coding
carl
parents:
diff changeset
6343 # End: