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 # define SED for historic ltconfig's generated by Libtool 1.3
52 test -z "$SED" && SED=sed
54 # The name of this program.
55 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
62 TIMESTAMP=" (1.1220.2.60 2004/01/25 12:25:08)"
65 help="Try \`$progname --help' for more information."
66 magic="%%%MAGIC variable%%%"
71 # Sed substitution that helps us do robust quoting. It backslashifies
72 # metacharacters that are still active within double-quoted strings.
73 Xsed="${SED}"' -e 1s/^X//'
74 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75 # test EBCDIC or ASCII
76 case `echo A|tr A '\301'` in
77 A) # EBCDIC based system
78 SP2NL="tr '\100' '\n'"
79 NL2SP="tr '\r\n' '\100\100'"
81 *) # Assume ASCII based system
82 SP2NL="tr '\040' '\012'"
83 NL2SP="tr '\015\012' '\040\040'"
88 # Only set LANG and LC_ALL to C if already set.
89 # These must not be set unconditionally because not all systems understand
90 # e.g. LANG=C (notably SCO).
91 # We save the old values to restore during execute mode.
92 if test "${LC_ALL+set}" = set; then
93 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
95 if test "${LANG+set}" = set; then
96 save_LANG="$LANG"; LANG=C; export LANG
99 # Make sure IFS has a sensible default
103 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
104 $echo "$modename: not configured to build any kind of library" 1>&2
105 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
118 lo2o="s/\\.lo\$/.${objext}/"
119 o2lo="s/\\.${objext}\$/.lo/"
121 if test -z "$max_cmd_len"; then
126 # If test is not a shell built-in, we'll probably end up computing a
127 # maximum length that is only half of the actual maximum length, but
129 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
130 = "XX$testring") >/dev/null 2>&1 &&
131 new_result=`expr "X$testring" : ".*" 2>&1` &&
132 max_cmd_len="$new_result" &&
133 test $i != 17 # 1/2 MB should be enough
136 testring="$testring$testring"
139 # Add a significant safety factor because C++ compilers can tack on massive
140 # amounts of additional arguments before passing them to the linker.
141 # It appears as though 1/2 is a usable value.
142 max_cmd_len=`expr $max_cmd_len \/ 2`
145 #####################################
146 # Shell function definitions:
147 # This seems to be the best place for them
149 # Need a lot of goo to handle *both* DLLs and import libs
150 # Has to be a shell function in order to 'eat' the argument
151 # that is supplied when $file_magic_command is called.
153 win32_libid_type="unknown"
154 win32_fileres=`file -L $1 2>/dev/null`
155 case $win32_fileres in
156 *ar\ archive\ import\ library*) # definitely import
157 win32_libid_type="x86 archive import"
159 *ar\ archive*) # could be an import, or static
160 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
161 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
162 win32_nmres=`eval $NM -f posix -A $1 | \
163 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
164 if test "X$win32_nmres" = "Ximport" ; then
165 win32_libid_type="x86 archive import"
167 win32_libid_type="x86 archive static"
172 win32_libid_type="x86 DLL"
174 *executable*) # but shell scripts are "executable" too...
175 case $win32_fileres in
176 *MS\ Windows\ PE\ Intel*)
177 win32_libid_type="x86 DLL"
182 $echo $win32_libid_type
185 # End of Shell function definitions
186 #####################################
188 # Parse our command line options once, thoroughly.
189 while test "$#" -gt 0
195 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
199 # If the previous option needs an argument, assign it.
200 if test -n "$prev"; then
203 execute_dlfiles="$execute_dlfiles $arg"
207 preserve_args="${preserve_args}=$arg"
209 # Check whether tagname contains only valid characters
212 $echo "$progname: invalid tag name: $tagname" 1>&2
219 # Don't test for the "default" C tag, as we know, it's there, but
220 # not specially marked.
223 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
224 taglist="$taglist $tagname"
225 # Evaluate the configuration.
226 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
228 $echo "$progname: ignoring unknown tag $tagname" 1>&2
243 # Have we seen a non-optional argument yet?
250 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
252 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
253 $echo "This is free software; see the source for copying conditions. There is NO"
254 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
259 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
260 # Now print the configurations for the tags.
261 for tagname in $taglist; do
262 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
268 $echo "$progname: enabling shell trace mode"
270 preserve_args="$preserve_args $arg"
279 if test "$build_libtool_libs" = yes; then
280 $echo "enable shared libraries"
282 $echo "disable shared libraries"
284 if test "$build_old_libs" = yes; then
285 $echo "enable static libraries"
287 $echo "disable static libraries"
292 --finish) mode="finish" ;;
294 --mode) prevopt="--mode" prev=mode ;;
295 --mode=*) mode="$optarg" ;;
297 --preserve-dup-deps) duplicate_deps="yes" ;;
301 preserve_args="$preserve_args $arg"
304 --tag) prevopt="--tag" prev=tag ;;
306 set tag "$optarg" ${1+"$@"}
309 preserve_args="$preserve_args --tag"
318 $echo "$modename: unrecognized option \`$arg'" 1>&2
330 if test -n "$prevopt"; then
331 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
336 # If this variable is set in any of the actions, the command in it
337 # will be execed at the end. This prevents here-documents from being
338 # left over by shells.
341 if test -z "$show_help"; then
343 # Infer the operation mode.
344 if test -z "$mode"; then
345 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
346 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
348 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
360 *db | *dbx | *strace | *truss)
370 # If we have no mode, but dlfiles were specified, then do execute mode.
371 test -n "$execute_dlfiles" && mode=execute
373 # Just use the default operation mode.
374 if test -z "$mode"; then
375 if test -n "$nonopt"; then
376 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
378 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
385 # Only execute mode is allowed to have -dlopen flags.
386 if test -n "$execute_dlfiles" && test "$mode" != execute; then
387 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
392 # Change the help message to a mode-specific one.
394 help="Try \`$modename --help --mode=$mode' for more information."
396 # These modes are in order of execution frequency so that they run quickly.
398 # libtool compile mode
400 modename="$modename: compile"
401 # Get the compilation command and the source file.
403 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
414 # do not "continue". Instead, add this to base_compile
426 # Accept any command-line options.
429 if test -n "$libobj" ; then
430 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
437 -static | -prefer-pic | -prefer-non-pic)
448 arg_mode=arg # the next one goes into the "base_compile" arg list
449 continue # The current "srcfile" will either be retained or
450 ;; # replaced later. I would guess that would be a bug.
453 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
455 save_ifs="$IFS"; IFS=','
459 # Double-quote args containing other shell metacharacters.
460 # Many Bourne shells cannot handle close brackets correctly
461 # in scan sets, so we specify it separately.
463 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
467 lastarg="$lastarg $arg"
470 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
472 # Add the arguments to base_compile.
473 base_compile="$base_compile $lastarg"
478 # Accept the current argument as the source file.
479 # The previous "srcfile" becomes the current argument.
486 esac # case $arg_mode
488 # Aesthetically quote the previous argument.
489 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
492 # Double-quote args containing other shell metacharacters.
493 # Many Bourne shells cannot handle close brackets correctly
494 # in scan sets, so we specify it separately.
495 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
496 lastarg="\"$lastarg\""
500 base_compile="$base_compile $lastarg"
505 $echo "$modename: you must specify an argument for -Xcompile"
509 $echo "$modename: you must specify a target with \`-o'" 1>&2
513 # Get the name of the library object.
514 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
518 # Recognize several different file suffixes.
519 # If the user specifies -o file.o, it is replaced with file.lo
529 *.class) xform=class ;;
534 *.java) xform=java ;;
537 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
540 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
542 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
547 # Infer tagged configuration to use if any are available and
548 # if one wasn't chosen via the "--tag" command line option.
549 # Only attempt this if the compiler in the base compile
550 # command doesn't match the default compiler.
551 if test -n "$available_tags" && test -z "$tagname"; then
552 case $base_compile in
553 # Blanks in the command may have been stripped by the calling shell,
554 # but not from the CC environment variable when configure was run.
555 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
556 # Blanks at the start of $base_compile will cause this to fail
557 # if we don't check for them as well.
559 for z in $available_tags; do
560 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
561 # Evaluate the configuration.
562 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
563 case "$base_compile " in
564 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
565 # The compiler in the base compile command matches
566 # the one in the tagged configuration.
567 # Assume this is the tagged configuration we want.
574 # If $tagname still isn't set, then no tagged configuration
575 # was found and let the user know that the "--tag" command
576 # line option must be used.
577 if test -z "$tagname"; then
578 $echo "$modename: unable to infer tagged configuration"
579 $echo "$modename: specify a tag with \`--tag'" 1>&2
582 # $echo "$modename: using $tagname tagged configuration"
588 for arg in $later; do
607 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
608 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
609 if test "X$xdir" = "X$obj"; then
614 lobj=${xdir}$objdir/$objname
616 if test -z "$base_compile"; then
617 $echo "$modename: you must specify a compilation command" 1>&2
622 # Delete any leftover library objects.
623 if test "$build_old_libs" = yes; then
624 removelist="$obj $lobj $libobj ${libobj}T"
626 removelist="$lobj $libobj ${libobj}T"
630 trap "$run $rm $removelist; exit 1" 1 2 15
632 # On Cygwin there's no "real" PIC flag so we must build both object types
634 cygwin* | mingw* | pw32* | os2*)
638 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
639 # non-PIC code in shared libraries is not supported
643 # Calculate the filename of the output object if compiler does
644 # not support -o with -c
645 if test "$compiler_c_o" = no; then
646 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
647 lockfile="$output_obj.lock"
648 removelist="$removelist $output_obj $lockfile"
649 trap "$run $rm $removelist; exit 1" 1 2 15
656 # Lock this critical section if it is needed
657 # We use this script file to make the link, it avoids creating a new file
658 if test "$need_locks" = yes; then
659 until $run ln "$0" "$lockfile" 2>/dev/null; do
660 $show "Waiting for $lockfile to be removed"
663 elif test "$need_locks" = warn; then
664 if test -f "$lockfile"; then
666 *** ERROR, $lockfile exists and contains:
667 `cat $lockfile 2>/dev/null`
669 This indicates that another process is trying to use the same
670 temporary object file, and libtool could not work around it because
671 your compiler does not support \`-c' and \`-o' together. If you
672 repeat this compilation, it may succeed, by chance, but you had better
673 avoid parallel builds (make -j) in this platform, or get a better
679 $echo $srcfile > "$lockfile"
682 if test -n "$fix_srcfile_path"; then
683 eval srcfile=\"$fix_srcfile_path\"
686 $run $rm "$libobj" "${libobj}T"
688 # Create a libtool object file (analogous to a ".la" file),
689 # but don't create it if we're doing a dry run.
690 test -z "$run" && cat > ${libobj}T <<EOF
691 # $libobj - a libtool object file
692 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
694 # Please DO NOT delete this file!
695 # It is necessary for linking the library.
697 # Name of the PIC object.
700 # Only build a PIC object if we are building libtool libraries.
701 if test "$build_libtool_libs" = yes; then
702 # Without this assignment, base_compile gets emptied.
703 fbsd_hideous_sh_bug=$base_compile
705 if test "$pic_mode" != no; then
706 command="$base_compile $srcfile $pic_flag"
708 # Don't build PIC code
709 command="$base_compile $srcfile"
712 if test ! -d "${xdir}$objdir"; then
713 $show "$mkdir ${xdir}$objdir"
714 $run $mkdir ${xdir}$objdir
716 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
721 if test -z "$output_obj"; then
722 # Place PIC objects in $objdir
723 command="$command -o $lobj"
726 $run $rm "$lobj" "$output_obj"
729 if $run eval "$command"; then :
731 test -n "$output_obj" && $run $rm $removelist
735 if test "$need_locks" = warn &&
736 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
738 *** ERROR, $lockfile contains:
739 `cat $lockfile 2>/dev/null`
741 but it should contain:
744 This indicates that another process is trying to use the same
745 temporary object file, and libtool could not work around it because
746 your compiler does not support \`-c' and \`-o' together. If you
747 repeat this compilation, it may succeed, by chance, but you had better
748 avoid parallel builds (make -j) in this platform, or get a better
755 # Just move the object if needed, then go on to compile the next one
756 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
757 $show "$mv $output_obj $lobj"
758 if $run $mv $output_obj $lobj; then :
766 # Append the name of the PIC object to the libtool object file.
767 test -z "$run" && cat >> ${libobj}T <<EOF
768 pic_object='$objdir/$objname'
772 # Allow error messages only from the first compilation.
773 if test "$suppress_opt" = yes; then
774 suppress_output=' >/dev/null 2>&1'
777 # No PIC object so indicate it doesn't exist in the libtool
779 test -z "$run" && cat >> ${libobj}T <<EOF
785 # Only build a position-dependent object if we build old libraries.
786 if test "$build_old_libs" = yes; then
787 if test "$pic_mode" != yes; then
788 # Don't build PIC code
789 command="$base_compile $srcfile"
791 command="$base_compile $srcfile $pic_flag"
793 if test "$compiler_c_o" = yes; then
794 command="$command -o $obj"
797 # Suppress compiler output if we already did a PIC compilation.
798 command="$command$suppress_output"
799 $run $rm "$obj" "$output_obj"
801 if $run eval "$command"; then :
807 if test "$need_locks" = warn &&
808 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
810 *** ERROR, $lockfile contains:
811 `cat $lockfile 2>/dev/null`
813 but it should contain:
816 This indicates that another process is trying to use the same
817 temporary object file, and libtool could not work around it because
818 your compiler does not support \`-c' and \`-o' together. If you
819 repeat this compilation, it may succeed, by chance, but you had better
820 avoid parallel builds (make -j) in this platform, or get a better
827 # Just move the object if needed
828 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
829 $show "$mv $output_obj $obj"
830 if $run $mv $output_obj $obj; then :
838 # Append the name of the non-PIC object the libtool object file.
839 # Only append if the libtool object file exists.
840 test -z "$run" && cat >> ${libobj}T <<EOF
841 # Name of the non-PIC object.
842 non_pic_object='$objname'
846 # Append the name of the non-PIC object the libtool object file.
847 # Only append if the libtool object file exists.
848 test -z "$run" && cat >> ${libobj}T <<EOF
849 # Name of the non-PIC object.
855 $run $mv "${libobj}T" "${libobj}"
857 # Unlock the critical section if it was locked
858 if test "$need_locks" != no; then
867 modename="$modename: link"
869 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
870 # It is impossible to link a dll without this setting, and
871 # we shouldn't force the makefile maintainer to figure out
872 # which system we are compiling for in order to pass an extra
873 # flag for every libtool invocation.
876 # FIXME: Unfortunately, there are problems with the above when trying
877 # to make a dll which has undefined symbols, in which case not
878 # even a static library is built. For now, we need to specify
879 # -no-undefined on the libtool link line when we can be certain
880 # that all symbols are satisfied, otherwise we get a static library.
887 libtool_args="$nonopt"
888 base_compile="$nonopt $@"
889 compile_command="$nonopt"
890 finalize_command="$nonopt"
903 lib_search_path=`pwd`
912 export_symbols_regex=
920 precious_files_regex=
921 prefer_static_libs=no
934 # Infer tagged configuration to use if any are available and
935 # if one wasn't chosen via the "--tag" command line option.
936 # Only attempt this if the compiler in the base link
937 # command doesn't match the default compiler.
938 if test -n "$available_tags" && test -z "$tagname"; then
939 case $base_compile in
940 # Blanks in the command may have been stripped by the calling shell,
941 # but not from the CC environment variable when configure was run.
942 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
943 # Blanks at the start of $base_compile will cause this to fail
944 # if we don't check for them as well.
946 for z in $available_tags; do
947 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
948 # Evaluate the configuration.
949 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
950 case $base_compile in
951 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
952 # The compiler in $compile_command matches
953 # the one in the tagged configuration.
954 # Assume this is the tagged configuration we want.
961 # If $tagname still isn't set, then no tagged configuration
962 # was found and let the user know that the "--tag" command
963 # line option must be used.
964 if test -z "$tagname"; then
965 $echo "$modename: unable to infer tagged configuration"
966 $echo "$modename: specify a tag with \`--tag'" 1>&2
969 # $echo "$modename: using $tagname tagged configuration"
975 # We need to know -static, to get the right output filenames.
979 -all-static | -static)
980 if test "X$arg" = "X-all-static"; then
981 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
982 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
984 if test -n "$link_static_flag"; then
985 dlopen_self=$dlopen_self_static
988 if test -z "$pic_flag" && test -n "$link_static_flag"; then
989 dlopen_self=$dlopen_self_static
992 build_libtool_libs=no
994 prefer_static_libs=yes
1000 # See if our shared archives depend on static archives.
1001 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1003 # Go through the arguments, transforming them on the way.
1004 while test "$#" -gt 0; do
1008 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1009 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1013 libtool_args="$libtool_args $qarg"
1015 # If the previous option needs an argument, assign it.
1016 if test -n "$prev"; then
1019 compile_command="$compile_command @OUTPUT@"
1020 finalize_command="$finalize_command @OUTPUT@"
1026 if test "$preload" = no; then
1027 # Add the symbol object into the linking commands.
1028 compile_command="$compile_command @SYMFILE@"
1029 finalize_command="$finalize_command @SYMFILE@"
1033 *.la | *.lo) ;; # We handle these cases below.
1035 if test "$dlself" = no; then
1043 if test "$prev" = dlprefiles; then
1045 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1055 if test "$prev" = dlfiles; then
1056 dlfiles="$dlfiles $arg"
1058 dlprefiles="$dlprefiles $arg"
1066 export_symbols="$arg"
1067 if test ! -f "$arg"; then
1068 $echo "$modename: symbol file \`$arg' does not exist"
1075 export_symbols_regex="$arg"
1080 inst_prefix_dir="$arg"
1085 precious_files_regex="$arg"
1095 if test -f "$arg"; then
1098 for fil in `cat $save_arg`
1100 # moreargs="$moreargs $fil"
1102 # A libtool-controlled object.
1104 # Check to see that this really is a libtool object.
1105 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1110 # If there is no directory component, then add one.
1112 */* | *\\*) . $arg ;;
1116 if test -z "$pic_object" || \
1117 test -z "$non_pic_object" ||
1118 test "$pic_object" = none && \
1119 test "$non_pic_object" = none; then
1120 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1124 # Extract subdirectory from the argument.
1125 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1126 if test "X$xdir" = "X$arg"; then
1132 if test "$pic_object" != none; then
1133 # Prepend the subdirectory the object is found in.
1134 pic_object="$xdir$pic_object"
1136 if test "$prev" = dlfiles; then
1137 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1138 dlfiles="$dlfiles $pic_object"
1142 # If libtool objects are unsupported, then we need to preload.
1147 # CHECK ME: I think I busted this. -Ossama
1148 if test "$prev" = dlprefiles; then
1149 # Preload the old-style object.
1150 dlprefiles="$dlprefiles $pic_object"
1155 libobjs="$libobjs $pic_object"
1160 if test "$non_pic_object" != none; then
1161 # Prepend the subdirectory the object is found in.
1162 non_pic_object="$xdir$non_pic_object"
1164 # A standard non-PIC object
1165 non_pic_objects="$non_pic_objects $non_pic_object"
1166 if test -z "$pic_object" || test "$pic_object" = none ; then
1167 arg="$non_pic_object"
1171 # Only an error if not doing a dry-run.
1172 if test -z "$run"; then
1173 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1178 # Extract subdirectory from the argument.
1179 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1180 if test "X$xdir" = "X$arg"; then
1186 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1187 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1188 libobjs="$libobjs $pic_object"
1189 non_pic_objects="$non_pic_objects $non_pic_object"
1194 $echo "$modename: link input file \`$save_arg' does not exist"
1202 # We need an absolute path.
1204 [\\/]* | [A-Za-z]:[\\/]*) ;;
1206 $echo "$modename: only absolute run-paths are allowed" 1>&2
1210 if test "$prev" = rpath; then
1213 *) rpath="$rpath $arg" ;;
1218 *) xrpath="$xrpath $arg" ;;
1225 compiler_flags="$compiler_flags $qarg"
1227 compile_command="$compile_command $qarg"
1228 finalize_command="$finalize_command $qarg"
1232 linker_flags="$linker_flags $qarg"
1233 compiler_flags="$compiler_flags $wl$qarg"
1235 compile_command="$compile_command $wl$qarg"
1236 finalize_command="$finalize_command $wl$qarg"
1240 linker_flags="$linker_flags $qarg"
1241 compiler_flags="$compiler_flags $qarg"
1243 compile_command="$compile_command $qarg"
1244 finalize_command="$finalize_command $qarg"
1248 eval "$prev=\"\$arg\""
1253 fi # test -n "$prev"
1259 if test -n "$link_static_flag"; then
1260 compile_command="$compile_command $link_static_flag"
1261 finalize_command="$finalize_command $link_static_flag"
1267 # FIXME: remove this flag sometime in the future.
1268 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1292 -export-symbols | -export-symbols-regex)
1293 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1294 $echo "$modename: more than one -exported-symbols argument is not allowed"
1297 if test "X$arg" = "X-export-symbols"; then
1310 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1311 # so, if we see these flags be careful not to treat them like -L
1313 case $with_gcc/$host in
1314 no/*-*-irix* | /*-*-irix*)
1315 compile_command="$compile_command $arg"
1316 finalize_command="$finalize_command $arg"
1323 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1324 # We need an absolute path.
1326 [\\/]* | [A-Za-z]:[\\/]*) ;;
1328 absdir=`cd "$dir" && pwd`
1329 if test -z "$absdir"; then
1330 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1339 deplibs="$deplibs -L$dir"
1340 lib_search_path="$lib_search_path $dir"
1344 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1345 case :$dllsearchpath: in
1347 *) dllsearchpath="$dllsearchpath:$dir";;
1355 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1357 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1358 # These systems don't actually have a C or math library (as such)
1361 *-*-mingw* | *-*-os2*)
1362 # These systems don't actually have a C library (as such)
1363 test "X$arg" = "X-lc" && continue
1365 *-*-openbsd* | *-*-freebsd*)
1366 # Do not include libc due to us having libc/libc_r.
1367 test "X$arg" = "X-lc" && continue
1369 *-*-rhapsody* | *-*-darwin1.[012])
1370 # Rhapsody C and math libraries are in the System framework
1371 deplibs="$deplibs -framework System"
1374 elif test "X$arg" = "X-lc_r"; then
1376 *-*-openbsd* | *-*-freebsd*)
1377 # Do not include libc_r directly, use -pthread flag.
1382 deplibs="$deplibs $arg"
1386 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1387 deplibs="$deplibs $arg"
1396 # gcc -m* arguments should be passed to the linker via $compiler_flags
1397 # in order to pass architecture information to the linker
1398 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1399 # but this is not reliable with gcc because gcc may use -mfoo to
1400 # select a different linker, different libraries, etc, while
1401 # -Wl,-mfoo simply passes -mfoo to the linker.
1403 # Unknown arguments in both finalize_command and compile_command need
1404 # to be aesthetically quoted because they are evaled later.
1405 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1407 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1411 compile_command="$compile_command $arg"
1412 finalize_command="$finalize_command $arg"
1413 if test "$with_gcc" = "yes" ; then
1414 compiler_flags="$compiler_flags $arg"
1431 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1432 # The PATH hackery in wrapper scripts is required on Windows
1433 # in order for the loader to find any dlls it needs.
1434 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1435 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1438 *) no_install=yes ;;
1455 -precious-files-regex)
1476 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1477 # We need an absolute path.
1479 [\\/]* | [A-Za-z]:[\\/]*) ;;
1481 $echo "$modename: only absolute run-paths are allowed" 1>&2
1487 *) xrpath="$xrpath $dir" ;;
1493 # The effects of -static are defined in a previous loop.
1494 # We used to do the same as -all-static on platforms that
1495 # didn't have a PIC flag, but the assumption that the effects
1496 # would be equivalent was wrong. It would break on at least
1497 # Digital Unix and AIX.
1517 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1519 save_ifs="$IFS"; IFS=','
1520 for flag in $args; do
1523 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1528 compiler_flags="$compiler_flags $flag"
1531 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1535 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1537 save_ifs="$IFS"; IFS=','
1538 for flag in $args; do
1541 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1546 compiler_flags="$compiler_flags $wl$flag"
1547 linker_flags="$linker_flags $flag"
1550 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1568 -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread )
1569 compiler_flags="$compiler_flags $arg"
1573 # Some other compiler flag.
1575 # Unknown arguments in both finalize_command and compile_command need
1576 # to be aesthetically quoted because they are evaled later.
1577 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1579 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1586 # A standard object.
1591 # A libtool-controlled object.
1593 # Check to see that this really is a libtool object.
1594 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1599 # If there is no directory component, then add one.
1601 */* | *\\*) . $arg ;;
1605 if test -z "$pic_object" || \
1606 test -z "$non_pic_object" ||
1607 test "$pic_object" = none && \
1608 test "$non_pic_object" = none; then
1609 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1613 # Extract subdirectory from the argument.
1614 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1615 if test "X$xdir" = "X$arg"; then
1621 if test "$pic_object" != none; then
1622 # Prepend the subdirectory the object is found in.
1623 pic_object="$xdir$pic_object"
1625 if test "$prev" = dlfiles; then
1626 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1627 dlfiles="$dlfiles $pic_object"
1631 # If libtool objects are unsupported, then we need to preload.
1636 # CHECK ME: I think I busted this. -Ossama
1637 if test "$prev" = dlprefiles; then
1638 # Preload the old-style object.
1639 dlprefiles="$dlprefiles $pic_object"
1644 libobjs="$libobjs $pic_object"
1649 if test "$non_pic_object" != none; then
1650 # Prepend the subdirectory the object is found in.
1651 non_pic_object="$xdir$non_pic_object"
1653 # A standard non-PIC object
1654 non_pic_objects="$non_pic_objects $non_pic_object"
1655 if test -z "$pic_object" || test "$pic_object" = none ; then
1656 arg="$non_pic_object"
1660 # Only an error if not doing a dry-run.
1661 if test -z "$run"; then
1662 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1667 # Extract subdirectory from the argument.
1668 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1669 if test "X$xdir" = "X$arg"; then
1675 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1676 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1677 libobjs="$libobjs $pic_object"
1678 non_pic_objects="$non_pic_objects $non_pic_object"
1685 deplibs="$deplibs $arg"
1686 old_deplibs="$old_deplibs $arg"
1691 # A libtool-controlled library.
1693 if test "$prev" = dlfiles; then
1694 # This library was specified with -dlopen.
1695 dlfiles="$dlfiles $arg"
1697 elif test "$prev" = dlprefiles; then
1698 # The library was specified with -dlpreopen.
1699 dlprefiles="$dlprefiles $arg"
1702 deplibs="$deplibs $arg"
1707 # Some other compiler argument.
1709 # Unknown arguments in both finalize_command and compile_command need
1710 # to be aesthetically quoted because they are evaled later.
1711 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1713 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1720 # Now actually substitute the argument into the commands.
1721 if test -n "$arg"; then
1722 compile_command="$compile_command $arg"
1723 finalize_command="$finalize_command $arg"
1725 done # argument parsing loop
1727 if test -n "$prev"; then
1728 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1733 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1734 eval arg=\"$export_dynamic_flag_spec\"
1735 compile_command="$compile_command $arg"
1736 finalize_command="$finalize_command $arg"
1740 # calculate the name of the file, without its directory
1741 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1742 libobjs_save="$libobjs"
1744 if test -n "$shlibpath_var"; then
1745 # get the directories listed in $shlibpath_var
1746 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1750 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1751 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1753 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1754 if test "X$output_objdir" = "X$output"; then
1755 output_objdir="$objdir"
1757 output_objdir="$output_objdir/$objdir"
1759 # Create the object directory.
1760 if test ! -d "$output_objdir"; then
1761 $show "$mkdir $output_objdir"
1762 $run $mkdir $output_objdir
1764 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1769 # Determine the type of output
1772 $echo "$modename: you must specify an output file" 1>&2
1776 *.$libext) linkmode=oldlib ;;
1777 *.lo | *.$objext) linkmode=obj ;;
1778 *.la) linkmode=lib ;;
1779 *) linkmode=prog ;; # Anything else should be a program.
1783 *cygwin* | *mingw* | *pw32*)
1784 # don't eliminate duplcations in $postdeps and $predeps
1785 duplicate_compiler_generated_deps=yes
1788 duplicate_compiler_generated_deps=$duplicate_deps
1794 # Find all interdependent deplibs by searching for libraries
1795 # that are linked more than once (e.g. -la -lb -la)
1796 for deplib in $deplibs; do
1797 if test "X$duplicate_deps" = "Xyes" ; then
1799 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1802 libs="$libs $deplib"
1805 if test "$linkmode" = lib; then
1806 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1808 # Compute libraries that are listed more than once in $predeps
1809 # $postdeps and mark them as special (i.e., whose duplicates are
1810 # not to be eliminated).
1812 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1813 for pre_post_dep in $predeps $postdeps; do
1814 case "$pre_post_deps " in
1815 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1817 pre_post_deps="$pre_post_deps $pre_post_dep"
1826 need_relink=no # whether we're linking any uninstalled libtool libraries
1827 notinst_deplibs= # not-installed libtool libraries
1828 notinst_path= # paths that contain not-installed libtool libraries
1832 for file in $dlfiles $dlprefiles; do
1836 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1848 passes="conv scan dlopen dlpreopen link"
1853 for pass in $passes; do
1854 if test "$linkmode,$pass" = "lib,link" ||
1855 test "$linkmode,$pass" = "prog,scan"; then
1859 if test "$linkmode" = prog; then
1861 dlopen) libs="$dlfiles" ;;
1862 dlpreopen) libs="$dlprefiles" ;;
1863 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1866 if test "$pass" = dlopen; then
1867 # Collect dlpreopened libraries
1868 save_deplibs="$deplibs"
1871 for deplib in $libs; do
1875 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1876 if test "$linkmode,$pass" = "prog,link"; then
1877 compile_deplibs="$deplib $compile_deplibs"
1878 finalize_deplibs="$deplib $finalize_deplibs"
1880 deplibs="$deplib $deplibs"
1885 if test "$linkmode" != lib && test "$linkmode" != prog; then
1886 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1889 if test "$pass" = conv; then
1890 deplibs="$deplib $deplibs"
1893 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1894 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1895 for search_ext in .la $shrext .so .a; do
1896 # Search the libtool library
1897 lib="$searchdir/lib${name}${search_ext}"
1898 if test -f "$lib"; then
1899 if test "$search_ext" = ".la"; then
1908 if test "$found" != yes; then
1909 # deplib doesn't seem to be a libtool library
1910 if test "$linkmode,$pass" = "prog,link"; then
1911 compile_deplibs="$deplib $compile_deplibs"
1912 finalize_deplibs="$deplib $finalize_deplibs"
1914 deplibs="$deplib $deplibs"
1915 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1918 else # deplib is a libtool library
1919 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1920 # We need to do some special things here, and not later.
1921 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1922 case " $predeps $postdeps " in
1924 if (${SED} -e '2q' $lib |
1925 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1929 */* | *\\*) . $lib ;;
1932 for l in $old_library $library_names; do
1935 if test "X$ll" = "X$old_library" ; then # only static version available
1937 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1938 test "X$ladir" = "X$lib" && ladir="."
1939 lib=$ladir/$old_library
1940 if test "$linkmode,$pass" = "prog,link"; then
1941 compile_deplibs="$deplib $compile_deplibs"
1942 finalize_deplibs="$deplib $finalize_deplibs"
1944 deplibs="$deplib $deplibs"
1945 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1959 deplibs="$deplib $deplibs"
1960 test "$pass" = conv && continue
1961 newdependency_libs="$deplib $newdependency_libs"
1962 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1965 if test "$pass" = conv; then
1966 deplibs="$deplib $deplibs"
1969 if test "$pass" = scan; then
1970 deplibs="$deplib $deplibs"
1971 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1973 compile_deplibs="$deplib $compile_deplibs"
1974 finalize_deplibs="$deplib $finalize_deplibs"
1978 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1984 if test "$pass" = link; then
1985 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1986 # Make sure the xrpath contains only unique directories.
1989 *) xrpath="$xrpath $dir" ;;
1992 deplibs="$deplib $deplibs"
1995 *.la) lib="$deplib" ;;
1997 if test "$pass" = conv; then
1998 deplibs="$deplib $deplibs"
2003 if test "$deplibs_check_method" != pass_all; then
2005 $echo "*** Warning: Trying to link with static lib archive $deplib."
2006 $echo "*** I have the capability to make that library automatically link in when"
2007 $echo "*** you link to this library. But I can only do this if you have a"
2008 $echo "*** shared version of the library, which you do not appear to have"
2009 $echo "*** because the file extensions .$libext of this argument makes me believe"
2010 $echo "*** that it is just a static archive that I should not used here."
2013 $echo "*** Warning: Linking the shared library $output against the"
2014 $echo "*** static library $deplib is not portable!"
2015 deplibs="$deplib $deplibs"
2020 if test "$pass" != link; then
2021 deplibs="$deplib $deplibs"
2023 compile_deplibs="$deplib $compile_deplibs"
2024 finalize_deplibs="$deplib $finalize_deplibs"
2031 if test "$pass" = conv; then
2032 deplibs="$deplib $deplibs"
2033 elif test "$linkmode" = prog; then
2034 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2035 # If there is no dlopen support or we're linking statically,
2036 # we need to preload.
2037 newdlprefiles="$newdlprefiles $deplib"
2038 compile_deplibs="$deplib $compile_deplibs"
2039 finalize_deplibs="$deplib $finalize_deplibs"
2041 newdlfiles="$newdlfiles $deplib"
2051 if test "$found" = yes || test -f "$lib"; then :
2053 $echo "$modename: cannot find the library \`$lib'" 1>&2
2057 # Check to see that this really is a libtool archive.
2058 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2060 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2064 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2065 test "X$ladir" = "X$lib" && ladir="."
2073 # If the library was installed with an old release of libtool,
2074 # it will not redefine variables installed, or shouldnotlink
2080 */* | *\\*) . $lib ;;
2084 if test "$linkmode,$pass" = "lib,link" ||
2085 test "$linkmode,$pass" = "prog,scan" ||
2086 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2087 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2088 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2091 if test "$pass" = conv; then
2092 # Only check for convenience libraries
2093 deplibs="$lib $deplibs"
2094 if test -z "$libdir"; then
2095 if test -z "$old_library"; then
2096 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2099 # It is a libtool convenience library, so add in its objects.
2100 convenience="$convenience $ladir/$objdir/$old_library"
2101 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2103 for deplib in $dependency_libs; do
2104 deplibs="$deplib $deplibs"
2105 if test "X$duplicate_deps" = "Xyes" ; then
2106 case "$tmp_libs " in
2107 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2110 tmp_libs="$tmp_libs $deplib"
2112 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2113 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2120 # Get the name of the library we link against.
2122 for l in $old_library $library_names; do
2125 if test -z "$linklib"; then
2126 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2130 # This library was specified with -dlopen.
2131 if test "$pass" = dlopen; then
2132 if test -z "$libdir"; then
2133 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2136 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2137 # If there is no dlname, no dlopen support or we're linking
2138 # statically, we need to preload. We also need to preload any
2139 # dependent libraries so libltdl's deplib preloader doesn't
2140 # bomb out in the load deplibs phase.
2141 dlprefiles="$dlprefiles $lib $dependency_libs"
2143 newdlfiles="$newdlfiles $lib"
2148 # We need an absolute path.
2150 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2152 abs_ladir=`cd "$ladir" && pwd`
2153 if test -z "$abs_ladir"; then
2154 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2155 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2160 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2162 # Find the relevant object directory and library name.
2163 if test "X$installed" = Xyes; then
2164 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2165 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2174 dir="$ladir/$objdir"
2175 absdir="$abs_ladir/$objdir"
2176 # Remove this search path later
2177 notinst_path="$notinst_path $abs_ladir"
2178 fi # $installed = yes
2179 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2181 # This library was specified with -dlpreopen.
2182 if test "$pass" = dlpreopen; then
2183 if test -z "$libdir"; then
2184 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2187 # Prefer using a static library (so that no silly _DYNAMIC symbols
2188 # are required to link).
2189 if test -n "$old_library"; then
2190 newdlprefiles="$newdlprefiles $dir/$old_library"
2191 # Otherwise, use the dlname, so that lt_dlopen finds it.
2192 elif test -n "$dlname"; then
2193 newdlprefiles="$newdlprefiles $dir/$dlname"
2195 newdlprefiles="$newdlprefiles $dir/$linklib"
2197 fi # $pass = dlpreopen
2199 if test -z "$libdir"; then
2200 # Link the convenience library
2201 if test "$linkmode" = lib; then
2202 deplibs="$dir/$old_library $deplibs"
2203 elif test "$linkmode,$pass" = "prog,link"; then
2204 compile_deplibs="$dir/$old_library $compile_deplibs"
2205 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2207 deplibs="$lib $deplibs" # used for prog,scan pass
2213 if test "$linkmode" = prog && test "$pass" != link; then
2214 newlib_search_path="$newlib_search_path $ladir"
2215 deplibs="$lib $deplibs"
2218 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2219 test "$build_libtool_libs" = no; then
2224 for deplib in $dependency_libs; do
2226 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2228 # Need to link against all dependency_libs?
2229 if test "$linkalldeplibs" = yes; then
2230 deplibs="$deplib $deplibs"
2232 # Need to hardcode shared library paths
2233 # or/and link against static libraries
2234 newdependency_libs="$deplib $newdependency_libs"
2236 if test "X$duplicate_deps" = "Xyes" ; then
2237 case "$tmp_libs " in
2238 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2241 tmp_libs="$tmp_libs $deplib"
2244 fi # $linkmode = prog...
2246 if test "$linkmode,$pass" = "prog,link"; then
2247 if test -n "$library_names" &&
2248 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2249 # We need to hardcode the library path
2250 if test -n "$shlibpath_var"; then
2251 # Make sure the rpath contains only unique directories.
2252 case "$temp_rpath " in
2255 *) temp_rpath="$temp_rpath $dir" ;;
2259 # Hardcode the library path.
2260 # Skip directories that are in the system default run-time
2262 case " $sys_lib_dlsearch_path " in
2265 case "$compile_rpath " in
2267 *) compile_rpath="$compile_rpath $absdir"
2271 case " $sys_lib_dlsearch_path " in
2274 case "$finalize_rpath " in
2276 *) finalize_rpath="$finalize_rpath $libdir"
2280 fi # $linkmode,$pass = prog,link...
2282 if test "$alldeplibs" = yes &&
2283 { test "$deplibs_check_method" = pass_all ||
2284 { test "$build_libtool_libs" = yes &&
2285 test -n "$library_names"; }; }; then
2286 # We only need to search for static libraries
2291 link_static=no # Whether the deplib will be linked statically
2292 if test -n "$library_names" &&
2293 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2294 if test "$installed" = no; then
2295 notinst_deplibs="$notinst_deplibs $lib"
2298 # This is a shared library
2300 # Warn about portability, can't link against -module's on some systems (darwin)
2301 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2303 if test "$linkmode" = prog; then
2304 $echo "*** Warning: Linking the executable $output against the loadable module"
2306 $echo "*** Warning: Linking the shared library $output against the loadable module"
2308 $echo "*** $linklib is not portable!"
2310 if test "$linkmode" = lib &&
2311 test "$hardcode_into_libs" = yes; then
2312 # Hardcode the library path.
2313 # Skip directories that are in the system default run-time
2315 case " $sys_lib_dlsearch_path " in
2318 case "$compile_rpath " in
2320 *) compile_rpath="$compile_rpath $absdir"
2324 case " $sys_lib_dlsearch_path " in
2327 case "$finalize_rpath " in
2329 *) finalize_rpath="$finalize_rpath $libdir"
2335 if test -n "$old_archive_from_expsyms_cmds"; then
2336 # figure out the soname
2337 set dummy $library_names
2340 libname=`eval \\$echo \"$libname_spec\"`
2341 # use dlname if we got it. it's perfectly good, no?
2342 if test -n "$dlname"; then
2344 elif test -n "$soname_spec"; then
2348 major=`expr $current - $age`
2352 eval soname=\"$soname_spec\"
2357 # Make a new name for the extract_expsyms_cmds to use
2359 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2360 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2362 # If the library has no export list, then create one now
2363 if test -f "$output_objdir/$soname-def"; then :
2365 $show "extracting exported symbol list from \`$soname'"
2366 save_ifs="$IFS"; IFS='~'
2367 cmds=$extract_expsyms_cmds
2368 for cmd in $cmds; do
2372 $run eval "$cmd" || exit $?
2378 if test -f "$output_objdir/$newlib"; then :; else
2379 $show "generating import library for \`$soname'"
2380 save_ifs="$IFS"; IFS='~'
2381 cmds=$old_archive_from_expsyms_cmds
2382 for cmd in $cmds; do
2386 $run eval "$cmd" || exit $?
2390 # make sure the library variables are pointing to the new library
2393 fi # test -n "$old_archive_from_expsyms_cmds"
2395 if test "$linkmode" = prog || test "$mode" != relink; then
2400 case $hardcode_action in
2401 immediate | unsupported)
2402 if test "$hardcode_direct" = no; then
2405 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2407 # if the lib is a module then we can not link against it, someone
2408 # is ignoring the new warnings I added
2409 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2410 $echo "** Warning, lib $linklib is a module, not a shared library"
2411 if test -z "$old_library" ; then
2413 $echo "** And there doesn't seem to be a static archive available"
2414 $echo "** The link will probably fail, sorry"
2416 add="$dir/$old_library"
2420 elif test "$hardcode_minus_L" = no; then
2422 *-*-sunos*) add_shlibpath="$dir" ;;
2426 elif test "$hardcode_shlibpath_var" = no; then
2427 add_shlibpath="$dir"
2434 if test "$hardcode_direct" = yes; then
2436 elif test "$hardcode_minus_L" = yes; then
2438 # Try looking first in the location we're being installed to.
2439 if test -n "$inst_prefix_dir"; then
2442 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2447 elif test "$hardcode_shlibpath_var" = yes; then
2448 add_shlibpath="$dir"
2457 if test "$lib_linked" != yes; then
2458 $echo "$modename: configuration error: unsupported hardcode properties"
2462 if test -n "$add_shlibpath"; then
2463 case :$compile_shlibpath: in
2464 *":$add_shlibpath:"*) ;;
2465 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2468 if test "$linkmode" = prog; then
2469 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2470 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2472 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2473 test -n "$add" && deplibs="$add $deplibs"
2474 if test "$hardcode_direct" != yes && \
2475 test "$hardcode_minus_L" != yes && \
2476 test "$hardcode_shlibpath_var" = yes; then
2477 case :$finalize_shlibpath: in
2479 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2485 if test "$linkmode" = prog || test "$mode" = relink; then
2489 # Finalize command for both is simple: just hardcode it.
2490 if test "$hardcode_direct" = yes; then
2491 add="$libdir/$linklib"
2492 elif test "$hardcode_minus_L" = yes; then
2495 elif test "$hardcode_shlibpath_var" = yes; then
2496 case :$finalize_shlibpath: in
2498 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2501 elif test "$hardcode_automatic" = yes; then
2502 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2503 add="$inst_prefix_dir$libdir/$linklib"
2505 add="$libdir/$linklib"
2508 # We cannot seem to hardcode it, guess we'll fake it.
2510 # Try looking first in the location we're being installed to.
2511 if test -n "$inst_prefix_dir"; then
2514 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2521 if test "$linkmode" = prog; then
2522 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2523 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2525 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2526 test -n "$add" && deplibs="$add $deplibs"
2529 elif test "$linkmode" = prog; then
2530 # Here we assume that one of hardcode_direct or hardcode_minus_L
2531 # is not unsupported. This is valid on all known static and
2533 if test "$hardcode_direct" != unsupported; then
2534 test -n "$old_library" && linklib="$old_library"
2535 compile_deplibs="$dir/$linklib $compile_deplibs"
2536 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2538 compile_deplibs="-l$name -L$dir $compile_deplibs"
2539 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2541 elif test "$build_libtool_libs" = yes; then
2542 # Not a shared library
2543 if test "$deplibs_check_method" != pass_all; then
2544 # We're trying link a shared library against a static one
2545 # but the system doesn't support it.
2547 # Just print a warning and add the library to dependency_libs so
2548 # that the program can be linked against the static library.
2550 $echo "*** Warning: This system can not link to static lib archive $lib."
2551 $echo "*** I have the capability to make that library automatically link in when"
2552 $echo "*** you link to this library. But I can only do this if you have a"
2553 $echo "*** shared version of the library, which you do not appear to have."
2554 if test "$module" = yes; then
2555 $echo "*** But as you try to build a module library, libtool will still create "
2556 $echo "*** a static module, that should work as long as the dlopening application"
2557 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2558 if test -z "$global_symbol_pipe"; then
2560 $echo "*** However, this would only work if libtool was able to extract symbol"
2561 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2562 $echo "*** not find such a program. So, this module is probably useless."
2563 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2565 if test "$build_old_libs" = no; then
2566 build_libtool_libs=module
2569 build_libtool_libs=no
2573 convenience="$convenience $dir/$old_library"
2574 old_convenience="$old_convenience $dir/$old_library"
2575 deplibs="$dir/$old_library $deplibs"
2578 fi # link shared/static library?
2580 if test "$linkmode" = lib; then
2581 if test -n "$dependency_libs" &&
2582 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2583 test "$link_static" = yes; }; then
2584 # Extract -R from dependency_libs
2586 for libdir in $dependency_libs; do
2588 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2590 *" $temp_xrpath "*) ;;
2591 *) xrpath="$xrpath $temp_xrpath";;
2593 *) temp_deplibs="$temp_deplibs $libdir";;
2596 dependency_libs="$temp_deplibs"
2599 newlib_search_path="$newlib_search_path $absdir"
2600 # Link against this library
2601 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2602 # ... and its dependency_libs
2604 for deplib in $dependency_libs; do
2605 newdependency_libs="$deplib $newdependency_libs"
2606 if test "X$duplicate_deps" = "Xyes" ; then
2607 case "$tmp_libs " in
2608 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2611 tmp_libs="$tmp_libs $deplib"
2614 if test "$link_all_deplibs" != no; then
2615 # Add the search paths of all dependency libraries
2616 for deplib in $dependency_libs; do
2618 -L*) path="$deplib" ;;
2620 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2621 test "X$dir" = "X$deplib" && dir="."
2622 # We need an absolute path.
2624 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2626 absdir=`cd "$dir" && pwd`
2627 if test -z "$absdir"; then
2628 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2633 if grep "^installed=no" $deplib > /dev/null; then
2634 path="$absdir/$objdir"
2636 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2637 if test -z "$libdir"; then
2638 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2641 if test "$absdir" != "$libdir"; then
2642 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2649 # we do not want to link against static libs, but need to link against shared
2650 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2651 if test -n "$deplibrary_names" ; then
2652 for tmp in $deplibrary_names ; do
2655 if test -f "$path/$depdepl" ; then
2656 depdepl="$path/$depdepl"
2658 # do not add paths which are already there
2659 case " $newlib_search_path " in
2661 *) newlib_search_path="$newlib_search_path $path";;
2675 # Again, we only want to link against shared libraries
2676 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2677 for tmp in $newlib_search_path ; do
2678 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2679 eval depdepl="$tmp/lib$tmp_libs.dylib"
2690 case " $deplibs " in
2692 *) deplibs="$deplibs $depdepl" ;;
2694 case " $deplibs " in
2696 *) deplibs="$deplibs $path" ;;
2699 fi # link_all_deplibs != no
2701 done # for deplib in $libs
2702 dependency_libs="$newdependency_libs"
2703 if test "$pass" = dlpreopen; then
2704 # Link the dlpreopened libraries before other libraries
2705 for deplib in $save_deplibs; do
2706 deplibs="$deplib $deplibs"
2709 if test "$pass" != dlopen; then
2710 if test "$pass" != conv; then
2711 # Make sure lib_search_path contains only unique directories.
2713 for dir in $newlib_search_path; do
2714 case "$lib_search_path " in
2716 *) lib_search_path="$lib_search_path $dir" ;;
2722 if test "$linkmode,$pass" != "prog,link"; then
2725 vars="compile_deplibs finalize_deplibs"
2727 for var in $vars dependency_libs; do
2728 # Add libraries to $var in reverse order
2729 eval tmp_libs=\"\$$var\"
2731 for deplib in $tmp_libs; do
2732 # FIXME: Pedantically, this is the right thing to do, so
2733 # that some nasty dependency loop isn't accidentally
2735 #new_libs="$deplib $new_libs"
2736 # Pragmatically, this seems to cause very few problems in
2739 -L*) new_libs="$deplib $new_libs" ;;
2742 # And here is the reason: when a library appears more
2743 # than once as an explicit dependence of a library, or
2744 # is implicitly linked in more than once by the
2745 # compiler, it is considered special, and multiple
2746 # occurrences thereof are not removed. Compare this
2747 # with having the same library being listed as a
2748 # dependency of multiple other libraries: in this case,
2749 # we know (pedantically, we assume) the library does not
2750 # need to be listed more than once, so we keep only the
2751 # last copy. This is not always right, but it is rare
2752 # enough that we require users that really mean to play
2753 # such unportable linking tricks to link the library
2754 # using -Wl,-lname, so that libtool does not consider it
2755 # for duplicate removal.
2756 case " $specialdeplibs " in
2757 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2759 case " $new_libs " in
2761 *) new_libs="$deplib $new_libs" ;;
2769 for deplib in $new_libs; do
2772 case " $tmp_libs " in
2774 *) tmp_libs="$tmp_libs $deplib" ;;
2777 *) tmp_libs="$tmp_libs $deplib" ;;
2780 eval $var=\"$tmp_libs\"
2783 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2785 for i in $dependency_libs ; do
2786 case " $predeps $postdeps $compiler_lib_search_path " in
2791 if test -n "$i" ; then
2792 tmp_libs="$tmp_libs $i"
2795 dependency_libs=$tmp_libs
2797 if test "$linkmode" = prog; then
2798 dlfiles="$newdlfiles"
2799 dlprefiles="$newdlprefiles"
2804 if test -n "$deplibs"; then
2805 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2808 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2809 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2812 if test -n "$rpath"; then
2813 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2816 if test -n "$xrpath"; then
2817 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2820 if test -n "$vinfo"; then
2821 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2824 if test -n "$release"; then
2825 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2828 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2829 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2832 # Now set the variables for building old libraries.
2833 build_libtool_libs=no
2835 objs="$objs$old_deplibs"
2839 # Make sure we only generate libraries of the form `libNAME.la'.
2842 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2843 eval shared_ext=\"$shrext\"
2844 eval libname=\"$libname_spec\"
2847 if test "$module" = no; then
2848 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2852 if test "$need_lib_prefix" != no; then
2853 # Add the "lib" prefix for modules if required
2854 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2855 eval shared_ext=\"$shrext\"
2856 eval libname=\"$libname_spec\"
2858 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2863 if test -n "$objs"; then
2864 if test "$deplibs_check_method" != pass_all; then
2865 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2869 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2870 $echo "*** objects $objs is not portable!"
2871 libobjs="$libobjs $objs"
2875 if test "$dlself" != no; then
2876 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2880 if test "$#" -gt 2; then
2881 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2886 if test -z "$rpath"; then
2887 if test "$build_libtool_libs" = yes; then
2888 # Building a libtool convenience library.
2889 # Some compilers have problems with a `.al' extension so
2890 # convenience libraries should have the same extension an
2891 # archive normally would.
2892 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2893 build_libtool_libs=convenience
2897 if test -n "$vinfo"; then
2898 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2901 if test -n "$release"; then
2902 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2906 # Parse the version information argument.
2907 save_ifs="$IFS"; IFS=':'
2908 set dummy $vinfo 0 0 0
2911 if test -n "$8"; then
2912 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2917 # convert absolute version numbers to libtool ages
2918 # this retains compatibility with .la files and attempts
2919 # to make the code below a bit more comprehensible
2921 case $vinfo_number in
2925 number_revision="$4"
2927 # There are really only two kinds -- those that
2928 # use the current revision as the major version
2929 # and those that subtract age and use age as
2930 # a minor version. But, then there is irix
2931 # which has an extra 1 added just for fun
2933 case $version_type in
2934 darwin|linux|osf|windows)
2935 current=`expr $number_major + $number_minor`
2937 revision="$number_revision"
2939 freebsd-aout|freebsd-elf|sunos)
2940 current="$number_major"
2941 revision="$number_minor"
2945 current=`expr $number_major + $number_minor - 1`
2947 revision="$number_minor"
2958 # Check that each of the things are valid numbers.
2962 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2963 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2971 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2972 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2980 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2981 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2986 if test "$age" -gt "$current"; then
2987 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2988 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2992 # Calculate the version variables.
2996 case $version_type in
3000 # Like Linux, but with the current version available in
3001 # verstring for coding it into the library header
3002 major=.`expr $current - $age`
3003 versuffix="$major.$age.$revision"
3004 # Darwin ld doesn't like 0 for these options...
3005 minor_current=`expr $current + 1`
3006 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3011 versuffix=".$current.$revision";
3016 versuffix=".$current";
3020 major=`expr $current - $age + 1`
3022 case $version_type in
3023 nonstopux) verstring_prefix=nonstopux ;;
3024 *) verstring_prefix=sgi ;;
3026 verstring="$verstring_prefix$major.$revision"
3028 # Add in all the interfaces that we are compatible with.
3030 while test "$loop" -ne 0; do
3031 iface=`expr $revision - $loop`
3032 loop=`expr $loop - 1`
3033 verstring="$verstring_prefix$major.$iface:$verstring"
3036 # Before this point, $major must not contain `.'.
3038 versuffix="$major.$revision"
3042 major=.`expr $current - $age`
3043 versuffix="$major.$age.$revision"
3047 major=.`expr $current - $age`
3048 versuffix=".$current.$age.$revision"
3049 verstring="$current.$age.$revision"
3051 # Add in all the interfaces that we are compatible with.
3053 while test "$loop" -ne 0; do
3054 iface=`expr $current - $loop`
3055 loop=`expr $loop - 1`
3056 verstring="$verstring:${iface}.0"
3059 # Make executables depend on our current version.
3060 verstring="$verstring:${current}.0"
3065 versuffix=".$current.$revision"
3069 # Use '-' rather than '.', since we only want one
3070 # extension on DOS 8.3 filesystems.
3071 major=`expr $current - $age`
3076 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3077 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3082 # Clear the version info if we defaulted, and they specified a release.
3083 if test -z "$vinfo" && test -n "$release"; then
3085 case $version_type in
3087 # we can't check for "0.0" in archive_cmds due to quoting
3088 # problems, so we reset it completely
3095 if test "$need_version" = no; then
3102 # Remove version info from name if versioning should be avoided
3103 if test "$avoid_version" = yes && test "$need_version" = no; then
3109 # Check to see if the archive will have undefined symbols.
3110 if test "$allow_undefined" = yes; then
3111 if test "$allow_undefined_flag" = unsupported; then
3112 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3113 build_libtool_libs=no
3117 # Don't allow undefined symbols.
3118 allow_undefined_flag="$no_undefined_flag"
3122 if test "$mode" != relink; then
3123 # Remove our outputs, but don't remove object files since they
3124 # may have been created when compiling PIC objects.
3126 tempremovelist=`$echo "$output_objdir/*"`
3127 for p in $tempremovelist; do
3131 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3132 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3136 removelist="$removelist $p"
3141 if test -n "$removelist"; then
3142 $show "${rm}r $removelist"
3143 $run ${rm}r $removelist
3147 # Now set the variables for building old libraries.
3148 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3149 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3151 # Transform .lo files to .o files.
3152 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3155 # Eliminate all temporary directories.
3156 for path in $notinst_path; do
3157 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3158 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3159 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3162 if test -n "$xrpath"; then
3163 # If the user specified any rpath flags, then add them.
3165 for libdir in $xrpath; do
3166 temp_xrpath="$temp_xrpath -R$libdir"
3167 case "$finalize_rpath " in
3169 *) finalize_rpath="$finalize_rpath $libdir" ;;
3172 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3173 dependency_libs="$temp_xrpath $dependency_libs"
3177 # Make sure dlfiles contains only unique files that won't be dlpreopened
3178 old_dlfiles="$dlfiles"
3180 for lib in $old_dlfiles; do
3181 case " $dlprefiles $dlfiles " in
3183 *) dlfiles="$dlfiles $lib" ;;
3187 # Make sure dlprefiles contains only unique files
3188 old_dlprefiles="$dlprefiles"
3190 for lib in $old_dlprefiles; do
3191 case "$dlprefiles " in
3193 *) dlprefiles="$dlprefiles $lib" ;;
3197 if test "$build_libtool_libs" = yes; then
3198 if test -n "$rpath"; then
3200 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3201 # these systems don't actually have a c library (as such)!
3203 *-*-rhapsody* | *-*-darwin1.[012])
3204 # Rhapsody C library is in the System framework
3205 deplibs="$deplibs -framework System"
3208 # Don't link with libc until the a.out ld.so is fixed.
3210 *-*-openbsd* | *-*-freebsd*)
3211 # Do not include libc due to us having libc/libc_r.
3212 test "X$arg" = "X-lc" && continue
3215 # Add libc to deplibs on all other systems if necessary.
3216 if test "$build_libtool_need_lc" = "yes"; then
3217 deplibs="$deplibs -lc"
3223 # Transform deplibs into only deplibs that can be linked in shared.
3225 libname_save=$libname
3226 release_save=$release
3227 versuffix_save=$versuffix
3229 # I'm not sure if I'm treating the release correctly. I think
3230 # release should show up in the -l (ie -lgmp5) so we don't want to
3231 # add it in twice. Is that correct?
3237 case $deplibs_check_method in
3239 # Don't check for shared/static. Everything works.
3240 # This might be a little naive. We might want to check
3241 # whether the library exists or not. But this is on
3242 # osf3 & osf4 and I'm not really sure... Just
3243 # implementing what was already the behavior.
3247 # This code stresses the "libraries are programs" paradigm to its
3248 # limits. Maybe even breaks it. We compile a program, linking it
3249 # against the deplibs as a proxy for the library. Then we can check
3250 # whether they linked in statically or dynamically with ldd.
3252 cat > conftest.c <<EOF
3253 int main() { return 0; }
3256 $LTCC -o conftest conftest.c $deplibs
3257 if test "$?" -eq 0 ; then
3258 ldd_output=`ldd conftest`
3259 for i in $deplibs; do
3260 name="`expr $i : '-l\(.*\)'`"
3261 # If $name is empty we are operating on a -L argument.
3262 if test "$name" != "" && test "$name" -ne "0"; then
3263 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3264 case " $predeps $postdeps " in
3266 newdeplibs="$newdeplibs $i"
3271 if test -n "$i" ; then
3272 libname=`eval \\$echo \"$libname_spec\"`
3273 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3274 set dummy $deplib_matches
3276 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3277 newdeplibs="$newdeplibs $i"
3281 $echo "*** Warning: dynamic linker does not accept needed library $i."
3282 $echo "*** I have the capability to make that library automatically link in when"
3283 $echo "*** you link to this library. But I can only do this if you have a"
3284 $echo "*** shared version of the library, which I believe you do not have"
3285 $echo "*** because a test_compile did reveal that the linker did not use it for"
3286 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3290 newdeplibs="$newdeplibs $i"
3294 # Error occurred in the first compile. Let's try to salvage
3295 # the situation: Compile a separate program for each library.
3296 for i in $deplibs; do
3297 name="`expr $i : '-l\(.*\)'`"
3298 # If $name is empty we are operating on a -L argument.
3299 if test "$name" != "" && test "$name" != "0"; then
3301 $LTCC -o conftest conftest.c $i
3303 if test "$?" -eq 0 ; then
3304 ldd_output=`ldd conftest`
3305 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3306 case " $predeps $postdeps " in
3308 newdeplibs="$newdeplibs $i"
3313 if test -n "$i" ; then
3314 libname=`eval \\$echo \"$libname_spec\"`
3315 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3316 set dummy $deplib_matches
3318 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3319 newdeplibs="$newdeplibs $i"
3323 $echo "*** Warning: dynamic linker does not accept needed library $i."
3324 $echo "*** I have the capability to make that library automatically link in when"
3325 $echo "*** you link to this library. But I can only do this if you have a"
3326 $echo "*** shared version of the library, which you do not appear to have"
3327 $echo "*** because a test_compile did reveal that the linker did not use this one"
3328 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3334 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3335 $echo "*** make it link in! You will probably need to install it or some"
3336 $echo "*** library that it depends on before this library will be fully"
3337 $echo "*** functional. Installing it before continuing would be even better."
3340 newdeplibs="$newdeplibs $i"
3346 set dummy $deplibs_check_method
3347 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3348 for a_deplib in $deplibs; do
3349 name="`expr $a_deplib : '-l\(.*\)'`"
3350 # If $name is empty we are operating on a -L argument.
3351 if test "$name" != "" && test "$name" != "0"; then
3352 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3353 case " $predeps $postdeps " in
3355 newdeplibs="$newdeplibs $a_deplib"
3360 if test -n "$a_deplib" ; then
3361 libname=`eval \\$echo \"$libname_spec\"`
3362 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3363 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3364 for potent_lib in $potential_libs; do
3365 # Follow soft links.
3366 if ls -lLd "$potent_lib" 2>/dev/null \
3367 | grep " -> " >/dev/null; then
3370 # The statement above tries to avoid entering an
3371 # endless loop below, in case of cyclic links.
3372 # We might still enter an endless loop, since a link
3373 # loop can be closed while we follow links,
3375 potlib="$potent_lib"
3376 while test -h "$potlib" 2>/dev/null; do
3377 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3379 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3380 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3383 # It is ok to link against an archive when
3384 # building a shared library.
3385 if $AR -t $potlib > /dev/null 2>&1; then
3386 newdeplibs="$newdeplibs $a_deplib"
3390 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3392 | $EGREP "$file_magic_regex" > /dev/null; then
3393 newdeplibs="$newdeplibs $a_deplib"
3400 if test -n "$a_deplib" ; then
3403 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3404 $echo "*** I have the capability to make that library automatically link in when"
3405 $echo "*** you link to this library. But I can only do this if you have a"
3406 $echo "*** shared version of the library, which you do not appear to have"
3407 $echo "*** because I did check the linker path looking for a file starting"
3408 if test -z "$potlib" ; then
3409 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3411 $echo "*** with $libname and none of the candidates passed a file format test"
3412 $echo "*** using a file magic. Last file checked: $potlib"
3416 # Add a -L argument.
3417 newdeplibs="$newdeplibs $a_deplib"
3419 done # Gone through all deplibs.
3422 set dummy $deplibs_check_method
3423 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3424 for a_deplib in $deplibs; do
3425 name="`expr $a_deplib : '-l\(.*\)'`"
3426 # If $name is empty we are operating on a -L argument.
3427 if test -n "$name" && test "$name" != "0"; then
3428 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3429 case " $predeps $postdeps " in
3431 newdeplibs="$newdeplibs $a_deplib"
3436 if test -n "$a_deplib" ; then
3437 libname=`eval \\$echo \"$libname_spec\"`
3438 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3439 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3440 for potent_lib in $potential_libs; do
3441 potlib="$potent_lib" # see symlink-check above in file_magic test
3442 if eval $echo \"$potent_lib\" 2>/dev/null \
3444 | $EGREP "$match_pattern_regex" > /dev/null; then
3445 newdeplibs="$newdeplibs $a_deplib"
3452 if test -n "$a_deplib" ; then
3455 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3456 $echo "*** I have the capability to make that library automatically link in when"
3457 $echo "*** you link to this library. But I can only do this if you have a"
3458 $echo "*** shared version of the library, which you do not appear to have"
3459 $echo "*** because I did check the linker path looking for a file starting"
3460 if test -z "$potlib" ; then
3461 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3463 $echo "*** with $libname and none of the candidates passed a file format test"
3464 $echo "*** using a regex pattern. Last file checked: $potlib"
3468 # Add a -L argument.
3469 newdeplibs="$newdeplibs $a_deplib"
3471 done # Gone through all deplibs.
3475 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3476 -e 's/ -[LR][^ ]*//g'`
3477 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3478 for i in $predeps $postdeps ; do
3479 # can't use Xsed below, because $i might contain '/'
3480 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3483 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3484 | grep . >/dev/null; then
3486 if test "X$deplibs_check_method" = "Xnone"; then
3487 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3489 $echo "*** Warning: inter-library dependencies are not known to be supported."
3491 $echo "*** All declared inter-library dependencies are being dropped."
3496 versuffix=$versuffix_save
3498 release=$release_save
3499 libname=$libname_save
3503 *-*-rhapsody* | *-*-darwin1.[012])
3504 # On Rhapsody replace the C library is the System framework
3505 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3509 if test "$droppeddeps" = yes; then
3510 if test "$module" = yes; then
3512 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3513 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3514 $echo "*** a static module, that should work as long as the dlopening"
3515 $echo "*** application is linked with the -dlopen flag."
3516 if test -z "$global_symbol_pipe"; then
3518 $echo "*** However, this would only work if libtool was able to extract symbol"
3519 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3520 $echo "*** not find such a program. So, this module is probably useless."
3521 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3523 if test "$build_old_libs" = no; then
3524 oldlibs="$output_objdir/$libname.$libext"
3525 build_libtool_libs=module
3528 build_libtool_libs=no
3531 $echo "*** The inter-library dependencies that have been dropped here will be"
3532 $echo "*** automatically added whenever a program is linked with this library"
3533 $echo "*** or is declared to -dlopen it."
3535 if test "$allow_undefined" = no; then
3537 $echo "*** Since this library must not contain undefined symbols,"
3538 $echo "*** because either the platform does not support them or"
3539 $echo "*** it was explicitly requested with -no-undefined,"
3540 $echo "*** libtool will only create a static version of it."
3541 if test "$build_old_libs" = no; then
3542 oldlibs="$output_objdir/$libname.$libext"
3543 build_libtool_libs=module
3546 build_libtool_libs=no
3551 # Done checking deplibs!
3555 # All the library-specific variables (install_libdir is set above).
3560 # Test again, we may have decided not to build it any more
3561 if test "$build_libtool_libs" = yes; then
3562 if test "$hardcode_into_libs" = yes; then
3563 # Hardcode the library paths
3566 rpath="$finalize_rpath"
3567 test "$mode" != relink && rpath="$compile_rpath$rpath"
3568 for libdir in $rpath; do
3569 if test -n "$hardcode_libdir_flag_spec"; then
3570 if test -n "$hardcode_libdir_separator"; then
3571 if test -z "$hardcode_libdirs"; then
3572 hardcode_libdirs="$libdir"
3574 # Just accumulate the unique libdirs.
3575 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3576 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3579 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3584 eval flag=\"$hardcode_libdir_flag_spec\"
3585 dep_rpath="$dep_rpath $flag"
3587 elif test -n "$runpath_var"; then
3588 case "$perm_rpath " in
3590 *) perm_rpath="$perm_rpath $libdir" ;;
3594 # Substitute the hardcoded libdirs into the rpath.
3595 if test -n "$hardcode_libdir_separator" &&
3596 test -n "$hardcode_libdirs"; then
3597 libdir="$hardcode_libdirs"
3598 if test -n "$hardcode_libdir_flag_spec_ld"; then
3599 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3601 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3604 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3605 # We should set the runpath_var.
3607 for dir in $perm_rpath; do
3610 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3612 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3615 shlibpath="$finalize_shlibpath"
3616 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3617 if test -n "$shlibpath"; then
3618 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3621 # Get the real and link names of the library.
3622 eval shared_ext=\"$shrext\"
3623 eval library_names=\"$library_names_spec\"
3624 set dummy $library_names
3628 if test -n "$soname_spec"; then
3629 eval soname=\"$soname_spec\"
3633 if test -z "$dlname"; then
3637 lib="$output_objdir/$realname"
3640 linknames="$linknames $link"
3643 # Use standard objects if they are pic
3644 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3646 # Prepare the list of exported symbols
3647 if test -z "$export_symbols"; then
3648 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3649 $show "generating symbol list for \`$libname.la'"
3650 export_symbols="$output_objdir/$libname.exp"
3651 $run $rm $export_symbols
3652 cmds=$export_symbols_cmds
3653 save_ifs="$IFS"; IFS='~'
3654 for cmd in $cmds; do
3657 if len=`expr "X$cmd" : ".*"` &&
3658 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3660 $run eval "$cmd" || exit $?
3661 skipped_export=false
3663 # The command line is too long to execute in one step.
3664 $show "using reloadable object file for export list..."
3669 if test -n "$export_symbols_regex"; then
3670 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3671 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3672 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3673 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3678 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3679 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3683 for test_deplib in $deplibs; do
3684 case " $convenience " in
3685 *" $test_deplib "*) ;;
3687 tmp_deplibs="$tmp_deplibs $test_deplib"
3691 deplibs="$tmp_deplibs"
3693 if test -n "$convenience"; then
3694 if test -n "$whole_archive_flag_spec"; then
3695 save_libobjs=$libobjs
3696 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3698 gentop="$output_objdir/${outputname}x"
3699 $show "${rm}r $gentop"
3700 $run ${rm}r "$gentop"
3701 $show "$mkdir $gentop"
3702 $run $mkdir "$gentop"
3704 if test "$status" -ne 0 && test ! -d "$gentop"; then
3707 generated="$generated $gentop"
3709 for xlib in $convenience; do
3710 # Extract the objects.
3712 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3713 *) xabs=`pwd`"/$xlib" ;;
3715 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3716 xdir="$gentop/$xlib"
3718 $show "${rm}r $xdir"
3720 $show "$mkdir $xdir"
3723 if test "$status" -ne 0 && test ! -d "$xdir"; then
3726 # We will extract separately just the conflicting names and we will no
3727 # longer touch any unique names. It is faster to leave these extract
3728 # automatically by $AR in one run.
3729 $show "(cd $xdir && $AR x $xabs)"
3730 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3731 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3734 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3735 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3736 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3739 while test "$i" -le "$count"
3741 # Put our $i before any first dot (extension)
3742 # Never overwrite any file
3744 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3746 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3748 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3749 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3755 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3760 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3761 eval flag=\"$thread_safe_flag_spec\"
3762 linker_flags="$linker_flags $flag"
3765 # Make a backup of the uninstalled library when relinking
3766 if test "$mode" = relink; then
3767 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3770 # Do each of the archive commands.
3771 if test "$module" = yes && test -n "$module_cmds" ; then
3772 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3773 eval test_cmds=\"$module_expsym_cmds\"
3774 cmds=$module_expsym_cmds
3776 eval test_cmds=\"$module_cmds\"
3780 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3781 eval test_cmds=\"$archive_expsym_cmds\"
3782 cmds=$archive_expsym_cmds
3784 eval test_cmds=\"$archive_cmds\"
3789 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3790 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3793 # The command line is too long to link in one step, link piecewise.
3794 $echo "creating reloadable object files..."
3796 # Save the value of $output and $libobjs because we want to
3797 # use them later. If we have whole_archive_flag_spec, we
3798 # want to use save_libobjs as it was before
3799 # whole_archive_flag_spec was expanded, because we can't
3800 # assume the linker understands whole_archive_flag_spec.
3801 # This may have to be revisited, in case too many
3802 # convenience libraries get linked in and end up exceeding
3804 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3805 save_libobjs=$libobjs
3809 # Clear the reloadable object creation command queue and
3810 # initialize k to one.
3817 output=$output_objdir/$save_output-${k}.$objext
3818 # Loop over the list of objects to be linked.
3819 for obj in $save_libobjs
3821 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3822 if test "X$objlist" = X ||
3823 { len=`expr "X$test_cmds" : ".*"` &&
3824 test "$len" -le "$max_cmd_len"; }; then
3825 objlist="$objlist $obj"
3827 # The command $test_cmds is almost too long, add a
3828 # command to the queue.
3829 if test "$k" -eq 1 ; then
3830 # The first file doesn't have a previous command to add.
3831 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3833 # All subsequent reloadable object files will link in
3834 # the last one created.
3835 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3837 last_robj=$output_objdir/$save_output-${k}.$objext
3839 output=$output_objdir/$save_output-${k}.$objext
3844 # Handle the remaining objects by creating one last
3845 # reloadable object file. All subsequent reloadable object
3846 # files will link in the last one created.
3847 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3848 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3850 if ${skipped_export-false}; then
3851 $show "generating symbol list for \`$libname.la'"
3852 export_symbols="$output_objdir/$libname.exp"
3853 $run $rm $export_symbols
3855 # Append the command to create the export file.
3856 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3859 # Set up a command to remove the reloadale object files
3860 # after they are used.
3862 while test "$i" -lt "$k"
3865 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3868 $echo "creating a temporary reloadable object file: $output"
3870 # Loop through the commands generated above and execute them.
3871 save_ifs="$IFS"; IFS='~'
3872 for cmd in $concat_cmds; do
3876 $run eval "$cmd" || exit $?
3881 # Restore the value of output.
3884 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3885 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3887 # Expand the library linking commands again to reset the
3888 # value of $libobjs for piecewise linking.
3890 # Do each of the archive commands.
3891 if test "$module" = yes && test -n "$module_cmds" ; then
3892 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3893 cmds=$module_expsym_cmds
3898 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3899 cmds=$archive_expsym_cmds
3905 # Append the command to remove the reloadable object files
3906 # to the just-reset $cmds.
3907 eval cmds=\"\$cmds~\$rm $delfiles\"
3909 save_ifs="$IFS"; IFS='~'
3910 for cmd in $cmds; do
3914 $run eval "$cmd" || exit $?
3918 # Restore the uninstalled library and exit
3919 if test "$mode" = relink; then
3920 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3924 # Create links to the real library.
3925 for linkname in $linknames; do
3926 if test "$realname" != "$linkname"; then
3927 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3928 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3932 # If -module or -export-dynamic was specified, set the dlname.
3933 if test "$module" = yes || test "$export_dynamic" = yes; then
3934 # On all known operating systems, these are identical.
3941 if test -n "$deplibs"; then
3942 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3945 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3946 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3949 if test -n "$rpath"; then
3950 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3953 if test -n "$xrpath"; then
3954 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3957 if test -n "$vinfo"; then
3958 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3961 if test -n "$release"; then
3962 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3967 if test -n "$objs$old_deplibs"; then
3968 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3972 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3980 # Delete the old objects.
3981 $run $rm $obj $libobj
3983 # Objects from convenience libraries. This assumes
3984 # single-version convenience libraries. Whenever we create
3985 # different ones for PIC/non-PIC, this we'll have to duplicate
3989 # reload_cmds runs $LD directly, so let us get rid of
3990 # -Wl from whole_archive_flag_spec
3993 if test -n "$convenience"; then
3994 if test -n "$whole_archive_flag_spec"; then
3995 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3997 gentop="$output_objdir/${obj}x"
3998 $show "${rm}r $gentop"
3999 $run ${rm}r "$gentop"
4000 $show "$mkdir $gentop"
4001 $run $mkdir "$gentop"
4003 if test "$status" -ne 0 && test ! -d "$gentop"; then
4006 generated="$generated $gentop"
4008 for xlib in $convenience; do
4009 # Extract the objects.
4011 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4012 *) xabs=`pwd`"/$xlib" ;;
4014 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4015 xdir="$gentop/$xlib"
4017 $show "${rm}r $xdir"
4019 $show "$mkdir $xdir"
4022 if test "$status" -ne 0 && test ! -d "$xdir"; then
4025 # We will extract separately just the conflicting names and we will no
4026 # longer touch any unique names. It is faster to leave these extract
4027 # automatically by $AR in one run.
4028 $show "(cd $xdir && $AR x $xabs)"
4029 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4030 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4033 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4034 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4035 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4038 while test "$i" -le "$count"
4040 # Put our $i before any first dot (extension)
4041 # Never overwrite any file
4043 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4045 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4047 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4048 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4054 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4059 # Create the old-style object.
4060 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
4064 save_ifs="$IFS"; IFS='~'
4065 for cmd in $cmds; do
4069 $run eval "$cmd" || exit $?
4073 # Exit if we aren't doing a library object file.
4074 if test -z "$libobj"; then
4075 if test -n "$gentop"; then
4076 $show "${rm}r $gentop"
4083 if test "$build_libtool_libs" != yes; then
4084 if test -n "$gentop"; then
4085 $show "${rm}r $gentop"
4089 # Create an invalid libtool object if no PIC, so that we don't
4090 # accidentally link it into a program.
4091 # $show "echo timestamp > $libobj"
4092 # $run eval "echo timestamp > $libobj" || exit $?
4096 if test -n "$pic_flag" || test "$pic_mode" != default; then
4097 # Only do commands if we really have different PIC objects.
4098 reload_objs="$libobjs $reload_conv_objs"
4101 save_ifs="$IFS"; IFS='~'
4102 for cmd in $cmds; do
4106 $run eval "$cmd" || exit $?
4111 if test -n "$gentop"; then
4112 $show "${rm}r $gentop"
4121 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4123 if test -n "$vinfo"; then
4124 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4127 if test -n "$release"; then
4128 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4131 if test "$preload" = yes; then
4132 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4133 test "$dlopen_self_static" = unknown; then
4134 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4139 *-*-rhapsody* | *-*-darwin1.[012])
4140 # On Rhapsody replace the C library is the System framework
4141 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4142 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4148 # Don't allow lazy linking, it breaks C++ global constructors
4149 if test "$tagname" = CXX ; then
4150 compile_command="$compile_command ${wl}-bind_at_load"
4151 finalize_command="$finalize_command ${wl}-bind_at_load"
4156 compile_command="$compile_command $compile_deplibs"
4157 finalize_command="$finalize_command $finalize_deplibs"
4159 if test -n "$rpath$xrpath"; then
4160 # If the user specified any rpath flags, then add them.
4161 for libdir in $rpath $xrpath; do
4162 # This is the magic to use -rpath.
4163 case "$finalize_rpath " in
4165 *) finalize_rpath="$finalize_rpath $libdir" ;;
4170 # Now hardcode the library paths
4173 for libdir in $compile_rpath $finalize_rpath; do
4174 if test -n "$hardcode_libdir_flag_spec"; then
4175 if test -n "$hardcode_libdir_separator"; then
4176 if test -z "$hardcode_libdirs"; then
4177 hardcode_libdirs="$libdir"
4179 # Just accumulate the unique libdirs.
4180 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4181 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4184 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4189 eval flag=\"$hardcode_libdir_flag_spec\"
4190 rpath="$rpath $flag"
4192 elif test -n "$runpath_var"; then
4193 case "$perm_rpath " in
4195 *) perm_rpath="$perm_rpath $libdir" ;;
4199 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4200 case :$dllsearchpath: in
4202 *) dllsearchpath="$dllsearchpath:$libdir";;
4207 # Substitute the hardcoded libdirs into the rpath.
4208 if test -n "$hardcode_libdir_separator" &&
4209 test -n "$hardcode_libdirs"; then
4210 libdir="$hardcode_libdirs"
4211 eval rpath=\" $hardcode_libdir_flag_spec\"
4213 compile_rpath="$rpath"
4217 for libdir in $finalize_rpath; do
4218 if test -n "$hardcode_libdir_flag_spec"; then
4219 if test -n "$hardcode_libdir_separator"; then
4220 if test -z "$hardcode_libdirs"; then
4221 hardcode_libdirs="$libdir"
4223 # Just accumulate the unique libdirs.
4224 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4225 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4228 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4233 eval flag=\"$hardcode_libdir_flag_spec\"
4234 rpath="$rpath $flag"
4236 elif test -n "$runpath_var"; then
4237 case "$finalize_perm_rpath " in
4239 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4243 # Substitute the hardcoded libdirs into the rpath.
4244 if test -n "$hardcode_libdir_separator" &&
4245 test -n "$hardcode_libdirs"; then
4246 libdir="$hardcode_libdirs"
4247 eval rpath=\" $hardcode_libdir_flag_spec\"
4249 finalize_rpath="$rpath"
4251 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4252 # Transform all the library objects into standard objects.
4253 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4254 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4258 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4259 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4260 dlsyms="${outputname}S.c"
4262 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4266 if test -n "$dlsyms"; then
4270 # Discover the nlist of each of the dlfiles.
4271 nlist="$output_objdir/${outputname}.nm"
4273 $show "$rm $nlist ${nlist}S ${nlist}T"
4274 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4276 # Parse the name list into a source file.
4277 $show "creating $output_objdir/$dlsyms"
4279 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4280 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4281 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4287 /* Prevent the only kind of declaration conflicts we can make. */
4288 #define lt_preloaded_symbols some_other_symbol
4290 /* External symbol declarations for the compiler. */\
4293 if test "$dlself" = yes; then
4294 $show "generating symbol list for \`$output'"
4296 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4298 # Add our own program objects to the symbol list.
4299 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4300 for arg in $progfiles; do
4301 $show "extracting global C symbols from \`$arg'"
4302 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4305 if test -n "$exclude_expsyms"; then
4306 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4307 $run eval '$mv "$nlist"T "$nlist"'
4310 if test -n "$export_symbols_regex"; then
4311 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4312 $run eval '$mv "$nlist"T "$nlist"'
4315 # Prepare the list of exported symbols
4316 if test -z "$export_symbols"; then
4317 export_symbols="$output_objdir/$output.exp"
4318 $run $rm $export_symbols
4319 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4321 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4322 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4323 $run eval 'mv "$nlist"T "$nlist"'
4327 for arg in $dlprefiles; do
4328 $show "extracting global C symbols from \`$arg'"
4329 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4330 $run eval '$echo ": $name " >> "$nlist"'
4331 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4334 if test -z "$run"; then
4335 # Make sure we have at least an empty file.
4336 test -f "$nlist" || : > "$nlist"
4338 if test -n "$exclude_expsyms"; then
4339 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4340 $mv "$nlist"T "$nlist"
4343 # Try sorting and uniquifying the output.
4344 if grep -v "^: " < "$nlist" |
4345 if sort -k 3 </dev/null >/dev/null 2>&1; then
4350 uniq > "$nlist"S; then
4353 grep -v "^: " < "$nlist" > "$nlist"S
4356 if test -f "$nlist"S; then
4357 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4359 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4362 $echo >> "$output_objdir/$dlsyms" "\
4364 #undef lt_preloaded_symbols
4366 #if defined (__STDC__) && __STDC__
4367 # define lt_ptr void *
4369 # define lt_ptr char *
4373 /* The mapping between symbol names and symbols. */
4378 lt_preloaded_symbols[] =
4382 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4384 $echo >> "$output_objdir/$dlsyms" "\
4388 /* This works around a problem in FreeBSD linker */
4389 #ifdef FREEBSD_WORKAROUND
4390 static const void *lt_preloaded_setup() {
4391 return lt_preloaded_symbols;
4401 pic_flag_for_symtable=
4403 # compiling the symbol table file with pic_flag works around
4404 # a FreeBSD bug that causes programs to crash when -lm is
4405 # linked before any other PIC object. But we must not use
4406 # pic_flag when linking with -static. The problem exists in
4407 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4408 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4409 case "$compile_command " in
4411 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4414 case "$compile_command " in
4416 *) pic_flag_for_symtable=" $pic_flag";;
4420 # Now compile the dynamic symbol file.
4421 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4422 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4424 # Clean up the generated files.
4425 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4426 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4428 # Transform the symbol file into the correct name.
4429 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4430 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4433 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4438 # We keep going just in case the user didn't refer to
4439 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4440 # really was required.
4442 # Nullify the symbol file.
4443 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4444 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4447 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4448 # Replace the output file specification.
4449 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4450 link_command="$compile_command$compile_rpath"
4452 # We have no uninstalled library dependencies, so finalize right now.
4453 $show "$link_command"
4454 $run eval "$link_command"
4457 # Delete the generated files.
4458 if test -n "$dlsyms"; then
4459 $show "$rm $output_objdir/${outputname}S.${objext}"
4460 $run $rm "$output_objdir/${outputname}S.${objext}"
4466 if test -n "$shlibpath_var"; then
4467 # We should set the shlibpath_var
4469 for dir in $temp_rpath; do
4471 [\\/]* | [A-Za-z]:[\\/]*)
4476 # Relative path: add a thisdir entry.
4477 rpath="$rpath\$thisdir/$dir:"
4484 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4485 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4487 if test -n "$finalize_shlibpath"; then
4488 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4493 if test -n "$runpath_var"; then
4494 if test -n "$perm_rpath"; then
4495 # We should set the runpath_var.
4497 for dir in $perm_rpath; do
4500 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4502 if test -n "$finalize_perm_rpath"; then
4503 # We should set the runpath_var.
4505 for dir in $finalize_perm_rpath; do
4508 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4512 if test "$no_install" = yes; then
4513 # We don't need to create a wrapper script.
4514 link_command="$compile_var$compile_command$compile_rpath"
4515 # Replace the output file specification.
4516 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4517 # Delete the old output file.
4519 # Link the executable and exit
4520 $show "$link_command"
4521 $run eval "$link_command" || exit $?
4525 if test "$hardcode_action" = relink; then
4526 # Fast installation is not supported
4527 link_command="$compile_var$compile_command$compile_rpath"
4528 relink_command="$finalize_var$finalize_command$finalize_rpath"
4530 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4531 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4533 if test "$fast_install" != no; then
4534 link_command="$finalize_var$compile_command$finalize_rpath"
4535 if test "$fast_install" = yes; then
4536 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4538 # fast_install is set to needless
4542 link_command="$compile_var$compile_command$compile_rpath"
4543 relink_command="$finalize_var$finalize_command$finalize_rpath"
4547 # Replace the output file specification.
4548 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4550 # Delete the old output files.
4551 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4553 $show "$link_command"
4554 $run eval "$link_command" || exit $?
4556 # Now create the wrapper script.
4557 $show "creating $output"
4559 # Quote the relink command for shipping.
4560 if test -n "$relink_command"; then
4561 # Preserve any variables that may affect compiler behavior
4562 for var in $variables_saved_for_relink; do
4563 if eval test -z \"\${$var+set}\"; then
4564 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4565 elif eval var_value=\$$var; test -z "$var_value"; then
4566 relink_command="$var=; export $var; $relink_command"
4568 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4569 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4572 relink_command="(cd `pwd`; $relink_command)"
4573 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4576 # Quote $echo for shipping.
4577 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4579 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4580 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4582 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4584 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4587 # Only actually do things if our run command is non-null.
4588 if test -z "$run"; then
4589 # win32 will think the script is a binary if it has
4590 # a .exe suffix, so we strip it off here.
4592 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4594 # test for cygwin because mv fails w/o .exe extensions
4598 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4602 *cygwin* | *mingw* )
4603 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4604 cwrapper=`$echo ${output}.exe`
4605 $rm $cwrappersource $cwrapper
4606 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4608 cat > $cwrappersource <<EOF
4610 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4611 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4613 The $output program cannot be directly executed until all the libtool
4614 libraries that it depends on are installed.
4616 This wrapper executable should never be moved out of the build directory.
4617 If it is, it will not operate correctly.
4619 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4620 but could eventually absorb all of the scripts functionality and
4621 exec $objdir/$outputname directly.
4624 cat >> $cwrappersource<<"EOF"
4632 #if defined(PATH_MAX)
4633 # define LT_PATHMAX PATH_MAX
4634 #elif defined(MAXPATHLEN)
4635 # define LT_PATHMAX MAXPATHLEN
4637 # define LT_PATHMAX 1024
4640 #ifndef DIR_SEPARATOR
4641 #define DIR_SEPARATOR '/'
4644 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4646 #define HAVE_DOS_BASED_FILE_SYSTEM
4647 #ifndef DIR_SEPARATOR_2
4648 #define DIR_SEPARATOR_2 '\\'
4652 #ifndef DIR_SEPARATOR_2
4653 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4654 #else /* DIR_SEPARATOR_2 */
4655 # define IS_DIR_SEPARATOR(ch) \
4656 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4657 #endif /* DIR_SEPARATOR_2 */
4659 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4660 #define XFREE(stale) do { \
4661 if (stale) { free ((void *) stale); stale = 0; } \
4664 const char *program_name = NULL;
4666 void * xmalloc (size_t num);
4667 char * xstrdup (const char *string);
4668 char * basename (const char *name);
4669 char * fnqualify(const char *path);
4670 char * strendzap(char *str, const char *pat);
4671 void lt_fatal (const char *message, ...);
4674 main (int argc, char *argv[])
4679 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4680 newargz = XMALLOC(char *, argc+2);
4683 cat >> $cwrappersource <<EOF
4684 newargz[0] = "$SHELL";
4687 cat >> $cwrappersource <<"EOF"
4688 newargz[1] = fnqualify(argv[0]);
4689 /* we know the script has the same name, without the .exe */
4690 /* so make sure newargz[1] doesn't end in .exe */
4691 strendzap(newargz[1],".exe");
4692 for (i = 1; i < argc; i++)
4693 newargz[i+1] = xstrdup(argv[i]);
4694 newargz[argc+1] = NULL;
4697 cat >> $cwrappersource <<EOF
4698 execv("$SHELL",newargz);
4701 cat >> $cwrappersource <<"EOF"
4705 xmalloc (size_t num)
4707 void * p = (void *) malloc (num);
4709 lt_fatal ("Memory exhausted");
4715 xstrdup (const char *string)
4717 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4722 basename (const char *name)
4726 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4727 /* Skip over the disk name in MSDOS pathnames. */
4728 if (isalpha (name[0]) && name[1] == ':')
4732 for (base = name; *name; name++)
4733 if (IS_DIR_SEPARATOR (*name))
4735 return (char *) base;
4739 fnqualify(const char *path)
4743 char tmp[LT_PATHMAX + 1];
4745 assert(path != NULL);
4747 /* Is it qualified already? */
4748 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4749 if (isalpha (path[0]) && path[1] == ':')
4750 return xstrdup (path);
4752 if (IS_DIR_SEPARATOR (path[0]))
4753 return xstrdup (path);
4755 /* prepend the current directory */
4756 /* doesn't handle '~' */
4757 if (getcwd (tmp, LT_PATHMAX) == NULL)
4758 lt_fatal ("getcwd failed");
4759 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4760 p = XMALLOC(char, size);
4761 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4766 strendzap(char *str, const char *pat)
4770 assert(str != NULL);
4771 assert(pat != NULL);
4774 patlen = strlen(pat);
4778 str += len - patlen;
4779 if (strcmp(str, pat) == 0)
4786 lt_error_core (int exit_status, const char * mode,
4787 const char * message, va_list ap)
4789 fprintf (stderr, "%s: %s: ", program_name, mode);
4790 vfprintf (stderr, message, ap);
4791 fprintf (stderr, ".\n");
4793 if (exit_status >= 0)
4798 lt_fatal (const char *message, ...)
4801 va_start (ap, message);
4802 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4806 # we should really use a build-platform specific compiler
4807 # here, but OTOH, the wrappers (shell script and this C one)
4808 # are only useful if you want to execute the "real" binary.
4809 # Since the "real" binary is built for $host, then this
4810 # wrapper might as well be built for $host, too.
4811 $run $LTCC -s -o $cwrapper $cwrappersource
4815 trap "$rm $output; exit 1" 1 2 15
4820 # $output - temporary wrapper script for $objdir/$outputname
4821 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4823 # The $output program cannot be directly executed until all the libtool
4824 # libraries that it depends on are installed.
4826 # This wrapper script should never be moved out of the build directory.
4827 # If it is, it will not operate correctly.
4829 # Sed substitution that helps us do robust quoting. It backslashifies
4830 # metacharacters that are still active within double-quoted strings.
4831 Xsed='${SED} -e 1s/^X//'
4832 sed_quote_subst='$sed_quote_subst'
4834 # The HP-UX ksh and POSIX shell print the target directory to stdout
4836 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4838 relink_command=\"$relink_command\"
4840 # This environment variable determines our operation mode.
4841 if test \"\$libtool_install_magic\" = \"$magic\"; then
4842 # install mode needs the following variable:
4843 notinst_deplibs='$notinst_deplibs'
4845 # When we are sourced in execute mode, \$file and \$echo are already set.
4846 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4849 # Make sure echo works.
4850 if test \"X\$1\" = X--no-reexec; then
4851 # Discard the --no-reexec flag, and continue.
4853 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4854 # Yippee, \$echo works!
4857 # Restart under the correct shell, and then maybe \$echo will work.
4858 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4864 # Find the directory that this script lives in.
4865 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4866 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4868 # Follow symbolic links until we get to the real thisdir.
4869 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4870 while test -n \"\$file\"; do
4871 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4873 # If there was a directory component, then change thisdir.
4874 if test \"x\$destdir\" != \"x\$file\"; then
4875 case \"\$destdir\" in
4876 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4877 *) thisdir=\"\$thisdir/\$destdir\" ;;
4881 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4882 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4885 # Try to get the absolute directory name.
4886 absdir=\`cd \"\$thisdir\" && pwd\`
4887 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4890 if test "$fast_install" = yes; then
4892 program=lt-'$outputname'$exeext
4893 progdir=\"\$thisdir/$objdir\"
4895 if test ! -f \"\$progdir/\$program\" || \\
4896 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4897 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4899 file=\"\$\$-\$program\"
4901 if test ! -d \"\$progdir\"; then
4902 $mkdir \"\$progdir\"
4904 $rm \"\$progdir/\$file\"
4909 # relink executable if necessary
4910 if test -n \"\$relink_command\"; then
4911 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4913 $echo \"\$relink_command_output\" >&2
4914 $rm \"\$progdir/\$file\"
4919 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4920 { $rm \"\$progdir/\$program\";
4921 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4922 $rm \"\$progdir/\$file\"
4926 program='$outputname'
4927 progdir=\"\$thisdir/$objdir\"
4933 if test -f \"\$progdir/\$program\"; then"
4935 # Export our shlibpath_var if we have one.
4936 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4938 # Add our own library path to $shlibpath_var
4939 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4941 # Some systems cannot cope with colon-terminated $shlibpath_var
4942 # The second colon is a workaround for a bug in BeOS R4 sed
4943 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4945 export $shlibpath_var
4949 # fixup the dll searchpath if we need to.
4950 if test -n "$dllsearchpath"; then
4952 # Add the dll search path components to the executable PATH
4953 PATH=$dllsearchpath:\$PATH
4958 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4959 # Run the actual program with our arguments.
4962 # Backslashes separate directories on plain windows
4963 *-*-mingw | *-*-os2*)
4965 exec \$progdir\\\\\$program \${1+\"\$@\"}
4971 exec \$progdir/\$program \${1+\"\$@\"}
4976 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4980 # The program doesn't exist.
4981 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4982 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4983 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4994 # See if we need to build an old-fashioned archive.
4995 for oldlib in $oldlibs; do
4997 if test "$build_libtool_libs" = convenience; then
4998 oldobjs="$libobjs_save"
4999 addlibs="$convenience"
5000 build_libtool_libs=no
5002 if test "$build_libtool_libs" = module; then
5003 oldobjs="$libobjs_save"
5004 build_libtool_libs=no
5006 oldobjs="$old_deplibs $non_pic_objects"
5008 addlibs="$old_convenience"
5011 if test -n "$addlibs"; then
5012 gentop="$output_objdir/${outputname}x"
5013 $show "${rm}r $gentop"
5014 $run ${rm}r "$gentop"
5015 $show "$mkdir $gentop"
5016 $run $mkdir "$gentop"
5018 if test "$status" -ne 0 && test ! -d "$gentop"; then
5021 generated="$generated $gentop"
5023 # Add in members from convenience archives.
5024 for xlib in $addlibs; do
5025 # Extract the objects.
5027 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5028 *) xabs=`pwd`"/$xlib" ;;
5030 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5031 xdir="$gentop/$xlib"
5033 $show "${rm}r $xdir"
5035 $show "$mkdir $xdir"
5038 if test "$status" -ne 0 && test ! -d "$xdir"; then
5041 # We will extract separately just the conflicting names and we will no
5042 # longer touch any unique names. It is faster to leave these extract
5043 # automatically by $AR in one run.
5044 $show "(cd $xdir && $AR x $xabs)"
5045 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5046 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5049 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5050 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5051 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5054 while test "$i" -le "$count"
5056 # Put our $i before any first dot (extension)
5057 # Never overwrite any file
5059 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5061 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5063 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5064 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5070 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5074 # Do each command in the archive commands.
5075 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5076 cmds=$old_archive_from_new_cmds
5078 eval cmds=\"$old_archive_cmds\"
5080 if len=`expr "X$cmds" : ".*"` &&
5081 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5082 cmds=$old_archive_cmds
5084 # the command line is too long to link in one step, link in parts
5085 $echo "using piecewise archive linking..."
5090 save_oldobjs=$oldobjs
5091 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5092 # encoded into archives. This makes 'ar r' malfunction in
5093 # this piecewise linking case whenever conflicting object
5094 # names appear in distinct ar calls; check, warn and compensate.
5095 if (for obj in $save_oldobjs
5097 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5098 done | sort | sort -uc >/dev/null 2>&1); then
5101 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5102 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5105 # Is there a better way of finding the last object in the list?
5106 for obj in $save_oldobjs
5110 for obj in $save_oldobjs
5112 oldobjs="$objlist $obj"
5113 objlist="$objlist $obj"
5114 eval test_cmds=\"$old_archive_cmds\"
5115 if len=`expr "X$test_cmds" : ".*"` &&
5116 test "$len" -le "$max_cmd_len"; then
5119 # the above command should be used before it gets too long
5121 if test "$obj" = "$last_oldobj" ; then
5124 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5125 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5131 if test "X$oldobjs" = "X" ; then
5132 eval cmds=\"\$concat_cmds\"
5134 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5138 save_ifs="$IFS"; IFS='~'
5139 for cmd in $cmds; do
5143 $run eval "$cmd" || exit $?
5148 if test -n "$generated"; then
5149 $show "${rm}r$generated"
5150 $run ${rm}r$generated
5153 # Now create the libtool archive.
5157 test "$build_old_libs" = yes && old_library="$libname.$libext"
5158 $show "creating $output"
5160 # Preserve any variables that may affect compiler behavior
5161 for var in $variables_saved_for_relink; do
5162 if eval test -z \"\${$var+set}\"; then
5163 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5164 elif eval var_value=\$$var; test -z "$var_value"; then
5165 relink_command="$var=; export $var; $relink_command"
5167 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5168 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5171 # Quote the link command for shipping.
5172 relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5173 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5174 if test "$hardcode_automatic" = yes ; then
5177 # Only create the output if not a dry run.
5178 if test -z "$run"; then
5179 for installed in no yes; do
5180 if test "$installed" = yes; then
5181 if test -z "$install_libdir"; then
5184 output="$output_objdir/$outputname"i
5185 # Replace all uninstalled libtool libraries with the installed ones
5187 for deplib in $dependency_libs; do
5190 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5191 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5192 if test -z "$libdir"; then
5193 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5196 # We do not want portage's install root ($D) present. Check only for
5197 # this if the .la is being installed.
5198 if test "$installed" = yes && test "$D"; then
5199 eval mynewdependency_lib="`echo "$libdir/$name" |sed -e "s:$D::g" -e 's://:/:g'`"
5201 mynewdependency_lib="$libdir/$name"
5203 # Do not add duplicates
5204 if test "$mynewdependency_lib"; then
5205 if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
5206 newdependency_libs="$newdependency_libs $mynewdependency_lib"
5211 if test "$installed" = yes; then
5212 # Rather use S=WORKDIR if our version of portage supports it.
5213 # This is because some ebuild (gcc) do not use $S as buildroot.
5214 if test "$PWORKDIR"; then
5217 # We do not want portage's build root ($S) present.
5218 if test -n "`echo $deplib |grep -e "$S"`" && test "$S"; then
5219 mynewdependency_lib=""
5220 # We do not want portage's install root ($D) present.
5221 elif test -n "`echo $deplib |grep -e "$D"`" && test "$D"; then
5222 eval mynewdependency_lib="`echo "$deplib" |sed -e "s:$D::g" -e 's://:/:g'`"
5224 mynewdependency_lib="$deplib"
5227 mynewdependency_lib="$deplib"
5229 # Do not add duplicates
5230 if test "$mynewdependency_lib"; then
5231 if test -z "`echo $newdependency_libs |grep -e "$mynewdependency_lib"`"; then
5232 newdependency_libs="$newdependency_libs $mynewdependency_lib"
5238 dependency_libs="$newdependency_libs"
5240 for lib in $dlfiles; do
5241 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5242 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5243 if test -z "$libdir"; then
5244 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5247 newdlfiles="$newdlfiles $libdir/$name"
5249 dlfiles="$newdlfiles"
5251 for lib in $dlprefiles; do
5252 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5253 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5254 if test -z "$libdir"; then
5255 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5258 newdlprefiles="$newdlprefiles $libdir/$name"
5260 dlprefiles="$newdlprefiles"
5263 for lib in $dlfiles; do
5265 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5266 *) abs=`pwd`"/$lib" ;;
5268 newdlfiles="$newdlfiles $abs"
5270 dlfiles="$newdlfiles"
5272 for lib in $dlprefiles; do
5274 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5275 *) abs=`pwd`"/$lib" ;;
5277 newdlprefiles="$newdlprefiles $abs"
5279 dlprefiles="$newdlprefiles"
5282 # place dlname in correct position for cygwin
5284 case $host,$output,$installed,$module,$dlname in
5285 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5287 # Do not add duplicates
5288 if test "$installed" = yes && test "$D"; then
5289 install_libdir="`echo "$install_libdir" |sed -e "s:$D::g" -e 's://:/:g'`"
5292 # $outputname - a libtool library file
5293 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5295 # Please DO NOT delete this file!
5296 # It is necessary for linking the library.
5298 # The name that we can dlopen(3).
5301 # Names of this library.
5302 library_names='$library_names'
5304 # The name of the static archive.
5305 old_library='$old_library'
5307 # Libraries that this one depends upon.
5308 dependency_libs='$dependency_libs'
5310 # Version information for $libname.
5315 # Is this an already installed library?
5316 installed=$installed
5318 # Should we warn about portability when linking against -modules?
5319 shouldnotlink=$module
5321 # Files to dlopen/dlpreopen
5323 dlpreopen='$dlprefiles'
5325 # Directory that this library needs to be installed in:
5326 libdir='$install_libdir'"
5327 if test "$installed" = no && test "$need_relink" = yes; then
5329 relink_command=\"$relink_command\""
5334 # Do a symbolic link so that the libtool archive can be found in
5335 # LD_LIBRARY_PATH before the program is installed.
5336 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5337 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5343 # libtool install mode
5345 modename="$modename: install"
5347 # There may be an optional sh(1) argument at the beginning of
5348 # install_prog (especially on Windows NT).
5349 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5350 # Allow the use of GNU shtool's install command.
5351 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5352 # Aesthetically quote it.
5353 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5355 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5359 install_prog="$arg "
5367 # The real first argument should be the name of the installation program.
5368 # Aesthetically quote it.
5369 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5371 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5375 install_prog="$install_prog$arg"
5377 # We need to accept at least all the BSD install flags.
5387 if test -n "$dest"; then
5388 files="$files $dest"
5406 # If the previous option needed an argument, then skip it.
5407 if test -n "$prev"; then
5416 # Aesthetically quote the argument.
5417 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5419 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5423 install_prog="$install_prog $arg"
5426 if test -z "$install_prog"; then
5427 $echo "$modename: you must specify an install program" 1>&2
5432 if test -n "$prev"; then
5433 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5438 if test -z "$files"; then
5439 if test -z "$dest"; then
5440 $echo "$modename: no file or destination specified" 1>&2
5442 $echo "$modename: you must specify a destination" 1>&2
5448 # Strip any trailing slash from the destination.
5449 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5451 # Check to see that the destination is a directory.
5452 test -d "$dest" && isdir=yes
5453 if test "$isdir" = yes; then
5457 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5458 test "X$destdir" = "X$dest" && destdir=.
5459 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5461 # Not a directory, so check to see that there is only one file specified.
5463 if test "$#" -gt 2; then
5464 $echo "$modename: \`$dest' is not a directory" 1>&2
5470 [\\/]* | [A-Za-z]:[\\/]*) ;;
5472 for file in $files; do
5476 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5485 # This variable tells wrapper scripts just to set variables rather
5486 # than running their programs.
5487 libtool_install_magic="$magic"
5492 for file in $files; do
5494 # Do each installation.
5497 # Do the static libraries later.
5498 staticlibs="$staticlibs $file"
5502 # Check to see that this really is a libtool archive.
5503 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5505 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5513 # If there is no directory component, then add one.
5515 */* | *\\*) . $file ;;
5519 # Add the libdir to current_libdirs if it is the destination.
5520 if test "X$destdir" = "X$libdir"; then
5521 case "$current_libdirs " in
5523 *) current_libdirs="$current_libdirs $libdir" ;;
5526 # Note the libdir as a future libdir.
5527 case "$future_libdirs " in
5529 *) future_libdirs="$future_libdirs $libdir" ;;
5533 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5534 test "X$dir" = "X$file/" && dir=
5537 if test -n "$relink_command"; then
5538 # Determine the prefix the user has applied to our future dir.
5539 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5541 # Don't allow the user to place us outside of our expected
5542 # location b/c this prevents finding dependent libraries that
5543 # are installed to the same prefix.
5544 # At present, this check doesn't affect windows .dll's that
5545 # are installed into $libdir/../bin (currently, that works fine)
5546 # but it's something to keep an eye on.
5547 if test "$inst_prefix_dir" = "$destdir"; then
5548 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5552 if test -n "$inst_prefix_dir"; then
5553 # Stick the inst_prefix_dir data into the link command.
5554 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5556 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5559 $echo "$modename: warning: relinking \`$file'" 1>&2
5560 $show "$relink_command"
5561 if $run eval "$relink_command"; then :
5563 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5568 # See the names of the shared library.
5569 set dummy $library_names
5570 if test -n "$2"; then
5576 test -n "$relink_command" && srcname="$realname"T
5578 # Install the shared library and build the symlinks.
5579 $show "$install_prog $dir/$srcname $destdir/$realname"
5580 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5581 if test -n "$stripme" && test -n "$striplib"; then
5582 $show "$striplib $destdir/$realname"
5583 $run eval "$striplib $destdir/$realname" || exit $?
5586 if test "$#" -gt 0; then
5587 # Delete the old symlinks, and create new ones.
5590 if test "$linkname" != "$realname"; then
5591 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5592 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5597 # Do each command in the postinstall commands.
5598 lib="$destdir/$realname"
5599 cmds=$postinstall_cmds
5600 save_ifs="$IFS"; IFS='~'
5601 for cmd in $cmds; do
5605 $run eval "$cmd" || exit $?
5610 # Install the pseudo-library for information purposes.
5611 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5612 instname="$dir/$name"i
5613 $show "$install_prog $instname $destdir/$name"
5614 $run eval "$install_prog $instname $destdir/$name" || exit $?
5616 # Maybe install the static library, too.
5617 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5621 # Install (i.e. copy) a libtool object.
5623 # Figure out destination file name, if it wasn't already specified.
5624 if test -n "$destname"; then
5625 destfile="$destdir/$destname"
5627 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5628 destfile="$destdir/$destfile"
5631 # Deduce the name of the destination old-style object file.
5634 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5637 staticdest="$destfile"
5641 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5647 # Install the libtool object if requested.
5648 if test -n "$destfile"; then
5649 $show "$install_prog $file $destfile"
5650 $run eval "$install_prog $file $destfile" || exit $?
5653 # Install the old object if enabled.
5654 if test "$build_old_libs" = yes; then
5655 # Deduce the name of the old-style object file.
5656 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5658 $show "$install_prog $staticobj $staticdest"
5659 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5665 # Figure out destination file name, if it wasn't already specified.
5666 if test -n "$destname"; then
5667 destfile="$destdir/$destname"
5669 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5670 destfile="$destdir/$destfile"
5673 # If the file is missing, and there is a .exe on the end, strip it
5674 # because it is most likely a libtool script we actually want to
5679 if test ! -f "$file"; then
5680 file=`$echo $file|${SED} 's,.exe$,,'`
5686 # Do a test to see if this is really a libtool program.
5689 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5695 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5699 # To insure that "foo" is sourced, and not "foo.exe",
5700 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5701 # which disallows the automatic-append-.exe behavior.
5703 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5704 *) wrapperdot=${wrapper} ;;
5706 # If there is no directory component, then add one.
5708 */* | *\\*) . ${wrapperdot} ;;
5709 *) . ./${wrapperdot} ;;
5712 # Check the variables that should have been set.
5713 if test -z "$notinst_deplibs"; then
5714 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5719 for lib in $notinst_deplibs; do
5720 # Check to see that each library is installed.
5722 if test -f "$lib"; then
5723 # If there is no directory component, then add one.
5725 */* | *\\*) . $lib ;;
5729 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5730 if test -n "$libdir" && test ! -f "$libfile"; then
5731 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5737 # To insure that "foo" is sourced, and not "foo.exe",
5738 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5739 # which disallows the automatic-append-.exe behavior.
5741 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5742 *) wrapperdot=${wrapper} ;;
5744 # If there is no directory component, then add one.
5746 */* | *\\*) . ${wrapperdot} ;;
5747 *) . ./${wrapperdot} ;;
5751 if test "$fast_install" = no && test -n "$relink_command"; then
5752 if test "$finalize" = yes && test -z "$run"; then
5754 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5755 tmpdir="$tmpdir/libtool-$$"
5756 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5758 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5761 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5762 outputname="$tmpdir/$file"
5763 # Replace the output file specification.
5764 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5766 $show "$relink_command"
5767 if $run eval "$relink_command"; then :
5769 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5775 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5778 # Install the binary that we compiled earlier.
5779 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5783 # remove .exe since cygwin /usr/bin/install will append another
5785 case $install_prog,$host in
5786 */usr/bin/install*,*cygwin*)
5787 case $file:$destfile in
5792 destfile=$destfile.exe
5795 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5800 $show "$install_prog$stripme $file $destfile"
5801 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5802 test -n "$outputname" && ${rm}r "$tmpdir"
5807 for file in $staticlibs; do
5808 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5810 # Set up the ranlib parameters.
5811 oldlib="$destdir/$name"
5813 $show "$install_prog $file $oldlib"
5814 $run eval "$install_prog \$file \$oldlib" || exit $?
5816 if test -n "$stripme" && test -n "$old_striplib"; then
5817 $show "$old_striplib $oldlib"
5818 $run eval "$old_striplib $oldlib" || exit $?
5821 # Do each command in the postinstall commands.
5822 cmds=$old_postinstall_cmds
5823 save_ifs="$IFS"; IFS='~'
5824 for cmd in $cmds; do
5828 $run eval "$cmd" || exit $?
5833 if test -n "$future_libdirs"; then
5834 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5837 if test -n "$current_libdirs"; then
5838 # Maybe just do a dry run.
5839 test -n "$run" && current_libdirs=" -n$current_libdirs"
5840 exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5846 # libtool finish mode
5848 modename="$modename: finish"
5852 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5855 libdirs="$libdirs $dir"
5858 for libdir in $libdirs; do
5859 if test -n "$finish_cmds"; then
5860 # Do each command in the finish commands.
5862 save_ifs="$IFS"; IFS='~'
5863 for cmd in $cmds; do
5867 $run eval "$cmd" || admincmds="$admincmds
5872 if test -n "$finish_eval"; then
5873 # Do the single finish_eval.
5874 eval cmds=\"$finish_eval\"
5875 $run eval "$cmds" || admincmds="$admincmds
5881 # Exit here if they wanted silent mode.
5882 test "$show" = : && exit 0
5884 $echo "----------------------------------------------------------------------"
5885 $echo "Libraries have been installed in:"
5886 for libdir in $libdirs; do
5890 $echo "If you ever happen to want to link against installed libraries"
5891 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5892 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5893 $echo "flag during linking and do at least one of the following:"
5894 if test -n "$shlibpath_var"; then
5895 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5896 $echo " during execution"
5898 if test -n "$runpath_var"; then
5899 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5900 $echo " during linking"
5902 if test -n "$hardcode_libdir_flag_spec"; then
5904 eval flag=\"$hardcode_libdir_flag_spec\"
5906 $echo " - use the \`$flag' linker flag"
5908 if test -n "$admincmds"; then
5909 $echo " - have your system administrator run these commands:$admincmds"
5911 if test -f /etc/ld.so.conf; then
5912 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5915 $echo "See any operating system documentation about shared libraries for"
5916 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5917 $echo "----------------------------------------------------------------------"
5921 # libtool execute mode
5923 modename="$modename: execute"
5925 # The first argument is the command name.
5927 if test -z "$cmd"; then
5928 $echo "$modename: you must specify a COMMAND" 1>&2
5933 # Handle -dlopen flags immediately.
5934 for file in $execute_dlfiles; do
5935 if test ! -f "$file"; then
5936 $echo "$modename: \`$file' is not a file" 1>&2
5944 # Check to see that this really is a libtool archive.
5945 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5947 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5952 # Read the libtool library.
5956 # If there is no directory component, then add one.
5958 */* | *\\*) . $file ;;
5962 # Skip this library if it cannot be dlopened.
5963 if test -z "$dlname"; then
5964 # Warn if it was a shared library.
5965 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5969 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5970 test "X$dir" = "X$file" && dir=.
5972 if test -f "$dir/$objdir/$dlname"; then
5975 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5981 # Just add the directory containing the .lo file.
5982 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5983 test "X$dir" = "X$file" && dir=.
5987 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5992 # Get the absolute pathname.
5993 absdir=`cd "$dir" && pwd`
5994 test -n "$absdir" && dir="$absdir"
5996 # Now add the directory to shlibpath_var.
5997 if eval "test -z \"\$$shlibpath_var\""; then
5998 eval "$shlibpath_var=\"\$dir\""
6000 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6004 # This variable tells wrapper scripts just to set shlibpath_var
6005 # rather than running their programs.
6006 libtool_execute_magic="$magic"
6008 # Check if any of the arguments is a wrapper script.
6015 # Do a test to see if this is really a libtool program.
6016 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6017 # If there is no directory component, then add one.
6019 */* | *\\*) . $file ;;
6023 # Transform arg to wrapped name.
6024 file="$progdir/$program"
6028 # Quote arguments (to preserve shell metacharacters).
6029 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6030 args="$args \"$file\""
6033 if test -z "$run"; then
6034 if test -n "$shlibpath_var"; then
6035 # Export the shlibpath_var.
6036 eval "export $shlibpath_var"
6039 # Restore saved environment variables
6040 if test "${save_LC_ALL+set}" = set; then
6041 LC_ALL="$save_LC_ALL"; export LC_ALL
6043 if test "${save_LANG+set}" = set; then
6044 LANG="$save_LANG"; export LANG
6047 # Now prepare to actually exec the command.
6048 exec_cmd="\$cmd$args"
6050 # Display what would be done.
6051 if test -n "$shlibpath_var"; then
6052 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6053 $echo "export $shlibpath_var"
6060 # libtool clean and uninstall mode
6062 modename="$modename: $mode"
6068 # This variable tells wrapper scripts just to set variables rather
6069 # than running their programs.
6070 libtool_install_magic="$magic"
6075 -f) rm="$rm $arg"; rmforce=yes ;;
6076 -*) rm="$rm $arg" ;;
6077 *) files="$files $arg" ;;
6081 if test -z "$rm"; then
6082 $echo "$modename: you must specify an RM program" 1>&2
6089 origobjdir="$objdir"
6090 for file in $files; do
6091 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6092 if test "X$dir" = "X$file"; then
6094 objdir="$origobjdir"
6096 objdir="$dir/$origobjdir"
6098 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6099 test "$mode" = uninstall && objdir="$dir"
6101 # Remember objdir for removal later, being careful to avoid duplicates
6102 if test "$mode" = clean; then
6105 *) rmdirs="$rmdirs $objdir" ;;
6109 # Don't error if the file doesn't exist and rm -f was used.
6110 if (test -L "$file") >/dev/null 2>&1 \
6111 || (test -h "$file") >/dev/null 2>&1 \
6112 || test -f "$file"; then
6114 elif test -d "$file"; then
6117 elif test "$rmforce" = yes; then
6125 # Possibly a libtool archive, so verify it.
6126 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6129 # Delete the libtool libraries and symlinks.
6130 for n in $library_names; do
6131 rmfiles="$rmfiles $objdir/$n"
6133 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6134 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6136 if test "$mode" = uninstall; then
6137 if test -n "$library_names"; then
6138 # Do each command in the postuninstall commands.
6139 cmds=$postuninstall_cmds
6140 save_ifs="$IFS"; IFS='~'
6141 for cmd in $cmds; do
6146 if test "$?" -ne 0 && test "$rmforce" != yes; then
6153 if test -n "$old_library"; then
6154 # Do each command in the old_postuninstall commands.
6155 cmds=$old_postuninstall_cmds
6156 save_ifs="$IFS"; IFS='~'
6157 for cmd in $cmds; do
6162 if test "$?" -ne 0 && test "$rmforce" != yes; then
6168 # FIXME: should reinstall the best remaining shared library.
6174 # Possibly a libtool object, so verify it.
6175 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6180 # Add PIC object to the list of files to remove.
6181 if test -n "$pic_object" \
6182 && test "$pic_object" != none; then
6183 rmfiles="$rmfiles $dir/$pic_object"
6186 # Add non-PIC object to the list of files to remove.
6187 if test -n "$non_pic_object" \
6188 && test "$non_pic_object" != none; then
6189 rmfiles="$rmfiles $dir/$non_pic_object"
6195 if test "$mode" = clean ; then
6199 file=`$echo $file|${SED} 's,.exe$,,'`
6200 noexename=`$echo $name|${SED} 's,.exe$,,'`
6201 # $file with .exe has already been added to rmfiles,
6202 # add $file without .exe
6203 rmfiles="$rmfiles $file"
6206 # Do a test to see if this is a libtool program.
6207 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6211 # note $name still contains .exe if it was in $file originally
6212 # as does the version of $file that was added into $rmfiles
6213 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6214 if test "$fast_install" = yes && test -n "$relink_command"; then
6215 rmfiles="$rmfiles $objdir/lt-$name"
6217 if test "X$noexename" != "X$name" ; then
6218 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6224 $show "$rm $rmfiles"
6225 $run $rm $rmfiles || exit_status=1
6227 objdir="$origobjdir"
6229 # Try to remove the ${objdir}s in the directories where we deleted files
6230 for dir in $rmdirs; do
6231 if test -d "$dir"; then
6233 $run rmdir $dir >/dev/null 2>&1
6241 $echo "$modename: you must specify a MODE" 1>&2
6242 $echo "$generic_help" 1>&2
6247 if test -z "$exec_cmd"; then
6248 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6249 $echo "$generic_help" 1>&2
6252 fi # test -z "$show_help"
6254 if test -n "$exec_cmd"; then
6259 # We need to display help for each of the modes.
6262 "Usage: $modename [OPTION]... [MODE-ARG]...
6264 Provide generalized library-building support services.
6266 --config show all configuration variables
6267 --debug enable verbose shell tracing
6268 -n, --dry-run display commands without modifying any files
6269 --features display basic configuration information and exit
6270 --finish same as \`--mode=finish'
6271 --help display this help message and exit
6272 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6273 --quiet same as \`--silent'
6274 --silent don't print informational messages
6275 --tag=TAG use configuration variables from tag TAG
6276 --version print version information
6278 MODE must be one of the following:
6280 clean remove files from the build directory
6281 compile compile a source file into a libtool object
6282 execute automatically set library path, then run a program
6283 finish complete the installation of libtool libraries
6284 install install libraries or executables
6285 link create a library or an executable
6286 uninstall remove libraries from an installed directory
6288 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6289 a more detailed description of MODE.
6291 Report bugs to <bug-libtool@gnu.org>."
6297 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6299 Remove files from the build directory.
6301 RM is the name of the program to use to delete files associated with each FILE
6302 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6305 If FILE is a libtool library, object or program, all the files associated
6306 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6311 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6313 Compile a source file into a libtool library object.
6315 This mode accepts the following additional options:
6317 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6318 -prefer-pic try to building PIC objects only
6319 -prefer-non-pic try to building non-PIC objects only
6320 -static always build a \`.o' file suitable for static linking
6322 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6323 from the given SOURCEFILE.
6325 The output file name is determined by removing the directory component from
6326 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6327 library object suffix, \`.lo'."
6332 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6334 Automatically set library path, then run a program.
6336 This mode accepts the following additional options:
6338 -dlopen FILE add the directory containing FILE to the library path
6340 This mode sets the library path environment variable according to \`-dlopen'
6343 If any of the ARGS are libtool executable wrappers, then they are translated
6344 into their corresponding uninstalled binary, and any of their required library
6345 directories are added to the library path.
6347 Then, COMMAND is executed, with ARGS as arguments."
6352 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6354 Complete the installation of libtool libraries.
6356 Each LIBDIR is a directory that contains libtool libraries.
6358 The commands that this mode executes may require superuser privileges. Use
6359 the \`--dry-run' option if you just want to see what would be executed."
6364 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6366 Install executables or libraries.
6368 INSTALL-COMMAND is the installation command. The first component should be
6369 either the \`install' or \`cp' program.
6371 The rest of the components are interpreted as arguments to that command (only
6372 BSD-compatible install options are recognized)."
6377 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6379 Link object files or libraries together to form another library, or to
6380 create an executable program.
6382 LINK-COMMAND is a command using the C compiler that you would use to create
6383 a program from several object files.
6385 The following components of LINK-COMMAND are treated specially:
6387 -all-static do not do any dynamic linking at all
6388 -avoid-version do not add a version suffix if possible
6389 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6390 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6391 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6392 -export-symbols SYMFILE
6393 try to export only the symbols listed in SYMFILE
6394 -export-symbols-regex REGEX
6395 try to export only the symbols matching REGEX
6396 -LLIBDIR search LIBDIR for required installed libraries
6397 -lNAME OUTPUT-FILE requires the installed library libNAME
6398 -module build a library that can dlopened
6399 -no-fast-install disable the fast-install mode
6400 -no-install link a not-installable executable
6401 -no-undefined declare that a library does not refer to external symbols
6402 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6403 -objectlist FILE Use a list of object files found in FILE to specify objects
6404 -precious-files-regex REGEX
6405 don't remove output files matching REGEX
6406 -release RELEASE specify package release information
6407 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6408 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6409 -static do not do any dynamic linking of libtool libraries
6410 -version-info CURRENT[:REVISION[:AGE]]
6411 specify library version info [each variable defaults to 0]
6413 All other options (arguments beginning with \`-') are ignored.
6415 Every other argument is treated as a filename. Files ending in \`.la' are
6416 treated as uninstalled libtool libraries, other files are standard or library
6419 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6420 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6421 required, except when creating a convenience library.
6423 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6424 using \`ar' and \`ranlib', or on Windows using \`lib'.
6426 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6427 is created, otherwise an executable program is created."
6432 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6434 Remove libraries from an installation directory.
6436 RM is the name of the program to use to delete files associated with each FILE
6437 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6440 If FILE is a libtool library, all the files associated with it are deleted.
6441 Otherwise, only FILE itself is deleted using RM."
6445 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6452 $echo "Try \`$modename --help' for more information about other modes."
6456 # The TAGs below are defined such that we never get into a situation
6457 # in which we disable both kinds of libraries. Given conflicting
6458 # choices, we go for a static library, that is the most portable,
6459 # since we can't tell whether shared libraries were disabled because
6460 # the user asked for that or because the platform doesn't support
6461 # them. This is particularly important on AIX, because we don't
6462 # support having both static and shared libraries enabled at the same
6463 # time on that platform, so we default to a shared-only configuration.
6464 # If a disable-shared tag is given, we'll fallback to a static-only
6465 # configuration. But we'll never go from static-only to shared-only.
6467 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6468 build_libtool_libs=no
6470 # ### END LIBTOOL TAG CONFIG: disable-shared
6472 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6473 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6474 # ### END LIBTOOL TAG CONFIG: disable-static