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.1133 2002/09/25 04:26:19)"
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.
118 while test "$#" -gt 0
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"
137 # Check whether tagname contains only valid characters
140 echo "$progname: invalid tag name: $tagname" 1>&2
147 # Don't test for the "default" C tag, as we know, it's there, but
148 # not specially marked.
151 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
152 taglist="$taglist $tagname"
153 # Evaluate the configuration.
154 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
156 echo "$progname: ignoring unknown tag $tagname" 1>&2
171 # Have we seen a non-optional argument yet?
178 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
180 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
181 echo "Free Software Foundation, Inc."
182 echo "This is free software; see the source for copying conditions. There is NO"
183 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
188 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
189 # Now print the configurations for the tags.
190 for tagname in $taglist; do
191 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
197 echo "$progname: enabling shell trace mode"
207 if test "$build_libtool_libs" = yes; then
208 echo "enable shared libraries"
210 echo "disable shared libraries"
212 if test "$build_old_libs" = yes; then
213 echo "enable static libraries"
215 echo "disable static libraries"
220 --finish) mode="finish" ;;
222 --mode) prevopt="--mode" prev=mode ;;
223 --mode=*) mode="$optarg" ;;
225 --preserve-dup-deps) duplicate_deps="yes" ;;
231 --tag) prevopt="--tag" prev=tag ;;
233 set tag "$optarg" ${1+"$@"}
244 $echo "$modename: unrecognized option \`$arg'" 1>&2
256 if test -n "$prevopt"; then
257 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
262 # If this variable is set in any of the actions, the command in it
263 # will be execed at the end. This prevents here-documents from being
264 # left over by shells.
267 if test -z "$show_help"; then
269 # Infer the operation mode.
270 if test -z "$mode"; then
272 *cc | *++ | gcc* | *-gcc*)
284 *db | *dbx | *strace | *truss)
294 # If we have no mode, but dlfiles were specified, then do execute mode.
295 test -n "$execute_dlfiles" && mode=execute
297 # Just use the default operation mode.
298 if test -z "$mode"; then
299 if test -n "$nonopt"; then
300 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
302 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
309 # Only execute mode is allowed to have -dlopen flags.
310 if test -n "$execute_dlfiles" && test "$mode" != execute; then
311 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
316 # Change the help message to a mode-specific one.
318 help="Try \`$modename --help --mode=$mode' for more information."
320 # These modes are in order of execution frequency so that they run quickly.
322 # libtool compile mode
324 modename="$modename: compile"
325 # Get the compilation command and the source file.
327 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
336 # do not "continue". Instead, add this to base_compile
348 # Accept any command-line options.
351 if test -n "$libobj" ; then
352 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
375 arg_mode=arg # the next one goes into the "base_compile" arg list
376 continue # The current "srcfile" will either be retained or
377 ;; # replaced later. I would guess that would be a bug.
380 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
382 save_ifs="$IFS"; IFS=','
386 # Double-quote args containing other shell metacharacters.
387 # Many Bourne shells cannot handle close brackets correctly
388 # in scan sets, so we specify it separately.
390 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
394 lastarg="$lastarg $arg"
397 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
399 # Add the arguments to base_compile.
400 base_compile="$base_compile $lastarg"
405 # Accept the current argument as the source file.
406 # The previous "srcfile" becomes the current argument.
413 esac # case $arg_mode
415 # Aesthetically quote the previous argument.
416 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
419 # Double-quote args containing other shell metacharacters.
420 # Many Bourne shells cannot handle close brackets correctly
421 # in scan sets, so we specify it separately.
422 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
423 lastarg="\"$lastarg\""
427 base_compile="$base_compile $lastarg"
432 $echo "$modename: you must specify an argument for -Xcompile"
436 $echo "$modename: you must specify a target with \`-o'" 1>&2
440 # Get the name of the library object.
441 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
445 # Recognize several different file suffixes.
446 # If the user specifies -o file.o, it is replaced with file.lo
456 *.class) xform=class ;;
461 *.java) xform=java ;;
464 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
467 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
469 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
474 # Infer tagged configuration to use if any are available and
475 # if one wasn't chosen via the "--tag" command line option.
476 # Only attempt this if the compiler in the base compile
477 # command doesn't match the default compiler.
478 if test -n "$available_tags" && test -z "$tagname"; then
479 case $base_compile in
480 # Blanks in the command may have been stripped by the calling shell,
481 # but not from the CC environment variable when configure was run.
482 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
483 # Blanks at the start of $base_compile will cause this to fail
484 # if we don't check for them as well.
486 for z in $available_tags; do
487 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
488 # Evaluate the configuration.
489 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
490 case "$base_compile " in
491 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
492 # The compiler in the base compile command matches
493 # the one in the tagged configuration.
494 # Assume this is the tagged configuration we want.
501 # If $tagname still isn't set, then no tagged configuration
502 # was found and let the user know that the "--tag" command
503 # line option must be used.
504 if test -z "$tagname"; then
505 echo "$modename: unable to infer tagged configuration"
506 echo "$modename: specify a tag with \`--tag'" 1>&2
509 # echo "$modename: using $tagname tagged configuration"
515 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
516 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
517 if test "X$xdir" = "X$obj"; then
522 lobj=${xdir}$objdir/$objname
524 if test -z "$base_compile"; then
525 $echo "$modename: you must specify a compilation command" 1>&2
530 # Delete any leftover library objects.
531 if test "$build_old_libs" = yes; then
532 removelist="$obj $lobj $libobj ${libobj}T"
534 removelist="$lobj $libobj ${libobj}T"
538 trap "$run $rm $removelist; exit 1" 1 2 15
540 # On Cygwin there's no "real" PIC flag so we must build both object types
542 cygwin* | mingw* | pw32* | os2*)
546 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
547 # non-PIC code in shared libraries is not supported
551 # Calculate the filename of the output object if compiler does
552 # not support -o with -c
553 if test "$compiler_c_o" = no; then
554 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
555 lockfile="$output_obj.lock"
556 removelist="$removelist $output_obj $lockfile"
557 trap "$run $rm $removelist; exit 1" 1 2 15
564 # Lock this critical section if it is needed
565 # We use this script file to make the link, it avoids creating a new file
566 if test "$need_locks" = yes; then
567 until $run ln "$0" "$lockfile" 2>/dev/null; do
568 $show "Waiting for $lockfile to be removed"
571 elif test "$need_locks" = warn; then
572 if test -f "$lockfile"; then
574 *** ERROR, $lockfile exists and contains:
575 `cat $lockfile 2>/dev/null`
577 This indicates that another process is trying to use the same
578 temporary object file, and libtool could not work around it because
579 your compiler does not support \`-c' and \`-o' together. If you
580 repeat this compilation, it may succeed, by chance, but you had better
581 avoid parallel builds (make -j) in this platform, or get a better
587 echo $srcfile > "$lockfile"
590 if test -n "$fix_srcfile_path"; then
591 eval srcfile=\"$fix_srcfile_path\"
594 $run $rm "$libobj" "${libobj}T"
596 # Create a libtool object file (analogous to a ".la" file),
597 # but don't create it if we're doing a dry run.
598 test -z "$run" && cat > ${libobj}T <<EOF
599 # $libobj - a libtool object file
600 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
602 # Please DO NOT delete this file!
603 # It is necessary for linking the library.
605 # Name of the PIC object.
608 # Only build a PIC object if we are building libtool libraries.
609 if test "$build_libtool_libs" = yes; then
610 # Without this assignment, base_compile gets emptied.
611 fbsd_hideous_sh_bug=$base_compile
613 if test "$pic_mode" != no; then
614 command="$base_compile $srcfile $pic_flag"
616 # Don't build PIC code
617 command="$base_compile $srcfile"
620 if test ! -d "${xdir}$objdir"; then
621 $show "$mkdir ${xdir}$objdir"
622 $run $mkdir ${xdir}$objdir
624 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
629 if test -z "$output_obj"; then
630 # Place PIC objects in $objdir
631 command="$command -o $lobj"
634 $run $rm "$lobj" "$output_obj"
637 if $run eval "$command"; then :
639 test -n "$output_obj" && $run $rm $removelist
643 if test "$need_locks" = warn &&
644 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
646 *** ERROR, $lockfile contains:
647 `cat $lockfile 2>/dev/null`
649 but it should contain:
652 This indicates that another process is trying to use the same
653 temporary object file, and libtool could not work around it because
654 your compiler does not support \`-c' and \`-o' together. If you
655 repeat this compilation, it may succeed, by chance, but you had better
656 avoid parallel builds (make -j) in this platform, or get a better
663 # Just move the object if needed, then go on to compile the next one
664 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
665 $show "$mv $output_obj $lobj"
666 if $run $mv $output_obj $lobj; then :
674 # Append the name of the PIC object to the libtool object file.
675 test -z "$run" && cat >> ${libobj}T <<EOF
676 pic_object='$objdir/$objname'
680 # Allow error messages only from the first compilation.
681 suppress_output=' >/dev/null 2>&1'
683 # No PIC object so indicate it doesn't exist in the libtool
685 test -z "$run" && cat >> ${libobj}T <<EOF
691 # Only build a position-dependent object if we build old libraries.
692 if test "$build_old_libs" = yes; then
693 if test "$pic_mode" != yes; then
694 # Don't build PIC code
695 command="$base_compile $srcfile"
697 command="$base_compile $srcfile $pic_flag"
699 if test "$compiler_c_o" = yes; then
700 command="$command -o $obj"
703 # Suppress compiler output if we already did a PIC compilation.
704 command="$command$suppress_output"
705 $run $rm "$obj" "$output_obj"
707 if $run eval "$command"; then :
713 if test "$need_locks" = warn &&
714 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
716 *** ERROR, $lockfile contains:
717 `cat $lockfile 2>/dev/null`
719 but it should contain:
722 This indicates that another process is trying to use the same
723 temporary object file, and libtool could not work around it because
724 your compiler does not support \`-c' and \`-o' together. If you
725 repeat this compilation, it may succeed, by chance, but you had better
726 avoid parallel builds (make -j) in this platform, or get a better
733 # Just move the object if needed
734 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
735 $show "$mv $output_obj $obj"
736 if $run $mv $output_obj $obj; then :
744 # Append the name of the non-PIC object the libtool object file.
745 # Only append if the libtool object file exists.
746 test -z "$run" && cat >> ${libobj}T <<EOF
747 # Name of the non-PIC object.
748 non_pic_object='$objname'
752 # Append the name of the non-PIC object the libtool object file.
753 # Only append if the libtool object file exists.
754 test -z "$run" && cat >> ${libobj}T <<EOF
755 # Name of the non-PIC object.
761 $run $mv "${libobj}T" "${libobj}"
763 # Unlock the critical section if it was locked
764 if test "$need_locks" != no; then
773 modename="$modename: link"
775 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
776 # It is impossible to link a dll without this setting, and
777 # we shouldn't force the makefile maintainer to figure out
778 # which system we are compiling for in order to pass an extra
779 # flag for every libtool invocation.
782 # FIXME: Unfortunately, there are problems with the above when trying
783 # to make a dll which has undefined symbols, in which case not
784 # even a static library is built. For now, we need to specify
785 # -no-undefined on the libtool link line when we can be certain
786 # that all symbols are satisfied, otherwise we get a static library.
793 libtool_args="$nonopt"
794 base_compile="$nonopt"
795 compile_command="$nonopt"
796 finalize_command="$nonopt"
809 lib_search_path=`pwd`
817 export_symbols_regex=
825 prefer_static_libs=no
837 # We need to know -static, to get the right output filenames.
841 -all-static | -static)
842 if test "X$arg" = "X-all-static"; then
843 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
844 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
846 if test -n "$link_static_flag"; then
847 dlopen_self=$dlopen_self_static
850 if test -z "$pic_flag" && test -n "$link_static_flag"; then
851 dlopen_self=$dlopen_self_static
854 build_libtool_libs=no
856 prefer_static_libs=yes
862 # See if our shared archives depend on static archives.
863 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
865 # Go through the arguments, transforming them on the way.
866 while test "$#" -gt 0; do
868 base_compile="$base_compile $arg"
871 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
872 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
876 libtool_args="$libtool_args $qarg"
878 # If the previous option needs an argument, assign it.
879 if test -n "$prev"; then
882 compile_command="$compile_command @OUTPUT@"
883 finalize_command="$finalize_command @OUTPUT@"
889 if test "$preload" = no; then
890 # Add the symbol object into the linking commands.
891 compile_command="$compile_command @SYMFILE@"
892 finalize_command="$finalize_command @SYMFILE@"
896 *.la | *.lo) ;; # We handle these cases below.
898 if test "$dlself" = no; then
906 if test "$prev" = dlprefiles; then
908 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
918 if test "$prev" = dlfiles; then
919 dlfiles="$dlfiles $arg"
921 dlprefiles="$dlprefiles $arg"
929 export_symbols="$arg"
930 if test ! -f "$arg"; then
931 $echo "$modename: symbol file \`$arg' does not exist"
938 export_symbols_regex="$arg"
948 if test -f "$arg"; then
951 for fil in `cat $save_arg`
953 # moreargs="$moreargs $fil"
955 # A libtool-controlled object.
957 # Check to see that this really is a libtool object.
958 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
963 # If there is no directory component, then add one.
965 */* | *\\*) . $arg ;;
969 if test -z "$pic_object" || \
970 test -z "$non_pic_object" ||
971 test "$pic_object" = none && \
972 test "$non_pic_object" = none; then
973 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
977 # Extract subdirectory from the argument.
978 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
979 if test "X$xdir" = "X$arg"; then
985 if test "$pic_object" != none; then
986 # Prepend the subdirectory the object is found in.
987 pic_object="$xdir$pic_object"
989 if test "$prev" = dlfiles; then
990 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
991 dlfiles="$dlfiles $pic_object"
995 # If libtool objects are unsupported, then we need to preload.
1000 # CHECK ME: I think I busted this. -Ossama
1001 if test "$prev" = dlprefiles; then
1002 # Preload the old-style object.
1003 dlprefiles="$dlprefiles $pic_object"
1008 libobjs="$libobjs $pic_object"
1013 if test "$non_pic_object" != none; then
1014 # Prepend the subdirectory the object is found in.
1015 non_pic_object="$xdir$non_pic_object"
1017 # A standard non-PIC object
1018 non_pic_objects="$non_pic_objects $non_pic_object"
1019 if test -z "$pic_object" || test "$pic_object" = none ; then
1020 arg="$non_pic_object"
1024 # Only an error if not doing a dry-run.
1025 if test -z "$run"; then
1026 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1031 # Extract subdirectory from the argument.
1032 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1033 if test "X$xdir" = "X$arg"; then
1039 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1040 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1041 libobjs="$libobjs $pic_object"
1042 non_pic_objects="$non_pic_objects $non_pic_object"
1047 $echo "$modename: link input file \`$save_arg' does not exist"
1055 # We need an absolute path.
1057 [\\/]* | [A-Za-z]:[\\/]*) ;;
1059 $echo "$modename: only absolute run-paths are allowed" 1>&2
1063 if test "$prev" = rpath; then
1066 *) rpath="$rpath $arg" ;;
1071 *) xrpath="$xrpath $arg" ;;
1078 compiler_flags="$compiler_flags $qarg"
1080 compile_command="$compile_command $qarg"
1081 finalize_command="$finalize_command $qarg"
1085 linker_flags="$linker_flags $qarg"
1086 compiler_flags="$compiler_flags $wl$qarg"
1088 compile_command="$compile_command $wl$qarg"
1089 finalize_command="$finalize_command $wl$qarg"
1093 eval "$prev=\"\$arg\""
1098 fi # test -n "$prev"
1104 if test -n "$link_static_flag"; then
1105 compile_command="$compile_command $link_static_flag"
1106 finalize_command="$finalize_command $link_static_flag"
1112 # FIXME: remove this flag sometime in the future.
1113 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1137 -export-symbols | -export-symbols-regex)
1138 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1139 $echo "$modename: more than one -exported-symbols argument is not allowed"
1142 if test "X$arg" = "X-export-symbols"; then
1150 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1151 # so, if we see these flags be careful not to treat them like -L
1153 case $with_gcc/$host in
1154 no/*-*-irix* | /*-*-irix*)
1155 compile_command="$compile_command $arg"
1156 finalize_command="$finalize_command $arg"
1163 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1164 # We need an absolute path.
1166 [\\/]* | [A-Za-z]:[\\/]*) ;;
1168 absdir=`cd "$dir" && pwd`
1169 if test -z "$absdir"; then
1170 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1179 deplibs="$deplibs -L$dir"
1180 lib_search_path="$lib_search_path $dir"
1184 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1185 case :$dllsearchpath: in
1187 *) dllsearchpath="$dllsearchpath:$dir";;
1195 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1197 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1198 # These systems don't actually have a C or math library (as such)
1201 *-*-mingw* | *-*-os2*)
1202 # These systems don't actually have a C library (as such)
1203 test "X$arg" = "X-lc" && continue
1205 *-*-openbsd* | *-*-freebsd*)
1206 # Do not include libc due to us having libc/libc_r.
1207 test "X$arg" = "X-lc" && continue
1209 *-*-rhapsody* | *-*-darwin1.[012])
1210 # Rhapsody C and math libraries are in the System framework
1211 deplibs="$deplibs -framework System"
1214 elif test "X$arg" = "X-lc_r"; then
1216 *-*-openbsd* | *-*-freebsd*)
1217 # Do not include libc_r directly, use -pthread flag.
1222 deplibs="$deplibs $arg"
1238 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1239 # The PATH hackery in wrapper scripts is required on Windows
1240 # in order for the loader to find any dlls it needs.
1241 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1242 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1245 *) no_install=yes ;;
1278 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1279 # We need an absolute path.
1281 [\\/]* | [A-Za-z]:[\\/]*) ;;
1283 $echo "$modename: only absolute run-paths are allowed" 1>&2
1289 *) xrpath="$xrpath $dir" ;;
1295 # The effects of -static are defined in a previous loop.
1296 # We used to do the same as -all-static on platforms that
1297 # didn't have a PIC flag, but the assumption that the effects
1298 # would be equivalent was wrong. It would break on at least
1299 # Digital Unix and AIX.
1314 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1316 save_ifs="$IFS"; IFS=','
1317 for flag in $args; do
1320 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1325 compiler_flags="$compiler_flags $flag"
1328 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1332 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1334 save_ifs="$IFS"; IFS=','
1335 for flag in $args; do
1338 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1343 compiler_flags="$compiler_flags $wl$flag"
1344 linker_flags="$linker_flags $flag"
1347 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1360 # Some other compiler flag.
1362 # Unknown arguments in both finalize_command and compile_command need
1363 # to be aesthetically quoted because they are evaled later.
1364 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1366 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1373 # A standard object.
1378 # A libtool-controlled object.
1380 # Check to see that this really is a libtool object.
1381 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1386 # If there is no directory component, then add one.
1388 */* | *\\*) . $arg ;;
1392 if test -z "$pic_object" || \
1393 test -z "$non_pic_object" ||
1394 test "$pic_object" = none && \
1395 test "$non_pic_object" = none; then
1396 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1400 # Extract subdirectory from the argument.
1401 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1402 if test "X$xdir" = "X$arg"; then
1408 if test "$pic_object" != none; then
1409 # Prepend the subdirectory the object is found in.
1410 pic_object="$xdir$pic_object"
1412 if test "$prev" = dlfiles; then
1413 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1414 dlfiles="$dlfiles $pic_object"
1418 # If libtool objects are unsupported, then we need to preload.
1423 # CHECK ME: I think I busted this. -Ossama
1424 if test "$prev" = dlprefiles; then
1425 # Preload the old-style object.
1426 dlprefiles="$dlprefiles $pic_object"
1431 libobjs="$libobjs $pic_object"
1436 if test "$non_pic_object" != none; then
1437 # Prepend the subdirectory the object is found in.
1438 non_pic_object="$xdir$non_pic_object"
1440 # A standard non-PIC object
1441 non_pic_objects="$non_pic_objects $non_pic_object"
1442 if test -z "$pic_object" || test "$pic_object" = none ; then
1443 arg="$non_pic_object"
1447 # Only an error if not doing a dry-run.
1448 if test -z "$run"; then
1449 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1454 # Extract subdirectory from the argument.
1455 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1456 if test "X$xdir" = "X$arg"; then
1462 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1463 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1464 libobjs="$libobjs $pic_object"
1465 non_pic_objects="$non_pic_objects $non_pic_object"
1472 deplibs="$deplibs $arg"
1473 old_deplibs="$old_deplibs $arg"
1478 # A libtool-controlled library.
1480 if test "$prev" = dlfiles; then
1481 # This library was specified with -dlopen.
1482 dlfiles="$dlfiles $arg"
1484 elif test "$prev" = dlprefiles; then
1485 # The library was specified with -dlpreopen.
1486 dlprefiles="$dlprefiles $arg"
1489 deplibs="$deplibs $arg"
1494 # Some other compiler argument.
1496 # Unknown arguments in both finalize_command and compile_command need
1497 # to be aesthetically quoted because they are evaled later.
1498 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1500 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1507 # Now actually substitute the argument into the commands.
1508 if test -n "$arg"; then
1509 compile_command="$compile_command $arg"
1510 finalize_command="$finalize_command $arg"
1512 done # argument parsing loop
1514 if test -n "$prev"; then
1515 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1520 # Infer tagged configuration to use if any are available and
1521 # if one wasn't chosen via the "--tag" command line option.
1522 # Only attempt this if the compiler in the base link
1523 # command doesn't match the default compiler.
1524 if test -n "$available_tags" && test -z "$tagname"; then
1525 case $base_compile in
1526 # Blanks in the command may have been stripped by the calling shell,
1527 # but not from the CC environment variable when configure was run.
1528 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1529 # Blanks at the start of $base_compile will cause this to fail
1530 # if we don't check for them as well.
1532 for z in $available_tags; do
1533 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1534 # Evaluate the configuration.
1535 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1536 case $base_compile in
1537 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1538 # The compiler in $compile_command matches
1539 # the one in the tagged configuration.
1540 # Assume this is the tagged configuration we want.
1547 # If $tagname still isn't set, then no tagged configuration
1548 # was found and let the user know that the "--tag" command
1549 # line option must be used.
1550 if test -z "$tagname"; then
1551 echo "$modename: unable to infer tagged configuration"
1552 echo "$modename: specify a tag with \`--tag'" 1>&2
1555 # echo "$modename: using $tagname tagged configuration"
1561 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1562 eval arg=\"$export_dynamic_flag_spec\"
1563 compile_command="$compile_command $arg"
1564 finalize_command="$finalize_command $arg"
1568 # calculate the name of the file, without its directory
1569 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1570 libobjs_save="$libobjs"
1572 if test -n "$shlibpath_var"; then
1573 # get the directories listed in $shlibpath_var
1574 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1578 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1579 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1581 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1582 if test "X$output_objdir" = "X$output"; then
1583 output_objdir="$objdir"
1585 output_objdir="$output_objdir/$objdir"
1587 # Create the object directory.
1588 if test ! -d "$output_objdir"; then
1589 $show "$mkdir $output_objdir"
1590 $run $mkdir $output_objdir
1592 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1597 # Determine the type of output
1600 $echo "$modename: you must specify an output file" 1>&2
1604 *.$libext) linkmode=oldlib ;;
1605 *.lo | *.$objext) linkmode=obj ;;
1606 *.la) linkmode=lib ;;
1607 *) linkmode=prog ;; # Anything else should be a program.
1612 # This is a hack, but we run into problems on cygwin.
1613 # libgcc.a depends on libcygwin, but gcc puts -lgcc onto
1614 # the link line twice: once before the "normal" libs
1615 # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and
1616 # once AFTER those. However, the "eliminate dup deps"
1617 # procedure keeps only the LAST duplicate -- thus
1618 # messing up the order, since after dup elimination
1619 # -lgcc comes AFTER -lcygwin. In normal C operation,
1620 # you don't notice the problem, because -lgcc isn't
1621 # really used. However, now that C++ libraries are
1622 # libtool-able, you DO see the problem. So, it must
1623 # be fixed. We could always force "--preserve-dup-deps"
1624 # but that could lead to other problems. So, on cygwin,
1625 # always preserve dups of -lgcc...but only -lgcc. That
1626 # way, the dependency order won't get corrupted.
1627 specialdeplibs="-lgcc"
1635 # Find all interdependent deplibs by searching for libraries
1636 # that are linked more than once (e.g. -la -lb -la)
1637 for deplib in $deplibs; do
1638 if test "X$duplicate_deps" = "Xyes" ; then
1640 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1643 libs="$libs $deplib"
1646 if test "$linkmode" = lib; then
1647 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1649 # Compute libraries that are listed more than once in $predeps
1650 # $postdeps and mark them as special (i.e., whose duplicates are
1651 # not to be eliminated).
1653 if test "X$duplicate_deps" = "Xyes" ; then
1654 for pre_post_dep in $predeps $postdeps; do
1655 case "$pre_post_deps " in
1656 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1658 pre_post_deps="$pre_post_deps $pre_post_dep"
1667 need_relink=no # whether we're linking any uninstalled libtool libraries
1668 notinst_deplibs= # not-installed libtool libraries
1669 notinst_path= # paths that contain not-installed libtool libraries
1673 for file in $dlfiles $dlprefiles; do
1677 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1689 passes="conv scan dlopen dlpreopen link"
1694 for pass in $passes; do
1695 if test "$linkmode,$pass" = "lib,link" ||
1696 test "$linkmode,$pass" = "prog,scan"; then
1700 if test "$linkmode" = prog; then
1702 dlopen) libs="$dlfiles" ;;
1703 dlpreopen) libs="$dlprefiles" ;;
1704 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1707 if test "$pass" = dlopen; then
1708 # Collect dlpreopened libraries
1709 save_deplibs="$deplibs"
1712 for deplib in $libs; do
1717 if test "$linkmode" != lib && test "$linkmode" != prog; then
1718 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1721 if test "$pass" = conv; then
1722 deplibs="$deplib $deplibs"
1725 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1726 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1727 # Search the libtool library
1728 lib="$searchdir/lib${name}.la"
1729 if test -f "$lib"; then
1734 if test "$found" != yes; then
1735 # deplib doesn't seem to be a libtool library
1736 if test "$linkmode,$pass" = "prog,link"; then
1737 compile_deplibs="$deplib $compile_deplibs"
1738 finalize_deplibs="$deplib $finalize_deplibs"
1740 deplibs="$deplib $deplibs"
1741 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1749 deplibs="$deplib $deplibs"
1750 test "$pass" = conv && continue
1751 newdependency_libs="$deplib $newdependency_libs"
1752 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1755 if test "$pass" = conv; then
1756 deplibs="$deplib $deplibs"
1759 if test "$pass" = scan; then
1760 deplibs="$deplib $deplibs"
1761 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1763 compile_deplibs="$deplib $compile_deplibs"
1764 finalize_deplibs="$deplib $finalize_deplibs"
1768 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1774 if test "$pass" = link; then
1775 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1776 # Make sure the xrpath contains only unique directories.
1779 *) xrpath="$xrpath $dir" ;;
1782 deplibs="$deplib $deplibs"
1785 *.la) lib="$deplib" ;;
1787 if test "$pass" = conv; then
1788 deplibs="$deplib $deplibs"
1793 if test "$deplibs_check_method" != pass_all; then
1795 echo "*** Warning: Trying to link with static lib archive $deplib."
1796 echo "*** I have the capability to make that library automatically link in when"
1797 echo "*** you link to this library. But I can only do this if you have a"
1798 echo "*** shared version of the library, which you do not appear to have"
1799 echo "*** because the file extensions .$libext of this argument makes me believe"
1800 echo "*** that it is just a static archive that I should not used here."
1803 echo "*** Warning: Linking the shared library $output against the"
1804 echo "*** static library $deplib is not portable!"
1805 deplibs="$deplib $deplibs"
1810 if test "$pass" != link; then
1811 deplibs="$deplib $deplibs"
1813 compile_deplibs="$deplib $compile_deplibs"
1814 finalize_deplibs="$deplib $finalize_deplibs"
1821 if test "$pass" = conv; then
1822 deplibs="$deplib $deplibs"
1823 elif test "$linkmode" = prog; then
1824 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1825 # If there is no dlopen support or we're linking statically,
1826 # we need to preload.
1827 newdlprefiles="$newdlprefiles $deplib"
1828 compile_deplibs="$deplib $compile_deplibs"
1829 finalize_deplibs="$deplib $finalize_deplibs"
1831 newdlfiles="$newdlfiles $deplib"
1841 if test "$found" = yes || test -f "$lib"; then :
1843 $echo "$modename: cannot find the library \`$lib'" 1>&2
1847 # Check to see that this really is a libtool archive.
1848 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1850 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1854 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1855 test "X$ladir" = "X$lib" && ladir="."
1863 # If the library was installed with an old release of libtool,
1864 # it will not redefine variable installed.
1869 */* | *\\*) . $lib ;;
1873 if test "$linkmode,$pass" = "lib,link" ||
1874 test "$linkmode,$pass" = "prog,scan" ||
1875 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1876 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1877 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1880 if test "$pass" = conv; then
1881 # Only check for convenience libraries
1882 deplibs="$lib $deplibs"
1883 if test -z "$libdir"; then
1884 if test -z "$old_library"; then
1885 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1888 # It is a libtool convenience library, so add in its objects.
1889 convenience="$convenience $ladir/$objdir/$old_library"
1890 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1892 for deplib in $dependency_libs; do
1893 deplibs="$deplib $deplibs"
1894 if test "X$duplicate_deps" = "Xyes" ; then
1895 case "$tmp_libs " in
1896 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1899 tmp_libs="$tmp_libs $deplib"
1901 elif test "$linkmode" != prog && test "$linkmode" != lib; then
1902 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1908 # Get the name of the library we link against.
1910 for l in $old_library $library_names; do
1913 if test -z "$linklib"; then
1914 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1918 # This library was specified with -dlopen.
1919 if test "$pass" = dlopen; then
1920 if test -z "$libdir"; then
1921 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1924 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1925 # If there is no dlname, no dlopen support or we're linking
1926 # statically, we need to preload. We also need to preload any
1927 # dependent libraries so libltdl's deplib preloader doesn't
1928 # bomb out in the load deplibs phase.
1929 dlprefiles="$dlprefiles $lib $dependency_libs"
1931 newdlfiles="$newdlfiles $lib"
1936 # We need an absolute path.
1938 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1940 abs_ladir=`cd "$ladir" && pwd`
1941 if test -z "$abs_ladir"; then
1942 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1943 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1948 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1950 # Find the relevant object directory and library name.
1951 if test "X$installed" = Xyes; then
1952 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1953 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1962 dir="$ladir/$objdir"
1963 absdir="$abs_ladir/$objdir"
1964 # Remove this search path later
1965 notinst_path="$notinst_path $abs_ladir"
1966 fi # $installed = yes
1967 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1969 # This library was specified with -dlpreopen.
1970 if test "$pass" = dlpreopen; then
1971 if test -z "$libdir"; then
1972 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1975 # Prefer using a static library (so that no silly _DYNAMIC symbols
1976 # are required to link).
1977 if test -n "$old_library"; then
1978 newdlprefiles="$newdlprefiles $dir/$old_library"
1979 # Otherwise, use the dlname, so that lt_dlopen finds it.
1980 elif test -n "$dlname"; then
1981 newdlprefiles="$newdlprefiles $dir/$dlname"
1983 newdlprefiles="$newdlprefiles $dir/$linklib"
1985 fi # $pass = dlpreopen
1987 if test -z "$libdir"; then
1988 # Link the convenience library
1989 if test "$linkmode" = lib; then
1990 deplibs="$dir/$old_library $deplibs"
1991 elif test "$linkmode,$pass" = "prog,link"; then
1992 compile_deplibs="$dir/$old_library $compile_deplibs"
1993 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1995 deplibs="$lib $deplibs" # used for prog,scan pass
2000 if test "$linkmode" = prog && test "$pass" != link; then
2001 newlib_search_path="$newlib_search_path $ladir"
2002 deplibs="$lib $deplibs"
2005 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2006 test "$build_libtool_libs" = no; then
2011 for deplib in $dependency_libs; do
2013 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2015 # Need to link against all dependency_libs?
2016 if test "$linkalldeplibs" = yes; then
2017 deplibs="$deplib $deplibs"
2019 # Need to hardcode shared library paths
2020 # or/and link against static libraries
2021 newdependency_libs="$deplib $newdependency_libs"
2023 if test "X$duplicate_deps" = "Xyes" ; then
2024 case "$tmp_libs " in
2025 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2028 tmp_libs="$tmp_libs $deplib"
2031 fi # $linkmode = prog...
2033 if test "$linkmode,$pass" = "prog,link"; then
2034 if test -n "$library_names" &&
2035 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2036 # We need to hardcode the library path
2037 if test -n "$shlibpath_var"; then
2038 # Make sure the rpath contains only unique directories.
2039 case "$temp_rpath " in
2042 *) temp_rpath="$temp_rpath $dir" ;;
2046 # Hardcode the library path.
2047 # Skip directories that are in the system default run-time
2049 case " $sys_lib_dlsearch_path " in
2052 case "$compile_rpath " in
2054 *) compile_rpath="$compile_rpath $absdir"
2058 case " $sys_lib_dlsearch_path " in
2061 case "$finalize_rpath " in
2063 *) finalize_rpath="$finalize_rpath $libdir"
2067 fi # $linkmode,$pass = prog,link...
2069 if test "$alldeplibs" = yes &&
2070 { test "$deplibs_check_method" = pass_all ||
2071 { test "$build_libtool_libs" = yes &&
2072 test -n "$library_names"; }; }; then
2073 # We only need to search for static libraries
2078 link_static=no # Whether the deplib will be linked statically
2079 if test -n "$library_names" &&
2080 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2081 if test "$installed" = no; then
2082 notinst_deplibs="$notinst_deplibs $lib"
2085 # This is a shared library
2086 if test "$linkmode" = lib &&
2087 test "$hardcode_into_libs" = yes; then
2088 # Hardcode the library path.
2089 # Skip directories that are in the system default run-time
2091 case " $sys_lib_dlsearch_path " in
2094 case "$compile_rpath " in
2096 *) compile_rpath="$compile_rpath $absdir"
2100 case " $sys_lib_dlsearch_path " in
2103 case "$finalize_rpath " in
2105 *) finalize_rpath="$finalize_rpath $libdir"
2111 if test -n "$old_archive_from_expsyms_cmds"; then
2112 # figure out the soname
2113 set dummy $library_names
2116 libname=`eval \\$echo \"$libname_spec\"`
2117 # use dlname if we got it. it's perfectly good, no?
2118 if test -n "$dlname"; then
2120 elif test -n "$soname_spec"; then
2124 major=`expr $current - $age`
2128 eval soname=\"$soname_spec\"
2133 # Make a new name for the extract_expsyms_cmds to use
2135 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2136 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2138 # If the library has no export list, then create one now
2139 if test -f "$output_objdir/$soname-def"; then :
2141 $show "extracting exported symbol list from \`$soname'"
2142 save_ifs="$IFS"; IFS='~'
2143 eval cmds=\"$extract_expsyms_cmds\"
2144 for cmd in $cmds; do
2147 $run eval "$cmd" || exit $?
2153 if test -f "$output_objdir/$newlib"; then :; else
2154 $show "generating import library for \`$soname'"
2155 save_ifs="$IFS"; IFS='~'
2156 eval cmds=\"$old_archive_from_expsyms_cmds\"
2157 for cmd in $cmds; do
2160 $run eval "$cmd" || exit $?
2164 # make sure the library variables are pointing to the new library
2167 fi # test -n "$old_archive_from_expsyms_cmds"
2169 if test "$linkmode" = prog || test "$mode" != relink; then
2174 case $hardcode_action in
2175 immediate | unsupported)
2176 if test "$hardcode_direct" = no; then
2178 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2181 elif test "$hardcode_minus_L" = no; then
2183 *-*-sunos*) add_shlibpath="$dir" ;;
2187 elif test "$hardcode_shlibpath_var" = no; then
2188 add_shlibpath="$dir"
2195 if test "$hardcode_direct" = yes; then
2197 elif test "$hardcode_minus_L" = yes; then
2200 elif test "$hardcode_shlibpath_var" = yes; then
2201 add_shlibpath="$dir"
2210 if test "$lib_linked" != yes; then
2211 $echo "$modename: configuration error: unsupported hardcode properties"
2215 if test -n "$add_shlibpath"; then
2216 case :$compile_shlibpath: in
2217 *":$add_shlibpath:"*) ;;
2218 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2221 if test "$linkmode" = prog; then
2222 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2223 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2225 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2226 test -n "$add" && deplibs="$add $deplibs"
2227 if test "$hardcode_direct" != yes && \
2228 test "$hardcode_minus_L" != yes && \
2229 test "$hardcode_shlibpath_var" = yes; then
2230 case :$finalize_shlibpath: in
2232 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2238 if test "$linkmode" = prog || test "$mode" = relink; then
2242 # Finalize command for both is simple: just hardcode it.
2243 if test "$hardcode_direct" = yes; then
2244 add="$libdir/$linklib"
2245 elif test "$hardcode_minus_L" = yes; then
2248 elif test "$hardcode_shlibpath_var" = yes; then
2249 case :$finalize_shlibpath: in
2251 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2255 # We cannot seem to hardcode it, guess we'll fake it.
2260 if test "$linkmode" = prog; then
2261 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2262 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2264 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2265 test -n "$add" && deplibs="$add $deplibs"
2268 elif test "$linkmode" = prog; then
2269 # Here we assume that one of hardcode_direct or hardcode_minus_L
2270 # is not unsupported. This is valid on all known static and
2272 if test "$hardcode_direct" != unsupported; then
2273 test -n "$old_library" && linklib="$old_library"
2274 compile_deplibs="$dir/$linklib $compile_deplibs"
2275 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2277 compile_deplibs="-l$name -L$dir $compile_deplibs"
2278 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2280 elif test "$build_libtool_libs" = yes; then
2281 # Not a shared library
2282 if test "$deplibs_check_method" != pass_all; then
2283 # We're trying link a shared library against a static one
2284 # but the system doesn't support it.
2286 # Just print a warning and add the library to dependency_libs so
2287 # that the program can be linked against the static library.
2289 echo "*** Warning: This system can not link to static lib archive $lib."
2290 echo "*** I have the capability to make that library automatically link in when"
2291 echo "*** you link to this library. But I can only do this if you have a"
2292 echo "*** shared version of the library, which you do not appear to have."
2293 if test "$module" = yes; then
2294 echo "*** But as you try to build a module library, libtool will still create "
2295 echo "*** a static module, that should work as long as the dlopening application"
2296 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2297 if test -z "$global_symbol_pipe"; then
2299 echo "*** However, this would only work if libtool was able to extract symbol"
2300 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2301 echo "*** not find such a program. So, this module is probably useless."
2302 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2304 if test "$build_old_libs" = no; then
2305 build_libtool_libs=module
2308 build_libtool_libs=no
2312 convenience="$convenience $dir/$old_library"
2313 old_convenience="$old_convenience $dir/$old_library"
2314 deplibs="$dir/$old_library $deplibs"
2317 fi # link shared/static library?
2319 if test "$linkmode" = lib; then
2320 if test -n "$dependency_libs" &&
2321 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2322 test "$link_static" = yes; }; then
2323 # Extract -R from dependency_libs
2325 for libdir in $dependency_libs; do
2327 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2329 *" $temp_xrpath "*) ;;
2330 *) xrpath="$xrpath $temp_xrpath";;
2332 *) temp_deplibs="$temp_deplibs $libdir";;
2335 dependency_libs="$temp_deplibs"
2338 newlib_search_path="$newlib_search_path $absdir"
2339 # Link against this library
2340 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2341 # ... and its dependency_libs
2343 for deplib in $dependency_libs; do
2344 newdependency_libs="$deplib $newdependency_libs"
2345 if test "X$duplicate_deps" = "Xyes" ; then
2346 case "$tmp_libs " in
2347 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2350 tmp_libs="$tmp_libs $deplib"
2353 if test "$link_all_deplibs" != no; then
2354 # Add the search paths of all dependency libraries
2355 for deplib in $dependency_libs; do
2357 -L*) path="$deplib" ;;
2359 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2360 test "X$dir" = "X$deplib" && dir="."
2361 # We need an absolute path.
2363 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2365 absdir=`cd "$dir" && pwd`
2366 if test -z "$absdir"; then
2367 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2372 if grep "^installed=no" $deplib > /dev/null; then
2373 path="-L$absdir/$objdir"
2375 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2376 if test -z "$libdir"; then
2377 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2380 if test "$absdir" != "$libdir"; then
2381 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2388 case " $deplibs " in
2390 *) deplibs="$deplibs $path" ;;
2393 fi # link_all_deplibs != no
2395 done # for deplib in $libs
2396 dependency_libs="$newdependency_libs"
2397 if test "$pass" = dlpreopen; then
2398 # Link the dlpreopened libraries before other libraries
2399 for deplib in $save_deplibs; do
2400 deplibs="$deplib $deplibs"
2403 if test "$pass" != dlopen; then
2404 if test "$pass" != conv; then
2405 # Make sure lib_search_path contains only unique directories.
2407 for dir in $newlib_search_path; do
2408 case "$lib_search_path " in
2410 *) lib_search_path="$lib_search_path $dir" ;;
2416 if test "$linkmode,$pass" != "prog,link"; then
2419 vars="compile_deplibs finalize_deplibs"
2421 for var in $vars dependency_libs; do
2422 # Add libraries to $var in reverse order
2423 eval tmp_libs=\"\$$var\"
2425 for deplib in $tmp_libs; do
2426 # FIXME: Pedantically, this is the right thing to do, so
2427 # that some nasty dependency loop isn't accidentally
2429 #new_libs="$deplib $new_libs"
2430 # Pragmatically, this seems to cause very few problems in
2433 -L*) new_libs="$deplib $new_libs" ;;
2435 # And here is the reason: when a library appears more
2436 # than once as an explicit dependence of a library, or
2437 # is implicitly linked in more than once by the
2438 # compiler, it is considered special, and multiple
2439 # occurrences thereof are not removed. Compare this
2440 # with having the same library being listed as a
2441 # dependency of multiple other libraries: in this case,
2442 # we know (pedantically, we assume) the library does not
2443 # need to be listed more than once, so we keep only the
2444 # last copy. This is not always right, but it is rare
2445 # enough that we require users that really mean to play
2446 # such unportable linking tricks to link the library
2447 # using -Wl,-lname, so that libtool does not consider it
2448 # for duplicate removal.
2449 case " $specialdeplibs " in
2450 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2452 case " $new_libs " in
2454 *) new_libs="$deplib $new_libs" ;;
2462 for deplib in $new_libs; do
2465 case " $tmp_libs " in
2467 *) tmp_libs="$tmp_libs $deplib" ;;
2470 *) tmp_libs="$tmp_libs $deplib" ;;
2473 eval $var=\"$tmp_libs\"
2477 if test "$linkmode" = prog; then
2478 dlfiles="$newdlfiles"
2479 dlprefiles="$newdlprefiles"
2484 if test -n "$deplibs"; then
2485 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2488 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2489 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2492 if test -n "$rpath"; then
2493 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2496 if test -n "$xrpath"; then
2497 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2500 if test -n "$vinfo"; then
2501 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2504 if test -n "$release"; then
2505 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2508 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2509 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2512 # Now set the variables for building old libraries.
2513 build_libtool_libs=no
2515 objs="$objs$old_deplibs"
2519 # Make sure we only generate libraries of the form `libNAME.la'.
2522 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2523 eval libname=\"$libname_spec\"
2526 if test "$module" = no; then
2527 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2531 if test "$need_lib_prefix" != no; then
2532 # Add the "lib" prefix for modules if required
2533 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2534 eval libname=\"$libname_spec\"
2536 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2541 if test -n "$objs"; then
2542 if test "$deplibs_check_method" != pass_all; then
2543 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2547 echo "*** Warning: Linking the shared library $output against the non-libtool"
2548 echo "*** objects $objs is not portable!"
2549 libobjs="$libobjs $objs"
2553 if test "$dlself" != no; then
2554 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2558 if test "$#" -gt 2; then
2559 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2564 if test -z "$rpath"; then
2565 if test "$build_libtool_libs" = yes; then
2566 # Building a libtool convenience library.
2567 # Some compilers have problems with a `.al' extension so
2568 # convenience libraries should have the same extension an
2569 # archive normally would.
2570 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2571 build_libtool_libs=convenience
2575 if test -n "$vinfo"; then
2576 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2579 if test -n "$release"; then
2580 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2584 # Parse the version information argument.
2585 save_ifs="$IFS"; IFS=':'
2586 set dummy $vinfo 0 0 0
2589 if test -n "$8"; then
2590 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2599 # Check that each of the things are valid numbers.
2601 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2603 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2604 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2610 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2612 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2613 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2619 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2621 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2622 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2627 if test "$age" -gt "$current"; then
2628 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2629 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2633 # Calculate the version variables.
2637 case $version_type in
2641 # Like Linux, but with the current version available in
2642 # verstring for coding it into the library header
2643 major=.`expr $current - $age`
2644 versuffix="$major.$age.$revision"
2645 # Darwin ld doesn't like 0 for these options...
2646 minor_current=`expr $current + 1`
2647 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2652 versuffix=".$current.$revision";
2657 versuffix=".$current";
2661 major=`expr $current - $age + 1`
2663 case $version_type in
2664 nonstopux) verstring_prefix=nonstopux ;;
2665 *) verstring_prefix=sgi ;;
2667 verstring="$verstring_prefix$major.$revision"
2669 # Add in all the interfaces that we are compatible with.
2671 while test "$loop" -ne 0; do
2672 iface=`expr $revision - $loop`
2673 loop=`expr $loop - 1`
2674 verstring="$verstring_prefix$major.$iface:$verstring"
2677 # Before this point, $major must not contain `.'.
2679 versuffix="$major.$revision"
2683 major=.`expr $current - $age`
2684 versuffix="$major.$age.$revision"
2688 major=.`expr $current - $age`
2689 versuffix=".$current.$age.$revision"
2690 verstring="$current.$age.$revision"
2692 # Add in all the interfaces that we are compatible with.
2694 while test "$loop" -ne 0; do
2695 iface=`expr $current - $loop`
2696 loop=`expr $loop - 1`
2697 verstring="$verstring:${iface}.0"
2700 # Make executables depend on our current version.
2701 verstring="$verstring:${current}.0"
2706 versuffix=".$current.$revision"
2710 # Use '-' rather than '.', since we only want one
2711 # extension on DOS 8.3 filesystems.
2712 major=`expr $current - $age`
2717 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2718 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2723 # Clear the version info if we defaulted, and they specified a release.
2724 if test -z "$vinfo" && test -n "$release"; then
2726 case $version_type in
2728 # we can't check for "0.0" in archive_cmds due to quoting
2729 # problems, so we reset it completely
2736 if test "$need_version" = no; then
2743 # Remove version info from name if versioning should be avoided
2744 if test "$avoid_version" = yes && test "$need_version" = no; then
2750 # Check to see if the archive will have undefined symbols.
2751 if test "$allow_undefined" = yes; then
2752 if test "$allow_undefined_flag" = unsupported; then
2753 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2754 build_libtool_libs=no
2758 # Don't allow undefined symbols.
2759 allow_undefined_flag="$no_undefined_flag"
2763 if test "$mode" != relink; then
2764 # Remove our outputs, but don't remove object files since they
2765 # may have been created when compiling PIC objects.
2767 tempremovelist=`echo "$output_objdir/*"`
2768 for p in $tempremovelist; do
2772 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2773 removelist="$removelist $p"
2778 if test -n "$removelist"; then
2779 $show "${rm}r $removelist"
2780 $run ${rm}r $removelist
2784 # Now set the variables for building old libraries.
2785 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2786 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2788 # Transform .lo files to .o files.
2789 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2792 # Eliminate all temporary directories.
2793 for path in $notinst_path; do
2794 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2795 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2796 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2799 if test -n "$xrpath"; then
2800 # If the user specified any rpath flags, then add them.
2802 for libdir in $xrpath; do
2803 temp_xrpath="$temp_xrpath -R$libdir"
2804 case "$finalize_rpath " in
2806 *) finalize_rpath="$finalize_rpath $libdir" ;;
2809 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2810 dependency_libs="$temp_xrpath $dependency_libs"
2814 # Make sure dlfiles contains only unique files that won't be dlpreopened
2815 old_dlfiles="$dlfiles"
2817 for lib in $old_dlfiles; do
2818 case " $dlprefiles $dlfiles " in
2820 *) dlfiles="$dlfiles $lib" ;;
2824 # Make sure dlprefiles contains only unique files
2825 old_dlprefiles="$dlprefiles"
2827 for lib in $old_dlprefiles; do
2828 case "$dlprefiles " in
2830 *) dlprefiles="$dlprefiles $lib" ;;
2834 if test "$build_libtool_libs" = yes; then
2835 if test -n "$rpath"; then
2837 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2838 # these systems don't actually have a c library (as such)!
2840 *-*-rhapsody* | *-*-darwin1.[012])
2841 # Rhapsody C library is in the System framework
2842 deplibs="$deplibs -framework System"
2845 # Don't link with libc until the a.out ld.so is fixed.
2847 *-*-openbsd* | *-*-freebsd*)
2848 # Do not include libc due to us having libc/libc_r.
2849 test "X$arg" = "X-lc" && continue
2852 # Add libc to deplibs on all other systems if necessary.
2853 if test "$build_libtool_need_lc" = "yes"; then
2854 deplibs="$deplibs -lc"
2860 # Transform deplibs into only deplibs that can be linked in shared.
2862 libname_save=$libname
2863 release_save=$release
2864 versuffix_save=$versuffix
2866 # I'm not sure if I'm treating the release correctly. I think
2867 # release should show up in the -l (ie -lgmp5) so we don't want to
2868 # add it in twice. Is that correct?
2874 case $deplibs_check_method in
2876 # Don't check for shared/static. Everything works.
2877 # This might be a little naive. We might want to check
2878 # whether the library exists or not. But this is on
2879 # osf3 & osf4 and I'm not really sure... Just
2880 # implementing what was already the behavior.
2884 # This code stresses the "libraries are programs" paradigm to its
2885 # limits. Maybe even breaks it. We compile a program, linking it
2886 # against the deplibs as a proxy for the library. Then we can check
2887 # whether they linked in statically or dynamically with ldd.
2889 cat > conftest.c <<EOF
2890 int main() { return 0; }
2893 $LTCC -o conftest conftest.c $deplibs
2894 if test "$?" -eq 0 ; then
2895 ldd_output=`ldd conftest`
2896 for i in $deplibs; do
2897 name="`expr $i : '-l\(.*\)'`"
2898 # If $name is empty we are operating on a -L argument.
2899 if test "$name" != "" && test "$name" -ne "0"; then
2900 libname=`eval \\$echo \"$libname_spec\"`
2901 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2902 set dummy $deplib_matches
2904 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2905 newdeplibs="$newdeplibs $i"
2909 echo "*** Warning: dynamic linker does not accept needed library $i."
2910 echo "*** I have the capability to make that library automatically link in when"
2911 echo "*** you link to this library. But I can only do this if you have a"
2912 echo "*** shared version of the library, which I believe you do not have"
2913 echo "*** because a test_compile did reveal that the linker did not use it for"
2914 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2917 newdeplibs="$newdeplibs $i"
2921 # Error occurred in the first compile. Let's try to salvage
2922 # the situation: Compile a separate program for each library.
2923 for i in $deplibs; do
2924 name="`expr $i : '-l\(.*\)'`"
2925 # If $name is empty we are operating on a -L argument.
2926 if test "$name" != "" && test "$name" != "0"; then
2928 $LTCC -o conftest conftest.c $i
2930 if test "$?" -eq 0 ; then
2931 ldd_output=`ldd conftest`
2932 libname=`eval \\$echo \"$libname_spec\"`
2933 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2934 set dummy $deplib_matches
2936 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2937 newdeplibs="$newdeplibs $i"
2941 echo "*** Warning: dynamic linker does not accept needed library $i."
2942 echo "*** I have the capability to make that library automatically link in when"
2943 echo "*** you link to this library. But I can only do this if you have a"
2944 echo "*** shared version of the library, which you do not appear to have"
2945 echo "*** because a test_compile did reveal that the linker did not use this one"
2946 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2951 echo "*** Warning! Library $i is needed by this library but I was not able to"
2952 echo "*** make it link in! You will probably need to install it or some"
2953 echo "*** library that it depends on before this library will be fully"
2954 echo "*** functional. Installing it before continuing would be even better."
2957 newdeplibs="$newdeplibs $i"
2963 set dummy $deplibs_check_method
2964 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2965 for a_deplib in $deplibs; do
2966 name="`expr $a_deplib : '-l\(.*\)'`"
2967 # If $name is empty we are operating on a -L argument.
2968 if test "$name" != "" && test "$name" != "0"; then
2969 libname=`eval \\$echo \"$libname_spec\"`
2970 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2971 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2972 for potent_lib in $potential_libs; do
2973 # Follow soft links.
2974 if ls -lLd "$potent_lib" 2>/dev/null \
2975 | grep " -> " >/dev/null; then
2978 # The statement above tries to avoid entering an
2979 # endless loop below, in case of cyclic links.
2980 # We might still enter an endless loop, since a link
2981 # loop can be closed while we follow links,
2983 potlib="$potent_lib"
2984 while test -h "$potlib" 2>/dev/null; do
2985 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2987 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2988 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2991 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2993 | egrep "$file_magic_regex" > /dev/null; then
2994 newdeplibs="$newdeplibs $a_deplib"
3000 if test -n "$a_deplib" ; then
3003 echo "*** Warning: linker path does not have real file for library $a_deplib."
3004 echo "*** I have the capability to make that library automatically link in when"
3005 echo "*** you link to this library. But I can only do this if you have a"
3006 echo "*** shared version of the library, which you do not appear to have"
3007 echo "*** because I did check the linker path looking for a file starting"
3008 if test -z "$potlib" ; then
3009 echo "*** with $libname but no candidates were found. (...for file magic test)"
3011 echo "*** with $libname and none of the candidates passed a file format test"
3012 echo "*** using a file magic. Last file checked: $potlib"
3016 # Add a -L argument.
3017 newdeplibs="$newdeplibs $a_deplib"
3019 done # Gone through all deplibs.
3022 set dummy $deplibs_check_method
3023 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3024 for a_deplib in $deplibs; do
3025 name="`expr $a_deplib : '-l\(.*\)'`"
3026 # If $name is empty we are operating on a -L argument.
3027 if test -n "$name" && test "$name" != "0"; then
3028 libname=`eval \\$echo \"$libname_spec\"`
3029 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3030 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3031 for potent_lib in $potential_libs; do
3032 potlib="$potent_lib" # see symlink-check above in file_magic test
3033 if eval echo \"$potent_lib\" 2>/dev/null \
3035 | egrep "$match_pattern_regex" > /dev/null; then
3036 newdeplibs="$newdeplibs $a_deplib"
3042 if test -n "$a_deplib" ; then
3045 echo "*** Warning: linker path does not have real file for library $a_deplib."
3046 echo "*** I have the capability to make that library automatically link in when"
3047 echo "*** you link to this library. But I can only do this if you have a"
3048 echo "*** shared version of the library, which you do not appear to have"
3049 echo "*** because I did check the linker path looking for a file starting"
3050 if test -z "$potlib" ; then
3051 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3053 echo "*** with $libname and none of the candidates passed a file format test"
3054 echo "*** using a regex pattern. Last file checked: $potlib"
3058 # Add a -L argument.
3059 newdeplibs="$newdeplibs $a_deplib"
3061 done # Gone through all deplibs.
3065 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3066 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3067 grep . >/dev/null; then
3069 if test "X$deplibs_check_method" = "Xnone"; then
3070 echo "*** Warning: inter-library dependencies are not supported in this platform."
3072 echo "*** Warning: inter-library dependencies are not known to be supported."
3074 echo "*** All declared inter-library dependencies are being dropped."
3079 versuffix=$versuffix_save
3081 release=$release_save
3082 libname=$libname_save
3086 *-*-rhapsody* | *-*-darwin1.[012])
3087 # On Rhapsody replace the C library is the System framework
3088 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3092 if test "$droppeddeps" = yes; then
3093 if test "$module" = yes; then
3095 echo "*** Warning: libtool could not satisfy all declared inter-library"
3096 echo "*** dependencies of module $libname. Therefore, libtool will create"
3097 echo "*** a static module, that should work as long as the dlopening"
3098 echo "*** application is linked with the -dlopen flag."
3099 if test -z "$global_symbol_pipe"; then
3101 echo "*** However, this would only work if libtool was able to extract symbol"
3102 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3103 echo "*** not find such a program. So, this module is probably useless."
3104 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3106 if test "$build_old_libs" = no; then
3107 oldlibs="$output_objdir/$libname.$libext"
3108 build_libtool_libs=module
3111 build_libtool_libs=no
3114 echo "*** The inter-library dependencies that have been dropped here will be"
3115 echo "*** automatically added whenever a program is linked with this library"
3116 echo "*** or is declared to -dlopen it."
3118 if test "$allow_undefined" = no; then
3120 echo "*** Since this library must not contain undefined symbols,"
3121 echo "*** because either the platform does not support them or"
3122 echo "*** it was explicitly requested with -no-undefined,"
3123 echo "*** libtool will only create a static version of it."
3124 if test "$build_old_libs" = no; then
3125 oldlibs="$output_objdir/$libname.$libext"
3126 build_libtool_libs=module
3129 build_libtool_libs=no
3134 # Done checking deplibs!
3138 # All the library-specific variables (install_libdir is set above).
3143 # Test again, we may have decided not to build it any more
3144 if test "$build_libtool_libs" = yes; then
3145 if test "$hardcode_into_libs" = yes; then
3146 # Hardcode the library paths
3149 rpath="$finalize_rpath"
3150 test "$mode" != relink && rpath="$compile_rpath$rpath"
3151 for libdir in $rpath; do
3152 if test -n "$hardcode_libdir_flag_spec"; then
3153 if test -n "$hardcode_libdir_separator"; then
3154 if test -z "$hardcode_libdirs"; then
3155 hardcode_libdirs="$libdir"
3157 # Just accumulate the unique libdirs.
3158 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3159 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3162 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3167 eval flag=\"$hardcode_libdir_flag_spec\"
3168 dep_rpath="$dep_rpath $flag"
3170 elif test -n "$runpath_var"; then
3171 case "$perm_rpath " in
3173 *) perm_rpath="$perm_rpath $libdir" ;;
3177 # Substitute the hardcoded libdirs into the rpath.
3178 if test -n "$hardcode_libdir_separator" &&
3179 test -n "$hardcode_libdirs"; then
3180 libdir="$hardcode_libdirs"
3181 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3183 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3184 # We should set the runpath_var.
3186 for dir in $perm_rpath; do
3189 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3191 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3194 shlibpath="$finalize_shlibpath"
3195 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3196 if test -n "$shlibpath"; then
3197 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3200 # Get the real and link names of the library.
3201 eval library_names=\"$library_names_spec\"
3202 set dummy $library_names
3206 if test -n "$soname_spec"; then
3207 eval soname=\"$soname_spec\"
3211 if test -z "$dlname"; then
3215 lib="$output_objdir/$realname"
3218 linknames="$linknames $link"
3221 # Use standard objects if they are pic
3222 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3224 # Prepare the list of exported symbols
3225 if test -z "$export_symbols"; then
3226 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3227 $show "generating symbol list for \`$libname.la'"
3228 export_symbols="$output_objdir/$libname.exp"
3229 $run $rm $export_symbols
3230 eval cmds=\"$export_symbols_cmds\"
3231 save_ifs="$IFS"; IFS='~'
3232 for cmd in $cmds; do
3234 if len=`expr "X$cmd" : ".*"` &&
3235 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3237 $run eval "$cmd" || exit $?
3238 skipped_export=false
3240 # The command line is too long to execute in one step.
3241 $show "using reloadable object file for export list..."
3246 if test -n "$export_symbols_regex"; then
3247 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3248 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3249 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3250 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3255 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3256 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3259 if test -n "$convenience"; then
3260 if test -n "$whole_archive_flag_spec"; then
3261 save_libobjs=$libobjs
3262 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3264 gentop="$output_objdir/${outputname}x"
3265 $show "${rm}r $gentop"
3266 $run ${rm}r "$gentop"
3267 $show "$mkdir $gentop"
3268 $run $mkdir "$gentop"
3270 if test "$status" -ne 0 && test ! -d "$gentop"; then
3273 generated="$generated $gentop"
3275 for xlib in $convenience; do
3276 # Extract the objects.
3278 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3279 *) xabs=`pwd`"/$xlib" ;;
3281 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3282 xdir="$gentop/$xlib"
3284 $show "${rm}r $xdir"
3286 $show "$mkdir $xdir"
3289 if test "$status" -ne 0 && test ! -d "$xdir"; then
3292 $show "(cd $xdir && $AR x $xabs)"
3293 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3295 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3300 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3301 eval flag=\"$thread_safe_flag_spec\"
3302 linker_flags="$linker_flags $flag"
3305 # Make a backup of the uninstalled library when relinking
3306 if test "$mode" = relink; then
3307 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3310 # Do each of the archive commands.
3311 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3312 eval cmds=\"$archive_expsym_cmds\"
3314 save_deplibs="$deplibs"
3315 for conv in $convenience; do
3317 for test_deplib in $deplibs; do
3318 if test "$test_deplib" != "$conv"; then
3319 tmp_deplibs="$tmp_deplibs $test_deplib"
3322 deplibs="$tmp_deplibs"
3324 eval cmds=\"$archive_cmds\"
3325 deplibs="$save_deplibs"
3328 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3329 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3332 # The command line is too long to link in one step, link piecewise.
3333 $echo "creating reloadable object files..."
3335 # Save the value of $output and $libobjs because we want to
3336 # use them later. If we have whole_archive_flag_spec, we
3337 # want to use save_libobjs as it was before
3338 # whole_archive_flag_spec was expanded, because we can't
3339 # assume the linker understands whole_archive_flag_spec.
3340 # This may have to be revisited, in case too many
3341 # convenience libraries get linked in and end up exceeding
3343 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3344 save_libobjs=$libobjs
3348 # Clear the reloadable object creation command queue and
3349 # initialize k to one.
3356 output=$output_objdir/$save_output-${k}.$objext
3357 # Loop over the list of objects to be linked.
3358 for obj in $save_libobjs
3360 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3361 if test "X$objlist" = X ||
3362 { len=`expr "X$test_cmds" : ".*"` &&
3363 test "$len" -le "$max_cmd_len"; }; then
3364 objlist="$objlist $obj"
3366 # The command $test_cmds is almost too long, add a
3367 # command to the queue.
3368 if test "$k" -eq 1 ; then
3369 # The first file doesn't have a previous command to add.
3370 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3372 # All subsequent reloadable object files will link in
3373 # the last one created.
3374 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3376 last_robj=$output_objdir/$save_output-${k}.$objext
3378 output=$output_objdir/$save_output-${k}.$objext
3383 # Handle the remaining objects by creating one last
3384 # reloadable object file. All subsequent reloadable object
3385 # files will link in the last one created.
3386 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3387 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3389 if ${skipped_export-false}; then
3390 $show "generating symbol list for \`$libname.la'"
3391 export_symbols="$output_objdir/$libname.exp"
3392 $run $rm $export_symbols
3394 # Append the command to create the export file.
3395 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3398 # Set up a command to remove the reloadale object files
3399 # after they are used.
3401 while test "$i" -lt "$k"
3404 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3407 $echo "creating a temporary reloadable object file: $output"
3409 # Loop through the commands generated above and execute them.
3410 save_ifs="$IFS"; IFS='~'
3411 for cmd in $concat_cmds; do
3414 $run eval "$cmd" || exit $?
3419 # Restore the value of output.
3422 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3423 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3425 # Expand the library linking commands again to reset the
3426 # value of $libobjs for piecewise linking.
3428 # Do each of the archive commands.
3429 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3430 eval cmds=\"$archive_expsym_cmds\"
3432 eval cmds=\"$archive_cmds\"
3435 # Append the command to remove the reloadable object files
3436 # to the just-reset $cmds.
3437 eval cmds=\"\$cmds~$rm $delfiles\"
3439 save_ifs="$IFS"; IFS='~'
3440 for cmd in $cmds; do
3443 $run eval "$cmd" || exit $?
3447 # Restore the uninstalled library and exit
3448 if test "$mode" = relink; then
3449 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3453 # Create links to the real library.
3454 for linkname in $linknames; do
3455 if test "$realname" != "$linkname"; then
3456 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3457 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3461 # If -module or -export-dynamic was specified, set the dlname.
3462 if test "$module" = yes || test "$export_dynamic" = yes; then
3463 # On all known operating systems, these are identical.
3470 if test -n "$deplibs"; then
3471 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3474 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3475 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3478 if test -n "$rpath"; then
3479 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3482 if test -n "$xrpath"; then
3483 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3486 if test -n "$vinfo"; then
3487 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3490 if test -n "$release"; then
3491 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3496 if test -n "$objs$old_deplibs"; then
3497 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3501 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3509 # Delete the old objects.
3510 $run $rm $obj $libobj
3512 # Objects from convenience libraries. This assumes
3513 # single-version convenience libraries. Whenever we create
3514 # different ones for PIC/non-PIC, this we'll have to duplicate
3518 # reload_cmds runs $LD directly, so let us get rid of
3519 # -Wl from whole_archive_flag_spec
3522 if test -n "$convenience"; then
3523 if test -n "$whole_archive_flag_spec"; then
3524 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3526 gentop="$output_objdir/${obj}x"
3527 $show "${rm}r $gentop"
3528 $run ${rm}r "$gentop"
3529 $show "$mkdir $gentop"
3530 $run $mkdir "$gentop"
3532 if test "$status" -ne 0 && test ! -d "$gentop"; then
3535 generated="$generated $gentop"
3537 for xlib in $convenience; do
3538 # Extract the objects.
3540 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3541 *) xabs=`pwd`"/$xlib" ;;
3543 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3544 xdir="$gentop/$xlib"
3546 $show "${rm}r $xdir"
3548 $show "$mkdir $xdir"
3551 if test "$status" -ne 0 && test ! -d "$xdir"; then
3554 $show "(cd $xdir && $AR x $xabs)"
3555 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3557 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3562 # Create the old-style object.
3563 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
3566 eval cmds=\"$reload_cmds\"
3567 save_ifs="$IFS"; IFS='~'
3568 for cmd in $cmds; do
3571 $run eval "$cmd" || exit $?
3575 # Exit if we aren't doing a library object file.
3576 if test -z "$libobj"; then
3577 if test -n "$gentop"; then
3578 $show "${rm}r $gentop"
3585 if test "$build_libtool_libs" != yes; then
3586 if test -n "$gentop"; then
3587 $show "${rm}r $gentop"
3591 # Create an invalid libtool object if no PIC, so that we don't
3592 # accidentally link it into a program.
3593 # $show "echo timestamp > $libobj"
3594 # $run eval "echo timestamp > $libobj" || exit $?
3598 if test -n "$pic_flag" || test "$pic_mode" != default; then
3599 # Only do commands if we really have different PIC objects.
3600 reload_objs="$libobjs $reload_conv_objs"
3602 eval cmds=\"$reload_cmds\"
3603 save_ifs="$IFS"; IFS='~'
3604 for cmd in $cmds; do
3607 $run eval "$cmd" || exit $?
3612 if test -n "$gentop"; then
3613 $show "${rm}r $gentop"
3622 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3624 if test -n "$vinfo"; then
3625 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3628 if test -n "$release"; then
3629 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3632 if test "$preload" = yes; then
3633 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3634 test "$dlopen_self_static" = unknown; then
3635 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3640 *-*-rhapsody* | *-*-darwin1.[012])
3641 # On Rhapsody replace the C library is the System framework
3642 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3643 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3647 compile_command="$compile_command $compile_deplibs"
3648 finalize_command="$finalize_command $finalize_deplibs"
3650 if test -n "$rpath$xrpath"; then
3651 # If the user specified any rpath flags, then add them.
3652 for libdir in $rpath $xrpath; do
3653 # This is the magic to use -rpath.
3654 case "$finalize_rpath " in
3656 *) finalize_rpath="$finalize_rpath $libdir" ;;
3661 # Now hardcode the library paths
3664 for libdir in $compile_rpath $finalize_rpath; do
3665 if test -n "$hardcode_libdir_flag_spec"; then
3666 if test -n "$hardcode_libdir_separator"; then
3667 if test -z "$hardcode_libdirs"; then
3668 hardcode_libdirs="$libdir"
3670 # Just accumulate the unique libdirs.
3671 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3672 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3675 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3680 eval flag=\"$hardcode_libdir_flag_spec\"
3681 rpath="$rpath $flag"
3683 elif test -n "$runpath_var"; then
3684 case "$perm_rpath " in
3686 *) perm_rpath="$perm_rpath $libdir" ;;
3690 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3691 case :$dllsearchpath: in
3693 *) dllsearchpath="$dllsearchpath:$libdir";;
3698 # Substitute the hardcoded libdirs into the rpath.
3699 if test -n "$hardcode_libdir_separator" &&
3700 test -n "$hardcode_libdirs"; then
3701 libdir="$hardcode_libdirs"
3702 eval rpath=\" $hardcode_libdir_flag_spec\"
3704 compile_rpath="$rpath"
3708 for libdir in $finalize_rpath; do
3709 if test -n "$hardcode_libdir_flag_spec"; then
3710 if test -n "$hardcode_libdir_separator"; then
3711 if test -z "$hardcode_libdirs"; then
3712 hardcode_libdirs="$libdir"
3714 # Just accumulate the unique libdirs.
3715 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3716 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3719 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3724 eval flag=\"$hardcode_libdir_flag_spec\"
3725 rpath="$rpath $flag"
3727 elif test -n "$runpath_var"; then
3728 case "$finalize_perm_rpath " in
3730 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3734 # Substitute the hardcoded libdirs into the rpath.
3735 if test -n "$hardcode_libdir_separator" &&
3736 test -n "$hardcode_libdirs"; then
3737 libdir="$hardcode_libdirs"
3738 eval rpath=\" $hardcode_libdir_flag_spec\"
3740 finalize_rpath="$rpath"
3742 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3743 # Transform all the library objects into standard objects.
3744 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3745 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3749 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3750 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3751 dlsyms="${outputname}S.c"
3753 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3757 if test -n "$dlsyms"; then
3761 # Discover the nlist of each of the dlfiles.
3762 nlist="$output_objdir/${outputname}.nm"
3764 $show "$rm $nlist ${nlist}S ${nlist}T"
3765 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3767 # Parse the name list into a source file.
3768 $show "creating $output_objdir/$dlsyms"
3770 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3771 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3772 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3778 /* Prevent the only kind of declaration conflicts we can make. */
3779 #define lt_preloaded_symbols some_other_symbol
3781 /* External symbol declarations for the compiler. */\
3784 if test "$dlself" = yes; then
3785 $show "generating symbol list for \`$output'"
3787 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3789 # Add our own program objects to the symbol list.
3790 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3791 for arg in $progfiles; do
3792 $show "extracting global C symbols from \`$arg'"
3793 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3796 if test -n "$exclude_expsyms"; then
3797 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3798 $run eval '$mv "$nlist"T "$nlist"'
3801 if test -n "$export_symbols_regex"; then
3802 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3803 $run eval '$mv "$nlist"T "$nlist"'
3806 # Prepare the list of exported symbols
3807 if test -z "$export_symbols"; then
3808 export_symbols="$output_objdir/$output.exp"
3809 $run $rm $export_symbols
3810 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3812 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3813 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3814 $run eval 'mv "$nlist"T "$nlist"'
3818 for arg in $dlprefiles; do
3819 $show "extracting global C symbols from \`$arg'"
3820 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3821 $run eval 'echo ": $name " >> "$nlist"'
3822 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3825 if test -z "$run"; then
3826 # Make sure we have at least an empty file.
3827 test -f "$nlist" || : > "$nlist"
3829 if test -n "$exclude_expsyms"; then
3830 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3831 $mv "$nlist"T "$nlist"
3834 # Try sorting and uniquifying the output.
3835 if grep -v "^: " < "$nlist" |
3836 if sort -k 3 </dev/null >/dev/null 2>&1; then
3841 uniq > "$nlist"S; then
3844 grep -v "^: " < "$nlist" > "$nlist"S
3847 if test -f "$nlist"S; then
3848 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3850 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3853 $echo >> "$output_objdir/$dlsyms" "\
3855 #undef lt_preloaded_symbols
3857 #if defined (__STDC__) && __STDC__
3858 # define lt_ptr void *
3860 # define lt_ptr char *
3864 /* The mapping between symbol names and symbols. */
3869 lt_preloaded_symbols[] =
3873 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3875 $echo >> "$output_objdir/$dlsyms" "\
3879 /* This works around a problem in FreeBSD linker */
3880 #ifdef FREEBSD_WORKAROUND
3881 static const void *lt_preloaded_setup() {
3882 return lt_preloaded_symbols;
3892 pic_flag_for_symtable=
3894 # compiling the symbol table file with pic_flag works around
3895 # a FreeBSD bug that causes programs to crash when -lm is
3896 # linked before any other PIC object. But we must not use
3897 # pic_flag when linking with -static. The problem exists in
3898 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3899 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3900 case "$compile_command " in
3902 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3905 case "$compile_command " in
3907 *) pic_flag_for_symtable=" $pic_flag";;
3911 # Now compile the dynamic symbol file.
3912 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3913 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3915 # Clean up the generated files.
3916 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3917 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3919 # Transform the symbol file into the correct name.
3920 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3921 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3924 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3929 # We keep going just in case the user didn't refer to
3930 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3931 # really was required.
3933 # Nullify the symbol file.
3934 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3935 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3938 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3939 # Replace the output file specification.
3940 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3941 link_command="$compile_command$compile_rpath"
3943 # We have no uninstalled library dependencies, so finalize right now.
3944 $show "$link_command"
3945 $run eval "$link_command"
3948 # Delete the generated files.
3949 if test -n "$dlsyms"; then
3950 $show "$rm $output_objdir/${outputname}S.${objext}"
3951 $run $rm "$output_objdir/${outputname}S.${objext}"
3957 if test -n "$shlibpath_var"; then
3958 # We should set the shlibpath_var
3960 for dir in $temp_rpath; do
3962 [\\/]* | [A-Za-z]:[\\/]*)
3967 # Relative path: add a thisdir entry.
3968 rpath="$rpath\$thisdir/$dir:"
3975 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3976 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3978 if test -n "$finalize_shlibpath"; then
3979 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3984 if test -n "$runpath_var"; then
3985 if test -n "$perm_rpath"; then
3986 # We should set the runpath_var.
3988 for dir in $perm_rpath; do
3991 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3993 if test -n "$finalize_perm_rpath"; then
3994 # We should set the runpath_var.
3996 for dir in $finalize_perm_rpath; do
3999 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4003 if test "$no_install" = yes; then
4004 # We don't need to create a wrapper script.
4005 link_command="$compile_var$compile_command$compile_rpath"
4006 # Replace the output file specification.
4007 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4008 # Delete the old output file.
4010 # Link the executable and exit
4011 $show "$link_command"
4012 $run eval "$link_command" || exit $?
4016 if test "$hardcode_action" = relink; then
4017 # Fast installation is not supported
4018 link_command="$compile_var$compile_command$compile_rpath"
4019 relink_command="$finalize_var$finalize_command$finalize_rpath"
4021 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4022 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4024 if test "$fast_install" != no; then
4025 link_command="$finalize_var$compile_command$finalize_rpath"
4026 if test "$fast_install" = yes; then
4027 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4029 # fast_install is set to needless
4033 link_command="$compile_var$compile_command$compile_rpath"
4034 relink_command="$finalize_var$finalize_command$finalize_rpath"
4038 # Replace the output file specification.
4039 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4041 # Delete the old output files.
4042 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4044 $show "$link_command"
4045 $run eval "$link_command" || exit $?
4047 # Now create the wrapper script.
4048 $show "creating $output"
4050 # Quote the relink command for shipping.
4051 if test -n "$relink_command"; then
4052 # Preserve any variables that may affect compiler behavior
4053 for var in $variables_saved_for_relink; do
4054 if eval test -z \"\${$var+set}\"; then
4055 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4056 elif eval var_value=\$$var; test -z "$var_value"; then
4057 relink_command="$var=; export $var; $relink_command"
4059 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4060 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4063 relink_command="(cd `pwd`; $relink_command)"
4064 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4067 # Quote $echo for shipping.
4068 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4070 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4071 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4073 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4075 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4078 # Only actually do things if our run command is non-null.
4079 if test -z "$run"; then
4080 # win32 will think the script is a binary if it has
4081 # a .exe suffix, so we strip it off here.
4083 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4085 # test for cygwin because mv fails w/o .exe extensions
4089 outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
4093 trap "$rm $output; exit 1" 1 2 15
4098 # $output - temporary wrapper script for $objdir/$outputname
4099 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4101 # The $output program cannot be directly executed until all the libtool
4102 # libraries that it depends on are installed.
4104 # This wrapper script should never be moved out of the build directory.
4105 # If it is, it will not operate correctly.
4107 # Sed substitution that helps us do robust quoting. It backslashifies
4108 # metacharacters that are still active within double-quoted strings.
4109 Xsed='${SED} -e 1s/^X//'
4110 sed_quote_subst='$sed_quote_subst'
4112 # The HP-UX ksh and POSIX shell print the target directory to stdout
4114 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4116 relink_command=\"$relink_command\"
4118 # This environment variable determines our operation mode.
4119 if test \"\$libtool_install_magic\" = \"$magic\"; then
4120 # install mode needs the following variable:
4121 notinst_deplibs='$notinst_deplibs'
4123 # When we are sourced in execute mode, \$file and \$echo are already set.
4124 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4127 # Make sure echo works.
4128 if test \"X\$1\" = X--no-reexec; then
4129 # Discard the --no-reexec flag, and continue.
4131 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4132 # Yippee, \$echo works!
4135 # Restart under the correct shell, and then maybe \$echo will work.
4136 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4142 # Find the directory that this script lives in.
4143 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4144 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4146 # Follow symbolic links until we get to the real thisdir.
4147 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4148 while test -n \"\$file\"; do
4149 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4151 # If there was a directory component, then change thisdir.
4152 if test \"x\$destdir\" != \"x\$file\"; then
4153 case \"\$destdir\" in
4154 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4155 *) thisdir=\"\$thisdir/\$destdir\" ;;
4159 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4160 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4163 # Try to get the absolute directory name.
4164 absdir=\`cd \"\$thisdir\" && pwd\`
4165 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4168 if test "$fast_install" = yes; then
4170 program=lt-'$outputname'$exeext
4171 progdir=\"\$thisdir/$objdir\"
4173 if test ! -f \"\$progdir/\$program\" || \\
4174 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4175 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4177 file=\"\$\$-\$program\"
4179 if test ! -d \"\$progdir\"; then
4180 $mkdir \"\$progdir\"
4182 $rm \"\$progdir/\$file\"
4187 # relink executable if necessary
4188 if test -n \"\$relink_command\"; then
4189 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4191 $echo \"\$relink_command_output\" >&2
4192 $rm \"\$progdir/\$file\"
4197 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4198 { $rm \"\$progdir/\$program\";
4199 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4200 $rm \"\$progdir/\$file\"
4204 program='$outputname'
4205 progdir=\"\$thisdir/$objdir\"
4211 if test -f \"\$progdir/\$program\"; then"
4213 # Export our shlibpath_var if we have one.
4214 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4216 # Add our own library path to $shlibpath_var
4217 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4219 # Some systems cannot cope with colon-terminated $shlibpath_var
4220 # The second colon is a workaround for a bug in BeOS R4 sed
4221 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4223 export $shlibpath_var
4227 # fixup the dll searchpath if we need to.
4228 if test -n "$dllsearchpath"; then
4230 # Add the dll search path components to the executable PATH
4231 PATH=$dllsearchpath:\$PATH
4236 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4237 # Run the actual program with our arguments.
4240 # win32 systems need to use the prog path for dll
4242 *-*-cygwin* | *-*-pw32*)
4244 exec \$progdir/\$program \${1+\"\$@\"}
4248 # Backslashes separate directories on plain windows
4249 *-*-mingw | *-*-os2*)
4251 exec \$progdir\\\\\$program \${1+\"\$@\"}
4257 # Export the path to the program.
4258 PATH=\"\$progdir:\$PATH\"
4261 exec \$program \${1+\"\$@\"}
4266 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4270 # The program doesn't exist.
4271 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4272 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4273 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4284 # See if we need to build an old-fashioned archive.
4285 for oldlib in $oldlibs; do
4287 if test "$build_libtool_libs" = convenience; then
4288 oldobjs="$libobjs_save"
4289 addlibs="$convenience"
4290 build_libtool_libs=no
4292 if test "$build_libtool_libs" = module; then
4293 oldobjs="$libobjs_save"
4294 build_libtool_libs=no
4296 oldobjs="$old_deplibs $non_pic_objects"
4298 addlibs="$old_convenience"
4301 if test -n "$addlibs"; then
4302 gentop="$output_objdir/${outputname}x"
4303 $show "${rm}r $gentop"
4304 $run ${rm}r "$gentop"
4305 $show "$mkdir $gentop"
4306 $run $mkdir "$gentop"
4308 if test "$status" -ne 0 && test ! -d "$gentop"; then
4311 generated="$generated $gentop"
4313 # Add in members from convenience archives.
4314 for xlib in $addlibs; do
4315 # Extract the objects.
4317 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4318 *) xabs=`pwd`"/$xlib" ;;
4320 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4321 xdir="$gentop/$xlib"
4323 $show "${rm}r $xdir"
4325 $show "$mkdir $xdir"
4328 if test "$status" -ne 0 && test ! -d "$xdir"; then
4331 $show "(cd $xdir && $AR x $xabs)"
4332 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4334 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4338 # Do each command in the archive commands.
4339 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4340 eval cmds=\"$old_archive_from_new_cmds\"
4342 eval cmds=\"$old_archive_cmds\"
4344 if len=`expr "X$cmds" : ".*"` &&
4345 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4348 # the command line is too long to link in one step, link in parts
4349 $echo "using piecewise archive linking..."
4354 save_oldobjs=$oldobjs
4355 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4356 # encoded into archives. This makes 'ar r' malfunction in
4357 # this piecewise linking case whenever conflicting object
4358 # names appear in distinct ar calls; check, warn and compensate.
4359 if (for obj in $save_oldobjs
4361 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4362 done | sort | sort -uc >/dev/null 2>&1); then
4365 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4366 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4369 for obj in $save_oldobjs
4371 oldobjs="$objlist $obj"
4372 objlist="$objlist $obj"
4373 eval test_cmds=\"$old_archive_cmds\"
4374 if len=`expr "X$test_cmds" : ".*"` &&
4375 test "$len" -le "$max_cmd_len"; then
4378 # the above command should be used before it gets too long
4380 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4381 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4387 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4390 save_ifs="$IFS"; IFS='~'
4391 for cmd in $cmds; do
4394 $run eval "$cmd" || exit $?
4399 if test -n "$generated"; then
4400 $show "${rm}r$generated"
4401 $run ${rm}r$generated
4404 # Now create the libtool archive.
4408 test "$build_old_libs" = yes && old_library="$libname.$libext"
4409 $show "creating $output"
4411 # Preserve any variables that may affect compiler behavior
4412 for var in $variables_saved_for_relink; do
4413 if eval test -z \"\${$var+set}\"; then
4414 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4415 elif eval var_value=\$$var; test -z "$var_value"; then
4416 relink_command="$var=; export $var; $relink_command"
4418 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4419 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4422 # Quote the link command for shipping.
4423 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4424 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4426 # Only create the output if not a dry run.
4427 if test -z "$run"; then
4428 for installed in no yes; do
4429 if test "$installed" = yes; then
4430 if test -z "$install_libdir"; then
4433 output="$output_objdir/$outputname"i
4434 # Replace all uninstalled libtool libraries with the installed ones
4436 for deplib in $dependency_libs; do
4439 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4440 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4441 if test -z "$libdir"; then
4442 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4445 newdependency_libs="$newdependency_libs $libdir/$name"
4447 *) newdependency_libs="$newdependency_libs $deplib" ;;
4450 dependency_libs="$newdependency_libs"
4452 for lib in $dlfiles; do
4453 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4454 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4455 if test -z "$libdir"; then
4456 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4459 newdlfiles="$newdlfiles $libdir/$name"
4461 dlfiles="$newdlfiles"
4463 for lib in $dlprefiles; do
4464 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4465 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4466 if test -z "$libdir"; then
4467 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4470 newdlprefiles="$newdlprefiles $libdir/$name"
4472 dlprefiles="$newdlprefiles"
4475 # place dlname in correct position for cygwin
4477 case $host,$output,$installed,$module,$dlname in
4478 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4481 # $outputname - a libtool library file
4482 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4484 # Please DO NOT delete this file!
4485 # It is necessary for linking the library.
4487 # The name that we can dlopen(3).
4490 # Names of this library.
4491 library_names='$library_names'
4493 # The name of the static archive.
4494 old_library='$old_library'
4496 # Libraries that this one depends upon.
4497 dependency_libs='$dependency_libs'
4499 # Version information for $libname.
4504 # Is this an already installed library?
4505 installed=$installed
4507 # Files to dlopen/dlpreopen
4509 dlpreopen='$dlprefiles'
4511 # Directory that this library needs to be installed in:
4512 libdir='$install_libdir'"
4513 if test "$installed" = no && test "$need_relink" = yes; then
4515 relink_command=\"$relink_command\""
4520 # Do a symbolic link so that the libtool archive can be found in
4521 # LD_LIBRARY_PATH before the program is installed.
4522 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4523 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4529 # libtool install mode
4531 modename="$modename: install"
4533 # There may be an optional sh(1) argument at the beginning of
4534 # install_prog (especially on Windows NT).
4535 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4536 # Allow the use of GNU shtool's install command.
4537 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4538 # Aesthetically quote it.
4539 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4541 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4545 install_prog="$arg "
4553 # The real first argument should be the name of the installation program.
4554 # Aesthetically quote it.
4555 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4557 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4561 install_prog="$install_prog$arg"
4563 # We need to accept at least all the BSD install flags.
4573 if test -n "$dest"; then
4574 files="$files $dest"
4592 # If the previous option needed an argument, then skip it.
4593 if test -n "$prev"; then
4602 # Aesthetically quote the argument.
4603 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4605 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4609 install_prog="$install_prog $arg"
4612 if test -z "$install_prog"; then
4613 $echo "$modename: you must specify an install program" 1>&2
4618 if test -n "$prev"; then
4619 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4624 if test -z "$files"; then
4625 if test -z "$dest"; then
4626 $echo "$modename: no file or destination specified" 1>&2
4628 $echo "$modename: you must specify a destination" 1>&2
4634 # Strip any trailing slash from the destination.
4635 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4637 # Check to see that the destination is a directory.
4638 test -d "$dest" && isdir=yes
4639 if test "$isdir" = yes; then
4643 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4644 test "X$destdir" = "X$dest" && destdir=.
4645 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4647 # Not a directory, so check to see that there is only one file specified.
4649 if test "$#" -gt 2; then
4650 $echo "$modename: \`$dest' is not a directory" 1>&2
4656 [\\/]* | [A-Za-z]:[\\/]*) ;;
4658 for file in $files; do
4662 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4671 # This variable tells wrapper scripts just to set variables rather
4672 # than running their programs.
4673 libtool_install_magic="$magic"
4678 for file in $files; do
4680 # Do each installation.
4683 # Do the static libraries later.
4684 staticlibs="$staticlibs $file"
4688 # Check to see that this really is a libtool archive.
4689 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4691 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4699 # If there is no directory component, then add one.
4701 */* | *\\*) . $file ;;
4705 # Add the libdir to current_libdirs if it is the destination.
4706 if test "X$destdir" = "X$libdir"; then
4707 case "$current_libdirs " in
4709 *) current_libdirs="$current_libdirs $libdir" ;;
4712 # Note the libdir as a future libdir.
4713 case "$future_libdirs " in
4715 *) future_libdirs="$future_libdirs $libdir" ;;
4719 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4720 test "X$dir" = "X$file/" && dir=
4723 if test -n "$relink_command"; then
4724 $echo "$modename: warning: relinking \`$file'" 1>&2
4725 $show "$relink_command"
4726 if $run eval "$relink_command"; then :
4728 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4733 # See the names of the shared library.
4734 set dummy $library_names
4735 if test -n "$2"; then
4741 test -n "$relink_command" && srcname="$realname"T
4743 # Install the shared library and build the symlinks.
4744 $show "$install_prog $dir/$srcname $destdir/$realname"
4745 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4746 if test -n "$stripme" && test -n "$striplib"; then
4747 $show "$striplib $destdir/$realname"
4748 $run eval "$striplib $destdir/$realname" || exit $?
4751 if test "$#" -gt 0; then
4752 # Delete the old symlinks, and create new ones.
4755 if test "$linkname" != "$realname"; then
4756 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4757 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4762 # Do each command in the postinstall commands.
4763 lib="$destdir/$realname"
4764 eval cmds=\"$postinstall_cmds\"
4765 save_ifs="$IFS"; IFS='~'
4766 for cmd in $cmds; do
4769 $run eval "$cmd" || exit $?
4774 # Install the pseudo-library for information purposes.
4775 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4776 instname="$dir/$name"i
4777 $show "$install_prog $instname $destdir/$name"
4778 $run eval "$install_prog $instname $destdir/$name" || exit $?
4780 # Maybe install the static library, too.
4781 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4785 # Install (i.e. copy) a libtool object.
4787 # Figure out destination file name, if it wasn't already specified.
4788 if test -n "$destname"; then
4789 destfile="$destdir/$destname"
4791 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4792 destfile="$destdir/$destfile"
4795 # Deduce the name of the destination old-style object file.
4798 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4801 staticdest="$destfile"
4805 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4811 # Install the libtool object if requested.
4812 if test -n "$destfile"; then
4813 $show "$install_prog $file $destfile"
4814 $run eval "$install_prog $file $destfile" || exit $?
4817 # Install the old object if enabled.
4818 if test "$build_old_libs" = yes; then
4819 # Deduce the name of the old-style object file.
4820 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4822 $show "$install_prog $staticobj $staticdest"
4823 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4829 # Figure out destination file name, if it wasn't already specified.
4830 if test -n "$destname"; then
4831 destfile="$destdir/$destname"
4833 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4834 destfile="$destdir/$destfile"
4837 # If the file is missing, and there is a .exe on the end, strip it
4838 # because it is most likely a libtool script we actually want to
4843 if test ! -f "$file"; then
4844 file=`echo $file|${SED} 's,.exe$,,'`
4850 # Do a test to see if this is really a libtool program.
4853 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4859 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4863 # If there is no directory component, then add one.
4865 */* | *\\*) . $wrapper ;;
4869 # Check the variables that should have been set.
4870 if test -z "$notinst_deplibs"; then
4871 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4876 for lib in $notinst_deplibs; do
4877 # Check to see that each library is installed.
4879 if test -f "$lib"; then
4880 # If there is no directory component, then add one.
4882 */* | *\\*) . $lib ;;
4886 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4887 if test -n "$libdir" && test ! -f "$libfile"; then
4888 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4894 # If there is no directory component, then add one.
4896 */* | *\\*) . $file ;;
4901 if test "$fast_install" = no && test -n "$relink_command"; then
4902 if test "$finalize" = yes && test -z "$run"; then
4904 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4905 tmpdir="$tmpdir/libtool-$$"
4906 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4908 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4911 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
4912 outputname="$tmpdir/$file"
4913 # Replace the output file specification.
4914 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4916 $show "$relink_command"
4917 if $run eval "$relink_command"; then :
4919 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4925 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4928 # Install the binary that we compiled earlier.
4929 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4933 # remove .exe since cygwin /usr/bin/install will append another
4935 case $install_prog,$host in
4936 */usr/bin/install*,*cygwin*)
4937 case $file:$destfile in
4942 destfile=$destfile.exe
4945 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4950 $show "$install_prog$stripme $file $destfile"
4951 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4952 test -n "$outputname" && ${rm}r "$tmpdir"
4957 for file in $staticlibs; do
4958 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4960 # Set up the ranlib parameters.
4961 oldlib="$destdir/$name"
4963 $show "$install_prog $file $oldlib"
4964 $run eval "$install_prog \$file \$oldlib" || exit $?
4966 if test -n "$stripme" && test -n "$striplib"; then
4967 $show "$old_striplib $oldlib"
4968 $run eval "$old_striplib $oldlib" || exit $?
4971 # Do each command in the postinstall commands.
4972 eval cmds=\"$old_postinstall_cmds\"
4973 save_ifs="$IFS"; IFS='~'
4974 for cmd in $cmds; do
4977 $run eval "$cmd" || exit $?
4982 if test -n "$future_libdirs"; then
4983 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4986 if test -n "$current_libdirs"; then
4987 # Maybe just do a dry run.
4988 test -n "$run" && current_libdirs=" -n$current_libdirs"
4989 exec_cmd='$SHELL $0 --finish$current_libdirs'
4995 # libtool finish mode
4997 modename="$modename: finish"
5001 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5004 libdirs="$libdirs $dir"
5007 for libdir in $libdirs; do
5008 if test -n "$finish_cmds"; then
5009 # Do each command in the finish commands.
5010 eval cmds=\"$finish_cmds\"
5011 save_ifs="$IFS"; IFS='~'
5012 for cmd in $cmds; do
5015 $run eval "$cmd" || admincmds="$admincmds
5020 if test -n "$finish_eval"; then
5021 # Do the single finish_eval.
5022 eval cmds=\"$finish_eval\"
5023 $run eval "$cmds" || admincmds="$admincmds
5029 # Exit here if they wanted silent mode.
5030 test "$show" = : && exit 0
5032 echo "----------------------------------------------------------------------"
5033 echo "Libraries have been installed in:"
5034 for libdir in $libdirs; do
5038 echo "If you ever happen to want to link against installed libraries"
5039 echo "in a given directory, LIBDIR, you must either use libtool, and"
5040 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5041 echo "flag during linking and do at least one of the following:"
5042 if test -n "$shlibpath_var"; then
5043 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5044 echo " during execution"
5046 if test -n "$runpath_var"; then
5047 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5048 echo " during linking"
5050 if test -n "$hardcode_libdir_flag_spec"; then
5052 eval flag=\"$hardcode_libdir_flag_spec\"
5054 echo " - use the \`$flag' linker flag"
5056 if test -n "$admincmds"; then
5057 echo " - have your system administrator run these commands:$admincmds"
5059 if test -f /etc/ld.so.conf; then
5060 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5063 echo "See any operating system documentation about shared libraries for"
5064 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5065 echo "----------------------------------------------------------------------"
5069 # libtool execute mode
5071 modename="$modename: execute"
5073 # The first argument is the command name.
5075 if test -z "$cmd"; then
5076 $echo "$modename: you must specify a COMMAND" 1>&2
5081 # Handle -dlopen flags immediately.
5082 for file in $execute_dlfiles; do
5083 if test ! -f "$file"; then
5084 $echo "$modename: \`$file' is not a file" 1>&2
5092 # Check to see that this really is a libtool archive.
5093 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5095 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5100 # Read the libtool library.
5104 # If there is no directory component, then add one.
5106 */* | *\\*) . $file ;;
5110 # Skip this library if it cannot be dlopened.
5111 if test -z "$dlname"; then
5112 # Warn if it was a shared library.
5113 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5117 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5118 test "X$dir" = "X$file" && dir=.
5120 if test -f "$dir/$objdir/$dlname"; then
5123 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5129 # Just add the directory containing the .lo file.
5130 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5131 test "X$dir" = "X$file" && dir=.
5135 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5140 # Get the absolute pathname.
5141 absdir=`cd "$dir" && pwd`
5142 test -n "$absdir" && dir="$absdir"
5144 # Now add the directory to shlibpath_var.
5145 if eval "test -z \"\$$shlibpath_var\""; then
5146 eval "$shlibpath_var=\"\$dir\""
5148 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5152 # This variable tells wrapper scripts just to set shlibpath_var
5153 # rather than running their programs.
5154 libtool_execute_magic="$magic"
5156 # Check if any of the arguments is a wrapper script.
5163 # Do a test to see if this is really a libtool program.
5164 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5165 # If there is no directory component, then add one.
5167 */* | *\\*) . $file ;;
5171 # Transform arg to wrapped name.
5172 file="$progdir/$program"
5176 # Quote arguments (to preserve shell metacharacters).
5177 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5178 args="$args \"$file\""
5181 if test -z "$run"; then
5182 if test -n "$shlibpath_var"; then
5183 # Export the shlibpath_var.
5184 eval "export $shlibpath_var"
5187 # Restore saved environment variables
5188 if test "${save_LC_ALL+set}" = set; then
5189 LC_ALL="$save_LC_ALL"; export LC_ALL
5191 if test "${save_LANG+set}" = set; then
5192 LANG="$save_LANG"; export LANG
5195 # Now prepare to actually exec the command.
5196 exec_cmd="\$cmd$args"
5198 # Display what would be done.
5199 if test -n "$shlibpath_var"; then
5200 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5201 $echo "export $shlibpath_var"
5208 # libtool clean and uninstall mode
5210 modename="$modename: $mode"
5216 # This variable tells wrapper scripts just to set variables rather
5217 # than running their programs.
5218 libtool_install_magic="$magic"
5223 -f) rm="$rm $arg"; rmforce=yes ;;
5224 -*) rm="$rm $arg" ;;
5225 *) files="$files $arg" ;;
5229 if test -z "$rm"; then
5230 $echo "$modename: you must specify an RM program" 1>&2
5237 for file in $files; do
5238 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5239 if test "X$dir" = "X$file"; then
5243 objdir="$dir/$objdir"
5245 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5246 test "$mode" = uninstall && objdir="$dir"
5248 # Remember objdir for removal later, being careful to avoid duplicates
5249 if test "$mode" = clean; then
5252 *) rmdirs="$rmdirs $objdir" ;;
5256 # Don't error if the file doesn't exist and rm -f was used.
5257 if (test -L "$file") >/dev/null 2>&1 \
5258 || (test -h "$file") >/dev/null 2>&1 \
5259 || test -f "$file"; then
5261 elif test -d "$file"; then
5264 elif test "$rmforce" = yes; then
5272 # Possibly a libtool archive, so verify it.
5273 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5276 # Delete the libtool libraries and symlinks.
5277 for n in $library_names; do
5278 rmfiles="$rmfiles $objdir/$n"
5280 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5281 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5283 if test "$mode" = uninstall; then
5284 if test -n "$library_names"; then
5285 # Do each command in the postuninstall commands.
5286 eval cmds=\"$postuninstall_cmds\"
5287 save_ifs="$IFS"; IFS='~'
5288 for cmd in $cmds; do
5292 if test "$?" -ne 0 && test "$rmforce" != yes; then
5299 if test -n "$old_library"; then
5300 # Do each command in the old_postuninstall commands.
5301 eval cmds=\"$old_postuninstall_cmds\"
5302 save_ifs="$IFS"; IFS='~'
5303 for cmd in $cmds; do
5307 if test "$?" -ne 0 && test "$rmforce" != yes; then
5313 # FIXME: should reinstall the best remaining shared library.
5319 # Possibly a libtool object, so verify it.
5320 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5325 # Add PIC object to the list of files to remove.
5326 if test -n "$pic_object" \
5327 && test "$pic_object" != none; then
5328 rmfiles="$rmfiles $dir/$pic_object"
5331 # Add non-PIC object to the list of files to remove.
5332 if test -n "$non_pic_object" \
5333 && test "$non_pic_object" != none; then
5334 rmfiles="$rmfiles $dir/$non_pic_object"
5340 # Do a test to see if this is a libtool program.
5341 if test "$mode" = clean &&
5342 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5346 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5347 if test "$fast_install" = yes && test -n "$relink_command"; then
5348 rmfiles="$rmfiles $objdir/lt-$name"
5353 $show "$rm $rmfiles"
5354 $run $rm $rmfiles || exit_status=1
5357 # Try to remove the ${objdir}s in the directories where we deleted files
5358 for dir in $rmdirs; do
5359 if test -d "$dir"; then
5361 $run rmdir $dir >/dev/null 2>&1
5369 $echo "$modename: you must specify a MODE" 1>&2
5370 $echo "$generic_help" 1>&2
5375 if test -z "$exec_cmd"; then
5376 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5377 $echo "$generic_help" 1>&2
5380 fi # test -z "$show_help"
5382 if test -n "$exec_cmd"; then
5387 # We need to display help for each of the modes.
5390 "Usage: $modename [OPTION]... [MODE-ARG]...
5392 Provide generalized library-building support services.
5394 --config show all configuration variables
5395 --debug enable verbose shell tracing
5396 -n, --dry-run display commands without modifying any files
5397 --features display basic configuration information and exit
5398 --finish same as \`--mode=finish'
5399 --help display this help message and exit
5400 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5401 --quiet same as \`--silent'
5402 --silent don't print informational messages
5403 --tag=TAG use configuration variables from tag TAG
5404 --version print version information
5406 MODE must be one of the following:
5408 clean remove files from the build directory
5409 compile compile a source file into a libtool object
5410 execute automatically set library path, then run a program
5411 finish complete the installation of libtool libraries
5412 install install libraries or executables
5413 link create a library or an executable
5414 uninstall remove libraries from an installed directory
5416 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5417 a more detailed description of MODE."
5423 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5425 Remove files from the build directory.
5427 RM is the name of the program to use to delete files associated with each FILE
5428 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5431 If FILE is a libtool library, object or program, all the files associated
5432 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5437 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5439 Compile a source file into a libtool library object.
5441 This mode accepts the following additional options:
5443 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5444 -prefer-pic try to building PIC objects only
5445 -prefer-non-pic try to building non-PIC objects only
5446 -static always build a \`.o' file suitable for static linking
5448 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5449 from the given SOURCEFILE.
5451 The output file name is determined by removing the directory component from
5452 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5453 library object suffix, \`.lo'."
5458 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5460 Automatically set library path, then run a program.
5462 This mode accepts the following additional options:
5464 -dlopen FILE add the directory containing FILE to the library path
5466 This mode sets the library path environment variable according to \`-dlopen'
5469 If any of the ARGS are libtool executable wrappers, then they are translated
5470 into their corresponding uninstalled binary, and any of their required library
5471 directories are added to the library path.
5473 Then, COMMAND is executed, with ARGS as arguments."
5478 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5480 Complete the installation of libtool libraries.
5482 Each LIBDIR is a directory that contains libtool libraries.
5484 The commands that this mode executes may require superuser privileges. Use
5485 the \`--dry-run' option if you just want to see what would be executed."
5490 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5492 Install executables or libraries.
5494 INSTALL-COMMAND is the installation command. The first component should be
5495 either the \`install' or \`cp' program.
5497 The rest of the components are interpreted as arguments to that command (only
5498 BSD-compatible install options are recognized)."
5503 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5505 Link object files or libraries together to form another library, or to
5506 create an executable program.
5508 LINK-COMMAND is a command using the C compiler that you would use to create
5509 a program from several object files.
5511 The following components of LINK-COMMAND are treated specially:
5513 -all-static do not do any dynamic linking at all
5514 -avoid-version do not add a version suffix if possible
5515 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5516 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5517 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5518 -export-symbols SYMFILE
5519 try to export only the symbols listed in SYMFILE
5520 -export-symbols-regex REGEX
5521 try to export only the symbols matching REGEX
5522 -LLIBDIR search LIBDIR for required installed libraries
5523 -lNAME OUTPUT-FILE requires the installed library libNAME
5524 -module build a library that can dlopened
5525 -no-fast-install disable the fast-install mode
5526 -no-install link a not-installable executable
5527 -no-undefined declare that a library does not refer to external symbols
5528 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5529 -objectlist FILE Use a list of object files found in FILE to specify objects
5530 -release RELEASE specify package release information
5531 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5532 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5533 -static do not do any dynamic linking of libtool libraries
5534 -version-info CURRENT[:REVISION[:AGE]]
5535 specify library version info [each variable defaults to 0]
5537 All other options (arguments beginning with \`-') are ignored.
5539 Every other argument is treated as a filename. Files ending in \`.la' are
5540 treated as uninstalled libtool libraries, other files are standard or library
5543 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5544 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5545 required, except when creating a convenience library.
5547 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5548 using \`ar' and \`ranlib', or on Windows using \`lib'.
5550 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5551 is created, otherwise an executable program is created."
5556 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5558 Remove libraries from an installation directory.
5560 RM is the name of the program to use to delete files associated with each FILE
5561 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5564 If FILE is a libtool library, all the files associated with it are deleted.
5565 Otherwise, only FILE itself is deleted using RM."
5569 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5576 $echo "Try \`$modename --help' for more information about other modes."
5580 # The TAGs below are defined such that we never get into a situation
5581 # in which we disable both kinds of libraries. Given conflicting
5582 # choices, we go for a static library, that is the most portable,
5583 # since we can't tell whether shared libraries were disabled because
5584 # the user asked for that or because the platform doesn't support
5585 # them. This is particularly important on AIX, because we don't
5586 # support having both static and shared libraries enabled at the same
5587 # time on that platform, so we default to a shared-only configuration.
5588 # If a disable-shared tag is given, we'll fallback to a static-only
5589 # configuration. But we'll never go from static-only to shared-only.
5591 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5592 build_libtool_libs=no
5594 # ### END LIBTOOL TAG CONFIG: disable-shared
5596 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5597 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5598 # ### END LIBTOOL TAG CONFIG: disable-static