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.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # The name of this program.
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
59 TIMESTAMP=" (1.1220 2003/04/05 19:32:58)"
62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 Xsed="${SED}"' -e 1s/^X//'
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 # test EBCDIC or ASCII
73 case `echo A|od -x` in
74 *[Cc]1*) # EBCDIC based system
75 SP2NL="tr '\100' '\n'"
76 NL2SP="tr '\r\n' '\100\100'"
78 *) # Assume ASCII based system
79 SP2NL="tr '\040' '\012'"
80 NL2SP="tr '\015\012' '\040\040'"
85 # Only set LANG and LC_ALL to C if already set.
86 # These must not be set unconditionally because not all systems understand
87 # e.g. LANG=C (notably SCO).
88 # We save the old values to restore during execute mode.
89 if test "${LC_ALL+set}" = set; then
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
92 if test "${LANG+set}" = set; then
93 save_LANG="$LANG"; LANG=C; export LANG
96 # Make sure IFS has a sensible default
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100 $echo "$modename: not configured to build any kind of library" 1>&2
101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
114 lo2o="s/\\.lo\$/.${objext}/"
115 o2lo="s/\\.${objext}\$/.lo/"
117 #####################################
118 # Shell function definitions:
119 # This seems to be the best place for them
121 # Need a lot of goo to handle *both* DLLs and import libs
122 # Has to be a shell function in order to 'eat' the argument
123 # that is supplied when $file_magic_command is called.
125 win32_libid_type="unknown"
126 win32_fileres=`file -L $1 2>/dev/null`
127 case $win32_fileres in
128 *ar\ archive\ import\ library*) # definitely import
129 win32_libid_type="x86 archive import"
131 *ar\ archive*) # could be an import, or static
132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
134 win32_nmres=`eval $NM -f posix -A $1 | \
135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
136 if test "X$win32_nmres" = "Ximport" ; then
137 win32_libid_type="x86 archive import"
139 win32_libid_type="x86 archive static"
144 win32_libid_type="x86 DLL"
146 *executable*) # but shell scripts are "executable" too...
147 case $win32_fileres in
148 *MS\ Windows\ PE\ Intel*)
149 win32_libid_type="x86 DLL"
154 $echo $win32_libid_type
157 # End of Shell function definitions
158 #####################################
160 # Parse our command line options once, thoroughly.
161 while test "$#" -gt 0
167 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
171 # If the previous option needs an argument, assign it.
172 if test -n "$prev"; then
175 execute_dlfiles="$execute_dlfiles $arg"
180 # Check whether tagname contains only valid characters
183 $echo "$progname: invalid tag name: $tagname" 1>&2
190 # Don't test for the "default" C tag, as we know, it's there, but
191 # not specially marked.
194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
195 taglist="$taglist $tagname"
196 # Evaluate the configuration.
197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
199 $echo "$progname: ignoring unknown tag $tagname" 1>&2
214 # Have we seen a non-optional argument yet?
221 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
223 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
224 $echo "This is free software; see the source for copying conditions. There is NO"
225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
231 # Now print the configurations for the tags.
232 for tagname in $taglist; do
233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
239 $echo "$progname: enabling shell trace mode"
249 if test "$build_libtool_libs" = yes; then
250 $echo "enable shared libraries"
252 $echo "disable shared libraries"
254 if test "$build_old_libs" = yes; then
255 $echo "enable static libraries"
257 $echo "disable static libraries"
262 --finish) mode="finish" ;;
264 --mode) prevopt="--mode" prev=mode ;;
265 --mode=*) mode="$optarg" ;;
267 --preserve-dup-deps) duplicate_deps="yes" ;;
273 --tag) prevopt="--tag" prev=tag ;;
275 set tag "$optarg" ${1+"$@"}
286 $echo "$modename: unrecognized option \`$arg'" 1>&2
298 if test -n "$prevopt"; then
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
304 # If this variable is set in any of the actions, the command in it
305 # will be execed at the end. This prevents here-documents from being
306 # left over by shells.
309 if test -z "$show_help"; then
311 # Infer the operation mode.
312 if test -z "$mode"; then
313 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
314 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
316 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
328 *db | *dbx | *strace | *truss)
338 # If we have no mode, but dlfiles were specified, then do execute mode.
339 test -n "$execute_dlfiles" && mode=execute
341 # Just use the default operation mode.
342 if test -z "$mode"; then
343 if test -n "$nonopt"; then
344 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
346 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
353 # Only execute mode is allowed to have -dlopen flags.
354 if test -n "$execute_dlfiles" && test "$mode" != execute; then
355 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
360 # Change the help message to a mode-specific one.
362 help="Try \`$modename --help --mode=$mode' for more information."
364 # These modes are in order of execution frequency so that they run quickly.
366 # libtool compile mode
368 modename="$modename: compile"
369 # Get the compilation command and the source file.
371 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
380 # do not "continue". Instead, add this to base_compile
392 # Accept any command-line options.
395 if test -n "$libobj" ; then
396 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
419 arg_mode=arg # the next one goes into the "base_compile" arg list
420 continue # The current "srcfile" will either be retained or
421 ;; # replaced later. I would guess that would be a bug.
424 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
426 save_ifs="$IFS"; IFS=','
430 # Double-quote args containing other shell metacharacters.
431 # Many Bourne shells cannot handle close brackets correctly
432 # in scan sets, so we specify it separately.
434 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
438 lastarg="$lastarg $arg"
441 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
443 # Add the arguments to base_compile.
444 base_compile="$base_compile $lastarg"
449 # Accept the current argument as the source file.
450 # The previous "srcfile" becomes the current argument.
457 esac # case $arg_mode
459 # Aesthetically quote the previous argument.
460 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
463 # Double-quote args containing other shell metacharacters.
464 # Many Bourne shells cannot handle close brackets correctly
465 # in scan sets, so we specify it separately.
466 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
467 lastarg="\"$lastarg\""
471 base_compile="$base_compile $lastarg"
476 $echo "$modename: you must specify an argument for -Xcompile"
480 $echo "$modename: you must specify a target with \`-o'" 1>&2
484 # Get the name of the library object.
485 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
489 # Recognize several different file suffixes.
490 # If the user specifies -o file.o, it is replaced with file.lo
500 *.class) xform=class ;;
505 *.java) xform=java ;;
508 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
511 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
513 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
518 # Infer tagged configuration to use if any are available and
519 # if one wasn't chosen via the "--tag" command line option.
520 # Only attempt this if the compiler in the base compile
521 # command doesn't match the default compiler.
522 if test -n "$available_tags" && test -z "$tagname"; then
523 case $base_compile in
524 # Blanks in the command may have been stripped by the calling shell,
525 # but not from the CC environment variable when configure was run.
526 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
527 # Blanks at the start of $base_compile will cause this to fail
528 # if we don't check for them as well.
530 for z in $available_tags; do
531 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
532 # Evaluate the configuration.
533 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
534 case "$base_compile " in
535 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
536 # The compiler in the base compile command matches
537 # the one in the tagged configuration.
538 # Assume this is the tagged configuration we want.
545 # If $tagname still isn't set, then no tagged configuration
546 # was found and let the user know that the "--tag" command
547 # line option must be used.
548 if test -z "$tagname"; then
549 $echo "$modename: unable to infer tagged configuration"
550 $echo "$modename: specify a tag with \`--tag'" 1>&2
553 # $echo "$modename: using $tagname tagged configuration"
559 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
560 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
561 if test "X$xdir" = "X$obj"; then
566 lobj=${xdir}$objdir/$objname
568 if test -z "$base_compile"; then
569 $echo "$modename: you must specify a compilation command" 1>&2
574 # Delete any leftover library objects.
575 if test "$build_old_libs" = yes; then
576 removelist="$obj $lobj $libobj ${libobj}T"
578 removelist="$lobj $libobj ${libobj}T"
582 trap "$run $rm $removelist; exit 1" 1 2 15
584 # On Cygwin there's no "real" PIC flag so we must build both object types
586 cygwin* | mingw* | pw32* | os2*)
590 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
591 # non-PIC code in shared libraries is not supported
595 # Calculate the filename of the output object if compiler does
596 # not support -o with -c
597 if test "$compiler_c_o" = no; then
598 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
599 lockfile="$output_obj.lock"
600 removelist="$removelist $output_obj $lockfile"
601 trap "$run $rm $removelist; exit 1" 1 2 15
608 # Lock this critical section if it is needed
609 # We use this script file to make the link, it avoids creating a new file
610 if test "$need_locks" = yes; then
611 until $run ln "$0" "$lockfile" 2>/dev/null; do
612 $show "Waiting for $lockfile to be removed"
615 elif test "$need_locks" = warn; then
616 if test -f "$lockfile"; then
618 *** ERROR, $lockfile exists and contains:
619 `cat $lockfile 2>/dev/null`
621 This indicates that another process is trying to use the same
622 temporary object file, and libtool could not work around it because
623 your compiler does not support \`-c' and \`-o' together. If you
624 repeat this compilation, it may succeed, by chance, but you had better
625 avoid parallel builds (make -j) in this platform, or get a better
631 $echo $srcfile > "$lockfile"
634 if test -n "$fix_srcfile_path"; then
635 eval srcfile=\"$fix_srcfile_path\"
638 $run $rm "$libobj" "${libobj}T"
640 # Create a libtool object file (analogous to a ".la" file),
641 # but don't create it if we're doing a dry run.
642 test -z "$run" && cat > ${libobj}T <<EOF
643 # $libobj - a libtool object file
644 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
646 # Please DO NOT delete this file!
647 # It is necessary for linking the library.
649 # Name of the PIC object.
652 # Only build a PIC object if we are building libtool libraries.
653 if test "$build_libtool_libs" = yes; then
654 # Without this assignment, base_compile gets emptied.
655 fbsd_hideous_sh_bug=$base_compile
657 if test "$pic_mode" != no; then
658 command="$base_compile $srcfile $pic_flag"
660 # Don't build PIC code
661 command="$base_compile $srcfile"
664 if test ! -d "${xdir}$objdir"; then
665 $show "$mkdir ${xdir}$objdir"
666 $run $mkdir ${xdir}$objdir
668 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
673 if test -z "$output_obj"; then
674 # Place PIC objects in $objdir
675 command="$command -o $lobj"
678 $run $rm "$lobj" "$output_obj"
681 if $run eval "$command"; then :
683 test -n "$output_obj" && $run $rm $removelist
687 if test "$need_locks" = warn &&
688 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
690 *** ERROR, $lockfile contains:
691 `cat $lockfile 2>/dev/null`
693 but it should contain:
696 This indicates that another process is trying to use the same
697 temporary object file, and libtool could not work around it because
698 your compiler does not support \`-c' and \`-o' together. If you
699 repeat this compilation, it may succeed, by chance, but you had better
700 avoid parallel builds (make -j) in this platform, or get a better
707 # Just move the object if needed, then go on to compile the next one
708 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
709 $show "$mv $output_obj $lobj"
710 if $run $mv $output_obj $lobj; then :
718 # Append the name of the PIC object to the libtool object file.
719 test -z "$run" && cat >> ${libobj}T <<EOF
720 pic_object='$objdir/$objname'
724 # Allow error messages only from the first compilation.
725 suppress_output=' >/dev/null 2>&1'
727 # No PIC object so indicate it doesn't exist in the libtool
729 test -z "$run" && cat >> ${libobj}T <<EOF
735 # Only build a position-dependent object if we build old libraries.
736 if test "$build_old_libs" = yes; then
737 if test "$pic_mode" != yes; then
738 # Don't build PIC code
739 command="$base_compile $srcfile"
741 command="$base_compile $srcfile $pic_flag"
743 if test "$compiler_c_o" = yes; then
744 command="$command -o $obj"
747 # Suppress compiler output if we already did a PIC compilation.
748 command="$command$suppress_output"
749 $run $rm "$obj" "$output_obj"
751 if $run eval "$command"; then :
757 if test "$need_locks" = warn &&
758 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
760 *** ERROR, $lockfile contains:
761 `cat $lockfile 2>/dev/null`
763 but it should contain:
766 This indicates that another process is trying to use the same
767 temporary object file, and libtool could not work around it because
768 your compiler does not support \`-c' and \`-o' together. If you
769 repeat this compilation, it may succeed, by chance, but you had better
770 avoid parallel builds (make -j) in this platform, or get a better
777 # Just move the object if needed
778 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
779 $show "$mv $output_obj $obj"
780 if $run $mv $output_obj $obj; then :
788 # Append the name of the non-PIC object the libtool object file.
789 # Only append if the libtool object file exists.
790 test -z "$run" && cat >> ${libobj}T <<EOF
791 # Name of the non-PIC object.
792 non_pic_object='$objname'
796 # Append the name of the non-PIC object the libtool object file.
797 # Only append if the libtool object file exists.
798 test -z "$run" && cat >> ${libobj}T <<EOF
799 # Name of the non-PIC object.
805 $run $mv "${libobj}T" "${libobj}"
807 # Unlock the critical section if it was locked
808 if test "$need_locks" != no; then
817 modename="$modename: link"
819 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
820 # It is impossible to link a dll without this setting, and
821 # we shouldn't force the makefile maintainer to figure out
822 # which system we are compiling for in order to pass an extra
823 # flag for every libtool invocation.
826 # FIXME: Unfortunately, there are problems with the above when trying
827 # to make a dll which has undefined symbols, in which case not
828 # even a static library is built. For now, we need to specify
829 # -no-undefined on the libtool link line when we can be certain
830 # that all symbols are satisfied, otherwise we get a static library.
837 libtool_args="$nonopt"
838 base_compile="$nonopt"
839 compile_command="$nonopt"
840 finalize_command="$nonopt"
853 lib_search_path=`pwd`
862 export_symbols_regex=
870 prefer_static_libs=no
883 # We need to know -static, to get the right output filenames.
887 -all-static | -static)
888 if test "X$arg" = "X-all-static"; then
889 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
890 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
892 if test -n "$link_static_flag"; then
893 dlopen_self=$dlopen_self_static
896 if test -z "$pic_flag" && test -n "$link_static_flag"; then
897 dlopen_self=$dlopen_self_static
900 build_libtool_libs=no
902 prefer_static_libs=yes
908 # See if our shared archives depend on static archives.
909 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
911 # Go through the arguments, transforming them on the way.
912 while test "$#" -gt 0; do
914 base_compile="$base_compile $arg"
917 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
918 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
922 libtool_args="$libtool_args $qarg"
924 # If the previous option needs an argument, assign it.
925 if test -n "$prev"; then
928 compile_command="$compile_command @OUTPUT@"
929 finalize_command="$finalize_command @OUTPUT@"
935 if test "$preload" = no; then
936 # Add the symbol object into the linking commands.
937 compile_command="$compile_command @SYMFILE@"
938 finalize_command="$finalize_command @SYMFILE@"
942 *.la | *.lo) ;; # We handle these cases below.
944 if test "$dlself" = no; then
952 if test "$prev" = dlprefiles; then
954 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
964 if test "$prev" = dlfiles; then
965 dlfiles="$dlfiles $arg"
967 dlprefiles="$dlprefiles $arg"
975 export_symbols="$arg"
976 if test ! -f "$arg"; then
977 $echo "$modename: symbol file \`$arg' does not exist"
984 export_symbols_regex="$arg"
989 inst_prefix_dir="$arg"
999 if test -f "$arg"; then
1002 for fil in `cat $save_arg`
1004 # moreargs="$moreargs $fil"
1006 # A libtool-controlled object.
1008 # Check to see that this really is a libtool object.
1009 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1014 # If there is no directory component, then add one.
1016 */* | *\\*) . $arg ;;
1020 if test -z "$pic_object" || \
1021 test -z "$non_pic_object" ||
1022 test "$pic_object" = none && \
1023 test "$non_pic_object" = none; then
1024 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1028 # Extract subdirectory from the argument.
1029 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1030 if test "X$xdir" = "X$arg"; then
1036 if test "$pic_object" != none; then
1037 # Prepend the subdirectory the object is found in.
1038 pic_object="$xdir$pic_object"
1040 if test "$prev" = dlfiles; then
1041 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1042 dlfiles="$dlfiles $pic_object"
1046 # If libtool objects are unsupported, then we need to preload.
1051 # CHECK ME: I think I busted this. -Ossama
1052 if test "$prev" = dlprefiles; then
1053 # Preload the old-style object.
1054 dlprefiles="$dlprefiles $pic_object"
1059 libobjs="$libobjs $pic_object"
1064 if test "$non_pic_object" != none; then
1065 # Prepend the subdirectory the object is found in.
1066 non_pic_object="$xdir$non_pic_object"
1068 # A standard non-PIC object
1069 non_pic_objects="$non_pic_objects $non_pic_object"
1070 if test -z "$pic_object" || test "$pic_object" = none ; then
1071 arg="$non_pic_object"
1075 # Only an error if not doing a dry-run.
1076 if test -z "$run"; then
1077 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1082 # Extract subdirectory from the argument.
1083 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1084 if test "X$xdir" = "X$arg"; then
1090 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1091 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1092 libobjs="$libobjs $pic_object"
1093 non_pic_objects="$non_pic_objects $non_pic_object"
1098 $echo "$modename: link input file \`$save_arg' does not exist"
1106 # We need an absolute path.
1108 [\\/]* | [A-Za-z]:[\\/]*) ;;
1110 $echo "$modename: only absolute run-paths are allowed" 1>&2
1114 if test "$prev" = rpath; then
1117 *) rpath="$rpath $arg" ;;
1122 *) xrpath="$xrpath $arg" ;;
1129 compiler_flags="$compiler_flags $qarg"
1131 compile_command="$compile_command $qarg"
1132 finalize_command="$finalize_command $qarg"
1136 linker_flags="$linker_flags $qarg"
1137 compiler_flags="$compiler_flags $wl$qarg"
1139 compile_command="$compile_command $wl$qarg"
1140 finalize_command="$finalize_command $wl$qarg"
1144 linker_flags="$linker_flags $qarg"
1145 compiler_flags="$compiler_flags $qarg"
1147 compile_command="$compile_command $qarg"
1148 finalize_command="$finalize_command $qarg"
1152 eval "$prev=\"\$arg\""
1157 fi # test -n "$prev"
1163 if test -n "$link_static_flag"; then
1164 compile_command="$compile_command $link_static_flag"
1165 finalize_command="$finalize_command $link_static_flag"
1171 # FIXME: remove this flag sometime in the future.
1172 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1196 -export-symbols | -export-symbols-regex)
1197 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1198 $echo "$modename: more than one -exported-symbols argument is not allowed"
1201 if test "X$arg" = "X-export-symbols"; then
1214 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1215 # so, if we see these flags be careful not to treat them like -L
1217 case $with_gcc/$host in
1218 no/*-*-irix* | /*-*-irix*)
1219 compile_command="$compile_command $arg"
1220 finalize_command="$finalize_command $arg"
1227 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1228 # We need an absolute path.
1230 [\\/]* | [A-Za-z]:[\\/]*) ;;
1232 absdir=`cd "$dir" && pwd`
1233 if test -z "$absdir"; then
1234 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1243 deplibs="$deplibs -L$dir"
1244 lib_search_path="$lib_search_path $dir"
1248 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1249 case :$dllsearchpath: in
1251 *) dllsearchpath="$dllsearchpath:$dir";;
1259 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1261 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1262 # These systems don't actually have a C or math library (as such)
1265 *-*-mingw* | *-*-os2*)
1266 # These systems don't actually have a C library (as such)
1267 test "X$arg" = "X-lc" && continue
1269 *-*-openbsd* | *-*-freebsd*)
1270 # Do not include libc due to us having libc/libc_r.
1271 test "X$arg" = "X-lc" && continue
1273 *-*-rhapsody* | *-*-darwin1.[012])
1274 # Rhapsody C and math libraries are in the System framework
1275 deplibs="$deplibs -framework System"
1278 elif test "X$arg" = "X-lc_r"; then
1280 *-*-openbsd* | *-*-freebsd*)
1281 # Do not include libc_r directly, use -pthread flag.
1286 deplibs="$deplibs $arg"
1295 # gcc -m* arguments should be passed to the linker via $compiler_flags
1296 # in order to pass architecture information to the linker
1297 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1298 # but this is not reliable with gcc because gcc may use -mfoo to
1299 # select a different linker, different libraries, etc, while
1300 # -Wl,-mfoo simply passes -mfoo to the linker.
1302 # Unknown arguments in both finalize_command and compile_command need
1303 # to be aesthetically quoted because they are evaled later.
1304 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1306 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1310 compile_command="$compile_command $arg"
1311 finalize_command="$finalize_command $arg"
1312 if test "$with_gcc" = "yes" ; then
1313 compiler_flags="$compiler_flags $arg"
1330 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1331 # The PATH hackery in wrapper scripts is required on Windows
1332 # in order for the loader to find any dlls it needs.
1333 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1334 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1337 *) no_install=yes ;;
1370 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1371 # We need an absolute path.
1373 [\\/]* | [A-Za-z]:[\\/]*) ;;
1375 $echo "$modename: only absolute run-paths are allowed" 1>&2
1381 *) xrpath="$xrpath $dir" ;;
1387 # The effects of -static are defined in a previous loop.
1388 # We used to do the same as -all-static on platforms that
1389 # didn't have a PIC flag, but the assumption that the effects
1390 # would be equivalent was wrong. It would break on at least
1391 # Digital Unix and AIX.
1411 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1413 save_ifs="$IFS"; IFS=','
1414 for flag in $args; do
1417 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1422 compiler_flags="$compiler_flags $flag"
1425 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1429 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1431 save_ifs="$IFS"; IFS=','
1432 for flag in $args; do
1435 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1440 compiler_flags="$compiler_flags $wl$flag"
1441 linker_flags="$linker_flags $flag"
1444 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1462 # Some other compiler flag.
1464 # Unknown arguments in both finalize_command and compile_command need
1465 # to be aesthetically quoted because they are evaled later.
1466 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1468 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1475 # A standard object.
1480 # A libtool-controlled object.
1482 # Check to see that this really is a libtool object.
1483 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1488 # If there is no directory component, then add one.
1490 */* | *\\*) . $arg ;;
1494 if test -z "$pic_object" || \
1495 test -z "$non_pic_object" ||
1496 test "$pic_object" = none && \
1497 test "$non_pic_object" = none; then
1498 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1502 # Extract subdirectory from the argument.
1503 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1504 if test "X$xdir" = "X$arg"; then
1510 if test "$pic_object" != none; then
1511 # Prepend the subdirectory the object is found in.
1512 pic_object="$xdir$pic_object"
1514 if test "$prev" = dlfiles; then
1515 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1516 dlfiles="$dlfiles $pic_object"
1520 # If libtool objects are unsupported, then we need to preload.
1525 # CHECK ME: I think I busted this. -Ossama
1526 if test "$prev" = dlprefiles; then
1527 # Preload the old-style object.
1528 dlprefiles="$dlprefiles $pic_object"
1533 libobjs="$libobjs $pic_object"
1538 if test "$non_pic_object" != none; then
1539 # Prepend the subdirectory the object is found in.
1540 non_pic_object="$xdir$non_pic_object"
1542 # A standard non-PIC object
1543 non_pic_objects="$non_pic_objects $non_pic_object"
1544 if test -z "$pic_object" || test "$pic_object" = none ; then
1545 arg="$non_pic_object"
1549 # Only an error if not doing a dry-run.
1550 if test -z "$run"; then
1551 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1556 # Extract subdirectory from the argument.
1557 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1558 if test "X$xdir" = "X$arg"; then
1564 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1565 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1566 libobjs="$libobjs $pic_object"
1567 non_pic_objects="$non_pic_objects $non_pic_object"
1574 deplibs="$deplibs $arg"
1575 old_deplibs="$old_deplibs $arg"
1580 # A libtool-controlled library.
1582 if test "$prev" = dlfiles; then
1583 # This library was specified with -dlopen.
1584 dlfiles="$dlfiles $arg"
1586 elif test "$prev" = dlprefiles; then
1587 # The library was specified with -dlpreopen.
1588 dlprefiles="$dlprefiles $arg"
1591 deplibs="$deplibs $arg"
1596 # Some other compiler argument.
1598 # Unknown arguments in both finalize_command and compile_command need
1599 # to be aesthetically quoted because they are evaled later.
1600 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1602 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1609 # Now actually substitute the argument into the commands.
1610 if test -n "$arg"; then
1611 compile_command="$compile_command $arg"
1612 finalize_command="$finalize_command $arg"
1614 done # argument parsing loop
1616 if test -n "$prev"; then
1617 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1622 # Infer tagged configuration to use if any are available and
1623 # if one wasn't chosen via the "--tag" command line option.
1624 # Only attempt this if the compiler in the base link
1625 # command doesn't match the default compiler.
1626 if test -n "$available_tags" && test -z "$tagname"; then
1627 case $base_compile in
1628 # Blanks in the command may have been stripped by the calling shell,
1629 # but not from the CC environment variable when configure was run.
1630 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1631 # Blanks at the start of $base_compile will cause this to fail
1632 # if we don't check for them as well.
1634 for z in $available_tags; do
1635 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1636 # Evaluate the configuration.
1637 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1638 case $base_compile in
1639 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1640 # The compiler in $compile_command matches
1641 # the one in the tagged configuration.
1642 # Assume this is the tagged configuration we want.
1649 # If $tagname still isn't set, then no tagged configuration
1650 # was found and let the user know that the "--tag" command
1651 # line option must be used.
1652 if test -z "$tagname"; then
1653 $echo "$modename: unable to infer tagged configuration"
1654 $echo "$modename: specify a tag with \`--tag'" 1>&2
1657 # $echo "$modename: using $tagname tagged configuration"
1663 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1664 eval arg=\"$export_dynamic_flag_spec\"
1665 compile_command="$compile_command $arg"
1666 finalize_command="$finalize_command $arg"
1670 # calculate the name of the file, without its directory
1671 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1672 libobjs_save="$libobjs"
1674 if test -n "$shlibpath_var"; then
1675 # get the directories listed in $shlibpath_var
1676 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1680 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1681 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1683 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1684 if test "X$output_objdir" = "X$output"; then
1685 output_objdir="$objdir"
1687 output_objdir="$output_objdir/$objdir"
1689 # Create the object directory.
1690 if test ! -d "$output_objdir"; then
1691 $show "$mkdir $output_objdir"
1692 $run $mkdir $output_objdir
1694 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1699 # Determine the type of output
1702 $echo "$modename: you must specify an output file" 1>&2
1706 *.$libext) linkmode=oldlib ;;
1707 *.lo | *.$objext) linkmode=obj ;;
1708 *.la) linkmode=lib ;;
1709 *) linkmode=prog ;; # Anything else should be a program.
1713 *cygwin* | *mingw* | *pw32*)
1714 # don't eliminate duplcations in $postdeps and $predeps
1715 duplicate_compiler_generated_deps=yes
1718 duplicate_compiler_generated_deps=$duplicate_deps
1724 # Find all interdependent deplibs by searching for libraries
1725 # that are linked more than once (e.g. -la -lb -la)
1726 for deplib in $deplibs; do
1727 if test "X$duplicate_deps" = "Xyes" ; then
1729 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1732 libs="$libs $deplib"
1735 if test "$linkmode" = lib; then
1736 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1738 # Compute libraries that are listed more than once in $predeps
1739 # $postdeps and mark them as special (i.e., whose duplicates are
1740 # not to be eliminated).
1742 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1743 for pre_post_dep in $predeps $postdeps; do
1744 case "$pre_post_deps " in
1745 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1747 pre_post_deps="$pre_post_deps $pre_post_dep"
1756 need_relink=no # whether we're linking any uninstalled libtool libraries
1757 notinst_deplibs= # not-installed libtool libraries
1758 notinst_path= # paths that contain not-installed libtool libraries
1762 for file in $dlfiles $dlprefiles; do
1766 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1778 passes="conv scan dlopen dlpreopen link"
1783 for pass in $passes; do
1784 if test "$linkmode,$pass" = "lib,link" ||
1785 test "$linkmode,$pass" = "prog,scan"; then
1789 if test "$linkmode" = prog; then
1791 dlopen) libs="$dlfiles" ;;
1792 dlpreopen) libs="$dlprefiles" ;;
1793 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1796 if test "$pass" = dlopen; then
1797 # Collect dlpreopened libraries
1798 save_deplibs="$deplibs"
1801 for deplib in $libs; do
1806 if test "$linkmode" != lib && test "$linkmode" != prog; then
1807 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1810 if test "$pass" = conv; then
1811 deplibs="$deplib $deplibs"
1814 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1815 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1816 # Search the libtool library
1817 lib="$searchdir/lib${name}.la"
1818 if test -f "$lib"; then
1823 if test "$found" != yes; then
1824 # deplib doesn't seem to be a libtool library
1825 if test "$linkmode,$pass" = "prog,link"; then
1826 compile_deplibs="$deplib $compile_deplibs"
1827 finalize_deplibs="$deplib $finalize_deplibs"
1829 deplibs="$deplib $deplibs"
1830 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1833 else # deplib is a libtool library
1834 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1835 # We need to do some special things here, and not later.
1836 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1837 case " $predeps $postdeps " in
1839 if (${SED} -e '2q' $lib |
1840 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1844 */* | *\\*) . $lib ;;
1847 for l in $old_library $library_names; do
1850 if test "X$ll" = "X$old_library" ; then # only static version available
1852 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1853 test "X$ladir" = "X$lib" && ladir="."
1854 lib=$ladir/$old_library
1855 if test "$linkmode,$pass" = "prog,link"; then
1856 compile_deplibs="$deplib $compile_deplibs"
1857 finalize_deplibs="$deplib $finalize_deplibs"
1859 deplibs="$deplib $deplibs"
1860 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1874 deplibs="$deplib $deplibs"
1875 test "$pass" = conv && continue
1876 newdependency_libs="$deplib $newdependency_libs"
1877 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1880 if test "$pass" = conv; then
1881 deplibs="$deplib $deplibs"
1884 if test "$pass" = scan; then
1885 deplibs="$deplib $deplibs"
1886 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1888 compile_deplibs="$deplib $compile_deplibs"
1889 finalize_deplibs="$deplib $finalize_deplibs"
1893 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1899 if test "$pass" = link; then
1900 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1901 # Make sure the xrpath contains only unique directories.
1904 *) xrpath="$xrpath $dir" ;;
1907 deplibs="$deplib $deplibs"
1910 *.la) lib="$deplib" ;;
1912 if test "$pass" = conv; then
1913 deplibs="$deplib $deplibs"
1918 if test "$deplibs_check_method" != pass_all; then
1920 $echo "*** Warning: Trying to link with static lib archive $deplib."
1921 $echo "*** I have the capability to make that library automatically link in when"
1922 $echo "*** you link to this library. But I can only do this if you have a"
1923 $echo "*** shared version of the library, which you do not appear to have"
1924 $echo "*** because the file extensions .$libext of this argument makes me believe"
1925 $echo "*** that it is just a static archive that I should not used here."
1928 $echo "*** Warning: Linking the shared library $output against the"
1929 $echo "*** static library $deplib is not portable!"
1930 deplibs="$deplib $deplibs"
1935 if test "$pass" != link; then
1936 deplibs="$deplib $deplibs"
1938 compile_deplibs="$deplib $compile_deplibs"
1939 finalize_deplibs="$deplib $finalize_deplibs"
1946 if test "$pass" = conv; then
1947 deplibs="$deplib $deplibs"
1948 elif test "$linkmode" = prog; then
1949 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1950 # If there is no dlopen support or we're linking statically,
1951 # we need to preload.
1952 newdlprefiles="$newdlprefiles $deplib"
1953 compile_deplibs="$deplib $compile_deplibs"
1954 finalize_deplibs="$deplib $finalize_deplibs"
1956 newdlfiles="$newdlfiles $deplib"
1966 if test "$found" = yes || test -f "$lib"; then :
1968 $echo "$modename: cannot find the library \`$lib'" 1>&2
1972 # Check to see that this really is a libtool archive.
1973 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1975 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1979 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1980 test "X$ladir" = "X$lib" && ladir="."
1988 # If the library was installed with an old release of libtool,
1989 # it will not redefine variables installed, or shouldnotlink
1995 */* | *\\*) . $lib ;;
1999 if test "$linkmode,$pass" = "lib,link" ||
2000 test "$linkmode,$pass" = "prog,scan" ||
2001 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2002 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2003 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2006 if test "$pass" = conv; then
2007 # Only check for convenience libraries
2008 deplibs="$lib $deplibs"
2009 if test -z "$libdir"; then
2010 if test -z "$old_library"; then
2011 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2014 # It is a libtool convenience library, so add in its objects.
2015 convenience="$convenience $ladir/$objdir/$old_library"
2016 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2018 for deplib in $dependency_libs; do
2019 deplibs="$deplib $deplibs"
2020 if test "X$duplicate_deps" = "Xyes" ; then
2021 case "$tmp_libs " in
2022 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2025 tmp_libs="$tmp_libs $deplib"
2027 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2028 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2035 # Get the name of the library we link against.
2037 for l in $old_library $library_names; do
2040 if test -z "$linklib"; then
2041 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2045 # This library was specified with -dlopen.
2046 if test "$pass" = dlopen; then
2047 if test -z "$libdir"; then
2048 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2051 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2052 # If there is no dlname, no dlopen support or we're linking
2053 # statically, we need to preload. We also need to preload any
2054 # dependent libraries so libltdl's deplib preloader doesn't
2055 # bomb out in the load deplibs phase.
2056 dlprefiles="$dlprefiles $lib $dependency_libs"
2058 newdlfiles="$newdlfiles $lib"
2063 # We need an absolute path.
2065 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2067 abs_ladir=`cd "$ladir" && pwd`
2068 if test -z "$abs_ladir"; then
2069 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2070 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2075 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2077 # Find the relevant object directory and library name.
2078 if test "X$installed" = Xyes; then
2079 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2080 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2089 dir="$ladir/$objdir"
2090 absdir="$abs_ladir/$objdir"
2091 # Remove this search path later
2092 notinst_path="$notinst_path $abs_ladir"
2093 fi # $installed = yes
2094 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2096 # This library was specified with -dlpreopen.
2097 if test "$pass" = dlpreopen; then
2098 if test -z "$libdir"; then
2099 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2102 # Prefer using a static library (so that no silly _DYNAMIC symbols
2103 # are required to link).
2104 if test -n "$old_library"; then
2105 newdlprefiles="$newdlprefiles $dir/$old_library"
2106 # Otherwise, use the dlname, so that lt_dlopen finds it.
2107 elif test -n "$dlname"; then
2108 newdlprefiles="$newdlprefiles $dir/$dlname"
2110 newdlprefiles="$newdlprefiles $dir/$linklib"
2112 fi # $pass = dlpreopen
2114 if test -z "$libdir"; then
2115 # Link the convenience library
2116 if test "$linkmode" = lib; then
2117 deplibs="$dir/$old_library $deplibs"
2118 elif test "$linkmode,$pass" = "prog,link"; then
2119 compile_deplibs="$dir/$old_library $compile_deplibs"
2120 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2122 deplibs="$lib $deplibs" # used for prog,scan pass
2128 if test "$linkmode" = prog && test "$pass" != link; then
2129 newlib_search_path="$newlib_search_path $ladir"
2130 deplibs="$lib $deplibs"
2133 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2134 test "$build_libtool_libs" = no; then
2139 for deplib in $dependency_libs; do
2141 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2143 # Need to link against all dependency_libs?
2144 if test "$linkalldeplibs" = yes; then
2145 deplibs="$deplib $deplibs"
2147 # Need to hardcode shared library paths
2148 # or/and link against static libraries
2149 newdependency_libs="$deplib $newdependency_libs"
2151 if test "X$duplicate_deps" = "Xyes" ; then
2152 case "$tmp_libs " in
2153 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2156 tmp_libs="$tmp_libs $deplib"
2159 fi # $linkmode = prog...
2161 if test "$linkmode,$pass" = "prog,link"; then
2162 if test -n "$library_names" &&
2163 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2164 # We need to hardcode the library path
2165 if test -n "$shlibpath_var"; then
2166 # Make sure the rpath contains only unique directories.
2167 case "$temp_rpath " in
2170 *) temp_rpath="$temp_rpath $dir" ;;
2174 # Hardcode the library path.
2175 # Skip directories that are in the system default run-time
2177 case " $sys_lib_dlsearch_path " in
2180 case "$compile_rpath " in
2182 *) compile_rpath="$compile_rpath $absdir"
2186 case " $sys_lib_dlsearch_path " in
2189 case "$finalize_rpath " in
2191 *) finalize_rpath="$finalize_rpath $libdir"
2195 fi # $linkmode,$pass = prog,link...
2197 if test "$alldeplibs" = yes &&
2198 { test "$deplibs_check_method" = pass_all ||
2199 { test "$build_libtool_libs" = yes &&
2200 test -n "$library_names"; }; }; then
2201 # We only need to search for static libraries
2206 link_static=no # Whether the deplib will be linked statically
2207 if test -n "$library_names" &&
2208 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2209 if test "$installed" = no; then
2210 notinst_deplibs="$notinst_deplibs $lib"
2213 # This is a shared library
2215 # Warn about portability, can't link against -module's on some systems (darwin)
2216 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2218 if test "$linkmode" = prog; then
2219 $echo "*** Warning: Linking the executable $output against the loadable module"
2221 $echo "*** Warning: Linking the shared library $output against the loadable module"
2223 $echo "*** $linklib is not portable!"
2225 if test "$linkmode" = lib &&
2226 test "$hardcode_into_libs" = yes; then
2227 # Hardcode the library path.
2228 # Skip directories that are in the system default run-time
2230 case " $sys_lib_dlsearch_path " in
2233 case "$compile_rpath " in
2235 *) compile_rpath="$compile_rpath $absdir"
2239 case " $sys_lib_dlsearch_path " in
2242 case "$finalize_rpath " in
2244 *) finalize_rpath="$finalize_rpath $libdir"
2250 if test -n "$old_archive_from_expsyms_cmds"; then
2251 # figure out the soname
2252 set dummy $library_names
2255 libname=`eval \\$echo \"$libname_spec\"`
2256 # use dlname if we got it. it's perfectly good, no?
2257 if test -n "$dlname"; then
2259 elif test -n "$soname_spec"; then
2263 major=`expr $current - $age`
2267 eval soname=\"$soname_spec\"
2272 # Make a new name for the extract_expsyms_cmds to use
2274 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2275 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2277 # If the library has no export list, then create one now
2278 if test -f "$output_objdir/$soname-def"; then :
2280 $show "extracting exported symbol list from \`$soname'"
2281 save_ifs="$IFS"; IFS='~'
2282 eval cmds=\"$extract_expsyms_cmds\"
2283 for cmd in $cmds; do
2286 $run eval "$cmd" || exit $?
2292 if test -f "$output_objdir/$newlib"; then :; else
2293 $show "generating import library for \`$soname'"
2294 save_ifs="$IFS"; IFS='~'
2295 eval cmds=\"$old_archive_from_expsyms_cmds\"
2296 for cmd in $cmds; do
2299 $run eval "$cmd" || exit $?
2303 # make sure the library variables are pointing to the new library
2306 fi # test -n "$old_archive_from_expsyms_cmds"
2308 if test "$linkmode" = prog || test "$mode" != relink; then
2313 case $hardcode_action in
2314 immediate | unsupported)
2315 if test "$hardcode_direct" = no; then
2318 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2320 # if the lib is a module then we can not link against it, someone
2321 # is ignoring the new warnings I added
2322 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2323 $echo "** Warning, lib $linklib is a module, not a shared library"
2324 if test -z "$old_library" ; then
2326 $echo "** And there doesn't seem to be a static archive available"
2327 $echo "** The link will probably fail, sorry"
2329 add="$dir/$old_library"
2333 elif test "$hardcode_minus_L" = no; then
2335 *-*-sunos*) add_shlibpath="$dir" ;;
2339 elif test "$hardcode_shlibpath_var" = no; then
2340 add_shlibpath="$dir"
2347 if test "$hardcode_direct" = yes; then
2349 elif test "$hardcode_minus_L" = yes; then
2351 # Try looking first in the location we're being installed to.
2352 if test -n "$inst_prefix_dir"; then
2355 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2360 elif test "$hardcode_shlibpath_var" = yes; then
2361 add_shlibpath="$dir"
2370 if test "$lib_linked" != yes; then
2371 $echo "$modename: configuration error: unsupported hardcode properties"
2375 if test -n "$add_shlibpath"; then
2376 case :$compile_shlibpath: in
2377 *":$add_shlibpath:"*) ;;
2378 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2381 if test "$linkmode" = prog; then
2382 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2383 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2385 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2386 test -n "$add" && deplibs="$add $deplibs"
2387 if test "$hardcode_direct" != yes && \
2388 test "$hardcode_minus_L" != yes && \
2389 test "$hardcode_shlibpath_var" = yes; then
2390 case :$finalize_shlibpath: in
2392 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2398 if test "$linkmode" = prog || test "$mode" = relink; then
2402 # Finalize command for both is simple: just hardcode it.
2403 if test "$hardcode_direct" = yes; then
2404 add="$libdir/$linklib"
2405 elif test "$hardcode_minus_L" = yes; then
2408 elif test "$hardcode_shlibpath_var" = yes; then
2409 case :$finalize_shlibpath: in
2411 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2414 elif test "$hardcode_automatic" = yes; then
2415 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2416 add="$inst_prefix_dir$libdir/$linklib"
2418 add="$libdir/$linklib"
2421 # We cannot seem to hardcode it, guess we'll fake it.
2423 # Try looking first in the location we're being installed to.
2424 if test -n "$inst_prefix_dir"; then
2427 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2434 if test "$linkmode" = prog; then
2435 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2436 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2438 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2439 test -n "$add" && deplibs="$add $deplibs"
2442 elif test "$linkmode" = prog; then
2443 # Here we assume that one of hardcode_direct or hardcode_minus_L
2444 # is not unsupported. This is valid on all known static and
2446 if test "$hardcode_direct" != unsupported; then
2447 test -n "$old_library" && linklib="$old_library"
2448 compile_deplibs="$dir/$linklib $compile_deplibs"
2449 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2451 compile_deplibs="-l$name -L$dir $compile_deplibs"
2452 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2454 elif test "$build_libtool_libs" = yes; then
2455 # Not a shared library
2456 if test "$deplibs_check_method" != pass_all; then
2457 # We're trying link a shared library against a static one
2458 # but the system doesn't support it.
2460 # Just print a warning and add the library to dependency_libs so
2461 # that the program can be linked against the static library.
2463 $echo "*** Warning: This system can not link to static lib archive $lib."
2464 $echo "*** I have the capability to make that library automatically link in when"
2465 $echo "*** you link to this library. But I can only do this if you have a"
2466 $echo "*** shared version of the library, which you do not appear to have."
2467 if test "$module" = yes; then
2468 $echo "*** But as you try to build a module library, libtool will still create "
2469 $echo "*** a static module, that should work as long as the dlopening application"
2470 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2471 if test -z "$global_symbol_pipe"; then
2473 $echo "*** However, this would only work if libtool was able to extract symbol"
2474 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2475 $echo "*** not find such a program. So, this module is probably useless."
2476 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2478 if test "$build_old_libs" = no; then
2479 build_libtool_libs=module
2482 build_libtool_libs=no
2486 convenience="$convenience $dir/$old_library"
2487 old_convenience="$old_convenience $dir/$old_library"
2488 deplibs="$dir/$old_library $deplibs"
2491 fi # link shared/static library?
2493 if test "$linkmode" = lib; then
2494 if test -n "$dependency_libs" &&
2495 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2496 test "$link_static" = yes; }; then
2497 # Extract -R from dependency_libs
2499 for libdir in $dependency_libs; do
2501 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2503 *" $temp_xrpath "*) ;;
2504 *) xrpath="$xrpath $temp_xrpath";;
2506 *) temp_deplibs="$temp_deplibs $libdir";;
2509 dependency_libs="$temp_deplibs"
2512 newlib_search_path="$newlib_search_path $absdir"
2513 # Link against this library
2514 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2515 # ... and its dependency_libs
2517 for deplib in $dependency_libs; do
2518 newdependency_libs="$deplib $newdependency_libs"
2519 if test "X$duplicate_deps" = "Xyes" ; then
2520 case "$tmp_libs " in
2521 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2524 tmp_libs="$tmp_libs $deplib"
2527 if test "$link_all_deplibs" != no; then
2528 # Add the search paths of all dependency libraries
2529 for deplib in $dependency_libs; do
2531 -L*) path="$deplib" ;;
2533 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2534 test "X$dir" = "X$deplib" && dir="."
2535 # We need an absolute path.
2537 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2539 absdir=`cd "$dir" && pwd`
2540 if test -z "$absdir"; then
2541 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2546 if grep "^installed=no" $deplib > /dev/null; then
2547 path="$absdir/$objdir"
2549 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2550 if test -z "$libdir"; then
2551 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2554 if test "$absdir" != "$libdir"; then
2555 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2562 # we do not want to link against static libs, but need to link against shared
2563 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2564 if test -n "$deplibrary_names" ; then
2565 for tmp in $deplibrary_names ; do
2568 if test -f "$path/$depdepl" ; then
2569 depdepl="$path/$depdepl"
2571 newlib_search_path="$newlib_search_path $path"
2584 # Again, we only want to link against shared libraries
2585 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2586 for tmp in $newlib_search_path ; do
2587 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2588 eval depdepl="$tmp/lib$tmp_libs.dylib"
2599 case " $deplibs " in
2601 *) deplibs="$deplibs $depdepl" ;;
2603 case " $deplibs " in
2605 *) deplibs="$deplibs $path" ;;
2608 fi # link_all_deplibs != no
2610 done # for deplib in $libs
2611 dependency_libs="$newdependency_libs"
2612 if test "$pass" = dlpreopen; then
2613 # Link the dlpreopened libraries before other libraries
2614 for deplib in $save_deplibs; do
2615 deplibs="$deplib $deplibs"
2618 if test "$pass" != dlopen; then
2619 if test "$pass" != conv; then
2620 # Make sure lib_search_path contains only unique directories.
2622 for dir in $newlib_search_path; do
2623 case "$lib_search_path " in
2625 *) lib_search_path="$lib_search_path $dir" ;;
2631 if test "$linkmode,$pass" != "prog,link"; then
2634 vars="compile_deplibs finalize_deplibs"
2636 for var in $vars dependency_libs; do
2637 # Add libraries to $var in reverse order
2638 eval tmp_libs=\"\$$var\"
2640 for deplib in $tmp_libs; do
2641 # FIXME: Pedantically, this is the right thing to do, so
2642 # that some nasty dependency loop isn't accidentally
2644 #new_libs="$deplib $new_libs"
2645 # Pragmatically, this seems to cause very few problems in
2648 -L*) new_libs="$deplib $new_libs" ;;
2651 # And here is the reason: when a library appears more
2652 # than once as an explicit dependence of a library, or
2653 # is implicitly linked in more than once by the
2654 # compiler, it is considered special, and multiple
2655 # occurrences thereof are not removed. Compare this
2656 # with having the same library being listed as a
2657 # dependency of multiple other libraries: in this case,
2658 # we know (pedantically, we assume) the library does not
2659 # need to be listed more than once, so we keep only the
2660 # last copy. This is not always right, but it is rare
2661 # enough that we require users that really mean to play
2662 # such unportable linking tricks to link the library
2663 # using -Wl,-lname, so that libtool does not consider it
2664 # for duplicate removal.
2665 case " $specialdeplibs " in
2666 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2668 case " $new_libs " in
2670 *) new_libs="$deplib $new_libs" ;;
2678 for deplib in $new_libs; do
2681 case " $tmp_libs " in
2683 *) tmp_libs="$tmp_libs $deplib" ;;
2686 *) tmp_libs="$tmp_libs $deplib" ;;
2689 eval $var=\"$tmp_libs\"
2692 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2694 for i in $dependency_libs ; do
2695 case " $predeps $postdeps $compiler_lib_search_path " in
2700 if test -n "$i" ; then
2701 tmp_libs="$tmp_libs $i"
2704 dependency_libs=$tmp_libs
2706 if test "$linkmode" = prog; then
2707 dlfiles="$newdlfiles"
2708 dlprefiles="$newdlprefiles"
2713 if test -n "$deplibs"; then
2714 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2717 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2718 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2721 if test -n "$rpath"; then
2722 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2725 if test -n "$xrpath"; then
2726 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2729 if test -n "$vinfo"; then
2730 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2733 if test -n "$release"; then
2734 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2737 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2738 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2741 # Now set the variables for building old libraries.
2742 build_libtool_libs=no
2744 objs="$objs$old_deplibs"
2748 # Make sure we only generate libraries of the form `libNAME.la'.
2751 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2752 eval shared_ext=\"$shrext\"
2753 eval libname=\"$libname_spec\"
2756 if test "$need_lib_prefix" != no; then
2757 # Add the "lib" prefix for modules if required
2758 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2759 eval shared_ext=\"$shrext\"
2760 eval libname=\"$libname_spec\"
2762 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2767 if test -n "$objs"; then
2768 if test "$deplibs_check_method" != pass_all; then
2769 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2773 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2774 $echo "*** objects $objs is not portable!"
2775 libobjs="$libobjs $objs"
2779 if test "$dlself" != no; then
2780 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2784 if test "$#" -gt 2; then
2785 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2790 if test -z "$rpath"; then
2791 if test "$build_libtool_libs" = yes; then
2792 # Building a libtool convenience library.
2793 # Some compilers have problems with a `.al' extension so
2794 # convenience libraries should have the same extension an
2795 # archive normally would.
2796 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2797 build_libtool_libs=convenience
2801 if test -n "$vinfo"; then
2802 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2805 if test -n "$release"; then
2806 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2810 # Parse the version information argument.
2811 save_ifs="$IFS"; IFS=':'
2812 set dummy $vinfo 0 0 0
2815 if test -n "$8"; then
2816 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2821 # convert absolute version numbers to libtool ages
2822 # this retains compatibility with .la files and attempts
2823 # to make the code below a bit more comprehensible
2825 case $vinfo_number in
2829 number_revision="$4"
2831 # There are really only two kinds -- those that
2832 # use the current revision as the major version
2833 # and those that subtract age and use age as
2834 # a minor version. But, then there is irix
2835 # which has an extra 1 added just for fun
2837 case $version_type in
2838 darwin|linux|osf|windows)
2839 current=`expr $number_major + $number_minor`
2841 revision="$number_revision"
2843 freebsd-aout|freebsd-elf|sunos)
2844 current="$number_major"
2845 revision="$number_minor"
2849 current=`expr $number_major + $number_minor - 1`
2851 revision="$number_minor"
2862 # Check that each of the things are valid numbers.
2864 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2866 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2867 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2873 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2875 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2876 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2882 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2884 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2885 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2890 if test "$age" -gt "$current"; then
2891 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2892 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2896 # Calculate the version variables.
2900 case $version_type in
2904 # Like Linux, but with the current version available in
2905 # verstring for coding it into the library header
2906 major=.`expr $current - $age`
2907 versuffix="$major.$age.$revision"
2908 # Darwin ld doesn't like 0 for these options...
2909 minor_current=`expr $current + 1`
2910 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2915 versuffix=".$current.$revision";
2920 versuffix=".$current";
2924 major=`expr $current - $age + 1`
2926 case $version_type in
2927 nonstopux) verstring_prefix=nonstopux ;;
2928 *) verstring_prefix=sgi ;;
2930 verstring="$verstring_prefix$major.$revision"
2932 # Add in all the interfaces that we are compatible with.
2934 while test "$loop" -ne 0; do
2935 iface=`expr $revision - $loop`
2936 loop=`expr $loop - 1`
2937 verstring="$verstring_prefix$major.$iface:$verstring"
2940 # Before this point, $major must not contain `.'.
2942 versuffix="$major.$revision"
2946 major=.`expr $current - $age`
2947 versuffix="$major.$age.$revision"
2951 major=.`expr $current - $age`
2952 versuffix=".$current.$age.$revision"
2953 verstring="$current.$age.$revision"
2955 # Add in all the interfaces that we are compatible with.
2957 while test "$loop" -ne 0; do
2958 iface=`expr $current - $loop`
2959 loop=`expr $loop - 1`
2960 verstring="$verstring:${iface}.0"
2963 # Make executables depend on our current version.
2964 verstring="$verstring:${current}.0"
2969 versuffix=".$current.$revision"
2973 # Use '-' rather than '.', since we only want one
2974 # extension on DOS 8.3 filesystems.
2975 major=`expr $current - $age`
2980 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2981 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2986 # Clear the version info if we defaulted, and they specified a release.
2987 if test -z "$vinfo" && test -n "$release"; then
2989 case $version_type in
2991 # we can't check for "0.0" in archive_cmds due to quoting
2992 # problems, so we reset it completely
2999 if test "$need_version" = no; then
3006 # Remove version info from name if versioning should be avoided
3007 if test "$avoid_version" = yes && test "$need_version" = no; then
3013 # Check to see if the archive will have undefined symbols.
3014 if test "$allow_undefined" = yes; then
3015 if test "$allow_undefined_flag" = unsupported; then
3016 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3017 build_libtool_libs=no
3021 # Don't allow undefined symbols.
3022 allow_undefined_flag="$no_undefined_flag"
3026 if test "$mode" != relink; then
3027 # Remove our outputs, but don't remove object files since they
3028 # may have been created when compiling PIC objects.
3030 tempremovelist=`$echo "$output_objdir/*"`
3031 for p in $tempremovelist; do
3035 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3036 removelist="$removelist $p"
3041 if test -n "$removelist"; then
3042 $show "${rm}r $removelist"
3043 $run ${rm}r $removelist
3047 # Now set the variables for building old libraries.
3048 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3049 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3051 # Transform .lo files to .o files.
3052 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3055 # Eliminate all temporary directories.
3056 for path in $notinst_path; do
3057 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3058 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3059 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3062 if test -n "$xrpath"; then
3063 # If the user specified any rpath flags, then add them.
3065 for libdir in $xrpath; do
3066 temp_xrpath="$temp_xrpath -R$libdir"
3067 case "$finalize_rpath " in
3069 *) finalize_rpath="$finalize_rpath $libdir" ;;
3072 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3073 dependency_libs="$temp_xrpath $dependency_libs"
3077 # Make sure dlfiles contains only unique files that won't be dlpreopened
3078 old_dlfiles="$dlfiles"
3080 for lib in $old_dlfiles; do
3081 case " $dlprefiles $dlfiles " in
3083 *) dlfiles="$dlfiles $lib" ;;
3087 # Make sure dlprefiles contains only unique files
3088 old_dlprefiles="$dlprefiles"
3090 for lib in $old_dlprefiles; do
3091 case "$dlprefiles " in
3093 *) dlprefiles="$dlprefiles $lib" ;;
3097 if test "$build_libtool_libs" = yes; then
3098 if test -n "$rpath"; then
3100 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3101 # these systems don't actually have a c library (as such)!
3103 *-*-rhapsody* | *-*-darwin1.[012])
3104 # Rhapsody C library is in the System framework
3105 deplibs="$deplibs -framework System"
3108 # Don't link with libc until the a.out ld.so is fixed.
3110 *-*-openbsd* | *-*-freebsd*)
3111 # Do not include libc due to us having libc/libc_r.
3112 test "X$arg" = "X-lc" && continue
3115 # Add libc to deplibs on all other systems if necessary.
3116 if test "$build_libtool_need_lc" = "yes"; then
3117 deplibs="$deplibs -lc"
3123 # Transform deplibs into only deplibs that can be linked in shared.
3125 libname_save=$libname
3126 release_save=$release
3127 versuffix_save=$versuffix
3129 # I'm not sure if I'm treating the release correctly. I think
3130 # release should show up in the -l (ie -lgmp5) so we don't want to
3131 # add it in twice. Is that correct?
3137 case $deplibs_check_method in
3139 # Don't check for shared/static. Everything works.
3140 # This might be a little naive. We might want to check
3141 # whether the library exists or not. But this is on
3142 # osf3 & osf4 and I'm not really sure... Just
3143 # implementing what was already the behavior.
3147 # This code stresses the "libraries are programs" paradigm to its
3148 # limits. Maybe even breaks it. We compile a program, linking it
3149 # against the deplibs as a proxy for the library. Then we can check
3150 # whether they linked in statically or dynamically with ldd.
3152 cat > conftest.c <<EOF
3153 int main() { return 0; }
3156 $LTCC -o conftest conftest.c $deplibs
3157 if test "$?" -eq 0 ; then
3158 ldd_output=`ldd conftest`
3159 for i in $deplibs; do
3160 name="`expr $i : '-l\(.*\)'`"
3161 # If $name is empty we are operating on a -L argument.
3162 if test "$name" != "" && test "$name" -ne "0"; then
3163 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3164 case " $predeps $postdeps " in
3166 newdeplibs="$newdeplibs $i"
3171 if test -n "$i" ; then
3172 libname=`eval \\$echo \"$libname_spec\"`
3173 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3174 set dummy $deplib_matches
3176 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3177 newdeplibs="$newdeplibs $i"
3181 $echo "*** Warning: dynamic linker does not accept needed library $i."
3182 $echo "*** I have the capability to make that library automatically link in when"
3183 $echo "*** you link to this library. But I can only do this if you have a"
3184 $echo "*** shared version of the library, which I believe you do not have"
3185 $echo "*** because a test_compile did reveal that the linker did not use it for"
3186 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3190 newdeplibs="$newdeplibs $i"
3194 # Error occurred in the first compile. Let's try to salvage
3195 # the situation: Compile a separate program for each library.
3196 for i in $deplibs; do
3197 name="`expr $i : '-l\(.*\)'`"
3198 # If $name is empty we are operating on a -L argument.
3199 if test "$name" != "" && test "$name" != "0"; then
3201 $LTCC -o conftest conftest.c $i
3203 if test "$?" -eq 0 ; then
3204 ldd_output=`ldd conftest`
3205 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3206 case " $predeps $postdeps " in
3208 newdeplibs="$newdeplibs $i"
3213 if test -n "$i" ; then
3214 libname=`eval \\$echo \"$libname_spec\"`
3215 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3216 set dummy $deplib_matches
3218 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3219 newdeplibs="$newdeplibs $i"
3223 $echo "*** Warning: dynamic linker does not accept needed library $i."
3224 $echo "*** I have the capability to make that library automatically link in when"
3225 $echo "*** you link to this library. But I can only do this if you have a"
3226 $echo "*** shared version of the library, which you do not appear to have"
3227 $echo "*** because a test_compile did reveal that the linker did not use this one"
3228 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3234 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3235 $echo "*** make it link in! You will probably need to install it or some"
3236 $echo "*** library that it depends on before this library will be fully"
3237 $echo "*** functional. Installing it before continuing would be even better."
3240 newdeplibs="$newdeplibs $i"
3246 set dummy $deplibs_check_method
3247 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3248 for a_deplib in $deplibs; do
3249 name="`expr $a_deplib : '-l\(.*\)'`"
3250 # If $name is empty we are operating on a -L argument.
3251 if test "$name" != "" && test "$name" != "0"; then
3252 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3253 case " $predeps $postdeps " in
3255 newdeplibs="$newdeplibs $a_deplib"
3260 if test -n "$a_deplib" ; then
3261 libname=`eval \\$echo \"$libname_spec\"`
3262 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3263 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3264 for potent_lib in $potential_libs; do
3265 # Follow soft links.
3266 if ls -lLd "$potent_lib" 2>/dev/null \
3267 | grep " -> " >/dev/null; then
3270 # The statement above tries to avoid entering an
3271 # endless loop below, in case of cyclic links.
3272 # We might still enter an endless loop, since a link
3273 # loop can be closed while we follow links,
3275 potlib="$potent_lib"
3276 while test -h "$potlib" 2>/dev/null; do
3277 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3279 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3280 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3283 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3285 | $EGREP "$file_magic_regex" > /dev/null; then
3286 newdeplibs="$newdeplibs $a_deplib"
3293 if test -n "$a_deplib" ; then
3296 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3297 $echo "*** I have the capability to make that library automatically link in when"
3298 $echo "*** you link to this library. But I can only do this if you have a"
3299 $echo "*** shared version of the library, which you do not appear to have"
3300 $echo "*** because I did check the linker path looking for a file starting"
3301 if test -z "$potlib" ; then
3302 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3304 $echo "*** with $libname and none of the candidates passed a file format test"
3305 $echo "*** using a file magic. Last file checked: $potlib"
3309 # Add a -L argument.
3310 newdeplibs="$newdeplibs $a_deplib"
3312 done # Gone through all deplibs.
3315 set dummy $deplibs_check_method
3316 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3317 for a_deplib in $deplibs; do
3318 name="`expr $a_deplib : '-l\(.*\)'`"
3319 # If $name is empty we are operating on a -L argument.
3320 if test -n "$name" && test "$name" != "0"; then
3321 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3322 case " $predeps $postdeps " in
3324 newdeplibs="$newdeplibs $a_deplib"
3329 if test -n "$a_deplib" ; then
3330 libname=`eval \\$echo \"$libname_spec\"`
3331 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3332 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3333 for potent_lib in $potential_libs; do
3334 potlib="$potent_lib" # see symlink-check above in file_magic test
3335 if eval $echo \"$potent_lib\" 2>/dev/null \
3337 | $EGREP "$match_pattern_regex" > /dev/null; then
3338 newdeplibs="$newdeplibs $a_deplib"
3345 if test -n "$a_deplib" ; then
3348 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3349 $echo "*** I have the capability to make that library automatically link in when"
3350 $echo "*** you link to this library. But I can only do this if you have a"
3351 $echo "*** shared version of the library, which you do not appear to have"
3352 $echo "*** because I did check the linker path looking for a file starting"
3353 if test -z "$potlib" ; then
3354 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3356 $echo "*** with $libname and none of the candidates passed a file format test"
3357 $echo "*** using a regex pattern. Last file checked: $potlib"
3361 # Add a -L argument.
3362 newdeplibs="$newdeplibs $a_deplib"
3364 done # Gone through all deplibs.
3368 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3369 -e 's/ -[LR][^ ]*//g'`
3370 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3371 for i in $predeps $postdeps ; do
3372 # can't use Xsed below, because $i might contain '/'
3373 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3376 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3377 | grep . >/dev/null; then
3379 if test "X$deplibs_check_method" = "Xnone"; then
3380 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3382 $echo "*** Warning: inter-library dependencies are not known to be supported."
3384 $echo "*** All declared inter-library dependencies are being dropped."
3389 versuffix=$versuffix_save
3391 release=$release_save
3392 libname=$libname_save
3396 *-*-rhapsody* | *-*-darwin1.[012])
3397 # On Rhapsody replace the C library is the System framework
3398 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3402 if test "$droppeddeps" = yes; then
3403 if test "$module" = yes; then
3405 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3406 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3407 $echo "*** a static module, that should work as long as the dlopening"
3408 $echo "*** application is linked with the -dlopen flag."
3409 if test -z "$global_symbol_pipe"; then
3411 $echo "*** However, this would only work if libtool was able to extract symbol"
3412 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3413 $echo "*** not find such a program. So, this module is probably useless."
3414 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3416 if test "$build_old_libs" = no; then
3417 oldlibs="$output_objdir/$libname.$libext"
3418 build_libtool_libs=module
3421 build_libtool_libs=no
3424 $echo "*** The inter-library dependencies that have been dropped here will be"
3425 $echo "*** automatically added whenever a program is linked with this library"
3426 $echo "*** or is declared to -dlopen it."
3428 if test "$allow_undefined" = no; then
3430 $echo "*** Since this library must not contain undefined symbols,"
3431 $echo "*** because either the platform does not support them or"
3432 $echo "*** it was explicitly requested with -no-undefined,"
3433 $echo "*** libtool will only create a static version of it."
3434 if test "$build_old_libs" = no; then
3435 oldlibs="$output_objdir/$libname.$libext"
3436 build_libtool_libs=module
3439 build_libtool_libs=no
3444 # Done checking deplibs!
3448 # All the library-specific variables (install_libdir is set above).
3453 # Test again, we may have decided not to build it any more
3454 if test "$build_libtool_libs" = yes; then
3455 if test "$hardcode_into_libs" = yes; then
3456 # Hardcode the library paths
3459 rpath="$finalize_rpath"
3460 test "$mode" != relink && rpath="$compile_rpath$rpath"
3461 for libdir in $rpath; do
3462 if test -n "$hardcode_libdir_flag_spec"; then
3463 if test -n "$hardcode_libdir_separator"; then
3464 if test -z "$hardcode_libdirs"; then
3465 hardcode_libdirs="$libdir"
3467 # Just accumulate the unique libdirs.
3468 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3469 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3472 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3477 eval flag=\"$hardcode_libdir_flag_spec\"
3478 dep_rpath="$dep_rpath $flag"
3480 elif test -n "$runpath_var"; then
3481 case "$perm_rpath " in
3483 *) perm_rpath="$perm_rpath $libdir" ;;
3487 # Substitute the hardcoded libdirs into the rpath.
3488 if test -n "$hardcode_libdir_separator" &&
3489 test -n "$hardcode_libdirs"; then
3490 libdir="$hardcode_libdirs"
3491 if test -n "$hardcode_libdir_flag_spec_ld"; then
3492 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3494 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3497 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3498 # We should set the runpath_var.
3500 for dir in $perm_rpath; do
3503 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3505 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3508 shlibpath="$finalize_shlibpath"
3509 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3510 if test -n "$shlibpath"; then
3511 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3514 # Get the real and link names of the library.
3515 eval shared_ext=\"$shrext\"
3516 eval library_names=\"$library_names_spec\"
3517 set dummy $library_names
3521 if test -n "$soname_spec"; then
3522 eval soname=\"$soname_spec\"
3526 if test -z "$dlname"; then
3530 lib="$output_objdir/$realname"
3533 linknames="$linknames $link"
3536 # Use standard objects if they are pic
3537 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3539 # Prepare the list of exported symbols
3540 if test -z "$export_symbols"; then
3541 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3542 $show "generating symbol list for \`$libname.la'"
3543 export_symbols="$output_objdir/$libname.exp"
3544 $run $rm $export_symbols
3545 eval cmds=\"$export_symbols_cmds\"
3546 save_ifs="$IFS"; IFS='~'
3547 for cmd in $cmds; do
3549 if len=`expr "X$cmd" : ".*"` &&
3550 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3552 $run eval "$cmd" || exit $?
3553 skipped_export=false
3555 # The command line is too long to execute in one step.
3556 $show "using reloadable object file for export list..."
3561 if test -n "$export_symbols_regex"; then
3562 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3563 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3564 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3565 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3570 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3571 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3575 for test_deplib in $deplibs; do
3576 case " $convenience " in
3577 *" $test_deplib "*) ;;
3579 tmp_deplibs="$tmp_deplibs $test_deplib"
3583 deplibs="$tmp_deplibs"
3585 if test -n "$convenience"; then
3586 if test -n "$whole_archive_flag_spec"; then
3587 save_libobjs=$libobjs
3588 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3590 gentop="$output_objdir/${outputname}x"
3591 $show "${rm}r $gentop"
3592 $run ${rm}r "$gentop"
3593 $show "$mkdir $gentop"
3594 $run $mkdir "$gentop"
3596 if test "$status" -ne 0 && test ! -d "$gentop"; then
3599 generated="$generated $gentop"
3601 for xlib in $convenience; do
3602 # Extract the objects.
3604 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3605 *) xabs=`pwd`"/$xlib" ;;
3607 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3608 xdir="$gentop/$xlib"
3610 $show "${rm}r $xdir"
3612 $show "$mkdir $xdir"
3615 if test "$status" -ne 0 && test ! -d "$xdir"; then
3618 # We will extract separately just the conflicting names and we will no
3619 # longer touch any unique names. It is faster to leave these extract
3620 # automatically by $AR in one run.
3621 $show "(cd $xdir && $AR x $xabs)"
3622 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3623 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3626 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3627 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3628 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3631 while test "$i" -le "$count"
3633 # Put our $i before any first dot (extension)
3634 # Never overwrite any file
3636 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3638 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3640 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3641 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3647 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3652 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3653 eval flag=\"$thread_safe_flag_spec\"
3654 linker_flags="$linker_flags $flag"
3657 # Make a backup of the uninstalled library when relinking
3658 if test "$mode" = relink; then
3659 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3662 # Do each of the archive commands.
3663 if test "$module" = yes && test -n "$module_cmds" ; then
3664 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3665 eval cmds=\"$module_expsym_cmds\"
3667 eval cmds=\"$module_cmds\"
3670 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3671 eval cmds=\"$archive_expsym_cmds\"
3673 eval cmds=\"$archive_cmds\"
3677 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3678 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3681 # The command line is too long to link in one step, link piecewise.
3682 $echo "creating reloadable object files..."
3684 # Save the value of $output and $libobjs because we want to
3685 # use them later. If we have whole_archive_flag_spec, we
3686 # want to use save_libobjs as it was before
3687 # whole_archive_flag_spec was expanded, because we can't
3688 # assume the linker understands whole_archive_flag_spec.
3689 # This may have to be revisited, in case too many
3690 # convenience libraries get linked in and end up exceeding
3692 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3693 save_libobjs=$libobjs
3697 # Clear the reloadable object creation command queue and
3698 # initialize k to one.
3705 output=$output_objdir/$save_output-${k}.$objext
3706 # Loop over the list of objects to be linked.
3707 for obj in $save_libobjs
3709 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3710 if test "X$objlist" = X ||
3711 { len=`expr "X$test_cmds" : ".*"` &&
3712 test "$len" -le "$max_cmd_len"; }; then
3713 objlist="$objlist $obj"
3715 # The command $test_cmds is almost too long, add a
3716 # command to the queue.
3717 if test "$k" -eq 1 ; then
3718 # The first file doesn't have a previous command to add.
3719 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3721 # All subsequent reloadable object files will link in
3722 # the last one created.
3723 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3725 last_robj=$output_objdir/$save_output-${k}.$objext
3727 output=$output_objdir/$save_output-${k}.$objext
3732 # Handle the remaining objects by creating one last
3733 # reloadable object file. All subsequent reloadable object
3734 # files will link in the last one created.
3735 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3736 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3738 if ${skipped_export-false}; then
3739 $show "generating symbol list for \`$libname.la'"
3740 export_symbols="$output_objdir/$libname.exp"
3741 $run $rm $export_symbols
3743 # Append the command to create the export file.
3744 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3747 # Set up a command to remove the reloadale object files
3748 # after they are used.
3750 while test "$i" -lt "$k"
3753 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3756 $echo "creating a temporary reloadable object file: $output"
3758 # Loop through the commands generated above and execute them.
3759 save_ifs="$IFS"; IFS='~'
3760 for cmd in $concat_cmds; do
3763 $run eval "$cmd" || exit $?
3768 # Restore the value of output.
3771 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3772 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3774 # Expand the library linking commands again to reset the
3775 # value of $libobjs for piecewise linking.
3777 # Do each of the archive commands.
3778 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3779 eval cmds=\"$archive_expsym_cmds\"
3781 eval cmds=\"$archive_cmds\"
3784 # Append the command to remove the reloadable object files
3785 # to the just-reset $cmds.
3786 eval cmds=\"\$cmds~$rm $delfiles\"
3788 save_ifs="$IFS"; IFS='~'
3789 for cmd in $cmds; do
3792 $run eval "$cmd" || exit $?
3796 # Restore the uninstalled library and exit
3797 if test "$mode" = relink; then
3798 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3802 # Create links to the real library.
3803 for linkname in $linknames; do
3804 if test "$realname" != "$linkname"; then
3805 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3806 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3810 # If -module or -export-dynamic was specified, set the dlname.
3811 if test "$module" = yes || test "$export_dynamic" = yes; then
3812 # On all known operating systems, these are identical.
3819 if test -n "$deplibs"; then
3820 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3823 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3824 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3827 if test -n "$rpath"; then
3828 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3831 if test -n "$xrpath"; then
3832 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3835 if test -n "$vinfo"; then
3836 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3839 if test -n "$release"; then
3840 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3845 if test -n "$objs$old_deplibs"; then
3846 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3850 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3858 # Delete the old objects.
3859 $run $rm $obj $libobj
3861 # Objects from convenience libraries. This assumes
3862 # single-version convenience libraries. Whenever we create
3863 # different ones for PIC/non-PIC, this we'll have to duplicate
3867 # reload_cmds runs $LD directly, so let us get rid of
3868 # -Wl from whole_archive_flag_spec
3871 if test -n "$convenience"; then
3872 if test -n "$whole_archive_flag_spec"; then
3873 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3875 gentop="$output_objdir/${obj}x"
3876 $show "${rm}r $gentop"
3877 $run ${rm}r "$gentop"
3878 $show "$mkdir $gentop"
3879 $run $mkdir "$gentop"
3881 if test "$status" -ne 0 && test ! -d "$gentop"; then
3884 generated="$generated $gentop"
3886 for xlib in $convenience; do
3887 # Extract the objects.
3889 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3890 *) xabs=`pwd`"/$xlib" ;;
3892 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3893 xdir="$gentop/$xlib"
3895 $show "${rm}r $xdir"
3897 $show "$mkdir $xdir"
3900 if test "$status" -ne 0 && test ! -d "$xdir"; then
3903 # We will extract separately just the conflicting names and we will no
3904 # longer touch any unique names. It is faster to leave these extract
3905 # automatically by $AR in one run.
3906 $show "(cd $xdir && $AR x $xabs)"
3907 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3908 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3911 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3912 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3913 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3916 while test "$i" -le "$count"
3918 # Put our $i before any first dot (extension)
3919 # Never overwrite any file
3921 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3923 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3925 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3926 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3932 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3937 # Create the old-style object.
3938 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
3941 eval cmds=\"$reload_cmds\"
3942 save_ifs="$IFS"; IFS='~'
3943 for cmd in $cmds; do
3946 $run eval "$cmd" || exit $?
3950 # Exit if we aren't doing a library object file.
3951 if test -z "$libobj"; then
3952 if test -n "$gentop"; then
3953 $show "${rm}r $gentop"
3960 if test "$build_libtool_libs" != yes; then
3961 if test -n "$gentop"; then
3962 $show "${rm}r $gentop"
3966 # Create an invalid libtool object if no PIC, so that we don't
3967 # accidentally link it into a program.
3968 # $show "echo timestamp > $libobj"
3969 # $run eval "echo timestamp > $libobj" || exit $?
3973 if test -n "$pic_flag" || test "$pic_mode" != default; then
3974 # Only do commands if we really have different PIC objects.
3975 reload_objs="$libobjs $reload_conv_objs"
3977 eval cmds=\"$reload_cmds\"
3978 save_ifs="$IFS"; IFS='~'
3979 for cmd in $cmds; do
3982 $run eval "$cmd" || exit $?
3987 if test -n "$gentop"; then
3988 $show "${rm}r $gentop"
3997 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3999 if test -n "$vinfo"; then
4000 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4003 if test -n "$release"; then
4004 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4007 if test "$preload" = yes; then
4008 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4009 test "$dlopen_self_static" = unknown; then
4010 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4015 *-*-rhapsody* | *-*-darwin1.[012])
4016 # On Rhapsody replace the C library is the System framework
4017 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4018 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4024 # Don't allow lazy linking, it breaks C++ global constructors
4025 if test "$tagname" = CXX ; then
4026 compile_command="$compile_command ${wl}-bind_at_load"
4027 finalize_command="$finalize_command ${wl}-bind_at_load"
4032 compile_command="$compile_command $compile_deplibs"
4033 finalize_command="$finalize_command $finalize_deplibs"
4035 if test -n "$rpath$xrpath"; then
4036 # If the user specified any rpath flags, then add them.
4037 for libdir in $rpath $xrpath; do
4038 # This is the magic to use -rpath.
4039 case "$finalize_rpath " in
4041 *) finalize_rpath="$finalize_rpath $libdir" ;;
4046 # Now hardcode the library paths
4049 for libdir in $compile_rpath $finalize_rpath; do
4050 if test -n "$hardcode_libdir_flag_spec"; then
4051 if test -n "$hardcode_libdir_separator"; then
4052 if test -z "$hardcode_libdirs"; then
4053 hardcode_libdirs="$libdir"
4055 # Just accumulate the unique libdirs.
4056 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4057 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4060 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4065 eval flag=\"$hardcode_libdir_flag_spec\"
4066 rpath="$rpath $flag"
4068 elif test -n "$runpath_var"; then
4069 case "$perm_rpath " in
4071 *) perm_rpath="$perm_rpath $libdir" ;;
4075 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4076 case :$dllsearchpath: in
4078 *) dllsearchpath="$dllsearchpath:$libdir";;
4083 # Substitute the hardcoded libdirs into the rpath.
4084 if test -n "$hardcode_libdir_separator" &&
4085 test -n "$hardcode_libdirs"; then
4086 libdir="$hardcode_libdirs"
4087 eval rpath=\" $hardcode_libdir_flag_spec\"
4089 compile_rpath="$rpath"
4093 for libdir in $finalize_rpath; do
4094 if test -n "$hardcode_libdir_flag_spec"; then
4095 if test -n "$hardcode_libdir_separator"; then
4096 if test -z "$hardcode_libdirs"; then
4097 hardcode_libdirs="$libdir"
4099 # Just accumulate the unique libdirs.
4100 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4101 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4104 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4109 eval flag=\"$hardcode_libdir_flag_spec\"
4110 rpath="$rpath $flag"
4112 elif test -n "$runpath_var"; then
4113 case "$finalize_perm_rpath " in
4115 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4119 # Substitute the hardcoded libdirs into the rpath.
4120 if test -n "$hardcode_libdir_separator" &&
4121 test -n "$hardcode_libdirs"; then
4122 libdir="$hardcode_libdirs"
4123 eval rpath=\" $hardcode_libdir_flag_spec\"
4125 finalize_rpath="$rpath"
4127 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4128 # Transform all the library objects into standard objects.
4129 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4130 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4134 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4135 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4136 dlsyms="${outputname}S.c"
4138 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4142 if test -n "$dlsyms"; then
4146 # Discover the nlist of each of the dlfiles.
4147 nlist="$output_objdir/${outputname}.nm"
4149 $show "$rm $nlist ${nlist}S ${nlist}T"
4150 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4152 # Parse the name list into a source file.
4153 $show "creating $output_objdir/$dlsyms"
4155 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4156 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4157 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4163 /* Prevent the only kind of declaration conflicts we can make. */
4164 #define lt_preloaded_symbols some_other_symbol
4166 /* External symbol declarations for the compiler. */\
4169 if test "$dlself" = yes; then
4170 $show "generating symbol list for \`$output'"
4172 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4174 # Add our own program objects to the symbol list.
4175 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4176 for arg in $progfiles; do
4177 $show "extracting global C symbols from \`$arg'"
4178 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4181 if test -n "$exclude_expsyms"; then
4182 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4183 $run eval '$mv "$nlist"T "$nlist"'
4186 if test -n "$export_symbols_regex"; then
4187 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4188 $run eval '$mv "$nlist"T "$nlist"'
4191 # Prepare the list of exported symbols
4192 if test -z "$export_symbols"; then
4193 export_symbols="$output_objdir/$output.exp"
4194 $run $rm $export_symbols
4195 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4197 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4198 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4199 $run eval 'mv "$nlist"T "$nlist"'
4203 for arg in $dlprefiles; do
4204 $show "extracting global C symbols from \`$arg'"
4205 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4206 $run eval '$echo ": $name " >> "$nlist"'
4207 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4210 if test -z "$run"; then
4211 # Make sure we have at least an empty file.
4212 test -f "$nlist" || : > "$nlist"
4214 if test -n "$exclude_expsyms"; then
4215 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4216 $mv "$nlist"T "$nlist"
4219 # Try sorting and uniquifying the output.
4220 if grep -v "^: " < "$nlist" |
4221 if sort -k 3 </dev/null >/dev/null 2>&1; then
4226 uniq > "$nlist"S; then
4229 grep -v "^: " < "$nlist" > "$nlist"S
4232 if test -f "$nlist"S; then
4233 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4235 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4238 $echo >> "$output_objdir/$dlsyms" "\
4240 #undef lt_preloaded_symbols
4242 #if defined (__STDC__) && __STDC__
4243 # define lt_ptr void *
4245 # define lt_ptr char *
4249 /* The mapping between symbol names and symbols. */
4254 lt_preloaded_symbols[] =
4258 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4260 $echo >> "$output_objdir/$dlsyms" "\
4264 /* This works around a problem in FreeBSD linker */
4265 #ifdef FREEBSD_WORKAROUND
4266 static const void *lt_preloaded_setup() {
4267 return lt_preloaded_symbols;
4277 pic_flag_for_symtable=
4279 # compiling the symbol table file with pic_flag works around
4280 # a FreeBSD bug that causes programs to crash when -lm is
4281 # linked before any other PIC object. But we must not use
4282 # pic_flag when linking with -static. The problem exists in
4283 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4284 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4285 case "$compile_command " in
4287 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4290 case "$compile_command " in
4292 *) pic_flag_for_symtable=" $pic_flag";;
4296 # Now compile the dynamic symbol file.
4297 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4298 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4300 # Clean up the generated files.
4301 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4302 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4304 # Transform the symbol file into the correct name.
4305 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4306 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4309 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4314 # We keep going just in case the user didn't refer to
4315 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4316 # really was required.
4318 # Nullify the symbol file.
4319 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4320 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4323 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4324 # Replace the output file specification.
4325 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4326 link_command="$compile_command$compile_rpath"
4328 # We have no uninstalled library dependencies, so finalize right now.
4329 $show "$link_command"
4330 $run eval "$link_command"
4333 # Delete the generated files.
4334 if test -n "$dlsyms"; then
4335 $show "$rm $output_objdir/${outputname}S.${objext}"
4336 $run $rm "$output_objdir/${outputname}S.${objext}"
4342 if test -n "$shlibpath_var"; then
4343 # We should set the shlibpath_var
4345 for dir in $temp_rpath; do
4347 [\\/]* | [A-Za-z]:[\\/]*)
4352 # Relative path: add a thisdir entry.
4353 rpath="$rpath\$thisdir/$dir:"
4360 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4361 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4363 if test -n "$finalize_shlibpath"; then
4364 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4369 if test -n "$runpath_var"; then
4370 if test -n "$perm_rpath"; then
4371 # We should set the runpath_var.
4373 for dir in $perm_rpath; do
4376 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4378 if test -n "$finalize_perm_rpath"; then
4379 # We should set the runpath_var.
4381 for dir in $finalize_perm_rpath; do
4384 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4388 if test "$no_install" = yes; then
4389 # We don't need to create a wrapper script.
4390 link_command="$compile_var$compile_command$compile_rpath"
4391 # Replace the output file specification.
4392 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4393 # Delete the old output file.
4395 # Link the executable and exit
4396 $show "$link_command"
4397 $run eval "$link_command" || exit $?
4401 if test "$hardcode_action" = relink; then
4402 # Fast installation is not supported
4403 link_command="$compile_var$compile_command$compile_rpath"
4404 relink_command="$finalize_var$finalize_command$finalize_rpath"
4406 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4407 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4409 if test "$fast_install" != no; then
4410 link_command="$finalize_var$compile_command$finalize_rpath"
4411 if test "$fast_install" = yes; then
4412 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4414 # fast_install is set to needless
4418 link_command="$compile_var$compile_command$compile_rpath"
4419 relink_command="$finalize_var$finalize_command$finalize_rpath"
4423 # Replace the output file specification.
4424 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4426 # Delete the old output files.
4427 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4429 $show "$link_command"
4430 $run eval "$link_command" || exit $?
4432 # Now create the wrapper script.
4433 $show "creating $output"
4435 # Quote the relink command for shipping.
4436 if test -n "$relink_command"; then
4437 # Preserve any variables that may affect compiler behavior
4438 for var in $variables_saved_for_relink; do
4439 if eval test -z \"\${$var+set}\"; then
4440 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4441 elif eval var_value=\$$var; test -z "$var_value"; then
4442 relink_command="$var=; export $var; $relink_command"
4444 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4445 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4448 relink_command="(cd `pwd`; $relink_command)"
4449 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4452 # Quote $echo for shipping.
4453 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4455 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4456 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4458 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4460 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4463 # Only actually do things if our run command is non-null.
4464 if test -z "$run"; then
4465 # win32 will think the script is a binary if it has
4466 # a .exe suffix, so we strip it off here.
4468 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4470 # test for cygwin because mv fails w/o .exe extensions
4474 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4478 *cygwin* | *mingw* )
4479 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4480 cwrapper=`$echo ${output}.exe`
4481 $rm $cwrappersource $cwrapper
4482 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4484 cat > $cwrappersource <<EOF
4486 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4487 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4489 The $output program cannot be directly executed until all the libtool
4490 libraries that it depends on are installed.
4492 This wrapper executable should never be moved out of the build directory.
4493 If it is, it will not operate correctly.
4495 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4496 but could eventually absorb all of the scripts functionality and
4497 exec $objdir/$outputname directly.
4500 cat >> $cwrappersource<<"EOF"
4508 #if defined(PATH_MAX)
4509 # define LT_PATHMAX PATH_MAX
4510 #elif defined(MAXPATHLEN)
4511 # define LT_PATHMAX MAXPATHLEN
4513 # define LT_PATHMAX 1024
4516 #ifndef DIR_SEPARATOR
4517 #define DIR_SEPARATOR '/'
4520 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4522 #define HAVE_DOS_BASED_FILE_SYSTEM
4523 #ifndef DIR_SEPARATOR_2
4524 #define DIR_SEPARATOR_2 '\\'
4528 #ifndef DIR_SEPARATOR_2
4529 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4530 #else /* DIR_SEPARATOR_2 */
4531 # define IS_DIR_SEPARATOR(ch) \
4532 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4533 #endif /* DIR_SEPARATOR_2 */
4535 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4536 #define XFREE(stale) do { \
4537 if (stale) { free ((void *) stale); stale = 0; } \
4540 const char *program_name = NULL;
4542 void * xmalloc (size_t num);
4543 char * xstrdup (const char *string);
4544 char * basename (const char *name);
4545 char * fnqualify(const char *path);
4546 char * strendzap(char *str, const char *pat);
4547 void lt_fatal (const char *message, ...);
4550 main (int argc, char *argv[])
4555 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4556 newargz = XMALLOC(char *, argc+2);
4559 cat >> $cwrappersource <<EOF
4560 newargz[0] = "$SHELL";
4563 cat >> $cwrappersource <<"EOF"
4564 newargz[1] = fnqualify(argv[0]);
4565 /* we know the script has the same name, without the .exe */
4566 /* so make sure newargz[1] doesn't end in .exe */
4567 strendzap(newargz[1],".exe");
4568 for (i = 1; i < argc; i++)
4569 newargz[i+1] = xstrdup(argv[i]);
4570 newargz[argc+1] = NULL;
4573 cat >> $cwrappersource <<EOF
4574 execv("$SHELL",newargz);
4577 cat >> $cwrappersource <<"EOF"
4581 xmalloc (size_t num)
4583 void * p = (void *) malloc (num);
4585 lt_fatal ("Memory exhausted");
4591 xstrdup (const char *string)
4593 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4598 basename (const char *name)
4602 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4603 /* Skip over the disk name in MSDOS pathnames. */
4604 if (isalpha (name[0]) && name[1] == ':')
4608 for (base = name; *name; name++)
4609 if (IS_DIR_SEPARATOR (*name))
4611 return (char *) base;
4615 fnqualify(const char *path)
4619 char tmp[LT_PATHMAX + 1];
4621 assert(path != NULL);
4623 /* Is it qualified already? */
4624 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4625 if (isalpha (path[0]) && path[1] == ':')
4626 return xstrdup (path);
4628 if (IS_DIR_SEPARATOR (path[0]))
4629 return xstrdup (path);
4631 /* prepend the current directory */
4632 /* doesn't handle '~' */
4633 if (getcwd (tmp, LT_PATHMAX) == NULL)
4634 lt_fatal ("getcwd failed");
4635 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4636 p = XMALLOC(char, size);
4637 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4642 strendzap(char *str, const char *pat)
4646 assert(str != NULL);
4647 assert(pat != NULL);
4650 patlen = strlen(pat);
4654 str += len - patlen;
4655 if (strcmp(str, pat) == 0)
4662 lt_error_core (int exit_status, const char * mode,
4663 const char * message, va_list ap)
4665 fprintf (stderr, "%s: %s: ", program_name, mode);
4666 vfprintf (stderr, message, ap);
4667 fprintf (stderr, ".\n");
4669 if (exit_status >= 0)
4674 lt_fatal (const char *message, ...)
4677 va_start (ap, message);
4678 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4682 # we should really use a build-platform specific compiler
4683 # here, but OTOH, the wrappers (shell script and this C one)
4684 # are only useful if you want to execute the "real" binary.
4685 # Since the "real" binary is built for $host, then this
4686 # wrapper might as well be built for $host, too.
4687 $run $LTCC -s -o $cwrapper $cwrappersource
4691 trap "$rm $output; exit 1" 1 2 15
4696 # $output - temporary wrapper script for $objdir/$outputname
4697 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4699 # The $output program cannot be directly executed until all the libtool
4700 # libraries that it depends on are installed.
4702 # This wrapper script should never be moved out of the build directory.
4703 # If it is, it will not operate correctly.
4705 # Sed substitution that helps us do robust quoting. It backslashifies
4706 # metacharacters that are still active within double-quoted strings.
4707 Xsed='${SED} -e 1s/^X//'
4708 sed_quote_subst='$sed_quote_subst'
4710 # The HP-UX ksh and POSIX shell print the target directory to stdout
4712 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4714 relink_command=\"$relink_command\"
4716 # This environment variable determines our operation mode.
4717 if test \"\$libtool_install_magic\" = \"$magic\"; then
4718 # install mode needs the following variable:
4719 notinst_deplibs='$notinst_deplibs'
4721 # When we are sourced in execute mode, \$file and \$echo are already set.
4722 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4725 # Make sure echo works.
4726 if test \"X\$1\" = X--no-reexec; then
4727 # Discard the --no-reexec flag, and continue.
4729 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4730 # Yippee, \$echo works!
4733 # Restart under the correct shell, and then maybe \$echo will work.
4734 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4740 # Find the directory that this script lives in.
4741 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4742 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4744 # Follow symbolic links until we get to the real thisdir.
4745 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4746 while test -n \"\$file\"; do
4747 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4749 # If there was a directory component, then change thisdir.
4750 if test \"x\$destdir\" != \"x\$file\"; then
4751 case \"\$destdir\" in
4752 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4753 *) thisdir=\"\$thisdir/\$destdir\" ;;
4757 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4758 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4761 # Try to get the absolute directory name.
4762 absdir=\`cd \"\$thisdir\" && pwd\`
4763 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4766 if test "$fast_install" = yes; then
4768 program=lt-'$outputname'$exeext
4769 progdir=\"\$thisdir/$objdir\"
4771 if test ! -f \"\$progdir/\$program\" || \\
4772 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4773 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4775 file=\"\$\$-\$program\"
4777 if test ! -d \"\$progdir\"; then
4778 $mkdir \"\$progdir\"
4780 $rm \"\$progdir/\$file\"
4785 # relink executable if necessary
4786 if test -n \"\$relink_command\"; then
4787 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4789 $echo \"\$relink_command_output\" >&2
4790 $rm \"\$progdir/\$file\"
4795 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4796 { $rm \"\$progdir/\$program\";
4797 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4798 $rm \"\$progdir/\$file\"
4802 program='$outputname'
4803 progdir=\"\$thisdir/$objdir\"
4809 if test -f \"\$progdir/\$program\"; then"
4811 # Export our shlibpath_var if we have one.
4812 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4814 # Add our own library path to $shlibpath_var
4815 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4817 # Some systems cannot cope with colon-terminated $shlibpath_var
4818 # The second colon is a workaround for a bug in BeOS R4 sed
4819 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4821 export $shlibpath_var
4825 # fixup the dll searchpath if we need to.
4826 if test -n "$dllsearchpath"; then
4828 # Add the dll search path components to the executable PATH
4829 PATH=$dllsearchpath:\$PATH
4834 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4835 # Run the actual program with our arguments.
4838 # Backslashes separate directories on plain windows
4839 *-*-mingw | *-*-os2*)
4841 exec \$progdir\\\\\$program \${1+\"\$@\"}
4847 exec \$progdir/\$program \${1+\"\$@\"}
4852 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4856 # The program doesn't exist.
4857 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4858 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4859 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4870 # See if we need to build an old-fashioned archive.
4871 for oldlib in $oldlibs; do
4873 if test "$build_libtool_libs" = convenience; then
4874 oldobjs="$libobjs_save"
4875 addlibs="$convenience"
4876 build_libtool_libs=no
4878 if test "$build_libtool_libs" = module; then
4879 oldobjs="$libobjs_save"
4880 build_libtool_libs=no
4882 oldobjs="$old_deplibs $non_pic_objects"
4884 addlibs="$old_convenience"
4887 if test -n "$addlibs"; then
4888 gentop="$output_objdir/${outputname}x"
4889 $show "${rm}r $gentop"
4890 $run ${rm}r "$gentop"
4891 $show "$mkdir $gentop"
4892 $run $mkdir "$gentop"
4894 if test "$status" -ne 0 && test ! -d "$gentop"; then
4897 generated="$generated $gentop"
4899 # Add in members from convenience archives.
4900 for xlib in $addlibs; do
4901 # Extract the objects.
4903 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4904 *) xabs=`pwd`"/$xlib" ;;
4906 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4907 xdir="$gentop/$xlib"
4909 $show "${rm}r $xdir"
4911 $show "$mkdir $xdir"
4914 if test "$status" -ne 0 && test ! -d "$xdir"; then
4917 # We will extract separately just the conflicting names and we will no
4918 # longer touch any unique names. It is faster to leave these extract
4919 # automatically by $AR in one run.
4920 $show "(cd $xdir && $AR x $xabs)"
4921 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4922 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4925 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4926 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4927 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4930 while test "$i" -le "$count"
4932 # Put our $i before any first dot (extension)
4933 # Never overwrite any file
4935 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4937 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4939 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4940 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4946 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4950 # Do each command in the archive commands.
4951 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4952 eval cmds=\"$old_archive_from_new_cmds\"
4954 eval cmds=\"$old_archive_cmds\"
4956 if len=`expr "X$cmds" : ".*"` &&
4957 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4960 # the command line is too long to link in one step, link in parts
4961 $echo "using piecewise archive linking..."
4966 save_oldobjs=$oldobjs
4967 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4968 # encoded into archives. This makes 'ar r' malfunction in
4969 # this piecewise linking case whenever conflicting object
4970 # names appear in distinct ar calls; check, warn and compensate.
4971 if (for obj in $save_oldobjs
4973 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4974 done | sort | sort -uc >/dev/null 2>&1); then
4977 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4978 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4981 # Is there a better way of finding the last object in the list?
4982 for obj in $save_oldobjs
4986 for obj in $save_oldobjs
4988 oldobjs="$objlist $obj"
4989 objlist="$objlist $obj"
4990 eval test_cmds=\"$old_archive_cmds\"
4991 if len=`expr "X$test_cmds" : ".*"` &&
4992 test "$len" -le "$max_cmd_len"; then
4995 # the above command should be used before it gets too long
4997 if test "$obj" = "$last_oldobj" ; then
5000 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5001 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5007 if test "X$oldobjs" = "X" ; then
5008 eval cmds=\"\$concat_cmds\"
5010 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5014 save_ifs="$IFS"; IFS='~'
5015 for cmd in $cmds; do
5018 $run eval "$cmd" || exit $?
5023 if test -n "$generated"; then
5024 $show "${rm}r$generated"
5025 $run ${rm}r$generated
5028 # Now create the libtool archive.
5032 test "$build_old_libs" = yes && old_library="$libname.$libext"
5033 $show "creating $output"
5035 # Preserve any variables that may affect compiler behavior
5036 for var in $variables_saved_for_relink; do
5037 if eval test -z \"\${$var+set}\"; then
5038 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5039 elif eval var_value=\$$var; test -z "$var_value"; then
5040 relink_command="$var=; export $var; $relink_command"
5042 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5043 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5046 # Quote the link command for shipping.
5047 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5048 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5050 # Only create the output if not a dry run.
5051 if test -z "$run"; then
5052 for installed in no yes; do
5053 if test "$installed" = yes; then
5054 if test -z "$install_libdir"; then
5057 output="$output_objdir/$outputname"i
5058 # Replace all uninstalled libtool libraries with the installed ones
5060 for deplib in $dependency_libs; do
5063 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5064 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5065 if test -z "$libdir"; then
5066 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5069 newdependency_libs="$newdependency_libs $libdir/$name"
5071 *) newdependency_libs="$newdependency_libs $deplib" ;;
5074 dependency_libs="$newdependency_libs"
5076 for lib in $dlfiles; do
5077 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5078 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5079 if test -z "$libdir"; then
5080 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5083 newdlfiles="$newdlfiles $libdir/$name"
5085 dlfiles="$newdlfiles"
5087 for lib in $dlprefiles; do
5088 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5089 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5090 if test -z "$libdir"; then
5091 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5094 newdlprefiles="$newdlprefiles $libdir/$name"
5096 dlprefiles="$newdlprefiles"
5099 # place dlname in correct position for cygwin
5101 case $host,$output,$installed,$module,$dlname in
5102 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5105 # $outputname - a libtool library file
5106 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5108 # Please DO NOT delete this file!
5109 # It is necessary for linking the library.
5111 # The name that we can dlopen(3).
5114 # Names of this library.
5115 library_names='$library_names'
5117 # The name of the static archive.
5118 old_library='$old_library'
5120 # Libraries that this one depends upon.
5121 dependency_libs='$dependency_libs'
5123 # Version information for $libname.
5128 # Is this an already installed library?
5129 installed=$installed
5131 # Should we warn about portability when linking against -modules?
5132 shouldnotlink=$module
5134 # Files to dlopen/dlpreopen
5136 dlpreopen='$dlprefiles'
5138 # Directory that this library needs to be installed in:
5139 libdir='$install_libdir'"
5140 if test "$installed" = no && test "$need_relink" = yes; then
5142 relink_command=\"$relink_command\""
5147 # Do a symbolic link so that the libtool archive can be found in
5148 # LD_LIBRARY_PATH before the program is installed.
5149 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5150 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5156 # libtool install mode
5158 modename="$modename: install"
5160 # There may be an optional sh(1) argument at the beginning of
5161 # install_prog (especially on Windows NT).
5162 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5163 # Allow the use of GNU shtool's install command.
5164 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5165 # Aesthetically quote it.
5166 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5168 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5172 install_prog="$arg "
5180 # The real first argument should be the name of the installation program.
5181 # Aesthetically quote it.
5182 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5184 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5188 install_prog="$install_prog$arg"
5190 # We need to accept at least all the BSD install flags.
5200 if test -n "$dest"; then
5201 files="$files $dest"
5219 # If the previous option needed an argument, then skip it.
5220 if test -n "$prev"; then
5229 # Aesthetically quote the argument.
5230 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5232 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5236 install_prog="$install_prog $arg"
5239 if test -z "$install_prog"; then
5240 $echo "$modename: you must specify an install program" 1>&2
5245 if test -n "$prev"; then
5246 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5251 if test -z "$files"; then
5252 if test -z "$dest"; then
5253 $echo "$modename: no file or destination specified" 1>&2
5255 $echo "$modename: you must specify a destination" 1>&2
5261 # Strip any trailing slash from the destination.
5262 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5264 # Check to see that the destination is a directory.
5265 test -d "$dest" && isdir=yes
5266 if test "$isdir" = yes; then
5270 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5271 test "X$destdir" = "X$dest" && destdir=.
5272 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5274 # Not a directory, so check to see that there is only one file specified.
5276 if test "$#" -gt 2; then
5277 $echo "$modename: \`$dest' is not a directory" 1>&2
5283 [\\/]* | [A-Za-z]:[\\/]*) ;;
5285 for file in $files; do
5289 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5298 # This variable tells wrapper scripts just to set variables rather
5299 # than running their programs.
5300 libtool_install_magic="$magic"
5305 for file in $files; do
5307 # Do each installation.
5310 # Do the static libraries later.
5311 staticlibs="$staticlibs $file"
5315 # Check to see that this really is a libtool archive.
5316 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5318 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5326 # If there is no directory component, then add one.
5328 */* | *\\*) . $file ;;
5332 # Add the libdir to current_libdirs if it is the destination.
5333 if test "X$destdir" = "X$libdir"; then
5334 case "$current_libdirs " in
5336 *) current_libdirs="$current_libdirs $libdir" ;;
5339 # Note the libdir as a future libdir.
5340 case "$future_libdirs " in
5342 *) future_libdirs="$future_libdirs $libdir" ;;
5346 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5347 test "X$dir" = "X$file/" && dir=
5350 if test -n "$relink_command"; then
5351 # Determine the prefix the user has applied to our future dir.
5352 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5354 # Don't allow the user to place us outside of our expected
5355 # location b/c this prevents finding dependent libraries that
5356 # are installed to the same prefix.
5357 # At present, this check doesn't affect windows .dll's that
5358 # are installed into $libdir/../bin (currently, that works fine)
5359 # but it's something to keep an eye on.
5360 if test "$inst_prefix_dir" = "$destdir"; then
5361 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5365 if test -n "$inst_prefix_dir"; then
5366 # Stick the inst_prefix_dir data into the link command.
5367 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5369 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5372 $echo "$modename: warning: relinking \`$file'" 1>&2
5373 $show "$relink_command"
5374 if $run eval "$relink_command"; then :
5376 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5381 # See the names of the shared library.
5382 set dummy $library_names
5383 if test -n "$2"; then
5389 test -n "$relink_command" && srcname="$realname"T
5391 # Install the shared library and build the symlinks.
5392 $show "$install_prog $dir/$srcname $destdir/$realname"
5393 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5394 if test -n "$stripme" && test -n "$striplib"; then
5395 $show "$striplib $destdir/$realname"
5396 $run eval "$striplib $destdir/$realname" || exit $?
5399 if test "$#" -gt 0; then
5400 # Delete the old symlinks, and create new ones.
5403 if test "$linkname" != "$realname"; then
5404 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5405 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5410 # Do each command in the postinstall commands.
5411 lib="$destdir/$realname"
5412 eval cmds=\"$postinstall_cmds\"
5413 save_ifs="$IFS"; IFS='~'
5414 for cmd in $cmds; do
5417 $run eval "$cmd" || exit $?
5422 # Install the pseudo-library for information purposes.
5423 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5424 instname="$dir/$name"i
5425 $show "$install_prog $instname $destdir/$name"
5426 $run eval "$install_prog $instname $destdir/$name" || exit $?
5428 # Maybe install the static library, too.
5429 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5433 # Install (i.e. copy) a libtool object.
5435 # Figure out destination file name, if it wasn't already specified.
5436 if test -n "$destname"; then
5437 destfile="$destdir/$destname"
5439 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5440 destfile="$destdir/$destfile"
5443 # Deduce the name of the destination old-style object file.
5446 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5449 staticdest="$destfile"
5453 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5459 # Install the libtool object if requested.
5460 if test -n "$destfile"; then
5461 $show "$install_prog $file $destfile"
5462 $run eval "$install_prog $file $destfile" || exit $?
5465 # Install the old object if enabled.
5466 if test "$build_old_libs" = yes; then
5467 # Deduce the name of the old-style object file.
5468 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5470 $show "$install_prog $staticobj $staticdest"
5471 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5477 # Figure out destination file name, if it wasn't already specified.
5478 if test -n "$destname"; then
5479 destfile="$destdir/$destname"
5481 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5482 destfile="$destdir/$destfile"
5485 # If the file is missing, and there is a .exe on the end, strip it
5486 # because it is most likely a libtool script we actually want to
5491 if test ! -f "$file"; then
5492 file=`$echo $file|${SED} 's,.exe$,,'`
5498 # Do a test to see if this is really a libtool program.
5501 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5507 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5511 # To insure that "foo" is sourced, and not "foo.exe",
5512 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5513 # which disallows the automatic-append-.exe behavior.
5515 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5516 *) wrapperdot=${wrapper} ;;
5518 # If there is no directory component, then add one.
5520 */* | *\\*) . ${wrapperdot} ;;
5521 *) . ./${wrapperdot} ;;
5524 # Check the variables that should have been set.
5525 if test -z "$notinst_deplibs"; then
5526 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5531 for lib in $notinst_deplibs; do
5532 # Check to see that each library is installed.
5534 if test -f "$lib"; then
5535 # If there is no directory component, then add one.
5537 */* | *\\*) . $lib ;;
5541 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5542 if test -n "$libdir" && test ! -f "$libfile"; then
5543 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5549 # To insure that "foo" is sourced, and not "foo.exe",
5550 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5551 # which disallows the automatic-append-.exe behavior.
5553 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5554 *) wrapperdot=${wrapper} ;;
5556 # If there is no directory component, then add one.
5558 */* | *\\*) . ${wrapperdot} ;;
5559 *) . ./${wrapperdot} ;;
5563 if test "$fast_install" = no && test -n "$relink_command"; then
5564 if test "$finalize" = yes && test -z "$run"; then
5566 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5567 tmpdir="$tmpdir/libtool-$$"
5568 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5570 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5573 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5574 outputname="$tmpdir/$file"
5575 # Replace the output file specification.
5576 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5578 $show "$relink_command"
5579 if $run eval "$relink_command"; then :
5581 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5587 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5590 # Install the binary that we compiled earlier.
5591 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5595 # remove .exe since cygwin /usr/bin/install will append another
5597 case $install_prog,$host in
5598 */usr/bin/install*,*cygwin*)
5599 case $file:$destfile in
5604 destfile=$destfile.exe
5607 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5612 $show "$install_prog$stripme $file $destfile"
5613 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5614 test -n "$outputname" && ${rm}r "$tmpdir"
5619 for file in $staticlibs; do
5620 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5622 # Set up the ranlib parameters.
5623 oldlib="$destdir/$name"
5625 $show "$install_prog $file $oldlib"
5626 $run eval "$install_prog \$file \$oldlib" || exit $?
5628 if test -n "$stripme" && test -n "$striplib"; then
5629 $show "$old_striplib $oldlib"
5630 $run eval "$old_striplib $oldlib" || exit $?
5633 # Do each command in the postinstall commands.
5634 eval cmds=\"$old_postinstall_cmds\"
5635 save_ifs="$IFS"; IFS='~'
5636 for cmd in $cmds; do
5639 $run eval "$cmd" || exit $?
5644 if test -n "$future_libdirs"; then
5645 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5648 if test -n "$current_libdirs"; then
5649 # Maybe just do a dry run.
5650 test -n "$run" && current_libdirs=" -n$current_libdirs"
5651 exec_cmd='$SHELL $0 --finish$current_libdirs'
5657 # libtool finish mode
5659 modename="$modename: finish"
5663 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5666 libdirs="$libdirs $dir"
5669 for libdir in $libdirs; do
5670 if test -n "$finish_cmds"; then
5671 # Do each command in the finish commands.
5672 eval cmds=\"$finish_cmds\"
5673 save_ifs="$IFS"; IFS='~'
5674 for cmd in $cmds; do
5677 $run eval "$cmd" || admincmds="$admincmds
5682 if test -n "$finish_eval"; then
5683 # Do the single finish_eval.
5684 eval cmds=\"$finish_eval\"
5685 $run eval "$cmds" || admincmds="$admincmds
5691 # Exit here if they wanted silent mode.
5693 #test "$show" = : && exit 0
5695 $echo "----------------------------------------------------------------------"
5696 $echo "Libraries have been installed in:"
5697 for libdir in $libdirs; do
5701 $echo "If you ever happen to want to link against installed libraries"
5702 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5703 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5704 $echo "flag during linking and do at least one of the following:"
5705 if test -n "$shlibpath_var"; then
5706 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5707 $echo " during execution"
5709 if test -n "$runpath_var"; then
5710 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5711 $echo " during linking"
5713 if test -n "$hardcode_libdir_flag_spec"; then
5715 eval flag=\"$hardcode_libdir_flag_spec\"
5717 $echo " - use the \`$flag' linker flag"
5719 if test -n "$admincmds"; then
5720 $echo " - have your system administrator run these commands:$admincmds"
5722 if test -f /etc/ld.so.conf; then
5723 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5726 $echo "See any operating system documentation about shared libraries for"
5727 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5728 $echo "----------------------------------------------------------------------"
5732 # libtool execute mode
5734 modename="$modename: execute"
5736 # The first argument is the command name.
5738 if test -z "$cmd"; then
5739 $echo "$modename: you must specify a COMMAND" 1>&2
5744 # Handle -dlopen flags immediately.
5745 for file in $execute_dlfiles; do
5746 if test ! -f "$file"; then
5747 $echo "$modename: \`$file' is not a file" 1>&2
5755 # Check to see that this really is a libtool archive.
5756 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5758 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5763 # Read the libtool library.
5767 # If there is no directory component, then add one.
5769 */* | *\\*) . $file ;;
5773 # Skip this library if it cannot be dlopened.
5774 if test -z "$dlname"; then
5775 # Warn if it was a shared library.
5776 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5780 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5781 test "X$dir" = "X$file" && dir=.
5783 if test -f "$dir/$objdir/$dlname"; then
5786 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5792 # Just add the directory containing the .lo file.
5793 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5794 test "X$dir" = "X$file" && dir=.
5798 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5803 # Get the absolute pathname.
5804 absdir=`cd "$dir" && pwd`
5805 test -n "$absdir" && dir="$absdir"
5807 # Now add the directory to shlibpath_var.
5808 if eval "test -z \"\$$shlibpath_var\""; then
5809 eval "$shlibpath_var=\"\$dir\""
5811 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5815 # This variable tells wrapper scripts just to set shlibpath_var
5816 # rather than running their programs.
5817 libtool_execute_magic="$magic"
5819 # Check if any of the arguments is a wrapper script.
5826 # Do a test to see if this is really a libtool program.
5827 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5828 # If there is no directory component, then add one.
5830 */* | *\\*) . $file ;;
5834 # Transform arg to wrapped name.
5835 file="$progdir/$program"
5839 # Quote arguments (to preserve shell metacharacters).
5840 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5841 args="$args \"$file\""
5844 if test -z "$run"; then
5845 if test -n "$shlibpath_var"; then
5846 # Export the shlibpath_var.
5847 eval "export $shlibpath_var"
5850 # Restore saved environment variables
5851 if test "${save_LC_ALL+set}" = set; then
5852 LC_ALL="$save_LC_ALL"; export LC_ALL
5854 if test "${save_LANG+set}" = set; then
5855 LANG="$save_LANG"; export LANG
5858 # Now prepare to actually exec the command.
5859 exec_cmd="\$cmd$args"
5861 # Display what would be done.
5862 if test -n "$shlibpath_var"; then
5863 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5864 $echo "export $shlibpath_var"
5871 # libtool clean and uninstall mode
5873 modename="$modename: $mode"
5879 # This variable tells wrapper scripts just to set variables rather
5880 # than running their programs.
5881 libtool_install_magic="$magic"
5886 -f) rm="$rm $arg"; rmforce=yes ;;
5887 -*) rm="$rm $arg" ;;
5888 *) files="$files $arg" ;;
5892 if test -z "$rm"; then
5893 $echo "$modename: you must specify an RM program" 1>&2
5900 origobjdir="$objdir"
5901 for file in $files; do
5902 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5903 if test "X$dir" = "X$file"; then
5905 objdir="$origobjdir"
5907 objdir="$dir/$origobjdir"
5909 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5910 test "$mode" = uninstall && objdir="$dir"
5912 # Remember objdir for removal later, being careful to avoid duplicates
5913 if test "$mode" = clean; then
5916 *) rmdirs="$rmdirs $objdir" ;;
5920 # Don't error if the file doesn't exist and rm -f was used.
5921 if (test -L "$file") >/dev/null 2>&1 \
5922 || (test -h "$file") >/dev/null 2>&1 \
5923 || test -f "$file"; then
5925 elif test -d "$file"; then
5928 elif test "$rmforce" = yes; then
5936 # Possibly a libtool archive, so verify it.
5937 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5940 # Delete the libtool libraries and symlinks.
5941 for n in $library_names; do
5942 rmfiles="$rmfiles $objdir/$n"
5944 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5945 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5947 if test "$mode" = uninstall; then
5948 if test -n "$library_names"; then
5949 # Do each command in the postuninstall commands.
5950 eval cmds=\"$postuninstall_cmds\"
5951 save_ifs="$IFS"; IFS='~'
5952 for cmd in $cmds; do
5956 if test "$?" -ne 0 && test "$rmforce" != yes; then
5963 if test -n "$old_library"; then
5964 # Do each command in the old_postuninstall commands.
5965 eval cmds=\"$old_postuninstall_cmds\"
5966 save_ifs="$IFS"; IFS='~'
5967 for cmd in $cmds; do
5971 if test "$?" -ne 0 && test "$rmforce" != yes; then
5977 # FIXME: should reinstall the best remaining shared library.
5983 # Possibly a libtool object, so verify it.
5984 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5989 # Add PIC object to the list of files to remove.
5990 if test -n "$pic_object" \
5991 && test "$pic_object" != none; then
5992 rmfiles="$rmfiles $dir/$pic_object"
5995 # Add non-PIC object to the list of files to remove.
5996 if test -n "$non_pic_object" \
5997 && test "$non_pic_object" != none; then
5998 rmfiles="$rmfiles $dir/$non_pic_object"
6004 if test "$mode" = clean ; then
6008 file=`$echo $file|${SED} 's,.exe$,,'`
6009 noexename=`$echo $name|${SED} 's,.exe$,,'`
6010 # $file with .exe has already been added to rmfiles,
6011 # add $file without .exe
6012 rmfiles="$rmfiles $file"
6015 # Do a test to see if this is a libtool program.
6016 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6020 # note $name still contains .exe if it was in $file originally
6021 # as does the version of $file that was added into $rmfiles
6022 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6023 if test "$fast_install" = yes && test -n "$relink_command"; then
6024 rmfiles="$rmfiles $objdir/lt-$name"
6026 if test "X$noexename" != "X$name" ; then
6027 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6033 $show "$rm $rmfiles"
6034 $run $rm $rmfiles || exit_status=1
6036 objdir="$origobjdir"
6038 # Try to remove the ${objdir}s in the directories where we deleted files
6039 for dir in $rmdirs; do
6040 if test -d "$dir"; then
6042 $run rmdir $dir >/dev/null 2>&1
6050 $echo "$modename: you must specify a MODE" 1>&2
6051 $echo "$generic_help" 1>&2
6056 if test -z "$exec_cmd"; then
6057 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6058 $echo "$generic_help" 1>&2
6061 fi # test -z "$show_help"
6063 if test -n "$exec_cmd"; then
6068 # We need to display help for each of the modes.
6071 "Usage: $modename [OPTION]... [MODE-ARG]...
6073 Provide generalized library-building support services.
6075 --config show all configuration variables
6076 --debug enable verbose shell tracing
6077 -n, --dry-run display commands without modifying any files
6078 --features display basic configuration information and exit
6079 --finish same as \`--mode=finish'
6080 --help display this help message and exit
6081 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6082 --quiet same as \`--silent'
6083 --silent don't print informational messages
6084 --tag=TAG use configuration variables from tag TAG
6085 --version print version information
6087 MODE must be one of the following:
6089 clean remove files from the build directory
6090 compile compile a source file into a libtool object
6091 execute automatically set library path, then run a program
6092 finish complete the installation of libtool libraries
6093 install install libraries or executables
6094 link create a library or an executable
6095 uninstall remove libraries from an installed directory
6097 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6098 a more detailed description of MODE.
6100 Report bugs to <bug-libtool@gnu.org>."
6106 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6108 Remove files from the build directory.
6110 RM is the name of the program to use to delete files associated with each FILE
6111 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6114 If FILE is a libtool library, object or program, all the files associated
6115 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6120 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6122 Compile a source file into a libtool library object.
6124 This mode accepts the following additional options:
6126 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6127 -prefer-pic try to building PIC objects only
6128 -prefer-non-pic try to building non-PIC objects only
6129 -static always build a \`.o' file suitable for static linking
6131 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6132 from the given SOURCEFILE.
6134 The output file name is determined by removing the directory component from
6135 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6136 library object suffix, \`.lo'."
6141 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6143 Automatically set library path, then run a program.
6145 This mode accepts the following additional options:
6147 -dlopen FILE add the directory containing FILE to the library path
6149 This mode sets the library path environment variable according to \`-dlopen'
6152 If any of the ARGS are libtool executable wrappers, then they are translated
6153 into their corresponding uninstalled binary, and any of their required library
6154 directories are added to the library path.
6156 Then, COMMAND is executed, with ARGS as arguments."
6161 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6163 Complete the installation of libtool libraries.
6165 Each LIBDIR is a directory that contains libtool libraries.
6167 The commands that this mode executes may require superuser privileges. Use
6168 the \`--dry-run' option if you just want to see what would be executed."
6173 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6175 Install executables or libraries.
6177 INSTALL-COMMAND is the installation command. The first component should be
6178 either the \`install' or \`cp' program.
6180 The rest of the components are interpreted as arguments to that command (only
6181 BSD-compatible install options are recognized)."
6186 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6188 Link object files or libraries together to form another library, or to
6189 create an executable program.
6191 LINK-COMMAND is a command using the C compiler that you would use to create
6192 a program from several object files.
6194 The following components of LINK-COMMAND are treated specially:
6196 -all-static do not do any dynamic linking at all
6197 -avoid-version do not add a version suffix if possible
6198 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6199 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6200 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6201 -export-symbols SYMFILE
6202 try to export only the symbols listed in SYMFILE
6203 -export-symbols-regex REGEX
6204 try to export only the symbols matching REGEX
6205 -LLIBDIR search LIBDIR for required installed libraries
6206 -lNAME OUTPUT-FILE requires the installed library libNAME
6207 -module build a library that can dlopened
6208 -no-fast-install disable the fast-install mode
6209 -no-install link a not-installable executable
6210 -no-undefined declare that a library does not refer to external symbols
6211 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6212 -objectlist FILE Use a list of object files found in FILE to specify objects
6213 -release RELEASE specify package release information
6214 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6215 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6216 -static do not do any dynamic linking of libtool libraries
6217 -version-info CURRENT[:REVISION[:AGE]]
6218 specify library version info [each variable defaults to 0]
6220 All other options (arguments beginning with \`-') are ignored.
6222 Every other argument is treated as a filename. Files ending in \`.la' are
6223 treated as uninstalled libtool libraries, other files are standard or library
6226 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6227 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6228 required, except when creating a convenience library.
6230 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6231 using \`ar' and \`ranlib', or on Windows using \`lib'.
6233 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6234 is created, otherwise an executable program is created."
6239 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6241 Remove libraries from an installation directory.
6243 RM is the name of the program to use to delete files associated with each FILE
6244 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6247 If FILE is a libtool library, all the files associated with it are deleted.
6248 Otherwise, only FILE itself is deleted using RM."
6252 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6259 $echo "Try \`$modename --help' for more information about other modes."
6263 # The TAGs below are defined such that we never get into a situation
6264 # in which we disable both kinds of libraries. Given conflicting
6265 # choices, we go for a static library, that is the most portable,
6266 # since we can't tell whether shared libraries were disabled because
6267 # the user asked for that or because the platform doesn't support
6268 # them. This is particularly important on AIX, because we don't
6269 # support having both static and shared libraries enabled at the same
6270 # time on that platform, so we default to a shared-only configuration.
6271 # If a disable-shared tag is given, we'll fallback to a static-only
6272 # configuration. But we'll never go from static-only to shared-only.
6274 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6275 build_libtool_libs=no
6277 # ### END LIBTOOL TAG CONFIG: disable-shared
6279 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6280 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6281 # ### END LIBTOOL TAG CONFIG: disable-static