1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # The name of this program.
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
59 TIMESTAMP=" (1.1220 2003/04/05 19:32:58)"
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|od -x` in
74 *[Cc]1*) # 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
409 build_libtool_libs=no
424 arg_mode=arg # the next one goes into the "base_compile" arg list
425 continue # The current "srcfile" will either be retained or
426 ;; # replaced later. I would guess that would be a bug.
429 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
431 save_ifs="$IFS"; IFS=','
435 # Double-quote args containing other shell metacharacters.
436 # Many Bourne shells cannot handle close brackets correctly
437 # in scan sets, so we specify it separately.
439 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
443 lastarg="$lastarg $arg"
446 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
448 # Add the arguments to base_compile.
449 base_compile="$base_compile $lastarg"
454 # Accept the current argument as the source file.
455 # The previous "srcfile" becomes the current argument.
462 esac # case $arg_mode
464 # Aesthetically quote the previous argument.
465 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
468 # Double-quote args containing other shell metacharacters.
469 # Many Bourne shells cannot handle close brackets correctly
470 # in scan sets, so we specify it separately.
471 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
472 lastarg="\"$lastarg\""
476 base_compile="$base_compile $lastarg"
481 $echo "$modename: you must specify an argument for -Xcompile"
485 $echo "$modename: you must specify a target with \`-o'" 1>&2
489 # Get the name of the library object.
490 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
494 # Recognize several different file suffixes.
495 # If the user specifies -o file.o, it is replaced with file.lo
505 *.class) xform=class ;;
510 *.java) xform=java ;;
513 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
516 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
518 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
523 # Infer tagged configuration to use if any are available and
524 # if one wasn't chosen via the "--tag" command line option.
525 # Only attempt this if the compiler in the base compile
526 # command doesn't match the default compiler.
527 if test -n "$available_tags" && test -z "$tagname"; then
528 case $base_compile in
529 # Blanks in the command may have been stripped by the calling shell,
530 # but not from the CC environment variable when configure was run.
531 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
532 # Blanks at the start of $base_compile will cause this to fail
533 # if we don't check for them as well.
535 for z in $available_tags; do
536 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
537 # Evaluate the configuration.
538 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
539 case "$base_compile " in
540 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
541 # The compiler in the base compile command matches
542 # the one in the tagged configuration.
543 # Assume this is the tagged configuration we want.
550 # If $tagname still isn't set, then no tagged configuration
551 # was found and let the user know that the "--tag" command
552 # line option must be used.
553 if test -z "$tagname"; then
554 $echo "$modename: unable to infer tagged configuration"
555 $echo "$modename: specify a tag with \`--tag'" 1>&2
558 # $echo "$modename: using $tagname tagged configuration"
564 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
565 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
566 if test "X$xdir" = "X$obj"; then
571 lobj=${xdir}$objdir/$objname
573 if test -z "$base_compile"; then
574 $echo "$modename: you must specify a compilation command" 1>&2
579 # Delete any leftover library objects.
580 if test "$build_old_libs" = yes; then
581 removelist="$obj $lobj $libobj ${libobj}T"
583 removelist="$lobj $libobj ${libobj}T"
587 trap "$run $rm $removelist; exit 1" 1 2 15
589 # On Cygwin there's no "real" PIC flag so we must build both object types
591 cygwin* | mingw* | pw32* | os2*)
595 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
596 # non-PIC code in shared libraries is not supported
600 # Calculate the filename of the output object if compiler does
601 # not support -o with -c
602 if test "$compiler_c_o" = no; then
603 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
604 lockfile="$output_obj.lock"
605 removelist="$removelist $output_obj $lockfile"
606 trap "$run $rm $removelist; exit 1" 1 2 15
613 # Lock this critical section if it is needed
614 # We use this script file to make the link, it avoids creating a new file
615 if test "$need_locks" = yes; then
616 until $run ln "$0" "$lockfile" 2>/dev/null; do
617 $show "Waiting for $lockfile to be removed"
620 elif test "$need_locks" = warn; then
621 if test -f "$lockfile"; then
623 *** ERROR, $lockfile exists and contains:
624 `cat $lockfile 2>/dev/null`
626 This indicates that another process is trying to use the same
627 temporary object file, and libtool could not work around it because
628 your compiler does not support \`-c' and \`-o' together. If you
629 repeat this compilation, it may succeed, by chance, but you had better
630 avoid parallel builds (make -j) in this platform, or get a better
636 $echo $srcfile > "$lockfile"
639 if test -n "$fix_srcfile_path"; then
640 eval srcfile=\"$fix_srcfile_path\"
643 $run $rm "$libobj" "${libobj}T"
645 # Create a libtool object file (analogous to a ".la" file),
646 # but don't create it if we're doing a dry run.
647 test -z "$run" && cat > ${libobj}T <<EOF
648 # $libobj - a libtool object file
649 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
651 # Please DO NOT delete this file!
652 # It is necessary for linking the library.
654 # Name of the PIC object.
657 # Only build a PIC object if we are building libtool libraries.
658 if test "$build_libtool_libs" = yes; then
659 # Without this assignment, base_compile gets emptied.
660 fbsd_hideous_sh_bug=$base_compile
662 if test "$pic_mode" != no; then
663 command="$base_compile $srcfile $pic_flag"
665 # Don't build PIC code
666 command="$base_compile $srcfile"
669 if test ! -d "${xdir}$objdir"; then
670 $show "$mkdir ${xdir}$objdir"
671 $run $mkdir ${xdir}$objdir
673 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
678 if test -z "$output_obj"; then
679 # Place PIC objects in $objdir
680 command="$command -o $lobj"
683 $run $rm "$lobj" "$output_obj"
686 if $run eval "$command"; then :
688 test -n "$output_obj" && $run $rm $removelist
692 if test "$need_locks" = warn &&
693 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
695 *** ERROR, $lockfile contains:
696 `cat $lockfile 2>/dev/null`
698 but it should contain:
701 This indicates that another process is trying to use the same
702 temporary object file, and libtool could not work around it because
703 your compiler does not support \`-c' and \`-o' together. If you
704 repeat this compilation, it may succeed, by chance, but you had better
705 avoid parallel builds (make -j) in this platform, or get a better
712 # Just move the object if needed, then go on to compile the next one
713 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
714 $show "$mv $output_obj $lobj"
715 if $run $mv $output_obj $lobj; then :
723 # Append the name of the PIC object to the libtool object file.
724 test -z "$run" && cat >> ${libobj}T <<EOF
725 pic_object='$objdir/$objname'
729 # Allow error messages only from the first compilation.
730 suppress_output=' >/dev/null 2>&1'
732 # No PIC object so indicate it doesn't exist in the libtool
734 test -z "$run" && cat >> ${libobj}T <<EOF
740 # Only build a position-dependent object if we build old libraries.
741 if test "$build_old_libs" = yes; then
742 if test "$pic_mode" != yes; then
743 # Don't build PIC code
744 command="$base_compile $srcfile"
746 command="$base_compile $srcfile $pic_flag"
748 if test "$compiler_c_o" = yes; then
749 command="$command -o $obj"
752 # Suppress compiler output if we already did a PIC compilation.
753 command="$command$suppress_output"
754 $run $rm "$obj" "$output_obj"
756 if $run eval "$command"; then :
762 if test "$need_locks" = warn &&
763 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
765 *** ERROR, $lockfile contains:
766 `cat $lockfile 2>/dev/null`
768 but it should contain:
771 This indicates that another process is trying to use the same
772 temporary object file, and libtool could not work around it because
773 your compiler does not support \`-c' and \`-o' together. If you
774 repeat this compilation, it may succeed, by chance, but you had better
775 avoid parallel builds (make -j) in this platform, or get a better
782 # Just move the object if needed
783 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
784 $show "$mv $output_obj $obj"
785 if $run $mv $output_obj $obj; then :
793 # Append the name of the non-PIC object the libtool object file.
794 # Only append if the libtool object file exists.
795 test -z "$run" && cat >> ${libobj}T <<EOF
796 # Name of the non-PIC object.
797 non_pic_object='$objname'
801 # Append the name of the non-PIC object the libtool object file.
802 # Only append if the libtool object file exists.
803 test -z "$run" && cat >> ${libobj}T <<EOF
804 # Name of the non-PIC object.
810 $run $mv "${libobj}T" "${libobj}"
812 # Unlock the critical section if it was locked
813 if test "$need_locks" != no; then
822 modename="$modename: link"
824 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
825 # It is impossible to link a dll without this setting, and
826 # we shouldn't force the makefile maintainer to figure out
827 # which system we are compiling for in order to pass an extra
828 # flag for every libtool invocation.
831 # FIXME: Unfortunately, there are problems with the above when trying
832 # to make a dll which has undefined symbols, in which case not
833 # even a static library is built. For now, we need to specify
834 # -no-undefined on the libtool link line when we can be certain
835 # that all symbols are satisfied, otherwise we get a static library.
842 libtool_args="$nonopt"
843 base_compile="$nonopt"
844 compile_command="$nonopt"
845 finalize_command="$nonopt"
858 lib_search_path=`pwd`
867 export_symbols_regex=
875 prefer_static_libs=no
888 # We need to know -static, to get the right output filenames.
892 -all-static | -static)
893 if test "X$arg" = "X-all-static"; then
894 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
895 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
897 if test -n "$link_static_flag"; then
898 dlopen_self=$dlopen_self_static
901 if test -z "$pic_flag" && test -n "$link_static_flag"; then
902 dlopen_self=$dlopen_self_static
905 build_libtool_libs=no
907 prefer_static_libs=yes
913 # See if our shared archives depend on static archives.
914 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
916 # Go through the arguments, transforming them on the way.
917 while test "$#" -gt 0; do
919 base_compile="$base_compile $arg"
922 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
923 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
927 libtool_args="$libtool_args $qarg"
929 # If the previous option needs an argument, assign it.
930 if test -n "$prev"; then
933 compile_command="$compile_command @OUTPUT@"
934 finalize_command="$finalize_command @OUTPUT@"
940 if test "$preload" = no; then
941 # Add the symbol object into the linking commands.
942 compile_command="$compile_command @SYMFILE@"
943 finalize_command="$finalize_command @SYMFILE@"
947 *.la | *.lo) ;; # We handle these cases below.
949 if test "$dlself" = no; then
957 if test "$prev" = dlprefiles; then
959 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
969 if test "$prev" = dlfiles; then
970 dlfiles="$dlfiles $arg"
972 dlprefiles="$dlprefiles $arg"
980 export_symbols="$arg"
981 if test ! -f "$arg"; then
982 $echo "$modename: symbol file \`$arg' does not exist"
989 export_symbols_regex="$arg"
994 inst_prefix_dir="$arg"
1004 if test -f "$arg"; then
1007 for fil in `cat $save_arg`
1009 # moreargs="$moreargs $fil"
1011 # A libtool-controlled object.
1013 # Check to see that this really is a libtool object.
1014 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1019 # If there is no directory component, then add one.
1021 */* | *\\*) . $arg ;;
1025 if test -z "$pic_object" || \
1026 test -z "$non_pic_object" ||
1027 test "$pic_object" = none && \
1028 test "$non_pic_object" = none; then
1029 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1033 # Extract subdirectory from the argument.
1034 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1035 if test "X$xdir" = "X$arg"; then
1041 if test "$pic_object" != none; then
1042 # Prepend the subdirectory the object is found in.
1043 pic_object="$xdir$pic_object"
1045 if test "$prev" = dlfiles; then
1046 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1047 dlfiles="$dlfiles $pic_object"
1051 # If libtool objects are unsupported, then we need to preload.
1056 # CHECK ME: I think I busted this. -Ossama
1057 if test "$prev" = dlprefiles; then
1058 # Preload the old-style object.
1059 dlprefiles="$dlprefiles $pic_object"
1064 libobjs="$libobjs $pic_object"
1069 if test "$non_pic_object" != none; then
1070 # Prepend the subdirectory the object is found in.
1071 non_pic_object="$xdir$non_pic_object"
1073 # A standard non-PIC object
1074 non_pic_objects="$non_pic_objects $non_pic_object"
1075 if test -z "$pic_object" || test "$pic_object" = none ; then
1076 arg="$non_pic_object"
1080 # Only an error if not doing a dry-run.
1081 if test -z "$run"; then
1082 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1087 # Extract subdirectory from the argument.
1088 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1089 if test "X$xdir" = "X$arg"; then
1095 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1096 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1097 libobjs="$libobjs $pic_object"
1098 non_pic_objects="$non_pic_objects $non_pic_object"
1103 $echo "$modename: link input file \`$save_arg' does not exist"
1111 # We need an absolute path.
1113 [\\/]* | [A-Za-z]:[\\/]*) ;;
1115 $echo "$modename: only absolute run-paths are allowed" 1>&2
1119 if test "$prev" = rpath; then
1122 *) rpath="$rpath $arg" ;;
1127 *) xrpath="$xrpath $arg" ;;
1134 compiler_flags="$compiler_flags $qarg"
1136 compile_command="$compile_command $qarg"
1137 finalize_command="$finalize_command $qarg"
1141 linker_flags="$linker_flags $qarg"
1142 compiler_flags="$compiler_flags $wl$qarg"
1144 compile_command="$compile_command $wl$qarg"
1145 finalize_command="$finalize_command $wl$qarg"
1149 linker_flags="$linker_flags $qarg"
1150 compiler_flags="$compiler_flags $qarg"
1152 compile_command="$compile_command $qarg"
1153 finalize_command="$finalize_command $qarg"
1157 eval "$prev=\"\$arg\""
1162 fi # test -n "$prev"
1168 if test -n "$link_static_flag"; then
1169 compile_command="$compile_command $link_static_flag"
1170 finalize_command="$finalize_command $link_static_flag"
1176 # FIXME: remove this flag sometime in the future.
1177 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1201 -export-symbols | -export-symbols-regex)
1202 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1203 $echo "$modename: more than one -exported-symbols argument is not allowed"
1206 if test "X$arg" = "X-export-symbols"; then
1219 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1220 # so, if we see these flags be careful not to treat them like -L
1222 case $with_gcc/$host in
1223 no/*-*-irix* | /*-*-irix*)
1224 compile_command="$compile_command $arg"
1225 finalize_command="$finalize_command $arg"
1232 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1233 # We need an absolute path.
1235 [\\/]* | [A-Za-z]:[\\/]*) ;;
1237 absdir=`cd "$dir" && pwd`
1238 if test -z "$absdir"; then
1239 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1248 deplibs="$deplibs -L$dir"
1249 lib_search_path="$lib_search_path $dir"
1253 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1254 case :$dllsearchpath: in
1256 *) dllsearchpath="$dllsearchpath:$dir";;
1264 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1266 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1267 # These systems don't actually have a C or math library (as such)
1270 *-*-mingw* | *-*-os2*)
1271 # These systems don't actually have a C library (as such)
1272 test "X$arg" = "X-lc" && continue
1274 *-*-openbsd* | *-*-freebsd*)
1275 # Do not include libc due to us having libc/libc_r.
1276 test "X$arg" = "X-lc" && continue
1278 *-*-rhapsody* | *-*-darwin1.[012])
1279 # Rhapsody C and math libraries are in the System framework
1280 deplibs="$deplibs -framework System"
1283 elif test "X$arg" = "X-lc_r"; then
1285 *-*-openbsd* | *-*-freebsd*)
1286 # Do not include libc_r directly, use -pthread flag.
1291 deplibs="$deplibs $arg"
1300 # gcc -m* arguments should be passed to the linker via $compiler_flags
1301 # in order to pass architecture information to the linker
1302 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1303 # but this is not reliable with gcc because gcc may use -mfoo to
1304 # select a different linker, different libraries, etc, while
1305 # -Wl,-mfoo simply passes -mfoo to the linker.
1307 # Unknown arguments in both finalize_command and compile_command need
1308 # to be aesthetically quoted because they are evaled later.
1309 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1311 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1315 compile_command="$compile_command $arg"
1316 finalize_command="$finalize_command $arg"
1317 if test "$with_gcc" = "yes" ; then
1318 compiler_flags="$compiler_flags $arg"
1335 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1336 # The PATH hackery in wrapper scripts is required on Windows
1337 # in order for the loader to find any dlls it needs.
1338 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1339 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1342 *) no_install=yes ;;
1375 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1376 # We need an absolute path.
1378 [\\/]* | [A-Za-z]:[\\/]*) ;;
1380 $echo "$modename: only absolute run-paths are allowed" 1>&2
1386 *) xrpath="$xrpath $dir" ;;
1392 # The effects of -static are defined in a previous loop.
1393 # We used to do the same as -all-static on platforms that
1394 # didn't have a PIC flag, but the assumption that the effects
1395 # would be equivalent was wrong. It would break on at least
1396 # Digital Unix and AIX.
1416 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1418 save_ifs="$IFS"; IFS=','
1419 for flag in $args; do
1422 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1427 compiler_flags="$compiler_flags $flag"
1430 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1434 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1436 save_ifs="$IFS"; IFS=','
1437 for flag in $args; do
1440 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1445 compiler_flags="$compiler_flags $wl$flag"
1446 linker_flags="$linker_flags $flag"
1449 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1467 # Some other compiler flag.
1469 # Unknown arguments in both finalize_command and compile_command need
1470 # to be aesthetically quoted because they are evaled later.
1471 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1473 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1480 # A standard object.
1485 # A libtool-controlled object.
1487 # Check to see that this really is a libtool object.
1488 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1493 # If there is no directory component, then add one.
1495 */* | *\\*) . $arg ;;
1499 if test -z "$pic_object" || \
1500 test -z "$non_pic_object" ||
1501 test "$pic_object" = none && \
1502 test "$non_pic_object" = none; then
1503 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1507 # Extract subdirectory from the argument.
1508 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1509 if test "X$xdir" = "X$arg"; then
1515 if test "$pic_object" != none; then
1516 # Prepend the subdirectory the object is found in.
1517 pic_object="$xdir$pic_object"
1519 if test "$prev" = dlfiles; then
1520 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1521 dlfiles="$dlfiles $pic_object"
1525 # If libtool objects are unsupported, then we need to preload.
1530 # CHECK ME: I think I busted this. -Ossama
1531 if test "$prev" = dlprefiles; then
1532 # Preload the old-style object.
1533 dlprefiles="$dlprefiles $pic_object"
1538 libobjs="$libobjs $pic_object"
1543 if test "$non_pic_object" != none; then
1544 # Prepend the subdirectory the object is found in.
1545 non_pic_object="$xdir$non_pic_object"
1547 # A standard non-PIC object
1548 non_pic_objects="$non_pic_objects $non_pic_object"
1549 if test -z "$pic_object" || test "$pic_object" = none ; then
1550 arg="$non_pic_object"
1554 # Only an error if not doing a dry-run.
1555 if test -z "$run"; then
1556 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1561 # Extract subdirectory from the argument.
1562 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1563 if test "X$xdir" = "X$arg"; then
1569 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1570 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1571 libobjs="$libobjs $pic_object"
1572 non_pic_objects="$non_pic_objects $non_pic_object"
1579 deplibs="$deplibs $arg"
1580 old_deplibs="$old_deplibs $arg"
1585 # A libtool-controlled library.
1587 if test "$prev" = dlfiles; then
1588 # This library was specified with -dlopen.
1589 dlfiles="$dlfiles $arg"
1591 elif test "$prev" = dlprefiles; then
1592 # The library was specified with -dlpreopen.
1593 dlprefiles="$dlprefiles $arg"
1596 deplibs="$deplibs $arg"
1601 # Some other compiler argument.
1603 # Unknown arguments in both finalize_command and compile_command need
1604 # to be aesthetically quoted because they are evaled later.
1605 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1607 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1614 # Now actually substitute the argument into the commands.
1615 if test -n "$arg"; then
1616 compile_command="$compile_command $arg"
1617 finalize_command="$finalize_command $arg"
1619 done # argument parsing loop
1621 if test -n "$prev"; then
1622 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1627 # Infer tagged configuration to use if any are available and
1628 # if one wasn't chosen via the "--tag" command line option.
1629 # Only attempt this if the compiler in the base link
1630 # command doesn't match the default compiler.
1631 if test -n "$available_tags" && test -z "$tagname"; then
1632 case $base_compile in
1633 # Blanks in the command may have been stripped by the calling shell,
1634 # but not from the CC environment variable when configure was run.
1635 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1636 # Blanks at the start of $base_compile will cause this to fail
1637 # if we don't check for them as well.
1639 for z in $available_tags; do
1640 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1641 # Evaluate the configuration.
1642 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1643 case $base_compile in
1644 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1645 # The compiler in $compile_command matches
1646 # the one in the tagged configuration.
1647 # Assume this is the tagged configuration we want.
1654 # If $tagname still isn't set, then no tagged configuration
1655 # was found and let the user know that the "--tag" command
1656 # line option must be used.
1657 if test -z "$tagname"; then
1658 $echo "$modename: unable to infer tagged configuration"
1659 $echo "$modename: specify a tag with \`--tag'" 1>&2
1662 # $echo "$modename: using $tagname tagged configuration"
1668 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1669 eval arg=\"$export_dynamic_flag_spec\"
1670 compile_command="$compile_command $arg"
1671 finalize_command="$finalize_command $arg"
1675 # calculate the name of the file, without its directory
1676 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1677 libobjs_save="$libobjs"
1679 if test -n "$shlibpath_var"; then
1680 # get the directories listed in $shlibpath_var
1681 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1685 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1686 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1688 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1689 if test "X$output_objdir" = "X$output"; then
1690 output_objdir="$objdir"
1692 output_objdir="$output_objdir/$objdir"
1694 # Create the object directory.
1695 if test ! -d "$output_objdir"; then
1696 $show "$mkdir $output_objdir"
1697 $run $mkdir $output_objdir
1699 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1704 # Determine the type of output
1707 $echo "$modename: you must specify an output file" 1>&2
1711 *.$libext) linkmode=oldlib ;;
1712 *.lo | *.$objext) linkmode=obj ;;
1713 *.la) linkmode=lib ;;
1714 *) linkmode=prog ;; # Anything else should be a program.
1718 *cygwin* | *mingw* | *pw32*)
1719 # don't eliminate duplcations in $postdeps and $predeps
1720 duplicate_compiler_generated_deps=yes
1723 duplicate_compiler_generated_deps=$duplicate_deps
1729 # Find all interdependent deplibs by searching for libraries
1730 # that are linked more than once (e.g. -la -lb -la)
1731 for deplib in $deplibs; do
1732 if test "X$duplicate_deps" = "Xyes" ; then
1734 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1737 libs="$libs $deplib"
1740 if test "$linkmode" = lib; then
1741 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1743 # Compute libraries that are listed more than once in $predeps
1744 # $postdeps and mark them as special (i.e., whose duplicates are
1745 # not to be eliminated).
1747 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1748 for pre_post_dep in $predeps $postdeps; do
1749 case "$pre_post_deps " in
1750 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1752 pre_post_deps="$pre_post_deps $pre_post_dep"
1761 need_relink=no # whether we're linking any uninstalled libtool libraries
1762 notinst_deplibs= # not-installed libtool libraries
1763 notinst_path= # paths that contain not-installed libtool libraries
1767 for file in $dlfiles $dlprefiles; do
1771 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1783 passes="conv scan dlopen dlpreopen link"
1788 for pass in $passes; do
1789 if test "$linkmode,$pass" = "lib,link" ||
1790 test "$linkmode,$pass" = "prog,scan"; then
1794 if test "$linkmode" = prog; then
1796 dlopen) libs="$dlfiles" ;;
1797 dlpreopen) libs="$dlprefiles" ;;
1798 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1801 if test "$pass" = dlopen; then
1802 # Collect dlpreopened libraries
1803 save_deplibs="$deplibs"
1806 for deplib in $libs; do
1811 if test "$linkmode" != lib && test "$linkmode" != prog; then
1812 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1815 if test "$pass" = conv; then
1816 deplibs="$deplib $deplibs"
1819 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1820 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1821 # Search the libtool library
1822 lib="$searchdir/lib${name}.la"
1823 if test -f "$lib"; then
1828 if test "$found" != yes; then
1829 # deplib doesn't seem to be a libtool library
1830 if test "$linkmode,$pass" = "prog,link"; then
1831 compile_deplibs="$deplib $compile_deplibs"
1832 finalize_deplibs="$deplib $finalize_deplibs"
1834 deplibs="$deplib $deplibs"
1835 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1838 else # deplib is a libtool library
1839 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1840 # We need to do some special things here, and not later.
1841 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1842 case " $predeps $postdeps " in
1844 if (${SED} -e '2q' $lib |
1845 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1849 */* | *\\*) . $lib ;;
1852 for l in $old_library $library_names; do
1855 if test "X$ll" = "X$old_library" ; then # only static version available
1857 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1858 test "X$ladir" = "X$lib" && ladir="."
1859 lib=$ladir/$old_library
1860 if test "$linkmode,$pass" = "prog,link"; then
1861 compile_deplibs="$deplib $compile_deplibs"
1862 finalize_deplibs="$deplib $finalize_deplibs"
1864 deplibs="$deplib $deplibs"
1865 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1879 deplibs="$deplib $deplibs"
1880 test "$pass" = conv && continue
1881 newdependency_libs="$deplib $newdependency_libs"
1882 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1885 if test "$pass" = conv; then
1886 deplibs="$deplib $deplibs"
1889 if test "$pass" = scan; then
1890 deplibs="$deplib $deplibs"
1891 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1893 compile_deplibs="$deplib $compile_deplibs"
1894 finalize_deplibs="$deplib $finalize_deplibs"
1898 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1904 if test "$pass" = link; then
1905 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1906 # Make sure the xrpath contains only unique directories.
1909 *) xrpath="$xrpath $dir" ;;
1912 deplibs="$deplib $deplibs"
1915 *.la) lib="$deplib" ;;
1917 if test "$pass" = conv; then
1918 deplibs="$deplib $deplibs"
1923 if test "$deplibs_check_method" != pass_all; then
1925 $echo "*** Warning: Trying to link with static lib archive $deplib."
1926 $echo "*** I have the capability to make that library automatically link in when"
1927 $echo "*** you link to this library. But I can only do this if you have a"
1928 $echo "*** shared version of the library, which you do not appear to have"
1929 $echo "*** because the file extensions .$libext of this argument makes me believe"
1930 $echo "*** that it is just a static archive that I should not used here."
1933 $echo "*** Warning: Linking the shared library $output against the"
1934 $echo "*** static library $deplib is not portable!"
1935 deplibs="$deplib $deplibs"
1940 if test "$pass" != link; then
1941 deplibs="$deplib $deplibs"
1943 compile_deplibs="$deplib $compile_deplibs"
1944 finalize_deplibs="$deplib $finalize_deplibs"
1951 if test "$pass" = conv; then
1952 deplibs="$deplib $deplibs"
1953 elif test "$linkmode" = prog; then
1954 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1955 # If there is no dlopen support or we're linking statically,
1956 # we need to preload.
1957 newdlprefiles="$newdlprefiles $deplib"
1958 compile_deplibs="$deplib $compile_deplibs"
1959 finalize_deplibs="$deplib $finalize_deplibs"
1961 newdlfiles="$newdlfiles $deplib"
1971 if test "$found" = yes || test -f "$lib"; then :
1973 $echo "$modename: cannot find the library \`$lib'" 1>&2
1977 # Check to see that this really is a libtool archive.
1978 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1980 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1984 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1985 test "X$ladir" = "X$lib" && ladir="."
1993 # If the library was installed with an old release of libtool,
1994 # it will not redefine variables installed, or shouldnotlink
2000 */* | *\\*) . $lib ;;
2004 if test "$linkmode,$pass" = "lib,link" ||
2005 test "$linkmode,$pass" = "prog,scan" ||
2006 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2007 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2008 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2011 if test "$pass" = conv; then
2012 # Only check for convenience libraries
2013 deplibs="$lib $deplibs"
2014 if test -z "$libdir"; then
2015 if test -z "$old_library"; then
2016 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2019 # It is a libtool convenience library, so add in its objects.
2020 convenience="$convenience $ladir/$objdir/$old_library"
2021 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2023 for deplib in $dependency_libs; do
2024 deplibs="$deplib $deplibs"
2025 if test "X$duplicate_deps" = "Xyes" ; then
2026 case "$tmp_libs " in
2027 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2030 tmp_libs="$tmp_libs $deplib"
2032 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2033 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2040 # Get the name of the library we link against.
2042 for l in $old_library $library_names; do
2045 if test -z "$linklib"; then
2046 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2050 # This library was specified with -dlopen.
2051 if test "$pass" = dlopen; then
2052 if test -z "$libdir"; then
2053 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2056 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2057 # If there is no dlname, no dlopen support or we're linking
2058 # statically, we need to preload. We also need to preload any
2059 # dependent libraries so libltdl's deplib preloader doesn't
2060 # bomb out in the load deplibs phase.
2061 dlprefiles="$dlprefiles $lib $dependency_libs"
2063 newdlfiles="$newdlfiles $lib"
2068 # We need an absolute path.
2070 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2072 abs_ladir=`cd "$ladir" && pwd`
2073 if test -z "$abs_ladir"; then
2074 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2075 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2080 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2082 # Find the relevant object directory and library name.
2083 if test "X$installed" = Xyes; then
2084 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2085 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2094 dir="$ladir/$objdir"
2095 absdir="$abs_ladir/$objdir"
2096 # Remove this search path later
2097 notinst_path="$notinst_path $abs_ladir"
2098 fi # $installed = yes
2099 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2101 # This library was specified with -dlpreopen.
2102 if test "$pass" = dlpreopen; then
2103 if test -z "$libdir"; then
2104 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2107 # Prefer using a static library (so that no silly _DYNAMIC symbols
2108 # are required to link).
2109 if test -n "$old_library"; then
2110 newdlprefiles="$newdlprefiles $dir/$old_library"
2111 # Otherwise, use the dlname, so that lt_dlopen finds it.
2112 elif test -n "$dlname"; then
2113 newdlprefiles="$newdlprefiles $dir/$dlname"
2115 newdlprefiles="$newdlprefiles $dir/$linklib"
2117 fi # $pass = dlpreopen
2119 if test -z "$libdir"; then
2120 # Link the convenience library
2121 if test "$linkmode" = lib; then
2122 deplibs="$dir/$old_library $deplibs"
2123 elif test "$linkmode,$pass" = "prog,link"; then
2124 compile_deplibs="$dir/$old_library $compile_deplibs"
2125 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2127 deplibs="$lib $deplibs" # used for prog,scan pass
2133 if test "$linkmode" = prog && test "$pass" != link; then
2134 newlib_search_path="$newlib_search_path $ladir"
2135 deplibs="$lib $deplibs"
2138 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2139 test "$build_libtool_libs" = no; then
2144 for deplib in $dependency_libs; do
2146 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2148 # Need to link against all dependency_libs?
2149 if test "$linkalldeplibs" = yes; then
2150 deplibs="$deplib $deplibs"
2152 # Need to hardcode shared library paths
2153 # or/and link against static libraries
2154 newdependency_libs="$deplib $newdependency_libs"
2156 if test "X$duplicate_deps" = "Xyes" ; then
2157 case "$tmp_libs " in
2158 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2161 tmp_libs="$tmp_libs $deplib"
2164 fi # $linkmode = prog...
2166 if test "$linkmode,$pass" = "prog,link"; then
2167 if test -n "$library_names" &&
2168 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2169 # We need to hardcode the library path
2170 if test -n "$shlibpath_var"; then
2171 # Make sure the rpath contains only unique directories.
2172 case "$temp_rpath " in
2175 *) temp_rpath="$temp_rpath $dir" ;;
2179 # Hardcode the library path.
2180 # Skip directories that are in the system default run-time
2182 case " $sys_lib_dlsearch_path " in
2185 case "$compile_rpath " in
2187 *) compile_rpath="$compile_rpath $absdir"
2191 case " $sys_lib_dlsearch_path " in
2194 case "$finalize_rpath " in
2196 *) finalize_rpath="$finalize_rpath $libdir"
2200 fi # $linkmode,$pass = prog,link...
2202 if test "$alldeplibs" = yes &&
2203 { test "$deplibs_check_method" = pass_all ||
2204 { test "$build_libtool_libs" = yes &&
2205 test -n "$library_names"; }; }; then
2206 # We only need to search for static libraries
2211 link_static=no # Whether the deplib will be linked statically
2212 if test -n "$library_names" &&
2213 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2214 if test "$installed" = no; then
2215 notinst_deplibs="$notinst_deplibs $lib"
2218 # This is a shared library
2220 # Warn about portability, can't link against -module's on some systems (darwin)
2221 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2223 if test "$linkmode" = prog; then
2224 $echo "*** Warning: Linking the executable $output against the loadable module"
2226 $echo "*** Warning: Linking the shared library $output against the loadable module"
2228 $echo "*** $linklib is not portable!"
2230 if test "$linkmode" = lib &&
2231 test "$hardcode_into_libs" = yes; then
2232 # Hardcode the library path.
2233 # Skip directories that are in the system default run-time
2235 case " $sys_lib_dlsearch_path " in
2238 case "$compile_rpath " in
2240 *) compile_rpath="$compile_rpath $absdir"
2244 case " $sys_lib_dlsearch_path " in
2247 case "$finalize_rpath " in
2249 *) finalize_rpath="$finalize_rpath $libdir"
2255 if test -n "$old_archive_from_expsyms_cmds"; then
2256 # figure out the soname
2257 set dummy $library_names
2260 libname=`eval \\$echo \"$libname_spec\"`
2261 # use dlname if we got it. it's perfectly good, no?
2262 if test -n "$dlname"; then
2264 elif test -n "$soname_spec"; then
2268 major=`expr $current - $age`
2272 eval soname=\"$soname_spec\"
2277 # Make a new name for the extract_expsyms_cmds to use
2279 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2280 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2282 # If the library has no export list, then create one now
2283 if test -f "$output_objdir/$soname-def"; then :
2285 $show "extracting exported symbol list from \`$soname'"
2286 save_ifs="$IFS"; IFS='~'
2287 eval cmds=\"$extract_expsyms_cmds\"
2288 for cmd in $cmds; do
2291 $run eval "$cmd" || exit $?
2297 if test -f "$output_objdir/$newlib"; then :; else
2298 $show "generating import library for \`$soname'"
2299 save_ifs="$IFS"; IFS='~'
2300 eval cmds=\"$old_archive_from_expsyms_cmds\"
2301 for cmd in $cmds; do
2304 $run eval "$cmd" || exit $?
2308 # make sure the library variables are pointing to the new library
2311 fi # test -n "$old_archive_from_expsyms_cmds"
2313 if test "$linkmode" = prog || test "$mode" != relink; then
2318 case $hardcode_action in
2319 immediate | unsupported)
2320 if test "$hardcode_direct" = no; then
2323 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2325 # if the lib is a module then we can not link against it, someone
2326 # is ignoring the new warnings I added
2327 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2328 $echo "** Warning, lib $linklib is a module, not a shared library"
2329 if test -z "$old_library" ; then
2331 $echo "** And there doesn't seem to be a static archive available"
2332 $echo "** The link will probably fail, sorry"
2334 add="$dir/$old_library"
2338 elif test "$hardcode_minus_L" = no; then
2340 *-*-sunos*) add_shlibpath="$dir" ;;
2344 elif test "$hardcode_shlibpath_var" = no; then
2345 add_shlibpath="$dir"
2352 if test "$hardcode_direct" = yes; then
2354 elif test "$hardcode_minus_L" = yes; then
2356 # Try looking first in the location we're being installed to.
2357 if test -n "$inst_prefix_dir"; then
2360 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2365 elif test "$hardcode_shlibpath_var" = yes; then
2366 add_shlibpath="$dir"
2375 if test "$lib_linked" != yes; then
2376 $echo "$modename: configuration error: unsupported hardcode properties"
2380 if test -n "$add_shlibpath"; then
2381 case :$compile_shlibpath: in
2382 *":$add_shlibpath:"*) ;;
2383 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2386 if test "$linkmode" = prog; then
2387 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2388 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2390 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2391 test -n "$add" && deplibs="$add $deplibs"
2392 if test "$hardcode_direct" != yes && \
2393 test "$hardcode_minus_L" != yes && \
2394 test "$hardcode_shlibpath_var" = yes; then
2395 case :$finalize_shlibpath: in
2397 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2403 if test "$linkmode" = prog || test "$mode" = relink; then
2407 # Finalize command for both is simple: just hardcode it.
2408 if test "$hardcode_direct" = yes; then
2409 add="$libdir/$linklib"
2410 elif test "$hardcode_minus_L" = yes; then
2413 elif test "$hardcode_shlibpath_var" = yes; then
2414 case :$finalize_shlibpath: in
2416 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2419 elif test "$hardcode_automatic" = yes; then
2420 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2421 add="$inst_prefix_dir$libdir/$linklib"
2423 add="$libdir/$linklib"
2426 # We cannot seem to hardcode it, guess we'll fake it.
2428 # Try looking first in the location we're being installed to.
2429 if test -n "$inst_prefix_dir"; then
2432 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2439 if test "$linkmode" = prog; then
2440 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2441 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2443 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2444 test -n "$add" && deplibs="$add $deplibs"
2447 elif test "$linkmode" = prog; then
2448 # Here we assume that one of hardcode_direct or hardcode_minus_L
2449 # is not unsupported. This is valid on all known static and
2451 if test "$hardcode_direct" != unsupported; then
2452 test -n "$old_library" && linklib="$old_library"
2453 compile_deplibs="$dir/$linklib $compile_deplibs"
2454 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2456 compile_deplibs="-l$name -L$dir $compile_deplibs"
2457 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2459 elif test "$build_libtool_libs" = yes; then
2460 # Not a shared library
2461 if test "$deplibs_check_method" != pass_all; then
2462 # We're trying link a shared library against a static one
2463 # but the system doesn't support it.
2465 # Just print a warning and add the library to dependency_libs so
2466 # that the program can be linked against the static library.
2468 $echo "*** Warning: This system can not link to static lib archive $lib."
2469 $echo "*** I have the capability to make that library automatically link in when"
2470 $echo "*** you link to this library. But I can only do this if you have a"
2471 $echo "*** shared version of the library, which you do not appear to have."
2472 if test "$module" = yes; then
2473 $echo "*** But as you try to build a module library, libtool will still create "
2474 $echo "*** a static module, that should work as long as the dlopening application"
2475 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2476 if test -z "$global_symbol_pipe"; then
2478 $echo "*** However, this would only work if libtool was able to extract symbol"
2479 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2480 $echo "*** not find such a program. So, this module is probably useless."
2481 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2483 if test "$build_old_libs" = no; then
2484 build_libtool_libs=module
2487 build_libtool_libs=no
2491 convenience="$convenience $dir/$old_library"
2492 old_convenience="$old_convenience $dir/$old_library"
2493 deplibs="$dir/$old_library $deplibs"
2496 fi # link shared/static library?
2498 if test "$linkmode" = lib; then
2499 if test -n "$dependency_libs" &&
2500 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2501 test "$link_static" = yes; }; then
2502 # Extract -R from dependency_libs
2504 for libdir in $dependency_libs; do
2506 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2508 *" $temp_xrpath "*) ;;
2509 *) xrpath="$xrpath $temp_xrpath";;
2511 *) temp_deplibs="$temp_deplibs $libdir";;
2514 dependency_libs="$temp_deplibs"
2517 newlib_search_path="$newlib_search_path $absdir"
2518 # Link against this library
2519 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2520 # ... and its dependency_libs
2522 for deplib in $dependency_libs; do
2523 newdependency_libs="$deplib $newdependency_libs"
2524 if test "X$duplicate_deps" = "Xyes" ; then
2525 case "$tmp_libs " in
2526 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2529 tmp_libs="$tmp_libs $deplib"
2532 if test "$link_all_deplibs" != no; then
2533 # Add the search paths of all dependency libraries
2534 for deplib in $dependency_libs; do
2536 -L*) path="$deplib" ;;
2538 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2539 test "X$dir" = "X$deplib" && dir="."
2540 # We need an absolute path.
2542 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2544 absdir=`cd "$dir" && pwd`
2545 if test -z "$absdir"; then
2546 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2551 if grep "^installed=no" $deplib > /dev/null; then
2552 path="$absdir/$objdir"
2554 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2555 if test -z "$libdir"; then
2556 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2559 if test "$absdir" != "$libdir"; then
2560 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2567 # we do not want to link against static libs, but need to link against shared
2568 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2569 if test -n "$deplibrary_names" ; then
2570 for tmp in $deplibrary_names ; do
2573 if test -f "$path/$depdepl" ; then
2574 depdepl="$path/$depdepl"
2576 newlib_search_path="$newlib_search_path $path"
2589 # Again, we only want to link against shared libraries
2590 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2591 for tmp in $newlib_search_path ; do
2592 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2593 eval depdepl="$tmp/lib$tmp_libs.dylib"
2604 case " $deplibs " in
2606 *) deplibs="$deplibs $depdepl" ;;
2608 case " $deplibs " in
2610 *) deplibs="$deplibs $path" ;;
2613 fi # link_all_deplibs != no
2615 done # for deplib in $libs
2616 dependency_libs="$newdependency_libs"
2617 if test "$pass" = dlpreopen; then
2618 # Link the dlpreopened libraries before other libraries
2619 for deplib in $save_deplibs; do
2620 deplibs="$deplib $deplibs"
2623 if test "$pass" != dlopen; then
2624 if test "$pass" != conv; then
2625 # Make sure lib_search_path contains only unique directories.
2627 for dir in $newlib_search_path; do
2628 case "$lib_search_path " in
2630 *) lib_search_path="$lib_search_path $dir" ;;
2636 if test "$linkmode,$pass" != "prog,link"; then
2639 vars="compile_deplibs finalize_deplibs"
2641 for var in $vars dependency_libs; do
2642 # Add libraries to $var in reverse order
2643 eval tmp_libs=\"\$$var\"
2645 for deplib in $tmp_libs; do
2646 # FIXME: Pedantically, this is the right thing to do, so
2647 # that some nasty dependency loop isn't accidentally
2649 #new_libs="$deplib $new_libs"
2650 # Pragmatically, this seems to cause very few problems in
2653 -L*) new_libs="$deplib $new_libs" ;;
2656 # And here is the reason: when a library appears more
2657 # than once as an explicit dependence of a library, or
2658 # is implicitly linked in more than once by the
2659 # compiler, it is considered special, and multiple
2660 # occurrences thereof are not removed. Compare this
2661 # with having the same library being listed as a
2662 # dependency of multiple other libraries: in this case,
2663 # we know (pedantically, we assume) the library does not
2664 # need to be listed more than once, so we keep only the
2665 # last copy. This is not always right, but it is rare
2666 # enough that we require users that really mean to play
2667 # such unportable linking tricks to link the library
2668 # using -Wl,-lname, so that libtool does not consider it
2669 # for duplicate removal.
2670 case " $specialdeplibs " in
2671 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2673 case " $new_libs " in
2675 *) new_libs="$deplib $new_libs" ;;
2683 for deplib in $new_libs; do
2686 case " $tmp_libs " in
2688 *) tmp_libs="$tmp_libs $deplib" ;;
2691 *) tmp_libs="$tmp_libs $deplib" ;;
2694 eval $var=\"$tmp_libs\"
2697 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2699 for i in $dependency_libs ; do
2700 case " $predeps $postdeps $compiler_lib_search_path " in
2705 if test -n "$i" ; then
2706 tmp_libs="$tmp_libs $i"
2709 dependency_libs=$tmp_libs
2711 if test "$linkmode" = prog; then
2712 dlfiles="$newdlfiles"
2713 dlprefiles="$newdlprefiles"
2718 if test -n "$deplibs"; then
2719 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2722 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2723 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2726 if test -n "$rpath"; then
2727 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2730 if test -n "$xrpath"; then
2731 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2734 if test -n "$vinfo"; then
2735 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2738 if test -n "$release"; then
2739 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2742 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2743 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2746 # Now set the variables for building old libraries.
2747 build_libtool_libs=no
2749 objs="$objs$old_deplibs"
2753 # Make sure we only generate libraries of the form `libNAME.la'.
2756 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2757 eval shared_ext=\"$shrext\"
2758 eval libname=\"$libname_spec\"
2761 if test "$module" = no; then
2762 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2766 if test "$need_lib_prefix" != no; then
2767 # Add the "lib" prefix for modules if required
2768 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2769 eval shared_ext=\"$shrext\"
2770 eval libname=\"$libname_spec\"
2772 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2777 if test -n "$objs"; then
2778 if test "$deplibs_check_method" != pass_all; then
2779 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2783 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2784 $echo "*** objects $objs is not portable!"
2785 libobjs="$libobjs $objs"
2789 if test "$dlself" != no; then
2790 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2794 if test "$#" -gt 2; then
2795 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2800 if test -z "$rpath"; then
2801 if test "$build_libtool_libs" = yes; then
2802 # Building a libtool convenience library.
2803 # Some compilers have problems with a `.al' extension so
2804 # convenience libraries should have the same extension an
2805 # archive normally would.
2806 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2807 build_libtool_libs=convenience
2811 if test -n "$vinfo"; then
2812 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2815 if test -n "$release"; then
2816 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2820 # Parse the version information argument.
2821 save_ifs="$IFS"; IFS=':'
2822 set dummy $vinfo 0 0 0
2825 if test -n "$8"; then
2826 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2831 # convert absolute version numbers to libtool ages
2832 # this retains compatibility with .la files and attempts
2833 # to make the code below a bit more comprehensible
2835 case $vinfo_number in
2839 number_revision="$4"
2841 # There are really only two kinds -- those that
2842 # use the current revision as the major version
2843 # and those that subtract age and use age as
2844 # a minor version. But, then there is irix
2845 # which has an extra 1 added just for fun
2847 case $version_type in
2848 darwin|linux|osf|windows)
2849 current=`expr $number_major + $number_minor`
2851 revision="$number_revision"
2853 freebsd-aout|freebsd-elf|sunos)
2854 current="$number_major"
2855 revision="$number_minor"
2859 current=`expr $number_major + $number_minor - 1`
2861 revision="$number_minor"
2872 # Check that each of the things are valid numbers.
2874 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2876 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2877 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2883 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2885 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2886 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2892 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2894 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2895 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2900 if test "$age" -gt "$current"; then
2901 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2902 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2906 # Calculate the version variables.
2910 case $version_type in
2914 # Like Linux, but with the current version available in
2915 # verstring for coding it into the library header
2916 major=.`expr $current - $age`
2917 versuffix="$major.$age.$revision"
2918 # Darwin ld doesn't like 0 for these options...
2919 minor_current=`expr $current + 1`
2920 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2925 versuffix=".$current.$revision";
2930 versuffix=".$current";
2934 major=`expr $current - $age + 1`
2936 case $version_type in
2937 nonstopux) verstring_prefix=nonstopux ;;
2938 *) verstring_prefix=sgi ;;
2940 verstring="$verstring_prefix$major.$revision"
2942 # Add in all the interfaces that we are compatible with.
2944 while test "$loop" -ne 0; do
2945 iface=`expr $revision - $loop`
2946 loop=`expr $loop - 1`
2947 verstring="$verstring_prefix$major.$iface:$verstring"
2950 # Before this point, $major must not contain `.'.
2952 versuffix="$major.$revision"
2956 major=.`expr $current - $age`
2957 versuffix="$major.$age.$revision"
2961 major=.`expr $current - $age`
2962 versuffix=".$current.$age.$revision"
2963 verstring="$current.$age.$revision"
2965 # Add in all the interfaces that we are compatible with.
2967 while test "$loop" -ne 0; do
2968 iface=`expr $current - $loop`
2969 loop=`expr $loop - 1`
2970 verstring="$verstring:${iface}.0"
2973 # Make executables depend on our current version.
2974 verstring="$verstring:${current}.0"
2979 versuffix=".$current.$revision"
2983 # Use '-' rather than '.', since we only want one
2984 # extension on DOS 8.3 filesystems.
2985 major=`expr $current - $age`
2990 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2991 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2996 # Clear the version info if we defaulted, and they specified a release.
2997 if test -z "$vinfo" && test -n "$release"; then
2999 case $version_type in
3001 # we can't check for "0.0" in archive_cmds due to quoting
3002 # problems, so we reset it completely
3009 if test "$need_version" = no; then
3016 # Remove version info from name if versioning should be avoided
3017 if test "$avoid_version" = yes && test "$need_version" = no; then
3023 # Check to see if the archive will have undefined symbols.
3024 if test "$allow_undefined" = yes; then
3025 if test "$allow_undefined_flag" = unsupported; then
3026 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3027 build_libtool_libs=no
3031 # Don't allow undefined symbols.
3032 allow_undefined_flag="$no_undefined_flag"
3036 if test "$mode" != relink; then
3037 # Remove our outputs, but don't remove object files since they
3038 # may have been created when compiling PIC objects.
3040 tempremovelist=`$echo "$output_objdir/*"`
3041 for p in $tempremovelist; do
3045 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3046 removelist="$removelist $p"
3051 if test -n "$removelist"; then
3052 $show "${rm}r $removelist"
3053 $run ${rm}r $removelist
3057 # Now set the variables for building old libraries.
3058 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3059 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3061 # Transform .lo files to .o files.
3062 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3065 # Eliminate all temporary directories.
3066 for path in $notinst_path; do
3067 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3068 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3069 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3072 if test -n "$xrpath"; then
3073 # If the user specified any rpath flags, then add them.
3075 for libdir in $xrpath; do
3076 temp_xrpath="$temp_xrpath -R$libdir"
3077 case "$finalize_rpath " in
3079 *) finalize_rpath="$finalize_rpath $libdir" ;;
3082 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3083 dependency_libs="$temp_xrpath $dependency_libs"
3087 # Make sure dlfiles contains only unique files that won't be dlpreopened
3088 old_dlfiles="$dlfiles"
3090 for lib in $old_dlfiles; do
3091 case " $dlprefiles $dlfiles " in
3093 *) dlfiles="$dlfiles $lib" ;;
3097 # Make sure dlprefiles contains only unique files
3098 old_dlprefiles="$dlprefiles"
3100 for lib in $old_dlprefiles; do
3101 case "$dlprefiles " in
3103 *) dlprefiles="$dlprefiles $lib" ;;
3107 if test "$build_libtool_libs" = yes; then
3108 if test -n "$rpath"; then
3110 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3111 # these systems don't actually have a c library (as such)!
3113 *-*-rhapsody* | *-*-darwin1.[012])
3114 # Rhapsody C library is in the System framework
3115 deplibs="$deplibs -framework System"
3118 # Don't link with libc until the a.out ld.so is fixed.
3120 *-*-openbsd* | *-*-freebsd*)
3121 # Do not include libc due to us having libc/libc_r.
3122 test "X$arg" = "X-lc" && continue
3125 # Add libc to deplibs on all other systems if necessary.
3126 if test "$build_libtool_need_lc" = "yes"; then
3127 deplibs="$deplibs -lc"
3133 # Transform deplibs into only deplibs that can be linked in shared.
3135 libname_save=$libname
3136 release_save=$release
3137 versuffix_save=$versuffix
3139 # I'm not sure if I'm treating the release correctly. I think
3140 # release should show up in the -l (ie -lgmp5) so we don't want to
3141 # add it in twice. Is that correct?
3147 case $deplibs_check_method in
3149 # Don't check for shared/static. Everything works.
3150 # This might be a little naive. We might want to check
3151 # whether the library exists or not. But this is on
3152 # osf3 & osf4 and I'm not really sure... Just
3153 # implementing what was already the behavior.
3157 # This code stresses the "libraries are programs" paradigm to its
3158 # limits. Maybe even breaks it. We compile a program, linking it
3159 # against the deplibs as a proxy for the library. Then we can check
3160 # whether they linked in statically or dynamically with ldd.
3162 cat > conftest.c <<EOF
3163 int main() { return 0; }
3166 $LTCC -o conftest conftest.c $deplibs
3167 if test "$?" -eq 0 ; then
3168 ldd_output=`ldd conftest`
3169 for i in $deplibs; do
3170 name="`expr $i : '-l\(.*\)'`"
3171 # If $name is empty we are operating on a -L argument.
3172 if test "$name" != "" && test "$name" -ne "0"; then
3173 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3174 case " $predeps $postdeps " in
3176 newdeplibs="$newdeplibs $i"
3181 if test -n "$i" ; then
3182 libname=`eval \\$echo \"$libname_spec\"`
3183 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3184 set dummy $deplib_matches
3186 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3187 newdeplibs="$newdeplibs $i"
3191 $echo "*** Warning: dynamic linker does not accept needed library $i."
3192 $echo "*** I have the capability to make that library automatically link in when"
3193 $echo "*** you link to this library. But I can only do this if you have a"
3194 $echo "*** shared version of the library, which I believe you do not have"
3195 $echo "*** because a test_compile did reveal that the linker did not use it for"
3196 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3200 newdeplibs="$newdeplibs $i"
3204 # Error occurred in the first compile. Let's try to salvage
3205 # the situation: Compile a separate program for each library.
3206 for i in $deplibs; do
3207 name="`expr $i : '-l\(.*\)'`"
3208 # If $name is empty we are operating on a -L argument.
3209 if test "$name" != "" && test "$name" != "0"; then
3211 $LTCC -o conftest conftest.c $i
3213 if test "$?" -eq 0 ; then
3214 ldd_output=`ldd conftest`
3215 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3216 case " $predeps $postdeps " in
3218 newdeplibs="$newdeplibs $i"
3223 if test -n "$i" ; then
3224 libname=`eval \\$echo \"$libname_spec\"`
3225 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3226 set dummy $deplib_matches
3228 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3229 newdeplibs="$newdeplibs $i"
3233 $echo "*** Warning: dynamic linker does not accept needed library $i."
3234 $echo "*** I have the capability to make that library automatically link in when"
3235 $echo "*** you link to this library. But I can only do this if you have a"
3236 $echo "*** shared version of the library, which you do not appear to have"
3237 $echo "*** because a test_compile did reveal that the linker did not use this one"
3238 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3244 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3245 $echo "*** make it link in! You will probably need to install it or some"
3246 $echo "*** library that it depends on before this library will be fully"
3247 $echo "*** functional. Installing it before continuing would be even better."
3250 newdeplibs="$newdeplibs $i"
3256 set dummy $deplibs_check_method
3257 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3258 for a_deplib in $deplibs; do
3259 name="`expr $a_deplib : '-l\(.*\)'`"
3260 # If $name is empty we are operating on a -L argument.
3261 if test "$name" != "" && test "$name" != "0"; then
3262 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3263 case " $predeps $postdeps " in
3265 newdeplibs="$newdeplibs $a_deplib"
3270 if test -n "$a_deplib" ; then
3271 libname=`eval \\$echo \"$libname_spec\"`
3272 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3273 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3274 for potent_lib in $potential_libs; do
3275 # Follow soft links.
3276 if ls -lLd "$potent_lib" 2>/dev/null \
3277 | grep " -> " >/dev/null; then
3280 # The statement above tries to avoid entering an
3281 # endless loop below, in case of cyclic links.
3282 # We might still enter an endless loop, since a link
3283 # loop can be closed while we follow links,
3285 potlib="$potent_lib"
3286 while test -h "$potlib" 2>/dev/null; do
3287 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3289 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3290 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3293 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3295 | $EGREP "$file_magic_regex" > /dev/null; then
3296 newdeplibs="$newdeplibs $a_deplib"
3303 if test -n "$a_deplib" ; then
3306 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3307 $echo "*** I have the capability to make that library automatically link in when"
3308 $echo "*** you link to this library. But I can only do this if you have a"
3309 $echo "*** shared version of the library, which you do not appear to have"
3310 $echo "*** because I did check the linker path looking for a file starting"
3311 if test -z "$potlib" ; then
3312 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3314 $echo "*** with $libname and none of the candidates passed a file format test"
3315 $echo "*** using a file magic. Last file checked: $potlib"
3319 # Add a -L argument.
3320 newdeplibs="$newdeplibs $a_deplib"
3322 done # Gone through all deplibs.
3325 set dummy $deplibs_check_method
3326 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3327 for a_deplib in $deplibs; do
3328 name="`expr $a_deplib : '-l\(.*\)'`"
3329 # If $name is empty we are operating on a -L argument.
3330 if test -n "$name" && test "$name" != "0"; then
3331 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3332 case " $predeps $postdeps " in
3334 newdeplibs="$newdeplibs $a_deplib"
3339 if test -n "$a_deplib" ; then
3340 libname=`eval \\$echo \"$libname_spec\"`
3341 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3342 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3343 for potent_lib in $potential_libs; do
3344 potlib="$potent_lib" # see symlink-check above in file_magic test
3345 if eval $echo \"$potent_lib\" 2>/dev/null \
3347 | $EGREP "$match_pattern_regex" > /dev/null; then
3348 newdeplibs="$newdeplibs $a_deplib"
3355 if test -n "$a_deplib" ; then
3358 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3359 $echo "*** I have the capability to make that library automatically link in when"
3360 $echo "*** you link to this library. But I can only do this if you have a"
3361 $echo "*** shared version of the library, which you do not appear to have"
3362 $echo "*** because I did check the linker path looking for a file starting"
3363 if test -z "$potlib" ; then
3364 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3366 $echo "*** with $libname and none of the candidates passed a file format test"
3367 $echo "*** using a regex pattern. Last file checked: $potlib"
3371 # Add a -L argument.
3372 newdeplibs="$newdeplibs $a_deplib"
3374 done # Gone through all deplibs.
3378 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3379 -e 's/ -[LR][^ ]*//g'`
3380 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3381 for i in $predeps $postdeps ; do
3382 # can't use Xsed below, because $i might contain '/'
3383 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3386 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3387 | grep . >/dev/null; then
3389 if test "X$deplibs_check_method" = "Xnone"; then
3390 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3392 $echo "*** Warning: inter-library dependencies are not known to be supported."
3394 $echo "*** All declared inter-library dependencies are being dropped."
3399 versuffix=$versuffix_save
3401 release=$release_save
3402 libname=$libname_save
3406 *-*-rhapsody* | *-*-darwin1.[012])
3407 # On Rhapsody replace the C library is the System framework
3408 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3412 if test "$droppeddeps" = yes; then
3413 if test "$module" = yes; then
3415 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3416 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3417 $echo "*** a static module, that should work as long as the dlopening"
3418 $echo "*** application is linked with the -dlopen flag."
3419 if test -z "$global_symbol_pipe"; then
3421 $echo "*** However, this would only work if libtool was able to extract symbol"
3422 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3423 $echo "*** not find such a program. So, this module is probably useless."
3424 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3426 if test "$build_old_libs" = no; then
3427 oldlibs="$output_objdir/$libname.$libext"
3428 build_libtool_libs=module
3431 build_libtool_libs=no
3434 $echo "*** The inter-library dependencies that have been dropped here will be"
3435 $echo "*** automatically added whenever a program is linked with this library"
3436 $echo "*** or is declared to -dlopen it."
3438 if test "$allow_undefined" = no; then
3440 $echo "*** Since this library must not contain undefined symbols,"
3441 $echo "*** because either the platform does not support them or"
3442 $echo "*** it was explicitly requested with -no-undefined,"
3443 $echo "*** libtool will only create a static version of it."
3444 if test "$build_old_libs" = no; then
3445 oldlibs="$output_objdir/$libname.$libext"
3446 build_libtool_libs=module
3449 build_libtool_libs=no
3454 # Done checking deplibs!
3458 # All the library-specific variables (install_libdir is set above).
3463 # Test again, we may have decided not to build it any more
3464 if test "$build_libtool_libs" = yes; then
3465 if test "$hardcode_into_libs" = yes; then
3466 # Hardcode the library paths
3469 rpath="$finalize_rpath"
3470 test "$mode" != relink && rpath="$compile_rpath$rpath"
3471 for libdir in $rpath; do
3472 if test -n "$hardcode_libdir_flag_spec"; then
3473 if test -n "$hardcode_libdir_separator"; then
3474 if test -z "$hardcode_libdirs"; then
3475 hardcode_libdirs="$libdir"
3477 # Just accumulate the unique libdirs.
3478 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3479 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3482 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3487 eval flag=\"$hardcode_libdir_flag_spec\"
3488 dep_rpath="$dep_rpath $flag"
3490 elif test -n "$runpath_var"; then
3491 case "$perm_rpath " in
3493 *) perm_rpath="$perm_rpath $libdir" ;;
3497 # Substitute the hardcoded libdirs into the rpath.
3498 if test -n "$hardcode_libdir_separator" &&
3499 test -n "$hardcode_libdirs"; then
3500 libdir="$hardcode_libdirs"
3501 if test -n "$hardcode_libdir_flag_spec_ld"; then
3502 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3504 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3507 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3508 # We should set the runpath_var.
3510 for dir in $perm_rpath; do
3513 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3515 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3518 shlibpath="$finalize_shlibpath"
3519 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3520 if test -n "$shlibpath"; then
3521 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3524 # Get the real and link names of the library.
3525 eval shared_ext=\"$shrext\"
3526 eval library_names=\"$library_names_spec\"
3527 set dummy $library_names
3531 if test -n "$soname_spec"; then
3532 eval soname=\"$soname_spec\"
3536 if test -z "$dlname"; then
3540 lib="$output_objdir/$realname"
3543 linknames="$linknames $link"
3546 # Use standard objects if they are pic
3547 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3549 # Prepare the list of exported symbols
3550 if test -z "$export_symbols"; then
3551 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3552 $show "generating symbol list for \`$libname.la'"
3553 export_symbols="$output_objdir/$libname.exp"
3554 $run $rm $export_symbols
3555 eval cmds=\"$export_symbols_cmds\"
3556 save_ifs="$IFS"; IFS='~'
3557 for cmd in $cmds; do
3559 if len=`expr "X$cmd" : ".*"` &&
3560 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3562 $run eval "$cmd" || exit $?
3563 skipped_export=false
3565 # The command line is too long to execute in one step.
3566 $show "using reloadable object file for export list..."
3571 if test -n "$export_symbols_regex"; then
3572 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3573 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3574 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3575 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3580 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3581 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3585 for test_deplib in $deplibs; do
3586 case " $convenience " in
3587 *" $test_deplib "*) ;;
3589 tmp_deplibs="$tmp_deplibs $test_deplib"
3593 deplibs="$tmp_deplibs"
3595 if test -n "$convenience"; then
3596 if test -n "$whole_archive_flag_spec"; then
3597 save_libobjs=$libobjs
3598 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3600 gentop="$output_objdir/${outputname}x"
3601 $show "${rm}r $gentop"
3602 $run ${rm}r "$gentop"
3603 $show "$mkdir $gentop"
3604 $run $mkdir "$gentop"
3606 if test "$status" -ne 0 && test ! -d "$gentop"; then
3609 generated="$generated $gentop"
3611 for xlib in $convenience; do
3612 # Extract the objects.
3614 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3615 *) xabs=`pwd`"/$xlib" ;;
3617 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3618 xdir="$gentop/$xlib"
3620 $show "${rm}r $xdir"
3622 $show "$mkdir $xdir"
3625 if test "$status" -ne 0 && test ! -d "$xdir"; then
3628 # We will extract separately just the conflicting names and we will no
3629 # longer touch any unique names. It is faster to leave these extract
3630 # automatically by $AR in one run.
3631 $show "(cd $xdir && $AR x $xabs)"
3632 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3633 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3636 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3637 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3638 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3641 while test "$i" -le "$count"
3643 # Put our $i before any first dot (extension)
3644 # Never overwrite any file
3646 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3648 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3650 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3651 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3657 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3662 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3663 eval flag=\"$thread_safe_flag_spec\"
3664 linker_flags="$linker_flags $flag"
3667 # Make a backup of the uninstalled library when relinking
3668 if test "$mode" = relink; then
3669 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3672 # Do each of the archive commands.
3673 if test "$module" = yes && test -n "$module_cmds" ; then
3674 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3675 eval cmds=\"$module_expsym_cmds\"
3677 eval cmds=\"$module_cmds\"
3680 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3681 eval cmds=\"$archive_expsym_cmds\"
3683 eval cmds=\"$archive_cmds\"
3687 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3688 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3691 # The command line is too long to link in one step, link piecewise.
3692 $echo "creating reloadable object files..."
3694 # Save the value of $output and $libobjs because we want to
3695 # use them later. If we have whole_archive_flag_spec, we
3696 # want to use save_libobjs as it was before
3697 # whole_archive_flag_spec was expanded, because we can't
3698 # assume the linker understands whole_archive_flag_spec.
3699 # This may have to be revisited, in case too many
3700 # convenience libraries get linked in and end up exceeding
3702 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3703 save_libobjs=$libobjs
3707 # Clear the reloadable object creation command queue and
3708 # initialize k to one.
3715 output=$output_objdir/$save_output-${k}.$objext
3716 # Loop over the list of objects to be linked.
3717 for obj in $save_libobjs
3719 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3720 if test "X$objlist" = X ||
3721 { len=`expr "X$test_cmds" : ".*"` &&
3722 test "$len" -le "$max_cmd_len"; }; then
3723 objlist="$objlist $obj"
3725 # The command $test_cmds is almost too long, add a
3726 # command to the queue.
3727 if test "$k" -eq 1 ; then
3728 # The first file doesn't have a previous command to add.
3729 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3731 # All subsequent reloadable object files will link in
3732 # the last one created.
3733 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3735 last_robj=$output_objdir/$save_output-${k}.$objext
3737 output=$output_objdir/$save_output-${k}.$objext
3742 # Handle the remaining objects by creating one last
3743 # reloadable object file. All subsequent reloadable object
3744 # files will link in the last one created.
3745 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3746 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3748 if ${skipped_export-false}; then
3749 $show "generating symbol list for \`$libname.la'"
3750 export_symbols="$output_objdir/$libname.exp"
3751 $run $rm $export_symbols
3753 # Append the command to create the export file.
3754 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3757 # Set up a command to remove the reloadale object files
3758 # after they are used.
3760 while test "$i" -lt "$k"
3763 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3766 $echo "creating a temporary reloadable object file: $output"
3768 # Loop through the commands generated above and execute them.
3769 save_ifs="$IFS"; IFS='~'
3770 for cmd in $concat_cmds; do
3773 $run eval "$cmd" || exit $?
3778 # Restore the value of output.
3781 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3782 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3784 # Expand the library linking commands again to reset the
3785 # value of $libobjs for piecewise linking.
3787 # Do each of the archive commands.
3788 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3789 eval cmds=\"$archive_expsym_cmds\"
3791 eval cmds=\"$archive_cmds\"
3794 # Append the command to remove the reloadable object files
3795 # to the just-reset $cmds.
3796 eval cmds=\"\$cmds~$rm $delfiles\"
3798 save_ifs="$IFS"; IFS='~'
3799 for cmd in $cmds; do
3802 $run eval "$cmd" || exit $?
3806 # Restore the uninstalled library and exit
3807 if test "$mode" = relink; then
3808 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3812 # Create links to the real library.
3813 for linkname in $linknames; do
3814 if test "$realname" != "$linkname"; then
3815 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3816 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3820 # If -module or -export-dynamic was specified, set the dlname.
3821 if test "$module" = yes || test "$export_dynamic" = yes; then
3822 # On all known operating systems, these are identical.
3829 if test -n "$deplibs"; then
3830 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3833 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3834 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3837 if test -n "$rpath"; then
3838 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3841 if test -n "$xrpath"; then
3842 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3845 if test -n "$vinfo"; then
3846 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3849 if test -n "$release"; then
3850 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3855 if test -n "$objs$old_deplibs"; then
3856 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3860 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3868 # Delete the old objects.
3869 $run $rm $obj $libobj
3871 # Objects from convenience libraries. This assumes
3872 # single-version convenience libraries. Whenever we create
3873 # different ones for PIC/non-PIC, this we'll have to duplicate
3877 # reload_cmds runs $LD directly, so let us get rid of
3878 # -Wl from whole_archive_flag_spec
3881 if test -n "$convenience"; then
3882 if test -n "$whole_archive_flag_spec"; then
3883 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3885 gentop="$output_objdir/${obj}x"
3886 $show "${rm}r $gentop"
3887 $run ${rm}r "$gentop"
3888 $show "$mkdir $gentop"
3889 $run $mkdir "$gentop"
3891 if test "$status" -ne 0 && test ! -d "$gentop"; then
3894 generated="$generated $gentop"
3896 for xlib in $convenience; do
3897 # Extract the objects.
3899 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3900 *) xabs=`pwd`"/$xlib" ;;
3902 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3903 xdir="$gentop/$xlib"
3905 $show "${rm}r $xdir"
3907 $show "$mkdir $xdir"
3910 if test "$status" -ne 0 && test ! -d "$xdir"; then
3913 # We will extract separately just the conflicting names and we will no
3914 # longer touch any unique names. It is faster to leave these extract
3915 # automatically by $AR in one run.
3916 $show "(cd $xdir && $AR x $xabs)"
3917 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3918 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3921 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3922 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3923 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3926 while test "$i" -le "$count"
3928 # Put our $i before any first dot (extension)
3929 # Never overwrite any file
3931 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3933 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3935 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3936 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3942 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3947 # Create the old-style object.
3948 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
3951 eval cmds=\"$reload_cmds\"
3952 save_ifs="$IFS"; IFS='~'
3953 for cmd in $cmds; do
3956 $run eval "$cmd" || exit $?
3960 # Exit if we aren't doing a library object file.
3961 if test -z "$libobj"; then
3962 if test -n "$gentop"; then
3963 $show "${rm}r $gentop"
3970 if test "$build_libtool_libs" != yes; then
3971 if test -n "$gentop"; then
3972 $show "${rm}r $gentop"
3976 # Create an invalid libtool object if no PIC, so that we don't
3977 # accidentally link it into a program.
3978 # $show "echo timestamp > $libobj"
3979 # $run eval "echo timestamp > $libobj" || exit $?
3983 if test -n "$pic_flag" || test "$pic_mode" != default; then
3984 # Only do commands if we really have different PIC objects.
3985 reload_objs="$libobjs $reload_conv_objs"
3987 eval cmds=\"$reload_cmds\"
3988 save_ifs="$IFS"; IFS='~'
3989 for cmd in $cmds; do
3992 $run eval "$cmd" || exit $?
3997 if test -n "$gentop"; then
3998 $show "${rm}r $gentop"
4007 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4009 if test -n "$vinfo"; then
4010 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4013 if test -n "$release"; then
4014 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4017 if test "$preload" = yes; then
4018 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4019 test "$dlopen_self_static" = unknown; then
4020 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4025 *-*-rhapsody* | *-*-darwin1.[012])
4026 # On Rhapsody replace the C library is the System framework
4027 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4028 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4034 # Don't allow lazy linking, it breaks C++ global constructors
4035 if test "$tagname" = CXX ; then
4036 compile_command="$compile_command ${wl}-bind_at_load"
4037 finalize_command="$finalize_command ${wl}-bind_at_load"
4042 compile_command="$compile_command $compile_deplibs"
4043 finalize_command="$finalize_command $finalize_deplibs"
4045 if test -n "$rpath$xrpath"; then
4046 # If the user specified any rpath flags, then add them.
4047 for libdir in $rpath $xrpath; do
4048 # This is the magic to use -rpath.
4049 case "$finalize_rpath " in
4051 *) finalize_rpath="$finalize_rpath $libdir" ;;
4056 # Now hardcode the library paths
4059 for libdir in $compile_rpath $finalize_rpath; do
4060 if test -n "$hardcode_libdir_flag_spec"; then
4061 if test -n "$hardcode_libdir_separator"; then
4062 if test -z "$hardcode_libdirs"; then
4063 hardcode_libdirs="$libdir"
4065 # Just accumulate the unique libdirs.
4066 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4067 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4070 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4075 eval flag=\"$hardcode_libdir_flag_spec\"
4076 rpath="$rpath $flag"
4078 elif test -n "$runpath_var"; then
4079 case "$perm_rpath " in
4081 *) perm_rpath="$perm_rpath $libdir" ;;
4085 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4086 case :$dllsearchpath: in
4088 *) dllsearchpath="$dllsearchpath:$libdir";;
4093 # Substitute the hardcoded libdirs into the rpath.
4094 if test -n "$hardcode_libdir_separator" &&
4095 test -n "$hardcode_libdirs"; then
4096 libdir="$hardcode_libdirs"
4097 eval rpath=\" $hardcode_libdir_flag_spec\"
4099 compile_rpath="$rpath"
4103 for libdir in $finalize_rpath; do
4104 if test -n "$hardcode_libdir_flag_spec"; then
4105 if test -n "$hardcode_libdir_separator"; then
4106 if test -z "$hardcode_libdirs"; then
4107 hardcode_libdirs="$libdir"
4109 # Just accumulate the unique libdirs.
4110 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4111 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4114 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4119 eval flag=\"$hardcode_libdir_flag_spec\"
4120 rpath="$rpath $flag"
4122 elif test -n "$runpath_var"; then
4123 case "$finalize_perm_rpath " in
4125 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4129 # Substitute the hardcoded libdirs into the rpath.
4130 if test -n "$hardcode_libdir_separator" &&
4131 test -n "$hardcode_libdirs"; then
4132 libdir="$hardcode_libdirs"
4133 eval rpath=\" $hardcode_libdir_flag_spec\"
4135 finalize_rpath="$rpath"
4137 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4138 # Transform all the library objects into standard objects.
4139 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4140 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4144 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4145 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4146 dlsyms="${outputname}S.c"
4148 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4152 if test -n "$dlsyms"; then
4156 # Discover the nlist of each of the dlfiles.
4157 nlist="$output_objdir/${outputname}.nm"
4159 $show "$rm $nlist ${nlist}S ${nlist}T"
4160 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4162 # Parse the name list into a source file.
4163 $show "creating $output_objdir/$dlsyms"
4165 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4166 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4167 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4173 /* Prevent the only kind of declaration conflicts we can make. */
4174 #define lt_preloaded_symbols some_other_symbol
4176 /* External symbol declarations for the compiler. */\
4179 if test "$dlself" = yes; then
4180 $show "generating symbol list for \`$output'"
4182 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4184 # Add our own program objects to the symbol list.
4185 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4186 for arg in $progfiles; do
4187 $show "extracting global C symbols from \`$arg'"
4188 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4191 if test -n "$exclude_expsyms"; then
4192 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4193 $run eval '$mv "$nlist"T "$nlist"'
4196 if test -n "$export_symbols_regex"; then
4197 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4198 $run eval '$mv "$nlist"T "$nlist"'
4201 # Prepare the list of exported symbols
4202 if test -z "$export_symbols"; then
4203 export_symbols="$output_objdir/$output.exp"
4204 $run $rm $export_symbols
4205 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4207 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4208 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4209 $run eval 'mv "$nlist"T "$nlist"'
4213 for arg in $dlprefiles; do
4214 $show "extracting global C symbols from \`$arg'"
4215 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4216 $run eval '$echo ": $name " >> "$nlist"'
4217 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4220 if test -z "$run"; then
4221 # Make sure we have at least an empty file.
4222 test -f "$nlist" || : > "$nlist"
4224 if test -n "$exclude_expsyms"; then
4225 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4226 $mv "$nlist"T "$nlist"
4229 # Try sorting and uniquifying the output.
4230 if grep -v "^: " < "$nlist" |
4231 if sort -k 3 </dev/null >/dev/null 2>&1; then
4236 uniq > "$nlist"S; then
4239 grep -v "^: " < "$nlist" > "$nlist"S
4242 if test -f "$nlist"S; then
4243 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4245 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4248 $echo >> "$output_objdir/$dlsyms" "\
4250 #undef lt_preloaded_symbols
4252 #if defined (__STDC__) && __STDC__
4253 # define lt_ptr void *
4255 # define lt_ptr char *
4259 /* The mapping between symbol names and symbols. */
4264 lt_preloaded_symbols[] =
4268 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4270 $echo >> "$output_objdir/$dlsyms" "\
4274 /* This works around a problem in FreeBSD linker */
4275 #ifdef FREEBSD_WORKAROUND
4276 static const void *lt_preloaded_setup() {
4277 return lt_preloaded_symbols;
4287 pic_flag_for_symtable=
4289 # compiling the symbol table file with pic_flag works around
4290 # a FreeBSD bug that causes programs to crash when -lm is
4291 # linked before any other PIC object. But we must not use
4292 # pic_flag when linking with -static. The problem exists in
4293 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4294 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4295 case "$compile_command " in
4297 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4300 case "$compile_command " in
4302 *) pic_flag_for_symtable=" $pic_flag";;
4306 # Now compile the dynamic symbol file.
4307 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4308 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4310 # Clean up the generated files.
4311 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4312 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4314 # Transform the symbol file into the correct name.
4315 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4316 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4319 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4324 # We keep going just in case the user didn't refer to
4325 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4326 # really was required.
4328 # Nullify the symbol file.
4329 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4330 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4333 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4334 # Replace the output file specification.
4335 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4336 link_command="$compile_command$compile_rpath"
4338 # We have no uninstalled library dependencies, so finalize right now.
4339 $show "$link_command"
4340 $run eval "$link_command"
4343 # Delete the generated files.
4344 if test -n "$dlsyms"; then
4345 $show "$rm $output_objdir/${outputname}S.${objext}"
4346 $run $rm "$output_objdir/${outputname}S.${objext}"
4352 if test -n "$shlibpath_var"; then
4353 # We should set the shlibpath_var
4355 for dir in $temp_rpath; do
4357 [\\/]* | [A-Za-z]:[\\/]*)
4362 # Relative path: add a thisdir entry.
4363 rpath="$rpath\$thisdir/$dir:"
4370 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4371 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4373 if test -n "$finalize_shlibpath"; then
4374 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4379 if test -n "$runpath_var"; then
4380 if test -n "$perm_rpath"; then
4381 # We should set the runpath_var.
4383 for dir in $perm_rpath; do
4386 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4388 if test -n "$finalize_perm_rpath"; then
4389 # We should set the runpath_var.
4391 for dir in $finalize_perm_rpath; do
4394 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4398 if test "$no_install" = yes; then
4399 # We don't need to create a wrapper script.
4400 link_command="$compile_var$compile_command$compile_rpath"
4401 # Replace the output file specification.
4402 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4403 # Delete the old output file.
4405 # Link the executable and exit
4406 $show "$link_command"
4407 $run eval "$link_command" || exit $?
4411 if test "$hardcode_action" = relink; then
4412 # Fast installation is not supported
4413 link_command="$compile_var$compile_command$compile_rpath"
4414 relink_command="$finalize_var$finalize_command$finalize_rpath"
4416 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4417 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4419 if test "$fast_install" != no; then
4420 link_command="$finalize_var$compile_command$finalize_rpath"
4421 if test "$fast_install" = yes; then
4422 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4424 # fast_install is set to needless
4428 link_command="$compile_var$compile_command$compile_rpath"
4429 relink_command="$finalize_var$finalize_command$finalize_rpath"
4433 # Replace the output file specification.
4434 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4436 # Delete the old output files.
4437 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4439 $show "$link_command"
4440 $run eval "$link_command" || exit $?
4442 # Now create the wrapper script.
4443 $show "creating $output"
4445 # Quote the relink command for shipping.
4446 if test -n "$relink_command"; then
4447 # Preserve any variables that may affect compiler behavior
4448 for var in $variables_saved_for_relink; do
4449 if eval test -z \"\${$var+set}\"; then
4450 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4451 elif eval var_value=\$$var; test -z "$var_value"; then
4452 relink_command="$var=; export $var; $relink_command"
4454 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4455 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4458 relink_command="(cd `pwd`; $relink_command)"
4459 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4462 # Quote $echo for shipping.
4463 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4465 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4466 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4468 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4470 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4473 # Only actually do things if our run command is non-null.
4474 if test -z "$run"; then
4475 # win32 will think the script is a binary if it has
4476 # a .exe suffix, so we strip it off here.
4478 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4480 # test for cygwin because mv fails w/o .exe extensions
4484 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4488 *cygwin* | *mingw* )
4489 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4490 cwrapper=`$echo ${output}.exe`
4491 $rm $cwrappersource $cwrapper
4492 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4494 cat > $cwrappersource <<EOF
4496 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4497 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4499 The $output program cannot be directly executed until all the libtool
4500 libraries that it depends on are installed.
4502 This wrapper executable should never be moved out of the build directory.
4503 If it is, it will not operate correctly.
4505 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4506 but could eventually absorb all of the scripts functionality and
4507 exec $objdir/$outputname directly.
4510 cat >> $cwrappersource<<"EOF"
4518 #if defined(PATH_MAX)
4519 # define LT_PATHMAX PATH_MAX
4520 #elif defined(MAXPATHLEN)
4521 # define LT_PATHMAX MAXPATHLEN
4523 # define LT_PATHMAX 1024
4526 #ifndef DIR_SEPARATOR
4527 #define DIR_SEPARATOR '/'
4530 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4532 #define HAVE_DOS_BASED_FILE_SYSTEM
4533 #ifndef DIR_SEPARATOR_2
4534 #define DIR_SEPARATOR_2 '\\'
4538 #ifndef DIR_SEPARATOR_2
4539 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4540 #else /* DIR_SEPARATOR_2 */
4541 # define IS_DIR_SEPARATOR(ch) \
4542 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4543 #endif /* DIR_SEPARATOR_2 */
4545 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4546 #define XFREE(stale) do { \
4547 if (stale) { free ((void *) stale); stale = 0; } \
4550 const char *program_name = NULL;
4552 void * xmalloc (size_t num);
4553 char * xstrdup (const char *string);
4554 char * basename (const char *name);
4555 char * fnqualify(const char *path);
4556 char * strendzap(char *str, const char *pat);
4557 void lt_fatal (const char *message, ...);
4560 main (int argc, char *argv[])
4565 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4566 newargz = XMALLOC(char *, argc+2);
4569 cat >> $cwrappersource <<EOF
4570 newargz[0] = "$SHELL";
4573 cat >> $cwrappersource <<"EOF"
4574 newargz[1] = fnqualify(argv[0]);
4575 /* we know the script has the same name, without the .exe */
4576 /* so make sure newargz[1] doesn't end in .exe */
4577 strendzap(newargz[1],".exe");
4578 for (i = 1; i < argc; i++)
4579 newargz[i+1] = xstrdup(argv[i]);
4580 newargz[argc+1] = NULL;
4583 cat >> $cwrappersource <<EOF
4584 execv("$SHELL",newargz);
4587 cat >> $cwrappersource <<"EOF"
4591 xmalloc (size_t num)
4593 void * p = (void *) malloc (num);
4595 lt_fatal ("Memory exhausted");
4601 xstrdup (const char *string)
4603 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4608 basename (const char *name)
4612 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4613 /* Skip over the disk name in MSDOS pathnames. */
4614 if (isalpha (name[0]) && name[1] == ':')
4618 for (base = name; *name; name++)
4619 if (IS_DIR_SEPARATOR (*name))
4621 return (char *) base;
4625 fnqualify(const char *path)
4629 char tmp[LT_PATHMAX + 1];
4631 assert(path != NULL);
4633 /* Is it qualified already? */
4634 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4635 if (isalpha (path[0]) && path[1] == ':')
4636 return xstrdup (path);
4638 if (IS_DIR_SEPARATOR (path[0]))
4639 return xstrdup (path);
4641 /* prepend the current directory */
4642 /* doesn't handle '~' */
4643 if (getcwd (tmp, LT_PATHMAX) == NULL)
4644 lt_fatal ("getcwd failed");
4645 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4646 p = XMALLOC(char, size);
4647 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4652 strendzap(char *str, const char *pat)
4656 assert(str != NULL);
4657 assert(pat != NULL);
4660 patlen = strlen(pat);
4664 str += len - patlen;
4665 if (strcmp(str, pat) == 0)
4672 lt_error_core (int exit_status, const char * mode,
4673 const char * message, va_list ap)
4675 fprintf (stderr, "%s: %s: ", program_name, mode);
4676 vfprintf (stderr, message, ap);
4677 fprintf (stderr, ".\n");
4679 if (exit_status >= 0)
4684 lt_fatal (const char *message, ...)
4687 va_start (ap, message);
4688 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4692 # we should really use a build-platform specific compiler
4693 # here, but OTOH, the wrappers (shell script and this C one)
4694 # are only useful if you want to execute the "real" binary.
4695 # Since the "real" binary is built for $host, then this
4696 # wrapper might as well be built for $host, too.
4697 $run $LTCC -s -o $cwrapper $cwrappersource
4701 trap "$rm $output; exit 1" 1 2 15
4706 # $output - temporary wrapper script for $objdir/$outputname
4707 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4709 # The $output program cannot be directly executed until all the libtool
4710 # libraries that it depends on are installed.
4712 # This wrapper script should never be moved out of the build directory.
4713 # If it is, it will not operate correctly.
4715 # Sed substitution that helps us do robust quoting. It backslashifies
4716 # metacharacters that are still active within double-quoted strings.
4717 Xsed='${SED} -e 1s/^X//'
4718 sed_quote_subst='$sed_quote_subst'
4720 # The HP-UX ksh and POSIX shell print the target directory to stdout
4722 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4724 relink_command=\"$relink_command\"
4726 # This environment variable determines our operation mode.
4727 if test \"\$libtool_install_magic\" = \"$magic\"; then
4728 # install mode needs the following variable:
4729 notinst_deplibs='$notinst_deplibs'
4731 # When we are sourced in execute mode, \$file and \$echo are already set.
4732 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4735 # Make sure echo works.
4736 if test \"X\$1\" = X--no-reexec; then
4737 # Discard the --no-reexec flag, and continue.
4739 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4740 # Yippee, \$echo works!
4743 # Restart under the correct shell, and then maybe \$echo will work.
4744 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4750 # Find the directory that this script lives in.
4751 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4752 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4754 # Follow symbolic links until we get to the real thisdir.
4755 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4756 while test -n \"\$file\"; do
4757 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4759 # If there was a directory component, then change thisdir.
4760 if test \"x\$destdir\" != \"x\$file\"; then
4761 case \"\$destdir\" in
4762 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4763 *) thisdir=\"\$thisdir/\$destdir\" ;;
4767 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4768 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4771 # Try to get the absolute directory name.
4772 absdir=\`cd \"\$thisdir\" && pwd\`
4773 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4776 if test "$fast_install" = yes; then
4778 program=lt-'$outputname'$exeext
4779 progdir=\"\$thisdir/$objdir\"
4781 if test ! -f \"\$progdir/\$program\" || \\
4782 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4783 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4785 file=\"\$\$-\$program\"
4787 if test ! -d \"\$progdir\"; then
4788 $mkdir \"\$progdir\"
4790 $rm \"\$progdir/\$file\"
4795 # relink executable if necessary
4796 if test -n \"\$relink_command\"; then
4797 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4799 $echo \"\$relink_command_output\" >&2
4800 $rm \"\$progdir/\$file\"
4805 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4806 { $rm \"\$progdir/\$program\";
4807 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4808 $rm \"\$progdir/\$file\"
4812 program='$outputname'
4813 progdir=\"\$thisdir/$objdir\"
4819 if test -f \"\$progdir/\$program\"; then"
4821 # Export our shlibpath_var if we have one.
4822 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4824 # Add our own library path to $shlibpath_var
4825 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4827 # Some systems cannot cope with colon-terminated $shlibpath_var
4828 # The second colon is a workaround for a bug in BeOS R4 sed
4829 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4831 export $shlibpath_var
4835 # fixup the dll searchpath if we need to.
4836 if test -n "$dllsearchpath"; then
4838 # Add the dll search path components to the executable PATH
4839 PATH=$dllsearchpath:\$PATH
4844 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4845 # Run the actual program with our arguments.
4848 # Backslashes separate directories on plain windows
4849 *-*-mingw | *-*-os2*)
4851 exec \$progdir\\\\\$program \${1+\"\$@\"}
4857 exec \$progdir/\$program \${1+\"\$@\"}
4862 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4866 # The program doesn't exist.
4867 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4868 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4869 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4880 # See if we need to build an old-fashioned archive.
4881 for oldlib in $oldlibs; do
4883 if test "$build_libtool_libs" = convenience; then
4884 oldobjs="$libobjs_save"
4885 addlibs="$convenience"
4886 build_libtool_libs=no
4888 if test "$build_libtool_libs" = module; then
4889 oldobjs="$libobjs_save"
4890 build_libtool_libs=no
4892 oldobjs="$old_deplibs $non_pic_objects"
4894 addlibs="$old_convenience"
4897 if test -n "$addlibs"; then
4898 gentop="$output_objdir/${outputname}x"
4899 $show "${rm}r $gentop"
4900 $run ${rm}r "$gentop"
4901 $show "$mkdir $gentop"
4902 $run $mkdir "$gentop"
4904 if test "$status" -ne 0 && test ! -d "$gentop"; then
4907 generated="$generated $gentop"
4909 # Add in members from convenience archives.
4910 for xlib in $addlibs; do
4911 # Extract the objects.
4913 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4914 *) xabs=`pwd`"/$xlib" ;;
4916 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4917 xdir="$gentop/$xlib"
4919 $show "${rm}r $xdir"
4921 $show "$mkdir $xdir"
4924 if test "$status" -ne 0 && test ! -d "$xdir"; then
4927 # We will extract separately just the conflicting names and we will no
4928 # longer touch any unique names. It is faster to leave these extract
4929 # automatically by $AR in one run.
4930 $show "(cd $xdir && $AR x $xabs)"
4931 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4932 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4935 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4936 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4937 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4940 while test "$i" -le "$count"
4942 # Put our $i before any first dot (extension)
4943 # Never overwrite any file
4945 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4947 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4949 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4950 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4956 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4960 # Do each command in the archive commands.
4961 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4962 eval cmds=\"$old_archive_from_new_cmds\"
4964 eval cmds=\"$old_archive_cmds\"
4966 if len=`expr "X$cmds" : ".*"` &&
4967 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4970 # the command line is too long to link in one step, link in parts
4971 $echo "using piecewise archive linking..."
4976 save_oldobjs=$oldobjs
4977 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4978 # encoded into archives. This makes 'ar r' malfunction in
4979 # this piecewise linking case whenever conflicting object
4980 # names appear in distinct ar calls; check, warn and compensate.
4981 if (for obj in $save_oldobjs
4983 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4984 done | sort | sort -uc >/dev/null 2>&1); then
4987 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4988 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4991 # Is there a better way of finding the last object in the list?
4992 for obj in $save_oldobjs
4996 for obj in $save_oldobjs
4998 oldobjs="$objlist $obj"
4999 objlist="$objlist $obj"
5000 eval test_cmds=\"$old_archive_cmds\"
5001 if len=`expr "X$test_cmds" : ".*"` &&
5002 test "$len" -le "$max_cmd_len"; then
5005 # the above command should be used before it gets too long
5007 if test "$obj" = "$last_oldobj" ; then
5010 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5011 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5017 if test "X$oldobjs" = "X" ; then
5018 eval cmds=\"\$concat_cmds\"
5020 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5024 save_ifs="$IFS"; IFS='~'
5025 for cmd in $cmds; do
5028 $run eval "$cmd" || exit $?
5033 if test -n "$generated"; then
5034 $show "${rm}r$generated"
5035 $run ${rm}r$generated
5038 # Now create the libtool archive.
5042 test "$build_old_libs" = yes && old_library="$libname.$libext"
5043 $show "creating $output"
5045 # Preserve any variables that may affect compiler behavior
5046 for var in $variables_saved_for_relink; do
5047 if eval test -z \"\${$var+set}\"; then
5048 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5049 elif eval var_value=\$$var; test -z "$var_value"; then
5050 relink_command="$var=; export $var; $relink_command"
5052 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5053 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5056 # Quote the link command for shipping.
5057 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5058 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5060 # Only create the output if not a dry run.
5061 if test -z "$run"; then
5062 for installed in no yes; do
5063 if test "$installed" = yes; then
5064 if test -z "$install_libdir"; then
5067 output="$output_objdir/$outputname"i
5068 # Replace all uninstalled libtool libraries with the installed ones
5070 for deplib in $dependency_libs; do
5073 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5074 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5075 if test -z "$libdir"; then
5076 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5079 newdependency_libs="$newdependency_libs $libdir/$name"
5081 *) newdependency_libs="$newdependency_libs $deplib" ;;
5084 dependency_libs="$newdependency_libs"
5086 for lib in $dlfiles; do
5087 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5088 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5089 if test -z "$libdir"; then
5090 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5093 newdlfiles="$newdlfiles $libdir/$name"
5095 dlfiles="$newdlfiles"
5097 for lib in $dlprefiles; do
5098 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5099 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5100 if test -z "$libdir"; then
5101 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5104 newdlprefiles="$newdlprefiles $libdir/$name"
5106 dlprefiles="$newdlprefiles"
5109 # place dlname in correct position for cygwin
5111 case $host,$output,$installed,$module,$dlname in
5112 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5115 # $outputname - a libtool library file
5116 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5118 # Please DO NOT delete this file!
5119 # It is necessary for linking the library.
5121 # The name that we can dlopen(3).
5124 # Names of this library.
5125 library_names='$library_names'
5127 # The name of the static archive.
5128 old_library='$old_library'
5130 # Libraries that this one depends upon.
5131 dependency_libs='$dependency_libs'
5133 # Version information for $libname.
5138 # Is this an already installed library?
5139 installed=$installed
5141 # Should we warn about portability when linking against -modules?
5142 shouldnotlink=$module
5144 # Files to dlopen/dlpreopen
5146 dlpreopen='$dlprefiles'
5148 # Directory that this library needs to be installed in:
5149 libdir='$install_libdir'"
5150 if test "$installed" = no && test "$need_relink" = yes; then
5152 relink_command=\"$relink_command\""
5157 # Do a symbolic link so that the libtool archive can be found in
5158 # LD_LIBRARY_PATH before the program is installed.
5159 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5160 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5166 # libtool install mode
5168 modename="$modename: install"
5170 # There may be an optional sh(1) argument at the beginning of
5171 # install_prog (especially on Windows NT).
5172 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5173 # Allow the use of GNU shtool's install command.
5174 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5175 # Aesthetically quote it.
5176 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5178 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5182 install_prog="$arg "
5190 # The real first argument should be the name of the installation program.
5191 # Aesthetically quote it.
5192 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5194 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5198 install_prog="$install_prog$arg"
5200 # We need to accept at least all the BSD install flags.
5210 if test -n "$dest"; then
5211 files="$files $dest"
5229 # If the previous option needed an argument, then skip it.
5230 if test -n "$prev"; then
5239 # Aesthetically quote the argument.
5240 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5242 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5246 install_prog="$install_prog $arg"
5249 if test -z "$install_prog"; then
5250 $echo "$modename: you must specify an install program" 1>&2
5255 if test -n "$prev"; then
5256 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5261 if test -z "$files"; then
5262 if test -z "$dest"; then
5263 $echo "$modename: no file or destination specified" 1>&2
5265 $echo "$modename: you must specify a destination" 1>&2
5271 # Strip any trailing slash from the destination.
5272 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5274 # Check to see that the destination is a directory.
5275 test -d "$dest" && isdir=yes
5276 if test "$isdir" = yes; then
5280 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5281 test "X$destdir" = "X$dest" && destdir=.
5282 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5284 # Not a directory, so check to see that there is only one file specified.
5286 if test "$#" -gt 2; then
5287 $echo "$modename: \`$dest' is not a directory" 1>&2
5293 [\\/]* | [A-Za-z]:[\\/]*) ;;
5295 for file in $files; do
5299 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5308 # This variable tells wrapper scripts just to set variables rather
5309 # than running their programs.
5310 libtool_install_magic="$magic"
5315 for file in $files; do
5317 # Do each installation.
5320 # Do the static libraries later.
5321 staticlibs="$staticlibs $file"
5325 # Check to see that this really is a libtool archive.
5326 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5328 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5336 # If there is no directory component, then add one.
5338 */* | *\\*) . $file ;;
5342 # Add the libdir to current_libdirs if it is the destination.
5343 if test "X$destdir" = "X$libdir"; then
5344 case "$current_libdirs " in
5346 *) current_libdirs="$current_libdirs $libdir" ;;
5349 # Note the libdir as a future libdir.
5350 case "$future_libdirs " in
5352 *) future_libdirs="$future_libdirs $libdir" ;;
5356 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5357 test "X$dir" = "X$file/" && dir=
5360 if test -n "$relink_command"; then
5361 # Determine the prefix the user has applied to our future dir.
5362 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5364 # Don't allow the user to place us outside of our expected
5365 # location b/c this prevents finding dependent libraries that
5366 # are installed to the same prefix.
5367 # At present, this check doesn't affect windows .dll's that
5368 # are installed into $libdir/../bin (currently, that works fine)
5369 # but it's something to keep an eye on.
5370 if test "$inst_prefix_dir" = "$destdir"; then
5371 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5375 if test -n "$inst_prefix_dir"; then
5376 # Stick the inst_prefix_dir data into the link command.
5377 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5379 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5382 $echo "$modename: warning: relinking \`$file'" 1>&2
5383 $show "$relink_command"
5384 if $run eval "$relink_command"; then :
5386 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5391 # See the names of the shared library.
5392 set dummy $library_names
5393 if test -n "$2"; then
5399 test -n "$relink_command" && srcname="$realname"T
5401 # Install the shared library and build the symlinks.
5402 $show "$install_prog $dir/$srcname $destdir/$realname"
5403 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5404 if test -n "$stripme" && test -n "$striplib"; then
5405 $show "$striplib $destdir/$realname"
5406 $run eval "$striplib $destdir/$realname" || exit $?
5409 if test "$#" -gt 0; then
5410 # Delete the old symlinks, and create new ones.
5413 if test "$linkname" != "$realname"; then
5414 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5415 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5420 # Do each command in the postinstall commands.
5421 lib="$destdir/$realname"
5422 eval cmds=\"$postinstall_cmds\"
5423 save_ifs="$IFS"; IFS='~'
5424 for cmd in $cmds; do
5427 $run eval "$cmd" || exit $?
5432 # Install the pseudo-library for information purposes.
5433 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5434 instname="$dir/$name"i
5435 $show "$install_prog $instname $destdir/$name"
5436 $run eval "$install_prog $instname $destdir/$name" || exit $?
5438 # Maybe install the static library, too.
5439 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5443 # Install (i.e. copy) a libtool object.
5445 # Figure out destination file name, if it wasn't already specified.
5446 if test -n "$destname"; then
5447 destfile="$destdir/$destname"
5449 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5450 destfile="$destdir/$destfile"
5453 # Deduce the name of the destination old-style object file.
5456 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5459 staticdest="$destfile"
5463 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5469 # Install the libtool object if requested.
5470 if test -n "$destfile"; then
5471 $show "$install_prog $file $destfile"
5472 $run eval "$install_prog $file $destfile" || exit $?
5475 # Install the old object if enabled.
5476 if test "$build_old_libs" = yes; then
5477 # Deduce the name of the old-style object file.
5478 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5480 $show "$install_prog $staticobj $staticdest"
5481 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5487 # Figure out destination file name, if it wasn't already specified.
5488 if test -n "$destname"; then
5489 destfile="$destdir/$destname"
5491 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5492 destfile="$destdir/$destfile"
5495 # If the file is missing, and there is a .exe on the end, strip it
5496 # because it is most likely a libtool script we actually want to
5501 if test ! -f "$file"; then
5502 file=`$echo $file|${SED} 's,.exe$,,'`
5508 # Do a test to see if this is really a libtool program.
5511 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5517 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5521 # To insure that "foo" is sourced, and not "foo.exe",
5522 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5523 # which disallows the automatic-append-.exe behavior.
5525 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5526 *) wrapperdot=${wrapper} ;;
5528 # If there is no directory component, then add one.
5530 */* | *\\*) . ${wrapperdot} ;;
5531 *) . ./${wrapperdot} ;;
5534 # Check the variables that should have been set.
5535 if test -z "$notinst_deplibs"; then
5536 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5541 for lib in $notinst_deplibs; do
5542 # Check to see that each library is installed.
5544 if test -f "$lib"; then
5545 # If there is no directory component, then add one.
5547 */* | *\\*) . $lib ;;
5551 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5552 if test -n "$libdir" && test ! -f "$libfile"; then
5553 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5559 # To insure that "foo" is sourced, and not "foo.exe",
5560 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5561 # which disallows the automatic-append-.exe behavior.
5563 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5564 *) wrapperdot=${wrapper} ;;
5566 # If there is no directory component, then add one.
5568 */* | *\\*) . ${wrapperdot} ;;
5569 *) . ./${wrapperdot} ;;
5573 if test "$fast_install" = no && test -n "$relink_command"; then
5574 if test "$finalize" = yes && test -z "$run"; then
5576 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5577 tmpdir="$tmpdir/libtool-$$"
5578 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5580 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5583 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5584 outputname="$tmpdir/$file"
5585 # Replace the output file specification.
5586 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5588 $show "$relink_command"
5589 if $run eval "$relink_command"; then :
5591 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5597 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5600 # Install the binary that we compiled earlier.
5601 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5605 # remove .exe since cygwin /usr/bin/install will append another
5607 case $install_prog,$host in
5608 */usr/bin/install*,*cygwin*)
5609 case $file:$destfile in
5614 destfile=$destfile.exe
5617 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5622 $show "$install_prog$stripme $file $destfile"
5623 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5624 test -n "$outputname" && ${rm}r "$tmpdir"
5629 for file in $staticlibs; do
5630 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5632 # Set up the ranlib parameters.
5633 oldlib="$destdir/$name"
5635 $show "$install_prog $file $oldlib"
5636 $run eval "$install_prog \$file \$oldlib" || exit $?
5638 if test -n "$stripme" && test -n "$striplib"; then
5639 $show "$old_striplib $oldlib"
5640 $run eval "$old_striplib $oldlib" || exit $?
5643 # Do each command in the postinstall commands.
5644 eval cmds=\"$old_postinstall_cmds\"
5645 save_ifs="$IFS"; IFS='~'
5646 for cmd in $cmds; do
5649 $run eval "$cmd" || exit $?
5654 if test -n "$future_libdirs"; then
5655 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5658 if test -n "$current_libdirs"; then
5659 # Maybe just do a dry run.
5660 test -n "$run" && current_libdirs=" -n$current_libdirs"
5661 exec_cmd='$SHELL $0 --finish$current_libdirs'
5667 # libtool finish mode
5669 modename="$modename: finish"
5673 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5676 libdirs="$libdirs $dir"
5679 for libdir in $libdirs; do
5680 if test -n "$finish_cmds"; then
5681 # Do each command in the finish commands.
5682 eval cmds=\"$finish_cmds\"
5683 save_ifs="$IFS"; IFS='~'
5684 for cmd in $cmds; do
5687 $run eval "$cmd" || admincmds="$admincmds
5692 if test -n "$finish_eval"; then
5693 # Do the single finish_eval.
5694 eval cmds=\"$finish_eval\"
5695 $run eval "$cmds" || admincmds="$admincmds
5701 # Exit here if they wanted silent mode.
5702 test "$show" = : && exit 0
5704 $echo "----------------------------------------------------------------------"
5705 $echo "Libraries have been installed in:"
5706 for libdir in $libdirs; do
5710 $echo "If you ever happen to want to link against installed libraries"
5711 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5712 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5713 $echo "flag during linking and do at least one of the following:"
5714 if test -n "$shlibpath_var"; then
5715 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5716 $echo " during execution"
5718 if test -n "$runpath_var"; then
5719 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5720 $echo " during linking"
5722 if test -n "$hardcode_libdir_flag_spec"; then
5724 eval flag=\"$hardcode_libdir_flag_spec\"
5726 $echo " - use the \`$flag' linker flag"
5728 if test -n "$admincmds"; then
5729 $echo " - have your system administrator run these commands:$admincmds"
5731 if test -f /etc/ld.so.conf; then
5732 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5735 $echo "See any operating system documentation about shared libraries for"
5736 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5737 $echo "----------------------------------------------------------------------"
5741 # libtool execute mode
5743 modename="$modename: execute"
5745 # The first argument is the command name.
5747 if test -z "$cmd"; then
5748 $echo "$modename: you must specify a COMMAND" 1>&2
5753 # Handle -dlopen flags immediately.
5754 for file in $execute_dlfiles; do
5755 if test ! -f "$file"; then
5756 $echo "$modename: \`$file' is not a file" 1>&2
5764 # Check to see that this really is a libtool archive.
5765 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5767 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5772 # Read the libtool library.
5776 # If there is no directory component, then add one.
5778 */* | *\\*) . $file ;;
5782 # Skip this library if it cannot be dlopened.
5783 if test -z "$dlname"; then
5784 # Warn if it was a shared library.
5785 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5789 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5790 test "X$dir" = "X$file" && dir=.
5792 if test -f "$dir/$objdir/$dlname"; then
5795 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5801 # Just add the directory containing the .lo file.
5802 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5803 test "X$dir" = "X$file" && dir=.
5807 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5812 # Get the absolute pathname.
5813 absdir=`cd "$dir" && pwd`
5814 test -n "$absdir" && dir="$absdir"
5816 # Now add the directory to shlibpath_var.
5817 if eval "test -z \"\$$shlibpath_var\""; then
5818 eval "$shlibpath_var=\"\$dir\""
5820 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5824 # This variable tells wrapper scripts just to set shlibpath_var
5825 # rather than running their programs.
5826 libtool_execute_magic="$magic"
5828 # Check if any of the arguments is a wrapper script.
5835 # Do a test to see if this is really a libtool program.
5836 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5837 # If there is no directory component, then add one.
5839 */* | *\\*) . $file ;;
5843 # Transform arg to wrapped name.
5844 file="$progdir/$program"
5848 # Quote arguments (to preserve shell metacharacters).
5849 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5850 args="$args \"$file\""
5853 if test -z "$run"; then
5854 if test -n "$shlibpath_var"; then
5855 # Export the shlibpath_var.
5856 eval "export $shlibpath_var"
5859 # Restore saved environment variables
5860 if test "${save_LC_ALL+set}" = set; then
5861 LC_ALL="$save_LC_ALL"; export LC_ALL
5863 if test "${save_LANG+set}" = set; then
5864 LANG="$save_LANG"; export LANG
5867 # Now prepare to actually exec the command.
5868 exec_cmd="\$cmd$args"
5870 # Display what would be done.
5871 if test -n "$shlibpath_var"; then
5872 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5873 $echo "export $shlibpath_var"
5880 # libtool clean and uninstall mode
5882 modename="$modename: $mode"
5888 # This variable tells wrapper scripts just to set variables rather
5889 # than running their programs.
5890 libtool_install_magic="$magic"
5895 -f) rm="$rm $arg"; rmforce=yes ;;
5896 -*) rm="$rm $arg" ;;
5897 *) files="$files $arg" ;;
5901 if test -z "$rm"; then
5902 $echo "$modename: you must specify an RM program" 1>&2
5909 origobjdir="$objdir"
5910 for file in $files; do
5911 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5912 if test "X$dir" = "X$file"; then
5914 objdir="$origobjdir"
5916 objdir="$dir/$origobjdir"
5918 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5919 test "$mode" = uninstall && objdir="$dir"
5921 # Remember objdir for removal later, being careful to avoid duplicates
5922 if test "$mode" = clean; then
5925 *) rmdirs="$rmdirs $objdir" ;;
5929 # Don't error if the file doesn't exist and rm -f was used.
5930 if (test -L "$file") >/dev/null 2>&1 \
5931 || (test -h "$file") >/dev/null 2>&1 \
5932 || test -f "$file"; then
5934 elif test -d "$file"; then
5937 elif test "$rmforce" = yes; then
5945 # Possibly a libtool archive, so verify it.
5946 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5949 # Delete the libtool libraries and symlinks.
5950 for n in $library_names; do
5951 rmfiles="$rmfiles $objdir/$n"
5953 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5954 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5956 if test "$mode" = uninstall; then
5957 if test -n "$library_names"; then
5958 # Do each command in the postuninstall commands.
5959 eval cmds=\"$postuninstall_cmds\"
5960 save_ifs="$IFS"; IFS='~'
5961 for cmd in $cmds; do
5965 if test "$?" -ne 0 && test "$rmforce" != yes; then
5972 if test -n "$old_library"; then
5973 # Do each command in the old_postuninstall commands.
5974 eval cmds=\"$old_postuninstall_cmds\"
5975 save_ifs="$IFS"; IFS='~'
5976 for cmd in $cmds; do
5980 if test "$?" -ne 0 && test "$rmforce" != yes; then
5986 # FIXME: should reinstall the best remaining shared library.
5992 # Possibly a libtool object, so verify it.
5993 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5998 # Add PIC object to the list of files to remove.
5999 if test -n "$pic_object" \
6000 && test "$pic_object" != none; then
6001 rmfiles="$rmfiles $dir/$pic_object"
6004 # Add non-PIC object to the list of files to remove.
6005 if test -n "$non_pic_object" \
6006 && test "$non_pic_object" != none; then
6007 rmfiles="$rmfiles $dir/$non_pic_object"
6013 if test "$mode" = clean ; then
6017 file=`$echo $file|${SED} 's,.exe$,,'`
6018 noexename=`$echo $name|${SED} 's,.exe$,,'`
6019 # $file with .exe has already been added to rmfiles,
6020 # add $file without .exe
6021 rmfiles="$rmfiles $file"
6024 # Do a test to see if this is a libtool program.
6025 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6029 # note $name still contains .exe if it was in $file originally
6030 # as does the version of $file that was added into $rmfiles
6031 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6032 if test "$fast_install" = yes && test -n "$relink_command"; then
6033 rmfiles="$rmfiles $objdir/lt-$name"
6035 if test "X$noexename" != "X$name" ; then
6036 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6042 $show "$rm $rmfiles"
6043 $run $rm $rmfiles || exit_status=1
6045 objdir="$origobjdir"
6047 # Try to remove the ${objdir}s in the directories where we deleted files
6048 for dir in $rmdirs; do
6049 if test -d "$dir"; then
6051 $run rmdir $dir >/dev/null 2>&1
6059 $echo "$modename: you must specify a MODE" 1>&2
6060 $echo "$generic_help" 1>&2
6065 if test -z "$exec_cmd"; then
6066 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6067 $echo "$generic_help" 1>&2
6070 fi # test -z "$show_help"
6072 if test -n "$exec_cmd"; then
6077 # We need to display help for each of the modes.
6080 "Usage: $modename [OPTION]... [MODE-ARG]...
6082 Provide generalized library-building support services.
6084 --config show all configuration variables
6085 --debug enable verbose shell tracing
6086 -n, --dry-run display commands without modifying any files
6087 --features display basic configuration information and exit
6088 --finish same as \`--mode=finish'
6089 --help display this help message and exit
6090 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6091 --quiet same as \`--silent'
6092 --silent don't print informational messages
6093 --tag=TAG use configuration variables from tag TAG
6094 --version print version information
6096 MODE must be one of the following:
6098 clean remove files from the build directory
6099 compile compile a source file into a libtool object
6100 execute automatically set library path, then run a program
6101 finish complete the installation of libtool libraries
6102 install install libraries or executables
6103 link create a library or an executable
6104 uninstall remove libraries from an installed directory
6106 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6107 a more detailed description of MODE.
6109 Report bugs to <bug-libtool@gnu.org>."
6115 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6117 Remove files from the build directory.
6119 RM is the name of the program to use to delete files associated with each FILE
6120 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6123 If FILE is a libtool library, object or program, all the files associated
6124 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6129 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6131 Compile a source file into a libtool library object.
6133 This mode accepts the following additional options:
6135 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6136 -prefer-pic try to building PIC objects only
6137 -prefer-non-pic try to building non-PIC objects only
6138 -static always build a \`.o' file suitable for static linking
6140 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6141 from the given SOURCEFILE.
6143 The output file name is determined by removing the directory component from
6144 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6145 library object suffix, \`.lo'."
6150 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6152 Automatically set library path, then run a program.
6154 This mode accepts the following additional options:
6156 -dlopen FILE add the directory containing FILE to the library path
6158 This mode sets the library path environment variable according to \`-dlopen'
6161 If any of the ARGS are libtool executable wrappers, then they are translated
6162 into their corresponding uninstalled binary, and any of their required library
6163 directories are added to the library path.
6165 Then, COMMAND is executed, with ARGS as arguments."
6170 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6172 Complete the installation of libtool libraries.
6174 Each LIBDIR is a directory that contains libtool libraries.
6176 The commands that this mode executes may require superuser privileges. Use
6177 the \`--dry-run' option if you just want to see what would be executed."
6182 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6184 Install executables or libraries.
6186 INSTALL-COMMAND is the installation command. The first component should be
6187 either the \`install' or \`cp' program.
6189 The rest of the components are interpreted as arguments to that command (only
6190 BSD-compatible install options are recognized)."
6195 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6197 Link object files or libraries together to form another library, or to
6198 create an executable program.
6200 LINK-COMMAND is a command using the C compiler that you would use to create
6201 a program from several object files.
6203 The following components of LINK-COMMAND are treated specially:
6205 -all-static do not do any dynamic linking at all
6206 -avoid-version do not add a version suffix if possible
6207 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6208 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6209 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6210 -export-symbols SYMFILE
6211 try to export only the symbols listed in SYMFILE
6212 -export-symbols-regex REGEX
6213 try to export only the symbols matching REGEX
6214 -LLIBDIR search LIBDIR for required installed libraries
6215 -lNAME OUTPUT-FILE requires the installed library libNAME
6216 -module build a library that can dlopened
6217 -no-fast-install disable the fast-install mode
6218 -no-install link a not-installable executable
6219 -no-undefined declare that a library does not refer to external symbols
6220 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6221 -objectlist FILE Use a list of object files found in FILE to specify objects
6222 -release RELEASE specify package release information
6223 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6224 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6225 -static do not do any dynamic linking of libtool libraries
6226 -version-info CURRENT[:REVISION[:AGE]]
6227 specify library version info [each variable defaults to 0]
6229 All other options (arguments beginning with \`-') are ignored.
6231 Every other argument is treated as a filename. Files ending in \`.la' are
6232 treated as uninstalled libtool libraries, other files are standard or library
6235 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6236 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6237 required, except when creating a convenience library.
6239 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6240 using \`ar' and \`ranlib', or on Windows using \`lib'.
6242 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6243 is created, otherwise an executable program is created."
6248 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6250 Remove libraries from an installation directory.
6252 RM is the name of the program to use to delete files associated with each FILE
6253 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6256 If FILE is a libtool library, all the files associated with it are deleted.
6257 Otherwise, only FILE itself is deleted using RM."
6261 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6268 $echo "Try \`$modename --help' for more information about other modes."
6272 # The TAGs below are defined such that we never get into a situation
6273 # in which we disable both kinds of libraries. Given conflicting
6274 # choices, we go for a static library, that is the most portable,
6275 # since we can't tell whether shared libraries were disabled because
6276 # the user asked for that or because the platform doesn't support
6277 # them. This is particularly important on AIX, because we don't
6278 # support having both static and shared libraries enabled at the same
6279 # time on that platform, so we default to a shared-only configuration.
6280 # If a disable-shared tag is given, we'll fallback to a static-only
6281 # configuration. But we'll never go from static-only to shared-only.
6283 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6284 build_libtool_libs=no
6286 # ### END LIBTOOL TAG CONFIG: disable-shared
6288 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6289 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6290 # ### END LIBTOOL TAG CONFIG: disable-static