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.60 2004/01/25 12:25:08)"
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 precious_files_regex=
894 prefer_static_libs=no
907 # Infer tagged configuration to use if any are available and
908 # if one wasn't chosen via the "--tag" command line option.
909 # Only attempt this if the compiler in the base link
910 # command doesn't match the default compiler.
911 if test -n "$available_tags" && test -z "$tagname"; then
912 case $base_compile in
913 # Blanks in the command may have been stripped by the calling shell,
914 # but not from the CC environment variable when configure was run.
915 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
916 # Blanks at the start of $base_compile will cause this to fail
917 # if we don't check for them as well.
919 for z in $available_tags; do
920 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
921 # Evaluate the configuration.
922 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
923 case $base_compile in
924 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
925 # The compiler in $compile_command matches
926 # the one in the tagged configuration.
927 # Assume this is the tagged configuration we want.
934 # If $tagname still isn't set, then no tagged configuration
935 # was found and let the user know that the "--tag" command
936 # line option must be used.
937 if test -z "$tagname"; then
938 $echo "$modename: unable to infer tagged configuration"
939 $echo "$modename: specify a tag with \`--tag'" 1>&2
942 # $echo "$modename: using $tagname tagged configuration"
948 # We need to know -static, to get the right output filenames.
952 -all-static | -static)
953 if test "X$arg" = "X-all-static"; then
954 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
955 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
957 if test -n "$link_static_flag"; then
958 dlopen_self=$dlopen_self_static
961 if test -z "$pic_flag" && test -n "$link_static_flag"; then
962 dlopen_self=$dlopen_self_static
965 build_libtool_libs=no
967 prefer_static_libs=yes
973 # See if our shared archives depend on static archives.
974 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
976 # Go through the arguments, transforming them on the way.
977 while test "$#" -gt 0; do
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"
1058 precious_files_regex="$arg"
1068 if test -f "$arg"; then
1071 for fil in `cat $save_arg`
1073 # moreargs="$moreargs $fil"
1075 # A libtool-controlled object.
1077 # Check to see that this really is a libtool object.
1078 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1083 # If there is no directory component, then add one.
1085 */* | *\\*) . $arg ;;
1089 if test -z "$pic_object" || \
1090 test -z "$non_pic_object" ||
1091 test "$pic_object" = none && \
1092 test "$non_pic_object" = none; then
1093 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1097 # Extract subdirectory from the argument.
1098 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1099 if test "X$xdir" = "X$arg"; then
1105 if test "$pic_object" != none; then
1106 # Prepend the subdirectory the object is found in.
1107 pic_object="$xdir$pic_object"
1109 if test "$prev" = dlfiles; then
1110 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1111 dlfiles="$dlfiles $pic_object"
1115 # If libtool objects are unsupported, then we need to preload.
1120 # CHECK ME: I think I busted this. -Ossama
1121 if test "$prev" = dlprefiles; then
1122 # Preload the old-style object.
1123 dlprefiles="$dlprefiles $pic_object"
1128 libobjs="$libobjs $pic_object"
1133 if test "$non_pic_object" != none; then
1134 # Prepend the subdirectory the object is found in.
1135 non_pic_object="$xdir$non_pic_object"
1137 # A standard non-PIC object
1138 non_pic_objects="$non_pic_objects $non_pic_object"
1139 if test -z "$pic_object" || test "$pic_object" = none ; then
1140 arg="$non_pic_object"
1144 # Only an error if not doing a dry-run.
1145 if test -z "$run"; then
1146 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1151 # Extract subdirectory from the argument.
1152 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1153 if test "X$xdir" = "X$arg"; then
1159 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1160 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1161 libobjs="$libobjs $pic_object"
1162 non_pic_objects="$non_pic_objects $non_pic_object"
1167 $echo "$modename: link input file \`$save_arg' does not exist"
1175 # We need an absolute path.
1177 [\\/]* | [A-Za-z]:[\\/]*) ;;
1179 $echo "$modename: only absolute run-paths are allowed" 1>&2
1183 if test "$prev" = rpath; then
1186 *) rpath="$rpath $arg" ;;
1191 *) xrpath="$xrpath $arg" ;;
1198 compiler_flags="$compiler_flags $qarg"
1200 compile_command="$compile_command $qarg"
1201 finalize_command="$finalize_command $qarg"
1205 linker_flags="$linker_flags $qarg"
1206 compiler_flags="$compiler_flags $wl$qarg"
1208 compile_command="$compile_command $wl$qarg"
1209 finalize_command="$finalize_command $wl$qarg"
1213 linker_flags="$linker_flags $qarg"
1214 compiler_flags="$compiler_flags $qarg"
1216 compile_command="$compile_command $qarg"
1217 finalize_command="$finalize_command $qarg"
1221 eval "$prev=\"\$arg\""
1226 fi # test -n "$prev"
1232 if test -n "$link_static_flag"; then
1233 compile_command="$compile_command $link_static_flag"
1234 finalize_command="$finalize_command $link_static_flag"
1240 # FIXME: remove this flag sometime in the future.
1241 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1265 -export-symbols | -export-symbols-regex)
1266 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1267 $echo "$modename: more than one -exported-symbols argument is not allowed"
1270 if test "X$arg" = "X-export-symbols"; then
1283 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1284 # so, if we see these flags be careful not to treat them like -L
1286 case $with_gcc/$host in
1287 no/*-*-irix* | /*-*-irix*)
1288 compile_command="$compile_command $arg"
1289 finalize_command="$finalize_command $arg"
1296 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1297 # We need an absolute path.
1299 [\\/]* | [A-Za-z]:[\\/]*) ;;
1301 absdir=`cd "$dir" && pwd`
1302 if test -z "$absdir"; then
1303 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1312 deplibs="$deplibs -L$dir"
1313 lib_search_path="$lib_search_path $dir"
1317 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1318 case :$dllsearchpath: in
1320 *) dllsearchpath="$dllsearchpath:$dir";;
1328 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1330 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1331 # These systems don't actually have a C or math library (as such)
1334 *-*-mingw* | *-*-os2*)
1335 # These systems don't actually have a C library (as such)
1336 test "X$arg" = "X-lc" && continue
1338 *-*-openbsd* | *-*-freebsd*)
1339 # Do not include libc due to us having libc/libc_r.
1340 test "X$arg" = "X-lc" && continue
1342 *-*-rhapsody* | *-*-darwin1.[012])
1343 # Rhapsody C and math libraries are in the System framework
1344 deplibs="$deplibs -framework System"
1347 elif test "X$arg" = "X-lc_r"; then
1349 *-*-openbsd* | *-*-freebsd4*)
1350 # Do not include libc_r directly, use -pthread flag.
1355 deplibs="$deplibs $arg"
1359 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1360 deplibs="$deplibs $arg"
1368 # Do not build the useless static library
1375 # gcc -m* arguments should be passed to the linker via $compiler_flags
1376 # in order to pass architecture information to the linker
1377 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1378 # but this is not reliable with gcc because gcc may use -mfoo to
1379 # select a different linker, different libraries, etc, while
1380 # -Wl,-mfoo simply passes -mfoo to the linker.
1382 # Unknown arguments in both finalize_command and compile_command need
1383 # to be aesthetically quoted because they are evaled later.
1384 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1386 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1390 compile_command="$compile_command $arg"
1391 finalize_command="$finalize_command $arg"
1392 if test "$with_gcc" = "yes" ; then
1393 compiler_flags="$compiler_flags $arg"
1410 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1411 # The PATH hackery in wrapper scripts is required on Windows
1412 # in order for the loader to find any dlls it needs.
1413 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1414 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1417 *) no_install=yes ;;
1434 -precious-files-regex)
1455 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1456 # We need an absolute path.
1458 [\\/]* | [A-Za-z]:[\\/]*) ;;
1460 $echo "$modename: only absolute run-paths are allowed" 1>&2
1466 *) xrpath="$xrpath $dir" ;;
1472 # The effects of -static are defined in a previous loop.
1473 # We used to do the same as -all-static on platforms that
1474 # didn't have a PIC flag, but the assumption that the effects
1475 # would be equivalent was wrong. It would break on at least
1476 # Digital Unix and AIX.
1496 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1498 save_ifs="$IFS"; IFS=','
1499 for flag in $args; do
1502 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1507 compiler_flags="$compiler_flags $flag"
1510 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1514 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1516 save_ifs="$IFS"; IFS=','
1517 for flag in $args; do
1520 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1525 compiler_flags="$compiler_flags $wl$flag"
1526 linker_flags="$linker_flags $flag"
1529 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1547 # Some other compiler flag.
1549 # Unknown arguments in both finalize_command and compile_command need
1550 # to be aesthetically quoted because they are evaled later.
1551 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1553 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1560 # A standard object.
1565 # A libtool-controlled object.
1567 # Check to see that this really is a libtool object.
1568 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1573 # If there is no directory component, then add one.
1575 */* | *\\*) . $arg ;;
1579 if test -z "$pic_object" || \
1580 test -z "$non_pic_object" ||
1581 test "$pic_object" = none && \
1582 test "$non_pic_object" = none; then
1583 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1587 # Extract subdirectory from the argument.
1588 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1589 if test "X$xdir" = "X$arg"; then
1595 if test "$pic_object" != none; then
1596 # Prepend the subdirectory the object is found in.
1597 pic_object="$xdir$pic_object"
1599 if test "$prev" = dlfiles; then
1600 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1601 dlfiles="$dlfiles $pic_object"
1605 # If libtool objects are unsupported, then we need to preload.
1610 # CHECK ME: I think I busted this. -Ossama
1611 if test "$prev" = dlprefiles; then
1612 # Preload the old-style object.
1613 dlprefiles="$dlprefiles $pic_object"
1618 libobjs="$libobjs $pic_object"
1623 if test "$non_pic_object" != none; then
1624 # Prepend the subdirectory the object is found in.
1625 non_pic_object="$xdir$non_pic_object"
1627 # A standard non-PIC object
1628 non_pic_objects="$non_pic_objects $non_pic_object"
1629 if test -z "$pic_object" || test "$pic_object" = none ; then
1630 arg="$non_pic_object"
1634 # Only an error if not doing a dry-run.
1635 if test -z "$run"; then
1636 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1641 # Extract subdirectory from the argument.
1642 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1643 if test "X$xdir" = "X$arg"; then
1649 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1650 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1651 libobjs="$libobjs $pic_object"
1652 non_pic_objects="$non_pic_objects $non_pic_object"
1659 deplibs="$deplibs $arg"
1660 old_deplibs="$old_deplibs $arg"
1665 # A libtool-controlled library.
1667 if test "$prev" = dlfiles; then
1668 # This library was specified with -dlopen.
1669 dlfiles="$dlfiles $arg"
1671 elif test "$prev" = dlprefiles; then
1672 # The library was specified with -dlpreopen.
1673 dlprefiles="$dlprefiles $arg"
1676 deplibs="$deplibs $arg"
1681 # Some other compiler argument.
1683 # Unknown arguments in both finalize_command and compile_command need
1684 # to be aesthetically quoted because they are evaled later.
1685 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1687 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1694 # Now actually substitute the argument into the commands.
1695 if test -n "$arg"; then
1696 compile_command="$compile_command $arg"
1697 finalize_command="$finalize_command $arg"
1699 done # argument parsing loop
1701 if test -n "$prev"; then
1702 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1707 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1708 eval arg=\"$export_dynamic_flag_spec\"
1709 compile_command="$compile_command $arg"
1710 finalize_command="$finalize_command $arg"
1714 # calculate the name of the file, without its directory
1715 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1716 libobjs_save="$libobjs"
1718 if test -n "$shlibpath_var"; then
1719 # get the directories listed in $shlibpath_var
1720 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1724 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1725 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1727 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1728 if test "X$output_objdir" = "X$output"; then
1729 output_objdir="$objdir"
1731 output_objdir="$output_objdir/$objdir"
1733 # Create the object directory.
1734 if test ! -d "$output_objdir"; then
1735 $show "$mkdir $output_objdir"
1736 $run $mkdir $output_objdir
1738 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1743 # Determine the type of output
1746 $echo "$modename: you must specify an output file" 1>&2
1750 *.$libext) linkmode=oldlib ;;
1751 *.lo | *.$objext) linkmode=obj ;;
1752 *.la) linkmode=lib ;;
1753 *) linkmode=prog ;; # Anything else should be a program.
1757 *cygwin* | *mingw* | *pw32*)
1758 # don't eliminate duplcations in $postdeps and $predeps
1759 duplicate_compiler_generated_deps=yes
1762 duplicate_compiler_generated_deps=$duplicate_deps
1768 # Find all interdependent deplibs by searching for libraries
1769 # that are linked more than once (e.g. -la -lb -la)
1770 for deplib in $deplibs; do
1771 if test "X$duplicate_deps" = "Xyes" ; then
1773 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1776 libs="$libs $deplib"
1779 if test "$linkmode" = lib; then
1780 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1782 # Compute libraries that are listed more than once in $predeps
1783 # $postdeps and mark them as special (i.e., whose duplicates are
1784 # not to be eliminated).
1786 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1787 for pre_post_dep in $predeps $postdeps; do
1788 case "$pre_post_deps " in
1789 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1791 pre_post_deps="$pre_post_deps $pre_post_dep"
1800 need_relink=no # whether we're linking any uninstalled libtool libraries
1801 notinst_deplibs= # not-installed libtool libraries
1802 notinst_path= # paths that contain not-installed libtool libraries
1806 for file in $dlfiles $dlprefiles; do
1810 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1822 passes="conv scan dlopen dlpreopen link"
1827 for pass in $passes; do
1828 if test "$linkmode,$pass" = "lib,link" ||
1829 test "$linkmode,$pass" = "prog,scan"; then
1833 if test "$linkmode" = prog; then
1835 dlopen) libs="$dlfiles" ;;
1836 dlpreopen) libs="$dlprefiles" ;;
1837 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1840 if test "$pass" = dlopen; then
1841 # Collect dlpreopened libraries
1842 save_deplibs="$deplibs"
1845 for deplib in $libs; do
1849 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1850 if test "$linkmode,$pass" = "prog,link"; then
1851 compile_deplibs="$deplib $compile_deplibs"
1852 finalize_deplibs="$deplib $finalize_deplibs"
1854 deplibs="$deplib $deplibs"
1859 if test "$linkmode" != lib && test "$linkmode" != prog; then
1860 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1863 if test "$pass" = conv; then
1864 deplibs="$deplib $deplibs"
1867 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1868 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1869 for search_ext in .la $shrext .so .a; do
1870 # Search the libtool library
1871 lib="$searchdir/lib${name}${search_ext}"
1872 if test -f "$lib"; then
1873 if test "$search_ext" = ".la"; then
1882 if test "$found" != yes; then
1883 # deplib doesn't seem to be a libtool library
1884 if test "$linkmode,$pass" = "prog,link"; then
1885 compile_deplibs="$deplib $compile_deplibs"
1886 finalize_deplibs="$deplib $finalize_deplibs"
1888 deplibs="$deplib $deplibs"
1889 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1892 else # deplib is a libtool library
1893 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1894 # We need to do some special things here, and not later.
1895 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1896 case " $predeps $postdeps " in
1898 if (${SED} -e '2q' $lib |
1899 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1903 */* | *\\*) . $lib ;;
1906 for l in $old_library $library_names; do
1909 if test "X$ll" = "X$old_library" ; then # only static version available
1911 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1912 test "X$ladir" = "X$lib" && ladir="."
1913 lib=$ladir/$old_library
1914 if test "$linkmode,$pass" = "prog,link"; then
1915 compile_deplibs="$deplib $compile_deplibs"
1916 finalize_deplibs="$deplib $finalize_deplibs"
1918 deplibs="$deplib $deplibs"
1919 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1933 deplibs="$deplib $deplibs"
1934 test "$pass" = conv && continue
1935 newdependency_libs="$deplib $newdependency_libs"
1936 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1939 if test "$pass" = conv; then
1940 deplibs="$deplib $deplibs"
1943 if test "$pass" = scan; then
1944 deplibs="$deplib $deplibs"
1945 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1947 compile_deplibs="$deplib $compile_deplibs"
1948 finalize_deplibs="$deplib $finalize_deplibs"
1952 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1958 if test "$pass" = link; then
1959 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1960 # Make sure the xrpath contains only unique directories.
1963 *) xrpath="$xrpath $dir" ;;
1966 deplibs="$deplib $deplibs"
1969 *.la) lib="$deplib" ;;
1971 if test "$pass" = conv; then
1972 deplibs="$deplib $deplibs"
1977 if test "$deplibs_check_method" != pass_all; then
1979 $echo "*** Warning: Trying to link with static lib archive $deplib."
1980 $echo "*** I have the capability to make that library automatically link in when"
1981 $echo "*** you link to this library. But I can only do this if you have a"
1982 $echo "*** shared version of the library, which you do not appear to have"
1983 $echo "*** because the file extensions .$libext of this argument makes me believe"
1984 $echo "*** that it is just a static archive that I should not used here."
1987 $echo "*** Warning: Linking the shared library $output against the"
1988 $echo "*** static library $deplib is not portable!"
1989 deplibs="$deplib $deplibs"
1994 if test "$pass" != link; then
1995 deplibs="$deplib $deplibs"
1997 compile_deplibs="$deplib $compile_deplibs"
1998 finalize_deplibs="$deplib $finalize_deplibs"
2005 if test "$pass" = conv; then
2006 deplibs="$deplib $deplibs"
2007 elif test "$linkmode" = prog; then
2008 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2009 # If there is no dlopen support or we're linking statically,
2010 # we need to preload.
2011 newdlprefiles="$newdlprefiles $deplib"
2012 compile_deplibs="$deplib $compile_deplibs"
2013 finalize_deplibs="$deplib $finalize_deplibs"
2015 newdlfiles="$newdlfiles $deplib"
2025 if test "$found" = yes || test -f "$lib"; then :
2027 $echo "$modename: cannot find the library \`$lib'" 1>&2
2031 # Check to see that this really is a libtool archive.
2032 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2034 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2038 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2039 test "X$ladir" = "X$lib" && ladir="."
2047 # If the library was installed with an old release of libtool,
2048 # it will not redefine variables installed, or shouldnotlink
2054 */* | *\\*) . $lib ;;
2058 if test "$linkmode,$pass" = "lib,link" ||
2059 test "$linkmode,$pass" = "prog,scan" ||
2060 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2061 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2062 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2065 if test "$pass" = conv; then
2066 # Only check for convenience libraries
2067 deplibs="$lib $deplibs"
2068 if test -z "$libdir"; then
2069 if test -z "$old_library"; then
2070 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2073 # It is a libtool convenience library, so add in its objects.
2074 convenience="$convenience $ladir/$objdir/$old_library"
2075 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2077 for deplib in $dependency_libs; do
2078 deplibs="$deplib $deplibs"
2079 if test "X$duplicate_deps" = "Xyes" ; then
2080 case "$tmp_libs " in
2081 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2084 tmp_libs="$tmp_libs $deplib"
2086 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2087 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2094 # Get the name of the library we link against.
2096 for l in $old_library $library_names; do
2099 if test -z "$linklib"; then
2100 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2104 # This library was specified with -dlopen.
2105 if test "$pass" = dlopen; then
2106 if test -z "$libdir"; then
2107 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2110 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2111 # If there is no dlname, no dlopen support or we're linking
2112 # statically, we need to preload. We also need to preload any
2113 # dependent libraries so libltdl's deplib preloader doesn't
2114 # bomb out in the load deplibs phase.
2115 dlprefiles="$dlprefiles $lib $dependency_libs"
2117 newdlfiles="$newdlfiles $lib"
2122 # We need an absolute path.
2124 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2126 abs_ladir=`cd "$ladir" && pwd`
2127 if test -z "$abs_ladir"; then
2128 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2129 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2134 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2136 # Find the relevant object directory and library name.
2137 if test "X$installed" = Xyes; then
2138 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2139 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2148 dir="$ladir/$objdir"
2149 absdir="$abs_ladir/$objdir"
2150 # Remove this search path later
2151 notinst_path="$notinst_path $abs_ladir"
2152 fi # $installed = yes
2153 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2155 # This library was specified with -dlpreopen.
2156 if test "$pass" = dlpreopen; then
2157 if test -z "$libdir"; then
2158 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2161 # Prefer using a static library (so that no silly _DYNAMIC symbols
2162 # are required to link).
2163 if test -n "$old_library"; then
2164 newdlprefiles="$newdlprefiles $dir/$old_library"
2165 # Otherwise, use the dlname, so that lt_dlopen finds it.
2166 elif test -n "$dlname"; then
2167 newdlprefiles="$newdlprefiles $dir/$dlname"
2169 newdlprefiles="$newdlprefiles $dir/$linklib"
2171 fi # $pass = dlpreopen
2173 if test -z "$libdir"; then
2174 # Link the convenience library
2175 if test "$linkmode" = lib; then
2176 deplibs="$dir/$old_library $deplibs"
2177 elif test "$linkmode,$pass" = "prog,link"; then
2178 compile_deplibs="$dir/$old_library $compile_deplibs"
2179 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2181 deplibs="$lib $deplibs" # used for prog,scan pass
2187 if test "$linkmode" = prog && test "$pass" != link; then
2188 newlib_search_path="$newlib_search_path $ladir"
2189 deplibs="$lib $deplibs"
2192 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2193 test "$build_libtool_libs" = no; then
2198 for deplib in $dependency_libs; do
2200 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2202 # Need to link against all dependency_libs?
2203 if test "$linkalldeplibs" = yes; then
2204 deplibs="$deplib $deplibs"
2206 # Need to hardcode shared library paths
2207 # or/and link against static libraries
2208 newdependency_libs="$deplib $newdependency_libs"
2210 if test "X$duplicate_deps" = "Xyes" ; then
2211 case "$tmp_libs " in
2212 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2215 tmp_libs="$tmp_libs $deplib"
2218 fi # $linkmode = prog...
2220 if test "$linkmode,$pass" = "prog,link"; then
2221 if test -n "$library_names" &&
2222 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2223 # We need to hardcode the library path
2224 if test -n "$shlibpath_var"; then
2225 # Make sure the rpath contains only unique directories.
2226 case "$temp_rpath " in
2229 *) temp_rpath="$temp_rpath $dir" ;;
2233 # Hardcode the library path.
2234 # Skip directories that are in the system default run-time
2236 case " $sys_lib_dlsearch_path " in
2239 case "$compile_rpath " in
2241 *) compile_rpath="$compile_rpath $absdir"
2245 case " $sys_lib_dlsearch_path " in
2248 case "$finalize_rpath " in
2250 *) finalize_rpath="$finalize_rpath $libdir"
2254 fi # $linkmode,$pass = prog,link...
2256 if test "$alldeplibs" = yes &&
2257 { test "$deplibs_check_method" = pass_all ||
2258 { test "$build_libtool_libs" = yes &&
2259 test -n "$library_names"; }; }; then
2260 # We only need to search for static libraries
2265 link_static=no # Whether the deplib will be linked statically
2266 if test -n "$library_names" &&
2267 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2268 if test "$installed" = no; then
2269 notinst_deplibs="$notinst_deplibs $lib"
2272 # This is a shared library
2274 # Warn about portability, can't link against -module's on some systems (darwin)
2275 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2277 if test "$linkmode" = prog; then
2278 $echo "*** Warning: Linking the executable $output against the loadable module"
2280 $echo "*** Warning: Linking the shared library $output against the loadable module"
2282 $echo "*** $linklib is not portable!"
2284 if test "$linkmode" = lib &&
2285 test "$hardcode_into_libs" = yes; then
2286 # Hardcode the library path.
2287 # Skip directories that are in the system default run-time
2289 case " $sys_lib_dlsearch_path " in
2292 case "$compile_rpath " in
2294 *) compile_rpath="$compile_rpath $absdir"
2298 case " $sys_lib_dlsearch_path " in
2301 case "$finalize_rpath " in
2303 *) finalize_rpath="$finalize_rpath $libdir"
2309 if test -n "$old_archive_from_expsyms_cmds"; then
2310 # figure out the soname
2311 set dummy $library_names
2314 libname=`eval \\$echo \"$libname_spec\"`
2315 # use dlname if we got it. it's perfectly good, no?
2316 if test -n "$dlname"; then
2318 elif test -n "$soname_spec"; then
2322 major=`expr $current - $age`
2326 eval soname=\"$soname_spec\"
2331 # Make a new name for the extract_expsyms_cmds to use
2333 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2334 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2336 # If the library has no export list, then create one now
2337 if test -f "$output_objdir/$soname-def"; then :
2339 $show "extracting exported symbol list from \`$soname'"
2340 save_ifs="$IFS"; IFS='~'
2341 cmds=$extract_expsyms_cmds
2342 for cmd in $cmds; do
2346 $run eval "$cmd" || exit $?
2352 if test -f "$output_objdir/$newlib"; then :; else
2353 $show "generating import library for \`$soname'"
2354 save_ifs="$IFS"; IFS='~'
2355 cmds=$old_archive_from_expsyms_cmds
2356 for cmd in $cmds; do
2360 $run eval "$cmd" || exit $?
2364 # make sure the library variables are pointing to the new library
2367 fi # test -n "$old_archive_from_expsyms_cmds"
2369 if test "$linkmode" = prog || test "$mode" != relink; then
2374 case $hardcode_action in
2375 immediate | unsupported)
2376 if test "$hardcode_direct" = no; then
2379 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2381 # if the lib is a module then we can not link against it, someone
2382 # is ignoring the new warnings I added
2383 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2384 $echo "** Warning, lib $linklib is a module, not a shared library"
2385 if test -z "$old_library" ; then
2387 $echo "** And there doesn't seem to be a static archive available"
2388 $echo "** The link will probably fail, sorry"
2390 add="$dir/$old_library"
2394 elif test "$hardcode_minus_L" = no; then
2396 *-*-sunos*) add_shlibpath="$dir" ;;
2400 elif test "$hardcode_shlibpath_var" = no; then
2401 add_shlibpath="$dir"
2408 if test "$hardcode_direct" = yes; then
2410 elif test "$hardcode_minus_L" = yes; then
2412 # Try looking first in the location we're being installed to.
2413 if test -n "$inst_prefix_dir"; then
2416 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2421 elif test "$hardcode_shlibpath_var" = yes; then
2422 add_shlibpath="$dir"
2431 if test "$lib_linked" != yes; then
2432 $echo "$modename: configuration error: unsupported hardcode properties"
2436 if test -n "$add_shlibpath"; then
2437 case :$compile_shlibpath: in
2438 *":$add_shlibpath:"*) ;;
2439 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2442 if test "$linkmode" = prog; then
2443 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2444 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2446 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2447 test -n "$add" && deplibs="$add $deplibs"
2448 if test "$hardcode_direct" != yes && \
2449 test "$hardcode_minus_L" != yes && \
2450 test "$hardcode_shlibpath_var" = yes; then
2451 case :$finalize_shlibpath: in
2453 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2459 if test "$linkmode" = prog || test "$mode" = relink; then
2463 # Finalize command for both is simple: just hardcode it.
2464 if test "$hardcode_direct" = yes; then
2465 add="$libdir/$linklib"
2466 elif test "$hardcode_minus_L" = yes; then
2469 elif test "$hardcode_shlibpath_var" = yes; then
2470 case :$finalize_shlibpath: in
2472 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2475 elif test "$hardcode_automatic" = yes; then
2476 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2477 add="$inst_prefix_dir$libdir/$linklib"
2479 add="$libdir/$linklib"
2482 # We cannot seem to hardcode it, guess we'll fake it.
2484 # Try looking first in the location we're being installed to.
2485 if test -n "$inst_prefix_dir"; then
2488 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2495 if test "$linkmode" = prog; then
2496 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2497 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2499 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2500 test -n "$add" && deplibs="$add $deplibs"
2503 elif test "$linkmode" = prog; then
2504 # Here we assume that one of hardcode_direct or hardcode_minus_L
2505 # is not unsupported. This is valid on all known static and
2507 if test "$hardcode_direct" != unsupported; then
2508 test -n "$old_library" && linklib="$old_library"
2509 compile_deplibs="$dir/$linklib $compile_deplibs"
2510 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2512 compile_deplibs="-l$name -L$dir $compile_deplibs"
2513 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2515 elif test "$build_libtool_libs" = yes; then
2516 # Not a shared library
2517 if test "$deplibs_check_method" != pass_all; then
2518 # We're trying link a shared library against a static one
2519 # but the system doesn't support it.
2521 # Just print a warning and add the library to dependency_libs so
2522 # that the program can be linked against the static library.
2524 $echo "*** Warning: This system can not link to static lib archive $lib."
2525 $echo "*** I have the capability to make that library automatically link in when"
2526 $echo "*** you link to this library. But I can only do this if you have a"
2527 $echo "*** shared version of the library, which you do not appear to have."
2528 if test "$module" = yes; then
2529 $echo "*** But as you try to build a module library, libtool will still create "
2530 $echo "*** a static module, that should work as long as the dlopening application"
2531 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2532 if test -z "$global_symbol_pipe"; then
2534 $echo "*** However, this would only work if libtool was able to extract symbol"
2535 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2536 $echo "*** not find such a program. So, this module is probably useless."
2537 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2539 if test "$build_old_libs" = no; then
2540 build_libtool_libs=module
2543 build_libtool_libs=no
2547 convenience="$convenience $dir/$old_library"
2548 old_convenience="$old_convenience $dir/$old_library"
2549 deplibs="$dir/$old_library $deplibs"
2552 fi # link shared/static library?
2554 if test "$linkmode" = lib; then
2555 if test -n "$dependency_libs" &&
2556 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2557 test "$link_static" = yes; }; then
2558 # Extract -R from dependency_libs
2560 for libdir in $dependency_libs; do
2562 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2564 *" $temp_xrpath "*) ;;
2565 *) xrpath="$xrpath $temp_xrpath";;
2567 *) temp_deplibs="$temp_deplibs $libdir";;
2570 dependency_libs="$temp_deplibs"
2573 newlib_search_path="$newlib_search_path $absdir"
2574 # Link against this library
2575 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2576 # ... and its dependency_libs
2578 for deplib in $dependency_libs; do
2579 newdependency_libs="$deplib $newdependency_libs"
2580 if test "X$duplicate_deps" = "Xyes" ; then
2581 case "$tmp_libs " in
2582 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2585 tmp_libs="$tmp_libs $deplib"
2588 if test "$link_all_deplibs" != no; then
2589 # Add the search paths of all dependency libraries
2590 for deplib in $dependency_libs; do
2592 -L*) path="$deplib" ;;
2594 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2595 test "X$dir" = "X$deplib" && dir="."
2596 # We need an absolute path.
2598 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2600 absdir=`cd "$dir" && pwd`
2601 if test -z "$absdir"; then
2602 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2607 if grep "^installed=no" $deplib > /dev/null; then
2608 path="$absdir/$objdir"
2610 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2611 if test -z "$libdir"; then
2612 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2615 if test "$absdir" != "$libdir"; then
2616 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2623 # we do not want to link against static libs, but need to link against shared
2624 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2625 if test -n "$deplibrary_names" ; then
2626 for tmp in $deplibrary_names ; do
2629 if test -f "$path/$depdepl" ; then
2630 depdepl="$path/$depdepl"
2632 # do not add paths which are already there
2633 case " $newlib_search_path " in
2635 *) newlib_search_path="$newlib_search_path $path";;
2649 # Again, we only want to link against shared libraries
2650 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2651 for tmp in $newlib_search_path ; do
2652 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2653 eval depdepl="$tmp/lib$tmp_libs.dylib"
2664 case " $deplibs " in
2666 *) deplibs="$deplibs $depdepl" ;;
2668 case " $deplibs " in
2670 *) deplibs="$deplibs $path" ;;
2673 fi # link_all_deplibs != no
2675 done # for deplib in $libs
2676 dependency_libs="$newdependency_libs"
2677 if test "$pass" = dlpreopen; then
2678 # Link the dlpreopened libraries before other libraries
2679 for deplib in $save_deplibs; do
2680 deplibs="$deplib $deplibs"
2683 if test "$pass" != dlopen; then
2684 if test "$pass" != conv; then
2685 # Make sure lib_search_path contains only unique directories.
2687 for dir in $newlib_search_path; do
2688 case "$lib_search_path " in
2690 *) lib_search_path="$lib_search_path $dir" ;;
2696 if test "$linkmode,$pass" != "prog,link"; then
2699 vars="compile_deplibs finalize_deplibs"
2701 for var in $vars dependency_libs; do
2702 # Add libraries to $var in reverse order
2703 eval tmp_libs=\"\$$var\"
2705 for deplib in $tmp_libs; do
2706 # FIXME: Pedantically, this is the right thing to do, so
2707 # that some nasty dependency loop isn't accidentally
2709 #new_libs="$deplib $new_libs"
2710 # Pragmatically, this seems to cause very few problems in
2713 -L*) new_libs="$deplib $new_libs" ;;
2716 # And here is the reason: when a library appears more
2717 # than once as an explicit dependence of a library, or
2718 # is implicitly linked in more than once by the
2719 # compiler, it is considered special, and multiple
2720 # occurrences thereof are not removed. Compare this
2721 # with having the same library being listed as a
2722 # dependency of multiple other libraries: in this case,
2723 # we know (pedantically, we assume) the library does not
2724 # need to be listed more than once, so we keep only the
2725 # last copy. This is not always right, but it is rare
2726 # enough that we require users that really mean to play
2727 # such unportable linking tricks to link the library
2728 # using -Wl,-lname, so that libtool does not consider it
2729 # for duplicate removal.
2730 case " $specialdeplibs " in
2731 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2733 case " $new_libs " in
2735 *) new_libs="$deplib $new_libs" ;;
2743 for deplib in $new_libs; do
2746 case " $tmp_libs " in
2748 *) tmp_libs="$tmp_libs $deplib" ;;
2751 *) tmp_libs="$tmp_libs $deplib" ;;
2754 eval $var=\"$tmp_libs\"
2757 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2759 for i in $dependency_libs ; do
2760 case " $predeps $postdeps $compiler_lib_search_path " in
2765 if test -n "$i" ; then
2766 tmp_libs="$tmp_libs $i"
2769 dependency_libs=$tmp_libs
2771 if test "$linkmode" = prog; then
2772 dlfiles="$newdlfiles"
2773 dlprefiles="$newdlprefiles"
2778 if test -n "$deplibs"; then
2779 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2782 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2783 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2786 if test -n "$rpath"; then
2787 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2790 if test -n "$xrpath"; then
2791 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2794 if test -n "$vinfo"; then
2795 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2798 if test -n "$release"; then
2799 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2802 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2803 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2806 # Now set the variables for building old libraries.
2807 build_libtool_libs=no
2809 objs="$objs$old_deplibs"
2813 # Make sure we only generate libraries of the form `libNAME.la'.
2816 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2817 eval shared_ext=\"$shrext\"
2818 eval libname=\"$libname_spec\"
2821 if test "$module" = no; then
2822 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2826 if test "$need_lib_prefix" != no; then
2827 # Add the "lib" prefix for modules if required
2828 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2829 eval shared_ext=\"$shrext\"
2830 eval libname=\"$libname_spec\"
2832 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2837 if test -n "$objs"; then
2838 if test "$deplibs_check_method" != pass_all; then
2839 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2843 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2844 $echo "*** objects $objs is not portable!"
2845 libobjs="$libobjs $objs"
2849 if test "$dlself" != no; then
2850 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2854 if test "$#" -gt 2; then
2855 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2860 if test -z "$rpath"; then
2861 if test "$build_libtool_libs" = yes; then
2862 # Building a libtool convenience library.
2863 # Some compilers have problems with a `.al' extension so
2864 # convenience libraries should have the same extension an
2865 # archive normally would.
2866 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2867 build_libtool_libs=convenience
2871 if test -n "$vinfo"; then
2872 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2875 if test -n "$release"; then
2876 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2880 # Parse the version information argument.
2881 save_ifs="$IFS"; IFS=':'
2882 set dummy $vinfo 0 0 0
2885 if test -n "$8"; then
2886 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2891 # convert absolute version numbers to libtool ages
2892 # this retains compatibility with .la files and attempts
2893 # to make the code below a bit more comprehensible
2895 case $vinfo_number in
2899 number_revision="$4"
2901 # There are really only two kinds -- those that
2902 # use the current revision as the major version
2903 # and those that subtract age and use age as
2904 # a minor version. But, then there is irix
2905 # which has an extra 1 added just for fun
2907 case $version_type in
2908 darwin|linux|osf|windows)
2909 current=`expr $number_major + $number_minor`
2911 revision="$number_revision"
2913 freebsd-aout|freebsd-elf|sunos)
2914 current="$number_major"
2915 revision="$number_minor"
2919 current=`expr $number_major + $number_minor - 1`
2921 revision="$number_minor"
2932 # Check that each of the things are valid numbers.
2934 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2936 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2937 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2943 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2945 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2946 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2952 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2954 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2955 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2960 if test "$age" -gt "$current"; then
2961 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2962 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2966 # Calculate the version variables.
2970 case $version_type in
2974 # Like Linux, but with the current version available in
2975 # verstring for coding it into the library header
2976 major=.`expr $current - $age`
2977 versuffix="$major.$age.$revision"
2978 # Darwin ld doesn't like 0 for these options...
2979 minor_current=`expr $current + 1`
2980 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2985 versuffix=".$current.$revision";
2990 versuffix=".$current";
2994 major=`expr $current - $age + 1`
2996 case $version_type in
2997 nonstopux) verstring_prefix=nonstopux ;;
2998 *) verstring_prefix=sgi ;;
3000 verstring="$verstring_prefix$major.$revision"
3002 # Add in all the interfaces that we are compatible with.
3004 while test "$loop" -ne 0; do
3005 iface=`expr $revision - $loop`
3006 loop=`expr $loop - 1`
3007 verstring="$verstring_prefix$major.$iface:$verstring"
3010 # Before this point, $major must not contain `.'.
3012 versuffix="$major.$revision"
3016 major=.`expr $current - $age`
3017 versuffix="$major.$age.$revision"
3021 major=.`expr $current - $age`
3022 versuffix=".$current.$age.$revision"
3023 verstring="$current.$age.$revision"
3025 # Add in all the interfaces that we are compatible with.
3027 while test "$loop" -ne 0; do
3028 iface=`expr $current - $loop`
3029 loop=`expr $loop - 1`
3030 verstring="$verstring:${iface}.0"
3033 # Make executables depend on our current version.
3034 verstring="$verstring:${current}.0"
3039 versuffix=".$current.$revision"
3043 # Use '-' rather than '.', since we only want one
3044 # extension on DOS 8.3 filesystems.
3045 major=`expr $current - $age`
3050 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3051 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3056 # Clear the version info if we defaulted, and they specified a release.
3057 if test -z "$vinfo" && test -n "$release"; then
3059 case $version_type in
3061 # we can't check for "0.0" in archive_cmds due to quoting
3062 # problems, so we reset it completely
3069 if test "$need_version" = no; then
3076 # Remove version info from name if versioning should be avoided
3077 if test "$avoid_version" = yes && test "$need_version" = no; then
3083 # Check to see if the archive will have undefined symbols.
3084 if test "$allow_undefined" = yes; then
3085 if test "$allow_undefined_flag" = unsupported; then
3086 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3087 build_libtool_libs=no
3091 # Don't allow undefined symbols.
3092 allow_undefined_flag="$no_undefined_flag"
3096 if test "$mode" != relink; then
3097 # Remove our outputs, but don't remove object files since they
3098 # may have been created when compiling PIC objects.
3100 tempremovelist=`$echo "$output_objdir/*"`
3101 for p in $tempremovelist; do
3105 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3106 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3110 removelist="$removelist $p"
3115 if test -n "$removelist"; then
3116 $show "${rm}r $removelist"
3117 $run ${rm}r $removelist
3121 # Now set the variables for building old libraries.
3122 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3123 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3125 # Transform .lo files to .o files.
3126 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3129 # Eliminate all temporary directories.
3130 for path in $notinst_path; do
3131 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3132 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3133 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3136 if test -n "$xrpath"; then
3137 # If the user specified any rpath flags, then add them.
3139 for libdir in $xrpath; do
3140 temp_xrpath="$temp_xrpath -R$libdir"
3141 case "$finalize_rpath " in
3143 *) finalize_rpath="$finalize_rpath $libdir" ;;
3146 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3147 dependency_libs="$temp_xrpath $dependency_libs"
3151 # Make sure dlfiles contains only unique files that won't be dlpreopened
3152 old_dlfiles="$dlfiles"
3154 for lib in $old_dlfiles; do
3155 case " $dlprefiles $dlfiles " in
3157 *) dlfiles="$dlfiles $lib" ;;
3161 # Make sure dlprefiles contains only unique files
3162 old_dlprefiles="$dlprefiles"
3164 for lib in $old_dlprefiles; do
3165 case "$dlprefiles " in
3167 *) dlprefiles="$dlprefiles $lib" ;;
3171 if test "$build_libtool_libs" = yes; then
3172 if test -n "$rpath"; then
3174 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3175 # these systems don't actually have a c library (as such)!
3177 *-*-rhapsody* | *-*-darwin1.[012])
3178 # Rhapsody C library is in the System framework
3179 deplibs="$deplibs -framework System"
3182 # Don't link with libc until the a.out ld.so is fixed.
3184 *-*-openbsd* | *-*-freebsd*)
3185 # Do not include libc due to us having libc/libc_r.
3186 test "X$arg" = "X-lc" && continue
3189 # Add libc to deplibs on all other systems if necessary.
3190 if test "$build_libtool_need_lc" = "yes"; then
3191 deplibs="$deplibs -lc"
3197 # Transform deplibs into only deplibs that can be linked in shared.
3199 libname_save=$libname
3200 release_save=$release
3201 versuffix_save=$versuffix
3203 # I'm not sure if I'm treating the release correctly. I think
3204 # release should show up in the -l (ie -lgmp5) so we don't want to
3205 # add it in twice. Is that correct?
3211 case $deplibs_check_method in
3213 # Don't check for shared/static. Everything works.
3214 # This might be a little naive. We might want to check
3215 # whether the library exists or not. But this is on
3216 # osf3 & osf4 and I'm not really sure... Just
3217 # implementing what was already the behavior.
3221 # This code stresses the "libraries are programs" paradigm to its
3222 # limits. Maybe even breaks it. We compile a program, linking it
3223 # against the deplibs as a proxy for the library. Then we can check
3224 # whether they linked in statically or dynamically with ldd.
3226 cat > conftest.c <<EOF
3227 int main() { return 0; }
3230 $LTCC -o conftest conftest.c $deplibs
3231 if test "$?" -eq 0 ; then
3232 ldd_output=`ldd conftest`
3233 for i in $deplibs; do
3234 name="`expr $i : '-l\(.*\)'`"
3235 # If $name is empty we are operating on a -L argument.
3236 if test "$name" != "" && test "$name" -ne "0"; then
3237 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3238 case " $predeps $postdeps " in
3240 newdeplibs="$newdeplibs $i"
3245 if test -n "$i" ; then
3246 libname=`eval \\$echo \"$libname_spec\"`
3247 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3248 set dummy $deplib_matches
3250 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3251 newdeplibs="$newdeplibs $i"
3255 $echo "*** Warning: dynamic linker does not accept needed library $i."
3256 $echo "*** I have the capability to make that library automatically link in when"
3257 $echo "*** you link to this library. But I can only do this if you have a"
3258 $echo "*** shared version of the library, which I believe you do not have"
3259 $echo "*** because a test_compile did reveal that the linker did not use it for"
3260 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3264 newdeplibs="$newdeplibs $i"
3268 # Error occurred in the first compile. Let's try to salvage
3269 # the situation: Compile a separate program for each library.
3270 for i in $deplibs; do
3271 name="`expr $i : '-l\(.*\)'`"
3272 # If $name is empty we are operating on a -L argument.
3273 if test "$name" != "" && test "$name" != "0"; then
3275 $LTCC -o conftest conftest.c $i
3277 if test "$?" -eq 0 ; then
3278 ldd_output=`ldd conftest`
3279 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3280 case " $predeps $postdeps " in
3282 newdeplibs="$newdeplibs $i"
3287 if test -n "$i" ; then
3288 libname=`eval \\$echo \"$libname_spec\"`
3289 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3290 set dummy $deplib_matches
3292 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3293 newdeplibs="$newdeplibs $i"
3297 $echo "*** Warning: dynamic linker does not accept needed library $i."
3298 $echo "*** I have the capability to make that library automatically link in when"
3299 $echo "*** you link to this library. But I can only do this if you have a"
3300 $echo "*** shared version of the library, which you do not appear to have"
3301 $echo "*** because a test_compile did reveal that the linker did not use this one"
3302 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3308 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3309 $echo "*** make it link in! You will probably need to install it or some"
3310 $echo "*** library that it depends on before this library will be fully"
3311 $echo "*** functional. Installing it before continuing would be even better."
3314 newdeplibs="$newdeplibs $i"
3320 set dummy $deplibs_check_method
3321 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3322 for a_deplib in $deplibs; do
3323 name="`expr $a_deplib : '-l\(.*\)'`"
3324 # If $name is empty we are operating on a -L argument.
3325 if test "$name" != "" && test "$name" != "0"; then
3326 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3327 case " $predeps $postdeps " in
3329 newdeplibs="$newdeplibs $a_deplib"
3334 if test -n "$a_deplib" ; then
3335 libname=`eval \\$echo \"$libname_spec\"`
3336 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3337 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3338 for potent_lib in $potential_libs; do
3339 # Follow soft links.
3340 if ls -lLd "$potent_lib" 2>/dev/null \
3341 | grep " -> " >/dev/null; then
3344 # The statement above tries to avoid entering an
3345 # endless loop below, in case of cyclic links.
3346 # We might still enter an endless loop, since a link
3347 # loop can be closed while we follow links,
3349 potlib="$potent_lib"
3350 while test -h "$potlib" 2>/dev/null; do
3351 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3353 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3354 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3357 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3359 | $EGREP "$file_magic_regex" > /dev/null; then
3360 newdeplibs="$newdeplibs $a_deplib"
3367 if test -n "$a_deplib" ; then
3370 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3371 $echo "*** I have the capability to make that library automatically link in when"
3372 $echo "*** you link to this library. But I can only do this if you have a"
3373 $echo "*** shared version of the library, which you do not appear to have"
3374 $echo "*** because I did check the linker path looking for a file starting"
3375 if test -z "$potlib" ; then
3376 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3378 $echo "*** with $libname and none of the candidates passed a file format test"
3379 $echo "*** using a file magic. Last file checked: $potlib"
3383 # Add a -L argument.
3384 newdeplibs="$newdeplibs $a_deplib"
3386 done # Gone through all deplibs.
3389 set dummy $deplibs_check_method
3390 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3391 for a_deplib in $deplibs; do
3392 name="`expr $a_deplib : '-l\(.*\)'`"
3393 # If $name is empty we are operating on a -L argument.
3394 if test -n "$name" && test "$name" != "0"; then
3395 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3396 case " $predeps $postdeps " in
3398 newdeplibs="$newdeplibs $a_deplib"
3403 if test -n "$a_deplib" ; then
3404 libname=`eval \\$echo \"$libname_spec\"`
3405 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3406 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3407 for potent_lib in $potential_libs; do
3408 potlib="$potent_lib" # see symlink-check above in file_magic test
3409 if eval $echo \"$potent_lib\" 2>/dev/null \
3411 | $EGREP "$match_pattern_regex" > /dev/null; then
3412 newdeplibs="$newdeplibs $a_deplib"
3419 if test -n "$a_deplib" ; then
3422 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3423 $echo "*** I have the capability to make that library automatically link in when"
3424 $echo "*** you link to this library. But I can only do this if you have a"
3425 $echo "*** shared version of the library, which you do not appear to have"
3426 $echo "*** because I did check the linker path looking for a file starting"
3427 if test -z "$potlib" ; then
3428 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3430 $echo "*** with $libname and none of the candidates passed a file format test"
3431 $echo "*** using a regex pattern. Last file checked: $potlib"
3435 # Add a -L argument.
3436 newdeplibs="$newdeplibs $a_deplib"
3438 done # Gone through all deplibs.
3442 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3443 -e 's/ -[LR][^ ]*//g'`
3444 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3445 for i in $predeps $postdeps ; do
3446 # can't use Xsed below, because $i might contain '/'
3447 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3450 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3451 | grep . >/dev/null; then
3453 if test "X$deplibs_check_method" = "Xnone"; then
3454 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3456 $echo "*** Warning: inter-library dependencies are not known to be supported."
3458 $echo "*** All declared inter-library dependencies are being dropped."
3463 versuffix=$versuffix_save
3465 release=$release_save
3466 libname=$libname_save
3470 *-*-rhapsody* | *-*-darwin1.[012])
3471 # On Rhapsody replace the C library is the System framework
3472 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3476 if test "$droppeddeps" = yes; then
3477 if test "$module" = yes; then
3479 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3480 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3481 $echo "*** a static module, that should work as long as the dlopening"
3482 $echo "*** application is linked with the -dlopen flag."
3483 if test -z "$global_symbol_pipe"; then
3485 $echo "*** However, this would only work if libtool was able to extract symbol"
3486 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3487 $echo "*** not find such a program. So, this module is probably useless."
3488 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3490 if test "$build_old_libs" = no; then
3491 oldlibs="$output_objdir/$libname.$libext"
3492 build_libtool_libs=module
3495 build_libtool_libs=no
3498 $echo "*** The inter-library dependencies that have been dropped here will be"
3499 $echo "*** automatically added whenever a program is linked with this library"
3500 $echo "*** or is declared to -dlopen it."
3502 if test "$allow_undefined" = no; then
3504 $echo "*** Since this library must not contain undefined symbols,"
3505 $echo "*** because either the platform does not support them or"
3506 $echo "*** it was explicitly requested with -no-undefined,"
3507 $echo "*** libtool will only create a static version of it."
3508 if test "$build_old_libs" = no; then
3509 oldlibs="$output_objdir/$libname.$libext"
3510 build_libtool_libs=module
3513 build_libtool_libs=no
3518 # Done checking deplibs!
3522 # All the library-specific variables (install_libdir is set above).
3527 # Test again, we may have decided not to build it any more
3528 if test "$build_libtool_libs" = yes; then
3529 if test "$hardcode_into_libs" = yes; then
3530 # Hardcode the library paths
3533 rpath="$finalize_rpath"
3534 test "$mode" != relink && rpath="$compile_rpath$rpath"
3535 for libdir in $rpath; do
3536 if test -n "$hardcode_libdir_flag_spec"; then
3537 if test -n "$hardcode_libdir_separator"; then
3538 if test -z "$hardcode_libdirs"; then
3539 hardcode_libdirs="$libdir"
3541 # Just accumulate the unique libdirs.
3542 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3543 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3546 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3551 eval flag=\"$hardcode_libdir_flag_spec\"
3552 dep_rpath="$dep_rpath $flag"
3554 elif test -n "$runpath_var"; then
3555 case "$perm_rpath " in
3557 *) perm_rpath="$perm_rpath $libdir" ;;
3561 # Substitute the hardcoded libdirs into the rpath.
3562 if test -n "$hardcode_libdir_separator" &&
3563 test -n "$hardcode_libdirs"; then
3564 libdir="$hardcode_libdirs"
3565 if test -n "$hardcode_libdir_flag_spec_ld"; then
3566 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3568 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3571 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3572 # We should set the runpath_var.
3574 for dir in $perm_rpath; do
3577 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3579 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3582 shlibpath="$finalize_shlibpath"
3583 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3584 if test -n "$shlibpath"; then
3585 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3588 # Get the real and link names of the library.
3589 eval shared_ext=\"$shrext\"
3590 eval library_names=\"$library_names_spec\"
3591 set dummy $library_names
3595 if test -n "$soname_spec"; then
3596 eval soname=\"$soname_spec\"
3600 if test -z "$dlname"; then
3604 lib="$output_objdir/$realname"
3607 linknames="$linknames $link"
3610 # Use standard objects if they are pic
3611 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3613 # Prepare the list of exported symbols
3614 if test -z "$export_symbols"; then
3615 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3616 $show "generating symbol list for \`$libname.la'"
3617 export_symbols="$output_objdir/$libname.exp"
3618 $run $rm $export_symbols
3619 cmds=$export_symbols_cmds
3620 save_ifs="$IFS"; IFS='~'
3621 for cmd in $cmds; do
3624 if len=`expr "X$cmd" : ".*"` &&
3625 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3627 $run eval "$cmd" || exit $?
3628 skipped_export=false
3630 # The command line is too long to execute in one step.
3631 $show "using reloadable object file for export list..."
3636 if test -n "$export_symbols_regex"; then
3637 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3638 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3639 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3640 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3645 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3646 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3650 for test_deplib in $deplibs; do
3651 case " $convenience " in
3652 *" $test_deplib "*) ;;
3654 tmp_deplibs="$tmp_deplibs $test_deplib"
3658 deplibs="$tmp_deplibs"
3660 if test -n "$convenience"; then
3661 if test -n "$whole_archive_flag_spec"; then
3662 save_libobjs=$libobjs
3663 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3665 gentop="$output_objdir/${outputname}x"
3666 $show "${rm}r $gentop"
3667 $run ${rm}r "$gentop"
3668 $show "$mkdir $gentop"
3669 $run $mkdir "$gentop"
3671 if test "$status" -ne 0 && test ! -d "$gentop"; then
3674 generated="$generated $gentop"
3676 for xlib in $convenience; do
3677 # Extract the objects.
3679 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3680 *) xabs=`pwd`"/$xlib" ;;
3682 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3683 xdir="$gentop/$xlib"
3685 $show "${rm}r $xdir"
3687 $show "$mkdir $xdir"
3690 if test "$status" -ne 0 && test ! -d "$xdir"; then
3693 # We will extract separately just the conflicting names and we will no
3694 # longer touch any unique names. It is faster to leave these extract
3695 # automatically by $AR in one run.
3696 $show "(cd $xdir && $AR x $xabs)"
3697 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3698 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3701 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3702 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3703 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3706 while test "$i" -le "$count"
3708 # Put our $i before any first dot (extension)
3709 # Never overwrite any file
3711 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3713 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3715 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3716 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3722 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3727 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3728 eval flag=\"$thread_safe_flag_spec\"
3729 linker_flags="$linker_flags $flag"
3732 # Make a backup of the uninstalled library when relinking
3733 if test "$mode" = relink; then
3734 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3737 # Do each of the archive commands.
3738 if test "$module" = yes && test -n "$module_cmds" ; then
3739 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3740 eval test_cmds=\"$module_expsym_cmds\"
3741 cmds=$module_expsym_cmds
3743 eval test_cmds=\"$module_cmds\"
3747 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3748 eval test_cmds=\"$archive_expsym_cmds\"
3749 cmds=$archive_expsym_cmds
3751 eval test_cmds=\"$archive_cmds\"
3756 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3757 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3760 # The command line is too long to link in one step, link piecewise.
3761 $echo "creating reloadable object files..."
3763 # Save the value of $output and $libobjs because we want to
3764 # use them later. If we have whole_archive_flag_spec, we
3765 # want to use save_libobjs as it was before
3766 # whole_archive_flag_spec was expanded, because we can't
3767 # assume the linker understands whole_archive_flag_spec.
3768 # This may have to be revisited, in case too many
3769 # convenience libraries get linked in and end up exceeding
3771 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3772 save_libobjs=$libobjs
3776 # Clear the reloadable object creation command queue and
3777 # initialize k to one.
3784 output=$output_objdir/$save_output-${k}.$objext
3785 # Loop over the list of objects to be linked.
3786 for obj in $save_libobjs
3788 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3789 if test "X$objlist" = X ||
3790 { len=`expr "X$test_cmds" : ".*"` &&
3791 test "$len" -le "$max_cmd_len"; }; then
3792 objlist="$objlist $obj"
3794 # The command $test_cmds is almost too long, add a
3795 # command to the queue.
3796 if test "$k" -eq 1 ; then
3797 # The first file doesn't have a previous command to add.
3798 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3800 # All subsequent reloadable object files will link in
3801 # the last one created.
3802 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3804 last_robj=$output_objdir/$save_output-${k}.$objext
3806 output=$output_objdir/$save_output-${k}.$objext
3811 # Handle the remaining objects by creating one last
3812 # reloadable object file. All subsequent reloadable object
3813 # files will link in the last one created.
3814 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3815 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3817 if ${skipped_export-false}; then
3818 $show "generating symbol list for \`$libname.la'"
3819 export_symbols="$output_objdir/$libname.exp"
3820 $run $rm $export_symbols
3822 # Append the command to create the export file.
3823 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3826 # Set up a command to remove the reloadale object files
3827 # after they are used.
3829 while test "$i" -lt "$k"
3832 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3835 $echo "creating a temporary reloadable object file: $output"
3837 # Loop through the commands generated above and execute them.
3838 save_ifs="$IFS"; IFS='~'
3839 for cmd in $concat_cmds; do
3843 $run eval "$cmd" || exit $?
3848 # Restore the value of output.
3851 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3852 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3854 # Expand the library linking commands again to reset the
3855 # value of $libobjs for piecewise linking.
3857 # Do each of the archive commands.
3858 if test "$module" = yes && test -n "$module_cmds" ; then
3859 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3860 cmds=$module_expsym_cmds
3865 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3866 cmds=$archive_expsym_cmds
3872 # Append the command to remove the reloadable object files
3873 # to the just-reset $cmds.
3874 eval cmds=\"\$cmds~\$rm $delfiles\"
3876 save_ifs="$IFS"; IFS='~'
3877 for cmd in $cmds; do
3881 $run eval "$cmd" || exit $?
3885 # Restore the uninstalled library and exit
3886 if test "$mode" = relink; then
3887 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3891 # Create links to the real library.
3892 for linkname in $linknames; do
3893 if test "$realname" != "$linkname"; then
3894 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3895 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3899 # If -module or -export-dynamic was specified, set the dlname.
3900 if test "$module" = yes || test "$export_dynamic" = yes; then
3901 # On all known operating systems, these are identical.
3908 if test -n "$deplibs"; then
3909 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3912 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3913 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3916 if test -n "$rpath"; then
3917 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3920 if test -n "$xrpath"; then
3921 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3924 if test -n "$vinfo"; then
3925 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3928 if test -n "$release"; then
3929 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3934 if test -n "$objs$old_deplibs"; then
3935 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3939 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3947 # Delete the old objects.
3948 $run $rm $obj $libobj
3950 # Objects from convenience libraries. This assumes
3951 # single-version convenience libraries. Whenever we create
3952 # different ones for PIC/non-PIC, this we'll have to duplicate
3956 # reload_cmds runs $LD directly, so let us get rid of
3957 # -Wl from whole_archive_flag_spec
3960 if test -n "$convenience"; then
3961 if test -n "$whole_archive_flag_spec"; then
3962 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3964 gentop="$output_objdir/${obj}x"
3965 $show "${rm}r $gentop"
3966 $run ${rm}r "$gentop"
3967 $show "$mkdir $gentop"
3968 $run $mkdir "$gentop"
3970 if test "$status" -ne 0 && test ! -d "$gentop"; then
3973 generated="$generated $gentop"
3975 for xlib in $convenience; do
3976 # Extract the objects.
3978 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3979 *) xabs=`pwd`"/$xlib" ;;
3981 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3982 xdir="$gentop/$xlib"
3984 $show "${rm}r $xdir"
3986 $show "$mkdir $xdir"
3989 if test "$status" -ne 0 && test ! -d "$xdir"; then
3992 # We will extract separately just the conflicting names and we will no
3993 # longer touch any unique names. It is faster to leave these extract
3994 # automatically by $AR in one run.
3995 $show "(cd $xdir && $AR x $xabs)"
3996 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3997 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4000 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4001 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4002 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4005 while test "$i" -le "$count"
4007 # Put our $i before any first dot (extension)
4008 # Never overwrite any file
4010 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4012 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4014 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4015 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4021 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4026 # Create the old-style object.
4027 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
4031 save_ifs="$IFS"; IFS='~'
4032 for cmd in $cmds; do
4036 $run eval "$cmd" || exit $?
4040 # Exit if we aren't doing a library object file.
4041 if test -z "$libobj"; then
4042 if test -n "$gentop"; then
4043 $show "${rm}r $gentop"
4050 if test "$build_libtool_libs" != yes; then
4051 if test -n "$gentop"; then
4052 $show "${rm}r $gentop"
4056 # Create an invalid libtool object if no PIC, so that we don't
4057 # accidentally link it into a program.
4058 # $show "echo timestamp > $libobj"
4059 # $run eval "echo timestamp > $libobj" || exit $?
4063 if test -n "$pic_flag" || test "$pic_mode" != default; then
4064 # Only do commands if we really have different PIC objects.
4065 reload_objs="$libobjs $reload_conv_objs"
4068 save_ifs="$IFS"; IFS='~'
4069 for cmd in $cmds; do
4073 $run eval "$cmd" || exit $?
4078 if test -n "$gentop"; then
4079 $show "${rm}r $gentop"
4088 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4090 if test -n "$vinfo"; then
4091 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4094 if test -n "$release"; then
4095 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4098 if test "$preload" = yes; then
4099 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4100 test "$dlopen_self_static" = unknown; then
4101 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4106 *-*-rhapsody* | *-*-darwin1.[012])
4107 # On Rhapsody replace the C library is the System framework
4108 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4109 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4115 # Don't allow lazy linking, it breaks C++ global constructors
4116 if test "$tagname" = CXX ; then
4117 compile_command="$compile_command ${wl}-bind_at_load"
4118 finalize_command="$finalize_command ${wl}-bind_at_load"
4123 compile_command="$compile_command $compile_deplibs"
4124 finalize_command="$finalize_command $finalize_deplibs"
4126 if test -n "$rpath$xrpath"; then
4127 # If the user specified any rpath flags, then add them.
4128 for libdir in $rpath $xrpath; do
4129 # This is the magic to use -rpath.
4130 case "$finalize_rpath " in
4132 *) finalize_rpath="$finalize_rpath $libdir" ;;
4137 # Now hardcode the library paths
4140 for libdir in $compile_rpath $finalize_rpath; do
4141 if test -n "$hardcode_libdir_flag_spec"; then
4142 if test -n "$hardcode_libdir_separator"; then
4143 if test -z "$hardcode_libdirs"; then
4144 hardcode_libdirs="$libdir"
4146 # Just accumulate the unique libdirs.
4147 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4148 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4151 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4156 eval flag=\"$hardcode_libdir_flag_spec\"
4157 rpath="$rpath $flag"
4159 elif test -n "$runpath_var"; then
4160 case "$perm_rpath " in
4162 *) perm_rpath="$perm_rpath $libdir" ;;
4166 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4167 case :$dllsearchpath: in
4169 *) dllsearchpath="$dllsearchpath:$libdir";;
4174 # Substitute the hardcoded libdirs into the rpath.
4175 if test -n "$hardcode_libdir_separator" &&
4176 test -n "$hardcode_libdirs"; then
4177 libdir="$hardcode_libdirs"
4178 eval rpath=\" $hardcode_libdir_flag_spec\"
4180 compile_rpath="$rpath"
4184 for libdir in $finalize_rpath; do
4185 if test -n "$hardcode_libdir_flag_spec"; then
4186 if test -n "$hardcode_libdir_separator"; then
4187 if test -z "$hardcode_libdirs"; then
4188 hardcode_libdirs="$libdir"
4190 # Just accumulate the unique libdirs.
4191 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4192 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4195 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4200 eval flag=\"$hardcode_libdir_flag_spec\"
4201 rpath="$rpath $flag"
4203 elif test -n "$runpath_var"; then
4204 case "$finalize_perm_rpath " in
4206 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4210 # Substitute the hardcoded libdirs into the rpath.
4211 if test -n "$hardcode_libdir_separator" &&
4212 test -n "$hardcode_libdirs"; then
4213 libdir="$hardcode_libdirs"
4214 eval rpath=\" $hardcode_libdir_flag_spec\"
4216 finalize_rpath="$rpath"
4218 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4219 # Transform all the library objects into standard objects.
4220 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4221 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4225 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4226 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4227 dlsyms="${outputname}S.c"
4229 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4233 if test -n "$dlsyms"; then
4237 # Discover the nlist of each of the dlfiles.
4238 nlist="$output_objdir/${outputname}.nm"
4240 $show "$rm $nlist ${nlist}S ${nlist}T"
4241 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4243 # Parse the name list into a source file.
4244 $show "creating $output_objdir/$dlsyms"
4246 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4247 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4248 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4254 /* Prevent the only kind of declaration conflicts we can make. */
4255 #define lt_preloaded_symbols some_other_symbol
4257 /* External symbol declarations for the compiler. */\
4260 if test "$dlself" = yes; then
4261 $show "generating symbol list for \`$output'"
4263 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4265 # Add our own program objects to the symbol list.
4266 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4267 for arg in $progfiles; do
4268 $show "extracting global C symbols from \`$arg'"
4269 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4272 if test -n "$exclude_expsyms"; then
4273 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4274 $run eval '$mv "$nlist"T "$nlist"'
4277 if test -n "$export_symbols_regex"; then
4278 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4279 $run eval '$mv "$nlist"T "$nlist"'
4282 # Prepare the list of exported symbols
4283 if test -z "$export_symbols"; then
4284 export_symbols="$output_objdir/$output.exp"
4285 $run $rm $export_symbols
4286 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4288 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4289 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4290 $run eval 'mv "$nlist"T "$nlist"'
4294 for arg in $dlprefiles; do
4295 $show "extracting global C symbols from \`$arg'"
4296 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4297 $run eval '$echo ": $name " >> "$nlist"'
4298 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4301 if test -z "$run"; then
4302 # Make sure we have at least an empty file.
4303 test -f "$nlist" || : > "$nlist"
4305 if test -n "$exclude_expsyms"; then
4306 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4307 $mv "$nlist"T "$nlist"
4310 # Try sorting and uniquifying the output.
4311 if grep -v "^: " < "$nlist" |
4312 if sort -k 3 </dev/null >/dev/null 2>&1; then
4317 uniq > "$nlist"S; then
4320 grep -v "^: " < "$nlist" > "$nlist"S
4323 if test -f "$nlist"S; then
4324 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4326 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4329 $echo >> "$output_objdir/$dlsyms" "\
4331 #undef lt_preloaded_symbols
4333 #if defined (__STDC__) && __STDC__
4334 # define lt_ptr void *
4336 # define lt_ptr char *
4340 /* The mapping between symbol names and symbols. */
4345 lt_preloaded_symbols[] =
4349 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4351 $echo >> "$output_objdir/$dlsyms" "\
4355 /* This works around a problem in FreeBSD linker */
4356 #ifdef FREEBSD_WORKAROUND
4357 static const void *lt_preloaded_setup() {
4358 return lt_preloaded_symbols;
4368 pic_flag_for_symtable=
4370 # compiling the symbol table file with pic_flag works around
4371 # a FreeBSD bug that causes programs to crash when -lm is
4372 # linked before any other PIC object. But we must not use
4373 # pic_flag when linking with -static. The problem exists in
4374 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4375 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4376 case "$compile_command " in
4378 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4381 case "$compile_command " in
4383 *) pic_flag_for_symtable=" $pic_flag";;
4387 # Now compile the dynamic symbol file.
4388 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4389 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4391 # Clean up the generated files.
4392 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4393 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4395 # Transform the symbol file into the correct name.
4396 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4397 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4400 # FreeBSD doesn't need this...
4403 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4408 # We keep going just in case the user didn't refer to
4409 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4410 # really was required.
4412 # Nullify the symbol file.
4413 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4414 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4417 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4418 # Replace the output file specification.
4419 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4420 link_command="$compile_command$compile_rpath"
4422 # We have no uninstalled library dependencies, so finalize right now.
4423 $show "$link_command"
4424 $run eval "$link_command"
4427 # Delete the generated files.
4428 if test -n "$dlsyms"; then
4429 $show "$rm $output_objdir/${outputname}S.${objext}"
4430 $run $rm "$output_objdir/${outputname}S.${objext}"
4436 if test -n "$shlibpath_var"; then
4437 # We should set the shlibpath_var
4439 for dir in $temp_rpath; do
4441 [\\/]* | [A-Za-z]:[\\/]*)
4446 # Relative path: add a thisdir entry.
4447 rpath="$rpath\$thisdir/$dir:"
4454 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4455 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4457 if test -n "$finalize_shlibpath"; then
4458 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4463 if test -n "$runpath_var"; then
4464 if test -n "$perm_rpath"; then
4465 # We should set the runpath_var.
4467 for dir in $perm_rpath; do
4470 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4472 if test -n "$finalize_perm_rpath"; then
4473 # We should set the runpath_var.
4475 for dir in $finalize_perm_rpath; do
4478 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4482 if test "$no_install" = yes; then
4483 # We don't need to create a wrapper script.
4484 link_command="$compile_var$compile_command$compile_rpath"
4485 # Replace the output file specification.
4486 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4487 # Delete the old output file.
4489 # Link the executable and exit
4490 $show "$link_command"
4491 $run eval "$link_command" || exit $?
4495 if test "$hardcode_action" = relink; then
4496 # Fast installation is not supported
4497 link_command="$compile_var$compile_command$compile_rpath"
4498 relink_command="$finalize_var$finalize_command$finalize_rpath"
4500 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4501 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4503 if test "$fast_install" != no; then
4504 link_command="$finalize_var$compile_command$finalize_rpath"
4505 if test "$fast_install" = yes; then
4506 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4508 # fast_install is set to needless
4512 link_command="$compile_var$compile_command$compile_rpath"
4513 relink_command="$finalize_var$finalize_command$finalize_rpath"
4517 # Replace the output file specification.
4518 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4520 # Delete the old output files.
4521 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4523 $show "$link_command"
4524 $run eval "$link_command" || exit $?
4526 # Now create the wrapper script.
4527 $show "creating $output"
4529 # Quote the relink command for shipping.
4530 if test -n "$relink_command"; then
4531 # Preserve any variables that may affect compiler behavior
4532 for var in $variables_saved_for_relink; do
4533 if eval test -z \"\${$var+set}\"; then
4534 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4535 elif eval var_value=\$$var; test -z "$var_value"; then
4536 relink_command="$var=; export $var; $relink_command"
4538 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4539 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4542 relink_command="(cd `pwd`; $relink_command)"
4543 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4546 # Quote $echo for shipping.
4547 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4549 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4550 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4552 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4554 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4557 # Only actually do things if our run command is non-null.
4558 if test -z "$run"; then
4559 # win32 will think the script is a binary if it has
4560 # a .exe suffix, so we strip it off here.
4562 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4564 # test for cygwin because mv fails w/o .exe extensions
4568 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4572 *cygwin* | *mingw* )
4573 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4574 cwrapper=`$echo ${output}.exe`
4575 $rm $cwrappersource $cwrapper
4576 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4578 cat > $cwrappersource <<EOF
4580 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4581 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4583 The $output program cannot be directly executed until all the libtool
4584 libraries that it depends on are installed.
4586 This wrapper executable should never be moved out of the build directory.
4587 If it is, it will not operate correctly.
4589 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4590 but could eventually absorb all of the scripts functionality and
4591 exec $objdir/$outputname directly.
4594 cat >> $cwrappersource<<"EOF"
4602 #if defined(PATH_MAX)
4603 # define LT_PATHMAX PATH_MAX
4604 #elif defined(MAXPATHLEN)
4605 # define LT_PATHMAX MAXPATHLEN
4607 # define LT_PATHMAX 1024
4610 #ifndef DIR_SEPARATOR
4611 #define DIR_SEPARATOR '/'
4614 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4616 #define HAVE_DOS_BASED_FILE_SYSTEM
4617 #ifndef DIR_SEPARATOR_2
4618 #define DIR_SEPARATOR_2 '\\'
4622 #ifndef DIR_SEPARATOR_2
4623 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4624 #else /* DIR_SEPARATOR_2 */
4625 # define IS_DIR_SEPARATOR(ch) \
4626 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4627 #endif /* DIR_SEPARATOR_2 */
4629 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4630 #define XFREE(stale) do { \
4631 if (stale) { free ((void *) stale); stale = 0; } \
4634 const char *program_name = NULL;
4636 void * xmalloc (size_t num);
4637 char * xstrdup (const char *string);
4638 char * basename (const char *name);
4639 char * fnqualify(const char *path);
4640 char * strendzap(char *str, const char *pat);
4641 void lt_fatal (const char *message, ...);
4644 main (int argc, char *argv[])
4649 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4650 newargz = XMALLOC(char *, argc+2);
4653 cat >> $cwrappersource <<EOF
4654 newargz[0] = "$SHELL";
4657 cat >> $cwrappersource <<"EOF"
4658 newargz[1] = fnqualify(argv[0]);
4659 /* we know the script has the same name, without the .exe */
4660 /* so make sure newargz[1] doesn't end in .exe */
4661 strendzap(newargz[1],".exe");
4662 for (i = 1; i < argc; i++)
4663 newargz[i+1] = xstrdup(argv[i]);
4664 newargz[argc+1] = NULL;
4667 cat >> $cwrappersource <<EOF
4668 execv("$SHELL",newargz);
4671 cat >> $cwrappersource <<"EOF"
4675 xmalloc (size_t num)
4677 void * p = (void *) malloc (num);
4679 lt_fatal ("Memory exhausted");
4685 xstrdup (const char *string)
4687 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4692 basename (const char *name)
4696 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4697 /* Skip over the disk name in MSDOS pathnames. */
4698 if (isalpha (name[0]) && name[1] == ':')
4702 for (base = name; *name; name++)
4703 if (IS_DIR_SEPARATOR (*name))
4705 return (char *) base;
4709 fnqualify(const char *path)
4713 char tmp[LT_PATHMAX + 1];
4715 assert(path != NULL);
4717 /* Is it qualified already? */
4718 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4719 if (isalpha (path[0]) && path[1] == ':')
4720 return xstrdup (path);
4722 if (IS_DIR_SEPARATOR (path[0]))
4723 return xstrdup (path);
4725 /* prepend the current directory */
4726 /* doesn't handle '~' */
4727 if (getcwd (tmp, LT_PATHMAX) == NULL)
4728 lt_fatal ("getcwd failed");
4729 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4730 p = XMALLOC(char, size);
4731 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4736 strendzap(char *str, const char *pat)
4740 assert(str != NULL);
4741 assert(pat != NULL);
4744 patlen = strlen(pat);
4748 str += len - patlen;
4749 if (strcmp(str, pat) == 0)
4756 lt_error_core (int exit_status, const char * mode,
4757 const char * message, va_list ap)
4759 fprintf (stderr, "%s: %s: ", program_name, mode);
4760 vfprintf (stderr, message, ap);
4761 fprintf (stderr, ".\n");
4763 if (exit_status >= 0)
4768 lt_fatal (const char *message, ...)
4771 va_start (ap, message);
4772 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4776 # we should really use a build-platform specific compiler
4777 # here, but OTOH, the wrappers (shell script and this C one)
4778 # are only useful if you want to execute the "real" binary.
4779 # Since the "real" binary is built for $host, then this
4780 # wrapper might as well be built for $host, too.
4781 $run $LTCC -s -o $cwrapper $cwrappersource
4785 trap "$rm $output; exit 1" 1 2 15
4790 # $output - temporary wrapper script for $objdir/$outputname
4791 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4793 # The $output program cannot be directly executed until all the libtool
4794 # libraries that it depends on are installed.
4796 # This wrapper script should never be moved out of the build directory.
4797 # If it is, it will not operate correctly.
4799 # Sed substitution that helps us do robust quoting. It backslashifies
4800 # metacharacters that are still active within double-quoted strings.
4801 Xsed='${SED} -e 1s/^X//'
4802 sed_quote_subst='$sed_quote_subst'
4804 # The HP-UX ksh and POSIX shell print the target directory to stdout
4806 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4808 relink_command=\"$relink_command\"
4810 # This environment variable determines our operation mode.
4811 if test \"\$libtool_install_magic\" = \"$magic\"; then
4812 # install mode needs the following variable:
4813 notinst_deplibs='$notinst_deplibs'
4815 # When we are sourced in execute mode, \$file and \$echo are already set.
4816 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4819 # Make sure echo works.
4820 if test \"X\$1\" = X--no-reexec; then
4821 # Discard the --no-reexec flag, and continue.
4823 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4824 # Yippee, \$echo works!
4827 # Restart under the correct shell, and then maybe \$echo will work.
4828 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4834 # Find the directory that this script lives in.
4835 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4836 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4838 # Follow symbolic links until we get to the real thisdir.
4839 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4840 while test -n \"\$file\"; do
4841 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4843 # If there was a directory component, then change thisdir.
4844 if test \"x\$destdir\" != \"x\$file\"; then
4845 case \"\$destdir\" in
4846 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4847 *) thisdir=\"\$thisdir/\$destdir\" ;;
4851 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4852 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4855 # Try to get the absolute directory name.
4856 absdir=\`cd \"\$thisdir\" && pwd\`
4857 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4860 if test "$fast_install" = yes; then
4862 program=lt-'$outputname'$exeext
4863 progdir=\"\$thisdir/$objdir\"
4865 if test ! -f \"\$progdir/\$program\" || \\
4866 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4867 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4869 file=\"\$\$-\$program\"
4871 if test ! -d \"\$progdir\"; then
4872 $mkdir \"\$progdir\"
4874 $rm \"\$progdir/\$file\"
4879 # relink executable if necessary
4880 if test -n \"\$relink_command\"; then
4881 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4883 $echo \"\$relink_command_output\" >&2
4884 $rm \"\$progdir/\$file\"
4889 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4890 { $rm \"\$progdir/\$program\";
4891 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4892 $rm \"\$progdir/\$file\"
4896 program='$outputname'
4897 progdir=\"\$thisdir/$objdir\"
4903 if test -f \"\$progdir/\$program\"; then"
4905 # Export our shlibpath_var if we have one.
4906 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4908 # Add our own library path to $shlibpath_var
4909 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4911 # Some systems cannot cope with colon-terminated $shlibpath_var
4912 # The second colon is a workaround for a bug in BeOS R4 sed
4913 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4915 export $shlibpath_var
4919 # fixup the dll searchpath if we need to.
4920 if test -n "$dllsearchpath"; then
4922 # Add the dll search path components to the executable PATH
4923 PATH=$dllsearchpath:\$PATH
4928 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4929 # Run the actual program with our arguments.
4932 # Backslashes separate directories on plain windows
4933 *-*-mingw | *-*-os2*)
4935 exec \$progdir\\\\\$program \${1+\"\$@\"}
4941 exec \$progdir/\$program \${1+\"\$@\"}
4946 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4950 # The program doesn't exist.
4951 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4952 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4953 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4964 # See if we need to build an old-fashioned archive.
4965 for oldlib in $oldlibs; do
4967 if test "$build_libtool_libs" = convenience; then
4968 oldobjs="$libobjs_save"
4969 addlibs="$convenience"
4970 build_libtool_libs=no
4972 if test "$build_libtool_libs" = module; then
4973 oldobjs="$libobjs_save"
4974 build_libtool_libs=no
4976 oldobjs="$old_deplibs $non_pic_objects"
4978 addlibs="$old_convenience"
4981 if test -n "$addlibs"; then
4982 gentop="$output_objdir/${outputname}x"
4983 $show "${rm}r $gentop"
4984 $run ${rm}r "$gentop"
4985 $show "$mkdir $gentop"
4986 $run $mkdir "$gentop"
4988 if test "$status" -ne 0 && test ! -d "$gentop"; then
4991 generated="$generated $gentop"
4993 # Add in members from convenience archives.
4994 for xlib in $addlibs; do
4995 # Extract the objects.
4997 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4998 *) xabs=`pwd`"/$xlib" ;;
5000 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5001 xdir="$gentop/$xlib"
5003 $show "${rm}r $xdir"
5005 $show "$mkdir $xdir"
5008 if test "$status" -ne 0 && test ! -d "$xdir"; then
5011 # We will extract separately just the conflicting names and we will no
5012 # longer touch any unique names. It is faster to leave these extract
5013 # automatically by $AR in one run.
5014 $show "(cd $xdir && $AR x $xabs)"
5015 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5016 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5019 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5020 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5021 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5024 while test "$i" -le "$count"
5026 # Put our $i before any first dot (extension)
5027 # Never overwrite any file
5029 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5031 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5033 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5034 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5040 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5044 # Do each command in the archive commands.
5045 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5046 cmds=$old_archive_from_new_cmds
5048 eval cmds=\"$old_archive_cmds\"
5050 if len=`expr "X$cmds" : ".*"` &&
5051 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5052 cmds=$old_archive_cmds
5054 # the command line is too long to link in one step, link in parts
5055 $echo "using piecewise archive linking..."
5060 save_oldobjs=$oldobjs
5061 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5062 # encoded into archives. This makes 'ar r' malfunction in
5063 # this piecewise linking case whenever conflicting object
5064 # names appear in distinct ar calls; check, warn and compensate.
5065 if (for obj in $save_oldobjs
5067 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5068 done | sort | sort -uc >/dev/null 2>&1); then
5071 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5072 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5075 # Is there a better way of finding the last object in the list?
5076 for obj in $save_oldobjs
5080 for obj in $save_oldobjs
5082 oldobjs="$objlist $obj"
5083 objlist="$objlist $obj"
5084 eval test_cmds=\"$old_archive_cmds\"
5085 if len=`expr "X$test_cmds" : ".*"` &&
5086 test "$len" -le "$max_cmd_len"; then
5089 # the above command should be used before it gets too long
5091 if test "$obj" = "$last_oldobj" ; then
5094 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5095 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5101 if test "X$oldobjs" = "X" ; then
5102 eval cmds=\"\$concat_cmds\"
5104 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5108 save_ifs="$IFS"; IFS='~'
5109 for cmd in $cmds; do
5113 $run eval "$cmd" || exit $?
5118 if test -n "$generated"; then
5119 $show "${rm}r$generated"
5120 $run ${rm}r$generated
5123 # Now create the libtool archive.
5127 test "$build_old_libs" = yes && old_library="$libname.$libext"
5128 $show "creating $output"
5130 # Preserve any variables that may affect compiler behavior
5131 for var in $variables_saved_for_relink; do
5132 if eval test -z \"\${$var+set}\"; then
5133 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5134 elif eval var_value=\$$var; test -z "$var_value"; then
5135 relink_command="$var=; export $var; $relink_command"
5137 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5138 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5141 # Quote the link command for shipping.
5142 relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5143 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5144 if test "$hardcode_automatic" = yes ; then
5147 # Only create the output if not a dry run.
5148 if test -z "$run"; then
5149 for installed in no yes; do
5150 if test "$installed" = yes; then
5151 if test -z "$install_libdir"; then
5154 output="$output_objdir/$outputname"i
5155 # Replace all uninstalled libtool libraries with the installed ones
5157 for deplib in $dependency_libs; do
5160 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5161 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5162 if test -z "$libdir"; then
5163 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5166 newdependency_libs="$newdependency_libs $libdir/$name"
5168 *) newdependency_libs="$newdependency_libs $deplib" ;;
5171 dependency_libs="$newdependency_libs"
5173 for lib in $dlfiles; do
5174 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5175 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5176 if test -z "$libdir"; then
5177 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5180 newdlfiles="$newdlfiles $libdir/$name"
5182 dlfiles="$newdlfiles"
5184 for lib in $dlprefiles; do
5185 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5186 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5187 if test -z "$libdir"; then
5188 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5191 newdlprefiles="$newdlprefiles $libdir/$name"
5193 dlprefiles="$newdlprefiles"
5196 for lib in $dlfiles; do
5198 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5199 *) abs=`pwd`"/$lib" ;;
5201 newdlfiles="$newdlfiles $abs"
5203 dlfiles="$newdlfiles"
5205 for lib in $dlprefiles; do
5207 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5208 *) abs=`pwd`"/$lib" ;;
5210 newdlprefiles="$newdlprefiles $abs"
5212 dlprefiles="$newdlprefiles"
5215 # place dlname in correct position for cygwin
5217 case $host,$output,$installed,$module,$dlname in
5218 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5221 # $outputname - a libtool library file
5222 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5224 # Please DO NOT delete this file!
5225 # It is necessary for linking the library.
5227 # The name that we can dlopen(3).
5230 # Names of this library.
5231 library_names='$library_names'
5233 # The name of the static archive.
5234 old_library='$old_library'
5236 # Libraries that this one depends upon.
5237 dependency_libs='$dependency_libs'
5239 # Version information for $libname.
5244 # Is this an already installed library?
5245 installed=$installed
5247 # Should we warn about portability when linking against -modules?
5248 shouldnotlink=$module
5250 # Files to dlopen/dlpreopen
5252 dlpreopen='$dlprefiles'
5254 # Directory that this library needs to be installed in:
5255 libdir='$install_libdir'"
5256 if test "$installed" = no && test "$need_relink" = yes; then
5258 relink_command=\"$relink_command\""
5263 # Do a symbolic link so that the libtool archive can be found in
5264 # LD_LIBRARY_PATH before the program is installed.
5265 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5266 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5272 # libtool install mode
5274 modename="$modename: install"
5276 # There may be an optional sh(1) argument at the beginning of
5277 # install_prog (especially on Windows NT).
5278 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5279 # Allow the use of GNU shtool's install command.
5280 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5281 # Aesthetically quote it.
5282 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5284 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5288 install_prog="$arg "
5296 # The real first argument should be the name of the installation program.
5297 # Aesthetically quote it.
5298 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5300 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5304 install_prog="$install_prog$arg"
5306 # We need to accept at least all the BSD install flags.
5316 if test -n "$dest"; then
5317 files="$files $dest"
5335 # If the previous option needed an argument, then skip it.
5336 if test -n "$prev"; then
5345 # Aesthetically quote the argument.
5346 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5348 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5352 install_prog="$install_prog $arg"
5355 if test -z "$install_prog"; then
5356 $echo "$modename: you must specify an install program" 1>&2
5361 if test -n "$prev"; then
5362 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5367 if test -z "$files"; then
5368 if test -z "$dest"; then
5369 $echo "$modename: no file or destination specified" 1>&2
5371 $echo "$modename: you must specify a destination" 1>&2
5377 # Strip any trailing slash from the destination.
5378 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5380 # Check to see that the destination is a directory.
5381 test -d "$dest" && isdir=yes
5382 if test "$isdir" = yes; then
5386 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5387 test "X$destdir" = "X$dest" && destdir=.
5388 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5390 # Not a directory, so check to see that there is only one file specified.
5392 if test "$#" -gt 2; then
5393 $echo "$modename: \`$dest' is not a directory" 1>&2
5399 [\\/]* | [A-Za-z]:[\\/]*) ;;
5401 for file in $files; do
5405 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5414 # This variable tells wrapper scripts just to set variables rather
5415 # than running their programs.
5416 libtool_install_magic="$magic"
5421 for file in $files; do
5423 # Do each installation.
5426 # Do the static libraries later.
5427 staticlibs="$staticlibs $file"
5431 # Check to see that this really is a libtool archive.
5432 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5434 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5442 # If there is no directory component, then add one.
5444 */* | *\\*) . $file ;;
5448 # Add the libdir to current_libdirs if it is the destination.
5449 if test "X$destdir" = "X$libdir"; then
5450 case "$current_libdirs " in
5452 *) current_libdirs="$current_libdirs $libdir" ;;
5455 # Note the libdir as a future libdir.
5456 case "$future_libdirs " in
5458 *) future_libdirs="$future_libdirs $libdir" ;;
5462 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5463 test "X$dir" = "X$file/" && dir=
5466 if test -n "$relink_command"; then
5467 # Determine the prefix the user has applied to our future dir.
5468 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5470 # Don't allow the user to place us outside of our expected
5471 # location b/c this prevents finding dependent libraries that
5472 # are installed to the same prefix.
5473 # At present, this check doesn't affect windows .dll's that
5474 # are installed into $libdir/../bin (currently, that works fine)
5475 # but it's something to keep an eye on.
5476 if test "$inst_prefix_dir" = "$destdir"; then
5477 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5481 if test -n "$inst_prefix_dir"; then
5482 # Stick the inst_prefix_dir data into the link command.
5483 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5485 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5488 $echo "$modename: warning: relinking \`$file'" 1>&2
5489 $show "$relink_command"
5490 if $run eval "$relink_command"; then :
5492 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5497 # See the names of the shared library.
5498 set dummy $library_names
5499 if test -n "$2"; then
5505 test -n "$relink_command" && srcname="$realname"T
5507 # Install the shared library and build the symlinks.
5508 $show "$install_prog $dir/$srcname $destdir/$realname"
5509 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5510 if test -n "$stripme" && test -n "$striplib"; then
5511 $show "$striplib $destdir/$realname"
5512 $run eval "$striplib $destdir/$realname" || exit $?
5515 if test "$#" -gt 0; then
5516 # Delete the old symlinks, and create new ones.
5519 if test "$linkname" != "$realname"; then
5520 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5521 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5526 # Do each command in the postinstall commands.
5527 lib="$destdir/$realname"
5528 cmds=$postinstall_cmds
5529 save_ifs="$IFS"; IFS='~'
5530 for cmd in $cmds; do
5534 $run eval "$cmd" || exit $?
5539 # Install the pseudo-library for information purposes.
5542 # Do not install the useless pseudo-library
5545 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5546 instname="$dir/$name"i
5547 $show "$install_prog $instname $destdir/$name"
5548 $run eval "$install_prog $instname $destdir/$name" || exit $?
5552 # Maybe install the static library, too.
5553 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5557 # Install (i.e. copy) a libtool object.
5559 # Figure out destination file name, if it wasn't already specified.
5560 if test -n "$destname"; then
5561 destfile="$destdir/$destname"
5563 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5564 destfile="$destdir/$destfile"
5567 # Deduce the name of the destination old-style object file.
5570 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5573 staticdest="$destfile"
5577 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5583 # Install the libtool object if requested.
5584 if test -n "$destfile"; then
5585 $show "$install_prog $file $destfile"
5586 $run eval "$install_prog $file $destfile" || exit $?
5589 # Install the old object if enabled.
5590 if test "$build_old_libs" = yes; then
5591 # Deduce the name of the old-style object file.
5592 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5594 $show "$install_prog $staticobj $staticdest"
5595 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5601 # Figure out destination file name, if it wasn't already specified.
5602 if test -n "$destname"; then
5603 destfile="$destdir/$destname"
5605 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5606 destfile="$destdir/$destfile"
5609 # If the file is missing, and there is a .exe on the end, strip it
5610 # because it is most likely a libtool script we actually want to
5615 if test ! -f "$file"; then
5616 file=`$echo $file|${SED} 's,.exe$,,'`
5622 # Do a test to see if this is really a libtool program.
5625 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5631 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5635 # To insure that "foo" is sourced, and not "foo.exe",
5636 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5637 # which disallows the automatic-append-.exe behavior.
5639 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5640 *) wrapperdot=${wrapper} ;;
5642 # If there is no directory component, then add one.
5644 */* | *\\*) . ${wrapperdot} ;;
5645 *) . ./${wrapperdot} ;;
5648 # Check the variables that should have been set.
5649 if test -z "$notinst_deplibs"; then
5650 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5655 for lib in $notinst_deplibs; do
5656 # Check to see that each library is installed.
5658 if test -f "$lib"; then
5659 # If there is no directory component, then add one.
5661 */* | *\\*) . $lib ;;
5665 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5666 if test -n "$libdir" && test ! -f "$libfile"; then
5667 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5673 # To insure that "foo" is sourced, and not "foo.exe",
5674 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5675 # which disallows the automatic-append-.exe behavior.
5677 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5678 *) wrapperdot=${wrapper} ;;
5680 # If there is no directory component, then add one.
5682 */* | *\\*) . ${wrapperdot} ;;
5683 *) . ./${wrapperdot} ;;
5687 if test "$fast_install" = no && test -n "$relink_command"; then
5688 if test "$finalize" = yes && test -z "$run"; then
5690 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5691 tmpdir="$tmpdir/libtool-$$"
5692 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5694 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5697 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5698 outputname="$tmpdir/$file"
5699 # Replace the output file specification.
5700 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5702 $show "$relink_command"
5703 if $run eval "$relink_command"; then :
5705 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5711 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5714 # Install the binary that we compiled earlier.
5715 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5719 # remove .exe since cygwin /usr/bin/install will append another
5721 case $install_prog,$host in
5722 */usr/bin/install*,*cygwin*)
5723 case $file:$destfile in
5728 destfile=$destfile.exe
5731 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5736 $show "$install_prog$stripme $file $destfile"
5737 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5738 test -n "$outputname" && ${rm}r "$tmpdir"
5743 for file in $staticlibs; do
5744 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5746 # Set up the ranlib parameters.
5747 oldlib="$destdir/$name"
5749 $show "$install_prog $file $oldlib"
5750 $run eval "$install_prog \$file \$oldlib" || exit $?
5752 if test -n "$stripme" && test -n "$old_striplib"; then
5753 $show "$old_striplib $oldlib"
5754 $run eval "$old_striplib $oldlib" || exit $?
5757 # Do each command in the postinstall commands.
5758 cmds=$old_postinstall_cmds
5759 save_ifs="$IFS"; IFS='~'
5760 for cmd in $cmds; do
5764 $run eval "$cmd" || exit $?
5769 if test -n "$future_libdirs"; then
5770 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5773 if test -n "$current_libdirs"; then
5774 # Maybe just do a dry run.
5775 test -n "$run" && current_libdirs=" -n$current_libdirs"
5776 exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5782 # libtool finish mode
5784 modename="$modename: finish"
5788 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5791 libdirs="$libdirs $dir"
5794 for libdir in $libdirs; do
5795 if test -n "$finish_cmds"; then
5796 # Do each command in the finish commands.
5798 save_ifs="$IFS"; IFS='~'
5799 for cmd in $cmds; do
5803 $run eval "$cmd" || admincmds="$admincmds
5808 if test -n "$finish_eval"; then
5809 # Do the single finish_eval.
5810 eval cmds=\"$finish_eval\"
5811 $run eval "$cmds" || admincmds="$admincmds
5817 # Exit here if they wanted silent mode.
5818 test "$show" = : && exit 0
5820 $echo "----------------------------------------------------------------------"
5821 $echo "Libraries have been installed in:"
5822 for libdir in $libdirs; do
5826 $echo "If you ever happen to want to link against installed libraries"
5827 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5828 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5829 $echo "flag during linking and do at least one of the following:"
5830 if test -n "$shlibpath_var"; then
5831 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5832 $echo " during execution"
5834 if test -n "$runpath_var"; then
5835 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5836 $echo " during linking"
5838 if test -n "$hardcode_libdir_flag_spec"; then
5840 eval flag=\"$hardcode_libdir_flag_spec\"
5842 $echo " - use the \`$flag' linker flag"
5844 if test -n "$admincmds"; then
5845 $echo " - have your system administrator run these commands:$admincmds"
5847 if test -f /etc/ld.so.conf; then
5848 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5851 $echo "See any operating system documentation about shared libraries for"
5852 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5853 $echo "----------------------------------------------------------------------"
5857 # libtool execute mode
5859 modename="$modename: execute"
5861 # The first argument is the command name.
5863 if test -z "$cmd"; then
5864 $echo "$modename: you must specify a COMMAND" 1>&2
5869 # Handle -dlopen flags immediately.
5870 for file in $execute_dlfiles; do
5871 if test ! -f "$file"; then
5872 $echo "$modename: \`$file' is not a file" 1>&2
5880 # Check to see that this really is a libtool archive.
5881 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5883 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5888 # Read the libtool library.
5892 # If there is no directory component, then add one.
5894 */* | *\\*) . $file ;;
5898 # Skip this library if it cannot be dlopened.
5899 if test -z "$dlname"; then
5900 # Warn if it was a shared library.
5901 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5905 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5906 test "X$dir" = "X$file" && dir=.
5908 if test -f "$dir/$objdir/$dlname"; then
5911 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5917 # Just add the directory containing the .lo file.
5918 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5919 test "X$dir" = "X$file" && dir=.
5923 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5928 # Get the absolute pathname.
5929 absdir=`cd "$dir" && pwd`
5930 test -n "$absdir" && dir="$absdir"
5932 # Now add the directory to shlibpath_var.
5933 if eval "test -z \"\$$shlibpath_var\""; then
5934 eval "$shlibpath_var=\"\$dir\""
5936 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5940 # This variable tells wrapper scripts just to set shlibpath_var
5941 # rather than running their programs.
5942 libtool_execute_magic="$magic"
5944 # Check if any of the arguments is a wrapper script.
5951 # Do a test to see if this is really a libtool program.
5952 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5953 # If there is no directory component, then add one.
5955 */* | *\\*) . $file ;;
5959 # Transform arg to wrapped name.
5960 file="$progdir/$program"
5964 # Quote arguments (to preserve shell metacharacters).
5965 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5966 args="$args \"$file\""
5969 if test -z "$run"; then
5970 if test -n "$shlibpath_var"; then
5971 # Export the shlibpath_var.
5972 eval "export $shlibpath_var"
5975 # Restore saved environment variables
5976 if test "${save_LC_ALL+set}" = set; then
5977 LC_ALL="$save_LC_ALL"; export LC_ALL
5979 if test "${save_LANG+set}" = set; then
5980 LANG="$save_LANG"; export LANG
5983 # Now prepare to actually exec the command.
5984 exec_cmd="\$cmd$args"
5986 # Display what would be done.
5987 if test -n "$shlibpath_var"; then
5988 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5989 $echo "export $shlibpath_var"
5996 # libtool clean and uninstall mode
5998 modename="$modename: $mode"
6004 # This variable tells wrapper scripts just to set variables rather
6005 # than running their programs.
6006 libtool_install_magic="$magic"
6011 -f) rm="$rm $arg"; rmforce=yes ;;
6012 -*) rm="$rm $arg" ;;
6013 *) files="$files $arg" ;;
6017 if test -z "$rm"; then
6018 $echo "$modename: you must specify an RM program" 1>&2
6025 origobjdir="$objdir"
6026 for file in $files; do
6027 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6028 if test "X$dir" = "X$file"; then
6030 objdir="$origobjdir"
6032 objdir="$dir/$origobjdir"
6034 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6035 test "$mode" = uninstall && objdir="$dir"
6037 # Remember objdir for removal later, being careful to avoid duplicates
6038 if test "$mode" = clean; then
6041 *) rmdirs="$rmdirs $objdir" ;;
6045 # Don't error if the file doesn't exist and rm -f was used.
6046 if (test -L "$file") >/dev/null 2>&1 \
6047 || (test -h "$file") >/dev/null 2>&1 \
6048 || test -f "$file"; then
6050 elif test -d "$file"; then
6053 elif test "$rmforce" = yes; then
6061 # Possibly a libtool archive, so verify it.
6062 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6065 # Delete the libtool libraries and symlinks.
6066 for n in $library_names; do
6067 rmfiles="$rmfiles $objdir/$n"
6069 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6070 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6072 if test "$mode" = uninstall; then
6073 if test -n "$library_names"; then
6074 # Do each command in the postuninstall commands.
6075 cmds=$postuninstall_cmds
6076 save_ifs="$IFS"; IFS='~'
6077 for cmd in $cmds; do
6082 if test "$?" -ne 0 && test "$rmforce" != yes; then
6089 if test -n "$old_library"; then
6090 # Do each command in the old_postuninstall commands.
6091 cmds=$old_postuninstall_cmds
6092 save_ifs="$IFS"; IFS='~'
6093 for cmd in $cmds; do
6098 if test "$?" -ne 0 && test "$rmforce" != yes; then
6104 # FIXME: should reinstall the best remaining shared library.
6110 # Possibly a libtool object, so verify it.
6111 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6116 # Add PIC object to the list of files to remove.
6117 if test -n "$pic_object" \
6118 && test "$pic_object" != none; then
6119 rmfiles="$rmfiles $dir/$pic_object"
6122 # Add non-PIC object to the list of files to remove.
6123 if test -n "$non_pic_object" \
6124 && test "$non_pic_object" != none; then
6125 rmfiles="$rmfiles $dir/$non_pic_object"
6131 if test "$mode" = clean ; then
6135 file=`$echo $file|${SED} 's,.exe$,,'`
6136 noexename=`$echo $name|${SED} 's,.exe$,,'`
6137 # $file with .exe has already been added to rmfiles,
6138 # add $file without .exe
6139 rmfiles="$rmfiles $file"
6142 # Do a test to see if this is a libtool program.
6143 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6147 # note $name still contains .exe if it was in $file originally
6148 # as does the version of $file that was added into $rmfiles
6149 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6150 if test "$fast_install" = yes && test -n "$relink_command"; then
6151 rmfiles="$rmfiles $objdir/lt-$name"
6153 if test "X$noexename" != "X$name" ; then
6154 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6160 $show "$rm $rmfiles"
6161 $run $rm $rmfiles || exit_status=1
6163 objdir="$origobjdir"
6165 # Try to remove the ${objdir}s in the directories where we deleted files
6166 for dir in $rmdirs; do
6167 if test -d "$dir"; then
6169 $run rmdir $dir >/dev/null 2>&1
6177 $echo "$modename: you must specify a MODE" 1>&2
6178 $echo "$generic_help" 1>&2
6183 if test -z "$exec_cmd"; then
6184 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6185 $echo "$generic_help" 1>&2
6188 fi # test -z "$show_help"
6190 if test -n "$exec_cmd"; then
6195 # We need to display help for each of the modes.
6198 "Usage: $modename [OPTION]... [MODE-ARG]...
6200 Provide generalized library-building support services.
6202 --config show all configuration variables
6203 --debug enable verbose shell tracing
6204 -n, --dry-run display commands without modifying any files
6205 --features display basic configuration information and exit
6206 --finish same as \`--mode=finish'
6207 --help display this help message and exit
6208 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6209 --quiet same as \`--silent'
6210 --silent don't print informational messages
6211 --tag=TAG use configuration variables from tag TAG
6212 --version print version information
6214 MODE must be one of the following:
6216 clean remove files from the build directory
6217 compile compile a source file into a libtool object
6218 execute automatically set library path, then run a program
6219 finish complete the installation of libtool libraries
6220 install install libraries or executables
6221 link create a library or an executable
6222 uninstall remove libraries from an installed directory
6224 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6225 a more detailed description of MODE.
6227 Report bugs to <bug-libtool@gnu.org>."
6233 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6235 Remove files from the build directory.
6237 RM is the name of the program to use to delete files associated with each FILE
6238 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6241 If FILE is a libtool library, object or program, all the files associated
6242 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6247 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6249 Compile a source file into a libtool library object.
6251 This mode accepts the following additional options:
6253 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6254 -prefer-pic try to building PIC objects only
6255 -prefer-non-pic try to building non-PIC objects only
6256 -static always build a \`.o' file suitable for static linking
6258 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6259 from the given SOURCEFILE.
6261 The output file name is determined by removing the directory component from
6262 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6263 library object suffix, \`.lo'."
6268 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6270 Automatically set library path, then run a program.
6272 This mode accepts the following additional options:
6274 -dlopen FILE add the directory containing FILE to the library path
6276 This mode sets the library path environment variable according to \`-dlopen'
6279 If any of the ARGS are libtool executable wrappers, then they are translated
6280 into their corresponding uninstalled binary, and any of their required library
6281 directories are added to the library path.
6283 Then, COMMAND is executed, with ARGS as arguments."
6288 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6290 Complete the installation of libtool libraries.
6292 Each LIBDIR is a directory that contains libtool libraries.
6294 The commands that this mode executes may require superuser privileges. Use
6295 the \`--dry-run' option if you just want to see what would be executed."
6300 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6302 Install executables or libraries.
6304 INSTALL-COMMAND is the installation command. The first component should be
6305 either the \`install' or \`cp' program.
6307 The rest of the components are interpreted as arguments to that command (only
6308 BSD-compatible install options are recognized)."
6313 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6315 Link object files or libraries together to form another library, or to
6316 create an executable program.
6318 LINK-COMMAND is a command using the C compiler that you would use to create
6319 a program from several object files.
6321 The following components of LINK-COMMAND are treated specially:
6323 -all-static do not do any dynamic linking at all
6324 -avoid-version do not add a version suffix if possible
6325 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6326 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6327 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6328 -export-symbols SYMFILE
6329 try to export only the symbols listed in SYMFILE
6330 -export-symbols-regex REGEX
6331 try to export only the symbols matching REGEX
6332 -LLIBDIR search LIBDIR for required installed libraries
6333 -lNAME OUTPUT-FILE requires the installed library libNAME
6334 -module build a library that can dlopened
6335 -no-fast-install disable the fast-install mode
6336 -no-install link a not-installable executable
6337 -no-undefined declare that a library does not refer to external symbols
6338 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6339 -objectlist FILE Use a list of object files found in FILE to specify objects
6340 -precious-files-regex REGEX
6341 don't remove output files matching REGEX
6342 -release RELEASE specify package release information
6343 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6344 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6345 -static do not do any dynamic linking of libtool libraries
6346 -version-info CURRENT[:REVISION[:AGE]]
6347 specify library version info [each variable defaults to 0]
6349 All other options (arguments beginning with \`-') are ignored.
6351 Every other argument is treated as a filename. Files ending in \`.la' are
6352 treated as uninstalled libtool libraries, other files are standard or library
6355 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6356 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6357 required, except when creating a convenience library.
6359 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6360 using \`ar' and \`ranlib', or on Windows using \`lib'.
6362 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6363 is created, otherwise an executable program is created."
6368 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6370 Remove libraries from an installation directory.
6372 RM is the name of the program to use to delete files associated with each FILE
6373 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6376 If FILE is a libtool library, all the files associated with it are deleted.
6377 Otherwise, only FILE itself is deleted using RM."
6381 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6388 $echo "Try \`$modename --help' for more information about other modes."
6392 # The TAGs below are defined such that we never get into a situation
6393 # in which we disable both kinds of libraries. Given conflicting
6394 # choices, we go for a static library, that is the most portable,
6395 # since we can't tell whether shared libraries were disabled because
6396 # the user asked for that or because the platform doesn't support
6397 # them. This is particularly important on AIX, because we don't
6398 # support having both static and shared libraries enabled at the same
6399 # time on that platform, so we default to a shared-only configuration.
6400 # If a disable-shared tag is given, we'll fallback to a static-only
6401 # configuration. But we'll never go from static-only to shared-only.
6403 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6404 build_libtool_libs=no
6406 # ### END LIBTOOL TAG CONFIG: disable-shared
6408 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6409 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6410 # ### END LIBTOOL TAG CONFIG: disable-static