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.1240 2003/06/26 06:55:19)"
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
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
100 $echo "$modename: not configured to build any kind of library" 1>&2
101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
114 lo2o="s/\\.lo\$/.${objext}/"
115 o2lo="s/\\.${objext}\$/.lo/"
117 #####################################
118 # Shell function definitions:
119 # This seems to be the best place for them
121 # Need a lot of goo to handle *both* DLLs and import libs
122 # Has to be a shell function in order to 'eat' the argument
123 # that is supplied when $file_magic_command is called.
125 win32_libid_type="unknown"
126 win32_fileres=`file -L $1 2>/dev/null`
127 case $win32_fileres in
128 *ar\ archive\ import\ library*) # definitely import
129 win32_libid_type="x86 archive import"
131 *ar\ archive*) # could be an import, or static
132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
134 win32_nmres=`eval $NM -f posix -A $1 | \
135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
136 if test "X$win32_nmres" = "Ximport" ; then
137 win32_libid_type="x86 archive import"
139 win32_libid_type="x86 archive static"
144 win32_libid_type="x86 DLL"
146 *executable*) # but shell scripts are "executable" too...
147 case $win32_fileres in
148 *MS\ Windows\ PE\ Intel*)
149 win32_libid_type="x86 DLL"
154 $echo $win32_libid_type
157 # End of Shell function definitions
158 #####################################
160 # Parse our command line options once, thoroughly.
161 while test "$#" -gt 0
167 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
171 # If the previous option needs an argument, assign it.
172 if test -n "$prev"; then
175 execute_dlfiles="$execute_dlfiles $arg"
180 # Check whether tagname contains only valid characters
183 $echo "$progname: invalid tag name: $tagname" 1>&2
190 # Don't test for the "default" C tag, as we know, it's there, but
191 # not specially marked.
194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
195 taglist="$taglist $tagname"
196 # Evaluate the configuration.
197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
199 $echo "$progname: ignoring unknown tag $tagname" 1>&2
214 # Have we seen a non-optional argument yet?
221 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
223 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
224 $echo "This is free software; see the source for copying conditions. There is NO"
225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
231 # Now print the configurations for the tags.
232 for tagname in $taglist; do
233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
239 $echo "$progname: enabling shell trace mode"
249 if test "$build_libtool_libs" = yes; then
250 $echo "enable shared libraries"
252 $echo "disable shared libraries"
254 if test "$build_old_libs" = yes; then
255 $echo "enable static libraries"
257 $echo "disable static libraries"
262 --finish) mode="finish" ;;
264 --mode) prevopt="--mode" prev=mode ;;
265 --mode=*) mode="$optarg" ;;
267 --preserve-dup-deps) duplicate_deps="yes" ;;
273 --tag) prevopt="--tag" prev=tag ;;
275 set tag "$optarg" ${1+"$@"}
286 $echo "$modename: unrecognized option \`$arg'" 1>&2
298 if test -n "$prevopt"; then
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
304 # If this variable is set in any of the actions, the command in it
305 # will be execed at the end. This prevents here-documents from being
306 # left over by shells.
309 if test -z "$show_help"; then
311 # Infer the operation mode.
312 if test -z "$mode"; then
313 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
314 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
316 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
328 *db | *dbx | *strace | *truss)
338 # If we have no mode, but dlfiles were specified, then do execute mode.
339 test -n "$execute_dlfiles" && mode=execute
341 # Just use the default operation mode.
342 if test -z "$mode"; then
343 if test -n "$nonopt"; then
344 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
346 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
353 # Only execute mode is allowed to have -dlopen flags.
354 if test -n "$execute_dlfiles" && test "$mode" != execute; then
355 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
360 # Change the help message to a mode-specific one.
362 help="Try \`$modename --help --mode=$mode' for more information."
364 # These modes are in order of execution frequency so that they run quickly.
366 # libtool compile mode
368 modename="$modename: compile"
369 # Get the compilation command and the source file.
371 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
380 # do not "continue". Instead, add this to base_compile
392 # Accept any command-line options.
395 if test -n "$libobj" ; then
396 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
419 arg_mode=arg # the next one goes into the "base_compile" arg list
420 continue # The current "srcfile" will either be retained or
421 ;; # replaced later. I would guess that would be a bug.
424 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
426 save_ifs="$IFS"; IFS=','
430 # Double-quote args containing other shell metacharacters.
431 # Many Bourne shells cannot handle close brackets correctly
432 # in scan sets, so we specify it separately.
434 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
438 lastarg="$lastarg $arg"
441 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
443 # Add the arguments to base_compile.
444 base_compile="$base_compile $lastarg"
449 # Accept the current argument as the source file.
450 # The previous "srcfile" becomes the current argument.
457 esac # case $arg_mode
459 # Aesthetically quote the previous argument.
460 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
463 # Double-quote args containing other shell metacharacters.
464 # Many Bourne shells cannot handle close brackets correctly
465 # in scan sets, so we specify it separately.
466 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
467 lastarg="\"$lastarg\""
471 base_compile="$base_compile $lastarg"
476 $echo "$modename: you must specify an argument for -Xcompile"
480 $echo "$modename: you must specify a target with \`-o'" 1>&2
484 # Get the name of the library object.
485 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
489 # Recognize several different file suffixes.
490 # If the user specifies -o file.o, it is replaced with file.lo
500 *.class) xform=class ;;
505 *.java) xform=java ;;
508 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
511 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
513 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
518 # Infer tagged configuration to use if any are available and
519 # if one wasn't chosen via the "--tag" command line option.
520 # Only attempt this if the compiler in the base compile
521 # command doesn't match the default compiler.
522 if test -n "$available_tags" && test -z "$tagname"; then
523 case $base_compile in
524 # Blanks in the command may have been stripped by the calling shell,
525 # but not from the CC environment variable when configure was run.
526 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
527 # Blanks at the start of $base_compile will cause this to fail
528 # if we don't check for them as well.
530 for z in $available_tags; do
531 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
532 # Evaluate the configuration.
533 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
534 case "$base_compile " in
535 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
536 # The compiler in the base compile command matches
537 # the one in the tagged configuration.
538 # Assume this is the tagged configuration we want.
545 # If $tagname still isn't set, then no tagged configuration
546 # was found and let the user know that the "--tag" command
547 # line option must be used.
548 if test -z "$tagname"; then
549 $echo "$modename: unable to infer tagged configuration"
550 $echo "$modename: specify a tag with \`--tag'" 1>&2
553 # $echo "$modename: using $tagname tagged configuration"
559 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
560 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
561 if test "X$xdir" = "X$obj"; then
566 lobj=${xdir}$objdir/$objname
568 if test -z "$base_compile"; then
569 $echo "$modename: you must specify a compilation command" 1>&2
574 # Delete any leftover library objects.
575 if test "$build_old_libs" = yes; then
576 removelist="$obj $lobj $libobj ${libobj}T"
578 removelist="$lobj $libobj ${libobj}T"
582 trap "$run $rm $removelist; exit 1" 1 2 15
584 # On Cygwin there's no "real" PIC flag so we must build both object types
586 cygwin* | mingw* | pw32* | os2*)
590 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
591 # non-PIC code in shared libraries is not supported
595 # Calculate the filename of the output object if compiler does
596 # not support -o with -c
597 if test "$compiler_c_o" = no; then
598 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
599 lockfile="$output_obj.lock"
600 removelist="$removelist $output_obj $lockfile"
601 trap "$run $rm $removelist; exit 1" 1 2 15
608 # Lock this critical section if it is needed
609 # We use this script file to make the link, it avoids creating a new file
610 if test "$need_locks" = yes; then
611 until $run ln "$0" "$lockfile" 2>/dev/null; do
612 $show "Waiting for $lockfile to be removed"
615 elif test "$need_locks" = warn; then
616 if test -f "$lockfile"; then
618 *** ERROR, $lockfile exists and contains:
619 `cat $lockfile 2>/dev/null`
621 This indicates that another process is trying to use the same
622 temporary object file, and libtool could not work around it because
623 your compiler does not support \`-c' and \`-o' together. If you
624 repeat this compilation, it may succeed, by chance, but you had better
625 avoid parallel builds (make -j) in this platform, or get a better
631 $echo $srcfile > "$lockfile"
634 if test -n "$fix_srcfile_path"; then
635 eval srcfile=\"$fix_srcfile_path\"
638 $run $rm "$libobj" "${libobj}T"
640 # Create a libtool object file (analogous to a ".la" file),
641 # but don't create it if we're doing a dry run.
642 test -z "$run" && cat > ${libobj}T <<EOF
643 # $libobj - a libtool object file
644 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
646 # Please DO NOT delete this file!
647 # It is necessary for linking the library.
649 # Name of the PIC object.
652 # Only build a PIC object if we are building libtool libraries.
653 if test "$build_libtool_libs" = yes; then
654 # Without this assignment, base_compile gets emptied.
655 fbsd_hideous_sh_bug=$base_compile
657 if test "$pic_mode" != no; then
658 command="$base_compile $srcfile $pic_flag"
660 # Don't build PIC code
661 command="$base_compile $srcfile"
664 if test ! -d "${xdir}$objdir"; then
665 $show "$mkdir ${xdir}$objdir"
666 $run $mkdir ${xdir}$objdir
668 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
673 if test -z "$output_obj"; then
674 # Place PIC objects in $objdir
675 command="$command -o $lobj"
678 $run $rm "$lobj" "$output_obj"
681 if $run eval "$command"; then :
683 test -n "$output_obj" && $run $rm $removelist
687 if test "$need_locks" = warn &&
688 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
690 *** ERROR, $lockfile contains:
691 `cat $lockfile 2>/dev/null`
693 but it should contain:
696 This indicates that another process is trying to use the same
697 temporary object file, and libtool could not work around it because
698 your compiler does not support \`-c' and \`-o' together. If you
699 repeat this compilation, it may succeed, by chance, but you had better
700 avoid parallel builds (make -j) in this platform, or get a better
707 # Just move the object if needed, then go on to compile the next one
708 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
709 $show "$mv $output_obj $lobj"
710 if $run $mv $output_obj $lobj; then :
718 # Append the name of the PIC object to the libtool object file.
719 test -z "$run" && cat >> ${libobj}T <<EOF
720 pic_object='$objdir/$objname'
724 # Allow error messages only from the first compilation.
725 suppress_output=' >/dev/null 2>&1'
727 # No PIC object so indicate it doesn't exist in the libtool
729 test -z "$run" && cat >> ${libobj}T <<EOF
735 # Only build a position-dependent object if we build old libraries.
736 if test "$build_old_libs" = yes; then
737 if test "$pic_mode" != yes; then
738 # Don't build PIC code
739 command="$base_compile $srcfile"
741 command="$base_compile $srcfile $pic_flag"
743 if test "$compiler_c_o" = yes; then
744 command="$command -o $obj"
747 # Suppress compiler output if we already did a PIC compilation.
748 command="$command$suppress_output"
749 $run $rm "$obj" "$output_obj"
751 if $run eval "$command"; then :
757 if test "$need_locks" = warn &&
758 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
760 *** ERROR, $lockfile contains:
761 `cat $lockfile 2>/dev/null`
763 but it should contain:
766 This indicates that another process is trying to use the same
767 temporary object file, and libtool could not work around it because
768 your compiler does not support \`-c' and \`-o' together. If you
769 repeat this compilation, it may succeed, by chance, but you had better
770 avoid parallel builds (make -j) in this platform, or get a better
777 # Just move the object if needed
778 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
779 $show "$mv $output_obj $obj"
780 if $run $mv $output_obj $obj; then :
788 # Append the name of the non-PIC object the libtool object file.
789 # Only append if the libtool object file exists.
790 test -z "$run" && cat >> ${libobj}T <<EOF
791 # Name of the non-PIC object.
792 non_pic_object='$objname'
796 # Append the name of the non-PIC object the libtool object file.
797 # Only append if the libtool object file exists.
798 test -z "$run" && cat >> ${libobj}T <<EOF
799 # Name of the non-PIC object.
805 $run $mv "${libobj}T" "${libobj}"
807 # Unlock the critical section if it was locked
808 if test "$need_locks" != no; then
817 modename="$modename: link"
819 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
820 # It is impossible to link a dll without this setting, and
821 # we shouldn't force the makefile maintainer to figure out
822 # which system we are compiling for in order to pass an extra
823 # flag for every libtool invocation.
826 # FIXME: Unfortunately, there are problems with the above when trying
827 # to make a dll which has undefined symbols, in which case not
828 # even a static library is built. For now, we need to specify
829 # -no-undefined on the libtool link line when we can be certain
830 # that all symbols are satisfied, otherwise we get a static library.
837 libtool_args="$nonopt"
838 base_compile="$nonopt"
839 compile_command="$nonopt"
840 finalize_command="$nonopt"
854 lib_search_path=`pwd`
863 export_symbols_regex=
871 prefer_static_libs=no
884 # We need to know -static, to get the right output filenames.
888 -all-static | -static)
889 if test "X$arg" = "X-all-static"; then
890 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
891 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
893 if test -n "$link_static_flag"; then
894 dlopen_self=$dlopen_self_static
897 if test -z "$pic_flag" && test -n "$link_static_flag"; then
898 dlopen_self=$dlopen_self_static
901 build_libtool_libs=no
903 prefer_static_libs=yes
909 # See if our shared archives depend on static archives.
910 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
912 # Go through the arguments, transforming them on the way.
913 while test "$#" -gt 0; do
915 base_compile="$base_compile $arg"
918 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
919 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
923 libtool_args="$libtool_args $qarg"
925 # If the previous option needs an argument, assign it.
926 if test -n "$prev"; then
929 compile_command="$compile_command @OUTPUT@"
930 finalize_command="$finalize_command @OUTPUT@"
936 if test "$preload" = no; then
937 # Add the symbol object into the linking commands.
938 compile_command="$compile_command @SYMFILE@"
939 finalize_command="$finalize_command @SYMFILE@"
943 *.la | *.lo) ;; # We handle these cases below.
945 if test "$dlself" = no; then
953 if test "$prev" = dlprefiles; then
955 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
965 if test "$prev" = dlfiles; then
966 dlfiles="$dlfiles $arg"
968 dlprefiles="$dlprefiles $arg"
976 export_symbols="$arg"
977 if test ! -f "$arg"; then
978 $echo "$modename: symbol file \`$arg' does not exist"
985 export_symbols_regex="$arg"
990 inst_prefix_dir="$arg"
1000 if test -f "$arg"; then
1003 for fil in `cat $save_arg`
1005 # moreargs="$moreargs $fil"
1007 # A libtool-controlled object.
1009 # Check to see that this really is a libtool object.
1010 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1015 # If there is no directory component, then add one.
1017 */* | *\\*) . $arg ;;
1021 if test -z "$pic_object" || \
1022 test -z "$non_pic_object" ||
1023 test "$pic_object" = none && \
1024 test "$non_pic_object" = none; then
1025 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1029 # Extract subdirectory from the argument.
1030 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1031 if test "X$xdir" = "X$arg"; then
1037 if test "$pic_object" != none; then
1038 # Prepend the subdirectory the object is found in.
1039 pic_object="$xdir$pic_object"
1041 if test "$prev" = dlfiles; then
1042 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1043 dlfiles="$dlfiles $pic_object"
1047 # If libtool objects are unsupported, then we need to preload.
1052 # CHECK ME: I think I busted this. -Ossama
1053 if test "$prev" = dlprefiles; then
1054 # Preload the old-style object.
1055 dlprefiles="$dlprefiles $pic_object"
1060 libobjs="$libobjs $pic_object"
1065 if test "$non_pic_object" != none; then
1066 # Prepend the subdirectory the object is found in.
1067 non_pic_object="$xdir$non_pic_object"
1069 # A standard non-PIC object
1070 non_pic_objects="$non_pic_objects $non_pic_object"
1071 if test -z "$pic_object" || test "$pic_object" = none ; then
1072 arg="$non_pic_object"
1076 # Only an error if not doing a dry-run.
1077 if test -z "$run"; then
1078 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1083 # Extract subdirectory from the argument.
1084 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1085 if test "X$xdir" = "X$arg"; then
1091 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1092 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1093 libobjs="$libobjs $pic_object"
1094 non_pic_objects="$non_pic_objects $non_pic_object"
1099 $echo "$modename: link input file \`$save_arg' does not exist"
1107 # We need an absolute path.
1109 [\\/]* | [A-Za-z]:[\\/]*) ;;
1111 $echo "$modename: only absolute run-paths are allowed" 1>&2
1115 if test "$prev" = rpath; then
1118 *) rpath="$rpath $arg" ;;
1123 *) xrpath="$xrpath $arg" ;;
1130 compiler_flags="$compiler_flags $qarg"
1132 compile_command="$compile_command $qarg"
1133 finalize_command="$finalize_command $qarg"
1137 linker_flags="$linker_flags $qarg"
1138 compiler_flags="$compiler_flags $wl$qarg"
1140 compile_command="$compile_command $wl$qarg"
1141 finalize_command="$finalize_command $wl$qarg"
1145 linker_flags="$linker_flags $qarg"
1146 compiler_flags="$compiler_flags $qarg"
1148 compile_command="$compile_command $qarg"
1149 finalize_command="$finalize_command $qarg"
1156 *" $qarg.ltframework "*) ;;
1157 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
1166 eval "$prev=\"\$arg\""
1171 fi # test -n "$prev"
1177 if test -n "$link_static_flag"; then
1178 compile_command="$compile_command $link_static_flag"
1179 finalize_command="$finalize_command $link_static_flag"
1185 # FIXME: remove this flag sometime in the future.
1186 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1210 -export-symbols | -export-symbols-regex)
1211 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1212 $echo "$modename: more than one -exported-symbols argument is not allowed"
1215 if test "X$arg" = "X-export-symbols"; then
1228 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1229 # so, if we see these flags be careful not to treat them like -L
1231 case $with_gcc/$host in
1232 no/*-*-irix* | /*-*-irix*)
1233 compile_command="$compile_command $arg"
1234 finalize_command="$finalize_command $arg"
1241 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1242 # We need an absolute path.
1244 [\\/]* | [A-Za-z]:[\\/]*) ;;
1246 absdir=`cd "$dir" && pwd`
1247 if test -z "$absdir"; then
1248 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1257 deplibs="$deplibs -L$dir"
1258 lib_search_path="$lib_search_path $dir"
1262 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1263 case :$dllsearchpath: in
1265 *) dllsearchpath="$dllsearchpath:$dir";;
1273 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1275 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1276 # These systems don't actually have a C or math library (as such)
1280 # prevent being parsed by the freebsd regexp below
1282 *-*-mingw* | *-*-os2*)
1283 # These systems don't actually have a C library (as such)
1284 test "X$arg" = "X-lc" && continue
1286 *-*-openbsd* | *-*-freebsd*)
1287 # Do not include libc due to us having libc/libc_r.
1288 test "X$arg" = "X-lc" && continue
1290 *-*-rhapsody* | *-*-darwin1.[012])
1291 # Rhapsody C and math libraries are in the System framework
1292 deplibs="$deplibs System.ltframework"
1295 elif test "X$arg" = "X-lc_r"; then
1298 # prevent being parsed by the freebsd regexp below
1301 # Do not include libc_r directly, use -pthread flag.
1306 deplibs="$deplibs $arg"
1315 # gcc -m* arguments should be passed to the linker via $compiler_flags
1316 # in order to pass architecture information to the linker
1317 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1318 # but this is not reliable with gcc because gcc may use -mfoo to
1319 # select a different linker, different libraries, etc, while
1320 # -Wl,-mfoo simply passes -mfoo to the linker.
1322 # Unknown arguments in both finalize_command and compile_command need
1323 # to be aesthetically quoted because they are evaled later.
1324 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1326 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1330 compile_command="$compile_command $arg"
1331 finalize_command="$finalize_command $arg"
1332 if test "$with_gcc" = "yes" ; then
1333 compiler_flags="$compiler_flags $arg"
1350 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1351 # The PATH hackery in wrapper scripts is required on Windows
1352 # in order for the loader to find any dlls it needs.
1353 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1354 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1357 *) no_install=yes ;;
1390 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1391 # We need an absolute path.
1393 [\\/]* | [A-Za-z]:[\\/]*) ;;
1395 $echo "$modename: only absolute run-paths are allowed" 1>&2
1401 *) xrpath="$xrpath $dir" ;;
1407 # The effects of -static are defined in a previous loop.
1408 # We used to do the same as -all-static on platforms that
1409 # didn't have a PIC flag, but the assumption that the effects
1410 # would be equivalent was wrong. It would break on at least
1411 # Digital Unix and AIX.
1431 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1433 save_ifs="$IFS"; IFS=','
1434 for flag in $args; do
1437 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1442 compiler_flags="$compiler_flags $flag"
1445 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1449 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1451 save_ifs="$IFS"; IFS=','
1452 for flag in $args; do
1455 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1460 compiler_flags="$compiler_flags $wl$flag"
1461 linker_flags="$linker_flags $flag"
1464 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1487 # Some other compiler flag.
1489 # Unknown arguments in both finalize_command and compile_command need
1490 # to be aesthetically quoted because they are evaled later.
1491 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1493 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1497 add_flags="$add_flags $arg"
1501 # A standard object.
1506 # A libtool-controlled object.
1508 # Check to see that this really is a libtool object.
1509 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1514 # If there is no directory component, then add one.
1516 */* | *\\*) . $arg ;;
1520 if test -z "$pic_object" || \
1521 test -z "$non_pic_object" ||
1522 test "$pic_object" = none && \
1523 test "$non_pic_object" = none; then
1524 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1528 # Extract subdirectory from the argument.
1529 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1530 if test "X$xdir" = "X$arg"; then
1536 if test "$pic_object" != none; then
1537 # Prepend the subdirectory the object is found in.
1538 pic_object="$xdir$pic_object"
1540 if test "$prev" = dlfiles; then
1541 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1542 dlfiles="$dlfiles $pic_object"
1546 # If libtool objects are unsupported, then we need to preload.
1551 # CHECK ME: I think I busted this. -Ossama
1552 if test "$prev" = dlprefiles; then
1553 # Preload the old-style object.
1554 dlprefiles="$dlprefiles $pic_object"
1559 libobjs="$libobjs $pic_object"
1564 if test "$non_pic_object" != none; then
1565 # Prepend the subdirectory the object is found in.
1566 non_pic_object="$xdir$non_pic_object"
1568 # A standard non-PIC object
1569 non_pic_objects="$non_pic_objects $non_pic_object"
1570 if test -z "$pic_object" || test "$pic_object" = none ; then
1571 arg="$non_pic_object"
1575 # Only an error if not doing a dry-run.
1576 if test -z "$run"; then
1577 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1582 # Extract subdirectory from the argument.
1583 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1584 if test "X$xdir" = "X$arg"; then
1590 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1591 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1592 libobjs="$libobjs $pic_object"
1593 non_pic_objects="$non_pic_objects $non_pic_object"
1600 deplibs="$deplibs $arg"
1601 old_deplibs="$old_deplibs $arg"
1606 # A libtool-controlled library.
1608 if test "$prev" = dlfiles; then
1609 # This library was specified with -dlopen.
1610 dlfiles="$dlfiles $arg"
1612 elif test "$prev" = dlprefiles; then
1613 # The library was specified with -dlpreopen.
1614 dlprefiles="$dlprefiles $arg"
1617 deplibs="$deplibs $arg"
1622 # Some other compiler argument.
1624 # Unknown arguments in both finalize_command and compile_command need
1625 # to be aesthetically quoted because they are evaled later.
1626 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1628 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1632 add_flags="$add_flags $arg"
1636 # Now actually substitute the argument into the commands.
1637 if test -n "$arg"; then
1638 compile_command="$compile_command $arg"
1639 finalize_command="$finalize_command $arg"
1641 done # argument parsing loop
1643 if test -n "$prev"; then
1644 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1649 # Infer tagged configuration to use if any are available and
1650 # if one wasn't chosen via the "--tag" command line option.
1651 # Only attempt this if the compiler in the base link
1652 # command doesn't match the default compiler.
1653 if test -n "$available_tags" && test -z "$tagname"; then
1654 case $base_compile in
1655 # Blanks in the command may have been stripped by the calling shell,
1656 # but not from the CC environment variable when configure was run.
1657 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1658 # Blanks at the start of $base_compile will cause this to fail
1659 # if we don't check for them as well.
1661 for z in $available_tags; do
1662 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1663 # Evaluate the configuration.
1664 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1665 case $base_compile in
1666 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1667 # The compiler in $compile_command matches
1668 # the one in the tagged configuration.
1669 # Assume this is the tagged configuration we want.
1676 # If $tagname still isn't set, then no tagged configuration
1677 # was found and let the user know that the "--tag" command
1678 # line option must be used.
1679 if test -z "$tagname"; then
1680 $echo "$modename: unable to infer tagged configuration"
1681 $echo "$modename: specify a tag with \`--tag'" 1>&2
1684 # $echo "$modename: using $tagname tagged configuration"
1690 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1691 eval arg=\"$export_dynamic_flag_spec\"
1692 compile_command="$compile_command $arg"
1693 finalize_command="$finalize_command $arg"
1697 # calculate the name of the file, without its directory
1698 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1699 libobjs_save="$libobjs"
1701 if test -n "$shlibpath_var"; then
1702 # get the directories listed in $shlibpath_var
1703 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1707 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1708 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1710 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1711 if test "X$output_objdir" = "X$output"; then
1712 output_objdir="$objdir"
1714 output_objdir="$output_objdir/$objdir"
1716 # Create the object directory.
1717 if test ! -d "$output_objdir"; then
1718 $show "$mkdir $output_objdir"
1719 $run $mkdir $output_objdir
1721 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1726 # Determine the type of output
1729 $echo "$modename: you must specify an output file" 1>&2
1733 *.$libext) linkmode=oldlib ;;
1734 *.lo | *.$objext) linkmode=obj ;;
1735 *.la) linkmode=lib ;;
1736 *) linkmode=prog ;; # Anything else should be a program.
1740 *cygwin* | *mingw* | *pw32*)
1741 # don't eliminate duplcations in $postdeps and $predeps
1742 duplicate_compiler_generated_deps=yes
1745 duplicate_compiler_generated_deps=$duplicate_deps
1751 # Find all interdependent deplibs by searching for libraries
1752 # that are linked more than once (e.g. -la -lb -la)
1753 for deplib in $deplibs; do
1754 if test "X$duplicate_deps" = "Xyes" ; then
1756 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1759 libs="$libs $deplib"
1762 if test "$linkmode" = lib; then
1763 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1765 # Compute libraries that are listed more than once in $predeps
1766 # $postdeps and mark them as special (i.e., whose duplicates are
1767 # not to be eliminated).
1769 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1770 for pre_post_dep in $predeps $postdeps; do
1771 case "$pre_post_deps " in
1772 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1774 pre_post_deps="$pre_post_deps $pre_post_dep"
1783 need_relink=no # whether we're linking any uninstalled libtool libraries
1784 notinst_deplibs= # not-installed libtool libraries
1785 notinst_path= # paths that contain not-installed libtool libraries
1789 for file in $dlfiles $dlprefiles; do
1793 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1805 passes="conv scan dlopen dlpreopen link"
1810 for pass in $passes; do
1811 if test "$linkmode,$pass" = "lib,link" ||
1812 test "$linkmode,$pass" = "prog,scan"; then
1816 if test "$linkmode" = prog; then
1818 dlopen) libs="$dlfiles" ;;
1819 dlpreopen) libs="$dlprefiles" ;;
1820 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1823 if test "$pass" = dlopen; then
1824 # Collect dlpreopened libraries
1825 save_deplibs="$deplibs"
1828 for deplib in $libs; do
1833 if test "$linkmode" != lib && test "$linkmode" != prog; then
1834 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1837 if test "$pass" = conv && test "$allow_undefined" = yes; then
1838 deplibs="$deplib $deplibs"
1841 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1842 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1843 for search_ext in .la $shrext .so .a; do
1844 # Search the libtool library
1845 lib="$searchdir/lib${name}${search_ext}"
1846 if test -f "$lib"; then
1847 if test "$search_ext" = ".la"; then
1856 if test "$found" != yes; then
1857 # deplib doesn't seem to be a libtool library
1858 if test "$linkmode,$pass" = "prog,link"; then
1859 compile_deplibs="$deplib $compile_deplibs"
1860 finalize_deplibs="$deplib $finalize_deplibs"
1862 deplibs="$deplib $deplibs"
1863 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1866 else # deplib is a libtool library
1867 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1868 # We need to do some special things here, and not later.
1869 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1870 case " $predeps $postdeps " in
1872 if (${SED} -e '2q' $lib |
1873 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1877 */* | *\\*) . $lib ;;
1880 for l in $old_library $library_names; do
1883 if test "X$ll" = "X$old_library" ; then # only static version available
1885 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1886 test "X$ladir" = "X$lib" && ladir="."
1887 lib=$ladir/$old_library
1888 if test "$linkmode,$pass" = "prog,link"; then
1889 compile_deplibs="$deplib $compile_deplibs"
1890 finalize_deplibs="$deplib $finalize_deplibs"
1892 deplibs="$deplib $deplibs"
1893 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1905 if test "$linkmode,$pass" = "prog,link"; then
1906 compile_deplibs="$deplib $compile_deplibs"
1907 finalize_deplibs="$deplib $finalize_deplibs"
1909 deplibs="$deplib $deplibs"
1910 if test "$linkmode" = lib ; then
1911 newdependency_libs="$deplib $newdependency_libs"
1919 deplibs="$deplib $deplibs"
1920 test "$pass" = conv && continue
1921 newdependency_libs="$deplib $newdependency_libs"
1922 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1925 if test "$pass" = conv; then
1926 deplibs="$deplib $deplibs"
1929 if test "$pass" = scan; then
1930 deplibs="$deplib $deplibs"
1931 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1933 compile_deplibs="$deplib $compile_deplibs"
1934 finalize_deplibs="$deplib $finalize_deplibs"
1938 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1944 if test "$pass" = link; then
1945 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1946 # Make sure the xrpath contains only unique directories.
1949 *) xrpath="$xrpath $dir" ;;
1952 deplibs="$deplib $deplibs"
1955 *.la) lib="$deplib" ;;
1957 if test "$pass" = conv; then
1958 deplibs="$deplib $deplibs"
1963 if test "$deplibs_check_method" != pass_all; then
1965 $echo "*** Warning: Trying to link with static lib archive $deplib."
1966 $echo "*** I have the capability to make that library automatically link in when"
1967 $echo "*** you link to this library. But I can only do this if you have a"
1968 $echo "*** shared version of the library, which you do not appear to have"
1969 $echo "*** because the file extensions .$libext of this argument makes me believe"
1970 $echo "*** that it is just a static archive that I should not used here."
1973 $echo "*** Warning: Linking the shared library $output against the"
1974 $echo "*** static library $deplib is not portable!"
1975 deplibs="$deplib $deplibs"
1980 if test "$pass" != link; then
1981 deplibs="$deplib $deplibs"
1983 compile_deplibs="$deplib $compile_deplibs"
1984 finalize_deplibs="$deplib $finalize_deplibs"
1991 if test "$pass" = conv; then
1992 deplibs="$deplib $deplibs"
1993 elif test "$linkmode" = prog; then
1994 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1995 # If there is no dlopen support or we're linking statically,
1996 # we need to preload.
1997 newdlprefiles="$newdlprefiles $deplib"
1998 compile_deplibs="$deplib $compile_deplibs"
1999 finalize_deplibs="$deplib $finalize_deplibs"
2001 newdlfiles="$newdlfiles $deplib"
2011 if test "$found" = yes || test -f "$lib"; then :
2013 $echo "$modename: cannot find the library \`$lib'" 1>&2
2017 # Check to see that this really is a libtool archive.
2018 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2020 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2024 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2025 test "X$ladir" = "X$lib" && ladir="."
2033 # If the library was installed with an old release of libtool,
2034 # it will not redefine variables installed, or shouldnotlink
2040 */* | *\\*) . $lib ;;
2046 # Convert "-framework foo" to "foo.ltframework" in dependency_libs
2047 test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
2051 if test "$linkmode,$pass" = "lib,link" ||
2052 test "$linkmode,$pass" = "prog,scan" ||
2053 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2054 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2055 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2058 if test "$pass" = conv; then
2059 # Only check for convenience libraries
2060 deplibs="$lib $deplibs"
2062 for deplib in $dependency_libs; do
2063 #echo "Adding $deplib to \$deplibs"
2064 deplibs="$deplib $deplibs"
2065 if test "X$duplicate_deps" = "Xyes" ; then
2066 case "$tmp_libs " in
2067 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2070 tmp_libs="$tmp_libs $deplib"
2072 if test -z "$libdir"; then
2073 if test -z "$old_library"; then
2074 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2077 # It is a libtool convenience library, so add in its objects.
2078 convenience="$convenience $ladir/$objdir/$old_library"
2079 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2080 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2081 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2088 # Get the name of the library we link against.
2090 for l in $old_library $library_names; do
2093 if test -z "$linklib"; then
2094 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2098 # This library was specified with -dlopen.
2099 if test "$pass" = dlopen; then
2100 if test -z "$libdir"; then
2101 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2104 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2105 # If there is no dlname, no dlopen support or we're linking
2106 # statically, we need to preload. We also need to preload any
2107 # dependent libraries so libltdl's deplib preloader doesn't
2108 # bomb out in the load deplibs phase.
2109 dlprefiles="$dlprefiles $lib $dependency_libs"
2111 newdlfiles="$newdlfiles $lib"
2116 # We need an absolute path.
2118 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2120 abs_ladir=`cd "$ladir" && pwd`
2121 if test -z "$abs_ladir"; then
2122 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2123 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2128 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2130 # Find the relevant object directory and library name.
2131 if test "X$installed" = Xyes; then
2132 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2133 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2142 dir="$ladir/$objdir"
2143 absdir="$abs_ladir/$objdir"
2144 # Remove this search path later
2145 notinst_path="$notinst_path $abs_ladir"
2146 fi # $installed = yes
2147 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2149 # This library was specified with -dlpreopen.
2150 if test "$pass" = dlpreopen; then
2151 if test -z "$libdir"; then
2152 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2155 # Prefer using a static library (so that no silly _DYNAMIC symbols
2156 # are required to link).
2157 if test -n "$old_library"; then
2158 newdlprefiles="$newdlprefiles $dir/$old_library"
2159 # Otherwise, use the dlname, so that lt_dlopen finds it.
2160 elif test -n "$dlname"; then
2161 newdlprefiles="$newdlprefiles $dir/$dlname"
2163 newdlprefiles="$newdlprefiles $dir/$linklib"
2165 fi # $pass = dlpreopen
2167 if test -z "$libdir"; then
2168 # Link the convenience library
2169 if test "$linkmode" = lib; then
2170 deplibs="$dir/$old_library $deplibs"
2171 elif test "$linkmode,$pass" = "prog,link"; then
2172 compile_deplibs="$dir/$old_library $compile_deplibs"
2173 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2175 deplibs="$lib $deplibs" # used for prog,scan pass
2181 if test "$linkmode" = prog && test "$pass" != link; then
2182 newlib_search_path="$newlib_search_path $ladir"
2183 deplibs="$lib $deplibs"
2186 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2187 test "$build_libtool_libs" = no; then
2192 for deplib in $dependency_libs; do
2194 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2196 # Need to link against all dependency_libs?
2197 if test "$linkalldeplibs" = yes; then
2198 deplibs="$deplib $deplibs"
2200 # Need to hardcode shared library paths
2201 # or/and link against static libraries
2202 newdependency_libs="$deplib $newdependency_libs"
2204 if test "X$duplicate_deps" = "Xyes" ; then
2205 case "$tmp_libs " in
2206 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2209 tmp_libs="$tmp_libs $deplib"
2212 fi # $linkmode = prog...
2214 if test "$linkmode,$pass" = "prog,link"; then
2215 if test -n "$library_names" &&
2216 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2217 # We need to hardcode the library path
2218 if test -n "$shlibpath_var"; then
2219 # Make sure the rpath contains only unique directories.
2220 case "$temp_rpath " in
2223 *) temp_rpath="$temp_rpath $dir" ;;
2227 # Hardcode the library path.
2228 # Skip directories that are in the system default run-time
2230 case " $sys_lib_dlsearch_path " in
2233 case "$compile_rpath " in
2235 *) compile_rpath="$compile_rpath $absdir"
2239 case " $sys_lib_dlsearch_path " in
2242 case "$finalize_rpath " in
2244 *) finalize_rpath="$finalize_rpath $libdir"
2248 fi # $linkmode,$pass = prog,link...
2250 if test "$alldeplibs" = yes &&
2251 { test "$deplibs_check_method" = pass_all ||
2252 { test "$build_libtool_libs" = yes &&
2253 test -n "$library_names"; }; }; then
2254 # We only need to search for static libraries
2259 link_static=no # Whether the deplib will be linked statically
2260 if test -n "$library_names" &&
2261 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2262 if test "$installed" = no; then
2263 notinst_deplibs="$notinst_deplibs $lib"
2266 # This is a shared library
2268 # Warn about portability, can't link against -module's on some systems (darwin)
2269 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2271 if test "$linkmode" = prog; then
2272 $echo "*** Warning: Linking the executable $output against the loadable module"
2274 $echo "*** Warning: Linking the shared library $output against the loadable module"
2276 $echo "*** $linklib is not portable!"
2278 if test "$linkmode" = lib &&
2279 test "$hardcode_into_libs" = yes; then
2280 # Hardcode the library path.
2281 # Skip directories that are in the system default run-time
2283 case " $sys_lib_dlsearch_path " in
2286 case "$compile_rpath " in
2288 *) compile_rpath="$compile_rpath $absdir"
2292 case " $sys_lib_dlsearch_path " in
2295 case "$finalize_rpath " in
2297 *) finalize_rpath="$finalize_rpath $libdir"
2303 if test -n "$old_archive_from_expsyms_cmds"; then
2304 # figure out the soname
2305 set dummy $library_names
2308 libname=`eval \\$echo \"$libname_spec\"`
2309 # use dlname if we got it. it's perfectly good, no?
2310 if test -n "$dlname"; then
2312 elif test -n "$soname_spec"; then
2316 major=`expr $current - $age`
2320 eval soname=\"$soname_spec\"
2325 # Make a new name for the extract_expsyms_cmds to use
2327 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2328 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2330 # If the library has no export list, then create one now
2331 if test -f "$output_objdir/$soname-def"; then :
2333 $show "extracting exported symbol list from \`$soname'"
2334 save_ifs="$IFS"; IFS='~'
2335 eval cmds=\"$extract_expsyms_cmds\"
2336 for cmd in $cmds; do
2339 $run eval "$cmd" || exit $?
2345 if test -f "$output_objdir/$newlib"; then :; else
2346 $show "generating import library for \`$soname'"
2347 save_ifs="$IFS"; IFS='~'
2348 eval cmds=\"$old_archive_from_expsyms_cmds\"
2349 for cmd in $cmds; do
2352 $run eval "$cmd" || exit $?
2356 # make sure the library variables are pointing to the new library
2359 fi # test -n "$old_archive_from_expsyms_cmds"
2361 if test "$linkmode" = prog || test "$mode" != relink; then
2366 case $hardcode_action in
2367 immediate | unsupported)
2368 if test "$hardcode_direct" = no; then
2371 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2373 # if the lib is a module then we can not link against it, someone
2374 # is ignoring the new warnings I added
2375 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2376 $echo "** Warning, lib $linklib is a module, not a shared library"
2377 if test -z "$old_library" ; then
2379 $echo "** And there doesn't seem to be a static archive available"
2380 $echo "** The link will probably fail, sorry"
2382 add="$dir/$old_library"
2386 elif test "$hardcode_minus_L" = no; then
2388 *-*-sunos*) add_shlibpath="$dir" ;;
2392 elif test "$hardcode_shlibpath_var" = no; then
2393 add_shlibpath="$dir"
2400 if test "$hardcode_direct" = yes; then
2402 elif test "$hardcode_minus_L" = yes; then
2404 # Try looking first in the location we're being installed to.
2405 if test -n "$inst_prefix_dir"; then
2408 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2413 elif test "$hardcode_shlibpath_var" = yes; then
2414 add_shlibpath="$dir"
2423 if test "$lib_linked" != yes; then
2424 $echo "$modename: configuration error: unsupported hardcode properties"
2428 if test -n "$add_shlibpath"; then
2429 case :$compile_shlibpath: in
2430 *":$add_shlibpath:"*) ;;
2431 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2434 if test "$linkmode" = prog; then
2435 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2436 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2438 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2439 test -n "$add" && deplibs="$add $deplibs"
2440 if test "$hardcode_direct" != yes && \
2441 test "$hardcode_minus_L" != yes && \
2442 test "$hardcode_shlibpath_var" = yes; then
2443 case :$finalize_shlibpath: in
2445 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2451 if test "$linkmode" = prog || test "$mode" = relink; then
2455 # Finalize command for both is simple: just hardcode it.
2456 if test "$hardcode_direct" = yes; then
2457 add="$libdir/$linklib"
2458 elif test "$hardcode_minus_L" = yes; then
2461 elif test "$hardcode_shlibpath_var" = yes; then
2462 case :$finalize_shlibpath: in
2464 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2467 elif test "$hardcode_automatic" = yes; then
2468 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2469 add="$inst_prefix_dir$libdir/$linklib"
2471 add="$libdir/$linklib"
2474 # We cannot seem to hardcode it, guess we'll fake it.
2476 # Try looking first in the location we're being installed to.
2477 if test -n "$inst_prefix_dir"; then
2480 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2487 if test "$linkmode" = prog; then
2488 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2489 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2491 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2492 test -n "$add" && deplibs="$add $deplibs"
2495 elif test "$linkmode" = prog; then
2496 # Here we assume that one of hardcode_direct or hardcode_minus_L
2497 # is not unsupported. This is valid on all known static and
2499 if test "$hardcode_direct" != unsupported; then
2500 test -n "$old_library" && linklib="$old_library"
2501 compile_deplibs="$dir/$linklib $compile_deplibs"
2502 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2504 compile_deplibs="-l$name -L$dir $compile_deplibs"
2505 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2507 elif test "$build_libtool_libs" = yes; then
2508 # Not a shared library
2509 if test "$deplibs_check_method" != pass_all; then
2510 # We're trying link a shared library against a static one
2511 # but the system doesn't support it.
2513 # Just print a warning and add the library to dependency_libs so
2514 # that the program can be linked against the static library.
2516 $echo "*** Warning: This system can not link to static lib archive $lib."
2517 $echo "*** I have the capability to make that library automatically link in when"
2518 $echo "*** you link to this library. But I can only do this if you have a"
2519 $echo "*** shared version of the library, which you do not appear to have."
2520 if test "$module" = yes; then
2521 $echo "*** But as you try to build a module library, libtool will still create "
2522 $echo "*** a static module, that should work as long as the dlopening application"
2523 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2524 if test -z "$global_symbol_pipe"; then
2526 $echo "*** However, this would only work if libtool was able to extract symbol"
2527 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2528 $echo "*** not find such a program. So, this module is probably useless."
2529 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2531 if test "$build_old_libs" = no; then
2532 build_libtool_libs=module
2535 build_libtool_libs=no
2539 convenience="$convenience $dir/$old_library"
2540 old_convenience="$old_convenience $dir/$old_library"
2541 deplibs="$dir/$old_library $deplibs"
2544 fi # link shared/static library?
2546 if test "$linkmode" = lib; then
2547 #if test -n "$dependency_libs" &&
2548 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2549 # test "$link_static" = yes; }; then
2550 # Extract -R from dependency_libs
2552 for libdir in $dependency_libs; do
2554 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2556 *" $temp_xrpath "*) ;;
2557 *) xrpath="$xrpath $temp_xrpath";;
2559 *) temp_deplibs="$temp_deplibs $libdir";;
2562 dependency_libs="$temp_deplibs"
2565 newlib_search_path="$newlib_search_path $absdir"
2566 # Link against this library
2567 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2568 # ... and its dependency_libs
2570 for deplib in $dependency_libs; do
2571 newdependency_libs="$deplib $newdependency_libs"
2572 if test "X$duplicate_deps" = "Xyes" ; then
2573 case "$tmp_libs " in
2574 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2577 tmp_libs="$tmp_libs $deplib"
2580 if test "$link_all_deplibs" != no; then
2581 # Add the search paths of all dependency libraries
2582 for deplib in $dependency_libs; do
2584 -L*) path="$deplib" ;;
2586 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2587 test "X$dir" = "X$deplib" && dir="."
2588 # We need an absolute path.
2590 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2592 absdir=`cd "$dir" && pwd`
2593 if test -z "$absdir"; then
2594 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2599 if grep "^installed=no" $deplib > /dev/null; then
2600 path="$absdir/$objdir"
2602 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2603 if test -z "$libdir"; then
2604 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2607 if test "$absdir" != "$libdir"; then
2608 # Sure, some shells/systems don't implement the -ef.
2609 # Those will have to live with the warning.
2610 test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
2611 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2618 # we do not want to link against static libs, but need to link against shared
2619 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2620 if test -n "$deplibrary_names" ; then
2621 for tmp in $deplibrary_names ; do
2624 if test -f "$path/$depdepl" ; then
2625 depdepl="$path/$depdepl"
2627 # do not add paths which are already there
2628 case " $newlib_search_path " in
2630 *) newlib_search_path="$newlib_search_path $path";;
2644 # Again, we only want to link against shared libraries
2645 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2646 for tmp in $newlib_search_path ; do
2647 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2648 eval depdepl="$tmp/lib$tmp_libs.dylib"
2668 case " $deplibs " in
2670 *) deplibs="$deplibs $depdepl" ;;
2672 case " $deplibs " in
2674 *) deplibs="$deplibs $path" ;;
2677 fi # link_all_deplibs != no
2679 done # for deplib in $libs
2680 dependency_libs="$newdependency_libs"
2681 if test "$pass" = dlpreopen; then
2682 # Link the dlpreopened libraries before other libraries
2683 for deplib in $save_deplibs; do
2684 deplibs="$deplib $deplibs"
2687 if test "$pass" != dlopen; then
2688 if test "$pass" != conv; then
2689 # Make sure lib_search_path contains only unique directories.
2691 for dir in $newlib_search_path; do
2692 case "$lib_search_path " in
2694 *) lib_search_path="$lib_search_path $dir" ;;
2700 if test "$linkmode,$pass" != "prog,link"; then
2703 vars="compile_deplibs finalize_deplibs"
2705 for var in $vars dependency_libs; do
2706 # Add libraries to $var in reverse order
2707 eval tmp_libs=\"\$$var\"
2709 for deplib in $tmp_libs; do
2710 # FIXME: Pedantically, this is the right thing to do, so
2711 # that some nasty dependency loop isn't accidentally
2713 #new_libs="$deplib $new_libs"
2714 # Pragmatically, this seems to cause very few problems in
2717 -L*) new_libs="$deplib $new_libs" ;;
2720 # And here is the reason: when a library appears more
2721 # than once as an explicit dependence of a library, or
2722 # is implicitly linked in more than once by the
2723 # compiler, it is considered special, and multiple
2724 # occurrences thereof are not removed. Compare this
2725 # with having the same library being listed as a
2726 # dependency of multiple other libraries: in this case,
2727 # we know (pedantically, we assume) the library does not
2728 # need to be listed more than once, so we keep only the
2729 # last copy. This is not always right, but it is rare
2730 # enough that we require users that really mean to play
2731 # such unportable linking tricks to link the library
2732 # using -Wl,-lname, so that libtool does not consider it
2733 # for duplicate removal.
2734 case " $specialdeplibs " in
2735 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2737 case " $new_libs " in
2739 *) new_libs="$deplib $new_libs" ;;
2747 for deplib in $new_libs; do
2750 case " $tmp_libs " in
2752 *) tmp_libs="$tmp_libs $deplib" ;;
2755 *) tmp_libs="$tmp_libs $deplib" ;;
2758 eval $var=\"$tmp_libs\"
2761 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2763 for i in $dependency_libs ; do
2764 case " $predeps $postdeps $compiler_lib_search_path " in
2769 if test -n "$i" ; then
2770 tmp_libs="$tmp_libs $i"
2773 dependency_libs=$tmp_libs
2775 if test "$linkmode" = prog; then
2776 dlfiles="$newdlfiles"
2777 dlprefiles="$newdlprefiles"
2782 if test -n "$deplibs"; then
2783 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2786 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2787 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2790 if test -n "$rpath"; then
2791 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2794 if test -n "$xrpath"; then
2795 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2798 if test -n "$vinfo"; then
2799 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2802 if test -n "$release"; then
2803 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2806 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2807 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2810 # Now set the variables for building old libraries.
2811 build_libtool_libs=no
2813 objs="$objs$old_deplibs"
2817 # Make sure we only generate libraries of the form `libNAME.la'.
2820 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2821 eval shared_ext=\"$shrext\"
2822 eval libname=\"$libname_spec\"
2825 if test "$module" = no; then
2826 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2830 if test "$need_lib_prefix" != no; then
2831 # Add the "lib" prefix for modules if required
2832 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2833 eval shared_ext=\"$shrext\"
2834 eval libname=\"$libname_spec\"
2836 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2841 if test -n "$objs"; then
2842 if test "$deplibs_check_method" != pass_all; then
2843 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2847 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2848 $echo "*** objects $objs is not portable!"
2849 libobjs="$libobjs $objs"
2853 if test "$dlself" != no; then
2854 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2858 if test "$#" -gt 2; then
2859 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2864 if test -z "$rpath"; then
2865 if test "$build_libtool_libs" = yes; then
2866 # Building a libtool convenience library.
2867 # Some compilers have problems with a `.al' extension so
2868 # convenience libraries should have the same extension an
2869 # archive normally would.
2870 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2871 build_libtool_libs=convenience
2875 if test -n "$vinfo"; then
2876 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2879 if test -n "$release"; then
2880 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2884 # Parse the version information argument.
2885 save_ifs="$IFS"; IFS=':'
2886 set dummy $vinfo 0 0 0
2889 if test -n "$8"; then
2890 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2895 # convert absolute version numbers to libtool ages
2896 # this retains compatibility with .la files and attempts
2897 # to make the code below a bit more comprehensible
2899 case $vinfo_number in
2903 number_revision="$4"
2905 # There are really only two kinds -- those that
2906 # use the current revision as the major version
2907 # and those that subtract age and use age as
2908 # a minor version. But, then there is irix
2909 # which has an extra 1 added just for fun
2911 case $version_type in
2912 darwin|linux|osf|windows)
2913 current=`expr $number_major + $number_minor`
2915 revision="$number_revision"
2917 freebsd-aout|freebsd-elf|sunos)
2918 current="$number_major"
2919 revision="$number_minor"
2923 current=`expr $number_major + $number_minor - 1`
2925 revision="$number_minor"
2936 # Check that each of the things are valid numbers.
2938 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2940 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2941 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2947 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2949 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2950 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2956 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2958 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2959 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2964 if test "$age" -gt "$current"; then
2965 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2966 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2970 # Calculate the version variables.
2974 case $version_type in
2978 # Like Linux, but with the current version available in
2979 # verstring for coding it into the library header
2980 major=.`expr $current - $age`
2981 versuffix="$major.$age.$revision"
2982 # Darwin ld doesn't like 0 for these options...
2983 minor_current=`expr $current + 1`
2984 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2989 versuffix=".$current.$revision";
2994 versuffix=".$current";
2998 major=`expr $current - $age + 1`
3000 case $version_type in
3001 nonstopux) verstring_prefix=nonstopux ;;
3002 *) verstring_prefix=sgi ;;
3004 verstring="$verstring_prefix$major.$revision"
3006 # Add in all the interfaces that we are compatible with.
3008 while test "$loop" -ne 0; do
3009 iface=`expr $revision - $loop`
3010 loop=`expr $loop - 1`
3011 verstring="$verstring_prefix$major.$iface:$verstring"
3014 # Before this point, $major must not contain `.'.
3016 versuffix="$major.$revision"
3020 major=.`expr $current - $age`
3021 versuffix="$major.$age.$revision"
3025 major=.`expr $current - $age`
3026 versuffix=".$current.$age.$revision"
3027 verstring="$current.$age.$revision"
3029 # Add in all the interfaces that we are compatible with.
3031 while test "$loop" -ne 0; do
3032 iface=`expr $current - $loop`
3033 loop=`expr $loop - 1`
3034 verstring="$verstring:${iface}.0"
3037 # Make executables depend on our current version.
3038 verstring="$verstring:${current}.0"
3043 versuffix=".$current.$revision"
3047 # Use '-' rather than '.', since we only want one
3048 # extension on DOS 8.3 filesystems.
3049 major=`expr $current - $age`
3054 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3055 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3060 # Clear the version info if we defaulted, and they specified a release.
3061 if test -z "$vinfo" && test -n "$release"; then
3063 case $version_type in
3065 # we can't check for "0.0" in archive_cmds due to quoting
3066 # problems, so we reset it completely
3073 if test "$need_version" = no; then
3080 # Remove version info from name if versioning should be avoided
3081 if test "$avoid_version" = yes && test "$need_version" = no; then
3087 # Check to see if the archive will have undefined symbols.
3088 if test "$allow_undefined" = yes; then
3089 if test "$allow_undefined_flag" = unsupported; then
3090 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3091 build_libtool_libs=no
3095 # Don't allow undefined symbols.
3096 allow_undefined_flag="$no_undefined_flag"
3100 if test "$mode" != relink; then
3101 # Remove our outputs, but don't remove object files since they
3102 # may have been created when compiling PIC objects.
3104 tempremovelist=`$echo "$output_objdir/*"`
3105 for p in $tempremovelist; do
3109 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3110 removelist="$removelist $p"
3115 if test -n "$removelist"; then
3116 $show "${rm}r $removelist"
3117 $run ${rm}r $removelist
3121 # Now set the variables for building old libraries.
3122 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3123 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3125 # Transform .lo files to .o files.
3126 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3129 # Eliminate all temporary directories.
3130 for path in $notinst_path; do
3131 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3132 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3133 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3136 if test -n "$xrpath"; then
3137 # If the user specified any rpath flags, then add them.
3139 for libdir in $xrpath; do
3140 temp_xrpath="$temp_xrpath -R$libdir"
3141 case "$finalize_rpath " in
3143 *) finalize_rpath="$finalize_rpath $libdir" ;;
3146 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3147 dependency_libs="$temp_xrpath $dependency_libs"
3151 # Make sure dlfiles contains only unique files that won't be dlpreopened
3152 old_dlfiles="$dlfiles"
3154 for lib in $old_dlfiles; do
3155 case " $dlprefiles $dlfiles " in
3157 *) dlfiles="$dlfiles $lib" ;;
3161 # Make sure dlprefiles contains only unique files
3162 old_dlprefiles="$dlprefiles"
3164 for lib in $old_dlprefiles; do
3165 case "$dlprefiles " in
3167 *) dlprefiles="$dlprefiles $lib" ;;
3171 if test "$build_libtool_libs" = yes; then
3172 if test -n "$rpath"; then
3174 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3175 # these systems don't actually have a c library (as such)!
3177 *-*-rhapsody* | *-*-darwin1.[012])
3178 # Rhapsody C library is in the System framework
3179 deplibs="$deplibs System.ltframework"
3182 # Don't link with libc until the a.out ld.so is fixed.
3185 # Prevent $arg from being parsed by the freebsd regexp below.
3186 if test "$build_libtool_need_lc" = "yes"; then
3187 deplibs="$deplibs -lc"
3190 *-*-openbsd* | *-*-freebsd*)
3191 # Do not include libc due to us having libc/libc_r.
3192 test "X$arg" = "X-lc" && continue
3195 # Add libc to deplibs on all other systems if necessary.
3196 if test "$build_libtool_need_lc" = "yes"; then
3197 deplibs="$deplibs -lc"
3203 # Transform deplibs into only deplibs that can be linked in shared.
3205 libname_save=$libname
3206 release_save=$release
3207 versuffix_save=$versuffix
3209 # I'm not sure if I'm treating the release correctly. I think
3210 # release should show up in the -l (ie -lgmp5) so we don't want to
3211 # add it in twice. Is that correct?
3217 case $deplibs_check_method in
3219 # Don't check for shared/static. Everything works.
3220 # This might be a little naive. We might want to check
3221 # whether the library exists or not. But this is on
3222 # osf3 & osf4 and I'm not really sure... Just
3223 # implementing what was already the behavior.
3227 # This code stresses the "libraries are programs" paradigm to its
3228 # limits. Maybe even breaks it. We compile a program, linking it
3229 # against the deplibs as a proxy for the library. Then we can check
3230 # whether they linked in statically or dynamically with ldd.
3232 cat > conftest.c <<EOF
3233 int main() { return 0; }
3236 $LTCC -o conftest conftest.c $deplibs
3237 if test "$?" -eq 0 ; then
3238 ldd_output=`ldd conftest`
3239 for i in $deplibs; do
3240 name="`expr $i : '-l\(.*\)'`"
3241 # If $name is empty we are operating on a -L argument.
3242 if test "$name" != "" && test "$name" -ne "0"; then
3243 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3244 case " $predeps $postdeps " in
3246 newdeplibs="$newdeplibs $i"
3251 if test -n "$i" ; then
3252 libname=`eval \\$echo \"$libname_spec\"`
3253 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3254 set dummy $deplib_matches
3256 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3257 newdeplibs="$newdeplibs $i"
3261 $echo "*** Warning: dynamic linker does not accept needed library $i."
3262 $echo "*** I have the capability to make that library automatically link in when"
3263 $echo "*** you link to this library. But I can only do this if you have a"
3264 $echo "*** shared version of the library, which I believe you do not have"
3265 $echo "*** because a test_compile did reveal that the linker did not use it for"
3266 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3270 newdeplibs="$newdeplibs $i"
3274 # Error occurred in the first compile. Let's try to salvage
3275 # the situation: Compile a separate program for each library.
3276 for i in $deplibs; do
3277 name="`expr $i : '-l\(.*\)'`"
3278 # If $name is empty we are operating on a -L argument.
3279 if test "$name" != "" && test "$name" != "0"; then
3281 $LTCC -o conftest conftest.c $i
3283 if test "$?" -eq 0 ; then
3284 ldd_output=`ldd conftest`
3285 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3286 case " $predeps $postdeps " in
3288 newdeplibs="$newdeplibs $i"
3293 if test -n "$i" ; then
3294 libname=`eval \\$echo \"$libname_spec\"`
3295 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3296 set dummy $deplib_matches
3298 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3299 newdeplibs="$newdeplibs $i"
3303 $echo "*** Warning: dynamic linker does not accept needed library $i."
3304 $echo "*** I have the capability to make that library automatically link in when"
3305 $echo "*** you link to this library. But I can only do this if you have a"
3306 $echo "*** shared version of the library, which you do not appear to have"
3307 $echo "*** because a test_compile did reveal that the linker did not use this one"
3308 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3314 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3315 $echo "*** make it link in! You will probably need to install it or some"
3316 $echo "*** library that it depends on before this library will be fully"
3317 $echo "*** functional. Installing it before continuing would be even better."
3320 newdeplibs="$newdeplibs $i"
3326 set dummy $deplibs_check_method
3327 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3328 for a_deplib in $deplibs; do
3329 name="`expr $a_deplib : '-l\(.*\)'`"
3330 # If $name is empty we are operating on a -L argument.
3331 if test "$name" != "" && test "$name" != "0"; then
3332 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3333 case " $predeps $postdeps " in
3335 newdeplibs="$newdeplibs $a_deplib"
3340 if test -n "$a_deplib" ; then
3341 libname=`eval \\$echo \"$libname_spec\"`
3342 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3343 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3344 for potent_lib in $potential_libs; do
3345 # Follow soft links.
3346 if ls -lLd "$potent_lib" 2>/dev/null \
3347 | grep " -> " >/dev/null; then
3350 # The statement above tries to avoid entering an
3351 # endless loop below, in case of cyclic links.
3352 # We might still enter an endless loop, since a link
3353 # loop can be closed while we follow links,
3355 potlib="$potent_lib"
3356 while test -h "$potlib" 2>/dev/null; do
3357 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3359 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3360 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3363 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3365 | $EGREP "$file_magic_regex" > /dev/null; then
3366 newdeplibs="$newdeplibs $a_deplib"
3373 if test -n "$a_deplib" ; then
3376 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3377 $echo "*** I have the capability to make that library automatically link in when"
3378 $echo "*** you link to this library. But I can only do this if you have a"
3379 $echo "*** shared version of the library, which you do not appear to have"
3380 $echo "*** because I did check the linker path looking for a file starting"
3381 if test -z "$potlib" ; then
3382 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3384 $echo "*** with $libname and none of the candidates passed a file format test"
3385 $echo "*** using a file magic. Last file checked: $potlib"
3389 # Add a -L argument.
3390 newdeplibs="$newdeplibs $a_deplib"
3392 done # Gone through all deplibs.
3395 set dummy $deplibs_check_method
3396 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3397 for a_deplib in $deplibs; do
3398 name="`expr $a_deplib : '-l\(.*\)'`"
3399 # If $name is empty we are operating on a -L argument.
3400 if test -n "$name" && test "$name" != "0"; then
3401 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3402 case " $predeps $postdeps " in
3404 newdeplibs="$newdeplibs $a_deplib"
3409 if test -n "$a_deplib" ; then
3410 libname=`eval \\$echo \"$libname_spec\"`
3411 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3412 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3413 for potent_lib in $potential_libs; do
3414 potlib="$potent_lib" # see symlink-check above in file_magic test
3415 if eval $echo \"$potent_lib\" 2>/dev/null \
3417 | $EGREP "$match_pattern_regex" > /dev/null; then
3418 newdeplibs="$newdeplibs $a_deplib"
3425 if test -n "$a_deplib" ; then
3428 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3429 $echo "*** I have the capability to make that library automatically link in when"
3430 $echo "*** you link to this library. But I can only do this if you have a"
3431 $echo "*** shared version of the library, which you do not appear to have"
3432 $echo "*** because I did check the linker path looking for a file starting"
3433 if test -z "$potlib" ; then
3434 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3436 $echo "*** with $libname and none of the candidates passed a file format test"
3437 $echo "*** using a regex pattern. Last file checked: $potlib"
3441 # Add a -L argument.
3442 newdeplibs="$newdeplibs $a_deplib"
3444 done # Gone through all deplibs.
3448 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3449 -e 's/ -[LR][^ ]*//g'`
3450 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3451 for i in $predeps $postdeps ; do
3452 # can't use Xsed below, because $i might contain '/'
3453 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3456 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3457 | grep . >/dev/null; then
3459 if test "X$deplibs_check_method" = "Xnone"; then
3460 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3462 $echo "*** Warning: inter-library dependencies are not known to be supported."
3464 $echo "*** All declared inter-library dependencies are being dropped."
3469 versuffix=$versuffix_save
3471 release=$release_save
3472 libname=$libname_save
3476 *-*-rhapsody* | *-*-darwin1.[012])
3477 # On Rhapsody replace the C library is the System framework
3478 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
3482 if test "$droppeddeps" = yes; then
3483 if test "$module" = yes; then
3485 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3486 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3487 $echo "*** a static module, that should work as long as the dlopening"
3488 $echo "*** application is linked with the -dlopen flag."
3489 if test -z "$global_symbol_pipe"; then
3491 $echo "*** However, this would only work if libtool was able to extract symbol"
3492 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3493 $echo "*** not find such a program. So, this module is probably useless."
3494 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3496 if test "$build_old_libs" = no; then
3497 oldlibs="$output_objdir/$libname.$libext"
3498 build_libtool_libs=module
3501 build_libtool_libs=no
3504 $echo "*** The inter-library dependencies that have been dropped here will be"
3505 $echo "*** automatically added whenever a program is linked with this library"
3506 $echo "*** or is declared to -dlopen it."
3508 if test "$allow_undefined" = no; then
3510 $echo "*** Since this library must not contain undefined symbols,"
3511 $echo "*** because either the platform does not support them or"
3512 $echo "*** it was explicitly requested with -no-undefined,"
3513 $echo "*** libtool will only create a static version of it."
3514 if test "$build_old_libs" = no; then
3515 oldlibs="$output_objdir/$libname.$libext"
3516 build_libtool_libs=module
3519 build_libtool_libs=no
3524 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
3527 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3528 dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3531 # Done checking deplibs!
3535 # All the library-specific variables (install_libdir is set above).
3540 # Test again, we may have decided not to build it any more
3541 if test "$build_libtool_libs" = yes; then
3542 if test "$hardcode_into_libs" = yes; then
3543 # Hardcode the library paths
3546 rpath="$finalize_rpath"
3547 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
3548 for libdir in $rpath; do
3549 if test -n "$hardcode_libdir_flag_spec"; then
3550 if test -n "$hardcode_libdir_separator"; then
3551 if test -z "$hardcode_libdirs"; then
3552 hardcode_libdirs="$libdir"
3554 # Just accumulate the unique libdirs.
3555 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3556 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3559 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3564 eval flag=\"$hardcode_libdir_flag_spec\"
3565 dep_rpath="$dep_rpath $flag"
3567 elif test -n "$runpath_var"; then
3568 case "$perm_rpath " in
3570 *) perm_rpath="$perm_rpath $libdir" ;;
3574 # Substitute the hardcoded libdirs into the rpath.
3575 if test -n "$hardcode_libdir_separator" &&
3576 test -n "$hardcode_libdirs"; then
3577 libdir="$hardcode_libdirs"
3578 if test -n "$hardcode_libdir_flag_spec_ld"; then
3579 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3581 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3584 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3585 # We should set the runpath_var.
3587 for dir in $perm_rpath; do
3590 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3592 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3595 shlibpath="$finalize_shlibpath"
3596 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3597 if test -n "$shlibpath"; then
3598 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3601 # Get the real and link names of the library.
3602 eval shared_ext=\"$shrext\"
3603 eval library_names=\"$library_names_spec\"
3604 set dummy $library_names
3608 if test -n "$soname_spec"; then
3609 eval soname=\"$soname_spec\"
3613 if test -z "$dlname"; then
3617 lib="$output_objdir/$realname"
3620 linknames="$linknames $link"
3623 # Use standard objects if they are pic
3624 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3626 # Prepare the list of exported symbols
3627 if test -z "$export_symbols"; then
3628 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3629 $show "generating symbol list for \`$libname.la'"
3630 export_symbols="$output_objdir/$libname.exp"
3631 $run $rm $export_symbols
3632 eval cmds=\"$export_symbols_cmds\"
3633 save_ifs="$IFS"; IFS='~'
3634 for cmd in $cmds; do
3636 if len=`expr "X$cmd" : ".*"` &&
3637 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3639 $run eval "$cmd" || exit $?
3640 skipped_export=false
3642 # The command line is too long to execute in one step.
3643 $show "using reloadable object file for export list..."
3648 if test -n "$export_symbols_regex"; then
3649 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3650 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3651 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3652 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3657 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3658 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3662 for test_deplib in $deplibs; do
3663 case " $convenience " in
3664 *" $test_deplib "*) ;;
3666 tmp_deplibs="$tmp_deplibs $test_deplib"
3670 deplibs="$tmp_deplibs"
3672 if test -n "$convenience"; then
3673 if test -n "$whole_archive_flag_spec"; then
3674 save_libobjs=$libobjs
3675 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3677 gentop="$output_objdir/${outputname}x"
3678 $show "${rm}r $gentop"
3679 $run ${rm}r "$gentop"
3680 $show "$mkdir $gentop"
3681 $run $mkdir "$gentop"
3683 if test "$status" -ne 0 && test ! -d "$gentop"; then
3686 generated="$generated $gentop"
3688 for xlib in $convenience; do
3689 # Extract the objects.
3691 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3692 *) xabs=`pwd`"/$xlib" ;;
3694 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3695 xdir="$gentop/$xlib"
3697 $show "${rm}r $xdir"
3699 $show "$mkdir $xdir"
3702 if test "$status" -ne 0 && test ! -d "$xdir"; then
3705 # We will extract separately just the conflicting names and we will no
3706 # longer touch any unique names. It is faster to leave these extract
3707 # automatically by $AR in one run.
3708 $show "(cd $xdir && $AR x $xabs)"
3709 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3710 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3713 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3714 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3715 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3718 while test "$i" -le "$count"
3720 # Put our $i before any first dot (extension)
3721 # Never overwrite any file
3723 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3725 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3727 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3728 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3734 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3739 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3740 eval flag=\"$thread_safe_flag_spec\"
3741 linker_flags="$linker_flags $flag"
3744 # Make a backup of the uninstalled library when relinking
3745 if test "$mode" = relink; then
3746 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3749 # Add all flags from the command line. We here create a library,
3750 # but those flags were only added to compile_command and
3751 # finalize_command, which are only used when creating executables.
3752 # So do it by hand here.
3753 compiler_flags="$compiler_flags $add_flags"
3754 # Only add it to commands which use CC, instead of LD, i.e.
3755 # only to $compiler_flags
3756 #linker_flags="$linker_flags $add_flags"
3758 # Do each of the archive commands.
3759 if test "$module" = yes && test -n "$module_cmds" ; then
3760 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3761 eval cmds=\"$module_expsym_cmds\"
3763 eval cmds=\"$module_cmds\"
3766 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3767 eval cmds=\"$archive_expsym_cmds\"
3769 eval cmds=\"$archive_cmds\"
3773 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3774 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3777 # The command line is too long to link in one step, link piecewise.
3778 $echo "creating reloadable object files..."
3780 # Save the value of $output and $libobjs because we want to
3781 # use them later. If we have whole_archive_flag_spec, we
3782 # want to use save_libobjs as it was before
3783 # whole_archive_flag_spec was expanded, because we can't
3784 # assume the linker understands whole_archive_flag_spec.
3785 # This may have to be revisited, in case too many
3786 # convenience libraries get linked in and end up exceeding
3788 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3789 save_libobjs=$libobjs
3793 # Clear the reloadable object creation command queue and
3794 # initialize k to one.
3801 output=$output_objdir/$save_output-${k}.$objext
3802 # Loop over the list of objects to be linked.
3803 for obj in $save_libobjs
3805 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3806 if test "X$objlist" = X ||
3807 { len=`expr "X$test_cmds" : ".*"` &&
3808 test "$len" -le "$max_cmd_len"; }; then
3809 objlist="$objlist $obj"
3811 # The command $test_cmds is almost too long, add a
3812 # command to the queue.
3813 if test "$k" -eq 1 ; then
3814 # The first file doesn't have a previous command to add.
3815 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3817 # All subsequent reloadable object files will link in
3818 # the last one created.
3819 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3821 last_robj=$output_objdir/$save_output-${k}.$objext
3823 output=$output_objdir/$save_output-${k}.$objext
3828 # Handle the remaining objects by creating one last
3829 # reloadable object file. All subsequent reloadable object
3830 # files will link in the last one created.
3831 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3832 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3834 if ${skipped_export-false}; then
3835 $show "generating symbol list for \`$libname.la'"
3836 export_symbols="$output_objdir/$libname.exp"
3837 $run $rm $export_symbols
3839 # Append the command to create the export file.
3840 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3843 # Set up a command to remove the reloadale object files
3844 # after they are used.
3846 while test "$i" -lt "$k"
3849 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3852 $echo "creating a temporary reloadable object file: $output"
3854 # Loop through the commands generated above and execute them.
3855 save_ifs="$IFS"; IFS='~'
3856 for cmd in $concat_cmds; do
3859 $run eval "$cmd" || exit $?
3864 # Restore the value of output.
3867 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3868 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3870 # Expand the library linking commands again to reset the
3871 # value of $libobjs for piecewise linking.
3873 # Do each of the archive commands.
3874 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3875 eval cmds=\"$archive_expsym_cmds\"
3877 eval cmds=\"$archive_cmds\"
3880 # Append the command to remove the reloadable object files
3881 # to the just-reset $cmds.
3882 eval cmds=\"\$cmds~$rm $delfiles\"
3884 save_ifs="$IFS"; IFS='~'
3885 for cmd in $cmds; do
3888 $run eval "$cmd" || exit $?
3892 # Restore the uninstalled library and exit
3893 if test "$mode" = relink; then
3894 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3898 # Create links to the real library.
3899 for linkname in $linknames; do
3900 if test "$realname" != "$linkname"; then
3901 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3902 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3906 # If -module or -export-dynamic was specified, set the dlname.
3907 if test "$module" = yes || test "$export_dynamic" = yes; then
3908 # On all known operating systems, these are identical.
3915 if test -n "$deplibs"; then
3916 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3919 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3920 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3923 if test -n "$rpath"; then
3924 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3927 if test -n "$xrpath"; then
3928 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3931 if test -n "$vinfo"; then
3932 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3935 if test -n "$release"; then
3936 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3941 if test -n "$objs$old_deplibs"; then
3942 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3946 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3954 # Delete the old objects.
3955 $run $rm $obj $libobj
3957 # Objects from convenience libraries. This assumes
3958 # single-version convenience libraries. Whenever we create
3959 # different ones for PIC/non-PIC, this we'll have to duplicate
3963 # reload_cmds runs $LD directly, so let us get rid of
3964 # -Wl from whole_archive_flag_spec
3967 if test -n "$convenience"; then
3968 if test -n "$whole_archive_flag_spec"; then
3969 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3971 gentop="$output_objdir/${obj}x"
3972 $show "${rm}r $gentop"
3973 $run ${rm}r "$gentop"
3974 $show "$mkdir $gentop"
3975 $run $mkdir "$gentop"
3977 if test "$status" -ne 0 && test ! -d "$gentop"; then
3980 generated="$generated $gentop"
3982 for xlib in $convenience; do
3983 # Extract the objects.
3985 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3986 *) xabs=`pwd`"/$xlib" ;;
3988 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3989 xdir="$gentop/$xlib"
3991 $show "${rm}r $xdir"
3993 $show "$mkdir $xdir"
3996 if test "$status" -ne 0 && test ! -d "$xdir"; then
3999 # We will extract separately just the conflicting names and we will no
4000 # longer touch any unique names. It is faster to leave these extract
4001 # automatically by $AR in one run.
4002 $show "(cd $xdir && $AR x $xabs)"
4003 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4004 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4007 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4008 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4009 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4012 while test "$i" -le "$count"
4014 # Put our $i before any first dot (extension)
4015 # Never overwrite any file
4017 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4019 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4021 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4022 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4028 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4033 # Create the old-style object.
4034 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
4037 eval cmds=\"$reload_cmds\"
4038 save_ifs="$IFS"; IFS='~'
4039 for cmd in $cmds; do
4042 $run eval "$cmd" || exit $?
4046 # Exit if we aren't doing a library object file.
4047 if test -z "$libobj"; then
4048 if test -n "$gentop"; then
4049 $show "${rm}r $gentop"
4056 if test "$build_libtool_libs" != yes; then
4057 if test -n "$gentop"; then
4058 $show "${rm}r $gentop"
4062 # Create an invalid libtool object if no PIC, so that we don't
4063 # accidentally link it into a program.
4064 # $show "echo timestamp > $libobj"
4065 # $run eval "echo timestamp > $libobj" || exit $?
4069 if test -n "$pic_flag" || test "$pic_mode" != default; then
4070 # Only do commands if we really have different PIC objects.
4071 reload_objs="$libobjs $reload_conv_objs"
4073 eval cmds=\"$reload_cmds\"
4074 save_ifs="$IFS"; IFS='~'
4075 for cmd in $cmds; do
4078 $run eval "$cmd" || exit $?
4083 if test -n "$gentop"; then
4084 $show "${rm}r $gentop"
4093 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4095 if test -n "$vinfo"; then
4096 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4099 if test -n "$release"; then
4100 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4103 if test "$preload" = yes; then
4104 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4105 test "$dlopen_self_static" = unknown; then
4106 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4111 *-*-rhapsody* | *-*-darwin1.[012])
4112 # On Rhapsody replace the C library is the System framework
4113 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4114 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4120 # Don't allow lazy linking, it breaks C++ global constructors
4121 if test "$tagname" = CXX ; then
4122 compile_command="$compile_command ${wl}-bind_at_load"
4123 finalize_command="$finalize_command ${wl}-bind_at_load"
4125 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
4126 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4127 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4131 compile_command="$compile_command $compile_deplibs"
4132 finalize_command="$finalize_command $finalize_deplibs"
4134 if test -n "$rpath$xrpath"; then
4135 # If the user specified any rpath flags, then add them.
4136 for libdir in $rpath $xrpath; do
4137 # This is the magic to use -rpath.
4138 case "$finalize_rpath " in
4140 *) finalize_rpath="$finalize_rpath $libdir" ;;
4145 # Now hardcode the library paths
4148 for libdir in $compile_rpath $finalize_rpath; do
4149 if test -n "$hardcode_libdir_flag_spec"; then
4150 if test -n "$hardcode_libdir_separator"; then
4151 if test -z "$hardcode_libdirs"; then
4152 hardcode_libdirs="$libdir"
4154 # Just accumulate the unique libdirs.
4155 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4156 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4159 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4164 eval flag=\"$hardcode_libdir_flag_spec\"
4165 rpath="$rpath $flag"
4167 elif test -n "$runpath_var"; then
4168 case "$perm_rpath " in
4170 *) perm_rpath="$perm_rpath $libdir" ;;
4174 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4175 case :$dllsearchpath: in
4177 *) dllsearchpath="$dllsearchpath:$libdir";;
4182 # Substitute the hardcoded libdirs into the rpath.
4183 if test -n "$hardcode_libdir_separator" &&
4184 test -n "$hardcode_libdirs"; then
4185 libdir="$hardcode_libdirs"
4186 eval rpath=\" $hardcode_libdir_flag_spec\"
4188 compile_rpath="$rpath"
4192 for libdir in $finalize_rpath; do
4193 if test -n "$hardcode_libdir_flag_spec"; then
4194 if test -n "$hardcode_libdir_separator"; then
4195 if test -z "$hardcode_libdirs"; then
4196 hardcode_libdirs="$libdir"
4198 # Just accumulate the unique libdirs.
4199 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4200 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4203 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4208 eval flag=\"$hardcode_libdir_flag_spec\"
4209 rpath="$rpath $flag"
4211 elif test -n "$runpath_var"; then
4212 case "$finalize_perm_rpath " in
4214 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4218 # Substitute the hardcoded libdirs into the rpath.
4219 if test -n "$hardcode_libdir_separator" &&
4220 test -n "$hardcode_libdirs"; then
4221 libdir="$hardcode_libdirs"
4222 eval rpath=\" $hardcode_libdir_flag_spec\"
4224 finalize_rpath="$rpath"
4226 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4227 # Transform all the library objects into standard objects.
4228 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4229 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4233 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4234 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4235 dlsyms="${outputname}S.c"
4237 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4241 if test -n "$dlsyms"; then
4245 # Discover the nlist of each of the dlfiles.
4246 nlist="$output_objdir/${outputname}.nm"
4248 $show "$rm $nlist ${nlist}S ${nlist}T"
4249 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4251 # Parse the name list into a source file.
4252 $show "creating $output_objdir/$dlsyms"
4254 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4255 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4256 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4262 /* Prevent the only kind of declaration conflicts we can make. */
4263 #define lt_preloaded_symbols some_other_symbol
4265 /* External symbol declarations for the compiler. */\
4268 if test "$dlself" = yes; then
4269 $show "generating symbol list for \`$output'"
4271 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4273 # Add our own program objects to the symbol list.
4274 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4275 for arg in $progfiles; do
4276 $show "extracting global C symbols from \`$arg'"
4277 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4280 if test -n "$exclude_expsyms"; then
4281 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4282 $run eval '$mv "$nlist"T "$nlist"'
4285 if test -n "$export_symbols_regex"; then
4286 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4287 $run eval '$mv "$nlist"T "$nlist"'
4290 # Prepare the list of exported symbols
4291 if test -z "$export_symbols"; then
4292 export_symbols="$output_objdir/$output.exp"
4293 $run $rm $export_symbols
4294 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4296 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4297 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4298 $run eval 'mv "$nlist"T "$nlist"'
4302 for arg in $dlprefiles; do
4303 $show "extracting global C symbols from \`$arg'"
4304 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4305 $run eval '$echo ": $name " >> "$nlist"'
4306 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4309 if test -z "$run"; then
4310 # Make sure we have at least an empty file.
4311 test -f "$nlist" || : > "$nlist"
4313 if test -n "$exclude_expsyms"; then
4314 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4315 $mv "$nlist"T "$nlist"
4318 # Try sorting and uniquifying the output.
4319 if grep -v "^: " < "$nlist" |
4320 if sort -k 3 </dev/null >/dev/null 2>&1; then
4325 uniq > "$nlist"S; then
4328 grep -v "^: " < "$nlist" > "$nlist"S
4331 if test -f "$nlist"S; then
4332 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4334 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4337 $echo >> "$output_objdir/$dlsyms" "\
4339 #undef lt_preloaded_symbols
4341 #if defined (__STDC__) && __STDC__
4342 # define lt_ptr void *
4344 # define lt_ptr char *
4348 /* The mapping between symbol names and symbols. */
4353 lt_preloaded_symbols[] =
4357 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4359 $echo >> "$output_objdir/$dlsyms" "\
4363 /* This works around a problem in FreeBSD linker */
4364 #ifdef FREEBSD_WORKAROUND
4365 static const void *lt_preloaded_setup() {
4366 return lt_preloaded_symbols;
4376 pic_flag_for_symtable=
4378 # compiling the symbol table file with pic_flag works around
4379 # a FreeBSD bug that causes programs to crash when -lm is
4380 # linked before any other PIC object. But we must not use
4381 # pic_flag when linking with -static. The problem exists in
4382 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4383 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4384 case "$compile_command " in
4386 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4389 case "$compile_command " in
4391 *) pic_flag_for_symtable=" $pic_flag";;
4395 # Now compile the dynamic symbol file.
4396 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4397 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4399 # Clean up the generated files.
4400 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4401 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4403 # Transform the symbol file into the correct name.
4404 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4405 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4408 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4413 # We keep going just in case the user didn't refer to
4414 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4415 # really was required.
4417 # Nullify the symbol file.
4418 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4419 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4422 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
4423 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
4424 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
4425 # This does not apply on AIX for ia64, which uses a SysV linker.
4428 *-*-aix4* | *-*-aix5*)
4429 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
4430 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
4433 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4434 # Replace the output file specification.
4435 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4436 link_command="$compile_command$compile_rpath"
4438 # We have no uninstalled library dependencies, so finalize right now.
4439 $show "$link_command"
4440 $run eval "$link_command"
4443 # Delete the generated files.
4444 if test -n "$dlsyms"; then
4445 $show "$rm $output_objdir/${outputname}S.${objext}"
4446 $run $rm "$output_objdir/${outputname}S.${objext}"
4452 if test -n "$shlibpath_var"; then
4453 # We should set the shlibpath_var
4455 for dir in $temp_rpath; do
4457 [\\/]* | [A-Za-z]:[\\/]*)
4462 # Relative path: add a thisdir entry.
4463 rpath="$rpath\$thisdir/$dir:"
4470 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4471 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4473 if test -n "$finalize_shlibpath"; then
4474 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4479 if test -n "$runpath_var"; then
4480 if test -n "$perm_rpath"; then
4481 # We should set the runpath_var.
4483 for dir in $perm_rpath; do
4486 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4488 if test -n "$finalize_perm_rpath"; then
4489 # We should set the runpath_var.
4491 for dir in $finalize_perm_rpath; do
4494 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4498 if test "$no_install" = yes; then
4499 # We don't need to create a wrapper script.
4500 link_command="$compile_var$compile_command$compile_rpath"
4501 # Replace the output file specification.
4502 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4503 # Delete the old output file.
4505 # Link the executable and exit
4506 $show "$link_command"
4507 $run eval "$link_command" || exit $?
4511 if test "$hardcode_action" = relink; then
4512 # Fast installation is not supported
4513 link_command="$compile_var$compile_command$compile_rpath"
4514 relink_command="$finalize_var$finalize_command$finalize_rpath"
4516 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4517 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4519 if test "$fast_install" != no; then
4520 link_command="$finalize_var$compile_command$finalize_rpath"
4521 if test "$fast_install" = yes; then
4522 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4524 # fast_install is set to needless
4528 link_command="$compile_var$compile_command$compile_rpath"
4529 relink_command="$finalize_var$finalize_command$finalize_rpath"
4533 # Replace the output file specification.
4534 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4536 # Delete the old output files.
4537 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4539 $show "$link_command"
4540 $run eval "$link_command" || exit $?
4542 # Now create the wrapper script.
4543 $show "creating $output"
4545 # Quote the relink command for shipping.
4546 if test -n "$relink_command"; then
4547 # Preserve any variables that may affect compiler behavior
4548 for var in $variables_saved_for_relink; do
4549 if eval test -z \"\${$var+set}\"; then
4550 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4551 elif eval var_value=\$$var; test -z "$var_value"; then
4552 relink_command="$var=; export $var; $relink_command"
4554 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4555 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4558 relink_command="(cd `pwd`; $relink_command)"
4559 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4562 # Quote $echo for shipping.
4563 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4565 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4566 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4568 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4570 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4573 # Only actually do things if our run command is non-null.
4574 if test -z "$run"; then
4575 # win32 will think the script is a binary if it has
4576 # a .exe suffix, so we strip it off here.
4578 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4580 # test for cygwin because mv fails w/o .exe extensions
4584 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4588 *cygwin* | *mingw* )
4589 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4590 cwrapper=`$echo ${output}.exe`
4591 $rm $cwrappersource $cwrapper
4592 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4594 cat > $cwrappersource <<EOF
4596 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4597 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4599 The $output program cannot be directly executed until all the libtool
4600 libraries that it depends on are installed.
4602 This wrapper executable should never be moved out of the build directory.
4603 If it is, it will not operate correctly.
4605 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4606 but could eventually absorb all of the scripts functionality and
4607 exec $objdir/$outputname directly.
4610 cat >> $cwrappersource<<"EOF"
4618 #if defined(PATH_MAX)
4619 # define LT_PATHMAX PATH_MAX
4620 #elif defined(MAXPATHLEN)
4621 # define LT_PATHMAX MAXPATHLEN
4623 # define LT_PATHMAX 1024
4626 #ifndef DIR_SEPARATOR
4627 #define DIR_SEPARATOR '/'
4630 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4632 #define HAVE_DOS_BASED_FILE_SYSTEM
4633 #ifndef DIR_SEPARATOR_2
4634 #define DIR_SEPARATOR_2 '\\'
4638 #ifndef DIR_SEPARATOR_2
4639 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4640 #else /* DIR_SEPARATOR_2 */
4641 # define IS_DIR_SEPARATOR(ch) \
4642 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4643 #endif /* DIR_SEPARATOR_2 */
4645 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4646 #define XFREE(stale) do { \
4647 if (stale) { free ((void *) stale); stale = 0; } \
4650 const char *program_name = NULL;
4652 void * xmalloc (size_t num);
4653 char * xstrdup (const char *string);
4654 char * basename (const char *name);
4655 char * fnqualify(const char *path);
4656 char * strendzap(char *str, const char *pat);
4657 void lt_fatal (const char *message, ...);
4660 main (int argc, char *argv[])
4665 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4666 newargz = XMALLOC(char *, argc+2);
4669 cat >> $cwrappersource <<EOF
4670 newargz[0] = "$SHELL";
4673 cat >> $cwrappersource <<"EOF"
4674 newargz[1] = fnqualify(argv[0]);
4675 /* we know the script has the same name, without the .exe */
4676 /* so make sure newargz[1] doesn't end in .exe */
4677 strendzap(newargz[1],".exe");
4678 for (i = 1; i < argc; i++)
4679 newargz[i+1] = xstrdup(argv[i]);
4680 newargz[argc+1] = NULL;
4683 cat >> $cwrappersource <<EOF
4684 execv("$SHELL",newargz);
4687 cat >> $cwrappersource <<"EOF"
4691 xmalloc (size_t num)
4693 void * p = (void *) malloc (num);
4695 lt_fatal ("Memory exhausted");
4701 xstrdup (const char *string)
4703 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4708 basename (const char *name)
4712 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4713 /* Skip over the disk name in MSDOS pathnames. */
4714 if (isalpha (name[0]) && name[1] == ':')
4718 for (base = name; *name; name++)
4719 if (IS_DIR_SEPARATOR (*name))
4721 return (char *) base;
4725 fnqualify(const char *path)
4729 char tmp[LT_PATHMAX + 1];
4731 assert(path != NULL);
4733 /* Is it qualified already? */
4734 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4735 if (isalpha (path[0]) && path[1] == ':')
4736 return xstrdup (path);
4738 if (IS_DIR_SEPARATOR (path[0]))
4739 return xstrdup (path);
4741 /* prepend the current directory */
4742 /* doesn't handle '~' */
4743 if (getcwd (tmp, LT_PATHMAX) == NULL)
4744 lt_fatal ("getcwd failed");
4745 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4746 p = XMALLOC(char, size);
4747 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4752 strendzap(char *str, const char *pat)
4756 assert(str != NULL);
4757 assert(pat != NULL);
4760 patlen = strlen(pat);
4764 str += len - patlen;
4765 if (strcmp(str, pat) == 0)
4772 lt_error_core (int exit_status, const char * mode,
4773 const char * message, va_list ap)
4775 fprintf (stderr, "%s: %s: ", program_name, mode);
4776 vfprintf (stderr, message, ap);
4777 fprintf (stderr, ".\n");
4779 if (exit_status >= 0)
4784 lt_fatal (const char *message, ...)
4787 va_start (ap, message);
4788 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4792 # we should really use a build-platform specific compiler
4793 # here, but OTOH, the wrappers (shell script and this C one)
4794 # are only useful if you want to execute the "real" binary.
4795 # Since the "real" binary is built for $host, then this
4796 # wrapper might as well be built for $host, too.
4797 $run $LTCC -s -o $cwrapper $cwrappersource
4801 trap "$rm $output; exit 1" 1 2 15
4806 # $output - temporary wrapper script for $objdir/$outputname
4807 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4809 # The $output program cannot be directly executed until all the libtool
4810 # libraries that it depends on are installed.
4812 # This wrapper script should never be moved out of the build directory.
4813 # If it is, it will not operate correctly.
4815 # Sed substitution that helps us do robust quoting. It backslashifies
4816 # metacharacters that are still active within double-quoted strings.
4817 Xsed='${SED} -e 1s/^X//'
4818 sed_quote_subst='$sed_quote_subst'
4820 # The HP-UX ksh and POSIX shell print the target directory to stdout
4822 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4824 relink_command=\"$relink_command\"
4826 # This environment variable determines our operation mode.
4827 if test \"\$libtool_install_magic\" = \"$magic\"; then
4828 # install mode needs the following variable:
4829 notinst_deplibs='$notinst_deplibs'
4831 # When we are sourced in execute mode, \$file and \$echo are already set.
4832 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4835 # Make sure echo works.
4836 if test \"X\$1\" = X--no-reexec; then
4837 # Discard the --no-reexec flag, and continue.
4839 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4840 # Yippee, \$echo works!
4843 # Restart under the correct shell, and then maybe \$echo will work.
4844 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4850 # Find the directory that this script lives in.
4851 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4852 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4854 # Follow symbolic links until we get to the real thisdir.
4855 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4856 while test -n \"\$file\"; do
4857 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4859 # If there was a directory component, then change thisdir.
4860 if test \"x\$destdir\" != \"x\$file\"; then
4861 case \"\$destdir\" in
4862 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4863 *) thisdir=\"\$thisdir/\$destdir\" ;;
4867 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4868 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4871 # Try to get the absolute directory name.
4872 absdir=\`cd \"\$thisdir\" && pwd\`
4873 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4876 if test "$fast_install" = yes; then
4878 program=lt-'$outputname'$exeext
4879 progdir=\"\$thisdir/$objdir\"
4881 if test ! -f \"\$progdir/\$program\" || \\
4882 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4883 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4885 file=\"\$\$-\$program\"
4887 if test ! -d \"\$progdir\"; then
4888 $mkdir \"\$progdir\"
4890 $rm \"\$progdir/\$file\"
4895 # relink executable if necessary
4896 if test -n \"\$relink_command\"; then
4897 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4899 $echo \"\$relink_command_output\" >&2
4900 $rm \"\$progdir/\$file\"
4905 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4906 { $rm \"\$progdir/\$program\";
4907 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4908 $rm \"\$progdir/\$file\"
4912 program='$outputname'
4913 progdir=\"\$thisdir/$objdir\"
4919 if test -f \"\$progdir/\$program\"; then"
4921 # Export our shlibpath_var if we have one.
4922 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4924 # Add our own library path to $shlibpath_var
4925 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4927 # Some systems cannot cope with colon-terminated $shlibpath_var
4928 # The second colon is a workaround for a bug in BeOS R4 sed
4929 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4931 export $shlibpath_var
4935 # fixup the dll searchpath if we need to.
4936 if test -n "$dllsearchpath"; then
4938 # Add the dll search path components to the executable PATH
4939 PATH=$dllsearchpath:\$PATH
4944 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4945 # Run the actual program with our arguments.
4948 # Backslashes separate directories on plain windows
4949 *-*-mingw | *-*-os2*)
4951 exec \$progdir\\\\\$program \${1+\"\$@\"}
4956 # Need to set LD_LIBRARY_PATH, to the value already
4957 # computed within libtool.
4959 LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"}
4964 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4968 # The program doesn't exist.
4969 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4970 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4971 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4982 # See if we need to build an old-fashioned archive.
4983 for oldlib in $oldlibs; do
4985 if test "$build_libtool_libs" = convenience; then
4986 oldobjs="$libobjs_save"
4987 addlibs="$convenience"
4988 build_libtool_libs=no
4990 if test "$build_libtool_libs" = module; then
4991 oldobjs="$libobjs_save"
4992 build_libtool_libs=no
4994 oldobjs="$old_deplibs $non_pic_objects"
4996 addlibs="$old_convenience"
4999 if test -n "$addlibs"; then
5000 gentop="$output_objdir/${outputname}x"
5001 $show "${rm}r $gentop"
5002 $run ${rm}r "$gentop"
5003 $show "$mkdir $gentop"
5004 $run $mkdir "$gentop"
5006 if test "$status" -ne 0 && test ! -d "$gentop"; then
5009 generated="$generated $gentop"
5011 # Add in members from convenience archives.
5012 for xlib in $addlibs; do
5013 # Extract the objects.
5015 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5016 *) xabs=`pwd`"/$xlib" ;;
5018 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5019 xdir="$gentop/$xlib"
5021 $show "${rm}r $xdir"
5023 $show "$mkdir $xdir"
5026 if test "$status" -ne 0 && test ! -d "$xdir"; then
5029 # We will extract separately just the conflicting names and we will no
5030 # longer touch any unique names. It is faster to leave these extract
5031 # automatically by $AR in one run.
5032 $show "(cd $xdir && $AR x $xabs)"
5033 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5034 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5037 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5038 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5039 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5042 while test "$i" -le "$count"
5044 # Put our $i before any first dot (extension)
5045 # Never overwrite any file
5047 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5049 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5051 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5052 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5058 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5062 compiler_flags="$compiler_flags $add_flags"
5064 # Do each command in the archive commands.
5065 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5066 eval cmds=\"$old_archive_from_new_cmds\"
5068 eval cmds=\"$old_archive_cmds\"
5070 if len=`expr "X$cmds" : ".*"` &&
5071 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5074 # the command line is too long to link in one step, link in parts
5075 $echo "using piecewise archive linking..."
5080 save_oldobjs=$oldobjs
5081 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5082 # encoded into archives. This makes 'ar r' malfunction in
5083 # this piecewise linking case whenever conflicting object
5084 # names appear in distinct ar calls; check, warn and compensate.
5085 if (for obj in $save_oldobjs
5087 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5088 done | sort | sort -uc >/dev/null 2>&1); then
5091 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5092 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5095 # Is there a better way of finding the last object in the list?
5096 for obj in $save_oldobjs
5100 for obj in $save_oldobjs
5102 oldobjs="$objlist $obj"
5103 objlist="$objlist $obj"
5104 eval test_cmds=\"$old_archive_cmds\"
5105 if len=`expr "X$test_cmds" : ".*"` &&
5106 test "$len" -le "$max_cmd_len"; then
5109 # the above command should be used before it gets too long
5111 if test "$obj" = "$last_oldobj" ; then
5114 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5115 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5121 if test "X$oldobjs" = "X" ; then
5122 eval cmds=\"\$concat_cmds\"
5124 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5128 save_ifs="$IFS"; IFS='~'
5129 for cmd in $cmds; do
5132 $run eval "$cmd" || exit $?
5137 if test -n "$generated"; then
5138 $show "${rm}r$generated"
5139 $run ${rm}r$generated
5142 # Now create the libtool archive.
5146 test "$build_old_libs" = yes && old_library="$libname.$libext"
5147 $show "creating $output"
5149 # Preserve any variables that may affect compiler behavior
5150 for var in $variables_saved_for_relink; do
5151 if eval test -z \"\${$var+set}\"; then
5152 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5153 elif eval var_value=\$$var; test -z "$var_value"; then
5154 relink_command="$var=; export $var; $relink_command"
5156 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5157 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5160 # Quote the link command for shipping.
5161 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5162 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5163 if test "$hardcode_automatic" = yes ; then
5166 # Only create the output if not a dry run.
5167 if test -z "$run"; then
5168 for installed in no yes; do
5169 if test "$installed" = yes; then
5170 if test -z "$install_libdir"; then
5173 output="$output_objdir/$outputname"i
5174 # Replace all uninstalled libtool libraries with the installed ones
5176 for deplib in $dependency_libs; do
5179 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5180 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5181 if test -z "$libdir"; then
5182 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5185 newdependency_libs="$newdependency_libs $libdir/$name"
5187 *) newdependency_libs="$newdependency_libs $deplib" ;;
5190 dependency_libs="$newdependency_libs"
5192 for lib in $dlfiles; do
5193 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5194 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5195 if test -z "$libdir"; then
5196 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5199 newdlfiles="$newdlfiles $libdir/$name"
5201 dlfiles="$newdlfiles"
5203 for lib in $dlprefiles; do
5204 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5205 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5206 if test -z "$libdir"; then
5207 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5210 newdlprefiles="$newdlprefiles $libdir/$name"
5212 dlprefiles="$newdlprefiles"
5215 # place dlname in correct position for cygwin
5217 case $host,$output,$installed,$module,$dlname in
5218 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5221 # $outputname - a libtool library file
5222 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5224 # Please DO NOT delete this file!
5225 # It is necessary for linking the library.
5227 # The name that we can dlopen(3).
5230 # Names of this library.
5231 library_names='$library_names'
5233 # The name of the static archive.
5234 old_library='$old_library'
5236 # Libraries that this one depends upon.
5237 dependency_libs='$dependency_libs'
5239 # Version information for $libname.
5244 # Is this an already installed library?
5245 installed=$installed
5247 # Should we warn about portability when linking against -modules?
5248 shouldnotlink=$module
5250 # Files to dlopen/dlpreopen
5252 dlpreopen='$dlprefiles'
5254 # Directory that this library needs to be installed in:
5255 libdir='$install_libdir'"
5256 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
5258 relink_command=\"$relink_command\""
5263 # Do a symbolic link so that the libtool archive can be found in
5264 # LD_LIBRARY_PATH before the program is installed.
5265 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5266 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5272 # libtool install mode
5274 modename="$modename: install"
5276 # There may be an optional sh(1) argument at the beginning of
5277 # install_prog (especially on Windows NT).
5278 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5279 # Allow the use of GNU shtool's install command.
5280 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5281 # Aesthetically quote it.
5282 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5284 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5288 install_prog="$arg "
5296 # The real first argument should be the name of the installation program.
5297 # Aesthetically quote it.
5298 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5300 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5304 install_prog="$install_prog$arg"
5306 # We need to accept at least all the BSD install flags.
5316 if test -n "$dest"; then
5317 files="$files $dest"
5335 # If the previous option needed an argument, then skip it.
5336 if test -n "$prev"; then
5345 # Aesthetically quote the argument.
5346 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5348 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5352 install_prog="$install_prog $arg"
5355 if test -z "$install_prog"; then
5356 $echo "$modename: you must specify an install program" 1>&2
5361 if test -n "$prev"; then
5362 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5367 if test -z "$files"; then
5368 if test -z "$dest"; then
5369 $echo "$modename: no file or destination specified" 1>&2
5371 $echo "$modename: you must specify a destination" 1>&2
5377 # Strip any trailing slash from the destination.
5378 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5380 # Check to see that the destination is a directory.
5381 test -d "$dest" && isdir=yes
5382 if test "$isdir" = yes; then
5386 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5387 test "X$destdir" = "X$dest" && destdir=.
5388 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5390 # Not a directory, so check to see that there is only one file specified.
5392 if test "$#" -gt 2; then
5393 $echo "$modename: \`$dest' is not a directory" 1>&2
5399 [\\/]* | [A-Za-z]:[\\/]*) ;;
5401 for file in $files; do
5405 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5414 # This variable tells wrapper scripts just to set variables rather
5415 # than running their programs.
5416 libtool_install_magic="$magic"
5421 for file in $files; do
5423 # Do each installation.
5426 # Do the static libraries later.
5427 staticlibs="$staticlibs $file"
5431 # Check to see that this really is a libtool archive.
5432 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5434 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5442 # If there is no directory component, then add one.
5444 */* | *\\*) . $file ;;
5448 # Add the libdir to current_libdirs if it is the destination.
5449 if test "X$destdir" = "X$libdir"; then
5450 case "$current_libdirs " in
5452 *) current_libdirs="$current_libdirs $libdir" ;;
5455 # Note the libdir as a future libdir.
5456 case "$future_libdirs " in
5458 *) future_libdirs="$future_libdirs $libdir" ;;
5462 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5463 test "X$dir" = "X$file/" && dir=
5466 if test -n "$relink_command"; then
5467 # Determine the prefix the user has applied to our future dir.
5468 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5470 # Don't allow the user to place us outside of our expected
5471 # location b/c this prevents finding dependent libraries that
5472 # are installed to the same prefix.
5473 # At present, this check doesn't affect windows .dll's that
5474 # are installed into $libdir/../bin (currently, that works fine)
5475 # but it's something to keep an eye on.
5476 if test "$inst_prefix_dir" = "$destdir"; then
5477 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5481 if test -n "$inst_prefix_dir"; then
5482 # Stick the inst_prefix_dir data into the link command.
5483 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5485 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5488 $echo "$modename: warning: relinking \`$file'" 1>&2
5489 $show "$relink_command"
5490 if $run eval "$relink_command"; then :
5492 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5497 # See the names of the shared library.
5498 set dummy $library_names
5499 if test -n "$2"; then
5505 test -n "$relink_command" && srcname="$realname"T
5507 # Install the shared library and build the symlinks.
5508 $show "$install_prog $dir/$srcname $destdir/$realname"
5509 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5510 if test -n "$stripme" && test -n "$striplib"; then
5511 $show "$striplib $destdir/$realname"
5512 $run eval "$striplib $destdir/$realname" || exit $?
5515 if test "$#" -gt 0; then
5516 # Delete the old symlinks, and create new ones.
5519 if test "$linkname" != "$realname"; then
5520 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5521 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5526 # Do each command in the postinstall commands.
5527 lib="$destdir/$realname"
5528 eval cmds=\"$postinstall_cmds\"
5529 save_ifs="$IFS"; IFS='~'
5530 for cmd in $cmds; do
5533 $run eval "$cmd" || exit $?
5538 # Install the pseudo-library for information purposes.
5539 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5540 instname="$dir/$name"i
5541 $show "$install_prog $instname $destdir/$name"
5542 $run eval "$install_prog $instname $destdir/$name" || exit $?
5544 # Maybe install the static library, too.
5545 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5549 # Install (i.e. copy) a libtool object.
5551 # Figure out destination file name, if it wasn't already specified.
5552 if test -n "$destname"; then
5553 destfile="$destdir/$destname"
5555 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5556 destfile="$destdir/$destfile"
5559 # Deduce the name of the destination old-style object file.
5562 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5565 staticdest="$destfile"
5569 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5575 # Install the libtool object if requested.
5576 if test -n "$destfile"; then
5577 $show "$install_prog $file $destfile"
5578 $run eval "$install_prog $file $destfile" || exit $?
5581 # Install the old object if enabled.
5582 if test "$build_old_libs" = yes; then
5583 # Deduce the name of the old-style object file.
5584 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5586 $show "$install_prog $staticobj $staticdest"
5587 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5593 # Figure out destination file name, if it wasn't already specified.
5594 if test -n "$destname"; then
5595 destfile="$destdir/$destname"
5597 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5598 destfile="$destdir/$destfile"
5601 # If the file is missing, and there is a .exe on the end, strip it
5602 # because it is most likely a libtool script we actually want to
5607 if test ! -f "$file"; then
5608 file=`$echo $file|${SED} 's,.exe$,,'`
5614 # Do a test to see if this is really a libtool program.
5617 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5623 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5627 # To insure that "foo" is sourced, and not "foo.exe",
5628 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5629 # which disallows the automatic-append-.exe behavior.
5631 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5632 *) wrapperdot=${wrapper} ;;
5634 # If there is no directory component, then add one.
5636 */* | *\\*) . ${wrapperdot} ;;
5637 *) . ./${wrapperdot} ;;
5640 # Check the variables that should have been set.
5641 if test -z "$notinst_deplibs"; then
5642 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5647 for lib in $notinst_deplibs; do
5648 # Check to see that each library is installed.
5650 if test -f "$lib"; then
5651 # If there is no directory component, then add one.
5653 */* | *\\*) . $lib ;;
5657 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5658 if test -n "$libdir" && test ! -f "$libfile"; then
5659 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5665 # To insure that "foo" is sourced, and not "foo.exe",
5666 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5667 # which disallows the automatic-append-.exe behavior.
5669 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5670 *) wrapperdot=${wrapper} ;;
5672 # If there is no directory component, then add one.
5674 */* | *\\*) . ${wrapperdot} ;;
5675 *) . ./${wrapperdot} ;;
5679 if test "$fast_install" = no && test -n "$relink_command"; then
5680 if test "$finalize" = yes && test -z "$run"; then
5682 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5683 tmpdir="$tmpdir/libtool-$$"
5684 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5686 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5689 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5690 outputname="$tmpdir/$file"
5691 # Replace the output file specification.
5692 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5694 $show "$relink_command"
5695 if $run eval "$relink_command"; then :
5697 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5703 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5706 # Install the binary that we compiled earlier.
5707 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5711 # remove .exe since cygwin /usr/bin/install will append another
5713 case $install_prog,$host in
5714 */usr/bin/install*,*cygwin*)
5715 case $file:$destfile in
5720 destfile=$destfile.exe
5723 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5728 $show "$install_prog$stripme $file $destfile"
5729 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5730 test -n "$outputname" && ${rm}r "$tmpdir"
5735 for file in $staticlibs; do
5736 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5738 # Set up the ranlib parameters.
5739 oldlib="$destdir/$name"
5741 $show "$install_prog $file $oldlib"
5742 $run eval "$install_prog \$file \$oldlib" || exit $?
5744 if test -n "$stripme" && test -n "$striplib"; then
5745 $show "$old_striplib $oldlib"
5746 $run eval "$old_striplib $oldlib" || exit $?
5749 # Do each command in the postinstall commands.
5750 eval cmds=\"$old_postinstall_cmds\"
5751 save_ifs="$IFS"; IFS='~'
5752 for cmd in $cmds; do
5755 $run eval "$cmd" || exit $?
5760 if test -n "$future_libdirs"; then
5761 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5764 if test -n "$current_libdirs"; then
5765 # Maybe just do a dry run.
5766 test -n "$run" && current_libdirs=" -n$current_libdirs"
5767 exec_cmd='$SHELL $0 --finish$current_libdirs'
5773 # libtool finish mode
5775 modename="$modename: finish"
5779 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5782 libdirs="$libdirs $dir"
5785 for libdir in $libdirs; do
5786 if test -n "$finish_cmds"; then
5787 # Do each command in the finish commands.
5788 eval cmds=\"$finish_cmds\"
5789 save_ifs="$IFS"; IFS='~'
5790 for cmd in $cmds; do
5793 $run eval "$cmd" || admincmds="$admincmds
5798 if test -n "$finish_eval"; then
5799 # Do the single finish_eval.
5800 eval cmds=\"$finish_eval\"
5801 $run eval "$cmds" || admincmds="$admincmds
5807 # Exit here if they wanted silent mode.
5810 $echo "----------------------------------------------------------------------"
5811 $echo "Libraries have been installed in:"
5812 for libdir in $libdirs; do
5816 $echo "If you ever happen to want to link against installed libraries"
5817 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5818 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5819 $echo "flag during linking and do at least one of the following:"
5820 if test -n "$shlibpath_var"; then
5821 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5822 $echo " during execution"
5824 if test -n "$runpath_var"; then
5825 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5826 $echo " during linking"
5828 if test -n "$hardcode_libdir_flag_spec"; then
5830 eval flag=\"$hardcode_libdir_flag_spec\"
5832 $echo " - use the \`$flag' linker flag"
5834 if test -n "$admincmds"; then
5835 $echo " - have your system administrator run these commands:$admincmds"
5837 if test -f /etc/ld.so.conf; then
5838 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5841 $echo "See any operating system documentation about shared libraries for"
5842 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5843 $echo "----------------------------------------------------------------------"
5847 # libtool execute mode
5849 modename="$modename: execute"
5851 # The first argument is the command name.
5853 if test -z "$cmd"; then
5854 $echo "$modename: you must specify a COMMAND" 1>&2
5859 # Handle -dlopen flags immediately.
5860 for file in $execute_dlfiles; do
5861 if test ! -f "$file"; then
5862 $echo "$modename: \`$file' is not a file" 1>&2
5870 # Check to see that this really is a libtool archive.
5871 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5873 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5878 # Read the libtool library.
5882 # If there is no directory component, then add one.
5884 */* | *\\*) . $file ;;
5888 # Skip this library if it cannot be dlopened.
5889 if test -z "$dlname"; then
5890 # Warn if it was a shared library.
5891 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5895 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5896 test "X$dir" = "X$file" && dir=.
5898 if test -f "$dir/$objdir/$dlname"; then
5901 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5907 # Just add the directory containing the .lo file.
5908 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5909 test "X$dir" = "X$file" && dir=.
5913 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5918 # Get the absolute pathname.
5919 absdir=`cd "$dir" && pwd`
5920 test -n "$absdir" && dir="$absdir"
5922 # Now add the directory to shlibpath_var.
5923 if eval "test -z \"\$$shlibpath_var\""; then
5924 eval "$shlibpath_var=\"\$dir\""
5926 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5930 # This variable tells wrapper scripts just to set shlibpath_var
5931 # rather than running their programs.
5932 libtool_execute_magic="$magic"
5934 # Check if any of the arguments is a wrapper script.
5941 # Do a test to see if this is really a libtool program.
5942 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5943 # If there is no directory component, then add one.
5945 */* | *\\*) . $file ;;
5949 # Transform arg to wrapped name.
5950 file="$progdir/$program"
5954 # Quote arguments (to preserve shell metacharacters).
5955 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5956 args="$args \"$file\""
5959 if test -z "$run"; then
5960 if test -n "$shlibpath_var"; then
5961 # Export the shlibpath_var.
5962 eval "export $shlibpath_var"
5965 # Restore saved environment variables
5966 if test "${save_LC_ALL+set}" = set; then
5967 LC_ALL="$save_LC_ALL"; export LC_ALL
5969 if test "${save_LANG+set}" = set; then
5970 LANG="$save_LANG"; export LANG
5973 # Now prepare to actually exec the command.
5974 exec_cmd="\$cmd$args"
5976 # Display what would be done.
5977 if test -n "$shlibpath_var"; then
5978 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5979 $echo "export $shlibpath_var"
5986 # libtool clean and uninstall mode
5988 modename="$modename: $mode"
5994 # This variable tells wrapper scripts just to set variables rather
5995 # than running their programs.
5996 libtool_install_magic="$magic"
6001 -f) rm="$rm $arg"; rmforce=yes ;;
6002 -*) rm="$rm $arg" ;;
6003 *) files="$files $arg" ;;
6007 if test -z "$rm"; then
6008 $echo "$modename: you must specify an RM program" 1>&2
6015 origobjdir="$objdir"
6016 for file in $files; do
6017 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6018 if test "X$dir" = "X$file"; then
6020 objdir="$origobjdir"
6022 objdir="$dir/$origobjdir"
6024 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6025 test "$mode" = uninstall && objdir="$dir"
6027 # Remember objdir for removal later, being careful to avoid duplicates
6028 if test "$mode" = clean; then
6031 *) rmdirs="$rmdirs $objdir" ;;
6035 # Don't error if the file doesn't exist and rm -f was used.
6036 if (test -L "$file") >/dev/null 2>&1 \
6037 || (test -h "$file") >/dev/null 2>&1 \
6038 || test -f "$file"; then
6040 elif test -d "$file"; then
6043 elif test "$rmforce" = yes; then
6051 # Possibly a libtool archive, so verify it.
6052 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6055 # Delete the libtool libraries and symlinks.
6056 for n in $library_names; do
6057 rmfiles="$rmfiles $objdir/$n"
6059 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6060 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6062 if test "$mode" = uninstall; then
6063 if test -n "$library_names"; then
6064 # Do each command in the postuninstall commands.
6065 eval cmds=\"$postuninstall_cmds\"
6066 save_ifs="$IFS"; IFS='~'
6067 for cmd in $cmds; do
6071 if test "$?" -ne 0 && test "$rmforce" != yes; then
6078 if test -n "$old_library"; then
6079 # Do each command in the old_postuninstall commands.
6080 eval cmds=\"$old_postuninstall_cmds\"
6081 save_ifs="$IFS"; IFS='~'
6082 for cmd in $cmds; do
6086 if test "$?" -ne 0 && test "$rmforce" != yes; then
6092 # FIXME: should reinstall the best remaining shared library.
6098 # Possibly a libtool object, so verify it.
6099 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6104 # Add PIC object to the list of files to remove.
6105 if test -n "$pic_object" \
6106 && test "$pic_object" != none; then
6107 rmfiles="$rmfiles $dir/$pic_object"
6110 # Add non-PIC object to the list of files to remove.
6111 if test -n "$non_pic_object" \
6112 && test "$non_pic_object" != none; then
6113 rmfiles="$rmfiles $dir/$non_pic_object"
6119 if test "$mode" = clean ; then
6123 file=`$echo $file|${SED} 's,.exe$,,'`
6124 noexename=`$echo $name|${SED} 's,.exe$,,'`
6125 # $file with .exe has already been added to rmfiles,
6126 # add $file without .exe
6127 rmfiles="$rmfiles $file"
6130 # Do a test to see if this is a libtool program.
6131 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6135 # note $name still contains .exe if it was in $file originally
6136 # as does the version of $file that was added into $rmfiles
6137 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6138 if test "$fast_install" = yes && test -n "$relink_command"; then
6139 rmfiles="$rmfiles $objdir/lt-$name"
6141 if test "X$noexename" != "X$name" ; then
6142 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6148 $show "$rm $rmfiles"
6149 $run $rm $rmfiles || exit_status=1
6151 objdir="$origobjdir"
6153 # Try to remove the ${objdir}s in the directories where we deleted files
6154 for dir in $rmdirs; do
6155 if test -d "$dir"; then
6157 $run rmdir $dir >/dev/null 2>&1
6165 $echo "$modename: you must specify a MODE" 1>&2
6166 $echo "$generic_help" 1>&2
6171 if test -z "$exec_cmd"; then
6172 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6173 $echo "$generic_help" 1>&2
6176 fi # test -z "$show_help"
6178 if test -n "$exec_cmd"; then
6183 # We need to display help for each of the modes.
6186 "Usage: $modename [OPTION]... [MODE-ARG]...
6188 Provide generalized library-building support services.
6190 --config show all configuration variables
6191 --debug enable verbose shell tracing
6192 -n, --dry-run display commands without modifying any files
6193 --features display basic configuration information and exit
6194 --finish same as \`--mode=finish'
6195 --help display this help message and exit
6196 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6197 --quiet same as \`--silent'
6198 --silent don't print informational messages
6199 --tag=TAG use configuration variables from tag TAG
6200 --version print version information
6202 MODE must be one of the following:
6204 clean remove files from the build directory
6205 compile compile a source file into a libtool object
6206 execute automatically set library path, then run a program
6207 finish complete the installation of libtool libraries
6208 install install libraries or executables
6209 link create a library or an executable
6210 uninstall remove libraries from an installed directory
6212 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6213 a more detailed description of MODE.
6215 Report bugs to <bug-libtool@gnu.org>."
6221 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6223 Remove files from the build directory.
6225 RM is the name of the program to use to delete files associated with each FILE
6226 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6229 If FILE is a libtool library, object or program, all the files associated
6230 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6235 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6237 Compile a source file into a libtool library object.
6239 This mode accepts the following additional options:
6241 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6242 -prefer-pic try to building PIC objects only
6243 -prefer-non-pic try to building non-PIC objects only
6244 -static always build a \`.o' file suitable for static linking
6246 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6247 from the given SOURCEFILE.
6249 The output file name is determined by removing the directory component from
6250 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6251 library object suffix, \`.lo'."
6256 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6258 Automatically set library path, then run a program.
6260 This mode accepts the following additional options:
6262 -dlopen FILE add the directory containing FILE to the library path
6264 This mode sets the library path environment variable according to \`-dlopen'
6267 If any of the ARGS are libtool executable wrappers, then they are translated
6268 into their corresponding uninstalled binary, and any of their required library
6269 directories are added to the library path.
6271 Then, COMMAND is executed, with ARGS as arguments."
6276 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6278 Complete the installation of libtool libraries.
6280 Each LIBDIR is a directory that contains libtool libraries.
6282 The commands that this mode executes may require superuser privileges. Use
6283 the \`--dry-run' option if you just want to see what would be executed."
6288 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6290 Install executables or libraries.
6292 INSTALL-COMMAND is the installation command. The first component should be
6293 either the \`install' or \`cp' program.
6295 The rest of the components are interpreted as arguments to that command (only
6296 BSD-compatible install options are recognized)."
6301 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6303 Link object files or libraries together to form another library, or to
6304 create an executable program.
6306 LINK-COMMAND is a command using the C compiler that you would use to create
6307 a program from several object files.
6309 The following components of LINK-COMMAND are treated specially:
6311 -all-static do not do any dynamic linking at all
6312 -avoid-version do not add a version suffix if possible
6313 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6314 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6315 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6316 -export-symbols SYMFILE
6317 try to export only the symbols listed in SYMFILE
6318 -export-symbols-regex REGEX
6319 try to export only the symbols matching REGEX
6320 -LLIBDIR search LIBDIR for required installed libraries
6321 -lNAME OUTPUT-FILE requires the installed library libNAME
6322 -module build a library that can dlopened
6323 -no-fast-install disable the fast-install mode
6324 -no-install link a not-installable executable
6325 -no-undefined declare that a library does not refer to external symbols
6326 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6327 -objectlist FILE Use a list of object files found in FILE to specify objects
6328 -release RELEASE specify package release information
6329 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6330 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6331 -static do not do any dynamic linking of libtool libraries
6332 -version-info CURRENT[:REVISION[:AGE]]
6333 specify library version info [each variable defaults to 0]
6335 All other options (arguments beginning with \`-') are ignored.
6337 Every other argument is treated as a filename. Files ending in \`.la' are
6338 treated as uninstalled libtool libraries, other files are standard or library
6341 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6342 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6343 required, except when creating a convenience library.
6345 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6346 using \`ar' and \`ranlib', or on Windows using \`lib'.
6348 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6349 is created, otherwise an executable program is created."
6354 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6356 Remove libraries from an installation directory.
6358 RM is the name of the program to use to delete files associated with each FILE
6359 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6362 If FILE is a libtool library, all the files associated with it are deleted.
6363 Otherwise, only FILE itself is deleted using RM."
6367 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6374 $echo "Try \`$modename --help' for more information about other modes."
6378 # The TAGs below are defined such that we never get into a situation
6379 # in which we disable both kinds of libraries. Given conflicting
6380 # choices, we go for a static library, that is the most portable,
6381 # since we can't tell whether shared libraries were disabled because
6382 # the user asked for that or because the platform doesn't support
6383 # them. This is particularly important on AIX, because we don't
6384 # support having both static and shared libraries enabled at the same
6385 # time on that platform, so we default to a shared-only configuration.
6386 # If a disable-shared tag is given, we'll fallback to a static-only
6387 # configuration. But we'll never go from static-only to shared-only.
6389 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6390 build_libtool_libs=no
6392 # ### END LIBTOOL TAG CONFIG: disable-shared
6394 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6395 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6396 # ### END LIBTOOL TAG CONFIG: disable-static