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, 2004
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.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # The name of this program:
37 progname=`echo "$progpath" | $SED $basename`
47 TIMESTAMP=" (1.1220.2.94 2004/04/10 16:27:27)"
50 # Check that we have a working $echo.
51 if test "X$1" = X--no-reexec; then
52 # Discard the --no-reexec flag, and continue.
54 elif test "X$1" = X--fallback-echo; then
55 # Avoid inline document here, it may be left over
57 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
58 # Yippee, $echo works!
61 # Restart under the correct shell, and then maybe $echo will work.
62 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
65 if test "X$1" = X--fallback-echo; then
66 # used as fallback echo
75 help="Try \`$progname --help' for more information."
76 magic="%%%MAGIC variable%%%"
81 # Sed substitution that helps us do robust quoting. It backslashifies
82 # metacharacters that are still active within double-quoted strings.
83 Xsed="${SED}"' -e 1s/^X//'
84 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
85 # test EBCDIC or ASCII
86 case `echo A|tr A '\301'` in
87 A) # EBCDIC based system
88 SP2NL="tr '\100' '\n'"
89 NL2SP="tr '\r\n' '\100\100'"
91 *) # Assume ASCII based system
92 SP2NL="tr '\040' '\012'"
93 NL2SP="tr '\015\012' '\040\040'"
98 # Only set LANG and LC_ALL to C if already set.
99 # These must not be set unconditionally because not all systems understand
100 # e.g. LANG=C (notably SCO).
101 # We save the old values to restore during execute mode.
102 if test "${LC_ALL+set}" = set; then
103 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
105 if test "${LANG+set}" = set; then
106 save_LANG="$LANG"; LANG=C; export LANG
109 # Make sure IFS has a sensible default
113 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
114 $echo "$modename: not configured to build any kind of library" 1>&2
115 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
128 lo2o="s/\\.lo\$/.${objext}/"
129 o2lo="s/\\.${objext}\$/.lo/"
131 #####################################
132 # Shell function definitions:
133 # This seems to be the best place for them
135 # func_win32_libid arg
136 # return the library type of file 'arg'
138 # Need a lot of goo to handle *both* DLLs and import libs
139 # Has to be a shell function in order to 'eat' the argument
140 # that is supplied when $file_magic_command is called.
141 func_win32_libid () {
142 win32_libid_type="unknown"
143 win32_fileres=`file -L $1 2>/dev/null`
144 case $win32_fileres in
145 *ar\ archive\ import\ library*) # definitely import
146 win32_libid_type="x86 archive import"
148 *ar\ archive*) # could be an import, or static
149 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
150 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
151 win32_nmres=`eval $NM -f posix -A $1 | \
152 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
153 if test "X$win32_nmres" = "Ximport" ; then
154 win32_libid_type="x86 archive import"
156 win32_libid_type="x86 archive static"
161 win32_libid_type="x86 DLL"
163 *executable*) # but shell scripts are "executable" too...
164 case $win32_fileres in
165 *MS\ Windows\ PE\ Intel*)
166 win32_libid_type="x86 DLL"
171 $echo $win32_libid_type
176 # Infer tagged configuration to use if any are available and
177 # if one wasn't chosen via the "--tag" command line option.
178 # Only attempt this if the compiler in the base compile
179 # command doesn't match the default compiler.
180 # arg is usually of the form 'gcc ...'
182 if test -n "$available_tags" && test -z "$tagname"; then
186 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
190 CC_quoted="$CC_quoted $arg"
193 # Blanks in the command may have been stripped by the calling shell,
194 # but not from the CC environment variable when configure was run.
195 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
196 # Blanks at the start of $base_compile will cause this to fail
197 # if we don't check for them as well.
199 for z in $available_tags; do
200 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
201 # Evaluate the configuration.
202 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
205 # Double-quote args containing other shell metacharacters.
207 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
211 CC_quoted="$CC_quoted $arg"
214 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
215 # The compiler in the base compile command matches
216 # the one in the tagged configuration.
217 # Assume this is the tagged configuration we want.
224 # If $tagname still isn't set, then no tagged configuration
225 # was found and let the user know that the "--tag" command
226 # line option must be used.
227 if test -z "$tagname"; then
228 $echo "$modename: unable to infer tagged configuration"
229 $echo "$modename: specify a tag with \`--tag'" 1>&2
232 # $echo "$modename: using $tagname tagged configuration"
238 # End of Shell function definitions
239 #####################################
242 eval std_shrext=\"$shrext_cmds\"
244 # Parse our command line options once, thoroughly.
245 while test "$#" -gt 0
251 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
255 # If the previous option needs an argument, assign it.
256 if test -n "$prev"; then
259 execute_dlfiles="$execute_dlfiles $arg"
263 preserve_args="${preserve_args}=$arg"
265 # Check whether tagname contains only valid characters
268 $echo "$progname: invalid tag name: $tagname" 1>&2
275 # Don't test for the "default" C tag, as we know, it's there, but
276 # not specially marked.
279 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
280 taglist="$taglist $tagname"
281 # Evaluate the configuration.
282 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
284 $echo "$progname: ignoring unknown tag $tagname" 1>&2
299 # Have we seen a non-optional argument yet?
306 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
308 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
309 $echo "This is free software; see the source for copying conditions. There is NO"
310 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
315 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
316 # Now print the configurations for the tags.
317 for tagname in $taglist; do
318 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
324 $echo "$progname: enabling shell trace mode"
326 preserve_args="$preserve_args $arg"
335 if test "$build_libtool_libs" = yes; then
336 $echo "enable shared libraries"
338 $echo "disable shared libraries"
340 if test "$build_old_libs" = yes; then
341 $echo "enable static libraries"
343 $echo "disable static libraries"
348 --finish) mode="finish" ;;
350 --mode) prevopt="--mode" prev=mode ;;
351 --mode=*) mode="$optarg" ;;
353 --preserve-dup-deps) duplicate_deps="yes" ;;
357 preserve_args="$preserve_args $arg"
360 --tag) prevopt="--tag" prev=tag ;;
362 set tag "$optarg" ${1+"$@"}
365 preserve_args="$preserve_args --tag"
374 $echo "$modename: unrecognized option \`$arg'" 1>&2
386 if test -n "$prevopt"; then
387 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
392 # If this variable is set in any of the actions, the command in it
393 # will be execed at the end. This prevents here-documents from being
394 # left over by shells.
397 if test -z "$show_help"; then
399 # Infer the operation mode.
400 if test -z "$mode"; then
401 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
402 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
404 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
416 *db | *dbx | *strace | *truss)
426 # If we have no mode, but dlfiles were specified, then do execute mode.
427 test -n "$execute_dlfiles" && mode=execute
429 # Just use the default operation mode.
430 if test -z "$mode"; then
431 if test -n "$nonopt"; then
432 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
434 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
441 # Only execute mode is allowed to have -dlopen flags.
442 if test -n "$execute_dlfiles" && test "$mode" != execute; then
443 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
448 # Change the help message to a mode-specific one.
450 help="Try \`$modename --help --mode=$mode' for more information."
452 # These modes are in order of execution frequency so that they run quickly.
454 # libtool compile mode
456 modename="$modename: compile"
457 # Get the compilation command and the source file.
459 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
470 # do not "continue". Instead, add this to base_compile
482 # Accept any command-line options.
485 if test -n "$libobj" ; then
486 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
493 -static | -prefer-pic | -prefer-non-pic)
504 arg_mode=arg # the next one goes into the "base_compile" arg list
505 continue # The current "srcfile" will either be retained or
506 ;; # replaced later. I would guess that would be a bug.
509 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
511 save_ifs="$IFS"; IFS=','
515 # Double-quote args containing other shell metacharacters.
516 # Many Bourne shells cannot handle close brackets correctly
517 # in scan sets, so we specify it separately.
519 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
523 lastarg="$lastarg $arg"
526 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
528 # Add the arguments to base_compile.
529 base_compile="$base_compile $lastarg"
534 # Accept the current argument as the source file.
535 # The previous "srcfile" becomes the current argument.
542 esac # case $arg_mode
544 # Aesthetically quote the previous argument.
545 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
548 # Double-quote args containing other shell metacharacters.
549 # Many Bourne shells cannot handle close brackets correctly
550 # in scan sets, so we specify it separately.
551 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
552 lastarg="\"$lastarg\""
556 base_compile="$base_compile $lastarg"
561 $echo "$modename: you must specify an argument for -Xcompile"
565 $echo "$modename: you must specify a target with \`-o'" 1>&2
569 # Get the name of the library object.
570 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
574 # Recognize several different file suffixes.
575 # If the user specifies -o file.o, it is replaced with file.lo
585 *.class) xform=class ;;
590 *.java) xform=java ;;
593 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
596 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
598 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
603 func_infer_tag $base_compile
605 for arg in $later; do
624 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
625 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
626 if test "X$xdir" = "X$obj"; then
631 lobj=${xdir}$objdir/$objname
633 if test -z "$base_compile"; then
634 $echo "$modename: you must specify a compilation command" 1>&2
639 # Delete any leftover library objects.
640 if test "$build_old_libs" = yes; then
641 removelist="$obj $lobj $libobj ${libobj}T"
643 removelist="$lobj $libobj ${libobj}T"
647 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
649 # On Cygwin there's no "real" PIC flag so we must build both object types
651 cygwin* | mingw* | pw32* | os2*)
655 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
656 # non-PIC code in shared libraries is not supported
660 # Calculate the filename of the output object if compiler does
661 # not support -o with -c
662 if test "$compiler_c_o" = no; then
663 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
664 lockfile="$output_obj.lock"
665 removelist="$removelist $output_obj $lockfile"
666 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
673 # Lock this critical section if it is needed
674 # We use this script file to make the link, it avoids creating a new file
675 if test "$need_locks" = yes; then
676 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
677 $show "Waiting for $lockfile to be removed"
680 elif test "$need_locks" = warn; then
681 if test -f "$lockfile"; then
683 *** ERROR, $lockfile exists and contains:
684 `cat $lockfile 2>/dev/null`
686 This indicates that another process is trying to use the same
687 temporary object file, and libtool could not work around it because
688 your compiler does not support \`-c' and \`-o' together. If you
689 repeat this compilation, it may succeed, by chance, but you had better
690 avoid parallel builds (make -j) in this platform, or get a better
696 $echo $srcfile > "$lockfile"
699 if test -n "$fix_srcfile_path"; then
700 eval srcfile=\"$fix_srcfile_path\"
703 $run $rm "$libobj" "${libobj}T"
705 # Create a libtool object file (analogous to a ".la" file),
706 # but don't create it if we're doing a dry run.
707 test -z "$run" && cat > ${libobj}T <<EOF
708 # $libobj - a libtool object file
709 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
711 # Please DO NOT delete this file!
712 # It is necessary for linking the library.
714 # Name of the PIC object.
717 # Only build a PIC object if we are building libtool libraries.
718 if test "$build_libtool_libs" = yes; then
719 # Without this assignment, base_compile gets emptied.
720 fbsd_hideous_sh_bug=$base_compile
722 if test "$pic_mode" != no; then
723 command="$base_compile $srcfile $pic_flag"
725 # Don't build PIC code
726 command="$base_compile $srcfile"
729 if test ! -d "${xdir}$objdir"; then
730 $show "$mkdir ${xdir}$objdir"
731 $run $mkdir ${xdir}$objdir
733 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
738 if test -z "$output_obj"; then
739 # Place PIC objects in $objdir
740 command="$command -o $lobj"
743 $run $rm "$lobj" "$output_obj"
746 if $run eval "$command"; then :
748 test -n "$output_obj" && $run $rm $removelist
752 if test "$need_locks" = warn &&
753 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
755 *** ERROR, $lockfile contains:
756 `cat $lockfile 2>/dev/null`
758 but it should contain:
761 This indicates that another process is trying to use the same
762 temporary object file, and libtool could not work around it because
763 your compiler does not support \`-c' and \`-o' together. If you
764 repeat this compilation, it may succeed, by chance, but you had better
765 avoid parallel builds (make -j) in this platform, or get a better
772 # Just move the object if needed, then go on to compile the next one
773 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
774 $show "$mv $output_obj $lobj"
775 if $run $mv $output_obj $lobj; then :
783 # Append the name of the PIC object to the libtool object file.
784 test -z "$run" && cat >> ${libobj}T <<EOF
785 pic_object='$objdir/$objname'
789 # Allow error messages only from the first compilation.
790 if test "$suppress_opt" = yes; then
791 suppress_output=' >/dev/null 2>&1'
794 # No PIC object so indicate it doesn't exist in the libtool
796 test -z "$run" && cat >> ${libobj}T <<EOF
802 # Only build a position-dependent object if we build old libraries.
803 if test "$build_old_libs" = yes; then
804 if test "$pic_mode" != yes; then
805 # Don't build PIC code
806 command="$base_compile $srcfile"
808 command="$base_compile $srcfile $pic_flag"
810 if test "$compiler_c_o" = yes; then
811 command="$command -o $obj"
814 # Suppress compiler output if we already did a PIC compilation.
815 command="$command$suppress_output"
816 $run $rm "$obj" "$output_obj"
818 if $run eval "$command"; then :
824 if test "$need_locks" = warn &&
825 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
827 *** ERROR, $lockfile contains:
828 `cat $lockfile 2>/dev/null`
830 but it should contain:
833 This indicates that another process is trying to use the same
834 temporary object file, and libtool could not work around it because
835 your compiler does not support \`-c' and \`-o' together. If you
836 repeat this compilation, it may succeed, by chance, but you had better
837 avoid parallel builds (make -j) in this platform, or get a better
844 # Just move the object if needed
845 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
846 $show "$mv $output_obj $obj"
847 if $run $mv $output_obj $obj; then :
855 # Append the name of the non-PIC object the libtool object file.
856 # Only append if the libtool object file exists.
857 test -z "$run" && cat >> ${libobj}T <<EOF
858 # Name of the non-PIC object.
859 non_pic_object='$objname'
863 # Append the name of the non-PIC object the libtool object file.
864 # Only append if the libtool object file exists.
865 test -z "$run" && cat >> ${libobj}T <<EOF
866 # Name of the non-PIC object.
872 $run $mv "${libobj}T" "${libobj}"
874 # Unlock the critical section if it was locked
875 if test "$need_locks" != no; then
884 modename="$modename: link"
886 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
887 # It is impossible to link a dll without this setting, and
888 # we shouldn't force the makefile maintainer to figure out
889 # which system we are compiling for in order to pass an extra
890 # flag for every libtool invocation.
893 # FIXME: Unfortunately, there are problems with the above when trying
894 # to make a dll which has undefined symbols, in which case not
895 # even a static library is built. For now, we need to specify
896 # -no-undefined on the libtool link line when we can be certain
897 # that all symbols are satisfied, otherwise we get a static library.
904 libtool_args="$nonopt"
905 base_compile="$nonopt $@"
906 compile_command="$nonopt"
907 finalize_command="$nonopt"
920 lib_search_path=`pwd`
929 export_symbols_regex=
937 precious_files_regex=
938 prefer_static_libs=no
951 func_infer_tag $base_compile
953 # We need to know -static, to get the right output filenames.
957 -all-static | -static)
958 if test "X$arg" = "X-all-static"; then
959 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
960 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
962 if test -n "$link_static_flag"; then
963 dlopen_self=$dlopen_self_static
966 if test -z "$pic_flag" && test -n "$link_static_flag"; then
967 dlopen_self=$dlopen_self_static
970 build_libtool_libs=no
972 prefer_static_libs=yes
978 # See if our shared archives depend on static archives.
979 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
981 # Go through the arguments, transforming them on the way.
982 while test "$#" -gt 0; do
986 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
987 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
991 libtool_args="$libtool_args $qarg"
993 # If the previous option needs an argument, assign it.
994 if test -n "$prev"; then
997 compile_command="$compile_command @OUTPUT@"
998 finalize_command="$finalize_command @OUTPUT@"
1004 if test "$preload" = no; then
1005 # Add the symbol object into the linking commands.
1006 compile_command="$compile_command @SYMFILE@"
1007 finalize_command="$finalize_command @SYMFILE@"
1011 *.la | *.lo) ;; # We handle these cases below.
1013 if test "$dlself" = no; then
1021 if test "$prev" = dlprefiles; then
1023 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1033 if test "$prev" = dlfiles; then
1034 dlfiles="$dlfiles $arg"
1036 dlprefiles="$dlprefiles $arg"
1044 export_symbols="$arg"
1045 if test ! -f "$arg"; then
1046 $echo "$modename: symbol file \`$arg' does not exist"
1053 export_symbols_regex="$arg"
1058 inst_prefix_dir="$arg"
1063 precious_files_regex="$arg"
1073 if test -f "$arg"; then
1076 for fil in `cat $save_arg`
1078 # moreargs="$moreargs $fil"
1080 # A libtool-controlled object.
1082 # Check to see that this really is a libtool object.
1083 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1088 # If there is no directory component, then add one.
1090 */* | *\\*) . $arg ;;
1094 if test -z "$pic_object" || \
1095 test -z "$non_pic_object" ||
1096 test "$pic_object" = none && \
1097 test "$non_pic_object" = none; then
1098 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1102 # Extract subdirectory from the argument.
1103 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1104 if test "X$xdir" = "X$arg"; then
1110 if test "$pic_object" != none; then
1111 # Prepend the subdirectory the object is found in.
1112 pic_object="$xdir$pic_object"
1114 if test "$prev" = dlfiles; then
1115 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1116 dlfiles="$dlfiles $pic_object"
1120 # If libtool objects are unsupported, then we need to preload.
1125 # CHECK ME: I think I busted this. -Ossama
1126 if test "$prev" = dlprefiles; then
1127 # Preload the old-style object.
1128 dlprefiles="$dlprefiles $pic_object"
1133 libobjs="$libobjs $pic_object"
1138 if test "$non_pic_object" != none; then
1139 # Prepend the subdirectory the object is found in.
1140 non_pic_object="$xdir$non_pic_object"
1142 # A standard non-PIC object
1143 non_pic_objects="$non_pic_objects $non_pic_object"
1144 if test -z "$pic_object" || test "$pic_object" = none ; then
1145 arg="$non_pic_object"
1149 # Only an error if not doing a dry-run.
1150 if test -z "$run"; then
1151 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1156 # Extract subdirectory from the argument.
1157 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1158 if test "X$xdir" = "X$arg"; then
1164 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1165 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1166 libobjs="$libobjs $pic_object"
1167 non_pic_objects="$non_pic_objects $non_pic_object"
1172 $echo "$modename: link input file \`$save_arg' does not exist"
1180 # We need an absolute path.
1182 [\\/]* | [A-Za-z]:[\\/]*) ;;
1184 $echo "$modename: only absolute run-paths are allowed" 1>&2
1188 if test "$prev" = rpath; then
1191 *) rpath="$rpath $arg" ;;
1196 *) xrpath="$xrpath $arg" ;;
1203 compiler_flags="$compiler_flags $qarg"
1205 compile_command="$compile_command $qarg"
1206 finalize_command="$finalize_command $qarg"
1210 linker_flags="$linker_flags $qarg"
1211 compiler_flags="$compiler_flags $wl$qarg"
1213 compile_command="$compile_command $wl$qarg"
1214 finalize_command="$finalize_command $wl$qarg"
1218 linker_flags="$linker_flags $qarg"
1219 compiler_flags="$compiler_flags $qarg"
1221 compile_command="$compile_command $qarg"
1222 finalize_command="$finalize_command $qarg"
1231 eval "$prev=\"\$arg\""
1236 fi # test -n "$prev"
1242 if test -n "$link_static_flag"; then
1243 compile_command="$compile_command $link_static_flag"
1244 finalize_command="$finalize_command $link_static_flag"
1250 # FIXME: remove this flag sometime in the future.
1251 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1275 -export-symbols | -export-symbols-regex)
1276 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1277 $echo "$modename: more than one -exported-symbols argument is not allowed"
1280 if test "X$arg" = "X-export-symbols"; then
1293 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1294 # so, if we see these flags be careful not to treat them like -L
1296 case $with_gcc/$host in
1297 no/*-*-irix* | /*-*-irix*)
1298 compile_command="$compile_command $arg"
1299 finalize_command="$finalize_command $arg"
1306 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1307 # We need an absolute path.
1309 [\\/]* | [A-Za-z]:[\\/]*) ;;
1311 absdir=`cd "$dir" && pwd`
1312 if test -z "$absdir"; then
1313 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1322 deplibs="$deplibs -L$dir"
1323 lib_search_path="$lib_search_path $dir"
1327 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1328 case :$dllsearchpath: in
1330 *) dllsearchpath="$dllsearchpath:$dir";;
1338 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1340 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1341 # These systems don't actually have a C or math library (as such)
1344 *-*-mingw* | *-*-os2*)
1345 # These systems don't actually have a C library (as such)
1346 test "X$arg" = "X-lc" && continue
1348 *-*-openbsd* | *-*-freebsd*)
1349 # Do not include libc due to us having libc/libc_r.
1350 test "X$arg" = "X-lc" && continue
1352 *-*-rhapsody* | *-*-darwin1.[012])
1353 # Rhapsody C and math libraries are in the System framework
1354 deplibs="$deplibs -framework System"
1357 elif test "X$arg" = "X-lc_r"; then
1359 *-*-openbsd* | *-*-freebsd*)
1360 # Do not include libc_r directly, use -pthread flag.
1365 deplibs="$deplibs $arg"
1369 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1370 deplibs="$deplibs $arg"
1379 # gcc -m* arguments should be passed to the linker via $compiler_flags
1380 # in order to pass architecture information to the linker
1381 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1382 # but this is not reliable with gcc because gcc may use -mfoo to
1383 # select a different linker, different libraries, etc, while
1384 # -Wl,-mfoo simply passes -mfoo to the linker.
1386 # Unknown arguments in both finalize_command and compile_command need
1387 # to be aesthetically quoted because they are evaled later.
1388 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1390 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1394 compile_command="$compile_command $arg"
1395 finalize_command="$finalize_command $arg"
1396 if test "$with_gcc" = "yes" ; then
1397 compiler_flags="$compiler_flags $arg"
1414 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1415 # The PATH hackery in wrapper scripts is required on Windows
1416 # in order for the loader to find any dlls it needs.
1417 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1418 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1421 *) no_install=yes ;;
1438 -precious-files-regex)
1459 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1460 # We need an absolute path.
1462 [\\/]* | [A-Za-z]:[\\/]*) ;;
1464 $echo "$modename: only absolute run-paths are allowed" 1>&2
1470 *) xrpath="$xrpath $dir" ;;
1476 # The effects of -static are defined in a previous loop.
1477 # We used to do the same as -all-static on platforms that
1478 # didn't have a PIC flag, but the assumption that the effects
1479 # would be equivalent was wrong. It would break on at least
1480 # Digital Unix and AIX.
1500 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1502 save_ifs="$IFS"; IFS=','
1503 for flag in $args; do
1506 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1511 compiler_flags="$compiler_flags $flag"
1514 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1518 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1520 save_ifs="$IFS"; IFS=','
1521 for flag in $args; do
1524 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1529 compiler_flags="$compiler_flags $wl$flag"
1530 linker_flags="$linker_flags $flag"
1533 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1551 # Some other compiler flag.
1553 # Unknown arguments in both finalize_command and compile_command need
1554 # to be aesthetically quoted because they are evaled later.
1555 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1557 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1564 # A standard object.
1569 # A libtool-controlled object.
1571 # Check to see that this really is a libtool object.
1572 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1577 # If there is no directory component, then add one.
1579 */* | *\\*) . $arg ;;
1583 if test -z "$pic_object" || \
1584 test -z "$non_pic_object" ||
1585 test "$pic_object" = none && \
1586 test "$non_pic_object" = none; then
1587 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1591 # Extract subdirectory from the argument.
1592 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1593 if test "X$xdir" = "X$arg"; then
1599 if test "$pic_object" != none; then
1600 # Prepend the subdirectory the object is found in.
1601 pic_object="$xdir$pic_object"
1603 if test "$prev" = dlfiles; then
1604 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1605 dlfiles="$dlfiles $pic_object"
1609 # If libtool objects are unsupported, then we need to preload.
1614 # CHECK ME: I think I busted this. -Ossama
1615 if test "$prev" = dlprefiles; then
1616 # Preload the old-style object.
1617 dlprefiles="$dlprefiles $pic_object"
1622 libobjs="$libobjs $pic_object"
1627 if test "$non_pic_object" != none; then
1628 # Prepend the subdirectory the object is found in.
1629 non_pic_object="$xdir$non_pic_object"
1631 # A standard non-PIC object
1632 non_pic_objects="$non_pic_objects $non_pic_object"
1633 if test -z "$pic_object" || test "$pic_object" = none ; then
1634 arg="$non_pic_object"
1638 # Only an error if not doing a dry-run.
1639 if test -z "$run"; then
1640 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1645 # Extract subdirectory from the argument.
1646 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1647 if test "X$xdir" = "X$arg"; then
1653 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1654 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1655 libobjs="$libobjs $pic_object"
1656 non_pic_objects="$non_pic_objects $non_pic_object"
1663 deplibs="$deplibs $arg"
1664 old_deplibs="$old_deplibs $arg"
1669 # A libtool-controlled library.
1671 if test "$prev" = dlfiles; then
1672 # This library was specified with -dlopen.
1673 dlfiles="$dlfiles $arg"
1675 elif test "$prev" = dlprefiles; then
1676 # The library was specified with -dlpreopen.
1677 dlprefiles="$dlprefiles $arg"
1680 deplibs="$deplibs $arg"
1685 # Some other compiler argument.
1687 # Unknown arguments in both finalize_command and compile_command need
1688 # to be aesthetically quoted because they are evaled later.
1689 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1691 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1698 # Now actually substitute the argument into the commands.
1699 if test -n "$arg"; then
1700 compile_command="$compile_command $arg"
1701 finalize_command="$finalize_command $arg"
1703 done # argument parsing loop
1705 if test -n "$prev"; then
1706 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1711 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1712 eval arg=\"$export_dynamic_flag_spec\"
1713 compile_command="$compile_command $arg"
1714 finalize_command="$finalize_command $arg"
1718 # calculate the name of the file, without its directory
1719 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1720 libobjs_save="$libobjs"
1722 if test -n "$shlibpath_var"; then
1723 # get the directories listed in $shlibpath_var
1724 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1728 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1729 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1731 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1732 if test "X$output_objdir" = "X$output"; then
1733 output_objdir="$objdir"
1735 output_objdir="$output_objdir/$objdir"
1737 # Create the object directory.
1738 if test ! -d "$output_objdir"; then
1739 $show "$mkdir $output_objdir"
1740 $run $mkdir $output_objdir
1742 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1747 # Determine the type of output
1750 $echo "$modename: you must specify an output file" 1>&2
1754 *.$libext) linkmode=oldlib ;;
1755 *.lo | *.$objext) linkmode=obj ;;
1756 *.la) linkmode=lib ;;
1757 *) linkmode=prog ;; # Anything else should be a program.
1761 *cygwin* | *mingw* | *pw32*)
1762 # don't eliminate duplications in $postdeps and $predeps
1763 duplicate_compiler_generated_deps=yes
1766 duplicate_compiler_generated_deps=$duplicate_deps
1772 # Find all interdependent deplibs by searching for libraries
1773 # that are linked more than once (e.g. -la -lb -la)
1774 for deplib in $deplibs; do
1775 if test "X$duplicate_deps" = "Xyes" ; then
1777 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1780 libs="$libs $deplib"
1783 if test "$linkmode" = lib; then
1784 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1786 # Compute libraries that are listed more than once in $predeps
1787 # $postdeps and mark them as special (i.e., whose duplicates are
1788 # not to be eliminated).
1790 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1791 for pre_post_dep in $predeps $postdeps; do
1792 case "$pre_post_deps " in
1793 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1795 pre_post_deps="$pre_post_deps $pre_post_dep"
1804 need_relink=no # whether we're linking any uninstalled libtool libraries
1805 notinst_deplibs= # not-installed libtool libraries
1806 notinst_path= # paths that contain not-installed libtool libraries
1810 for file in $dlfiles $dlprefiles; do
1814 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1826 passes="conv scan dlopen dlpreopen link"
1831 for pass in $passes; do
1832 if test "$linkmode,$pass" = "lib,link" ||
1833 test "$linkmode,$pass" = "prog,scan"; then
1837 if test "$linkmode" = prog; then
1839 dlopen) libs="$dlfiles" ;;
1840 dlpreopen) libs="$dlprefiles" ;;
1841 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1844 if test "$pass" = dlopen; then
1845 # Collect dlpreopened libraries
1846 save_deplibs="$deplibs"
1849 for deplib in $libs; do
1853 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1854 if test "$linkmode,$pass" = "prog,link"; then
1855 compile_deplibs="$deplib $compile_deplibs"
1856 finalize_deplibs="$deplib $finalize_deplibs"
1858 deplibs="$deplib $deplibs"
1863 if test "$linkmode" != lib && test "$linkmode" != prog; then
1864 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1867 if test "$pass" = conv; then
1868 deplibs="$deplib $deplibs"
1871 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1872 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1873 for search_ext in .la $std_shrext .so .a; do
1874 # Search the libtool library
1875 lib="$searchdir/lib${name}${search_ext}"
1876 if test -f "$lib"; then
1877 if test "$search_ext" = ".la"; then
1886 if test "$found" != yes; then
1887 # deplib doesn't seem to be a libtool library
1888 if test "$linkmode,$pass" = "prog,link"; then
1889 compile_deplibs="$deplib $compile_deplibs"
1890 finalize_deplibs="$deplib $finalize_deplibs"
1892 deplibs="$deplib $deplibs"
1893 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1896 else # deplib is a libtool library
1897 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1898 # We need to do some special things here, and not later.
1899 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1900 case " $predeps $postdeps " in
1902 if (${SED} -e '2q' $lib |
1903 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1907 */* | *\\*) . $lib ;;
1910 for l in $old_library $library_names; do
1913 if test "X$ll" = "X$old_library" ; then # only static version available
1915 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1916 test "X$ladir" = "X$lib" && ladir="."
1917 lib=$ladir/$old_library
1918 if test "$linkmode,$pass" = "prog,link"; then
1919 compile_deplibs="$deplib $compile_deplibs"
1920 finalize_deplibs="$deplib $finalize_deplibs"
1922 deplibs="$deplib $deplibs"
1923 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1937 deplibs="$deplib $deplibs"
1938 test "$pass" = conv && continue
1939 newdependency_libs="$deplib $newdependency_libs"
1940 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1943 if test "$pass" = conv; then
1944 deplibs="$deplib $deplibs"
1947 if test "$pass" = scan; then
1948 deplibs="$deplib $deplibs"
1950 compile_deplibs="$deplib $compile_deplibs"
1951 finalize_deplibs="$deplib $finalize_deplibs"
1953 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1956 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1962 if test "$pass" = link; then
1963 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1964 # Make sure the xrpath contains only unique directories.
1967 *) xrpath="$xrpath $dir" ;;
1970 deplibs="$deplib $deplibs"
1973 *.la) lib="$deplib" ;;
1975 if test "$pass" = conv; then
1976 deplibs="$deplib $deplibs"
1981 if test "$deplibs_check_method" != pass_all; then
1983 $echo "*** Warning: Trying to link with static lib archive $deplib."
1984 $echo "*** I have the capability to make that library automatically link in when"
1985 $echo "*** you link to this library. But I can only do this if you have a"
1986 $echo "*** shared version of the library, which you do not appear to have"
1987 $echo "*** because the file extensions .$libext of this argument makes me believe"
1988 $echo "*** that it is just a static archive that I should not used here."
1991 $echo "*** Warning: Linking the shared library $output against the"
1992 $echo "*** static library $deplib is not portable!"
1993 deplibs="$deplib $deplibs"
1998 if test "$pass" != link; then
1999 deplibs="$deplib $deplibs"
2001 compile_deplibs="$deplib $compile_deplibs"
2002 finalize_deplibs="$deplib $finalize_deplibs"
2009 if test "$pass" = conv; then
2010 deplibs="$deplib $deplibs"
2011 elif test "$linkmode" = prog; then
2012 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2013 # If there is no dlopen support or we're linking statically,
2014 # we need to preload.
2015 newdlprefiles="$newdlprefiles $deplib"
2016 compile_deplibs="$deplib $compile_deplibs"
2017 finalize_deplibs="$deplib $finalize_deplibs"
2019 newdlfiles="$newdlfiles $deplib"
2029 if test "$found" = yes || test -f "$lib"; then :
2031 $echo "$modename: cannot find the library \`$lib'" 1>&2
2035 # Check to see that this really is a libtool archive.
2036 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2038 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2042 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2043 test "X$ladir" = "X$lib" && ladir="."
2051 # If the library was installed with an old release of libtool,
2052 # it will not redefine variables installed, or shouldnotlink
2058 */* | *\\*) . $lib ;;
2062 if test "$linkmode,$pass" = "lib,link" ||
2063 test "$linkmode,$pass" = "prog,scan" ||
2064 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2065 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2066 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2069 if test "$pass" = conv; then
2070 # Only check for convenience libraries
2071 deplibs="$lib $deplibs"
2072 if test -z "$libdir"; then
2073 if test -z "$old_library"; then
2074 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2077 # It is a libtool convenience library, so add in its objects.
2078 convenience="$convenience $ladir/$objdir/$old_library"
2079 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2081 for deplib in $dependency_libs; do
2082 deplibs="$deplib $deplibs"
2083 if test "X$duplicate_deps" = "Xyes" ; then
2084 case "$tmp_libs " in
2085 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2088 tmp_libs="$tmp_libs $deplib"
2090 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2091 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2098 # Get the name of the library we link against.
2100 for l in $old_library $library_names; do
2103 if test -z "$linklib"; then
2104 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2108 # This library was specified with -dlopen.
2109 if test "$pass" = dlopen; then
2110 if test -z "$libdir"; then
2111 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2114 if test -z "$dlname" ||
2115 test "$dlopen_support" != yes ||
2116 test "$build_libtool_libs" = no; then
2117 # If there is no dlname, no dlopen support or we're linking
2118 # statically, we need to preload. We also need to preload any
2119 # dependent libraries so libltdl's deplib preloader doesn't
2120 # bomb out in the load deplibs phase.
2121 dlprefiles="$dlprefiles $lib $dependency_libs"
2123 newdlfiles="$newdlfiles $lib"
2128 # We need an absolute path.
2130 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2132 abs_ladir=`cd "$ladir" && pwd`
2133 if test -z "$abs_ladir"; then
2134 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2135 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2140 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2142 # Find the relevant object directory and library name.
2143 if test "X$installed" = Xyes; then
2144 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2145 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2154 dir="$ladir/$objdir"
2155 absdir="$abs_ladir/$objdir"
2156 # Remove this search path later
2157 notinst_path="$notinst_path $abs_ladir"
2158 fi # $installed = yes
2159 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2161 # This library was specified with -dlpreopen.
2162 if test "$pass" = dlpreopen; then
2163 if test -z "$libdir"; then
2164 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2167 # Prefer using a static library (so that no silly _DYNAMIC symbols
2168 # are required to link).
2169 if test -n "$old_library"; then
2170 newdlprefiles="$newdlprefiles $dir/$old_library"
2171 # Otherwise, use the dlname, so that lt_dlopen finds it.
2172 elif test -n "$dlname"; then
2173 newdlprefiles="$newdlprefiles $dir/$dlname"
2175 newdlprefiles="$newdlprefiles $dir/$linklib"
2177 fi # $pass = dlpreopen
2179 if test -z "$libdir"; then
2180 # Link the convenience library
2181 if test "$linkmode" = lib; then
2182 deplibs="$dir/$old_library $deplibs"
2183 elif test "$linkmode,$pass" = "prog,link"; then
2184 compile_deplibs="$dir/$old_library $compile_deplibs"
2185 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2187 deplibs="$lib $deplibs" # used for prog,scan pass
2193 if test "$linkmode" = prog && test "$pass" != link; then
2194 newlib_search_path="$newlib_search_path $ladir"
2195 deplibs="$lib $deplibs"
2198 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2199 test "$build_libtool_libs" = no; then
2204 for deplib in $dependency_libs; do
2206 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2208 # Need to link against all dependency_libs?
2209 if test "$linkalldeplibs" = yes; then
2210 deplibs="$deplib $deplibs"
2212 # Need to hardcode shared library paths
2213 # or/and link against static libraries
2214 newdependency_libs="$deplib $newdependency_libs"
2216 if test "X$duplicate_deps" = "Xyes" ; then
2217 case "$tmp_libs " in
2218 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2221 tmp_libs="$tmp_libs $deplib"
2224 fi # $linkmode = prog...
2226 if test "$linkmode,$pass" = "prog,link"; then
2227 if test -n "$library_names" &&
2228 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2229 # We need to hardcode the library path
2230 if test -n "$shlibpath_var"; then
2231 # Make sure the rpath contains only unique directories.
2232 case "$temp_rpath " in
2235 *) temp_rpath="$temp_rpath $dir" ;;
2239 # Hardcode the library path.
2240 # Skip directories that are in the system default run-time
2242 case " $sys_lib_dlsearch_path " in
2245 case "$compile_rpath " in
2247 *) compile_rpath="$compile_rpath $absdir"
2251 case " $sys_lib_dlsearch_path " in
2254 case "$finalize_rpath " in
2256 *) finalize_rpath="$finalize_rpath $libdir"
2260 fi # $linkmode,$pass = prog,link...
2262 if test "$alldeplibs" = yes &&
2263 { test "$deplibs_check_method" = pass_all ||
2264 { test "$build_libtool_libs" = yes &&
2265 test -n "$library_names"; }; }; then
2266 # We only need to search for static libraries
2271 link_static=no # Whether the deplib will be linked statically
2272 if test -n "$library_names" &&
2273 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2274 if test "$installed" = no; then
2275 notinst_deplibs="$notinst_deplibs $lib"
2278 # This is a shared library
2280 # Warn about portability, can't link against -module's on
2281 # some systems (darwin)
2282 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2284 if test "$linkmode" = prog; then
2285 $echo "*** Warning: Linking the executable $output against the loadable module"
2287 $echo "*** Warning: Linking the shared library $output against the loadable module"
2289 $echo "*** $linklib is not portable!"
2291 if test "$linkmode" = lib &&
2292 test "$hardcode_into_libs" = yes; then
2293 # Hardcode the library path.
2294 # Skip directories that are in the system default run-time
2296 case " $sys_lib_dlsearch_path " in
2299 case "$compile_rpath " in
2301 *) compile_rpath="$compile_rpath $absdir"
2305 case " $sys_lib_dlsearch_path " in
2308 case "$finalize_rpath " in
2310 *) finalize_rpath="$finalize_rpath $libdir"
2316 if test -n "$old_archive_from_expsyms_cmds"; then
2317 # figure out the soname
2318 set dummy $library_names
2321 libname=`eval \\$echo \"$libname_spec\"`
2322 # use dlname if we got it. it's perfectly good, no?
2323 if test -n "$dlname"; then
2325 elif test -n "$soname_spec"; then
2329 major=`expr $current - $age`
2333 eval soname=\"$soname_spec\"
2338 # Make a new name for the extract_expsyms_cmds to use
2340 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2341 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2343 # If the library has no export list, then create one now
2344 if test -f "$output_objdir/$soname-def"; then :
2346 $show "extracting exported symbol list from \`$soname'"
2347 save_ifs="$IFS"; IFS='~'
2348 cmds=$extract_expsyms_cmds
2349 for cmd in $cmds; do
2353 $run eval "$cmd" || exit $?
2359 if test -f "$output_objdir/$newlib"; then :; else
2360 $show "generating import library for \`$soname'"
2361 save_ifs="$IFS"; IFS='~'
2362 cmds=$old_archive_from_expsyms_cmds
2363 for cmd in $cmds; do
2367 $run eval "$cmd" || exit $?
2371 # make sure the library variables are pointing to the new library
2374 fi # test -n "$old_archive_from_expsyms_cmds"
2376 if test "$linkmode" = prog || test "$mode" != relink; then
2381 case $hardcode_action in
2382 immediate | unsupported)
2383 if test "$hardcode_direct" = no; then
2386 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2388 # if the lib is a module then we can not link against
2389 # it, someone is ignoring the new warnings I added
2390 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2391 $echo "** Warning, lib $linklib is a module, not a shared library"
2392 if test -z "$old_library" ; then
2394 $echo "** And there doesn't seem to be a static archive available"
2395 $echo "** The link will probably fail, sorry"
2397 add="$dir/$old_library"
2401 elif test "$hardcode_minus_L" = no; then
2403 *-*-sunos*) add_shlibpath="$dir" ;;
2407 elif test "$hardcode_shlibpath_var" = no; then
2408 add_shlibpath="$dir"
2415 if test "$hardcode_direct" = yes; then
2417 elif test "$hardcode_minus_L" = yes; then
2419 # Try looking first in the location we're being installed to.
2420 if test -n "$inst_prefix_dir"; then
2423 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2428 elif test "$hardcode_shlibpath_var" = yes; then
2429 add_shlibpath="$dir"
2438 if test "$lib_linked" != yes; then
2439 $echo "$modename: configuration error: unsupported hardcode properties"
2443 if test -n "$add_shlibpath"; then
2444 case :$compile_shlibpath: in
2445 *":$add_shlibpath:"*) ;;
2446 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2449 if test "$linkmode" = prog; then
2450 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2451 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2453 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2454 test -n "$add" && deplibs="$add $deplibs"
2455 if test "$hardcode_direct" != yes && \
2456 test "$hardcode_minus_L" != yes && \
2457 test "$hardcode_shlibpath_var" = yes; then
2458 case :$finalize_shlibpath: in
2460 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2466 if test "$linkmode" = prog || test "$mode" = relink; then
2470 # Finalize command for both is simple: just hardcode it.
2471 if test "$hardcode_direct" = yes; then
2472 add="$libdir/$linklib"
2473 elif test "$hardcode_minus_L" = yes; then
2476 elif test "$hardcode_shlibpath_var" = yes; then
2477 case :$finalize_shlibpath: in
2479 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2482 elif test "$hardcode_automatic" = yes; then
2483 if test -n "$inst_prefix_dir" &&
2484 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2485 add="$inst_prefix_dir$libdir/$linklib"
2487 add="$libdir/$linklib"
2490 # We cannot seem to hardcode it, guess we'll fake it.
2492 # Try looking first in the location we're being installed to.
2493 if test -n "$inst_prefix_dir"; then
2496 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2503 if test "$linkmode" = prog; then
2504 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2505 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2507 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2508 test -n "$add" && deplibs="$add $deplibs"
2511 elif test "$linkmode" = prog; then
2512 # Here we assume that one of hardcode_direct or hardcode_minus_L
2513 # is not unsupported. This is valid on all known static and
2515 if test "$hardcode_direct" != unsupported; then
2516 test -n "$old_library" && linklib="$old_library"
2517 compile_deplibs="$dir/$linklib $compile_deplibs"
2518 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2520 compile_deplibs="-l$name -L$dir $compile_deplibs"
2521 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2523 elif test "$build_libtool_libs" = yes; then
2524 # Not a shared library
2525 if test "$deplibs_check_method" != pass_all; then
2526 # We're trying link a shared library against a static one
2527 # but the system doesn't support it.
2529 # Just print a warning and add the library to dependency_libs so
2530 # that the program can be linked against the static library.
2532 $echo "*** Warning: This system can not link to static lib archive $lib."
2533 $echo "*** I have the capability to make that library automatically link in when"
2534 $echo "*** you link to this library. But I can only do this if you have a"
2535 $echo "*** shared version of the library, which you do not appear to have."
2536 if test "$module" = yes; then
2537 $echo "*** But as you try to build a module library, libtool will still create "
2538 $echo "*** a static module, that should work as long as the dlopening application"
2539 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2540 if test -z "$global_symbol_pipe"; then
2542 $echo "*** However, this would only work if libtool was able to extract symbol"
2543 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2544 $echo "*** not find such a program. So, this module is probably useless."
2545 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2547 if test "$build_old_libs" = no; then
2548 build_libtool_libs=module
2551 build_libtool_libs=no
2555 convenience="$convenience $dir/$old_library"
2556 old_convenience="$old_convenience $dir/$old_library"
2557 deplibs="$dir/$old_library $deplibs"
2560 fi # link shared/static library?
2562 if test "$linkmode" = lib; then
2563 if test -n "$dependency_libs" &&
2564 { test "$hardcode_into_libs" != yes ||
2565 test "$build_old_libs" = yes ||
2566 test "$link_static" = yes; }; then
2567 # Extract -R from dependency_libs
2569 for libdir in $dependency_libs; do
2571 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2573 *" $temp_xrpath "*) ;;
2574 *) xrpath="$xrpath $temp_xrpath";;
2576 *) temp_deplibs="$temp_deplibs $libdir";;
2579 dependency_libs="$temp_deplibs"
2582 newlib_search_path="$newlib_search_path $absdir"
2583 # Link against this library
2584 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2585 # ... and its dependency_libs
2587 for deplib in $dependency_libs; do
2588 newdependency_libs="$deplib $newdependency_libs"
2589 if test "X$duplicate_deps" = "Xyes" ; then
2590 case "$tmp_libs " in
2591 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2594 tmp_libs="$tmp_libs $deplib"
2597 if test "$link_all_deplibs" != no; then
2598 # Add the search paths of all dependency libraries
2599 for deplib in $dependency_libs; do
2601 -L*) path="$deplib" ;;
2603 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2604 test "X$dir" = "X$deplib" && dir="."
2605 # We need an absolute path.
2607 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2609 absdir=`cd "$dir" && pwd`
2610 if test -z "$absdir"; then
2611 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2616 if grep "^installed=no" $deplib > /dev/null; then
2617 path="$absdir/$objdir"
2619 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2620 if test -z "$libdir"; then
2621 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2624 if test "$absdir" != "$libdir"; then
2625 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2632 # we do not want to link against static libs,
2633 # but need to link against shared
2634 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2635 if test -n "$deplibrary_names" ; then
2636 for tmp in $deplibrary_names ; do
2639 if test -f "$path/$depdepl" ; then
2640 depdepl="$path/$depdepl"
2642 # do not add paths which are already there
2643 case " $newlib_search_path " in
2645 *) newlib_search_path="$newlib_search_path $path";;
2658 # Again, we only want to link against shared libraries
2659 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2660 for tmp in $newlib_search_path ; do
2661 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2662 eval depdepl="$tmp/lib$tmp_libs.dylib"
2673 case " $deplibs " in
2675 *) deplibs="$depdepl $deplibs" ;;
2677 case " $deplibs " in
2679 *) deplibs="$deplibs $path" ;;
2682 fi # link_all_deplibs != no
2684 done # for deplib in $libs
2685 dependency_libs="$newdependency_libs"
2686 if test "$pass" = dlpreopen; then
2687 # Link the dlpreopened libraries before other libraries
2688 for deplib in $save_deplibs; do
2689 deplibs="$deplib $deplibs"
2692 if test "$pass" != dlopen; then
2693 if test "$pass" != conv; then
2694 # Make sure lib_search_path contains only unique directories.
2696 for dir in $newlib_search_path; do
2697 case "$lib_search_path " in
2699 *) lib_search_path="$lib_search_path $dir" ;;
2705 if test "$linkmode,$pass" != "prog,link"; then
2708 vars="compile_deplibs finalize_deplibs"
2710 for var in $vars dependency_libs; do
2711 # Add libraries to $var in reverse order
2712 eval tmp_libs=\"\$$var\"
2714 for deplib in $tmp_libs; do
2715 # FIXME: Pedantically, this is the right thing to do, so
2716 # that some nasty dependency loop isn't accidentally
2718 #new_libs="$deplib $new_libs"
2719 # Pragmatically, this seems to cause very few problems in
2722 -L*) new_libs="$deplib $new_libs" ;;
2725 # And here is the reason: when a library appears more
2726 # than once as an explicit dependence of a library, or
2727 # is implicitly linked in more than once by the
2728 # compiler, it is considered special, and multiple
2729 # occurrences thereof are not removed. Compare this
2730 # with having the same library being listed as a
2731 # dependency of multiple other libraries: in this case,
2732 # we know (pedantically, we assume) the library does not
2733 # need to be listed more than once, so we keep only the
2734 # last copy. This is not always right, but it is rare
2735 # enough that we require users that really mean to play
2736 # such unportable linking tricks to link the library
2737 # using -Wl,-lname, so that libtool does not consider it
2738 # for duplicate removal.
2739 case " $specialdeplibs " in
2740 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2742 case " $new_libs " in
2744 *) new_libs="$deplib $new_libs" ;;
2752 for deplib in $new_libs; do
2755 case " $tmp_libs " in
2757 *) tmp_libs="$tmp_libs $deplib" ;;
2760 *) tmp_libs="$tmp_libs $deplib" ;;
2763 eval $var=\"$tmp_libs\"
2766 # Last step: remove runtime libs from dependency_libs
2767 # (they stay in deplibs)
2769 for i in $dependency_libs ; do
2770 case " $predeps $postdeps $compiler_lib_search_path " in
2775 if test -n "$i" ; then
2776 tmp_libs="$tmp_libs $i"
2779 dependency_libs=$tmp_libs
2781 if test "$linkmode" = prog; then
2782 dlfiles="$newdlfiles"
2783 dlprefiles="$newdlprefiles"
2788 if test -n "$deplibs"; then
2789 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2792 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2793 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2796 if test -n "$rpath"; then
2797 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2800 if test -n "$xrpath"; then
2801 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2804 if test -n "$vinfo"; then
2805 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2808 if test -n "$release"; then
2809 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2812 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2813 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2816 # Now set the variables for building old libraries.
2817 build_libtool_libs=no
2819 objs="$objs$old_deplibs"
2823 # Make sure we only generate libraries of the form `libNAME.la'.
2826 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2827 eval shared_ext=\"$shrext_cmds\"
2828 eval libname=\"$libname_spec\"
2831 if test "$module" = no; then
2832 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2836 if test "$need_lib_prefix" != no; then
2837 # Add the "lib" prefix for modules if required
2838 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2839 eval shared_ext=\"$shrext_cmds\"
2840 eval libname=\"$libname_spec\"
2842 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2847 if test -n "$objs"; then
2848 if test "$deplibs_check_method" != pass_all; then
2849 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2853 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2854 $echo "*** objects $objs is not portable!"
2855 libobjs="$libobjs $objs"
2859 if test "$dlself" != no; then
2860 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2864 if test "$#" -gt 2; then
2865 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2870 if test -z "$rpath"; then
2871 if test "$build_libtool_libs" = yes; then
2872 # Building a libtool convenience library.
2873 # Some compilers have problems with a `.al' extension so
2874 # convenience libraries should have the same extension an
2875 # archive normally would.
2876 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2877 build_libtool_libs=convenience
2881 if test -n "$vinfo"; then
2882 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2885 if test -n "$release"; then
2886 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2890 # Parse the version information argument.
2891 save_ifs="$IFS"; IFS=':'
2892 set dummy $vinfo 0 0 0
2895 if test -n "$8"; then
2896 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2901 # convert absolute version numbers to libtool ages
2902 # this retains compatibility with .la files and attempts
2903 # to make the code below a bit more comprehensible
2905 case $vinfo_number in
2909 number_revision="$4"
2911 # There are really only two kinds -- those that
2912 # use the current revision as the major version
2913 # and those that subtract age and use age as
2914 # a minor version. But, then there is irix
2915 # which has an extra 1 added just for fun
2917 case $version_type in
2918 darwin|linux|osf|windows)
2919 current=`expr $number_major + $number_minor`
2921 revision="$number_revision"
2923 freebsd-aout|freebsd-elf|sunos)
2924 current="$number_major"
2925 revision="$number_minor"
2929 current=`expr $number_major + $number_minor - 1`
2931 revision="$number_minor"
2942 # Check that each of the things are valid numbers.
2944 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2946 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2947 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2953 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2955 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2956 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2962 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2964 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2965 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2970 if test "$age" -gt "$current"; then
2971 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2972 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2976 # Calculate the version variables.
2980 case $version_type in
2984 # Like Linux, but with the current version available in
2985 # verstring for coding it into the library header
2986 major=.`expr $current - $age`
2987 versuffix="$major.$age.$revision"
2988 # Darwin ld doesn't like 0 for these options...
2989 minor_current=`expr $current + 1`
2990 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2995 versuffix=".$current.$revision";
3000 versuffix=".$current";
3004 major=`expr $current - $age + 1`
3006 case $version_type in
3007 nonstopux) verstring_prefix=nonstopux ;;
3008 *) verstring_prefix=sgi ;;
3010 verstring="$verstring_prefix$major.$revision"
3012 # Add in all the interfaces that we are compatible with.
3014 while test "$loop" -ne 0; do
3015 iface=`expr $revision - $loop`
3016 loop=`expr $loop - 1`
3017 verstring="$verstring_prefix$major.$iface:$verstring"
3020 # Before this point, $major must not contain `.'.
3022 versuffix="$major.$revision"
3026 major=.`expr $current - $age`
3027 versuffix="$major.$age.$revision"
3031 major=.`expr $current - $age`
3032 versuffix=".$current.$age.$revision"
3033 verstring="$current.$age.$revision"
3035 # Add in all the interfaces that we are compatible with.
3037 while test "$loop" -ne 0; do
3038 iface=`expr $current - $loop`
3039 loop=`expr $loop - 1`
3040 verstring="$verstring:${iface}.0"
3043 # Make executables depend on our current version.
3044 verstring="$verstring:${current}.0"
3049 versuffix=".$current.$revision"
3053 # Use '-' rather than '.', since we only want one
3054 # extension on DOS 8.3 filesystems.
3055 major=`expr $current - $age`
3060 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3061 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3066 # Clear the version info if we defaulted, and they specified a release.
3067 if test -z "$vinfo" && test -n "$release"; then
3069 case $version_type in
3071 # we can't check for "0.0" in archive_cmds due to quoting
3072 # problems, so we reset it completely
3079 if test "$need_version" = no; then
3086 # Remove version info from name if versioning should be avoided
3087 if test "$avoid_version" = yes && test "$need_version" = no; then
3093 # Check to see if the archive will have undefined symbols.
3094 if test "$allow_undefined" = yes; then
3095 if test "$allow_undefined_flag" = unsupported; then
3096 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3097 build_libtool_libs=no
3101 # Don't allow undefined symbols.
3102 allow_undefined_flag="$no_undefined_flag"
3106 if test "$mode" != relink; then
3107 # Remove our outputs, but don't remove object files since they
3108 # may have been created when compiling PIC objects.
3110 tempremovelist=`$echo "$output_objdir/*"`
3111 for p in $tempremovelist; do
3115 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3116 if test "X$precious_files_regex" != "X"; then
3117 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3122 removelist="$removelist $p"
3127 if test -n "$removelist"; then
3128 $show "${rm}r $removelist"
3129 $run ${rm}r $removelist
3133 # Now set the variables for building old libraries.
3134 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3135 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3137 # Transform .lo files to .o files.
3138 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3141 # Eliminate all temporary directories.
3142 for path in $notinst_path; do
3143 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3144 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3145 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3148 if test -n "$xrpath"; then
3149 # If the user specified any rpath flags, then add them.
3151 for libdir in $xrpath; do
3152 temp_xrpath="$temp_xrpath -R$libdir"
3153 case "$finalize_rpath " in
3155 *) finalize_rpath="$finalize_rpath $libdir" ;;
3158 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3159 dependency_libs="$temp_xrpath $dependency_libs"
3163 # Make sure dlfiles contains only unique files that won't be dlpreopened
3164 old_dlfiles="$dlfiles"
3166 for lib in $old_dlfiles; do
3167 case " $dlprefiles $dlfiles " in
3169 *) dlfiles="$dlfiles $lib" ;;
3173 # Make sure dlprefiles contains only unique files
3174 old_dlprefiles="$dlprefiles"
3176 for lib in $old_dlprefiles; do
3177 case "$dlprefiles " in
3179 *) dlprefiles="$dlprefiles $lib" ;;
3183 if test "$build_libtool_libs" = yes; then
3184 if test -n "$rpath"; then
3186 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3187 # these systems don't actually have a c library (as such)!
3189 *-*-rhapsody* | *-*-darwin1.[012])
3190 # Rhapsody C library is in the System framework
3191 deplibs="$deplibs -framework System"
3194 # Don't link with libc until the a.out ld.so is fixed.
3196 *-*-openbsd* | *-*-freebsd*)
3197 # Do not include libc due to us having libc/libc_r.
3198 test "X$arg" = "X-lc" && continue
3201 # Add libc to deplibs on all other systems if necessary.
3202 if test "$build_libtool_need_lc" = "yes"; then
3203 deplibs="$deplibs -lc"
3209 # Transform deplibs into only deplibs that can be linked in shared.
3211 libname_save=$libname
3212 release_save=$release
3213 versuffix_save=$versuffix
3215 # I'm not sure if I'm treating the release correctly. I think
3216 # release should show up in the -l (ie -lgmp5) so we don't want to
3217 # add it in twice. Is that correct?
3223 case $deplibs_check_method in
3225 # Don't check for shared/static. Everything works.
3226 # This might be a little naive. We might want to check
3227 # whether the library exists or not. But this is on
3228 # osf3 & osf4 and I'm not really sure... Just
3229 # implementing what was already the behavior.
3233 # This code stresses the "libraries are programs" paradigm to its
3234 # limits. Maybe even breaks it. We compile a program, linking it
3235 # against the deplibs as a proxy for the library. Then we can check
3236 # whether they linked in statically or dynamically with ldd.
3238 cat > conftest.c <<EOF
3239 int main() { return 0; }
3242 $LTCC -o conftest conftest.c $deplibs
3243 if test "$?" -eq 0 ; then
3244 ldd_output=`ldd conftest`
3245 for i in $deplibs; do
3246 name="`expr $i : '-l\(.*\)'`"
3247 # If $name is empty we are operating on a -L argument.
3248 if test "$name" != "" && test "$name" -ne "0"; then
3249 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3250 case " $predeps $postdeps " in
3252 newdeplibs="$newdeplibs $i"
3257 if test -n "$i" ; then
3258 libname=`eval \\$echo \"$libname_spec\"`
3259 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3260 set dummy $deplib_matches
3262 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3263 newdeplibs="$newdeplibs $i"
3267 $echo "*** Warning: dynamic linker does not accept needed library $i."
3268 $echo "*** I have the capability to make that library automatically link in when"
3269 $echo "*** you link to this library. But I can only do this if you have a"
3270 $echo "*** shared version of the library, which I believe you do not have"
3271 $echo "*** because a test_compile did reveal that the linker did not use it for"
3272 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3276 newdeplibs="$newdeplibs $i"
3280 # Error occurred in the first compile. Let's try to salvage
3281 # the situation: Compile a separate program for each library.
3282 for i in $deplibs; do
3283 name="`expr $i : '-l\(.*\)'`"
3284 # If $name is empty we are operating on a -L argument.
3285 if test "$name" != "" && test "$name" != "0"; then
3287 $LTCC -o conftest conftest.c $i
3289 if test "$?" -eq 0 ; then
3290 ldd_output=`ldd conftest`
3291 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3292 case " $predeps $postdeps " in
3294 newdeplibs="$newdeplibs $i"
3299 if test -n "$i" ; then
3300 libname=`eval \\$echo \"$libname_spec\"`
3301 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3302 set dummy $deplib_matches
3304 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3305 newdeplibs="$newdeplibs $i"
3309 $echo "*** Warning: dynamic linker does not accept needed library $i."
3310 $echo "*** I have the capability to make that library automatically link in when"
3311 $echo "*** you link to this library. But I can only do this if you have a"
3312 $echo "*** shared version of the library, which you do not appear to have"
3313 $echo "*** because a test_compile did reveal that the linker did not use this one"
3314 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3320 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3321 $echo "*** make it link in! You will probably need to install it or some"
3322 $echo "*** library that it depends on before this library will be fully"
3323 $echo "*** functional. Installing it before continuing would be even better."
3326 newdeplibs="$newdeplibs $i"
3332 set dummy $deplibs_check_method
3333 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3334 for a_deplib in $deplibs; do
3335 name="`expr $a_deplib : '-l\(.*\)'`"
3336 # If $name is empty we are operating on a -L argument.
3337 if test "$name" != "" && test "$name" != "0"; then
3338 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3339 case " $predeps $postdeps " in
3341 newdeplibs="$newdeplibs $a_deplib"
3346 if test -n "$a_deplib" ; then
3347 libname=`eval \\$echo \"$libname_spec\"`
3348 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3349 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3350 for potent_lib in $potential_libs; do
3351 # Follow soft links.
3352 if ls -lLd "$potent_lib" 2>/dev/null \
3353 | grep " -> " >/dev/null; then
3356 # The statement above tries to avoid entering an
3357 # endless loop below, in case of cyclic links.
3358 # We might still enter an endless loop, since a link
3359 # loop can be closed while we follow links,
3361 potlib="$potent_lib"
3362 while test -h "$potlib" 2>/dev/null; do
3363 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3365 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3366 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3369 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3371 | $EGREP "$file_magic_regex" > /dev/null; then
3372 newdeplibs="$newdeplibs $a_deplib"
3379 if test -n "$a_deplib" ; then
3382 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3383 $echo "*** I have the capability to make that library automatically link in when"
3384 $echo "*** you link to this library. But I can only do this if you have a"
3385 $echo "*** shared version of the library, which you do not appear to have"
3386 $echo "*** because I did check the linker path looking for a file starting"
3387 if test -z "$potlib" ; then
3388 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3390 $echo "*** with $libname and none of the candidates passed a file format test"
3391 $echo "*** using a file magic. Last file checked: $potlib"
3395 # Add a -L argument.
3396 newdeplibs="$newdeplibs $a_deplib"
3398 done # Gone through all deplibs.
3401 set dummy $deplibs_check_method
3402 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3403 for a_deplib in $deplibs; do
3404 name="`expr $a_deplib : '-l\(.*\)'`"
3405 # If $name is empty we are operating on a -L argument.
3406 if test -n "$name" && test "$name" != "0"; then
3407 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3408 case " $predeps $postdeps " in
3410 newdeplibs="$newdeplibs $a_deplib"
3415 if test -n "$a_deplib" ; then
3416 libname=`eval \\$echo \"$libname_spec\"`
3417 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3418 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3419 for potent_lib in $potential_libs; do
3420 potlib="$potent_lib" # see symlink-check above in file_magic test
3421 if eval $echo \"$potent_lib\" 2>/dev/null \
3423 | $EGREP "$match_pattern_regex" > /dev/null; then
3424 newdeplibs="$newdeplibs $a_deplib"
3431 if test -n "$a_deplib" ; then
3434 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3435 $echo "*** I have the capability to make that library automatically link in when"
3436 $echo "*** you link to this library. But I can only do this if you have a"
3437 $echo "*** shared version of the library, which you do not appear to have"
3438 $echo "*** because I did check the linker path looking for a file starting"
3439 if test -z "$potlib" ; then
3440 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3442 $echo "*** with $libname and none of the candidates passed a file format test"
3443 $echo "*** using a regex pattern. Last file checked: $potlib"
3447 # Add a -L argument.
3448 newdeplibs="$newdeplibs $a_deplib"
3450 done # Gone through all deplibs.
3454 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3455 -e 's/ -[LR][^ ]*//g'`
3456 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3457 for i in $predeps $postdeps ; do
3458 # can't use Xsed below, because $i might contain '/'
3459 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3462 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3463 | grep . >/dev/null; then
3465 if test "X$deplibs_check_method" = "Xnone"; then
3466 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3468 $echo "*** Warning: inter-library dependencies are not known to be supported."
3470 $echo "*** All declared inter-library dependencies are being dropped."
3475 versuffix=$versuffix_save
3477 release=$release_save
3478 libname=$libname_save
3482 *-*-rhapsody* | *-*-darwin1.[012])
3483 # On Rhapsody replace the C library is the System framework
3484 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3488 if test "$droppeddeps" = yes; then
3489 if test "$module" = yes; then
3491 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3492 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3493 $echo "*** a static module, that should work as long as the dlopening"
3494 $echo "*** application is linked with the -dlopen flag."
3495 if test -z "$global_symbol_pipe"; then
3497 $echo "*** However, this would only work if libtool was able to extract symbol"
3498 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3499 $echo "*** not find such a program. So, this module is probably useless."
3500 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3502 if test "$build_old_libs" = no; then
3503 oldlibs="$output_objdir/$libname.$libext"
3504 build_libtool_libs=module
3507 build_libtool_libs=no
3510 $echo "*** The inter-library dependencies that have been dropped here will be"
3511 $echo "*** automatically added whenever a program is linked with this library"
3512 $echo "*** or is declared to -dlopen it."
3514 if test "$allow_undefined" = no; then
3516 $echo "*** Since this library must not contain undefined symbols,"
3517 $echo "*** because either the platform does not support them or"
3518 $echo "*** it was explicitly requested with -no-undefined,"
3519 $echo "*** libtool will only create a static version of it."
3520 if test "$build_old_libs" = no; then
3521 oldlibs="$output_objdir/$libname.$libext"
3522 build_libtool_libs=module
3525 build_libtool_libs=no
3530 # Done checking deplibs!
3534 # All the library-specific variables (install_libdir is set above).
3539 # Test again, we may have decided not to build it any more
3540 if test "$build_libtool_libs" = yes; then
3541 if test "$hardcode_into_libs" = yes; then
3542 # Hardcode the library paths
3545 rpath="$finalize_rpath"
3546 test "$mode" != relink && rpath="$compile_rpath$rpath"
3547 for libdir in $rpath; do
3548 if test -n "$hardcode_libdir_flag_spec"; then
3549 if test -n "$hardcode_libdir_separator"; then
3550 if test -z "$hardcode_libdirs"; then
3551 hardcode_libdirs="$libdir"
3553 # Just accumulate the unique libdirs.
3554 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3555 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3558 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3563 eval flag=\"$hardcode_libdir_flag_spec\"
3564 dep_rpath="$dep_rpath $flag"
3566 elif test -n "$runpath_var"; then
3567 case "$perm_rpath " in
3569 *) perm_rpath="$perm_rpath $libdir" ;;
3573 # Substitute the hardcoded libdirs into the rpath.
3574 if test -n "$hardcode_libdir_separator" &&
3575 test -n "$hardcode_libdirs"; then
3576 libdir="$hardcode_libdirs"
3577 if test -n "$hardcode_libdir_flag_spec_ld"; then
3578 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3580 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3583 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3584 # We should set the runpath_var.
3586 for dir in $perm_rpath; do
3589 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3591 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3594 shlibpath="$finalize_shlibpath"
3595 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3596 if test -n "$shlibpath"; then
3597 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3600 # Get the real and link names of the library.
3601 eval shared_ext=\"$shrext_cmds\"
3602 eval library_names=\"$library_names_spec\"
3603 set dummy $library_names
3607 if test -n "$soname_spec"; then
3608 eval soname=\"$soname_spec\"
3612 if test -z "$dlname"; then
3616 lib="$output_objdir/$realname"
3619 linknames="$linknames $link"
3622 # Use standard objects if they are pic
3623 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3625 # Prepare the list of exported symbols
3626 if test -z "$export_symbols"; then
3627 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3628 $show "generating symbol list for \`$libname.la'"
3629 export_symbols="$output_objdir/$libname.exp"
3630 $run $rm $export_symbols
3631 cmds=$export_symbols_cmds
3632 save_ifs="$IFS"; IFS='~'
3633 for cmd in $cmds; do
3636 if len=`expr "X$cmd" : ".*"` &&
3637 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3639 $run eval "$cmd" || exit $?
3640 skipped_export=false
3642 # The command line is too long to execute in one step.
3643 $show "using reloadable object file for export list..."
3648 if test -n "$export_symbols_regex"; then
3649 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3650 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3651 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3652 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3657 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3658 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3662 for test_deplib in $deplibs; do
3663 case " $convenience " in
3664 *" $test_deplib "*) ;;
3666 tmp_deplibs="$tmp_deplibs $test_deplib"
3670 deplibs="$tmp_deplibs"
3672 if test -n "$convenience"; then
3673 if test -n "$whole_archive_flag_spec"; then
3674 save_libobjs=$libobjs
3675 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3677 gentop="$output_objdir/${outputname}x"
3678 $show "${rm}r $gentop"
3679 $run ${rm}r "$gentop"
3680 $show "$mkdir $gentop"
3681 $run $mkdir "$gentop"
3683 if test "$status" -ne 0 && test ! -d "$gentop"; then
3686 generated="$generated $gentop"
3688 for xlib in $convenience; do
3689 # Extract the objects.
3691 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3692 *) xabs=`pwd`"/$xlib" ;;
3694 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3695 xdir="$gentop/$xlib"
3697 $show "${rm}r $xdir"
3699 $show "$mkdir $xdir"
3702 if test "$status" -ne 0 && test ! -d "$xdir"; then
3705 # We will extract separately just the conflicting names and we will no
3706 # longer touch any unique names. It is faster to leave these extract
3707 # automatically by $AR in one run.
3708 $show "(cd $xdir && $AR x $xabs)"
3709 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3710 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3713 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3714 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3715 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3718 while test "$i" -le "$count"
3720 # Put our $i before any first dot (extension)
3721 # Never overwrite any file
3723 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3725 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3727 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3728 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3734 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3739 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3740 eval flag=\"$thread_safe_flag_spec\"
3741 linker_flags="$linker_flags $flag"
3744 # Make a backup of the uninstalled library when relinking
3745 if test "$mode" = relink; then
3746 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3749 # Do each of the archive commands.
3750 if test "$module" = yes && test -n "$module_cmds" ; then
3751 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3752 eval test_cmds=\"$module_expsym_cmds\"
3753 cmds=$module_expsym_cmds
3755 eval test_cmds=\"$module_cmds\"
3759 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3760 eval test_cmds=\"$archive_expsym_cmds\"
3761 cmds=$archive_expsym_cmds
3763 eval test_cmds=\"$archive_cmds\"
3768 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3769 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3772 # The command line is too long to link in one step, link piecewise.
3773 $echo "creating reloadable object files..."
3775 # Save the value of $output and $libobjs because we want to
3776 # use them later. If we have whole_archive_flag_spec, we
3777 # want to use save_libobjs as it was before
3778 # whole_archive_flag_spec was expanded, because we can't
3779 # assume the linker understands whole_archive_flag_spec.
3780 # This may have to be revisited, in case too many
3781 # convenience libraries get linked in and end up exceeding
3783 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3784 save_libobjs=$libobjs
3788 # Clear the reloadable object creation command queue and
3789 # initialize k to one.
3796 output=$output_objdir/$save_output-${k}.$objext
3797 # Loop over the list of objects to be linked.
3798 for obj in $save_libobjs
3800 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3801 if test "X$objlist" = X ||
3802 { len=`expr "X$test_cmds" : ".*"` &&
3803 test "$len" -le "$max_cmd_len"; }; then
3804 objlist="$objlist $obj"
3806 # The command $test_cmds is almost too long, add a
3807 # command to the queue.
3808 if test "$k" -eq 1 ; then
3809 # The first file doesn't have a previous command to add.
3810 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3812 # All subsequent reloadable object files will link in
3813 # the last one created.
3814 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3816 last_robj=$output_objdir/$save_output-${k}.$objext
3818 output=$output_objdir/$save_output-${k}.$objext
3823 # Handle the remaining objects by creating one last
3824 # reloadable object file. All subsequent reloadable object
3825 # files will link in the last one created.
3826 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3827 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3829 if ${skipped_export-false}; then
3830 $show "generating symbol list for \`$libname.la'"
3831 export_symbols="$output_objdir/$libname.exp"
3832 $run $rm $export_symbols
3834 # Append the command to create the export file.
3835 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3838 # Set up a command to remove the reloadale object files
3839 # after they are used.
3841 while test "$i" -lt "$k"
3844 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3847 $echo "creating a temporary reloadable object file: $output"
3849 # Loop through the commands generated above and execute them.
3850 save_ifs="$IFS"; IFS='~'
3851 for cmd in $concat_cmds; do
3854 $run eval "$cmd" || exit $?
3859 # Restore the value of output.
3862 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3863 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3865 # Expand the library linking commands again to reset the
3866 # value of $libobjs for piecewise linking.
3868 # Do each of the archive commands.
3869 if test "$module" = yes && test -n "$module_cmds" ; then
3870 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3871 cmds=$module_expsym_cmds
3876 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3877 cmds=$archive_expsym_cmds
3883 # Append the command to remove the reloadable object files
3884 # to the just-reset $cmds.
3885 eval cmds=\"\$cmds~\$rm $delfiles\"
3887 save_ifs="$IFS"; IFS='~'
3888 for cmd in $cmds; do
3892 $run eval "$cmd" || exit $?
3896 # Restore the uninstalled library and exit
3897 if test "$mode" = relink; then
3898 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3902 # Create links to the real library.
3903 for linkname in $linknames; do
3904 if test "$realname" != "$linkname"; then
3905 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3906 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3910 # If -module or -export-dynamic was specified, set the dlname.
3911 if test "$module" = yes || test "$export_dynamic" = yes; then
3912 # On all known operating systems, these are identical.
3919 if test -n "$deplibs"; then
3920 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3923 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3924 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3927 if test -n "$rpath"; then
3928 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3931 if test -n "$xrpath"; then
3932 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3935 if test -n "$vinfo"; then
3936 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3939 if test -n "$release"; then
3940 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3945 if test -n "$objs$old_deplibs"; then
3946 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3950 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3958 # Delete the old objects.
3959 $run $rm $obj $libobj
3961 # Objects from convenience libraries. This assumes
3962 # single-version convenience libraries. Whenever we create
3963 # different ones for PIC/non-PIC, this we'll have to duplicate
3967 # reload_cmds runs $LD directly, so let us get rid of
3968 # -Wl from whole_archive_flag_spec
3971 if test -n "$convenience"; then
3972 if test -n "$whole_archive_flag_spec"; then
3973 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3975 gentop="$output_objdir/${obj}x"
3976 $show "${rm}r $gentop"
3977 $run ${rm}r "$gentop"
3978 $show "$mkdir $gentop"
3979 $run $mkdir "$gentop"
3981 if test "$status" -ne 0 && test ! -d "$gentop"; then
3984 generated="$generated $gentop"
3986 for xlib in $convenience; do
3987 # Extract the objects.
3989 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3990 *) xabs=`pwd`"/$xlib" ;;
3992 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3993 xdir="$gentop/$xlib"
3995 $show "${rm}r $xdir"
3997 $show "$mkdir $xdir"
4000 if test "$status" -ne 0 && test ! -d "$xdir"; then
4003 # We will extract separately just the conflicting names and we will no
4004 # longer touch any unique names. It is faster to leave these extract
4005 # automatically by $AR in one run.
4006 $show "(cd $xdir && $AR x $xabs)"
4007 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4008 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4011 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4012 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4013 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4016 while test "$i" -le "$count"
4018 # Put our $i before any first dot (extension)
4019 # Never overwrite any file
4021 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4023 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4025 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4026 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4032 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4037 # Create the old-style object.
4038 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
4042 save_ifs="$IFS"; IFS='~'
4043 for cmd in $cmds; do
4047 $run eval "$cmd" || exit $?
4051 # Exit if we aren't doing a library object file.
4052 if test -z "$libobj"; then
4053 if test -n "$gentop"; then
4054 $show "${rm}r $gentop"
4061 if test "$build_libtool_libs" != yes; then
4062 if test -n "$gentop"; then
4063 $show "${rm}r $gentop"
4067 # Create an invalid libtool object if no PIC, so that we don't
4068 # accidentally link it into a program.
4069 # $show "echo timestamp > $libobj"
4070 # $run eval "echo timestamp > $libobj" || exit $?
4074 if test -n "$pic_flag" || test "$pic_mode" != default; then
4075 # Only do commands if we really have different PIC objects.
4076 reload_objs="$libobjs $reload_conv_objs"
4079 save_ifs="$IFS"; IFS='~'
4080 for cmd in $cmds; do
4084 $run eval "$cmd" || exit $?
4089 if test -n "$gentop"; then
4090 $show "${rm}r $gentop"
4099 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4101 if test -n "$vinfo"; then
4102 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4105 if test -n "$release"; then
4106 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4109 if test "$preload" = yes; then
4110 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4111 test "$dlopen_self_static" = unknown; then
4112 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4117 *-*-rhapsody* | *-*-darwin1.[012])
4118 # On Rhapsody replace the C library is the System framework
4119 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4120 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4126 # Don't allow lazy linking, it breaks C++ global constructors
4127 if test "$tagname" = CXX ; then
4128 compile_command="$compile_command ${wl}-bind_at_load"
4129 finalize_command="$finalize_command ${wl}-bind_at_load"
4134 compile_command="$compile_command $compile_deplibs"
4135 finalize_command="$finalize_command $finalize_deplibs"
4137 if test -n "$rpath$xrpath"; then
4138 # If the user specified any rpath flags, then add them.
4139 for libdir in $rpath $xrpath; do
4140 # This is the magic to use -rpath.
4141 case "$finalize_rpath " in
4143 *) finalize_rpath="$finalize_rpath $libdir" ;;
4148 # Now hardcode the library paths
4151 for libdir in $compile_rpath $finalize_rpath; do
4152 if test -n "$hardcode_libdir_flag_spec"; then
4153 if test -n "$hardcode_libdir_separator"; then
4154 if test -z "$hardcode_libdirs"; then
4155 hardcode_libdirs="$libdir"
4157 # Just accumulate the unique libdirs.
4158 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4159 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4162 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4167 eval flag=\"$hardcode_libdir_flag_spec\"
4168 rpath="$rpath $flag"
4170 elif test -n "$runpath_var"; then
4171 case "$perm_rpath " in
4173 *) perm_rpath="$perm_rpath $libdir" ;;
4177 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4178 case :$dllsearchpath: in
4180 *) dllsearchpath="$dllsearchpath:$libdir";;
4185 # Substitute the hardcoded libdirs into the rpath.
4186 if test -n "$hardcode_libdir_separator" &&
4187 test -n "$hardcode_libdirs"; then
4188 libdir="$hardcode_libdirs"
4189 eval rpath=\" $hardcode_libdir_flag_spec\"
4191 compile_rpath="$rpath"
4195 for libdir in $finalize_rpath; do
4196 if test -n "$hardcode_libdir_flag_spec"; then
4197 if test -n "$hardcode_libdir_separator"; then
4198 if test -z "$hardcode_libdirs"; then
4199 hardcode_libdirs="$libdir"
4201 # Just accumulate the unique libdirs.
4202 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4203 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4206 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4211 eval flag=\"$hardcode_libdir_flag_spec\"
4212 rpath="$rpath $flag"
4214 elif test -n "$runpath_var"; then
4215 case "$finalize_perm_rpath " in
4217 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4221 # Substitute the hardcoded libdirs into the rpath.
4222 if test -n "$hardcode_libdir_separator" &&
4223 test -n "$hardcode_libdirs"; then
4224 libdir="$hardcode_libdirs"
4225 eval rpath=\" $hardcode_libdir_flag_spec\"
4227 finalize_rpath="$rpath"
4229 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4230 # Transform all the library objects into standard objects.
4231 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4232 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4236 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4237 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4238 dlsyms="${outputname}S.c"
4240 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4244 if test -n "$dlsyms"; then
4248 # Discover the nlist of each of the dlfiles.
4249 nlist="$output_objdir/${outputname}.nm"
4251 $show "$rm $nlist ${nlist}S ${nlist}T"
4252 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4254 # Parse the name list into a source file.
4255 $show "creating $output_objdir/$dlsyms"
4257 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4258 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4259 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4265 /* Prevent the only kind of declaration conflicts we can make. */
4266 #define lt_preloaded_symbols some_other_symbol
4268 /* External symbol declarations for the compiler. */\
4271 if test "$dlself" = yes; then
4272 $show "generating symbol list for \`$output'"
4274 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4276 # Add our own program objects to the symbol list.
4277 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4278 for arg in $progfiles; do
4279 $show "extracting global C symbols from \`$arg'"
4280 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4283 if test -n "$exclude_expsyms"; then
4284 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4285 $run eval '$mv "$nlist"T "$nlist"'
4288 if test -n "$export_symbols_regex"; then
4289 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4290 $run eval '$mv "$nlist"T "$nlist"'
4293 # Prepare the list of exported symbols
4294 if test -z "$export_symbols"; then
4295 export_symbols="$output_objdir/$output.exp"
4296 $run $rm $export_symbols
4297 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4299 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4300 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4301 $run eval 'mv "$nlist"T "$nlist"'
4305 for arg in $dlprefiles; do
4306 $show "extracting global C symbols from \`$arg'"
4307 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4308 $run eval '$echo ": $name " >> "$nlist"'
4309 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4312 if test -z "$run"; then
4313 # Make sure we have at least an empty file.
4314 test -f "$nlist" || : > "$nlist"
4316 if test -n "$exclude_expsyms"; then
4317 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4318 $mv "$nlist"T "$nlist"
4321 # Try sorting and uniquifying the output.
4322 if grep -v "^: " < "$nlist" |
4323 if sort -k 3 </dev/null >/dev/null 2>&1; then
4328 uniq > "$nlist"S; then
4331 grep -v "^: " < "$nlist" > "$nlist"S
4334 if test -f "$nlist"S; then
4335 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4337 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4340 $echo >> "$output_objdir/$dlsyms" "\
4342 #undef lt_preloaded_symbols
4344 #if defined (__STDC__) && __STDC__
4345 # define lt_ptr void *
4347 # define lt_ptr char *
4351 /* The mapping between symbol names and symbols. */
4356 lt_preloaded_symbols[] =
4360 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4362 $echo >> "$output_objdir/$dlsyms" "\
4366 /* This works around a problem in FreeBSD linker */
4367 #ifdef FREEBSD_WORKAROUND
4368 static const void *lt_preloaded_setup() {
4369 return lt_preloaded_symbols;
4379 pic_flag_for_symtable=
4381 # compiling the symbol table file with pic_flag works around
4382 # a FreeBSD bug that causes programs to crash when -lm is
4383 # linked before any other PIC object. But we must not use
4384 # pic_flag when linking with -static. The problem exists in
4385 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4386 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4387 case "$compile_command " in
4389 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4392 case "$compile_command " in
4394 *) pic_flag_for_symtable=" $pic_flag";;
4398 # Now compile the dynamic symbol file.
4399 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4400 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4402 # Clean up the generated files.
4403 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4404 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4406 # Transform the symbol file into the correct name.
4407 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4408 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4411 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4416 # We keep going just in case the user didn't refer to
4417 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4418 # really was required.
4420 # Nullify the symbol file.
4421 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4422 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4425 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4426 # Replace the output file specification.
4427 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4428 link_command="$compile_command$compile_rpath"
4430 # We have no uninstalled library dependencies, so finalize right now.
4431 $show "$link_command"
4432 $run eval "$link_command"
4435 # Delete the generated files.
4436 if test -n "$dlsyms"; then
4437 $show "$rm $output_objdir/${outputname}S.${objext}"
4438 $run $rm "$output_objdir/${outputname}S.${objext}"
4444 if test -n "$shlibpath_var"; then
4445 # We should set the shlibpath_var
4447 for dir in $temp_rpath; do
4449 [\\/]* | [A-Za-z]:[\\/]*)
4454 # Relative path: add a thisdir entry.
4455 rpath="$rpath\$thisdir/$dir:"
4462 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4463 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4465 if test -n "$finalize_shlibpath"; then
4466 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4471 if test -n "$runpath_var"; then
4472 if test -n "$perm_rpath"; then
4473 # We should set the runpath_var.
4475 for dir in $perm_rpath; do
4478 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4480 if test -n "$finalize_perm_rpath"; then
4481 # We should set the runpath_var.
4483 for dir in $finalize_perm_rpath; do
4486 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4490 if test "$no_install" = yes; then
4491 # We don't need to create a wrapper script.
4492 link_command="$compile_var$compile_command$compile_rpath"
4493 # Replace the output file specification.
4494 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4495 # Delete the old output file.
4497 # Link the executable and exit
4498 $show "$link_command"
4499 $run eval "$link_command" || exit $?
4503 if test "$hardcode_action" = relink; then
4504 # Fast installation is not supported
4505 link_command="$compile_var$compile_command$compile_rpath"
4506 relink_command="$finalize_var$finalize_command$finalize_rpath"
4508 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4509 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4511 if test "$fast_install" != no; then
4512 link_command="$finalize_var$compile_command$finalize_rpath"
4513 if test "$fast_install" = yes; then
4514 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4516 # fast_install is set to needless
4520 link_command="$compile_var$compile_command$compile_rpath"
4521 relink_command="$finalize_var$finalize_command$finalize_rpath"
4525 # Replace the output file specification.
4526 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4528 # Delete the old output files.
4529 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4531 $show "$link_command"
4532 $run eval "$link_command" || exit $?
4534 # Now create the wrapper script.
4535 $show "creating $output"
4537 # Quote the relink command for shipping.
4538 if test -n "$relink_command"; then
4539 # Preserve any variables that may affect compiler behavior
4540 for var in $variables_saved_for_relink; do
4541 if eval test -z \"\${$var+set}\"; then
4542 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4543 elif eval var_value=\$$var; test -z "$var_value"; then
4544 relink_command="$var=; export $var; $relink_command"
4546 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4547 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4550 relink_command="(cd `pwd`; $relink_command)"
4551 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4554 # Quote $echo for shipping.
4555 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4557 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4558 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4560 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4562 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4565 # Only actually do things if our run command is non-null.
4566 if test -z "$run"; then
4567 # win32 will think the script is a binary if it has
4568 # a .exe suffix, so we strip it off here.
4570 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4572 # test for cygwin because mv fails w/o .exe extensions
4576 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4580 *cygwin* | *mingw* )
4581 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4582 cwrapper=`$echo ${output}.exe`
4583 $rm $cwrappersource $cwrapper
4584 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4586 cat > $cwrappersource <<EOF
4588 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4589 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4591 The $output program cannot be directly executed until all the libtool
4592 libraries that it depends on are installed.
4594 This wrapper executable should never be moved out of the build directory.
4595 If it is, it will not operate correctly.
4597 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4598 but could eventually absorb all of the scripts functionality and
4599 exec $objdir/$outputname directly.
4602 cat >> $cwrappersource<<"EOF"
4610 #if defined(PATH_MAX)
4611 # define LT_PATHMAX PATH_MAX
4612 #elif defined(MAXPATHLEN)
4613 # define LT_PATHMAX MAXPATHLEN
4615 # define LT_PATHMAX 1024
4618 #ifndef DIR_SEPARATOR
4619 #define DIR_SEPARATOR '/'
4622 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4624 #define HAVE_DOS_BASED_FILE_SYSTEM
4625 #ifndef DIR_SEPARATOR_2
4626 #define DIR_SEPARATOR_2 '\\'
4630 #ifndef DIR_SEPARATOR_2
4631 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4632 #else /* DIR_SEPARATOR_2 */
4633 # define IS_DIR_SEPARATOR(ch) \
4634 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4635 #endif /* DIR_SEPARATOR_2 */
4637 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4638 #define XFREE(stale) do { \
4639 if (stale) { free ((void *) stale); stale = 0; } \
4642 const char *program_name = NULL;
4644 void * xmalloc (size_t num);
4645 char * xstrdup (const char *string);
4646 char * basename (const char *name);
4647 char * fnqualify(const char *path);
4648 char * strendzap(char *str, const char *pat);
4649 void lt_fatal (const char *message, ...);
4652 main (int argc, char *argv[])
4657 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4658 newargz = XMALLOC(char *, argc+2);
4661 cat >> $cwrappersource <<EOF
4662 newargz[0] = "$SHELL";
4665 cat >> $cwrappersource <<"EOF"
4666 newargz[1] = fnqualify(argv[0]);
4667 /* we know the script has the same name, without the .exe */
4668 /* so make sure newargz[1] doesn't end in .exe */
4669 strendzap(newargz[1],".exe");
4670 for (i = 1; i < argc; i++)
4671 newargz[i+1] = xstrdup(argv[i]);
4672 newargz[argc+1] = NULL;
4675 cat >> $cwrappersource <<EOF
4676 execv("$SHELL",newargz);
4679 cat >> $cwrappersource <<"EOF"
4683 xmalloc (size_t num)
4685 void * p = (void *) malloc (num);
4687 lt_fatal ("Memory exhausted");
4693 xstrdup (const char *string)
4695 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4700 basename (const char *name)
4704 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4705 /* Skip over the disk name in MSDOS pathnames. */
4706 if (isalpha (name[0]) && name[1] == ':')
4710 for (base = name; *name; name++)
4711 if (IS_DIR_SEPARATOR (*name))
4713 return (char *) base;
4717 fnqualify(const char *path)
4721 char tmp[LT_PATHMAX + 1];
4723 assert(path != NULL);
4725 /* Is it qualified already? */
4726 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4727 if (isalpha (path[0]) && path[1] == ':')
4728 return xstrdup (path);
4730 if (IS_DIR_SEPARATOR (path[0]))
4731 return xstrdup (path);
4733 /* prepend the current directory */
4734 /* doesn't handle '~' */
4735 if (getcwd (tmp, LT_PATHMAX) == NULL)
4736 lt_fatal ("getcwd failed");
4737 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4738 p = XMALLOC(char, size);
4739 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4744 strendzap(char *str, const char *pat)
4748 assert(str != NULL);
4749 assert(pat != NULL);
4752 patlen = strlen(pat);
4756 str += len - patlen;
4757 if (strcmp(str, pat) == 0)
4764 lt_error_core (int exit_status, const char * mode,
4765 const char * message, va_list ap)
4767 fprintf (stderr, "%s: %s: ", program_name, mode);
4768 vfprintf (stderr, message, ap);
4769 fprintf (stderr, ".\n");
4771 if (exit_status >= 0)
4776 lt_fatal (const char *message, ...)
4779 va_start (ap, message);
4780 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4784 # we should really use a build-platform specific compiler
4785 # here, but OTOH, the wrappers (shell script and this C one)
4786 # are only useful if you want to execute the "real" binary.
4787 # Since the "real" binary is built for $host, then this
4788 # wrapper might as well be built for $host, too.
4789 $run $LTCC -s -o $cwrapper $cwrappersource
4793 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4798 # $output - temporary wrapper script for $objdir/$outputname
4799 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4801 # The $output program cannot be directly executed until all the libtool
4802 # libraries that it depends on are installed.
4804 # This wrapper script should never be moved out of the build directory.
4805 # If it is, it will not operate correctly.
4807 # Sed substitution that helps us do robust quoting. It backslashifies
4808 # metacharacters that are still active within double-quoted strings.
4809 Xsed='${SED} -e 1s/^X//'
4810 sed_quote_subst='$sed_quote_subst'
4812 # The HP-UX ksh and POSIX shell print the target directory to stdout
4814 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4816 relink_command=\"$relink_command\"
4818 # This environment variable determines our operation mode.
4819 if test \"\$libtool_install_magic\" = \"$magic\"; then
4820 # install mode needs the following variable:
4821 notinst_deplibs='$notinst_deplibs'
4823 # When we are sourced in execute mode, \$file and \$echo are already set.
4824 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4827 # Make sure echo works.
4828 if test \"X\$1\" = X--no-reexec; then
4829 # Discard the --no-reexec flag, and continue.
4831 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4832 # Yippee, \$echo works!
4835 # Restart under the correct shell, and then maybe \$echo will work.
4836 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4842 # Find the directory that this script lives in.
4843 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4844 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4846 # Follow symbolic links until we get to the real thisdir.
4847 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4848 while test -n \"\$file\"; do
4849 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4851 # If there was a directory component, then change thisdir.
4852 if test \"x\$destdir\" != \"x\$file\"; then
4853 case \"\$destdir\" in
4854 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4855 *) thisdir=\"\$thisdir/\$destdir\" ;;
4859 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4860 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4863 # Try to get the absolute directory name.
4864 absdir=\`cd \"\$thisdir\" && pwd\`
4865 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4868 if test "$fast_install" = yes; then
4870 program=lt-'$outputname'$exeext
4871 progdir=\"\$thisdir/$objdir\"
4873 if test ! -f \"\$progdir/\$program\" || \\
4874 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4875 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4877 file=\"\$\$-\$program\"
4879 if test ! -d \"\$progdir\"; then
4880 $mkdir \"\$progdir\"
4882 $rm \"\$progdir/\$file\"
4887 # relink executable if necessary
4888 if test -n \"\$relink_command\"; then
4889 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4891 $echo \"\$relink_command_output\" >&2
4892 $rm \"\$progdir/\$file\"
4897 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4898 { $rm \"\$progdir/\$program\";
4899 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4900 $rm \"\$progdir/\$file\"
4904 program='$outputname'
4905 progdir=\"\$thisdir/$objdir\"
4911 if test -f \"\$progdir/\$program\"; then"
4913 # Export our shlibpath_var if we have one.
4914 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4916 # Add our own library path to $shlibpath_var
4917 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4919 # Some systems cannot cope with colon-terminated $shlibpath_var
4920 # The second colon is a workaround for a bug in BeOS R4 sed
4921 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4923 export $shlibpath_var
4927 # fixup the dll searchpath if we need to.
4928 if test -n "$dllsearchpath"; then
4930 # Add the dll search path components to the executable PATH
4931 PATH=$dllsearchpath:\$PATH
4936 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4937 # Run the actual program with our arguments.
4940 # Backslashes separate directories on plain windows
4941 *-*-mingw | *-*-os2*)
4943 exec \$progdir\\\\\$program \${1+\"\$@\"}
4949 exec \$progdir/\$program \${1+\"\$@\"}
4954 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4958 # The program doesn't exist.
4959 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4960 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4961 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4972 # See if we need to build an old-fashioned archive.
4973 for oldlib in $oldlibs; do
4975 if test "$build_libtool_libs" = convenience; then
4976 oldobjs="$libobjs_save"
4977 addlibs="$convenience"
4978 build_libtool_libs=no
4980 if test "$build_libtool_libs" = module; then
4981 oldobjs="$libobjs_save"
4982 build_libtool_libs=no
4984 oldobjs="$old_deplibs $non_pic_objects"
4986 addlibs="$old_convenience"
4989 if test -n "$addlibs"; then
4990 gentop="$output_objdir/${outputname}x"
4991 $show "${rm}r $gentop"
4992 $run ${rm}r "$gentop"
4993 $show "$mkdir $gentop"
4994 $run $mkdir "$gentop"
4996 if test "$status" -ne 0 && test ! -d "$gentop"; then
4999 generated="$generated $gentop"
5001 # Add in members from convenience archives.
5002 for xlib in $addlibs; do
5003 # Extract the objects.
5005 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5006 *) xabs=`pwd`"/$xlib" ;;
5008 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5009 xdir="$gentop/$xlib"
5011 $show "${rm}r $xdir"
5013 $show "$mkdir $xdir"
5016 if test "$status" -ne 0 && test ! -d "$xdir"; then
5019 # We will extract separately just the conflicting names and we will no
5020 # longer touch any unique names. It is faster to leave these extract
5021 # automatically by $AR in one run.
5022 $show "(cd $xdir && $AR x $xabs)"
5023 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5024 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5027 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5028 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5029 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5032 while test "$i" -le "$count"
5034 # Put our $i before any first dot (extension)
5035 # Never overwrite any file
5037 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5039 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5041 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5042 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5048 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5052 # Do each command in the archive commands.
5053 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5054 cmds=$old_archive_from_new_cmds
5056 eval cmds=\"$old_archive_cmds\"
5058 if len=`expr "X$cmds" : ".*"` &&
5059 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5060 cmds=$old_archive_cmds
5062 # the command line is too long to link in one step, link in parts
5063 $echo "using piecewise archive linking..."
5068 save_oldobjs=$oldobjs
5069 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5070 # encoded into archives. This makes 'ar r' malfunction in
5071 # this piecewise linking case whenever conflicting object
5072 # names appear in distinct ar calls; check, warn and compensate.
5073 if (for obj in $save_oldobjs
5075 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5076 done | sort | sort -uc >/dev/null 2>&1); then
5079 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5080 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5083 # Is there a better way of finding the last object in the list?
5084 for obj in $save_oldobjs
5088 for obj in $save_oldobjs
5090 oldobjs="$objlist $obj"
5091 objlist="$objlist $obj"
5092 eval test_cmds=\"$old_archive_cmds\"
5093 if len=`expr "X$test_cmds" : ".*"` &&
5094 test "$len" -le "$max_cmd_len"; then
5097 # the above command should be used before it gets too long
5099 if test "$obj" = "$last_oldobj" ; then
5102 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5103 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5109 if test "X$oldobjs" = "X" ; then
5110 eval cmds=\"\$concat_cmds\"
5112 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5116 save_ifs="$IFS"; IFS='~'
5117 for cmd in $cmds; do
5121 $run eval "$cmd" || exit $?
5126 if test -n "$generated"; then
5127 $show "${rm}r$generated"
5128 $run ${rm}r$generated
5131 # Now create the libtool archive.
5135 test "$build_old_libs" = yes && old_library="$libname.$libext"
5136 $show "creating $output"
5138 # Preserve any variables that may affect compiler behavior
5139 for var in $variables_saved_for_relink; do
5140 if eval test -z \"\${$var+set}\"; then
5141 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5142 elif eval var_value=\$$var; test -z "$var_value"; then
5143 relink_command="$var=; export $var; $relink_command"
5145 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5146 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5149 # Quote the link command for shipping.
5150 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5151 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5152 if test "$hardcode_automatic" = yes ; then
5157 # Only create the output if not a dry run.
5158 if test -z "$run"; then
5159 for installed in no yes; do
5160 if test "$installed" = yes; then
5161 if test -z "$install_libdir"; then
5164 output="$output_objdir/$outputname"i
5165 # Replace all uninstalled libtool libraries with the installed ones
5167 for deplib in $dependency_libs; do
5170 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5171 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5172 if test -z "$libdir"; then
5173 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5176 newdependency_libs="$newdependency_libs $libdir/$name"
5178 *) newdependency_libs="$newdependency_libs $deplib" ;;
5181 dependency_libs="$newdependency_libs"
5183 for lib in $dlfiles; do
5184 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5185 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5186 if test -z "$libdir"; then
5187 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5190 newdlfiles="$newdlfiles $libdir/$name"
5192 dlfiles="$newdlfiles"
5194 for lib in $dlprefiles; do
5195 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5196 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5197 if test -z "$libdir"; then
5198 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5201 newdlprefiles="$newdlprefiles $libdir/$name"
5203 dlprefiles="$newdlprefiles"
5206 for lib in $dlfiles; do
5208 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5209 *) abs=`pwd`"/$lib" ;;
5211 newdlfiles="$newdlfiles $abs"
5213 dlfiles="$newdlfiles"
5215 for lib in $dlprefiles; do
5217 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5218 *) abs=`pwd`"/$lib" ;;
5220 newdlprefiles="$newdlprefiles $abs"
5222 dlprefiles="$newdlprefiles"
5225 # place dlname in correct position for cygwin
5227 case $host,$output,$installed,$module,$dlname in
5228 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5231 # $outputname - a libtool library file
5232 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5234 # Please DO NOT delete this file!
5235 # It is necessary for linking the library.
5237 # The name that we can dlopen(3).
5240 # Names of this library.
5241 library_names='$library_names'
5243 # The name of the static archive.
5244 old_library='$old_library'
5246 # Libraries that this one depends upon.
5247 dependency_libs='$dependency_libs'
5249 # Version information for $libname.
5254 # Is this an already installed library?
5255 installed=$installed
5257 # Should we warn about portability when linking against -modules?
5258 shouldnotlink=$module
5260 # Files to dlopen/dlpreopen
5262 dlpreopen='$dlprefiles'
5264 # Directory that this library needs to be installed in:
5265 libdir='$install_libdir'"
5266 if test "$installed" = no && test "$need_relink" = yes; then
5268 relink_command=\"$relink_command\""
5273 # Do a symbolic link so that the libtool archive can be found in
5274 # LD_LIBRARY_PATH before the program is installed.
5275 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5276 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5282 # libtool install mode
5284 modename="$modename: install"
5286 # There may be an optional sh(1) argument at the beginning of
5287 # install_prog (especially on Windows NT).
5288 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5289 # Allow the use of GNU shtool's install command.
5290 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5291 # Aesthetically quote it.
5292 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5294 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5298 install_prog="$arg "
5306 # The real first argument should be the name of the installation program.
5307 # Aesthetically quote it.
5308 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5310 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5314 install_prog="$install_prog$arg"
5316 # We need to accept at least all the BSD install flags.
5326 if test -n "$dest"; then
5327 files="$files $dest"
5345 # If the previous option needed an argument, then skip it.
5346 if test -n "$prev"; then
5355 # Aesthetically quote the argument.
5356 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5358 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5362 install_prog="$install_prog $arg"
5365 if test -z "$install_prog"; then
5366 $echo "$modename: you must specify an install program" 1>&2
5371 if test -n "$prev"; then
5372 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5377 if test -z "$files"; then
5378 if test -z "$dest"; then
5379 $echo "$modename: no file or destination specified" 1>&2
5381 $echo "$modename: you must specify a destination" 1>&2
5387 # Strip any trailing slash from the destination.
5388 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5390 # Check to see that the destination is a directory.
5391 test -d "$dest" && isdir=yes
5392 if test "$isdir" = yes; then
5396 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5397 test "X$destdir" = "X$dest" && destdir=.
5398 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5400 # Not a directory, so check to see that there is only one file specified.
5402 if test "$#" -gt 2; then
5403 $echo "$modename: \`$dest' is not a directory" 1>&2
5409 [\\/]* | [A-Za-z]:[\\/]*) ;;
5411 for file in $files; do
5415 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5424 # This variable tells wrapper scripts just to set variables rather
5425 # than running their programs.
5426 libtool_install_magic="$magic"
5431 for file in $files; do
5433 # Do each installation.
5436 # Do the static libraries later.
5437 staticlibs="$staticlibs $file"
5441 # Check to see that this really is a libtool archive.
5442 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5444 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5452 # If there is no directory component, then add one.
5454 */* | *\\*) . $file ;;
5458 # Add the libdir to current_libdirs if it is the destination.
5459 if test "X$destdir" = "X$libdir"; then
5460 case "$current_libdirs " in
5462 *) current_libdirs="$current_libdirs $libdir" ;;
5465 # Note the libdir as a future libdir.
5466 case "$future_libdirs " in
5468 *) future_libdirs="$future_libdirs $libdir" ;;
5472 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5473 test "X$dir" = "X$file/" && dir=
5476 if test -n "$relink_command"; then
5477 # Determine the prefix the user has applied to our future dir.
5478 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5480 # Don't allow the user to place us outside of our expected
5481 # location b/c this prevents finding dependent libraries that
5482 # are installed to the same prefix.
5483 # At present, this check doesn't affect windows .dll's that
5484 # are installed into $libdir/../bin (currently, that works fine)
5485 # but it's something to keep an eye on.
5486 if test "$inst_prefix_dir" = "$destdir"; then
5487 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5491 if test -n "$inst_prefix_dir"; then
5492 # Stick the inst_prefix_dir data into the link command.
5493 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5495 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5498 $echo "$modename: warning: relinking \`$file'" 1>&2
5499 $show "$relink_command"
5500 if $run eval "$relink_command"; then :
5502 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5507 # See the names of the shared library.
5508 set dummy $library_names
5509 if test -n "$2"; then
5515 test -n "$relink_command" && srcname="$realname"T
5517 # Install the shared library and build the symlinks.
5518 $show "$install_prog $dir/$srcname $destdir/$realname"
5519 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5520 if test -n "$stripme" && test -n "$striplib"; then
5521 $show "$striplib $destdir/$realname"
5522 $run eval "$striplib $destdir/$realname" || exit $?
5525 if test "$#" -gt 0; then
5526 # Delete the old symlinks, and create new ones.
5529 if test "$linkname" != "$realname"; then
5530 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5531 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5536 # Do each command in the postinstall commands.
5537 lib="$destdir/$realname"
5538 cmds=$postinstall_cmds
5539 save_ifs="$IFS"; IFS='~'
5540 for cmd in $cmds; do
5544 $run eval "$cmd" || exit $?
5549 # Install the pseudo-library for information purposes.
5550 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5551 instname="$dir/$name"i
5552 $show "$install_prog $instname $destdir/$name"
5553 $run eval "$install_prog $instname $destdir/$name" || exit $?
5555 # Maybe install the static library, too.
5556 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5560 # Install (i.e. copy) a libtool object.
5562 # Figure out destination file name, if it wasn't already specified.
5563 if test -n "$destname"; then
5564 destfile="$destdir/$destname"
5566 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5567 destfile="$destdir/$destfile"
5570 # Deduce the name of the destination old-style object file.
5573 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5576 staticdest="$destfile"
5580 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5586 # Install the libtool object if requested.
5587 if test -n "$destfile"; then
5588 $show "$install_prog $file $destfile"
5589 $run eval "$install_prog $file $destfile" || exit $?
5592 # Install the old object if enabled.
5593 if test "$build_old_libs" = yes; then
5594 # Deduce the name of the old-style object file.
5595 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5597 $show "$install_prog $staticobj $staticdest"
5598 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5604 # Figure out destination file name, if it wasn't already specified.
5605 if test -n "$destname"; then
5606 destfile="$destdir/$destname"
5608 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5609 destfile="$destdir/$destfile"
5612 # If the file is missing, and there is a .exe on the end, strip it
5613 # because it is most likely a libtool script we actually want to
5618 if test ! -f "$file"; then
5619 file=`$echo $file|${SED} 's,.exe$,,'`
5625 # Do a test to see if this is really a libtool program.
5628 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5634 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5638 # To insure that "foo" is sourced, and not "foo.exe",
5639 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5640 # which disallows the automatic-append-.exe behavior.
5642 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5643 *) wrapperdot=${wrapper} ;;
5645 # If there is no directory component, then add one.
5647 */* | *\\*) . ${wrapperdot} ;;
5648 *) . ./${wrapperdot} ;;
5651 # Check the variables that should have been set.
5652 if test -z "$notinst_deplibs"; then
5653 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5658 for lib in $notinst_deplibs; do
5659 # Check to see that each library is installed.
5661 if test -f "$lib"; then
5662 # If there is no directory component, then add one.
5664 */* | *\\*) . $lib ;;
5668 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5669 if test -n "$libdir" && test ! -f "$libfile"; then
5670 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5676 # To insure that "foo" is sourced, and not "foo.exe",
5677 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5678 # which disallows the automatic-append-.exe behavior.
5680 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5681 *) wrapperdot=${wrapper} ;;
5683 # If there is no directory component, then add one.
5685 */* | *\\*) . ${wrapperdot} ;;
5686 *) . ./${wrapperdot} ;;
5690 if test "$fast_install" = no && test -n "$relink_command"; then
5691 if test "$finalize" = yes && test -z "$run"; then
5693 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5694 tmpdir="$tmpdir/libtool-$$"
5697 if $mkdir "$tmpdir"; then
5701 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5704 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5705 outputname="$tmpdir/$file"
5706 # Replace the output file specification.
5707 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5709 $show "$relink_command"
5710 if $run eval "$relink_command"; then :
5712 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5718 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5721 # Install the binary that we compiled earlier.
5722 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5726 # remove .exe since cygwin /usr/bin/install will append another
5728 case $install_prog,$host in
5729 */usr/bin/install*,*cygwin*)
5730 case $file:$destfile in
5735 destfile=$destfile.exe
5738 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5743 $show "$install_prog$stripme $file $destfile"
5744 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5745 test -n "$outputname" && ${rm}r "$tmpdir"
5750 for file in $staticlibs; do
5751 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5753 # Set up the ranlib parameters.
5754 oldlib="$destdir/$name"
5756 $show "$install_prog $file $oldlib"
5757 $run eval "$install_prog \$file \$oldlib" || exit $?
5759 if test -n "$stripme" && test -n "$old_striplib"; then
5760 $show "$old_striplib $oldlib"
5761 $run eval "$old_striplib $oldlib" || exit $?
5764 # Do each command in the postinstall commands.
5765 cmds=$old_postinstall_cmds
5766 save_ifs="$IFS"; IFS='~'
5767 for cmd in $cmds; do
5771 $run eval "$cmd" || exit $?
5776 if test -n "$future_libdirs"; then
5777 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5780 if test -n "$current_libdirs"; then
5781 # Maybe just do a dry run.
5782 test -n "$run" && current_libdirs=" -n$current_libdirs"
5783 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5789 # libtool finish mode
5791 modename="$modename: finish"
5795 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5798 libdirs="$libdirs $dir"
5801 for libdir in $libdirs; do
5802 if test -n "$finish_cmds"; then
5803 # Do each command in the finish commands.
5805 save_ifs="$IFS"; IFS='~'
5806 for cmd in $cmds; do
5810 $run eval "$cmd" || admincmds="$admincmds
5815 if test -n "$finish_eval"; then
5816 # Do the single finish_eval.
5817 eval cmds=\"$finish_eval\"
5818 $run eval "$cmds" || admincmds="$admincmds
5824 # Exit here if they wanted silent mode.
5825 test "$show" = : && exit $EXIT_SUCCESS
5827 $echo "----------------------------------------------------------------------"
5828 $echo "Libraries have been installed in:"
5829 for libdir in $libdirs; do
5833 $echo "If you ever happen to want to link against installed libraries"
5834 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5835 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5836 $echo "flag during linking and do at least one of the following:"
5837 if test -n "$shlibpath_var"; then
5838 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5839 $echo " during execution"
5841 if test -n "$runpath_var"; then
5842 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5843 $echo " during linking"
5845 if test -n "$hardcode_libdir_flag_spec"; then
5847 eval flag=\"$hardcode_libdir_flag_spec\"
5849 $echo " - use the \`$flag' linker flag"
5851 if test -n "$admincmds"; then
5852 $echo " - have your system administrator run these commands:$admincmds"
5854 if test -f /etc/ld.so.conf; then
5855 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5858 $echo "See any operating system documentation about shared libraries for"
5859 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5860 $echo "----------------------------------------------------------------------"
5864 # libtool execute mode
5866 modename="$modename: execute"
5868 # The first argument is the command name.
5870 if test -z "$cmd"; then
5871 $echo "$modename: you must specify a COMMAND" 1>&2
5876 # Handle -dlopen flags immediately.
5877 for file in $execute_dlfiles; do
5878 if test ! -f "$file"; then
5879 $echo "$modename: \`$file' is not a file" 1>&2
5887 # Check to see that this really is a libtool archive.
5888 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5890 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5895 # Read the libtool library.
5899 # If there is no directory component, then add one.
5901 */* | *\\*) . $file ;;
5905 # Skip this library if it cannot be dlopened.
5906 if test -z "$dlname"; then
5907 # Warn if it was a shared library.
5908 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5912 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5913 test "X$dir" = "X$file" && dir=.
5915 if test -f "$dir/$objdir/$dlname"; then
5918 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5924 # Just add the directory containing the .lo file.
5925 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5926 test "X$dir" = "X$file" && dir=.
5930 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5935 # Get the absolute pathname.
5936 absdir=`cd "$dir" && pwd`
5937 test -n "$absdir" && dir="$absdir"
5939 # Now add the directory to shlibpath_var.
5940 if eval "test -z \"\$$shlibpath_var\""; then
5941 eval "$shlibpath_var=\"\$dir\""
5943 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5947 # This variable tells wrapper scripts just to set shlibpath_var
5948 # rather than running their programs.
5949 libtool_execute_magic="$magic"
5951 # Check if any of the arguments is a wrapper script.
5958 # Do a test to see if this is really a libtool program.
5959 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5960 # If there is no directory component, then add one.
5962 */* | *\\*) . $file ;;
5966 # Transform arg to wrapped name.
5967 file="$progdir/$program"
5971 # Quote arguments (to preserve shell metacharacters).
5972 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5973 args="$args \"$file\""
5976 if test -z "$run"; then
5977 if test -n "$shlibpath_var"; then
5978 # Export the shlibpath_var.
5979 eval "export $shlibpath_var"
5982 # Restore saved environment variables
5983 if test "${save_LC_ALL+set}" = set; then
5984 LC_ALL="$save_LC_ALL"; export LC_ALL
5986 if test "${save_LANG+set}" = set; then
5987 LANG="$save_LANG"; export LANG
5990 # Now prepare to actually exec the command.
5991 exec_cmd="\$cmd$args"
5993 # Display what would be done.
5994 if test -n "$shlibpath_var"; then
5995 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5996 $echo "export $shlibpath_var"
6003 # libtool clean and uninstall mode
6005 modename="$modename: $mode"
6011 # This variable tells wrapper scripts just to set variables rather
6012 # than running their programs.
6013 libtool_install_magic="$magic"
6018 -f) rm="$rm $arg"; rmforce=yes ;;
6019 -*) rm="$rm $arg" ;;
6020 *) files="$files $arg" ;;
6024 if test -z "$rm"; then
6025 $echo "$modename: you must specify an RM program" 1>&2
6032 origobjdir="$objdir"
6033 for file in $files; do
6034 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6035 if test "X$dir" = "X$file"; then
6037 objdir="$origobjdir"
6039 objdir="$dir/$origobjdir"
6041 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6042 test "$mode" = uninstall && objdir="$dir"
6044 # Remember objdir for removal later, being careful to avoid duplicates
6045 if test "$mode" = clean; then
6048 *) rmdirs="$rmdirs $objdir" ;;
6052 # Don't error if the file doesn't exist and rm -f was used.
6053 if (test -L "$file") >/dev/null 2>&1 \
6054 || (test -h "$file") >/dev/null 2>&1 \
6055 || test -f "$file"; then
6057 elif test -d "$file"; then
6060 elif test "$rmforce" = yes; then
6068 # Possibly a libtool archive, so verify it.
6069 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6072 # Delete the libtool libraries and symlinks.
6073 for n in $library_names; do
6074 rmfiles="$rmfiles $objdir/$n"
6076 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6077 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6079 if test "$mode" = uninstall; then
6080 if test -n "$library_names"; then
6081 # Do each command in the postuninstall commands.
6082 cmds=$postuninstall_cmds
6083 save_ifs="$IFS"; IFS='~'
6084 for cmd in $cmds; do
6089 if test "$?" -ne 0 && test "$rmforce" != yes; then
6096 if test -n "$old_library"; then
6097 # Do each command in the old_postuninstall commands.
6098 cmds=$old_postuninstall_cmds
6099 save_ifs="$IFS"; IFS='~'
6100 for cmd in $cmds; do
6105 if test "$?" -ne 0 && test "$rmforce" != yes; then
6111 # FIXME: should reinstall the best remaining shared library.
6117 # Possibly a libtool object, so verify it.
6118 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6123 # Add PIC object to the list of files to remove.
6124 if test -n "$pic_object" \
6125 && test "$pic_object" != none; then
6126 rmfiles="$rmfiles $dir/$pic_object"
6129 # Add non-PIC object to the list of files to remove.
6130 if test -n "$non_pic_object" \
6131 && test "$non_pic_object" != none; then
6132 rmfiles="$rmfiles $dir/$non_pic_object"
6138 if test "$mode" = clean ; then
6142 file=`$echo $file|${SED} 's,.exe$,,'`
6143 noexename=`$echo $name|${SED} 's,.exe$,,'`
6144 # $file with .exe has already been added to rmfiles,
6145 # add $file without .exe
6146 rmfiles="$rmfiles $file"
6149 # Do a test to see if this is a libtool program.
6150 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6154 # note $name still contains .exe if it was in $file originally
6155 # as does the version of $file that was added into $rmfiles
6156 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6157 if test "$fast_install" = yes && test -n "$relink_command"; then
6158 rmfiles="$rmfiles $objdir/lt-$name"
6160 if test "X$noexename" != "X$name" ; then
6161 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6167 $show "$rm $rmfiles"
6168 $run $rm $rmfiles || exit_status=1
6170 objdir="$origobjdir"
6172 # Try to remove the ${objdir}s in the directories where we deleted files
6173 for dir in $rmdirs; do
6174 if test -d "$dir"; then
6176 $run rmdir $dir >/dev/null 2>&1
6184 $echo "$modename: you must specify a MODE" 1>&2
6185 $echo "$generic_help" 1>&2
6190 if test -z "$exec_cmd"; then
6191 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6192 $echo "$generic_help" 1>&2
6195 fi # test -z "$show_help"
6197 if test -n "$exec_cmd"; then
6202 # We need to display help for each of the modes.
6205 "Usage: $modename [OPTION]... [MODE-ARG]...
6207 Provide generalized library-building support services.
6209 --config show all configuration variables
6210 --debug enable verbose shell tracing
6211 -n, --dry-run display commands without modifying any files
6212 --features display basic configuration information and exit
6213 --finish same as \`--mode=finish'
6214 --help display this help message and exit
6215 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6216 --quiet same as \`--silent'
6217 --silent don't print informational messages
6218 --tag=TAG use configuration variables from tag TAG
6219 --version print version information
6221 MODE must be one of the following:
6223 clean remove files from the build directory
6224 compile compile a source file into a libtool object
6225 execute automatically set library path, then run a program
6226 finish complete the installation of libtool libraries
6227 install install libraries or executables
6228 link create a library or an executable
6229 uninstall remove libraries from an installed directory
6231 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6232 a more detailed description of MODE.
6234 Report bugs to <bug-libtool@gnu.org>."
6240 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6242 Remove files from the build directory.
6244 RM is the name of the program to use to delete files associated with each FILE
6245 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6248 If FILE is a libtool library, object or program, all the files associated
6249 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6254 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6256 Compile a source file into a libtool library object.
6258 This mode accepts the following additional options:
6260 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6261 -prefer-pic try to building PIC objects only
6262 -prefer-non-pic try to building non-PIC objects only
6263 -static always build a \`.o' file suitable for static linking
6265 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6266 from the given SOURCEFILE.
6268 The output file name is determined by removing the directory component from
6269 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6270 library object suffix, \`.lo'."
6275 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6277 Automatically set library path, then run a program.
6279 This mode accepts the following additional options:
6281 -dlopen FILE add the directory containing FILE to the library path
6283 This mode sets the library path environment variable according to \`-dlopen'
6286 If any of the ARGS are libtool executable wrappers, then they are translated
6287 into their corresponding uninstalled binary, and any of their required library
6288 directories are added to the library path.
6290 Then, COMMAND is executed, with ARGS as arguments."
6295 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6297 Complete the installation of libtool libraries.
6299 Each LIBDIR is a directory that contains libtool libraries.
6301 The commands that this mode executes may require superuser privileges. Use
6302 the \`--dry-run' option if you just want to see what would be executed."
6307 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6309 Install executables or libraries.
6311 INSTALL-COMMAND is the installation command. The first component should be
6312 either the \`install' or \`cp' program.
6314 The rest of the components are interpreted as arguments to that command (only
6315 BSD-compatible install options are recognized)."
6320 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6322 Link object files or libraries together to form another library, or to
6323 create an executable program.
6325 LINK-COMMAND is a command using the C compiler that you would use to create
6326 a program from several object files.
6328 The following components of LINK-COMMAND are treated specially:
6330 -all-static do not do any dynamic linking at all
6331 -avoid-version do not add a version suffix if possible
6332 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6333 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6334 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6335 -export-symbols SYMFILE
6336 try to export only the symbols listed in SYMFILE
6337 -export-symbols-regex REGEX
6338 try to export only the symbols matching REGEX
6339 -LLIBDIR search LIBDIR for required installed libraries
6340 -lNAME OUTPUT-FILE requires the installed library libNAME
6341 -module build a library that can dlopened
6342 -no-fast-install disable the fast-install mode
6343 -no-install link a not-installable executable
6344 -no-undefined declare that a library does not refer to external symbols
6345 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6346 -objectlist FILE Use a list of object files found in FILE to specify objects
6347 -precious-files-regex REGEX
6348 don't remove output files matching REGEX
6349 -release RELEASE specify package release information
6350 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6351 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6352 -static do not do any dynamic linking of libtool libraries
6353 -version-info CURRENT[:REVISION[:AGE]]
6354 specify library version info [each variable defaults to 0]
6356 All other options (arguments beginning with \`-') are ignored.
6358 Every other argument is treated as a filename. Files ending in \`.la' are
6359 treated as uninstalled libtool libraries, other files are standard or library
6362 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6363 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6364 required, except when creating a convenience library.
6366 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6367 using \`ar' and \`ranlib', or on Windows using \`lib'.
6369 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6370 is created, otherwise an executable program is created."
6375 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6377 Remove libraries from an installation directory.
6379 RM is the name of the program to use to delete files associated with each FILE
6380 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6383 If FILE is a libtool library, all the files associated with it are deleted.
6384 Otherwise, only FILE itself is deleted using RM."
6388 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6395 $echo "Try \`$modename --help' for more information about other modes."
6399 # The TAGs below are defined such that we never get into a situation
6400 # in which we disable both kinds of libraries. Given conflicting
6401 # choices, we go for a static library, that is the most portable,
6402 # since we can't tell whether shared libraries were disabled because
6403 # the user asked for that or because the platform doesn't support
6404 # them. This is particularly important on AIX, because we don't
6405 # support having both static and shared libraries enabled at the same
6406 # time on that platform, so we default to a shared-only configuration.
6407 # If a disable-shared tag is given, we'll fallback to a static-only
6408 # configuration. But we'll never go from static-only to shared-only.
6410 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6411 build_libtool_libs=no
6413 # ### END LIBTOOL TAG CONFIG: disable-shared
6415 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6416 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6417 # ### END LIBTOOL TAG CONFIG: disable-static