Debian Codegraph @

libtool

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