diff options
author | Jay Threeth | 2011-04-04 11:48:26 -0700 |
---|---|---|
committer | Jay Threeth | 2011-04-04 11:48:26 -0700 |
commit | 3c9cc506f741b980565ff5b3b001cd8b6ee36b12 (patch) | |
tree | cb862c57b3d5f74177cde3bd962a53fc377166f6 /linden/indra/libgpg-error/libgpg-error-1.0/ltmain.sh | |
parent | build fixes, might build on linux now (diff) | |
download | meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.zip meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.gz meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.bz2 meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.xz |
add source to libraries, and cruft for building under windows
Diffstat (limited to '')
-rwxr-xr-x | linden/indra/libgpg-error/libgpg-error-1.0/ltmain.sh | 5115 |
1 files changed, 5115 insertions, 0 deletions
diff --git a/linden/indra/libgpg-error/libgpg-error-1.0/ltmain.sh b/linden/indra/libgpg-error/libgpg-error-1.0/ltmain.sh new file mode 100755 index 0000000..df1cb00 --- /dev/null +++ b/linden/indra/libgpg-error/libgpg-error-1.0/ltmain.sh | |||
@@ -0,0 +1,5115 @@ | |||
1 | # ltmain.sh - Provide generalized library-building support services. | ||
2 | # NOTE: Changing this file will not affect anything until you rerun configure. | ||
3 | # | ||
4 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 | ||
5 | # Free Software Foundation, Inc. | ||
6 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 | ||
7 | # | ||
8 | # This program is free software; you can redistribute it and/or modify | ||
9 | # it under the terms of the GNU General Public License as published by | ||
10 | # the Free Software Foundation; either version 2 of the License, or | ||
11 | # (at your option) any later version. | ||
12 | # | ||
13 | # This program is distributed in the hope that it will be useful, but | ||
14 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | # General Public License for more details. | ||
17 | # | ||
18 | # You should have received a copy of the GNU General Public License | ||
19 | # along with this program; if not, write to the Free Software | ||
20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
21 | # | ||
22 | # As a special exception to the GNU General Public License, if you | ||
23 | # distribute this file as part of a program that contains a | ||
24 | # configuration script generated by Autoconf, you may include it under | ||
25 | # the same distribution terms that you use for the rest of that program. | ||
26 | |||
27 | # Check that we have a working $echo. | ||
28 | if test "X$1" = X--no-reexec; then | ||
29 | # Discard the --no-reexec flag, and continue. | ||
30 | shift | ||
31 | elif test "X$1" = X--fallback-echo; then | ||
32 | # Avoid inline document here, it may be left over | ||
33 | : | ||
34 | elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then | ||
35 | # Yippee, $echo works! | ||
36 | : | ||
37 | else | ||
38 | # Restart under the correct shell, and then maybe $echo will work. | ||
39 | exec $SHELL "$0" --no-reexec ${1+"$@"} | ||
40 | fi | ||
41 | |||
42 | if test "X$1" = X--fallback-echo; then | ||
43 | # used as fallback echo | ||
44 | shift | ||
45 | cat <<EOF | ||
46 | $* | ||
47 | EOF | ||
48 | exit 0 | ||
49 | fi | ||
50 | |||
51 | # The name of this program. | ||
52 | progname=`$echo "$0" | ${SED} 's%^.*/%%'` | ||
53 | modename="$progname" | ||
54 | |||
55 | # Constants. | ||
56 | PROGRAM=ltmain.sh | ||
57 | PACKAGE=libtool | ||
58 | VERSION=1.4.3 | ||
59 | TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)" | ||
60 | |||
61 | default_mode= | ||
62 | help="Try \`$progname --help' for more information." | ||
63 | magic="%%%MAGIC variable%%%" | ||
64 | mkdir="mkdir" | ||
65 | mv="mv -f" | ||
66 | rm="rm -f" | ||
67 | |||
68 | # Sed substitution that helps us do robust quoting. It backslashifies | ||
69 | # metacharacters that are still active within double-quoted strings. | ||
70 | Xsed="${SED}"' -e 1s/^X//' | ||
71 | sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' | ||
72 | # test EBCDIC or ASCII | ||
73 | case `echo A|od -x` in | ||
74 | *[Cc]1*) # EBCDIC based system | ||
75 | SP2NL="tr '\100' '\n'" | ||
76 | NL2SP="tr '\r\n' '\100\100'" | ||
77 | ;; | ||
78 | *) # Assume ASCII based system | ||
79 | SP2NL="tr '\040' '\012'" | ||
80 | NL2SP="tr '\015\012' '\040\040'" | ||
81 | ;; | ||
82 | esac | ||
83 | |||
84 | # NLS nuisances. | ||
85 | # Only set LANG and LC_ALL to C if already set. | ||
86 | # These must not be set unconditionally because not all systems understand | ||
87 | # e.g. LANG=C (notably SCO). | ||
88 | # We save the old values to restore during execute mode. | ||
89 | if test "${LC_ALL+set}" = set; then | ||
90 | save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL | ||
91 | fi | ||
92 | if test "${LANG+set}" = set; then | ||
93 | save_LANG="$LANG"; LANG=C; export LANG | ||
94 | fi | ||
95 | |||
96 | # Make sure IFS has a sensible default | ||
97 | : ${IFS=" | ||
98 | "} | ||
99 | |||
100 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | ||
101 | echo "$modename: not configured to build any kind of library" 1>&2 | ||
102 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | ||
103 | exit 1 | ||
104 | fi | ||
105 | |||
106 | # Global variables. | ||
107 | mode=$default_mode | ||
108 | nonopt= | ||
109 | prev= | ||
110 | prevopt= | ||
111 | run= | ||
112 | show="$echo" | ||
113 | show_help= | ||
114 | execute_dlfiles= | ||
115 | lo2o="s/\\.lo\$/.${objext}/" | ||
116 | o2lo="s/\\.${objext}\$/.lo/" | ||
117 | |||
118 | # Parse our command line options once, thoroughly. | ||
119 | while test $# -gt 0 | ||
120 | do | ||
121 | arg="$1" | ||
122 | shift | ||
123 | |||
124 | case $arg in | ||
125 | -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; | ||
126 | *) optarg= ;; | ||
127 | esac | ||
128 | |||
129 | # If the previous option needs an argument, assign it. | ||
130 | if test -n "$prev"; then | ||
131 | case $prev in | ||
132 | execute_dlfiles) | ||
133 | execute_dlfiles="$execute_dlfiles $arg" | ||
134 | ;; | ||
135 | *) | ||
136 | eval "$prev=\$arg" | ||
137 | ;; | ||
138 | esac | ||
139 | |||
140 | prev= | ||
141 | prevopt= | ||
142 | continue | ||
143 | fi | ||
144 | |||
145 | # Have we seen a non-optional argument yet? | ||
146 | case $arg in | ||
147 | --help) | ||
148 | show_help=yes | ||
149 | ;; | ||
150 | |||
151 | --version) | ||
152 | echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" | ||
153 | exit 0 | ||
154 | ;; | ||
155 | |||
156 | --config) | ||
157 | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 | ||
158 | exit 0 | ||
159 | ;; | ||
160 | |||
161 | --debug) | ||
162 | echo "$progname: enabling shell trace mode" | ||
163 | set -x | ||
164 | ;; | ||
165 | |||
166 | --dry-run | -n) | ||
167 | run=: | ||
168 | ;; | ||
169 | |||
170 | --features) | ||
171 | echo "host: $host" | ||
172 | if test "$build_libtool_libs" = yes; then | ||
173 | echo "enable shared libraries" | ||
174 | else | ||
175 | echo "disable shared libraries" | ||
176 | fi | ||
177 | if test "$build_old_libs" = yes; then | ||
178 | echo "enable static libraries" | ||
179 | else | ||
180 | echo "disable static libraries" | ||
181 | fi | ||
182 | exit 0 | ||
183 | ;; | ||
184 | |||
185 | --finish) mode="finish" ;; | ||
186 | |||
187 | --mode) prevopt="--mode" prev=mode ;; | ||
188 | --mode=*) mode="$optarg" ;; | ||
189 | |||
190 | --preserve-dup-deps) duplicate_deps="yes" ;; | ||
191 | |||
192 | --quiet | --silent) | ||
193 | show=: | ||
194 | ;; | ||
195 | |||
196 | -dlopen) | ||
197 | prevopt="-dlopen" | ||
198 | prev=execute_dlfiles | ||
199 | ;; | ||
200 | |||
201 | -*) | ||
202 | $echo "$modename: unrecognized option \`$arg'" 1>&2 | ||
203 | $echo "$help" 1>&2 | ||
204 | exit 1 | ||
205 | ;; | ||
206 | |||
207 | *) | ||
208 | nonopt="$arg" | ||
209 | break | ||
210 | ;; | ||
211 | esac | ||
212 | done | ||
213 | |||
214 | if test -n "$prevopt"; then | ||
215 | $echo "$modename: option \`$prevopt' requires an argument" 1>&2 | ||
216 | $echo "$help" 1>&2 | ||
217 | exit 1 | ||
218 | fi | ||
219 | |||
220 | # If this variable is set in any of the actions, the command in it | ||
221 | # will be execed at the end. This prevents here-documents from being | ||
222 | # left over by shells. | ||
223 | exec_cmd= | ||
224 | |||
225 | if test -z "$show_help"; then | ||
226 | |||
227 | # Infer the operation mode. | ||
228 | if test -z "$mode"; then | ||
229 | case $nonopt in | ||
230 | *cc | *++ | gcc* | *-gcc* | g++* | xlc*) | ||
231 | mode=link | ||
232 | for arg | ||
233 | do | ||
234 | case $arg in | ||
235 | -c) | ||
236 | mode=compile | ||
237 | break | ||
238 | ;; | ||
239 | esac | ||
240 | done | ||
241 | ;; | ||
242 | *db | *dbx | *strace | *truss) | ||
243 | mode=execute | ||
244 | ;; | ||
245 | *install*|cp|mv) | ||
246 | mode=install | ||
247 | ;; | ||
248 | *rm) | ||
249 | mode=uninstall | ||
250 | ;; | ||
251 | *) | ||
252 | # If we have no mode, but dlfiles were specified, then do execute mode. | ||
253 | test -n "$execute_dlfiles" && mode=execute | ||
254 | |||
255 | # Just use the default operation mode. | ||
256 | if test -z "$mode"; then | ||
257 | if test -n "$nonopt"; then | ||
258 | $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 | ||
259 | else | ||
260 | $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 | ||
261 | fi | ||
262 | fi | ||
263 | ;; | ||
264 | esac | ||
265 | fi | ||
266 | |||
267 | # Only execute mode is allowed to have -dlopen flags. | ||
268 | if test -n "$execute_dlfiles" && test "$mode" != execute; then | ||
269 | $echo "$modename: unrecognized option \`-dlopen'" 1>&2 | ||
270 | $echo "$help" 1>&2 | ||
271 | exit 1 | ||
272 | fi | ||
273 | |||
274 | # Change the help message to a mode-specific one. | ||
275 | generic_help="$help" | ||
276 | help="Try \`$modename --help --mode=$mode' for more information." | ||
277 | |||
278 | # These modes are in order of execution frequency so that they run quickly. | ||
279 | case $mode in | ||
280 | # libtool compile mode | ||
281 | compile) | ||
282 | modename="$modename: compile" | ||
283 | # Get the compilation command and the source file. | ||
284 | base_compile= | ||
285 | prev= | ||
286 | lastarg= | ||
287 | srcfile="$nonopt" | ||
288 | suppress_output= | ||
289 | |||
290 | user_target=no | ||
291 | for arg | ||
292 | do | ||
293 | case $prev in | ||
294 | "") ;; | ||
295 | xcompiler) | ||
296 | # Aesthetically quote the previous argument. | ||
297 | prev= | ||
298 | lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
299 | |||
300 | case $arg in | ||
301 | # Double-quote args containing other shell metacharacters. | ||
302 | # Many Bourne shells cannot handle close brackets correctly | ||
303 | # in scan sets, so we specify it separately. | ||
304 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
305 | arg="\"$arg\"" | ||
306 | ;; | ||
307 | esac | ||
308 | |||
309 | # Add the previous argument to base_compile. | ||
310 | if test -z "$base_compile"; then | ||
311 | base_compile="$lastarg" | ||
312 | else | ||
313 | base_compile="$base_compile $lastarg" | ||
314 | fi | ||
315 | continue | ||
316 | ;; | ||
317 | esac | ||
318 | |||
319 | # Accept any command-line options. | ||
320 | case $arg in | ||
321 | -o) | ||
322 | if test "$user_target" != "no"; then | ||
323 | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 | ||
324 | exit 1 | ||
325 | fi | ||
326 | user_target=next | ||
327 | ;; | ||
328 | |||
329 | -static) | ||
330 | build_old_libs=yes | ||
331 | continue | ||
332 | ;; | ||
333 | |||
334 | -prefer-pic) | ||
335 | pic_mode=yes | ||
336 | continue | ||
337 | ;; | ||
338 | |||
339 | -prefer-non-pic) | ||
340 | pic_mode=no | ||
341 | continue | ||
342 | ;; | ||
343 | |||
344 | -Xcompiler) | ||
345 | prev=xcompiler | ||
346 | continue | ||
347 | ;; | ||
348 | |||
349 | -Wc,*) | ||
350 | args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` | ||
351 | lastarg= | ||
352 | save_ifs="$IFS"; IFS=',' | ||
353 | for arg in $args; do | ||
354 | IFS="$save_ifs" | ||
355 | |||
356 | # Double-quote args containing other shell metacharacters. | ||
357 | # Many Bourne shells cannot handle close brackets correctly | ||
358 | # in scan sets, so we specify it separately. | ||
359 | case $arg in | ||
360 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
361 | arg="\"$arg\"" | ||
362 | ;; | ||
363 | esac | ||
364 | lastarg="$lastarg $arg" | ||
365 | done | ||
366 | IFS="$save_ifs" | ||
367 | lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` | ||
368 | |||
369 | # Add the arguments to base_compile. | ||
370 | if test -z "$base_compile"; then | ||
371 | base_compile="$lastarg" | ||
372 | else | ||
373 | base_compile="$base_compile $lastarg" | ||
374 | fi | ||
375 | continue | ||
376 | ;; | ||
377 | esac | ||
378 | |||
379 | case $user_target in | ||
380 | next) | ||
381 | # The next one is the -o target name | ||
382 | user_target=yes | ||
383 | continue | ||
384 | ;; | ||
385 | yes) | ||
386 | # We got the output file | ||
387 | user_target=set | ||
388 | libobj="$arg" | ||
389 | continue | ||
390 | ;; | ||
391 | esac | ||
392 | |||
393 | # Accept the current argument as the source file. | ||
394 | lastarg="$srcfile" | ||
395 | srcfile="$arg" | ||
396 | |||
397 | # Aesthetically quote the previous argument. | ||
398 | |||
399 | # Backslashify any backslashes, double quotes, and dollar signs. | ||
400 | # These are the only characters that are still specially | ||
401 | # interpreted inside of double-quoted scrings. | ||
402 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` | ||
403 | |||
404 | # Double-quote args containing other shell metacharacters. | ||
405 | # Many Bourne shells cannot handle close brackets correctly | ||
406 | # in scan sets, so we specify it separately. | ||
407 | case $lastarg in | ||
408 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
409 | lastarg="\"$lastarg\"" | ||
410 | ;; | ||
411 | esac | ||
412 | |||
413 | # Add the previous argument to base_compile. | ||
414 | if test -z "$base_compile"; then | ||
415 | base_compile="$lastarg" | ||
416 | else | ||
417 | base_compile="$base_compile $lastarg" | ||
418 | fi | ||
419 | done | ||
420 | |||
421 | case $user_target in | ||
422 | set) | ||
423 | ;; | ||
424 | no) | ||
425 | # Get the name of the library object. | ||
426 | libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` | ||
427 | ;; | ||
428 | *) | ||
429 | $echo "$modename: you must specify a target with \`-o'" 1>&2 | ||
430 | exit 1 | ||
431 | ;; | ||
432 | esac | ||
433 | |||
434 | # Recognize several different file suffixes. | ||
435 | # If the user specifies -o file.o, it is replaced with file.lo | ||
436 | xform='[cCFSfmso]' | ||
437 | case $libobj in | ||
438 | *.ada) xform=ada ;; | ||
439 | *.adb) xform=adb ;; | ||
440 | *.ads) xform=ads ;; | ||
441 | *.asm) xform=asm ;; | ||
442 | *.c++) xform=c++ ;; | ||
443 | *.cc) xform=cc ;; | ||
444 | *.cpp) xform=cpp ;; | ||
445 | *.cxx) xform=cxx ;; | ||
446 | *.f90) xform=f90 ;; | ||
447 | *.for) xform=for ;; | ||
448 | esac | ||
449 | |||
450 | libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` | ||
451 | |||
452 | case $libobj in | ||
453 | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; | ||
454 | *) | ||
455 | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 | ||
456 | exit 1 | ||
457 | ;; | ||
458 | esac | ||
459 | |||
460 | if test -z "$base_compile"; then | ||
461 | $echo "$modename: you must specify a compilation command" 1>&2 | ||
462 | $echo "$help" 1>&2 | ||
463 | exit 1 | ||
464 | fi | ||
465 | |||
466 | # Delete any leftover library objects. | ||
467 | if test "$build_old_libs" = yes; then | ||
468 | removelist="$obj $libobj" | ||
469 | else | ||
470 | removelist="$libobj" | ||
471 | fi | ||
472 | |||
473 | $run $rm $removelist | ||
474 | trap "$run $rm $removelist; exit 1" 1 2 15 | ||
475 | |||
476 | # On Cygwin there's no "real" PIC flag so we must build both object types | ||
477 | case $host_os in | ||
478 | cygwin* | mingw* | pw32* | os2*) | ||
479 | pic_mode=default | ||
480 | ;; | ||
481 | esac | ||
482 | if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then | ||
483 | # non-PIC code in shared libraries is not supported | ||
484 | pic_mode=default | ||
485 | fi | ||
486 | |||
487 | # Calculate the filename of the output object if compiler does | ||
488 | # not support -o with -c | ||
489 | if test "$compiler_c_o" = no; then | ||
490 | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} | ||
491 | lockfile="$output_obj.lock" | ||
492 | removelist="$removelist $output_obj $lockfile" | ||
493 | trap "$run $rm $removelist; exit 1" 1 2 15 | ||
494 | else | ||
495 | need_locks=no | ||
496 | lockfile= | ||
497 | fi | ||
498 | |||
499 | # Lock this critical section if it is needed | ||
500 | # We use this script file to make the link, it avoids creating a new file | ||
501 | if test "$need_locks" = yes; then | ||
502 | until $run ln "$0" "$lockfile" 2>/dev/null; do | ||
503 | $show "Waiting for $lockfile to be removed" | ||
504 | sleep 2 | ||
505 | done | ||
506 | elif test "$need_locks" = warn; then | ||
507 | if test -f "$lockfile"; then | ||
508 | echo "\ | ||
509 | *** ERROR, $lockfile exists and contains: | ||
510 | `cat $lockfile 2>/dev/null` | ||
511 | |||
512 | This indicates that another process is trying to use the same | ||
513 | temporary object file, and libtool could not work around it because | ||
514 | your compiler does not support \`-c' and \`-o' together. If you | ||
515 | repeat this compilation, it may succeed, by chance, but you had better | ||
516 | avoid parallel builds (make -j) in this platform, or get a better | ||
517 | compiler." | ||
518 | |||
519 | $run $rm $removelist | ||
520 | exit 1 | ||
521 | fi | ||
522 | echo $srcfile > "$lockfile" | ||
523 | fi | ||
524 | |||
525 | if test -n "$fix_srcfile_path"; then | ||
526 | eval srcfile=\"$fix_srcfile_path\" | ||
527 | fi | ||
528 | |||
529 | # Only build a PIC object if we are building libtool libraries. | ||
530 | if test "$build_libtool_libs" = yes; then | ||
531 | # Without this assignment, base_compile gets emptied. | ||
532 | fbsd_hideous_sh_bug=$base_compile | ||
533 | |||
534 | if test "$pic_mode" != no; then | ||
535 | # All platforms use -DPIC, to notify preprocessed assembler code. | ||
536 | command="$base_compile $srcfile $pic_flag -DPIC" | ||
537 | else | ||
538 | # Don't build PIC code | ||
539 | command="$base_compile $srcfile" | ||
540 | fi | ||
541 | if test "$build_old_libs" = yes; then | ||
542 | lo_libobj="$libobj" | ||
543 | dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` | ||
544 | if test "X$dir" = "X$libobj"; then | ||
545 | dir="$objdir" | ||
546 | else | ||
547 | dir="$dir/$objdir" | ||
548 | fi | ||
549 | libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` | ||
550 | |||
551 | if test -d "$dir"; then | ||
552 | $show "$rm $libobj" | ||
553 | $run $rm $libobj | ||
554 | else | ||
555 | $show "$mkdir $dir" | ||
556 | $run $mkdir $dir | ||
557 | status=$? | ||
558 | if test $status -ne 0 && test ! -d $dir; then | ||
559 | exit $status | ||
560 | fi | ||
561 | fi | ||
562 | fi | ||
563 | if test "$compiler_o_lo" = yes; then | ||
564 | output_obj="$libobj" | ||
565 | command="$command -o $output_obj" | ||
566 | elif test "$compiler_c_o" = yes; then | ||
567 | output_obj="$obj" | ||
568 | command="$command -o $output_obj" | ||
569 | fi | ||
570 | |||
571 | $run $rm "$output_obj" | ||
572 | $show "$command" | ||
573 | if $run eval "$command"; then : | ||
574 | else | ||
575 | test -n "$output_obj" && $run $rm $removelist | ||
576 | exit 1 | ||
577 | fi | ||
578 | |||
579 | if test "$need_locks" = warn && | ||
580 | test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then | ||
581 | echo "\ | ||
582 | *** ERROR, $lockfile contains: | ||
583 | `cat $lockfile 2>/dev/null` | ||
584 | |||
585 | but it should contain: | ||
586 | $srcfile | ||
587 | |||
588 | This indicates that another process is trying to use the same | ||
589 | temporary object file, and libtool could not work around it because | ||
590 | your compiler does not support \`-c' and \`-o' together. If you | ||
591 | repeat this compilation, it may succeed, by chance, but you had better | ||
592 | avoid parallel builds (make -j) in this platform, or get a better | ||
593 | compiler." | ||
594 | |||
595 | $run $rm $removelist | ||
596 | exit 1 | ||
597 | fi | ||
598 | |||
599 | # Just move the object if needed, then go on to compile the next one | ||
600 | if test x"$output_obj" != x"$libobj"; then | ||
601 | $show "$mv $output_obj $libobj" | ||
602 | if $run $mv $output_obj $libobj; then : | ||
603 | else | ||
604 | error=$? | ||
605 | $run $rm $removelist | ||
606 | exit $error | ||
607 | fi | ||
608 | fi | ||
609 | |||
610 | # If we have no pic_flag, then copy the object into place and finish. | ||
611 | if (test -z "$pic_flag" || test "$pic_mode" != default) && | ||
612 | test "$build_old_libs" = yes; then | ||
613 | # Rename the .lo from within objdir to obj | ||
614 | if test -f $obj; then | ||
615 | $show $rm $obj | ||
616 | $run $rm $obj | ||
617 | fi | ||
618 | |||
619 | $show "$mv $libobj $obj" | ||
620 | if $run $mv $libobj $obj; then : | ||
621 | else | ||
622 | error=$? | ||
623 | $run $rm $removelist | ||
624 | exit $error | ||
625 | fi | ||
626 | |||
627 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` | ||
628 | if test "X$xdir" = "X$obj"; then | ||
629 | xdir="." | ||
630 | else | ||
631 | xdir="$xdir" | ||
632 | fi | ||
633 | baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` | ||
634 | libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` | ||
635 | # Now arrange that obj and lo_libobj become the same file | ||
636 | $show "(cd $xdir && $LN_S $baseobj $libobj)" | ||
637 | if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then | ||
638 | # Unlock the critical section if it was locked | ||
639 | if test "$need_locks" != no; then | ||
640 | $run $rm "$lockfile" | ||
641 | fi | ||
642 | exit 0 | ||
643 | else | ||
644 | error=$? | ||
645 | $run $rm $removelist | ||
646 | exit $error | ||
647 | fi | ||
648 | fi | ||
649 | |||
650 | # Allow error messages only from the first compilation. | ||
651 | suppress_output=' >/dev/null 2>&1' | ||
652 | fi | ||
653 | |||
654 | # Only build a position-dependent object if we build old libraries. | ||
655 | if test "$build_old_libs" = yes; then | ||
656 | if test "$pic_mode" != yes; then | ||
657 | # Don't build PIC code | ||
658 | command="$base_compile $srcfile" | ||
659 | else | ||
660 | # All platforms use -DPIC, to notify preprocessed assembler code. | ||
661 | command="$base_compile $srcfile $pic_flag -DPIC" | ||
662 | fi | ||
663 | if test "$compiler_c_o" = yes; then | ||
664 | command="$command -o $obj" | ||
665 | output_obj="$obj" | ||
666 | fi | ||
667 | |||
668 | # Suppress compiler output if we already did a PIC compilation. | ||
669 | command="$command$suppress_output" | ||
670 | $run $rm "$output_obj" | ||
671 | $show "$command" | ||
672 | if $run eval "$command"; then : | ||
673 | else | ||
674 | $run $rm $removelist | ||
675 | exit 1 | ||
676 | fi | ||
677 | |||
678 | if test "$need_locks" = warn && | ||
679 | test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then | ||
680 | echo "\ | ||
681 | *** ERROR, $lockfile contains: | ||
682 | `cat $lockfile 2>/dev/null` | ||
683 | |||
684 | but it should contain: | ||
685 | $srcfile | ||
686 | |||
687 | This indicates that another process is trying to use the same | ||
688 | temporary object file, and libtool could not work around it because | ||
689 | your compiler does not support \`-c' and \`-o' together. If you | ||
690 | repeat this compilation, it may succeed, by chance, but you had better | ||
691 | avoid parallel builds (make -j) in this platform, or get a better | ||
692 | compiler." | ||
693 | |||
694 | $run $rm $removelist | ||
695 | exit 1 | ||
696 | fi | ||
697 | |||
698 | # Just move the object if needed | ||
699 | if test x"$output_obj" != x"$obj"; then | ||
700 | $show "$mv $output_obj $obj" | ||
701 | if $run $mv $output_obj $obj; then : | ||
702 | else | ||
703 | error=$? | ||
704 | $run $rm $removelist | ||
705 | exit $error | ||
706 | fi | ||
707 | fi | ||
708 | |||
709 | # Create an invalid libtool object if no PIC, so that we do not | ||
710 | # accidentally link it into a program. | ||
711 | if test "$build_libtool_libs" != yes; then | ||
712 | $show "echo timestamp > $libobj" | ||
713 | $run eval "echo timestamp > \$libobj" || exit $? | ||
714 | else | ||
715 | # Move the .lo from within objdir | ||
716 | $show "$mv $libobj $lo_libobj" | ||
717 | if $run $mv $libobj $lo_libobj; then : | ||
718 | else | ||
719 | error=$? | ||
720 | $run $rm $removelist | ||
721 | exit $error | ||
722 | fi | ||
723 | fi | ||
724 | fi | ||
725 | |||
726 | # Unlock the critical section if it was locked | ||
727 | if test "$need_locks" != no; then | ||
728 | $run $rm "$lockfile" | ||
729 | fi | ||
730 | |||
731 | exit 0 | ||
732 | ;; | ||
733 | |||
734 | # libtool link mode | ||
735 | link | relink) | ||
736 | modename="$modename: link" | ||
737 | case $host in | ||
738 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
739 | # It is impossible to link a dll without this setting, and | ||
740 | # we shouldn't force the makefile maintainer to figure out | ||
741 | # which system we are compiling for in order to pass an extra | ||
742 | # flag for every libtool invokation. | ||
743 | # allow_undefined=no | ||
744 | |||
745 | # FIXME: Unfortunately, there are problems with the above when trying | ||
746 | # to make a dll which has undefined symbols, in which case not | ||
747 | # even a static library is built. For now, we need to specify | ||
748 | # -no-undefined on the libtool link line when we can be certain | ||
749 | # that all symbols are satisfied, otherwise we get a static library. | ||
750 | allow_undefined=yes | ||
751 | ;; | ||
752 | *) | ||
753 | allow_undefined=yes | ||
754 | ;; | ||
755 | esac | ||
756 | libtool_args="$nonopt" | ||
757 | compile_command="$nonopt" | ||
758 | finalize_command="$nonopt" | ||
759 | |||
760 | compile_rpath= | ||
761 | finalize_rpath= | ||
762 | compile_shlibpath= | ||
763 | finalize_shlibpath= | ||
764 | convenience= | ||
765 | old_convenience= | ||
766 | deplibs= | ||
767 | old_deplibs= | ||
768 | compiler_flags= | ||
769 | linker_flags= | ||
770 | dllsearchpath= | ||
771 | lib_search_path=`pwd` | ||
772 | inst_prefix_dir= | ||
773 | |||
774 | avoid_version=no | ||
775 | dlfiles= | ||
776 | dlprefiles= | ||
777 | dlself=no | ||
778 | export_dynamic=no | ||
779 | export_symbols= | ||
780 | export_symbols_regex= | ||
781 | generated= | ||
782 | libobjs= | ||
783 | ltlibs= | ||
784 | module=no | ||
785 | no_install=no | ||
786 | objs= | ||
787 | prefer_static_libs=no | ||
788 | preload=no | ||
789 | prev= | ||
790 | prevarg= | ||
791 | release= | ||
792 | rpath= | ||
793 | xrpath= | ||
794 | perm_rpath= | ||
795 | temp_rpath= | ||
796 | thread_safe=no | ||
797 | vinfo= | ||
798 | |||
799 | # We need to know -static, to get the right output filenames. | ||
800 | for arg | ||
801 | do | ||
802 | case $arg in | ||
803 | -all-static | -static) | ||
804 | if test "X$arg" = "X-all-static"; then | ||
805 | if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then | ||
806 | $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 | ||
807 | fi | ||
808 | if test -n "$link_static_flag"; then | ||
809 | dlopen_self=$dlopen_self_static | ||
810 | fi | ||
811 | else | ||
812 | if test -z "$pic_flag" && test -n "$link_static_flag"; then | ||
813 | dlopen_self=$dlopen_self_static | ||
814 | fi | ||
815 | fi | ||
816 | build_libtool_libs=no | ||
817 | build_old_libs=yes | ||
818 | prefer_static_libs=yes | ||
819 | break | ||
820 | ;; | ||
821 | esac | ||
822 | done | ||
823 | |||
824 | # See if our shared archives depend on static archives. | ||
825 | test -n "$old_archive_from_new_cmds" && build_old_libs=yes | ||
826 | |||
827 | # Go through the arguments, transforming them on the way. | ||
828 | while test $# -gt 0; do | ||
829 | arg="$1" | ||
830 | shift | ||
831 | case $arg in | ||
832 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
833 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test | ||
834 | ;; | ||
835 | *) qarg=$arg ;; | ||
836 | esac | ||
837 | libtool_args="$libtool_args $qarg" | ||
838 | |||
839 | # If the previous option needs an argument, assign it. | ||
840 | if test -n "$prev"; then | ||
841 | case $prev in | ||
842 | output) | ||
843 | compile_command="$compile_command @OUTPUT@" | ||
844 | finalize_command="$finalize_command @OUTPUT@" | ||
845 | ;; | ||
846 | esac | ||
847 | |||
848 | case $prev in | ||
849 | dlfiles|dlprefiles) | ||
850 | if test "$preload" = no; then | ||
851 | # Add the symbol object into the linking commands. | ||
852 | compile_command="$compile_command @SYMFILE@" | ||
853 | finalize_command="$finalize_command @SYMFILE@" | ||
854 | preload=yes | ||
855 | fi | ||
856 | case $arg in | ||
857 | *.la | *.lo) ;; # We handle these cases below. | ||
858 | force) | ||
859 | if test "$dlself" = no; then | ||
860 | dlself=needless | ||
861 | export_dynamic=yes | ||
862 | fi | ||
863 | prev= | ||
864 | continue | ||
865 | ;; | ||
866 | self) | ||
867 | if test "$prev" = dlprefiles; then | ||
868 | dlself=yes | ||
869 | elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then | ||
870 | dlself=yes | ||
871 | else | ||
872 | dlself=needless | ||
873 | export_dynamic=yes | ||
874 | fi | ||
875 | prev= | ||
876 | continue | ||
877 | ;; | ||
878 | *) | ||
879 | if test "$prev" = dlfiles; then | ||
880 | dlfiles="$dlfiles $arg" | ||
881 | else | ||
882 | dlprefiles="$dlprefiles $arg" | ||
883 | fi | ||
884 | prev= | ||
885 | continue | ||
886 | ;; | ||
887 | esac | ||
888 | ;; | ||
889 | expsyms) | ||
890 | export_symbols="$arg" | ||
891 | if test ! -f "$arg"; then | ||
892 | $echo "$modename: symbol file \`$arg' does not exist" | ||
893 | exit 1 | ||
894 | fi | ||
895 | prev= | ||
896 | continue | ||
897 | ;; | ||
898 | expsyms_regex) | ||
899 | export_symbols_regex="$arg" | ||
900 | prev= | ||
901 | continue | ||
902 | ;; | ||
903 | inst_prefix) | ||
904 | inst_prefix_dir="$arg" | ||
905 | prev= | ||
906 | continue | ||
907 | ;; | ||
908 | release) | ||
909 | release="-$arg" | ||
910 | prev= | ||
911 | continue | ||
912 | ;; | ||
913 | rpath | xrpath) | ||
914 | # We need an absolute path. | ||
915 | case $arg in | ||
916 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
917 | *) | ||
918 | $echo "$modename: only absolute run-paths are allowed" 1>&2 | ||
919 | exit 1 | ||
920 | ;; | ||
921 | esac | ||
922 | if test "$prev" = rpath; then | ||
923 | case "$rpath " in | ||
924 | *" $arg "*) ;; | ||
925 | *) rpath="$rpath $arg" ;; | ||
926 | esac | ||
927 | else | ||
928 | case "$xrpath " in | ||
929 | *" $arg "*) ;; | ||
930 | *) xrpath="$xrpath $arg" ;; | ||
931 | esac | ||
932 | fi | ||
933 | prev= | ||
934 | continue | ||
935 | ;; | ||
936 | xcompiler) | ||
937 | compiler_flags="$compiler_flags $qarg" | ||
938 | prev= | ||
939 | compile_command="$compile_command $qarg" | ||
940 | finalize_command="$finalize_command $qarg" | ||
941 | continue | ||
942 | ;; | ||
943 | xlinker) | ||
944 | linker_flags="$linker_flags $qarg" | ||
945 | compiler_flags="$compiler_flags $wl$qarg" | ||
946 | prev= | ||
947 | compile_command="$compile_command $wl$qarg" | ||
948 | finalize_command="$finalize_command $wl$qarg" | ||
949 | continue | ||
950 | ;; | ||
951 | *) | ||
952 | eval "$prev=\"\$arg\"" | ||
953 | prev= | ||
954 | continue | ||
955 | ;; | ||
956 | esac | ||
957 | fi # test -n $prev | ||
958 | |||
959 | prevarg="$arg" | ||
960 | |||
961 | case $arg in | ||
962 | -all-static) | ||
963 | if test -n "$link_static_flag"; then | ||
964 | compile_command="$compile_command $link_static_flag" | ||
965 | finalize_command="$finalize_command $link_static_flag" | ||
966 | fi | ||
967 | continue | ||
968 | ;; | ||
969 | |||
970 | -allow-undefined) | ||
971 | # FIXME: remove this flag sometime in the future. | ||
972 | $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 | ||
973 | continue | ||
974 | ;; | ||
975 | |||
976 | -avoid-version) | ||
977 | avoid_version=yes | ||
978 | continue | ||
979 | ;; | ||
980 | |||
981 | -dlopen) | ||
982 | prev=dlfiles | ||
983 | continue | ||
984 | ;; | ||
985 | |||
986 | -dlpreopen) | ||
987 | prev=dlprefiles | ||
988 | continue | ||
989 | ;; | ||
990 | |||
991 | -export-dynamic) | ||
992 | export_dynamic=yes | ||
993 | continue | ||
994 | ;; | ||
995 | |||
996 | -export-symbols | -export-symbols-regex) | ||
997 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | ||
998 | $echo "$modename: more than one -exported-symbols argument is not allowed" | ||
999 | exit 1 | ||
1000 | fi | ||
1001 | if test "X$arg" = "X-export-symbols"; then | ||
1002 | prev=expsyms | ||
1003 | else | ||
1004 | prev=expsyms_regex | ||
1005 | fi | ||
1006 | continue | ||
1007 | ;; | ||
1008 | |||
1009 | -inst-prefix-dir) | ||
1010 | prev=inst_prefix | ||
1011 | continue | ||
1012 | ;; | ||
1013 | |||
1014 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* | ||
1015 | # so, if we see these flags be careful not to treat them like -L | ||
1016 | -L[A-Z][A-Z]*:*) | ||
1017 | if test -z "$with_gcc"; then | ||
1018 | case $host in | ||
1019 | *-*-irix* | *-*-nonstopux*) | ||
1020 | compile_command="$compile_command $arg" | ||
1021 | finalize_command="$finalize_command $arg" | ||
1022 | ;; | ||
1023 | esac | ||
1024 | fi | ||
1025 | continue | ||
1026 | ;; | ||
1027 | |||
1028 | -L*) | ||
1029 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` | ||
1030 | # We need an absolute path. | ||
1031 | case $dir in | ||
1032 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
1033 | *) | ||
1034 | absdir=`cd "$dir" && pwd` | ||
1035 | if test -z "$absdir"; then | ||
1036 | $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 | ||
1037 | exit 1 | ||
1038 | fi | ||
1039 | dir="$absdir" | ||
1040 | ;; | ||
1041 | esac | ||
1042 | case "$deplibs " in | ||
1043 | *" -L$dir "*) ;; | ||
1044 | *) | ||
1045 | deplibs="$deplibs -L$dir" | ||
1046 | lib_search_path="$lib_search_path $dir" | ||
1047 | ;; | ||
1048 | esac | ||
1049 | case $host in | ||
1050 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
1051 | case :$dllsearchpath: in | ||
1052 | *":$dir:"*) ;; | ||
1053 | *) dllsearchpath="$dllsearchpath:$dir";; | ||
1054 | esac | ||
1055 | ;; | ||
1056 | esac | ||
1057 | continue | ||
1058 | ;; | ||
1059 | |||
1060 | -l*) | ||
1061 | if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then | ||
1062 | case $host in | ||
1063 | *-*-cygwin* | *-*-pw32* | *-*-beos*) | ||
1064 | # These systems don't actually have a C or math library (as such) | ||
1065 | continue | ||
1066 | ;; | ||
1067 | *-*-mingw* | *-*-os2*) | ||
1068 | # These systems don't actually have a C library (as such) | ||
1069 | test "X$arg" = "X-lc" && continue | ||
1070 | ;; | ||
1071 | *-*-openbsd* | *-*-freebsd*) | ||
1072 | # Do not include libc due to us having libc/libc_r. | ||
1073 | test "X$arg" = "X-lc" && continue | ||
1074 | ;; | ||
1075 | esac | ||
1076 | elif test "X$arg" = "X-lc_r"; then | ||
1077 | case $host in | ||
1078 | *-*-openbsd* | *-*-freebsd*) | ||
1079 | # Do not include libc_r directly, use -pthread flag. | ||
1080 | continue | ||
1081 | ;; | ||
1082 | esac | ||
1083 | fi | ||
1084 | deplibs="$deplibs $arg" | ||
1085 | continue | ||
1086 | ;; | ||
1087 | |||
1088 | -module) | ||
1089 | module=yes | ||
1090 | continue | ||
1091 | ;; | ||
1092 | |||
1093 | -no-fast-install) | ||
1094 | fast_install=no | ||
1095 | continue | ||
1096 | ;; | ||
1097 | |||
1098 | -no-install) | ||
1099 | case $host in | ||
1100 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
1101 | # The PATH hackery in wrapper scripts is required on Windows | ||
1102 | # in order for the loader to find any dlls it needs. | ||
1103 | $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 | ||
1104 | $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 | ||
1105 | fast_install=no | ||
1106 | ;; | ||
1107 | *) no_install=yes ;; | ||
1108 | esac | ||
1109 | continue | ||
1110 | ;; | ||
1111 | |||
1112 | -no-undefined) | ||
1113 | allow_undefined=no | ||
1114 | continue | ||
1115 | ;; | ||
1116 | |||
1117 | -o) prev=output ;; | ||
1118 | |||
1119 | -release) | ||
1120 | prev=release | ||
1121 | continue | ||
1122 | ;; | ||
1123 | |||
1124 | -rpath) | ||
1125 | prev=rpath | ||
1126 | continue | ||
1127 | ;; | ||
1128 | |||
1129 | -R) | ||
1130 | prev=xrpath | ||
1131 | continue | ||
1132 | ;; | ||
1133 | |||
1134 | -R*) | ||
1135 | dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` | ||
1136 | # We need an absolute path. | ||
1137 | case $dir in | ||
1138 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
1139 | *) | ||
1140 | $echo "$modename: only absolute run-paths are allowed" 1>&2 | ||
1141 | exit 1 | ||
1142 | ;; | ||
1143 | esac | ||
1144 | case "$xrpath " in | ||
1145 | *" $dir "*) ;; | ||
1146 | *) xrpath="$xrpath $dir" ;; | ||
1147 | esac | ||
1148 | continue | ||
1149 | ;; | ||
1150 | |||
1151 | -static) | ||
1152 | # The effects of -static are defined in a previous loop. | ||
1153 | # We used to do the same as -all-static on platforms that | ||
1154 | # didn't have a PIC flag, but the assumption that the effects | ||
1155 | # would be equivalent was wrong. It would break on at least | ||
1156 | # Digital Unix and AIX. | ||
1157 | continue | ||
1158 | ;; | ||
1159 | |||
1160 | -thread-safe) | ||
1161 | thread_safe=yes | ||
1162 | continue | ||
1163 | ;; | ||
1164 | |||
1165 | -version-info) | ||
1166 | prev=vinfo | ||
1167 | continue | ||
1168 | ;; | ||
1169 | |||
1170 | -Wc,*) | ||
1171 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` | ||
1172 | arg= | ||
1173 | save_ifs="$IFS"; IFS=',' | ||
1174 | for flag in $args; do | ||
1175 | IFS="$save_ifs" | ||
1176 | case $flag in | ||
1177 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
1178 | flag="\"$flag\"" | ||
1179 | ;; | ||
1180 | esac | ||
1181 | arg="$arg $wl$flag" | ||
1182 | compiler_flags="$compiler_flags $flag" | ||
1183 | done | ||
1184 | IFS="$save_ifs" | ||
1185 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` | ||
1186 | ;; | ||
1187 | |||
1188 | -Wl,*) | ||
1189 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` | ||
1190 | arg= | ||
1191 | save_ifs="$IFS"; IFS=',' | ||
1192 | for flag in $args; do | ||
1193 | IFS="$save_ifs" | ||
1194 | case $flag in | ||
1195 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
1196 | flag="\"$flag\"" | ||
1197 | ;; | ||
1198 | esac | ||
1199 | arg="$arg $wl$flag" | ||
1200 | compiler_flags="$compiler_flags $wl$flag" | ||
1201 | linker_flags="$linker_flags $flag" | ||
1202 | done | ||
1203 | IFS="$save_ifs" | ||
1204 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` | ||
1205 | ;; | ||
1206 | |||
1207 | -Xcompiler) | ||
1208 | prev=xcompiler | ||
1209 | continue | ||
1210 | ;; | ||
1211 | |||
1212 | -Xlinker) | ||
1213 | prev=xlinker | ||
1214 | continue | ||
1215 | ;; | ||
1216 | |||
1217 | -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread ) | ||
1218 | compiler_flags="$compiler_flags $arg" | ||
1219 | continue | ||
1220 | ;; | ||
1221 | |||
1222 | # Some other compiler flag. | ||
1223 | -* | +*) | ||
1224 | # Unknown arguments in both finalize_command and compile_command need | ||
1225 | # to be aesthetically quoted because they are evaled later. | ||
1226 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
1227 | case $arg in | ||
1228 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
1229 | arg="\"$arg\"" | ||
1230 | ;; | ||
1231 | esac | ||
1232 | ;; | ||
1233 | |||
1234 | *.lo | *.$objext) | ||
1235 | # A library or standard object. | ||
1236 | if test "$prev" = dlfiles; then | ||
1237 | # This file was specified with -dlopen. | ||
1238 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then | ||
1239 | dlfiles="$dlfiles $arg" | ||
1240 | prev= | ||
1241 | continue | ||
1242 | else | ||
1243 | # If libtool objects are unsupported, then we need to preload. | ||
1244 | prev=dlprefiles | ||
1245 | fi | ||
1246 | fi | ||
1247 | |||
1248 | if test "$prev" = dlprefiles; then | ||
1249 | # Preload the old-style object. | ||
1250 | dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` | ||
1251 | prev= | ||
1252 | else | ||
1253 | case $arg in | ||
1254 | *.lo) libobjs="$libobjs $arg" ;; | ||
1255 | *) objs="$objs $arg" ;; | ||
1256 | esac | ||
1257 | fi | ||
1258 | ;; | ||
1259 | |||
1260 | *.$libext) | ||
1261 | # An archive. | ||
1262 | deplibs="$deplibs $arg" | ||
1263 | old_deplibs="$old_deplibs $arg" | ||
1264 | continue | ||
1265 | ;; | ||
1266 | |||
1267 | *.la) | ||
1268 | # A libtool-controlled library. | ||
1269 | |||
1270 | if test "$prev" = dlfiles; then | ||
1271 | # This library was specified with -dlopen. | ||
1272 | dlfiles="$dlfiles $arg" | ||
1273 | prev= | ||
1274 | elif test "$prev" = dlprefiles; then | ||
1275 | # The library was specified with -dlpreopen. | ||
1276 | dlprefiles="$dlprefiles $arg" | ||
1277 | prev= | ||
1278 | else | ||
1279 | deplibs="$deplibs $arg" | ||
1280 | fi | ||
1281 | continue | ||
1282 | ;; | ||
1283 | |||
1284 | # Some other compiler argument. | ||
1285 | *) | ||
1286 | # Unknown arguments in both finalize_command and compile_command need | ||
1287 | # to be aesthetically quoted because they are evaled later. | ||
1288 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
1289 | case $arg in | ||
1290 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
1291 | arg="\"$arg\"" | ||
1292 | ;; | ||
1293 | esac | ||
1294 | ;; | ||
1295 | esac # arg | ||
1296 | |||
1297 | # Now actually substitute the argument into the commands. | ||
1298 | if test -n "$arg"; then | ||
1299 | compile_command="$compile_command $arg" | ||
1300 | finalize_command="$finalize_command $arg" | ||
1301 | fi | ||
1302 | done # argument parsing loop | ||
1303 | |||
1304 | if test -n "$prev"; then | ||
1305 | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 | ||
1306 | $echo "$help" 1>&2 | ||
1307 | exit 1 | ||
1308 | fi | ||
1309 | |||
1310 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then | ||
1311 | eval arg=\"$export_dynamic_flag_spec\" | ||
1312 | compile_command="$compile_command $arg" | ||
1313 | finalize_command="$finalize_command $arg" | ||
1314 | fi | ||
1315 | |||
1316 | # calculate the name of the file, without its directory | ||
1317 | outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` | ||
1318 | libobjs_save="$libobjs" | ||
1319 | |||
1320 | if test -n "$shlibpath_var"; then | ||
1321 | # get the directories listed in $shlibpath_var | ||
1322 | eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` | ||
1323 | else | ||
1324 | shlib_search_path= | ||
1325 | fi | ||
1326 | eval sys_lib_search_path=\"$sys_lib_search_path_spec\" | ||
1327 | eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" | ||
1328 | |||
1329 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` | ||
1330 | if test "X$output_objdir" = "X$output"; then | ||
1331 | output_objdir="$objdir" | ||
1332 | else | ||
1333 | output_objdir="$output_objdir/$objdir" | ||
1334 | fi | ||
1335 | # Create the object directory. | ||
1336 | if test ! -d $output_objdir; then | ||
1337 | $show "$mkdir $output_objdir" | ||
1338 | $run $mkdir $output_objdir | ||
1339 | status=$? | ||
1340 | if test $status -ne 0 && test ! -d $output_objdir; then | ||
1341 | exit $status | ||
1342 | fi | ||
1343 | fi | ||
1344 | |||
1345 | # Determine the type of output | ||
1346 | case $output in | ||
1347 | "") | ||
1348 | $echo "$modename: you must specify an output file" 1>&2 | ||
1349 | $echo "$help" 1>&2 | ||
1350 | exit 1 | ||
1351 | ;; | ||
1352 | *.$libext) linkmode=oldlib ;; | ||
1353 | *.lo | *.$objext) linkmode=obj ;; | ||
1354 | *.la) linkmode=lib ;; | ||
1355 | *) linkmode=prog ;; # Anything else should be a program. | ||
1356 | esac | ||
1357 | |||
1358 | specialdeplibs= | ||
1359 | libs= | ||
1360 | # Find all interdependent deplibs by searching for libraries | ||
1361 | # that are linked more than once (e.g. -la -lb -la) | ||
1362 | for deplib in $deplibs; do | ||
1363 | if test "X$duplicate_deps" = "Xyes" ; then | ||
1364 | case "$libs " in | ||
1365 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
1366 | esac | ||
1367 | fi | ||
1368 | libs="$libs $deplib" | ||
1369 | done | ||
1370 | deplibs= | ||
1371 | newdependency_libs= | ||
1372 | newlib_search_path= | ||
1373 | need_relink=no # whether we're linking any uninstalled libtool libraries | ||
1374 | notinst_deplibs= # not-installed libtool libraries | ||
1375 | notinst_path= # paths that contain not-installed libtool libraries | ||
1376 | case $linkmode in | ||
1377 | lib) | ||
1378 | passes="conv link" | ||
1379 | for file in $dlfiles $dlprefiles; do | ||
1380 | case $file in | ||
1381 | *.la) ;; | ||
1382 | *) | ||
1383 | $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 | ||
1384 | exit 1 | ||
1385 | ;; | ||
1386 | esac | ||
1387 | done | ||
1388 | ;; | ||
1389 | prog) | ||
1390 | compile_deplibs= | ||
1391 | finalize_deplibs= | ||
1392 | alldeplibs=no | ||
1393 | newdlfiles= | ||
1394 | newdlprefiles= | ||
1395 | passes="conv scan dlopen dlpreopen link" | ||
1396 | ;; | ||
1397 | *) passes="conv" | ||
1398 | ;; | ||
1399 | esac | ||
1400 | for pass in $passes; do | ||
1401 | if test $linkmode = prog; then | ||
1402 | # Determine which files to process | ||
1403 | case $pass in | ||
1404 | dlopen) | ||
1405 | libs="$dlfiles" | ||
1406 | save_deplibs="$deplibs" # Collect dlpreopened libraries | ||
1407 | deplibs= | ||
1408 | ;; | ||
1409 | dlpreopen) libs="$dlprefiles" ;; | ||
1410 | link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; | ||
1411 | esac | ||
1412 | fi | ||
1413 | for deplib in $libs; do | ||
1414 | lib= | ||
1415 | found=no | ||
1416 | case $deplib in | ||
1417 | -l*) | ||
1418 | if test $linkmode = oldlib && test $linkmode = obj; then | ||
1419 | $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 | ||
1420 | continue | ||
1421 | fi | ||
1422 | if test $pass = conv; then | ||
1423 | deplibs="$deplib $deplibs" | ||
1424 | continue | ||
1425 | fi | ||
1426 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` | ||
1427 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
1428 | # Search the libtool library | ||
1429 | lib="$searchdir/lib${name}.la" | ||
1430 | if test -f "$lib"; then | ||
1431 | found=yes | ||
1432 | break | ||
1433 | fi | ||
1434 | done | ||
1435 | if test "$found" != yes; then | ||
1436 | # deplib doesn't seem to be a libtool library | ||
1437 | if test "$linkmode,$pass" = "prog,link"; then | ||
1438 | compile_deplibs="$deplib $compile_deplibs" | ||
1439 | finalize_deplibs="$deplib $finalize_deplibs" | ||
1440 | else | ||
1441 | deplibs="$deplib $deplibs" | ||
1442 | test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" | ||
1443 | fi | ||
1444 | continue | ||
1445 | fi | ||
1446 | ;; # -l | ||
1447 | -L*) | ||
1448 | case $linkmode in | ||
1449 | lib) | ||
1450 | deplibs="$deplib $deplibs" | ||
1451 | test $pass = conv && continue | ||
1452 | newdependency_libs="$deplib $newdependency_libs" | ||
1453 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` | ||
1454 | ;; | ||
1455 | prog) | ||
1456 | if test $pass = conv; then | ||
1457 | deplibs="$deplib $deplibs" | ||
1458 | continue | ||
1459 | fi | ||
1460 | if test $pass = scan; then | ||
1461 | deplibs="$deplib $deplibs" | ||
1462 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` | ||
1463 | else | ||
1464 | compile_deplibs="$deplib $compile_deplibs" | ||
1465 | finalize_deplibs="$deplib $finalize_deplibs" | ||
1466 | fi | ||
1467 | ;; | ||
1468 | *) | ||
1469 | $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 | ||
1470 | ;; | ||
1471 | esac # linkmode | ||
1472 | continue | ||
1473 | ;; # -L | ||
1474 | -R*) | ||
1475 | if test $pass = link; then | ||
1476 | dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` | ||
1477 | # Make sure the xrpath contains only unique directories. | ||
1478 | case "$xrpath " in | ||
1479 | *" $dir "*) ;; | ||
1480 | *) xrpath="$xrpath $dir" ;; | ||
1481 | esac | ||
1482 | fi | ||
1483 | deplibs="$deplib $deplibs" | ||
1484 | continue | ||
1485 | ;; | ||
1486 | *.la) lib="$deplib" ;; | ||
1487 | *.$libext) | ||
1488 | if test $pass = conv; then | ||
1489 | deplibs="$deplib $deplibs" | ||
1490 | continue | ||
1491 | fi | ||
1492 | case $linkmode in | ||
1493 | lib) | ||
1494 | if test "$deplibs_check_method" != pass_all; then | ||
1495 | echo | ||
1496 | echo "*** Warning: Trying to link with static lib archive $deplib." | ||
1497 | echo "*** I have the capability to make that library automatically link in when" | ||
1498 | echo "*** you link to this library. But I can only do this if you have a" | ||
1499 | echo "*** shared version of the library, which you do not appear to have" | ||
1500 | echo "*** because the file extensions .$libext of this argument makes me believe" | ||
1501 | echo "*** that it is just a static archive that I should not used here." | ||
1502 | else | ||
1503 | echo | ||
1504 | echo "*** Warning: Linking the shared library $output against the" | ||
1505 | echo "*** static library $deplib is not portable!" | ||
1506 | deplibs="$deplib $deplibs" | ||
1507 | fi | ||
1508 | continue | ||
1509 | ;; | ||
1510 | prog) | ||
1511 | if test $pass != link; then | ||
1512 | deplibs="$deplib $deplibs" | ||
1513 | else | ||
1514 | compile_deplibs="$deplib $compile_deplibs" | ||
1515 | finalize_deplibs="$deplib $finalize_deplibs" | ||
1516 | fi | ||
1517 | continue | ||
1518 | ;; | ||
1519 | esac # linkmode | ||
1520 | ;; # *.$libext | ||
1521 | *.lo | *.$objext) | ||
1522 | if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then | ||
1523 | # If there is no dlopen support or we're linking statically, | ||
1524 | # we need to preload. | ||
1525 | newdlprefiles="$newdlprefiles $deplib" | ||
1526 | compile_deplibs="$deplib $compile_deplibs" | ||
1527 | finalize_deplibs="$deplib $finalize_deplibs" | ||
1528 | else | ||
1529 | newdlfiles="$newdlfiles $deplib" | ||
1530 | fi | ||
1531 | continue | ||
1532 | ;; | ||
1533 | %DEPLIBS%) | ||
1534 | alldeplibs=yes | ||
1535 | continue | ||
1536 | ;; | ||
1537 | esac # case $deplib | ||
1538 | if test $found = yes || test -f "$lib"; then : | ||
1539 | else | ||
1540 | $echo "$modename: cannot find the library \`$lib'" 1>&2 | ||
1541 | exit 1 | ||
1542 | fi | ||
1543 | |||
1544 | # Check to see that this really is a libtool archive. | ||
1545 | if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
1546 | else | ||
1547 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
1548 | exit 1 | ||
1549 | fi | ||
1550 | |||
1551 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` | ||
1552 | test "X$ladir" = "X$lib" && ladir="." | ||
1553 | |||
1554 | dlname= | ||
1555 | dlopen= | ||
1556 | dlpreopen= | ||
1557 | libdir= | ||
1558 | library_names= | ||
1559 | old_library= | ||
1560 | # If the library was installed with an old release of libtool, | ||
1561 | # it will not redefine variable installed. | ||
1562 | installed=yes | ||
1563 | |||
1564 | # Read the .la file | ||
1565 | case $lib in | ||
1566 | */* | *\\*) . $lib ;; | ||
1567 | *) . ./$lib ;; | ||
1568 | esac | ||
1569 | |||
1570 | if test "$linkmode,$pass" = "lib,link" || | ||
1571 | test "$linkmode,$pass" = "prog,scan" || | ||
1572 | { test $linkmode = oldlib && test $linkmode = obj; }; then | ||
1573 | # Add dl[pre]opened files of deplib | ||
1574 | test -n "$dlopen" && dlfiles="$dlfiles $dlopen" | ||
1575 | test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" | ||
1576 | fi | ||
1577 | |||
1578 | if test $pass = conv; then | ||
1579 | # Only check for convenience libraries | ||
1580 | deplibs="$lib $deplibs" | ||
1581 | if test -z "$libdir"; then | ||
1582 | if test -z "$old_library"; then | ||
1583 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | ||
1584 | exit 1 | ||
1585 | fi | ||
1586 | # It is a libtool convenience library, so add in its objects. | ||
1587 | convenience="$convenience $ladir/$objdir/$old_library" | ||
1588 | old_convenience="$old_convenience $ladir/$objdir/$old_library" | ||
1589 | tmp_libs= | ||
1590 | for deplib in $dependency_libs; do | ||
1591 | deplibs="$deplib $deplibs" | ||
1592 | if test "X$duplicate_deps" = "Xyes" ; then | ||
1593 | case "$tmp_libs " in | ||
1594 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
1595 | esac | ||
1596 | fi | ||
1597 | tmp_libs="$tmp_libs $deplib" | ||
1598 | done | ||
1599 | elif test $linkmode != prog && test $linkmode != lib; then | ||
1600 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 | ||
1601 | exit 1 | ||
1602 | fi | ||
1603 | continue | ||
1604 | fi # $pass = conv | ||
1605 | |||
1606 | # Get the name of the library we link against. | ||
1607 | linklib= | ||
1608 | for l in $old_library $library_names; do | ||
1609 | linklib="$l" | ||
1610 | done | ||
1611 | if test -z "$linklib"; then | ||
1612 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | ||
1613 | exit 1 | ||
1614 | fi | ||
1615 | |||
1616 | # This library was specified with -dlopen. | ||
1617 | if test $pass = dlopen; then | ||
1618 | if test -z "$libdir"; then | ||
1619 | $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 | ||
1620 | exit 1 | ||
1621 | fi | ||
1622 | if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then | ||
1623 | # If there is no dlname, no dlopen support or we're linking | ||
1624 | # statically, we need to preload. | ||
1625 | dlprefiles="$dlprefiles $lib" | ||
1626 | else | ||
1627 | newdlfiles="$newdlfiles $lib" | ||
1628 | fi | ||
1629 | continue | ||
1630 | fi # $pass = dlopen | ||
1631 | |||
1632 | # We need an absolute path. | ||
1633 | case $ladir in | ||
1634 | [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; | ||
1635 | *) | ||
1636 | abs_ladir=`cd "$ladir" && pwd` | ||
1637 | if test -z "$abs_ladir"; then | ||
1638 | $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 | ||
1639 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 | ||
1640 | abs_ladir="$ladir" | ||
1641 | fi | ||
1642 | ;; | ||
1643 | esac | ||
1644 | laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
1645 | |||
1646 | # Find the relevant object directory and library name. | ||
1647 | if test "X$installed" = Xyes; then | ||
1648 | if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then | ||
1649 | $echo "$modename: warning: library \`$lib' was moved." 1>&2 | ||
1650 | dir="$ladir" | ||
1651 | absdir="$abs_ladir" | ||
1652 | libdir="$abs_ladir" | ||
1653 | else | ||
1654 | dir="$libdir" | ||
1655 | absdir="$libdir" | ||
1656 | fi | ||
1657 | else | ||
1658 | dir="$ladir/$objdir" | ||
1659 | absdir="$abs_ladir/$objdir" | ||
1660 | # Remove this search path later | ||
1661 | notinst_path="$notinst_path $abs_ladir" | ||
1662 | fi # $installed = yes | ||
1663 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | ||
1664 | |||
1665 | # This library was specified with -dlpreopen. | ||
1666 | if test $pass = dlpreopen; then | ||
1667 | if test -z "$libdir"; then | ||
1668 | $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 | ||
1669 | exit 1 | ||
1670 | fi | ||
1671 | # Prefer using a static library (so that no silly _DYNAMIC symbols | ||
1672 | # are required to link). | ||
1673 | if test -n "$old_library"; then | ||
1674 | newdlprefiles="$newdlprefiles $dir/$old_library" | ||
1675 | # Otherwise, use the dlname, so that lt_dlopen finds it. | ||
1676 | elif test -n "$dlname"; then | ||
1677 | newdlprefiles="$newdlprefiles $dir/$dlname" | ||
1678 | else | ||
1679 | newdlprefiles="$newdlprefiles $dir/$linklib" | ||
1680 | fi | ||
1681 | fi # $pass = dlpreopen | ||
1682 | |||
1683 | if test -z "$libdir"; then | ||
1684 | # Link the convenience library | ||
1685 | if test $linkmode = lib; then | ||
1686 | deplibs="$dir/$old_library $deplibs" | ||
1687 | elif test "$linkmode,$pass" = "prog,link"; then | ||
1688 | compile_deplibs="$dir/$old_library $compile_deplibs" | ||
1689 | finalize_deplibs="$dir/$old_library $finalize_deplibs" | ||
1690 | else | ||
1691 | deplibs="$lib $deplibs" | ||
1692 | fi | ||
1693 | continue | ||
1694 | fi | ||
1695 | |||
1696 | if test $linkmode = prog && test $pass != link; then | ||
1697 | newlib_search_path="$newlib_search_path $ladir" | ||
1698 | deplibs="$lib $deplibs" | ||
1699 | |||
1700 | linkalldeplibs=no | ||
1701 | if test "$link_all_deplibs" != no || test -z "$library_names" || | ||
1702 | test "$build_libtool_libs" = no; then | ||
1703 | linkalldeplibs=yes | ||
1704 | fi | ||
1705 | |||
1706 | tmp_libs= | ||
1707 | for deplib in $dependency_libs; do | ||
1708 | case $deplib in | ||
1709 | -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test | ||
1710 | esac | ||
1711 | # Need to link against all dependency_libs? | ||
1712 | if test $linkalldeplibs = yes; then | ||
1713 | deplibs="$deplib $deplibs" | ||
1714 | else | ||
1715 | # Need to hardcode shared library paths | ||
1716 | # or/and link against static libraries | ||
1717 | newdependency_libs="$deplib $newdependency_libs" | ||
1718 | fi | ||
1719 | if test "X$duplicate_deps" = "Xyes" ; then | ||
1720 | case "$tmp_libs " in | ||
1721 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
1722 | esac | ||
1723 | fi | ||
1724 | tmp_libs="$tmp_libs $deplib" | ||
1725 | done # for deplib | ||
1726 | continue | ||
1727 | fi # $linkmode = prog... | ||
1728 | |||
1729 | link_static=no # Whether the deplib will be linked statically | ||
1730 | if test -n "$library_names" && | ||
1731 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then | ||
1732 | # Link against this shared library | ||
1733 | |||
1734 | if test "$linkmode,$pass" = "prog,link" || | ||
1735 | { test $linkmode = lib && test $hardcode_into_libs = yes; }; then | ||
1736 | # Hardcode the library path. | ||
1737 | # Skip directories that are in the system default run-time | ||
1738 | # search path. | ||
1739 | case " $sys_lib_dlsearch_path " in | ||
1740 | *" $absdir "*) ;; | ||
1741 | *) | ||
1742 | case "$compile_rpath " in | ||
1743 | *" $absdir "*) ;; | ||
1744 | *) compile_rpath="$compile_rpath $absdir" | ||
1745 | esac | ||
1746 | ;; | ||
1747 | esac | ||
1748 | case " $sys_lib_dlsearch_path " in | ||
1749 | *" $libdir "*) ;; | ||
1750 | *) | ||
1751 | case "$finalize_rpath " in | ||
1752 | *" $libdir "*) ;; | ||
1753 | *) finalize_rpath="$finalize_rpath $libdir" | ||
1754 | esac | ||
1755 | ;; | ||
1756 | esac | ||
1757 | if test $linkmode = prog; then | ||
1758 | # We need to hardcode the library path | ||
1759 | if test -n "$shlibpath_var"; then | ||
1760 | # Make sure the rpath contains only unique directories. | ||
1761 | case "$temp_rpath " in | ||
1762 | *" $dir "*) ;; | ||
1763 | *" $absdir "*) ;; | ||
1764 | *) temp_rpath="$temp_rpath $dir" ;; | ||
1765 | esac | ||
1766 | fi | ||
1767 | fi | ||
1768 | fi # $linkmode,$pass = prog,link... | ||
1769 | |||
1770 | if test "$alldeplibs" = yes && | ||
1771 | { test "$deplibs_check_method" = pass_all || | ||
1772 | { test "$build_libtool_libs" = yes && | ||
1773 | test -n "$library_names"; }; }; then | ||
1774 | # We only need to search for static libraries | ||
1775 | continue | ||
1776 | fi | ||
1777 | |||
1778 | if test "$installed" = no; then | ||
1779 | notinst_deplibs="$notinst_deplibs $lib" | ||
1780 | need_relink=yes | ||
1781 | fi | ||
1782 | |||
1783 | if test -n "$old_archive_from_expsyms_cmds"; then | ||
1784 | # figure out the soname | ||
1785 | set dummy $library_names | ||
1786 | realname="$2" | ||
1787 | shift; shift | ||
1788 | libname=`eval \\$echo \"$libname_spec\"` | ||
1789 | # use dlname if we got it. it's perfectly good, no? | ||
1790 | if test -n "$dlname"; then | ||
1791 | soname="$dlname" | ||
1792 | elif test -n "$soname_spec"; then | ||
1793 | # bleh windows | ||
1794 | case $host in | ||
1795 | *cygwin*) | ||
1796 | major=`expr $current - $age` | ||
1797 | versuffix="-$major" | ||
1798 | ;; | ||
1799 | esac | ||
1800 | eval soname=\"$soname_spec\" | ||
1801 | else | ||
1802 | soname="$realname" | ||
1803 | fi | ||
1804 | |||
1805 | # Make a new name for the extract_expsyms_cmds to use | ||
1806 | soroot="$soname" | ||
1807 | soname=`echo $soroot | ${SED} -e 's/^.*\///'` | ||
1808 | newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" | ||
1809 | |||
1810 | # If the library has no export list, then create one now | ||
1811 | if test -f "$output_objdir/$soname-def"; then : | ||
1812 | else | ||
1813 | $show "extracting exported symbol list from \`$soname'" | ||
1814 | save_ifs="$IFS"; IFS='~' | ||
1815 | eval cmds=\"$extract_expsyms_cmds\" | ||
1816 | for cmd in $cmds; do | ||
1817 | IFS="$save_ifs" | ||
1818 | $show "$cmd" | ||
1819 | $run eval "$cmd" || exit $? | ||
1820 | done | ||
1821 | IFS="$save_ifs" | ||
1822 | fi | ||
1823 | |||
1824 | # Create $newlib | ||
1825 | if test -f "$output_objdir/$newlib"; then :; else | ||
1826 | $show "generating import library for \`$soname'" | ||
1827 | save_ifs="$IFS"; IFS='~' | ||
1828 | eval cmds=\"$old_archive_from_expsyms_cmds\" | ||
1829 | for cmd in $cmds; do | ||
1830 | IFS="$save_ifs" | ||
1831 | $show "$cmd" | ||
1832 | $run eval "$cmd" || exit $? | ||
1833 | done | ||
1834 | IFS="$save_ifs" | ||
1835 | fi | ||
1836 | # make sure the library variables are pointing to the new library | ||
1837 | dir=$output_objdir | ||
1838 | linklib=$newlib | ||
1839 | fi # test -n $old_archive_from_expsyms_cmds | ||
1840 | |||
1841 | if test $linkmode = prog || test "$mode" != relink; then | ||
1842 | add_shlibpath= | ||
1843 | add_dir= | ||
1844 | add= | ||
1845 | lib_linked=yes | ||
1846 | case $hardcode_action in | ||
1847 | immediate | unsupported) | ||
1848 | if test "$hardcode_direct" = no; then | ||
1849 | add="$dir/$linklib" | ||
1850 | elif test "$hardcode_minus_L" = no; then | ||
1851 | case $host in | ||
1852 | *-*-sunos*) add_shlibpath="$dir" ;; | ||
1853 | esac | ||
1854 | add_dir="-L$dir" | ||
1855 | add="-l$name" | ||
1856 | elif test "$hardcode_shlibpath_var" = no; then | ||
1857 | add_shlibpath="$dir" | ||
1858 | add="-l$name" | ||
1859 | else | ||
1860 | lib_linked=no | ||
1861 | fi | ||
1862 | ;; | ||
1863 | relink) | ||
1864 | if test "$hardcode_direct" = yes; then | ||
1865 | add="$dir/$linklib" | ||
1866 | elif test "$hardcode_minus_L" = yes; then | ||
1867 | add_dir="-L$dir" | ||
1868 | # Try looking first in the location we're being installed to. | ||
1869 | if test -n "$inst_prefix_dir"; then | ||
1870 | case "$libdir" in | ||
1871 | [\/]*) | ||
1872 | add_dir="-L$inst_prefix_dir$libdir $add_dir" | ||
1873 | ;; | ||
1874 | esac | ||
1875 | fi | ||
1876 | add="-l$name" | ||
1877 | elif test "$hardcode_shlibpath_var" = yes; then | ||
1878 | add_shlibpath="$dir" | ||
1879 | add="-l$name" | ||
1880 | else | ||
1881 | lib_linked=no | ||
1882 | fi | ||
1883 | ;; | ||
1884 | *) lib_linked=no ;; | ||
1885 | esac | ||
1886 | |||
1887 | if test "$lib_linked" != yes; then | ||
1888 | $echo "$modename: configuration error: unsupported hardcode properties" | ||
1889 | exit 1 | ||
1890 | fi | ||
1891 | |||
1892 | if test -n "$add_shlibpath"; then | ||
1893 | case :$compile_shlibpath: in | ||
1894 | *":$add_shlibpath:"*) ;; | ||
1895 | *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; | ||
1896 | esac | ||
1897 | fi | ||
1898 | if test $linkmode = prog; then | ||
1899 | test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" | ||
1900 | test -n "$add" && compile_deplibs="$add $compile_deplibs" | ||
1901 | else | ||
1902 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | ||
1903 | test -n "$add" && deplibs="$add $deplibs" | ||
1904 | if test "$hardcode_direct" != yes && \ | ||
1905 | test "$hardcode_minus_L" != yes && \ | ||
1906 | test "$hardcode_shlibpath_var" = yes; then | ||
1907 | case :$finalize_shlibpath: in | ||
1908 | *":$libdir:"*) ;; | ||
1909 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
1910 | esac | ||
1911 | fi | ||
1912 | fi | ||
1913 | fi | ||
1914 | |||
1915 | if test $linkmode = prog || test "$mode" = relink; then | ||
1916 | add_shlibpath= | ||
1917 | add_dir= | ||
1918 | add= | ||
1919 | # Finalize command for both is simple: just hardcode it. | ||
1920 | if test "$hardcode_direct" = yes; then | ||
1921 | add="$libdir/$linklib" | ||
1922 | elif test "$hardcode_minus_L" = yes; then | ||
1923 | add_dir="-L$libdir" | ||
1924 | add="-l$name" | ||
1925 | elif test "$hardcode_shlibpath_var" = yes; then | ||
1926 | case :$finalize_shlibpath: in | ||
1927 | *":$libdir:"*) ;; | ||
1928 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
1929 | esac | ||
1930 | add="-l$name" | ||
1931 | else | ||
1932 | # We cannot seem to hardcode it, guess we'll fake it. | ||
1933 | add_dir="-L$libdir" | ||
1934 | # Try looking first in the location we're being installed to. | ||
1935 | if test -n "$inst_prefix_dir"; then | ||
1936 | case "$libdir" in | ||
1937 | [\/]*) | ||
1938 | add_dir="-L$inst_prefix_dir$libdir $add_dir" | ||
1939 | ;; | ||
1940 | esac | ||
1941 | fi | ||
1942 | add="-l$name" | ||
1943 | fi | ||
1944 | |||
1945 | if test $linkmode = prog; then | ||
1946 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" | ||
1947 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" | ||
1948 | else | ||
1949 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | ||
1950 | test -n "$add" && deplibs="$add $deplibs" | ||
1951 | fi | ||
1952 | fi | ||
1953 | elif test $linkmode = prog; then | ||
1954 | if test "$alldeplibs" = yes && | ||
1955 | { test "$deplibs_check_method" = pass_all || | ||
1956 | { test "$build_libtool_libs" = yes && | ||
1957 | test -n "$library_names"; }; }; then | ||
1958 | # We only need to search for static libraries | ||
1959 | continue | ||
1960 | fi | ||
1961 | |||
1962 | # Try to link the static library | ||
1963 | # Here we assume that one of hardcode_direct or hardcode_minus_L | ||
1964 | # is not unsupported. This is valid on all known static and | ||
1965 | # shared platforms. | ||
1966 | if test "$hardcode_direct" != unsupported; then | ||
1967 | test -n "$old_library" && linklib="$old_library" | ||
1968 | compile_deplibs="$dir/$linklib $compile_deplibs" | ||
1969 | finalize_deplibs="$dir/$linklib $finalize_deplibs" | ||
1970 | else | ||
1971 | compile_deplibs="-l$name -L$dir $compile_deplibs" | ||
1972 | finalize_deplibs="-l$name -L$dir $finalize_deplibs" | ||
1973 | fi | ||
1974 | elif test "$build_libtool_libs" = yes; then | ||
1975 | # Not a shared library | ||
1976 | if test "$deplibs_check_method" != pass_all; then | ||
1977 | # We're trying link a shared library against a static one | ||
1978 | # but the system doesn't support it. | ||
1979 | |||
1980 | # Just print a warning and add the library to dependency_libs so | ||
1981 | # that the program can be linked against the static library. | ||
1982 | echo | ||
1983 | echo "*** Warning: This system can not link to static lib archive $lib." | ||
1984 | echo "*** I have the capability to make that library automatically link in when" | ||
1985 | echo "*** you link to this library. But I can only do this if you have a" | ||
1986 | echo "*** shared version of the library, which you do not appear to have." | ||
1987 | if test "$module" = yes; then | ||
1988 | echo "*** But as you try to build a module library, libtool will still create " | ||
1989 | echo "*** a static module, that should work as long as the dlopening application" | ||
1990 | echo "*** is linked with the -dlopen flag to resolve symbols at runtime." | ||
1991 | if test -z "$global_symbol_pipe"; then | ||
1992 | echo | ||
1993 | echo "*** However, this would only work if libtool was able to extract symbol" | ||
1994 | echo "*** lists from a program, using \`nm' or equivalent, but libtool could" | ||
1995 | echo "*** not find such a program. So, this module is probably useless." | ||
1996 | echo "*** \`nm' from GNU binutils and a full rebuild may help." | ||
1997 | fi | ||
1998 | if test "$build_old_libs" = no; then | ||
1999 | build_libtool_libs=module | ||
2000 | build_old_libs=yes | ||
2001 | else | ||
2002 | build_libtool_libs=no | ||
2003 | fi | ||
2004 | fi | ||
2005 | else | ||
2006 | convenience="$convenience $dir/$old_library" | ||
2007 | old_convenience="$old_convenience $dir/$old_library" | ||
2008 | deplibs="$dir/$old_library $deplibs" | ||
2009 | link_static=yes | ||
2010 | fi | ||
2011 | fi # link shared/static library? | ||
2012 | |||
2013 | if test $linkmode = lib; then | ||
2014 | if test -n "$dependency_libs" && | ||
2015 | { test $hardcode_into_libs != yes || test $build_old_libs = yes || | ||
2016 | test $link_static = yes; }; then | ||
2017 | # Extract -R from dependency_libs | ||
2018 | temp_deplibs= | ||
2019 | for libdir in $dependency_libs; do | ||
2020 | case $libdir in | ||
2021 | -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` | ||
2022 | case " $xrpath " in | ||
2023 | *" $temp_xrpath "*) ;; | ||
2024 | *) xrpath="$xrpath $temp_xrpath";; | ||
2025 | esac;; | ||
2026 | *) temp_deplibs="$temp_deplibs $libdir";; | ||
2027 | esac | ||
2028 | done | ||
2029 | dependency_libs="$temp_deplibs" | ||
2030 | fi | ||
2031 | |||
2032 | newlib_search_path="$newlib_search_path $absdir" | ||
2033 | # Link against this library | ||
2034 | test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" | ||
2035 | # ... and its dependency_libs | ||
2036 | tmp_libs= | ||
2037 | for deplib in $dependency_libs; do | ||
2038 | newdependency_libs="$deplib $newdependency_libs" | ||
2039 | if test "X$duplicate_deps" = "Xyes" ; then | ||
2040 | case "$tmp_libs " in | ||
2041 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
2042 | esac | ||
2043 | fi | ||
2044 | tmp_libs="$tmp_libs $deplib" | ||
2045 | done | ||
2046 | |||
2047 | if test $link_all_deplibs != no; then | ||
2048 | # Add the search paths of all dependency libraries | ||
2049 | for deplib in $dependency_libs; do | ||
2050 | case $deplib in | ||
2051 | -L*) path="$deplib" ;; | ||
2052 | *.la) | ||
2053 | dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` | ||
2054 | test "X$dir" = "X$deplib" && dir="." | ||
2055 | # We need an absolute path. | ||
2056 | case $dir in | ||
2057 | [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; | ||
2058 | *) | ||
2059 | absdir=`cd "$dir" && pwd` | ||
2060 | if test -z "$absdir"; then | ||
2061 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 | ||
2062 | absdir="$dir" | ||
2063 | fi | ||
2064 | ;; | ||
2065 | esac | ||
2066 | if grep "^installed=no" $deplib > /dev/null; then | ||
2067 | path="-L$absdir/$objdir" | ||
2068 | else | ||
2069 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
2070 | if test -z "$libdir"; then | ||
2071 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | ||
2072 | exit 1 | ||
2073 | fi | ||
2074 | if test "$absdir" != "$libdir"; then | ||
2075 | $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 | ||
2076 | fi | ||
2077 | path="-L$absdir" | ||
2078 | fi | ||
2079 | ;; | ||
2080 | *) continue ;; | ||
2081 | esac | ||
2082 | case " $deplibs " in | ||
2083 | *" $path "*) ;; | ||
2084 | *) deplibs="$deplibs $path" ;; | ||
2085 | esac | ||
2086 | done | ||
2087 | fi # link_all_deplibs != no | ||
2088 | fi # linkmode = lib | ||
2089 | done # for deplib in $libs | ||
2090 | if test $pass = dlpreopen; then | ||
2091 | # Link the dlpreopened libraries before other libraries | ||
2092 | for deplib in $save_deplibs; do | ||
2093 | deplibs="$deplib $deplibs" | ||
2094 | done | ||
2095 | fi | ||
2096 | if test $pass != dlopen; then | ||
2097 | test $pass != scan && dependency_libs="$newdependency_libs" | ||
2098 | if test $pass != conv; then | ||
2099 | # Make sure lib_search_path contains only unique directories. | ||
2100 | lib_search_path= | ||
2101 | for dir in $newlib_search_path; do | ||
2102 | case "$lib_search_path " in | ||
2103 | *" $dir "*) ;; | ||
2104 | *) lib_search_path="$lib_search_path $dir" ;; | ||
2105 | esac | ||
2106 | done | ||
2107 | newlib_search_path= | ||
2108 | fi | ||
2109 | |||
2110 | if test "$linkmode,$pass" != "prog,link"; then | ||
2111 | vars="deplibs" | ||
2112 | else | ||
2113 | vars="compile_deplibs finalize_deplibs" | ||
2114 | fi | ||
2115 | for var in $vars dependency_libs; do | ||
2116 | # Add libraries to $var in reverse order | ||
2117 | eval tmp_libs=\"\$$var\" | ||
2118 | new_libs= | ||
2119 | for deplib in $tmp_libs; do | ||
2120 | case $deplib in | ||
2121 | -L*) new_libs="$deplib $new_libs" ;; | ||
2122 | *) | ||
2123 | case " $specialdeplibs " in | ||
2124 | *" $deplib "*) new_libs="$deplib $new_libs" ;; | ||
2125 | *) | ||
2126 | case " $new_libs " in | ||
2127 | *" $deplib "*) ;; | ||
2128 | *) new_libs="$deplib $new_libs" ;; | ||
2129 | esac | ||
2130 | ;; | ||
2131 | esac | ||
2132 | ;; | ||
2133 | esac | ||
2134 | done | ||
2135 | tmp_libs= | ||
2136 | for deplib in $new_libs; do | ||
2137 | case $deplib in | ||
2138 | -L*) | ||
2139 | case " $tmp_libs " in | ||
2140 | *" $deplib "*) ;; | ||
2141 | *) tmp_libs="$tmp_libs $deplib" ;; | ||
2142 | esac | ||
2143 | ;; | ||
2144 | *) tmp_libs="$tmp_libs $deplib" ;; | ||
2145 | esac | ||
2146 | done | ||
2147 | eval $var=\"$tmp_libs\" | ||
2148 | done # for var | ||
2149 | fi | ||
2150 | if test "$pass" = "conv" && | ||
2151 | { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then | ||
2152 | libs="$deplibs" # reset libs | ||
2153 | deplibs= | ||
2154 | fi | ||
2155 | done # for pass | ||
2156 | if test $linkmode = prog; then | ||
2157 | dlfiles="$newdlfiles" | ||
2158 | dlprefiles="$newdlprefiles" | ||
2159 | fi | ||
2160 | |||
2161 | case $linkmode in | ||
2162 | oldlib) | ||
2163 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
2164 | $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 | ||
2165 | fi | ||
2166 | |||
2167 | if test -n "$rpath"; then | ||
2168 | $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 | ||
2169 | fi | ||
2170 | |||
2171 | if test -n "$xrpath"; then | ||
2172 | $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 | ||
2173 | fi | ||
2174 | |||
2175 | if test -n "$vinfo"; then | ||
2176 | $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 | ||
2177 | fi | ||
2178 | |||
2179 | if test -n "$release"; then | ||
2180 | $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 | ||
2181 | fi | ||
2182 | |||
2183 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | ||
2184 | $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 | ||
2185 | fi | ||
2186 | |||
2187 | # Now set the variables for building old libraries. | ||
2188 | build_libtool_libs=no | ||
2189 | oldlibs="$output" | ||
2190 | objs="$objs$old_deplibs" | ||
2191 | ;; | ||
2192 | |||
2193 | lib) | ||
2194 | # Make sure we only generate libraries of the form `libNAME.la'. | ||
2195 | case $outputname in | ||
2196 | lib*) | ||
2197 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | ||
2198 | eval libname=\"$libname_spec\" | ||
2199 | ;; | ||
2200 | *) | ||
2201 | if test "$module" = no; then | ||
2202 | $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 | ||
2203 | $echo "$help" 1>&2 | ||
2204 | exit 1 | ||
2205 | fi | ||
2206 | if test "$need_lib_prefix" != no; then | ||
2207 | # Add the "lib" prefix for modules if required | ||
2208 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | ||
2209 | eval libname=\"$libname_spec\" | ||
2210 | else | ||
2211 | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | ||
2212 | fi | ||
2213 | ;; | ||
2214 | esac | ||
2215 | |||
2216 | if test -n "$objs"; then | ||
2217 | if test "$deplibs_check_method" != pass_all; then | ||
2218 | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 | ||
2219 | exit 1 | ||
2220 | else | ||
2221 | echo | ||
2222 | echo "*** Warning: Linking the shared library $output against the non-libtool" | ||
2223 | echo "*** objects $objs is not portable!" | ||
2224 | libobjs="$libobjs $objs" | ||
2225 | fi | ||
2226 | fi | ||
2227 | |||
2228 | if test "$dlself" != no; then | ||
2229 | $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 | ||
2230 | fi | ||
2231 | |||
2232 | set dummy $rpath | ||
2233 | if test $# -gt 2; then | ||
2234 | $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 | ||
2235 | fi | ||
2236 | install_libdir="$2" | ||
2237 | |||
2238 | oldlibs= | ||
2239 | if test -z "$rpath"; then | ||
2240 | if test "$build_libtool_libs" = yes; then | ||
2241 | # Building a libtool convenience library. | ||
2242 | libext=al | ||
2243 | oldlibs="$output_objdir/$libname.$libext $oldlibs" | ||
2244 | build_libtool_libs=convenience | ||
2245 | build_old_libs=yes | ||
2246 | fi | ||
2247 | |||
2248 | if test -n "$vinfo"; then | ||
2249 | $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 | ||
2250 | fi | ||
2251 | |||
2252 | if test -n "$release"; then | ||
2253 | $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 | ||
2254 | fi | ||
2255 | else | ||
2256 | |||
2257 | # Parse the version information argument. | ||
2258 | save_ifs="$IFS"; IFS=':' | ||
2259 | set dummy $vinfo 0 0 0 | ||
2260 | IFS="$save_ifs" | ||
2261 | |||
2262 | if test -n "$8"; then | ||
2263 | $echo "$modename: too many parameters to \`-version-info'" 1>&2 | ||
2264 | $echo "$help" 1>&2 | ||
2265 | exit 1 | ||
2266 | fi | ||
2267 | |||
2268 | current="$2" | ||
2269 | revision="$3" | ||
2270 | age="$4" | ||
2271 | |||
2272 | # Check that each of the things are valid numbers. | ||
2273 | case $current in | ||
2274 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; | ||
2275 | *) | ||
2276 | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 | ||
2277 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
2278 | exit 1 | ||
2279 | ;; | ||
2280 | esac | ||
2281 | |||
2282 | case $revision in | ||
2283 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; | ||
2284 | *) | ||
2285 | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 | ||
2286 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
2287 | exit 1 | ||
2288 | ;; | ||
2289 | esac | ||
2290 | |||
2291 | case $age in | ||
2292 | 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; | ||
2293 | *) | ||
2294 | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 | ||
2295 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
2296 | exit 1 | ||
2297 | ;; | ||
2298 | esac | ||
2299 | |||
2300 | if test $age -gt $current; then | ||
2301 | $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 | ||
2302 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
2303 | exit 1 | ||
2304 | fi | ||
2305 | |||
2306 | # Calculate the version variables. | ||
2307 | major= | ||
2308 | versuffix= | ||
2309 | verstring= | ||
2310 | case $version_type in | ||
2311 | none) ;; | ||
2312 | |||
2313 | darwin) | ||
2314 | # Like Linux, but with the current version available in | ||
2315 | # verstring for coding it into the library header | ||
2316 | major=.`expr $current - $age` | ||
2317 | versuffix="$major.$age.$revision" | ||
2318 | # Darwin ld doesn't like 0 for these options... | ||
2319 | minor_current=`expr $current + 1` | ||
2320 | verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" | ||
2321 | ;; | ||
2322 | |||
2323 | freebsd-aout) | ||
2324 | major=".$current" | ||
2325 | versuffix=".$current.$revision"; | ||
2326 | ;; | ||
2327 | |||
2328 | freebsd-elf) | ||
2329 | major=".$current" | ||
2330 | versuffix=".$current"; | ||
2331 | ;; | ||
2332 | |||
2333 | irix | nonstopux) | ||
2334 | major=`expr $current - $age + 1` | ||
2335 | |||
2336 | case $version_type in | ||
2337 | nonstopux) verstring_prefix=nonstopux ;; | ||
2338 | *) verstring_prefix=sgi ;; | ||
2339 | esac | ||
2340 | verstring="$verstring_prefix$major.$revision" | ||
2341 | |||
2342 | # Add in all the interfaces that we are compatible with. | ||
2343 | loop=$revision | ||
2344 | while test $loop != 0; do | ||
2345 | iface=`expr $revision - $loop` | ||
2346 | loop=`expr $loop - 1` | ||
2347 | verstring="$verstring_prefix$major.$iface:$verstring" | ||
2348 | done | ||
2349 | |||
2350 | # Before this point, $major must not contain `.'. | ||
2351 | major=.$major | ||
2352 | versuffix="$major.$revision" | ||
2353 | ;; | ||
2354 | |||
2355 | linux) | ||
2356 | major=.`expr $current - $age` | ||
2357 | versuffix="$major.$age.$revision" | ||
2358 | ;; | ||
2359 | |||
2360 | osf) | ||
2361 | major=.`expr $current - $age` | ||
2362 | versuffix=".$current.$age.$revision" | ||
2363 | verstring="$current.$age.$revision" | ||
2364 | |||
2365 | # Add in all the interfaces that we are compatible with. | ||
2366 | loop=$age | ||
2367 | while test $loop != 0; do | ||
2368 | iface=`expr $current - $loop` | ||
2369 | loop=`expr $loop - 1` | ||
2370 | verstring="$verstring:${iface}.0" | ||
2371 | done | ||
2372 | |||
2373 | # Make executables depend on our current version. | ||
2374 | verstring="$verstring:${current}.0" | ||
2375 | ;; | ||
2376 | |||
2377 | sunos) | ||
2378 | major=".$current" | ||
2379 | versuffix=".$current.$revision" | ||
2380 | ;; | ||
2381 | |||
2382 | windows) | ||
2383 | # Use '-' rather than '.', since we only want one | ||
2384 | # extension on DOS 8.3 filesystems. | ||
2385 | major=`expr $current - $age` | ||
2386 | versuffix="-$major" | ||
2387 | ;; | ||
2388 | |||
2389 | *) | ||
2390 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 | ||
2391 | echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | ||
2392 | exit 1 | ||
2393 | ;; | ||
2394 | esac | ||
2395 | |||
2396 | # Clear the version info if we defaulted, and they specified a release. | ||
2397 | if test -z "$vinfo" && test -n "$release"; then | ||
2398 | major= | ||
2399 | verstring="0.0" | ||
2400 | case $version_type in | ||
2401 | darwin) | ||
2402 | # we can't check for "0.0" in archive_cmds due to quoting | ||
2403 | # problems, so we reset it completely | ||
2404 | verstring="" | ||
2405 | ;; | ||
2406 | *) | ||
2407 | verstring="0.0" | ||
2408 | ;; | ||
2409 | esac | ||
2410 | if test "$need_version" = no; then | ||
2411 | versuffix= | ||
2412 | else | ||
2413 | versuffix=".0.0" | ||
2414 | fi | ||
2415 | fi | ||
2416 | |||
2417 | # Remove version info from name if versioning should be avoided | ||
2418 | if test "$avoid_version" = yes && test "$need_version" = no; then | ||
2419 | major= | ||
2420 | versuffix= | ||
2421 | verstring="" | ||
2422 | fi | ||
2423 | |||
2424 | # Check to see if the archive will have undefined symbols. | ||
2425 | if test "$allow_undefined" = yes; then | ||
2426 | if test "$allow_undefined_flag" = unsupported; then | ||
2427 | $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 | ||
2428 | build_libtool_libs=no | ||
2429 | build_old_libs=yes | ||
2430 | fi | ||
2431 | else | ||
2432 | # Don't allow undefined symbols. | ||
2433 | allow_undefined_flag="$no_undefined_flag" | ||
2434 | fi | ||
2435 | fi | ||
2436 | |||
2437 | if test "$mode" != relink; then | ||
2438 | # Remove our outputs. | ||
2439 | $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" | ||
2440 | $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* | ||
2441 | fi | ||
2442 | |||
2443 | # Now set the variables for building old libraries. | ||
2444 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then | ||
2445 | oldlibs="$oldlibs $output_objdir/$libname.$libext" | ||
2446 | |||
2447 | # Transform .lo files to .o files. | ||
2448 | oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` | ||
2449 | fi | ||
2450 | |||
2451 | # Eliminate all temporary directories. | ||
2452 | for path in $notinst_path; do | ||
2453 | lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` | ||
2454 | deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` | ||
2455 | dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` | ||
2456 | done | ||
2457 | |||
2458 | if test -n "$xrpath"; then | ||
2459 | # If the user specified any rpath flags, then add them. | ||
2460 | temp_xrpath= | ||
2461 | for libdir in $xrpath; do | ||
2462 | temp_xrpath="$temp_xrpath -R$libdir" | ||
2463 | case "$finalize_rpath " in | ||
2464 | *" $libdir "*) ;; | ||
2465 | *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
2466 | esac | ||
2467 | done | ||
2468 | if test $hardcode_into_libs != yes || test $build_old_libs = yes; then | ||
2469 | dependency_libs="$temp_xrpath $dependency_libs" | ||
2470 | fi | ||
2471 | fi | ||
2472 | |||
2473 | # Make sure dlfiles contains only unique files that won't be dlpreopened | ||
2474 | old_dlfiles="$dlfiles" | ||
2475 | dlfiles= | ||
2476 | for lib in $old_dlfiles; do | ||
2477 | case " $dlprefiles $dlfiles " in | ||
2478 | *" $lib "*) ;; | ||
2479 | *) dlfiles="$dlfiles $lib" ;; | ||
2480 | esac | ||
2481 | done | ||
2482 | |||
2483 | # Make sure dlprefiles contains only unique files | ||
2484 | old_dlprefiles="$dlprefiles" | ||
2485 | dlprefiles= | ||
2486 | for lib in $old_dlprefiles; do | ||
2487 | case "$dlprefiles " in | ||
2488 | *" $lib "*) ;; | ||
2489 | *) dlprefiles="$dlprefiles $lib" ;; | ||
2490 | esac | ||
2491 | done | ||
2492 | |||
2493 | if test "$build_libtool_libs" = yes; then | ||
2494 | if test -n "$rpath"; then | ||
2495 | case $host in | ||
2496 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) | ||
2497 | # these systems don't actually have a c library (as such)! | ||
2498 | ;; | ||
2499 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
2500 | # Rhapsody C library is in the System framework | ||
2501 | deplibs="$deplibs -framework System" | ||
2502 | ;; | ||
2503 | *-*-netbsd*) | ||
2504 | # Don't link with libc until the a.out ld.so is fixed. | ||
2505 | ;; | ||
2506 | *-*-openbsd* | *-*-freebsd*) | ||
2507 | # Do not include libc due to us having libc/libc_r. | ||
2508 | ;; | ||
2509 | *) | ||
2510 | # Add libc to deplibs on all other systems if necessary. | ||
2511 | if test $build_libtool_need_lc = "yes"; then | ||
2512 | deplibs="$deplibs -lc" | ||
2513 | fi | ||
2514 | ;; | ||
2515 | esac | ||
2516 | fi | ||
2517 | |||
2518 | # Transform deplibs into only deplibs that can be linked in shared. | ||
2519 | name_save=$name | ||
2520 | libname_save=$libname | ||
2521 | release_save=$release | ||
2522 | versuffix_save=$versuffix | ||
2523 | major_save=$major | ||
2524 | # I'm not sure if I'm treating the release correctly. I think | ||
2525 | # release should show up in the -l (ie -lgmp5) so we don't want to | ||
2526 | # add it in twice. Is that correct? | ||
2527 | release="" | ||
2528 | versuffix="" | ||
2529 | major="" | ||
2530 | newdeplibs= | ||
2531 | droppeddeps=no | ||
2532 | case $deplibs_check_method in | ||
2533 | pass_all) | ||
2534 | # Don't check for shared/static. Everything works. | ||
2535 | # This might be a little naive. We might want to check | ||
2536 | # whether the library exists or not. But this is on | ||
2537 | # osf3 & osf4 and I'm not really sure... Just | ||
2538 | # implementing what was already the behaviour. | ||
2539 | newdeplibs=$deplibs | ||
2540 | ;; | ||
2541 | test_compile) | ||
2542 | # This code stresses the "libraries are programs" paradigm to its | ||
2543 | # limits. Maybe even breaks it. We compile a program, linking it | ||
2544 | # against the deplibs as a proxy for the library. Then we can check | ||
2545 | # whether they linked in statically or dynamically with ldd. | ||
2546 | $rm conftest.c | ||
2547 | cat > conftest.c <<EOF | ||
2548 | int main() { return 0; } | ||
2549 | EOF | ||
2550 | $rm conftest | ||
2551 | $CC -o conftest conftest.c $deplibs | ||
2552 | if test $? -eq 0 ; then | ||
2553 | ldd_output=`ldd conftest` | ||
2554 | for i in $deplibs; do | ||
2555 | name="`expr $i : '-l\(.*\)'`" | ||
2556 | # If $name is empty we are operating on a -L argument. | ||
2557 | if test -n "$name" && test "$name" != "0"; then | ||
2558 | libname=`eval \\$echo \"$libname_spec\"` | ||
2559 | deplib_matches=`eval \\$echo \"$library_names_spec\"` | ||
2560 | set dummy $deplib_matches | ||
2561 | deplib_match=$2 | ||
2562 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
2563 | newdeplibs="$newdeplibs $i" | ||
2564 | else | ||
2565 | droppeddeps=yes | ||
2566 | echo | ||
2567 | echo "*** Warning: dynamic linker does not accept needed library $i." | ||
2568 | echo "*** I have the capability to make that library automatically link in when" | ||
2569 | echo "*** you link to this library. But I can only do this if you have a" | ||
2570 | echo "*** shared version of the library, which I believe you do not have" | ||
2571 | echo "*** because a test_compile did reveal that the linker did not use it for" | ||
2572 | echo "*** its dynamic dependency list that programs get resolved with at runtime." | ||
2573 | fi | ||
2574 | else | ||
2575 | newdeplibs="$newdeplibs $i" | ||
2576 | fi | ||
2577 | done | ||
2578 | else | ||
2579 | # Error occured in the first compile. Let's try to salvage | ||
2580 | # the situation: Compile a separate program for each library. | ||
2581 | for i in $deplibs; do | ||
2582 | name="`expr $i : '-l\(.*\)'`" | ||
2583 | # If $name is empty we are operating on a -L argument. | ||
2584 | if test -n "$name" && test "$name" != "0"; then | ||
2585 | $rm conftest | ||
2586 | $CC -o conftest conftest.c $i | ||
2587 | # Did it work? | ||
2588 | if test $? -eq 0 ; then | ||
2589 | ldd_output=`ldd conftest` | ||
2590 | libname=`eval \\$echo \"$libname_spec\"` | ||
2591 | deplib_matches=`eval \\$echo \"$library_names_spec\"` | ||
2592 | set dummy $deplib_matches | ||
2593 | deplib_match=$2 | ||
2594 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
2595 | newdeplibs="$newdeplibs $i" | ||
2596 | else | ||
2597 | droppeddeps=yes | ||
2598 | echo | ||
2599 | echo "*** Warning: dynamic linker does not accept needed library $i." | ||
2600 | echo "*** I have the capability to make that library automatically link in when" | ||
2601 | echo "*** you link to this library. But I can only do this if you have a" | ||
2602 | echo "*** shared version of the library, which you do not appear to have" | ||
2603 | echo "*** because a test_compile did reveal that the linker did not use this one" | ||
2604 | echo "*** as a dynamic dependency that programs can get resolved with at runtime." | ||
2605 | fi | ||
2606 | else | ||
2607 | droppeddeps=yes | ||
2608 | echo | ||
2609 | echo "*** Warning! Library $i is needed by this library but I was not able to" | ||
2610 | echo "*** make it link in! You will probably need to install it or some" | ||
2611 | echo "*** library that it depends on before this library will be fully" | ||
2612 | echo "*** functional. Installing it before continuing would be even better." | ||
2613 | fi | ||
2614 | else | ||
2615 | newdeplibs="$newdeplibs $i" | ||
2616 | fi | ||
2617 | done | ||
2618 | fi | ||
2619 | ;; | ||
2620 | file_magic*) | ||
2621 | set dummy $deplibs_check_method | ||
2622 | file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` | ||
2623 | for a_deplib in $deplibs; do | ||
2624 | name="`expr $a_deplib : '-l\(.*\)'`" | ||
2625 | # If $name is empty we are operating on a -L argument. | ||
2626 | if test -n "$name" && test "$name" != "0"; then | ||
2627 | libname=`eval \\$echo \"$libname_spec\"` | ||
2628 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
2629 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
2630 | for potent_lib in $potential_libs; do | ||
2631 | # Follow soft links. | ||
2632 | if ls -lLd "$potent_lib" 2>/dev/null \ | ||
2633 | | grep " -> " >/dev/null; then | ||
2634 | continue | ||
2635 | fi | ||
2636 | # The statement above tries to avoid entering an | ||
2637 | # endless loop below, in case of cyclic links. | ||
2638 | # We might still enter an endless loop, since a link | ||
2639 | # loop can be closed while we follow links, | ||
2640 | # but so what? | ||
2641 | potlib="$potent_lib" | ||
2642 | while test -h "$potlib" 2>/dev/null; do | ||
2643 | potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` | ||
2644 | case $potliblink in | ||
2645 | [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; | ||
2646 | *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; | ||
2647 | esac | ||
2648 | done | ||
2649 | if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ||
2650 | | ${SED} 10q \ | ||
2651 | | egrep "$file_magic_regex" > /dev/null; then | ||
2652 | newdeplibs="$newdeplibs $a_deplib" | ||
2653 | a_deplib="" | ||
2654 | break 2 | ||
2655 | fi | ||
2656 | done | ||
2657 | done | ||
2658 | if test -n "$a_deplib" ; then | ||
2659 | droppeddeps=yes | ||
2660 | echo | ||
2661 | echo "*** Warning: linker path does not have real file for library $a_deplib." | ||
2662 | echo "*** I have the capability to make that library automatically link in when" | ||
2663 | echo "*** you link to this library. But I can only do this if you have a" | ||
2664 | echo "*** shared version of the library, which you do not appear to have" | ||
2665 | echo "*** because I did check the linker path looking for a file starting" | ||
2666 | if test -z "$potlib" ; then | ||
2667 | echo "*** with $libname but no candidates were found. (...for file magic test)" | ||
2668 | else | ||
2669 | echo "*** with $libname and none of the candidates passed a file format test" | ||
2670 | echo "*** using a file magic. Last file checked: $potlib" | ||
2671 | fi | ||
2672 | fi | ||
2673 | else | ||
2674 | # Add a -L argument. | ||
2675 | newdeplibs="$newdeplibs $a_deplib" | ||
2676 | fi | ||
2677 | done # Gone through all deplibs. | ||
2678 | ;; | ||
2679 | match_pattern*) | ||
2680 | set dummy $deplibs_check_method | ||
2681 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` | ||
2682 | for a_deplib in $deplibs; do | ||
2683 | name="`expr $a_deplib : '-l\(.*\)'`" | ||
2684 | # If $name is empty we are operating on a -L argument. | ||
2685 | if test -n "$name" && test "$name" != "0"; then | ||
2686 | libname=`eval \\$echo \"$libname_spec\"` | ||
2687 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
2688 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
2689 | for potent_lib in $potential_libs; do | ||
2690 | potlib="$potent_lib" # see symlink-check below in file_magic test | ||
2691 | if eval echo \"$potent_lib\" 2>/dev/null \ | ||
2692 | | ${SED} 10q \ | ||
2693 | | egrep "$match_pattern_regex" > /dev/null; then | ||
2694 | newdeplibs="$newdeplibs $a_deplib" | ||
2695 | a_deplib="" | ||
2696 | break 2 | ||
2697 | fi | ||
2698 | done | ||
2699 | done | ||
2700 | if test -n "$a_deplib" ; then | ||
2701 | droppeddeps=yes | ||
2702 | echo | ||
2703 | echo "*** Warning: linker path does not have real file for library $a_deplib." | ||
2704 | echo "*** I have the capability to make that library automatically link in when" | ||
2705 | echo "*** you link to this library. But I can only do this if you have a" | ||
2706 | echo "*** shared version of the library, which you do not appear to have" | ||
2707 | echo "*** because I did check the linker path looking for a file starting" | ||
2708 | if test -z "$potlib" ; then | ||
2709 | echo "*** with $libname but no candidates were found. (...for regex pattern test)" | ||
2710 | else | ||
2711 | echo "*** with $libname and none of the candidates passed a file format test" | ||
2712 | echo "*** using a regex pattern. Last file checked: $potlib" | ||
2713 | fi | ||
2714 | fi | ||
2715 | else | ||
2716 | # Add a -L argument. | ||
2717 | newdeplibs="$newdeplibs $a_deplib" | ||
2718 | fi | ||
2719 | done # Gone through all deplibs. | ||
2720 | ;; | ||
2721 | none | unknown | *) | ||
2722 | newdeplibs="" | ||
2723 | if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ | ||
2724 | -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | | ||
2725 | grep . >/dev/null; then | ||
2726 | echo | ||
2727 | if test "X$deplibs_check_method" = "Xnone"; then | ||
2728 | echo "*** Warning: inter-library dependencies are not supported in this platform." | ||
2729 | else | ||
2730 | echo "*** Warning: inter-library dependencies are not known to be supported." | ||
2731 | fi | ||
2732 | echo "*** All declared inter-library dependencies are being dropped." | ||
2733 | droppeddeps=yes | ||
2734 | fi | ||
2735 | ;; | ||
2736 | esac | ||
2737 | versuffix=$versuffix_save | ||
2738 | major=$major_save | ||
2739 | release=$release_save | ||
2740 | libname=$libname_save | ||
2741 | name=$name_save | ||
2742 | |||
2743 | case $host in | ||
2744 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
2745 | # On Rhapsody replace the C library is the System framework | ||
2746 | newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
2747 | ;; | ||
2748 | esac | ||
2749 | |||
2750 | if test "$droppeddeps" = yes; then | ||
2751 | if test "$module" = yes; then | ||
2752 | echo | ||
2753 | echo "*** Warning: libtool could not satisfy all declared inter-library" | ||
2754 | echo "*** dependencies of module $libname. Therefore, libtool will create" | ||
2755 | echo "*** a static module, that should work as long as the dlopening" | ||
2756 | echo "*** application is linked with the -dlopen flag." | ||
2757 | if test -z "$global_symbol_pipe"; then | ||
2758 | echo | ||
2759 | echo "*** However, this would only work if libtool was able to extract symbol" | ||
2760 | echo "*** lists from a program, using \`nm' or equivalent, but libtool could" | ||
2761 | echo "*** not find such a program. So, this module is probably useless." | ||
2762 | echo "*** \`nm' from GNU binutils and a full rebuild may help." | ||
2763 | fi | ||
2764 | if test "$build_old_libs" = no; then | ||
2765 | oldlibs="$output_objdir/$libname.$libext" | ||
2766 | build_libtool_libs=module | ||
2767 | build_old_libs=yes | ||
2768 | else | ||
2769 | build_libtool_libs=no | ||
2770 | fi | ||
2771 | else | ||
2772 | echo "*** The inter-library dependencies that have been dropped here will be" | ||
2773 | echo "*** automatically added whenever a program is linked with this library" | ||
2774 | echo "*** or is declared to -dlopen it." | ||
2775 | |||
2776 | if test $allow_undefined = no; then | ||
2777 | echo | ||
2778 | echo "*** Since this library must not contain undefined symbols," | ||
2779 | echo "*** because either the platform does not support them or" | ||
2780 | echo "*** it was explicitly requested with -no-undefined," | ||
2781 | echo "*** libtool will only create a static version of it." | ||
2782 | if test "$build_old_libs" = no; then | ||
2783 | oldlibs="$output_objdir/$libname.$libext" | ||
2784 | build_libtool_libs=module | ||
2785 | build_old_libs=yes | ||
2786 | else | ||
2787 | build_libtool_libs=no | ||
2788 | fi | ||
2789 | fi | ||
2790 | fi | ||
2791 | fi | ||
2792 | # Done checking deplibs! | ||
2793 | deplibs=$newdeplibs | ||
2794 | fi | ||
2795 | |||
2796 | # All the library-specific variables (install_libdir is set above). | ||
2797 | library_names= | ||
2798 | old_library= | ||
2799 | dlname= | ||
2800 | |||
2801 | # Test again, we may have decided not to build it any more | ||
2802 | if test "$build_libtool_libs" = yes; then | ||
2803 | if test $hardcode_into_libs = yes; then | ||
2804 | # Hardcode the library paths | ||
2805 | hardcode_libdirs= | ||
2806 | dep_rpath= | ||
2807 | rpath="$finalize_rpath" | ||
2808 | test "$mode" != relink && rpath="$compile_rpath$rpath" | ||
2809 | for libdir in $rpath; do | ||
2810 | if test -n "$hardcode_libdir_flag_spec"; then | ||
2811 | if test -n "$hardcode_libdir_separator"; then | ||
2812 | if test -z "$hardcode_libdirs"; then | ||
2813 | hardcode_libdirs="$libdir" | ||
2814 | else | ||
2815 | # Just accumulate the unique libdirs. | ||
2816 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
2817 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
2818 | ;; | ||
2819 | *) | ||
2820 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
2821 | ;; | ||
2822 | esac | ||
2823 | fi | ||
2824 | else | ||
2825 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
2826 | dep_rpath="$dep_rpath $flag" | ||
2827 | fi | ||
2828 | elif test -n "$runpath_var"; then | ||
2829 | case "$perm_rpath " in | ||
2830 | *" $libdir "*) ;; | ||
2831 | *) perm_rpath="$perm_rpath $libdir" ;; | ||
2832 | esac | ||
2833 | fi | ||
2834 | done | ||
2835 | # Substitute the hardcoded libdirs into the rpath. | ||
2836 | if test -n "$hardcode_libdir_separator" && | ||
2837 | test -n "$hardcode_libdirs"; then | ||
2838 | libdir="$hardcode_libdirs" | ||
2839 | eval dep_rpath=\"$hardcode_libdir_flag_spec\" | ||
2840 | fi | ||
2841 | if test -n "$runpath_var" && test -n "$perm_rpath"; then | ||
2842 | # We should set the runpath_var. | ||
2843 | rpath= | ||
2844 | for dir in $perm_rpath; do | ||
2845 | rpath="$rpath$dir:" | ||
2846 | done | ||
2847 | eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" | ||
2848 | fi | ||
2849 | test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" | ||
2850 | fi | ||
2851 | |||
2852 | shlibpath="$finalize_shlibpath" | ||
2853 | test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" | ||
2854 | if test -n "$shlibpath"; then | ||
2855 | eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" | ||
2856 | fi | ||
2857 | |||
2858 | # Get the real and link names of the library. | ||
2859 | eval library_names=\"$library_names_spec\" | ||
2860 | set dummy $library_names | ||
2861 | realname="$2" | ||
2862 | shift; shift | ||
2863 | |||
2864 | if test -n "$soname_spec"; then | ||
2865 | eval soname=\"$soname_spec\" | ||
2866 | else | ||
2867 | soname="$realname" | ||
2868 | fi | ||
2869 | test -z "$dlname" && dlname=$soname | ||
2870 | |||
2871 | lib="$output_objdir/$realname" | ||
2872 | for link | ||
2873 | do | ||
2874 | linknames="$linknames $link" | ||
2875 | done | ||
2876 | |||
2877 | # Ensure that we have .o objects for linkers which dislike .lo | ||
2878 | # (e.g. aix) in case we are running --disable-static | ||
2879 | for obj in $libobjs; do | ||
2880 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` | ||
2881 | if test "X$xdir" = "X$obj"; then | ||
2882 | xdir="." | ||
2883 | else | ||
2884 | xdir="$xdir" | ||
2885 | fi | ||
2886 | baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` | ||
2887 | oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` | ||
2888 | if test ! -f $xdir/$oldobj; then | ||
2889 | $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" | ||
2890 | $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? | ||
2891 | fi | ||
2892 | done | ||
2893 | |||
2894 | # Use standard objects if they are pic | ||
2895 | test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
2896 | |||
2897 | # Prepare the list of exported symbols | ||
2898 | if test -z "$export_symbols"; then | ||
2899 | if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then | ||
2900 | $show "generating symbol list for \`$libname.la'" | ||
2901 | export_symbols="$output_objdir/$libname.exp" | ||
2902 | $run $rm $export_symbols | ||
2903 | eval cmds=\"$export_symbols_cmds\" | ||
2904 | save_ifs="$IFS"; IFS='~' | ||
2905 | for cmd in $cmds; do | ||
2906 | IFS="$save_ifs" | ||
2907 | $show "$cmd" | ||
2908 | $run eval "$cmd" || exit $? | ||
2909 | done | ||
2910 | IFS="$save_ifs" | ||
2911 | if test -n "$export_symbols_regex"; then | ||
2912 | $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" | ||
2913 | $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' | ||
2914 | $show "$mv \"${export_symbols}T\" \"$export_symbols\"" | ||
2915 | $run eval '$mv "${export_symbols}T" "$export_symbols"' | ||
2916 | fi | ||
2917 | fi | ||
2918 | fi | ||
2919 | |||
2920 | if test -n "$export_symbols" && test -n "$include_expsyms"; then | ||
2921 | $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' | ||
2922 | fi | ||
2923 | |||
2924 | if test -n "$convenience"; then | ||
2925 | if test -n "$whole_archive_flag_spec"; then | ||
2926 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" | ||
2927 | else | ||
2928 | gentop="$output_objdir/${outputname}x" | ||
2929 | $show "${rm}r $gentop" | ||
2930 | $run ${rm}r "$gentop" | ||
2931 | $show "mkdir $gentop" | ||
2932 | $run mkdir "$gentop" | ||
2933 | status=$? | ||
2934 | if test $status -ne 0 && test ! -d "$gentop"; then | ||
2935 | exit $status | ||
2936 | fi | ||
2937 | generated="$generated $gentop" | ||
2938 | |||
2939 | for xlib in $convenience; do | ||
2940 | # Extract the objects. | ||
2941 | case $xlib in | ||
2942 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; | ||
2943 | *) xabs=`pwd`"/$xlib" ;; | ||
2944 | esac | ||
2945 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | ||
2946 | xdir="$gentop/$xlib" | ||
2947 | |||
2948 | $show "${rm}r $xdir" | ||
2949 | $run ${rm}r "$xdir" | ||
2950 | $show "mkdir $xdir" | ||
2951 | $run mkdir "$xdir" | ||
2952 | status=$? | ||
2953 | if test $status -ne 0 && test ! -d "$xdir"; then | ||
2954 | exit $status | ||
2955 | fi | ||
2956 | $show "(cd $xdir && $AR x $xabs)" | ||
2957 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | ||
2958 | |||
2959 | libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` | ||
2960 | done | ||
2961 | fi | ||
2962 | fi | ||
2963 | |||
2964 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then | ||
2965 | eval flag=\"$thread_safe_flag_spec\" | ||
2966 | linker_flags="$linker_flags $flag" | ||
2967 | fi | ||
2968 | |||
2969 | # Make a backup of the uninstalled library when relinking | ||
2970 | if test "$mode" = relink; then | ||
2971 | $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? | ||
2972 | fi | ||
2973 | |||
2974 | # Do each of the archive commands. | ||
2975 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | ||
2976 | eval cmds=\"$archive_expsym_cmds\" | ||
2977 | else | ||
2978 | save_deplibs="$deplibs" | ||
2979 | for conv in $convenience; do | ||
2980 | tmp_deplibs= | ||
2981 | for test_deplib in $deplibs; do | ||
2982 | if test "$test_deplib" != "$conv"; then | ||
2983 | tmp_deplibs="$tmp_deplibs $test_deplib" | ||
2984 | fi | ||
2985 | done | ||
2986 | deplibs="$tmp_deplibs" | ||
2987 | done | ||
2988 | eval cmds=\"$archive_cmds\" | ||
2989 | deplibs="$save_deplibs" | ||
2990 | fi | ||
2991 | save_ifs="$IFS"; IFS='~' | ||
2992 | for cmd in $cmds; do | ||
2993 | IFS="$save_ifs" | ||
2994 | $show "$cmd" | ||
2995 | $run eval "$cmd" || exit $? | ||
2996 | done | ||
2997 | IFS="$save_ifs" | ||
2998 | |||
2999 | # Restore the uninstalled library and exit | ||
3000 | if test "$mode" = relink; then | ||
3001 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? | ||
3002 | exit 0 | ||
3003 | fi | ||
3004 | |||
3005 | # Create links to the real library. | ||
3006 | for linkname in $linknames; do | ||
3007 | if test "$realname" != "$linkname"; then | ||
3008 | $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" | ||
3009 | $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? | ||
3010 | fi | ||
3011 | done | ||
3012 | |||
3013 | # If -module or -export-dynamic was specified, set the dlname. | ||
3014 | if test "$module" = yes || test "$export_dynamic" = yes; then | ||
3015 | # On all known operating systems, these are identical. | ||
3016 | dlname="$soname" | ||
3017 | fi | ||
3018 | fi | ||
3019 | ;; | ||
3020 | |||
3021 | obj) | ||
3022 | if test -n "$deplibs"; then | ||
3023 | $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 | ||
3024 | fi | ||
3025 | |||
3026 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
3027 | $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 | ||
3028 | fi | ||
3029 | |||
3030 | if test -n "$rpath"; then | ||
3031 | $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 | ||
3032 | fi | ||
3033 | |||
3034 | if test -n "$xrpath"; then | ||
3035 | $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 | ||
3036 | fi | ||
3037 | |||
3038 | if test -n "$vinfo"; then | ||
3039 | $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 | ||
3040 | fi | ||
3041 | |||
3042 | if test -n "$release"; then | ||
3043 | $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 | ||
3044 | fi | ||
3045 | |||
3046 | case $output in | ||
3047 | *.lo) | ||
3048 | if test -n "$objs$old_deplibs"; then | ||
3049 | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 | ||
3050 | exit 1 | ||
3051 | fi | ||
3052 | libobj="$output" | ||
3053 | obj=`$echo "X$output" | $Xsed -e "$lo2o"` | ||
3054 | ;; | ||
3055 | *) | ||
3056 | libobj= | ||
3057 | obj="$output" | ||
3058 | ;; | ||
3059 | esac | ||
3060 | |||
3061 | # Delete the old objects. | ||
3062 | $run $rm $obj $libobj | ||
3063 | |||
3064 | # Objects from convenience libraries. This assumes | ||
3065 | # single-version convenience libraries. Whenever we create | ||
3066 | # different ones for PIC/non-PIC, this we'll have to duplicate | ||
3067 | # the extraction. | ||
3068 | reload_conv_objs= | ||
3069 | gentop= | ||
3070 | # reload_cmds runs $LD directly, so let us get rid of | ||
3071 | # -Wl from whole_archive_flag_spec | ||
3072 | wl= | ||
3073 | |||
3074 | if test -n "$convenience"; then | ||
3075 | if test -n "$whole_archive_flag_spec"; then | ||
3076 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" | ||
3077 | else | ||
3078 | gentop="$output_objdir/${obj}x" | ||
3079 | $show "${rm}r $gentop" | ||
3080 | $run ${rm}r "$gentop" | ||
3081 | $show "mkdir $gentop" | ||
3082 | $run mkdir "$gentop" | ||
3083 | status=$? | ||
3084 | if test $status -ne 0 && test ! -d "$gentop"; then | ||
3085 | exit $status | ||
3086 | fi | ||
3087 | generated="$generated $gentop" | ||
3088 | |||
3089 | for xlib in $convenience; do | ||
3090 | # Extract the objects. | ||
3091 | case $xlib in | ||
3092 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; | ||
3093 | *) xabs=`pwd`"/$xlib" ;; | ||
3094 | esac | ||
3095 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | ||
3096 | xdir="$gentop/$xlib" | ||
3097 | |||
3098 | $show "${rm}r $xdir" | ||
3099 | $run ${rm}r "$xdir" | ||
3100 | $show "mkdir $xdir" | ||
3101 | $run mkdir "$xdir" | ||
3102 | status=$? | ||
3103 | if test $status -ne 0 && test ! -d "$xdir"; then | ||
3104 | exit $status | ||
3105 | fi | ||
3106 | $show "(cd $xdir && $AR x $xabs)" | ||
3107 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | ||
3108 | |||
3109 | reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` | ||
3110 | done | ||
3111 | fi | ||
3112 | fi | ||
3113 | |||
3114 | # Create the old-style object. | ||
3115 | 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 | ||
3116 | |||
3117 | output="$obj" | ||
3118 | eval cmds=\"$reload_cmds\" | ||
3119 | save_ifs="$IFS"; IFS='~' | ||
3120 | for cmd in $cmds; do | ||
3121 | IFS="$save_ifs" | ||
3122 | $show "$cmd" | ||
3123 | $run eval "$cmd" || exit $? | ||
3124 | done | ||
3125 | IFS="$save_ifs" | ||
3126 | |||
3127 | # Exit if we aren't doing a library object file. | ||
3128 | if test -z "$libobj"; then | ||
3129 | if test -n "$gentop"; then | ||
3130 | $show "${rm}r $gentop" | ||
3131 | $run ${rm}r $gentop | ||
3132 | fi | ||
3133 | |||
3134 | exit 0 | ||
3135 | fi | ||
3136 | |||
3137 | if test "$build_libtool_libs" != yes; then | ||
3138 | if test -n "$gentop"; then | ||
3139 | $show "${rm}r $gentop" | ||
3140 | $run ${rm}r $gentop | ||
3141 | fi | ||
3142 | |||
3143 | # Create an invalid libtool object if no PIC, so that we don't | ||
3144 | # accidentally link it into a program. | ||
3145 | $show "echo timestamp > $libobj" | ||
3146 | $run eval "echo timestamp > $libobj" || exit $? | ||
3147 | exit 0 | ||
3148 | fi | ||
3149 | |||
3150 | if test -n "$pic_flag" || test "$pic_mode" != default; then | ||
3151 | # Only do commands if we really have different PIC objects. | ||
3152 | reload_objs="$libobjs $reload_conv_objs" | ||
3153 | output="$libobj" | ||
3154 | eval cmds=\"$reload_cmds\" | ||
3155 | save_ifs="$IFS"; IFS='~' | ||
3156 | for cmd in $cmds; do | ||
3157 | IFS="$save_ifs" | ||
3158 | $show "$cmd" | ||
3159 | $run eval "$cmd" || exit $? | ||
3160 | done | ||
3161 | IFS="$save_ifs" | ||
3162 | else | ||
3163 | # Just create a symlink. | ||
3164 | $show $rm $libobj | ||
3165 | $run $rm $libobj | ||
3166 | xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` | ||
3167 | if test "X$xdir" = "X$libobj"; then | ||
3168 | xdir="." | ||
3169 | else | ||
3170 | xdir="$xdir" | ||
3171 | fi | ||
3172 | baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` | ||
3173 | oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` | ||
3174 | $show "(cd $xdir && $LN_S $oldobj $baseobj)" | ||
3175 | $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? | ||
3176 | fi | ||
3177 | |||
3178 | if test -n "$gentop"; then | ||
3179 | $show "${rm}r $gentop" | ||
3180 | $run ${rm}r $gentop | ||
3181 | fi | ||
3182 | |||
3183 | exit 0 | ||
3184 | ;; | ||
3185 | |||
3186 | prog) | ||
3187 | case $host in | ||
3188 | *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; | ||
3189 | esac | ||
3190 | if test -n "$vinfo"; then | ||
3191 | $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 | ||
3192 | fi | ||
3193 | |||
3194 | if test -n "$release"; then | ||
3195 | $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 | ||
3196 | fi | ||
3197 | |||
3198 | if test "$preload" = yes; then | ||
3199 | if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && | ||
3200 | test "$dlopen_self_static" = unknown; then | ||
3201 | $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." | ||
3202 | fi | ||
3203 | fi | ||
3204 | |||
3205 | case $host in | ||
3206 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
3207 | # On Rhapsody replace the C library is the System framework | ||
3208 | compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
3209 | finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
3210 | case $host in | ||
3211 | *darwin*) | ||
3212 | # Don't allow lazy linking, it breaks C++ global constructors | ||
3213 | compile_command="$compile_command ${wl}-bind_at_load" | ||
3214 | finalize_command="$finalize_command ${wl}-bind_at_load" | ||
3215 | ;; | ||
3216 | esac | ||
3217 | ;; | ||
3218 | esac | ||
3219 | |||
3220 | compile_command="$compile_command $compile_deplibs" | ||
3221 | finalize_command="$finalize_command $finalize_deplibs" | ||
3222 | |||
3223 | if test -n "$rpath$xrpath"; then | ||
3224 | # If the user specified any rpath flags, then add them. | ||
3225 | for libdir in $rpath $xrpath; do | ||
3226 | # This is the magic to use -rpath. | ||
3227 | case "$finalize_rpath " in | ||
3228 | *" $libdir "*) ;; | ||
3229 | *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
3230 | esac | ||
3231 | done | ||
3232 | fi | ||
3233 | |||
3234 | # Now hardcode the library paths | ||
3235 | rpath= | ||
3236 | hardcode_libdirs= | ||
3237 | for libdir in $compile_rpath $finalize_rpath; do | ||
3238 | if test -n "$hardcode_libdir_flag_spec"; then | ||
3239 | if test -n "$hardcode_libdir_separator"; then | ||
3240 | if test -z "$hardcode_libdirs"; then | ||
3241 | hardcode_libdirs="$libdir" | ||
3242 | else | ||
3243 | # Just accumulate the unique libdirs. | ||
3244 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
3245 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
3246 | ;; | ||
3247 | *) | ||
3248 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
3249 | ;; | ||
3250 | esac | ||
3251 | fi | ||
3252 | else | ||
3253 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
3254 | rpath="$rpath $flag" | ||
3255 | fi | ||
3256 | elif test -n "$runpath_var"; then | ||
3257 | case "$perm_rpath " in | ||
3258 | *" $libdir "*) ;; | ||
3259 | *) perm_rpath="$perm_rpath $libdir" ;; | ||
3260 | esac | ||
3261 | fi | ||
3262 | case $host in | ||
3263 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
3264 | case :$dllsearchpath: in | ||
3265 | *":$libdir:"*) ;; | ||
3266 | *) dllsearchpath="$dllsearchpath:$libdir";; | ||
3267 | esac | ||
3268 | ;; | ||
3269 | esac | ||
3270 | done | ||
3271 | # Substitute the hardcoded libdirs into the rpath. | ||
3272 | if test -n "$hardcode_libdir_separator" && | ||
3273 | test -n "$hardcode_libdirs"; then | ||
3274 | libdir="$hardcode_libdirs" | ||
3275 | eval rpath=\" $hardcode_libdir_flag_spec\" | ||
3276 | fi | ||
3277 | compile_rpath="$rpath" | ||
3278 | |||
3279 | rpath= | ||
3280 | hardcode_libdirs= | ||
3281 | for libdir in $finalize_rpath; do | ||
3282 | if test -n "$hardcode_libdir_flag_spec"; then | ||
3283 | if test -n "$hardcode_libdir_separator"; then | ||
3284 | if test -z "$hardcode_libdirs"; then | ||
3285 | hardcode_libdirs="$libdir" | ||
3286 | else | ||
3287 | # Just accumulate the unique libdirs. | ||
3288 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
3289 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
3290 | ;; | ||
3291 | *) | ||
3292 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
3293 | ;; | ||
3294 | esac | ||
3295 | fi | ||
3296 | else | ||
3297 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
3298 | rpath="$rpath $flag" | ||
3299 | fi | ||
3300 | elif test -n "$runpath_var"; then | ||
3301 | case "$finalize_perm_rpath " in | ||
3302 | *" $libdir "*) ;; | ||
3303 | *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; | ||
3304 | esac | ||
3305 | fi | ||
3306 | done | ||
3307 | # Substitute the hardcoded libdirs into the rpath. | ||
3308 | if test -n "$hardcode_libdir_separator" && | ||
3309 | test -n "$hardcode_libdirs"; then | ||
3310 | libdir="$hardcode_libdirs" | ||
3311 | eval rpath=\" $hardcode_libdir_flag_spec\" | ||
3312 | fi | ||
3313 | finalize_rpath="$rpath" | ||
3314 | |||
3315 | if test -n "$libobjs" && test "$build_old_libs" = yes; then | ||
3316 | # Transform all the library objects into standard objects. | ||
3317 | compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
3318 | finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
3319 | fi | ||
3320 | |||
3321 | dlsyms= | ||
3322 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
3323 | if test -n "$NM" && test -n "$global_symbol_pipe"; then | ||
3324 | dlsyms="${outputname}S.c" | ||
3325 | else | ||
3326 | $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 | ||
3327 | fi | ||
3328 | fi | ||
3329 | |||
3330 | if test -n "$dlsyms"; then | ||
3331 | case $dlsyms in | ||
3332 | "") ;; | ||
3333 | *.c) | ||
3334 | # Discover the nlist of each of the dlfiles. | ||
3335 | nlist="$output_objdir/${outputname}.nm" | ||
3336 | |||
3337 | $show "$rm $nlist ${nlist}S ${nlist}T" | ||
3338 | $run $rm "$nlist" "${nlist}S" "${nlist}T" | ||
3339 | |||
3340 | # Parse the name list into a source file. | ||
3341 | $show "creating $output_objdir/$dlsyms" | ||
3342 | |||
3343 | test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ | ||
3344 | /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ | ||
3345 | /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ | ||
3346 | |||
3347 | #ifdef __cplusplus | ||
3348 | extern \"C\" { | ||
3349 | #endif | ||
3350 | |||
3351 | /* Prevent the only kind of declaration conflicts we can make. */ | ||
3352 | #define lt_preloaded_symbols some_other_symbol | ||
3353 | |||
3354 | /* External symbol declarations for the compiler. */\ | ||
3355 | " | ||
3356 | |||
3357 | if test "$dlself" = yes; then | ||
3358 | $show "generating symbol list for \`$output'" | ||
3359 | |||
3360 | test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" | ||
3361 | |||
3362 | # Add our own program objects to the symbol list. | ||
3363 | progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
3364 | for arg in $progfiles; do | ||
3365 | $show "extracting global C symbols from \`$arg'" | ||
3366 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" | ||
3367 | done | ||
3368 | |||
3369 | if test -n "$exclude_expsyms"; then | ||
3370 | $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' | ||
3371 | $run eval '$mv "$nlist"T "$nlist"' | ||
3372 | fi | ||
3373 | |||
3374 | if test -n "$export_symbols_regex"; then | ||
3375 | $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' | ||
3376 | $run eval '$mv "$nlist"T "$nlist"' | ||
3377 | fi | ||
3378 | |||
3379 | # Prepare the list of exported symbols | ||
3380 | if test -z "$export_symbols"; then | ||
3381 | export_symbols="$output_objdir/$output.exp" | ||
3382 | $run $rm $export_symbols | ||
3383 | $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' | ||
3384 | else | ||
3385 | $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' | ||
3386 | $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' | ||
3387 | $run eval 'mv "$nlist"T "$nlist"' | ||
3388 | fi | ||
3389 | fi | ||
3390 | |||
3391 | for arg in $dlprefiles; do | ||
3392 | $show "extracting global C symbols from \`$arg'" | ||
3393 | name=`echo "$arg" | ${SED} -e 's%^.*/%%'` | ||
3394 | $run eval 'echo ": $name " >> "$nlist"' | ||
3395 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" | ||
3396 | done | ||
3397 | |||
3398 | if test -z "$run"; then | ||
3399 | # Make sure we have at least an empty file. | ||
3400 | test -f "$nlist" || : > "$nlist" | ||
3401 | |||
3402 | if test -n "$exclude_expsyms"; then | ||
3403 | egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T | ||
3404 | $mv "$nlist"T "$nlist" | ||
3405 | fi | ||
3406 | |||
3407 | # Try sorting and uniquifying the output. | ||
3408 | if grep -v "^: " < "$nlist" | | ||
3409 | if sort -k 3 </dev/null >/dev/null 2>&1; then | ||
3410 | sort -k 3 | ||
3411 | else | ||
3412 | sort +2 | ||
3413 | fi | | ||
3414 | uniq > "$nlist"S; then | ||
3415 | : | ||
3416 | else | ||
3417 | grep -v "^: " < "$nlist" > "$nlist"S | ||
3418 | fi | ||
3419 | |||
3420 | if test -f "$nlist"S; then | ||
3421 | eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' | ||
3422 | else | ||
3423 | echo '/* NONE */' >> "$output_objdir/$dlsyms" | ||
3424 | fi | ||
3425 | |||
3426 | $echo >> "$output_objdir/$dlsyms" "\ | ||
3427 | |||
3428 | #undef lt_preloaded_symbols | ||
3429 | |||
3430 | #if defined (__STDC__) && __STDC__ | ||
3431 | # define lt_ptr void * | ||
3432 | #else | ||
3433 | # define lt_ptr char * | ||
3434 | # define const | ||
3435 | #endif | ||
3436 | |||
3437 | /* The mapping between symbol names and symbols. */ | ||
3438 | const struct { | ||
3439 | const char *name; | ||
3440 | lt_ptr address; | ||
3441 | } | ||
3442 | lt_preloaded_symbols[] = | ||
3443 | {\ | ||
3444 | " | ||
3445 | |||
3446 | eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" | ||
3447 | |||
3448 | $echo >> "$output_objdir/$dlsyms" "\ | ||
3449 | {0, (lt_ptr) 0} | ||
3450 | }; | ||
3451 | |||
3452 | /* This works around a problem in FreeBSD linker */ | ||
3453 | #ifdef FREEBSD_WORKAROUND | ||
3454 | static const void *lt_preloaded_setup() { | ||
3455 | return lt_preloaded_symbols; | ||
3456 | } | ||
3457 | #endif | ||
3458 | |||
3459 | #ifdef __cplusplus | ||
3460 | } | ||
3461 | #endif\ | ||
3462 | " | ||
3463 | fi | ||
3464 | |||
3465 | pic_flag_for_symtable= | ||
3466 | case $host in | ||
3467 | # compiling the symbol table file with pic_flag works around | ||
3468 | # a FreeBSD bug that causes programs to crash when -lm is | ||
3469 | # linked before any other PIC object. But we must not use | ||
3470 | # pic_flag when linking with -static. The problem exists in | ||
3471 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. | ||
3472 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) | ||
3473 | case "$compile_command " in | ||
3474 | *" -static "*) ;; | ||
3475 | *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; | ||
3476 | esac;; | ||
3477 | *-*-hpux*) | ||
3478 | case "$compile_command " in | ||
3479 | *" -static "*) ;; | ||
3480 | *) pic_flag_for_symtable=" $pic_flag -DPIC";; | ||
3481 | esac | ||
3482 | esac | ||
3483 | |||
3484 | # Now compile the dynamic symbol file. | ||
3485 | $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" | ||
3486 | $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? | ||
3487 | |||
3488 | # Clean up the generated files. | ||
3489 | $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" | ||
3490 | $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" | ||
3491 | |||
3492 | # Transform the symbol file into the correct name. | ||
3493 | compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
3494 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
3495 | ;; | ||
3496 | *) | ||
3497 | $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 | ||
3498 | exit 1 | ||
3499 | ;; | ||
3500 | esac | ||
3501 | else | ||
3502 | # We keep going just in case the user didn't refer to | ||
3503 | # lt_preloaded_symbols. The linker will fail if global_symbol_pipe | ||
3504 | # really was required. | ||
3505 | |||
3506 | # Nullify the symbol file. | ||
3507 | compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` | ||
3508 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` | ||
3509 | fi | ||
3510 | |||
3511 | if test $need_relink = no || test "$build_libtool_libs" != yes; then | ||
3512 | # Replace the output file specification. | ||
3513 | compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` | ||
3514 | link_command="$compile_command$compile_rpath" | ||
3515 | |||
3516 | # We have no uninstalled library dependencies, so finalize right now. | ||
3517 | $show "$link_command" | ||
3518 | $run eval "$link_command" | ||
3519 | status=$? | ||
3520 | |||
3521 | # Delete the generated files. | ||
3522 | if test -n "$dlsyms"; then | ||
3523 | $show "$rm $output_objdir/${outputname}S.${objext}" | ||
3524 | $run $rm "$output_objdir/${outputname}S.${objext}" | ||
3525 | fi | ||
3526 | |||
3527 | exit $status | ||
3528 | fi | ||
3529 | |||
3530 | if test -n "$shlibpath_var"; then | ||
3531 | # We should set the shlibpath_var | ||
3532 | rpath= | ||
3533 | for dir in $temp_rpath; do | ||
3534 | case $dir in | ||
3535 | [\\/]* | [A-Za-z]:[\\/]*) | ||
3536 | # Absolute path. | ||
3537 | rpath="$rpath$dir:" | ||
3538 | ;; | ||
3539 | *) | ||
3540 | # Relative path: add a thisdir entry. | ||
3541 | rpath="$rpath\$thisdir/$dir:" | ||
3542 | ;; | ||
3543 | esac | ||
3544 | done | ||
3545 | temp_rpath="$rpath" | ||
3546 | fi | ||
3547 | |||
3548 | if test -n "$compile_shlibpath$finalize_shlibpath"; then | ||
3549 | compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" | ||
3550 | fi | ||
3551 | if test -n "$finalize_shlibpath"; then | ||
3552 | finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" | ||
3553 | fi | ||
3554 | |||
3555 | compile_var= | ||
3556 | finalize_var= | ||
3557 | if test -n "$runpath_var"; then | ||
3558 | if test -n "$perm_rpath"; then | ||
3559 | # We should set the runpath_var. | ||
3560 | rpath= | ||
3561 | for dir in $perm_rpath; do | ||
3562 | rpath="$rpath$dir:" | ||
3563 | done | ||
3564 | compile_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
3565 | fi | ||
3566 | if test -n "$finalize_perm_rpath"; then | ||
3567 | # We should set the runpath_var. | ||
3568 | rpath= | ||
3569 | for dir in $finalize_perm_rpath; do | ||
3570 | rpath="$rpath$dir:" | ||
3571 | done | ||
3572 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
3573 | fi | ||
3574 | fi | ||
3575 | |||
3576 | if test "$no_install" = yes; then | ||
3577 | # We don't need to create a wrapper script. | ||
3578 | link_command="$compile_var$compile_command$compile_rpath" | ||
3579 | # Replace the output file specification. | ||
3580 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` | ||
3581 | # Delete the old output file. | ||
3582 | $run $rm $output | ||
3583 | # Link the executable and exit | ||
3584 | $show "$link_command" | ||
3585 | $run eval "$link_command" || exit $? | ||
3586 | exit 0 | ||
3587 | fi | ||
3588 | |||
3589 | if test "$hardcode_action" = relink; then | ||
3590 | # Fast installation is not supported | ||
3591 | link_command="$compile_var$compile_command$compile_rpath" | ||
3592 | relink_command="$finalize_var$finalize_command$finalize_rpath" | ||
3593 | |||
3594 | $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 | ||
3595 | $echo "$modename: \`$output' will be relinked during installation" 1>&2 | ||
3596 | else | ||
3597 | if test "$fast_install" != no; then | ||
3598 | link_command="$finalize_var$compile_command$finalize_rpath" | ||
3599 | if test "$fast_install" = yes; then | ||
3600 | relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` | ||
3601 | else | ||
3602 | # fast_install is set to needless | ||
3603 | relink_command= | ||
3604 | fi | ||
3605 | else | ||
3606 | link_command="$compile_var$compile_command$compile_rpath" | ||
3607 | relink_command="$finalize_var$finalize_command$finalize_rpath" | ||
3608 | fi | ||
3609 | fi | ||
3610 | |||
3611 | # Replace the output file specification. | ||
3612 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` | ||
3613 | |||
3614 | # Delete the old output files. | ||
3615 | $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname | ||
3616 | |||
3617 | $show "$link_command" | ||
3618 | $run eval "$link_command" || exit $? | ||
3619 | |||
3620 | # Now create the wrapper script. | ||
3621 | $show "creating $output" | ||
3622 | |||
3623 | # Quote the relink command for shipping. | ||
3624 | if test -n "$relink_command"; then | ||
3625 | # Preserve any variables that may affect compiler behavior | ||
3626 | for var in $variables_saved_for_relink; do | ||
3627 | if eval test -z \"\${$var+set}\"; then | ||
3628 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" | ||
3629 | elif eval var_value=\$$var; test -z "$var_value"; then | ||
3630 | relink_command="$var=; export $var; $relink_command" | ||
3631 | else | ||
3632 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` | ||
3633 | relink_command="$var=\"$var_value\"; export $var; $relink_command" | ||
3634 | fi | ||
3635 | done | ||
3636 | relink_command="(cd `pwd`; $relink_command)" | ||
3637 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | ||
3638 | fi | ||
3639 | |||
3640 | # Quote $echo for shipping. | ||
3641 | if test "X$echo" = "X$SHELL $0 --fallback-echo"; then | ||
3642 | case $0 in | ||
3643 | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; | ||
3644 | *) qecho="$SHELL `pwd`/$0 --fallback-echo";; | ||
3645 | esac | ||
3646 | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` | ||
3647 | else | ||
3648 | qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` | ||
3649 | fi | ||
3650 | |||
3651 | # Only actually do things if our run command is non-null. | ||
3652 | if test -z "$run"; then | ||
3653 | # win32 will think the script is a binary if it has | ||
3654 | # a .exe suffix, so we strip it off here. | ||
3655 | case $output in | ||
3656 | *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; | ||
3657 | esac | ||
3658 | # test for cygwin because mv fails w/o .exe extensions | ||
3659 | case $host in | ||
3660 | *cygwin*) exeext=.exe ;; | ||
3661 | *) exeext= ;; | ||
3662 | esac | ||
3663 | $rm $output | ||
3664 | trap "$rm $output; exit 1" 1 2 15 | ||
3665 | |||
3666 | $echo > $output "\ | ||
3667 | #! $SHELL | ||
3668 | |||
3669 | # $output - temporary wrapper script for $objdir/$outputname | ||
3670 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
3671 | # | ||
3672 | # The $output program cannot be directly executed until all the libtool | ||
3673 | # libraries that it depends on are installed. | ||
3674 | # | ||
3675 | # This wrapper script should never be moved out of the build directory. | ||
3676 | # If it is, it will not operate correctly. | ||
3677 | |||
3678 | # Sed substitution that helps us do robust quoting. It backslashifies | ||
3679 | # metacharacters that are still active within double-quoted strings. | ||
3680 | Xsed="${SED}"' -e 1s/^X//' | ||
3681 | sed_quote_subst='$sed_quote_subst' | ||
3682 | |||
3683 | # The HP-UX ksh and POSIX shell print the target directory to stdout | ||
3684 | # if CDPATH is set. | ||
3685 | if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi | ||
3686 | |||
3687 | relink_command=\"$relink_command\" | ||
3688 | |||
3689 | # This environment variable determines our operation mode. | ||
3690 | if test \"\$libtool_install_magic\" = \"$magic\"; then | ||
3691 | # install mode needs the following variable: | ||
3692 | notinst_deplibs='$notinst_deplibs' | ||
3693 | else | ||
3694 | # When we are sourced in execute mode, \$file and \$echo are already set. | ||
3695 | if test \"\$libtool_execute_magic\" != \"$magic\"; then | ||
3696 | echo=\"$qecho\" | ||
3697 | file=\"\$0\" | ||
3698 | # Make sure echo works. | ||
3699 | if test \"X\$1\" = X--no-reexec; then | ||
3700 | # Discard the --no-reexec flag, and continue. | ||
3701 | shift | ||
3702 | elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then | ||
3703 | # Yippee, \$echo works! | ||
3704 | : | ||
3705 | else | ||
3706 | # Restart under the correct shell, and then maybe \$echo will work. | ||
3707 | exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} | ||
3708 | fi | ||
3709 | fi\ | ||
3710 | " | ||
3711 | $echo >> $output "\ | ||
3712 | |||
3713 | # Find the directory that this script lives in. | ||
3714 | thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` | ||
3715 | test \"x\$thisdir\" = \"x\$file\" && thisdir=. | ||
3716 | |||
3717 | # Follow symbolic links until we get to the real thisdir. | ||
3718 | file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` | ||
3719 | while test -n \"\$file\"; do | ||
3720 | destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` | ||
3721 | |||
3722 | # If there was a directory component, then change thisdir. | ||
3723 | if test \"x\$destdir\" != \"x\$file\"; then | ||
3724 | case \"\$destdir\" in | ||
3725 | [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; | ||
3726 | *) thisdir=\"\$thisdir/\$destdir\" ;; | ||
3727 | esac | ||
3728 | fi | ||
3729 | |||
3730 | file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` | ||
3731 | file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` | ||
3732 | done | ||
3733 | |||
3734 | # Try to get the absolute directory name. | ||
3735 | absdir=\`cd \"\$thisdir\" && pwd\` | ||
3736 | test -n \"\$absdir\" && thisdir=\"\$absdir\" | ||
3737 | " | ||
3738 | |||
3739 | if test "$fast_install" = yes; then | ||
3740 | echo >> $output "\ | ||
3741 | program=lt-'$outputname'$exeext | ||
3742 | progdir=\"\$thisdir/$objdir\" | ||
3743 | |||
3744 | if test ! -f \"\$progdir/\$program\" || \\ | ||
3745 | { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ | ||
3746 | test \"X\$file\" != \"X\$progdir/\$program\"; }; then | ||
3747 | |||
3748 | file=\"\$\$-\$program\" | ||
3749 | |||
3750 | if test ! -d \"\$progdir\"; then | ||
3751 | $mkdir \"\$progdir\" | ||
3752 | else | ||
3753 | $rm \"\$progdir/\$file\" | ||
3754 | fi" | ||
3755 | |||
3756 | echo >> $output "\ | ||
3757 | |||
3758 | # relink executable if necessary | ||
3759 | if test -n \"\$relink_command\"; then | ||
3760 | if relink_command_output=\`eval \$relink_command 2>&1\`; then : | ||
3761 | else | ||
3762 | $echo \"\$relink_command_output\" >&2 | ||
3763 | $rm \"\$progdir/\$file\" | ||
3764 | exit 1 | ||
3765 | fi | ||
3766 | fi | ||
3767 | |||
3768 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || | ||
3769 | { $rm \"\$progdir/\$program\"; | ||
3770 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } | ||
3771 | $rm \"\$progdir/\$file\" | ||
3772 | fi" | ||
3773 | else | ||
3774 | echo >> $output "\ | ||
3775 | program='$outputname' | ||
3776 | progdir=\"\$thisdir/$objdir\" | ||
3777 | " | ||
3778 | fi | ||
3779 | |||
3780 | echo >> $output "\ | ||
3781 | |||
3782 | if test -f \"\$progdir/\$program\"; then" | ||
3783 | |||
3784 | # Export our shlibpath_var if we have one. | ||
3785 | if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then | ||
3786 | $echo >> $output "\ | ||
3787 | # Add our own library path to $shlibpath_var | ||
3788 | $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" | ||
3789 | |||
3790 | # Some systems cannot cope with colon-terminated $shlibpath_var | ||
3791 | # The second colon is a workaround for a bug in BeOS R4 ${SED} | ||
3792 | $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` | ||
3793 | |||
3794 | export $shlibpath_var | ||
3795 | " | ||
3796 | fi | ||
3797 | |||
3798 | # fixup the dll searchpath if we need to. | ||
3799 | if test -n "$dllsearchpath"; then | ||
3800 | $echo >> $output "\ | ||
3801 | # Add the dll search path components to the executable PATH | ||
3802 | PATH=$dllsearchpath:\$PATH | ||
3803 | " | ||
3804 | fi | ||
3805 | |||
3806 | $echo >> $output "\ | ||
3807 | if test \"\$libtool_execute_magic\" != \"$magic\"; then | ||
3808 | # Run the actual program with our arguments. | ||
3809 | " | ||
3810 | case $host in | ||
3811 | # win32 systems need to use the prog path for dll | ||
3812 | # lookup to work | ||
3813 | *-*-cygwin* | *-*-pw32*) | ||
3814 | $echo >> $output "\ | ||
3815 | exec \$progdir/\$program \${1+\"\$@\"} | ||
3816 | " | ||
3817 | ;; | ||
3818 | |||
3819 | # Backslashes separate directories on plain windows | ||
3820 | *-*-mingw | *-*-os2*) | ||
3821 | $echo >> $output "\ | ||
3822 | exec \$progdir\\\\\$program \${1+\"\$@\"} | ||
3823 | " | ||
3824 | ;; | ||
3825 | |||
3826 | *) | ||
3827 | $echo >> $output "\ | ||
3828 | # Export the path to the program. | ||
3829 | PATH=\"\$progdir:\$PATH\" | ||
3830 | export PATH | ||
3831 | |||
3832 | exec \$program \${1+\"\$@\"} | ||
3833 | " | ||
3834 | ;; | ||
3835 | esac | ||
3836 | $echo >> $output "\ | ||
3837 | \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" | ||
3838 | exit 1 | ||
3839 | fi | ||
3840 | else | ||
3841 | # The program doesn't exist. | ||
3842 | \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 | ||
3843 | \$echo \"This script is just a wrapper for \$program.\" 1>&2 | ||
3844 | echo \"See the $PACKAGE documentation for more information.\" 1>&2 | ||
3845 | exit 1 | ||
3846 | fi | ||
3847 | fi\ | ||
3848 | " | ||
3849 | chmod +x $output | ||
3850 | fi | ||
3851 | exit 0 | ||
3852 | ;; | ||
3853 | esac | ||
3854 | |||
3855 | # See if we need to build an old-fashioned archive. | ||
3856 | for oldlib in $oldlibs; do | ||
3857 | |||
3858 | if test "$build_libtool_libs" = convenience; then | ||
3859 | oldobjs="$libobjs_save" | ||
3860 | addlibs="$convenience" | ||
3861 | build_libtool_libs=no | ||
3862 | else | ||
3863 | if test "$build_libtool_libs" = module; then | ||
3864 | oldobjs="$libobjs_save" | ||
3865 | build_libtool_libs=no | ||
3866 | else | ||
3867 | oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` | ||
3868 | fi | ||
3869 | addlibs="$old_convenience" | ||
3870 | fi | ||
3871 | |||
3872 | if test -n "$addlibs"; then | ||
3873 | gentop="$output_objdir/${outputname}x" | ||
3874 | $show "${rm}r $gentop" | ||
3875 | $run ${rm}r "$gentop" | ||
3876 | $show "mkdir $gentop" | ||
3877 | $run mkdir "$gentop" | ||
3878 | status=$? | ||
3879 | if test $status -ne 0 && test ! -d "$gentop"; then | ||
3880 | exit $status | ||
3881 | fi | ||
3882 | generated="$generated $gentop" | ||
3883 | |||
3884 | # Add in members from convenience archives. | ||
3885 | for xlib in $addlibs; do | ||
3886 | # Extract the objects. | ||
3887 | case $xlib in | ||
3888 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; | ||
3889 | *) xabs=`pwd`"/$xlib" ;; | ||
3890 | esac | ||
3891 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | ||
3892 | xdir="$gentop/$xlib" | ||
3893 | |||
3894 | $show "${rm}r $xdir" | ||
3895 | $run ${rm}r "$xdir" | ||
3896 | $show "mkdir $xdir" | ||
3897 | $run mkdir "$xdir" | ||
3898 | status=$? | ||
3899 | if test $status -ne 0 && test ! -d "$xdir"; then | ||
3900 | exit $status | ||
3901 | fi | ||
3902 | $show "(cd $xdir && $AR x $xabs)" | ||
3903 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | ||
3904 | |||
3905 | oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` | ||
3906 | done | ||
3907 | fi | ||
3908 | |||
3909 | # Do each command in the archive commands. | ||
3910 | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then | ||
3911 | eval cmds=\"$old_archive_from_new_cmds\" | ||
3912 | else | ||
3913 | # Ensure that we have .o objects in place in case we decided | ||
3914 | # not to build a shared library, and have fallen back to building | ||
3915 | # static libs even though --disable-static was passed! | ||
3916 | for oldobj in $oldobjs; do | ||
3917 | if test ! -f $oldobj; then | ||
3918 | xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` | ||
3919 | if test "X$xdir" = "X$oldobj"; then | ||
3920 | xdir="." | ||
3921 | else | ||
3922 | xdir="$xdir" | ||
3923 | fi | ||
3924 | baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` | ||
3925 | obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` | ||
3926 | $show "(cd $xdir && ${LN_S} $obj $baseobj)" | ||
3927 | $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? | ||
3928 | fi | ||
3929 | done | ||
3930 | |||
3931 | eval cmds=\"$old_archive_cmds\" | ||
3932 | fi | ||
3933 | save_ifs="$IFS"; IFS='~' | ||
3934 | for cmd in $cmds; do | ||
3935 | IFS="$save_ifs" | ||
3936 | $show "$cmd" | ||
3937 | $run eval "$cmd" || exit $? | ||
3938 | done | ||
3939 | IFS="$save_ifs" | ||
3940 | done | ||
3941 | |||
3942 | if test -n "$generated"; then | ||
3943 | $show "${rm}r$generated" | ||
3944 | $run ${rm}r$generated | ||
3945 | fi | ||
3946 | |||
3947 | # Now create the libtool archive. | ||
3948 | case $output in | ||
3949 | *.la) | ||
3950 | old_library= | ||
3951 | test "$build_old_libs" = yes && old_library="$libname.$libext" | ||
3952 | $show "creating $output" | ||
3953 | |||
3954 | # Preserve any variables that may affect compiler behavior | ||
3955 | for var in $variables_saved_for_relink; do | ||
3956 | if eval test -z \"\${$var+set}\"; then | ||
3957 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" | ||
3958 | elif eval var_value=\$$var; test -z "$var_value"; then | ||
3959 | relink_command="$var=; export $var; $relink_command" | ||
3960 | else | ||
3961 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` | ||
3962 | relink_command="$var=\"$var_value\"; export $var; $relink_command" | ||
3963 | fi | ||
3964 | done | ||
3965 | # Quote the link command for shipping. | ||
3966 | relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" | ||
3967 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | ||
3968 | |||
3969 | # Only create the output if not a dry run. | ||
3970 | if test -z "$run"; then | ||
3971 | for installed in no yes; do | ||
3972 | if test "$installed" = yes; then | ||
3973 | if test -z "$install_libdir"; then | ||
3974 | break | ||
3975 | fi | ||
3976 | output="$output_objdir/$outputname"i | ||
3977 | # Replace all uninstalled libtool libraries with the installed ones | ||
3978 | newdependency_libs= | ||
3979 | for deplib in $dependency_libs; do | ||
3980 | case $deplib in | ||
3981 | *.la) | ||
3982 | name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` | ||
3983 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
3984 | if test -z "$libdir"; then | ||
3985 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | ||
3986 | exit 1 | ||
3987 | fi | ||
3988 | newdependency_libs="$newdependency_libs $libdir/$name" | ||
3989 | ;; | ||
3990 | *) newdependency_libs="$newdependency_libs $deplib" ;; | ||
3991 | esac | ||
3992 | done | ||
3993 | dependency_libs="$newdependency_libs" | ||
3994 | newdlfiles= | ||
3995 | for lib in $dlfiles; do | ||
3996 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
3997 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
3998 | if test -z "$libdir"; then | ||
3999 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
4000 | exit 1 | ||
4001 | fi | ||
4002 | newdlfiles="$newdlfiles $libdir/$name" | ||
4003 | done | ||
4004 | dlfiles="$newdlfiles" | ||
4005 | newdlprefiles= | ||
4006 | for lib in $dlprefiles; do | ||
4007 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
4008 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
4009 | if test -z "$libdir"; then | ||
4010 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
4011 | exit 1 | ||
4012 | fi | ||
4013 | newdlprefiles="$newdlprefiles $libdir/$name" | ||
4014 | done | ||
4015 | dlprefiles="$newdlprefiles" | ||
4016 | fi | ||
4017 | $rm $output | ||
4018 | # place dlname in correct position for cygwin | ||
4019 | tdlname=$dlname | ||
4020 | case $host,$output,$installed,$module,$dlname in | ||
4021 | *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; | ||
4022 | esac | ||
4023 | $echo > $output "\ | ||
4024 | # $outputname - a libtool library file | ||
4025 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
4026 | # | ||
4027 | # Please DO NOT delete this file! | ||
4028 | # It is necessary for linking the library. | ||
4029 | |||
4030 | # The name that we can dlopen(3). | ||
4031 | dlname='$tdlname' | ||
4032 | |||
4033 | # Names of this library. | ||
4034 | library_names='$library_names' | ||
4035 | |||
4036 | # The name of the static archive. | ||
4037 | old_library='$old_library' | ||
4038 | |||
4039 | # Libraries that this one depends upon. | ||
4040 | dependency_libs='$dependency_libs' | ||
4041 | |||
4042 | # Version information for $libname. | ||
4043 | current=$current | ||
4044 | age=$age | ||
4045 | revision=$revision | ||
4046 | |||
4047 | # Is this an already installed library? | ||
4048 | installed=$installed | ||
4049 | |||
4050 | # Files to dlopen/dlpreopen | ||
4051 | dlopen='$dlfiles' | ||
4052 | dlpreopen='$dlprefiles' | ||
4053 | |||
4054 | # Directory that this library needs to be installed in: | ||
4055 | libdir='$install_libdir'" | ||
4056 | if test "$installed" = no && test $need_relink = yes; then | ||
4057 | $echo >> $output "\ | ||
4058 | relink_command=\"$relink_command\"" | ||
4059 | fi | ||
4060 | done | ||
4061 | fi | ||
4062 | |||
4063 | # Do a symbolic link so that the libtool archive can be found in | ||
4064 | # LD_LIBRARY_PATH before the program is installed. | ||
4065 | $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" | ||
4066 | $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? | ||
4067 | ;; | ||
4068 | esac | ||
4069 | exit 0 | ||
4070 | ;; | ||
4071 | |||
4072 | # libtool install mode | ||
4073 | install) | ||
4074 | modename="$modename: install" | ||
4075 | |||
4076 | # There may be an optional sh(1) argument at the beginning of | ||
4077 | # install_prog (especially on Windows NT). | ||
4078 | if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || | ||
4079 | # Allow the use of GNU shtool's install command. | ||
4080 | $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then | ||
4081 | # Aesthetically quote it. | ||
4082 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` | ||
4083 | case $arg in | ||
4084 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) | ||
4085 | arg="\"$arg\"" | ||
4086 | ;; | ||
4087 | esac | ||
4088 | install_prog="$arg " | ||
4089 | arg="$1" | ||
4090 | shift | ||
4091 | else | ||
4092 | install_prog= | ||
4093 | arg="$nonopt" | ||
4094 | fi | ||
4095 | |||
4096 | # The real first argument should be the name of the installation program. | ||
4097 | # Aesthetically quote it. | ||
4098 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
4099 | case $arg in | ||
4100 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) | ||
4101 | arg="\"$arg\"" | ||
4102 | ;; | ||
4103 | esac | ||
4104 | install_prog="$install_prog$arg" | ||
4105 | |||
4106 | # We need to accept at least all the BSD install flags. | ||
4107 | dest= | ||
4108 | files= | ||
4109 | opts= | ||
4110 | prev= | ||
4111 | install_type= | ||
4112 | isdir=no | ||
4113 | stripme= | ||
4114 | for arg | ||
4115 | do | ||
4116 | if test -n "$dest"; then | ||
4117 | files="$files $dest" | ||
4118 | dest="$arg" | ||
4119 | continue | ||
4120 | fi | ||
4121 | |||
4122 | case $arg in | ||
4123 | -d) isdir=yes ;; | ||
4124 | -f) prev="-f" ;; | ||
4125 | -g) prev="-g" ;; | ||
4126 | -m) prev="-m" ;; | ||
4127 | -o) prev="-o" ;; | ||
4128 | -s) | ||
4129 | stripme=" -s" | ||
4130 | continue | ||
4131 | ;; | ||
4132 | -*) ;; | ||
4133 | |||
4134 | *) | ||
4135 | # If the previous option needed an argument, then skip it. | ||
4136 | if test -n "$prev"; then | ||
4137 | prev= | ||
4138 | else | ||
4139 | dest="$arg" | ||
4140 | continue | ||
4141 | fi | ||
4142 | ;; | ||
4143 | esac | ||
4144 | |||
4145 | # Aesthetically quote the argument. | ||
4146 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
4147 | case $arg in | ||
4148 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) | ||
4149 | arg="\"$arg\"" | ||
4150 | ;; | ||
4151 | esac | ||
4152 | install_prog="$install_prog $arg" | ||
4153 | done | ||
4154 | |||
4155 | if test -z "$install_prog"; then | ||
4156 | $echo "$modename: you must specify an install program" 1>&2 | ||
4157 | $echo "$help" 1>&2 | ||
4158 | exit 1 | ||
4159 | fi | ||
4160 | |||
4161 | if test -n "$prev"; then | ||
4162 | $echo "$modename: the \`$prev' option requires an argument" 1>&2 | ||
4163 | $echo "$help" 1>&2 | ||
4164 | exit 1 | ||
4165 | fi | ||
4166 | |||
4167 | if test -z "$files"; then | ||
4168 | if test -z "$dest"; then | ||
4169 | $echo "$modename: no file or destination specified" 1>&2 | ||
4170 | else | ||
4171 | $echo "$modename: you must specify a destination" 1>&2 | ||
4172 | fi | ||
4173 | $echo "$help" 1>&2 | ||
4174 | exit 1 | ||
4175 | fi | ||
4176 | |||
4177 | # Strip any trailing slash from the destination. | ||
4178 | dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` | ||
4179 | |||
4180 | # Check to see that the destination is a directory. | ||
4181 | test -d "$dest" && isdir=yes | ||
4182 | if test "$isdir" = yes; then | ||
4183 | destdir="$dest" | ||
4184 | destname= | ||
4185 | else | ||
4186 | destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` | ||
4187 | test "X$destdir" = "X$dest" && destdir=. | ||
4188 | destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` | ||
4189 | |||
4190 | # Not a directory, so check to see that there is only one file specified. | ||
4191 | set dummy $files | ||
4192 | if test $# -gt 2; then | ||
4193 | $echo "$modename: \`$dest' is not a directory" 1>&2 | ||
4194 | $echo "$help" 1>&2 | ||
4195 | exit 1 | ||
4196 | fi | ||
4197 | fi | ||
4198 | case $destdir in | ||
4199 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
4200 | *) | ||
4201 | for file in $files; do | ||
4202 | case $file in | ||
4203 | *.lo) ;; | ||
4204 | *) | ||
4205 | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 | ||
4206 | $echo "$help" 1>&2 | ||
4207 | exit 1 | ||
4208 | ;; | ||
4209 | esac | ||
4210 | done | ||
4211 | ;; | ||
4212 | esac | ||
4213 | |||
4214 | # This variable tells wrapper scripts just to set variables rather | ||
4215 | # than running their programs. | ||
4216 | libtool_install_magic="$magic" | ||
4217 | |||
4218 | staticlibs= | ||
4219 | future_libdirs= | ||
4220 | current_libdirs= | ||
4221 | for file in $files; do | ||
4222 | |||
4223 | # Do each installation. | ||
4224 | case $file in | ||
4225 | *.$libext) | ||
4226 | # Do the static libraries later. | ||
4227 | staticlibs="$staticlibs $file" | ||
4228 | ;; | ||
4229 | |||
4230 | *.la) | ||
4231 | # Check to see that this really is a libtool archive. | ||
4232 | if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
4233 | else | ||
4234 | $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 | ||
4235 | $echo "$help" 1>&2 | ||
4236 | exit 1 | ||
4237 | fi | ||
4238 | |||
4239 | library_names= | ||
4240 | old_library= | ||
4241 | relink_command= | ||
4242 | # If there is no directory component, then add one. | ||
4243 | case $file in | ||
4244 | */* | *\\*) . $file ;; | ||
4245 | *) . ./$file ;; | ||
4246 | esac | ||
4247 | |||
4248 | # Add the libdir to current_libdirs if it is the destination. | ||
4249 | if test "X$destdir" = "X$libdir"; then | ||
4250 | case "$current_libdirs " in | ||
4251 | *" $libdir "*) ;; | ||
4252 | *) current_libdirs="$current_libdirs $libdir" ;; | ||
4253 | esac | ||
4254 | else | ||
4255 | # Note the libdir as a future libdir. | ||
4256 | case "$future_libdirs " in | ||
4257 | *" $libdir "*) ;; | ||
4258 | *) future_libdirs="$future_libdirs $libdir" ;; | ||
4259 | esac | ||
4260 | fi | ||
4261 | |||
4262 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ | ||
4263 | test "X$dir" = "X$file/" && dir= | ||
4264 | dir="$dir$objdir" | ||
4265 | |||
4266 | if test -n "$relink_command"; then | ||
4267 | # Determine the prefix the user has applied to our future dir. | ||
4268 | inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"` | ||
4269 | |||
4270 | # Don't allow the user to place us outside of our expected | ||
4271 | # location b/c this prevents finding dependent libraries that | ||
4272 | # are installed to the same prefix. | ||
4273 | if test "$inst_prefix_dir" = "$destdir"; then | ||
4274 | $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | ||
4275 | exit 1 | ||
4276 | fi | ||
4277 | |||
4278 | if test -n "$inst_prefix_dir"; then | ||
4279 | # Stick the inst_prefix_dir data into the link command. | ||
4280 | relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` | ||
4281 | else | ||
4282 | relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"` | ||
4283 | fi | ||
4284 | |||
4285 | $echo "$modename: warning: relinking \`$file'" 1>&2 | ||
4286 | $show "$relink_command" | ||
4287 | if $run eval "$relink_command"; then : | ||
4288 | else | ||
4289 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | ||
4290 | exit 1 | ||
4291 | fi | ||
4292 | fi | ||
4293 | |||
4294 | # See the names of the shared library. | ||
4295 | set dummy $library_names | ||
4296 | if test -n "$2"; then | ||
4297 | realname="$2" | ||
4298 | shift | ||
4299 | shift | ||
4300 | |||
4301 | srcname="$realname" | ||
4302 | test -n "$relink_command" && srcname="$realname"T | ||
4303 | |||
4304 | # Install the shared library and build the symlinks. | ||
4305 | $show "$install_prog $dir/$srcname $destdir/$realname" | ||
4306 | $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? | ||
4307 | if test -n "$stripme" && test -n "$striplib"; then | ||
4308 | $show "$striplib $destdir/$realname" | ||
4309 | $run eval "$striplib $destdir/$realname" || exit $? | ||
4310 | fi | ||
4311 | |||
4312 | if test $# -gt 0; then | ||
4313 | # Delete the old symlinks, and create new ones. | ||
4314 | for linkname | ||
4315 | do | ||
4316 | if test "$linkname" != "$realname"; then | ||
4317 | $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" | ||
4318 | $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" | ||
4319 | fi | ||
4320 | done | ||
4321 | fi | ||
4322 | |||
4323 | # Do each command in the postinstall commands. | ||
4324 | lib="$destdir/$realname" | ||
4325 | eval cmds=\"$postinstall_cmds\" | ||
4326 | save_ifs="$IFS"; IFS='~' | ||
4327 | for cmd in $cmds; do | ||
4328 | IFS="$save_ifs" | ||
4329 | $show "$cmd" | ||
4330 | $run eval "$cmd" || exit $? | ||
4331 | done | ||
4332 | IFS="$save_ifs" | ||
4333 | fi | ||
4334 | |||
4335 | # Install the pseudo-library for information purposes. | ||
4336 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4337 | instname="$dir/$name"i | ||
4338 | $show "$install_prog $instname $destdir/$name" | ||
4339 | $run eval "$install_prog $instname $destdir/$name" || exit $? | ||
4340 | |||
4341 | # Maybe install the static library, too. | ||
4342 | test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" | ||
4343 | ;; | ||
4344 | |||
4345 | *.lo) | ||
4346 | # Install (i.e. copy) a libtool object. | ||
4347 | |||
4348 | # Figure out destination file name, if it wasn't already specified. | ||
4349 | if test -n "$destname"; then | ||
4350 | destfile="$destdir/$destname" | ||
4351 | else | ||
4352 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4353 | destfile="$destdir/$destfile" | ||
4354 | fi | ||
4355 | |||
4356 | # Deduce the name of the destination old-style object file. | ||
4357 | case $destfile in | ||
4358 | *.lo) | ||
4359 | staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` | ||
4360 | ;; | ||
4361 | *.$objext) | ||
4362 | staticdest="$destfile" | ||
4363 | destfile= | ||
4364 | ;; | ||
4365 | *) | ||
4366 | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 | ||
4367 | $echo "$help" 1>&2 | ||
4368 | exit 1 | ||
4369 | ;; | ||
4370 | esac | ||
4371 | |||
4372 | # Install the libtool object if requested. | ||
4373 | if test -n "$destfile"; then | ||
4374 | $show "$install_prog $file $destfile" | ||
4375 | $run eval "$install_prog $file $destfile" || exit $? | ||
4376 | fi | ||
4377 | |||
4378 | # Install the old object if enabled. | ||
4379 | if test "$build_old_libs" = yes; then | ||
4380 | # Deduce the name of the old-style object file. | ||
4381 | staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` | ||
4382 | |||
4383 | $show "$install_prog $staticobj $staticdest" | ||
4384 | $run eval "$install_prog \$staticobj \$staticdest" || exit $? | ||
4385 | fi | ||
4386 | exit 0 | ||
4387 | ;; | ||
4388 | |||
4389 | *) | ||
4390 | # Figure out destination file name, if it wasn't already specified. | ||
4391 | if test -n "$destname"; then | ||
4392 | destfile="$destdir/$destname" | ||
4393 | else | ||
4394 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4395 | destfile="$destdir/$destfile" | ||
4396 | fi | ||
4397 | |||
4398 | # Do a test to see if this is really a libtool program. | ||
4399 | case $host in | ||
4400 | *cygwin*|*mingw*) | ||
4401 | wrapper=`echo $file | ${SED} -e 's,.exe$,,'` | ||
4402 | ;; | ||
4403 | *) | ||
4404 | wrapper=$file | ||
4405 | ;; | ||
4406 | esac | ||
4407 | if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then | ||
4408 | notinst_deplibs= | ||
4409 | relink_command= | ||
4410 | |||
4411 | # If there is no directory component, then add one. | ||
4412 | case $file in | ||
4413 | */* | *\\*) . $wrapper ;; | ||
4414 | *) . ./$wrapper ;; | ||
4415 | esac | ||
4416 | |||
4417 | # Check the variables that should have been set. | ||
4418 | if test -z "$notinst_deplibs"; then | ||
4419 | $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 | ||
4420 | exit 1 | ||
4421 | fi | ||
4422 | |||
4423 | finalize=yes | ||
4424 | for lib in $notinst_deplibs; do | ||
4425 | # Check to see that each library is installed. | ||
4426 | libdir= | ||
4427 | if test -f "$lib"; then | ||
4428 | # If there is no directory component, then add one. | ||
4429 | case $lib in | ||
4430 | */* | *\\*) . $lib ;; | ||
4431 | *) . ./$lib ;; | ||
4432 | esac | ||
4433 | fi | ||
4434 | libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test | ||
4435 | if test -n "$libdir" && test ! -f "$libfile"; then | ||
4436 | $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 | ||
4437 | finalize=no | ||
4438 | fi | ||
4439 | done | ||
4440 | |||
4441 | relink_command= | ||
4442 | # If there is no directory component, then add one. | ||
4443 | case $file in | ||
4444 | */* | *\\*) . $wrapper ;; | ||
4445 | *) . ./$wrapper ;; | ||
4446 | esac | ||
4447 | |||
4448 | outputname= | ||
4449 | if test "$fast_install" = no && test -n "$relink_command"; then | ||
4450 | if test "$finalize" = yes && test -z "$run"; then | ||
4451 | tmpdir="/tmp" | ||
4452 | test -n "$TMPDIR" && tmpdir="$TMPDIR" | ||
4453 | tmpdir="$tmpdir/libtool-$$" | ||
4454 | if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : | ||
4455 | else | ||
4456 | $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 | ||
4457 | continue | ||
4458 | fi | ||
4459 | file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4460 | outputname="$tmpdir/$file" | ||
4461 | # Replace the output file specification. | ||
4462 | relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` | ||
4463 | |||
4464 | $show "$relink_command" | ||
4465 | if $run eval "$relink_command"; then : | ||
4466 | else | ||
4467 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | ||
4468 | ${rm}r "$tmpdir" | ||
4469 | continue | ||
4470 | fi | ||
4471 | file="$outputname" | ||
4472 | else | ||
4473 | $echo "$modename: warning: cannot relink \`$file'" 1>&2 | ||
4474 | fi | ||
4475 | else | ||
4476 | # Install the binary that we compiled earlier. | ||
4477 | file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` | ||
4478 | fi | ||
4479 | fi | ||
4480 | |||
4481 | # remove .exe since cygwin /usr/bin/install will append another | ||
4482 | # one anyways | ||
4483 | case $install_prog,$host in | ||
4484 | /usr/bin/install*,*cygwin*) | ||
4485 | case $file:$destfile in | ||
4486 | *.exe:*.exe) | ||
4487 | # this is ok | ||
4488 | ;; | ||
4489 | *.exe:*) | ||
4490 | destfile=$destfile.exe | ||
4491 | ;; | ||
4492 | *:*.exe) | ||
4493 | destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` | ||
4494 | ;; | ||
4495 | esac | ||
4496 | ;; | ||
4497 | esac | ||
4498 | $show "$install_prog$stripme $file $destfile" | ||
4499 | $run eval "$install_prog\$stripme \$file \$destfile" || exit $? | ||
4500 | test -n "$outputname" && ${rm}r "$tmpdir" | ||
4501 | ;; | ||
4502 | esac | ||
4503 | done | ||
4504 | |||
4505 | for file in $staticlibs; do | ||
4506 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4507 | |||
4508 | # Set up the ranlib parameters. | ||
4509 | oldlib="$destdir/$name" | ||
4510 | |||
4511 | $show "$install_prog $file $oldlib" | ||
4512 | $run eval "$install_prog \$file \$oldlib" || exit $? | ||
4513 | |||
4514 | if test -n "$stripme" && test -n "$striplib"; then | ||
4515 | $show "$old_striplib $oldlib" | ||
4516 | $run eval "$old_striplib $oldlib" || exit $? | ||
4517 | fi | ||
4518 | |||
4519 | # Do each command in the postinstall commands. | ||
4520 | eval cmds=\"$old_postinstall_cmds\" | ||
4521 | save_ifs="$IFS"; IFS='~' | ||
4522 | for cmd in $cmds; do | ||
4523 | IFS="$save_ifs" | ||
4524 | $show "$cmd" | ||
4525 | $run eval "$cmd" || exit $? | ||
4526 | done | ||
4527 | IFS="$save_ifs" | ||
4528 | done | ||
4529 | |||
4530 | if test -n "$future_libdirs"; then | ||
4531 | $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 | ||
4532 | fi | ||
4533 | |||
4534 | if test -n "$current_libdirs"; then | ||
4535 | # Maybe just do a dry run. | ||
4536 | test -n "$run" && current_libdirs=" -n$current_libdirs" | ||
4537 | exec_cmd='$SHELL $0 --finish$current_libdirs' | ||
4538 | else | ||
4539 | exit 0 | ||
4540 | fi | ||
4541 | ;; | ||
4542 | |||
4543 | # libtool finish mode | ||
4544 | finish) | ||
4545 | modename="$modename: finish" | ||
4546 | libdirs="$nonopt" | ||
4547 | admincmds= | ||
4548 | |||
4549 | if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | ||
4550 | for dir | ||
4551 | do | ||
4552 | libdirs="$libdirs $dir" | ||
4553 | done | ||
4554 | |||
4555 | for libdir in $libdirs; do | ||
4556 | if test -n "$finish_cmds"; then | ||
4557 | # Do each command in the finish commands. | ||
4558 | eval cmds=\"$finish_cmds\" | ||
4559 | save_ifs="$IFS"; IFS='~' | ||
4560 | for cmd in $cmds; do | ||
4561 | IFS="$save_ifs" | ||
4562 | $show "$cmd" | ||
4563 | $run eval "$cmd" || admincmds="$admincmds | ||
4564 | $cmd" | ||
4565 | done | ||
4566 | IFS="$save_ifs" | ||
4567 | fi | ||
4568 | if test -n "$finish_eval"; then | ||
4569 | # Do the single finish_eval. | ||
4570 | eval cmds=\"$finish_eval\" | ||
4571 | $run eval "$cmds" || admincmds="$admincmds | ||
4572 | $cmds" | ||
4573 | fi | ||
4574 | done | ||
4575 | fi | ||
4576 | |||
4577 | # Exit here if they wanted silent mode. | ||
4578 | test "$show" = ":" && exit 0 | ||
4579 | |||
4580 | echo "----------------------------------------------------------------------" | ||
4581 | echo "Libraries have been installed in:" | ||
4582 | for libdir in $libdirs; do | ||
4583 | echo " $libdir" | ||
4584 | done | ||
4585 | echo | ||
4586 | echo "If you ever happen to want to link against installed libraries" | ||
4587 | echo "in a given directory, LIBDIR, you must either use libtool, and" | ||
4588 | echo "specify the full pathname of the library, or use the \`-LLIBDIR'" | ||
4589 | echo "flag during linking and do at least one of the following:" | ||
4590 | if test -n "$shlibpath_var"; then | ||
4591 | echo " - add LIBDIR to the \`$shlibpath_var' environment variable" | ||
4592 | echo " during execution" | ||
4593 | fi | ||
4594 | if test -n "$runpath_var"; then | ||
4595 | echo " - add LIBDIR to the \`$runpath_var' environment variable" | ||
4596 | echo " during linking" | ||
4597 | fi | ||
4598 | if test -n "$hardcode_libdir_flag_spec"; then | ||
4599 | libdir=LIBDIR | ||
4600 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
4601 | |||
4602 | echo " - use the \`$flag' linker flag" | ||
4603 | fi | ||
4604 | if test -n "$admincmds"; then | ||
4605 | echo " - have your system administrator run these commands:$admincmds" | ||
4606 | fi | ||
4607 | if test -f /etc/ld.so.conf; then | ||
4608 | echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" | ||
4609 | fi | ||
4610 | echo | ||
4611 | echo "See any operating system documentation about shared libraries for" | ||
4612 | echo "more information, such as the ld(1) and ld.so(8) manual pages." | ||
4613 | echo "----------------------------------------------------------------------" | ||
4614 | exit 0 | ||
4615 | ;; | ||
4616 | |||
4617 | # libtool execute mode | ||
4618 | execute) | ||
4619 | modename="$modename: execute" | ||
4620 | |||
4621 | # The first argument is the command name. | ||
4622 | cmd="$nonopt" | ||
4623 | if test -z "$cmd"; then | ||
4624 | $echo "$modename: you must specify a COMMAND" 1>&2 | ||
4625 | $echo "$help" | ||
4626 | exit 1 | ||
4627 | fi | ||
4628 | |||
4629 | # Handle -dlopen flags immediately. | ||
4630 | for file in $execute_dlfiles; do | ||
4631 | if test ! -f "$file"; then | ||
4632 | $echo "$modename: \`$file' is not a file" 1>&2 | ||
4633 | $echo "$help" 1>&2 | ||
4634 | exit 1 | ||
4635 | fi | ||
4636 | |||
4637 | dir= | ||
4638 | case $file in | ||
4639 | *.la) | ||
4640 | # Check to see that this really is a libtool archive. | ||
4641 | if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
4642 | else | ||
4643 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
4644 | $echo "$help" 1>&2 | ||
4645 | exit 1 | ||
4646 | fi | ||
4647 | |||
4648 | # Read the libtool library. | ||
4649 | dlname= | ||
4650 | library_names= | ||
4651 | |||
4652 | # If there is no directory component, then add one. | ||
4653 | case $file in | ||
4654 | */* | *\\*) . $file ;; | ||
4655 | *) . ./$file ;; | ||
4656 | esac | ||
4657 | |||
4658 | # Skip this library if it cannot be dlopened. | ||
4659 | if test -z "$dlname"; then | ||
4660 | # Warn if it was a shared library. | ||
4661 | test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" | ||
4662 | continue | ||
4663 | fi | ||
4664 | |||
4665 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
4666 | test "X$dir" = "X$file" && dir=. | ||
4667 | |||
4668 | if test -f "$dir/$objdir/$dlname"; then | ||
4669 | dir="$dir/$objdir" | ||
4670 | else | ||
4671 | $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 | ||
4672 | exit 1 | ||
4673 | fi | ||
4674 | ;; | ||
4675 | |||
4676 | *.lo) | ||
4677 | # Just add the directory containing the .lo file. | ||
4678 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
4679 | test "X$dir" = "X$file" && dir=. | ||
4680 | ;; | ||
4681 | |||
4682 | *) | ||
4683 | $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 | ||
4684 | continue | ||
4685 | ;; | ||
4686 | esac | ||
4687 | |||
4688 | # Get the absolute pathname. | ||
4689 | absdir=`cd "$dir" && pwd` | ||
4690 | test -n "$absdir" && dir="$absdir" | ||
4691 | |||
4692 | # Now add the directory to shlibpath_var. | ||
4693 | if eval "test -z \"\$$shlibpath_var\""; then | ||
4694 | eval "$shlibpath_var=\"\$dir\"" | ||
4695 | else | ||
4696 | eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" | ||
4697 | fi | ||
4698 | done | ||
4699 | |||
4700 | # This variable tells wrapper scripts just to set shlibpath_var | ||
4701 | # rather than running their programs. | ||
4702 | libtool_execute_magic="$magic" | ||
4703 | |||
4704 | # Check if any of the arguments is a wrapper script. | ||
4705 | args= | ||
4706 | for file | ||
4707 | do | ||
4708 | case $file in | ||
4709 | -*) ;; | ||
4710 | *) | ||
4711 | # Do a test to see if this is really a libtool program. | ||
4712 | if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
4713 | # If there is no directory component, then add one. | ||
4714 | case $file in | ||
4715 | */* | *\\*) . $file ;; | ||
4716 | *) . ./$file ;; | ||
4717 | esac | ||
4718 | |||
4719 | # Transform arg to wrapped name. | ||
4720 | file="$progdir/$program" | ||
4721 | fi | ||
4722 | ;; | ||
4723 | esac | ||
4724 | # Quote arguments (to preserve shell metacharacters). | ||
4725 | file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` | ||
4726 | args="$args \"$file\"" | ||
4727 | done | ||
4728 | |||
4729 | if test -z "$run"; then | ||
4730 | if test -n "$shlibpath_var"; then | ||
4731 | # Export the shlibpath_var. | ||
4732 | eval "export $shlibpath_var" | ||
4733 | fi | ||
4734 | |||
4735 | # Restore saved enviroment variables | ||
4736 | if test "${save_LC_ALL+set}" = set; then | ||
4737 | LC_ALL="$save_LC_ALL"; export LC_ALL | ||
4738 | fi | ||
4739 | if test "${save_LANG+set}" = set; then | ||
4740 | LANG="$save_LANG"; export LANG | ||
4741 | fi | ||
4742 | |||
4743 | # Now prepare to actually exec the command. | ||
4744 | exec_cmd="\$cmd$args" | ||
4745 | else | ||
4746 | # Display what would be done. | ||
4747 | if test -n "$shlibpath_var"; then | ||
4748 | eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" | ||
4749 | $echo "export $shlibpath_var" | ||
4750 | fi | ||
4751 | $echo "$cmd$args" | ||
4752 | exit 0 | ||
4753 | fi | ||
4754 | ;; | ||
4755 | |||
4756 | # libtool clean and uninstall mode | ||
4757 | clean | uninstall) | ||
4758 | modename="$modename: $mode" | ||
4759 | rm="$nonopt" | ||
4760 | files= | ||
4761 | rmforce= | ||
4762 | exit_status=0 | ||
4763 | |||
4764 | # This variable tells wrapper scripts just to set variables rather | ||
4765 | # than running their programs. | ||
4766 | libtool_install_magic="$magic" | ||
4767 | |||
4768 | for arg | ||
4769 | do | ||
4770 | case $arg in | ||
4771 | -f) rm="$rm $arg"; rmforce=yes ;; | ||
4772 | -*) rm="$rm $arg" ;; | ||
4773 | *) files="$files $arg" ;; | ||
4774 | esac | ||
4775 | done | ||
4776 | |||
4777 | if test -z "$rm"; then | ||
4778 | $echo "$modename: you must specify an RM program" 1>&2 | ||
4779 | $echo "$help" 1>&2 | ||
4780 | exit 1 | ||
4781 | fi | ||
4782 | |||
4783 | rmdirs= | ||
4784 | |||
4785 | for file in $files; do | ||
4786 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
4787 | if test "X$dir" = "X$file"; then | ||
4788 | dir=. | ||
4789 | objdir="$objdir" | ||
4790 | else | ||
4791 | objdir="$dir/$objdir" | ||
4792 | fi | ||
4793 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
4794 | test $mode = uninstall && objdir="$dir" | ||
4795 | |||
4796 | # Remember objdir for removal later, being careful to avoid duplicates | ||
4797 | if test $mode = clean; then | ||
4798 | case " $rmdirs " in | ||
4799 | *" $objdir "*) ;; | ||
4800 | *) rmdirs="$rmdirs $objdir" ;; | ||
4801 | esac | ||
4802 | fi | ||
4803 | |||
4804 | # Don't error if the file doesn't exist and rm -f was used. | ||
4805 | if (test -L "$file") >/dev/null 2>&1 \ | ||
4806 | || (test -h "$file") >/dev/null 2>&1 \ | ||
4807 | || test -f "$file"; then | ||
4808 | : | ||
4809 | elif test -d "$file"; then | ||
4810 | exit_status=1 | ||
4811 | continue | ||
4812 | elif test "$rmforce" = yes; then | ||
4813 | continue | ||
4814 | fi | ||
4815 | |||
4816 | rmfiles="$file" | ||
4817 | |||
4818 | case $name in | ||
4819 | *.la) | ||
4820 | # Possibly a libtool archive, so verify it. | ||
4821 | if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
4822 | . $dir/$name | ||
4823 | |||
4824 | # Delete the libtool libraries and symlinks. | ||
4825 | for n in $library_names; do | ||
4826 | rmfiles="$rmfiles $objdir/$n" | ||
4827 | done | ||
4828 | test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" | ||
4829 | test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" | ||
4830 | |||
4831 | if test $mode = uninstall; then | ||
4832 | if test -n "$library_names"; then | ||
4833 | # Do each command in the postuninstall commands. | ||
4834 | eval cmds=\"$postuninstall_cmds\" | ||
4835 | save_ifs="$IFS"; IFS='~' | ||
4836 | for cmd in $cmds; do | ||
4837 | IFS="$save_ifs" | ||
4838 | $show "$cmd" | ||
4839 | $run eval "$cmd" | ||
4840 | if test $? != 0 && test "$rmforce" != yes; then | ||
4841 | exit_status=1 | ||
4842 | fi | ||
4843 | done | ||
4844 | IFS="$save_ifs" | ||
4845 | fi | ||
4846 | |||
4847 | if test -n "$old_library"; then | ||
4848 | # Do each command in the old_postuninstall commands. | ||
4849 | eval cmds=\"$old_postuninstall_cmds\" | ||
4850 | save_ifs="$IFS"; IFS='~' | ||
4851 | for cmd in $cmds; do | ||
4852 | IFS="$save_ifs" | ||
4853 | $show "$cmd" | ||
4854 | $run eval "$cmd" | ||
4855 | if test $? != 0 && test "$rmforce" != yes; then | ||
4856 | exit_status=1 | ||
4857 | fi | ||
4858 | done | ||
4859 | IFS="$save_ifs" | ||
4860 | fi | ||
4861 | # FIXME: should reinstall the best remaining shared library. | ||
4862 | fi | ||
4863 | fi | ||
4864 | ;; | ||
4865 | |||
4866 | *.lo) | ||
4867 | if test "$build_old_libs" = yes; then | ||
4868 | oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` | ||
4869 | rmfiles="$rmfiles $dir/$oldobj" | ||
4870 | fi | ||
4871 | ;; | ||
4872 | |||
4873 | *) | ||
4874 | # Do a test to see if this is a libtool program. | ||
4875 | if test $mode = clean && | ||
4876 | (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
4877 | relink_command= | ||
4878 | . $dir/$file | ||
4879 | |||
4880 | rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" | ||
4881 | if test "$fast_install" = yes && test -n "$relink_command"; then | ||
4882 | rmfiles="$rmfiles $objdir/lt-$name" | ||
4883 | fi | ||
4884 | fi | ||
4885 | ;; | ||
4886 | esac | ||
4887 | $show "$rm $rmfiles" | ||
4888 | $run $rm $rmfiles || exit_status=1 | ||
4889 | done | ||
4890 | |||
4891 | # Try to remove the ${objdir}s in the directories where we deleted files | ||
4892 | for dir in $rmdirs; do | ||
4893 | if test -d "$dir"; then | ||
4894 | $show "rmdir $dir" | ||
4895 | $run rmdir $dir >/dev/null 2>&1 | ||
4896 | fi | ||
4897 | done | ||
4898 | |||
4899 | exit $exit_status | ||
4900 | ;; | ||
4901 | |||
4902 | "") | ||
4903 | $echo "$modename: you must specify a MODE" 1>&2 | ||
4904 | $echo "$generic_help" 1>&2 | ||
4905 | exit 1 | ||
4906 | ;; | ||
4907 | esac | ||
4908 | |||
4909 | if test -z "$exec_cmd"; then | ||
4910 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 | ||
4911 | $echo "$generic_help" 1>&2 | ||
4912 | exit 1 | ||
4913 | fi | ||
4914 | fi # test -z "$show_help" | ||
4915 | |||
4916 | if test -n "$exec_cmd"; then | ||
4917 | eval exec $exec_cmd | ||
4918 | exit 1 | ||
4919 | fi | ||
4920 | |||
4921 | # We need to display help for each of the modes. | ||
4922 | case $mode in | ||
4923 | "") $echo \ | ||
4924 | "Usage: $modename [OPTION]... [MODE-ARG]... | ||
4925 | |||
4926 | Provide generalized library-building support services. | ||
4927 | |||
4928 | --config show all configuration variables | ||
4929 | --debug enable verbose shell tracing | ||
4930 | -n, --dry-run display commands without modifying any files | ||
4931 | --features display basic configuration information and exit | ||
4932 | --finish same as \`--mode=finish' | ||
4933 | --help display this help message and exit | ||
4934 | --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] | ||
4935 | --quiet same as \`--silent' | ||
4936 | --silent don't print informational messages | ||
4937 | --version print version information | ||
4938 | |||
4939 | MODE must be one of the following: | ||
4940 | |||
4941 | clean remove files from the build directory | ||
4942 | compile compile a source file into a libtool object | ||
4943 | execute automatically set library path, then run a program | ||
4944 | finish complete the installation of libtool libraries | ||
4945 | install install libraries or executables | ||
4946 | link create a library or an executable | ||
4947 | uninstall remove libraries from an installed directory | ||
4948 | |||
4949 | MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for | ||
4950 | a more detailed description of MODE." | ||
4951 | exit 0 | ||
4952 | ;; | ||
4953 | |||
4954 | clean) | ||
4955 | $echo \ | ||
4956 | "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... | ||
4957 | |||
4958 | Remove files from the build directory. | ||
4959 | |||
4960 | RM is the name of the program to use to delete files associated with each FILE | ||
4961 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed | ||
4962 | to RM. | ||
4963 | |||
4964 | If FILE is a libtool library, object or program, all the files associated | ||
4965 | with it are deleted. Otherwise, only FILE itself is deleted using RM." | ||
4966 | ;; | ||
4967 | |||
4968 | compile) | ||
4969 | $echo \ | ||
4970 | "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE | ||
4971 | |||
4972 | Compile a source file into a libtool library object. | ||
4973 | |||
4974 | This mode accepts the following additional options: | ||
4975 | |||
4976 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE | ||
4977 | -prefer-pic try to building PIC objects only | ||
4978 | -prefer-non-pic try to building non-PIC objects only | ||
4979 | -static always build a \`.o' file suitable for static linking | ||
4980 | |||
4981 | COMPILE-COMMAND is a command to be used in creating a \`standard' object file | ||
4982 | from the given SOURCEFILE. | ||
4983 | |||
4984 | The output file name is determined by removing the directory component from | ||
4985 | SOURCEFILE, then substituting the C source code suffix \`.c' with the | ||
4986 | library object suffix, \`.lo'." | ||
4987 | ;; | ||
4988 | |||
4989 | execute) | ||
4990 | $echo \ | ||
4991 | "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... | ||
4992 | |||
4993 | Automatically set library path, then run a program. | ||
4994 | |||
4995 | This mode accepts the following additional options: | ||
4996 | |||
4997 | -dlopen FILE add the directory containing FILE to the library path | ||
4998 | |||
4999 | This mode sets the library path environment variable according to \`-dlopen' | ||
5000 | flags. | ||
5001 | |||
5002 | If any of the ARGS are libtool executable wrappers, then they are translated | ||
5003 | into their corresponding uninstalled binary, and any of their required library | ||
5004 | directories are added to the library path. | ||
5005 | |||
5006 | Then, COMMAND is executed, with ARGS as arguments." | ||
5007 | ;; | ||
5008 | |||
5009 | finish) | ||
5010 | $echo \ | ||
5011 | "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... | ||
5012 | |||
5013 | Complete the installation of libtool libraries. | ||
5014 | |||
5015 | Each LIBDIR is a directory that contains libtool libraries. | ||
5016 | |||
5017 | The commands that this mode executes may require superuser privileges. Use | ||
5018 | the \`--dry-run' option if you just want to see what would be executed." | ||
5019 | ;; | ||
5020 | |||
5021 | install) | ||
5022 | $echo \ | ||
5023 | "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... | ||
5024 | |||
5025 | Install executables or libraries. | ||
5026 | |||
5027 | INSTALL-COMMAND is the installation command. The first component should be | ||
5028 | either the \`install' or \`cp' program. | ||
5029 | |||
5030 | The rest of the components are interpreted as arguments to that command (only | ||
5031 | BSD-compatible install options are recognized)." | ||
5032 | ;; | ||
5033 | |||
5034 | link) | ||
5035 | $echo \ | ||
5036 | "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... | ||
5037 | |||
5038 | Link object files or libraries together to form another library, or to | ||
5039 | create an executable program. | ||
5040 | |||
5041 | LINK-COMMAND is a command using the C compiler that you would use to create | ||
5042 | a program from several object files. | ||
5043 | |||
5044 | The following components of LINK-COMMAND are treated specially: | ||
5045 | |||
5046 | -all-static do not do any dynamic linking at all | ||
5047 | -avoid-version do not add a version suffix if possible | ||
5048 | -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime | ||
5049 | -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols | ||
5050 | -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) | ||
5051 | -export-symbols SYMFILE | ||
5052 | try to export only the symbols listed in SYMFILE | ||
5053 | -export-symbols-regex REGEX | ||
5054 | try to export only the symbols matching REGEX | ||
5055 | -LLIBDIR search LIBDIR for required installed libraries | ||
5056 | -lNAME OUTPUT-FILE requires the installed library libNAME | ||
5057 | -module build a library that can dlopened | ||
5058 | -no-fast-install disable the fast-install mode | ||
5059 | -no-install link a not-installable executable | ||
5060 | -no-undefined declare that a library does not refer to external symbols | ||
5061 | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects | ||
5062 | -release RELEASE specify package release information | ||
5063 | -rpath LIBDIR the created library will eventually be installed in LIBDIR | ||
5064 | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries | ||
5065 | -static do not do any dynamic linking of libtool libraries | ||
5066 | -version-info CURRENT[:REVISION[:AGE]] | ||
5067 | specify library version info [each variable defaults to 0] | ||
5068 | |||
5069 | All other options (arguments beginning with \`-') are ignored. | ||
5070 | |||
5071 | Every other argument is treated as a filename. Files ending in \`.la' are | ||
5072 | treated as uninstalled libtool libraries, other files are standard or library | ||
5073 | object files. | ||
5074 | |||
5075 | If the OUTPUT-FILE ends in \`.la', then a libtool library is created, | ||
5076 | only library objects (\`.lo' files) may be specified, and \`-rpath' is | ||
5077 | required, except when creating a convenience library. | ||
5078 | |||
5079 | If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created | ||
5080 | using \`ar' and \`ranlib', or on Windows using \`lib'. | ||
5081 | |||
5082 | If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file | ||
5083 | is created, otherwise an executable program is created." | ||
5084 | ;; | ||
5085 | |||
5086 | uninstall) | ||
5087 | $echo \ | ||
5088 | "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... | ||
5089 | |||
5090 | Remove libraries from an installation directory. | ||
5091 | |||
5092 | RM is the name of the program to use to delete files associated with each FILE | ||
5093 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed | ||
5094 | to RM. | ||
5095 | |||
5096 | If FILE is a libtool library, all the files associated with it are deleted. | ||
5097 | Otherwise, only FILE itself is deleted using RM." | ||
5098 | ;; | ||
5099 | |||
5100 | *) | ||
5101 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 | ||
5102 | $echo "$help" 1>&2 | ||
5103 | exit 1 | ||
5104 | ;; | ||
5105 | esac | ||
5106 | |||
5107 | echo | ||
5108 | $echo "Try \`$modename --help' for more information about other modes." | ||
5109 | |||
5110 | exit 0 | ||
5111 | |||
5112 | # Local Variables: | ||
5113 | # mode:shell-script | ||
5114 | # sh-indentation:2 | ||
5115 | # End: | ||