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.2.1 2003/04/14 22:48:00)"
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"
1155 *" $qarg.framework "*) ;;
1156 *) deplibs="$deplibs $qarg.framework" # this is fixed later
1165 eval "$prev=\"\$arg\""
1170 fi # test -n "$prev"
1176 if test -n "$link_static_flag"; then
1177 compile_command="$compile_command $link_static_flag"
1178 finalize_command="$finalize_command $link_static_flag"
1184 # FIXME: remove this flag sometime in the future.
1185 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1209 -export-symbols | -export-symbols-regex)
1210 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1211 $echo "$modename: more than one -exported-symbols argument is not allowed"
1214 if test "X$arg" = "X-export-symbols"; then
1227 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1228 # so, if we see these flags be careful not to treat them like -L
1230 case $with_gcc/$host in
1231 no/*-*-irix* | /*-*-irix*)
1232 compile_command="$compile_command $arg"
1233 finalize_command="$finalize_command $arg"
1240 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1241 # We need an absolute path.
1243 [\\/]* | [A-Za-z]:[\\/]*) ;;
1245 absdir=`cd "$dir" && pwd`
1246 if test -z "$absdir"; then
1247 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1256 deplibs="$deplibs -L$dir"
1257 lib_search_path="$lib_search_path $dir"
1261 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1262 case :$dllsearchpath: in
1264 *) dllsearchpath="$dllsearchpath:$dir";;
1272 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1274 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1275 # These systems don't actually have a C or math library (as such)
1278 *-*-mingw* | *-*-os2*)
1279 # These systems don't actually have a C library (as such)
1280 test "X$arg" = "X-lc" && continue
1282 *-*-openbsd* | *-*-freebsd*)
1283 # Do not include libc due to us having libc/libc_r.
1284 test "X$arg" = "X-lc" && continue
1286 *-*-rhapsody* | *-*-darwin1.[012])
1287 # Rhapsody C and math libraries are in the System framework
1288 deplibs="$deplibs -framework System"
1291 elif test "X$arg" = "X-lc_r"; then
1293 *-*-openbsd* | *-*-freebsd*)
1294 # Do not include libc_r directly, use -pthread flag.
1299 deplibs="$deplibs $arg"
1308 # gcc -m* arguments should be passed to the linker via $compiler_flags
1309 # in order to pass architecture information to the linker
1310 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1311 # but this is not reliable with gcc because gcc may use -mfoo to
1312 # select a different linker, different libraries, etc, while
1313 # -Wl,-mfoo simply passes -mfoo to the linker.
1315 # Unknown arguments in both finalize_command and compile_command need
1316 # to be aesthetically quoted because they are evaled later.
1317 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1319 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1323 compile_command="$compile_command $arg"
1324 finalize_command="$finalize_command $arg"
1325 if test "$with_gcc" = "yes" ; then
1326 compiler_flags="$compiler_flags $arg"
1343 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1344 # The PATH hackery in wrapper scripts is required on Windows
1345 # in order for the loader to find any dlls it needs.
1346 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1347 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1350 *) no_install=yes ;;
1383 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1384 # We need an absolute path.
1386 [\\/]* | [A-Za-z]:[\\/]*) ;;
1388 $echo "$modename: only absolute run-paths are allowed" 1>&2
1394 *) xrpath="$xrpath $dir" ;;
1400 # The effects of -static are defined in a previous loop.
1401 # We used to do the same as -all-static on platforms that
1402 # didn't have a PIC flag, but the assumption that the effects
1403 # would be equivalent was wrong. It would break on at least
1404 # Digital Unix and AIX.
1424 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1426 save_ifs="$IFS"; IFS=','
1427 for flag in $args; do
1430 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1435 compiler_flags="$compiler_flags $flag"
1438 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1442 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1444 save_ifs="$IFS"; IFS=','
1445 for flag in $args; do
1448 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1453 compiler_flags="$compiler_flags $wl$flag"
1454 linker_flags="$linker_flags $flag"
1457 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1480 # Some other compiler flag.
1482 # Unknown arguments in both finalize_command and compile_command need
1483 # to be aesthetically quoted because they are evaled later.
1484 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1486 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1493 # A standard object.
1498 # A libtool-controlled object.
1500 # Check to see that this really is a libtool object.
1501 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1506 # If there is no directory component, then add one.
1508 */* | *\\*) . $arg ;;
1512 if test -z "$pic_object" || \
1513 test -z "$non_pic_object" ||
1514 test "$pic_object" = none && \
1515 test "$non_pic_object" = none; then
1516 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1520 # Extract subdirectory from the argument.
1521 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1522 if test "X$xdir" = "X$arg"; then
1528 if test "$pic_object" != none; then
1529 # Prepend the subdirectory the object is found in.
1530 pic_object="$xdir$pic_object"
1532 if test "$prev" = dlfiles; then
1533 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1534 dlfiles="$dlfiles $pic_object"
1538 # If libtool objects are unsupported, then we need to preload.
1543 # CHECK ME: I think I busted this. -Ossama
1544 if test "$prev" = dlprefiles; then
1545 # Preload the old-style object.
1546 dlprefiles="$dlprefiles $pic_object"
1551 libobjs="$libobjs $pic_object"
1556 if test "$non_pic_object" != none; then
1557 # Prepend the subdirectory the object is found in.
1558 non_pic_object="$xdir$non_pic_object"
1560 # A standard non-PIC object
1561 non_pic_objects="$non_pic_objects $non_pic_object"
1562 if test -z "$pic_object" || test "$pic_object" = none ; then
1563 arg="$non_pic_object"
1567 # Only an error if not doing a dry-run.
1568 if test -z "$run"; then
1569 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1574 # Extract subdirectory from the argument.
1575 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1576 if test "X$xdir" = "X$arg"; then
1582 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1583 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1584 libobjs="$libobjs $pic_object"
1585 non_pic_objects="$non_pic_objects $non_pic_object"
1592 deplibs="$deplibs $arg"
1593 old_deplibs="$old_deplibs $arg"
1598 # A libtool-controlled library.
1600 if test "$prev" = dlfiles; then
1601 # This library was specified with -dlopen.
1602 dlfiles="$dlfiles $arg"
1604 elif test "$prev" = dlprefiles; then
1605 # The library was specified with -dlpreopen.
1606 dlprefiles="$dlprefiles $arg"
1609 deplibs="$deplibs $arg"
1614 # Some other compiler argument.
1616 # Unknown arguments in both finalize_command and compile_command need
1617 # to be aesthetically quoted because they are evaled later.
1618 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1620 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1627 # Now actually substitute the argument into the commands.
1628 if test -n "$arg"; then
1629 compile_command="$compile_command $arg"
1630 finalize_command="$finalize_command $arg"
1632 done # argument parsing loop
1634 if test -n "$prev"; then
1635 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1640 # Infer tagged configuration to use if any are available and
1641 # if one wasn't chosen via the "--tag" command line option.
1642 # Only attempt this if the compiler in the base link
1643 # command doesn't match the default compiler.
1644 if test -n "$available_tags" && test -z "$tagname"; then
1645 case $base_compile in
1646 # Blanks in the command may have been stripped by the calling shell,
1647 # but not from the CC environment variable when configure was run.
1648 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1649 # Blanks at the start of $base_compile will cause this to fail
1650 # if we don't check for them as well.
1652 for z in $available_tags; do
1653 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1654 # Evaluate the configuration.
1655 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1656 case $base_compile in
1657 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1658 # The compiler in $compile_command matches
1659 # the one in the tagged configuration.
1660 # Assume this is the tagged configuration we want.
1667 # If $tagname still isn't set, then no tagged configuration
1668 # was found and let the user know that the "--tag" command
1669 # line option must be used.
1670 if test -z "$tagname"; then
1671 $echo "$modename: unable to infer tagged configuration"
1672 $echo "$modename: specify a tag with \`--tag'" 1>&2
1675 # $echo "$modename: using $tagname tagged configuration"
1681 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1682 eval arg=\"$export_dynamic_flag_spec\"
1683 compile_command="$compile_command $arg"
1684 finalize_command="$finalize_command $arg"
1688 # calculate the name of the file, without its directory
1689 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1690 libobjs_save="$libobjs"
1692 if test -n "$shlibpath_var"; then
1693 # get the directories listed in $shlibpath_var
1694 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1698 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1699 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1701 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1702 if test "X$output_objdir" = "X$output"; then
1703 output_objdir="$objdir"
1705 output_objdir="$output_objdir/$objdir"
1707 # Create the object directory.
1708 if test ! -d "$output_objdir"; then
1709 $show "$mkdir $output_objdir"
1710 $run $mkdir $output_objdir
1712 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1717 # Determine the type of output
1720 $echo "$modename: you must specify an output file" 1>&2
1724 *.$libext) linkmode=oldlib ;;
1725 *.lo | *.$objext) linkmode=obj ;;
1726 *.la) linkmode=lib ;;
1727 *) linkmode=prog ;; # Anything else should be a program.
1731 *cygwin* | *mingw* | *pw32*)
1732 # don't eliminate duplcations in $postdeps and $predeps
1733 duplicate_compiler_generated_deps=yes
1736 duplicate_compiler_generated_deps=$duplicate_deps
1742 # Find all interdependent deplibs by searching for libraries
1743 # that are linked more than once (e.g. -la -lb -la)
1744 for deplib in $deplibs; do
1745 if test "X$duplicate_deps" = "Xyes" ; then
1747 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1750 libs="$libs $deplib"
1753 if test "$linkmode" = lib; then
1754 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1756 # Compute libraries that are listed more than once in $predeps
1757 # $postdeps and mark them as special (i.e., whose duplicates are
1758 # not to be eliminated).
1760 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1761 for pre_post_dep in $predeps $postdeps; do
1762 case "$pre_post_deps " in
1763 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1765 pre_post_deps="$pre_post_deps $pre_post_dep"
1774 need_relink=no # whether we're linking any uninstalled libtool libraries
1775 notinst_deplibs= # not-installed libtool libraries
1776 notinst_path= # paths that contain not-installed libtool libraries
1780 for file in $dlfiles $dlprefiles; do
1784 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1796 passes="conv scan dlopen dlpreopen link"
1801 for pass in $passes; do
1802 if test "$linkmode,$pass" = "lib,link" ||
1803 test "$linkmode,$pass" = "prog,scan"; then
1807 if test "$linkmode" = prog; then
1809 dlopen) libs="$dlfiles" ;;
1810 dlpreopen) libs="$dlprefiles" ;;
1811 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1814 if test "$pass" = dlopen; then
1815 # Collect dlpreopened libraries
1816 save_deplibs="$deplibs"
1819 for deplib in $libs; do
1824 if test "$linkmode" != lib && test "$linkmode" != prog; then
1825 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1828 if test "$pass" = conv; then
1829 deplibs="$deplib $deplibs"
1832 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1833 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1834 # Search the libtool library
1835 lib="$searchdir/lib${name}.la"
1836 if test -f "$lib"; then
1841 if test "$found" != yes; then
1842 # deplib doesn't seem to be a libtool library
1843 if test "$linkmode,$pass" = "prog,link"; then
1844 compile_deplibs="$deplib $compile_deplibs"
1845 finalize_deplibs="$deplib $finalize_deplibs"
1847 deplibs="$deplib $deplibs"
1848 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1851 else # deplib is a libtool library
1852 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1853 # We need to do some special things here, and not later.
1854 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1855 case " $predeps $postdeps " in
1857 if (${SED} -e '2q' $lib |
1858 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1862 */* | *\\*) . $lib ;;
1865 for l in $old_library $library_names; do
1868 if test "X$ll" = "X$old_library" ; then # only static version available
1870 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1871 test "X$ladir" = "X$lib" && ladir="."
1872 lib=$ladir/$old_library
1873 if test "$linkmode,$pass" = "prog,link"; then
1874 compile_deplibs="$deplib $compile_deplibs"
1875 finalize_deplibs="$deplib $finalize_deplibs"
1877 deplibs="$deplib $deplibs"
1878 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1890 if test "$linkmode,$pass" = "prog,link"; then
1891 compile_deplibs="$deplib $compile_deplibs"
1892 finalize_deplibs="$deplib $finalize_deplibs"
1894 deplibs="$deplib $deplibs"
1895 if test "$linkmode" = lib ; then
1896 newdependency_libs="$deplib $newdependency_libs"
1904 deplibs="$deplib $deplibs"
1905 test "$pass" = conv && continue
1906 newdependency_libs="$deplib $newdependency_libs"
1907 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1910 if test "$pass" = conv; then
1911 deplibs="$deplib $deplibs"
1914 if test "$pass" = scan; then
1915 deplibs="$deplib $deplibs"
1916 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1918 compile_deplibs="$deplib $compile_deplibs"
1919 finalize_deplibs="$deplib $finalize_deplibs"
1923 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1929 if test "$pass" = link; then
1930 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1931 # Make sure the xrpath contains only unique directories.
1934 *) xrpath="$xrpath $dir" ;;
1937 deplibs="$deplib $deplibs"
1940 *.la) lib="$deplib" ;;
1942 if test "$pass" = conv; then
1943 deplibs="$deplib $deplibs"
1948 if test "$deplibs_check_method" != pass_all; then
1950 $echo "*** Warning: Trying to link with static lib archive $deplib."
1951 $echo "*** I have the capability to make that library automatically link in when"
1952 $echo "*** you link to this library. But I can only do this if you have a"
1953 $echo "*** shared version of the library, which you do not appear to have"
1954 $echo "*** because the file extensions .$libext of this argument makes me believe"
1955 $echo "*** that it is just a static archive that I should not used here."
1958 $echo "*** Warning: Linking the shared library $output against the"
1959 $echo "*** static library $deplib is not portable!"
1960 deplibs="$deplib $deplibs"
1965 if test "$pass" != link; then
1966 deplibs="$deplib $deplibs"
1968 compile_deplibs="$deplib $compile_deplibs"
1969 finalize_deplibs="$deplib $finalize_deplibs"
1976 if test "$pass" = conv; then
1977 deplibs="$deplib $deplibs"
1978 elif test "$linkmode" = prog; then
1979 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1980 # If there is no dlopen support or we're linking statically,
1981 # we need to preload.
1982 newdlprefiles="$newdlprefiles $deplib"
1983 compile_deplibs="$deplib $compile_deplibs"
1984 finalize_deplibs="$deplib $finalize_deplibs"
1986 newdlfiles="$newdlfiles $deplib"
1996 if test "$found" = yes || test -f "$lib"; then :
1998 $echo "$modename: cannot find the library \`$lib'" 1>&2
2002 # Check to see that this really is a libtool archive.
2003 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2005 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2009 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2010 test "X$ladir" = "X$lib" && ladir="."
2018 # If the library was installed with an old release of libtool,
2019 # it will not redefine variables installed, or shouldnotlink
2025 */* | *\\*) . $lib ;;
2031 # Convert "-framework foo" to "foo.framework" in dependency_libs
2032 test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
2036 if test "$linkmode,$pass" = "lib,link" ||
2037 test "$linkmode,$pass" = "prog,scan" ||
2038 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2039 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2040 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2043 if test "$pass" = conv; then
2044 # Only check for convenience libraries
2045 deplibs="$lib $deplibs"
2046 if test -z "$libdir"; then
2047 if test -z "$old_library"; then
2048 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2051 # It is a libtool convenience library, so add in its objects.
2052 convenience="$convenience $ladir/$objdir/$old_library"
2053 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2055 for deplib in $dependency_libs; do
2056 deplibs="$deplib $deplibs"
2057 if test "X$duplicate_deps" = "Xyes" ; then
2058 case "$tmp_libs " in
2059 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2062 tmp_libs="$tmp_libs $deplib"
2064 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2065 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2072 # Get the name of the library we link against.
2074 for l in $old_library $library_names; do
2077 if test -z "$linklib"; then
2078 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2082 # This library was specified with -dlopen.
2083 if test "$pass" = dlopen; then
2084 if test -z "$libdir"; then
2085 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2088 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2089 # If there is no dlname, no dlopen support or we're linking
2090 # statically, we need to preload. We also need to preload any
2091 # dependent libraries so libltdl's deplib preloader doesn't
2092 # bomb out in the load deplibs phase.
2093 dlprefiles="$dlprefiles $lib $dependency_libs"
2095 newdlfiles="$newdlfiles $lib"
2100 # We need an absolute path.
2102 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2104 abs_ladir=`cd "$ladir" && pwd`
2105 if test -z "$abs_ladir"; then
2106 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2107 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2112 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2114 # Find the relevant object directory and library name.
2115 if test "X$installed" = Xyes; then
2116 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2117 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2126 dir="$ladir/$objdir"
2127 absdir="$abs_ladir/$objdir"
2128 # Remove this search path later
2129 notinst_path="$notinst_path $abs_ladir"
2130 fi # $installed = yes
2131 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2133 # This library was specified with -dlpreopen.
2134 if test "$pass" = dlpreopen; then
2135 if test -z "$libdir"; then
2136 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2139 # Prefer using a static library (so that no silly _DYNAMIC symbols
2140 # are required to link).
2141 if test -n "$old_library"; then
2142 newdlprefiles="$newdlprefiles $dir/$old_library"
2143 # Otherwise, use the dlname, so that lt_dlopen finds it.
2144 elif test -n "$dlname"; then
2145 newdlprefiles="$newdlprefiles $dir/$dlname"
2147 newdlprefiles="$newdlprefiles $dir/$linklib"
2149 fi # $pass = dlpreopen
2151 if test -z "$libdir"; then
2152 # Link the convenience library
2153 if test "$linkmode" = lib; then
2154 deplibs="$dir/$old_library $deplibs"
2155 elif test "$linkmode,$pass" = "prog,link"; then
2156 compile_deplibs="$dir/$old_library $compile_deplibs"
2157 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2159 deplibs="$lib $deplibs" # used for prog,scan pass
2165 if test "$linkmode" = prog && test "$pass" != link; then
2166 newlib_search_path="$newlib_search_path $ladir"
2167 deplibs="$lib $deplibs"
2170 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2171 test "$build_libtool_libs" = no; then
2176 for deplib in $dependency_libs; do
2178 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2180 # Need to link against all dependency_libs?
2181 if test "$linkalldeplibs" = yes; then
2182 deplibs="$deplib $deplibs"
2184 # Need to hardcode shared library paths
2185 # or/and link against static libraries
2186 newdependency_libs="$deplib $newdependency_libs"
2188 if test "X$duplicate_deps" = "Xyes" ; then
2189 case "$tmp_libs " in
2190 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2193 tmp_libs="$tmp_libs $deplib"
2196 fi # $linkmode = prog...
2198 if test "$linkmode,$pass" = "prog,link"; then
2199 if test -n "$library_names" &&
2200 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2201 # We need to hardcode the library path
2202 if test -n "$shlibpath_var"; then
2203 # Make sure the rpath contains only unique directories.
2204 case "$temp_rpath " in
2207 *) temp_rpath="$temp_rpath $dir" ;;
2211 # Hardcode the library path.
2212 # Skip directories that are in the system default run-time
2214 case " $sys_lib_dlsearch_path " in
2217 case "$compile_rpath " in
2219 *) compile_rpath="$compile_rpath $absdir"
2223 case " $sys_lib_dlsearch_path " in
2226 case "$finalize_rpath " in
2228 *) finalize_rpath="$finalize_rpath $libdir"
2232 fi # $linkmode,$pass = prog,link...
2234 if test "$alldeplibs" = yes &&
2235 { test "$deplibs_check_method" = pass_all ||
2236 { test "$build_libtool_libs" = yes &&
2237 test -n "$library_names"; }; }; then
2238 # We only need to search for static libraries
2243 link_static=no # Whether the deplib will be linked statically
2244 if test -n "$library_names" &&
2245 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2246 if test "$installed" = no; then
2247 notinst_deplibs="$notinst_deplibs $lib"
2250 # This is a shared library
2252 # Warn about portability, can't link against -module's on some systems (darwin)
2253 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2255 if test "$linkmode" = prog; then
2256 $echo "*** Warning: Linking the executable $output against the loadable module"
2258 $echo "*** Warning: Linking the shared library $output against the loadable module"
2260 $echo "*** $linklib is not portable!"
2262 if test "$linkmode" = lib &&
2263 test "$hardcode_into_libs" = yes; then
2264 # Hardcode the library path.
2265 # Skip directories that are in the system default run-time
2267 case " $sys_lib_dlsearch_path " in
2270 case "$compile_rpath " in
2272 *) compile_rpath="$compile_rpath $absdir"
2276 case " $sys_lib_dlsearch_path " in
2279 case "$finalize_rpath " in
2281 *) finalize_rpath="$finalize_rpath $libdir"
2287 if test -n "$old_archive_from_expsyms_cmds"; then
2288 # figure out the soname
2289 set dummy $library_names
2292 libname=`eval \\$echo \"$libname_spec\"`
2293 # use dlname if we got it. it's perfectly good, no?
2294 if test -n "$dlname"; then
2296 elif test -n "$soname_spec"; then
2300 major=`expr $current - $age`
2304 eval soname=\"$soname_spec\"
2309 # Make a new name for the extract_expsyms_cmds to use
2311 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2312 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2314 # If the library has no export list, then create one now
2315 if test -f "$output_objdir/$soname-def"; then :
2317 $show "extracting exported symbol list from \`$soname'"
2318 save_ifs="$IFS"; IFS='~'
2319 eval cmds=\"$extract_expsyms_cmds\"
2320 for cmd in $cmds; do
2323 $run eval "$cmd" || exit $?
2329 if test -f "$output_objdir/$newlib"; then :; else
2330 $show "generating import library for \`$soname'"
2331 save_ifs="$IFS"; IFS='~'
2332 eval cmds=\"$old_archive_from_expsyms_cmds\"
2333 for cmd in $cmds; do
2336 $run eval "$cmd" || exit $?
2340 # make sure the library variables are pointing to the new library
2343 fi # test -n "$old_archive_from_expsyms_cmds"
2345 if test "$linkmode" = prog || test "$mode" != relink; then
2350 case $hardcode_action in
2351 immediate | unsupported)
2352 if test "$hardcode_direct" = no; then
2355 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2357 # if the lib is a module then we can not link against it, someone
2358 # is ignoring the new warnings I added
2359 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2360 $echo "** Warning, lib $linklib is a module, not a shared library"
2361 if test -z "$old_library" ; then
2363 $echo "** And there doesn't seem to be a static archive available"
2364 $echo "** The link will probably fail, sorry"
2366 add="$dir/$old_library"
2370 elif test "$hardcode_minus_L" = no; then
2372 *-*-sunos*) add_shlibpath="$dir" ;;
2376 elif test "$hardcode_shlibpath_var" = no; then
2377 add_shlibpath="$dir"
2384 if test "$hardcode_direct" = yes; then
2386 elif test "$hardcode_minus_L" = yes; then
2388 # Try looking first in the location we're being installed to.
2389 if test -n "$inst_prefix_dir"; then
2392 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2397 elif test "$hardcode_shlibpath_var" = yes; then
2398 add_shlibpath="$dir"
2407 if test "$lib_linked" != yes; then
2408 $echo "$modename: configuration error: unsupported hardcode properties"
2412 if test -n "$add_shlibpath"; then
2413 case :$compile_shlibpath: in
2414 *":$add_shlibpath:"*) ;;
2415 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2418 if test "$linkmode" = prog; then
2419 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2420 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2422 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2423 test -n "$add" && deplibs="$add $deplibs"
2424 if test "$hardcode_direct" != yes && \
2425 test "$hardcode_minus_L" != yes && \
2426 test "$hardcode_shlibpath_var" = yes; then
2427 case :$finalize_shlibpath: in
2429 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2435 if test "$linkmode" = prog || test "$mode" = relink; then
2439 # Finalize command for both is simple: just hardcode it.
2440 if test "$hardcode_direct" = yes; then
2441 add="$libdir/$linklib"
2442 elif test "$hardcode_minus_L" = yes; then
2445 elif test "$hardcode_shlibpath_var" = yes; then
2446 case :$finalize_shlibpath: in
2448 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2451 elif test "$hardcode_automatic" = yes; then
2452 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2453 add="$inst_prefix_dir$libdir/$linklib"
2455 add="$libdir/$linklib"
2458 # We cannot seem to hardcode it, guess we'll fake it.
2460 # Try looking first in the location we're being installed to.
2461 if test -n "$inst_prefix_dir"; then
2464 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2471 if test "$linkmode" = prog; then
2472 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2473 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2475 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2476 test -n "$add" && deplibs="$add $deplibs"
2479 elif test "$linkmode" = prog; then
2480 # Here we assume that one of hardcode_direct or hardcode_minus_L
2481 # is not unsupported. This is valid on all known static and
2483 if test "$hardcode_direct" != unsupported; then
2484 test -n "$old_library" && linklib="$old_library"
2485 compile_deplibs="$dir/$linklib $compile_deplibs"
2486 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2488 compile_deplibs="-l$name -L$dir $compile_deplibs"
2489 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2491 elif test "$build_libtool_libs" = yes; then
2492 # Not a shared library
2493 if test "$deplibs_check_method" != pass_all; then
2494 # We're trying link a shared library against a static one
2495 # but the system doesn't support it.
2497 # Just print a warning and add the library to dependency_libs so
2498 # that the program can be linked against the static library.
2500 $echo "*** Warning: This system can not link to static lib archive $lib."
2501 $echo "*** I have the capability to make that library automatically link in when"
2502 $echo "*** you link to this library. But I can only do this if you have a"
2503 $echo "*** shared version of the library, which you do not appear to have."
2504 if test "$module" = yes; then
2505 $echo "*** But as you try to build a module library, libtool will still create "
2506 $echo "*** a static module, that should work as long as the dlopening application"
2507 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2508 if test -z "$global_symbol_pipe"; then
2510 $echo "*** However, this would only work if libtool was able to extract symbol"
2511 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2512 $echo "*** not find such a program. So, this module is probably useless."
2513 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2515 if test "$build_old_libs" = no; then
2516 build_libtool_libs=module
2519 build_libtool_libs=no
2523 convenience="$convenience $dir/$old_library"
2524 old_convenience="$old_convenience $dir/$old_library"
2525 deplibs="$dir/$old_library $deplibs"
2528 fi # link shared/static library?
2530 if test "$linkmode" = lib; then
2531 if test -n "$dependency_libs" &&
2532 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2533 test "$link_static" = yes; }; then
2534 # Extract -R from dependency_libs
2536 for libdir in $dependency_libs; do
2538 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2540 *" $temp_xrpath "*) ;;
2541 *) xrpath="$xrpath $temp_xrpath";;
2543 *) temp_deplibs="$temp_deplibs $libdir";;
2546 dependency_libs="$temp_deplibs"
2549 newlib_search_path="$newlib_search_path $absdir"
2550 # Link against this library
2551 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2552 # ... and its dependency_libs
2554 for deplib in $dependency_libs; do
2555 newdependency_libs="$deplib $newdependency_libs"
2556 if test "X$duplicate_deps" = "Xyes" ; then
2557 case "$tmp_libs " in
2558 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2561 tmp_libs="$tmp_libs $deplib"
2564 if test "$link_all_deplibs" != no; then
2565 # Add the search paths of all dependency libraries
2566 for deplib in $dependency_libs; do
2568 -L*) path="$deplib" ;;
2570 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2571 test "X$dir" = "X$deplib" && dir="."
2572 # We need an absolute path.
2574 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2576 absdir=`cd "$dir" && pwd`
2577 if test -z "$absdir"; then
2578 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2583 if grep "^installed=no" $deplib > /dev/null; then
2584 path="$absdir/$objdir"
2586 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2587 if test -z "$libdir"; then
2588 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2591 if test "$absdir" != "$libdir"; then
2592 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2599 # we do not want to link against static libs, but need to link against shared
2600 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2601 if test -n "$deplibrary_names" ; then
2602 for tmp in $deplibrary_names ; do
2605 if test -f "$path/$depdepl" ; then
2606 depdepl="$path/$depdepl"
2608 # do not add paths which are already there
2609 case " $newlib_search_path " in
2611 *) newlib_search_path="$newlib_search_path $path";;
2625 # Again, we only want to link against shared libraries
2626 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2627 for tmp in $newlib_search_path ; do
2628 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2629 eval depdepl="$tmp/lib$tmp_libs.dylib"
2649 case " $deplibs " in
2651 *) deplibs="$deplibs $depdepl" ;;
2653 case " $deplibs " in
2655 *) deplibs="$deplibs $path" ;;
2658 fi # link_all_deplibs != no
2660 done # for deplib in $libs
2661 dependency_libs="$newdependency_libs"
2662 if test "$pass" = dlpreopen; then
2663 # Link the dlpreopened libraries before other libraries
2664 for deplib in $save_deplibs; do
2665 deplibs="$deplib $deplibs"
2668 if test "$pass" != dlopen; then
2669 if test "$pass" != conv; then
2670 # Make sure lib_search_path contains only unique directories.
2672 for dir in $newlib_search_path; do
2673 case "$lib_search_path " in
2675 *) lib_search_path="$lib_search_path $dir" ;;
2681 if test "$linkmode,$pass" != "prog,link"; then
2684 vars="compile_deplibs finalize_deplibs"
2686 for var in $vars dependency_libs; do
2687 # Add libraries to $var in reverse order
2688 eval tmp_libs=\"\$$var\"
2690 for deplib in $tmp_libs; do
2691 # FIXME: Pedantically, this is the right thing to do, so
2692 # that some nasty dependency loop isn't accidentally
2694 #new_libs="$deplib $new_libs"
2695 # Pragmatically, this seems to cause very few problems in
2698 -L*) new_libs="$deplib $new_libs" ;;
2701 # And here is the reason: when a library appears more
2702 # than once as an explicit dependence of a library, or
2703 # is implicitly linked in more than once by the
2704 # compiler, it is considered special, and multiple
2705 # occurrences thereof are not removed. Compare this
2706 # with having the same library being listed as a
2707 # dependency of multiple other libraries: in this case,
2708 # we know (pedantically, we assume) the library does not
2709 # need to be listed more than once, so we keep only the
2710 # last copy. This is not always right, but it is rare
2711 # enough that we require users that really mean to play
2712 # such unportable linking tricks to link the library
2713 # using -Wl,-lname, so that libtool does not consider it
2714 # for duplicate removal.
2715 case " $specialdeplibs " in
2716 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2718 case " $new_libs " in
2720 *) new_libs="$deplib $new_libs" ;;
2728 for deplib in $new_libs; do
2731 case " $tmp_libs " in
2733 *) tmp_libs="$tmp_libs $deplib" ;;
2736 *) tmp_libs="$tmp_libs $deplib" ;;
2739 eval $var=\"$tmp_libs\"
2742 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2744 for i in $dependency_libs ; do
2745 case " $predeps $postdeps $compiler_lib_search_path " in
2750 if test -n "$i" ; then
2751 tmp_libs="$tmp_libs $i"
2754 dependency_libs=$tmp_libs
2756 if test "$linkmode" = prog; then
2757 dlfiles="$newdlfiles"
2758 dlprefiles="$newdlprefiles"
2763 if test -n "$deplibs"; then
2764 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2767 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2768 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2771 if test -n "$rpath"; then
2772 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2775 if test -n "$xrpath"; then
2776 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2779 if test -n "$vinfo"; then
2780 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2783 if test -n "$release"; then
2784 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2787 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2788 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2791 # Now set the variables for building old libraries.
2792 build_libtool_libs=no
2794 objs="$objs$old_deplibs"
2798 # Make sure we only generate libraries of the form `libNAME.la'.
2801 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2802 eval shared_ext=\"$shrext\"
2803 eval libname=\"$libname_spec\"
2806 if test "$module" = no; then
2807 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2811 if test "$need_lib_prefix" != no; then
2812 # Add the "lib" prefix for modules if required
2813 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2814 eval shared_ext=\"$shrext\"
2815 eval libname=\"$libname_spec\"
2817 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2822 if test -n "$objs"; then
2823 if test "$deplibs_check_method" != pass_all; then
2824 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2828 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2829 $echo "*** objects $objs is not portable!"
2830 libobjs="$libobjs $objs"
2834 if test "$dlself" != no; then
2835 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2839 if test "$#" -gt 2; then
2840 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2845 if test -z "$rpath"; then
2846 if test "$build_libtool_libs" = yes; then
2847 # Building a libtool convenience library.
2848 # Some compilers have problems with a `.al' extension so
2849 # convenience libraries should have the same extension an
2850 # archive normally would.
2851 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2852 build_libtool_libs=convenience
2856 if test -n "$vinfo"; then
2857 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2860 if test -n "$release"; then
2861 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2865 # Parse the version information argument.
2866 save_ifs="$IFS"; IFS=':'
2867 set dummy $vinfo 0 0 0
2870 if test -n "$8"; then
2871 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2876 # convert absolute version numbers to libtool ages
2877 # this retains compatibility with .la files and attempts
2878 # to make the code below a bit more comprehensible
2880 case $vinfo_number in
2884 number_revision="$4"
2886 # There are really only two kinds -- those that
2887 # use the current revision as the major version
2888 # and those that subtract age and use age as
2889 # a minor version. But, then there is irix
2890 # which has an extra 1 added just for fun
2892 case $version_type in
2893 darwin|linux|osf|windows)
2894 current=`expr $number_major + $number_minor`
2896 revision="$number_revision"
2898 freebsd-aout|freebsd-elf|sunos)
2899 current="$number_major"
2900 revision="$number_minor"
2904 current=`expr $number_major + $number_minor - 1`
2906 revision="$number_minor"
2917 # Check that each of the things are valid numbers.
2919 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2921 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2928 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2930 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2931 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2937 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2939 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2940 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2945 if test "$age" -gt "$current"; then
2946 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2947 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2951 # Calculate the version variables.
2955 case $version_type in
2959 # Like Linux, but with the current version available in
2960 # verstring for coding it into the library header
2961 major=.`expr $current - $age`
2962 versuffix="$major.$age.$revision"
2963 # Darwin ld doesn't like 0 for these options...
2964 minor_current=`expr $current + 1`
2965 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2970 versuffix=".$current.$revision";
2975 versuffix=".$current";
2979 major=`expr $current - $age + 1`
2981 case $version_type in
2982 nonstopux) verstring_prefix=nonstopux ;;
2983 *) verstring_prefix=sgi ;;
2985 verstring="$verstring_prefix$major.$revision"
2987 # Add in all the interfaces that we are compatible with.
2989 while test "$loop" -ne 0; do
2990 iface=`expr $revision - $loop`
2991 loop=`expr $loop - 1`
2992 verstring="$verstring_prefix$major.$iface:$verstring"
2995 # Before this point, $major must not contain `.'.
2997 versuffix="$major.$revision"
3001 major=.`expr $current - $age`
3002 versuffix="$major.$age.$revision"
3006 major=.`expr $current - $age`
3007 versuffix=".$current.$age.$revision"
3008 verstring="$current.$age.$revision"
3010 # Add in all the interfaces that we are compatible with.
3012 while test "$loop" -ne 0; do
3013 iface=`expr $current - $loop`
3014 loop=`expr $loop - 1`
3015 verstring="$verstring:${iface}.0"
3018 # Make executables depend on our current version.
3019 verstring="$verstring:${current}.0"
3024 versuffix=".$current.$revision"
3028 # Use '-' rather than '.', since we only want one
3029 # extension on DOS 8.3 filesystems.
3030 major=`expr $current - $age`
3035 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3036 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3041 # Clear the version info if we defaulted, and they specified a release.
3042 if test -z "$vinfo" && test -n "$release"; then
3044 case $version_type in
3046 # we can't check for "0.0" in archive_cmds due to quoting
3047 # problems, so we reset it completely
3054 if test "$need_version" = no; then
3061 # Remove version info from name if versioning should be avoided
3062 if test "$avoid_version" = yes && test "$need_version" = no; then
3068 # Check to see if the archive will have undefined symbols.
3069 if test "$allow_undefined" = yes; then
3070 if test "$allow_undefined_flag" = unsupported; then
3071 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3072 build_libtool_libs=no
3076 # Don't allow undefined symbols.
3077 allow_undefined_flag="$no_undefined_flag"
3081 if test "$mode" != relink; then
3082 # Remove our outputs, but don't remove object files since they
3083 # may have been created when compiling PIC objects.
3085 tempremovelist=`$echo "$output_objdir/*"`
3086 for p in $tempremovelist; do
3090 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3091 removelist="$removelist $p"
3096 if test -n "$removelist"; then
3097 $show "${rm}r $removelist"
3098 $run ${rm}r $removelist
3102 # Now set the variables for building old libraries.
3103 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3104 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3106 # Transform .lo files to .o files.
3107 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3110 # Eliminate all temporary directories.
3111 for path in $notinst_path; do
3112 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3113 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3114 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3117 if test -n "$xrpath"; then
3118 # If the user specified any rpath flags, then add them.
3120 for libdir in $xrpath; do
3121 temp_xrpath="$temp_xrpath -R$libdir"
3122 case "$finalize_rpath " in
3124 *) finalize_rpath="$finalize_rpath $libdir" ;;
3127 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3128 dependency_libs="$temp_xrpath $dependency_libs"
3132 # Make sure dlfiles contains only unique files that won't be dlpreopened
3133 old_dlfiles="$dlfiles"
3135 for lib in $old_dlfiles; do
3136 case " $dlprefiles $dlfiles " in
3138 *) dlfiles="$dlfiles $lib" ;;
3142 # Make sure dlprefiles contains only unique files
3143 old_dlprefiles="$dlprefiles"
3145 for lib in $old_dlprefiles; do
3146 case "$dlprefiles " in
3148 *) dlprefiles="$dlprefiles $lib" ;;
3152 if test "$build_libtool_libs" = yes; then
3153 if test -n "$rpath"; then
3155 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3156 # these systems don't actually have a c library (as such)!
3158 *-*-rhapsody* | *-*-darwin1.[012])
3159 # Rhapsody C library is in the System framework
3160 deplibs="$deplibs -framework System"
3163 # Don't link with libc until the a.out ld.so is fixed.
3165 *-*-openbsd* | *-*-freebsd*)
3166 # Do not include libc due to us having libc/libc_r.
3167 test "X$arg" = "X-lc" && continue
3170 # Add libc to deplibs on all other systems if necessary.
3171 if test "$build_libtool_need_lc" = "yes"; then
3172 deplibs="$deplibs -lc"
3178 # Transform deplibs into only deplibs that can be linked in shared.
3180 libname_save=$libname
3181 release_save=$release
3182 versuffix_save=$versuffix
3184 # I'm not sure if I'm treating the release correctly. I think
3185 # release should show up in the -l (ie -lgmp5) so we don't want to
3186 # add it in twice. Is that correct?
3192 case $deplibs_check_method in
3194 # Don't check for shared/static. Everything works.
3195 # This might be a little naive. We might want to check
3196 # whether the library exists or not. But this is on
3197 # osf3 & osf4 and I'm not really sure... Just
3198 # implementing what was already the behavior.
3202 # This code stresses the "libraries are programs" paradigm to its
3203 # limits. Maybe even breaks it. We compile a program, linking it
3204 # against the deplibs as a proxy for the library. Then we can check
3205 # whether they linked in statically or dynamically with ldd.
3207 cat > conftest.c <<EOF
3208 int main() { return 0; }
3211 $LTCC -o conftest conftest.c $deplibs
3212 if test "$?" -eq 0 ; then
3213 ldd_output=`ldd conftest`
3214 for i in $deplibs; do
3215 name="`expr $i : '-l\(.*\)'`"
3216 # If $name is empty we are operating on a -L argument.
3217 if test "$name" != "" && test "$name" -ne "0"; then
3218 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3219 case " $predeps $postdeps " in
3221 newdeplibs="$newdeplibs $i"
3226 if test -n "$i" ; then
3227 libname=`eval \\$echo \"$libname_spec\"`
3228 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3229 set dummy $deplib_matches
3231 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3232 newdeplibs="$newdeplibs $i"
3236 $echo "*** Warning: dynamic linker does not accept needed library $i."
3237 $echo "*** I have the capability to make that library automatically link in when"
3238 $echo "*** you link to this library. But I can only do this if you have a"
3239 $echo "*** shared version of the library, which I believe you do not have"
3240 $echo "*** because a test_compile did reveal that the linker did not use it for"
3241 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3245 newdeplibs="$newdeplibs $i"
3249 # Error occurred in the first compile. Let's try to salvage
3250 # the situation: Compile a separate program for each library.
3251 for i in $deplibs; do
3252 name="`expr $i : '-l\(.*\)'`"
3253 # If $name is empty we are operating on a -L argument.
3254 if test "$name" != "" && test "$name" != "0"; then
3256 $LTCC -o conftest conftest.c $i
3258 if test "$?" -eq 0 ; then
3259 ldd_output=`ldd conftest`
3260 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3261 case " $predeps $postdeps " in
3263 newdeplibs="$newdeplibs $i"
3268 if test -n "$i" ; then
3269 libname=`eval \\$echo \"$libname_spec\"`
3270 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3271 set dummy $deplib_matches
3273 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3274 newdeplibs="$newdeplibs $i"
3278 $echo "*** Warning: dynamic linker does not accept needed library $i."
3279 $echo "*** I have the capability to make that library automatically link in when"
3280 $echo "*** you link to this library. But I can only do this if you have a"
3281 $echo "*** shared version of the library, which you do not appear to have"
3282 $echo "*** because a test_compile did reveal that the linker did not use this one"
3283 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3289 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3290 $echo "*** make it link in! You will probably need to install it or some"
3291 $echo "*** library that it depends on before this library will be fully"
3292 $echo "*** functional. Installing it before continuing would be even better."
3295 newdeplibs="$newdeplibs $i"
3301 set dummy $deplibs_check_method
3302 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3303 for a_deplib in $deplibs; do
3304 name="`expr $a_deplib : '-l\(.*\)'`"
3305 # If $name is empty we are operating on a -L argument.
3306 if test "$name" != "" && test "$name" != "0"; then
3307 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3308 case " $predeps $postdeps " in
3310 newdeplibs="$newdeplibs $a_deplib"
3315 if test -n "$a_deplib" ; then
3316 libname=`eval \\$echo \"$libname_spec\"`
3317 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3318 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3319 for potent_lib in $potential_libs; do
3320 # Follow soft links.
3321 if ls -lLd "$potent_lib" 2>/dev/null \
3322 | grep " -> " >/dev/null; then
3325 # The statement above tries to avoid entering an
3326 # endless loop below, in case of cyclic links.
3327 # We might still enter an endless loop, since a link
3328 # loop can be closed while we follow links,
3330 potlib="$potent_lib"
3331 while test -h "$potlib" 2>/dev/null; do
3332 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3334 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3335 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3338 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3340 | $EGREP "$file_magic_regex" > /dev/null; then
3341 newdeplibs="$newdeplibs $a_deplib"
3348 if test -n "$a_deplib" ; then
3351 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3352 $echo "*** I have the capability to make that library automatically link in when"
3353 $echo "*** you link to this library. But I can only do this if you have a"
3354 $echo "*** shared version of the library, which you do not appear to have"
3355 $echo "*** because I did check the linker path looking for a file starting"
3356 if test -z "$potlib" ; then
3357 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3359 $echo "*** with $libname and none of the candidates passed a file format test"
3360 $echo "*** using a file magic. Last file checked: $potlib"
3364 # Add a -L argument.
3365 newdeplibs="$newdeplibs $a_deplib"
3367 done # Gone through all deplibs.
3370 set dummy $deplibs_check_method
3371 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3372 for a_deplib in $deplibs; do
3373 name="`expr $a_deplib : '-l\(.*\)'`"
3374 # If $name is empty we are operating on a -L argument.
3375 if test -n "$name" && test "$name" != "0"; then
3376 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3377 case " $predeps $postdeps " in
3379 newdeplibs="$newdeplibs $a_deplib"
3384 if test -n "$a_deplib" ; then
3385 libname=`eval \\$echo \"$libname_spec\"`
3386 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3387 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3388 for potent_lib in $potential_libs; do
3389 potlib="$potent_lib" # see symlink-check above in file_magic test
3390 if eval $echo \"$potent_lib\" 2>/dev/null \
3392 | $EGREP "$match_pattern_regex" > /dev/null; then
3393 newdeplibs="$newdeplibs $a_deplib"
3400 if test -n "$a_deplib" ; then
3403 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3404 $echo "*** I have the capability to make that library automatically link in when"
3405 $echo "*** you link to this library. But I can only do this if you have a"
3406 $echo "*** shared version of the library, which you do not appear to have"
3407 $echo "*** because I did check the linker path looking for a file starting"
3408 if test -z "$potlib" ; then
3409 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3411 $echo "*** with $libname and none of the candidates passed a file format test"
3412 $echo "*** using a regex pattern. Last file checked: $potlib"
3416 # Add a -L argument.
3417 newdeplibs="$newdeplibs $a_deplib"
3419 done # Gone through all deplibs.
3423 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3424 -e 's/ -[LR][^ ]*//g'`
3425 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3426 for i in $predeps $postdeps ; do
3427 # can't use Xsed below, because $i might contain '/'
3428 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3431 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3432 | grep . >/dev/null; then
3434 if test "X$deplibs_check_method" = "Xnone"; then
3435 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3437 $echo "*** Warning: inter-library dependencies are not known to be supported."
3439 $echo "*** All declared inter-library dependencies are being dropped."
3444 versuffix=$versuffix_save
3446 release=$release_save
3447 libname=$libname_save
3451 *-*-rhapsody* | *-*-darwin1.[012])
3452 # On Rhapsody replace the C library is the System framework
3453 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3457 if test "$droppeddeps" = yes; then
3458 if test "$module" = yes; then
3460 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3461 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3462 $echo "*** a static module, that should work as long as the dlopening"
3463 $echo "*** application is linked with the -dlopen flag."
3464 if test -z "$global_symbol_pipe"; then
3466 $echo "*** However, this would only work if libtool was able to extract symbol"
3467 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3468 $echo "*** not find such a program. So, this module is probably useless."
3469 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3471 if test "$build_old_libs" = no; then
3472 oldlibs="$output_objdir/$libname.$libext"
3473 build_libtool_libs=module
3476 build_libtool_libs=no
3479 $echo "*** The inter-library dependencies that have been dropped here will be"
3480 $echo "*** automatically added whenever a program is linked with this library"
3481 $echo "*** or is declared to -dlopen it."
3483 if test "$allow_undefined" = no; then
3485 $echo "*** Since this library must not contain undefined symbols,"
3486 $echo "*** because either the platform does not support them or"
3487 $echo "*** it was explicitly requested with -no-undefined,"
3488 $echo "*** libtool will only create a static version of it."
3489 if test "$build_old_libs" = no; then
3490 oldlibs="$output_objdir/$libname.$libext"
3491 build_libtool_libs=module
3494 build_libtool_libs=no
3499 # Time to change all our "foo.framework" stuff back to "-framework foo"
3502 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3503 dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3506 # Done checking deplibs!
3510 # All the library-specific variables (install_libdir is set above).
3515 # Test again, we may have decided not to build it any more
3516 if test "$build_libtool_libs" = yes; then
3517 if test "$hardcode_into_libs" = yes; then
3518 # Hardcode the library paths
3521 rpath="$finalize_rpath"
3522 test "$mode" != relink && rpath="$compile_rpath$rpath"
3523 for libdir in $rpath; do
3524 if test -n "$hardcode_libdir_flag_spec"; then
3525 if test -n "$hardcode_libdir_separator"; then
3526 if test -z "$hardcode_libdirs"; then
3527 hardcode_libdirs="$libdir"
3529 # Just accumulate the unique libdirs.
3530 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3531 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3534 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3539 eval flag=\"$hardcode_libdir_flag_spec\"
3540 dep_rpath="$dep_rpath $flag"
3542 elif test -n "$runpath_var"; then
3543 case "$perm_rpath " in
3545 *) perm_rpath="$perm_rpath $libdir" ;;
3549 # Substitute the hardcoded libdirs into the rpath.
3550 if test -n "$hardcode_libdir_separator" &&
3551 test -n "$hardcode_libdirs"; then
3552 libdir="$hardcode_libdirs"
3553 if test -n "$hardcode_libdir_flag_spec_ld"; then
3554 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3556 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3559 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3560 # We should set the runpath_var.
3562 for dir in $perm_rpath; do
3565 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3567 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3570 shlibpath="$finalize_shlibpath"
3571 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3572 if test -n "$shlibpath"; then
3573 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3576 # Get the real and link names of the library.
3577 eval shared_ext=\"$shrext\"
3578 eval library_names=\"$library_names_spec\"
3579 set dummy $library_names
3583 if test -n "$soname_spec"; then
3584 eval soname=\"$soname_spec\"
3588 if test -z "$dlname"; then
3592 lib="$output_objdir/$realname"
3595 linknames="$linknames $link"
3598 # Use standard objects if they are pic
3599 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3601 # Prepare the list of exported symbols
3602 if test -z "$export_symbols"; then
3603 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3604 $show "generating symbol list for \`$libname.la'"
3605 export_symbols="$output_objdir/$libname.exp"
3606 $run $rm $export_symbols
3607 eval cmds=\"$export_symbols_cmds\"
3608 save_ifs="$IFS"; IFS='~'
3609 for cmd in $cmds; do
3611 if len=`expr "X$cmd" : ".*"` &&
3612 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3614 $run eval "$cmd" || exit $?
3615 skipped_export=false
3617 # The command line is too long to execute in one step.
3618 $show "using reloadable object file for export list..."
3623 if test -n "$export_symbols_regex"; then
3624 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3625 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3626 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3627 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3632 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3633 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3637 for test_deplib in $deplibs; do
3638 case " $convenience " in
3639 *" $test_deplib "*) ;;
3641 tmp_deplibs="$tmp_deplibs $test_deplib"
3645 deplibs="$tmp_deplibs"
3647 if test -n "$convenience"; then
3648 if test -n "$whole_archive_flag_spec"; then
3649 save_libobjs=$libobjs
3650 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3652 gentop="$output_objdir/${outputname}x"
3653 $show "${rm}r $gentop"
3654 $run ${rm}r "$gentop"
3655 $show "$mkdir $gentop"
3656 $run $mkdir "$gentop"
3658 if test "$status" -ne 0 && test ! -d "$gentop"; then
3661 generated="$generated $gentop"
3663 for xlib in $convenience; do
3664 # Extract the objects.
3666 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3667 *) xabs=`pwd`"/$xlib" ;;
3669 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3670 xdir="$gentop/$xlib"
3672 $show "${rm}r $xdir"
3674 $show "$mkdir $xdir"
3677 if test "$status" -ne 0 && test ! -d "$xdir"; then
3680 # We will extract separately just the conflicting names and we will no
3681 # longer touch any unique names. It is faster to leave these extract
3682 # automatically by $AR in one run.
3683 $show "(cd $xdir && $AR x $xabs)"
3684 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3685 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3688 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3689 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3690 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3693 while test "$i" -le "$count"
3695 # Put our $i before any first dot (extension)
3696 # Never overwrite any file
3698 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3700 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3702 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3703 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3709 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3714 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3715 eval flag=\"$thread_safe_flag_spec\"
3716 linker_flags="$linker_flags $flag"
3719 # Make a backup of the uninstalled library when relinking
3720 if test "$mode" = relink; then
3721 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3724 # Do each of the archive commands.
3725 if test "$module" = yes && test -n "$module_cmds" ; then
3726 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3727 eval cmds=\"$module_expsym_cmds\"
3729 eval cmds=\"$module_cmds\"
3732 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3733 eval cmds=\"$archive_expsym_cmds\"
3735 eval cmds=\"$archive_cmds\"
3739 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3740 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3743 # The command line is too long to link in one step, link piecewise.
3744 $echo "creating reloadable object files..."
3746 # Save the value of $output and $libobjs because we want to
3747 # use them later. If we have whole_archive_flag_spec, we
3748 # want to use save_libobjs as it was before
3749 # whole_archive_flag_spec was expanded, because we can't
3750 # assume the linker understands whole_archive_flag_spec.
3751 # This may have to be revisited, in case too many
3752 # convenience libraries get linked in and end up exceeding
3754 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3755 save_libobjs=$libobjs
3759 # Clear the reloadable object creation command queue and
3760 # initialize k to one.
3767 output=$output_objdir/$save_output-${k}.$objext
3768 # Loop over the list of objects to be linked.
3769 for obj in $save_libobjs
3771 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3772 if test "X$objlist" = X ||
3773 { len=`expr "X$test_cmds" : ".*"` &&
3774 test "$len" -le "$max_cmd_len"; }; then
3775 objlist="$objlist $obj"
3777 # The command $test_cmds is almost too long, add a
3778 # command to the queue.
3779 if test "$k" -eq 1 ; then
3780 # The first file doesn't have a previous command to add.
3781 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3783 # All subsequent reloadable object files will link in
3784 # the last one created.
3785 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3787 last_robj=$output_objdir/$save_output-${k}.$objext
3789 output=$output_objdir/$save_output-${k}.$objext
3794 # Handle the remaining objects by creating one last
3795 # reloadable object file. All subsequent reloadable object
3796 # files will link in the last one created.
3797 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3798 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3800 if ${skipped_export-false}; then
3801 $show "generating symbol list for \`$libname.la'"
3802 export_symbols="$output_objdir/$libname.exp"
3803 $run $rm $export_symbols
3805 # Append the command to create the export file.
3806 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3809 # Set up a command to remove the reloadale object files
3810 # after they are used.
3812 while test "$i" -lt "$k"
3815 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3818 $echo "creating a temporary reloadable object file: $output"
3820 # Loop through the commands generated above and execute them.
3821 save_ifs="$IFS"; IFS='~'
3822 for cmd in $concat_cmds; do
3825 $run eval "$cmd" || exit $?
3830 # Restore the value of output.
3833 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3834 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3836 # Expand the library linking commands again to reset the
3837 # value of $libobjs for piecewise linking.
3839 # Do each of the archive commands.
3840 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3841 eval cmds=\"$archive_expsym_cmds\"
3843 eval cmds=\"$archive_cmds\"
3846 # Append the command to remove the reloadable object files
3847 # to the just-reset $cmds.
3848 eval cmds=\"\$cmds~$rm $delfiles\"
3850 save_ifs="$IFS"; IFS='~'
3851 for cmd in $cmds; do
3854 $run eval "$cmd" || exit $?
3858 # Restore the uninstalled library and exit
3859 if test "$mode" = relink; then
3860 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3864 # Create links to the real library.
3865 for linkname in $linknames; do
3866 if test "$realname" != "$linkname"; then
3867 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3868 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3872 # If -module or -export-dynamic was specified, set the dlname.
3873 if test "$module" = yes || test "$export_dynamic" = yes; then
3874 # On all known operating systems, these are identical.
3881 if test -n "$deplibs"; then
3882 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3885 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3886 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3889 if test -n "$rpath"; then
3890 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3893 if test -n "$xrpath"; then
3894 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3897 if test -n "$vinfo"; then
3898 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3901 if test -n "$release"; then
3902 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3907 if test -n "$objs$old_deplibs"; then
3908 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3912 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3920 # Delete the old objects.
3921 $run $rm $obj $libobj
3923 # Objects from convenience libraries. This assumes
3924 # single-version convenience libraries. Whenever we create
3925 # different ones for PIC/non-PIC, this we'll have to duplicate
3929 # reload_cmds runs $LD directly, so let us get rid of
3930 # -Wl from whole_archive_flag_spec
3933 if test -n "$convenience"; then
3934 if test -n "$whole_archive_flag_spec"; then
3935 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3937 gentop="$output_objdir/${obj}x"
3938 $show "${rm}r $gentop"
3939 $run ${rm}r "$gentop"
3940 $show "$mkdir $gentop"
3941 $run $mkdir "$gentop"
3943 if test "$status" -ne 0 && test ! -d "$gentop"; then
3946 generated="$generated $gentop"
3948 for xlib in $convenience; do
3949 # Extract the objects.
3951 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3952 *) xabs=`pwd`"/$xlib" ;;
3954 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3955 xdir="$gentop/$xlib"
3957 $show "${rm}r $xdir"
3959 $show "$mkdir $xdir"
3962 if test "$status" -ne 0 && test ! -d "$xdir"; then
3965 # We will extract separately just the conflicting names and we will no
3966 # longer touch any unique names. It is faster to leave these extract
3967 # automatically by $AR in one run.
3968 $show "(cd $xdir && $AR x $xabs)"
3969 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3970 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3973 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3974 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3975 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3978 while test "$i" -le "$count"
3980 # Put our $i before any first dot (extension)
3981 # Never overwrite any file
3983 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3985 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3987 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3988 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3994 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3999 # Create the old-style object.
4000 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
4003 eval cmds=\"$reload_cmds\"
4004 save_ifs="$IFS"; IFS='~'
4005 for cmd in $cmds; do
4008 $run eval "$cmd" || exit $?
4012 # Exit if we aren't doing a library object file.
4013 if test -z "$libobj"; then
4014 if test -n "$gentop"; then
4015 $show "${rm}r $gentop"
4022 if test "$build_libtool_libs" != yes; then
4023 if test -n "$gentop"; then
4024 $show "${rm}r $gentop"
4028 # Create an invalid libtool object if no PIC, so that we don't
4029 # accidentally link it into a program.
4030 # $show "echo timestamp > $libobj"
4031 # $run eval "echo timestamp > $libobj" || exit $?
4035 if test -n "$pic_flag" || test "$pic_mode" != default; then
4036 # Only do commands if we really have different PIC objects.
4037 reload_objs="$libobjs $reload_conv_objs"
4039 eval cmds=\"$reload_cmds\"
4040 save_ifs="$IFS"; IFS='~'
4041 for cmd in $cmds; do
4044 $run eval "$cmd" || exit $?
4049 if test -n "$gentop"; then
4050 $show "${rm}r $gentop"
4059 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4061 if test -n "$vinfo"; then
4062 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4065 if test -n "$release"; then
4066 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4069 if test "$preload" = yes; then
4070 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4071 test "$dlopen_self_static" = unknown; then
4072 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4077 *-*-rhapsody* | *-*-darwin1.[012])
4078 # On Rhapsody replace the C library is the System framework
4079 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4080 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4086 # Don't allow lazy linking, it breaks C++ global constructors
4087 if test "$tagname" = CXX ; then
4088 compile_command="$compile_command ${wl}-bind_at_load"
4089 finalize_command="$finalize_command ${wl}-bind_at_load"
4091 # Time to change all our "foo.framework" stuff back to "-framework foo"
4092 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
4093 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
4097 compile_command="$compile_command $compile_deplibs"
4098 finalize_command="$finalize_command $finalize_deplibs"
4100 if test -n "$rpath$xrpath"; then
4101 # If the user specified any rpath flags, then add them.
4102 for libdir in $rpath $xrpath; do
4103 # This is the magic to use -rpath.
4104 case "$finalize_rpath " in
4106 *) finalize_rpath="$finalize_rpath $libdir" ;;
4111 # Now hardcode the library paths
4114 for libdir in $compile_rpath $finalize_rpath; do
4115 if test -n "$hardcode_libdir_flag_spec"; then
4116 if test -n "$hardcode_libdir_separator"; then
4117 if test -z "$hardcode_libdirs"; then
4118 hardcode_libdirs="$libdir"
4120 # Just accumulate the unique libdirs.
4121 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4122 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4125 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4130 eval flag=\"$hardcode_libdir_flag_spec\"
4131 rpath="$rpath $flag"
4133 elif test -n "$runpath_var"; then
4134 case "$perm_rpath " in
4136 *) perm_rpath="$perm_rpath $libdir" ;;
4140 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4141 case :$dllsearchpath: in
4143 *) dllsearchpath="$dllsearchpath:$libdir";;
4148 # Substitute the hardcoded libdirs into the rpath.
4149 if test -n "$hardcode_libdir_separator" &&
4150 test -n "$hardcode_libdirs"; then
4151 libdir="$hardcode_libdirs"
4152 eval rpath=\" $hardcode_libdir_flag_spec\"
4154 compile_rpath="$rpath"
4158 for libdir in $finalize_rpath; do
4159 if test -n "$hardcode_libdir_flag_spec"; then
4160 if test -n "$hardcode_libdir_separator"; then
4161 if test -z "$hardcode_libdirs"; then
4162 hardcode_libdirs="$libdir"
4164 # Just accumulate the unique libdirs.
4165 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4166 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4169 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4174 eval flag=\"$hardcode_libdir_flag_spec\"
4175 rpath="$rpath $flag"
4177 elif test -n "$runpath_var"; then
4178 case "$finalize_perm_rpath " in
4180 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4184 # Substitute the hardcoded libdirs into the rpath.
4185 if test -n "$hardcode_libdir_separator" &&
4186 test -n "$hardcode_libdirs"; then
4187 libdir="$hardcode_libdirs"
4188 eval rpath=\" $hardcode_libdir_flag_spec\"
4190 finalize_rpath="$rpath"
4192 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4193 # Transform all the library objects into standard objects.
4194 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4195 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4199 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4200 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4201 dlsyms="${outputname}S.c"
4203 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4207 if test -n "$dlsyms"; then
4211 # Discover the nlist of each of the dlfiles.
4212 nlist="$output_objdir/${outputname}.nm"
4214 $show "$rm $nlist ${nlist}S ${nlist}T"
4215 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4217 # Parse the name list into a source file.
4218 $show "creating $output_objdir/$dlsyms"
4220 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4221 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4222 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4228 /* Prevent the only kind of declaration conflicts we can make. */
4229 #define lt_preloaded_symbols some_other_symbol
4231 /* External symbol declarations for the compiler. */\
4234 if test "$dlself" = yes; then
4235 $show "generating symbol list for \`$output'"
4237 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4239 # Add our own program objects to the symbol list.
4240 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4241 for arg in $progfiles; do
4242 $show "extracting global C symbols from \`$arg'"
4243 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4246 if test -n "$exclude_expsyms"; then
4247 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4248 $run eval '$mv "$nlist"T "$nlist"'
4251 if test -n "$export_symbols_regex"; then
4252 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4253 $run eval '$mv "$nlist"T "$nlist"'
4256 # Prepare the list of exported symbols
4257 if test -z "$export_symbols"; then
4258 export_symbols="$output_objdir/$output.exp"
4259 $run $rm $export_symbols
4260 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4262 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4263 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4264 $run eval 'mv "$nlist"T "$nlist"'
4268 for arg in $dlprefiles; do
4269 $show "extracting global C symbols from \`$arg'"
4270 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4271 $run eval '$echo ": $name " >> "$nlist"'
4272 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4275 if test -z "$run"; then
4276 # Make sure we have at least an empty file.
4277 test -f "$nlist" || : > "$nlist"
4279 if test -n "$exclude_expsyms"; then
4280 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4281 $mv "$nlist"T "$nlist"
4284 # Try sorting and uniquifying the output.
4285 if grep -v "^: " < "$nlist" |
4286 if sort -k 3 </dev/null >/dev/null 2>&1; then
4291 uniq > "$nlist"S; then
4294 grep -v "^: " < "$nlist" > "$nlist"S
4297 if test -f "$nlist"S; then
4298 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4300 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4303 $echo >> "$output_objdir/$dlsyms" "\
4305 #undef lt_preloaded_symbols
4307 #if defined (__STDC__) && __STDC__
4308 # define lt_ptr void *
4310 # define lt_ptr char *
4314 /* The mapping between symbol names and symbols. */
4319 lt_preloaded_symbols[] =
4323 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4325 $echo >> "$output_objdir/$dlsyms" "\
4329 /* This works around a problem in FreeBSD linker */
4330 #ifdef FREEBSD_WORKAROUND
4331 static const void *lt_preloaded_setup() {
4332 return lt_preloaded_symbols;
4342 pic_flag_for_symtable=
4344 # compiling the symbol table file with pic_flag works around
4345 # a FreeBSD bug that causes programs to crash when -lm is
4346 # linked before any other PIC object. But we must not use
4347 # pic_flag when linking with -static. The problem exists in
4348 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4349 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4350 case "$compile_command " in
4352 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4355 case "$compile_command " in
4357 *) pic_flag_for_symtable=" $pic_flag";;
4361 # Now compile the dynamic symbol file.
4362 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4363 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4365 # Clean up the generated files.
4366 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4367 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4369 # Transform the symbol file into the correct name.
4370 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4371 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4374 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4379 # We keep going just in case the user didn't refer to
4380 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4381 # really was required.
4383 # Nullify the symbol file.
4384 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4385 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4388 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4389 # Replace the output file specification.
4390 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4391 link_command="$compile_command$compile_rpath"
4393 # We have no uninstalled library dependencies, so finalize right now.
4394 $show "$link_command"
4395 $run eval "$link_command"
4398 # Delete the generated files.
4399 if test -n "$dlsyms"; then
4400 $show "$rm $output_objdir/${outputname}S.${objext}"
4401 $run $rm "$output_objdir/${outputname}S.${objext}"
4407 if test -n "$shlibpath_var"; then
4408 # We should set the shlibpath_var
4410 for dir in $temp_rpath; do
4412 [\\/]* | [A-Za-z]:[\\/]*)
4417 # Relative path: add a thisdir entry.
4418 rpath="$rpath\$thisdir/$dir:"
4425 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4426 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4428 if test -n "$finalize_shlibpath"; then
4429 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4434 if test -n "$runpath_var"; then
4435 if test -n "$perm_rpath"; then
4436 # We should set the runpath_var.
4438 for dir in $perm_rpath; do
4441 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4443 if test -n "$finalize_perm_rpath"; then
4444 # We should set the runpath_var.
4446 for dir in $finalize_perm_rpath; do
4449 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4453 if test "$no_install" = yes; then
4454 # We don't need to create a wrapper script.
4455 link_command="$compile_var$compile_command$compile_rpath"
4456 # Replace the output file specification.
4457 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4458 # Delete the old output file.
4460 # Link the executable and exit
4461 $show "$link_command"
4462 $run eval "$link_command" || exit $?
4466 if test "$hardcode_action" = relink; then
4467 # Fast installation is not supported
4468 link_command="$compile_var$compile_command$compile_rpath"
4469 relink_command="$finalize_var$finalize_command$finalize_rpath"
4471 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4472 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4474 if test "$fast_install" != no; then
4475 link_command="$finalize_var$compile_command$finalize_rpath"
4476 if test "$fast_install" = yes; then
4477 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4479 # fast_install is set to needless
4483 link_command="$compile_var$compile_command$compile_rpath"
4484 relink_command="$finalize_var$finalize_command$finalize_rpath"
4488 # Replace the output file specification.
4489 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4491 # Delete the old output files.
4492 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4494 $show "$link_command"
4495 $run eval "$link_command" || exit $?
4497 # Now create the wrapper script.
4498 $show "creating $output"
4500 # Quote the relink command for shipping.
4501 if test -n "$relink_command"; then
4502 # Preserve any variables that may affect compiler behavior
4503 for var in $variables_saved_for_relink; do
4504 if eval test -z \"\${$var+set}\"; then
4505 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4506 elif eval var_value=\$$var; test -z "$var_value"; then
4507 relink_command="$var=; export $var; $relink_command"
4509 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4510 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4513 relink_command="(cd `pwd`; $relink_command)"
4514 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4517 # Quote $echo for shipping.
4518 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4520 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4521 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4523 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4525 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4528 # Only actually do things if our run command is non-null.
4529 if test -z "$run"; then
4530 # win32 will think the script is a binary if it has
4531 # a .exe suffix, so we strip it off here.
4533 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4535 # test for cygwin because mv fails w/o .exe extensions
4539 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4543 *cygwin* | *mingw* )
4544 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4545 cwrapper=`$echo ${output}.exe`
4546 $rm $cwrappersource $cwrapper
4547 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4549 cat > $cwrappersource <<EOF
4551 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4552 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4554 The $output program cannot be directly executed until all the libtool
4555 libraries that it depends on are installed.
4557 This wrapper executable should never be moved out of the build directory.
4558 If it is, it will not operate correctly.
4560 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4561 but could eventually absorb all of the scripts functionality and
4562 exec $objdir/$outputname directly.
4565 cat >> $cwrappersource<<"EOF"
4572 #include <sys/stat.h>
4574 #if defined(PATH_MAX)
4575 # define LT_PATHMAX PATH_MAX
4576 #elif defined(MAXPATHLEN)
4577 # define LT_PATHMAX MAXPATHLEN
4579 # define LT_PATHMAX 1024
4582 #ifndef DIR_SEPARATOR
4583 # define DIR_SEPARATOR '/'
4584 # define PATH_SEPARATOR ':'
4587 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4589 # define HAVE_DOS_BASED_FILE_SYSTEM
4590 # ifndef DIR_SEPARATOR_2
4591 # define DIR_SEPARATOR_2 '\\'
4593 # ifndef PATH_SEPARATOR_2
4594 # define PATH_SEPARATOR_2 ';'
4598 #ifndef DIR_SEPARATOR_2
4599 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4600 #else /* DIR_SEPARATOR_2 */
4601 # define IS_DIR_SEPARATOR(ch) \
4602 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4603 #endif /* DIR_SEPARATOR_2 */
4605 #ifndef PATH_SEPARATOR_2
4606 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4607 #else /* PATH_SEPARATOR_2 */
4608 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4609 #endif /* PATH_SEPARATOR_2 */
4611 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4612 #define XFREE(stale) do { \
4613 if (stale) { free ((void *) stale); stale = 0; } \
4616 #if defined DEBUGWRAPPER
4617 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
4619 # define DEBUG(format, ...)
4622 const char *program_name = NULL;
4624 void * xmalloc (size_t num);
4625 char * xstrdup (const char *string);
4626 char * basename (const char *name);
4627 char * find_executable(const char *wrapper);
4628 int check_executable(const char *path);
4629 char * strendzap(char *str, const char *pat);
4630 void lt_fatal (const char *message, ...);
4633 main (int argc, char *argv[])
4638 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4639 DEBUG("(main) argv[0] : %s\n",argv[0]);
4640 DEBUG("(main) program_name : %s\n",program_name);
4641 newargz = XMALLOC(char *, argc+2);
4644 cat >> $cwrappersource <<EOF
4645 newargz[0] = "$SHELL";
4648 cat >> $cwrappersource <<"EOF"
4649 newargz[1] = find_executable(argv[0]);
4650 if (newargz[1] == NULL)
4651 lt_fatal("Couldn't find %s", argv[0]);
4652 DEBUG("(main) found exe at : %s\n",newargz[1]);
4653 /* we know the script has the same name, without the .exe */
4654 /* so make sure newargz[1] doesn't end in .exe */
4655 strendzap(newargz[1],".exe");
4656 for (i = 1; i < argc; i++)
4657 newargz[i+1] = xstrdup(argv[i]);
4658 newargz[argc+1] = NULL;
4660 for (i=0; i<argc+1; i++)
4662 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
4668 cat >> $cwrappersource <<EOF
4669 execv("$SHELL",newargz);
4672 cat >> $cwrappersource <<"EOF"
4676 xmalloc (size_t num)
4678 void * p = (void *) malloc (num);
4680 lt_fatal ("Memory exhausted");
4686 xstrdup (const char *string)
4688 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4693 basename (const char *name)
4697 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4698 /* Skip over the disk name in MSDOS pathnames. */
4699 if (isalpha (name[0]) && name[1] == ':')
4703 for (base = name; *name; name++)
4704 if (IS_DIR_SEPARATOR (*name))
4706 return (char *) base;
4710 check_executable(const char * path)
4714 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
4715 if ((!path) || (!*path))
4718 if ((stat (path, &st) >= 0) &&
4721 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
4724 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
4726 ((st.st_mode & S_IXUSR) == S_IXUSR)))
4732 /* Searches for the full path of the wrapper. Returns
4733 newly allocated full path name if found, NULL otherwise */
4735 find_executable (const char* wrapper)
4741 /* static buffer for getcwd */
4742 char tmp[LT_PATHMAX + 1];
4746 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
4748 if ((wrapper == NULL) || (*wrapper == '\0'))
4751 /* Absolute path? */
4752 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4753 if (isalpha (wrapper[0]) && wrapper[1] == ':')
4755 concat_name = xstrdup (wrapper);
4756 if (check_executable(concat_name))
4763 if (IS_DIR_SEPARATOR (wrapper[0]))
4765 concat_name = xstrdup (wrapper);
4766 if (check_executable(concat_name))
4770 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4774 for (p = wrapper; *p; p++)
4782 /* no slashes; search PATH */
4783 const char* path = getenv ("PATH");
4786 for (p = path; *p; p = p_next)
4790 for (q = p; *q; q++)
4791 if (IS_PATH_SEPARATOR(*q))
4794 p_next = (*q == '\0' ? q : q + 1);
4797 /* empty path: current directory */
4798 if (getcwd (tmp, LT_PATHMAX) == NULL)
4799 lt_fatal ("getcwd failed");
4800 tmp_len = strlen(tmp);
4801 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
4802 memcpy (concat_name, tmp, tmp_len);
4803 concat_name[tmp_len] = '/';
4804 strcpy (concat_name + tmp_len + 1, wrapper);
4808 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
4809 memcpy (concat_name, p, p_len);
4810 concat_name[p_len] = '/';
4811 strcpy (concat_name + p_len + 1, wrapper);
4813 if (check_executable(concat_name))
4818 /* not found in PATH; assume curdir */
4820 /* Relative path | not found in path: prepend cwd */
4821 if (getcwd (tmp, LT_PATHMAX) == NULL)
4822 lt_fatal ("getcwd failed");
4823 tmp_len = strlen(tmp);
4824 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
4825 memcpy (concat_name, tmp, tmp_len);
4826 concat_name[tmp_len] = '/';
4827 strcpy (concat_name + tmp_len + 1, wrapper);
4829 if (check_executable(concat_name))
4836 strendzap(char *str, const char *pat)
4840 assert(str != NULL);
4841 assert(pat != NULL);
4844 patlen = strlen(pat);
4848 str += len - patlen;
4849 if (strcmp(str, pat) == 0)
4856 lt_error_core (int exit_status, const char * mode,
4857 const char * message, va_list ap)
4859 fprintf (stderr, "%s: %s: ", program_name, mode);
4860 vfprintf (stderr, message, ap);
4861 fprintf (stderr, ".\n");
4863 if (exit_status >= 0)
4868 lt_fatal (const char *message, ...)
4871 va_start (ap, message);
4872 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4876 # we should really use a build-platform specific compiler
4877 # here, but OTOH, the wrappers (shell script and this C one)
4878 # are only useful if you want to execute the "real" binary.
4879 # Since the "real" binary is built for $host, then this
4880 # wrapper might as well be built for $host, too.
4881 $run $LTCC -s -o $cwrapper $cwrappersource
4885 trap "$rm $output; exit 1" 1 2 15
4890 # $output - temporary wrapper script for $objdir/$outputname
4891 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4893 # The $output program cannot be directly executed until all the libtool
4894 # libraries that it depends on are installed.
4896 # This wrapper script should never be moved out of the build directory.
4897 # If it is, it will not operate correctly.
4899 # Sed substitution that helps us do robust quoting. It backslashifies
4900 # metacharacters that are still active within double-quoted strings.
4901 Xsed='${SED} -e 1s/^X//'
4902 sed_quote_subst='$sed_quote_subst'
4904 # The HP-UX ksh and POSIX shell print the target directory to stdout
4906 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4908 relink_command=\"$relink_command\"
4910 # This environment variable determines our operation mode.
4911 if test \"\$libtool_install_magic\" = \"$magic\"; then
4912 # install mode needs the following variable:
4913 notinst_deplibs='$notinst_deplibs'
4915 # When we are sourced in execute mode, \$file and \$echo are already set.
4916 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4919 # Make sure echo works.
4920 if test \"X\$1\" = X--no-reexec; then
4921 # Discard the --no-reexec flag, and continue.
4923 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4924 # Yippee, \$echo works!
4927 # Restart under the correct shell, and then maybe \$echo will work.
4928 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4934 # Find the directory that this script lives in.
4935 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4936 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4938 # Follow symbolic links until we get to the real thisdir.
4939 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4940 while test -n \"\$file\"; do
4941 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4943 # If there was a directory component, then change thisdir.
4944 if test \"x\$destdir\" != \"x\$file\"; then
4945 case \"\$destdir\" in
4946 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4947 *) thisdir=\"\$thisdir/\$destdir\" ;;
4951 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4952 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4955 # Try to get the absolute directory name.
4956 absdir=\`cd \"\$thisdir\" && pwd\`
4957 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4960 if test "$fast_install" = yes; then
4962 program=lt-'$outputname'$exeext
4963 progdir=\"\$thisdir/$objdir\"
4965 if test ! -f \"\$progdir/\$program\" || \\
4966 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4967 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4969 file=\"\$\$-\$program\"
4971 if test ! -d \"\$progdir\"; then
4972 $mkdir \"\$progdir\"
4974 $rm \"\$progdir/\$file\"
4979 # relink executable if necessary
4980 if test -n \"\$relink_command\"; then
4981 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4983 $echo \"\$relink_command_output\" >&2
4984 $rm \"\$progdir/\$file\"
4989 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4990 { $rm \"\$progdir/\$program\";
4991 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4992 $rm \"\$progdir/\$file\"
4996 program='$outputname'
4997 progdir=\"\$thisdir/$objdir\"
5003 if test -f \"\$progdir/\$program\"; then"
5005 # Export our shlibpath_var if we have one.
5006 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5008 # Add our own library path to $shlibpath_var
5009 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5011 # Some systems cannot cope with colon-terminated $shlibpath_var
5012 # The second colon is a workaround for a bug in BeOS R4 sed
5013 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5015 export $shlibpath_var
5019 # fixup the dll searchpath if we need to.
5020 if test -n "$dllsearchpath"; then
5022 # Add the dll search path components to the executable PATH
5023 PATH=$dllsearchpath:\$PATH
5028 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5029 # Run the actual program with our arguments.
5032 # Backslashes separate directories on plain windows
5033 *-*-mingw | *-*-os2*)
5035 exec \$progdir\\\\\$program \${1+\"\$@\"}
5041 exec \$progdir/\$program \${1+\"\$@\"}
5046 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5050 # The program doesn't exist.
5051 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5052 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5053 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5064 # See if we need to build an old-fashioned archive.
5065 for oldlib in $oldlibs; do
5067 if test "$build_libtool_libs" = convenience; then
5068 oldobjs="$libobjs_save"
5069 addlibs="$convenience"
5070 build_libtool_libs=no
5072 if test "$build_libtool_libs" = module; then
5073 oldobjs="$libobjs_save"
5074 build_libtool_libs=no
5076 oldobjs="$old_deplibs $non_pic_objects"
5078 addlibs="$old_convenience"
5081 if test -n "$addlibs"; then
5082 gentop="$output_objdir/${outputname}x"
5083 $show "${rm}r $gentop"
5084 $run ${rm}r "$gentop"
5085 $show "$mkdir $gentop"
5086 $run $mkdir "$gentop"
5088 if test "$status" -ne 0 && test ! -d "$gentop"; then
5091 generated="$generated $gentop"
5093 # Add in members from convenience archives.
5094 for xlib in $addlibs; do
5095 # Extract the objects.
5097 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5098 *) xabs=`pwd`"/$xlib" ;;
5100 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5101 xdir="$gentop/$xlib"
5103 $show "${rm}r $xdir"
5105 $show "$mkdir $xdir"
5108 if test "$status" -ne 0 && test ! -d "$xdir"; then
5111 # We will extract separately just the conflicting names and we will no
5112 # longer touch any unique names. It is faster to leave these extract
5113 # automatically by $AR in one run.
5114 $show "(cd $xdir && $AR x $xabs)"
5115 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5116 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5119 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5120 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5121 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5124 while test "$i" -le "$count"
5126 # Put our $i before any first dot (extension)
5127 # Never overwrite any file
5129 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5131 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5133 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5134 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5140 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5144 # Do each command in the archive commands.
5145 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5146 eval cmds=\"$old_archive_from_new_cmds\"
5148 eval cmds=\"$old_archive_cmds\"
5150 if len=`expr "X$cmds" : ".*"` &&
5151 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5154 # the command line is too long to link in one step, link in parts
5155 $echo "using piecewise archive linking..."
5160 save_oldobjs=$oldobjs
5161 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5162 # encoded into archives. This makes 'ar r' malfunction in
5163 # this piecewise linking case whenever conflicting object
5164 # names appear in distinct ar calls; check, warn and compensate.
5165 if (for obj in $save_oldobjs
5167 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5168 done | sort | sort -uc >/dev/null 2>&1); then
5171 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5172 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5175 # Is there a better way of finding the last object in the list?
5176 for obj in $save_oldobjs
5180 for obj in $save_oldobjs
5182 oldobjs="$objlist $obj"
5183 objlist="$objlist $obj"
5184 eval test_cmds=\"$old_archive_cmds\"
5185 if len=`expr "X$test_cmds" : ".*"` &&
5186 test "$len" -le "$max_cmd_len"; then
5189 # the above command should be used before it gets too long
5191 if test "$obj" = "$last_oldobj" ; then
5194 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5195 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5201 if test "X$oldobjs" = "X" ; then
5202 eval cmds=\"\$concat_cmds\"
5204 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5208 save_ifs="$IFS"; IFS='~'
5209 for cmd in $cmds; do
5212 $run eval "$cmd" || exit $?
5217 if test -n "$generated"; then
5218 $show "${rm}r$generated"
5219 $run ${rm}r$generated
5222 # Now create the libtool archive.
5226 test "$build_old_libs" = yes && old_library="$libname.$libext"
5227 $show "creating $output"
5229 # Preserve any variables that may affect compiler behavior
5230 for var in $variables_saved_for_relink; do
5231 if eval test -z \"\${$var+set}\"; then
5232 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5233 elif eval var_value=\$$var; test -z "$var_value"; then
5234 relink_command="$var=; export $var; $relink_command"
5236 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5237 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5240 # Quote the link command for shipping.
5241 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5242 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5244 # Only create the output if not a dry run.
5245 if test -z "$run"; then
5246 for installed in no yes; do
5247 if test "$installed" = yes; then
5248 if test -z "$install_libdir"; then
5251 output="$output_objdir/$outputname"i
5252 # Replace all uninstalled libtool libraries with the installed ones
5254 for deplib in $dependency_libs; do
5257 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5258 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5259 if test -z "$libdir"; then
5260 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5263 newdependency_libs="$newdependency_libs $libdir/$name"
5265 *) newdependency_libs="$newdependency_libs $deplib" ;;
5268 dependency_libs="$newdependency_libs"
5270 for lib in $dlfiles; do
5271 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5272 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5273 if test -z "$libdir"; then
5274 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5277 newdlfiles="$newdlfiles $libdir/$name"
5279 dlfiles="$newdlfiles"
5281 for lib in $dlprefiles; do
5282 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5283 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5284 if test -z "$libdir"; then
5285 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5288 newdlprefiles="$newdlprefiles $libdir/$name"
5290 dlprefiles="$newdlprefiles"
5293 # place dlname in correct position for cygwin
5295 case $host,$output,$installed,$module,$dlname in
5296 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5299 # $outputname - a libtool library file
5300 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5302 # Please DO NOT delete this file!
5303 # It is necessary for linking the library.
5305 # The name that we can dlopen(3).
5308 # Names of this library.
5309 library_names='$library_names'
5311 # The name of the static archive.
5312 old_library='$old_library'
5314 # Libraries that this one depends upon.
5315 dependency_libs='$dependency_libs'
5317 # Version information for $libname.
5322 # Is this an already installed library?
5323 installed=$installed
5325 # Should we warn about portability when linking against -modules?
5326 shouldnotlink=$module
5328 # Files to dlopen/dlpreopen
5330 dlpreopen='$dlprefiles'
5332 # Directory that this library needs to be installed in:
5333 libdir='$install_libdir'"
5334 if test "$installed" = no && test "$need_relink" = yes; then
5336 relink_command=\"$relink_command\""
5341 # Do a symbolic link so that the libtool archive can be found in
5342 # LD_LIBRARY_PATH before the program is installed.
5343 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5344 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5350 # libtool install mode
5352 modename="$modename: install"
5354 # There may be an optional sh(1) argument at the beginning of
5355 # install_prog (especially on Windows NT).
5356 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5357 # Allow the use of GNU shtool's install command.
5358 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5359 # Aesthetically quote it.
5360 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5362 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5366 install_prog="$arg "
5374 # The real first argument should be the name of the installation program.
5375 # Aesthetically quote it.
5376 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5378 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5382 install_prog="$install_prog$arg"
5384 # We need to accept at least all the BSD install flags.
5394 if test -n "$dest"; then
5395 files="$files $dest"
5413 # If the previous option needed an argument, then skip it.
5414 if test -n "$prev"; then
5423 # Aesthetically quote the argument.
5424 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5426 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5430 install_prog="$install_prog $arg"
5433 if test -z "$install_prog"; then
5434 $echo "$modename: you must specify an install program" 1>&2
5439 if test -n "$prev"; then
5440 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5445 if test -z "$files"; then
5446 if test -z "$dest"; then
5447 $echo "$modename: no file or destination specified" 1>&2
5449 $echo "$modename: you must specify a destination" 1>&2
5455 # Strip any trailing slash from the destination.
5456 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5458 # Check to see that the destination is a directory.
5459 test -d "$dest" && isdir=yes
5460 if test "$isdir" = yes; then
5464 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5465 test "X$destdir" = "X$dest" && destdir=.
5466 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5468 # Not a directory, so check to see that there is only one file specified.
5470 if test "$#" -gt 2; then
5471 $echo "$modename: \`$dest' is not a directory" 1>&2
5477 [\\/]* | [A-Za-z]:[\\/]*) ;;
5479 for file in $files; do
5483 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5492 # This variable tells wrapper scripts just to set variables rather
5493 # than running their programs.
5494 libtool_install_magic="$magic"
5499 for file in $files; do
5501 # Do each installation.
5504 # Do the static libraries later.
5505 staticlibs="$staticlibs $file"
5509 # Check to see that this really is a libtool archive.
5510 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5512 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5520 # If there is no directory component, then add one.
5522 */* | *\\*) . $file ;;
5526 # Add the libdir to current_libdirs if it is the destination.
5527 if test "X$destdir" = "X$libdir"; then
5528 case "$current_libdirs " in
5530 *) current_libdirs="$current_libdirs $libdir" ;;
5533 # Note the libdir as a future libdir.
5534 case "$future_libdirs " in
5536 *) future_libdirs="$future_libdirs $libdir" ;;
5540 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5541 test "X$dir" = "X$file/" && dir=
5544 if test -n "$relink_command"; then
5545 # Determine the prefix the user has applied to our future dir.
5546 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5548 # Don't allow the user to place us outside of our expected
5549 # location b/c this prevents finding dependent libraries that
5550 # are installed to the same prefix.
5551 # At present, this check doesn't affect windows .dll's that
5552 # are installed into $libdir/../bin (currently, that works fine)
5553 # but it's something to keep an eye on.
5554 if test "$inst_prefix_dir" = "$destdir"; then
5555 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5559 if test -n "$inst_prefix_dir"; then
5560 # Stick the inst_prefix_dir data into the link command.
5561 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5563 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5566 $echo "$modename: warning: relinking \`$file'" 1>&2
5567 $show "$relink_command"
5568 if $run eval "$relink_command"; then :
5570 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5575 # See the names of the shared library.
5576 set dummy $library_names
5577 if test -n "$2"; then
5583 test -n "$relink_command" && srcname="$realname"T
5585 # Install the shared library and build the symlinks.
5586 $show "$install_prog $dir/$srcname $destdir/$realname"
5587 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5588 if test -n "$stripme" && test -n "$striplib"; then
5589 $show "$striplib $destdir/$realname"
5590 $run eval "$striplib $destdir/$realname" || exit $?
5593 if test "$#" -gt 0; then
5594 # Delete the old symlinks, and create new ones.
5597 if test "$linkname" != "$realname"; then
5598 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5599 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5604 # Do each command in the postinstall commands.
5605 lib="$destdir/$realname"
5606 eval cmds=\"$postinstall_cmds\"
5607 save_ifs="$IFS"; IFS='~'
5608 for cmd in $cmds; do
5611 $run eval "$cmd" || exit $?
5616 # Install the pseudo-library for information purposes.
5617 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5618 instname="$dir/$name"i
5619 $show "$install_prog $instname $destdir/$name"
5620 $run eval "$install_prog $instname $destdir/$name" || exit $?
5622 # Maybe install the static library, too.
5623 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5627 # Install (i.e. copy) a libtool object.
5629 # Figure out destination file name, if it wasn't already specified.
5630 if test -n "$destname"; then
5631 destfile="$destdir/$destname"
5633 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5634 destfile="$destdir/$destfile"
5637 # Deduce the name of the destination old-style object file.
5640 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5643 staticdest="$destfile"
5647 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5653 # Install the libtool object if requested.
5654 if test -n "$destfile"; then
5655 $show "$install_prog $file $destfile"
5656 $run eval "$install_prog $file $destfile" || exit $?
5659 # Install the old object if enabled.
5660 if test "$build_old_libs" = yes; then
5661 # Deduce the name of the old-style object file.
5662 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5664 $show "$install_prog $staticobj $staticdest"
5665 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5671 # Figure out destination file name, if it wasn't already specified.
5672 if test -n "$destname"; then
5673 destfile="$destdir/$destname"
5675 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5676 destfile="$destdir/$destfile"
5679 # If the file is missing, and there is a .exe on the end, strip it
5680 # because it is most likely a libtool script we actually want to
5685 if test ! -f "$file"; then
5686 file=`$echo $file|${SED} 's,.exe$,,'`
5692 # Do a test to see if this is really a libtool program.
5695 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5701 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5705 # To insure that "foo" is sourced, and not "foo.exe",
5706 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5707 # which disallows the automatic-append-.exe behavior.
5709 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5710 *) wrapperdot=${wrapper} ;;
5712 # If there is no directory component, then add one.
5714 */* | *\\*) . ${wrapperdot} ;;
5715 *) . ./${wrapperdot} ;;
5718 # Check the variables that should have been set.
5719 if test -z "$notinst_deplibs"; then
5720 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5725 for lib in $notinst_deplibs; do
5726 # Check to see that each library is installed.
5728 if test -f "$lib"; then
5729 # If there is no directory component, then add one.
5731 */* | *\\*) . $lib ;;
5735 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5736 if test -n "$libdir" && test ! -f "$libfile"; then
5737 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5743 # To insure that "foo" is sourced, and not "foo.exe",
5744 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5745 # which disallows the automatic-append-.exe behavior.
5747 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5748 *) wrapperdot=${wrapper} ;;
5750 # If there is no directory component, then add one.
5752 */* | *\\*) . ${wrapperdot} ;;
5753 *) . ./${wrapperdot} ;;
5757 if test "$fast_install" = no && test -n "$relink_command"; then
5758 if test "$finalize" = yes && test -z "$run"; then
5760 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5761 tmpdir="$tmpdir/libtool-$$"
5762 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5764 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5767 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5768 outputname="$tmpdir/$file"
5769 # Replace the output file specification.
5770 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5772 $show "$relink_command"
5773 if $run eval "$relink_command"; then :
5775 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5781 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5784 # Install the binary that we compiled earlier.
5785 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5789 # remove .exe since cygwin /usr/bin/install will append another
5791 case $install_prog,$host in
5792 */usr/bin/install*,*cygwin*)
5793 case $file:$destfile in
5798 destfile=$destfile.exe
5801 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5806 $show "$install_prog$stripme $file $destfile"
5807 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5808 test -n "$outputname" && ${rm}r "$tmpdir"
5813 for file in $staticlibs; do
5814 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5816 # Set up the ranlib parameters.
5817 oldlib="$destdir/$name"
5819 $show "$install_prog $file $oldlib"
5820 $run eval "$install_prog \$file \$oldlib" || exit $?
5822 if test -n "$stripme" && test -n "$striplib"; then
5823 $show "$old_striplib $oldlib"
5824 $run eval "$old_striplib $oldlib" || exit $?
5827 # Do each command in the postinstall commands.
5828 eval cmds=\"$old_postinstall_cmds\"
5829 save_ifs="$IFS"; IFS='~'
5830 for cmd in $cmds; do
5833 $run eval "$cmd" || exit $?
5838 if test -n "$future_libdirs"; then
5839 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5842 if test -n "$current_libdirs"; then
5843 # Maybe just do a dry run.
5844 test -n "$run" && current_libdirs=" -n$current_libdirs"
5845 exec_cmd='$SHELL $0 --finish$current_libdirs'
5851 # libtool finish mode
5853 modename="$modename: finish"
5857 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5860 libdirs="$libdirs $dir"
5863 for libdir in $libdirs; do
5864 if test -n "$finish_cmds"; then
5865 # Do each command in the finish commands.
5866 eval cmds=\"$finish_cmds\"
5867 save_ifs="$IFS"; IFS='~'
5868 for cmd in $cmds; do
5871 $run eval "$cmd" || admincmds="$admincmds
5876 if test -n "$finish_eval"; then
5877 # Do the single finish_eval.
5878 eval cmds=\"$finish_eval\"
5879 $run eval "$cmds" || admincmds="$admincmds
5885 # Exit here if they wanted silent mode.
5886 test "$show" = : && exit 0
5888 $echo "----------------------------------------------------------------------"
5889 $echo "Libraries have been installed in:"
5890 for libdir in $libdirs; do
5894 $echo "If you ever happen to want to link against installed libraries"
5895 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5896 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5897 $echo "flag during linking and do at least one of the following:"
5898 if test -n "$shlibpath_var"; then
5899 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5900 $echo " during execution"
5902 if test -n "$runpath_var"; then
5903 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5904 $echo " during linking"
5906 if test -n "$hardcode_libdir_flag_spec"; then
5908 eval flag=\"$hardcode_libdir_flag_spec\"
5910 $echo " - use the \`$flag' linker flag"
5912 if test -n "$admincmds"; then
5913 $echo " - have your system administrator run these commands:$admincmds"
5915 if test -f /etc/ld.so.conf; then
5916 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5919 $echo "See any operating system documentation about shared libraries for"
5920 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5921 $echo "----------------------------------------------------------------------"
5925 # libtool execute mode
5927 modename="$modename: execute"
5929 # The first argument is the command name.
5931 if test -z "$cmd"; then
5932 $echo "$modename: you must specify a COMMAND" 1>&2
5937 # Handle -dlopen flags immediately.
5938 for file in $execute_dlfiles; do
5939 if test ! -f "$file"; then
5940 $echo "$modename: \`$file' is not a file" 1>&2
5948 # Check to see that this really is a libtool archive.
5949 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5951 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5956 # Read the libtool library.
5960 # If there is no directory component, then add one.
5962 */* | *\\*) . $file ;;
5966 # Skip this library if it cannot be dlopened.
5967 if test -z "$dlname"; then
5968 # Warn if it was a shared library.
5969 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5973 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5974 test "X$dir" = "X$file" && dir=.
5976 if test -f "$dir/$objdir/$dlname"; then
5979 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5985 # Just add the directory containing the .lo file.
5986 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5987 test "X$dir" = "X$file" && dir=.
5991 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5996 # Get the absolute pathname.
5997 absdir=`cd "$dir" && pwd`
5998 test -n "$absdir" && dir="$absdir"
6000 # Now add the directory to shlibpath_var.
6001 if eval "test -z \"\$$shlibpath_var\""; then
6002 eval "$shlibpath_var=\"\$dir\""
6004 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6008 # This variable tells wrapper scripts just to set shlibpath_var
6009 # rather than running their programs.
6010 libtool_execute_magic="$magic"
6012 # Check if any of the arguments is a wrapper script.
6019 # Do a test to see if this is really a libtool program.
6020 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6021 # If there is no directory component, then add one.
6023 */* | *\\*) . $file ;;
6027 # Transform arg to wrapped name.
6028 file="$progdir/$program"
6032 # Quote arguments (to preserve shell metacharacters).
6033 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6034 args="$args \"$file\""
6037 if test -z "$run"; then
6038 if test -n "$shlibpath_var"; then
6039 # Export the shlibpath_var.
6040 eval "export $shlibpath_var"
6043 # Restore saved environment variables
6044 if test "${save_LC_ALL+set}" = set; then
6045 LC_ALL="$save_LC_ALL"; export LC_ALL
6047 if test "${save_LANG+set}" = set; then
6048 LANG="$save_LANG"; export LANG
6051 # Now prepare to actually exec the command.
6052 exec_cmd="\$cmd$args"
6054 # Display what would be done.
6055 if test -n "$shlibpath_var"; then
6056 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6057 $echo "export $shlibpath_var"
6064 # libtool clean and uninstall mode
6066 modename="$modename: $mode"
6072 # This variable tells wrapper scripts just to set variables rather
6073 # than running their programs.
6074 libtool_install_magic="$magic"
6079 -f) rm="$rm $arg"; rmforce=yes ;;
6080 -*) rm="$rm $arg" ;;
6081 *) files="$files $arg" ;;
6085 if test -z "$rm"; then
6086 $echo "$modename: you must specify an RM program" 1>&2
6093 origobjdir="$objdir"
6094 for file in $files; do
6095 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6096 if test "X$dir" = "X$file"; then
6098 objdir="$origobjdir"
6100 objdir="$dir/$origobjdir"
6102 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6103 test "$mode" = uninstall && objdir="$dir"
6105 # Remember objdir for removal later, being careful to avoid duplicates
6106 if test "$mode" = clean; then
6109 *) rmdirs="$rmdirs $objdir" ;;
6113 # Don't error if the file doesn't exist and rm -f was used.
6114 if (test -L "$file") >/dev/null 2>&1 \
6115 || (test -h "$file") >/dev/null 2>&1 \
6116 || test -f "$file"; then
6118 elif test -d "$file"; then
6121 elif test "$rmforce" = yes; then
6129 # Possibly a libtool archive, so verify it.
6130 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6133 # Delete the libtool libraries and symlinks.
6134 for n in $library_names; do
6135 rmfiles="$rmfiles $objdir/$n"
6137 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6138 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6140 if test "$mode" = uninstall; then
6141 if test -n "$library_names"; then
6142 # Do each command in the postuninstall commands.
6143 eval cmds=\"$postuninstall_cmds\"
6144 save_ifs="$IFS"; IFS='~'
6145 for cmd in $cmds; do
6149 if test "$?" -ne 0 && test "$rmforce" != yes; then
6156 if test -n "$old_library"; then
6157 # Do each command in the old_postuninstall commands.
6158 eval cmds=\"$old_postuninstall_cmds\"
6159 save_ifs="$IFS"; IFS='~'
6160 for cmd in $cmds; do
6164 if test "$?" -ne 0 && test "$rmforce" != yes; then
6170 # FIXME: should reinstall the best remaining shared library.
6176 # Possibly a libtool object, so verify it.
6177 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6182 # Add PIC object to the list of files to remove.
6183 if test -n "$pic_object" \
6184 && test "$pic_object" != none; then
6185 rmfiles="$rmfiles $dir/$pic_object"
6188 # Add non-PIC object to the list of files to remove.
6189 if test -n "$non_pic_object" \
6190 && test "$non_pic_object" != none; then
6191 rmfiles="$rmfiles $dir/$non_pic_object"
6197 if test "$mode" = clean ; then
6201 file=`$echo $file|${SED} 's,.exe$,,'`
6202 noexename=`$echo $name|${SED} 's,.exe$,,'`
6203 # $file with .exe has already been added to rmfiles,
6204 # add $file without .exe
6205 rmfiles="$rmfiles $file"
6208 # Do a test to see if this is a libtool program.
6209 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6213 # note $name still contains .exe if it was in $file originally
6214 # as does the version of $file that was added into $rmfiles
6215 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6216 if test "$fast_install" = yes && test -n "$relink_command"; then
6217 rmfiles="$rmfiles $objdir/lt-$name"
6219 if test "X$noexename" != "X$name" ; then
6220 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6226 $show "$rm $rmfiles"
6227 $run $rm $rmfiles || exit_status=1
6229 objdir="$origobjdir"
6231 # Try to remove the ${objdir}s in the directories where we deleted files
6232 for dir in $rmdirs; do
6233 if test -d "$dir"; then
6235 $run rmdir $dir >/dev/null 2>&1
6243 $echo "$modename: you must specify a MODE" 1>&2
6244 $echo "$generic_help" 1>&2
6249 if test -z "$exec_cmd"; then
6250 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6251 $echo "$generic_help" 1>&2
6254 fi # test -z "$show_help"
6256 if test -n "$exec_cmd"; then
6261 # We need to display help for each of the modes.
6264 "Usage: $modename [OPTION]... [MODE-ARG]...
6266 Provide generalized library-building support services.
6268 --config show all configuration variables
6269 --debug enable verbose shell tracing
6270 -n, --dry-run display commands without modifying any files
6271 --features display basic configuration information and exit
6272 --finish same as \`--mode=finish'
6273 --help display this help message and exit
6274 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6275 --quiet same as \`--silent'
6276 --silent don't print informational messages
6277 --tag=TAG use configuration variables from tag TAG
6278 --version print version information
6280 MODE must be one of the following:
6282 clean remove files from the build directory
6283 compile compile a source file into a libtool object
6284 execute automatically set library path, then run a program
6285 finish complete the installation of libtool libraries
6286 install install libraries or executables
6287 link create a library or an executable
6288 uninstall remove libraries from an installed directory
6290 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6291 a more detailed description of MODE.
6293 Report bugs to <bug-libtool@gnu.org>."
6299 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6301 Remove files from the build directory.
6303 RM is the name of the program to use to delete files associated with each FILE
6304 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6307 If FILE is a libtool library, object or program, all the files associated
6308 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6313 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6315 Compile a source file into a libtool library object.
6317 This mode accepts the following additional options:
6319 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6320 -prefer-pic try to building PIC objects only
6321 -prefer-non-pic try to building non-PIC objects only
6322 -static always build a \`.o' file suitable for static linking
6324 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6325 from the given SOURCEFILE.
6327 The output file name is determined by removing the directory component from
6328 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6329 library object suffix, \`.lo'."
6334 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6336 Automatically set library path, then run a program.
6338 This mode accepts the following additional options:
6340 -dlopen FILE add the directory containing FILE to the library path
6342 This mode sets the library path environment variable according to \`-dlopen'
6345 If any of the ARGS are libtool executable wrappers, then they are translated
6346 into their corresponding uninstalled binary, and any of their required library
6347 directories are added to the library path.
6349 Then, COMMAND is executed, with ARGS as arguments."
6354 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6356 Complete the installation of libtool libraries.
6358 Each LIBDIR is a directory that contains libtool libraries.
6360 The commands that this mode executes may require superuser privileges. Use
6361 the \`--dry-run' option if you just want to see what would be executed."
6366 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6368 Install executables or libraries.
6370 INSTALL-COMMAND is the installation command. The first component should be
6371 either the \`install' or \`cp' program.
6373 The rest of the components are interpreted as arguments to that command (only
6374 BSD-compatible install options are recognized)."
6379 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6381 Link object files or libraries together to form another library, or to
6382 create an executable program.
6384 LINK-COMMAND is a command using the C compiler that you would use to create
6385 a program from several object files.
6387 The following components of LINK-COMMAND are treated specially:
6389 -all-static do not do any dynamic linking at all
6390 -avoid-version do not add a version suffix if possible
6391 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6392 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6393 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6394 -export-symbols SYMFILE
6395 try to export only the symbols listed in SYMFILE
6396 -export-symbols-regex REGEX
6397 try to export only the symbols matching REGEX
6398 -LLIBDIR search LIBDIR for required installed libraries
6399 -lNAME OUTPUT-FILE requires the installed library libNAME
6400 -module build a library that can dlopened
6401 -no-fast-install disable the fast-install mode
6402 -no-install link a not-installable executable
6403 -no-undefined declare that a library does not refer to external symbols
6404 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6405 -objectlist FILE Use a list of object files found in FILE to specify objects
6406 -release RELEASE specify package release information
6407 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6408 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6409 -static do not do any dynamic linking of libtool libraries
6410 -version-info CURRENT[:REVISION[:AGE]]
6411 specify library version info [each variable defaults to 0]
6413 All other options (arguments beginning with \`-') are ignored.
6415 Every other argument is treated as a filename. Files ending in \`.la' are
6416 treated as uninstalled libtool libraries, other files are standard or library
6419 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6420 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6421 required, except when creating a convenience library.
6423 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6424 using \`ar' and \`ranlib', or on Windows using \`lib'.
6426 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6427 is created, otherwise an executable program is created."
6432 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6434 Remove libraries from an installation directory.
6436 RM is the name of the program to use to delete files associated with each FILE
6437 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6440 If FILE is a libtool library, all the files associated with it are deleted.
6441 Otherwise, only FILE itself is deleted using RM."
6445 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6452 $echo "Try \`$modename --help' for more information about other modes."
6456 # The TAGs below are defined such that we never get into a situation
6457 # in which we disable both kinds of libraries. Given conflicting
6458 # choices, we go for a static library, that is the most portable,
6459 # since we can't tell whether shared libraries were disabled because
6460 # the user asked for that or because the platform doesn't support
6461 # them. This is particularly important on AIX, because we don't
6462 # support having both static and shared libraries enabled at the same
6463 # time on that platform, so we default to a shared-only configuration.
6464 # If a disable-shared tag is given, we'll fallback to a static-only
6465 # configuration. But we'll never go from static-only to shared-only.
6467 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6468 build_libtool_libs=no
6470 # ### END LIBTOOL TAG CONFIG: disable-shared
6472 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6473 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6474 # ### END LIBTOOL TAG CONFIG: disable-static