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.35 2003/11/12 18:51:58) Debian$Rev: 159 $"
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|tr A '\301'` in
74 A) # 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
100 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101 $echo "$modename: not configured to build any kind of library" 1>&2
102 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
115 lo2o="s/\\.lo\$/.${objext}/"
116 o2lo="s/\\.${objext}\$/.lo/"
118 #####################################
119 # Shell function definitions:
120 # This seems to be the best place for them
122 # Need a lot of goo to handle *both* DLLs and import libs
123 # Has to be a shell function in order to 'eat' the argument
124 # that is supplied when $file_magic_command is called.
126 win32_libid_type="unknown"
127 win32_fileres=`file -L $1 2>/dev/null`
128 case $win32_fileres in
129 *ar\ archive\ import\ library*) # definitely import
130 win32_libid_type="x86 archive import"
132 *ar\ archive*) # could be an import, or static
133 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135 win32_nmres=`eval $NM -f posix -A $1 | \
136 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137 if test "X$win32_nmres" = "Ximport" ; then
138 win32_libid_type="x86 archive import"
140 win32_libid_type="x86 archive static"
145 win32_libid_type="x86 DLL"
147 *executable*) # but shell scripts are "executable" too...
148 case $win32_fileres in
149 *MS\ Windows\ PE\ Intel*)
150 win32_libid_type="x86 DLL"
155 $echo $win32_libid_type
158 # End of Shell function definitions
159 #####################################
161 # Parse our command line options once, thoroughly.
162 while test "$#" -gt 0
168 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
172 # If the previous option needs an argument, assign it.
173 if test -n "$prev"; then
176 execute_dlfiles="$execute_dlfiles $arg"
180 preserve_args="${preserve_args}=$arg"
182 # Check whether tagname contains only valid characters
185 $echo "$progname: invalid tag name: $tagname" 1>&2
192 # Don't test for the "default" C tag, as we know, it's there, but
193 # not specially marked.
196 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
197 taglist="$taglist $tagname"
198 # Evaluate the configuration.
199 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201 $echo "$progname: ignoring unknown tag $tagname" 1>&2
216 # Have we seen a non-optional argument yet?
223 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
226 $echo "This is free software; see the source for copying conditions. There is NO"
227 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
232 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
233 # Now print the configurations for the tags.
234 for tagname in $taglist; do
235 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
241 $echo "$progname: enabling shell trace mode"
243 preserve_args="$preserve_args $arg"
252 if test "$build_libtool_libs" = yes; then
253 $echo "enable shared libraries"
255 $echo "disable shared libraries"
257 if test "$build_old_libs" = yes; then
258 $echo "enable static libraries"
260 $echo "disable static libraries"
265 --finish) mode="finish" ;;
267 --mode) prevopt="--mode" prev=mode ;;
268 --mode=*) mode="$optarg" ;;
270 --preserve-dup-deps) duplicate_deps="yes" ;;
274 preserve_args="$preserve_args $arg"
277 --tag) prevopt="--tag" prev=tag ;;
279 set tag "$optarg" ${1+"$@"}
282 preserve_args="$preserve_args --tag"
291 $echo "$modename: unrecognized option \`$arg'" 1>&2
303 if test -n "$prevopt"; then
304 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
309 # If this variable is set in any of the actions, the command in it
310 # will be execed at the end. This prevents here-documents from being
311 # left over by shells.
314 if test -z "$show_help"; then
316 # Infer the operation mode.
317 if test -z "$mode"; then
318 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
319 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
321 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
333 *db | *dbx | *strace | *truss)
343 # If we have no mode, but dlfiles were specified, then do execute mode.
344 test -n "$execute_dlfiles" && mode=execute
346 # Just use the default operation mode.
347 if test -z "$mode"; then
348 if test -n "$nonopt"; then
349 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
351 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
358 # Only execute mode is allowed to have -dlopen flags.
359 if test -n "$execute_dlfiles" && test "$mode" != execute; then
360 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
365 # Change the help message to a mode-specific one.
367 help="Try \`$modename --help --mode=$mode' for more information."
369 # These modes are in order of execution frequency so that they run quickly.
371 # libtool compile mode
373 modename="$modename: compile"
374 # Get the compilation command and the source file.
376 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
387 # do not "continue". Instead, add this to base_compile
399 # Accept any command-line options.
402 if test -n "$libobj" ; then
403 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
410 -static | -prefer-pic | -prefer-non-pic)
421 arg_mode=arg # the next one goes into the "base_compile" arg list
422 continue # The current "srcfile" will either be retained or
423 ;; # replaced later. I would guess that would be a bug.
426 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
428 save_ifs="$IFS"; IFS=','
432 # Double-quote args containing other shell metacharacters.
433 # Many Bourne shells cannot handle close brackets correctly
434 # in scan sets, so we specify it separately.
436 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
440 lastarg="$lastarg $arg"
443 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
445 # Add the arguments to base_compile.
446 base_compile="$base_compile $lastarg"
451 # Accept the current argument as the source file.
452 # The previous "srcfile" becomes the current argument.
459 esac # case $arg_mode
461 # Aesthetically quote the previous argument.
462 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
465 # Double-quote args containing other shell metacharacters.
466 # Many Bourne shells cannot handle close brackets correctly
467 # in scan sets, so we specify it separately.
468 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
469 lastarg="\"$lastarg\""
473 base_compile="$base_compile $lastarg"
478 $echo "$modename: you must specify an argument for -Xcompile"
482 $echo "$modename: you must specify a target with \`-o'" 1>&2
486 # Get the name of the library object.
487 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
491 # Recognize several different file suffixes.
492 # If the user specifies -o file.o, it is replaced with file.lo
502 *.class) xform=class ;;
507 *.java) xform=java ;;
510 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
513 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
515 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
520 # Infer tagged configuration to use if any are available and
521 # if one wasn't chosen via the "--tag" command line option.
522 # Only attempt this if the compiler in the base compile
523 # command doesn't match the default compiler.
524 if test -n "$available_tags" && test -z "$tagname"; then
525 case $base_compile in
526 # Blanks in the command may have been stripped by the calling shell,
527 # but not from the CC environment variable when configure was run.
528 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
529 # Blanks at the start of $base_compile will cause this to fail
530 # if we don't check for them as well.
532 for z in $available_tags; do
533 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
534 # Evaluate the configuration.
535 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
536 case "$base_compile " in
537 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
538 # The compiler in the base compile command matches
539 # the one in the tagged configuration.
540 # Assume this is the tagged configuration we want.
547 # If $tagname still isn't set, then no tagged configuration
548 # was found and let the user know that the "--tag" command
549 # line option must be used.
550 if test -z "$tagname"; then
551 $echo "$modename: unable to infer tagged configuration"
552 $echo "$modename: specify a tag with \`--tag'" 1>&2
555 # $echo "$modename: using $tagname tagged configuration"
561 for arg in $later; do
580 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
581 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
582 if test "X$xdir" = "X$obj"; then
587 lobj=${xdir}$objdir/$objname
589 if test -z "$base_compile"; then
590 $echo "$modename: you must specify a compilation command" 1>&2
595 # Delete any leftover library objects.
596 if test "$build_old_libs" = yes; then
597 removelist="$obj $lobj $libobj ${libobj}T"
599 removelist="$lobj $libobj ${libobj}T"
603 trap "$run $rm $removelist; exit 1" 1 2 15
605 # On Cygwin there's no "real" PIC flag so we must build both object types
607 cygwin* | mingw* | pw32* | os2*)
611 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
612 # non-PIC code in shared libraries is not supported
616 # Calculate the filename of the output object if compiler does
617 # not support -o with -c
618 if test "$compiler_c_o" = no; then
619 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
620 lockfile="$output_obj.lock"
621 removelist="$removelist $output_obj $lockfile"
622 trap "$run $rm $removelist; exit 1" 1 2 15
629 # Lock this critical section if it is needed
630 # We use this script file to make the link, it avoids creating a new file
631 if test "$need_locks" = yes; then
632 until $run ln "$0" "$lockfile" 2>/dev/null; do
633 $show "Waiting for $lockfile to be removed"
636 elif test "$need_locks" = warn; then
637 if test -f "$lockfile"; then
639 *** ERROR, $lockfile exists and contains:
640 `cat $lockfile 2>/dev/null`
642 This indicates that another process is trying to use the same
643 temporary object file, and libtool could not work around it because
644 your compiler does not support \`-c' and \`-o' together. If you
645 repeat this compilation, it may succeed, by chance, but you had better
646 avoid parallel builds (make -j) in this platform, or get a better
652 $echo $srcfile > "$lockfile"
655 if test -n "$fix_srcfile_path"; then
656 eval srcfile=\"$fix_srcfile_path\"
659 $run $rm "$libobj" "${libobj}T"
661 # Create a libtool object file (analogous to a ".la" file),
662 # but don't create it if we're doing a dry run.
663 test -z "$run" && cat > ${libobj}T <<EOF
664 # $libobj - a libtool object file
665 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
667 # Please DO NOT delete this file!
668 # It is necessary for linking the library.
670 # Name of the PIC object.
673 # Only build a PIC object if we are building libtool libraries.
674 if test "$build_libtool_libs" = yes; then
675 # Without this assignment, base_compile gets emptied.
676 fbsd_hideous_sh_bug=$base_compile
678 if test "$pic_mode" != no; then
679 command="$base_compile $srcfile $pic_flag"
681 # Don't build PIC code
682 command="$base_compile $srcfile"
685 if test ! -d "${xdir}$objdir"; then
686 $show "$mkdir ${xdir}$objdir"
687 $run $mkdir ${xdir}$objdir
689 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
694 if test -z "$output_obj"; then
695 # Place PIC objects in $objdir
696 command="$command -o $lobj"
699 $run $rm "$lobj" "$output_obj"
702 if $run eval "$command"; then :
704 test -n "$output_obj" && $run $rm $removelist
708 if test "$need_locks" = warn &&
709 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
711 *** ERROR, $lockfile contains:
712 `cat $lockfile 2>/dev/null`
714 but it should contain:
717 This indicates that another process is trying to use the same
718 temporary object file, and libtool could not work around it because
719 your compiler does not support \`-c' and \`-o' together. If you
720 repeat this compilation, it may succeed, by chance, but you had better
721 avoid parallel builds (make -j) in this platform, or get a better
728 # Just move the object if needed, then go on to compile the next one
729 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
730 $show "$mv $output_obj $lobj"
731 if $run $mv $output_obj $lobj; then :
739 # Append the name of the PIC object to the libtool object file.
740 test -z "$run" && cat >> ${libobj}T <<EOF
741 pic_object='$objdir/$objname'
745 # Allow error messages only from the first compilation.
746 if test "$suppress_opt" = yes; then
747 suppress_output=' >/dev/null 2>&1'
750 # No PIC object so indicate it doesn't exist in the libtool
752 test -z "$run" && cat >> ${libobj}T <<EOF
758 # Only build a position-dependent object if we build old libraries.
759 if test "$build_old_libs" = yes; then
760 if test "$pic_mode" != yes; then
761 # Don't build PIC code
762 command="$base_compile $srcfile"
764 command="$base_compile $srcfile $pic_flag"
766 if test "$compiler_c_o" = yes; then
767 command="$command -o $obj"
770 # Suppress compiler output if we already did a PIC compilation.
771 command="$command$suppress_output"
772 $run $rm "$obj" "$output_obj"
774 if $run eval "$command"; then :
780 if test "$need_locks" = warn &&
781 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
783 *** ERROR, $lockfile contains:
784 `cat $lockfile 2>/dev/null`
786 but it should contain:
789 This indicates that another process is trying to use the same
790 temporary object file, and libtool could not work around it because
791 your compiler does not support \`-c' and \`-o' together. If you
792 repeat this compilation, it may succeed, by chance, but you had better
793 avoid parallel builds (make -j) in this platform, or get a better
800 # Just move the object if needed
801 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
802 $show "$mv $output_obj $obj"
803 if $run $mv $output_obj $obj; then :
811 # Append the name of the non-PIC object the libtool object file.
812 # Only append if the libtool object file exists.
813 test -z "$run" && cat >> ${libobj}T <<EOF
814 # Name of the non-PIC object.
815 non_pic_object='$objname'
819 # Append the name of the non-PIC object the libtool object file.
820 # Only append if the libtool object file exists.
821 test -z "$run" && cat >> ${libobj}T <<EOF
822 # Name of the non-PIC object.
828 $run $mv "${libobj}T" "${libobj}"
830 # Unlock the critical section if it was locked
831 if test "$need_locks" != no; then
840 modename="$modename: link"
842 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
843 # It is impossible to link a dll without this setting, and
844 # we shouldn't force the makefile maintainer to figure out
845 # which system we are compiling for in order to pass an extra
846 # flag for every libtool invocation.
849 # FIXME: Unfortunately, there are problems with the above when trying
850 # to make a dll which has undefined symbols, in which case not
851 # even a static library is built. For now, we need to specify
852 # -no-undefined on the libtool link line when we can be certain
853 # that all symbols are satisfied, otherwise we get a static library.
860 libtool_args="$nonopt"
861 base_compile="$nonopt"
862 compile_command="$nonopt"
863 finalize_command="$nonopt"
876 lib_search_path=`pwd`
885 export_symbols_regex=
893 prefer_static_libs=no
906 # Infer tagged configuration to use if any are available and
907 # if one wasn't chosen via the "--tag" command line option.
908 # Only attempt this if the compiler in the base link
909 # command doesn't match the default compiler.
910 if test -n "$available_tags" && test -z "$tagname"; then
911 case "$base_compile " in
912 # Blanks in the command may have been stripped by the calling shell,
913 # but not from the CC environment variable when configure was run.
914 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
915 # Blanks at the start of $base_compile will cause this to fail
916 # if we don't check for them as well.
918 for z in $available_tags; do
919 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
920 # Evaluate the configuration.
921 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
922 case "$base_compile " in
923 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
924 # The compiler in $compile_command matches
925 # the one in the tagged configuration.
926 # Assume this is the tagged configuration we want.
933 # If $tagname still isn't set, then no tagged configuration
934 # was found and let the user know that the "--tag" command
935 # line option must be used.
936 if test -z "$tagname"; then
937 $echo "$modename: unable to infer tagged configuration"
938 $echo "$modename: specify a tag with \`--tag'" 1>&2
941 # $echo "$modename: using $tagname tagged configuration"
947 # We need to know -static, to get the right output filenames.
951 -all-static | -static)
952 if test "X$arg" = "X-all-static"; then
953 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
954 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
956 if test -n "$link_static_flag"; then
957 dlopen_self=$dlopen_self_static
960 if test -z "$pic_flag" && test -n "$link_static_flag"; then
961 dlopen_self=$dlopen_self_static
964 build_libtool_libs=no
966 prefer_static_libs=yes
972 # See if our shared archives depend on static archives.
973 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
975 # Go through the arguments, transforming them on the way.
976 while test "$#" -gt 0; do
978 base_compile="$base_compile $arg"
981 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
982 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
986 libtool_args="$libtool_args $qarg"
988 # If the previous option needs an argument, assign it.
989 if test -n "$prev"; then
992 compile_command="$compile_command @OUTPUT@"
993 finalize_command="$finalize_command @OUTPUT@"
999 if test "$preload" = no; then
1000 # Add the symbol object into the linking commands.
1001 compile_command="$compile_command @SYMFILE@"
1002 finalize_command="$finalize_command @SYMFILE@"
1006 *.la | *.lo) ;; # We handle these cases below.
1008 if test "$dlself" = no; then
1016 if test "$prev" = dlprefiles; then
1018 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1028 if test "$prev" = dlfiles; then
1029 dlfiles="$dlfiles $arg"
1031 dlprefiles="$dlprefiles $arg"
1039 export_symbols="$arg"
1040 if test ! -f "$arg"; then
1041 $echo "$modename: symbol file \`$arg' does not exist"
1048 export_symbols_regex="$arg"
1053 inst_prefix_dir="$arg"
1063 if test -f "$arg"; then
1066 for fil in `cat $save_arg`
1068 # moreargs="$moreargs $fil"
1070 # A libtool-controlled object.
1072 # Check to see that this really is a libtool object.
1073 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1078 # If there is no directory component, then add one.
1080 */* | *\\*) . $arg ;;
1084 if test -z "$pic_object" || \
1085 test -z "$non_pic_object" ||
1086 test "$pic_object" = none && \
1087 test "$non_pic_object" = none; then
1088 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1092 # Extract subdirectory from the argument.
1093 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1094 if test "X$xdir" = "X$arg"; then
1100 if test "$pic_object" != none; then
1101 # Prepend the subdirectory the object is found in.
1102 pic_object="$xdir$pic_object"
1104 if test "$prev" = dlfiles; then
1105 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1106 dlfiles="$dlfiles $pic_object"
1110 # If libtool objects are unsupported, then we need to preload.
1115 # CHECK ME: I think I busted this. -Ossama
1116 if test "$prev" = dlprefiles; then
1117 # Preload the old-style object.
1118 dlprefiles="$dlprefiles $pic_object"
1123 libobjs="$libobjs $pic_object"
1128 if test "$non_pic_object" != none; then
1129 # Prepend the subdirectory the object is found in.
1130 non_pic_object="$xdir$non_pic_object"
1132 # A standard non-PIC object
1133 non_pic_objects="$non_pic_objects $non_pic_object"
1134 if test -z "$pic_object" || test "$pic_object" = none ; then
1135 arg="$non_pic_object"
1139 # Only an error if not doing a dry-run.
1140 if test -z "$run"; then
1141 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1146 # Extract subdirectory from the argument.
1147 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1148 if test "X$xdir" = "X$arg"; then
1154 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1155 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1156 libobjs="$libobjs $pic_object"
1157 non_pic_objects="$non_pic_objects $non_pic_object"
1162 $echo "$modename: link input file \`$save_arg' does not exist"
1170 # We need an absolute path.
1172 [\\/]* | [A-Za-z]:[\\/]*) ;;
1174 $echo "$modename: only absolute run-paths are allowed" 1>&2
1178 if test "$prev" = rpath; then
1181 *) rpath="$rpath $arg" ;;
1186 *) xrpath="$xrpath $arg" ;;
1193 compiler_flags="$compiler_flags $qarg"
1195 compile_command="$compile_command $qarg"
1196 finalize_command="$finalize_command $qarg"
1200 linker_flags="$linker_flags $qarg"
1201 compiler_flags="$compiler_flags $wl$qarg"
1203 compile_command="$compile_command $wl$qarg"
1204 finalize_command="$finalize_command $wl$qarg"
1208 linker_flags="$linker_flags $qarg"
1209 compiler_flags="$compiler_flags $qarg"
1211 compile_command="$compile_command $qarg"
1212 finalize_command="$finalize_command $qarg"
1216 eval "$prev=\"\$arg\""
1221 fi # test -n "$prev"
1227 if test -n "$link_static_flag"; then
1228 compile_command="$compile_command $link_static_flag"
1229 finalize_command="$finalize_command $link_static_flag"
1235 # FIXME: remove this flag sometime in the future.
1236 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1260 -export-symbols | -export-symbols-regex)
1261 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1262 $echo "$modename: more than one -exported-symbols argument is not allowed"
1265 if test "X$arg" = "X-export-symbols"; then
1278 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1279 # so, if we see these flags be careful not to treat them like -L
1281 case $with_gcc/$host in
1282 no/*-*-irix* | /*-*-irix*)
1283 compile_command="$compile_command $arg"
1284 finalize_command="$finalize_command $arg"
1291 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1292 # We need an absolute path.
1294 [\\/]* | [A-Za-z]:[\\/]*) ;;
1296 absdir=`cd "$dir" && pwd`
1297 if test -z "$absdir"; then
1298 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1307 deplibs="$deplibs -L$dir"
1308 lib_search_path="$lib_search_path $dir"
1312 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1313 case :$dllsearchpath: in
1315 *) dllsearchpath="$dllsearchpath:$dir";;
1323 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1325 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1326 # These systems don't actually have a C or math library (as such)
1329 *-*-mingw* | *-*-os2*)
1330 # These systems don't actually have a C library (as such)
1331 test "X$arg" = "X-lc" && continue
1333 *-*-openbsd* | *-*-freebsd*)
1334 # Do not include libc due to us having libc/libc_r.
1335 test "X$arg" = "X-lc" && continue
1337 *-*-rhapsody* | *-*-darwin1.[012])
1338 # Rhapsody C and math libraries are in the System framework
1339 deplibs="$deplibs -framework System"
1342 elif test "X$arg" = "X-lc_r"; then
1344 *-*-openbsd* | *-*-freebsd*)
1345 # Do not include libc_r directly, use -pthread flag.
1350 deplibs="$deplibs $arg"
1354 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1355 deplibs="$deplibs $arg"
1364 # gcc -m* arguments should be passed to the linker via $compiler_flags
1365 # in order to pass architecture information to the linker
1366 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1367 # but this is not reliable with gcc because gcc may use -mfoo to
1368 # select a different linker, different libraries, etc, while
1369 # -Wl,-mfoo simply passes -mfoo to the linker.
1371 # Unknown arguments in both finalize_command and compile_command need
1372 # to be aesthetically quoted because they are evaled later.
1373 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1375 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1379 compile_command="$compile_command $arg"
1380 finalize_command="$finalize_command $arg"
1381 if test "$with_gcc" = "yes" ; then
1382 compiler_flags="$compiler_flags $arg"
1399 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1400 # The PATH hackery in wrapper scripts is required on Windows
1401 # in order for the loader to find any dlls it needs.
1402 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1403 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1406 *) no_install=yes ;;
1439 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1440 # We need an absolute path.
1442 [\\/]* | [A-Za-z]:[\\/]*) ;;
1444 $echo "$modename: only absolute run-paths are allowed" 1>&2
1450 *) xrpath="$xrpath $dir" ;;
1456 # The effects of -static are defined in a previous loop.
1457 # We used to do the same as -all-static on platforms that
1458 # didn't have a PIC flag, but the assumption that the effects
1459 # would be equivalent was wrong. It would break on at least
1460 # Digital Unix and AIX.
1480 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1482 save_ifs="$IFS"; IFS=','
1483 for flag in $args; do
1486 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1491 compiler_flags="$compiler_flags $flag"
1494 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1498 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1500 save_ifs="$IFS"; IFS=','
1501 for flag in $args; do
1504 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1509 compiler_flags="$compiler_flags $wl$flag"
1510 linker_flags="$linker_flags $flag"
1513 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1531 # Some other compiler flag.
1533 # Unknown arguments in both finalize_command and compile_command need
1534 # to be aesthetically quoted because they are evaled later.
1535 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1537 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1544 # A standard object.
1549 # A libtool-controlled object.
1551 # Check to see that this really is a libtool object.
1552 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1557 # If there is no directory component, then add one.
1559 */* | *\\*) . $arg ;;
1563 if test -z "$pic_object" || \
1564 test -z "$non_pic_object" ||
1565 test "$pic_object" = none && \
1566 test "$non_pic_object" = none; then
1567 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1571 # Extract subdirectory from the argument.
1572 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1573 if test "X$xdir" = "X$arg"; then
1579 if test "$pic_object" != none; then
1580 # Prepend the subdirectory the object is found in.
1581 pic_object="$xdir$pic_object"
1583 if test "$prev" = dlfiles; then
1584 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1585 dlfiles="$dlfiles $pic_object"
1589 # If libtool objects are unsupported, then we need to preload.
1594 # CHECK ME: I think I busted this. -Ossama
1595 if test "$prev" = dlprefiles; then
1596 # Preload the old-style object.
1597 dlprefiles="$dlprefiles $pic_object"
1602 libobjs="$libobjs $pic_object"
1607 if test "$non_pic_object" != none; then
1608 # Prepend the subdirectory the object is found in.
1609 non_pic_object="$xdir$non_pic_object"
1611 # A standard non-PIC object
1612 non_pic_objects="$non_pic_objects $non_pic_object"
1613 if test -z "$pic_object" || test "$pic_object" = none ; then
1614 arg="$non_pic_object"
1618 # Only an error if not doing a dry-run.
1619 if test -z "$run"; then
1620 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1625 # Extract subdirectory from the argument.
1626 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1627 if test "X$xdir" = "X$arg"; then
1633 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1634 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1635 libobjs="$libobjs $pic_object"
1636 non_pic_objects="$non_pic_objects $non_pic_object"
1643 deplibs="$deplibs $arg"
1644 old_deplibs="$old_deplibs $arg"
1649 # A libtool-controlled library.
1651 if test "$prev" = dlfiles; then
1652 # This library was specified with -dlopen.
1653 dlfiles="$dlfiles $arg"
1655 elif test "$prev" = dlprefiles; then
1656 # The library was specified with -dlpreopen.
1657 dlprefiles="$dlprefiles $arg"
1660 deplibs="$deplibs $arg"
1665 # Some other compiler argument.
1667 # Unknown arguments in both finalize_command and compile_command need
1668 # to be aesthetically quoted because they are evaled later.
1669 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1671 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1678 # Now actually substitute the argument into the commands.
1679 if test -n "$arg"; then
1680 compile_command="$compile_command $arg"
1681 finalize_command="$finalize_command $arg"
1683 done # argument parsing loop
1685 if test -n "$prev"; then
1686 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1691 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1692 eval arg=\"$export_dynamic_flag_spec\"
1693 compile_command="$compile_command $arg"
1694 finalize_command="$finalize_command $arg"
1698 # calculate the name of the file, without its directory
1699 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1700 libobjs_save="$libobjs"
1702 if test -n "$shlibpath_var"; then
1703 # get the directories listed in $shlibpath_var
1704 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1708 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1709 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1711 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1712 if test "X$output_objdir" = "X$output"; then
1713 output_objdir="$objdir"
1715 output_objdir="$output_objdir/$objdir"
1717 # Create the object directory.
1718 if test ! -d "$output_objdir"; then
1719 $show "$mkdir $output_objdir"
1720 $run $mkdir $output_objdir
1722 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1727 # Determine the type of output
1730 $echo "$modename: you must specify an output file" 1>&2
1734 *.$libext) linkmode=oldlib ;;
1735 *.lo | *.$objext) linkmode=obj ;;
1736 *.la) linkmode=lib ;;
1737 *) linkmode=prog ;; # Anything else should be a program.
1741 *cygwin* | *mingw* | *pw32*)
1742 # don't eliminate duplcations in $postdeps and $predeps
1743 duplicate_compiler_generated_deps=yes
1746 duplicate_compiler_generated_deps=$duplicate_deps
1752 # Find all interdependent deplibs by searching for libraries
1753 # that are linked more than once (e.g. -la -lb -la)
1754 for deplib in $deplibs; do
1755 if test "X$duplicate_deps" = "Xyes" ; then
1757 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1760 libs="$libs $deplib"
1763 if test "$linkmode" = lib; then
1764 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1766 # Compute libraries that are listed more than once in $predeps
1767 # $postdeps and mark them as special (i.e., whose duplicates are
1768 # not to be eliminated).
1770 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1771 for pre_post_dep in $predeps $postdeps; do
1772 case "$pre_post_deps " in
1773 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1775 pre_post_deps="$pre_post_deps $pre_post_dep"
1784 need_relink=no # whether we're linking any uninstalled libtool libraries
1785 notinst_deplibs= # not-installed libtool libraries
1786 notinst_path= # paths that contain not-installed libtool libraries
1790 for file in $dlfiles $dlprefiles; do
1794 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1806 passes="conv scan dlopen dlpreopen link"
1811 for pass in $passes; do
1812 if test "$linkmode,$pass" = "lib,link" ||
1813 test "$linkmode,$pass" = "prog,scan"; then
1817 if test "$linkmode" = prog; then
1819 dlopen) libs="$dlfiles" ;;
1820 dlpreopen) libs="$dlprefiles" ;;
1821 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1824 if test "$pass" = dlopen; then
1825 # Collect dlpreopened libraries
1826 save_deplibs="$deplibs"
1829 for deplib in $libs; do
1833 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1834 if test "$linkmode,$pass" = "prog,link"; then
1835 compile_deplibs="$deplib $compile_deplibs"
1836 finalize_deplibs="$deplib $finalize_deplibs"
1838 deplibs="$deplib $deplibs"
1843 if test "$linkmode" != lib && test "$linkmode" != prog; then
1844 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1847 if test "$pass" = conv; then
1848 deplibs="$deplib $deplibs"
1851 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1852 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1853 for search_ext in .la $shrext .so .a; do
1854 # Search the libtool library
1855 lib="$searchdir/lib${name}${search_ext}"
1856 if test -f "$lib"; then
1857 if test "$search_ext" = ".la"; then
1866 if test "$found" != yes; then
1867 # deplib doesn't seem to be a libtool library
1868 if test "$linkmode,$pass" = "prog,link"; then
1869 compile_deplibs="$deplib $compile_deplibs"
1870 finalize_deplibs="$deplib $finalize_deplibs"
1872 deplibs="$deplib $deplibs"
1873 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1876 else # deplib is a libtool library
1877 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1878 # We need to do some special things here, and not later.
1879 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1880 case " $predeps $postdeps " in
1882 if (${SED} -e '2q' $lib |
1883 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1887 */* | *\\*) . $lib ;;
1890 for l in $old_library $library_names; do
1893 if test "X$ll" = "X$old_library" ; then # only static version available
1895 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1896 test "X$ladir" = "X$lib" && ladir="."
1897 lib=$ladir/$old_library
1898 if test "$linkmode,$pass" = "prog,link"; then
1899 compile_deplibs="$deplib $compile_deplibs"
1900 finalize_deplibs="$deplib $finalize_deplibs"
1902 deplibs="$deplib $deplibs"
1903 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1917 deplibs="$deplib $deplibs"
1918 test "$pass" = conv && continue
1919 newdependency_libs="$deplib $newdependency_libs"
1920 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1923 if test "$pass" = conv; then
1924 deplibs="$deplib $deplibs"
1927 if test "$pass" = scan; then
1928 deplibs="$deplib $deplibs"
1929 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1931 compile_deplibs="$deplib $compile_deplibs"
1932 finalize_deplibs="$deplib $finalize_deplibs"
1936 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1942 if test "$pass" = link; then
1943 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1944 # Make sure the xrpath contains only unique directories.
1947 *) xrpath="$xrpath $dir" ;;
1950 deplibs="$deplib $deplibs"
1953 *.la) lib="$deplib" ;;
1955 if test "$pass" = conv; then
1956 deplibs="$deplib $deplibs"
1961 if test "$deplibs_check_method" != pass_all; then
1963 $echo "*** Warning: Trying to link with static lib archive $deplib."
1964 $echo "*** I have the capability to make that library automatically link in when"
1965 $echo "*** you link to this library. But I can only do this if you have a"
1966 $echo "*** shared version of the library, which you do not appear to have"
1967 $echo "*** because the file extensions .$libext of this argument makes me believe"
1968 $echo "*** that it is just a static archive that I should not used here."
1971 $echo "*** Warning: Linking the shared library $output against the"
1972 $echo "*** static library $deplib is not portable!"
1973 deplibs="$deplib $deplibs"
1978 if test "$pass" != link; then
1979 deplibs="$deplib $deplibs"
1981 compile_deplibs="$deplib $compile_deplibs"
1982 finalize_deplibs="$deplib $finalize_deplibs"
1989 if test "$pass" = conv; then
1990 deplibs="$deplib $deplibs"
1991 elif test "$linkmode" = prog; then
1992 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1993 # If there is no dlopen support or we're linking statically,
1994 # we need to preload.
1995 newdlprefiles="$newdlprefiles $deplib"
1996 compile_deplibs="$deplib $compile_deplibs"
1997 finalize_deplibs="$deplib $finalize_deplibs"
1999 newdlfiles="$newdlfiles $deplib"
2009 if test "$found" = yes || test -f "$lib"; then :
2011 $echo "$modename: cannot find the library \`$lib'" 1>&2
2015 # Check to see that this really is a libtool archive.
2016 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2018 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2022 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2023 test "X$ladir" = "X$lib" && ladir="."
2031 # If the library was installed with an old release of libtool,
2032 # it will not redefine variables installed, or shouldnotlink
2038 */* | *\\*) . $lib ;;
2042 if test "$linkmode,$pass" = "lib,link" ||
2043 test "$linkmode,$pass" = "prog,scan" ||
2044 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2045 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2046 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2049 if test "$pass" = conv; then
2050 # Only check for convenience libraries
2051 deplibs="$lib $deplibs"
2052 if test -z "$libdir"; then
2053 if test -z "$old_library"; then
2054 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2057 # It is a libtool convenience library, so add in its objects.
2058 convenience="$convenience $ladir/$objdir/$old_library"
2059 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2061 for deplib in $dependency_libs; do
2062 deplibs="$deplib $deplibs"
2063 if test "X$duplicate_deps" = "Xyes" ; then
2064 case "$tmp_libs " in
2065 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2068 tmp_libs="$tmp_libs $deplib"
2070 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2071 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2078 # Get the name of the library we link against.
2080 for l in $old_library $library_names; do
2083 if test -z "$linklib"; then
2084 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2088 # This library was specified with -dlopen.
2089 if test "$pass" = dlopen; then
2090 if test -z "$libdir"; then
2091 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2094 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2095 # If there is no dlname, no dlopen support or we're linking
2096 # statically, we need to preload. We also need to preload any
2097 # dependent libraries so libltdl's deplib preloader doesn't
2098 # bomb out in the load deplibs phase.
2099 dlprefiles="$dlprefiles $lib $dependency_libs"
2101 newdlfiles="$newdlfiles $lib"
2106 # We need an absolute path.
2108 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2110 abs_ladir=`cd "$ladir" && pwd`
2111 if test -z "$abs_ladir"; then
2112 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2113 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2118 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2120 # Find the relevant object directory and library name.
2121 if test "X$installed" = Xyes; then
2122 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2123 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2132 dir="$ladir/$objdir"
2133 absdir="$abs_ladir/$objdir"
2134 # Remove this search path later
2135 notinst_path="$notinst_path $abs_ladir"
2136 fi # $installed = yes
2137 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2139 # This library was specified with -dlpreopen.
2140 if test "$pass" = dlpreopen; then
2141 if test -z "$libdir"; then
2142 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2145 # Prefer using a static library (so that no silly _DYNAMIC symbols
2146 # are required to link).
2147 if test -n "$old_library"; then
2148 newdlprefiles="$newdlprefiles $dir/$old_library"
2149 # Otherwise, use the dlname, so that lt_dlopen finds it.
2150 elif test -n "$dlname"; then
2151 newdlprefiles="$newdlprefiles $dir/$dlname"
2153 newdlprefiles="$newdlprefiles $dir/$linklib"
2155 fi # $pass = dlpreopen
2157 if test -z "$libdir"; then
2158 # Link the convenience library
2159 if test "$linkmode" = lib; then
2160 deplibs="$dir/$old_library $deplibs"
2161 elif test "$linkmode,$pass" = "prog,link"; then
2162 compile_deplibs="$dir/$old_library $compile_deplibs"
2163 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2165 deplibs="$lib $deplibs" # used for prog,scan pass
2171 if test "$linkmode" = prog && test "$pass" != link; then
2172 newlib_search_path="$newlib_search_path $ladir"
2173 deplibs="$lib $deplibs"
2176 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2177 test "$build_libtool_libs" = no; then
2182 for deplib in $dependency_libs; do
2184 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2186 # Need to link against all dependency_libs?
2187 if test "$linkalldeplibs" = yes; then
2188 deplibs="$deplib $deplibs"
2190 # Need to hardcode shared library paths
2191 # or/and link against static libraries
2192 newdependency_libs="$deplib $newdependency_libs"
2194 if test "X$duplicate_deps" = "Xyes" ; then
2195 case "$tmp_libs " in
2196 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2199 tmp_libs="$tmp_libs $deplib"
2202 fi # $linkmode = prog...
2204 if test "$linkmode,$pass" = "prog,link"; then
2205 if test -n "$library_names" &&
2206 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2207 # We need to hardcode the library path
2208 if test -n "$shlibpath_var"; then
2209 # Make sure the rpath contains only unique directories.
2210 case "$temp_rpath " in
2213 *) temp_rpath="$temp_rpath $dir" ;;
2217 # Hardcode the library path.
2218 # Skip directories that are in the system default run-time
2220 case " $sys_lib_dlsearch_path " in
2223 case "$compile_rpath " in
2225 *) compile_rpath="$compile_rpath $absdir"
2229 case " $sys_lib_dlsearch_path " in
2232 case "$finalize_rpath " in
2234 *) finalize_rpath="$finalize_rpath $libdir"
2238 fi # $linkmode,$pass = prog,link...
2240 if test "$alldeplibs" = yes &&
2241 { test "$deplibs_check_method" = pass_all ||
2242 { test "$build_libtool_libs" = yes &&
2243 test -n "$library_names"; }; }; then
2244 # We only need to search for static libraries
2249 link_static=no # Whether the deplib will be linked statically
2250 if test -n "$library_names" &&
2251 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2252 if test "$installed" = no; then
2253 notinst_deplibs="$notinst_deplibs $lib"
2256 # This is a shared library
2258 # Warn about portability, can't link against -module's on some systems (darwin)
2259 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2261 if test "$linkmode" = prog; then
2262 $echo "*** Warning: Linking the executable $output against the loadable module"
2264 $echo "*** Warning: Linking the shared library $output against the loadable module"
2266 $echo "*** $linklib is not portable!"
2268 if test "$linkmode" = lib &&
2269 test "$hardcode_into_libs" = yes; then
2270 # Hardcode the library path.
2271 # Skip directories that are in the system default run-time
2273 case " $sys_lib_dlsearch_path " in
2276 case "$compile_rpath " in
2278 *) compile_rpath="$compile_rpath $absdir"
2282 case " $sys_lib_dlsearch_path " in
2285 case "$finalize_rpath " in
2287 *) finalize_rpath="$finalize_rpath $libdir"
2293 if test -n "$old_archive_from_expsyms_cmds"; then
2294 # figure out the soname
2295 set dummy $library_names
2298 libname=`eval \\$echo \"$libname_spec\"`
2299 # use dlname if we got it. it's perfectly good, no?
2300 if test -n "$dlname"; then
2302 elif test -n "$soname_spec"; then
2306 major=`expr $current - $age`
2310 eval soname=\"$soname_spec\"
2315 # Make a new name for the extract_expsyms_cmds to use
2317 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2318 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2320 # If the library has no export list, then create one now
2321 if test -f "$output_objdir/$soname-def"; then :
2323 $show "extracting exported symbol list from \`$soname'"
2324 save_ifs="$IFS"; IFS='~'
2325 eval cmds=\"$extract_expsyms_cmds\"
2326 for cmd in $cmds; do
2329 $run eval "$cmd" || exit $?
2335 if test -f "$output_objdir/$newlib"; then :; else
2336 $show "generating import library for \`$soname'"
2337 save_ifs="$IFS"; IFS='~'
2338 eval cmds=\"$old_archive_from_expsyms_cmds\"
2339 for cmd in $cmds; do
2342 $run eval "$cmd" || exit $?
2346 # make sure the library variables are pointing to the new library
2349 fi # test -n "$old_archive_from_expsyms_cmds"
2351 if test "$linkmode" = prog || test "$mode" != relink; then
2356 case $hardcode_action in
2357 immediate | unsupported)
2358 if test "$hardcode_direct" = no; then
2361 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2363 # if the lib is a module then we can not link against it, someone
2364 # is ignoring the new warnings I added
2365 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2366 $echo "** Warning, lib $linklib is a module, not a shared library"
2367 if test -z "$old_library" ; then
2369 $echo "** And there doesn't seem to be a static archive available"
2370 $echo "** The link will probably fail, sorry"
2372 add="$dir/$old_library"
2376 elif test "$hardcode_minus_L" = no; then
2378 *-*-sunos*) add_shlibpath="$dir" ;;
2382 elif test "$hardcode_shlibpath_var" = no; then
2383 add_shlibpath="$dir"
2390 if test "$hardcode_direct" = yes; then
2392 elif test "$hardcode_minus_L" = yes; then
2394 # Try looking first in the location we're being installed to.
2395 if test -n "$inst_prefix_dir"; then
2398 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2403 elif test "$hardcode_shlibpath_var" = yes; then
2404 add_shlibpath="$dir"
2413 if test "$lib_linked" != yes; then
2414 $echo "$modename: configuration error: unsupported hardcode properties"
2418 if test -n "$add_shlibpath"; then
2419 case :$compile_shlibpath: in
2420 *":$add_shlibpath:"*) ;;
2421 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2424 if test "$linkmode" = prog; then
2425 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2426 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2428 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2429 test -n "$add" && deplibs="$add $deplibs"
2430 if test "$hardcode_direct" != yes && \
2431 test "$hardcode_minus_L" != yes && \
2432 test "$hardcode_shlibpath_var" = yes; then
2433 case :$finalize_shlibpath: in
2435 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2441 if test "$linkmode" = prog || test "$mode" = relink; then
2445 # Finalize command for both is simple: just hardcode it.
2446 if test "$hardcode_direct" = yes; then
2447 add="$libdir/$linklib"
2448 elif test "$hardcode_minus_L" = yes; then
2451 elif test "$hardcode_shlibpath_var" = yes; then
2452 case :$finalize_shlibpath: in
2454 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2457 elif test "$hardcode_automatic" = yes; then
2458 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2459 add="$inst_prefix_dir$libdir/$linklib"
2461 add="$libdir/$linklib"
2464 # We cannot seem to hardcode it, guess we'll fake it.
2466 # Try looking first in the location we're being installed to.
2467 if test -n "$inst_prefix_dir"; then
2470 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2477 if test "$linkmode" = prog; then
2478 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2479 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2481 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2482 test -n "$add" && deplibs="$add $deplibs"
2485 elif test "$linkmode" = prog; then
2486 # Here we assume that one of hardcode_direct or hardcode_minus_L
2487 # is not unsupported. This is valid on all known static and
2489 if test "$hardcode_direct" != unsupported; then
2490 test -n "$old_library" && linklib="$old_library"
2491 compile_deplibs="$dir/$linklib $compile_deplibs"
2492 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2494 compile_deplibs="-l$name -L$dir $compile_deplibs"
2495 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2497 elif test "$build_libtool_libs" = yes; then
2498 # Not a shared library
2499 if test "$deplibs_check_method" != pass_all; then
2500 # We're trying link a shared library against a static one
2501 # but the system doesn't support it.
2503 # Just print a warning and add the library to dependency_libs so
2504 # that the program can be linked against the static library.
2506 $echo "*** Warning: This system can not link to static lib archive $lib."
2507 $echo "*** I have the capability to make that library automatically link in when"
2508 $echo "*** you link to this library. But I can only do this if you have a"
2509 $echo "*** shared version of the library, which you do not appear to have."
2510 if test "$module" = yes; then
2511 $echo "*** But as you try to build a module library, libtool will still create "
2512 $echo "*** a static module, that should work as long as the dlopening application"
2513 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2514 if test -z "$global_symbol_pipe"; then
2516 $echo "*** However, this would only work if libtool was able to extract symbol"
2517 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2518 $echo "*** not find such a program. So, this module is probably useless."
2519 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2521 if test "$build_old_libs" = no; then
2522 build_libtool_libs=module
2525 build_libtool_libs=no
2529 convenience="$convenience $dir/$old_library"
2530 old_convenience="$old_convenience $dir/$old_library"
2531 deplibs="$dir/$old_library $deplibs"
2534 fi # link shared/static library?
2536 if test "$linkmode" = lib; then
2537 if test -n "$dependency_libs" &&
2538 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2539 test "$link_static" = yes; }; then
2540 # Extract -R from dependency_libs
2542 for libdir in $dependency_libs; do
2544 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2546 *" $temp_xrpath "*) ;;
2547 *) xrpath="$xrpath $temp_xrpath";;
2549 *) temp_deplibs="$temp_deplibs $libdir";;
2552 dependency_libs="$temp_deplibs"
2555 newlib_search_path="$newlib_search_path $absdir"
2556 # Link against this library
2557 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2558 # ... and its dependency_libs
2560 for deplib in $dependency_libs; do
2561 newdependency_libs="$deplib $newdependency_libs"
2562 if test "X$duplicate_deps" = "Xyes" ; then
2563 case "$tmp_libs " in
2564 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2567 tmp_libs="$tmp_libs $deplib"
2570 if test "$link_all_deplibs" != no; then
2571 # Add the search paths of all dependency libraries
2572 for deplib in $dependency_libs; do
2574 -L*) path="$deplib" ;;
2576 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2577 test "X$dir" = "X$deplib" && dir="."
2578 # We need an absolute path.
2580 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2582 absdir=`cd "$dir" && pwd`
2583 if test -z "$absdir"; then
2584 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2589 if grep "^installed=no" $deplib > /dev/null; then
2590 path="$absdir/$objdir"
2592 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2593 if test -z "$libdir"; then
2594 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2597 if test "$absdir" != "$libdir"; then
2598 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2605 # we do not want to link against static libs, but need to link against shared
2606 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2607 if test -n "$deplibrary_names" ; then
2608 for tmp in $deplibrary_names ; do
2611 if test -f "$path/$depdepl" ; then
2612 depdepl="$path/$depdepl"
2614 # do not add paths which are already there
2615 case " $newlib_search_path " in
2617 *) newlib_search_path="$newlib_search_path $path";;
2631 # Again, we only want to link against shared libraries
2632 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2633 for tmp in $newlib_search_path ; do
2634 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2635 eval depdepl="$tmp/lib$tmp_libs.dylib"
2646 case " $deplibs " in
2648 *) deplibs="$deplibs $depdepl" ;;
2650 case " $deplibs " in
2652 *) deplibs="$deplibs $path" ;;
2655 fi # link_all_deplibs != no
2657 done # for deplib in $libs
2658 dependency_libs="$newdependency_libs"
2659 if test "$pass" = dlpreopen; then
2660 # Link the dlpreopened libraries before other libraries
2661 for deplib in $save_deplibs; do
2662 deplibs="$deplib $deplibs"
2665 if test "$pass" != dlopen; then
2666 if test "$pass" != conv; then
2667 # Make sure lib_search_path contains only unique directories.
2669 for dir in $newlib_search_path; do
2670 case "$lib_search_path " in
2672 *) lib_search_path="$lib_search_path $dir" ;;
2678 if test "$linkmode,$pass" != "prog,link"; then
2681 vars="compile_deplibs finalize_deplibs"
2683 for var in $vars dependency_libs; do
2684 # Add libraries to $var in reverse order
2685 eval tmp_libs=\"\$$var\"
2687 for deplib in $tmp_libs; do
2688 # FIXME: Pedantically, this is the right thing to do, so
2689 # that some nasty dependency loop isn't accidentally
2691 #new_libs="$deplib $new_libs"
2692 # Pragmatically, this seems to cause very few problems in
2695 -L*) new_libs="$deplib $new_libs" ;;
2698 # And here is the reason: when a library appears more
2699 # than once as an explicit dependence of a library, or
2700 # is implicitly linked in more than once by the
2701 # compiler, it is considered special, and multiple
2702 # occurrences thereof are not removed. Compare this
2703 # with having the same library being listed as a
2704 # dependency of multiple other libraries: in this case,
2705 # we know (pedantically, we assume) the library does not
2706 # need to be listed more than once, so we keep only the
2707 # last copy. This is not always right, but it is rare
2708 # enough that we require users that really mean to play
2709 # such unportable linking tricks to link the library
2710 # using -Wl,-lname, so that libtool does not consider it
2711 # for duplicate removal.
2712 case " $specialdeplibs " in
2713 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2715 case " $new_libs " in
2717 *) new_libs="$deplib $new_libs" ;;
2725 for deplib in $new_libs; do
2728 case " $tmp_libs " in
2730 *) tmp_libs="$tmp_libs $deplib" ;;
2733 *) tmp_libs="$tmp_libs $deplib" ;;
2736 eval $var=\"$tmp_libs\"
2739 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2741 for i in $dependency_libs ; do
2742 case " $predeps $postdeps $compiler_lib_search_path " in
2747 if test -n "$i" ; then
2748 tmp_libs="$tmp_libs $i"
2751 dependency_libs=$tmp_libs
2753 if test "$linkmode" = prog; then
2754 dlfiles="$newdlfiles"
2755 dlprefiles="$newdlprefiles"
2760 if test -n "$deplibs"; then
2761 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2764 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2765 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2768 if test -n "$rpath"; then
2769 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2772 if test -n "$xrpath"; then
2773 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2776 if test -n "$vinfo"; then
2777 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2780 if test -n "$release"; then
2781 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2784 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2785 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2788 # Now set the variables for building old libraries.
2789 build_libtool_libs=no
2791 objs="$objs$old_deplibs"
2795 # Make sure we only generate libraries of the form `libNAME.la'.
2798 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2799 eval shared_ext=\"$shrext\"
2800 eval libname=\"$libname_spec\"
2803 if test "$module" = no; then
2804 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2808 if test "$need_lib_prefix" != no; then
2809 # Add the "lib" prefix for modules if required
2810 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2811 eval shared_ext=\"$shrext\"
2812 eval libname=\"$libname_spec\"
2814 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2819 if test -n "$objs"; then
2820 if test "$deplibs_check_method" != pass_all; then
2821 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2825 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2826 $echo "*** objects $objs is not portable!"
2827 libobjs="$libobjs $objs"
2831 if test "$dlself" != no; then
2832 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2836 if test "$#" -gt 2; then
2837 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2842 if test -z "$rpath"; then
2843 if test "$build_libtool_libs" = yes; then
2844 # Building a libtool convenience library.
2845 # Some compilers have problems with a `.al' extension so
2846 # convenience libraries should have the same extension an
2847 # archive normally would.
2848 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2849 build_libtool_libs=convenience
2853 if test -n "$vinfo"; then
2854 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2857 if test -n "$release"; then
2858 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2862 # Parse the version information argument.
2863 save_ifs="$IFS"; IFS=':'
2864 set dummy $vinfo 0 0 0
2867 if test -n "$8"; then
2868 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2873 # convert absolute version numbers to libtool ages
2874 # this retains compatibility with .la files and attempts
2875 # to make the code below a bit more comprehensible
2877 case $vinfo_number in
2881 number_revision="$4"
2883 # There are really only two kinds -- those that
2884 # use the current revision as the major version
2885 # and those that subtract age and use age as
2886 # a minor version. But, then there is irix
2887 # which has an extra 1 added just for fun
2889 case $version_type in
2890 darwin|linux|osf|windows)
2891 current=`expr $number_major + $number_minor`
2893 revision="$number_revision"
2895 freebsd-aout|freebsd-elf|sunos)
2896 current="$number_major"
2897 revision="$number_minor"
2901 current=`expr $number_major + $number_minor - 1`
2903 revision="$number_minor"
2914 # Check that each of the things are valid numbers.
2916 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2918 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2919 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2925 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2927 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2928 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2934 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2936 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2937 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2942 if test "$age" -gt "$current"; then
2943 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2944 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2948 # Calculate the version variables.
2952 case $version_type in
2956 # Like Linux, but with the current version available in
2957 # verstring for coding it into the library header
2958 major=.`expr $current - $age`
2959 versuffix="$major.$age.$revision"
2960 # Darwin ld doesn't like 0 for these options...
2961 minor_current=`expr $current + 1`
2962 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2967 versuffix=".$current.$revision";
2972 versuffix=".$current";
2976 major=`expr $current - $age + 1`
2978 case $version_type in
2979 nonstopux) verstring_prefix=nonstopux ;;
2980 *) verstring_prefix=sgi ;;
2982 verstring="$verstring_prefix$major.$revision"
2984 # Add in all the interfaces that we are compatible with.
2986 while test "$loop" -ne 0; do
2987 iface=`expr $revision - $loop`
2988 loop=`expr $loop - 1`
2989 verstring="$verstring_prefix$major.$iface:$verstring"
2992 # Before this point, $major must not contain `.'.
2994 versuffix="$major.$revision"
2998 major=.`expr $current - $age`
2999 versuffix="$major.$age.$revision"
3003 major=.`expr $current - $age`
3004 versuffix=".$current.$age.$revision"
3005 verstring="$current.$age.$revision"
3007 # Add in all the interfaces that we are compatible with.
3009 while test "$loop" -ne 0; do
3010 iface=`expr $current - $loop`
3011 loop=`expr $loop - 1`
3012 verstring="$verstring:${iface}.0"
3015 # Make executables depend on our current version.
3016 verstring="$verstring:${current}.0"
3021 versuffix=".$current.$revision"
3025 # Use '-' rather than '.', since we only want one
3026 # extension on DOS 8.3 filesystems.
3027 major=`expr $current - $age`
3032 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3033 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3038 # Clear the version info if we defaulted, and they specified a release.
3039 if test -z "$vinfo" && test -n "$release"; then
3041 case $version_type in
3043 # we can't check for "0.0" in archive_cmds due to quoting
3044 # problems, so we reset it completely
3051 if test "$need_version" = no; then
3058 # Remove version info from name if versioning should be avoided
3059 if test "$avoid_version" = yes && test "$need_version" = no; then
3065 # Check to see if the archive will have undefined symbols.
3066 if test "$allow_undefined" = yes; then
3067 if test "$allow_undefined_flag" = unsupported; then
3068 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3069 build_libtool_libs=no
3073 # Don't allow undefined symbols.
3074 allow_undefined_flag="$no_undefined_flag"
3078 if test "$mode" != relink; then
3079 # Remove our outputs, but don't remove object files since they
3080 # may have been created when compiling PIC objects.
3082 tempremovelist=`$echo "$output_objdir/*"`
3083 for p in $tempremovelist; do
3087 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3088 removelist="$removelist $p"
3093 if test -n "$removelist"; then
3094 $show "${rm}r $removelist"
3095 $run ${rm}r $removelist
3099 # Now set the variables for building old libraries.
3100 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3101 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3103 # Transform .lo files to .o files.
3104 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3107 # Eliminate all temporary directories.
3108 for path in $notinst_path; do
3109 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3110 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3111 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3114 if test -n "$xrpath"; then
3115 # If the user specified any rpath flags, then add them.
3117 for libdir in $xrpath; do
3118 temp_xrpath="$temp_xrpath -R$libdir"
3119 case "$finalize_rpath " in
3121 *) finalize_rpath="$finalize_rpath $libdir" ;;
3124 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3125 dependency_libs="$temp_xrpath $dependency_libs"
3129 # Make sure dlfiles contains only unique files that won't be dlpreopened
3130 old_dlfiles="$dlfiles"
3132 for lib in $old_dlfiles; do
3133 case " $dlprefiles $dlfiles " in
3135 *) dlfiles="$dlfiles $lib" ;;
3139 # Make sure dlprefiles contains only unique files
3140 old_dlprefiles="$dlprefiles"
3142 for lib in $old_dlprefiles; do
3143 case "$dlprefiles " in
3145 *) dlprefiles="$dlprefiles $lib" ;;
3149 if test "$build_libtool_libs" = yes; then
3150 if test -n "$rpath"; then
3152 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3153 # these systems don't actually have a c library (as such)!
3155 *-*-rhapsody* | *-*-darwin1.[012])
3156 # Rhapsody C library is in the System framework
3157 deplibs="$deplibs -framework System"
3160 # Don't link with libc until the a.out ld.so is fixed.
3162 *-*-openbsd* | *-*-freebsd*)
3163 # Do not include libc due to us having libc/libc_r.
3164 test "X$arg" = "X-lc" && continue
3167 # Add libc to deplibs on all other systems if necessary.
3168 if test "$build_libtool_need_lc" = "yes"; then
3169 deplibs="$deplibs -lc"
3175 # Transform deplibs into only deplibs that can be linked in shared.
3177 libname_save=$libname
3178 release_save=$release
3179 versuffix_save=$versuffix
3181 # I'm not sure if I'm treating the release correctly. I think
3182 # release should show up in the -l (ie -lgmp5) so we don't want to
3183 # add it in twice. Is that correct?
3189 case $deplibs_check_method in
3191 # Don't check for shared/static. Everything works.
3192 # This might be a little naive. We might want to check
3193 # whether the library exists or not. But this is on
3194 # osf3 & osf4 and I'm not really sure... Just
3195 # implementing what was already the behavior.
3199 # This code stresses the "libraries are programs" paradigm to its
3200 # limits. Maybe even breaks it. We compile a program, linking it
3201 # against the deplibs as a proxy for the library. Then we can check
3202 # whether they linked in statically or dynamically with ldd.
3204 cat > conftest.c <<EOF
3205 int main() { return 0; }
3208 $LTCC -o conftest conftest.c $deplibs
3209 if test "$?" -eq 0 ; then
3210 ldd_output=`ldd conftest`
3211 for i in $deplibs; do
3212 name="`expr $i : '-l\(.*\)'`"
3213 # If $name is empty we are operating on a -L argument.
3214 if test "$name" != "" && test "$name" -ne "0"; then
3215 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3216 case " $predeps $postdeps " in
3218 newdeplibs="$newdeplibs $i"
3223 if test -n "$i" ; then
3224 libname=`eval \\$echo \"$libname_spec\"`
3225 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3226 set dummy $deplib_matches
3228 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3229 newdeplibs="$newdeplibs $i"
3233 $echo "*** Warning: dynamic linker does not accept needed library $i."
3234 $echo "*** I have the capability to make that library automatically link in when"
3235 $echo "*** you link to this library. But I can only do this if you have a"
3236 $echo "*** shared version of the library, which I believe you do not have"
3237 $echo "*** because a test_compile did reveal that the linker did not use it for"
3238 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3242 newdeplibs="$newdeplibs $i"
3246 # Error occurred in the first compile. Let's try to salvage
3247 # the situation: Compile a separate program for each library.
3248 for i in $deplibs; do
3249 name="`expr $i : '-l\(.*\)'`"
3250 # If $name is empty we are operating on a -L argument.
3251 if test "$name" != "" && test "$name" != "0"; then
3253 $LTCC -o conftest conftest.c $i
3255 if test "$?" -eq 0 ; then
3256 ldd_output=`ldd conftest`
3257 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3258 case " $predeps $postdeps " in
3260 newdeplibs="$newdeplibs $i"
3265 if test -n "$i" ; then
3266 libname=`eval \\$echo \"$libname_spec\"`
3267 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3268 set dummy $deplib_matches
3270 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3271 newdeplibs="$newdeplibs $i"
3275 $echo "*** Warning: dynamic linker does not accept needed library $i."
3276 $echo "*** I have the capability to make that library automatically link in when"
3277 $echo "*** you link to this library. But I can only do this if you have a"
3278 $echo "*** shared version of the library, which you do not appear to have"
3279 $echo "*** because a test_compile did reveal that the linker did not use this one"
3280 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3286 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3287 $echo "*** make it link in! You will probably need to install it or some"
3288 $echo "*** library that it depends on before this library will be fully"
3289 $echo "*** functional. Installing it before continuing would be even better."
3292 newdeplibs="$newdeplibs $i"
3298 set dummy $deplibs_check_method
3299 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3300 for a_deplib in $deplibs; do
3301 name="`expr $a_deplib : '-l\(.*\)'`"
3302 # If $name is empty we are operating on a -L argument.
3303 if test "$name" != "" && test "$name" != "0"; then
3304 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3305 case " $predeps $postdeps " in
3307 newdeplibs="$newdeplibs $a_deplib"
3312 if test -n "$a_deplib" ; then
3313 libname=`eval \\$echo \"$libname_spec\"`
3314 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3315 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3316 for potent_lib in $potential_libs; do
3317 # Follow soft links.
3318 if ls -lLd "$potent_lib" 2>/dev/null \
3319 | grep " -> " >/dev/null; then
3322 # The statement above tries to avoid entering an
3323 # endless loop below, in case of cyclic links.
3324 # We might still enter an endless loop, since a link
3325 # loop can be closed while we follow links,
3327 potlib="$potent_lib"
3328 while test -h "$potlib" 2>/dev/null; do
3329 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3331 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3332 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3335 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3337 | $EGREP "$file_magic_regex" > /dev/null; then
3338 newdeplibs="$newdeplibs $a_deplib"
3345 if test -n "$a_deplib" ; then
3348 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3349 $echo "*** I have the capability to make that library automatically link in when"
3350 $echo "*** you link to this library. But I can only do this if you have a"
3351 $echo "*** shared version of the library, which you do not appear to have"
3352 $echo "*** because I did check the linker path looking for a file starting"
3353 if test -z "$potlib" ; then
3354 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3356 $echo "*** with $libname and none of the candidates passed a file format test"
3357 $echo "*** using a file magic. Last file checked: $potlib"
3361 # Add a -L argument.
3362 newdeplibs="$newdeplibs $a_deplib"
3364 done # Gone through all deplibs.
3367 set dummy $deplibs_check_method
3368 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3369 for a_deplib in $deplibs; do
3370 name="`expr $a_deplib : '-l\(.*\)'`"
3371 # If $name is empty we are operating on a -L argument.
3372 if test -n "$name" && test "$name" != "0"; then
3373 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3374 case " $predeps $postdeps " in
3376 newdeplibs="$newdeplibs $a_deplib"
3381 if test -n "$a_deplib" ; then
3382 libname=`eval \\$echo \"$libname_spec\"`
3383 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3384 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3385 for potent_lib in $potential_libs; do
3386 potlib="$potent_lib" # see symlink-check above in file_magic test
3387 if eval $echo \"$potent_lib\" 2>/dev/null \
3389 | $EGREP "$match_pattern_regex" > /dev/null; then
3390 newdeplibs="$newdeplibs $a_deplib"
3397 if test -n "$a_deplib" ; then
3400 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3401 $echo "*** I have the capability to make that library automatically link in when"
3402 $echo "*** you link to this library. But I can only do this if you have a"
3403 $echo "*** shared version of the library, which you do not appear to have"
3404 $echo "*** because I did check the linker path looking for a file starting"
3405 if test -z "$potlib" ; then
3406 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3408 $echo "*** with $libname and none of the candidates passed a file format test"
3409 $echo "*** using a regex pattern. Last file checked: $potlib"
3413 # Add a -L argument.
3414 newdeplibs="$newdeplibs $a_deplib"
3416 done # Gone through all deplibs.
3420 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3421 -e 's/ -[LR][^ ]*//g'`
3422 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3423 for i in $predeps $postdeps ; do
3424 # can't use Xsed below, because $i might contain '/'
3425 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3428 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3429 | grep . >/dev/null; then
3431 if test "X$deplibs_check_method" = "Xnone"; then
3432 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3434 $echo "*** Warning: inter-library dependencies are not known to be supported."
3436 $echo "*** All declared inter-library dependencies are being dropped."
3441 versuffix=$versuffix_save
3443 release=$release_save
3444 libname=$libname_save
3448 *-*-rhapsody* | *-*-darwin1.[012])
3449 # On Rhapsody replace the C library is the System framework
3450 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3454 if test "$droppeddeps" = yes; then
3455 if test "$module" = yes; then
3457 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3458 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3459 $echo "*** a static module, that should work as long as the dlopening"
3460 $echo "*** application is linked with the -dlopen flag."
3461 if test -z "$global_symbol_pipe"; then
3463 $echo "*** However, this would only work if libtool was able to extract symbol"
3464 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3465 $echo "*** not find such a program. So, this module is probably useless."
3466 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3468 if test "$build_old_libs" = no; then
3469 oldlibs="$output_objdir/$libname.$libext"
3470 build_libtool_libs=module
3473 build_libtool_libs=no
3476 $echo "*** The inter-library dependencies that have been dropped here will be"
3477 $echo "*** automatically added whenever a program is linked with this library"
3478 $echo "*** or is declared to -dlopen it."
3480 if test "$allow_undefined" = no; then
3482 $echo "*** Since this library must not contain undefined symbols,"
3483 $echo "*** because either the platform does not support them or"
3484 $echo "*** it was explicitly requested with -no-undefined,"
3485 $echo "*** libtool will only create a static version of it."
3486 if test "$build_old_libs" = no; then
3487 oldlibs="$output_objdir/$libname.$libext"
3488 build_libtool_libs=module
3491 build_libtool_libs=no
3496 # Done checking deplibs!
3500 # All the library-specific variables (install_libdir is set above).
3505 # Test again, we may have decided not to build it any more
3506 if test "$build_libtool_libs" = yes; then
3507 if test "$hardcode_into_libs" = yes; then
3508 # Hardcode the library paths
3511 rpath="$finalize_rpath"
3512 test "$mode" != relink && rpath="$compile_rpath$rpath"
3513 for libdir in $rpath; do
3514 if test -n "$hardcode_libdir_flag_spec"; then
3515 if test -n "$hardcode_libdir_separator"; then
3516 if test -z "$hardcode_libdirs"; then
3517 hardcode_libdirs="$libdir"
3519 # Just accumulate the unique libdirs.
3520 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3521 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3524 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3529 eval flag=\"$hardcode_libdir_flag_spec\"
3530 dep_rpath="$dep_rpath $flag"
3532 elif test -n "$runpath_var"; then
3533 case "$perm_rpath " in
3535 *) perm_rpath="$perm_rpath $libdir" ;;
3539 # Substitute the hardcoded libdirs into the rpath.
3540 if test -n "$hardcode_libdir_separator" &&
3541 test -n "$hardcode_libdirs"; then
3542 libdir="$hardcode_libdirs"
3543 if test -n "$hardcode_libdir_flag_spec_ld"; then
3544 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3546 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3549 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3550 # We should set the runpath_var.
3552 for dir in $perm_rpath; do
3555 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3557 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3560 shlibpath="$finalize_shlibpath"
3561 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3562 if test -n "$shlibpath"; then
3563 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3566 # Get the real and link names of the library.
3567 eval shared_ext=\"$shrext\"
3568 eval library_names=\"$library_names_spec\"
3569 set dummy $library_names
3573 if test -n "$soname_spec"; then
3574 eval soname=\"$soname_spec\"
3578 if test -z "$dlname"; then
3582 lib="$output_objdir/$realname"
3585 linknames="$linknames $link"
3588 # Use standard objects if they are pic
3589 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3591 # Prepare the list of exported symbols
3592 if test -z "$export_symbols"; then
3593 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3594 $show "generating symbol list for \`$libname.la'"
3595 export_symbols="$output_objdir/$libname.exp"
3596 $run $rm $export_symbols
3597 eval cmds=\"$export_symbols_cmds\"
3598 save_ifs="$IFS"; IFS='~'
3599 for cmd in $cmds; do
3601 if len=`expr "X$cmd" : ".*"` &&
3602 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3604 $run eval "$cmd" || exit $?
3605 skipped_export=false
3607 # The command line is too long to execute in one step.
3608 $show "using reloadable object file for export list..."
3613 if test -n "$export_symbols_regex"; then
3614 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3615 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3616 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3617 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3622 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3623 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3627 for test_deplib in $deplibs; do
3628 case " $convenience " in
3629 *" $test_deplib "*) ;;
3631 tmp_deplibs="$tmp_deplibs $test_deplib"
3635 deplibs="$tmp_deplibs"
3637 if test -n "$convenience"; then
3638 if test -n "$whole_archive_flag_spec"; then
3639 save_libobjs=$libobjs
3640 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3642 gentop="$output_objdir/${outputname}x"
3643 $show "${rm}r $gentop"
3644 $run ${rm}r "$gentop"
3645 $show "$mkdir $gentop"
3646 $run $mkdir "$gentop"
3648 if test "$status" -ne 0 && test ! -d "$gentop"; then
3651 generated="$generated $gentop"
3653 for xlib in $convenience; do
3654 # Extract the objects.
3656 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3657 *) xabs=`pwd`"/$xlib" ;;
3659 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3660 xdir="$gentop/$xlib"
3662 $show "${rm}r $xdir"
3664 $show "$mkdir $xdir"
3667 if test "$status" -ne 0 && test ! -d "$xdir"; then
3670 # We will extract separately just the conflicting names and we will no
3671 # longer touch any unique names. It is faster to leave these extract
3672 # automatically by $AR in one run.
3673 $show "(cd $xdir && $AR x $xabs)"
3674 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3675 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3678 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3679 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3680 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3683 while test "$i" -le "$count"
3685 # Put our $i before any first dot (extension)
3686 # Never overwrite any file
3688 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3690 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3692 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3693 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3699 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3704 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3705 eval flag=\"$thread_safe_flag_spec\"
3706 linker_flags="$linker_flags $flag"
3709 # Make a backup of the uninstalled library when relinking
3710 if test "$mode" = relink; then
3711 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3714 # Do each of the archive commands.
3715 if test "$module" = yes && test -n "$module_cmds" ; then
3716 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3717 eval cmds=\"$module_expsym_cmds\"
3719 eval cmds=\"$module_cmds\"
3722 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3723 eval cmds=\"$archive_expsym_cmds\"
3725 eval cmds=\"$archive_cmds\"
3729 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3730 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3733 # The command line is too long to link in one step, link piecewise.
3734 $echo "creating reloadable object files..."
3736 # Save the value of $output and $libobjs because we want to
3737 # use them later. If we have whole_archive_flag_spec, we
3738 # want to use save_libobjs as it was before
3739 # whole_archive_flag_spec was expanded, because we can't
3740 # assume the linker understands whole_archive_flag_spec.
3741 # This may have to be revisited, in case too many
3742 # convenience libraries get linked in and end up exceeding
3744 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3745 save_libobjs=$libobjs
3749 # Clear the reloadable object creation command queue and
3750 # initialize k to one.
3757 output=$output_objdir/$save_output-${k}.$objext
3758 # Loop over the list of objects to be linked.
3759 for obj in $save_libobjs
3761 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3762 if test "X$objlist" = X ||
3763 { len=`expr "X$test_cmds" : ".*"` &&
3764 test "$len" -le "$max_cmd_len"; }; then
3765 objlist="$objlist $obj"
3767 # The command $test_cmds is almost too long, add a
3768 # command to the queue.
3769 if test "$k" -eq 1 ; then
3770 # The first file doesn't have a previous command to add.
3771 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3773 # All subsequent reloadable object files will link in
3774 # the last one created.
3775 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3777 last_robj=$output_objdir/$save_output-${k}.$objext
3779 output=$output_objdir/$save_output-${k}.$objext
3784 # Handle the remaining objects by creating one last
3785 # reloadable object file. All subsequent reloadable object
3786 # files will link in the last one created.
3787 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3788 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3790 if ${skipped_export-false}; then
3791 $show "generating symbol list for \`$libname.la'"
3792 export_symbols="$output_objdir/$libname.exp"
3793 $run $rm $export_symbols
3795 # Append the command to create the export file.
3796 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3799 # Set up a command to remove the reloadale object files
3800 # after they are used.
3802 while test "$i" -lt "$k"
3805 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3808 $echo "creating a temporary reloadable object file: $output"
3810 # Loop through the commands generated above and execute them.
3811 save_ifs="$IFS"; IFS='~'
3812 for cmd in $concat_cmds; do
3815 $run eval "$cmd" || exit $?
3820 # Restore the value of output.
3823 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3824 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3826 # Expand the library linking commands again to reset the
3827 # value of $libobjs for piecewise linking.
3829 # Do each of the archive commands.
3830 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3831 eval cmds=\"$archive_expsym_cmds\"
3833 eval cmds=\"$archive_cmds\"
3836 # Append the command to remove the reloadable object files
3837 # to the just-reset $cmds.
3838 eval cmds=\"\$cmds~$rm $delfiles\"
3840 save_ifs="$IFS"; IFS='~'
3841 for cmd in $cmds; do
3844 $run eval "$cmd" || exit $?
3848 # Restore the uninstalled library and exit
3849 if test "$mode" = relink; then
3850 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3854 # Create links to the real library.
3855 for linkname in $linknames; do
3856 if test "$realname" != "$linkname"; then
3857 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3858 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3862 # If -module or -export-dynamic was specified, set the dlname.
3863 if test "$module" = yes || test "$export_dynamic" = yes; then
3864 # On all known operating systems, these are identical.
3871 if test -n "$deplibs"; then
3872 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3875 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3876 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3879 if test -n "$rpath"; then
3880 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3883 if test -n "$xrpath"; then
3884 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3887 if test -n "$vinfo"; then
3888 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3891 if test -n "$release"; then
3892 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3897 if test -n "$objs$old_deplibs"; then
3898 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3902 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3910 # Delete the old objects.
3911 $run $rm $obj $libobj
3913 # Objects from convenience libraries. This assumes
3914 # single-version convenience libraries. Whenever we create
3915 # different ones for PIC/non-PIC, this we'll have to duplicate
3919 # reload_cmds runs $LD directly, so let us get rid of
3920 # -Wl from whole_archive_flag_spec
3923 if test -n "$convenience"; then
3924 if test -n "$whole_archive_flag_spec"; then
3925 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3927 gentop="$output_objdir/${obj}x"
3928 $show "${rm}r $gentop"
3929 $run ${rm}r "$gentop"
3930 $show "$mkdir $gentop"
3931 $run $mkdir "$gentop"
3933 if test "$status" -ne 0 && test ! -d "$gentop"; then
3936 generated="$generated $gentop"
3938 for xlib in $convenience; do
3939 # Extract the objects.
3941 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3942 *) xabs=`pwd`"/$xlib" ;;
3944 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3945 xdir="$gentop/$xlib"
3947 $show "${rm}r $xdir"
3949 $show "$mkdir $xdir"
3952 if test "$status" -ne 0 && test ! -d "$xdir"; then
3955 # We will extract separately just the conflicting names and we will no
3956 # longer touch any unique names. It is faster to leave these extract
3957 # automatically by $AR in one run.
3958 $show "(cd $xdir && $AR x $xabs)"
3959 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3960 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3963 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3964 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3965 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3968 while test "$i" -le "$count"
3970 # Put our $i before any first dot (extension)
3971 # Never overwrite any file
3973 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3975 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3977 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3978 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3984 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3989 # Create the old-style object.
3990 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
3993 eval cmds=\"$reload_cmds\"
3994 save_ifs="$IFS"; IFS='~'
3995 for cmd in $cmds; do
3998 $run eval "$cmd" || exit $?
4002 # Exit if we aren't doing a library object file.
4003 if test -z "$libobj"; then
4004 if test -n "$gentop"; then
4005 $show "${rm}r $gentop"
4012 if test "$build_libtool_libs" != yes; then
4013 if test -n "$gentop"; then
4014 $show "${rm}r $gentop"
4018 # Create an invalid libtool object if no PIC, so that we don't
4019 # accidentally link it into a program.
4020 # $show "echo timestamp > $libobj"
4021 # $run eval "echo timestamp > $libobj" || exit $?
4025 if test -n "$pic_flag" || test "$pic_mode" != default; then
4026 # Only do commands if we really have different PIC objects.
4027 reload_objs="$libobjs $reload_conv_objs"
4029 eval cmds=\"$reload_cmds\"
4030 save_ifs="$IFS"; IFS='~'
4031 for cmd in $cmds; do
4034 $run eval "$cmd" || exit $?
4039 if test -n "$gentop"; then
4040 $show "${rm}r $gentop"
4049 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4051 if test -n "$vinfo"; then
4052 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4055 if test -n "$release"; then
4056 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4059 if test "$preload" = yes; then
4060 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4061 test "$dlopen_self_static" = unknown; then
4062 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4067 *-*-rhapsody* | *-*-darwin1.[012])
4068 # On Rhapsody replace the C library is the System framework
4069 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4070 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4076 # Don't allow lazy linking, it breaks C++ global constructors
4077 if test "$tagname" = CXX ; then
4078 compile_command="$compile_command ${wl}-bind_at_load"
4079 finalize_command="$finalize_command ${wl}-bind_at_load"
4084 compile_command="$compile_command $compile_deplibs"
4085 finalize_command="$finalize_command $finalize_deplibs"
4087 if test -n "$rpath$xrpath"; then
4088 # If the user specified any rpath flags, then add them.
4089 for libdir in $rpath $xrpath; do
4090 # This is the magic to use -rpath.
4091 case "$finalize_rpath " in
4093 *) finalize_rpath="$finalize_rpath $libdir" ;;
4098 # Now hardcode the library paths
4101 for libdir in $compile_rpath $finalize_rpath; do
4102 if test -n "$hardcode_libdir_flag_spec"; then
4103 if test -n "$hardcode_libdir_separator"; then
4104 if test -z "$hardcode_libdirs"; then
4105 hardcode_libdirs="$libdir"
4107 # Just accumulate the unique libdirs.
4108 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4109 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4112 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4117 eval flag=\"$hardcode_libdir_flag_spec\"
4118 rpath="$rpath $flag"
4120 elif test -n "$runpath_var"; then
4121 case "$perm_rpath " in
4123 *) perm_rpath="$perm_rpath $libdir" ;;
4127 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4128 case :$dllsearchpath: in
4130 *) dllsearchpath="$dllsearchpath:$libdir";;
4135 # Substitute the hardcoded libdirs into the rpath.
4136 if test -n "$hardcode_libdir_separator" &&
4137 test -n "$hardcode_libdirs"; then
4138 libdir="$hardcode_libdirs"
4139 eval rpath=\" $hardcode_libdir_flag_spec\"
4141 compile_rpath="$rpath"
4145 for libdir in $finalize_rpath; do
4146 if test -n "$hardcode_libdir_flag_spec"; then
4147 if test -n "$hardcode_libdir_separator"; then
4148 if test -z "$hardcode_libdirs"; then
4149 hardcode_libdirs="$libdir"
4151 # Just accumulate the unique libdirs.
4152 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4153 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4156 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4161 eval flag=\"$hardcode_libdir_flag_spec\"
4162 rpath="$rpath $flag"
4164 elif test -n "$runpath_var"; then
4165 case "$finalize_perm_rpath " in
4167 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4171 # Substitute the hardcoded libdirs into the rpath.
4172 if test -n "$hardcode_libdir_separator" &&
4173 test -n "$hardcode_libdirs"; then
4174 libdir="$hardcode_libdirs"
4175 eval rpath=\" $hardcode_libdir_flag_spec\"
4177 finalize_rpath="$rpath"
4179 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4180 # Transform all the library objects into standard objects.
4181 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4182 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4186 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4187 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4188 dlsyms="${outputname}S.c"
4190 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4194 if test -n "$dlsyms"; then
4198 # Discover the nlist of each of the dlfiles.
4199 nlist="$output_objdir/${outputname}.nm"
4201 $show "$rm $nlist ${nlist}S ${nlist}T"
4202 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4204 # Parse the name list into a source file.
4205 $show "creating $output_objdir/$dlsyms"
4207 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4208 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4209 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4215 /* Prevent the only kind of declaration conflicts we can make. */
4216 #define lt_preloaded_symbols some_other_symbol
4218 /* External symbol declarations for the compiler. */\
4221 if test "$dlself" = yes; then
4222 $show "generating symbol list for \`$output'"
4224 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4226 # Add our own program objects to the symbol list.
4227 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4228 for arg in $progfiles; do
4229 $show "extracting global C symbols from \`$arg'"
4230 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4233 if test -n "$exclude_expsyms"; then
4234 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4235 $run eval '$mv "$nlist"T "$nlist"'
4238 if test -n "$export_symbols_regex"; then
4239 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4240 $run eval '$mv "$nlist"T "$nlist"'
4243 # Prepare the list of exported symbols
4244 if test -z "$export_symbols"; then
4245 export_symbols="$output_objdir/$output.exp"
4246 $run $rm $export_symbols
4247 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4249 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4250 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4251 $run eval 'mv "$nlist"T "$nlist"'
4255 for arg in $dlprefiles; do
4256 $show "extracting global C symbols from \`$arg'"
4257 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4258 $run eval '$echo ": $name " >> "$nlist"'
4259 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4262 if test -z "$run"; then
4263 # Make sure we have at least an empty file.
4264 test -f "$nlist" || : > "$nlist"
4266 if test -n "$exclude_expsyms"; then
4267 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4268 $mv "$nlist"T "$nlist"
4271 # Try sorting and uniquifying the output.
4272 if grep -v "^: " < "$nlist" |
4273 if sort -k 3 </dev/null >/dev/null 2>&1; then
4278 uniq > "$nlist"S; then
4281 grep -v "^: " < "$nlist" > "$nlist"S
4284 if test -f "$nlist"S; then
4285 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4287 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4290 $echo >> "$output_objdir/$dlsyms" "\
4292 #undef lt_preloaded_symbols
4294 #if defined (__STDC__) && __STDC__
4295 # define lt_ptr void *
4297 # define lt_ptr char *
4301 /* The mapping between symbol names and symbols. */
4306 lt_preloaded_symbols[] =
4310 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4312 $echo >> "$output_objdir/$dlsyms" "\
4316 /* This works around a problem in FreeBSD linker */
4317 #ifdef FREEBSD_WORKAROUND
4318 static const void *lt_preloaded_setup() {
4319 return lt_preloaded_symbols;
4329 pic_flag_for_symtable=
4331 # compiling the symbol table file with pic_flag works around
4332 # a FreeBSD bug that causes programs to crash when -lm is
4333 # linked before any other PIC object. But we must not use
4334 # pic_flag when linking with -static. The problem exists in
4335 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4336 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4337 case "$compile_command " in
4339 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4342 case "$compile_command " in
4344 *) pic_flag_for_symtable=" $pic_flag";;
4348 # Now compile the dynamic symbol file.
4349 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4350 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4352 # Clean up the generated files.
4353 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4354 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4356 # Transform the symbol file into the correct name.
4357 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4358 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4361 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4366 # We keep going just in case the user didn't refer to
4367 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4368 # really was required.
4370 # Nullify the symbol file.
4371 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4372 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4375 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4376 # Replace the output file specification.
4377 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4378 link_command="$compile_command$compile_rpath"
4380 # We have no uninstalled library dependencies, so finalize right now.
4381 $show "$link_command"
4382 $run eval "$link_command"
4385 # Delete the generated files.
4386 if test -n "$dlsyms"; then
4387 $show "$rm $output_objdir/${outputname}S.${objext}"
4388 $run $rm "$output_objdir/${outputname}S.${objext}"
4394 if test -n "$shlibpath_var"; then
4395 # We should set the shlibpath_var
4397 for dir in $temp_rpath; do
4399 [\\/]* | [A-Za-z]:[\\/]*)
4404 # Relative path: add a thisdir entry.
4405 rpath="$rpath\$thisdir/$dir:"
4412 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4413 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4415 if test -n "$finalize_shlibpath"; then
4416 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4421 if test -n "$runpath_var"; then
4422 if test -n "$perm_rpath"; then
4423 # We should set the runpath_var.
4425 for dir in $perm_rpath; do
4428 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4430 if test -n "$finalize_perm_rpath"; then
4431 # We should set the runpath_var.
4433 for dir in $finalize_perm_rpath; do
4436 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4440 if test "$no_install" = yes; then
4441 # We don't need to create a wrapper script.
4442 link_command="$compile_var$compile_command$compile_rpath"
4443 # Replace the output file specification.
4444 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4445 # Delete the old output file.
4447 # Link the executable and exit
4448 $show "$link_command"
4449 $run eval "$link_command" || exit $?
4453 if test "$hardcode_action" = relink; then
4454 # Fast installation is not supported
4455 link_command="$compile_var$compile_command$compile_rpath"
4456 relink_command="$finalize_var$finalize_command$finalize_rpath"
4458 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4459 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4461 if test "$fast_install" != no; then
4462 link_command="$finalize_var$compile_command$finalize_rpath"
4463 if test "$fast_install" = yes; then
4464 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4466 # fast_install is set to needless
4470 link_command="$compile_var$compile_command$compile_rpath"
4471 relink_command="$finalize_var$finalize_command$finalize_rpath"
4475 # Replace the output file specification.
4476 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4478 # Delete the old output files.
4479 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4481 $show "$link_command"
4482 $run eval "$link_command" || exit $?
4484 # Now create the wrapper script.
4485 $show "creating $output"
4487 # Quote the relink command for shipping.
4488 if test -n "$relink_command"; then
4489 # Preserve any variables that may affect compiler behavior
4490 for var in $variables_saved_for_relink; do
4491 if eval test -z \"\${$var+set}\"; then
4492 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4493 elif eval var_value=\$$var; test -z "$var_value"; then
4494 relink_command="$var=; export $var; $relink_command"
4496 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4497 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4500 relink_command="(cd `pwd`; $relink_command)"
4501 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4504 # Quote $echo for shipping.
4505 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4507 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4508 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4510 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4512 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4515 # Only actually do things if our run command is non-null.
4516 if test -z "$run"; then
4517 # win32 will think the script is a binary if it has
4518 # a .exe suffix, so we strip it off here.
4520 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4522 # test for cygwin because mv fails w/o .exe extensions
4526 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4530 *cygwin* | *mingw* )
4531 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4532 cwrapper=`$echo ${output}.exe`
4533 $rm $cwrappersource $cwrapper
4534 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4536 cat > $cwrappersource <<EOF
4538 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4539 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4541 The $output program cannot be directly executed until all the libtool
4542 libraries that it depends on are installed.
4544 This wrapper executable should never be moved out of the build directory.
4545 If it is, it will not operate correctly.
4547 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4548 but could eventually absorb all of the scripts functionality and
4549 exec $objdir/$outputname directly.
4552 cat >> $cwrappersource<<"EOF"
4560 #if defined(PATH_MAX)
4561 # define LT_PATHMAX PATH_MAX
4562 #elif defined(MAXPATHLEN)
4563 # define LT_PATHMAX MAXPATHLEN
4565 # define LT_PATHMAX 1024
4568 #ifndef DIR_SEPARATOR
4569 #define DIR_SEPARATOR '/'
4572 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4574 #define HAVE_DOS_BASED_FILE_SYSTEM
4575 #ifndef DIR_SEPARATOR_2
4576 #define DIR_SEPARATOR_2 '\\'
4580 #ifndef DIR_SEPARATOR_2
4581 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4582 #else /* DIR_SEPARATOR_2 */
4583 # define IS_DIR_SEPARATOR(ch) \
4584 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4585 #endif /* DIR_SEPARATOR_2 */
4587 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4588 #define XFREE(stale) do { \
4589 if (stale) { free ((void *) stale); stale = 0; } \
4592 const char *program_name = NULL;
4594 void * xmalloc (size_t num);
4595 char * xstrdup (const char *string);
4596 char * basename (const char *name);
4597 char * fnqualify(const char *path);
4598 char * strendzap(char *str, const char *pat);
4599 void lt_fatal (const char *message, ...);
4602 main (int argc, char *argv[])
4607 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4608 newargz = XMALLOC(char *, argc+2);
4611 cat >> $cwrappersource <<EOF
4612 newargz[0] = "$SHELL";
4615 cat >> $cwrappersource <<"EOF"
4616 newargz[1] = fnqualify(argv[0]);
4617 /* we know the script has the same name, without the .exe */
4618 /* so make sure newargz[1] doesn't end in .exe */
4619 strendzap(newargz[1],".exe");
4620 for (i = 1; i < argc; i++)
4621 newargz[i+1] = xstrdup(argv[i]);
4622 newargz[argc+1] = NULL;
4625 cat >> $cwrappersource <<EOF
4626 execv("$SHELL",newargz);
4629 cat >> $cwrappersource <<"EOF"
4633 xmalloc (size_t num)
4635 void * p = (void *) malloc (num);
4637 lt_fatal ("Memory exhausted");
4643 xstrdup (const char *string)
4645 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4650 basename (const char *name)
4654 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4655 /* Skip over the disk name in MSDOS pathnames. */
4656 if (isalpha (name[0]) && name[1] == ':')
4660 for (base = name; *name; name++)
4661 if (IS_DIR_SEPARATOR (*name))
4663 return (char *) base;
4667 fnqualify(const char *path)
4671 char tmp[LT_PATHMAX + 1];
4673 assert(path != NULL);
4675 /* Is it qualified already? */
4676 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4677 if (isalpha (path[0]) && path[1] == ':')
4678 return xstrdup (path);
4680 if (IS_DIR_SEPARATOR (path[0]))
4681 return xstrdup (path);
4683 /* prepend the current directory */
4684 /* doesn't handle '~' */
4685 if (getcwd (tmp, LT_PATHMAX) == NULL)
4686 lt_fatal ("getcwd failed");
4687 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4688 p = XMALLOC(char, size);
4689 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4694 strendzap(char *str, const char *pat)
4698 assert(str != NULL);
4699 assert(pat != NULL);
4702 patlen = strlen(pat);
4706 str += len - patlen;
4707 if (strcmp(str, pat) == 0)
4714 lt_error_core (int exit_status, const char * mode,
4715 const char * message, va_list ap)
4717 fprintf (stderr, "%s: %s: ", program_name, mode);
4718 vfprintf (stderr, message, ap);
4719 fprintf (stderr, ".\n");
4721 if (exit_status >= 0)
4726 lt_fatal (const char *message, ...)
4729 va_start (ap, message);
4730 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4734 # we should really use a build-platform specific compiler
4735 # here, but OTOH, the wrappers (shell script and this C one)
4736 # are only useful if you want to execute the "real" binary.
4737 # Since the "real" binary is built for $host, then this
4738 # wrapper might as well be built for $host, too.
4739 $run $LTCC -s -o $cwrapper $cwrappersource
4743 trap "$rm $output; exit 1" 1 2 15
4748 # $output - temporary wrapper script for $objdir/$outputname
4749 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4751 # The $output program cannot be directly executed until all the libtool
4752 # libraries that it depends on are installed.
4754 # This wrapper script should never be moved out of the build directory.
4755 # If it is, it will not operate correctly.
4757 # Sed substitution that helps us do robust quoting. It backslashifies
4758 # metacharacters that are still active within double-quoted strings.
4759 Xsed='${SED} -e 1s/^X//'
4760 sed_quote_subst='$sed_quote_subst'
4762 # The HP-UX ksh and POSIX shell print the target directory to stdout
4764 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4766 relink_command=\"$relink_command\"
4768 # This environment variable determines our operation mode.
4769 if test \"\$libtool_install_magic\" = \"$magic\"; then
4770 # install mode needs the following variable:
4771 notinst_deplibs='$notinst_deplibs'
4773 # When we are sourced in execute mode, \$file and \$echo are already set.
4774 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4777 # Make sure echo works.
4778 if test \"X\$1\" = X--no-reexec; then
4779 # Discard the --no-reexec flag, and continue.
4781 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4782 # Yippee, \$echo works!
4785 # Restart under the correct shell, and then maybe \$echo will work.
4786 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4792 # Find the directory that this script lives in.
4793 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4794 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4796 # Follow symbolic links until we get to the real thisdir.
4797 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4798 while test -n \"\$file\"; do
4799 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4801 # If there was a directory component, then change thisdir.
4802 if test \"x\$destdir\" != \"x\$file\"; then
4803 case \"\$destdir\" in
4804 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4805 *) thisdir=\"\$thisdir/\$destdir\" ;;
4809 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4810 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4813 # Try to get the absolute directory name.
4814 absdir=\`cd \"\$thisdir\" && pwd\`
4815 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4818 if test "$fast_install" = yes; then
4820 program=lt-'$outputname'$exeext
4821 progdir=\"\$thisdir/$objdir\"
4823 if test ! -f \"\$progdir/\$program\" || \\
4824 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4825 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4827 file=\"\$\$-\$program\"
4829 if test ! -d \"\$progdir\"; then
4830 $mkdir \"\$progdir\"
4832 $rm \"\$progdir/\$file\"
4837 # relink executable if necessary
4838 if test -n \"\$relink_command\"; then
4839 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4841 $echo \"\$relink_command_output\" >&2
4842 $rm \"\$progdir/\$file\"
4847 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4848 { $rm \"\$progdir/\$program\";
4849 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4850 $rm \"\$progdir/\$file\"
4854 program='$outputname'
4855 progdir=\"\$thisdir/$objdir\"
4861 if test -f \"\$progdir/\$program\"; then"
4863 # Export our shlibpath_var if we have one.
4864 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4866 # Add our own library path to $shlibpath_var
4867 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4869 # Some systems cannot cope with colon-terminated $shlibpath_var
4870 # The second colon is a workaround for a bug in BeOS R4 sed
4871 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4873 export $shlibpath_var
4877 # fixup the dll searchpath if we need to.
4878 if test -n "$dllsearchpath"; then
4880 # Add the dll search path components to the executable PATH
4881 PATH=$dllsearchpath:\$PATH
4886 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4887 # Run the actual program with our arguments.
4890 # Backslashes separate directories on plain windows
4891 *-*-mingw | *-*-os2*)
4893 exec \$progdir\\\\\$program \${1+\"\$@\"}
4899 exec \$progdir/\$program \${1+\"\$@\"}
4904 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4908 # The program doesn't exist.
4909 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4910 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4911 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4922 # See if we need to build an old-fashioned archive.
4923 for oldlib in $oldlibs; do
4925 if test "$build_libtool_libs" = convenience; then
4926 oldobjs="$libobjs_save"
4927 addlibs="$convenience"
4928 build_libtool_libs=no
4930 if test "$build_libtool_libs" = module; then
4931 oldobjs="$libobjs_save"
4932 build_libtool_libs=no
4934 oldobjs="$old_deplibs $non_pic_objects"
4936 addlibs="$old_convenience"
4939 if test -n "$addlibs"; then
4940 gentop="$output_objdir/${outputname}x"
4941 $show "${rm}r $gentop"
4942 $run ${rm}r "$gentop"
4943 $show "$mkdir $gentop"
4944 $run $mkdir "$gentop"
4946 if test "$status" -ne 0 && test ! -d "$gentop"; then
4949 generated="$generated $gentop"
4951 # Add in members from convenience archives.
4952 for xlib in $addlibs; do
4953 # Extract the objects.
4955 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4956 *) xabs=`pwd`"/$xlib" ;;
4958 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4959 xdir="$gentop/$xlib"
4961 $show "${rm}r $xdir"
4963 $show "$mkdir $xdir"
4966 if test "$status" -ne 0 && test ! -d "$xdir"; then
4969 # We will extract separately just the conflicting names and we will no
4970 # longer touch any unique names. It is faster to leave these extract
4971 # automatically by $AR in one run.
4972 $show "(cd $xdir && $AR x $xabs)"
4973 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4974 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4977 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4978 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4979 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4982 while test "$i" -le "$count"
4984 # Put our $i before any first dot (extension)
4985 # Never overwrite any file
4987 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4989 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4991 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4992 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4998 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5002 # Do each command in the archive commands.
5003 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5004 eval cmds=\"$old_archive_from_new_cmds\"
5006 eval cmds=\"$old_archive_cmds\"
5008 if len=`expr "X$cmds" : ".*"` &&
5009 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5012 # the command line is too long to link in one step, link in parts
5013 $echo "using piecewise archive linking..."
5018 save_oldobjs=$oldobjs
5019 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5020 # encoded into archives. This makes 'ar r' malfunction in
5021 # this piecewise linking case whenever conflicting object
5022 # names appear in distinct ar calls; check, warn and compensate.
5023 if (for obj in $save_oldobjs
5025 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5026 done | sort | sort -uc >/dev/null 2>&1); then
5029 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5030 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5033 # Is there a better way of finding the last object in the list?
5034 for obj in $save_oldobjs
5038 for obj in $save_oldobjs
5040 oldobjs="$objlist $obj"
5041 objlist="$objlist $obj"
5042 eval test_cmds=\"$old_archive_cmds\"
5043 if len=`expr "X$test_cmds" : ".*"` &&
5044 test "$len" -le "$max_cmd_len"; then
5047 # the above command should be used before it gets too long
5049 if test "$obj" = "$last_oldobj" ; then
5052 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5053 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5059 if test "X$oldobjs" = "X" ; then
5060 eval cmds=\"\$concat_cmds\"
5062 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5066 save_ifs="$IFS"; IFS='~'
5067 for cmd in $cmds; do
5070 $run eval "$cmd" || exit $?
5075 if test -n "$generated"; then
5076 $show "${rm}r$generated"
5077 $run ${rm}r$generated
5080 # Now create the libtool archive.
5084 test "$build_old_libs" = yes && old_library="$libname.$libext"
5085 $show "creating $output"
5087 # Preserve any variables that may affect compiler behavior
5088 for var in $variables_saved_for_relink; do
5089 if eval test -z \"\${$var+set}\"; then
5090 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5091 elif eval var_value=\$$var; test -z "$var_value"; then
5092 relink_command="$var=; export $var; $relink_command"
5094 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5095 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5098 # Quote the link command for shipping.
5099 relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5100 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5101 if test "$hardcode_automatic" = yes ; then
5104 # Only create the output if not a dry run.
5105 if test -z "$run"; then
5106 for installed in no yes; do
5107 if test "$installed" = yes; then
5108 if test -z "$install_libdir"; then
5111 output="$output_objdir/$outputname"i
5112 # Replace all uninstalled libtool libraries with the installed ones
5114 for deplib in $dependency_libs; do
5117 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5118 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5119 if test -z "$libdir"; then
5120 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5123 newdependency_libs="$newdependency_libs $libdir/$name"
5125 *) newdependency_libs="$newdependency_libs $deplib" ;;
5128 dependency_libs="$newdependency_libs"
5130 for lib in $dlfiles; do
5131 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5132 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5133 if test -z "$libdir"; then
5134 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5137 newdlfiles="$newdlfiles $libdir/$name"
5139 dlfiles="$newdlfiles"
5141 for lib in $dlprefiles; do
5142 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5143 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5144 if test -z "$libdir"; then
5145 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5148 newdlprefiles="$newdlprefiles $libdir/$name"
5150 dlprefiles="$newdlprefiles"
5153 for lib in $dlfiles; do
5155 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5156 *) abs=`pwd`"/$lib" ;;
5158 newdlfiles="$newdlfiles $abs"
5160 dlfiles="$newdlfiles"
5162 for lib in $dlprefiles; do
5164 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5165 *) abs=`pwd`"/$lib" ;;
5167 newdlprefiles="$newdlprefiles $abs"
5169 dlprefiles="$newdlprefiles"
5172 # place dlname in correct position for cygwin
5174 case $host,$output,$installed,$module,$dlname in
5175 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5178 # $outputname - a libtool library file
5179 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5181 # Please DO NOT delete this file!
5182 # It is necessary for linking the library.
5184 # The name that we can dlopen(3).
5187 # Names of this library.
5188 library_names='$library_names'
5190 # The name of the static archive.
5191 old_library='$old_library'
5193 # Libraries that this one depends upon.
5194 dependency_libs='$dependency_libs'
5196 # Version information for $libname.
5201 # Is this an already installed library?
5202 installed=$installed
5204 # Should we warn about portability when linking against -modules?
5205 shouldnotlink=$module
5207 # Files to dlopen/dlpreopen
5209 dlpreopen='$dlprefiles'
5211 # Directory that this library needs to be installed in:
5212 libdir='$install_libdir'"
5213 if test "$installed" = no && test "$need_relink" = yes; then
5215 relink_command=\"$relink_command\""
5220 # Do a symbolic link so that the libtool archive can be found in
5221 # LD_LIBRARY_PATH before the program is installed.
5222 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5223 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5229 # libtool install mode
5231 modename="$modename: install"
5233 # There may be an optional sh(1) argument at the beginning of
5234 # install_prog (especially on Windows NT).
5235 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5236 # Allow the use of GNU shtool's install command.
5237 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5238 # Aesthetically quote it.
5239 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5241 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5245 install_prog="$arg "
5253 # The real first argument should be the name of the installation program.
5254 # Aesthetically quote it.
5255 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5257 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5261 install_prog="$install_prog$arg"
5263 # We need to accept at least all the BSD install flags.
5273 if test -n "$dest"; then
5274 files="$files $dest"
5292 # If the previous option needed an argument, then skip it.
5293 if test -n "$prev"; then
5302 # Aesthetically quote the argument.
5303 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5305 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5309 install_prog="$install_prog $arg"
5312 if test -z "$install_prog"; then
5313 $echo "$modename: you must specify an install program" 1>&2
5318 if test -n "$prev"; then
5319 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5324 if test -z "$files"; then
5325 if test -z "$dest"; then
5326 $echo "$modename: no file or destination specified" 1>&2
5328 $echo "$modename: you must specify a destination" 1>&2
5334 # Strip any trailing slash from the destination.
5335 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5337 # Check to see that the destination is a directory.
5338 test -d "$dest" && isdir=yes
5339 if test "$isdir" = yes; then
5343 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5344 test "X$destdir" = "X$dest" && destdir=.
5345 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5347 # Not a directory, so check to see that there is only one file specified.
5349 if test "$#" -gt 2; then
5350 $echo "$modename: \`$dest' is not a directory" 1>&2
5356 [\\/]* | [A-Za-z]:[\\/]*) ;;
5358 for file in $files; do
5362 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5371 # This variable tells wrapper scripts just to set variables rather
5372 # than running their programs.
5373 libtool_install_magic="$magic"
5378 for file in $files; do
5380 # Do each installation.
5383 # Do the static libraries later.
5384 staticlibs="$staticlibs $file"
5388 # Check to see that this really is a libtool archive.
5389 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5391 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5399 # If there is no directory component, then add one.
5401 */* | *\\*) . $file ;;
5405 # Add the libdir to current_libdirs if it is the destination.
5406 if test "X$destdir" = "X$libdir"; then
5407 case "$current_libdirs " in
5409 *) current_libdirs="$current_libdirs $libdir" ;;
5412 # Note the libdir as a future libdir.
5413 case "$future_libdirs " in
5415 *) future_libdirs="$future_libdirs $libdir" ;;
5419 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5420 test "X$dir" = "X$file/" && dir=
5423 if test -n "$relink_command"; then
5424 # Determine the prefix the user has applied to our future dir.
5425 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5427 # Don't allow the user to place us outside of our expected
5428 # location b/c this prevents finding dependent libraries that
5429 # are installed to the same prefix.
5430 # At present, this check doesn't affect windows .dll's that
5431 # are installed into $libdir/../bin (currently, that works fine)
5432 # but it's something to keep an eye on.
5433 if test "$inst_prefix_dir" = "$destdir"; then
5434 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5438 if test -n "$inst_prefix_dir"; then
5439 # Stick the inst_prefix_dir data into the link command.
5440 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5442 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5445 $echo "$modename: warning: relinking \`$file'" 1>&2
5446 $show "$relink_command"
5447 if $run eval "$relink_command"; then :
5449 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5454 # See the names of the shared library.
5455 set dummy $library_names
5456 if test -n "$2"; then
5462 test -n "$relink_command" && srcname="$realname"T
5464 # Install the shared library and build the symlinks.
5465 $show "$install_prog $dir/$srcname $destdir/$realname"
5466 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5467 if test -n "$stripme" && test -n "$striplib"; then
5468 $show "$striplib $destdir/$realname"
5469 $run eval "$striplib $destdir/$realname" || exit $?
5472 if test "$#" -gt 0; then
5473 # Delete the old symlinks, and create new ones.
5476 if test "$linkname" != "$realname"; then
5477 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5478 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5483 # Do each command in the postinstall commands.
5484 lib="$destdir/$realname"
5485 eval cmds=\"$postinstall_cmds\"
5486 save_ifs="$IFS"; IFS='~'
5487 for cmd in $cmds; do
5490 $run eval "$cmd" || exit $?
5495 # Install the pseudo-library for information purposes.
5496 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5497 instname="$dir/$name"i
5498 $show "$install_prog $instname $destdir/$name"
5499 $run eval "$install_prog $instname $destdir/$name" || exit $?
5501 # Maybe install the static library, too.
5502 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5506 # Install (i.e. copy) a libtool object.
5508 # Figure out destination file name, if it wasn't already specified.
5509 if test -n "$destname"; then
5510 destfile="$destdir/$destname"
5512 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5513 destfile="$destdir/$destfile"
5516 # Deduce the name of the destination old-style object file.
5519 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5522 staticdest="$destfile"
5526 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5532 # Install the libtool object if requested.
5533 if test -n "$destfile"; then
5534 $show "$install_prog $file $destfile"
5535 $run eval "$install_prog $file $destfile" || exit $?
5538 # Install the old object if enabled.
5539 if test "$build_old_libs" = yes; then
5540 # Deduce the name of the old-style object file.
5541 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5543 $show "$install_prog $staticobj $staticdest"
5544 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5550 # Figure out destination file name, if it wasn't already specified.
5551 if test -n "$destname"; then
5552 destfile="$destdir/$destname"
5554 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5555 destfile="$destdir/$destfile"
5558 # If the file is missing, and there is a .exe on the end, strip it
5559 # because it is most likely a libtool script we actually want to
5564 if test ! -f "$file"; then
5565 file=`$echo $file|${SED} 's,.exe$,,'`
5571 # Do a test to see if this is really a libtool program.
5574 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5580 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5584 # To insure that "foo" is sourced, and not "foo.exe",
5585 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5586 # which disallows the automatic-append-.exe behavior.
5588 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5589 *) wrapperdot=${wrapper} ;;
5591 # If there is no directory component, then add one.
5593 */* | *\\*) . ${wrapperdot} ;;
5594 *) . ./${wrapperdot} ;;
5597 # Check the variables that should have been set.
5598 if test -z "$notinst_deplibs"; then
5599 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5604 for lib in $notinst_deplibs; do
5605 # Check to see that each library is installed.
5607 if test -f "$lib"; then
5608 # If there is no directory component, then add one.
5610 */* | *\\*) . $lib ;;
5614 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5615 if test -n "$libdir" && test ! -f "$libfile"; then
5616 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5622 # To insure that "foo" is sourced, and not "foo.exe",
5623 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5624 # which disallows the automatic-append-.exe behavior.
5626 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5627 *) wrapperdot=${wrapper} ;;
5629 # If there is no directory component, then add one.
5631 */* | *\\*) . ${wrapperdot} ;;
5632 *) . ./${wrapperdot} ;;
5636 if test "$fast_install" = no && test -n "$relink_command"; then
5637 if test "$finalize" = yes && test -z "$run"; then
5639 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5640 tmpdir="$tmpdir/libtool-$$"
5641 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5643 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5646 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5647 outputname="$tmpdir/$file"
5648 # Replace the output file specification.
5649 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5651 $show "$relink_command"
5652 if $run eval "$relink_command"; then :
5654 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5660 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5663 # Install the binary that we compiled earlier.
5664 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5668 # remove .exe since cygwin /usr/bin/install will append another
5670 case $install_prog,$host in
5671 */usr/bin/install*,*cygwin*)
5672 case $file:$destfile in
5677 destfile=$destfile.exe
5680 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5685 $show "$install_prog$stripme $file $destfile"
5686 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5687 test -n "$outputname" && ${rm}r "$tmpdir"
5692 for file in $staticlibs; do
5693 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5695 # Set up the ranlib parameters.
5696 oldlib="$destdir/$name"
5698 $show "$install_prog $file $oldlib"
5699 $run eval "$install_prog \$file \$oldlib" || exit $?
5701 if test -n "$stripme" && test -n "$striplib"; then
5702 $show "$old_striplib $oldlib"
5703 $run eval "$old_striplib $oldlib" || exit $?
5706 # Do each command in the postinstall commands.
5707 eval cmds=\"$old_postinstall_cmds\"
5708 save_ifs="$IFS"; IFS='~'
5709 for cmd in $cmds; do
5712 $run eval "$cmd" || exit $?
5717 if test -n "$future_libdirs"; then
5718 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5721 if test -n "$current_libdirs"; then
5722 # Maybe just do a dry run.
5723 test -n "$run" && current_libdirs=" -n$current_libdirs"
5724 exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5730 # libtool finish mode
5732 modename="$modename: finish"
5736 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5739 libdirs="$libdirs $dir"
5742 for libdir in $libdirs; do
5743 if test -n "$finish_cmds"; then
5744 # Do each command in the finish commands.
5745 eval cmds=\"$finish_cmds\"
5746 save_ifs="$IFS"; IFS='~'
5747 for cmd in $cmds; do
5750 $run eval "$cmd" || admincmds="$admincmds
5755 if test -n "$finish_eval"; then
5756 # Do the single finish_eval.
5757 eval cmds=\"$finish_eval\"
5758 $run eval "$cmds" || admincmds="$admincmds
5764 # Exit here if they wanted silent mode.
5765 test "$show" = : && exit 0
5767 $echo "----------------------------------------------------------------------"
5768 $echo "Libraries have been installed in:"
5769 for libdir in $libdirs; do
5773 $echo "If you ever happen to want to link against installed libraries"
5774 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5775 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5776 $echo "flag during linking and do at least one of the following:"
5777 if test -n "$shlibpath_var"; then
5778 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5779 $echo " during execution"
5781 if test -n "$runpath_var"; then
5782 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5783 $echo " during linking"
5785 if test -n "$hardcode_libdir_flag_spec"; then
5787 eval flag=\"$hardcode_libdir_flag_spec\"
5789 $echo " - use the \`$flag' linker flag"
5791 if test -n "$admincmds"; then
5792 $echo " - have your system administrator run these commands:$admincmds"
5794 if test -f /etc/ld.so.conf; then
5795 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5798 $echo "See any operating system documentation about shared libraries for"
5799 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5800 $echo "----------------------------------------------------------------------"
5804 # libtool execute mode
5806 modename="$modename: execute"
5808 # The first argument is the command name.
5810 if test -z "$cmd"; then
5811 $echo "$modename: you must specify a COMMAND" 1>&2
5816 # Handle -dlopen flags immediately.
5817 for file in $execute_dlfiles; do
5818 if test ! -f "$file"; then
5819 $echo "$modename: \`$file' is not a file" 1>&2
5827 # Check to see that this really is a libtool archive.
5828 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5830 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5835 # Read the libtool library.
5839 # If there is no directory component, then add one.
5841 */* | *\\*) . $file ;;
5845 # Skip this library if it cannot be dlopened.
5846 if test -z "$dlname"; then
5847 # Warn if it was a shared library.
5848 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5852 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5853 test "X$dir" = "X$file" && dir=.
5855 if test -f "$dir/$objdir/$dlname"; then
5858 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5864 # Just add the directory containing the .lo file.
5865 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5866 test "X$dir" = "X$file" && dir=.
5870 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5875 # Get the absolute pathname.
5876 absdir=`cd "$dir" && pwd`
5877 test -n "$absdir" && dir="$absdir"
5879 # Now add the directory to shlibpath_var.
5880 if eval "test -z \"\$$shlibpath_var\""; then
5881 eval "$shlibpath_var=\"\$dir\""
5883 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5887 # This variable tells wrapper scripts just to set shlibpath_var
5888 # rather than running their programs.
5889 libtool_execute_magic="$magic"
5891 # Check if any of the arguments is a wrapper script.
5898 # Do a test to see if this is really a libtool program.
5899 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5900 # If there is no directory component, then add one.
5902 */* | *\\*) . $file ;;
5906 # Transform arg to wrapped name.
5907 file="$progdir/$program"
5911 # Quote arguments (to preserve shell metacharacters).
5912 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5913 args="$args \"$file\""
5916 if test -z "$run"; then
5917 if test -n "$shlibpath_var"; then
5918 # Export the shlibpath_var.
5919 eval "export $shlibpath_var"
5922 # Restore saved environment variables
5923 if test "${save_LC_ALL+set}" = set; then
5924 LC_ALL="$save_LC_ALL"; export LC_ALL
5926 if test "${save_LANG+set}" = set; then
5927 LANG="$save_LANG"; export LANG
5930 # Now prepare to actually exec the command.
5931 exec_cmd="\$cmd$args"
5933 # Display what would be done.
5934 if test -n "$shlibpath_var"; then
5935 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5936 $echo "export $shlibpath_var"
5943 # libtool clean and uninstall mode
5945 modename="$modename: $mode"
5951 # This variable tells wrapper scripts just to set variables rather
5952 # than running their programs.
5953 libtool_install_magic="$magic"
5958 -f) rm="$rm $arg"; rmforce=yes ;;
5959 -*) rm="$rm $arg" ;;
5960 *) files="$files $arg" ;;
5964 if test -z "$rm"; then
5965 $echo "$modename: you must specify an RM program" 1>&2
5972 origobjdir="$objdir"
5973 for file in $files; do
5974 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5975 if test "X$dir" = "X$file"; then
5977 objdir="$origobjdir"
5979 objdir="$dir/$origobjdir"
5981 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5982 test "$mode" = uninstall && objdir="$dir"
5984 # Remember objdir for removal later, being careful to avoid duplicates
5985 if test "$mode" = clean; then
5988 *) rmdirs="$rmdirs $objdir" ;;
5992 # Don't error if the file doesn't exist and rm -f was used.
5993 if (test -L "$file") >/dev/null 2>&1 \
5994 || (test -h "$file") >/dev/null 2>&1 \
5995 || test -f "$file"; then
5997 elif test -d "$file"; then
6000 elif test "$rmforce" = yes; then
6008 # Possibly a libtool archive, so verify it.
6009 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6012 # Delete the libtool libraries and symlinks.
6013 for n in $library_names; do
6014 rmfiles="$rmfiles $objdir/$n"
6016 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6017 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6019 if test "$mode" = uninstall; then
6020 if test -n "$library_names"; then
6021 # Do each command in the postuninstall commands.
6022 eval cmds=\"$postuninstall_cmds\"
6023 save_ifs="$IFS"; IFS='~'
6024 for cmd in $cmds; do
6028 if test "$?" -ne 0 && test "$rmforce" != yes; then
6035 if test -n "$old_library"; then
6036 # Do each command in the old_postuninstall commands.
6037 eval cmds=\"$old_postuninstall_cmds\"
6038 save_ifs="$IFS"; IFS='~'
6039 for cmd in $cmds; do
6043 if test "$?" -ne 0 && test "$rmforce" != yes; then
6049 # FIXME: should reinstall the best remaining shared library.
6055 # Possibly a libtool object, so verify it.
6056 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6061 # Add PIC object to the list of files to remove.
6062 if test -n "$pic_object" \
6063 && test "$pic_object" != none; then
6064 rmfiles="$rmfiles $dir/$pic_object"
6067 # Add non-PIC object to the list of files to remove.
6068 if test -n "$non_pic_object" \
6069 && test "$non_pic_object" != none; then
6070 rmfiles="$rmfiles $dir/$non_pic_object"
6076 if test "$mode" = clean ; then
6080 file=`$echo $file|${SED} 's,.exe$,,'`
6081 noexename=`$echo $name|${SED} 's,.exe$,,'`
6082 # $file with .exe has already been added to rmfiles,
6083 # add $file without .exe
6084 rmfiles="$rmfiles $file"
6087 # Do a test to see if this is a libtool program.
6088 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6092 # note $name still contains .exe if it was in $file originally
6093 # as does the version of $file that was added into $rmfiles
6094 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6095 if test "$fast_install" = yes && test -n "$relink_command"; then
6096 rmfiles="$rmfiles $objdir/lt-$name"
6098 if test "X$noexename" != "X$name" ; then
6099 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6105 $show "$rm $rmfiles"
6106 $run $rm $rmfiles || exit_status=1
6108 objdir="$origobjdir"
6110 # Try to remove the ${objdir}s in the directories where we deleted files
6111 for dir in $rmdirs; do
6112 if test -d "$dir"; then
6114 $run rmdir $dir >/dev/null 2>&1
6122 $echo "$modename: you must specify a MODE" 1>&2
6123 $echo "$generic_help" 1>&2
6128 if test -z "$exec_cmd"; then
6129 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6130 $echo "$generic_help" 1>&2
6133 fi # test -z "$show_help"
6135 if test -n "$exec_cmd"; then
6140 # We need to display help for each of the modes.
6143 "Usage: $modename [OPTION]... [MODE-ARG]...
6145 Provide generalized library-building support services.
6147 --config show all configuration variables
6148 --debug enable verbose shell tracing
6149 -n, --dry-run display commands without modifying any files
6150 --features display basic configuration information and exit
6151 --finish same as \`--mode=finish'
6152 --help display this help message and exit
6153 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6154 --quiet same as \`--silent'
6155 --silent don't print informational messages
6156 --tag=TAG use configuration variables from tag TAG
6157 --version print version information
6159 MODE must be one of the following:
6161 clean remove files from the build directory
6162 compile compile a source file into a libtool object
6163 execute automatically set library path, then run a program
6164 finish complete the installation of libtool libraries
6165 install install libraries or executables
6166 link create a library or an executable
6167 uninstall remove libraries from an installed directory
6169 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6170 a more detailed description of MODE.
6172 Report bugs to <bug-libtool@gnu.org>."
6178 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6180 Remove files from the build directory.
6182 RM is the name of the program to use to delete files associated with each FILE
6183 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6186 If FILE is a libtool library, object or program, all the files associated
6187 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6192 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6194 Compile a source file into a libtool library object.
6196 This mode accepts the following additional options:
6198 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6199 -prefer-pic try to building PIC objects only
6200 -prefer-non-pic try to building non-PIC objects only
6201 -static always build a \`.o' file suitable for static linking
6203 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6204 from the given SOURCEFILE.
6206 The output file name is determined by removing the directory component from
6207 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6208 library object suffix, \`.lo'."
6213 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6215 Automatically set library path, then run a program.
6217 This mode accepts the following additional options:
6219 -dlopen FILE add the directory containing FILE to the library path
6221 This mode sets the library path environment variable according to \`-dlopen'
6224 If any of the ARGS are libtool executable wrappers, then they are translated
6225 into their corresponding uninstalled binary, and any of their required library
6226 directories are added to the library path.
6228 Then, COMMAND is executed, with ARGS as arguments."
6233 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6235 Complete the installation of libtool libraries.
6237 Each LIBDIR is a directory that contains libtool libraries.
6239 The commands that this mode executes may require superuser privileges. Use
6240 the \`--dry-run' option if you just want to see what would be executed."
6245 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6247 Install executables or libraries.
6249 INSTALL-COMMAND is the installation command. The first component should be
6250 either the \`install' or \`cp' program.
6252 The rest of the components are interpreted as arguments to that command (only
6253 BSD-compatible install options are recognized)."
6258 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6260 Link object files or libraries together to form another library, or to
6261 create an executable program.
6263 LINK-COMMAND is a command using the C compiler that you would use to create
6264 a program from several object files.
6266 The following components of LINK-COMMAND are treated specially:
6268 -all-static do not do any dynamic linking at all
6269 -avoid-version do not add a version suffix if possible
6270 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6271 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6272 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6273 -export-symbols SYMFILE
6274 try to export only the symbols listed in SYMFILE
6275 -export-symbols-regex REGEX
6276 try to export only the symbols matching REGEX
6277 -LLIBDIR search LIBDIR for required installed libraries
6278 -lNAME OUTPUT-FILE requires the installed library libNAME
6279 -module build a library that can dlopened
6280 -no-fast-install disable the fast-install mode
6281 -no-install link a not-installable executable
6282 -no-undefined declare that a library does not refer to external symbols
6283 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6284 -objectlist FILE Use a list of object files found in FILE to specify objects
6285 -release RELEASE specify package release information
6286 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6287 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6288 -static do not do any dynamic linking of libtool libraries
6289 -version-info CURRENT[:REVISION[:AGE]]
6290 specify library version info [each variable defaults to 0]
6292 All other options (arguments beginning with \`-') are ignored.
6294 Every other argument is treated as a filename. Files ending in \`.la' are
6295 treated as uninstalled libtool libraries, other files are standard or library
6298 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6299 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6300 required, except when creating a convenience library.
6302 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6303 using \`ar' and \`ranlib', or on Windows using \`lib'.
6305 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6306 is created, otherwise an executable program is created."
6311 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6313 Remove libraries from an installation directory.
6315 RM is the name of the program to use to delete files associated with each FILE
6316 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6319 If FILE is a libtool library, all the files associated with it are deleted.
6320 Otherwise, only FILE itself is deleted using RM."
6324 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6331 $echo "Try \`$modename --help' for more information about other modes."
6335 # The TAGs below are defined such that we never get into a situation
6336 # in which we disable both kinds of libraries. Given conflicting
6337 # choices, we go for a static library, that is the most portable,
6338 # since we can't tell whether shared libraries were disabled because
6339 # the user asked for that or because the platform doesn't support
6340 # them. This is particularly important on AIX, because we don't
6341 # support having both static and shared libraries enabled at the same
6342 # time on that platform, so we default to a shared-only configuration.
6343 # If a disable-shared tag is given, we'll fallback to a static-only
6344 # configuration. But we'll never go from static-only to shared-only.
6346 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6347 build_libtool_libs=no
6349 # ### END LIBTOOL TAG CONFIG: disable-shared
6351 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6352 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6353 # ### END LIBTOOL TAG CONFIG: disable-static