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, 2003
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.
29 # Check that we have a working $echo.
30 if test "X$1" = X--no-reexec; then
31 # Discard the --no-reexec flag, and continue.
33 elif test "X$1" = X--fallback-echo; then
34 # Avoid inline document here, it may be left over
36 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
37 # Yippee, $echo works!
40 # Restart under the correct shell, and then maybe $echo will work.
41 exec $SHELL "$0" --no-reexec ${1+"$@"}
44 if test "X$1" = X--fallback-echo; then
45 # used as fallback echo
53 # The name of this program.
54 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
61 TIMESTAMP=" (1.1220 2003/04/05 19:32:58)"
64 help="Try \`$progname --help' for more information."
65 magic="%%%MAGIC variable%%%"
70 # Sed substitution that helps us do robust quoting. It backslashifies
71 # metacharacters that are still active within double-quoted strings.
72 Xsed="${SED}"' -e 1s/^X//'
73 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
74 # test EBCDIC or ASCII
75 case `echo A|od -x` in
76 *[Cc]1*) # EBCDIC based system
77 SP2NL="tr '\100' '\n'"
78 NL2SP="tr '\r\n' '\100\100'"
80 *) # Assume ASCII based system
81 SP2NL="tr '\040' '\012'"
82 NL2SP="tr '\015\012' '\040\040'"
87 # Only set LANG and LC_ALL to C if already set.
88 # These must not be set unconditionally because not all systems understand
89 # e.g. LANG=C (notably SCO).
90 # We save the old values to restore during execute mode.
91 if test "${LC_ALL+set}" = set; then
92 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
94 if test "${LANG+set}" = set; then
95 save_LANG="$LANG"; LANG=C; export LANG
98 # Make sure IFS has a sensible default
101 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
102 $echo "$modename: not configured to build any kind of library" 1>&2
103 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
116 lo2o="s/\\.lo\$/.${objext}/"
117 o2lo="s/\\.${objext}\$/.lo/"
119 #####################################
120 # Shell function definitions:
121 # This seems to be the best place for them
123 # Need a lot of goo to handle *both* DLLs and import libs
124 # Has to be a shell function in order to 'eat' the argument
125 # that is supplied when $file_magic_command is called.
127 win32_libid_type="unknown"
128 win32_fileres=`file -L $1 2>/dev/null`
129 case $win32_fileres in
130 *ar\ archive\ import\ library*) # definitely import
131 win32_libid_type="x86 archive import"
133 *ar\ archive*) # could be an import, or static
134 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
135 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
136 win32_nmres=`eval $NM -f posix -A $1 | \
137 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
138 if test "X$win32_nmres" = "Ximport" ; then
139 win32_libid_type="x86 archive import"
141 win32_libid_type="x86 archive static"
146 win32_libid_type="x86 DLL"
148 *executable*) # but shell scripts are "executable" too...
149 case $win32_fileres in
150 *MS\ Windows\ PE\ Intel*)
151 win32_libid_type="x86 DLL"
156 $echo $win32_libid_type
159 # End of Shell function definitions
160 #####################################
162 # Parse our command line options once, thoroughly.
163 while test "$#" -gt 0
169 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
173 # If the previous option needs an argument, assign it.
174 if test -n "$prev"; then
177 execute_dlfiles="$execute_dlfiles $arg"
182 # Check whether tagname contains only valid characters
185 $echo "$progname: invalid tag name: $tagname" 1>&2
192 # Don't test for the "default" C tag, as we know, it's there, but
193 # not specially marked.
196 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
197 taglist="$taglist $tagname"
198 # Evaluate the configuration.
199 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201 $echo "$progname: ignoring unknown tag $tagname" 1>&2
216 # Have we seen a non-optional argument yet?
223 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
226 $echo "This is free software; see the source for copying conditions. There is NO"
227 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
232 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
233 # Now print the configurations for the tags.
234 for tagname in $taglist; do
235 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
241 $echo "$progname: enabling shell trace mode"
251 if test "$build_libtool_libs" = yes; then
252 $echo "enable shared libraries"
254 $echo "disable shared libraries"
256 if test "$build_old_libs" = yes; then
257 $echo "enable static libraries"
259 $echo "disable static libraries"
264 --finish) mode="finish" ;;
266 --mode) prevopt="--mode" prev=mode ;;
267 --mode=*) mode="$optarg" ;;
269 --preserve-dup-deps) duplicate_deps="yes" ;;
275 --tag) prevopt="--tag" prev=tag ;;
277 set tag "$optarg" ${1+"$@"}
288 $echo "$modename: unrecognized option \`$arg'" 1>&2
300 if test -n "$prevopt"; then
301 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
306 # If this variable is set in any of the actions, the command in it
307 # will be execed at the end. This prevents here-documents from being
308 # left over by shells.
311 if test -z "$show_help"; then
313 # Infer the operation mode.
314 if test -z "$mode"; then
315 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
316 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
318 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
330 *db | *dbx | *strace | *truss)
340 # If we have no mode, but dlfiles were specified, then do execute mode.
341 test -n "$execute_dlfiles" && mode=execute
343 # Just use the default operation mode.
344 if test -z "$mode"; then
345 if test -n "$nonopt"; then
346 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
348 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
355 # Only execute mode is allowed to have -dlopen flags.
356 if test -n "$execute_dlfiles" && test "$mode" != execute; then
357 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
362 # Change the help message to a mode-specific one.
364 help="Try \`$modename --help --mode=$mode' for more information."
366 # These modes are in order of execution frequency so that they run quickly.
368 # libtool compile mode
370 modename="$modename: compile"
371 # Get the compilation command and the source file.
373 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
382 # do not "continue". Instead, add this to base_compile
394 # Accept any command-line options.
397 if test -n "$libobj" ; then
398 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
421 arg_mode=arg # the next one goes into the "base_compile" arg list
422 continue # The current "srcfile" will either be retained or
423 ;; # replaced later. I would guess that would be a bug.
426 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428 save_ifs="$IFS"; IFS=','
432 # Double-quote args containing other shell metacharacters.
433 # Many Bourne shells cannot handle close brackets correctly
434 # in scan sets, so we specify it separately.
436 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
440 lastarg="$lastarg $arg"
443 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
445 # Add the arguments to base_compile.
446 base_compile="$base_compile $lastarg"
451 # Accept the current argument as the source file.
452 # The previous "srcfile" becomes the current argument.
459 esac # case $arg_mode
461 # Aesthetically quote the previous argument.
462 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
465 # Double-quote args containing other shell metacharacters.
466 # Many Bourne shells cannot handle close brackets correctly
467 # in scan sets, so we specify it separately.
468 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
469 lastarg="\"$lastarg\""
473 base_compile="$base_compile $lastarg"
478 $echo "$modename: you must specify an argument for -Xcompile"
482 $echo "$modename: you must specify a target with \`-o'" 1>&2
486 # Get the name of the library object.
487 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
491 # Recognize several different file suffixes.
492 # If the user specifies -o file.o, it is replaced with file.lo
502 *.class) xform=class ;;
507 *.java) xform=java ;;
510 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
513 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
520 # Infer tagged configuration to use if any are available and
521 # if one wasn't chosen via the "--tag" command line option.
522 # Only attempt this if the compiler in the base compile
523 # command doesn't match the default compiler.
524 if test -n "$available_tags" && test -z "$tagname"; then
525 case $base_compile in
526 # Blanks in the command may have been stripped by the calling shell,
527 # but not from the CC environment variable when configure was run.
528 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
529 # Blanks at the start of $base_compile will cause this to fail
530 # if we don't check for them as well.
532 for z in $available_tags; do
533 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
534 # Evaluate the configuration.
535 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
536 case "$base_compile " in
537 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
538 # The compiler in the base compile command matches
539 # the one in the tagged configuration.
540 # Assume this is the tagged configuration we want.
547 # If $tagname still isn't set, then no tagged configuration
548 # was found and let the user know that the "--tag" command
549 # line option must be used.
550 if test -z "$tagname"; then
551 $echo "$modename: unable to infer tagged configuration"
552 $echo "$modename: specify a tag with \`--tag'" 1>&2
555 # $echo "$modename: using $tagname tagged configuration"
561 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
562 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
563 if test "X$xdir" = "X$obj"; then
568 lobj=${xdir}$objdir/$objname
570 if test -z "$base_compile"; then
571 $echo "$modename: you must specify a compilation command" 1>&2
576 # Delete any leftover library objects.
577 if test "$build_old_libs" = yes; then
578 removelist="$obj $lobj $libobj ${libobj}T"
580 removelist="$lobj $libobj ${libobj}T"
584 trap "$run $rm $removelist; exit 1" 1 2 15
586 # On Cygwin there's no "real" PIC flag so we must build both object types
588 cygwin* | mingw* | pw32* | os2*)
592 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
593 # non-PIC code in shared libraries is not supported
597 # Calculate the filename of the output object if compiler does
598 # not support -o with -c
599 if test "$compiler_c_o" = no; then
600 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
601 lockfile="$output_obj.lock"
602 removelist="$removelist $output_obj $lockfile"
603 trap "$run $rm $removelist; exit 1" 1 2 15
610 # Lock this critical section if it is needed
611 # We use this script file to make the link, it avoids creating a new file
612 if test "$need_locks" = yes; then
613 until $run ln "$0" "$lockfile" 2>/dev/null; do
614 $show "Waiting for $lockfile to be removed"
617 elif test "$need_locks" = warn; then
618 if test -f "$lockfile"; then
620 *** ERROR, $lockfile exists and contains:
621 `cat $lockfile 2>/dev/null`
623 This indicates that another process is trying to use the same
624 temporary object file, and libtool could not work around it because
625 your compiler does not support \`-c' and \`-o' together. If you
626 repeat this compilation, it may succeed, by chance, but you had better
627 avoid parallel builds (make -j) in this platform, or get a better
633 $echo $srcfile > "$lockfile"
636 if test -n "$fix_srcfile_path"; then
637 eval srcfile=\"$fix_srcfile_path\"
640 $run $rm "$libobj" "${libobj}T"
642 # Create a libtool object file (analogous to a ".la" file),
643 # but don't create it if we're doing a dry run.
644 test -z "$run" && cat > ${libobj}T <<EOF
645 # $libobj - a libtool object file
646 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
648 # Please DO NOT delete this file!
649 # It is necessary for linking the library.
651 # Name of the PIC object.
654 # Only build a PIC object if we are building libtool libraries.
655 if test "$build_libtool_libs" = yes; then
656 # Without this assignment, base_compile gets emptied.
657 fbsd_hideous_sh_bug=$base_compile
659 if test "$pic_mode" != no; then
660 command="$base_compile $srcfile $pic_flag"
662 # Don't build PIC code
663 command="$base_compile $srcfile"
666 if test ! -d "${xdir}$objdir"; then
667 $show "$mkdir ${xdir}$objdir"
668 $run $mkdir ${xdir}$objdir
670 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
675 if test -z "$output_obj"; then
676 # Place PIC objects in $objdir
677 command="$command -o $lobj"
680 $run $rm "$lobj" "$output_obj"
683 if $run eval "$command"; then :
685 test -n "$output_obj" && $run $rm $removelist
689 if test "$need_locks" = warn &&
690 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
692 *** ERROR, $lockfile contains:
693 `cat $lockfile 2>/dev/null`
695 but it should contain:
698 This indicates that another process is trying to use the same
699 temporary object file, and libtool could not work around it because
700 your compiler does not support \`-c' and \`-o' together. If you
701 repeat this compilation, it may succeed, by chance, but you had better
702 avoid parallel builds (make -j) in this platform, or get a better
709 # Just move the object if needed, then go on to compile the next one
710 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
711 $show "$mv $output_obj $lobj"
712 if $run $mv $output_obj $lobj; then :
720 # Append the name of the PIC object to the libtool object file.
721 test -z "$run" && cat >> ${libobj}T <<EOF
722 pic_object='$objdir/$objname'
726 # Allow error messages only from the first compilation.
727 suppress_output=' >/dev/null 2>&1'
729 # No PIC object so indicate it doesn't exist in the libtool
731 test -z "$run" && cat >> ${libobj}T <<EOF
737 # Only build a position-dependent object if we build old libraries.
738 if test "$build_old_libs" = yes; then
739 if test "$pic_mode" != yes; then
740 # Don't build PIC code
741 command="$base_compile $srcfile"
743 command="$base_compile $srcfile $pic_flag"
745 if test "$compiler_c_o" = yes; then
746 command="$command -o $obj"
749 # Suppress compiler output if we already did a PIC compilation.
750 command="$command$suppress_output"
751 $run $rm "$obj" "$output_obj"
753 if $run eval "$command"; then :
759 if test "$need_locks" = warn &&
760 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
762 *** ERROR, $lockfile contains:
763 `cat $lockfile 2>/dev/null`
765 but it should contain:
768 This indicates that another process is trying to use the same
769 temporary object file, and libtool could not work around it because
770 your compiler does not support \`-c' and \`-o' together. If you
771 repeat this compilation, it may succeed, by chance, but you had better
772 avoid parallel builds (make -j) in this platform, or get a better
779 # Just move the object if needed
780 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
781 $show "$mv $output_obj $obj"
782 if $run $mv $output_obj $obj; then :
790 # Append the name of the non-PIC object the libtool object file.
791 # Only append if the libtool object file exists.
792 test -z "$run" && cat >> ${libobj}T <<EOF
793 # Name of the non-PIC object.
794 non_pic_object='$objname'
798 # Append the name of the non-PIC object the libtool object file.
799 # Only append if the libtool object file exists.
800 test -z "$run" && cat >> ${libobj}T <<EOF
801 # Name of the non-PIC object.
807 $run $mv "${libobj}T" "${libobj}"
809 # Unlock the critical section if it was locked
810 if test "$need_locks" != no; then
819 modename="$modename: link"
821 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
822 # It is impossible to link a dll without this setting, and
823 # we shouldn't force the makefile maintainer to figure out
824 # which system we are compiling for in order to pass an extra
825 # flag for every libtool invocation.
828 # FIXME: Unfortunately, there are problems with the above when trying
829 # to make a dll which has undefined symbols, in which case not
830 # even a static library is built. For now, we need to specify
831 # -no-undefined on the libtool link line when we can be certain
832 # that all symbols are satisfied, otherwise we get a static library.
839 libtool_args="$nonopt"
840 base_compile="$nonopt"
841 compile_command="$nonopt"
842 finalize_command="$nonopt"
855 lib_search_path=`pwd`
864 export_symbols_regex=
872 prefer_static_libs=no
885 # We need to know -static, to get the right output filenames.
889 -all-static | -static)
890 if test "X$arg" = "X-all-static"; then
891 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
892 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
894 if test -n "$link_static_flag"; then
895 dlopen_self=$dlopen_self_static
898 if test -z "$pic_flag" && test -n "$link_static_flag"; then
899 dlopen_self=$dlopen_self_static
902 build_libtool_libs=no
904 prefer_static_libs=yes
910 # See if our shared archives depend on static archives.
911 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
913 # Go through the arguments, transforming them on the way.
914 while test "$#" -gt 0; do
916 base_compile="$base_compile $arg"
919 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
920 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
924 libtool_args="$libtool_args $qarg"
926 # If the previous option needs an argument, assign it.
927 if test -n "$prev"; then
930 compile_command="$compile_command @OUTPUT@"
931 finalize_command="$finalize_command @OUTPUT@"
937 if test "$preload" = no; then
938 # Add the symbol object into the linking commands.
939 compile_command="$compile_command @SYMFILE@"
940 finalize_command="$finalize_command @SYMFILE@"
944 *.la | *.lo) ;; # We handle these cases below.
946 if test "$dlself" = no; then
954 if test "$prev" = dlprefiles; then
956 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
966 if test "$prev" = dlfiles; then
967 dlfiles="$dlfiles $arg"
969 dlprefiles="$dlprefiles $arg"
977 export_symbols="$arg"
978 if test ! -f "$arg"; then
979 $echo "$modename: symbol file \`$arg' does not exist"
986 export_symbols_regex="$arg"
991 inst_prefix_dir="$arg"
1001 if test -f "$arg"; then
1004 for fil in `cat $save_arg`
1006 # moreargs="$moreargs $fil"
1008 # A libtool-controlled object.
1010 # Check to see that this really is a libtool object.
1011 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1016 # If there is no directory component, then add one.
1018 */* | *\\*) . $arg ;;
1022 if test -z "$pic_object" || \
1023 test -z "$non_pic_object" ||
1024 test "$pic_object" = none && \
1025 test "$non_pic_object" = none; then
1026 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1030 # Extract subdirectory from the argument.
1031 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1032 if test "X$xdir" = "X$arg"; then
1038 if test "$pic_object" != none; then
1039 # Prepend the subdirectory the object is found in.
1040 pic_object="$xdir$pic_object"
1042 if test "$prev" = dlfiles; then
1043 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1044 dlfiles="$dlfiles $pic_object"
1048 # If libtool objects are unsupported, then we need to preload.
1053 # CHECK ME: I think I busted this. -Ossama
1054 if test "$prev" = dlprefiles; then
1055 # Preload the old-style object.
1056 dlprefiles="$dlprefiles $pic_object"
1061 libobjs="$libobjs $pic_object"
1066 if test "$non_pic_object" != none; then
1067 # Prepend the subdirectory the object is found in.
1068 non_pic_object="$xdir$non_pic_object"
1070 # A standard non-PIC object
1071 non_pic_objects="$non_pic_objects $non_pic_object"
1072 if test -z "$pic_object" || test "$pic_object" = none ; then
1073 arg="$non_pic_object"
1077 # Only an error if not doing a dry-run.
1078 if test -z "$run"; then
1079 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1084 # Extract subdirectory from the argument.
1085 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1086 if test "X$xdir" = "X$arg"; then
1092 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1093 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1094 libobjs="$libobjs $pic_object"
1095 non_pic_objects="$non_pic_objects $non_pic_object"
1100 $echo "$modename: link input file \`$save_arg' does not exist"
1108 # We need an absolute path.
1110 [\\/]* | [A-Za-z]:[\\/]*) ;;
1112 $echo "$modename: only absolute run-paths are allowed" 1>&2
1116 if test "$prev" = rpath; then
1119 *) rpath="$rpath $arg" ;;
1124 *) xrpath="$xrpath $arg" ;;
1131 compiler_flags="$compiler_flags $qarg"
1133 compile_command="$compile_command $qarg"
1134 finalize_command="$finalize_command $qarg"
1138 linker_flags="$linker_flags $qarg"
1139 compiler_flags="$compiler_flags $wl$qarg"
1141 compile_command="$compile_command $wl$qarg"
1142 finalize_command="$finalize_command $wl$qarg"
1146 linker_flags="$linker_flags $qarg"
1147 compiler_flags="$compiler_flags $qarg"
1149 compile_command="$compile_command $qarg"
1150 finalize_command="$finalize_command $qarg"
1154 eval "$prev=\"\$arg\""
1159 fi # test -n "$prev"
1165 if test -n "$link_static_flag"; then
1166 compile_command="$compile_command $link_static_flag"
1167 finalize_command="$finalize_command $link_static_flag"
1173 # FIXME: remove this flag sometime in the future.
1174 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1198 -export-symbols | -export-symbols-regex)
1199 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1200 $echo "$modename: more than one -exported-symbols argument is not allowed"
1203 if test "X$arg" = "X-export-symbols"; then
1216 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1217 # so, if we see these flags be careful not to treat them like -L
1219 case $with_gcc/$host in
1220 no/*-*-irix* | /*-*-irix*)
1221 compile_command="$compile_command $arg"
1222 finalize_command="$finalize_command $arg"
1229 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1230 # We need an absolute path.
1232 [\\/]* | [A-Za-z]:[\\/]*) ;;
1234 absdir=`cd "$dir" && pwd`
1235 if test -z "$absdir"; then
1236 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1245 deplibs="$deplibs -L$dir"
1246 lib_search_path="$lib_search_path $dir"
1250 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1251 case :$dllsearchpath: in
1253 *) dllsearchpath="$dllsearchpath:$dir";;
1261 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1263 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1264 # These systems don't actually have a C or math library (as such)
1267 *-*-mingw* | *-*-os2*)
1268 # These systems don't actually have a C library (as such)
1269 test "X$arg" = "X-lc" && continue
1271 *-*-openbsd* | *-*-freebsd*)
1272 # Do not include libc due to us having libc/libc_r.
1273 test "X$arg" = "X-lc" && continue
1275 *-*-rhapsody* | *-*-darwin1.[012])
1276 # Rhapsody C and math libraries are in the System framework
1277 deplibs="$deplibs -framework System"
1280 elif test "X$arg" = "X-lc_r"; then
1282 *-*-openbsd* | *-*-freebsd*)
1283 # Do not include libc_r directly, use -pthread flag.
1288 deplibs="$deplibs $arg"
1297 # gcc -m* arguments should be passed to the linker via $compiler_flags
1298 # in order to pass architecture information to the linker
1299 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1300 # but this is not reliable with gcc because gcc may use -mfoo to
1301 # select a different linker, different libraries, etc, while
1302 # -Wl,-mfoo simply passes -mfoo to the linker.
1304 # Unknown arguments in both finalize_command and compile_command need
1305 # to be aesthetically quoted because they are evaled later.
1306 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1308 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1312 compile_command="$compile_command $arg"
1313 finalize_command="$finalize_command $arg"
1314 if test "$with_gcc" = "yes" ; then
1315 compiler_flags="$compiler_flags $arg"
1332 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1333 # The PATH hackery in wrapper scripts is required on Windows
1334 # in order for the loader to find any dlls it needs.
1335 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1336 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1339 *) no_install=yes ;;
1372 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1373 # We need an absolute path.
1375 [\\/]* | [A-Za-z]:[\\/]*) ;;
1377 $echo "$modename: only absolute run-paths are allowed" 1>&2
1383 *) xrpath="$xrpath $dir" ;;
1389 # The effects of -static are defined in a previous loop.
1390 # We used to do the same as -all-static on platforms that
1391 # didn't have a PIC flag, but the assumption that the effects
1392 # would be equivalent was wrong. It would break on at least
1393 # Digital Unix and AIX.
1413 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1415 save_ifs="$IFS"; IFS=','
1416 for flag in $args; do
1419 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1424 compiler_flags="$compiler_flags $flag"
1427 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1431 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1433 save_ifs="$IFS"; IFS=','
1434 for flag in $args; do
1437 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1442 compiler_flags="$compiler_flags $wl$flag"
1443 linker_flags="$linker_flags $flag"
1446 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1464 # Some other compiler flag.
1466 # Unknown arguments in both finalize_command and compile_command need
1467 # to be aesthetically quoted because they are evaled later.
1468 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1470 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1477 # A standard object.
1482 # A libtool-controlled object.
1484 # Check to see that this really is a libtool object.
1485 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1490 # If there is no directory component, then add one.
1492 */* | *\\*) . $arg ;;
1496 if test -z "$pic_object" || \
1497 test -z "$non_pic_object" ||
1498 test "$pic_object" = none && \
1499 test "$non_pic_object" = none; then
1500 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1504 # Extract subdirectory from the argument.
1505 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1506 if test "X$xdir" = "X$arg"; then
1512 if test "$pic_object" != none; then
1513 # Prepend the subdirectory the object is found in.
1514 pic_object="$xdir$pic_object"
1516 if test "$prev" = dlfiles; then
1517 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1518 dlfiles="$dlfiles $pic_object"
1522 # If libtool objects are unsupported, then we need to preload.
1527 # CHECK ME: I think I busted this. -Ossama
1528 if test "$prev" = dlprefiles; then
1529 # Preload the old-style object.
1530 dlprefiles="$dlprefiles $pic_object"
1535 libobjs="$libobjs $pic_object"
1540 if test "$non_pic_object" != none; then
1541 # Prepend the subdirectory the object is found in.
1542 non_pic_object="$xdir$non_pic_object"
1544 # A standard non-PIC object
1545 non_pic_objects="$non_pic_objects $non_pic_object"
1546 if test -z "$pic_object" || test "$pic_object" = none ; then
1547 arg="$non_pic_object"
1551 # Only an error if not doing a dry-run.
1552 if test -z "$run"; then
1553 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1558 # Extract subdirectory from the argument.
1559 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1560 if test "X$xdir" = "X$arg"; then
1566 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1567 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1568 libobjs="$libobjs $pic_object"
1569 non_pic_objects="$non_pic_objects $non_pic_object"
1576 deplibs="$deplibs $arg"
1577 old_deplibs="$old_deplibs $arg"
1582 # A libtool-controlled library.
1584 if test "$prev" = dlfiles; then
1585 # This library was specified with -dlopen.
1586 dlfiles="$dlfiles $arg"
1588 elif test "$prev" = dlprefiles; then
1589 # The library was specified with -dlpreopen.
1590 dlprefiles="$dlprefiles $arg"
1593 deplibs="$deplibs $arg"
1598 # Some other compiler argument.
1600 # Unknown arguments in both finalize_command and compile_command need
1601 # to be aesthetically quoted because they are evaled later.
1602 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1604 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1611 # Now actually substitute the argument into the commands.
1612 if test -n "$arg"; then
1613 compile_command="$compile_command $arg"
1614 finalize_command="$finalize_command $arg"
1616 done # argument parsing loop
1618 if test -n "$prev"; then
1619 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1624 # Infer tagged configuration to use if any are available and
1625 # if one wasn't chosen via the "--tag" command line option.
1626 # Only attempt this if the compiler in the base link
1627 # command doesn't match the default compiler.
1628 if test -n "$available_tags" && test -z "$tagname"; then
1629 case $base_compile in
1630 # Blanks in the command may have been stripped by the calling shell,
1631 # but not from the CC environment variable when configure was run.
1632 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1633 # Blanks at the start of $base_compile will cause this to fail
1634 # if we don't check for them as well.
1636 for z in $available_tags; do
1637 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1638 # Evaluate the configuration.
1639 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1640 case $base_compile in
1641 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1642 # The compiler in $compile_command matches
1643 # the one in the tagged configuration.
1644 # Assume this is the tagged configuration we want.
1651 # If $tagname still isn't set, then no tagged configuration
1652 # was found and let the user know that the "--tag" command
1653 # line option must be used.
1654 if test -z "$tagname"; then
1655 $echo "$modename: unable to infer tagged configuration"
1656 $echo "$modename: specify a tag with \`--tag'" 1>&2
1659 # $echo "$modename: using $tagname tagged configuration"
1665 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1666 eval arg=\"$export_dynamic_flag_spec\"
1667 compile_command="$compile_command $arg"
1668 finalize_command="$finalize_command $arg"
1672 # calculate the name of the file, without its directory
1673 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1674 libobjs_save="$libobjs"
1676 if test -n "$shlibpath_var"; then
1677 # get the directories listed in $shlibpath_var
1678 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1682 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1683 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1685 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1686 if test "X$output_objdir" = "X$output"; then
1687 output_objdir="$objdir"
1689 output_objdir="$output_objdir/$objdir"
1691 # Create the object directory.
1692 if test ! -d "$output_objdir"; then
1693 $show "$mkdir $output_objdir"
1694 $run $mkdir $output_objdir
1696 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1701 # Determine the type of output
1704 $echo "$modename: you must specify an output file" 1>&2
1708 *.$libext) linkmode=oldlib ;;
1709 *.lo | *.$objext) linkmode=obj ;;
1710 *.la) linkmode=lib ;;
1711 *) linkmode=prog ;; # Anything else should be a program.
1715 *cygwin* | *mingw* | *pw32*)
1716 # don't eliminate duplcations in $postdeps and $predeps
1717 duplicate_compiler_generated_deps=yes
1720 duplicate_compiler_generated_deps=$duplicate_deps
1726 # Find all interdependent deplibs by searching for libraries
1727 # that are linked more than once (e.g. -la -lb -la)
1728 for deplib in $deplibs; do
1729 if test "X$duplicate_deps" = "Xyes" ; then
1731 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1734 libs="$libs $deplib"
1737 if test "$linkmode" = lib; then
1738 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1740 # Compute libraries that are listed more than once in $predeps
1741 # $postdeps and mark them as special (i.e., whose duplicates are
1742 # not to be eliminated).
1744 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1745 for pre_post_dep in $predeps $postdeps; do
1746 case "$pre_post_deps " in
1747 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1749 pre_post_deps="$pre_post_deps $pre_post_dep"
1758 need_relink=no # whether we're linking any uninstalled libtool libraries
1759 notinst_deplibs= # not-installed libtool libraries
1760 notinst_path= # paths that contain not-installed libtool libraries
1764 for file in $dlfiles $dlprefiles; do
1768 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1780 passes="conv scan dlopen dlpreopen link"
1785 for pass in $passes; do
1786 if test "$linkmode,$pass" = "lib,link" ||
1787 test "$linkmode,$pass" = "prog,scan"; then
1791 if test "$linkmode" = prog; then
1793 dlopen) libs="$dlfiles" ;;
1794 dlpreopen) libs="$dlprefiles" ;;
1795 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1798 if test "$pass" = dlopen; then
1799 # Collect dlpreopened libraries
1800 save_deplibs="$deplibs"
1803 for deplib in $libs; do
1808 if test "$linkmode" != lib && test "$linkmode" != prog; then
1809 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1812 if test "$pass" = conv; then
1813 deplibs="$deplib $deplibs"
1816 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1817 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1818 # Search the libtool library
1819 lib="$searchdir/lib${name}.la"
1820 if test -f "$lib"; then
1825 if test "$found" != yes; then
1826 # deplib doesn't seem to be a libtool library
1827 if test "$linkmode,$pass" = "prog,link"; then
1828 compile_deplibs="$deplib $compile_deplibs"
1829 finalize_deplibs="$deplib $finalize_deplibs"
1831 deplibs="$deplib $deplibs"
1832 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1835 else # deplib is a libtool library
1836 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1837 # We need to do some special things here, and not later.
1838 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1839 case " $predeps $postdeps " in
1841 if (${SED} -e '2q' $lib |
1842 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1846 */* | *\\*) . $lib ;;
1849 for l in $old_library $library_names; do
1852 if test "X$ll" = "X$old_library" ; then # only static version available
1854 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1855 test "X$ladir" = "X$lib" && ladir="."
1856 lib=$ladir/$old_library
1857 if test "$linkmode,$pass" = "prog,link"; then
1858 compile_deplibs="$deplib $compile_deplibs"
1859 finalize_deplibs="$deplib $finalize_deplibs"
1861 deplibs="$deplib $deplibs"
1862 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1876 deplibs="$deplib $deplibs"
1877 test "$pass" = conv && continue
1878 newdependency_libs="$deplib $newdependency_libs"
1879 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1882 if test "$pass" = conv; then
1883 deplibs="$deplib $deplibs"
1886 if test "$pass" = scan; then
1887 deplibs="$deplib $deplibs"
1888 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1890 compile_deplibs="$deplib $compile_deplibs"
1891 finalize_deplibs="$deplib $finalize_deplibs"
1895 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1901 if test "$pass" = link; then
1902 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1903 # Make sure the xrpath contains only unique directories.
1906 *) xrpath="$xrpath $dir" ;;
1909 deplibs="$deplib $deplibs"
1912 *.la) lib="$deplib" ;;
1914 if test "$pass" = conv; then
1915 deplibs="$deplib $deplibs"
1920 if test "$deplibs_check_method" != pass_all; then
1922 $echo "*** Warning: Trying to link with static lib archive $deplib."
1923 $echo "*** I have the capability to make that library automatically link in when"
1924 $echo "*** you link to this library. But I can only do this if you have a"
1925 $echo "*** shared version of the library, which you do not appear to have"
1926 $echo "*** because the file extensions .$libext of this argument makes me believe"
1927 $echo "*** that it is just a static archive that I should not used here."
1930 $echo "*** Warning: Linking the shared library $output against the"
1931 $echo "*** static library $deplib is not portable!"
1932 deplibs="$deplib $deplibs"
1937 if test "$pass" != link; then
1938 deplibs="$deplib $deplibs"
1940 compile_deplibs="$deplib $compile_deplibs"
1941 finalize_deplibs="$deplib $finalize_deplibs"
1948 if test "$pass" = conv; then
1949 deplibs="$deplib $deplibs"
1950 elif test "$linkmode" = prog; then
1951 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1952 # If there is no dlopen support or we're linking statically,
1953 # we need to preload.
1954 newdlprefiles="$newdlprefiles $deplib"
1955 compile_deplibs="$deplib $compile_deplibs"
1956 finalize_deplibs="$deplib $finalize_deplibs"
1958 newdlfiles="$newdlfiles $deplib"
1968 if test "$found" = yes || test -f "$lib"; then :
1970 $echo "$modename: cannot find the library \`$lib'" 1>&2
1974 # Check to see that this really is a libtool archive.
1975 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1977 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1981 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1982 test "X$ladir" = "X$lib" && ladir="."
1990 # If the library was installed with an old release of libtool,
1991 # it will not redefine variables installed, or shouldnotlink
1997 */* | *\\*) . $lib ;;
2001 if test "$linkmode,$pass" = "lib,link" ||
2002 test "$linkmode,$pass" = "prog,scan" ||
2003 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2004 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2005 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2008 if test "$pass" = conv; then
2009 # Only check for convenience libraries
2010 deplibs="$lib $deplibs"
2011 if test -z "$libdir"; then
2012 if test -z "$old_library"; then
2013 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2016 # It is a libtool convenience library, so add in its objects.
2017 convenience="$convenience $ladir/$objdir/$old_library"
2018 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2020 for deplib in $dependency_libs; do
2021 deplibs="$deplib $deplibs"
2022 if test "X$duplicate_deps" = "Xyes" ; then
2023 case "$tmp_libs " in
2024 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2027 tmp_libs="$tmp_libs $deplib"
2029 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2030 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2037 # Get the name of the library we link against.
2039 for l in $old_library $library_names; do
2042 if test -z "$linklib"; then
2043 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2047 # This library was specified with -dlopen.
2048 if test "$pass" = dlopen; then
2049 if test -z "$libdir"; then
2050 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2053 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2054 # If there is no dlname, no dlopen support or we're linking
2055 # statically, we need to preload. We also need to preload any
2056 # dependent libraries so libltdl's deplib preloader doesn't
2057 # bomb out in the load deplibs phase.
2058 dlprefiles="$dlprefiles $lib $dependency_libs"
2060 newdlfiles="$newdlfiles $lib"
2065 # We need an absolute path.
2067 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2069 abs_ladir=`cd "$ladir" && pwd`
2070 if test -z "$abs_ladir"; then
2071 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2072 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2077 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2079 # Find the relevant object directory and library name.
2080 if test "X$installed" = Xyes; then
2081 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2082 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2091 dir="$ladir/$objdir"
2092 absdir="$abs_ladir/$objdir"
2093 # Remove this search path later
2094 notinst_path="$notinst_path $abs_ladir"
2095 fi # $installed = yes
2096 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2098 # This library was specified with -dlpreopen.
2099 if test "$pass" = dlpreopen; then
2100 if test -z "$libdir"; then
2101 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2104 # Prefer using a static library (so that no silly _DYNAMIC symbols
2105 # are required to link).
2106 if test -n "$old_library"; then
2107 newdlprefiles="$newdlprefiles $dir/$old_library"
2108 # Otherwise, use the dlname, so that lt_dlopen finds it.
2109 elif test -n "$dlname"; then
2110 newdlprefiles="$newdlprefiles $dir/$dlname"
2112 newdlprefiles="$newdlprefiles $dir/$linklib"
2114 fi # $pass = dlpreopen
2116 if test -z "$libdir"; then
2117 # Link the convenience library
2118 if test "$linkmode" = lib; then
2119 deplibs="$dir/$old_library $deplibs"
2120 elif test "$linkmode,$pass" = "prog,link"; then
2121 compile_deplibs="$dir/$old_library $compile_deplibs"
2122 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2124 deplibs="$lib $deplibs" # used for prog,scan pass
2130 if test "$linkmode" = prog && test "$pass" != link; then
2131 newlib_search_path="$newlib_search_path $ladir"
2132 deplibs="$lib $deplibs"
2135 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2136 test "$build_libtool_libs" = no; then
2141 for deplib in $dependency_libs; do
2143 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2145 # Need to link against all dependency_libs?
2146 if test "$linkalldeplibs" = yes; then
2147 deplibs="$deplib $deplibs"
2149 # Need to hardcode shared library paths
2150 # or/and link against static libraries
2151 newdependency_libs="$deplib $newdependency_libs"
2153 if test "X$duplicate_deps" = "Xyes" ; then
2154 case "$tmp_libs " in
2155 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2158 tmp_libs="$tmp_libs $deplib"
2161 fi # $linkmode = prog...
2163 if test "$linkmode,$pass" = "prog,link"; then
2164 if test -n "$library_names" &&
2165 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2166 # We need to hardcode the library path
2167 if test -n "$shlibpath_var"; then
2168 # Make sure the rpath contains only unique directories.
2169 case "$temp_rpath " in
2172 *) temp_rpath="$temp_rpath $dir" ;;
2176 # Hardcode the library path.
2177 # Skip directories that are in the system default run-time
2179 case " $sys_lib_dlsearch_path " in
2182 case "$compile_rpath " in
2184 *) compile_rpath="$compile_rpath $absdir"
2188 case " $sys_lib_dlsearch_path " in
2191 case "$finalize_rpath " in
2193 *) finalize_rpath="$finalize_rpath $libdir"
2197 fi # $linkmode,$pass = prog,link...
2199 if test "$alldeplibs" = yes &&
2200 { test "$deplibs_check_method" = pass_all ||
2201 { test "$build_libtool_libs" = yes &&
2202 test -n "$library_names"; }; }; then
2203 # We only need to search for static libraries
2208 link_static=no # Whether the deplib will be linked statically
2209 if test -n "$library_names" &&
2210 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2211 if test "$installed" = no; then
2212 notinst_deplibs="$notinst_deplibs $lib"
2215 # This is a shared library
2217 # Warn about portability, can't link against -module's on some systems (darwin)
2218 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2220 if test "$linkmode" = prog; then
2221 $echo "*** Warning: Linking the executable $output against the loadable module"
2223 $echo "*** Warning: Linking the shared library $output against the loadable module"
2225 $echo "*** $linklib is not portable!"
2227 if test "$linkmode" = lib &&
2228 test "$hardcode_into_libs" = yes; then
2229 # Hardcode the library path.
2230 # Skip directories that are in the system default run-time
2232 case " $sys_lib_dlsearch_path " in
2235 case "$compile_rpath " in
2237 *) compile_rpath="$compile_rpath $absdir"
2241 case " $sys_lib_dlsearch_path " in
2244 case "$finalize_rpath " in
2246 *) finalize_rpath="$finalize_rpath $libdir"
2252 if test -n "$old_archive_from_expsyms_cmds"; then
2253 # figure out the soname
2254 set dummy $library_names
2257 libname=`eval \\$echo \"$libname_spec\"`
2258 # use dlname if we got it. it's perfectly good, no?
2259 if test -n "$dlname"; then
2261 elif test -n "$soname_spec"; then
2265 major=`expr $current - $age`
2269 eval soname=\"$soname_spec\"
2274 # Make a new name for the extract_expsyms_cmds to use
2276 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2277 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2279 # If the library has no export list, then create one now
2280 if test -f "$output_objdir/$soname-def"; then :
2282 $show "extracting exported symbol list from \`$soname'"
2283 save_ifs="$IFS"; IFS='~'
2284 eval cmds=\"$extract_expsyms_cmds\"
2285 for cmd in $cmds; do
2288 $run eval "$cmd" || exit $?
2294 if test -f "$output_objdir/$newlib"; then :; else
2295 $show "generating import library for \`$soname'"
2296 save_ifs="$IFS"; IFS='~'
2297 eval cmds=\"$old_archive_from_expsyms_cmds\"
2298 for cmd in $cmds; do
2301 $run eval "$cmd" || exit $?
2305 # make sure the library variables are pointing to the new library
2308 fi # test -n "$old_archive_from_expsyms_cmds"
2310 if test "$linkmode" = prog || test "$mode" != relink; then
2315 case $hardcode_action in
2316 immediate | unsupported)
2317 if test "$hardcode_direct" = no; then
2320 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2322 # if the lib is a module then we can not link against it, someone
2323 # is ignoring the new warnings I added
2324 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2325 $echo "** Warning, lib $linklib is a module, not a shared library"
2326 if test -z "$old_library" ; then
2328 $echo "** And there doesn't seem to be a static archive available"
2329 $echo "** The link will probably fail, sorry"
2331 add="$dir/$old_library"
2335 elif test "$hardcode_minus_L" = no; then
2337 *-*-sunos*) add_shlibpath="$dir" ;;
2341 elif test "$hardcode_shlibpath_var" = no; then
2342 add_shlibpath="$dir"
2349 if test "$hardcode_direct" = yes; then
2351 elif test "$hardcode_minus_L" = yes; then
2353 # Try looking first in the location we're being installed to.
2354 if test -n "$inst_prefix_dir"; then
2357 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2362 elif test "$hardcode_shlibpath_var" = yes; then
2363 add_shlibpath="$dir"
2372 if test "$lib_linked" != yes; then
2373 $echo "$modename: configuration error: unsupported hardcode properties"
2377 if test -n "$add_shlibpath"; then
2378 case :$compile_shlibpath: in
2379 *":$add_shlibpath:"*) ;;
2380 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2383 if test "$linkmode" = prog; then
2384 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2385 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2387 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2388 test -n "$add" && deplibs="$add $deplibs"
2389 if test "$hardcode_direct" != yes && \
2390 test "$hardcode_minus_L" != yes && \
2391 test "$hardcode_shlibpath_var" = yes; then
2392 case :$finalize_shlibpath: in
2394 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2400 if test "$linkmode" = prog || test "$mode" = relink; then
2404 # Finalize command for both is simple: just hardcode it.
2405 if test "$hardcode_direct" = yes; then
2406 add="$libdir/$linklib"
2407 elif test "$hardcode_minus_L" = yes; then
2410 elif test "$hardcode_shlibpath_var" = yes; then
2411 case :$finalize_shlibpath: in
2413 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2416 elif test "$hardcode_automatic" = yes; then
2417 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2418 add="$inst_prefix_dir$libdir/$linklib"
2420 add="$libdir/$linklib"
2423 # We cannot seem to hardcode it, guess we'll fake it.
2425 # Try looking first in the location we're being installed to.
2426 if test -n "$inst_prefix_dir"; then
2429 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2436 if test "$linkmode" = prog; then
2437 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2438 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2440 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2441 test -n "$add" && deplibs="$add $deplibs"
2444 elif test "$linkmode" = prog; then
2445 # Here we assume that one of hardcode_direct or hardcode_minus_L
2446 # is not unsupported. This is valid on all known static and
2448 if test "$hardcode_direct" != unsupported; then
2449 test -n "$old_library" && linklib="$old_library"
2450 compile_deplibs="$dir/$linklib $compile_deplibs"
2451 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2453 compile_deplibs="-l$name -L$dir $compile_deplibs"
2454 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2456 elif test "$build_libtool_libs" = yes; then
2457 # Not a shared library
2458 if test "$deplibs_check_method" != pass_all; then
2459 # We're trying link a shared library against a static one
2460 # but the system doesn't support it.
2462 # Just print a warning and add the library to dependency_libs so
2463 # that the program can be linked against the static library.
2465 $echo "*** Warning: This system can not link to static lib archive $lib."
2466 $echo "*** I have the capability to make that library automatically link in when"
2467 $echo "*** you link to this library. But I can only do this if you have a"
2468 $echo "*** shared version of the library, which you do not appear to have."
2469 if test "$module" = yes; then
2470 $echo "*** But as you try to build a module library, libtool will still create "
2471 $echo "*** a static module, that should work as long as the dlopening application"
2472 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2473 if test -z "$global_symbol_pipe"; then
2475 $echo "*** However, this would only work if libtool was able to extract symbol"
2476 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2477 $echo "*** not find such a program. So, this module is probably useless."
2478 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2480 if test "$build_old_libs" = no; then
2481 build_libtool_libs=module
2484 build_libtool_libs=no
2488 convenience="$convenience $dir/$old_library"
2489 old_convenience="$old_convenience $dir/$old_library"
2490 deplibs="$dir/$old_library $deplibs"
2493 fi # link shared/static library?
2495 if test "$linkmode" = lib; then
2496 if test -n "$dependency_libs" &&
2497 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2498 test "$link_static" = yes; }; then
2499 # Extract -R from dependency_libs
2501 for libdir in $dependency_libs; do
2503 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2505 *" $temp_xrpath "*) ;;
2506 *) xrpath="$xrpath $temp_xrpath";;
2508 *) temp_deplibs="$temp_deplibs $libdir";;
2511 dependency_libs="$temp_deplibs"
2514 newlib_search_path="$newlib_search_path $absdir"
2515 # Link against this library
2516 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2517 # ... and its dependency_libs
2519 for deplib in $dependency_libs; do
2520 newdependency_libs="$deplib $newdependency_libs"
2521 if test "X$duplicate_deps" = "Xyes" ; then
2522 case "$tmp_libs " in
2523 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2526 tmp_libs="$tmp_libs $deplib"
2529 if test "$link_all_deplibs" != no; then
2530 # Add the search paths of all dependency libraries
2531 for deplib in $dependency_libs; do
2533 -L*) path="$deplib" ;;
2535 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2536 test "X$dir" = "X$deplib" && dir="."
2537 # We need an absolute path.
2539 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2541 absdir=`cd "$dir" && pwd`
2542 if test -z "$absdir"; then
2543 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2548 if grep "^installed=no" $deplib > /dev/null; then
2549 path="$absdir/$objdir"
2551 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2552 if test -z "$libdir"; then
2553 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2556 if test "$absdir" != "$libdir"; then
2557 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2564 # we do not want to link against static libs, but need to link against shared
2565 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2566 if test -n "$deplibrary_names" ; then
2567 for tmp in $deplibrary_names ; do
2570 if test -f "$path/$depdepl" ; then
2571 depdepl="$path/$depdepl"
2573 newlib_search_path="$newlib_search_path $path"
2586 # Again, we only want to link against shared libraries
2587 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2588 for tmp in $newlib_search_path ; do
2589 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2590 eval depdepl="$tmp/lib$tmp_libs.dylib"
2601 case " $deplibs " in
2603 *) deplibs="$deplibs $depdepl" ;;
2605 case " $deplibs " in
2607 *) deplibs="$deplibs $path" ;;
2610 fi # link_all_deplibs != no
2612 done # for deplib in $libs
2613 dependency_libs="$newdependency_libs"
2614 if test "$pass" = dlpreopen; then
2615 # Link the dlpreopened libraries before other libraries
2616 for deplib in $save_deplibs; do
2617 deplibs="$deplib $deplibs"
2620 if test "$pass" != dlopen; then
2621 if test "$pass" != conv; then
2622 # Make sure lib_search_path contains only unique directories.
2624 for dir in $newlib_search_path; do
2625 case "$lib_search_path " in
2627 *) lib_search_path="$lib_search_path $dir" ;;
2633 if test "$linkmode,$pass" != "prog,link"; then
2636 vars="compile_deplibs finalize_deplibs"
2638 for var in $vars dependency_libs; do
2639 # Add libraries to $var in reverse order
2640 eval tmp_libs=\"\$$var\"
2642 for deplib in $tmp_libs; do
2643 # FIXME: Pedantically, this is the right thing to do, so
2644 # that some nasty dependency loop isn't accidentally
2646 #new_libs="$deplib $new_libs"
2647 # Pragmatically, this seems to cause very few problems in
2650 -L*) new_libs="$deplib $new_libs" ;;
2653 # And here is the reason: when a library appears more
2654 # than once as an explicit dependence of a library, or
2655 # is implicitly linked in more than once by the
2656 # compiler, it is considered special, and multiple
2657 # occurrences thereof are not removed. Compare this
2658 # with having the same library being listed as a
2659 # dependency of multiple other libraries: in this case,
2660 # we know (pedantically, we assume) the library does not
2661 # need to be listed more than once, so we keep only the
2662 # last copy. This is not always right, but it is rare
2663 # enough that we require users that really mean to play
2664 # such unportable linking tricks to link the library
2665 # using -Wl,-lname, so that libtool does not consider it
2666 # for duplicate removal.
2667 case " $specialdeplibs " in
2668 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2670 case " $new_libs " in
2672 *) new_libs="$deplib $new_libs" ;;
2680 for deplib in $new_libs; do
2683 case " $tmp_libs " in
2685 *) tmp_libs="$tmp_libs $deplib" ;;
2688 *) tmp_libs="$tmp_libs $deplib" ;;
2691 eval $var=\"$tmp_libs\"
2694 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2696 for i in $dependency_libs ; do
2697 case " $predeps $postdeps $compiler_lib_search_path " in
2702 if test -n "$i" ; then
2703 tmp_libs="$tmp_libs $i"
2706 dependency_libs=$tmp_libs
2708 if test "$linkmode" = prog; then
2709 dlfiles="$newdlfiles"
2710 dlprefiles="$newdlprefiles"
2715 if test -n "$deplibs"; then
2716 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2719 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2720 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2723 if test -n "$rpath"; then
2724 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2727 if test -n "$xrpath"; then
2728 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2731 if test -n "$vinfo"; then
2732 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2735 if test -n "$release"; then
2736 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2739 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2740 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2743 # Now set the variables for building old libraries.
2744 build_libtool_libs=no
2746 objs="$objs$old_deplibs"
2750 # Make sure we only generate libraries of the form `libNAME.la'.
2753 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2754 eval shared_ext=\"$shrext\"
2755 eval libname=\"$libname_spec\"
2758 if test "$module" = no; then
2759 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2763 if test "$need_lib_prefix" != no; then
2764 # Add the "lib" prefix for modules if required
2765 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2766 eval shared_ext=\"$shrext\"
2767 eval libname=\"$libname_spec\"
2769 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2774 if test -n "$objs"; then
2775 if test "$deplibs_check_method" != pass_all; then
2776 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2780 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2781 $echo "*** objects $objs is not portable!"
2782 libobjs="$libobjs $objs"
2786 if test "$dlself" != no; then
2787 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2791 if test "$#" -gt 2; then
2792 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2797 if test -z "$rpath"; then
2798 if test "$build_libtool_libs" = yes; then
2799 # Building a libtool convenience library.
2800 # Some compilers have problems with a `.al' extension so
2801 # convenience libraries should have the same extension an
2802 # archive normally would.
2803 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2804 build_libtool_libs=convenience
2808 if test -n "$vinfo"; then
2809 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2812 if test -n "$release"; then
2813 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2817 # Parse the version information argument.
2818 save_ifs="$IFS"; IFS=':'
2819 set dummy $vinfo 0 0 0
2822 if test -n "$8"; then
2823 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2828 # convert absolute version numbers to libtool ages
2829 # this retains compatibility with .la files and attempts
2830 # to make the code below a bit more comprehensible
2832 case $vinfo_number in
2836 number_revision="$4"
2838 # There are really only two kinds -- those that
2839 # use the current revision as the major version
2840 # and those that subtract age and use age as
2841 # a minor version. But, then there is irix
2842 # which has an extra 1 added just for fun
2844 case $version_type in
2845 darwin|linux|osf|windows)
2846 current=`expr $number_major + $number_minor`
2848 revision="$number_revision"
2850 freebsd-aout|freebsd-elf|sunos)
2851 current="$number_major"
2852 revision="$number_minor"
2856 current=`expr $number_major + $number_minor - 1`
2858 revision="$number_minor"
2869 # Check that each of the things are valid numbers.
2871 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2873 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2874 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2880 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2882 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2883 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2889 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2891 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2892 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2897 if test "$age" -gt "$current"; then
2898 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2899 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2903 # Calculate the version variables.
2907 case $version_type in
2911 # Like Linux, but with the current version available in
2912 # verstring for coding it into the library header
2913 major=.`expr $current - $age`
2914 versuffix="$major.$age.$revision"
2915 # Darwin ld doesn't like 0 for these options...
2916 minor_current=`expr $current + 1`
2917 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2922 versuffix=".$current.$revision";
2927 versuffix=".$current";
2931 major=`expr $current - $age + 1`
2933 case $version_type in
2934 nonstopux) verstring_prefix=nonstopux ;;
2935 *) verstring_prefix=sgi ;;
2937 verstring="$verstring_prefix$major.$revision"
2939 # Add in all the interfaces that we are compatible with.
2941 while test "$loop" -ne 0; do
2942 iface=`expr $revision - $loop`
2943 loop=`expr $loop - 1`
2944 verstring="$verstring_prefix$major.$iface:$verstring"
2947 # Before this point, $major must not contain `.'.
2949 versuffix="$major.$revision"
2953 major=.`expr $current - $age`
2954 versuffix="$major.$age.$revision"
2958 major=.`expr $current - $age`
2959 versuffix=".$current.$age.$revision"
2960 verstring="$current.$age.$revision"
2962 # Add in all the interfaces that we are compatible with.
2964 while test "$loop" -ne 0; do
2965 iface=`expr $current - $loop`
2966 loop=`expr $loop - 1`
2967 verstring="$verstring:${iface}.0"
2970 # Make executables depend on our current version.
2971 verstring="$verstring:${current}.0"
2976 versuffix=".$current.$revision"
2980 # Use '-' rather than '.', since we only want one
2981 # extension on DOS 8.3 filesystems.
2982 major=`expr $current - $age`
2987 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2988 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2993 # Clear the version info if we defaulted, and they specified a release.
2994 if test -z "$vinfo" && test -n "$release"; then
2996 case $version_type in
2998 # we can't check for "0.0" in archive_cmds due to quoting
2999 # problems, so we reset it completely
3006 if test "$need_version" = no; then
3013 # Remove version info from name if versioning should be avoided
3014 if test "$avoid_version" = yes && test "$need_version" = no; then
3020 # Check to see if the archive will have undefined symbols.
3021 if test "$allow_undefined" = yes; then
3022 if test "$allow_undefined_flag" = unsupported; then
3023 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3024 build_libtool_libs=no
3028 # Don't allow undefined symbols.
3029 allow_undefined_flag="$no_undefined_flag"
3033 if test "$mode" != relink; then
3034 # Remove our outputs, but don't remove object files since they
3035 # may have been created when compiling PIC objects.
3037 tempremovelist=`$echo "$output_objdir/*"`
3038 for p in $tempremovelist; do
3042 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3043 removelist="$removelist $p"
3048 if test -n "$removelist"; then
3049 $show "${rm}r $removelist"
3050 $run ${rm}r $removelist
3054 # Now set the variables for building old libraries.
3055 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3056 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3058 # Transform .lo files to .o files.
3059 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3062 # Eliminate all temporary directories.
3063 for path in $notinst_path; do
3064 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3065 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3066 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3069 if test -n "$xrpath"; then
3070 # If the user specified any rpath flags, then add them.
3072 for libdir in $xrpath; do
3073 temp_xrpath="$temp_xrpath -R$libdir"
3074 case "$finalize_rpath " in
3076 *) finalize_rpath="$finalize_rpath $libdir" ;;
3079 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3080 dependency_libs="$temp_xrpath $dependency_libs"
3084 # Make sure dlfiles contains only unique files that won't be dlpreopened
3085 old_dlfiles="$dlfiles"
3087 for lib in $old_dlfiles; do
3088 case " $dlprefiles $dlfiles " in
3090 *) dlfiles="$dlfiles $lib" ;;
3094 # Make sure dlprefiles contains only unique files
3095 old_dlprefiles="$dlprefiles"
3097 for lib in $old_dlprefiles; do
3098 case "$dlprefiles " in
3100 *) dlprefiles="$dlprefiles $lib" ;;
3104 if test "$build_libtool_libs" = yes; then
3105 if test -n "$rpath"; then
3107 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3108 # these systems don't actually have a c library (as such)!
3110 *-*-rhapsody* | *-*-darwin1.[012])
3111 # Rhapsody C library is in the System framework
3112 deplibs="$deplibs -framework System"
3115 # Don't link with libc until the a.out ld.so is fixed.
3117 *-*-openbsd* | *-*-freebsd*)
3118 # Do not include libc due to us having libc/libc_r.
3119 test "X$arg" = "X-lc" && continue
3122 # Add libc to deplibs on all other systems if necessary.
3123 if test "$build_libtool_need_lc" = "yes"; then
3124 deplibs="$deplibs -lc"
3130 # Transform deplibs into only deplibs that can be linked in shared.
3132 libname_save=$libname
3133 release_save=$release
3134 versuffix_save=$versuffix
3136 # I'm not sure if I'm treating the release correctly. I think
3137 # release should show up in the -l (ie -lgmp5) so we don't want to
3138 # add it in twice. Is that correct?
3144 case $deplibs_check_method in
3146 # Don't check for shared/static. Everything works.
3147 # This might be a little naive. We might want to check
3148 # whether the library exists or not. But this is on
3149 # osf3 & osf4 and I'm not really sure... Just
3150 # implementing what was already the behavior.
3154 # This code stresses the "libraries are programs" paradigm to its
3155 # limits. Maybe even breaks it. We compile a program, linking it
3156 # against the deplibs as a proxy for the library. Then we can check
3157 # whether they linked in statically or dynamically with ldd.
3159 cat > conftest.c <<EOF
3160 int main() { return 0; }
3163 $LTCC -o conftest conftest.c $deplibs
3164 if test "$?" -eq 0 ; then
3165 ldd_output=`ldd conftest`
3166 for i in $deplibs; do
3167 name="`expr $i : '-l\(.*\)'`"
3168 # If $name is empty we are operating on a -L argument.
3169 if test "$name" != "" && test "$name" -ne "0"; then
3170 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3171 case " $predeps $postdeps " in
3173 newdeplibs="$newdeplibs $i"
3178 if test -n "$i" ; then
3179 libname=`eval \\$echo \"$libname_spec\"`
3180 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3181 set dummy $deplib_matches
3183 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3184 newdeplibs="$newdeplibs $i"
3188 $echo "*** Warning: dynamic linker does not accept needed library $i."
3189 $echo "*** I have the capability to make that library automatically link in when"
3190 $echo "*** you link to this library. But I can only do this if you have a"
3191 $echo "*** shared version of the library, which I believe you do not have"
3192 $echo "*** because a test_compile did reveal that the linker did not use it for"
3193 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3197 newdeplibs="$newdeplibs $i"
3201 # Error occurred in the first compile. Let's try to salvage
3202 # the situation: Compile a separate program for each library.
3203 for i in $deplibs; do
3204 name="`expr $i : '-l\(.*\)'`"
3205 # If $name is empty we are operating on a -L argument.
3206 if test "$name" != "" && test "$name" != "0"; then
3208 $LTCC -o conftest conftest.c $i
3210 if test "$?" -eq 0 ; then
3211 ldd_output=`ldd conftest`
3212 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3213 case " $predeps $postdeps " in
3215 newdeplibs="$newdeplibs $i"
3220 if test -n "$i" ; then
3221 libname=`eval \\$echo \"$libname_spec\"`
3222 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3223 set dummy $deplib_matches
3225 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3226 newdeplibs="$newdeplibs $i"
3230 $echo "*** Warning: dynamic linker does not accept needed library $i."
3231 $echo "*** I have the capability to make that library automatically link in when"
3232 $echo "*** you link to this library. But I can only do this if you have a"
3233 $echo "*** shared version of the library, which you do not appear to have"
3234 $echo "*** because a test_compile did reveal that the linker did not use this one"
3235 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3241 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3242 $echo "*** make it link in! You will probably need to install it or some"
3243 $echo "*** library that it depends on before this library will be fully"
3244 $echo "*** functional. Installing it before continuing would be even better."
3247 newdeplibs="$newdeplibs $i"
3253 set dummy $deplibs_check_method
3254 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3255 for a_deplib in $deplibs; do
3256 name="`expr $a_deplib : '-l\(.*\)'`"
3257 # If $name is empty we are operating on a -L argument.
3258 if test "$name" != "" && test "$name" != "0"; then
3259 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3260 case " $predeps $postdeps " in
3262 newdeplibs="$newdeplibs $a_deplib"
3267 if test -n "$a_deplib" ; then
3268 libname=`eval \\$echo \"$libname_spec\"`
3269 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3270 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3271 for potent_lib in $potential_libs; do
3272 # Follow soft links.
3273 if ls -lLd "$potent_lib" 2>/dev/null \
3274 | grep " -> " >/dev/null; then
3277 # The statement above tries to avoid entering an
3278 # endless loop below, in case of cyclic links.
3279 # We might still enter an endless loop, since a link
3280 # loop can be closed while we follow links,
3282 potlib="$potent_lib"
3283 while test -h "$potlib" 2>/dev/null; do
3284 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3286 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3287 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3290 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3292 | $EGREP "$file_magic_regex" > /dev/null; then
3293 newdeplibs="$newdeplibs $a_deplib"
3300 if test -n "$a_deplib" ; then
3303 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3304 $echo "*** I have the capability to make that library automatically link in when"
3305 $echo "*** you link to this library. But I can only do this if you have a"
3306 $echo "*** shared version of the library, which you do not appear to have"
3307 $echo "*** because I did check the linker path looking for a file starting"
3308 if test -z "$potlib" ; then
3309 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3311 $echo "*** with $libname and none of the candidates passed a file format test"
3312 $echo "*** using a file magic. Last file checked: $potlib"
3316 # Add a -L argument.
3317 newdeplibs="$newdeplibs $a_deplib"
3319 done # Gone through all deplibs.
3322 set dummy $deplibs_check_method
3323 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3324 for a_deplib in $deplibs; do
3325 name="`expr $a_deplib : '-l\(.*\)'`"
3326 # If $name is empty we are operating on a -L argument.
3327 if test -n "$name" && test "$name" != "0"; then
3328 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3329 case " $predeps $postdeps " in
3331 newdeplibs="$newdeplibs $a_deplib"
3336 if test -n "$a_deplib" ; then
3337 libname=`eval \\$echo \"$libname_spec\"`
3338 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3339 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3340 for potent_lib in $potential_libs; do
3341 potlib="$potent_lib" # see symlink-check above in file_magic test
3342 if eval $echo \"$potent_lib\" 2>/dev/null \
3344 | $EGREP "$match_pattern_regex" > /dev/null; then
3345 newdeplibs="$newdeplibs $a_deplib"
3352 if test -n "$a_deplib" ; then
3355 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3356 $echo "*** I have the capability to make that library automatically link in when"
3357 $echo "*** you link to this library. But I can only do this if you have a"
3358 $echo "*** shared version of the library, which you do not appear to have"
3359 $echo "*** because I did check the linker path looking for a file starting"
3360 if test -z "$potlib" ; then
3361 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3363 $echo "*** with $libname and none of the candidates passed a file format test"
3364 $echo "*** using a regex pattern. Last file checked: $potlib"
3368 # Add a -L argument.
3369 newdeplibs="$newdeplibs $a_deplib"
3371 done # Gone through all deplibs.
3375 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3376 -e 's/ -[LR][^ ]*//g'`
3377 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3378 for i in $predeps $postdeps ; do
3379 # can't use Xsed below, because $i might contain '/'
3380 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3383 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3384 | grep . >/dev/null; then
3386 if test "X$deplibs_check_method" = "Xnone"; then
3387 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3389 $echo "*** Warning: inter-library dependencies are not known to be supported."
3391 $echo "*** All declared inter-library dependencies are being dropped."
3396 versuffix=$versuffix_save
3398 release=$release_save
3399 libname=$libname_save
3403 *-*-rhapsody* | *-*-darwin1.[012])
3404 # On Rhapsody replace the C library is the System framework
3405 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3409 if test "$droppeddeps" = yes; then
3410 if test "$module" = yes; then
3412 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3413 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3414 $echo "*** a static module, that should work as long as the dlopening"
3415 $echo "*** application is linked with the -dlopen flag."
3416 if test -z "$global_symbol_pipe"; then
3418 $echo "*** However, this would only work if libtool was able to extract symbol"
3419 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3420 $echo "*** not find such a program. So, this module is probably useless."
3421 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3423 if test "$build_old_libs" = no; then
3424 oldlibs="$output_objdir/$libname.$libext"
3425 build_libtool_libs=module
3428 build_libtool_libs=no
3431 $echo "*** The inter-library dependencies that have been dropped here will be"
3432 $echo "*** automatically added whenever a program is linked with this library"
3433 $echo "*** or is declared to -dlopen it."
3435 if test "$allow_undefined" = no; then
3437 $echo "*** Since this library must not contain undefined symbols,"
3438 $echo "*** because either the platform does not support them or"
3439 $echo "*** it was explicitly requested with -no-undefined,"
3440 $echo "*** libtool will only create a static version of it."
3441 if test "$build_old_libs" = no; then
3442 oldlibs="$output_objdir/$libname.$libext"
3443 build_libtool_libs=module
3446 build_libtool_libs=no
3451 # Done checking deplibs!
3455 # All the library-specific variables (install_libdir is set above).
3460 # Test again, we may have decided not to build it any more
3461 if test "$build_libtool_libs" = yes; then
3462 if test "$hardcode_into_libs" = yes; then
3463 # Hardcode the library paths
3466 rpath="$finalize_rpath"
3467 test "$mode" != relink && rpath="$compile_rpath$rpath"
3468 for libdir in $rpath; do
3469 if test -n "$hardcode_libdir_flag_spec"; then
3470 if test -n "$hardcode_libdir_separator"; then
3471 if test -z "$hardcode_libdirs"; then
3472 hardcode_libdirs="$libdir"
3474 # Just accumulate the unique libdirs.
3475 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3476 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3479 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3484 eval flag=\"$hardcode_libdir_flag_spec\"
3485 dep_rpath="$dep_rpath $flag"
3487 elif test -n "$runpath_var"; then
3488 case "$perm_rpath " in
3490 *) perm_rpath="$perm_rpath $libdir" ;;
3494 # Substitute the hardcoded libdirs into the rpath.
3495 if test -n "$hardcode_libdir_separator" &&
3496 test -n "$hardcode_libdirs"; then
3497 libdir="$hardcode_libdirs"
3498 if test -n "$hardcode_libdir_flag_spec_ld"; then
3499 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3501 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3504 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3505 # We should set the runpath_var.
3507 for dir in $perm_rpath; do
3510 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3512 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3515 shlibpath="$finalize_shlibpath"
3516 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3517 if test -n "$shlibpath"; then
3518 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3521 # Get the real and link names of the library.
3522 eval shared_ext=\"$shrext\"
3523 eval library_names=\"$library_names_spec\"
3524 set dummy $library_names
3528 if test -n "$soname_spec"; then
3529 eval soname=\"$soname_spec\"
3533 if test -z "$dlname"; then
3537 lib="$output_objdir/$realname"
3540 linknames="$linknames $link"
3543 # Use standard objects if they are pic
3544 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3546 # Prepare the list of exported symbols
3547 if test -z "$export_symbols"; then
3548 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3549 $show "generating symbol list for \`$libname.la'"
3550 export_symbols="$output_objdir/$libname.exp"
3551 $run $rm $export_symbols
3552 eval cmds=\"$export_symbols_cmds\"
3553 save_ifs="$IFS"; IFS='~'
3554 for cmd in $cmds; do
3556 if len=`expr "X$cmd" : ".*"` &&
3557 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3559 $run eval "$cmd" || exit $?
3560 skipped_export=false
3562 # The command line is too long to execute in one step.
3563 $show "using reloadable object file for export list..."
3568 if test -n "$export_symbols_regex"; then
3569 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3570 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3571 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3572 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3577 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3578 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3582 for test_deplib in $deplibs; do
3583 case " $convenience " in
3584 *" $test_deplib "*) ;;
3586 tmp_deplibs="$tmp_deplibs $test_deplib"
3590 deplibs="$tmp_deplibs"
3592 if test -n "$convenience"; then
3593 if test -n "$whole_archive_flag_spec"; then
3594 save_libobjs=$libobjs
3595 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3597 gentop="$output_objdir/${outputname}x"
3598 $show "${rm}r $gentop"
3599 $run ${rm}r "$gentop"
3600 $show "$mkdir $gentop"
3601 $run $mkdir "$gentop"
3603 if test "$status" -ne 0 && test ! -d "$gentop"; then
3606 generated="$generated $gentop"
3608 for xlib in $convenience; do
3609 # Extract the objects.
3611 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3612 *) xabs=`pwd`"/$xlib" ;;
3614 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3615 xdir="$gentop/$xlib"
3617 $show "${rm}r $xdir"
3619 $show "$mkdir $xdir"
3622 if test "$status" -ne 0 && test ! -d "$xdir"; then
3625 # We will extract separately just the conflicting names and we will no
3626 # longer touch any unique names. It is faster to leave these extract
3627 # automatically by $AR in one run.
3628 $show "(cd $xdir && $AR x $xabs)"
3629 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3630 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3633 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3634 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3635 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3638 while test "$i" -le "$count"
3640 # Put our $i before any first dot (extension)
3641 # Never overwrite any file
3643 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3645 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3647 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3648 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3654 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3659 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3660 eval flag=\"$thread_safe_flag_spec\"
3661 linker_flags="$linker_flags $flag"
3664 # Make a backup of the uninstalled library when relinking
3665 if test "$mode" = relink; then
3666 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3669 # Do each of the archive commands.
3670 if test "$module" = yes && test -n "$module_cmds" ; then
3671 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3672 eval cmds=\"$module_expsym_cmds\"
3674 eval cmds=\"$module_cmds\"
3677 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3678 eval cmds=\"$archive_expsym_cmds\"
3680 eval cmds=\"$archive_cmds\"
3684 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3685 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3688 # The command line is too long to link in one step, link piecewise.
3689 $echo "creating reloadable object files..."
3691 # Save the value of $output and $libobjs because we want to
3692 # use them later. If we have whole_archive_flag_spec, we
3693 # want to use save_libobjs as it was before
3694 # whole_archive_flag_spec was expanded, because we can't
3695 # assume the linker understands whole_archive_flag_spec.
3696 # This may have to be revisited, in case too many
3697 # convenience libraries get linked in and end up exceeding
3699 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3700 save_libobjs=$libobjs
3704 # Clear the reloadable object creation command queue and
3705 # initialize k to one.
3712 output=$output_objdir/$save_output-${k}.$objext
3713 # Loop over the list of objects to be linked.
3714 for obj in $save_libobjs
3716 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3717 if test "X$objlist" = X ||
3718 { len=`expr "X$test_cmds" : ".*"` &&
3719 test "$len" -le "$max_cmd_len"; }; then
3720 objlist="$objlist $obj"
3722 # The command $test_cmds is almost too long, add a
3723 # command to the queue.
3724 if test "$k" -eq 1 ; then
3725 # The first file doesn't have a previous command to add.
3726 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3728 # All subsequent reloadable object files will link in
3729 # the last one created.
3730 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3732 last_robj=$output_objdir/$save_output-${k}.$objext
3734 output=$output_objdir/$save_output-${k}.$objext
3739 # Handle the remaining objects by creating one last
3740 # reloadable object file. All subsequent reloadable object
3741 # files will link in the last one created.
3742 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3743 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3745 if ${skipped_export-false}; then
3746 $show "generating symbol list for \`$libname.la'"
3747 export_symbols="$output_objdir/$libname.exp"
3748 $run $rm $export_symbols
3750 # Append the command to create the export file.
3751 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3754 # Set up a command to remove the reloadale object files
3755 # after they are used.
3757 while test "$i" -lt "$k"
3760 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3763 $echo "creating a temporary reloadable object file: $output"
3765 # Loop through the commands generated above and execute them.
3766 save_ifs="$IFS"; IFS='~'
3767 for cmd in $concat_cmds; do
3770 $run eval "$cmd" || exit $?
3775 # Restore the value of output.
3778 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3779 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3781 # Expand the library linking commands again to reset the
3782 # value of $libobjs for piecewise linking.
3784 # Do each of the archive commands.
3785 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3786 eval cmds=\"$archive_expsym_cmds\"
3788 eval cmds=\"$archive_cmds\"
3791 # Append the command to remove the reloadable object files
3792 # to the just-reset $cmds.
3793 eval cmds=\"\$cmds~$rm $delfiles\"
3795 save_ifs="$IFS"; IFS='~'
3796 for cmd in $cmds; do
3799 $run eval "$cmd" || exit $?
3803 # Restore the uninstalled library and exit
3804 if test "$mode" = relink; then
3805 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3809 # Create links to the real library.
3810 for linkname in $linknames; do
3811 if test "$realname" != "$linkname"; then
3812 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3813 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3817 # If -module or -export-dynamic was specified, set the dlname.
3818 if test "$module" = yes || test "$export_dynamic" = yes; then
3819 # On all known operating systems, these are identical.
3826 if test -n "$deplibs"; then
3827 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3830 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3831 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3834 if test -n "$rpath"; then
3835 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3838 if test -n "$xrpath"; then
3839 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3842 if test -n "$vinfo"; then
3843 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3846 if test -n "$release"; then
3847 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3852 if test -n "$objs$old_deplibs"; then
3853 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3857 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3865 # Delete the old objects.
3866 $run $rm $obj $libobj
3868 # Objects from convenience libraries. This assumes
3869 # single-version convenience libraries. Whenever we create
3870 # different ones for PIC/non-PIC, this we'll have to duplicate
3874 # reload_cmds runs $LD directly, so let us get rid of
3875 # -Wl from whole_archive_flag_spec
3878 if test -n "$convenience"; then
3879 if test -n "$whole_archive_flag_spec"; then
3880 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3882 gentop="$output_objdir/${obj}x"
3883 $show "${rm}r $gentop"
3884 $run ${rm}r "$gentop"
3885 $show "$mkdir $gentop"
3886 $run $mkdir "$gentop"
3888 if test "$status" -ne 0 && test ! -d "$gentop"; then
3891 generated="$generated $gentop"
3893 for xlib in $convenience; do
3894 # Extract the objects.
3896 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3897 *) xabs=`pwd`"/$xlib" ;;
3899 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3900 xdir="$gentop/$xlib"
3902 $show "${rm}r $xdir"
3904 $show "$mkdir $xdir"
3907 if test "$status" -ne 0 && test ! -d "$xdir"; then
3910 # We will extract separately just the conflicting names and we will no
3911 # longer touch any unique names. It is faster to leave these extract
3912 # automatically by $AR in one run.
3913 $show "(cd $xdir && $AR x $xabs)"
3914 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3915 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3918 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3919 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3920 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3923 while test "$i" -le "$count"
3925 # Put our $i before any first dot (extension)
3926 # Never overwrite any file
3928 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3930 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3932 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3933 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3939 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3944 # Create the old-style object.
3945 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
3948 eval cmds=\"$reload_cmds\"
3949 save_ifs="$IFS"; IFS='~'
3950 for cmd in $cmds; do
3953 $run eval "$cmd" || exit $?
3957 # Exit if we aren't doing a library object file.
3958 if test -z "$libobj"; then
3959 if test -n "$gentop"; then
3960 $show "${rm}r $gentop"
3967 if test "$build_libtool_libs" != yes; then
3968 if test -n "$gentop"; then
3969 $show "${rm}r $gentop"
3973 # Create an invalid libtool object if no PIC, so that we don't
3974 # accidentally link it into a program.
3975 # $show "echo timestamp > $libobj"
3976 # $run eval "echo timestamp > $libobj" || exit $?
3980 if test -n "$pic_flag" || test "$pic_mode" != default; then
3981 # Only do commands if we really have different PIC objects.
3982 reload_objs="$libobjs $reload_conv_objs"
3984 eval cmds=\"$reload_cmds\"
3985 save_ifs="$IFS"; IFS='~'
3986 for cmd in $cmds; do
3989 $run eval "$cmd" || exit $?
3994 if test -n "$gentop"; then
3995 $show "${rm}r $gentop"
4004 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4006 if test -n "$vinfo"; then
4007 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4010 if test -n "$release"; then
4011 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4014 if test "$preload" = yes; then
4015 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4016 test "$dlopen_self_static" = unknown; then
4017 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4022 *-*-rhapsody* | *-*-darwin1.[012])
4023 # On Rhapsody replace the C library is the System framework
4024 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4025 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4031 # Don't allow lazy linking, it breaks C++ global constructors
4032 if test "$tagname" = CXX ; then
4033 compile_command="$compile_command ${wl}-bind_at_load"
4034 finalize_command="$finalize_command ${wl}-bind_at_load"
4039 compile_command="$compile_command $compile_deplibs"
4040 finalize_command="$finalize_command $finalize_deplibs"
4042 if test -n "$rpath$xrpath"; then
4043 # If the user specified any rpath flags, then add them.
4044 for libdir in $rpath $xrpath; do
4045 # This is the magic to use -rpath.
4046 case "$finalize_rpath " in
4048 *) finalize_rpath="$finalize_rpath $libdir" ;;
4053 # Now hardcode the library paths
4056 for libdir in $compile_rpath $finalize_rpath; do
4057 if test -n "$hardcode_libdir_flag_spec"; then
4058 if test -n "$hardcode_libdir_separator"; then
4059 if test -z "$hardcode_libdirs"; then
4060 hardcode_libdirs="$libdir"
4062 # Just accumulate the unique libdirs.
4063 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4064 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4067 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4072 eval flag=\"$hardcode_libdir_flag_spec\"
4073 rpath="$rpath $flag"
4075 elif test -n "$runpath_var"; then
4076 case "$perm_rpath " in
4078 *) perm_rpath="$perm_rpath $libdir" ;;
4082 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4083 case :$dllsearchpath: in
4085 *) dllsearchpath="$dllsearchpath:$libdir";;
4090 # Substitute the hardcoded libdirs into the rpath.
4091 if test -n "$hardcode_libdir_separator" &&
4092 test -n "$hardcode_libdirs"; then
4093 libdir="$hardcode_libdirs"
4094 eval rpath=\" $hardcode_libdir_flag_spec\"
4096 compile_rpath="$rpath"
4100 for libdir in $finalize_rpath; do
4101 if test -n "$hardcode_libdir_flag_spec"; then
4102 if test -n "$hardcode_libdir_separator"; then
4103 if test -z "$hardcode_libdirs"; then
4104 hardcode_libdirs="$libdir"
4106 # Just accumulate the unique libdirs.
4107 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4108 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4111 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4116 eval flag=\"$hardcode_libdir_flag_spec\"
4117 rpath="$rpath $flag"
4119 elif test -n "$runpath_var"; then
4120 case "$finalize_perm_rpath " in
4122 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4126 # Substitute the hardcoded libdirs into the rpath.
4127 if test -n "$hardcode_libdir_separator" &&
4128 test -n "$hardcode_libdirs"; then
4129 libdir="$hardcode_libdirs"
4130 eval rpath=\" $hardcode_libdir_flag_spec\"
4132 finalize_rpath="$rpath"
4134 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4135 # Transform all the library objects into standard objects.
4136 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4137 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4141 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4142 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4143 dlsyms="${outputname}S.c"
4145 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4149 if test -n "$dlsyms"; then
4153 # Discover the nlist of each of the dlfiles.
4154 nlist="$output_objdir/${outputname}.nm"
4156 $show "$rm $nlist ${nlist}S ${nlist}T"
4157 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4159 # Parse the name list into a source file.
4160 $show "creating $output_objdir/$dlsyms"
4162 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4163 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4164 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4170 /* Prevent the only kind of declaration conflicts we can make. */
4171 #define lt_preloaded_symbols some_other_symbol
4173 /* External symbol declarations for the compiler. */\
4176 if test "$dlself" = yes; then
4177 $show "generating symbol list for \`$output'"
4179 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4181 # Add our own program objects to the symbol list.
4182 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4183 for arg in $progfiles; do
4184 $show "extracting global C symbols from \`$arg'"
4185 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4188 if test -n "$exclude_expsyms"; then
4189 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4190 $run eval '$mv "$nlist"T "$nlist"'
4193 if test -n "$export_symbols_regex"; then
4194 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4195 $run eval '$mv "$nlist"T "$nlist"'
4198 # Prepare the list of exported symbols
4199 if test -z "$export_symbols"; then
4200 export_symbols="$output_objdir/$output.exp"
4201 $run $rm $export_symbols
4202 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4204 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4205 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4206 $run eval 'mv "$nlist"T "$nlist"'
4210 for arg in $dlprefiles; do
4211 $show "extracting global C symbols from \`$arg'"
4212 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4213 $run eval '$echo ": $name " >> "$nlist"'
4214 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4217 if test -z "$run"; then
4218 # Make sure we have at least an empty file.
4219 test -f "$nlist" || : > "$nlist"
4221 if test -n "$exclude_expsyms"; then
4222 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4223 $mv "$nlist"T "$nlist"
4226 # Try sorting and uniquifying the output.
4227 if grep -v "^: " < "$nlist" |
4228 if sort -k 3 </dev/null >/dev/null 2>&1; then
4233 uniq > "$nlist"S; then
4236 grep -v "^: " < "$nlist" > "$nlist"S
4239 if test -f "$nlist"S; then
4240 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4242 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4245 $echo >> "$output_objdir/$dlsyms" "\
4247 #undef lt_preloaded_symbols
4249 #if defined (__STDC__) && __STDC__
4250 # define lt_ptr void *
4252 # define lt_ptr char *
4256 /* The mapping between symbol names and symbols. */
4261 lt_preloaded_symbols[] =
4265 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4267 $echo >> "$output_objdir/$dlsyms" "\
4271 /* This works around a problem in FreeBSD linker */
4272 #ifdef FREEBSD_WORKAROUND
4273 static const void *lt_preloaded_setup() {
4274 return lt_preloaded_symbols;
4284 pic_flag_for_symtable=
4286 # compiling the symbol table file with pic_flag works around
4287 # a FreeBSD bug that causes programs to crash when -lm is
4288 # linked before any other PIC object. But we must not use
4289 # pic_flag when linking with -static. The problem exists in
4290 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4291 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4292 case "$compile_command " in
4294 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4297 case "$compile_command " in
4299 *) pic_flag_for_symtable=" $pic_flag";;
4303 # Now compile the dynamic symbol file.
4304 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4305 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4307 # Clean up the generated files.
4308 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4309 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4311 # Transform the symbol file into the correct name.
4312 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4313 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4316 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4321 # We keep going just in case the user didn't refer to
4322 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4323 # really was required.
4325 # Nullify the symbol file.
4326 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4327 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4330 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4331 # Replace the output file specification.
4332 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4333 link_command="$compile_command$compile_rpath"
4335 # We have no uninstalled library dependencies, so finalize right now.
4336 $show "$link_command"
4337 $run eval "$link_command"
4340 # Delete the generated files.
4341 if test -n "$dlsyms"; then
4342 $show "$rm $output_objdir/${outputname}S.${objext}"
4343 $run $rm "$output_objdir/${outputname}S.${objext}"
4349 if test -n "$shlibpath_var"; then
4350 # We should set the shlibpath_var
4352 for dir in $temp_rpath; do
4354 [\\/]* | [A-Za-z]:[\\/]*)
4359 # Relative path: add a thisdir entry.
4360 rpath="$rpath\$thisdir/$dir:"
4367 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4368 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4370 if test -n "$finalize_shlibpath"; then
4371 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4376 if test -n "$runpath_var"; then
4377 if test -n "$perm_rpath"; then
4378 # We should set the runpath_var.
4380 for dir in $perm_rpath; do
4383 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4385 if test -n "$finalize_perm_rpath"; then
4386 # We should set the runpath_var.
4388 for dir in $finalize_perm_rpath; do
4391 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4395 if test "$no_install" = yes; then
4396 # We don't need to create a wrapper script.
4397 link_command="$compile_var$compile_command$compile_rpath"
4398 # Replace the output file specification.
4399 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4400 # Delete the old output file.
4402 # Link the executable and exit
4403 $show "$link_command"
4404 $run eval "$link_command" || exit $?
4408 if test "$hardcode_action" = relink; then
4409 # Fast installation is not supported
4410 link_command="$compile_var$compile_command$compile_rpath"
4411 relink_command="$finalize_var$finalize_command$finalize_rpath"
4413 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4414 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4416 if test "$fast_install" != no; then
4417 link_command="$finalize_var$compile_command$finalize_rpath"
4418 if test "$fast_install" = yes; then
4419 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4421 # fast_install is set to needless
4425 link_command="$compile_var$compile_command$compile_rpath"
4426 relink_command="$finalize_var$finalize_command$finalize_rpath"
4430 # Replace the output file specification.
4431 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4433 # Delete the old output files.
4434 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4436 $show "$link_command"
4437 $run eval "$link_command" || exit $?
4439 # Now create the wrapper script.
4440 $show "creating $output"
4442 # Quote the relink command for shipping.
4443 if test -n "$relink_command"; then
4444 # Preserve any variables that may affect compiler behavior
4445 for var in $variables_saved_for_relink; do
4446 if eval test -z \"\${$var+set}\"; then
4447 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4448 elif eval var_value=\$$var; test -z "$var_value"; then
4449 relink_command="$var=; export $var; $relink_command"
4451 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4452 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4455 relink_command="(cd `pwd`; $relink_command)"
4456 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4459 # Quote $echo for shipping.
4460 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4462 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4463 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4465 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4467 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4470 # Only actually do things if our run command is non-null.
4471 if test -z "$run"; then
4472 # win32 will think the script is a binary if it has
4473 # a .exe suffix, so we strip it off here.
4475 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4477 # test for cygwin because mv fails w/o .exe extensions
4481 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4485 *cygwin* | *mingw* )
4486 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4487 cwrapper=`$echo ${output}.exe`
4488 $rm $cwrappersource $cwrapper
4489 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4491 cat > $cwrappersource <<EOF
4493 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4494 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4496 The $output program cannot be directly executed until all the libtool
4497 libraries that it depends on are installed.
4499 This wrapper executable should never be moved out of the build directory.
4500 If it is, it will not operate correctly.
4502 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4503 but could eventually absorb all of the scripts functionality and
4504 exec $objdir/$outputname directly.
4507 cat >> $cwrappersource<<"EOF"
4515 #if defined(PATH_MAX)
4516 # define LT_PATHMAX PATH_MAX
4517 #elif defined(MAXPATHLEN)
4518 # define LT_PATHMAX MAXPATHLEN
4520 # define LT_PATHMAX 1024
4523 #ifndef DIR_SEPARATOR
4524 #define DIR_SEPARATOR '/'
4527 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4529 #define HAVE_DOS_BASED_FILE_SYSTEM
4530 #ifndef DIR_SEPARATOR_2
4531 #define DIR_SEPARATOR_2 '\\'
4535 #ifndef DIR_SEPARATOR_2
4536 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4537 #else /* DIR_SEPARATOR_2 */
4538 # define IS_DIR_SEPARATOR(ch) \
4539 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4540 #endif /* DIR_SEPARATOR_2 */
4542 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4543 #define XFREE(stale) do { \
4544 if (stale) { free ((void *) stale); stale = 0; } \
4547 const char *program_name = NULL;
4549 void * xmalloc (size_t num);
4550 char * xstrdup (const char *string);
4551 char * basename (const char *name);
4552 char * fnqualify(const char *path);
4553 char * strendzap(char *str, const char *pat);
4554 void lt_fatal (const char *message, ...);
4557 main (int argc, char *argv[])
4562 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4563 newargz = XMALLOC(char *, argc+2);
4566 cat >> $cwrappersource <<EOF
4567 newargz[0] = "$SHELL";
4570 cat >> $cwrappersource <<"EOF"
4571 newargz[1] = fnqualify(argv[0]);
4572 /* we know the script has the same name, without the .exe */
4573 /* so make sure newargz[1] doesn't end in .exe */
4574 strendzap(newargz[1],".exe");
4575 for (i = 1; i < argc; i++)
4576 newargz[i+1] = xstrdup(argv[i]);
4577 newargz[argc+1] = NULL;
4580 cat >> $cwrappersource <<EOF
4581 execv("$SHELL",newargz);
4584 cat >> $cwrappersource <<"EOF"
4588 xmalloc (size_t num)
4590 void * p = (void *) malloc (num);
4592 lt_fatal ("Memory exhausted");
4598 xstrdup (const char *string)
4600 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4605 basename (const char *name)
4609 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4610 /* Skip over the disk name in MSDOS pathnames. */
4611 if (isalpha (name[0]) && name[1] == ':')
4615 for (base = name; *name; name++)
4616 if (IS_DIR_SEPARATOR (*name))
4618 return (char *) base;
4622 fnqualify(const char *path)
4626 char tmp[LT_PATHMAX + 1];
4628 assert(path != NULL);
4630 /* Is it qualified already? */
4631 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4632 if (isalpha (path[0]) && path[1] == ':')
4633 return xstrdup (path);
4635 if (IS_DIR_SEPARATOR (path[0]))
4636 return xstrdup (path);
4638 /* prepend the current directory */
4639 /* doesn't handle '~' */
4640 if (getcwd (tmp, LT_PATHMAX) == NULL)
4641 lt_fatal ("getcwd failed");
4642 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4643 p = XMALLOC(char, size);
4644 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4649 strendzap(char *str, const char *pat)
4653 assert(str != NULL);
4654 assert(pat != NULL);
4657 patlen = strlen(pat);
4661 str += len - patlen;
4662 if (strcmp(str, pat) == 0)
4669 lt_error_core (int exit_status, const char * mode,
4670 const char * message, va_list ap)
4672 fprintf (stderr, "%s: %s: ", program_name, mode);
4673 vfprintf (stderr, message, ap);
4674 fprintf (stderr, ".\n");
4676 if (exit_status >= 0)
4681 lt_fatal (const char *message, ...)
4684 va_start (ap, message);
4685 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4689 # we should really use a build-platform specific compiler
4690 # here, but OTOH, the wrappers (shell script and this C one)
4691 # are only useful if you want to execute the "real" binary.
4692 # Since the "real" binary is built for $host, then this
4693 # wrapper might as well be built for $host, too.
4694 $run $LTCC -s -o $cwrapper $cwrappersource
4698 trap "$rm $output; exit 1" 1 2 15
4703 # $output - temporary wrapper script for $objdir/$outputname
4704 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4706 # The $output program cannot be directly executed until all the libtool
4707 # libraries that it depends on are installed.
4709 # This wrapper script should never be moved out of the build directory.
4710 # If it is, it will not operate correctly.
4712 # Sed substitution that helps us do robust quoting. It backslashifies
4713 # metacharacters that are still active within double-quoted strings.
4714 Xsed='${SED} -e 1s/^X//'
4715 sed_quote_subst='$sed_quote_subst'
4717 # The HP-UX ksh and POSIX shell print the target directory to stdout
4719 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4721 relink_command=\"$relink_command\"
4723 # This environment variable determines our operation mode.
4724 if test \"\$libtool_install_magic\" = \"$magic\"; then
4725 # install mode needs the following variable:
4726 notinst_deplibs='$notinst_deplibs'
4728 # When we are sourced in execute mode, \$file and \$echo are already set.
4729 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4732 # Make sure echo works.
4733 if test \"X\$1\" = X--no-reexec; then
4734 # Discard the --no-reexec flag, and continue.
4736 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4737 # Yippee, \$echo works!
4740 # Restart under the correct shell, and then maybe \$echo will work.
4741 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4747 # Find the directory that this script lives in.
4748 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4749 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4751 # Follow symbolic links until we get to the real thisdir.
4752 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4753 while test -n \"\$file\"; do
4754 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4756 # If there was a directory component, then change thisdir.
4757 if test \"x\$destdir\" != \"x\$file\"; then
4758 case \"\$destdir\" in
4759 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4760 *) thisdir=\"\$thisdir/\$destdir\" ;;
4764 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4765 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4768 # Try to get the absolute directory name.
4769 absdir=\`cd \"\$thisdir\" && pwd\`
4770 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4773 if test "$fast_install" = yes; then
4775 program=lt-'$outputname'$exeext
4776 progdir=\"\$thisdir/$objdir\"
4778 if test ! -f \"\$progdir/\$program\" || \\
4779 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4780 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4782 file=\"\$\$-\$program\"
4784 if test ! -d \"\$progdir\"; then
4785 $mkdir \"\$progdir\"
4787 $rm \"\$progdir/\$file\"
4792 # relink executable if necessary
4793 if test -n \"\$relink_command\"; then
4794 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4796 $echo \"\$relink_command_output\" >&2
4797 $rm \"\$progdir/\$file\"
4802 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4803 { $rm \"\$progdir/\$program\";
4804 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4805 $rm \"\$progdir/\$file\"
4809 program='$outputname'
4810 progdir=\"\$thisdir/$objdir\"
4816 if test -f \"\$progdir/\$program\"; then"
4818 # Export our shlibpath_var if we have one.
4819 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4821 # Add our own library path to $shlibpath_var
4822 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4824 # Some systems cannot cope with colon-terminated $shlibpath_var
4825 # The second colon is a workaround for a bug in BeOS R4 sed
4826 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4828 export $shlibpath_var
4832 # fixup the dll searchpath if we need to.
4833 if test -n "$dllsearchpath"; then
4835 # Add the dll search path components to the executable PATH
4836 PATH=$dllsearchpath:\$PATH
4841 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4842 # Run the actual program with our arguments.
4845 # Backslashes separate directories on plain windows
4846 *-*-mingw | *-*-os2*)
4848 exec \$progdir\\\\\$program \${1+\"\$@\"}
4854 exec \$progdir/\$program \${1+\"\$@\"}
4859 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4863 # The program doesn't exist.
4864 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4865 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4866 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4877 # See if we need to build an old-fashioned archive.
4878 for oldlib in $oldlibs; do
4880 if test "$build_libtool_libs" = convenience; then
4881 oldobjs="$libobjs_save"
4882 addlibs="$convenience"
4883 build_libtool_libs=no
4885 if test "$build_libtool_libs" = module; then
4886 oldobjs="$libobjs_save"
4887 build_libtool_libs=no
4889 oldobjs="$old_deplibs $non_pic_objects"
4891 addlibs="$old_convenience"
4894 if test -n "$addlibs"; then
4895 gentop="$output_objdir/${outputname}x"
4896 $show "${rm}r $gentop"
4897 $run ${rm}r "$gentop"
4898 $show "$mkdir $gentop"
4899 $run $mkdir "$gentop"
4901 if test "$status" -ne 0 && test ! -d "$gentop"; then
4904 generated="$generated $gentop"
4906 # Add in members from convenience archives.
4907 for xlib in $addlibs; do
4908 # Extract the objects.
4910 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4911 *) xabs=`pwd`"/$xlib" ;;
4913 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4914 xdir="$gentop/$xlib"
4916 $show "${rm}r $xdir"
4918 $show "$mkdir $xdir"
4921 if test "$status" -ne 0 && test ! -d "$xdir"; then
4924 # We will extract separately just the conflicting names and we will no
4925 # longer touch any unique names. It is faster to leave these extract
4926 # automatically by $AR in one run.
4927 $show "(cd $xdir && $AR x $xabs)"
4928 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4929 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4932 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4933 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4934 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4937 while test "$i" -le "$count"
4939 # Put our $i before any first dot (extension)
4940 # Never overwrite any file
4942 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4944 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4946 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4947 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4953 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4957 # Do each command in the archive commands.
4958 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4959 eval cmds=\"$old_archive_from_new_cmds\"
4961 eval cmds=\"$old_archive_cmds\"
4963 if len=`expr "X$cmds" : ".*"` &&
4964 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4967 # the command line is too long to link in one step, link in parts
4968 $echo "using piecewise archive linking..."
4973 save_oldobjs=$oldobjs
4974 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4975 # encoded into archives. This makes 'ar r' malfunction in
4976 # this piecewise linking case whenever conflicting object
4977 # names appear in distinct ar calls; check, warn and compensate.
4978 if (for obj in $save_oldobjs
4980 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4981 done | sort | sort -uc >/dev/null 2>&1); then
4984 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4985 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4988 # Is there a better way of finding the last object in the list?
4989 for obj in $save_oldobjs
4993 for obj in $save_oldobjs
4995 oldobjs="$objlist $obj"
4996 objlist="$objlist $obj"
4997 eval test_cmds=\"$old_archive_cmds\"
4998 if len=`expr "X$test_cmds" : ".*"` &&
4999 test "$len" -le "$max_cmd_len"; then
5002 # the above command should be used before it gets too long
5004 if test "$obj" = "$last_oldobj" ; then
5007 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5008 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5014 if test "X$oldobjs" = "X" ; then
5015 eval cmds=\"\$concat_cmds\"
5017 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5021 save_ifs="$IFS"; IFS='~'
5022 for cmd in $cmds; do
5025 $run eval "$cmd" || exit $?
5030 if test -n "$generated"; then
5031 $show "${rm}r$generated"
5032 $run ${rm}r$generated
5035 # Now create the libtool archive.
5039 test "$build_old_libs" = yes && old_library="$libname.$libext"
5040 $show "creating $output"
5042 # Preserve any variables that may affect compiler behavior
5043 for var in $variables_saved_for_relink; do
5044 if eval test -z \"\${$var+set}\"; then
5045 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5046 elif eval var_value=\$$var; test -z "$var_value"; then
5047 relink_command="$var=; export $var; $relink_command"
5049 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5050 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5053 # Quote the link command for shipping.
5054 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5055 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5057 # Only create the output if not a dry run.
5058 if test -z "$run"; then
5059 for installed in no yes; do
5060 if test "$installed" = yes; then
5061 if test -z "$install_libdir"; then
5064 output="$output_objdir/$outputname"i
5065 # Replace all uninstalled libtool libraries with the installed ones
5067 for deplib in $dependency_libs; do
5070 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5071 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5072 if test -z "$libdir"; then
5073 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5076 newdependency_libs="$newdependency_libs $libdir/$name"
5078 *) newdependency_libs="$newdependency_libs $deplib" ;;
5081 dependency_libs="$newdependency_libs"
5083 for lib in $dlfiles; do
5084 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5085 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5086 if test -z "$libdir"; then
5087 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5090 newdlfiles="$newdlfiles $libdir/$name"
5092 dlfiles="$newdlfiles"
5094 for lib in $dlprefiles; do
5095 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5096 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5097 if test -z "$libdir"; then
5098 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5101 newdlprefiles="$newdlprefiles $libdir/$name"
5103 dlprefiles="$newdlprefiles"
5106 # place dlname in correct position for cygwin
5108 case $host,$output,$installed,$module,$dlname in
5109 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5112 # $outputname - a libtool library file
5113 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5115 # Please DO NOT delete this file!
5116 # It is necessary for linking the library.
5118 # The name that we can dlopen(3).
5121 # Names of this library.
5122 library_names='$library_names'
5124 # The name of the static archive.
5125 old_library='$old_library'
5127 # Libraries that this one depends upon.
5128 dependency_libs='$dependency_libs'
5130 # Version information for $libname.
5135 # Is this an already installed library?
5136 installed=$installed
5138 # Should we warn about portability when linking against -modules?
5139 shouldnotlink=$module
5141 # Files to dlopen/dlpreopen
5143 dlpreopen='$dlprefiles'
5145 # Directory that this library needs to be installed in:
5146 libdir='$install_libdir'"
5147 if test "$installed" = no && test "$need_relink" = yes; then
5149 relink_command=\"$relink_command\""
5154 # Do a symbolic link so that the libtool archive can be found in
5155 # LD_LIBRARY_PATH before the program is installed.
5156 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5157 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5163 # libtool install mode
5165 modename="$modename: install"
5167 # There may be an optional sh(1) argument at the beginning of
5168 # install_prog (especially on Windows NT).
5169 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5170 # Allow the use of GNU shtool's install command.
5171 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5172 # Aesthetically quote it.
5173 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5175 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5179 install_prog="$arg "
5187 # The real first argument should be the name of the installation program.
5188 # Aesthetically quote it.
5189 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5191 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5195 install_prog="$install_prog$arg"
5197 # We need to accept at least all the BSD install flags.
5207 if test -n "$dest"; then
5208 files="$files $dest"
5226 # If the previous option needed an argument, then skip it.
5227 if test -n "$prev"; then
5236 # Aesthetically quote the argument.
5237 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5239 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5243 install_prog="$install_prog $arg"
5246 if test -z "$install_prog"; then
5247 $echo "$modename: you must specify an install program" 1>&2
5252 if test -n "$prev"; then
5253 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5258 if test -z "$files"; then
5259 if test -z "$dest"; then
5260 $echo "$modename: no file or destination specified" 1>&2
5262 $echo "$modename: you must specify a destination" 1>&2
5268 # Strip any trailing slash from the destination.
5269 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5271 # Check to see that the destination is a directory.
5272 test -d "$dest" && isdir=yes
5273 if test "$isdir" = yes; then
5277 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5278 test "X$destdir" = "X$dest" && destdir=.
5279 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5281 # Not a directory, so check to see that there is only one file specified.
5283 if test "$#" -gt 2; then
5284 $echo "$modename: \`$dest' is not a directory" 1>&2
5290 [\\/]* | [A-Za-z]:[\\/]*) ;;
5292 for file in $files; do
5296 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5305 # This variable tells wrapper scripts just to set variables rather
5306 # than running their programs.
5307 libtool_install_magic="$magic"
5312 for file in $files; do
5314 # Do each installation.
5317 # Do the static libraries later.
5318 staticlibs="$staticlibs $file"
5322 # Check to see that this really is a libtool archive.
5323 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5325 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5333 # If there is no directory component, then add one.
5335 */* | *\\*) . $file ;;
5339 # Add the libdir to current_libdirs if it is the destination.
5340 if test "X$destdir" = "X$libdir"; then
5341 case "$current_libdirs " in
5343 *) current_libdirs="$current_libdirs $libdir" ;;
5346 # Note the libdir as a future libdir.
5347 case "$future_libdirs " in
5349 *) future_libdirs="$future_libdirs $libdir" ;;
5353 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5354 test "X$dir" = "X$file/" && dir=
5357 if test -n "$relink_command"; then
5358 # Determine the prefix the user has applied to our future dir.
5359 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5361 # Don't allow the user to place us outside of our expected
5362 # location b/c this prevents finding dependent libraries that
5363 # are installed to the same prefix.
5364 # At present, this check doesn't affect windows .dll's that
5365 # are installed into $libdir/../bin (currently, that works fine)
5366 # but it's something to keep an eye on.
5367 if test "$inst_prefix_dir" = "$destdir"; then
5368 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5372 if test -n "$inst_prefix_dir"; then
5373 # Stick the inst_prefix_dir data into the link command.
5374 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5376 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5379 $echo "$modename: warning: relinking \`$file'" 1>&2
5380 $show "$relink_command"
5381 if $run eval "$relink_command"; then :
5383 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5388 # See the names of the shared library.
5389 set dummy $library_names
5390 if test -n "$2"; then
5396 test -n "$relink_command" && srcname="$realname"T
5398 # Install the shared library and build the symlinks.
5399 $show "$install_prog $dir/$srcname $destdir/$realname"
5400 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5401 if test -n "$stripme" && test -n "$striplib"; then
5402 $show "$striplib $destdir/$realname"
5403 $run eval "$striplib $destdir/$realname" || exit $?
5406 if test "$#" -gt 0; then
5407 # Delete the old symlinks, and create new ones.
5410 if test "$linkname" != "$realname"; then
5411 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5412 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5417 # Do each command in the postinstall commands.
5418 lib="$destdir/$realname"
5419 eval cmds=\"$postinstall_cmds\"
5420 save_ifs="$IFS"; IFS='~'
5421 for cmd in $cmds; do
5424 $run eval "$cmd" || exit $?
5429 # Install the pseudo-library for information purposes.
5430 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5431 instname="$dir/$name"i
5432 $show "$install_prog $instname $destdir/$name"
5433 $run eval "$install_prog $instname $destdir/$name" || exit $?
5435 # Maybe install the static library, too.
5436 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5440 # Install (i.e. copy) a libtool object.
5442 # Figure out destination file name, if it wasn't already specified.
5443 if test -n "$destname"; then
5444 destfile="$destdir/$destname"
5446 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5447 destfile="$destdir/$destfile"
5450 # Deduce the name of the destination old-style object file.
5453 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5456 staticdest="$destfile"
5460 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5466 # Install the libtool object if requested.
5467 if test -n "$destfile"; then
5468 $show "$install_prog $file $destfile"
5469 $run eval "$install_prog $file $destfile" || exit $?
5472 # Install the old object if enabled.
5473 if test "$build_old_libs" = yes; then
5474 # Deduce the name of the old-style object file.
5475 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5477 $show "$install_prog $staticobj $staticdest"
5478 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5484 # Figure out destination file name, if it wasn't already specified.
5485 if test -n "$destname"; then
5486 destfile="$destdir/$destname"
5488 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5489 destfile="$destdir/$destfile"
5492 # If the file is missing, and there is a .exe on the end, strip it
5493 # because it is most likely a libtool script we actually want to
5498 if test ! -f "$file"; then
5499 file=`$echo $file|${SED} 's,.exe$,,'`
5505 # Do a test to see if this is really a libtool program.
5508 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5514 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5518 # To insure that "foo" is sourced, and not "foo.exe",
5519 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5520 # which disallows the automatic-append-.exe behavior.
5522 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5523 *) wrapperdot=${wrapper} ;;
5525 # If there is no directory component, then add one.
5527 */* | *\\*) . ${wrapperdot} ;;
5528 *) . ./${wrapperdot} ;;
5531 # Check the variables that should have been set.
5532 if test -z "$notinst_deplibs"; then
5533 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5538 for lib in $notinst_deplibs; do
5539 # Check to see that each library is installed.
5541 if test -f "$lib"; then
5542 # If there is no directory component, then add one.
5544 */* | *\\*) . $lib ;;
5548 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5549 if test -n "$libdir" && test ! -f "$libfile"; then
5550 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5556 # To insure that "foo" is sourced, and not "foo.exe",
5557 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5558 # which disallows the automatic-append-.exe behavior.
5560 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5561 *) wrapperdot=${wrapper} ;;
5563 # If there is no directory component, then add one.
5565 */* | *\\*) . ${wrapperdot} ;;
5566 *) . ./${wrapperdot} ;;
5570 if test "$fast_install" = no && test -n "$relink_command"; then
5571 if test "$finalize" = yes && test -z "$run"; then
5573 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5574 tmpdir="$tmpdir/libtool-$$"
5575 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5577 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5580 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5581 outputname="$tmpdir/$file"
5582 # Replace the output file specification.
5583 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5585 $show "$relink_command"
5586 if $run eval "$relink_command"; then :
5588 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5594 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5597 # Install the binary that we compiled earlier.
5598 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5602 # remove .exe since cygwin /usr/bin/install will append another
5604 case $install_prog,$host in
5605 */usr/bin/install*,*cygwin*)
5606 case $file:$destfile in
5611 destfile=$destfile.exe
5614 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5619 $show "$install_prog$stripme $file $destfile"
5620 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5621 test -n "$outputname" && ${rm}r "$tmpdir"
5626 for file in $staticlibs; do
5627 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5629 # Set up the ranlib parameters.
5630 oldlib="$destdir/$name"
5632 $show "$install_prog $file $oldlib"
5633 $run eval "$install_prog \$file \$oldlib" || exit $?
5635 if test -n "$stripme" && test -n "$striplib"; then
5636 $show "$old_striplib $oldlib"
5637 $run eval "$old_striplib $oldlib" || exit $?
5640 # Do each command in the postinstall commands.
5641 eval cmds=\"$old_postinstall_cmds\"
5642 save_ifs="$IFS"; IFS='~'
5643 for cmd in $cmds; do
5646 $run eval "$cmd" || exit $?
5651 if test -n "$future_libdirs"; then
5652 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5655 if test -n "$current_libdirs"; then
5656 # Maybe just do a dry run.
5657 test -n "$run" && current_libdirs=" -n$current_libdirs"
5658 exec_cmd='$SHELL $0 --finish$current_libdirs'
5664 # libtool finish mode
5666 modename="$modename: finish"
5670 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5673 libdirs="$libdirs $dir"
5676 for libdir in $libdirs; do
5677 if test -n "$finish_cmds"; then
5678 # Do each command in the finish commands.
5679 eval cmds=\"$finish_cmds\"
5680 save_ifs="$IFS"; IFS='~'
5681 for cmd in $cmds; do
5684 $run eval "$cmd" || admincmds="$admincmds
5689 if test -n "$finish_eval"; then
5690 # Do the single finish_eval.
5691 eval cmds=\"$finish_eval\"
5692 $run eval "$cmds" || admincmds="$admincmds
5698 # Exit here if they wanted silent mode.
5699 test "$show" = : && exit 0
5701 $echo "----------------------------------------------------------------------"
5702 $echo "Libraries have been installed in:"
5703 for libdir in $libdirs; do
5707 $echo "If you ever happen to want to link against installed libraries"
5708 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5709 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5710 $echo "flag during linking and do at least one of the following:"
5711 if test -n "$shlibpath_var"; then
5712 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5713 $echo " during execution"
5715 if test -n "$runpath_var"; then
5716 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5717 $echo " during linking"
5719 if test -n "$hardcode_libdir_flag_spec"; then
5721 eval flag=\"$hardcode_libdir_flag_spec\"
5723 $echo " - use the \`$flag' linker flag"
5725 if test -n "$admincmds"; then
5726 $echo " - have your system administrator run these commands:$admincmds"
5728 if test -f /etc/ld.so.conf; then
5729 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5732 $echo "See any operating system documentation about shared libraries for"
5733 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5734 $echo "----------------------------------------------------------------------"
5738 # libtool execute mode
5740 modename="$modename: execute"
5742 # The first argument is the command name.
5744 if test -z "$cmd"; then
5745 $echo "$modename: you must specify a COMMAND" 1>&2
5750 # Handle -dlopen flags immediately.
5751 for file in $execute_dlfiles; do
5752 if test ! -f "$file"; then
5753 $echo "$modename: \`$file' is not a file" 1>&2
5761 # Check to see that this really is a libtool archive.
5762 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5764 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5769 # Read the libtool library.
5773 # If there is no directory component, then add one.
5775 */* | *\\*) . $file ;;
5779 # Skip this library if it cannot be dlopened.
5780 if test -z "$dlname"; then
5781 # Warn if it was a shared library.
5782 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5786 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5787 test "X$dir" = "X$file" && dir=.
5789 if test -f "$dir/$objdir/$dlname"; then
5792 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5798 # Just add the directory containing the .lo file.
5799 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5800 test "X$dir" = "X$file" && dir=.
5804 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5809 # Get the absolute pathname.
5810 absdir=`cd "$dir" && pwd`
5811 test -n "$absdir" && dir="$absdir"
5813 # Now add the directory to shlibpath_var.
5814 if eval "test -z \"\$$shlibpath_var\""; then
5815 eval "$shlibpath_var=\"\$dir\""
5817 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5821 # This variable tells wrapper scripts just to set shlibpath_var
5822 # rather than running their programs.
5823 libtool_execute_magic="$magic"
5825 # Check if any of the arguments is a wrapper script.
5832 # Do a test to see if this is really a libtool program.
5833 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5834 # If there is no directory component, then add one.
5836 */* | *\\*) . $file ;;
5840 # Transform arg to wrapped name.
5841 file="$progdir/$program"
5845 # Quote arguments (to preserve shell metacharacters).
5846 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5847 args="$args \"$file\""
5850 if test -z "$run"; then
5851 if test -n "$shlibpath_var"; then
5852 # Export the shlibpath_var.
5853 eval "export $shlibpath_var"
5856 # Restore saved environment variables
5857 if test "${save_LC_ALL+set}" = set; then
5858 LC_ALL="$save_LC_ALL"; export LC_ALL
5860 if test "${save_LANG+set}" = set; then
5861 LANG="$save_LANG"; export LANG
5864 # Now prepare to actually exec the command.
5865 exec_cmd="\$cmd$args"
5867 # Display what would be done.
5868 if test -n "$shlibpath_var"; then
5869 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5870 $echo "export $shlibpath_var"
5877 # libtool clean and uninstall mode
5879 modename="$modename: $mode"
5885 # This variable tells wrapper scripts just to set variables rather
5886 # than running their programs.
5887 libtool_install_magic="$magic"
5892 -f) rm="$rm $arg"; rmforce=yes ;;
5893 -*) rm="$rm $arg" ;;
5894 *) files="$files $arg" ;;
5898 if test -z "$rm"; then
5899 $echo "$modename: you must specify an RM program" 1>&2
5906 origobjdir="$objdir"
5907 for file in $files; do
5908 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5909 if test "X$dir" = "X$file"; then
5911 objdir="$origobjdir"
5913 objdir="$dir/$origobjdir"
5915 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5916 test "$mode" = uninstall && objdir="$dir"
5918 # Remember objdir for removal later, being careful to avoid duplicates
5919 if test "$mode" = clean; then
5922 *) rmdirs="$rmdirs $objdir" ;;
5926 # Don't error if the file doesn't exist and rm -f was used.
5927 if (test -L "$file") >/dev/null 2>&1 \
5928 || (test -h "$file") >/dev/null 2>&1 \
5929 || test -f "$file"; then
5931 elif test -d "$file"; then
5934 elif test "$rmforce" = yes; then
5942 # Possibly a libtool archive, so verify it.
5943 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5946 # Delete the libtool libraries and symlinks.
5947 for n in $library_names; do
5948 rmfiles="$rmfiles $objdir/$n"
5950 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5951 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5953 if test "$mode" = uninstall; then
5954 if test -n "$library_names"; then
5955 # Do each command in the postuninstall commands.
5956 eval cmds=\"$postuninstall_cmds\"
5957 save_ifs="$IFS"; IFS='~'
5958 for cmd in $cmds; do
5962 if test "$?" -ne 0 && test "$rmforce" != yes; then
5969 if test -n "$old_library"; then
5970 # Do each command in the old_postuninstall commands.
5971 eval cmds=\"$old_postuninstall_cmds\"
5972 save_ifs="$IFS"; IFS='~'
5973 for cmd in $cmds; do
5977 if test "$?" -ne 0 && test "$rmforce" != yes; then
5983 # FIXME: should reinstall the best remaining shared library.
5989 # Possibly a libtool object, so verify it.
5990 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5995 # Add PIC object to the list of files to remove.
5996 if test -n "$pic_object" \
5997 && test "$pic_object" != none; then
5998 rmfiles="$rmfiles $dir/$pic_object"
6001 # Add non-PIC object to the list of files to remove.
6002 if test -n "$non_pic_object" \
6003 && test "$non_pic_object" != none; then
6004 rmfiles="$rmfiles $dir/$non_pic_object"
6010 if test "$mode" = clean ; then
6014 file=`$echo $file|${SED} 's,.exe$,,'`
6015 noexename=`$echo $name|${SED} 's,.exe$,,'`
6016 # $file with .exe has already been added to rmfiles,
6017 # add $file without .exe
6018 rmfiles="$rmfiles $file"
6021 # Do a test to see if this is a libtool program.
6022 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6026 # note $name still contains .exe if it was in $file originally
6027 # as does the version of $file that was added into $rmfiles
6028 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6029 if test "$fast_install" = yes && test -n "$relink_command"; then
6030 rmfiles="$rmfiles $objdir/lt-$name"
6032 if test "X$noexename" != "X$name" ; then
6033 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6039 $show "$rm $rmfiles"
6040 $run $rm $rmfiles || exit_status=1
6042 objdir="$origobjdir"
6044 # Try to remove the ${objdir}s in the directories where we deleted files
6045 for dir in $rmdirs; do
6046 if test -d "$dir"; then
6048 $run rmdir $dir >/dev/null 2>&1
6056 $echo "$modename: you must specify a MODE" 1>&2
6057 $echo "$generic_help" 1>&2
6062 if test -z "$exec_cmd"; then
6063 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6064 $echo "$generic_help" 1>&2
6067 fi # test -z "$show_help"
6069 if test -n "$exec_cmd"; then
6074 # We need to display help for each of the modes.
6077 "Usage: $modename [OPTION]... [MODE-ARG]...
6079 Provide generalized library-building support services.
6081 --config show all configuration variables
6082 --debug enable verbose shell tracing
6083 -n, --dry-run display commands without modifying any files
6084 --features display basic configuration information and exit
6085 --finish same as \`--mode=finish'
6086 --help display this help message and exit
6087 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6088 --quiet same as \`--silent'
6089 --silent don't print informational messages
6090 --tag=TAG use configuration variables from tag TAG
6091 --version print version information
6093 MODE must be one of the following:
6095 clean remove files from the build directory
6096 compile compile a source file into a libtool object
6097 execute automatically set library path, then run a program
6098 finish complete the installation of libtool libraries
6099 install install libraries or executables
6100 link create a library or an executable
6101 uninstall remove libraries from an installed directory
6103 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6104 a more detailed description of MODE.
6106 Report bugs to <bug-libtool@gnu.org>."
6112 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6114 Remove files from the build directory.
6116 RM is the name of the program to use to delete files associated with each FILE
6117 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6120 If FILE is a libtool library, object or program, all the files associated
6121 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6126 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6128 Compile a source file into a libtool library object.
6130 This mode accepts the following additional options:
6132 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6133 -prefer-pic try to building PIC objects only
6134 -prefer-non-pic try to building non-PIC objects only
6135 -static always build a \`.o' file suitable for static linking
6137 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6138 from the given SOURCEFILE.
6140 The output file name is determined by removing the directory component from
6141 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6142 library object suffix, \`.lo'."
6147 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6149 Automatically set library path, then run a program.
6151 This mode accepts the following additional options:
6153 -dlopen FILE add the directory containing FILE to the library path
6155 This mode sets the library path environment variable according to \`-dlopen'
6158 If any of the ARGS are libtool executable wrappers, then they are translated
6159 into their corresponding uninstalled binary, and any of their required library
6160 directories are added to the library path.
6162 Then, COMMAND is executed, with ARGS as arguments."
6167 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6169 Complete the installation of libtool libraries.
6171 Each LIBDIR is a directory that contains libtool libraries.
6173 The commands that this mode executes may require superuser privileges. Use
6174 the \`--dry-run' option if you just want to see what would be executed."
6179 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6181 Install executables or libraries.
6183 INSTALL-COMMAND is the installation command. The first component should be
6184 either the \`install' or \`cp' program.
6186 The rest of the components are interpreted as arguments to that command (only
6187 BSD-compatible install options are recognized)."
6192 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6194 Link object files or libraries together to form another library, or to
6195 create an executable program.
6197 LINK-COMMAND is a command using the C compiler that you would use to create
6198 a program from several object files.
6200 The following components of LINK-COMMAND are treated specially:
6202 -all-static do not do any dynamic linking at all
6203 -avoid-version do not add a version suffix if possible
6204 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6205 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6206 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6207 -export-symbols SYMFILE
6208 try to export only the symbols listed in SYMFILE
6209 -export-symbols-regex REGEX
6210 try to export only the symbols matching REGEX
6211 -LLIBDIR search LIBDIR for required installed libraries
6212 -lNAME OUTPUT-FILE requires the installed library libNAME
6213 -module build a library that can dlopened
6214 -no-fast-install disable the fast-install mode
6215 -no-install link a not-installable executable
6216 -no-undefined declare that a library does not refer to external symbols
6217 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6218 -objectlist FILE Use a list of object files found in FILE to specify objects
6219 -release RELEASE specify package release information
6220 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6221 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6222 -static do not do any dynamic linking of libtool libraries
6223 -version-info CURRENT[:REVISION[:AGE]]
6224 specify library version info [each variable defaults to 0]
6226 All other options (arguments beginning with \`-') are ignored.
6228 Every other argument is treated as a filename. Files ending in \`.la' are
6229 treated as uninstalled libtool libraries, other files are standard or library
6232 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6233 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6234 required, except when creating a convenience library.
6236 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6237 using \`ar' and \`ranlib', or on Windows using \`lib'.
6239 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6240 is created, otherwise an executable program is created."
6245 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6247 Remove libraries from an installation directory.
6249 RM is the name of the program to use to delete files associated with each FILE
6250 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6253 If FILE is a libtool library, all the files associated with it are deleted.
6254 Otherwise, only FILE itself is deleted using RM."
6258 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6265 $echo "Try \`$modename --help' for more information about other modes."
6269 # The TAGs below are defined such that we never get into a situation
6270 # in which we disable both kinds of libraries. Given conflicting
6271 # choices, we go for a static library, that is the most portable,
6272 # since we can't tell whether shared libraries were disabled because
6273 # the user asked for that or because the platform doesn't support
6274 # them. This is particularly important on AIX, because we don't
6275 # support having both static and shared libraries enabled at the same
6276 # time on that platform, so we default to a shared-only configuration.
6277 # If a disable-shared tag is given, we'll fallback to a static-only
6278 # configuration. But we'll never go from static-only to shared-only.
6280 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6281 build_libtool_libs=no
6283 # ### END LIBTOOL TAG CONFIG: disable-shared
6285 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6286 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6287 # ### END LIBTOOL TAG CONFIG: disable-static