1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # The name of this program.
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
59 TIMESTAMP=" (1.922.2.100 2002/06/26 07:25:14)"
62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 Xsed="${SED}"' -e 1s/^X//'
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 # test EBCDIC or ASCII
73 case `echo A|od -x` in
74 *[Cc]1*) # EBCDIC based system
75 SP2NL="tr '\100' '\n'"
76 NL2SP="tr '\r\n' '\100\100'"
78 *) # Assume ASCII based system
79 SP2NL="tr '\040' '\012'"
80 NL2SP="tr '\015\012' '\040\040'"
85 # Only set LANG and LC_ALL to C if already set.
86 # These must not be set unconditionally because not all systems understand
87 # e.g. LANG=C (notably SCO).
88 # We save the old values to restore during execute mode.
89 if test "${LC_ALL+set}" = set; then
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
92 if test "${LANG+set}" = set; then
93 save_LANG="$LANG"; LANG=C; export LANG
96 # Make sure IFS has a sensible default
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100 echo "$modename: not configured to build any kind of library" 1>&2
101 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
114 lo2o="s/\\.lo\$/.${objext}/"
115 o2lo="s/\\.${objext}\$/.lo/"
117 # Parse our command line options once, thoroughly.
124 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
128 # If the previous option needs an argument, assign it.
129 if test -n "$prev"; then
132 execute_dlfiles="$execute_dlfiles $arg"
144 # Have we seen a non-optional argument yet?
151 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
156 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
161 echo "$progname: enabling shell trace mode"
171 if test "$build_libtool_libs" = yes; then
172 echo "enable shared libraries"
174 echo "disable shared libraries"
176 if test "$build_old_libs" = yes; then
177 echo "enable static libraries"
179 echo "disable static libraries"
184 --finish) mode="finish" ;;
186 --mode) prevopt="--mode" prev=mode ;;
187 --mode=*) mode="$optarg" ;;
189 --preserve-dup-deps) duplicate_deps="yes" ;;
201 $echo "$modename: unrecognized option \`$arg'" 1>&2
213 if test -n "$prevopt"; then
214 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
219 # If this variable is set in any of the actions, the command in it
220 # will be execed at the end. This prevents here-documents from being
221 # left over by shells.
224 if test -z "$show_help"; then
226 # Infer the operation mode.
227 if test -z "$mode"; then
229 *cc | *++ | gcc* | *-gcc*)
241 *db | *dbx | *strace | *truss)
251 # If we have no mode, but dlfiles were specified, then do execute mode.
252 test -n "$execute_dlfiles" && mode=execute
254 # Just use the default operation mode.
255 if test -z "$mode"; then
256 if test -n "$nonopt"; then
257 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
259 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
266 # Only execute mode is allowed to have -dlopen flags.
267 if test -n "$execute_dlfiles" && test "$mode" != execute; then
268 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
273 # Change the help message to a mode-specific one.
275 help="Try \`$modename --help --mode=$mode' for more information."
277 # These modes are in order of execution frequency so that they run quickly.
279 # libtool compile mode
281 modename="$modename: compile"
282 # Get the compilation command and the source file.
295 # Aesthetically quote the previous argument.
297 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
300 # Double-quote args containing other shell metacharacters.
301 # Many Bourne shells cannot handle close brackets correctly
302 # in scan sets, so we specify it separately.
303 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
308 # Add the previous argument to base_compile.
309 if test -z "$base_compile"; then
310 base_compile="$lastarg"
312 base_compile="$base_compile $lastarg"
318 # Accept any command-line options.
321 if test "$user_target" != "no"; then
322 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
349 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
351 save_ifs="$IFS"; IFS=','
355 # Double-quote args containing other shell metacharacters.
356 # Many Bourne shells cannot handle close brackets correctly
357 # in scan sets, so we specify it separately.
359 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
363 lastarg="$lastarg $arg"
366 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
368 # Add the arguments to base_compile.
369 if test -z "$base_compile"; then
370 base_compile="$lastarg"
372 base_compile="$base_compile $lastarg"
380 # The next one is the -o target name
385 # We got the output file
392 # Accept the current argument as the source file.
396 # Aesthetically quote the previous argument.
398 # Backslashify any backslashes, double quotes, and dollar signs.
399 # These are the only characters that are still specially
400 # interpreted inside of double-quoted scrings.
401 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
403 # Double-quote args containing other shell metacharacters.
404 # Many Bourne shells cannot handle close brackets correctly
405 # in scan sets, so we specify it separately.
407 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
408 lastarg="\"$lastarg\""
412 # Add the previous argument to base_compile.
413 if test -z "$base_compile"; then
414 base_compile="$lastarg"
416 base_compile="$base_compile $lastarg"
424 # Get the name of the library object.
425 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
428 $echo "$modename: you must specify a target with \`-o'" 1>&2
433 # Recognize several different file suffixes.
434 # If the user specifies -o file.o, it is replaced with file.lo
449 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
452 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
454 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
459 if test -z "$base_compile"; then
460 $echo "$modename: you must specify a compilation command" 1>&2
465 # Delete any leftover library objects.
466 if test "$build_old_libs" = yes; then
467 removelist="$obj $libobj"
473 trap "$run $rm $removelist; exit 1" 1 2 15
475 # On Cygwin there's no "real" PIC flag so we must build both object types
477 cygwin* | mingw* | pw32* | os2*)
481 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
482 # non-PIC code in shared libraries is not supported
486 # Calculate the filename of the output object if compiler does
487 # not support -o with -c
488 if test "$compiler_c_o" = no; then
489 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
490 lockfile="$output_obj.lock"
491 removelist="$removelist $output_obj $lockfile"
492 trap "$run $rm $removelist; exit 1" 1 2 15
498 # Lock this critical section if it is needed
499 # We use this script file to make the link, it avoids creating a new file
500 if test "$need_locks" = yes; then
501 until $run ln "$0" "$lockfile" 2>/dev/null; do
502 $show "Waiting for $lockfile to be removed"
505 elif test "$need_locks" = warn; then
506 if test -f "$lockfile"; then
508 *** ERROR, $lockfile exists and contains:
509 `cat $lockfile 2>/dev/null`
511 This indicates that another process is trying to use the same
512 temporary object file, and libtool could not work around it because
513 your compiler does not support \`-c' and \`-o' together. If you
514 repeat this compilation, it may succeed, by chance, but you had better
515 avoid parallel builds (make -j) in this platform, or get a better
521 echo $srcfile > "$lockfile"
524 if test -n "$fix_srcfile_path"; then
525 eval srcfile=\"$fix_srcfile_path\"
528 # Only build a PIC object if we are building libtool libraries.
529 if test "$build_libtool_libs" = yes; then
530 # Without this assignment, base_compile gets emptied.
531 fbsd_hideous_sh_bug=$base_compile
533 if test "$pic_mode" != no; then
534 # All platforms use -DPIC, to notify preprocessed assembler code.
535 command="$base_compile $srcfile $pic_flag -DPIC"
537 # Don't build PIC code
538 command="$base_compile $srcfile"
540 if test "$build_old_libs" = yes; then
542 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
543 if test "X$dir" = "X$libobj"; then
548 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
550 if test -d "$dir"; then
557 if test $status -ne 0 && test ! -d $dir; then
562 if test "$compiler_o_lo" = yes; then
564 command="$command -o $output_obj"
565 elif test "$compiler_c_o" = yes; then
567 command="$command -o $output_obj"
570 $run $rm "$output_obj"
572 if $run eval "$command"; then :
574 test -n "$output_obj" && $run $rm $removelist
578 if test "$need_locks" = warn &&
579 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
581 *** ERROR, $lockfile contains:
582 `cat $lockfile 2>/dev/null`
584 but it should contain:
587 This indicates that another process is trying to use the same
588 temporary object file, and libtool could not work around it because
589 your compiler does not support \`-c' and \`-o' together. If you
590 repeat this compilation, it may succeed, by chance, but you had better
591 avoid parallel builds (make -j) in this platform, or get a better
598 # Just move the object if needed, then go on to compile the next one
599 if test x"$output_obj" != x"$libobj"; then
600 $show "$mv $output_obj $libobj"
601 if $run $mv $output_obj $libobj; then :
609 # If we have no pic_flag, then copy the object into place and finish.
610 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
611 test "$build_old_libs" = yes; then
612 # Rename the .lo from within objdir to obj
613 if test -f $obj; then
618 $show "$mv $libobj $obj"
619 if $run $mv $libobj $obj; then :
626 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
627 if test "X$xdir" = "X$obj"; then
632 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
633 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
634 # Now arrange that obj and lo_libobj become the same file
635 $show "(cd $xdir && $LN_S $baseobj $libobj)"
636 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
637 # Unlock the critical section if it was locked
638 if test "$need_locks" != no; then
649 # Allow error messages only from the first compilation.
650 suppress_output=' >/dev/null 2>&1'
653 # Only build a position-dependent object if we build old libraries.
654 if test "$build_old_libs" = yes; then
655 if test "$pic_mode" != yes; then
656 # Don't build PIC code
657 command="$base_compile $srcfile"
659 # All platforms use -DPIC, to notify preprocessed assembler code.
660 command="$base_compile $srcfile $pic_flag -DPIC"
662 if test "$compiler_c_o" = yes; then
663 command="$command -o $obj"
667 # Suppress compiler output if we already did a PIC compilation.
668 command="$command$suppress_output"
669 $run $rm "$output_obj"
671 if $run eval "$command"; then :
677 if test "$need_locks" = warn &&
678 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
680 *** ERROR, $lockfile contains:
681 `cat $lockfile 2>/dev/null`
683 but it should contain:
686 This indicates that another process is trying to use the same
687 temporary object file, and libtool could not work around it because
688 your compiler does not support \`-c' and \`-o' together. If you
689 repeat this compilation, it may succeed, by chance, but you had better
690 avoid parallel builds (make -j) in this platform, or get a better
697 # Just move the object if needed
698 if test x"$output_obj" != x"$obj"; then
699 $show "$mv $output_obj $obj"
700 if $run $mv $output_obj $obj; then :
708 # Create an invalid libtool object if no PIC, so that we do not
709 # accidentally link it into a program.
710 if test "$build_libtool_libs" != yes; then
711 $show "echo timestamp > $libobj"
712 $run eval "echo timestamp > \$libobj" || exit $?
714 # Move the .lo from within objdir
715 $show "$mv $libobj $lo_libobj"
716 if $run $mv $libobj $lo_libobj; then :
725 # Unlock the critical section if it was locked
726 if test "$need_locks" != no; then
735 modename="$modename: link"
737 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
738 # It is impossible to link a dll without this setting, and
739 # we shouldn't force the makefile maintainer to figure out
740 # which system we are compiling for in order to pass an extra
741 # flag for every libtool invokation.
744 # FIXME: Unfortunately, there are problems with the above when trying
745 # to make a dll which has undefined symbols, in which case not
746 # even a static library is built. For now, we need to specify
747 # -no-undefined on the libtool link line when we can be certain
748 # that all symbols are satisfied, otherwise we get a static library.
755 libtool_args="$nonopt"
756 compile_command="$nonopt"
757 finalize_command="$nonopt"
770 lib_search_path=`pwd`
778 export_symbols_regex=
785 prefer_static_libs=no
797 # We need to know -static, to get the right output filenames.
801 -all-static | -static)
802 if test "X$arg" = "X-all-static"; then
803 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
804 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
806 if test -n "$link_static_flag"; then
807 dlopen_self=$dlopen_self_static
810 if test -z "$pic_flag" && test -n "$link_static_flag"; then
811 dlopen_self=$dlopen_self_static
814 build_libtool_libs=no
816 prefer_static_libs=yes
822 # See if our shared archives depend on static archives.
823 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
825 # Go through the arguments, transforming them on the way.
826 while test $# -gt 0; do
830 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
831 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
835 libtool_args="$libtool_args $qarg"
837 # If the previous option needs an argument, assign it.
838 if test -n "$prev"; then
841 compile_command="$compile_command @OUTPUT@"
842 finalize_command="$finalize_command @OUTPUT@"
848 if test "$preload" = no; then
849 # Add the symbol object into the linking commands.
850 compile_command="$compile_command @SYMFILE@"
851 finalize_command="$finalize_command @SYMFILE@"
855 *.la | *.lo) ;; # We handle these cases below.
857 if test "$dlself" = no; then
865 if test "$prev" = dlprefiles; then
867 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
877 if test "$prev" = dlfiles; then
878 dlfiles="$dlfiles $arg"
880 dlprefiles="$dlprefiles $arg"
888 export_symbols="$arg"
889 if test ! -f "$arg"; then
890 $echo "$modename: symbol file \`$arg' does not exist"
897 export_symbols_regex="$arg"
907 # We need an absolute path.
909 [\\/]* | [A-Za-z]:[\\/]*) ;;
911 $echo "$modename: only absolute run-paths are allowed" 1>&2
915 if test "$prev" = rpath; then
918 *) rpath="$rpath $arg" ;;
923 *) xrpath="$xrpath $arg" ;;
930 compiler_flags="$compiler_flags $qarg"
932 compile_command="$compile_command $qarg"
933 finalize_command="$finalize_command $qarg"
937 linker_flags="$linker_flags $qarg"
938 compiler_flags="$compiler_flags $wl$qarg"
940 compile_command="$compile_command $wl$qarg"
941 finalize_command="$finalize_command $wl$qarg"
945 eval "$prev=\"\$arg\""
956 if test -n "$link_static_flag"; then
957 compile_command="$compile_command $link_static_flag"
958 finalize_command="$finalize_command $link_static_flag"
964 # FIXME: remove this flag sometime in the future.
965 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
989 -export-symbols | -export-symbols-regex)
990 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
991 $echo "$modename: more than one -exported-symbols argument is not allowed"
994 if test "X$arg" = "X-export-symbols"; then
1002 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1003 # so, if we see these flags be careful not to treat them like -L
1005 case $with_gcc/$host in
1006 no/*-*-irix* | no/*-*-nonstopux*)
1007 compile_command="$compile_command $arg"
1008 finalize_command="$finalize_command $arg"
1015 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1016 # We need an absolute path.
1018 [\\/]* | [A-Za-z]:[\\/]*) ;;
1020 absdir=`cd "$dir" && pwd`
1021 if test -z "$absdir"; then
1022 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1031 deplibs="$deplibs -L$dir"
1032 lib_search_path="$lib_search_path $dir"
1036 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1037 case :$dllsearchpath: in
1039 *) dllsearchpath="$dllsearchpath:$dir";;
1047 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1049 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1050 # These systems don't actually have a C or math library (as such)
1053 *-*-mingw* | *-*-os2*)
1054 # These systems don't actually have a C library (as such)
1055 test "X$arg" = "X-lc" && continue
1057 *-*-openbsd* | *-*-freebsd*)
1058 # Do not include libc due to us having libc/libc_r.
1059 test "X$arg" = "X-lc" && continue
1062 elif test "X$arg" = "X-lc_r"; then
1064 *-*-openbsd* | *-*-freebsd*)
1065 # Do not include libc_r directly, use -pthread flag.
1070 deplibs="$deplibs $arg"
1086 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1087 # The PATH hackery in wrapper scripts is required on Windows
1088 # in order for the loader to find any dlls it needs.
1089 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1090 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1093 *) no_install=yes ;;
1121 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1122 # We need an absolute path.
1124 [\\/]* | [A-Za-z]:[\\/]*) ;;
1126 $echo "$modename: only absolute run-paths are allowed" 1>&2
1132 *) xrpath="$xrpath $dir" ;;
1138 # The effects of -static are defined in a previous loop.
1139 # We used to do the same as -all-static on platforms that
1140 # didn't have a PIC flag, but the assumption that the effects
1141 # would be equivalent was wrong. It would break on at least
1142 # Digital Unix and AIX.
1157 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1159 save_ifs="$IFS"; IFS=','
1160 for flag in $args; do
1163 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1168 compiler_flags="$compiler_flags $flag"
1171 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1175 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1177 save_ifs="$IFS"; IFS=','
1178 for flag in $args; do
1181 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1186 compiler_flags="$compiler_flags $wl$flag"
1187 linker_flags="$linker_flags $flag"
1190 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1203 # Some other compiler flag.
1205 # Unknown arguments in both finalize_command and compile_command need
1206 # to be aesthetically quoted because they are evaled later.
1207 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1209 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1216 # A library or standard object.
1217 if test "$prev" = dlfiles; then
1218 # This file was specified with -dlopen.
1219 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1220 dlfiles="$dlfiles $arg"
1224 # If libtool objects are unsupported, then we need to preload.
1229 if test "$prev" = dlprefiles; then
1230 # Preload the old-style object.
1231 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1235 *.lo) libobjs="$libobjs $arg" ;;
1236 *) objs="$objs $arg" ;;
1243 deplibs="$deplibs $arg"
1244 old_deplibs="$old_deplibs $arg"
1249 # A libtool-controlled library.
1251 if test "$prev" = dlfiles; then
1252 # This library was specified with -dlopen.
1253 dlfiles="$dlfiles $arg"
1255 elif test "$prev" = dlprefiles; then
1256 # The library was specified with -dlpreopen.
1257 dlprefiles="$dlprefiles $arg"
1260 deplibs="$deplibs $arg"
1265 # Some other compiler argument.
1267 # Unknown arguments in both finalize_command and compile_command need
1268 # to be aesthetically quoted because they are evaled later.
1269 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1271 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1278 # Now actually substitute the argument into the commands.
1279 if test -n "$arg"; then
1280 compile_command="$compile_command $arg"
1281 finalize_command="$finalize_command $arg"
1283 done # argument parsing loop
1285 if test -n "$prev"; then
1286 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1291 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1292 eval arg=\"$export_dynamic_flag_spec\"
1293 compile_command="$compile_command $arg"
1294 finalize_command="$finalize_command $arg"
1297 # calculate the name of the file, without its directory
1298 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1299 libobjs_save="$libobjs"
1301 if test -n "$shlibpath_var"; then
1302 # get the directories listed in $shlibpath_var
1303 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1307 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1308 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1310 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1311 if test "X$output_objdir" = "X$output"; then
1312 output_objdir="$objdir"
1314 output_objdir="$output_objdir/$objdir"
1316 # Create the object directory.
1317 if test ! -d $output_objdir; then
1318 $show "$mkdir $output_objdir"
1319 $run $mkdir $output_objdir
1321 if test $status -ne 0 && test ! -d $output_objdir; then
1326 # Determine the type of output
1329 $echo "$modename: you must specify an output file" 1>&2
1333 *.$libext) linkmode=oldlib ;;
1334 *.lo | *.$objext) linkmode=obj ;;
1335 *.la) linkmode=lib ;;
1336 *) linkmode=prog ;; # Anything else should be a program.
1341 # Find all interdependent deplibs by searching for libraries
1342 # that are linked more than once (e.g. -la -lb -la)
1343 for deplib in $deplibs; do
1344 if test "X$duplicate_deps" = "Xyes" ; then
1346 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1349 libs="$libs $deplib"
1354 need_relink=no # whether we're linking any uninstalled libtool libraries
1355 notinst_deplibs= # not-installed libtool libraries
1356 notinst_path= # paths that contain not-installed libtool libraries
1360 for file in $dlfiles $dlprefiles; do
1364 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1376 passes="conv scan dlopen dlpreopen link"
1381 for pass in $passes; do
1382 if test $linkmode = prog; then
1383 # Determine which files to process
1387 save_deplibs="$deplibs" # Collect dlpreopened libraries
1390 dlpreopen) libs="$dlprefiles" ;;
1391 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1394 for deplib in $libs; do
1399 if test $linkmode = oldlib && test $linkmode = obj; then
1400 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1403 if test $pass = conv; then
1404 deplibs="$deplib $deplibs"
1407 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1408 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1409 # Search the libtool library
1410 lib="$searchdir/lib${name}.la"
1411 if test -f "$lib"; then
1416 if test "$found" != yes; then
1417 # deplib doesn't seem to be a libtool library
1418 if test "$linkmode,$pass" = "prog,link"; then
1419 compile_deplibs="$deplib $compile_deplibs"
1420 finalize_deplibs="$deplib $finalize_deplibs"
1422 deplibs="$deplib $deplibs"
1423 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1431 deplibs="$deplib $deplibs"
1432 test $pass = conv && continue
1433 newdependency_libs="$deplib $newdependency_libs"
1434 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1437 if test $pass = conv; then
1438 deplibs="$deplib $deplibs"
1441 if test $pass = scan; then
1442 deplibs="$deplib $deplibs"
1443 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1445 compile_deplibs="$deplib $compile_deplibs"
1446 finalize_deplibs="$deplib $finalize_deplibs"
1450 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1456 if test $pass = link; then
1457 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1458 # Make sure the xrpath contains only unique directories.
1461 *) xrpath="$xrpath $dir" ;;
1464 deplibs="$deplib $deplibs"
1467 *.la) lib="$deplib" ;;
1469 if test $pass = conv; then
1470 deplibs="$deplib $deplibs"
1475 if test "$deplibs_check_method" != pass_all; then
1477 echo "*** Warning: Trying to link with static lib archive $deplib."
1478 echo "*** I have the capability to make that library automatically link in when"
1479 echo "*** you link to this library. But I can only do this if you have a"
1480 echo "*** shared version of the library, which you do not appear to have"
1481 echo "*** because the file extensions .$libext of this argument makes me believe"
1482 echo "*** that it is just a static archive that I should not used here."
1485 echo "*** Warning: Linking the shared library $output against the"
1486 echo "*** static library $deplib is not portable!"
1487 deplibs="$deplib $deplibs"
1492 if test $pass != link; then
1493 deplibs="$deplib $deplibs"
1495 compile_deplibs="$deplib $compile_deplibs"
1496 finalize_deplibs="$deplib $finalize_deplibs"
1503 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1504 # If there is no dlopen support or we're linking statically,
1505 # we need to preload.
1506 newdlprefiles="$newdlprefiles $deplib"
1507 compile_deplibs="$deplib $compile_deplibs"
1508 finalize_deplibs="$deplib $finalize_deplibs"
1510 newdlfiles="$newdlfiles $deplib"
1519 if test $found = yes || test -f "$lib"; then :
1521 $echo "$modename: cannot find the library \`$lib'" 1>&2
1525 # Check to see that this really is a libtool archive.
1526 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1528 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1532 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1533 test "X$ladir" = "X$lib" && ladir="."
1541 # If the library was installed with an old release of libtool,
1542 # it will not redefine variable installed.
1547 */* | *\\*) . $lib ;;
1551 if test "$linkmode,$pass" = "lib,link" ||
1552 test "$linkmode,$pass" = "prog,scan" ||
1553 { test $linkmode = oldlib && test $linkmode = obj; }; then
1554 # Add dl[pre]opened files of deplib
1555 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1556 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1559 if test $pass = conv; then
1560 # Only check for convenience libraries
1561 deplibs="$lib $deplibs"
1562 if test -z "$libdir"; then
1563 if test -z "$old_library"; then
1564 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1567 # It is a libtool convenience library, so add in its objects.
1568 convenience="$convenience $ladir/$objdir/$old_library"
1569 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1571 for deplib in $dependency_libs; do
1572 deplibs="$deplib $deplibs"
1573 if test "X$duplicate_deps" = "Xyes" ; then
1574 case "$tmp_libs " in
1575 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1578 tmp_libs="$tmp_libs $deplib"
1580 elif test $linkmode != prog && test $linkmode != lib; then
1581 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1587 # Get the name of the library we link against.
1589 for l in $old_library $library_names; do
1592 if test -z "$linklib"; then
1593 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1597 # This library was specified with -dlopen.
1598 if test $pass = dlopen; then
1599 if test -z "$libdir"; then
1600 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1603 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1604 # If there is no dlname, no dlopen support or we're linking
1605 # statically, we need to preload.
1606 dlprefiles="$dlprefiles $lib"
1608 newdlfiles="$newdlfiles $lib"
1613 # We need an absolute path.
1615 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1617 abs_ladir=`cd "$ladir" && pwd`
1618 if test -z "$abs_ladir"; then
1619 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1620 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1625 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1627 # Find the relevant object directory and library name.
1628 if test "X$installed" = Xyes; then
1629 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1630 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1639 dir="$ladir/$objdir"
1640 absdir="$abs_ladir/$objdir"
1641 # Remove this search path later
1642 notinst_path="$notinst_path $abs_ladir"
1643 fi # $installed = yes
1644 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1646 # This library was specified with -dlpreopen.
1647 if test $pass = dlpreopen; then
1648 if test -z "$libdir"; then
1649 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1652 # Prefer using a static library (so that no silly _DYNAMIC symbols
1653 # are required to link).
1654 if test -n "$old_library"; then
1655 newdlprefiles="$newdlprefiles $dir/$old_library"
1656 # Otherwise, use the dlname, so that lt_dlopen finds it.
1657 elif test -n "$dlname"; then
1658 newdlprefiles="$newdlprefiles $dir/$dlname"
1660 newdlprefiles="$newdlprefiles $dir/$linklib"
1662 fi # $pass = dlpreopen
1664 if test -z "$libdir"; then
1665 # Link the convenience library
1666 if test $linkmode = lib; then
1667 deplibs="$dir/$old_library $deplibs"
1668 elif test "$linkmode,$pass" = "prog,link"; then
1669 compile_deplibs="$dir/$old_library $compile_deplibs"
1670 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1672 deplibs="$lib $deplibs"
1677 if test $linkmode = prog && test $pass != link; then
1678 newlib_search_path="$newlib_search_path $ladir"
1679 deplibs="$lib $deplibs"
1682 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1683 test "$build_libtool_libs" = no; then
1688 for deplib in $dependency_libs; do
1690 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1692 # Need to link against all dependency_libs?
1693 if test $linkalldeplibs = yes; then
1694 deplibs="$deplib $deplibs"
1696 # Need to hardcode shared library paths
1697 # or/and link against static libraries
1698 newdependency_libs="$deplib $newdependency_libs"
1700 if test "X$duplicate_deps" = "Xyes" ; then
1701 case "$tmp_libs " in
1702 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1705 tmp_libs="$tmp_libs $deplib"
1708 fi # $linkmode = prog...
1710 link_static=no # Whether the deplib will be linked statically
1711 if test -n "$library_names" &&
1712 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1713 # Link against this shared library
1715 if test "$linkmode,$pass" = "prog,link" ||
1716 { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1717 # Hardcode the library path.
1718 # Skip directories that are in the system default run-time
1720 case " $sys_lib_dlsearch_path " in
1723 case "$compile_rpath " in
1725 *) compile_rpath="$compile_rpath $absdir"
1729 case " $sys_lib_dlsearch_path " in
1732 case "$finalize_rpath " in
1734 *) finalize_rpath="$finalize_rpath $libdir"
1738 if test $linkmode = prog; then
1739 # We need to hardcode the library path
1740 if test -n "$shlibpath_var"; then
1741 # Make sure the rpath contains only unique directories.
1742 case "$temp_rpath " in
1745 *) temp_rpath="$temp_rpath $dir" ;;
1749 fi # $linkmode,$pass = prog,link...
1751 if test "$alldeplibs" = yes &&
1752 { test "$deplibs_check_method" = pass_all ||
1753 { test "$build_libtool_libs" = yes &&
1754 test -n "$library_names"; }; }; then
1755 # We only need to search for static libraries
1759 if test "$installed" = no; then
1760 notinst_deplibs="$notinst_deplibs $lib"
1764 if test -n "$old_archive_from_expsyms_cmds"; then
1765 # figure out the soname
1766 set dummy $library_names
1769 libname=`eval \\$echo \"$libname_spec\"`
1770 # use dlname if we got it. it's perfectly good, no?
1771 if test -n "$dlname"; then
1773 elif test -n "$soname_spec"; then
1777 major=`expr $current - $age`
1781 eval soname=\"$soname_spec\"
1786 # Make a new name for the extract_expsyms_cmds to use
1788 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
1789 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
1791 # If the library has no export list, then create one now
1792 if test -f "$output_objdir/$soname-def"; then :
1794 $show "extracting exported symbol list from \`$soname'"
1795 save_ifs="$IFS"; IFS='~'
1796 eval cmds=\"$extract_expsyms_cmds\"
1797 for cmd in $cmds; do
1800 $run eval "$cmd" || exit $?
1806 if test -f "$output_objdir/$newlib"; then :; else
1807 $show "generating import library for \`$soname'"
1808 save_ifs="$IFS"; IFS='~'
1809 eval cmds=\"$old_archive_from_expsyms_cmds\"
1810 for cmd in $cmds; do
1813 $run eval "$cmd" || exit $?
1817 # make sure the library variables are pointing to the new library
1820 fi # test -n $old_archive_from_expsyms_cmds
1822 if test $linkmode = prog || test "$mode" != relink; then
1827 case $hardcode_action in
1828 immediate | unsupported)
1829 if test "$hardcode_direct" = no; then
1831 elif test "$hardcode_minus_L" = no; then
1833 *-*-sunos*) add_shlibpath="$dir" ;;
1837 elif test "$hardcode_shlibpath_var" = no; then
1838 add_shlibpath="$dir"
1845 if test "$hardcode_direct" = yes; then
1847 elif test "$hardcode_minus_L" = yes; then
1850 elif test "$hardcode_shlibpath_var" = yes; then
1851 add_shlibpath="$dir"
1860 if test "$lib_linked" != yes; then
1861 $echo "$modename: configuration error: unsupported hardcode properties"
1865 if test -n "$add_shlibpath"; then
1866 case :$compile_shlibpath: in
1867 *":$add_shlibpath:"*) ;;
1868 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1871 if test $linkmode = prog; then
1872 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1873 test -n "$add" && compile_deplibs="$add $compile_deplibs"
1875 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1876 test -n "$add" && deplibs="$add $deplibs"
1877 if test "$hardcode_direct" != yes && \
1878 test "$hardcode_minus_L" != yes && \
1879 test "$hardcode_shlibpath_var" = yes; then
1880 case :$finalize_shlibpath: in
1882 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1888 if test $linkmode = prog || test "$mode" = relink; then
1892 # Finalize command for both is simple: just hardcode it.
1893 if test "$hardcode_direct" = yes; then
1894 add="$libdir/$linklib"
1895 elif test "$hardcode_minus_L" = yes; then
1898 elif test "$hardcode_shlibpath_var" = yes; then
1899 case :$finalize_shlibpath: in
1901 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1905 # We cannot seem to hardcode it, guess we'll fake it.
1910 if test $linkmode = prog; then
1911 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1912 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1914 test -n "$add_dir" && deplibs="$add_dir $deplibs"
1915 test -n "$add" && deplibs="$add $deplibs"
1918 elif test $linkmode = prog; then
1919 if test "$alldeplibs" = yes &&
1920 { test "$deplibs_check_method" = pass_all ||
1921 { test "$build_libtool_libs" = yes &&
1922 test -n "$library_names"; }; }; then
1923 # We only need to search for static libraries
1927 # Try to link the static library
1928 # Here we assume that one of hardcode_direct or hardcode_minus_L
1929 # is not unsupported. This is valid on all known static and
1931 if test "$hardcode_direct" != unsupported; then
1932 test -n "$old_library" && linklib="$old_library"
1933 compile_deplibs="$dir/$linklib $compile_deplibs"
1934 finalize_deplibs="$dir/$linklib $finalize_deplibs"
1936 compile_deplibs="-l$name -L$dir $compile_deplibs"
1937 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1939 elif test "$build_libtool_libs" = yes; then
1940 # Not a shared library
1941 if test "$deplibs_check_method" != pass_all; then
1942 # We're trying link a shared library against a static one
1943 # but the system doesn't support it.
1945 # Just print a warning and add the library to dependency_libs so
1946 # that the program can be linked against the static library.
1948 echo "*** Warning: This system can not link to static lib archive $lib."
1949 echo "*** I have the capability to make that library automatically link in when"
1950 echo "*** you link to this library. But I can only do this if you have a"
1951 echo "*** shared version of the library, which you do not appear to have."
1952 if test "$module" = yes; then
1953 echo "*** But as you try to build a module library, libtool will still create "
1954 echo "*** a static module, that should work as long as the dlopening application"
1955 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1956 if test -z "$global_symbol_pipe"; then
1958 echo "*** However, this would only work if libtool was able to extract symbol"
1959 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1960 echo "*** not find such a program. So, this module is probably useless."
1961 echo "*** \`nm' from GNU binutils and a full rebuild may help."
1963 if test "$build_old_libs" = no; then
1964 build_libtool_libs=module
1967 build_libtool_libs=no
1971 convenience="$convenience $dir/$old_library"
1972 old_convenience="$old_convenience $dir/$old_library"
1973 deplibs="$dir/$old_library $deplibs"
1976 fi # link shared/static library?
1978 if test $linkmode = lib; then
1979 if test -n "$dependency_libs" &&
1980 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
1981 test $link_static = yes; }; then
1982 # Extract -R from dependency_libs
1984 for libdir in $dependency_libs; do
1986 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1988 *" $temp_xrpath "*) ;;
1989 *) xrpath="$xrpath $temp_xrpath";;
1991 *) temp_deplibs="$temp_deplibs $libdir";;
1994 dependency_libs="$temp_deplibs"
1997 newlib_search_path="$newlib_search_path $absdir"
1998 # Link against this library
1999 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2000 # ... and its dependency_libs
2002 for deplib in $dependency_libs; do
2003 newdependency_libs="$deplib $newdependency_libs"
2004 if test "X$duplicate_deps" = "Xyes" ; then
2005 case "$tmp_libs " in
2006 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2009 tmp_libs="$tmp_libs $deplib"
2012 if test $link_all_deplibs != no; then
2013 # Add the search paths of all dependency libraries
2014 for deplib in $dependency_libs; do
2016 -L*) path="$deplib" ;;
2018 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2019 test "X$dir" = "X$deplib" && dir="."
2020 # We need an absolute path.
2022 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2024 absdir=`cd "$dir" && pwd`
2025 if test -z "$absdir"; then
2026 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2031 if grep "^installed=no" $deplib > /dev/null; then
2032 path="-L$absdir/$objdir"
2034 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2035 if test -z "$libdir"; then
2036 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2039 if test "$absdir" != "$libdir"; then
2040 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2047 case " $deplibs " in
2049 *) deplibs="$deplibs $path" ;;
2052 fi # link_all_deplibs != no
2054 done # for deplib in $libs
2055 if test $pass = dlpreopen; then
2056 # Link the dlpreopened libraries before other libraries
2057 for deplib in $save_deplibs; do
2058 deplibs="$deplib $deplibs"
2061 if test $pass != dlopen; then
2062 test $pass != scan && dependency_libs="$newdependency_libs"
2063 if test $pass != conv; then
2064 # Make sure lib_search_path contains only unique directories.
2066 for dir in $newlib_search_path; do
2067 case "$lib_search_path " in
2069 *) lib_search_path="$lib_search_path $dir" ;;
2075 if test "$linkmode,$pass" != "prog,link"; then
2078 vars="compile_deplibs finalize_deplibs"
2080 for var in $vars dependency_libs; do
2081 # Add libraries to $var in reverse order
2082 eval tmp_libs=\"\$$var\"
2084 for deplib in $tmp_libs; do
2086 -L*) new_libs="$deplib $new_libs" ;;
2088 case " $specialdeplibs " in
2089 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2091 case " $new_libs " in
2093 *) new_libs="$deplib $new_libs" ;;
2101 for deplib in $new_libs; do
2104 case " $tmp_libs " in
2106 *) tmp_libs="$tmp_libs $deplib" ;;
2109 *) tmp_libs="$tmp_libs $deplib" ;;
2112 eval $var=\"$tmp_libs\"
2115 if test "$pass" = "conv" &&
2116 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2117 libs="$deplibs" # reset libs
2121 if test $linkmode = prog; then
2122 dlfiles="$newdlfiles"
2123 dlprefiles="$newdlprefiles"
2128 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2129 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2132 if test -n "$rpath"; then
2133 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2136 if test -n "$xrpath"; then
2137 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2140 if test -n "$vinfo"; then
2141 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2144 if test -n "$release"; then
2145 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2148 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2149 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2152 # Now set the variables for building old libraries.
2153 build_libtool_libs=no
2155 objs="$objs$old_deplibs"
2159 # Make sure we only generate libraries of the form `libNAME.la'.
2162 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2163 eval libname=\"$libname_spec\"
2166 if test "$module" = no; then
2167 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2171 if test "$need_lib_prefix" != no; then
2172 # Add the "lib" prefix for modules if required
2173 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2174 eval libname=\"$libname_spec\"
2176 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2181 if test -n "$objs"; then
2182 if test "$deplibs_check_method" != pass_all; then
2183 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2187 echo "*** Warning: Linking the shared library $output against the non-libtool"
2188 echo "*** objects $objs is not portable!"
2189 libobjs="$libobjs $objs"
2193 if test "$dlself" != no; then
2194 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2198 if test $# -gt 2; then
2199 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2204 if test -z "$rpath"; then
2205 if test "$build_libtool_libs" = yes; then
2206 # Building a libtool convenience library.
2208 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2209 build_libtool_libs=convenience
2213 if test -n "$vinfo"; then
2214 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2217 if test -n "$release"; then
2218 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2222 # Parse the version information argument.
2223 save_ifs="$IFS"; IFS=':'
2224 set dummy $vinfo 0 0 0
2227 if test -n "$8"; then
2228 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2237 # Check that each of the things are valid numbers.
2239 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2241 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2242 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2248 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2250 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2251 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2257 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2259 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2260 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2265 if test $age -gt $current; then
2266 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2267 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2271 # Calculate the version variables.
2275 case $version_type in
2279 # Like Linux, but with the current version available in
2280 # verstring for coding it into the library header
2281 major=.`expr $current - $age`
2282 versuffix="$major.$age.$revision"
2283 # Darwin ld doesn't like 0 for these options...
2284 minor_current=`expr $current + 1`
2285 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2290 versuffix=".$current.$revision";
2295 versuffix=".$current";
2299 major=`expr $current - $age + 1`
2301 case $version_type in
2302 nonstopux) verstring_prefix=nonstopux ;;
2303 *) verstring_prefix=sgi ;;
2305 verstring="$verstring_prefix$major.$revision"
2307 # Add in all the interfaces that we are compatible with.
2309 while test $loop != 0; do
2310 iface=`expr $revision - $loop`
2311 loop=`expr $loop - 1`
2312 verstring="$verstring_prefix$major.$iface:$verstring"
2315 # Before this point, $major must not contain `.'.
2317 versuffix="$major.$revision"
2321 major=.`expr $current - $age`
2322 versuffix="$major.$age.$revision"
2326 major=`expr $current - $age`
2327 versuffix=".$current.$age.$revision"
2328 verstring="$current.$age.$revision"
2330 # Add in all the interfaces that we are compatible with.
2332 while test $loop != 0; do
2333 iface=`expr $current - $loop`
2334 loop=`expr $loop - 1`
2335 verstring="$verstring:${iface}.0"
2338 # Make executables depend on our current version.
2339 verstring="$verstring:${current}.0"
2344 versuffix=".$current.$revision"
2348 # Use '-' rather than '.', since we only want one
2349 # extension on DOS 8.3 filesystems.
2350 major=`expr $current - $age`
2355 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2356 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2361 # Clear the version info if we defaulted, and they specified a release.
2362 if test -z "$vinfo" && test -n "$release"; then
2365 case $version_type in
2367 # we can't check for "0.0" in archive_cmds due to quoting
2368 # problems, so we reset it completely
2375 if test "$need_version" = no; then
2382 # Remove version info from name if versioning should be avoided
2383 if test "$avoid_version" = yes && test "$need_version" = no; then
2389 # Check to see if the archive will have undefined symbols.
2390 if test "$allow_undefined" = yes; then
2391 if test "$allow_undefined_flag" = unsupported; then
2392 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2393 build_libtool_libs=no
2397 # Don't allow undefined symbols.
2398 allow_undefined_flag="$no_undefined_flag"
2402 if test "$mode" != relink; then
2403 # Remove our outputs.
2404 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2405 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2408 # Now set the variables for building old libraries.
2409 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2410 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2412 # Transform .lo files to .o files.
2413 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2416 # Eliminate all temporary directories.
2417 for path in $notinst_path; do
2418 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2419 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2420 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2423 if test -n "$xrpath"; then
2424 # If the user specified any rpath flags, then add them.
2426 for libdir in $xrpath; do
2427 temp_xrpath="$temp_xrpath -R$libdir"
2428 case "$finalize_rpath " in
2430 *) finalize_rpath="$finalize_rpath $libdir" ;;
2433 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2434 dependency_libs="$temp_xrpath $dependency_libs"
2438 # Make sure dlfiles contains only unique files that won't be dlpreopened
2439 old_dlfiles="$dlfiles"
2441 for lib in $old_dlfiles; do
2442 case " $dlprefiles $dlfiles " in
2444 *) dlfiles="$dlfiles $lib" ;;
2448 # Make sure dlprefiles contains only unique files
2449 old_dlprefiles="$dlprefiles"
2451 for lib in $old_dlprefiles; do
2452 case "$dlprefiles " in
2454 *) dlprefiles="$dlprefiles $lib" ;;
2458 if test "$build_libtool_libs" = yes; then
2459 if test -n "$rpath"; then
2461 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2462 # these systems don't actually have a c library (as such)!
2464 *-*-rhapsody* | *-*-darwin1.[012])
2465 # Rhapsody C library is in the System framework
2466 deplibs="$deplibs -framework System"
2469 # Don't link with libc until the a.out ld.so is fixed.
2471 *-*-openbsd* | *-*-freebsd*)
2472 # Do not include libc due to us having libc/libc_r.
2475 # Add libc to deplibs on all other systems if necessary.
2476 if test $build_libtool_need_lc = "yes"; then
2477 deplibs="$deplibs -lc"
2483 # Transform deplibs into only deplibs that can be linked in shared.
2485 libname_save=$libname
2486 release_save=$release
2487 versuffix_save=$versuffix
2489 # I'm not sure if I'm treating the release correctly. I think
2490 # release should show up in the -l (ie -lgmp5) so we don't want to
2491 # add it in twice. Is that correct?
2497 case $deplibs_check_method in
2499 # Don't check for shared/static. Everything works.
2500 # This might be a little naive. We might want to check
2501 # whether the library exists or not. But this is on
2502 # osf3 & osf4 and I'm not really sure... Just
2503 # implementing what was already the behaviour.
2507 # This code stresses the "libraries are programs" paradigm to its
2508 # limits. Maybe even breaks it. We compile a program, linking it
2509 # against the deplibs as a proxy for the library. Then we can check
2510 # whether they linked in statically or dynamically with ldd.
2512 cat > conftest.c <<EOF
2513 int main() { return 0; }
2516 $CC -o conftest conftest.c $deplibs
2517 if test $? -eq 0 ; then
2518 ldd_output=`ldd conftest`
2519 for i in $deplibs; do
2520 name="`expr $i : '-l\(.*\)'`"
2521 # If $name is empty we are operating on a -L argument.
2522 if test -n "$name" && test "$name" != "0"; then
2523 libname=`eval \\$echo \"$libname_spec\"`
2524 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2525 set dummy $deplib_matches
2527 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2528 newdeplibs="$newdeplibs $i"
2532 echo "*** Warning: dynamic linker does not accept needed library $i."
2533 echo "*** I have the capability to make that library automatically link in when"
2534 echo "*** you link to this library. But I can only do this if you have a"
2535 echo "*** shared version of the library, which I believe you do not have"
2536 echo "*** because a test_compile did reveal that the linker did not use it for"
2537 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2540 newdeplibs="$newdeplibs $i"
2544 # Error occured in the first compile. Let's try to salvage
2545 # the situation: Compile a separate program for each library.
2546 for i in $deplibs; do
2547 name="`expr $i : '-l\(.*\)'`"
2548 # If $name is empty we are operating on a -L argument.
2549 if test -n "$name" && test "$name" != "0"; then
2551 $CC -o conftest conftest.c $i
2553 if test $? -eq 0 ; then
2554 ldd_output=`ldd conftest`
2555 libname=`eval \\$echo \"$libname_spec\"`
2556 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2557 set dummy $deplib_matches
2559 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2560 newdeplibs="$newdeplibs $i"
2564 echo "*** Warning: dynamic linker does not accept needed library $i."
2565 echo "*** I have the capability to make that library automatically link in when"
2566 echo "*** you link to this library. But I can only do this if you have a"
2567 echo "*** shared version of the library, which you do not appear to have"
2568 echo "*** because a test_compile did reveal that the linker did not use this one"
2569 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2574 echo "*** Warning! Library $i is needed by this library but I was not able to"
2575 echo "*** make it link in! You will probably need to install it or some"
2576 echo "*** library that it depends on before this library will be fully"
2577 echo "*** functional. Installing it before continuing would be even better."
2580 newdeplibs="$newdeplibs $i"
2586 set dummy $deplibs_check_method
2587 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2588 for a_deplib in $deplibs; do
2589 name="`expr $a_deplib : '-l\(.*\)'`"
2590 # If $name is empty we are operating on a -L argument.
2591 if test -n "$name" && test "$name" != "0"; then
2592 libname=`eval \\$echo \"$libname_spec\"`
2593 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2594 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2595 for potent_lib in $potential_libs; do
2596 # Follow soft links.
2597 if ls -lLd "$potent_lib" 2>/dev/null \
2598 | grep " -> " >/dev/null; then
2601 # The statement above tries to avoid entering an
2602 # endless loop below, in case of cyclic links.
2603 # We might still enter an endless loop, since a link
2604 # loop can be closed while we follow links,
2606 potlib="$potent_lib"
2607 while test -h "$potlib" 2>/dev/null; do
2608 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2610 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2611 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2614 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2616 | egrep "$file_magic_regex" > /dev/null; then
2617 newdeplibs="$newdeplibs $a_deplib"
2623 if test -n "$a_deplib" ; then
2626 echo "*** Warning: linker path does not have real file for library $a_deplib."
2627 echo "*** I have the capability to make that library automatically link in when"
2628 echo "*** you link to this library. But I can only do this if you have a"
2629 echo "*** shared version of the library, which you do not appear to have"
2630 echo "*** because I did check the linker path looking for a file starting"
2631 if test -z "$potlib" ; then
2632 echo "*** with $libname but no candidates were found. (...for file magic test)"
2634 echo "*** with $libname and none of the candidates passed a file format test"
2635 echo "*** using a file magic. Last file checked: $potlib"
2639 # Add a -L argument.
2640 newdeplibs="$newdeplibs $a_deplib"
2642 done # Gone through all deplibs.
2645 set dummy $deplibs_check_method
2646 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2647 for a_deplib in $deplibs; do
2648 name="`expr $a_deplib : '-l\(.*\)'`"
2649 # If $name is empty we are operating on a -L argument.
2650 if test -n "$name" && test "$name" != "0"; then
2651 libname=`eval \\$echo \"$libname_spec\"`
2652 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2653 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2654 for potent_lib in $potential_libs; do
2655 potlib="$potent_lib" # see symlink-check below in file_magic test
2656 if eval echo \"$potent_lib\" 2>/dev/null \
2658 | egrep "$match_pattern_regex" > /dev/null; then
2659 newdeplibs="$newdeplibs $a_deplib"
2665 if test -n "$a_deplib" ; then
2668 echo "*** Warning: linker path does not have real file for library $a_deplib."
2669 echo "*** I have the capability to make that library automatically link in when"
2670 echo "*** you link to this library. But I can only do this if you have a"
2671 echo "*** shared version of the library, which you do not appear to have"
2672 echo "*** because I did check the linker path looking for a file starting"
2673 if test -z "$potlib" ; then
2674 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2676 echo "*** with $libname and none of the candidates passed a file format test"
2677 echo "*** using a regex pattern. Last file checked: $potlib"
2681 # Add a -L argument.
2682 newdeplibs="$newdeplibs $a_deplib"
2684 done # Gone through all deplibs.
2688 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2689 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2690 grep . >/dev/null; then
2692 if test "X$deplibs_check_method" = "Xnone"; then
2693 echo "*** Warning: inter-library dependencies are not supported in this platform."
2695 echo "*** Warning: inter-library dependencies are not known to be supported."
2697 echo "*** All declared inter-library dependencies are being dropped."
2702 versuffix=$versuffix_save
2704 release=$release_save
2705 libname=$libname_save
2709 *-*-rhapsody* | *-*-darwin1.[012])
2710 # On Rhapsody replace the C library is the System framework
2711 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2715 if test "$droppeddeps" = yes; then
2716 if test "$module" = yes; then
2718 echo "*** Warning: libtool could not satisfy all declared inter-library"
2719 echo "*** dependencies of module $libname. Therefore, libtool will create"
2720 echo "*** a static module, that should work as long as the dlopening"
2721 echo "*** application is linked with the -dlopen flag."
2722 if test -z "$global_symbol_pipe"; then
2724 echo "*** However, this would only work if libtool was able to extract symbol"
2725 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2726 echo "*** not find such a program. So, this module is probably useless."
2727 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2729 if test "$build_old_libs" = no; then
2730 oldlibs="$output_objdir/$libname.$libext"
2731 build_libtool_libs=module
2734 build_libtool_libs=no
2737 echo "*** The inter-library dependencies that have been dropped here will be"
2738 echo "*** automatically added whenever a program is linked with this library"
2739 echo "*** or is declared to -dlopen it."
2741 if test $allow_undefined = no; then
2743 echo "*** Since this library must not contain undefined symbols,"
2744 echo "*** because either the platform does not support them or"
2745 echo "*** it was explicitly requested with -no-undefined,"
2746 echo "*** libtool will only create a static version of it."
2747 if test "$build_old_libs" = no; then
2748 oldlibs="$output_objdir/$libname.$libext"
2749 build_libtool_libs=module
2752 build_libtool_libs=no
2757 # Done checking deplibs!
2761 # All the library-specific variables (install_libdir is set above).
2766 # Test again, we may have decided not to build it any more
2767 if test "$build_libtool_libs" = yes; then
2768 if test $hardcode_into_libs = yes; then
2769 # Hardcode the library paths
2772 rpath="$finalize_rpath"
2773 test "$mode" != relink && rpath="$compile_rpath$rpath"
2774 for libdir in $rpath; do
2775 if test -n "$hardcode_libdir_flag_spec"; then
2776 if test -n "$hardcode_libdir_separator"; then
2777 if test -z "$hardcode_libdirs"; then
2778 hardcode_libdirs="$libdir"
2780 # Just accumulate the unique libdirs.
2781 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2782 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2785 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2790 eval flag=\"$hardcode_libdir_flag_spec\"
2791 dep_rpath="$dep_rpath $flag"
2793 elif test -n "$runpath_var"; then
2794 case "$perm_rpath " in
2796 *) perm_rpath="$perm_rpath $libdir" ;;
2800 # Substitute the hardcoded libdirs into the rpath.
2801 if test -n "$hardcode_libdir_separator" &&
2802 test -n "$hardcode_libdirs"; then
2803 libdir="$hardcode_libdirs"
2804 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2806 if test -n "$runpath_var" && test -n "$perm_rpath"; then
2807 # We should set the runpath_var.
2809 for dir in $perm_rpath; do
2812 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2814 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2817 shlibpath="$finalize_shlibpath"
2818 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2819 if test -n "$shlibpath"; then
2820 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2823 # Get the real and link names of the library.
2824 eval library_names=\"$library_names_spec\"
2825 set dummy $library_names
2829 if test -n "$soname_spec"; then
2830 eval soname=\"$soname_spec\"
2834 test -z "$dlname" && dlname=$soname
2836 lib="$output_objdir/$realname"
2839 linknames="$linknames $link"
2842 # Ensure that we have .o objects for linkers which dislike .lo
2843 # (e.g. aix) in case we are running --disable-static
2844 for obj in $libobjs; do
2845 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2846 if test "X$xdir" = "X$obj"; then
2851 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2852 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2853 if test ! -f $xdir/$oldobj; then
2854 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2855 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2859 # Use standard objects if they are pic
2860 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2862 # Prepare the list of exported symbols
2863 if test -z "$export_symbols"; then
2864 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2865 $show "generating symbol list for \`$libname.la'"
2866 export_symbols="$output_objdir/$libname.exp"
2867 $run $rm $export_symbols
2868 eval cmds=\"$export_symbols_cmds\"
2869 save_ifs="$IFS"; IFS='~'
2870 for cmd in $cmds; do
2873 $run eval "$cmd" || exit $?
2876 if test -n "$export_symbols_regex"; then
2877 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2878 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2879 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2880 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2885 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2886 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2889 if test -n "$convenience"; then
2890 if test -n "$whole_archive_flag_spec"; then
2891 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2893 gentop="$output_objdir/${outputname}x"
2894 $show "${rm}r $gentop"
2895 $run ${rm}r "$gentop"
2896 $show "mkdir $gentop"
2897 $run mkdir "$gentop"
2899 if test $status -ne 0 && test ! -d "$gentop"; then
2902 generated="$generated $gentop"
2904 for xlib in $convenience; do
2905 # Extract the objects.
2907 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2908 *) xabs=`pwd`"/$xlib" ;;
2910 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2911 xdir="$gentop/$xlib"
2913 $show "${rm}r $xdir"
2918 if test $status -ne 0 && test ! -d "$xdir"; then
2921 $show "(cd $xdir && $AR x $xabs)"
2922 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2924 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2929 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2930 eval flag=\"$thread_safe_flag_spec\"
2931 linker_flags="$linker_flags $flag"
2934 # Make a backup of the uninstalled library when relinking
2935 if test "$mode" = relink; then
2936 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2939 # Do each of the archive commands.
2940 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2941 eval cmds=\"$archive_expsym_cmds\"
2943 save_deplibs="$deplibs"
2944 for conv in $convenience; do
2946 for test_deplib in $deplibs; do
2947 if test "$test_deplib" != "$conv"; then
2948 tmp_deplibs="$tmp_deplibs $test_deplib"
2951 deplibs="$tmp_deplibs"
2953 eval cmds=\"$archive_cmds\"
2954 deplibs="$save_deplibs"
2956 save_ifs="$IFS"; IFS='~'
2957 for cmd in $cmds; do
2960 $run eval "$cmd" || exit $?
2964 # Restore the uninstalled library and exit
2965 if test "$mode" = relink; then
2966 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2970 # Create links to the real library.
2971 for linkname in $linknames; do
2972 if test "$realname" != "$linkname"; then
2973 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2974 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2978 # If -module or -export-dynamic was specified, set the dlname.
2979 if test "$module" = yes || test "$export_dynamic" = yes; then
2980 # On all known operating systems, these are identical.
2987 if test -n "$deplibs"; then
2988 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2991 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2992 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2995 if test -n "$rpath"; then
2996 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2999 if test -n "$xrpath"; then
3000 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3003 if test -n "$vinfo"; then
3004 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3007 if test -n "$release"; then
3008 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3013 if test -n "$objs$old_deplibs"; then
3014 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3018 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3026 # Delete the old objects.
3027 $run $rm $obj $libobj
3029 # Objects from convenience libraries. This assumes
3030 # single-version convenience libraries. Whenever we create
3031 # different ones for PIC/non-PIC, this we'll have to duplicate
3035 # reload_cmds runs $LD directly, so let us get rid of
3036 # -Wl from whole_archive_flag_spec
3039 if test -n "$convenience"; then
3040 if test -n "$whole_archive_flag_spec"; then
3041 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3043 gentop="$output_objdir/${obj}x"
3044 $show "${rm}r $gentop"
3045 $run ${rm}r "$gentop"
3046 $show "mkdir $gentop"
3047 $run mkdir "$gentop"
3049 if test $status -ne 0 && test ! -d "$gentop"; then
3052 generated="$generated $gentop"
3054 for xlib in $convenience; do
3055 # Extract the objects.
3057 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3058 *) xabs=`pwd`"/$xlib" ;;
3060 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3061 xdir="$gentop/$xlib"
3063 $show "${rm}r $xdir"
3068 if test $status -ne 0 && test ! -d "$xdir"; then
3071 $show "(cd $xdir && $AR x $xabs)"
3072 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3074 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3079 # Create the old-style object.
3080 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
3083 eval cmds=\"$reload_cmds\"
3084 save_ifs="$IFS"; IFS='~'
3085 for cmd in $cmds; do
3088 $run eval "$cmd" || exit $?
3092 # Exit if we aren't doing a library object file.
3093 if test -z "$libobj"; then
3094 if test -n "$gentop"; then
3095 $show "${rm}r $gentop"
3102 if test "$build_libtool_libs" != yes; then
3103 if test -n "$gentop"; then
3104 $show "${rm}r $gentop"
3108 # Create an invalid libtool object if no PIC, so that we don't
3109 # accidentally link it into a program.
3110 $show "echo timestamp > $libobj"
3111 $run eval "echo timestamp > $libobj" || exit $?
3115 if test -n "$pic_flag" || test "$pic_mode" != default; then
3116 # Only do commands if we really have different PIC objects.
3117 reload_objs="$libobjs $reload_conv_objs"
3119 eval cmds=\"$reload_cmds\"
3120 save_ifs="$IFS"; IFS='~'
3121 for cmd in $cmds; do
3124 $run eval "$cmd" || exit $?
3128 # Just create a symlink.
3131 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3132 if test "X$xdir" = "X$libobj"; then
3137 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3138 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3139 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3140 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3143 if test -n "$gentop"; then
3144 $show "${rm}r $gentop"
3153 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3155 if test -n "$vinfo"; then
3156 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3159 if test -n "$release"; then
3160 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3163 if test "$preload" = yes; then
3164 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3165 test "$dlopen_self_static" = unknown; then
3166 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3171 *-*-rhapsody* | *-*-darwin1.[012])
3172 # On Rhapsody replace the C library is the System framework
3173 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3174 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3178 compile_command="$compile_command $compile_deplibs"
3179 finalize_command="$finalize_command $finalize_deplibs"
3181 if test -n "$rpath$xrpath"; then
3182 # If the user specified any rpath flags, then add them.
3183 for libdir in $rpath $xrpath; do
3184 # This is the magic to use -rpath.
3185 case "$finalize_rpath " in
3187 *) finalize_rpath="$finalize_rpath $libdir" ;;
3192 # Now hardcode the library paths
3195 for libdir in $compile_rpath $finalize_rpath; do
3196 if test -n "$hardcode_libdir_flag_spec"; then
3197 if test -n "$hardcode_libdir_separator"; then
3198 if test -z "$hardcode_libdirs"; then
3199 hardcode_libdirs="$libdir"
3201 # Just accumulate the unique libdirs.
3202 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3203 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3206 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3211 eval flag=\"$hardcode_libdir_flag_spec\"
3212 rpath="$rpath $flag"
3214 elif test -n "$runpath_var"; then
3215 case "$perm_rpath " in
3217 *) perm_rpath="$perm_rpath $libdir" ;;
3221 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3222 case :$dllsearchpath: in
3224 *) dllsearchpath="$dllsearchpath:$libdir";;
3229 # Substitute the hardcoded libdirs into the rpath.
3230 if test -n "$hardcode_libdir_separator" &&
3231 test -n "$hardcode_libdirs"; then
3232 libdir="$hardcode_libdirs"
3233 eval rpath=\" $hardcode_libdir_flag_spec\"
3235 compile_rpath="$rpath"
3239 for libdir in $finalize_rpath; do
3240 if test -n "$hardcode_libdir_flag_spec"; then
3241 if test -n "$hardcode_libdir_separator"; then
3242 if test -z "$hardcode_libdirs"; then
3243 hardcode_libdirs="$libdir"
3245 # Just accumulate the unique libdirs.
3246 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3247 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3250 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3255 eval flag=\"$hardcode_libdir_flag_spec\"
3256 rpath="$rpath $flag"
3258 elif test -n "$runpath_var"; then
3259 case "$finalize_perm_rpath " in
3261 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3265 # Substitute the hardcoded libdirs into the rpath.
3266 if test -n "$hardcode_libdir_separator" &&
3267 test -n "$hardcode_libdirs"; then
3268 libdir="$hardcode_libdirs"
3269 eval rpath=\" $hardcode_libdir_flag_spec\"
3271 finalize_rpath="$rpath"
3273 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3274 # Transform all the library objects into standard objects.
3275 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3276 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3280 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3281 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3282 dlsyms="${outputname}S.c"
3284 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3288 if test -n "$dlsyms"; then
3292 # Discover the nlist of each of the dlfiles.
3293 nlist="$output_objdir/${outputname}.nm"
3295 $show "$rm $nlist ${nlist}S ${nlist}T"
3296 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3298 # Parse the name list into a source file.
3299 $show "creating $output_objdir/$dlsyms"
3301 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3302 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3303 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3309 /* Prevent the only kind of declaration conflicts we can make. */
3310 #define lt_preloaded_symbols some_other_symbol
3312 /* External symbol declarations for the compiler. */\
3315 if test "$dlself" = yes; then
3316 $show "generating symbol list for \`$output'"
3318 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3320 # Add our own program objects to the symbol list.
3321 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3322 for arg in $progfiles; do
3323 $show "extracting global C symbols from \`$arg'"
3324 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3327 if test -n "$exclude_expsyms"; then
3328 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3329 $run eval '$mv "$nlist"T "$nlist"'
3332 if test -n "$export_symbols_regex"; then
3333 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3334 $run eval '$mv "$nlist"T "$nlist"'
3337 # Prepare the list of exported symbols
3338 if test -z "$export_symbols"; then
3339 export_symbols="$output_objdir/$output.exp"
3340 $run $rm $export_symbols
3341 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3343 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3344 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3345 $run eval 'mv "$nlist"T "$nlist"'
3349 for arg in $dlprefiles; do
3350 $show "extracting global C symbols from \`$arg'"
3351 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3352 $run eval 'echo ": $name " >> "$nlist"'
3353 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3356 if test -z "$run"; then
3357 # Make sure we have at least an empty file.
3358 test -f "$nlist" || : > "$nlist"
3360 if test -n "$exclude_expsyms"; then
3361 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3362 $mv "$nlist"T "$nlist"
3365 # Try sorting and uniquifying the output.
3366 if grep -v "^: " < "$nlist" |
3367 if sort -k 3 </dev/null >/dev/null 2>&1; then
3372 uniq > "$nlist"S; then
3375 grep -v "^: " < "$nlist" > "$nlist"S
3378 if test -f "$nlist"S; then
3379 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3381 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3384 $echo >> "$output_objdir/$dlsyms" "\
3386 #undef lt_preloaded_symbols
3388 #if defined (__STDC__) && __STDC__
3389 # define lt_ptr void *
3391 # define lt_ptr char *
3395 /* The mapping between symbol names and symbols. */
3400 lt_preloaded_symbols[] =
3404 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3406 $echo >> "$output_objdir/$dlsyms" "\
3410 /* This works around a problem in FreeBSD linker */
3411 #ifdef FREEBSD_WORKAROUND
3412 static const void *lt_preloaded_setup() {
3413 return lt_preloaded_symbols;
3423 pic_flag_for_symtable=
3425 # compiling the symbol table file with pic_flag works around
3426 # a FreeBSD bug that causes programs to crash when -lm is
3427 # linked before any other PIC object. But we must not use
3428 # pic_flag when linking with -static. The problem exists in
3429 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3430 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3431 case "$compile_command " in
3433 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3436 case "$compile_command " in
3438 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3442 # Now compile the dynamic symbol file.
3443 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3444 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3446 # Clean up the generated files.
3447 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3448 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3450 # Transform the symbol file into the correct name.
3451 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3452 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3455 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3460 # We keep going just in case the user didn't refer to
3461 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3462 # really was required.
3464 # Nullify the symbol file.
3465 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3466 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3469 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3470 # Replace the output file specification.
3471 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3472 link_command="$compile_command$compile_rpath"
3474 # We have no uninstalled library dependencies, so finalize right now.
3475 $show "$link_command"
3476 $run eval "$link_command"
3479 # Delete the generated files.
3480 if test -n "$dlsyms"; then
3481 $show "$rm $output_objdir/${outputname}S.${objext}"
3482 $run $rm "$output_objdir/${outputname}S.${objext}"
3488 if test -n "$shlibpath_var"; then
3489 # We should set the shlibpath_var
3491 for dir in $temp_rpath; do
3493 [\\/]* | [A-Za-z]:[\\/]*)
3498 # Relative path: add a thisdir entry.
3499 rpath="$rpath\$thisdir/$dir:"
3506 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3507 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3509 if test -n "$finalize_shlibpath"; then
3510 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3515 if test -n "$runpath_var"; then
3516 if test -n "$perm_rpath"; then
3517 # We should set the runpath_var.
3519 for dir in $perm_rpath; do
3522 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3524 if test -n "$finalize_perm_rpath"; then
3525 # We should set the runpath_var.
3527 for dir in $finalize_perm_rpath; do
3530 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3534 if test "$no_install" = yes; then
3535 # We don't need to create a wrapper script.
3536 link_command="$compile_var$compile_command$compile_rpath"
3537 # Replace the output file specification.
3538 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3539 # Delete the old output file.
3541 # Link the executable and exit
3542 $show "$link_command"
3543 $run eval "$link_command" || exit $?
3547 if test "$hardcode_action" = relink; then
3548 # Fast installation is not supported
3549 link_command="$compile_var$compile_command$compile_rpath"
3550 relink_command="$finalize_var$finalize_command$finalize_rpath"
3552 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3553 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3555 if test "$fast_install" != no; then
3556 link_command="$finalize_var$compile_command$finalize_rpath"
3557 if test "$fast_install" = yes; then
3558 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3560 # fast_install is set to needless
3564 link_command="$compile_var$compile_command$compile_rpath"
3565 relink_command="$finalize_var$finalize_command$finalize_rpath"
3569 # Replace the output file specification.
3570 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3572 # Delete the old output files.
3573 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3575 $show "$link_command"
3576 $run eval "$link_command" || exit $?
3578 # Now create the wrapper script.
3579 $show "creating $output"
3581 # Quote the relink command for shipping.
3582 if test -n "$relink_command"; then
3583 # Preserve any variables that may affect compiler behavior
3584 for var in $variables_saved_for_relink; do
3585 if eval test -z \"\${$var+set}\"; then
3586 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3587 elif eval var_value=\$$var; test -z "$var_value"; then
3588 relink_command="$var=; export $var; $relink_command"
3590 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3591 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3594 relink_command="(cd `pwd`; $relink_command)"
3595 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3598 # Quote $echo for shipping.
3599 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3601 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3602 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3604 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3606 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3609 # Only actually do things if our run command is non-null.
3610 if test -z "$run"; then
3611 # win32 will think the script is a binary if it has
3612 # a .exe suffix, so we strip it off here.
3614 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
3616 # test for cygwin because mv fails w/o .exe extensions
3618 *cygwin*) exeext=.exe ;;
3622 trap "$rm $output; exit 1" 1 2 15
3627 # $output - temporary wrapper script for $objdir/$outputname
3628 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3630 # The $output program cannot be directly executed until all the libtool
3631 # libraries that it depends on are installed.
3633 # This wrapper script should never be moved out of the build directory.
3634 # If it is, it will not operate correctly.
3636 # Sed substitution that helps us do robust quoting. It backslashifies
3637 # metacharacters that are still active within double-quoted strings.
3638 Xsed="${SED}"' -e 1s/^X//'
3639 sed_quote_subst='$sed_quote_subst'
3641 # The HP-UX ksh and POSIX shell print the target directory to stdout
3643 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3645 relink_command=\"$relink_command\"
3647 # This environment variable determines our operation mode.
3648 if test \"\$libtool_install_magic\" = \"$magic\"; then
3649 # install mode needs the following variable:
3650 notinst_deplibs='$notinst_deplibs'
3652 # When we are sourced in execute mode, \$file and \$echo are already set.
3653 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3656 # Make sure echo works.
3657 if test \"X\$1\" = X--no-reexec; then
3658 # Discard the --no-reexec flag, and continue.
3660 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3661 # Yippee, \$echo works!
3664 # Restart under the correct shell, and then maybe \$echo will work.
3665 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3671 # Find the directory that this script lives in.
3672 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3673 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3675 # Follow symbolic links until we get to the real thisdir.
3676 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3677 while test -n \"\$file\"; do
3678 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3680 # If there was a directory component, then change thisdir.
3681 if test \"x\$destdir\" != \"x\$file\"; then
3682 case \"\$destdir\" in
3683 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3684 *) thisdir=\"\$thisdir/\$destdir\" ;;
3688 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3689 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3692 # Try to get the absolute directory name.
3693 absdir=\`cd \"\$thisdir\" && pwd\`
3694 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3697 if test "$fast_install" = yes; then
3699 program=lt-'$outputname'$exeext
3700 progdir=\"\$thisdir/$objdir\"
3702 if test ! -f \"\$progdir/\$program\" || \\
3703 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3704 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3706 file=\"\$\$-\$program\"
3708 if test ! -d \"\$progdir\"; then
3709 $mkdir \"\$progdir\"
3711 $rm \"\$progdir/\$file\"
3716 # relink executable if necessary
3717 if test -n \"\$relink_command\"; then
3718 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3720 $echo \"\$relink_command_output\" >&2
3721 $rm \"\$progdir/\$file\"
3726 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3727 { $rm \"\$progdir/\$program\";
3728 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3729 $rm \"\$progdir/\$file\"
3733 program='$outputname'
3734 progdir=\"\$thisdir/$objdir\"
3740 if test -f \"\$progdir/\$program\"; then"
3742 # Export our shlibpath_var if we have one.
3743 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3745 # Add our own library path to $shlibpath_var
3746 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3748 # Some systems cannot cope with colon-terminated $shlibpath_var
3749 # The second colon is a workaround for a bug in BeOS R4 ${SED}
3750 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3752 export $shlibpath_var
3756 # fixup the dll searchpath if we need to.
3757 if test -n "$dllsearchpath"; then
3759 # Add the dll search path components to the executable PATH
3760 PATH=$dllsearchpath:\$PATH
3765 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3766 # Run the actual program with our arguments.
3769 # win32 systems need to use the prog path for dll
3771 *-*-cygwin* | *-*-pw32*)
3773 exec \$progdir/\$program \${1+\"\$@\"}
3777 # Backslashes separate directories on plain windows
3778 *-*-mingw | *-*-os2*)
3780 exec \$progdir\\\\\$program \${1+\"\$@\"}
3786 # Export the path to the program.
3787 PATH=\"\$progdir:\$PATH\"
3790 exec \$program \${1+\"\$@\"}
3795 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3799 # The program doesn't exist.
3800 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3801 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3802 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3813 # See if we need to build an old-fashioned archive.
3814 for oldlib in $oldlibs; do
3816 if test "$build_libtool_libs" = convenience; then
3817 oldobjs="$libobjs_save"
3818 addlibs="$convenience"
3819 build_libtool_libs=no
3821 if test "$build_libtool_libs" = module; then
3822 oldobjs="$libobjs_save"
3823 build_libtool_libs=no
3825 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3827 addlibs="$old_convenience"
3830 if test -n "$addlibs"; then
3831 gentop="$output_objdir/${outputname}x"
3832 $show "${rm}r $gentop"
3833 $run ${rm}r "$gentop"
3834 $show "mkdir $gentop"
3835 $run mkdir "$gentop"
3837 if test $status -ne 0 && test ! -d "$gentop"; then
3840 generated="$generated $gentop"
3842 # Add in members from convenience archives.
3843 for xlib in $addlibs; do
3844 # Extract the objects.
3846 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3847 *) xabs=`pwd`"/$xlib" ;;
3849 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3850 xdir="$gentop/$xlib"
3852 $show "${rm}r $xdir"
3857 if test $status -ne 0 && test ! -d "$xdir"; then
3860 $show "(cd $xdir && $AR x $xabs)"
3861 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3863 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3867 # Do each command in the archive commands.
3868 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3869 eval cmds=\"$old_archive_from_new_cmds\"
3871 # Ensure that we have .o objects in place in case we decided
3872 # not to build a shared library, and have fallen back to building
3873 # static libs even though --disable-static was passed!
3874 for oldobj in $oldobjs; do
3875 if test ! -f $oldobj; then
3876 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3877 if test "X$xdir" = "X$oldobj"; then
3882 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3883 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3884 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3885 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3889 eval cmds=\"$old_archive_cmds\"
3891 save_ifs="$IFS"; IFS='~'
3892 for cmd in $cmds; do
3895 $run eval "$cmd" || exit $?
3900 if test -n "$generated"; then
3901 $show "${rm}r$generated"
3902 $run ${rm}r$generated
3905 # Now create the libtool archive.
3909 test "$build_old_libs" = yes && old_library="$libname.$libext"
3910 $show "creating $output"
3912 # Preserve any variables that may affect compiler behavior
3913 for var in $variables_saved_for_relink; do
3914 if eval test -z \"\${$var+set}\"; then
3915 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3916 elif eval var_value=\$$var; test -z "$var_value"; then
3917 relink_command="$var=; export $var; $relink_command"
3919 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3920 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3923 # Quote the link command for shipping.
3924 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
3925 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3927 # Only create the output if not a dry run.
3928 if test -z "$run"; then
3929 for installed in no yes; do
3930 if test "$installed" = yes; then
3931 if test -z "$install_libdir"; then
3934 output="$output_objdir/$outputname"i
3935 # Replace all uninstalled libtool libraries with the installed ones
3937 for deplib in $dependency_libs; do
3940 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3941 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3942 if test -z "$libdir"; then
3943 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3946 newdependency_libs="$newdependency_libs $libdir/$name"
3948 *) newdependency_libs="$newdependency_libs $deplib" ;;
3951 dependency_libs="$newdependency_libs"
3953 for lib in $dlfiles; do
3954 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3955 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3956 if test -z "$libdir"; then
3957 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3960 newdlfiles="$newdlfiles $libdir/$name"
3962 dlfiles="$newdlfiles"
3964 for lib in $dlprefiles; do
3965 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3966 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3967 if test -z "$libdir"; then
3968 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3971 newdlprefiles="$newdlprefiles $libdir/$name"
3973 dlprefiles="$newdlprefiles"
3976 # place dlname in correct position for cygwin
3978 case $host,$output,$installed,$module,$dlname in
3979 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3982 # $outputname - a libtool library file
3983 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3985 # Please DO NOT delete this file!
3986 # It is necessary for linking the library.
3988 # The name that we can dlopen(3).
3991 # Names of this library.
3992 library_names='$library_names'
3994 # The name of the static archive.
3995 old_library='$old_library'
3997 # Libraries that this one depends upon.
3998 dependency_libs='$dependency_libs'
4000 # Version information for $libname.
4005 # Is this an already installed library?
4006 installed=$installed
4008 # Files to dlopen/dlpreopen
4010 dlpreopen='$dlprefiles'
4012 # Directory that this library needs to be installed in:
4013 libdir='$install_libdir'"
4014 if test "$installed" = no && test $need_relink = yes; then
4016 relink_command=\"$relink_command\""
4021 # Do a symbolic link so that the libtool archive can be found in
4022 # LD_LIBRARY_PATH before the program is installed.
4023 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4024 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4030 # libtool install mode
4032 modename="$modename: install"
4034 # There may be an optional sh(1) argument at the beginning of
4035 # install_prog (especially on Windows NT).
4036 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4037 # Allow the use of GNU shtool's install command.
4038 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4039 # Aesthetically quote it.
4040 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4042 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4046 install_prog="$arg "
4054 # The real first argument should be the name of the installation program.
4055 # Aesthetically quote it.
4056 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4058 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4062 install_prog="$install_prog$arg"
4064 # We need to accept at least all the BSD install flags.
4074 if test -n "$dest"; then
4075 files="$files $dest"
4093 # If the previous option needed an argument, then skip it.
4094 if test -n "$prev"; then
4103 # Aesthetically quote the argument.
4104 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4106 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4110 install_prog="$install_prog $arg"
4113 if test -z "$install_prog"; then
4114 $echo "$modename: you must specify an install program" 1>&2
4119 if test -n "$prev"; then
4120 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4125 if test -z "$files"; then
4126 if test -z "$dest"; then
4127 $echo "$modename: no file or destination specified" 1>&2
4129 $echo "$modename: you must specify a destination" 1>&2
4135 # Strip any trailing slash from the destination.
4136 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4138 # Check to see that the destination is a directory.
4139 test -d "$dest" && isdir=yes
4140 if test "$isdir" = yes; then
4144 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4145 test "X$destdir" = "X$dest" && destdir=.
4146 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4148 # Not a directory, so check to see that there is only one file specified.
4150 if test $# -gt 2; then
4151 $echo "$modename: \`$dest' is not a directory" 1>&2
4157 [\\/]* | [A-Za-z]:[\\/]*) ;;
4159 for file in $files; do
4163 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4172 # This variable tells wrapper scripts just to set variables rather
4173 # than running their programs.
4174 libtool_install_magic="$magic"
4179 for file in $files; do
4181 # Do each installation.
4184 # Do the static libraries later.
4185 staticlibs="$staticlibs $file"
4189 # Check to see that this really is a libtool archive.
4190 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4192 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4200 # If there is no directory component, then add one.
4202 */* | *\\*) . $file ;;
4206 # Add the libdir to current_libdirs if it is the destination.
4207 if test "X$destdir" = "X$libdir"; then
4208 case "$current_libdirs " in
4210 *) current_libdirs="$current_libdirs $libdir" ;;
4213 # Note the libdir as a future libdir.
4214 case "$future_libdirs " in
4216 *) future_libdirs="$future_libdirs $libdir" ;;
4220 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4221 test "X$dir" = "X$file/" && dir=
4224 if test -n "$relink_command"; then
4225 $echo "$modename: warning: relinking \`$file'" 1>&2
4226 $show "$relink_command"
4227 if $run eval "$relink_command"; then :
4229 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4234 # See the names of the shared library.
4235 set dummy $library_names
4236 if test -n "$2"; then
4242 test -n "$relink_command" && srcname="$realname"T
4244 # Install the shared library and build the symlinks.
4245 $show "$install_prog $dir/$srcname $destdir/$realname"
4246 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4247 if test -n "$stripme" && test -n "$striplib"; then
4248 $show "$striplib $destdir/$realname"
4249 $run eval "$striplib $destdir/$realname" || exit $?
4252 if test $# -gt 0; then
4253 # Delete the old symlinks, and create new ones.
4256 if test "$linkname" != "$realname"; then
4257 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4258 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4263 # Do each command in the postinstall commands.
4264 lib="$destdir/$realname"
4265 eval cmds=\"$postinstall_cmds\"
4266 save_ifs="$IFS"; IFS='~'
4267 for cmd in $cmds; do
4270 $run eval "$cmd" || exit $?
4275 # Install the pseudo-library for information purposes.
4276 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4277 instname="$dir/$name"i
4278 $show "$install_prog $instname $destdir/$name"
4279 $run eval "$install_prog $instname $destdir/$name" || exit $?
4281 # Maybe install the static library, too.
4282 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4286 # Install (i.e. copy) a libtool object.
4288 # Figure out destination file name, if it wasn't already specified.
4289 if test -n "$destname"; then
4290 destfile="$destdir/$destname"
4292 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4293 destfile="$destdir/$destfile"
4296 # Deduce the name of the destination old-style object file.
4299 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4302 staticdest="$destfile"
4306 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4312 # Install the libtool object if requested.
4313 if test -n "$destfile"; then
4314 $show "$install_prog $file $destfile"
4315 $run eval "$install_prog $file $destfile" || exit $?
4318 # Install the old object if enabled.
4319 if test "$build_old_libs" = yes; then
4320 # Deduce the name of the old-style object file.
4321 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4323 $show "$install_prog $staticobj $staticdest"
4324 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4330 # Figure out destination file name, if it wasn't already specified.
4331 if test -n "$destname"; then
4332 destfile="$destdir/$destname"
4334 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4335 destfile="$destdir/$destfile"
4338 # Do a test to see if this is really a libtool program.
4341 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4347 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4351 # If there is no directory component, then add one.
4353 */* | *\\*) . $wrapper ;;
4357 # Check the variables that should have been set.
4358 if test -z "$notinst_deplibs"; then
4359 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4364 for lib in $notinst_deplibs; do
4365 # Check to see that each library is installed.
4367 if test -f "$lib"; then
4368 # If there is no directory component, then add one.
4370 */* | *\\*) . $lib ;;
4374 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4375 if test -n "$libdir" && test ! -f "$libfile"; then
4376 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4382 # If there is no directory component, then add one.
4384 */* | *\\*) . $wrapper ;;
4389 if test "$fast_install" = no && test -n "$relink_command"; then
4390 if test "$finalize" = yes && test -z "$run"; then
4392 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4393 tmpdir="$tmpdir/libtool-$$"
4394 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4396 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4399 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4400 outputname="$tmpdir/$file"
4401 # Replace the output file specification.
4402 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4404 $show "$relink_command"
4405 if $run eval "$relink_command"; then :
4407 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4413 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4416 # Install the binary that we compiled earlier.
4417 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4421 # remove .exe since cygwin /usr/bin/install will append another
4423 case $install_prog,$host in
4424 /usr/bin/install*,*cygwin*)
4425 case $file:$destfile in
4430 destfile=$destfile.exe
4433 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4438 $show "$install_prog$stripme $file $destfile"
4439 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4440 test -n "$outputname" && ${rm}r "$tmpdir"
4445 for file in $staticlibs; do
4446 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4448 # Set up the ranlib parameters.
4449 oldlib="$destdir/$name"
4451 $show "$install_prog $file $oldlib"
4452 $run eval "$install_prog \$file \$oldlib" || exit $?
4454 if test -n "$stripme" && test -n "$striplib"; then
4455 $show "$old_striplib $oldlib"
4456 $run eval "$old_striplib $oldlib" || exit $?
4459 # Do each command in the postinstall commands.
4460 eval cmds=\"$old_postinstall_cmds\"
4461 save_ifs="$IFS"; IFS='~'
4462 for cmd in $cmds; do
4465 $run eval "$cmd" || exit $?
4470 if test -n "$future_libdirs"; then
4471 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4474 if test -n "$current_libdirs"; then
4475 # Maybe just do a dry run.
4476 test -n "$run" && current_libdirs=" -n$current_libdirs"
4477 exec_cmd='$SHELL $0 --finish$current_libdirs'
4483 # libtool finish mode
4485 modename="$modename: finish"
4489 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4492 libdirs="$libdirs $dir"
4495 for libdir in $libdirs; do
4496 if test -n "$finish_cmds"; then
4497 # Do each command in the finish commands.
4498 eval cmds=\"$finish_cmds\"
4499 save_ifs="$IFS"; IFS='~'
4500 for cmd in $cmds; do
4503 $run eval "$cmd" || admincmds="$admincmds
4508 if test -n "$finish_eval"; then
4509 # Do the single finish_eval.
4510 eval cmds=\"$finish_eval\"
4511 $run eval "$cmds" || admincmds="$admincmds
4517 # Exit here if they wanted silent mode.
4518 test "$show" = ":" && exit 0
4520 echo "----------------------------------------------------------------------"
4521 echo "Libraries have been installed in:"
4522 for libdir in $libdirs; do
4526 echo "If you ever happen to want to link against installed libraries"
4527 echo "in a given directory, LIBDIR, you must either use libtool, and"
4528 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4529 echo "flag during linking and do at least one of the following:"
4530 if test -n "$shlibpath_var"; then
4531 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4532 echo " during execution"
4534 if test -n "$runpath_var"; then
4535 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4536 echo " during linking"
4538 if test -n "$hardcode_libdir_flag_spec"; then
4540 eval flag=\"$hardcode_libdir_flag_spec\"
4542 echo " - use the \`$flag' linker flag"
4544 if test -n "$admincmds"; then
4545 echo " - have your system administrator run these commands:$admincmds"
4547 if test -f /etc/ld.so.conf; then
4548 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4551 echo "See any operating system documentation about shared libraries for"
4552 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4553 echo "----------------------------------------------------------------------"
4557 # libtool execute mode
4559 modename="$modename: execute"
4561 # The first argument is the command name.
4563 if test -z "$cmd"; then
4564 $echo "$modename: you must specify a COMMAND" 1>&2
4569 # Handle -dlopen flags immediately.
4570 for file in $execute_dlfiles; do
4571 if test ! -f "$file"; then
4572 $echo "$modename: \`$file' is not a file" 1>&2
4580 # Check to see that this really is a libtool archive.
4581 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4583 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4588 # Read the libtool library.
4592 # If there is no directory component, then add one.
4594 */* | *\\*) . $file ;;
4598 # Skip this library if it cannot be dlopened.
4599 if test -z "$dlname"; then
4600 # Warn if it was a shared library.
4601 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4605 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4606 test "X$dir" = "X$file" && dir=.
4608 if test -f "$dir/$objdir/$dlname"; then
4611 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4617 # Just add the directory containing the .lo file.
4618 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4619 test "X$dir" = "X$file" && dir=.
4623 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4628 # Get the absolute pathname.
4629 absdir=`cd "$dir" && pwd`
4630 test -n "$absdir" && dir="$absdir"
4632 # Now add the directory to shlibpath_var.
4633 if eval "test -z \"\$$shlibpath_var\""; then
4634 eval "$shlibpath_var=\"\$dir\""
4636 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4640 # This variable tells wrapper scripts just to set shlibpath_var
4641 # rather than running their programs.
4642 libtool_execute_magic="$magic"
4644 # Check if any of the arguments is a wrapper script.
4651 # Do a test to see if this is really a libtool program.
4652 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4653 # If there is no directory component, then add one.
4655 */* | *\\*) . $file ;;
4659 # Transform arg to wrapped name.
4660 file="$progdir/$program"
4664 # Quote arguments (to preserve shell metacharacters).
4665 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4666 args="$args \"$file\""
4669 if test -z "$run"; then
4670 if test -n "$shlibpath_var"; then
4671 # Export the shlibpath_var.
4672 eval "export $shlibpath_var"
4675 # Restore saved enviroment variables
4676 if test "${save_LC_ALL+set}" = set; then
4677 LC_ALL="$save_LC_ALL"; export LC_ALL
4679 if test "${save_LANG+set}" = set; then
4680 LANG="$save_LANG"; export LANG
4683 # Now prepare to actually exec the command.
4684 exec_cmd="\$cmd$args"
4686 # Display what would be done.
4687 if test -n "$shlibpath_var"; then
4688 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4689 $echo "export $shlibpath_var"
4696 # libtool clean and uninstall mode
4698 modename="$modename: $mode"
4704 # This variable tells wrapper scripts just to set variables rather
4705 # than running their programs.
4706 libtool_install_magic="$magic"
4711 -f) rm="$rm $arg"; rmforce=yes ;;
4712 -*) rm="$rm $arg" ;;
4713 *) files="$files $arg" ;;
4717 if test -z "$rm"; then
4718 $echo "$modename: you must specify an RM program" 1>&2
4725 for file in $files; do
4726 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4727 if test "X$dir" = "X$file"; then
4731 objdir="$dir/$objdir"
4733 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4734 test $mode = uninstall && objdir="$dir"
4736 # Remember objdir for removal later, being careful to avoid duplicates
4737 if test $mode = clean; then
4740 *) rmdirs="$rmdirs $objdir" ;;
4744 # Don't error if the file doesn't exist and rm -f was used.
4745 if (test -L "$file") >/dev/null 2>&1 \
4746 || (test -h "$file") >/dev/null 2>&1 \
4747 || test -f "$file"; then
4749 elif test -d "$file"; then
4752 elif test "$rmforce" = yes; then
4760 # Possibly a libtool archive, so verify it.
4761 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4764 # Delete the libtool libraries and symlinks.
4765 for n in $library_names; do
4766 rmfiles="$rmfiles $objdir/$n"
4768 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4769 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4771 if test $mode = uninstall; then
4772 if test -n "$library_names"; then
4773 # Do each command in the postuninstall commands.
4774 eval cmds=\"$postuninstall_cmds\"
4775 save_ifs="$IFS"; IFS='~'
4776 for cmd in $cmds; do
4780 if test $? != 0 && test "$rmforce" != yes; then
4787 if test -n "$old_library"; then
4788 # Do each command in the old_postuninstall commands.
4789 eval cmds=\"$old_postuninstall_cmds\"
4790 save_ifs="$IFS"; IFS='~'
4791 for cmd in $cmds; do
4795 if test $? != 0 && test "$rmforce" != yes; then
4801 # FIXME: should reinstall the best remaining shared library.
4807 if test "$build_old_libs" = yes; then
4808 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4809 rmfiles="$rmfiles $dir/$oldobj"
4814 # Do a test to see if this is a libtool program.
4815 if test $mode = clean &&
4816 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4820 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4821 if test "$fast_install" = yes && test -n "$relink_command"; then
4822 rmfiles="$rmfiles $objdir/lt-$name"
4827 $show "$rm $rmfiles"
4828 $run $rm $rmfiles || exit_status=1
4831 # Try to remove the ${objdir}s in the directories where we deleted files
4832 for dir in $rmdirs; do
4833 if test -d "$dir"; then
4835 $run rmdir $dir >/dev/null 2>&1
4843 $echo "$modename: you must specify a MODE" 1>&2
4844 $echo "$generic_help" 1>&2
4849 if test -z "$exec_cmd"; then
4850 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4851 $echo "$generic_help" 1>&2
4854 fi # test -z "$show_help"
4856 if test -n "$exec_cmd"; then
4861 # We need to display help for each of the modes.
4864 "Usage: $modename [OPTION]... [MODE-ARG]...
4866 Provide generalized library-building support services.
4868 --config show all configuration variables
4869 --debug enable verbose shell tracing
4870 -n, --dry-run display commands without modifying any files
4871 --features display basic configuration information and exit
4872 --finish same as \`--mode=finish'
4873 --help display this help message and exit
4874 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4875 --quiet same as \`--silent'
4876 --silent don't print informational messages
4877 --version print version information
4879 MODE must be one of the following:
4881 clean remove files from the build directory
4882 compile compile a source file into a libtool object
4883 execute automatically set library path, then run a program
4884 finish complete the installation of libtool libraries
4885 install install libraries or executables
4886 link create a library or an executable
4887 uninstall remove libraries from an installed directory
4889 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4890 a more detailed description of MODE."
4896 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4898 Remove files from the build directory.
4900 RM is the name of the program to use to delete files associated with each FILE
4901 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4904 If FILE is a libtool library, object or program, all the files associated
4905 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4910 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4912 Compile a source file into a libtool library object.
4914 This mode accepts the following additional options:
4916 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4917 -prefer-pic try to building PIC objects only
4918 -prefer-non-pic try to building non-PIC objects only
4919 -static always build a \`.o' file suitable for static linking
4921 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4922 from the given SOURCEFILE.
4924 The output file name is determined by removing the directory component from
4925 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4926 library object suffix, \`.lo'."
4931 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4933 Automatically set library path, then run a program.
4935 This mode accepts the following additional options:
4937 -dlopen FILE add the directory containing FILE to the library path
4939 This mode sets the library path environment variable according to \`-dlopen'
4942 If any of the ARGS are libtool executable wrappers, then they are translated
4943 into their corresponding uninstalled binary, and any of their required library
4944 directories are added to the library path.
4946 Then, COMMAND is executed, with ARGS as arguments."
4951 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4953 Complete the installation of libtool libraries.
4955 Each LIBDIR is a directory that contains libtool libraries.
4957 The commands that this mode executes may require superuser privileges. Use
4958 the \`--dry-run' option if you just want to see what would be executed."
4963 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4965 Install executables or libraries.
4967 INSTALL-COMMAND is the installation command. The first component should be
4968 either the \`install' or \`cp' program.
4970 The rest of the components are interpreted as arguments to that command (only
4971 BSD-compatible install options are recognized)."
4976 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4978 Link object files or libraries together to form another library, or to
4979 create an executable program.
4981 LINK-COMMAND is a command using the C compiler that you would use to create
4982 a program from several object files.
4984 The following components of LINK-COMMAND are treated specially:
4986 -all-static do not do any dynamic linking at all
4987 -avoid-version do not add a version suffix if possible
4988 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4989 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4990 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4991 -export-symbols SYMFILE
4992 try to export only the symbols listed in SYMFILE
4993 -export-symbols-regex REGEX
4994 try to export only the symbols matching REGEX
4995 -LLIBDIR search LIBDIR for required installed libraries
4996 -lNAME OUTPUT-FILE requires the installed library libNAME
4997 -module build a library that can dlopened
4998 -no-fast-install disable the fast-install mode
4999 -no-install link a not-installable executable
5000 -no-undefined declare that a library does not refer to external symbols
5001 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5002 -release RELEASE specify package release information
5003 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5004 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5005 -static do not do any dynamic linking of libtool libraries
5006 -version-info CURRENT[:REVISION[:AGE]]
5007 specify library version info [each variable defaults to 0]
5009 All other options (arguments beginning with \`-') are ignored.
5011 Every other argument is treated as a filename. Files ending in \`.la' are
5012 treated as uninstalled libtool libraries, other files are standard or library
5015 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5016 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5017 required, except when creating a convenience library.
5019 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5020 using \`ar' and \`ranlib', or on Windows using \`lib'.
5022 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5023 is created, otherwise an executable program is created."
5028 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5030 Remove libraries from an installation directory.
5032 RM is the name of the program to use to delete files associated with each FILE
5033 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5036 If FILE is a libtool library, all the files associated with it are deleted.
5037 Otherwise, only FILE itself is deleted using RM."
5041 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5048 $echo "Try \`$modename --help' for more information about other modes."