1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # The name of this program.
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
59 TIMESTAMP=" (1.1220.2.33 2003/09/29 11:43:50) Debian$Rev: 131 $"
62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 Xsed="${SED}"' -e 1s/^X//'
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 # test EBCDIC or ASCII
73 case `echo A|tr A '\301'` in
74 A) # EBCDIC based system
75 SP2NL="tr '\100' '\n'"
76 NL2SP="tr '\r\n' '\100\100'"
78 *) # Assume ASCII based system
79 SP2NL="tr '\040' '\012'"
80 NL2SP="tr '\015\012' '\040\040'"
85 # Only set LANG and LC_ALL to C if already set.
86 # These must not be set unconditionally because not all systems understand
87 # e.g. LANG=C (notably SCO).
88 # We save the old values to restore during execute mode.
89 if test "${LC_ALL+set}" = set; then
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
92 if test "${LANG+set}" = set; then
93 save_LANG="$LANG"; LANG=C; export LANG
96 # Make sure IFS has a sensible default
100 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
101 $echo "$modename: not configured to build any kind of library" 1>&2
102 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
115 lo2o="s/\\.lo\$/.${objext}/"
116 o2lo="s/\\.${objext}\$/.lo/"
118 #####################################
119 # Shell function definitions:
120 # This seems to be the best place for them
122 # Need a lot of goo to handle *both* DLLs and import libs
123 # Has to be a shell function in order to 'eat' the argument
124 # that is supplied when $file_magic_command is called.
126 win32_libid_type="unknown"
127 win32_fileres=`file -L $1 2>/dev/null`
128 case $win32_fileres in
129 *ar\ archive\ import\ library*) # definitely import
130 win32_libid_type="x86 archive import"
132 *ar\ archive*) # could be an import, or static
133 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
134 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
135 win32_nmres=`eval $NM -f posix -A $1 | \
136 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
137 if test "X$win32_nmres" = "Ximport" ; then
138 win32_libid_type="x86 archive import"
140 win32_libid_type="x86 archive static"
145 win32_libid_type="x86 DLL"
147 *executable*) # but shell scripts are "executable" too...
148 case $win32_fileres in
149 *MS\ Windows\ PE\ Intel*)
150 win32_libid_type="x86 DLL"
155 $echo $win32_libid_type
158 # End of Shell function definitions
159 #####################################
161 # Parse our command line options once, thoroughly.
162 while test "$#" -gt 0
168 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
172 # If the previous option needs an argument, assign it.
173 if test -n "$prev"; then
176 execute_dlfiles="$execute_dlfiles $arg"
180 preserve_args="${preserve_args}=$arg"
182 # Check whether tagname contains only valid characters
185 $echo "$progname: invalid tag name: $tagname" 1>&2
192 # Don't test for the "default" C tag, as we know, it's there, but
193 # not specially marked.
196 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
197 taglist="$taglist $tagname"
198 # Evaluate the configuration.
199 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
201 $echo "$progname: ignoring unknown tag $tagname" 1>&2
216 # Have we seen a non-optional argument yet?
223 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
225 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
226 $echo "This is free software; see the source for copying conditions. There is NO"
227 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
232 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
233 # Now print the configurations for the tags.
234 for tagname in $taglist; do
235 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
241 $echo "$progname: enabling shell trace mode"
243 preserve_args="$preserve_args $arg"
252 if test "$build_libtool_libs" = yes; then
253 $echo "enable shared libraries"
255 $echo "disable shared libraries"
257 if test "$build_old_libs" = yes; then
258 $echo "enable static libraries"
260 $echo "disable static libraries"
265 --finish) mode="finish" ;;
267 --mode) prevopt="--mode" prev=mode ;;
268 --mode=*) mode="$optarg" ;;
270 --preserve-dup-deps) duplicate_deps="yes" ;;
274 preserve_args="$preserve_args $arg"
277 --tag) prevopt="--tag" prev=tag ;;
279 set tag "$optarg" ${1+"$@"}
282 preserve_args="$preserve_args --tag"
291 $echo "$modename: unrecognized option \`$arg'" 1>&2
303 if test -n "$prevopt"; then
304 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
309 # If this variable is set in any of the actions, the command in it
310 # will be execed at the end. This prevents here-documents from being
311 # left over by shells.
314 if test -z "$show_help"; then
316 # Infer the operation mode.
317 if test -z "$mode"; then
318 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
319 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
321 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
333 *db | *dbx | *strace | *truss)
343 # If we have no mode, but dlfiles were specified, then do execute mode.
344 test -n "$execute_dlfiles" && mode=execute
346 # Just use the default operation mode.
347 if test -z "$mode"; then
348 if test -n "$nonopt"; then
349 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
351 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
358 # Only execute mode is allowed to have -dlopen flags.
359 if test -n "$execute_dlfiles" && test "$mode" != execute; then
360 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
365 # Change the help message to a mode-specific one.
367 help="Try \`$modename --help --mode=$mode' for more information."
369 # These modes are in order of execution frequency so that they run quickly.
371 # libtool compile mode
373 modename="$modename: compile"
374 # Get the compilation command and the source file.
376 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
386 # do not "continue". Instead, add this to base_compile
398 # Accept any command-line options.
401 if test -n "$libobj" ; then
402 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
430 arg_mode=arg # the next one goes into the "base_compile" arg list
431 continue # The current "srcfile" will either be retained or
432 ;; # replaced later. I would guess that would be a bug.
435 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
437 save_ifs="$IFS"; IFS=','
441 # Double-quote args containing other shell metacharacters.
442 # Many Bourne shells cannot handle close brackets correctly
443 # in scan sets, so we specify it separately.
445 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
449 lastarg="$lastarg $arg"
452 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
454 # Add the arguments to base_compile.
455 base_compile="$base_compile $lastarg"
460 # Accept the current argument as the source file.
461 # The previous "srcfile" becomes the current argument.
468 esac # case $arg_mode
470 # Aesthetically quote the previous argument.
471 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
474 # Double-quote args containing other shell metacharacters.
475 # Many Bourne shells cannot handle close brackets correctly
476 # in scan sets, so we specify it separately.
477 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
478 lastarg="\"$lastarg\""
482 base_compile="$base_compile $lastarg"
487 $echo "$modename: you must specify an argument for -Xcompile"
491 $echo "$modename: you must specify a target with \`-o'" 1>&2
495 # Get the name of the library object.
496 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
500 # Recognize several different file suffixes.
501 # If the user specifies -o file.o, it is replaced with file.lo
511 *.class) xform=class ;;
516 *.java) xform=java ;;
519 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
522 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
524 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
529 # Infer tagged configuration to use if any are available and
530 # if one wasn't chosen via the "--tag" command line option.
531 # Only attempt this if the compiler in the base compile
532 # command doesn't match the default compiler.
533 if test -n "$available_tags" && test -z "$tagname"; then
534 case $base_compile in
535 # Blanks in the command may have been stripped by the calling shell,
536 # but not from the CC environment variable when configure was run.
537 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
538 # Blanks at the start of $base_compile will cause this to fail
539 # if we don't check for them as well.
541 for z in $available_tags; do
542 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
543 # Evaluate the configuration.
544 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
545 case "$base_compile " in
546 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
547 # The compiler in the base compile command matches
548 # the one in the tagged configuration.
549 # Assume this is the tagged configuration we want.
556 # If $tagname still isn't set, then no tagged configuration
557 # was found and let the user know that the "--tag" command
558 # line option must be used.
559 if test -z "$tagname"; then
560 $echo "$modename: unable to infer tagged configuration"
561 $echo "$modename: specify a tag with \`--tag'" 1>&2
564 # $echo "$modename: using $tagname tagged configuration"
570 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
571 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
572 if test "X$xdir" = "X$obj"; then
577 lobj=${xdir}$objdir/$objname
579 if test -z "$base_compile"; then
580 $echo "$modename: you must specify a compilation command" 1>&2
585 # Delete any leftover library objects.
586 if test "$build_old_libs" = yes; then
587 removelist="$obj $lobj $libobj ${libobj}T"
589 removelist="$lobj $libobj ${libobj}T"
593 trap "$run $rm $removelist; exit 1" 1 2 15
595 # On Cygwin there's no "real" PIC flag so we must build both object types
597 cygwin* | mingw* | pw32* | os2*)
601 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
602 # non-PIC code in shared libraries is not supported
606 # Calculate the filename of the output object if compiler does
607 # not support -o with -c
608 if test "$compiler_c_o" = no; then
609 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
610 lockfile="$output_obj.lock"
611 removelist="$removelist $output_obj $lockfile"
612 trap "$run $rm $removelist; exit 1" 1 2 15
619 # Lock this critical section if it is needed
620 # We use this script file to make the link, it avoids creating a new file
621 if test "$need_locks" = yes; then
622 until $run ln "$0" "$lockfile" 2>/dev/null; do
623 $show "Waiting for $lockfile to be removed"
626 elif test "$need_locks" = warn; then
627 if test -f "$lockfile"; then
629 *** ERROR, $lockfile exists and contains:
630 `cat $lockfile 2>/dev/null`
632 This indicates that another process is trying to use the same
633 temporary object file, and libtool could not work around it because
634 your compiler does not support \`-c' and \`-o' together. If you
635 repeat this compilation, it may succeed, by chance, but you had better
636 avoid parallel builds (make -j) in this platform, or get a better
642 $echo $srcfile > "$lockfile"
645 if test -n "$fix_srcfile_path"; then
646 eval srcfile=\"$fix_srcfile_path\"
649 $run $rm "$libobj" "${libobj}T"
651 # Create a libtool object file (analogous to a ".la" file),
652 # but don't create it if we're doing a dry run.
653 test -z "$run" && cat > ${libobj}T <<EOF
654 # $libobj - a libtool object file
655 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
657 # Please DO NOT delete this file!
658 # It is necessary for linking the library.
660 # Name of the PIC object.
663 # Only build a PIC object if we are building libtool libraries.
664 if test "$build_libtool_libs" = yes; then
665 # Without this assignment, base_compile gets emptied.
666 fbsd_hideous_sh_bug=$base_compile
668 if test "$pic_mode" != no; then
669 command="$base_compile $srcfile $pic_flag"
671 # Don't build PIC code
672 command="$base_compile $srcfile"
675 if test ! -d "${xdir}$objdir"; then
676 $show "$mkdir ${xdir}$objdir"
677 $run $mkdir ${xdir}$objdir
679 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
684 if test -z "$output_obj"; then
685 # Place PIC objects in $objdir
686 command="$command -o $lobj"
689 $run $rm "$lobj" "$output_obj"
692 if $run eval "$command"; then :
694 test -n "$output_obj" && $run $rm $removelist
698 if test "$need_locks" = warn &&
699 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
701 *** ERROR, $lockfile contains:
702 `cat $lockfile 2>/dev/null`
704 but it should contain:
707 This indicates that another process is trying to use the same
708 temporary object file, and libtool could not work around it because
709 your compiler does not support \`-c' and \`-o' together. If you
710 repeat this compilation, it may succeed, by chance, but you had better
711 avoid parallel builds (make -j) in this platform, or get a better
718 # Just move the object if needed, then go on to compile the next one
719 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
720 $show "$mv $output_obj $lobj"
721 if $run $mv $output_obj $lobj; then :
729 # Append the name of the PIC object to the libtool object file.
730 test -z "$run" && cat >> ${libobj}T <<EOF
731 pic_object='$objdir/$objname'
735 # Allow error messages only from the first compilation.
736 if test "$suppress_opt" = yes; then
737 suppress_output=' >/dev/null 2>&1'
740 # No PIC object so indicate it doesn't exist in the libtool
742 test -z "$run" && cat >> ${libobj}T <<EOF
748 # Only build a position-dependent object if we build old libraries.
749 if test "$build_old_libs" = yes; then
750 if test "$pic_mode" != yes; then
751 # Don't build PIC code
752 command="$base_compile $srcfile"
754 command="$base_compile $srcfile $pic_flag"
756 if test "$compiler_c_o" = yes; then
757 command="$command -o $obj"
760 # Suppress compiler output if we already did a PIC compilation.
761 command="$command$suppress_output"
762 $run $rm "$obj" "$output_obj"
764 if $run eval "$command"; then :
770 if test "$need_locks" = warn &&
771 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
773 *** ERROR, $lockfile contains:
774 `cat $lockfile 2>/dev/null`
776 but it should contain:
779 This indicates that another process is trying to use the same
780 temporary object file, and libtool could not work around it because
781 your compiler does not support \`-c' and \`-o' together. If you
782 repeat this compilation, it may succeed, by chance, but you had better
783 avoid parallel builds (make -j) in this platform, or get a better
790 # Just move the object if needed
791 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
792 $show "$mv $output_obj $obj"
793 if $run $mv $output_obj $obj; then :
801 # Append the name of the non-PIC object the libtool object file.
802 # Only append if the libtool object file exists.
803 test -z "$run" && cat >> ${libobj}T <<EOF
804 # Name of the non-PIC object.
805 non_pic_object='$objname'
809 # Append the name of the non-PIC object the libtool object file.
810 # Only append if the libtool object file exists.
811 test -z "$run" && cat >> ${libobj}T <<EOF
812 # Name of the non-PIC object.
818 $run $mv "${libobj}T" "${libobj}"
820 # Unlock the critical section if it was locked
821 if test "$need_locks" != no; then
830 modename="$modename: link"
832 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
833 # It is impossible to link a dll without this setting, and
834 # we shouldn't force the makefile maintainer to figure out
835 # which system we are compiling for in order to pass an extra
836 # flag for every libtool invocation.
839 # FIXME: Unfortunately, there are problems with the above when trying
840 # to make a dll which has undefined symbols, in which case not
841 # even a static library is built. For now, we need to specify
842 # -no-undefined on the libtool link line when we can be certain
843 # that all symbols are satisfied, otherwise we get a static library.
850 libtool_args="$nonopt"
851 base_compile="$nonopt"
852 compile_command="$nonopt"
853 finalize_command="$nonopt"
866 lib_search_path=`pwd`
875 export_symbols_regex=
883 prefer_static_libs=no
896 # We need to know -static, to get the right output filenames.
900 -all-static | -static)
901 if test "X$arg" = "X-all-static"; then
902 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
903 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
905 if test -n "$link_static_flag"; then
906 dlopen_self=$dlopen_self_static
909 if test -z "$pic_flag" && test -n "$link_static_flag"; then
910 dlopen_self=$dlopen_self_static
913 build_libtool_libs=no
915 prefer_static_libs=yes
921 # See if our shared archives depend on static archives.
922 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
924 # Go through the arguments, transforming them on the way.
925 while test "$#" -gt 0; do
927 base_compile="$base_compile $arg"
930 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
931 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
935 libtool_args="$libtool_args $qarg"
937 # If the previous option needs an argument, assign it.
938 if test -n "$prev"; then
941 compile_command="$compile_command @OUTPUT@"
942 finalize_command="$finalize_command @OUTPUT@"
948 if test "$preload" = no; then
949 # Add the symbol object into the linking commands.
950 compile_command="$compile_command @SYMFILE@"
951 finalize_command="$finalize_command @SYMFILE@"
955 *.la | *.lo) ;; # We handle these cases below.
957 if test "$dlself" = no; then
965 if test "$prev" = dlprefiles; then
967 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
977 if test "$prev" = dlfiles; then
978 dlfiles="$dlfiles $arg"
980 dlprefiles="$dlprefiles $arg"
988 export_symbols="$arg"
989 if test ! -f "$arg"; then
990 $echo "$modename: symbol file \`$arg' does not exist"
997 export_symbols_regex="$arg"
1002 inst_prefix_dir="$arg"
1012 if test -f "$arg"; then
1015 for fil in `cat $save_arg`
1017 # moreargs="$moreargs $fil"
1019 # A libtool-controlled object.
1021 # Check to see that this really is a libtool object.
1022 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1027 # If there is no directory component, then add one.
1029 */* | *\\*) . $arg ;;
1033 if test -z "$pic_object" || \
1034 test -z "$non_pic_object" ||
1035 test "$pic_object" = none && \
1036 test "$non_pic_object" = none; then
1037 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1041 # Extract subdirectory from the argument.
1042 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1043 if test "X$xdir" = "X$arg"; then
1049 if test "$pic_object" != none; then
1050 # Prepend the subdirectory the object is found in.
1051 pic_object="$xdir$pic_object"
1053 if test "$prev" = dlfiles; then
1054 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1055 dlfiles="$dlfiles $pic_object"
1059 # If libtool objects are unsupported, then we need to preload.
1064 # CHECK ME: I think I busted this. -Ossama
1065 if test "$prev" = dlprefiles; then
1066 # Preload the old-style object.
1067 dlprefiles="$dlprefiles $pic_object"
1072 libobjs="$libobjs $pic_object"
1077 if test "$non_pic_object" != none; then
1078 # Prepend the subdirectory the object is found in.
1079 non_pic_object="$xdir$non_pic_object"
1081 # A standard non-PIC object
1082 non_pic_objects="$non_pic_objects $non_pic_object"
1083 if test -z "$pic_object" || test "$pic_object" = none ; then
1084 arg="$non_pic_object"
1088 # Only an error if not doing a dry-run.
1089 if test -z "$run"; then
1090 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1095 # Extract subdirectory from the argument.
1096 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1097 if test "X$xdir" = "X$arg"; then
1103 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1104 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1105 libobjs="$libobjs $pic_object"
1106 non_pic_objects="$non_pic_objects $non_pic_object"
1111 $echo "$modename: link input file \`$save_arg' does not exist"
1119 # We need an absolute path.
1121 [\\/]* | [A-Za-z]:[\\/]*) ;;
1123 $echo "$modename: only absolute run-paths are allowed" 1>&2
1127 if test "$prev" = rpath; then
1130 *) rpath="$rpath $arg" ;;
1135 *) xrpath="$xrpath $arg" ;;
1142 compiler_flags="$compiler_flags $qarg"
1144 compile_command="$compile_command $qarg"
1145 finalize_command="$finalize_command $qarg"
1149 linker_flags="$linker_flags $qarg"
1150 compiler_flags="$compiler_flags $wl$qarg"
1152 compile_command="$compile_command $wl$qarg"
1153 finalize_command="$finalize_command $wl$qarg"
1157 linker_flags="$linker_flags $qarg"
1158 compiler_flags="$compiler_flags $qarg"
1160 compile_command="$compile_command $qarg"
1161 finalize_command="$finalize_command $qarg"
1165 eval "$prev=\"\$arg\""
1170 fi # test -n "$prev"
1176 if test -n "$link_static_flag"; then
1177 compile_command="$compile_command $link_static_flag"
1178 finalize_command="$finalize_command $link_static_flag"
1184 # FIXME: remove this flag sometime in the future.
1185 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1209 -export-symbols | -export-symbols-regex)
1210 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1211 $echo "$modename: more than one -exported-symbols argument is not allowed"
1214 if test "X$arg" = "X-export-symbols"; then
1227 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1228 # so, if we see these flags be careful not to treat them like -L
1230 case $with_gcc/$host in
1231 no/*-*-irix* | /*-*-irix*)
1232 compile_command="$compile_command $arg"
1233 finalize_command="$finalize_command $arg"
1240 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1241 # We need an absolute path.
1243 [\\/]* | [A-Za-z]:[\\/]*) ;;
1245 absdir=`cd "$dir" && pwd`
1246 if test -z "$absdir"; then
1247 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1256 deplibs="$deplibs -L$dir"
1257 lib_search_path="$lib_search_path $dir"
1261 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1262 case :$dllsearchpath: in
1264 *) dllsearchpath="$dllsearchpath:$dir";;
1272 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1274 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1275 # These systems don't actually have a C or math library (as such)
1278 *-*-mingw* | *-*-os2*)
1279 # These systems don't actually have a C library (as such)
1280 test "X$arg" = "X-lc" && continue
1282 *-*-openbsd* | *-*-freebsd*)
1283 # Do not include libc due to us having libc/libc_r.
1284 test "X$arg" = "X-lc" && continue
1286 *-*-rhapsody* | *-*-darwin1.[012])
1287 # Rhapsody C and math libraries are in the System framework
1288 deplibs="$deplibs -framework System"
1291 elif test "X$arg" = "X-lc_r"; then
1293 *-*-openbsd* | *-*-freebsd*)
1294 # Do not include libc_r directly, use -pthread flag.
1299 deplibs="$deplibs $arg"
1303 -pthread|-pthreads|-kthread|-Kthread|-mthreads|--thread-safe|-mt)
1304 # deplibs="$deplibs $arg"
1312 # gcc -m* arguments should be passed to the linker via $compiler_flags
1313 # in order to pass architecture information to the linker
1314 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1315 # but this is not reliable with gcc because gcc may use -mfoo to
1316 # select a different linker, different libraries, etc, while
1317 # -Wl,-mfoo simply passes -mfoo to the linker.
1319 # Unknown arguments in both finalize_command and compile_command need
1320 # to be aesthetically quoted because they are evaled later.
1321 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1323 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1327 compile_command="$compile_command $arg"
1328 finalize_command="$finalize_command $arg"
1329 if test "$with_gcc" = "yes" ; then
1330 compiler_flags="$compiler_flags $arg"
1347 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1348 # The PATH hackery in wrapper scripts is required on Windows
1349 # in order for the loader to find any dlls it needs.
1350 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1351 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1354 *) no_install=yes ;;
1387 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1388 # We need an absolute path.
1390 [\\/]* | [A-Za-z]:[\\/]*) ;;
1392 $echo "$modename: only absolute run-paths are allowed" 1>&2
1398 *) xrpath="$xrpath $dir" ;;
1404 # The effects of -static are defined in a previous loop.
1405 # We used to do the same as -all-static on platforms that
1406 # didn't have a PIC flag, but the assumption that the effects
1407 # would be equivalent was wrong. It would break on at least
1408 # Digital Unix and AIX.
1428 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1430 save_ifs="$IFS"; IFS=','
1431 for flag in $args; do
1434 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1439 compiler_flags="$compiler_flags $flag"
1442 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1446 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1448 save_ifs="$IFS"; IFS=','
1449 for flag in $args; do
1452 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1457 compiler_flags="$compiler_flags $wl$flag"
1458 linker_flags="$linker_flags $flag"
1461 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1479 # Some other compiler flag.
1481 # Unknown arguments in both finalize_command and compile_command need
1482 # to be aesthetically quoted because they are evaled later.
1483 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1485 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1492 # A standard object.
1497 # A libtool-controlled object.
1499 # Check to see that this really is a libtool object.
1500 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1505 # If there is no directory component, then add one.
1507 */* | *\\*) . $arg ;;
1511 if test -z "$pic_object" || \
1512 test -z "$non_pic_object" ||
1513 test "$pic_object" = none && \
1514 test "$non_pic_object" = none; then
1515 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1519 # Extract subdirectory from the argument.
1520 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1521 if test "X$xdir" = "X$arg"; then
1527 if test "$pic_object" != none; then
1528 # Prepend the subdirectory the object is found in.
1529 pic_object="$xdir$pic_object"
1531 if test "$prev" = dlfiles; then
1532 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1533 dlfiles="$dlfiles $pic_object"
1537 # If libtool objects are unsupported, then we need to preload.
1542 # CHECK ME: I think I busted this. -Ossama
1543 if test "$prev" = dlprefiles; then
1544 # Preload the old-style object.
1545 dlprefiles="$dlprefiles $pic_object"
1550 libobjs="$libobjs $pic_object"
1555 if test "$non_pic_object" != none; then
1556 # Prepend the subdirectory the object is found in.
1557 non_pic_object="$xdir$non_pic_object"
1559 # A standard non-PIC object
1560 non_pic_objects="$non_pic_objects $non_pic_object"
1561 if test -z "$pic_object" || test "$pic_object" = none ; then
1562 arg="$non_pic_object"
1566 # Only an error if not doing a dry-run.
1567 if test -z "$run"; then
1568 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1573 # Extract subdirectory from the argument.
1574 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1575 if test "X$xdir" = "X$arg"; then
1581 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1582 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1583 libobjs="$libobjs $pic_object"
1584 non_pic_objects="$non_pic_objects $non_pic_object"
1591 deplibs="$deplibs $arg"
1592 old_deplibs="$old_deplibs $arg"
1597 # A libtool-controlled library.
1599 if test "$prev" = dlfiles; then
1600 # This library was specified with -dlopen.
1601 dlfiles="$dlfiles $arg"
1603 elif test "$prev" = dlprefiles; then
1604 # The library was specified with -dlpreopen.
1605 dlprefiles="$dlprefiles $arg"
1608 deplibs="$deplibs $arg"
1613 # Some other compiler argument.
1615 # Unknown arguments in both finalize_command and compile_command need
1616 # to be aesthetically quoted because they are evaled later.
1617 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1619 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1626 # Now actually substitute the argument into the commands.
1627 if test -n "$arg"; then
1628 compile_command="$compile_command $arg"
1629 finalize_command="$finalize_command $arg"
1631 done # argument parsing loop
1633 if test -n "$prev"; then
1634 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1639 # Infer tagged configuration to use if any are available and
1640 # if one wasn't chosen via the "--tag" command line option.
1641 # Only attempt this if the compiler in the base link
1642 # command doesn't match the default compiler.
1643 if test -n "$available_tags" && test -z "$tagname"; then
1644 case $base_compile in
1645 # Blanks in the command may have been stripped by the calling shell,
1646 # but not from the CC environment variable when configure was run.
1647 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1648 # Blanks at the start of $base_compile will cause this to fail
1649 # if we don't check for them as well.
1651 for z in $available_tags; do
1652 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1653 # Evaluate the configuration.
1654 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1655 case $base_compile in
1656 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1657 # The compiler in $compile_command matches
1658 # the one in the tagged configuration.
1659 # Assume this is the tagged configuration we want.
1666 # If $tagname still isn't set, then no tagged configuration
1667 # was found and let the user know that the "--tag" command
1668 # line option must be used.
1669 if test -z "$tagname"; then
1670 $echo "$modename: unable to infer tagged configuration"
1671 $echo "$modename: specify a tag with \`--tag'" 1>&2
1674 # $echo "$modename: using $tagname tagged configuration"
1680 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1681 eval arg=\"$export_dynamic_flag_spec\"
1682 compile_command="$compile_command $arg"
1683 finalize_command="$finalize_command $arg"
1687 # calculate the name of the file, without its directory
1688 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1689 libobjs_save="$libobjs"
1691 if test -n "$shlibpath_var"; then
1692 # get the directories listed in $shlibpath_var
1693 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1697 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1698 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1700 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1701 if test "X$output_objdir" = "X$output"; then
1702 output_objdir="$objdir"
1704 output_objdir="$output_objdir/$objdir"
1706 # Create the object directory.
1707 if test ! -d "$output_objdir"; then
1708 $show "$mkdir $output_objdir"
1709 $run $mkdir $output_objdir
1711 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1716 # Determine the type of output
1719 $echo "$modename: you must specify an output file" 1>&2
1723 *.$libext) linkmode=oldlib ;;
1724 *.lo | *.$objext) linkmode=obj ;;
1725 *.la) linkmode=lib ;;
1726 *) linkmode=prog ;; # Anything else should be a program.
1730 *cygwin* | *mingw* | *pw32*)
1731 # don't eliminate duplcations in $postdeps and $predeps
1732 duplicate_compiler_generated_deps=yes
1735 duplicate_compiler_generated_deps=$duplicate_deps
1741 # Find all interdependent deplibs by searching for libraries
1742 # that are linked more than once (e.g. -la -lb -la)
1743 for deplib in $deplibs; do
1744 if test "X$duplicate_deps" = "Xyes" ; then
1746 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1749 libs="$libs $deplib"
1752 if test "$linkmode" = lib; then
1753 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1755 # Compute libraries that are listed more than once in $predeps
1756 # $postdeps and mark them as special (i.e., whose duplicates are
1757 # not to be eliminated).
1759 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1760 for pre_post_dep in $predeps $postdeps; do
1761 case "$pre_post_deps " in
1762 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1764 pre_post_deps="$pre_post_deps $pre_post_dep"
1773 need_relink=no # whether we're linking any uninstalled libtool libraries
1774 notinst_deplibs= # not-installed libtool libraries
1775 notinst_path= # paths that contain not-installed libtool libraries
1779 for file in $dlfiles $dlprefiles; do
1783 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1795 passes="conv scan dlopen dlpreopen link"
1800 for pass in $passes; do
1801 if test "$linkmode,$pass" = "lib,link" ||
1802 test "$linkmode,$pass" = "prog,scan"; then
1806 if test "$linkmode" = prog; then
1808 dlopen) libs="$dlfiles" ;;
1809 dlpreopen) libs="$dlprefiles" ;;
1810 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1813 if test "$pass" = dlopen; then
1814 # Collect dlpreopened libraries
1815 save_deplibs="$deplibs"
1818 for deplib in $libs; do
1822 -pthread|-pthreads|-kthread|-Kthread|-mthreads|--thread-safe|-mt)
1823 deplibs="$deplib $deplibs"
1824 # test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1828 if test "$linkmode" != lib && test "$linkmode" != prog; then
1829 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1832 if test "$pass" = conv; then
1833 deplibs="$deplib $deplibs"
1836 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1837 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1838 for search_ext in .la $shrext .so .a; do
1839 # Search the libtool library
1840 lib="$searchdir/lib${name}${search_ext}"
1841 if test -f "$lib"; then
1842 if test "$search_ext" = ".la"; then
1851 if test "$found" != yes; then
1852 # deplib doesn't seem to be a libtool library
1853 if test "$linkmode,$pass" = "prog,link"; then
1854 compile_deplibs="$deplib $compile_deplibs"
1855 finalize_deplibs="$deplib $finalize_deplibs"
1857 deplibs="$deplib $deplibs"
1858 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1861 else # deplib is a libtool library
1862 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1863 # We need to do some special things here, and not later.
1864 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1865 case " $predeps $postdeps " in
1867 if (${SED} -e '2q' $lib |
1868 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1872 */* | *\\*) . $lib ;;
1875 for l in $old_library $library_names; do
1878 if test "X$ll" = "X$old_library" ; then # only static version available
1880 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1881 test "X$ladir" = "X$lib" && ladir="."
1882 lib=$ladir/$old_library
1883 if test "$linkmode,$pass" = "prog,link"; then
1884 compile_deplibs="$deplib $compile_deplibs"
1885 finalize_deplibs="$deplib $finalize_deplibs"
1887 deplibs="$deplib $deplibs"
1888 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1902 deplibs="$deplib $deplibs"
1903 test "$pass" = conv && continue
1904 newdependency_libs="$deplib $newdependency_libs"
1905 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1908 if test "$pass" = conv; then
1909 deplibs="$deplib $deplibs"
1912 if test "$pass" = scan; then
1913 deplibs="$deplib $deplibs"
1914 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1916 compile_deplibs="$deplib $compile_deplibs"
1917 finalize_deplibs="$deplib $finalize_deplibs"
1921 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1927 if test "$pass" = link; then
1928 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1929 # Make sure the xrpath contains only unique directories.
1932 *) xrpath="$xrpath $dir" ;;
1935 deplibs="$deplib $deplibs"
1938 *.la) lib="$deplib" ;;
1940 if test "$pass" = conv; then
1941 deplibs="$deplib $deplibs"
1946 if test "$deplibs_check_method" != pass_all; then
1948 $echo "*** Warning: Trying to link with static lib archive $deplib."
1949 $echo "*** I have the capability to make that library automatically link in when"
1950 $echo "*** you link to this library. But I can only do this if you have a"
1951 $echo "*** shared version of the library, which you do not appear to have"
1952 $echo "*** because the file extensions .$libext of this argument makes me believe"
1953 $echo "*** that it is just a static archive that I should not used here."
1956 $echo "*** Warning: Linking the shared library $output against the"
1957 $echo "*** static library $deplib is not portable!"
1958 deplibs="$deplib $deplibs"
1963 if test "$pass" != link; then
1964 deplibs="$deplib $deplibs"
1966 compile_deplibs="$deplib $compile_deplibs"
1967 finalize_deplibs="$deplib $finalize_deplibs"
1974 if test "$pass" = conv; then
1975 deplibs="$deplib $deplibs"
1976 elif test "$linkmode" = prog; then
1977 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1978 # If there is no dlopen support or we're linking statically,
1979 # we need to preload.
1980 newdlprefiles="$newdlprefiles $deplib"
1981 compile_deplibs="$deplib $compile_deplibs"
1982 finalize_deplibs="$deplib $finalize_deplibs"
1984 newdlfiles="$newdlfiles $deplib"
1994 if test "$found" = yes || test -f "$lib"; then :
1996 $echo "$modename: cannot find the library \`$lib'" 1>&2
2000 # Check to see that this really is a libtool archive.
2001 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2003 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2007 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2008 test "X$ladir" = "X$lib" && ladir="."
2016 # If the library was installed with an old release of libtool,
2017 # it will not redefine variables installed, or shouldnotlink
2023 */* | *\\*) . $lib ;;
2027 if test "$linkmode,$pass" = "lib,link" ||
2028 test "$linkmode,$pass" = "prog,scan" ||
2029 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2030 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2031 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2034 if test "$pass" = conv; then
2035 # Only check for convenience libraries
2036 deplibs="$lib $deplibs"
2037 if test -z "$libdir"; then
2038 if test -z "$old_library"; then
2039 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2042 # It is a libtool convenience library, so add in its objects.
2043 convenience="$convenience $ladir/$objdir/$old_library"
2044 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2046 for deplib in $dependency_libs; do
2047 deplibs="$deplib $deplibs"
2048 if test "X$duplicate_deps" = "Xyes" ; then
2049 case "$tmp_libs " in
2050 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2053 tmp_libs="$tmp_libs $deplib"
2055 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2056 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2063 # Get the name of the library we link against.
2065 for l in $old_library $library_names; do
2068 if test -z "$linklib"; then
2069 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2073 # This library was specified with -dlopen.
2074 if test "$pass" = dlopen; then
2075 if test -z "$libdir"; then
2076 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2079 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2080 # If there is no dlname, no dlopen support or we're linking
2081 # statically, we need to preload. We also need to preload any
2082 # dependent libraries so libltdl's deplib preloader doesn't
2083 # bomb out in the load deplibs phase.
2084 dlprefiles="$dlprefiles $lib $dependency_libs"
2086 newdlfiles="$newdlfiles $lib"
2091 # We need an absolute path.
2093 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2095 abs_ladir=`cd "$ladir" && pwd`
2096 if test -z "$abs_ladir"; then
2097 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2098 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2103 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2105 # Find the relevant object directory and library name.
2106 if test "X$installed" = Xyes; then
2107 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2108 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2117 dir="$ladir/$objdir"
2118 absdir="$abs_ladir/$objdir"
2119 # Remove this search path later
2120 notinst_path="$notinst_path $abs_ladir"
2121 fi # $installed = yes
2122 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2124 # This library was specified with -dlpreopen.
2125 if test "$pass" = dlpreopen; then
2126 if test -z "$libdir"; then
2127 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2130 # Prefer using a static library (so that no silly _DYNAMIC symbols
2131 # are required to link).
2132 if test -n "$old_library"; then
2133 newdlprefiles="$newdlprefiles $dir/$old_library"
2134 # Otherwise, use the dlname, so that lt_dlopen finds it.
2135 elif test -n "$dlname"; then
2136 newdlprefiles="$newdlprefiles $dir/$dlname"
2138 newdlprefiles="$newdlprefiles $dir/$linklib"
2140 fi # $pass = dlpreopen
2142 if test -z "$libdir"; then
2143 # Link the convenience library
2144 if test "$linkmode" = lib; then
2145 deplibs="$dir/$old_library $deplibs"
2146 elif test "$linkmode,$pass" = "prog,link"; then
2147 compile_deplibs="$dir/$old_library $compile_deplibs"
2148 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2150 deplibs="$lib $deplibs" # used for prog,scan pass
2156 if test "$linkmode" = prog && test "$pass" != link; then
2157 newlib_search_path="$newlib_search_path $ladir"
2158 deplibs="$lib $deplibs"
2161 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2162 test "$build_libtool_libs" = no; then
2167 for deplib in $dependency_libs; do
2169 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2171 # Need to link against all dependency_libs?
2172 if test "$linkalldeplibs" = yes; then
2173 deplibs="$deplib $deplibs"
2175 # Need to hardcode shared library paths
2176 # or/and link against static libraries
2177 newdependency_libs="$deplib $newdependency_libs"
2179 if test "X$duplicate_deps" = "Xyes" ; then
2180 case "$tmp_libs " in
2181 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2184 tmp_libs="$tmp_libs $deplib"
2187 fi # $linkmode = prog...
2189 if test "$linkmode,$pass" = "prog,link"; then
2190 if test -n "$library_names" &&
2191 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2192 # We need to hardcode the library path
2193 if test -n "$shlibpath_var"; then
2194 # Make sure the rpath contains only unique directories.
2195 case "$temp_rpath " in
2198 *) temp_rpath="$temp_rpath $dir" ;;
2202 # Hardcode the library path.
2203 # Skip directories that are in the system default run-time
2205 case " $sys_lib_dlsearch_path " in
2208 case "$compile_rpath " in
2210 *) compile_rpath="$compile_rpath $absdir"
2214 case " $sys_lib_dlsearch_path " in
2217 case "$finalize_rpath " in
2219 *) finalize_rpath="$finalize_rpath $libdir"
2223 fi # $linkmode,$pass = prog,link...
2225 if test "$alldeplibs" = yes &&
2226 { test "$deplibs_check_method" = pass_all ||
2227 { test "$build_libtool_libs" = yes &&
2228 test -n "$library_names"; }; }; then
2229 # We only need to search for static libraries
2234 link_static=no # Whether the deplib will be linked statically
2235 if test -n "$library_names" &&
2236 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2237 if test "$installed" = no; then
2238 notinst_deplibs="$notinst_deplibs $lib"
2241 # This is a shared library
2243 # Warn about portability, can't link against -module's on some systems (darwin)
2244 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2246 if test "$linkmode" = prog; then
2247 $echo "*** Warning: Linking the executable $output against the loadable module"
2249 $echo "*** Warning: Linking the shared library $output against the loadable module"
2251 $echo "*** $linklib is not portable!"
2253 if test "$linkmode" = lib &&
2254 test "$hardcode_into_libs" = yes; then
2255 # Hardcode the library path.
2256 # Skip directories that are in the system default run-time
2258 case " $sys_lib_dlsearch_path " in
2261 case "$compile_rpath " in
2263 *) compile_rpath="$compile_rpath $absdir"
2267 case " $sys_lib_dlsearch_path " in
2270 case "$finalize_rpath " in
2272 *) finalize_rpath="$finalize_rpath $libdir"
2278 if test -n "$old_archive_from_expsyms_cmds"; then
2279 # figure out the soname
2280 set dummy $library_names
2283 libname=`eval \\$echo \"$libname_spec\"`
2284 # use dlname if we got it. it's perfectly good, no?
2285 if test -n "$dlname"; then
2287 elif test -n "$soname_spec"; then
2291 major=`expr $current - $age`
2295 eval soname=\"$soname_spec\"
2300 # Make a new name for the extract_expsyms_cmds to use
2302 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2303 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2305 # If the library has no export list, then create one now
2306 if test -f "$output_objdir/$soname-def"; then :
2308 $show "extracting exported symbol list from \`$soname'"
2309 save_ifs="$IFS"; IFS='~'
2310 eval cmds=\"$extract_expsyms_cmds\"
2311 for cmd in $cmds; do
2314 $run eval "$cmd" || exit $?
2320 if test -f "$output_objdir/$newlib"; then :; else
2321 $show "generating import library for \`$soname'"
2322 save_ifs="$IFS"; IFS='~'
2323 eval cmds=\"$old_archive_from_expsyms_cmds\"
2324 for cmd in $cmds; do
2327 $run eval "$cmd" || exit $?
2331 # make sure the library variables are pointing to the new library
2334 fi # test -n "$old_archive_from_expsyms_cmds"
2336 if test "$linkmode" = prog || test "$mode" != relink; then
2341 case $hardcode_action in
2342 immediate | unsupported)
2343 if test "$hardcode_direct" = no; then
2346 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2348 # if the lib is a module then we can not link against it, someone
2349 # is ignoring the new warnings I added
2350 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2351 $echo "** Warning, lib $linklib is a module, not a shared library"
2352 if test -z "$old_library" ; then
2354 $echo "** And there doesn't seem to be a static archive available"
2355 $echo "** The link will probably fail, sorry"
2357 add="$dir/$old_library"
2361 elif test "$hardcode_minus_L" = no; then
2363 *-*-sunos*) add_shlibpath="$dir" ;;
2367 elif test "$hardcode_shlibpath_var" = no; then
2368 add_shlibpath="$dir"
2375 if test "$hardcode_direct" = yes; then
2377 elif test "$hardcode_minus_L" = yes; then
2379 # Try looking first in the location we're being installed to.
2380 if test -n "$inst_prefix_dir"; then
2383 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2388 elif test "$hardcode_shlibpath_var" = yes; then
2389 add_shlibpath="$dir"
2398 if test "$lib_linked" != yes; then
2399 $echo "$modename: configuration error: unsupported hardcode properties"
2403 if test -n "$add_shlibpath"; then
2404 case :$compile_shlibpath: in
2405 *":$add_shlibpath:"*) ;;
2406 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2409 if test "$linkmode" = prog; then
2410 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2411 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2413 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2414 test -n "$add" && deplibs="$add $deplibs"
2415 if test "$hardcode_direct" != yes && \
2416 test "$hardcode_minus_L" != yes && \
2417 test "$hardcode_shlibpath_var" = yes; then
2418 case :$finalize_shlibpath: in
2420 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2426 if test "$linkmode" = prog || test "$mode" = relink; then
2430 # Finalize command for both is simple: just hardcode it.
2431 if test "$hardcode_direct" = yes; then
2432 add="$libdir/$linklib"
2433 elif test "$hardcode_minus_L" = yes; then
2436 elif test "$hardcode_shlibpath_var" = yes; then
2437 case :$finalize_shlibpath: in
2439 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2442 elif test "$hardcode_automatic" = yes; then
2443 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2444 add="$inst_prefix_dir$libdir/$linklib"
2446 add="$libdir/$linklib"
2449 # We cannot seem to hardcode it, guess we'll fake it.
2451 # Try looking first in the location we're being installed to.
2452 if test -n "$inst_prefix_dir"; then
2455 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2462 if test "$linkmode" = prog; then
2463 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2464 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2466 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2467 test -n "$add" && deplibs="$add $deplibs"
2470 elif test "$linkmode" = prog; then
2471 # Here we assume that one of hardcode_direct or hardcode_minus_L
2472 # is not unsupported. This is valid on all known static and
2474 if test "$hardcode_direct" != unsupported; then
2475 test -n "$old_library" && linklib="$old_library"
2476 compile_deplibs="$dir/$linklib $compile_deplibs"
2477 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2479 compile_deplibs="-l$name -L$dir $compile_deplibs"
2480 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2482 elif test "$build_libtool_libs" = yes; then
2483 # Not a shared library
2484 if test "$deplibs_check_method" != pass_all; then
2485 # We're trying link a shared library against a static one
2486 # but the system doesn't support it.
2488 # Just print a warning and add the library to dependency_libs so
2489 # that the program can be linked against the static library.
2491 $echo "*** Warning: This system can not link to static lib archive $lib."
2492 $echo "*** I have the capability to make that library automatically link in when"
2493 $echo "*** you link to this library. But I can only do this if you have a"
2494 $echo "*** shared version of the library, which you do not appear to have."
2495 if test "$module" = yes; then
2496 $echo "*** But as you try to build a module library, libtool will still create "
2497 $echo "*** a static module, that should work as long as the dlopening application"
2498 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2499 if test -z "$global_symbol_pipe"; then
2501 $echo "*** However, this would only work if libtool was able to extract symbol"
2502 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2503 $echo "*** not find such a program. So, this module is probably useless."
2504 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2506 if test "$build_old_libs" = no; then
2507 build_libtool_libs=module
2510 build_libtool_libs=no
2514 convenience="$convenience $dir/$old_library"
2515 old_convenience="$old_convenience $dir/$old_library"
2516 deplibs="$dir/$old_library $deplibs"
2519 fi # link shared/static library?
2521 if test "$linkmode" = lib; then
2522 if test -n "$dependency_libs" &&
2523 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2524 test "$link_static" = yes; }; then
2525 # Extract -R from dependency_libs
2527 for libdir in $dependency_libs; do
2529 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2531 *" $temp_xrpath "*) ;;
2532 *) xrpath="$xrpath $temp_xrpath";;
2534 *) temp_deplibs="$temp_deplibs $libdir";;
2537 dependency_libs="$temp_deplibs"
2540 newlib_search_path="$newlib_search_path $absdir"
2541 # Link against this library
2542 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2543 # ... and its dependency_libs
2545 for deplib in $dependency_libs; do
2546 newdependency_libs="$deplib $newdependency_libs"
2547 if test "X$duplicate_deps" = "Xyes" ; then
2548 case "$tmp_libs " in
2549 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2552 tmp_libs="$tmp_libs $deplib"
2555 if test "$link_all_deplibs" != no; then
2556 # Add the search paths of all dependency libraries
2557 for deplib in $dependency_libs; do
2559 -L*) path="$deplib" ;;
2561 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2562 test "X$dir" = "X$deplib" && dir="."
2563 # We need an absolute path.
2565 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2567 absdir=`cd "$dir" && pwd`
2568 if test -z "$absdir"; then
2569 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2574 if grep "^installed=no" $deplib > /dev/null; then
2575 path="$absdir/$objdir"
2577 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2578 if test -z "$libdir"; then
2579 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2582 if test "$absdir" != "$libdir"; then
2583 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2590 # we do not want to link against static libs, but need to link against shared
2591 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2592 if test -n "$deplibrary_names" ; then
2593 for tmp in $deplibrary_names ; do
2596 if test -f "$path/$depdepl" ; then
2597 depdepl="$path/$depdepl"
2599 # do not add paths which are already there
2600 case " $newlib_search_path " in
2602 *) newlib_search_path="$newlib_search_path $path";;
2616 # Again, we only want to link against shared libraries
2617 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2618 for tmp in $newlib_search_path ; do
2619 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2620 eval depdepl="$tmp/lib$tmp_libs.dylib"
2631 case " $deplibs " in
2633 *) deplibs="$deplibs $depdepl" ;;
2635 case " $deplibs " in
2637 *) deplibs="$deplibs $path" ;;
2640 fi # link_all_deplibs != no
2642 done # for deplib in $libs
2643 dependency_libs="$newdependency_libs"
2644 if test "$pass" = dlpreopen; then
2645 # Link the dlpreopened libraries before other libraries
2646 for deplib in $save_deplibs; do
2647 deplibs="$deplib $deplibs"
2650 if test "$pass" != dlopen; then
2651 if test "$pass" != conv; then
2652 # Make sure lib_search_path contains only unique directories.
2654 for dir in $newlib_search_path; do
2655 case "$lib_search_path " in
2657 *) lib_search_path="$lib_search_path $dir" ;;
2663 if test "$linkmode,$pass" != "prog,link"; then
2666 vars="compile_deplibs finalize_deplibs"
2668 for var in $vars dependency_libs; do
2669 # Add libraries to $var in reverse order
2670 eval tmp_libs=\"\$$var\"
2672 for deplib in $tmp_libs; do
2673 # FIXME: Pedantically, this is the right thing to do, so
2674 # that some nasty dependency loop isn't accidentally
2676 #new_libs="$deplib $new_libs"
2677 # Pragmatically, this seems to cause very few problems in
2680 -L*) new_libs="$deplib $new_libs" ;;
2683 # And here is the reason: when a library appears more
2684 # than once as an explicit dependence of a library, or
2685 # is implicitly linked in more than once by the
2686 # compiler, it is considered special, and multiple
2687 # occurrences thereof are not removed. Compare this
2688 # with having the same library being listed as a
2689 # dependency of multiple other libraries: in this case,
2690 # we know (pedantically, we assume) the library does not
2691 # need to be listed more than once, so we keep only the
2692 # last copy. This is not always right, but it is rare
2693 # enough that we require users that really mean to play
2694 # such unportable linking tricks to link the library
2695 # using -Wl,-lname, so that libtool does not consider it
2696 # for duplicate removal.
2697 case " $specialdeplibs " in
2698 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2700 case " $new_libs " in
2702 *) new_libs="$deplib $new_libs" ;;
2710 for deplib in $new_libs; do
2713 case " $tmp_libs " in
2715 *) tmp_libs="$tmp_libs $deplib" ;;
2718 *) tmp_libs="$tmp_libs $deplib" ;;
2721 eval $var=\"$tmp_libs\"
2724 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2726 for i in $dependency_libs ; do
2727 case " $predeps $postdeps $compiler_lib_search_path " in
2732 if test -n "$i" ; then
2733 tmp_libs="$tmp_libs $i"
2736 dependency_libs=$tmp_libs
2738 if test "$linkmode" = prog; then
2739 dlfiles="$newdlfiles"
2740 dlprefiles="$newdlprefiles"
2745 if test -n "$deplibs"; then
2746 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2749 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2750 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2753 if test -n "$rpath"; then
2754 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2757 if test -n "$xrpath"; then
2758 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2761 if test -n "$vinfo"; then
2762 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2765 if test -n "$release"; then
2766 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2769 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2770 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2773 # Now set the variables for building old libraries.
2774 build_libtool_libs=no
2776 objs="$objs$old_deplibs"
2780 # Make sure we only generate libraries of the form `libNAME.la'.
2783 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2784 eval shared_ext=\"$shrext\"
2785 eval libname=\"$libname_spec\"
2788 if test "$module" = no; then
2789 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2793 if test "$need_lib_prefix" != no; then
2794 # Add the "lib" prefix for modules if required
2795 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2796 eval shared_ext=\"$shrext\"
2797 eval libname=\"$libname_spec\"
2799 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2804 if test -n "$objs"; then
2805 if test "$deplibs_check_method" != pass_all; then
2806 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2810 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2811 $echo "*** objects $objs is not portable!"
2812 libobjs="$libobjs $objs"
2816 if test "$dlself" != no; then
2817 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2821 if test "$#" -gt 2; then
2822 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2827 if test -z "$rpath"; then
2828 if test "$build_libtool_libs" = yes; then
2829 # Building a libtool convenience library.
2830 # Some compilers have problems with a `.al' extension so
2831 # convenience libraries should have the same extension an
2832 # archive normally would.
2833 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2834 build_libtool_libs=convenience
2838 if test -n "$vinfo"; then
2839 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2842 if test -n "$release"; then
2843 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2847 # Parse the version information argument.
2848 save_ifs="$IFS"; IFS=':'
2849 set dummy $vinfo 0 0 0
2852 if test -n "$8"; then
2853 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2858 # convert absolute version numbers to libtool ages
2859 # this retains compatibility with .la files and attempts
2860 # to make the code below a bit more comprehensible
2862 case $vinfo_number in
2866 number_revision="$4"
2868 # There are really only two kinds -- those that
2869 # use the current revision as the major version
2870 # and those that subtract age and use age as
2871 # a minor version. But, then there is irix
2872 # which has an extra 1 added just for fun
2874 case $version_type in
2875 darwin|linux|osf|windows)
2876 current=`expr $number_major + $number_minor`
2878 revision="$number_revision"
2880 freebsd-aout|freebsd-elf|sunos)
2881 current="$number_major"
2882 revision="$number_minor"
2886 current=`expr $number_major + $number_minor - 1`
2888 revision="$number_minor"
2899 # Check that each of the things are valid numbers.
2901 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2903 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2904 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2910 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2912 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2913 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2919 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2921 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2927 if test "$age" -gt "$current"; then
2928 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2929 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2933 # Calculate the version variables.
2937 case $version_type in
2941 # Like Linux, but with the current version available in
2942 # verstring for coding it into the library header
2943 major=.`expr $current - $age`
2944 versuffix="$major.$age.$revision"
2945 # Darwin ld doesn't like 0 for these options...
2946 minor_current=`expr $current + 1`
2947 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2952 versuffix=".$current.$revision";
2957 versuffix=".$current";
2961 major=`expr $current - $age + 1`
2963 case $version_type in
2964 nonstopux) verstring_prefix=nonstopux ;;
2965 *) verstring_prefix=sgi ;;
2967 verstring="$verstring_prefix$major.$revision"
2969 # Add in all the interfaces that we are compatible with.
2971 while test "$loop" -ne 0; do
2972 iface=`expr $revision - $loop`
2973 loop=`expr $loop - 1`
2974 verstring="$verstring_prefix$major.$iface:$verstring"
2977 # Before this point, $major must not contain `.'.
2979 versuffix="$major.$revision"
2983 major=.`expr $current - $age`
2984 versuffix="$major.$age.$revision"
2988 major=.`expr $current - $age`
2989 versuffix=".$current.$age.$revision"
2990 verstring="$current.$age.$revision"
2992 # Add in all the interfaces that we are compatible with.
2994 while test "$loop" -ne 0; do
2995 iface=`expr $current - $loop`
2996 loop=`expr $loop - 1`
2997 verstring="$verstring:${iface}.0"
3000 # Make executables depend on our current version.
3001 verstring="$verstring:${current}.0"
3006 versuffix=".$current.$revision"
3010 # Use '-' rather than '.', since we only want one
3011 # extension on DOS 8.3 filesystems.
3012 major=`expr $current - $age`
3017 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3018 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3023 # Clear the version info if we defaulted, and they specified a release.
3024 if test -z "$vinfo" && test -n "$release"; then
3026 case $version_type in
3028 # we can't check for "0.0" in archive_cmds due to quoting
3029 # problems, so we reset it completely
3036 if test "$need_version" = no; then
3043 # Remove version info from name if versioning should be avoided
3044 if test "$avoid_version" = yes && test "$need_version" = no; then
3050 # Check to see if the archive will have undefined symbols.
3051 if test "$allow_undefined" = yes; then
3052 if test "$allow_undefined_flag" = unsupported; then
3053 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3054 build_libtool_libs=no
3058 # Don't allow undefined symbols.
3059 allow_undefined_flag="$no_undefined_flag"
3063 if test "$mode" != relink; then
3064 # Remove our outputs, but don't remove object files since they
3065 # may have been created when compiling PIC objects.
3067 tempremovelist=`$echo "$output_objdir/*"`
3068 for p in $tempremovelist; do
3072 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3073 removelist="$removelist $p"
3078 if test -n "$removelist"; then
3079 $show "${rm}r $removelist"
3080 $run ${rm}r $removelist
3084 # Now set the variables for building old libraries.
3085 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3086 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3088 # Transform .lo files to .o files.
3089 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3092 # Eliminate all temporary directories.
3093 for path in $notinst_path; do
3094 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3095 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3096 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3099 if test -n "$xrpath"; then
3100 # If the user specified any rpath flags, then add them.
3102 for libdir in $xrpath; do
3103 temp_xrpath="$temp_xrpath -R$libdir"
3104 case "$finalize_rpath " in
3106 *) finalize_rpath="$finalize_rpath $libdir" ;;
3109 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3110 dependency_libs="$temp_xrpath $dependency_libs"
3114 # Make sure dlfiles contains only unique files that won't be dlpreopened
3115 old_dlfiles="$dlfiles"
3117 for lib in $old_dlfiles; do
3118 case " $dlprefiles $dlfiles " in
3120 *) dlfiles="$dlfiles $lib" ;;
3124 # Make sure dlprefiles contains only unique files
3125 old_dlprefiles="$dlprefiles"
3127 for lib in $old_dlprefiles; do
3128 case "$dlprefiles " in
3130 *) dlprefiles="$dlprefiles $lib" ;;
3134 if test "$build_libtool_libs" = yes; then
3135 if test -n "$rpath"; then
3137 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3138 # these systems don't actually have a c library (as such)!
3140 *-*-rhapsody* | *-*-darwin1.[012])
3141 # Rhapsody C library is in the System framework
3142 deplibs="$deplibs -framework System"
3145 # Don't link with libc until the a.out ld.so is fixed.
3147 *-*-openbsd* | *-*-freebsd*)
3148 # Do not include libc due to us having libc/libc_r.
3149 test "X$arg" = "X-lc" && continue
3152 # Add libc to deplibs on all other systems if necessary.
3153 if test "$build_libtool_need_lc" = "yes"; then
3154 deplibs="$deplibs -lc"
3160 # Transform deplibs into only deplibs that can be linked in shared.
3162 libname_save=$libname
3163 release_save=$release
3164 versuffix_save=$versuffix
3166 # I'm not sure if I'm treating the release correctly. I think
3167 # release should show up in the -l (ie -lgmp5) so we don't want to
3168 # add it in twice. Is that correct?
3174 case $deplibs_check_method in
3176 # Don't check for shared/static. Everything works.
3177 # This might be a little naive. We might want to check
3178 # whether the library exists or not. But this is on
3179 # osf3 & osf4 and I'm not really sure... Just
3180 # implementing what was already the behavior.
3184 # This code stresses the "libraries are programs" paradigm to its
3185 # limits. Maybe even breaks it. We compile a program, linking it
3186 # against the deplibs as a proxy for the library. Then we can check
3187 # whether they linked in statically or dynamically with ldd.
3189 cat > conftest.c <<EOF
3190 int main() { return 0; }
3193 $LTCC -o conftest conftest.c $deplibs
3194 if test "$?" -eq 0 ; then
3195 ldd_output=`ldd conftest`
3196 for i in $deplibs; do
3197 name="`expr $i : '-l\(.*\)'`"
3198 # If $name is empty we are operating on a -L argument.
3199 if test "$name" != "" && test "$name" -ne "0"; then
3200 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3201 case " $predeps $postdeps " in
3203 newdeplibs="$newdeplibs $i"
3208 if test -n "$i" ; then
3209 libname=`eval \\$echo \"$libname_spec\"`
3210 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3211 set dummy $deplib_matches
3213 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3214 newdeplibs="$newdeplibs $i"
3218 $echo "*** Warning: dynamic linker does not accept needed library $i."
3219 $echo "*** I have the capability to make that library automatically link in when"
3220 $echo "*** you link to this library. But I can only do this if you have a"
3221 $echo "*** shared version of the library, which I believe you do not have"
3222 $echo "*** because a test_compile did reveal that the linker did not use it for"
3223 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3227 newdeplibs="$newdeplibs $i"
3231 # Error occurred in the first compile. Let's try to salvage
3232 # the situation: Compile a separate program for each library.
3233 for i in $deplibs; do
3234 name="`expr $i : '-l\(.*\)'`"
3235 # If $name is empty we are operating on a -L argument.
3236 if test "$name" != "" && test "$name" != "0"; then
3238 $LTCC -o conftest conftest.c $i
3240 if test "$?" -eq 0 ; then
3241 ldd_output=`ldd conftest`
3242 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3243 case " $predeps $postdeps " in
3245 newdeplibs="$newdeplibs $i"
3250 if test -n "$i" ; then
3251 libname=`eval \\$echo \"$libname_spec\"`
3252 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3253 set dummy $deplib_matches
3255 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3256 newdeplibs="$newdeplibs $i"
3260 $echo "*** Warning: dynamic linker does not accept needed library $i."
3261 $echo "*** I have the capability to make that library automatically link in when"
3262 $echo "*** you link to this library. But I can only do this if you have a"
3263 $echo "*** shared version of the library, which you do not appear to have"
3264 $echo "*** because a test_compile did reveal that the linker did not use this one"
3265 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3271 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3272 $echo "*** make it link in! You will probably need to install it or some"
3273 $echo "*** library that it depends on before this library will be fully"
3274 $echo "*** functional. Installing it before continuing would be even better."
3277 newdeplibs="$newdeplibs $i"
3283 set dummy $deplibs_check_method
3284 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3285 for a_deplib in $deplibs; do
3286 name="`expr $a_deplib : '-l\(.*\)'`"
3287 # If $name is empty we are operating on a -L argument.
3288 if test "$name" != "" && test "$name" != "0"; then
3289 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3290 case " $predeps $postdeps " in
3292 newdeplibs="$newdeplibs $a_deplib"
3297 if test -n "$a_deplib" ; then
3298 libname=`eval \\$echo \"$libname_spec\"`
3299 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3300 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3301 for potent_lib in $potential_libs; do
3302 # Follow soft links.
3303 if ls -lLd "$potent_lib" 2>/dev/null \
3304 | grep " -> " >/dev/null; then
3307 # The statement above tries to avoid entering an
3308 # endless loop below, in case of cyclic links.
3309 # We might still enter an endless loop, since a link
3310 # loop can be closed while we follow links,
3312 potlib="$potent_lib"
3313 while test -h "$potlib" 2>/dev/null; do
3314 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3316 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3317 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3320 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3322 | $EGREP "$file_magic_regex" > /dev/null; then
3323 newdeplibs="$newdeplibs $a_deplib"
3330 if test -n "$a_deplib" ; then
3333 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3334 $echo "*** I have the capability to make that library automatically link in when"
3335 $echo "*** you link to this library. But I can only do this if you have a"
3336 $echo "*** shared version of the library, which you do not appear to have"
3337 $echo "*** because I did check the linker path looking for a file starting"
3338 if test -z "$potlib" ; then
3339 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3341 $echo "*** with $libname and none of the candidates passed a file format test"
3342 $echo "*** using a file magic. Last file checked: $potlib"
3346 # Add a -L argument.
3347 newdeplibs="$newdeplibs $a_deplib"
3349 done # Gone through all deplibs.
3352 set dummy $deplibs_check_method
3353 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3354 for a_deplib in $deplibs; do
3355 name="`expr $a_deplib : '-l\(.*\)'`"
3356 # If $name is empty we are operating on a -L argument.
3357 if test -n "$name" && test "$name" != "0"; then
3358 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3359 case " $predeps $postdeps " in
3361 newdeplibs="$newdeplibs $a_deplib"
3366 if test -n "$a_deplib" ; then
3367 libname=`eval \\$echo \"$libname_spec\"`
3368 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3369 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3370 for potent_lib in $potential_libs; do
3371 potlib="$potent_lib" # see symlink-check above in file_magic test
3372 if eval $echo \"$potent_lib\" 2>/dev/null \
3374 | $EGREP "$match_pattern_regex" > /dev/null; then
3375 newdeplibs="$newdeplibs $a_deplib"
3382 if test -n "$a_deplib" ; then
3385 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3386 $echo "*** I have the capability to make that library automatically link in when"
3387 $echo "*** you link to this library. But I can only do this if you have a"
3388 $echo "*** shared version of the library, which you do not appear to have"
3389 $echo "*** because I did check the linker path looking for a file starting"
3390 if test -z "$potlib" ; then
3391 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3393 $echo "*** with $libname and none of the candidates passed a file format test"
3394 $echo "*** using a regex pattern. Last file checked: $potlib"
3398 # Add a -L argument.
3399 newdeplibs="$newdeplibs $a_deplib"
3401 done # Gone through all deplibs.
3405 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3406 -e 's/ -[LR][^ ]*//g'`
3407 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3408 for i in $predeps $postdeps ; do
3409 # can't use Xsed below, because $i might contain '/'
3410 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3413 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3414 | grep . >/dev/null; then
3416 if test "X$deplibs_check_method" = "Xnone"; then
3417 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3419 $echo "*** Warning: inter-library dependencies are not known to be supported."
3421 $echo "*** All declared inter-library dependencies are being dropped."
3426 versuffix=$versuffix_save
3428 release=$release_save
3429 libname=$libname_save
3433 *-*-rhapsody* | *-*-darwin1.[012])
3434 # On Rhapsody replace the C library is the System framework
3435 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3439 if test "$droppeddeps" = yes; then
3440 if test "$module" = yes; then
3442 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3443 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3444 $echo "*** a static module, that should work as long as the dlopening"
3445 $echo "*** application is linked with the -dlopen flag."
3446 if test -z "$global_symbol_pipe"; then
3448 $echo "*** However, this would only work if libtool was able to extract symbol"
3449 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3450 $echo "*** not find such a program. So, this module is probably useless."
3451 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3453 if test "$build_old_libs" = no; then
3454 oldlibs="$output_objdir/$libname.$libext"
3455 build_libtool_libs=module
3458 build_libtool_libs=no
3461 $echo "*** The inter-library dependencies that have been dropped here will be"
3462 $echo "*** automatically added whenever a program is linked with this library"
3463 $echo "*** or is declared to -dlopen it."
3465 if test "$allow_undefined" = no; then
3467 $echo "*** Since this library must not contain undefined symbols,"
3468 $echo "*** because either the platform does not support them or"
3469 $echo "*** it was explicitly requested with -no-undefined,"
3470 $echo "*** libtool will only create a static version of it."
3471 if test "$build_old_libs" = no; then
3472 oldlibs="$output_objdir/$libname.$libext"
3473 build_libtool_libs=module
3476 build_libtool_libs=no
3481 # Done checking deplibs!
3485 # All the library-specific variables (install_libdir is set above).
3490 # Test again, we may have decided not to build it any more
3491 if test "$build_libtool_libs" = yes; then
3492 if test "$hardcode_into_libs" = yes; then
3493 # Hardcode the library paths
3496 rpath="$finalize_rpath"
3497 test "$mode" != relink && rpath="$compile_rpath$rpath"
3498 for libdir in $rpath; do
3499 if test -n "$hardcode_libdir_flag_spec"; then
3500 if test -n "$hardcode_libdir_separator"; then
3501 if test -z "$hardcode_libdirs"; then
3502 hardcode_libdirs="$libdir"
3504 # Just accumulate the unique libdirs.
3505 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3506 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3509 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3514 eval flag=\"$hardcode_libdir_flag_spec\"
3515 dep_rpath="$dep_rpath $flag"
3517 elif test -n "$runpath_var"; then
3518 case "$perm_rpath " in
3520 *) perm_rpath="$perm_rpath $libdir" ;;
3524 # Substitute the hardcoded libdirs into the rpath.
3525 if test -n "$hardcode_libdir_separator" &&
3526 test -n "$hardcode_libdirs"; then
3527 libdir="$hardcode_libdirs"
3528 if test -n "$hardcode_libdir_flag_spec_ld"; then
3529 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3531 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3534 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3535 # We should set the runpath_var.
3537 for dir in $perm_rpath; do
3540 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3542 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3545 shlibpath="$finalize_shlibpath"
3546 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3547 if test -n "$shlibpath"; then
3548 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3551 # Get the real and link names of the library.
3552 eval shared_ext=\"$shrext\"
3553 eval library_names=\"$library_names_spec\"
3554 set dummy $library_names
3558 if test -n "$soname_spec"; then
3559 eval soname=\"$soname_spec\"
3563 if test -z "$dlname"; then
3567 lib="$output_objdir/$realname"
3570 linknames="$linknames $link"
3573 # Use standard objects if they are pic
3574 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3576 # Prepare the list of exported symbols
3577 if test -z "$export_symbols"; then
3578 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3579 $show "generating symbol list for \`$libname.la'"
3580 export_symbols="$output_objdir/$libname.exp"
3581 $run $rm $export_symbols
3582 eval cmds=\"$export_symbols_cmds\"
3583 save_ifs="$IFS"; IFS='~'
3584 for cmd in $cmds; do
3586 if len=`expr "X$cmd" : ".*"` &&
3587 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3589 $run eval "$cmd" || exit $?
3590 skipped_export=false
3592 # The command line is too long to execute in one step.
3593 $show "using reloadable object file for export list..."
3598 if test -n "$export_symbols_regex"; then
3599 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3600 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3601 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3602 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3607 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3608 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3612 for test_deplib in $deplibs; do
3613 case " $convenience " in
3614 *" $test_deplib "*) ;;
3616 tmp_deplibs="$tmp_deplibs $test_deplib"
3620 deplibs="$tmp_deplibs"
3622 if test -n "$convenience"; then
3623 if test -n "$whole_archive_flag_spec"; then
3624 save_libobjs=$libobjs
3625 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3627 gentop="$output_objdir/${outputname}x"
3628 $show "${rm}r $gentop"
3629 $run ${rm}r "$gentop"
3630 $show "$mkdir $gentop"
3631 $run $mkdir "$gentop"
3633 if test "$status" -ne 0 && test ! -d "$gentop"; then
3636 generated="$generated $gentop"
3638 for xlib in $convenience; do
3639 # Extract the objects.
3641 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3642 *) xabs=`pwd`"/$xlib" ;;
3644 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3645 xdir="$gentop/$xlib"
3647 $show "${rm}r $xdir"
3649 $show "$mkdir $xdir"
3652 if test "$status" -ne 0 && test ! -d "$xdir"; then
3655 # We will extract separately just the conflicting names and we will no
3656 # longer touch any unique names. It is faster to leave these extract
3657 # automatically by $AR in one run.
3658 $show "(cd $xdir && $AR x $xabs)"
3659 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3660 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3663 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3664 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3665 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3668 while test "$i" -le "$count"
3670 # Put our $i before any first dot (extension)
3671 # Never overwrite any file
3673 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3675 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3677 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3678 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3684 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3689 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3690 eval flag=\"$thread_safe_flag_spec\"
3691 linker_flags="$linker_flags $flag"
3694 # Make a backup of the uninstalled library when relinking
3695 if test "$mode" = relink; then
3696 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3699 # Do each of the archive commands.
3700 if test "$module" = yes && test -n "$module_cmds" ; then
3701 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3702 eval cmds=\"$module_expsym_cmds\"
3704 eval cmds=\"$module_cmds\"
3707 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3708 eval cmds=\"$archive_expsym_cmds\"
3710 eval cmds=\"$archive_cmds\"
3714 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3715 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3718 # The command line is too long to link in one step, link piecewise.
3719 $echo "creating reloadable object files..."
3721 # Save the value of $output and $libobjs because we want to
3722 # use them later. If we have whole_archive_flag_spec, we
3723 # want to use save_libobjs as it was before
3724 # whole_archive_flag_spec was expanded, because we can't
3725 # assume the linker understands whole_archive_flag_spec.
3726 # This may have to be revisited, in case too many
3727 # convenience libraries get linked in and end up exceeding
3729 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3730 save_libobjs=$libobjs
3734 # Clear the reloadable object creation command queue and
3735 # initialize k to one.
3742 output=$output_objdir/$save_output-${k}.$objext
3743 # Loop over the list of objects to be linked.
3744 for obj in $save_libobjs
3746 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3747 if test "X$objlist" = X ||
3748 { len=`expr "X$test_cmds" : ".*"` &&
3749 test "$len" -le "$max_cmd_len"; }; then
3750 objlist="$objlist $obj"
3752 # The command $test_cmds is almost too long, add a
3753 # command to the queue.
3754 if test "$k" -eq 1 ; then
3755 # The first file doesn't have a previous command to add.
3756 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3758 # All subsequent reloadable object files will link in
3759 # the last one created.
3760 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3762 last_robj=$output_objdir/$save_output-${k}.$objext
3764 output=$output_objdir/$save_output-${k}.$objext
3769 # Handle the remaining objects by creating one last
3770 # reloadable object file. All subsequent reloadable object
3771 # files will link in the last one created.
3772 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3773 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3775 if ${skipped_export-false}; then
3776 $show "generating symbol list for \`$libname.la'"
3777 export_symbols="$output_objdir/$libname.exp"
3778 $run $rm $export_symbols
3780 # Append the command to create the export file.
3781 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3784 # Set up a command to remove the reloadale object files
3785 # after they are used.
3787 while test "$i" -lt "$k"
3790 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3793 $echo "creating a temporary reloadable object file: $output"
3795 # Loop through the commands generated above and execute them.
3796 save_ifs="$IFS"; IFS='~'
3797 for cmd in $concat_cmds; do
3800 $run eval "$cmd" || exit $?
3805 # Restore the value of output.
3808 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3809 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3811 # Expand the library linking commands again to reset the
3812 # value of $libobjs for piecewise linking.
3814 # Do each of the archive commands.
3815 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3816 eval cmds=\"$archive_expsym_cmds\"
3818 eval cmds=\"$archive_cmds\"
3821 # Append the command to remove the reloadable object files
3822 # to the just-reset $cmds.
3823 eval cmds=\"\$cmds~$rm $delfiles\"
3825 save_ifs="$IFS"; IFS='~'
3826 for cmd in $cmds; do
3829 $run eval "$cmd" || exit $?
3833 # Restore the uninstalled library and exit
3834 if test "$mode" = relink; then
3835 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3839 # Create links to the real library.
3840 for linkname in $linknames; do
3841 if test "$realname" != "$linkname"; then
3842 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3843 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3847 # If -module or -export-dynamic was specified, set the dlname.
3848 if test "$module" = yes || test "$export_dynamic" = yes; then
3849 # On all known operating systems, these are identical.
3856 if test -n "$deplibs"; then
3857 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3860 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3861 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3864 if test -n "$rpath"; then
3865 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3868 if test -n "$xrpath"; then
3869 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3872 if test -n "$vinfo"; then
3873 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3876 if test -n "$release"; then
3877 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3882 if test -n "$objs$old_deplibs"; then
3883 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3887 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3895 # Delete the old objects.
3896 $run $rm $obj $libobj
3898 # Objects from convenience libraries. This assumes
3899 # single-version convenience libraries. Whenever we create
3900 # different ones for PIC/non-PIC, this we'll have to duplicate
3904 # reload_cmds runs $LD directly, so let us get rid of
3905 # -Wl from whole_archive_flag_spec
3908 if test -n "$convenience"; then
3909 if test -n "$whole_archive_flag_spec"; then
3910 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3912 gentop="$output_objdir/${obj}x"
3913 $show "${rm}r $gentop"
3914 $run ${rm}r "$gentop"
3915 $show "$mkdir $gentop"
3916 $run $mkdir "$gentop"
3918 if test "$status" -ne 0 && test ! -d "$gentop"; then
3921 generated="$generated $gentop"
3923 for xlib in $convenience; do
3924 # Extract the objects.
3926 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3927 *) xabs=`pwd`"/$xlib" ;;
3929 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3930 xdir="$gentop/$xlib"
3932 $show "${rm}r $xdir"
3934 $show "$mkdir $xdir"
3937 if test "$status" -ne 0 && test ! -d "$xdir"; then
3940 # We will extract separately just the conflicting names and we will no
3941 # longer touch any unique names. It is faster to leave these extract
3942 # automatically by $AR in one run.
3943 $show "(cd $xdir && $AR x $xabs)"
3944 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3945 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3948 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3949 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3950 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3953 while test "$i" -le "$count"
3955 # Put our $i before any first dot (extension)
3956 # Never overwrite any file
3958 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3960 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3962 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3963 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3969 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3974 # Create the old-style object.
3975 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
3978 eval cmds=\"$reload_cmds\"
3979 save_ifs="$IFS"; IFS='~'
3980 for cmd in $cmds; do
3983 $run eval "$cmd" || exit $?
3987 # Exit if we aren't doing a library object file.
3988 if test -z "$libobj"; then
3989 if test -n "$gentop"; then
3990 $show "${rm}r $gentop"
3997 if test "$build_libtool_libs" != yes; then
3998 if test -n "$gentop"; then
3999 $show "${rm}r $gentop"
4003 # Create an invalid libtool object if no PIC, so that we don't
4004 # accidentally link it into a program.
4005 # $show "echo timestamp > $libobj"
4006 # $run eval "echo timestamp > $libobj" || exit $?
4010 if test -n "$pic_flag" || test "$pic_mode" != default; then
4011 # Only do commands if we really have different PIC objects.
4012 reload_objs="$libobjs $reload_conv_objs"
4014 eval cmds=\"$reload_cmds\"
4015 save_ifs="$IFS"; IFS='~'
4016 for cmd in $cmds; do
4019 $run eval "$cmd" || exit $?
4024 if test -n "$gentop"; then
4025 $show "${rm}r $gentop"
4034 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4036 if test -n "$vinfo"; then
4037 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4040 if test -n "$release"; then
4041 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4044 if test "$preload" = yes; then
4045 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4046 test "$dlopen_self_static" = unknown; then
4047 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4052 *-*-rhapsody* | *-*-darwin1.[012])
4053 # On Rhapsody replace the C library is the System framework
4054 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4055 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4061 # Don't allow lazy linking, it breaks C++ global constructors
4062 if test "$tagname" = CXX ; then
4063 compile_command="$compile_command ${wl}-bind_at_load"
4064 finalize_command="$finalize_command ${wl}-bind_at_load"
4069 compile_command="$compile_command $compile_deplibs"
4070 finalize_command="$finalize_command $finalize_deplibs"
4072 if test -n "$rpath$xrpath"; then
4073 # If the user specified any rpath flags, then add them.
4074 for libdir in $rpath $xrpath; do
4075 # This is the magic to use -rpath.
4076 case "$finalize_rpath " in
4078 *) finalize_rpath="$finalize_rpath $libdir" ;;
4083 # Now hardcode the library paths
4086 for libdir in $compile_rpath $finalize_rpath; do
4087 if test -n "$hardcode_libdir_flag_spec"; then
4088 if test -n "$hardcode_libdir_separator"; then
4089 if test -z "$hardcode_libdirs"; then
4090 hardcode_libdirs="$libdir"
4092 # Just accumulate the unique libdirs.
4093 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4094 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4097 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4102 eval flag=\"$hardcode_libdir_flag_spec\"
4103 rpath="$rpath $flag"
4105 elif test -n "$runpath_var"; then
4106 case "$perm_rpath " in
4108 *) perm_rpath="$perm_rpath $libdir" ;;
4112 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4113 case :$dllsearchpath: in
4115 *) dllsearchpath="$dllsearchpath:$libdir";;
4120 # Substitute the hardcoded libdirs into the rpath.
4121 if test -n "$hardcode_libdir_separator" &&
4122 test -n "$hardcode_libdirs"; then
4123 libdir="$hardcode_libdirs"
4124 eval rpath=\" $hardcode_libdir_flag_spec\"
4126 compile_rpath="$rpath"
4130 for libdir in $finalize_rpath; do
4131 if test -n "$hardcode_libdir_flag_spec"; then
4132 if test -n "$hardcode_libdir_separator"; then
4133 if test -z "$hardcode_libdirs"; then
4134 hardcode_libdirs="$libdir"
4136 # Just accumulate the unique libdirs.
4137 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4138 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4141 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4146 eval flag=\"$hardcode_libdir_flag_spec\"
4147 rpath="$rpath $flag"
4149 elif test -n "$runpath_var"; then
4150 case "$finalize_perm_rpath " in
4152 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4156 # Substitute the hardcoded libdirs into the rpath.
4157 if test -n "$hardcode_libdir_separator" &&
4158 test -n "$hardcode_libdirs"; then
4159 libdir="$hardcode_libdirs"
4160 eval rpath=\" $hardcode_libdir_flag_spec\"
4162 finalize_rpath="$rpath"
4164 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4165 # Transform all the library objects into standard objects.
4166 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4167 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4171 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4172 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4173 dlsyms="${outputname}S.c"
4175 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4179 if test -n "$dlsyms"; then
4183 # Discover the nlist of each of the dlfiles.
4184 nlist="$output_objdir/${outputname}.nm"
4186 $show "$rm $nlist ${nlist}S ${nlist}T"
4187 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4189 # Parse the name list into a source file.
4190 $show "creating $output_objdir/$dlsyms"
4192 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4193 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4194 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4200 /* Prevent the only kind of declaration conflicts we can make. */
4201 #define lt_preloaded_symbols some_other_symbol
4203 /* External symbol declarations for the compiler. */\
4206 if test "$dlself" = yes; then
4207 $show "generating symbol list for \`$output'"
4209 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4211 # Add our own program objects to the symbol list.
4212 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4213 for arg in $progfiles; do
4214 $show "extracting global C symbols from \`$arg'"
4215 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4218 if test -n "$exclude_expsyms"; then
4219 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4220 $run eval '$mv "$nlist"T "$nlist"'
4223 if test -n "$export_symbols_regex"; then
4224 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4225 $run eval '$mv "$nlist"T "$nlist"'
4228 # Prepare the list of exported symbols
4229 if test -z "$export_symbols"; then
4230 export_symbols="$output_objdir/$output.exp"
4231 $run $rm $export_symbols
4232 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4234 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4235 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4236 $run eval 'mv "$nlist"T "$nlist"'
4240 for arg in $dlprefiles; do
4241 $show "extracting global C symbols from \`$arg'"
4242 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4243 $run eval '$echo ": $name " >> "$nlist"'
4244 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4247 if test -z "$run"; then
4248 # Make sure we have at least an empty file.
4249 test -f "$nlist" || : > "$nlist"
4251 if test -n "$exclude_expsyms"; then
4252 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4253 $mv "$nlist"T "$nlist"
4256 # Try sorting and uniquifying the output.
4257 if grep -v "^: " < "$nlist" |
4258 if sort -k 3 </dev/null >/dev/null 2>&1; then
4263 uniq > "$nlist"S; then
4266 grep -v "^: " < "$nlist" > "$nlist"S
4269 if test -f "$nlist"S; then
4270 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4272 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4275 $echo >> "$output_objdir/$dlsyms" "\
4277 #undef lt_preloaded_symbols
4279 #if defined (__STDC__) && __STDC__
4280 # define lt_ptr void *
4282 # define lt_ptr char *
4286 /* The mapping between symbol names and symbols. */
4291 lt_preloaded_symbols[] =
4295 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4297 $echo >> "$output_objdir/$dlsyms" "\
4301 /* This works around a problem in FreeBSD linker */
4302 #ifdef FREEBSD_WORKAROUND
4303 static const void *lt_preloaded_setup() {
4304 return lt_preloaded_symbols;
4314 pic_flag_for_symtable=
4316 # compiling the symbol table file with pic_flag works around
4317 # a FreeBSD bug that causes programs to crash when -lm is
4318 # linked before any other PIC object. But we must not use
4319 # pic_flag when linking with -static. The problem exists in
4320 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4321 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4322 case "$compile_command " in
4324 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4327 case "$compile_command " in
4329 *) pic_flag_for_symtable=" $pic_flag";;
4333 # Now compile the dynamic symbol file.
4334 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4335 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4337 # Clean up the generated files.
4338 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4339 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4341 # Transform the symbol file into the correct name.
4342 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4343 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4346 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4351 # We keep going just in case the user didn't refer to
4352 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4353 # really was required.
4355 # Nullify the symbol file.
4356 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4357 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4360 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4361 # Replace the output file specification.
4362 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4363 link_command="$compile_command$compile_rpath"
4365 # We have no uninstalled library dependencies, so finalize right now.
4366 $show "$link_command"
4367 $run eval "$link_command"
4370 # Delete the generated files.
4371 if test -n "$dlsyms"; then
4372 $show "$rm $output_objdir/${outputname}S.${objext}"
4373 $run $rm "$output_objdir/${outputname}S.${objext}"
4379 if test -n "$shlibpath_var"; then
4380 # We should set the shlibpath_var
4382 for dir in $temp_rpath; do
4384 [\\/]* | [A-Za-z]:[\\/]*)
4389 # Relative path: add a thisdir entry.
4390 rpath="$rpath\$thisdir/$dir:"
4397 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4398 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4400 if test -n "$finalize_shlibpath"; then
4401 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4406 if test -n "$runpath_var"; then
4407 if test -n "$perm_rpath"; then
4408 # We should set the runpath_var.
4410 for dir in $perm_rpath; do
4413 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4415 if test -n "$finalize_perm_rpath"; then
4416 # We should set the runpath_var.
4418 for dir in $finalize_perm_rpath; do
4421 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4425 if test "$no_install" = yes; then
4426 # We don't need to create a wrapper script.
4427 link_command="$compile_var$compile_command$compile_rpath"
4428 # Replace the output file specification.
4429 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4430 # Delete the old output file.
4432 # Link the executable and exit
4433 $show "$link_command"
4434 $run eval "$link_command" || exit $?
4438 if test "$hardcode_action" = relink; then
4439 # Fast installation is not supported
4440 link_command="$compile_var$compile_command$compile_rpath"
4441 relink_command="$finalize_var$finalize_command$finalize_rpath"
4443 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4444 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4446 if test "$fast_install" != no; then
4447 link_command="$finalize_var$compile_command$finalize_rpath"
4448 if test "$fast_install" = yes; then
4449 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4451 # fast_install is set to needless
4455 link_command="$compile_var$compile_command$compile_rpath"
4456 relink_command="$finalize_var$finalize_command$finalize_rpath"
4460 # Replace the output file specification.
4461 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4463 # Delete the old output files.
4464 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4466 $show "$link_command"
4467 $run eval "$link_command" || exit $?
4469 # Now create the wrapper script.
4470 $show "creating $output"
4472 # Quote the relink command for shipping.
4473 if test -n "$relink_command"; then
4474 # Preserve any variables that may affect compiler behavior
4475 for var in $variables_saved_for_relink; do
4476 if eval test -z \"\${$var+set}\"; then
4477 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4478 elif eval var_value=\$$var; test -z "$var_value"; then
4479 relink_command="$var=; export $var; $relink_command"
4481 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4482 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4485 relink_command="(cd `pwd`; $relink_command)"
4486 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4489 # Quote $echo for shipping.
4490 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4492 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4493 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4495 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4497 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4500 # Only actually do things if our run command is non-null.
4501 if test -z "$run"; then
4502 # win32 will think the script is a binary if it has
4503 # a .exe suffix, so we strip it off here.
4505 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4507 # test for cygwin because mv fails w/o .exe extensions
4511 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4515 *cygwin* | *mingw* )
4516 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4517 cwrapper=`$echo ${output}.exe`
4518 $rm $cwrappersource $cwrapper
4519 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4521 cat > $cwrappersource <<EOF
4523 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4524 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4526 The $output program cannot be directly executed until all the libtool
4527 libraries that it depends on are installed.
4529 This wrapper executable should never be moved out of the build directory.
4530 If it is, it will not operate correctly.
4532 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4533 but could eventually absorb all of the scripts functionality and
4534 exec $objdir/$outputname directly.
4537 cat >> $cwrappersource<<"EOF"
4545 #if defined(PATH_MAX)
4546 # define LT_PATHMAX PATH_MAX
4547 #elif defined(MAXPATHLEN)
4548 # define LT_PATHMAX MAXPATHLEN
4550 # define LT_PATHMAX 1024
4553 #ifndef DIR_SEPARATOR
4554 #define DIR_SEPARATOR '/'
4557 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4559 #define HAVE_DOS_BASED_FILE_SYSTEM
4560 #ifndef DIR_SEPARATOR_2
4561 #define DIR_SEPARATOR_2 '\\'
4565 #ifndef DIR_SEPARATOR_2
4566 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4567 #else /* DIR_SEPARATOR_2 */
4568 # define IS_DIR_SEPARATOR(ch) \
4569 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4570 #endif /* DIR_SEPARATOR_2 */
4572 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4573 #define XFREE(stale) do { \
4574 if (stale) { free ((void *) stale); stale = 0; } \
4577 const char *program_name = NULL;
4579 void * xmalloc (size_t num);
4580 char * xstrdup (const char *string);
4581 char * basename (const char *name);
4582 char * fnqualify(const char *path);
4583 char * strendzap(char *str, const char *pat);
4584 void lt_fatal (const char *message, ...);
4587 main (int argc, char *argv[])
4592 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4593 newargz = XMALLOC(char *, argc+2);
4596 cat >> $cwrappersource <<EOF
4597 newargz[0] = "$SHELL";
4600 cat >> $cwrappersource <<"EOF"
4601 newargz[1] = fnqualify(argv[0]);
4602 /* we know the script has the same name, without the .exe */
4603 /* so make sure newargz[1] doesn't end in .exe */
4604 strendzap(newargz[1],".exe");
4605 for (i = 1; i < argc; i++)
4606 newargz[i+1] = xstrdup(argv[i]);
4607 newargz[argc+1] = NULL;
4610 cat >> $cwrappersource <<EOF
4611 execv("$SHELL",newargz);
4614 cat >> $cwrappersource <<"EOF"
4618 xmalloc (size_t num)
4620 void * p = (void *) malloc (num);
4622 lt_fatal ("Memory exhausted");
4628 xstrdup (const char *string)
4630 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4635 basename (const char *name)
4639 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4640 /* Skip over the disk name in MSDOS pathnames. */
4641 if (isalpha (name[0]) && name[1] == ':')
4645 for (base = name; *name; name++)
4646 if (IS_DIR_SEPARATOR (*name))
4648 return (char *) base;
4652 fnqualify(const char *path)
4656 char tmp[LT_PATHMAX + 1];
4658 assert(path != NULL);
4660 /* Is it qualified already? */
4661 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4662 if (isalpha (path[0]) && path[1] == ':')
4663 return xstrdup (path);
4665 if (IS_DIR_SEPARATOR (path[0]))
4666 return xstrdup (path);
4668 /* prepend the current directory */
4669 /* doesn't handle '~' */
4670 if (getcwd (tmp, LT_PATHMAX) == NULL)
4671 lt_fatal ("getcwd failed");
4672 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4673 p = XMALLOC(char, size);
4674 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4679 strendzap(char *str, const char *pat)
4683 assert(str != NULL);
4684 assert(pat != NULL);
4687 patlen = strlen(pat);
4691 str += len - patlen;
4692 if (strcmp(str, pat) == 0)
4699 lt_error_core (int exit_status, const char * mode,
4700 const char * message, va_list ap)
4702 fprintf (stderr, "%s: %s: ", program_name, mode);
4703 vfprintf (stderr, message, ap);
4704 fprintf (stderr, ".\n");
4706 if (exit_status >= 0)
4711 lt_fatal (const char *message, ...)
4714 va_start (ap, message);
4715 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4719 # we should really use a build-platform specific compiler
4720 # here, but OTOH, the wrappers (shell script and this C one)
4721 # are only useful if you want to execute the "real" binary.
4722 # Since the "real" binary is built for $host, then this
4723 # wrapper might as well be built for $host, too.
4724 $run $LTCC -s -o $cwrapper $cwrappersource
4728 trap "$rm $output; exit 1" 1 2 15
4733 # $output - temporary wrapper script for $objdir/$outputname
4734 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4736 # The $output program cannot be directly executed until all the libtool
4737 # libraries that it depends on are installed.
4739 # This wrapper script should never be moved out of the build directory.
4740 # If it is, it will not operate correctly.
4742 # Sed substitution that helps us do robust quoting. It backslashifies
4743 # metacharacters that are still active within double-quoted strings.
4744 Xsed='${SED} -e 1s/^X//'
4745 sed_quote_subst='$sed_quote_subst'
4747 # The HP-UX ksh and POSIX shell print the target directory to stdout
4749 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4751 relink_command=\"$relink_command\"
4753 # This environment variable determines our operation mode.
4754 if test \"\$libtool_install_magic\" = \"$magic\"; then
4755 # install mode needs the following variable:
4756 notinst_deplibs='$notinst_deplibs'
4758 # When we are sourced in execute mode, \$file and \$echo are already set.
4759 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4762 # Make sure echo works.
4763 if test \"X\$1\" = X--no-reexec; then
4764 # Discard the --no-reexec flag, and continue.
4766 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4767 # Yippee, \$echo works!
4770 # Restart under the correct shell, and then maybe \$echo will work.
4771 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4777 # Find the directory that this script lives in.
4778 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4779 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4781 # Follow symbolic links until we get to the real thisdir.
4782 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4783 while test -n \"\$file\"; do
4784 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4786 # If there was a directory component, then change thisdir.
4787 if test \"x\$destdir\" != \"x\$file\"; then
4788 case \"\$destdir\" in
4789 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4790 *) thisdir=\"\$thisdir/\$destdir\" ;;
4794 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4795 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4798 # Try to get the absolute directory name.
4799 absdir=\`cd \"\$thisdir\" && pwd\`
4800 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4803 if test "$fast_install" = yes; then
4805 program=lt-'$outputname'$exeext
4806 progdir=\"\$thisdir/$objdir\"
4808 if test ! -f \"\$progdir/\$program\" || \\
4809 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4810 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4812 file=\"\$\$-\$program\"
4814 if test ! -d \"\$progdir\"; then
4815 $mkdir \"\$progdir\"
4817 $rm \"\$progdir/\$file\"
4822 # relink executable if necessary
4823 if test -n \"\$relink_command\"; then
4824 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4826 $echo \"\$relink_command_output\" >&2
4827 $rm \"\$progdir/\$file\"
4832 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4833 { $rm \"\$progdir/\$program\";
4834 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4835 $rm \"\$progdir/\$file\"
4839 program='$outputname'
4840 progdir=\"\$thisdir/$objdir\"
4846 if test -f \"\$progdir/\$program\"; then"
4848 # Export our shlibpath_var if we have one.
4849 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4851 # Add our own library path to $shlibpath_var
4852 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4854 # Some systems cannot cope with colon-terminated $shlibpath_var
4855 # The second colon is a workaround for a bug in BeOS R4 sed
4856 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4858 export $shlibpath_var
4862 # fixup the dll searchpath if we need to.
4863 if test -n "$dllsearchpath"; then
4865 # Add the dll search path components to the executable PATH
4866 PATH=$dllsearchpath:\$PATH
4871 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4872 # Run the actual program with our arguments.
4875 # Backslashes separate directories on plain windows
4876 *-*-mingw | *-*-os2*)
4878 exec \$progdir\\\\\$program \${1+\"\$@\"}
4884 exec \$progdir/\$program \${1+\"\$@\"}
4889 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4893 # The program doesn't exist.
4894 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4895 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4896 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4907 # See if we need to build an old-fashioned archive.
4908 for oldlib in $oldlibs; do
4910 if test "$build_libtool_libs" = convenience; then
4911 oldobjs="$libobjs_save"
4912 addlibs="$convenience"
4913 build_libtool_libs=no
4915 if test "$build_libtool_libs" = module; then
4916 oldobjs="$libobjs_save"
4917 build_libtool_libs=no
4919 oldobjs="$old_deplibs $non_pic_objects"
4921 addlibs="$old_convenience"
4924 if test -n "$addlibs"; then
4925 gentop="$output_objdir/${outputname}x"
4926 $show "${rm}r $gentop"
4927 $run ${rm}r "$gentop"
4928 $show "$mkdir $gentop"
4929 $run $mkdir "$gentop"
4931 if test "$status" -ne 0 && test ! -d "$gentop"; then
4934 generated="$generated $gentop"
4936 # Add in members from convenience archives.
4937 for xlib in $addlibs; do
4938 # Extract the objects.
4940 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4941 *) xabs=`pwd`"/$xlib" ;;
4943 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4944 xdir="$gentop/$xlib"
4946 $show "${rm}r $xdir"
4948 $show "$mkdir $xdir"
4951 if test "$status" -ne 0 && test ! -d "$xdir"; then
4954 # We will extract separately just the conflicting names and we will no
4955 # longer touch any unique names. It is faster to leave these extract
4956 # automatically by $AR in one run.
4957 $show "(cd $xdir && $AR x $xabs)"
4958 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4959 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4962 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4963 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4964 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4967 while test "$i" -le "$count"
4969 # Put our $i before any first dot (extension)
4970 # Never overwrite any file
4972 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4974 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4976 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4977 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4983 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4987 # Do each command in the archive commands.
4988 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4989 eval cmds=\"$old_archive_from_new_cmds\"
4991 eval cmds=\"$old_archive_cmds\"
4993 if len=`expr "X$cmds" : ".*"` &&
4994 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4997 # the command line is too long to link in one step, link in parts
4998 $echo "using piecewise archive linking..."
5003 save_oldobjs=$oldobjs
5004 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5005 # encoded into archives. This makes 'ar r' malfunction in
5006 # this piecewise linking case whenever conflicting object
5007 # names appear in distinct ar calls; check, warn and compensate.
5008 if (for obj in $save_oldobjs
5010 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5011 done | sort | sort -uc >/dev/null 2>&1); then
5014 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5015 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5018 # Is there a better way of finding the last object in the list?
5019 for obj in $save_oldobjs
5023 for obj in $save_oldobjs
5025 oldobjs="$objlist $obj"
5026 objlist="$objlist $obj"
5027 eval test_cmds=\"$old_archive_cmds\"
5028 if len=`expr "X$test_cmds" : ".*"` &&
5029 test "$len" -le "$max_cmd_len"; then
5032 # the above command should be used before it gets too long
5034 if test "$obj" = "$last_oldobj" ; then
5037 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5038 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5044 if test "X$oldobjs" = "X" ; then
5045 eval cmds=\"\$concat_cmds\"
5047 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5051 save_ifs="$IFS"; IFS='~'
5052 for cmd in $cmds; do
5055 $run eval "$cmd" || exit $?
5060 if test -n "$generated"; then
5061 $show "${rm}r$generated"
5062 $run ${rm}r$generated
5065 # Now create the libtool archive.
5069 test "$build_old_libs" = yes && old_library="$libname.$libext"
5070 $show "creating $output"
5072 # Preserve any variables that may affect compiler behavior
5073 for var in $variables_saved_for_relink; do
5074 if eval test -z \"\${$var+set}\"; then
5075 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5076 elif eval var_value=\$$var; test -z "$var_value"; then
5077 relink_command="$var=; export $var; $relink_command"
5079 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5080 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5083 # Quote the link command for shipping.
5084 relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5085 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5086 if test "$hardcode_automatic" = yes ; then
5089 # Only create the output if not a dry run.
5090 if test -z "$run"; then
5091 for installed in no yes; do
5092 if test "$installed" = yes; then
5093 if test -z "$install_libdir"; then
5096 output="$output_objdir/$outputname"i
5097 # Replace all uninstalled libtool libraries with the installed ones
5099 for deplib in $dependency_libs; do
5102 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5103 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5104 if test -z "$libdir"; then
5105 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5108 newdependency_libs="$newdependency_libs $libdir/$name"
5110 *) newdependency_libs="$newdependency_libs $deplib" ;;
5113 dependency_libs="$newdependency_libs"
5115 for lib in $dlfiles; do
5116 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5117 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5118 if test -z "$libdir"; then
5119 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5122 newdlfiles="$newdlfiles $libdir/$name"
5124 dlfiles="$newdlfiles"
5126 for lib in $dlprefiles; do
5127 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5128 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5129 if test -z "$libdir"; then
5130 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5133 newdlprefiles="$newdlprefiles $libdir/$name"
5135 dlprefiles="$newdlprefiles"
5138 for lib in $dlfiles; do
5140 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5141 *) abs=`pwd`"/$lib" ;;
5143 newdlfiles="$newdlfiles $abs"
5145 dlfiles="$newdlfiles"
5147 for lib in $dlprefiles; do
5149 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5150 *) abs=`pwd`"/$lib" ;;
5152 newdlprefiles="$newdlprefiles $abs"
5154 dlprefiles="$newdlprefiles"
5157 # place dlname in correct position for cygwin
5159 case $host,$output,$installed,$module,$dlname in
5160 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5163 # $outputname - a libtool library file
5164 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5166 # Please DO NOT delete this file!
5167 # It is necessary for linking the library.
5169 # The name that we can dlopen(3).
5172 # Names of this library.
5173 library_names='$library_names'
5175 # The name of the static archive.
5176 old_library='$old_library'
5178 # Libraries that this one depends upon.
5179 dependency_libs='$dependency_libs'
5181 # Version information for $libname.
5186 # Is this an already installed library?
5187 installed=$installed
5189 # Should we warn about portability when linking against -modules?
5190 shouldnotlink=$module
5192 # Files to dlopen/dlpreopen
5194 dlpreopen='$dlprefiles'
5196 # Directory that this library needs to be installed in:
5197 libdir='$install_libdir'"
5198 if test "$installed" = no && test "$need_relink" = yes; then
5200 relink_command=\"$relink_command\""
5205 # Do a symbolic link so that the libtool archive can be found in
5206 # LD_LIBRARY_PATH before the program is installed.
5207 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5208 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5214 # libtool install mode
5216 modename="$modename: install"
5218 # There may be an optional sh(1) argument at the beginning of
5219 # install_prog (especially on Windows NT).
5220 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5221 # Allow the use of GNU shtool's install command.
5222 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5223 # Aesthetically quote it.
5224 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5226 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5230 install_prog="$arg "
5238 # The real first argument should be the name of the installation program.
5239 # Aesthetically quote it.
5240 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5242 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5246 install_prog="$install_prog$arg"
5248 # We need to accept at least all the BSD install flags.
5258 if test -n "$dest"; then
5259 files="$files $dest"
5277 # If the previous option needed an argument, then skip it.
5278 if test -n "$prev"; then
5287 # Aesthetically quote the argument.
5288 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5290 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5294 install_prog="$install_prog $arg"
5297 if test -z "$install_prog"; then
5298 $echo "$modename: you must specify an install program" 1>&2
5303 if test -n "$prev"; then
5304 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5309 if test -z "$files"; then
5310 if test -z "$dest"; then
5311 $echo "$modename: no file or destination specified" 1>&2
5313 $echo "$modename: you must specify a destination" 1>&2
5319 # Strip any trailing slash from the destination.
5320 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5322 # Check to see that the destination is a directory.
5323 test -d "$dest" && isdir=yes
5324 if test "$isdir" = yes; then
5328 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5329 test "X$destdir" = "X$dest" && destdir=.
5330 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5332 # Not a directory, so check to see that there is only one file specified.
5334 if test "$#" -gt 2; then
5335 $echo "$modename: \`$dest' is not a directory" 1>&2
5341 [\\/]* | [A-Za-z]:[\\/]*) ;;
5343 for file in $files; do
5347 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5356 # This variable tells wrapper scripts just to set variables rather
5357 # than running their programs.
5358 libtool_install_magic="$magic"
5363 for file in $files; do
5365 # Do each installation.
5368 # Do the static libraries later.
5369 staticlibs="$staticlibs $file"
5373 # Check to see that this really is a libtool archive.
5374 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5376 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5384 # If there is no directory component, then add one.
5386 */* | *\\*) . $file ;;
5390 # Add the libdir to current_libdirs if it is the destination.
5391 if test "X$destdir" = "X$libdir"; then
5392 case "$current_libdirs " in
5394 *) current_libdirs="$current_libdirs $libdir" ;;
5397 # Note the libdir as a future libdir.
5398 case "$future_libdirs " in
5400 *) future_libdirs="$future_libdirs $libdir" ;;
5404 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5405 test "X$dir" = "X$file/" && dir=
5408 if test -n "$relink_command"; then
5409 # Determine the prefix the user has applied to our future dir.
5410 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5412 # Don't allow the user to place us outside of our expected
5413 # location b/c this prevents finding dependent libraries that
5414 # are installed to the same prefix.
5415 # At present, this check doesn't affect windows .dll's that
5416 # are installed into $libdir/../bin (currently, that works fine)
5417 # but it's something to keep an eye on.
5418 if test "$inst_prefix_dir" = "$destdir"; then
5419 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5423 if test -n "$inst_prefix_dir"; then
5424 # Stick the inst_prefix_dir data into the link command.
5425 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5427 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5430 $echo "$modename: warning: relinking \`$file'" 1>&2
5431 $show "$relink_command"
5432 if $run eval "$relink_command"; then :
5434 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5439 # See the names of the shared library.
5440 set dummy $library_names
5441 if test -n "$2"; then
5447 test -n "$relink_command" && srcname="$realname"T
5449 # Install the shared library and build the symlinks.
5450 $show "$install_prog $dir/$srcname $destdir/$realname"
5451 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5452 if test -n "$stripme" && test -n "$striplib"; then
5453 $show "$striplib $destdir/$realname"
5454 $run eval "$striplib $destdir/$realname" || exit $?
5457 if test "$#" -gt 0; then
5458 # Delete the old symlinks, and create new ones.
5461 if test "$linkname" != "$realname"; then
5462 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5463 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5468 # Do each command in the postinstall commands.
5469 lib="$destdir/$realname"
5470 eval cmds=\"$postinstall_cmds\"
5471 save_ifs="$IFS"; IFS='~'
5472 for cmd in $cmds; do
5475 $run eval "$cmd" || exit $?
5480 # Install the pseudo-library for information purposes.
5481 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5482 instname="$dir/$name"i
5483 $show "$install_prog $instname $destdir/$name"
5484 $run eval "$install_prog $instname $destdir/$name" || exit $?
5486 # Maybe install the static library, too.
5487 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5491 # Install (i.e. copy) a libtool object.
5493 # Figure out destination file name, if it wasn't already specified.
5494 if test -n "$destname"; then
5495 destfile="$destdir/$destname"
5497 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5498 destfile="$destdir/$destfile"
5501 # Deduce the name of the destination old-style object file.
5504 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5507 staticdest="$destfile"
5511 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5517 # Install the libtool object if requested.
5518 if test -n "$destfile"; then
5519 $show "$install_prog $file $destfile"
5520 $run eval "$install_prog $file $destfile" || exit $?
5523 # Install the old object if enabled.
5524 if test "$build_old_libs" = yes; then
5525 # Deduce the name of the old-style object file.
5526 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5528 $show "$install_prog $staticobj $staticdest"
5529 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5535 # Figure out destination file name, if it wasn't already specified.
5536 if test -n "$destname"; then
5537 destfile="$destdir/$destname"
5539 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5540 destfile="$destdir/$destfile"
5543 # If the file is missing, and there is a .exe on the end, strip it
5544 # because it is most likely a libtool script we actually want to
5549 if test ! -f "$file"; then
5550 file=`$echo $file|${SED} 's,.exe$,,'`
5556 # Do a test to see if this is really a libtool program.
5559 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5565 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5569 # To insure that "foo" is sourced, and not "foo.exe",
5570 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5571 # which disallows the automatic-append-.exe behavior.
5573 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5574 *) wrapperdot=${wrapper} ;;
5576 # If there is no directory component, then add one.
5578 */* | *\\*) . ${wrapperdot} ;;
5579 *) . ./${wrapperdot} ;;
5582 # Check the variables that should have been set.
5583 if test -z "$notinst_deplibs"; then
5584 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5589 for lib in $notinst_deplibs; do
5590 # Check to see that each library is installed.
5592 if test -f "$lib"; then
5593 # If there is no directory component, then add one.
5595 */* | *\\*) . $lib ;;
5599 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5600 if test -n "$libdir" && test ! -f "$libfile"; then
5601 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5607 # To insure that "foo" is sourced, and not "foo.exe",
5608 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5609 # which disallows the automatic-append-.exe behavior.
5611 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5612 *) wrapperdot=${wrapper} ;;
5614 # If there is no directory component, then add one.
5616 */* | *\\*) . ${wrapperdot} ;;
5617 *) . ./${wrapperdot} ;;
5621 if test "$fast_install" = no && test -n "$relink_command"; then
5622 if test "$finalize" = yes && test -z "$run"; then
5624 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5625 tmpdir="$tmpdir/libtool-$$"
5626 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5628 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5631 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5632 outputname="$tmpdir/$file"
5633 # Replace the output file specification.
5634 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5636 $show "$relink_command"
5637 if $run eval "$relink_command"; then :
5639 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5645 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5648 # Install the binary that we compiled earlier.
5649 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5653 # remove .exe since cygwin /usr/bin/install will append another
5655 case $install_prog,$host in
5656 */usr/bin/install*,*cygwin*)
5657 case $file:$destfile in
5662 destfile=$destfile.exe
5665 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5670 $show "$install_prog$stripme $file $destfile"
5671 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5672 test -n "$outputname" && ${rm}r "$tmpdir"
5677 for file in $staticlibs; do
5678 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5680 # Set up the ranlib parameters.
5681 oldlib="$destdir/$name"
5683 $show "$install_prog $file $oldlib"
5684 $run eval "$install_prog \$file \$oldlib" || exit $?
5686 if test -n "$stripme" && test -n "$striplib"; then
5687 $show "$old_striplib $oldlib"
5688 $run eval "$old_striplib $oldlib" || exit $?
5691 # Do each command in the postinstall commands.
5692 eval cmds=\"$old_postinstall_cmds\"
5693 save_ifs="$IFS"; IFS='~'
5694 for cmd in $cmds; do
5697 $run eval "$cmd" || exit $?
5702 if test -n "$future_libdirs"; then
5703 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5706 if test -n "$current_libdirs"; then
5707 # Maybe just do a dry run.
5708 test -n "$run" && current_libdirs=" -n$current_libdirs"
5709 exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs'
5715 # libtool finish mode
5717 modename="$modename: finish"
5721 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5724 libdirs="$libdirs $dir"
5727 for libdir in $libdirs; do
5728 if test -n "$finish_cmds"; then
5729 # Do each command in the finish commands.
5730 eval cmds=\"$finish_cmds\"
5731 save_ifs="$IFS"; IFS='~'
5732 for cmd in $cmds; do
5735 $run eval "$cmd" || admincmds="$admincmds
5740 if test -n "$finish_eval"; then
5741 # Do the single finish_eval.
5742 eval cmds=\"$finish_eval\"
5743 $run eval "$cmds" || admincmds="$admincmds
5749 # Exit here if they wanted silent mode.
5750 test "$show" = : && exit 0
5752 $echo "----------------------------------------------------------------------"
5753 $echo "Libraries have been installed in:"
5754 for libdir in $libdirs; do
5758 $echo "If you ever happen to want to link against installed libraries"
5759 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5760 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5761 $echo "flag during linking and do at least one of the following:"
5762 if test -n "$shlibpath_var"; then
5763 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5764 $echo " during execution"
5766 if test -n "$runpath_var"; then
5767 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5768 $echo " during linking"
5770 if test -n "$hardcode_libdir_flag_spec"; then
5772 eval flag=\"$hardcode_libdir_flag_spec\"
5774 $echo " - use the \`$flag' linker flag"
5776 if test -n "$admincmds"; then
5777 $echo " - have your system administrator run these commands:$admincmds"
5779 if test -f /etc/ld.so.conf; then
5780 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5783 $echo "See any operating system documentation about shared libraries for"
5784 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5785 $echo "----------------------------------------------------------------------"
5789 # libtool execute mode
5791 modename="$modename: execute"
5793 # The first argument is the command name.
5795 if test -z "$cmd"; then
5796 $echo "$modename: you must specify a COMMAND" 1>&2
5801 # Handle -dlopen flags immediately.
5802 for file in $execute_dlfiles; do
5803 if test ! -f "$file"; then
5804 $echo "$modename: \`$file' is not a file" 1>&2
5812 # Check to see that this really is a libtool archive.
5813 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5815 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5820 # Read the libtool library.
5824 # If there is no directory component, then add one.
5826 */* | *\\*) . $file ;;
5830 # Skip this library if it cannot be dlopened.
5831 if test -z "$dlname"; then
5832 # Warn if it was a shared library.
5833 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5837 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5838 test "X$dir" = "X$file" && dir=.
5840 if test -f "$dir/$objdir/$dlname"; then
5843 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5849 # Just add the directory containing the .lo file.
5850 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5851 test "X$dir" = "X$file" && dir=.
5855 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5860 # Get the absolute pathname.
5861 absdir=`cd "$dir" && pwd`
5862 test -n "$absdir" && dir="$absdir"
5864 # Now add the directory to shlibpath_var.
5865 if eval "test -z \"\$$shlibpath_var\""; then
5866 eval "$shlibpath_var=\"\$dir\""
5868 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5872 # This variable tells wrapper scripts just to set shlibpath_var
5873 # rather than running their programs.
5874 libtool_execute_magic="$magic"
5876 # Check if any of the arguments is a wrapper script.
5883 # Do a test to see if this is really a libtool program.
5884 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5885 # If there is no directory component, then add one.
5887 */* | *\\*) . $file ;;
5891 # Transform arg to wrapped name.
5892 file="$progdir/$program"
5896 # Quote arguments (to preserve shell metacharacters).
5897 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5898 args="$args \"$file\""
5901 if test -z "$run"; then
5902 if test -n "$shlibpath_var"; then
5903 # Export the shlibpath_var.
5904 eval "export $shlibpath_var"
5907 # Restore saved environment variables
5908 if test "${save_LC_ALL+set}" = set; then
5909 LC_ALL="$save_LC_ALL"; export LC_ALL
5911 if test "${save_LANG+set}" = set; then
5912 LANG="$save_LANG"; export LANG
5915 # Now prepare to actually exec the command.
5916 exec_cmd="\$cmd$args"
5918 # Display what would be done.
5919 if test -n "$shlibpath_var"; then
5920 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5921 $echo "export $shlibpath_var"
5928 # libtool clean and uninstall mode
5930 modename="$modename: $mode"
5936 # This variable tells wrapper scripts just to set variables rather
5937 # than running their programs.
5938 libtool_install_magic="$magic"
5943 -f) rm="$rm $arg"; rmforce=yes ;;
5944 -*) rm="$rm $arg" ;;
5945 *) files="$files $arg" ;;
5949 if test -z "$rm"; then
5950 $echo "$modename: you must specify an RM program" 1>&2
5957 origobjdir="$objdir"
5958 for file in $files; do
5959 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5960 if test "X$dir" = "X$file"; then
5962 objdir="$origobjdir"
5964 objdir="$dir/$origobjdir"
5966 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5967 test "$mode" = uninstall && objdir="$dir"
5969 # Remember objdir for removal later, being careful to avoid duplicates
5970 if test "$mode" = clean; then
5973 *) rmdirs="$rmdirs $objdir" ;;
5977 # Don't error if the file doesn't exist and rm -f was used.
5978 if (test -L "$file") >/dev/null 2>&1 \
5979 || (test -h "$file") >/dev/null 2>&1 \
5980 || test -f "$file"; then
5982 elif test -d "$file"; then
5985 elif test "$rmforce" = yes; then
5993 # Possibly a libtool archive, so verify it.
5994 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5997 # Delete the libtool libraries and symlinks.
5998 for n in $library_names; do
5999 rmfiles="$rmfiles $objdir/$n"
6001 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6002 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6004 if test "$mode" = uninstall; then
6005 if test -n "$library_names"; then
6006 # Do each command in the postuninstall commands.
6007 eval cmds=\"$postuninstall_cmds\"
6008 save_ifs="$IFS"; IFS='~'
6009 for cmd in $cmds; do
6013 if test "$?" -ne 0 && test "$rmforce" != yes; then
6020 if test -n "$old_library"; then
6021 # Do each command in the old_postuninstall commands.
6022 eval cmds=\"$old_postuninstall_cmds\"
6023 save_ifs="$IFS"; IFS='~'
6024 for cmd in $cmds; do
6028 if test "$?" -ne 0 && test "$rmforce" != yes; then
6034 # FIXME: should reinstall the best remaining shared library.
6040 # Possibly a libtool object, so verify it.
6041 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6046 # Add PIC object to the list of files to remove.
6047 if test -n "$pic_object" \
6048 && test "$pic_object" != none; then
6049 rmfiles="$rmfiles $dir/$pic_object"
6052 # Add non-PIC object to the list of files to remove.
6053 if test -n "$non_pic_object" \
6054 && test "$non_pic_object" != none; then
6055 rmfiles="$rmfiles $dir/$non_pic_object"
6061 if test "$mode" = clean ; then
6065 file=`$echo $file|${SED} 's,.exe$,,'`
6066 noexename=`$echo $name|${SED} 's,.exe$,,'`
6067 # $file with .exe has already been added to rmfiles,
6068 # add $file without .exe
6069 rmfiles="$rmfiles $file"
6072 # Do a test to see if this is a libtool program.
6073 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6077 # note $name still contains .exe if it was in $file originally
6078 # as does the version of $file that was added into $rmfiles
6079 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6080 if test "$fast_install" = yes && test -n "$relink_command"; then
6081 rmfiles="$rmfiles $objdir/lt-$name"
6083 if test "X$noexename" != "X$name" ; then
6084 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6090 $show "$rm $rmfiles"
6091 $run $rm $rmfiles || exit_status=1
6093 objdir="$origobjdir"
6095 # Try to remove the ${objdir}s in the directories where we deleted files
6096 for dir in $rmdirs; do
6097 if test -d "$dir"; then
6099 $run rmdir $dir >/dev/null 2>&1
6107 $echo "$modename: you must specify a MODE" 1>&2
6108 $echo "$generic_help" 1>&2
6113 if test -z "$exec_cmd"; then
6114 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6115 $echo "$generic_help" 1>&2
6118 fi # test -z "$show_help"
6120 if test -n "$exec_cmd"; then
6125 # We need to display help for each of the modes.
6128 "Usage: $modename [OPTION]... [MODE-ARG]...
6130 Provide generalized library-building support services.
6132 --config show all configuration variables
6133 --debug enable verbose shell tracing
6134 -n, --dry-run display commands without modifying any files
6135 --features display basic configuration information and exit
6136 --finish same as \`--mode=finish'
6137 --help display this help message and exit
6138 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6139 --quiet same as \`--silent'
6140 --silent don't print informational messages
6141 --tag=TAG use configuration variables from tag TAG
6142 --version print version information
6144 MODE must be one of the following:
6146 clean remove files from the build directory
6147 compile compile a source file into a libtool object
6148 execute automatically set library path, then run a program
6149 finish complete the installation of libtool libraries
6150 install install libraries or executables
6151 link create a library or an executable
6152 uninstall remove libraries from an installed directory
6154 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6155 a more detailed description of MODE.
6157 Report bugs to <bug-libtool@gnu.org>."
6163 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6165 Remove files from the build directory.
6167 RM is the name of the program to use to delete files associated with each FILE
6168 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6171 If FILE is a libtool library, object or program, all the files associated
6172 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6177 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6179 Compile a source file into a libtool library object.
6181 This mode accepts the following additional options:
6183 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6184 -prefer-pic try to building PIC objects only
6185 -prefer-non-pic try to building non-PIC objects only
6186 -static always build a \`.o' file suitable for static linking
6188 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6189 from the given SOURCEFILE.
6191 The output file name is determined by removing the directory component from
6192 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6193 library object suffix, \`.lo'."
6198 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6200 Automatically set library path, then run a program.
6202 This mode accepts the following additional options:
6204 -dlopen FILE add the directory containing FILE to the library path
6206 This mode sets the library path environment variable according to \`-dlopen'
6209 If any of the ARGS are libtool executable wrappers, then they are translated
6210 into their corresponding uninstalled binary, and any of their required library
6211 directories are added to the library path.
6213 Then, COMMAND is executed, with ARGS as arguments."
6218 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6220 Complete the installation of libtool libraries.
6222 Each LIBDIR is a directory that contains libtool libraries.
6224 The commands that this mode executes may require superuser privileges. Use
6225 the \`--dry-run' option if you just want to see what would be executed."
6230 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6232 Install executables or libraries.
6234 INSTALL-COMMAND is the installation command. The first component should be
6235 either the \`install' or \`cp' program.
6237 The rest of the components are interpreted as arguments to that command (only
6238 BSD-compatible install options are recognized)."
6243 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6245 Link object files or libraries together to form another library, or to
6246 create an executable program.
6248 LINK-COMMAND is a command using the C compiler that you would use to create
6249 a program from several object files.
6251 The following components of LINK-COMMAND are treated specially:
6253 -all-static do not do any dynamic linking at all
6254 -avoid-version do not add a version suffix if possible
6255 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6256 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6257 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6258 -export-symbols SYMFILE
6259 try to export only the symbols listed in SYMFILE
6260 -export-symbols-regex REGEX
6261 try to export only the symbols matching REGEX
6262 -LLIBDIR search LIBDIR for required installed libraries
6263 -lNAME OUTPUT-FILE requires the installed library libNAME
6264 -module build a library that can dlopened
6265 -no-fast-install disable the fast-install mode
6266 -no-install link a not-installable executable
6267 -no-undefined declare that a library does not refer to external symbols
6268 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6269 -objectlist FILE Use a list of object files found in FILE to specify objects
6270 -release RELEASE specify package release information
6271 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6272 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6273 -static do not do any dynamic linking of libtool libraries
6274 -version-info CURRENT[:REVISION[:AGE]]
6275 specify library version info [each variable defaults to 0]
6277 All other options (arguments beginning with \`-') are ignored.
6279 Every other argument is treated as a filename. Files ending in \`.la' are
6280 treated as uninstalled libtool libraries, other files are standard or library
6283 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6284 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6285 required, except when creating a convenience library.
6287 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6288 using \`ar' and \`ranlib', or on Windows using \`lib'.
6290 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6291 is created, otherwise an executable program is created."
6296 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6298 Remove libraries from an installation directory.
6300 RM is the name of the program to use to delete files associated with each FILE
6301 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6304 If FILE is a libtool library, all the files associated with it are deleted.
6305 Otherwise, only FILE itself is deleted using RM."
6309 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6316 $echo "Try \`$modename --help' for more information about other modes."
6320 # The TAGs below are defined such that we never get into a situation
6321 # in which we disable both kinds of libraries. Given conflicting
6322 # choices, we go for a static library, that is the most portable,
6323 # since we can't tell whether shared libraries were disabled because
6324 # the user asked for that or because the platform doesn't support
6325 # them. This is particularly important on AIX, because we don't
6326 # support having both static and shared libraries enabled at the same
6327 # time on that platform, so we default to a shared-only configuration.
6328 # If a disable-shared tag is given, we'll fallback to a static-only
6329 # configuration. But we'll never go from static-only to shared-only.
6331 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6332 build_libtool_libs=no
6334 # ### END LIBTOOL TAG CONFIG: disable-shared
6336 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6337 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6338 # ### END LIBTOOL TAG CONFIG: disable-static