1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # define SED for historic ltconfig's generated by Libtool 1.3
52 test -z "$SED" && SED=sed
54 # The name of this program.
55 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
62 TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
65 help="Try \`$progname --help' for more information."
66 magic="%%%MAGIC variable%%%"
71 # Sed substitution that helps us do robust quoting. It backslashifies
72 # metacharacters that are still active within double-quoted strings.
73 Xsed="${SED}"' -e 1s/^X//'
74 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
75 # test EBCDIC or ASCII
76 case `echo A|od -x` in
77 *[Cc]1*) # EBCDIC based system
78 SP2NL="tr '\100' '\n'"
79 NL2SP="tr '\r\n' '\100\100'"
81 *) # Assume ASCII based system
82 SP2NL="tr '\040' '\012'"
83 NL2SP="tr '\015\012' '\040\040'"
88 # Only set LANG and LC_ALL to C if already set.
89 # These must not be set unconditionally because not all systems understand
90 # e.g. LANG=C (notably SCO).
91 # We save the old values to restore during execute mode.
92 if test "${LC_ALL+set}" = set; then
93 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
95 if test "${LANG+set}" = set; then
96 save_LANG="$LANG"; LANG=C; export LANG
99 # Make sure IFS has a sensible default
102 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
103 $echo "$modename: not configured to build any kind of library" 1>&2
104 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
117 lo2o="s/\\.lo\$/.${objext}/"
118 o2lo="s/\\.${objext}\$/.lo/"
120 #####################################
121 # Shell function definitions:
122 # This seems to be the best place for them
124 # Need a lot of goo to handle *both* DLLs and import libs
125 # Has to be a shell function in order to 'eat' the argument
126 # that is supplied when $file_magic_command is called.
128 win32_libid_type="unknown"
129 win32_fileres=`file -L $1 2>/dev/null`
130 case $win32_fileres in
131 *ar\ archive\ import\ library*) # definitely import
132 win32_libid_type="x86 archive import"
134 *ar\ archive*) # could be an import, or static
135 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
136 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
137 win32_nmres=`eval $NM -f posix -A $1 | \
138 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
139 if test "X$win32_nmres" = "Ximport" ; then
140 win32_libid_type="x86 archive import"
142 win32_libid_type="x86 archive static"
147 win32_libid_type="x86 DLL"
149 *executable*) # but shell scripts are "executable" too...
150 case $win32_fileres in
151 *MS\ Windows\ PE\ Intel*)
152 win32_libid_type="x86 DLL"
157 $echo $win32_libid_type
160 # End of Shell function definitions
161 #####################################
163 # Parse our command line options once, thoroughly.
164 while test "$#" -gt 0
170 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
174 # If the previous option needs an argument, assign it.
175 if test -n "$prev"; then
178 execute_dlfiles="$execute_dlfiles $arg"
183 # Check whether tagname contains only valid characters
186 $echo "$progname: invalid tag name: $tagname" 1>&2
193 # Don't test for the "default" C tag, as we know, it's there, but
194 # not specially marked.
197 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
198 taglist="$taglist $tagname"
199 # Evaluate the configuration.
200 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
202 $echo "$progname: ignoring unknown tag $tagname" 1>&2
217 # Have we seen a non-optional argument yet?
224 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
226 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
227 $echo "This is free software; see the source for copying conditions. There is NO"
228 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
233 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
234 # Now print the configurations for the tags.
235 for tagname in $taglist; do
236 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
242 $echo "$progname: enabling shell trace mode"
252 if test "$build_libtool_libs" = yes; then
253 $echo "enable shared libraries"
255 $echo "disable shared libraries"
257 if test "$build_old_libs" = yes; then
258 $echo "enable static libraries"
260 $echo "disable static libraries"
265 --finish) mode="finish" ;;
267 --mode) prevopt="--mode" prev=mode ;;
268 --mode=*) mode="$optarg" ;;
270 --preserve-dup-deps) duplicate_deps="yes" ;;
276 --tag) prevopt="--tag" prev=tag ;;
278 set tag "$optarg" ${1+"$@"}
289 $echo "$modename: unrecognized option \`$arg'" 1>&2
301 if test -n "$prevopt"; then
302 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
307 # If this variable is set in any of the actions, the command in it
308 # will be execed at the end. This prevents here-documents from being
309 # left over by shells.
312 if test -z "$show_help"; then
314 # Infer the operation mode.
315 if test -z "$mode"; then
316 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
317 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
319 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
331 *db | *dbx | *strace | *truss)
341 # If we have no mode, but dlfiles were specified, then do execute mode.
342 test -n "$execute_dlfiles" && mode=execute
344 # Just use the default operation mode.
345 if test -z "$mode"; then
346 if test -n "$nonopt"; then
347 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
349 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
356 # Only execute mode is allowed to have -dlopen flags.
357 if test -n "$execute_dlfiles" && test "$mode" != execute; then
358 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
363 # Change the help message to a mode-specific one.
365 help="Try \`$modename --help --mode=$mode' for more information."
367 # These modes are in order of execution frequency so that they run quickly.
369 # libtool compile mode
371 modename="$modename: compile"
372 # Get the compilation command and the source file.
374 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
383 # do not "continue". Instead, add this to base_compile
395 # Accept any command-line options.
398 if test -n "$libobj" ; then
399 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
422 arg_mode=arg # the next one goes into the "base_compile" arg list
423 continue # The current "srcfile" will either be retained or
424 ;; # replaced later. I would guess that would be a bug.
427 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
429 save_ifs="$IFS"; IFS=','
433 # Double-quote args containing other shell metacharacters.
434 # Many Bourne shells cannot handle close brackets correctly
435 # in scan sets, so we specify it separately.
437 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
441 lastarg="$lastarg $arg"
444 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
446 # Add the arguments to base_compile.
447 base_compile="$base_compile $lastarg"
452 # Accept the current argument as the source file.
453 # The previous "srcfile" becomes the current argument.
460 esac # case $arg_mode
462 # Aesthetically quote the previous argument.
463 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
466 # Double-quote args containing other shell metacharacters.
467 # Many Bourne shells cannot handle close brackets correctly
468 # in scan sets, so we specify it separately.
469 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
470 lastarg="\"$lastarg\""
474 base_compile="$base_compile $lastarg"
479 $echo "$modename: you must specify an argument for -Xcompile"
483 $echo "$modename: you must specify a target with \`-o'" 1>&2
487 # Get the name of the library object.
488 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
492 # Recognize several different file suffixes.
493 # If the user specifies -o file.o, it is replaced with file.lo
503 *.class) xform=class ;;
508 *.java) xform=java ;;
511 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
514 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
516 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
521 # Infer tagged configuration to use if any are available and
522 # if one wasn't chosen via the "--tag" command line option.
523 # Only attempt this if the compiler in the base compile
524 # command doesn't match the default compiler.
525 if test -n "$available_tags" && test -z "$tagname"; then
526 case $base_compile in
527 # Blanks in the command may have been stripped by the calling shell,
528 # but not from the CC environment variable when configure was run.
529 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
530 # Blanks at the start of $base_compile will cause this to fail
531 # if we don't check for them as well.
533 for z in $available_tags; do
534 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
535 # Evaluate the configuration.
536 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
537 case "$base_compile " in
538 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
539 # The compiler in the base compile command matches
540 # the one in the tagged configuration.
541 # Assume this is the tagged configuration we want.
548 # If $tagname still isn't set, then no tagged configuration
549 # was found and let the user know that the "--tag" command
550 # line option must be used.
551 if test -z "$tagname"; then
552 $echo "$modename: unable to infer tagged configuration"
553 $echo "$modename: specify a tag with \`--tag'" 1>&2
556 # $echo "$modename: using $tagname tagged configuration"
562 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
563 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
564 if test "X$xdir" = "X$obj"; then
569 lobj=${xdir}$objdir/$objname
571 if test -z "$base_compile"; then
572 $echo "$modename: you must specify a compilation command" 1>&2
577 # Delete any leftover library objects.
578 if test "$build_old_libs" = yes; then
579 removelist="$obj $lobj $libobj ${libobj}T"
581 removelist="$lobj $libobj ${libobj}T"
585 trap "$run $rm $removelist; exit 1" 1 2 15
587 # On Cygwin there's no "real" PIC flag so we must build both object types
589 cygwin* | mingw* | pw32* | os2*)
593 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
594 # non-PIC code in shared libraries is not supported
598 # Calculate the filename of the output object if compiler does
599 # not support -o with -c
600 if test "$compiler_c_o" = no; then
601 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
602 lockfile="$output_obj.lock"
603 removelist="$removelist $output_obj $lockfile"
604 trap "$run $rm $removelist; exit 1" 1 2 15
611 # Lock this critical section if it is needed
612 # We use this script file to make the link, it avoids creating a new file
613 if test "$need_locks" = yes; then
614 until $run ln "$0" "$lockfile" 2>/dev/null; do
615 $show "Waiting for $lockfile to be removed"
618 elif test "$need_locks" = warn; then
619 if test -f "$lockfile"; then
621 *** ERROR, $lockfile exists and contains:
622 `cat $lockfile 2>/dev/null`
624 This indicates that another process is trying to use the same
625 temporary object file, and libtool could not work around it because
626 your compiler does not support \`-c' and \`-o' together. If you
627 repeat this compilation, it may succeed, by chance, but you had better
628 avoid parallel builds (make -j) in this platform, or get a better
634 $echo $srcfile > "$lockfile"
637 if test -n "$fix_srcfile_path"; then
638 eval srcfile=\"$fix_srcfile_path\"
641 $run $rm "$libobj" "${libobj}T"
643 # Create a libtool object file (analogous to a ".la" file),
644 # but don't create it if we're doing a dry run.
645 test -z "$run" && cat > ${libobj}T <<EOF
646 # $libobj - a libtool object file
647 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
649 # Please DO NOT delete this file!
650 # It is necessary for linking the library.
652 # Name of the PIC object.
655 # Only build a PIC object if we are building libtool libraries.
656 if test "$build_libtool_libs" = yes; then
657 # Without this assignment, base_compile gets emptied.
658 fbsd_hideous_sh_bug=$base_compile
660 if test "$pic_mode" != no; then
661 command="$base_compile $srcfile $pic_flag"
663 # Don't build PIC code
664 command="$base_compile $srcfile"
667 if test ! -d "${xdir}$objdir"; then
668 $show "$mkdir ${xdir}$objdir"
669 $run $mkdir ${xdir}$objdir
671 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
676 if test -z "$output_obj"; then
677 # Place PIC objects in $objdir
678 command="$command -o $lobj"
681 $run $rm "$lobj" "$output_obj"
684 if $run eval "$command"; then :
686 test -n "$output_obj" && $run $rm $removelist
690 if test "$need_locks" = warn &&
691 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
693 *** ERROR, $lockfile contains:
694 `cat $lockfile 2>/dev/null`
696 but it should contain:
699 This indicates that another process is trying to use the same
700 temporary object file, and libtool could not work around it because
701 your compiler does not support \`-c' and \`-o' together. If you
702 repeat this compilation, it may succeed, by chance, but you had better
703 avoid parallel builds (make -j) in this platform, or get a better
710 # Just move the object if needed, then go on to compile the next one
711 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
712 $show "$mv $output_obj $lobj"
713 if $run $mv $output_obj $lobj; then :
721 # Append the name of the PIC object to the libtool object file.
722 test -z "$run" && cat >> ${libobj}T <<EOF
723 pic_object='$objdir/$objname'
727 # Allow error messages only from the first compilation.
728 suppress_output=' >/dev/null 2>&1'
730 # No PIC object so indicate it doesn't exist in the libtool
732 test -z "$run" && cat >> ${libobj}T <<EOF
738 # Only build a position-dependent object if we build old libraries.
739 if test "$build_old_libs" = yes; then
740 if test "$pic_mode" != yes; then
741 # Don't build PIC code
742 command="$base_compile $srcfile"
744 command="$base_compile $srcfile $pic_flag"
746 if test "$compiler_c_o" = yes; then
747 command="$command -o $obj"
750 # Suppress compiler output if we already did a PIC compilation.
751 command="$command$suppress_output"
752 $run $rm "$obj" "$output_obj"
754 if $run eval "$command"; then :
760 if test "$need_locks" = warn &&
761 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
763 *** ERROR, $lockfile contains:
764 `cat $lockfile 2>/dev/null`
766 but it should contain:
769 This indicates that another process is trying to use the same
770 temporary object file, and libtool could not work around it because
771 your compiler does not support \`-c' and \`-o' together. If you
772 repeat this compilation, it may succeed, by chance, but you had better
773 avoid parallel builds (make -j) in this platform, or get a better
780 # Just move the object if needed
781 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
782 $show "$mv $output_obj $obj"
783 if $run $mv $output_obj $obj; then :
791 # Append the name of the non-PIC object the libtool object file.
792 # Only append if the libtool object file exists.
793 test -z "$run" && cat >> ${libobj}T <<EOF
794 # Name of the non-PIC object.
795 non_pic_object='$objname'
799 # Append the name of the non-PIC object the libtool object file.
800 # Only append if the libtool object file exists.
801 test -z "$run" && cat >> ${libobj}T <<EOF
802 # Name of the non-PIC object.
808 $run $mv "${libobj}T" "${libobj}"
810 # Unlock the critical section if it was locked
811 if test "$need_locks" != no; then
820 modename="$modename: link"
822 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
823 # It is impossible to link a dll without this setting, and
824 # we shouldn't force the makefile maintainer to figure out
825 # which system we are compiling for in order to pass an extra
826 # flag for every libtool invocation.
829 # FIXME: Unfortunately, there are problems with the above when trying
830 # to make a dll which has undefined symbols, in which case not
831 # even a static library is built. For now, we need to specify
832 # -no-undefined on the libtool link line when we can be certain
833 # that all symbols are satisfied, otherwise we get a static library.
840 libtool_args="$nonopt"
841 base_compile="$nonopt"
842 compile_command="$nonopt"
843 finalize_command="$nonopt"
856 lib_search_path=`pwd`
865 export_symbols_regex=
873 prefer_static_libs=no
886 # We need to know -static, to get the right output filenames.
890 -all-static | -static)
891 if test "X$arg" = "X-all-static"; then
892 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
893 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
895 if test -n "$link_static_flag"; then
896 dlopen_self=$dlopen_self_static
899 if test -z "$pic_flag" && test -n "$link_static_flag"; then
900 dlopen_self=$dlopen_self_static
903 build_libtool_libs=no
905 prefer_static_libs=yes
911 # See if our shared archives depend on static archives.
912 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
914 # Go through the arguments, transforming them on the way.
915 while test "$#" -gt 0; do
917 base_compile="$base_compile $arg"
920 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
921 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
925 libtool_args="$libtool_args $qarg"
927 # If the previous option needs an argument, assign it.
928 if test -n "$prev"; then
931 compile_command="$compile_command @OUTPUT@"
932 finalize_command="$finalize_command @OUTPUT@"
938 if test "$preload" = no; then
939 # Add the symbol object into the linking commands.
940 compile_command="$compile_command @SYMFILE@"
941 finalize_command="$finalize_command @SYMFILE@"
945 *.la | *.lo) ;; # We handle these cases below.
947 if test "$dlself" = no; then
955 if test "$prev" = dlprefiles; then
957 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
967 if test "$prev" = dlfiles; then
968 dlfiles="$dlfiles $arg"
970 dlprefiles="$dlprefiles $arg"
978 export_symbols="$arg"
979 if test ! -f "$arg"; then
980 $echo "$modename: symbol file \`$arg' does not exist"
987 export_symbols_regex="$arg"
992 inst_prefix_dir="$arg"
1002 if test -f "$arg"; then
1005 for fil in `cat $save_arg`
1007 # moreargs="$moreargs $fil"
1009 # A libtool-controlled object.
1011 # Check to see that this really is a libtool object.
1012 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1017 # If there is no directory component, then add one.
1019 */* | *\\*) . $arg ;;
1023 if test -z "$pic_object" || \
1024 test -z "$non_pic_object" ||
1025 test "$pic_object" = none && \
1026 test "$non_pic_object" = none; then
1027 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1031 # Extract subdirectory from the argument.
1032 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1033 if test "X$xdir" = "X$arg"; then
1039 if test "$pic_object" != none; then
1040 # Prepend the subdirectory the object is found in.
1041 pic_object="$xdir$pic_object"
1043 if test "$prev" = dlfiles; then
1044 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1045 dlfiles="$dlfiles $pic_object"
1049 # If libtool objects are unsupported, then we need to preload.
1054 # CHECK ME: I think I busted this. -Ossama
1055 if test "$prev" = dlprefiles; then
1056 # Preload the old-style object.
1057 dlprefiles="$dlprefiles $pic_object"
1062 libobjs="$libobjs $pic_object"
1067 if test "$non_pic_object" != none; then
1068 # Prepend the subdirectory the object is found in.
1069 non_pic_object="$xdir$non_pic_object"
1071 # A standard non-PIC object
1072 non_pic_objects="$non_pic_objects $non_pic_object"
1073 if test -z "$pic_object" || test "$pic_object" = none ; then
1074 arg="$non_pic_object"
1078 # Only an error if not doing a dry-run.
1079 if test -z "$run"; then
1080 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1085 # Extract subdirectory from the argument.
1086 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1087 if test "X$xdir" = "X$arg"; then
1093 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1094 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1095 libobjs="$libobjs $pic_object"
1096 non_pic_objects="$non_pic_objects $non_pic_object"
1101 $echo "$modename: link input file \`$save_arg' does not exist"
1109 # We need an absolute path.
1111 [\\/]* | [A-Za-z]:[\\/]*) ;;
1113 $echo "$modename: only absolute run-paths are allowed" 1>&2
1117 if test "$prev" = rpath; then
1120 *) rpath="$rpath $arg" ;;
1125 *) xrpath="$xrpath $arg" ;;
1132 compiler_flags="$compiler_flags $qarg"
1134 compile_command="$compile_command $qarg"
1135 finalize_command="$finalize_command $qarg"
1139 linker_flags="$linker_flags $qarg"
1140 compiler_flags="$compiler_flags $wl$qarg"
1142 compile_command="$compile_command $wl$qarg"
1143 finalize_command="$finalize_command $wl$qarg"
1147 linker_flags="$linker_flags $qarg"
1148 compiler_flags="$compiler_flags $qarg"
1150 compile_command="$compile_command $qarg"
1151 finalize_command="$finalize_command $qarg"
1155 eval "$prev=\"\$arg\""
1160 fi # test -n "$prev"
1166 if test -n "$link_static_flag"; then
1167 compile_command="$compile_command $link_static_flag"
1168 finalize_command="$finalize_command $link_static_flag"
1174 # FIXME: remove this flag sometime in the future.
1175 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1199 -export-symbols | -export-symbols-regex)
1200 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1201 $echo "$modename: more than one -exported-symbols argument is not allowed"
1204 if test "X$arg" = "X-export-symbols"; then
1217 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1218 # so, if we see these flags be careful not to treat them like -L
1220 case $with_gcc/$host in
1221 no/*-*-irix* | /*-*-irix*)
1222 compile_command="$compile_command $arg"
1223 finalize_command="$finalize_command $arg"
1230 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1231 # We need an absolute path.
1233 [\\/]* | [A-Za-z]:[\\/]*) ;;
1235 absdir=`cd "$dir" && pwd`
1236 if test -z "$absdir"; then
1237 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1246 deplibs="$deplibs -L$dir"
1247 lib_search_path="$lib_search_path $dir"
1251 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1252 case :$dllsearchpath: in
1254 *) dllsearchpath="$dllsearchpath:$dir";;
1262 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1264 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1265 # These systems don't actually have a C or math library (as such)
1268 *-*-mingw* | *-*-os2*)
1269 # These systems don't actually have a C library (as such)
1270 test "X$arg" = "X-lc" && continue
1272 *-*-openbsd* | *-*-freebsd*)
1273 # Do not include libc due to us having libc/libc_r.
1274 test "X$arg" = "X-lc" && continue
1276 *-*-rhapsody* | *-*-darwin1.[012])
1277 # Rhapsody C and math libraries are in the System framework
1278 deplibs="$deplibs -framework System"
1281 elif test "X$arg" = "X-lc_r"; then
1283 *-*-openbsd* | *-*-freebsd*)
1284 # Do not include libc_r directly, use -pthread flag.
1289 deplibs="$deplibs $arg"
1298 # gcc -m* arguments should be passed to the linker via $compiler_flags
1299 # in order to pass architecture information to the linker
1300 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1301 # but this is not reliable with gcc because gcc may use -mfoo to
1302 # select a different linker, different libraries, etc, while
1303 # -Wl,-mfoo simply passes -mfoo to the linker.
1305 # Unknown arguments in both finalize_command and compile_command need
1306 # to be aesthetically quoted because they are evaled later.
1307 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1309 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1313 compile_command="$compile_command $arg"
1314 finalize_command="$finalize_command $arg"
1315 if test "$with_gcc" = "yes" ; then
1316 compiler_flags="$compiler_flags $arg"
1333 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1334 # The PATH hackery in wrapper scripts is required on Windows
1335 # in order for the loader to find any dlls it needs.
1336 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1337 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1340 *) no_install=yes ;;
1373 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1374 # We need an absolute path.
1376 [\\/]* | [A-Za-z]:[\\/]*) ;;
1378 $echo "$modename: only absolute run-paths are allowed" 1>&2
1384 *) xrpath="$xrpath $dir" ;;
1390 # The effects of -static are defined in a previous loop.
1391 # We used to do the same as -all-static on platforms that
1392 # didn't have a PIC flag, but the assumption that the effects
1393 # would be equivalent was wrong. It would break on at least
1394 # Digital Unix and AIX.
1414 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1416 save_ifs="$IFS"; IFS=','
1417 for flag in $args; do
1420 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1425 compiler_flags="$compiler_flags $flag"
1428 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1432 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1434 save_ifs="$IFS"; IFS=','
1435 for flag in $args; do
1438 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1443 compiler_flags="$compiler_flags $wl$flag"
1444 linker_flags="$linker_flags $flag"
1447 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1465 # Some other compiler flag.
1467 # Unknown arguments in both finalize_command and compile_command need
1468 # to be aesthetically quoted because they are evaled later.
1469 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1471 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1478 # A standard object.
1483 # A libtool-controlled object.
1485 # Check to see that this really is a libtool object.
1486 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1491 # If there is no directory component, then add one.
1493 */* | *\\*) . $arg ;;
1497 if test -z "$pic_object" || \
1498 test -z "$non_pic_object" ||
1499 test "$pic_object" = none && \
1500 test "$non_pic_object" = none; then
1501 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1505 # Extract subdirectory from the argument.
1506 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1507 if test "X$xdir" = "X$arg"; then
1513 if test "$pic_object" != none; then
1514 # Prepend the subdirectory the object is found in.
1515 pic_object="$xdir$pic_object"
1517 if test "$prev" = dlfiles; then
1518 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1519 dlfiles="$dlfiles $pic_object"
1523 # If libtool objects are unsupported, then we need to preload.
1528 # CHECK ME: I think I busted this. -Ossama
1529 if test "$prev" = dlprefiles; then
1530 # Preload the old-style object.
1531 dlprefiles="$dlprefiles $pic_object"
1536 libobjs="$libobjs $pic_object"
1541 if test "$non_pic_object" != none; then
1542 # Prepend the subdirectory the object is found in.
1543 non_pic_object="$xdir$non_pic_object"
1545 # A standard non-PIC object
1546 non_pic_objects="$non_pic_objects $non_pic_object"
1547 if test -z "$pic_object" || test "$pic_object" = none ; then
1548 arg="$non_pic_object"
1552 # Only an error if not doing a dry-run.
1553 if test -z "$run"; then
1554 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1559 # Extract subdirectory from the argument.
1560 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1561 if test "X$xdir" = "X$arg"; then
1567 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1568 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1569 libobjs="$libobjs $pic_object"
1570 non_pic_objects="$non_pic_objects $non_pic_object"
1577 deplibs="$deplibs $arg"
1578 old_deplibs="$old_deplibs $arg"
1583 # A libtool-controlled library.
1585 if test "$prev" = dlfiles; then
1586 # This library was specified with -dlopen.
1587 dlfiles="$dlfiles $arg"
1589 elif test "$prev" = dlprefiles; then
1590 # The library was specified with -dlpreopen.
1591 dlprefiles="$dlprefiles $arg"
1594 deplibs="$deplibs $arg"
1599 # Some other compiler argument.
1601 # Unknown arguments in both finalize_command and compile_command need
1602 # to be aesthetically quoted because they are evaled later.
1603 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1605 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1612 # Now actually substitute the argument into the commands.
1613 if test -n "$arg"; then
1614 compile_command="$compile_command $arg"
1615 finalize_command="$finalize_command $arg"
1617 done # argument parsing loop
1619 if test -n "$prev"; then
1620 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1625 # Infer tagged configuration to use if any are available and
1626 # if one wasn't chosen via the "--tag" command line option.
1627 # Only attempt this if the compiler in the base link
1628 # command doesn't match the default compiler.
1629 if test -n "$available_tags" && test -z "$tagname"; then
1630 case $base_compile in
1631 # Blanks in the command may have been stripped by the calling shell,
1632 # but not from the CC environment variable when configure was run.
1633 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1634 # Blanks at the start of $base_compile will cause this to fail
1635 # if we don't check for them as well.
1637 for z in $available_tags; do
1638 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1639 # Evaluate the configuration.
1640 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1641 case $base_compile in
1642 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1643 # The compiler in $compile_command matches
1644 # the one in the tagged configuration.
1645 # Assume this is the tagged configuration we want.
1652 # If $tagname still isn't set, then no tagged configuration
1653 # was found and let the user know that the "--tag" command
1654 # line option must be used.
1655 if test -z "$tagname"; then
1656 $echo "$modename: unable to infer tagged configuration"
1657 $echo "$modename: specify a tag with \`--tag'" 1>&2
1660 # $echo "$modename: using $tagname tagged configuration"
1666 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1667 eval arg=\"$export_dynamic_flag_spec\"
1668 compile_command="$compile_command $arg"
1669 finalize_command="$finalize_command $arg"
1673 # calculate the name of the file, without its directory
1674 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1675 libobjs_save="$libobjs"
1677 if test -n "$shlibpath_var"; then
1678 # get the directories listed in $shlibpath_var
1679 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1683 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1684 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1686 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1687 if test "X$output_objdir" = "X$output"; then
1688 output_objdir="$objdir"
1690 output_objdir="$output_objdir/$objdir"
1692 # Create the object directory.
1693 if test ! -d "$output_objdir"; then
1694 $show "$mkdir $output_objdir"
1695 $run $mkdir $output_objdir
1697 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1702 # Determine the type of output
1705 $echo "$modename: you must specify an output file" 1>&2
1709 *.$libext) linkmode=oldlib ;;
1710 *.lo | *.$objext) linkmode=obj ;;
1711 *.la) linkmode=lib ;;
1712 *) linkmode=prog ;; # Anything else should be a program.
1716 *cygwin* | *mingw* | *pw32*)
1717 # don't eliminate duplcations in $postdeps and $predeps
1718 duplicate_compiler_generated_deps=yes
1721 duplicate_compiler_generated_deps=$duplicate_deps
1727 # Find all interdependent deplibs by searching for libraries
1728 # that are linked more than once (e.g. -la -lb -la)
1729 for deplib in $deplibs; do
1730 if test "X$duplicate_deps" = "Xyes" ; then
1732 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1735 libs="$libs $deplib"
1738 if test "$linkmode" = lib; then
1739 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1741 # Compute libraries that are listed more than once in $predeps
1742 # $postdeps and mark them as special (i.e., whose duplicates are
1743 # not to be eliminated).
1745 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1746 for pre_post_dep in $predeps $postdeps; do
1747 case "$pre_post_deps " in
1748 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1750 pre_post_deps="$pre_post_deps $pre_post_dep"
1759 need_relink=no # whether we're linking any uninstalled libtool libraries
1760 notinst_deplibs= # not-installed libtool libraries
1761 notinst_path= # paths that contain not-installed libtool libraries
1765 for file in $dlfiles $dlprefiles; do
1769 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1781 passes="conv scan dlopen dlpreopen link"
1786 for pass in $passes; do
1787 if test "$linkmode,$pass" = "lib,link" ||
1788 test "$linkmode,$pass" = "prog,scan"; then
1792 if test "$linkmode" = prog; then
1794 dlopen) libs="$dlfiles" ;;
1795 dlpreopen) libs="$dlprefiles" ;;
1796 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1799 if test "$pass" = dlopen; then
1800 # Collect dlpreopened libraries
1801 save_deplibs="$deplibs"
1804 for deplib in $libs; do
1809 if test "$linkmode" != lib && test "$linkmode" != prog; then
1810 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1813 if test "$pass" = conv; then
1814 deplibs="$deplib $deplibs"
1817 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1818 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1819 # Search the libtool library
1820 lib="$searchdir/lib${name}.la"
1821 if test -f "$lib"; then
1826 if test "$found" != yes; then
1827 # deplib doesn't seem to be a libtool library
1828 if test "$linkmode,$pass" = "prog,link"; then
1829 compile_deplibs="$deplib $compile_deplibs"
1830 finalize_deplibs="$deplib $finalize_deplibs"
1832 deplibs="$deplib $deplibs"
1833 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1836 else # deplib is a libtool library
1837 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1838 # We need to do some special things here, and not later.
1839 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1840 case " $predeps $postdeps " in
1842 if (${SED} -e '2q' $lib |
1843 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1847 */* | *\\*) . $lib ;;
1850 for l in $old_library $library_names; do
1853 if test "X$ll" = "X$old_library" ; then # only static version available
1855 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1856 test "X$ladir" = "X$lib" && ladir="."
1857 lib=$ladir/$old_library
1858 if test "$linkmode,$pass" = "prog,link"; then
1859 compile_deplibs="$deplib $compile_deplibs"
1860 finalize_deplibs="$deplib $finalize_deplibs"
1862 deplibs="$deplib $deplibs"
1863 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1877 deplibs="$deplib $deplibs"
1878 test "$pass" = conv && continue
1879 newdependency_libs="$deplib $newdependency_libs"
1880 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1883 if test "$pass" = conv; then
1884 deplibs="$deplib $deplibs"
1887 if test "$pass" = scan; then
1888 deplibs="$deplib $deplibs"
1889 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1891 compile_deplibs="$deplib $compile_deplibs"
1892 finalize_deplibs="$deplib $finalize_deplibs"
1896 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1902 if test "$pass" = link; then
1903 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1904 # Make sure the xrpath contains only unique directories.
1907 *) xrpath="$xrpath $dir" ;;
1910 deplibs="$deplib $deplibs"
1913 *.la) lib="$deplib" ;;
1915 if test "$pass" = conv; then
1916 deplibs="$deplib $deplibs"
1921 if test "$deplibs_check_method" != pass_all; then
1923 $echo "*** Warning: Trying to link with static lib archive $deplib."
1924 $echo "*** I have the capability to make that library automatically link in when"
1925 $echo "*** you link to this library. But I can only do this if you have a"
1926 $echo "*** shared version of the library, which you do not appear to have"
1927 $echo "*** because the file extensions .$libext of this argument makes me believe"
1928 $echo "*** that it is just a static archive that I should not used here."
1931 $echo "*** Warning: Linking the shared library $output against the"
1932 $echo "*** static library $deplib is not portable!"
1933 deplibs="$deplib $deplibs"
1938 if test "$pass" != link; then
1939 deplibs="$deplib $deplibs"
1941 compile_deplibs="$deplib $compile_deplibs"
1942 finalize_deplibs="$deplib $finalize_deplibs"
1949 if test "$pass" = conv; then
1950 deplibs="$deplib $deplibs"
1951 elif test "$linkmode" = prog; then
1952 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1953 # If there is no dlopen support or we're linking statically,
1954 # we need to preload.
1955 newdlprefiles="$newdlprefiles $deplib"
1956 compile_deplibs="$deplib $compile_deplibs"
1957 finalize_deplibs="$deplib $finalize_deplibs"
1959 newdlfiles="$newdlfiles $deplib"
1969 if test "$found" = yes || test -f "$lib"; then :
1971 $echo "$modename: cannot find the library \`$lib'" 1>&2
1975 # Check to see that this really is a libtool archive.
1976 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1978 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1982 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1983 test "X$ladir" = "X$lib" && ladir="."
1991 # If the library was installed with an old release of libtool,
1992 # it will not redefine variables installed, or shouldnotlink
1998 */* | *\\*) . $lib ;;
2002 if test "$linkmode,$pass" = "lib,link" ||
2003 test "$linkmode,$pass" = "prog,scan" ||
2004 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2005 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2006 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2009 if test "$pass" = conv; then
2010 # Only check for convenience libraries
2011 deplibs="$lib $deplibs"
2012 if test -z "$libdir"; then
2013 if test -z "$old_library"; then
2014 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2017 # It is a libtool convenience library, so add in its objects.
2018 convenience="$convenience $ladir/$objdir/$old_library"
2019 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2021 for deplib in $dependency_libs; do
2022 deplibs="$deplib $deplibs"
2023 if test "X$duplicate_deps" = "Xyes" ; then
2024 case "$tmp_libs " in
2025 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2028 tmp_libs="$tmp_libs $deplib"
2030 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2031 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2038 # Get the name of the library we link against.
2040 for l in $old_library $library_names; do
2043 if test -z "$linklib"; then
2044 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2048 # This library was specified with -dlopen.
2049 if test "$pass" = dlopen; then
2050 if test -z "$libdir"; then
2051 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2054 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2055 # If there is no dlname, no dlopen support or we're linking
2056 # statically, we need to preload. We also need to preload any
2057 # dependent libraries so libltdl's deplib preloader doesn't
2058 # bomb out in the load deplibs phase.
2059 dlprefiles="$dlprefiles $lib $dependency_libs"
2061 newdlfiles="$newdlfiles $lib"
2066 # We need an absolute path.
2068 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2070 abs_ladir=`cd "$ladir" && pwd`
2071 if test -z "$abs_ladir"; then
2072 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2073 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2078 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2080 # Find the relevant object directory and library name.
2081 if test "X$installed" = Xyes; then
2082 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2083 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2092 dir="$ladir/$objdir"
2093 absdir="$abs_ladir/$objdir"
2094 # Remove this search path later
2095 notinst_path="$notinst_path $abs_ladir"
2096 fi # $installed = yes
2097 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2099 # This library was specified with -dlpreopen.
2100 if test "$pass" = dlpreopen; then
2101 if test -z "$libdir"; then
2102 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2105 # Prefer using a static library (so that no silly _DYNAMIC symbols
2106 # are required to link).
2107 if test -n "$old_library"; then
2108 newdlprefiles="$newdlprefiles $dir/$old_library"
2109 # Otherwise, use the dlname, so that lt_dlopen finds it.
2110 elif test -n "$dlname"; then
2111 newdlprefiles="$newdlprefiles $dir/$dlname"
2113 newdlprefiles="$newdlprefiles $dir/$linklib"
2115 fi # $pass = dlpreopen
2117 if test -z "$libdir"; then
2118 # Link the convenience library
2119 if test "$linkmode" = lib; then
2120 deplibs="$dir/$old_library $deplibs"
2121 elif test "$linkmode,$pass" = "prog,link"; then
2122 compile_deplibs="$dir/$old_library $compile_deplibs"
2123 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2125 deplibs="$lib $deplibs" # used for prog,scan pass
2131 if test "$linkmode" = prog && test "$pass" != link; then
2132 newlib_search_path="$newlib_search_path $ladir"
2133 deplibs="$lib $deplibs"
2136 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2137 test "$build_libtool_libs" = no; then
2142 for deplib in $dependency_libs; do
2144 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2146 # Need to link against all dependency_libs?
2147 if test "$linkalldeplibs" = yes; then
2148 deplibs="$deplib $deplibs"
2150 # Need to hardcode shared library paths
2151 # or/and link against static libraries
2152 newdependency_libs="$deplib $newdependency_libs"
2154 if test "X$duplicate_deps" = "Xyes" ; then
2155 case "$tmp_libs " in
2156 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2159 tmp_libs="$tmp_libs $deplib"
2162 fi # $linkmode = prog...
2164 if test "$linkmode,$pass" = "prog,link"; then
2165 if test -n "$library_names" &&
2166 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2167 # We need to hardcode the library path
2168 if test -n "$shlibpath_var"; then
2169 # Make sure the rpath contains only unique directories.
2170 case "$temp_rpath " in
2173 *) temp_rpath="$temp_rpath $dir" ;;
2177 # Hardcode the library path.
2178 # Skip directories that are in the system default run-time
2180 case " $sys_lib_dlsearch_path " in
2183 case "$compile_rpath " in
2185 *) compile_rpath="$compile_rpath $absdir"
2189 case " $sys_lib_dlsearch_path " in
2192 case "$finalize_rpath " in
2194 *) finalize_rpath="$finalize_rpath $libdir"
2198 fi # $linkmode,$pass = prog,link...
2200 if test "$alldeplibs" = yes &&
2201 { test "$deplibs_check_method" = pass_all ||
2202 { test "$build_libtool_libs" = yes &&
2203 test -n "$library_names"; }; }; then
2204 # We only need to search for static libraries
2209 link_static=no # Whether the deplib will be linked statically
2210 if test -n "$library_names" &&
2211 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2212 if test "$installed" = no; then
2213 notinst_deplibs="$notinst_deplibs $lib"
2216 # This is a shared library
2218 # Warn about portability, can't link against -module's on some systems (darwin)
2219 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2221 if test "$linkmode" = prog; then
2222 $echo "*** Warning: Linking the executable $output against the loadable module"
2224 $echo "*** Warning: Linking the shared library $output against the loadable module"
2226 $echo "*** $linklib is not portable!"
2228 if test "$linkmode" = lib &&
2229 test "$hardcode_into_libs" = yes; then
2230 # Hardcode the library path.
2231 # Skip directories that are in the system default run-time
2233 case " $sys_lib_dlsearch_path " in
2236 case "$compile_rpath " in
2238 *) compile_rpath="$compile_rpath $absdir"
2242 case " $sys_lib_dlsearch_path " in
2245 case "$finalize_rpath " in
2247 *) finalize_rpath="$finalize_rpath $libdir"
2253 if test -n "$old_archive_from_expsyms_cmds"; then
2254 # figure out the soname
2255 set dummy $library_names
2258 libname=`eval \\$echo \"$libname_spec\"`
2259 # use dlname if we got it. it's perfectly good, no?
2260 if test -n "$dlname"; then
2262 elif test -n "$soname_spec"; then
2266 major=`expr $current - $age`
2270 eval soname=\"$soname_spec\"
2275 # Make a new name for the extract_expsyms_cmds to use
2277 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2278 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2280 # If the library has no export list, then create one now
2281 if test -f "$output_objdir/$soname-def"; then :
2283 $show "extracting exported symbol list from \`$soname'"
2284 save_ifs="$IFS"; IFS='~'
2285 eval cmds=\"$extract_expsyms_cmds\"
2286 for cmd in $cmds; do
2289 $run eval "$cmd" || exit $?
2295 if test -f "$output_objdir/$newlib"; then :; else
2296 $show "generating import library for \`$soname'"
2297 save_ifs="$IFS"; IFS='~'
2298 eval cmds=\"$old_archive_from_expsyms_cmds\"
2299 for cmd in $cmds; do
2302 $run eval "$cmd" || exit $?
2306 # make sure the library variables are pointing to the new library
2309 fi # test -n "$old_archive_from_expsyms_cmds"
2311 if test "$linkmode" = prog || test "$mode" != relink; then
2316 case $hardcode_action in
2317 immediate | unsupported)
2318 if test "$hardcode_direct" = no; then
2321 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2323 # if the lib is a module then we can not link against it, someone
2324 # is ignoring the new warnings I added
2325 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2326 $echo "** Warning, lib $linklib is a module, not a shared library"
2327 if test -z "$old_library" ; then
2329 $echo "** And there doesn't seem to be a static archive available"
2330 $echo "** The link will probably fail, sorry"
2332 add="$dir/$old_library"
2336 elif test "$hardcode_minus_L" = no; then
2338 *-*-sunos*) add_shlibpath="$dir" ;;
2342 elif test "$hardcode_shlibpath_var" = no; then
2343 add_shlibpath="$dir"
2350 if test "$hardcode_direct" = yes; then
2352 elif test "$hardcode_minus_L" = yes; then
2354 # Try looking first in the location we're being installed to.
2355 if test -n "$inst_prefix_dir"; then
2358 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2363 elif test "$hardcode_shlibpath_var" = yes; then
2364 add_shlibpath="$dir"
2373 if test "$lib_linked" != yes; then
2374 $echo "$modename: configuration error: unsupported hardcode properties"
2378 if test -n "$add_shlibpath"; then
2379 case :$compile_shlibpath: in
2380 *":$add_shlibpath:"*) ;;
2381 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2384 if test "$linkmode" = prog; then
2385 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2386 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2388 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2389 test -n "$add" && deplibs="$add $deplibs"
2390 if test "$hardcode_direct" != yes && \
2391 test "$hardcode_minus_L" != yes && \
2392 test "$hardcode_shlibpath_var" = yes; then
2393 case :$finalize_shlibpath: in
2395 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2401 if test "$linkmode" = prog || test "$mode" = relink; then
2405 # Finalize command for both is simple: just hardcode it.
2406 if test "$hardcode_direct" = yes; then
2407 add="$libdir/$linklib"
2408 elif test "$hardcode_minus_L" = yes; then
2411 elif test "$hardcode_shlibpath_var" = yes; then
2412 case :$finalize_shlibpath: in
2414 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2417 elif test "$hardcode_automatic" = yes; then
2418 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2419 add="$inst_prefix_dir$libdir/$linklib"
2421 add="$libdir/$linklib"
2424 # We cannot seem to hardcode it, guess we'll fake it.
2426 # Try looking first in the location we're being installed to.
2427 if test -n "$inst_prefix_dir"; then
2430 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2437 if test "$linkmode" = prog; then
2438 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2439 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2441 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2442 test -n "$add" && deplibs="$add $deplibs"
2445 elif test "$linkmode" = prog; then
2446 # Here we assume that one of hardcode_direct or hardcode_minus_L
2447 # is not unsupported. This is valid on all known static and
2449 if test "$hardcode_direct" != unsupported; then
2450 test -n "$old_library" && linklib="$old_library"
2451 compile_deplibs="$dir/$linklib $compile_deplibs"
2452 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2454 compile_deplibs="-l$name -L$dir $compile_deplibs"
2455 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2457 elif test "$build_libtool_libs" = yes; then
2458 # Not a shared library
2459 if test "$deplibs_check_method" != pass_all; then
2460 # We're trying link a shared library against a static one
2461 # but the system doesn't support it.
2463 # Just print a warning and add the library to dependency_libs so
2464 # that the program can be linked against the static library.
2466 $echo "*** Warning: This system can not link to static lib archive $lib."
2467 $echo "*** I have the capability to make that library automatically link in when"
2468 $echo "*** you link to this library. But I can only do this if you have a"
2469 $echo "*** shared version of the library, which you do not appear to have."
2470 if test "$module" = yes; then
2471 $echo "*** But as you try to build a module library, libtool will still create "
2472 $echo "*** a static module, that should work as long as the dlopening application"
2473 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2474 if test -z "$global_symbol_pipe"; then
2476 $echo "*** However, this would only work if libtool was able to extract symbol"
2477 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2478 $echo "*** not find such a program. So, this module is probably useless."
2479 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2481 if test "$build_old_libs" = no; then
2482 build_libtool_libs=module
2485 build_libtool_libs=no
2489 convenience="$convenience $dir/$old_library"
2490 old_convenience="$old_convenience $dir/$old_library"
2491 deplibs="$dir/$old_library $deplibs"
2494 fi # link shared/static library?
2496 if test "$linkmode" = lib; then
2497 if test -n "$dependency_libs" &&
2498 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2499 test "$link_static" = yes; }; then
2500 # Extract -R from dependency_libs
2502 for libdir in $dependency_libs; do
2504 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2506 *" $temp_xrpath "*) ;;
2507 *) xrpath="$xrpath $temp_xrpath";;
2509 *) temp_deplibs="$temp_deplibs $libdir";;
2512 dependency_libs="$temp_deplibs"
2515 newlib_search_path="$newlib_search_path $absdir"
2516 # Link against this library
2517 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2518 # ... and its dependency_libs
2520 for deplib in $dependency_libs; do
2521 newdependency_libs="$deplib $newdependency_libs"
2522 if test "X$duplicate_deps" = "Xyes" ; then
2523 case "$tmp_libs " in
2524 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2527 tmp_libs="$tmp_libs $deplib"
2530 if test "$link_all_deplibs" != no; then
2531 # Add the search paths of all dependency libraries
2532 for deplib in $dependency_libs; do
2534 -L*) path="$deplib" ;;
2536 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2537 test "X$dir" = "X$deplib" && dir="."
2538 # We need an absolute path.
2540 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2542 absdir=`cd "$dir" && pwd`
2543 if test -z "$absdir"; then
2544 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2549 if grep "^installed=no" $deplib > /dev/null; then
2550 path="$absdir/$objdir"
2552 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2553 if test -z "$libdir"; then
2554 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2557 if test "$absdir" != "$libdir"; then
2558 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2565 # we do not want to link against static libs, but need to link against shared
2566 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2567 if test -n "$deplibrary_names" ; then
2568 for tmp in $deplibrary_names ; do
2571 if test -f "$path/$depdepl" ; then
2572 depdepl="$path/$depdepl"
2574 newlib_search_path="$newlib_search_path $path"
2587 # Again, we only want to link against shared libraries
2588 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2589 for tmp in $newlib_search_path ; do
2590 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2591 eval depdepl="$tmp/lib$tmp_libs.dylib"
2602 case " $deplibs " in
2604 *) deplibs="$deplibs $depdepl" ;;
2606 case " $deplibs " in
2608 *) deplibs="$deplibs $path" ;;
2611 fi # link_all_deplibs != no
2613 done # for deplib in $libs
2614 dependency_libs="$newdependency_libs"
2615 if test "$pass" = dlpreopen; then
2616 # Link the dlpreopened libraries before other libraries
2617 for deplib in $save_deplibs; do
2618 deplibs="$deplib $deplibs"
2621 if test "$pass" != dlopen; then
2622 if test "$pass" != conv; then
2623 # Make sure lib_search_path contains only unique directories.
2625 for dir in $newlib_search_path; do
2626 case "$lib_search_path " in
2628 *) lib_search_path="$lib_search_path $dir" ;;
2634 if test "$linkmode,$pass" != "prog,link"; then
2637 vars="compile_deplibs finalize_deplibs"
2639 for var in $vars dependency_libs; do
2640 # Add libraries to $var in reverse order
2641 eval tmp_libs=\"\$$var\"
2643 for deplib in $tmp_libs; do
2644 # FIXME: Pedantically, this is the right thing to do, so
2645 # that some nasty dependency loop isn't accidentally
2647 #new_libs="$deplib $new_libs"
2648 # Pragmatically, this seems to cause very few problems in
2651 -L*) new_libs="$deplib $new_libs" ;;
2654 # And here is the reason: when a library appears more
2655 # than once as an explicit dependence of a library, or
2656 # is implicitly linked in more than once by the
2657 # compiler, it is considered special, and multiple
2658 # occurrences thereof are not removed. Compare this
2659 # with having the same library being listed as a
2660 # dependency of multiple other libraries: in this case,
2661 # we know (pedantically, we assume) the library does not
2662 # need to be listed more than once, so we keep only the
2663 # last copy. This is not always right, but it is rare
2664 # enough that we require users that really mean to play
2665 # such unportable linking tricks to link the library
2666 # using -Wl,-lname, so that libtool does not consider it
2667 # for duplicate removal.
2668 case " $specialdeplibs " in
2669 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2671 case " $new_libs " in
2673 *) new_libs="$deplib $new_libs" ;;
2681 for deplib in $new_libs; do
2684 case " $tmp_libs " in
2686 *) tmp_libs="$tmp_libs $deplib" ;;
2689 *) tmp_libs="$tmp_libs $deplib" ;;
2692 eval $var=\"$tmp_libs\"
2695 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2697 for i in $dependency_libs ; do
2698 case " $predeps $postdeps $compiler_lib_search_path " in
2703 if test -n "$i" ; then
2704 tmp_libs="$tmp_libs $i"
2707 dependency_libs=$tmp_libs
2709 if test "$linkmode" = prog; then
2710 dlfiles="$newdlfiles"
2711 dlprefiles="$newdlprefiles"
2716 if test -n "$deplibs"; then
2717 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2720 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2721 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2724 if test -n "$rpath"; then
2725 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2728 if test -n "$xrpath"; then
2729 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2732 if test -n "$vinfo"; then
2733 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2736 if test -n "$release"; then
2737 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2740 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2741 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2744 # Now set the variables for building old libraries.
2745 build_libtool_libs=no
2747 objs="$objs$old_deplibs"
2751 # Make sure we only generate libraries of the form `libNAME.la'.
2754 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2755 eval shared_ext=\"$shrext\"
2756 eval libname=\"$libname_spec\"
2759 if test "$module" = no; then
2760 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2764 if test "$need_lib_prefix" != no; then
2765 # Add the "lib" prefix for modules if required
2766 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2767 eval shared_ext=\"$shrext\"
2768 eval libname=\"$libname_spec\"
2770 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2775 if test -n "$objs"; then
2776 if test "$deplibs_check_method" != pass_all; then
2777 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2781 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2782 $echo "*** objects $objs is not portable!"
2783 libobjs="$libobjs $objs"
2787 if test "$dlself" != no; then
2788 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2792 if test "$#" -gt 2; then
2793 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2798 if test -z "$rpath"; then
2799 if test "$build_libtool_libs" = yes; then
2800 # Building a libtool convenience library.
2801 # Some compilers have problems with a `.al' extension so
2802 # convenience libraries should have the same extension an
2803 # archive normally would.
2804 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2805 build_libtool_libs=convenience
2809 if test -n "$vinfo"; then
2810 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2813 if test -n "$release"; then
2814 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2818 # Parse the version information argument.
2819 save_ifs="$IFS"; IFS=':'
2820 set dummy $vinfo 0 0 0
2823 if test -n "$8"; then
2824 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2829 # convert absolute version numbers to libtool ages
2830 # this retains compatibility with .la files and attempts
2831 # to make the code below a bit more comprehensible
2833 case $vinfo_number in
2837 number_revision="$4"
2839 # There are really only two kinds -- those that
2840 # use the current revision as the major version
2841 # and those that subtract age and use age as
2842 # a minor version. But, then there is irix
2843 # which has an extra 1 added just for fun
2845 case $version_type in
2846 darwin|linux|osf|windows)
2847 current=`expr $number_major + $number_minor`
2849 revision="$number_revision"
2851 freebsd-aout|freebsd-elf|sunos)
2852 current="$number_major"
2853 revision="$number_minor"
2857 current=`expr $number_major + $number_minor - 1`
2859 revision="$number_minor"
2870 # Check that each of the things are valid numbers.
2874 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2875 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2883 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2884 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2892 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2893 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2898 if test "$age" -gt "$current"; then
2899 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2900 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2904 # Calculate the version variables.
2908 case $version_type in
2912 # Like Linux, but with the current version available in
2913 # verstring for coding it into the library header
2914 major=.`expr $current - $age`
2915 versuffix="$major.$age.$revision"
2916 # Darwin ld doesn't like 0 for these options...
2917 minor_current=`expr $current + 1`
2918 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2923 versuffix=".$current.$revision";
2928 versuffix=".$current";
2932 major=`expr $current - $age + 1`
2934 case $version_type in
2935 nonstopux) verstring_prefix=nonstopux ;;
2936 *) verstring_prefix=sgi ;;
2938 verstring="$verstring_prefix$major.$revision"
2940 # Add in all the interfaces that we are compatible with.
2942 while test "$loop" -ne 0; do
2943 iface=`expr $revision - $loop`
2944 loop=`expr $loop - 1`
2945 verstring="$verstring_prefix$major.$iface:$verstring"
2948 # Before this point, $major must not contain `.'.
2950 versuffix="$major.$revision"
2954 major=.`expr $current - $age`
2955 versuffix="$major.$age.$revision"
2959 major=.`expr $current - $age`
2960 versuffix=".$current.$age.$revision"
2961 verstring="$current.$age.$revision"
2963 # Add in all the interfaces that we are compatible with.
2965 while test "$loop" -ne 0; do
2966 iface=`expr $current - $loop`
2967 loop=`expr $loop - 1`
2968 verstring="$verstring:${iface}.0"
2971 # Make executables depend on our current version.
2972 verstring="$verstring:${current}.0"
2977 versuffix=".$current.$revision"
2981 # Use '-' rather than '.', since we only want one
2982 # extension on DOS 8.3 filesystems.
2983 major=`expr $current - $age`
2988 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2989 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2994 # Clear the version info if we defaulted, and they specified a release.
2995 if test -z "$vinfo" && test -n "$release"; then
2997 case $version_type in
2999 # we can't check for "0.0" in archive_cmds due to quoting
3000 # problems, so we reset it completely
3007 if test "$need_version" = no; then
3014 # Remove version info from name if versioning should be avoided
3015 if test "$avoid_version" = yes && test "$need_version" = no; then
3021 # Check to see if the archive will have undefined symbols.
3022 if test "$allow_undefined" = yes; then
3023 if test "$allow_undefined_flag" = unsupported; then
3024 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3025 build_libtool_libs=no
3029 # Don't allow undefined symbols.
3030 allow_undefined_flag="$no_undefined_flag"
3034 if test "$mode" != relink; then
3035 # Remove our outputs, but don't remove object files since they
3036 # may have been created when compiling PIC objects.
3038 tempremovelist=`$echo "$output_objdir/*"`
3039 for p in $tempremovelist; do
3043 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3044 removelist="$removelist $p"
3049 if test -n "$removelist"; then
3050 $show "${rm}r $removelist"
3051 $run ${rm}r $removelist
3055 # Now set the variables for building old libraries.
3056 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3057 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3059 # Transform .lo files to .o files.
3060 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3063 # Eliminate all temporary directories.
3064 for path in $notinst_path; do
3065 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3066 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3067 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3070 if test -n "$xrpath"; then
3071 # If the user specified any rpath flags, then add them.
3073 for libdir in $xrpath; do
3074 temp_xrpath="$temp_xrpath -R$libdir"
3075 case "$finalize_rpath " in
3077 *) finalize_rpath="$finalize_rpath $libdir" ;;
3080 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3081 dependency_libs="$temp_xrpath $dependency_libs"
3085 # Make sure dlfiles contains only unique files that won't be dlpreopened
3086 old_dlfiles="$dlfiles"
3088 for lib in $old_dlfiles; do
3089 case " $dlprefiles $dlfiles " in
3091 *) dlfiles="$dlfiles $lib" ;;
3095 # Make sure dlprefiles contains only unique files
3096 old_dlprefiles="$dlprefiles"
3098 for lib in $old_dlprefiles; do
3099 case "$dlprefiles " in
3101 *) dlprefiles="$dlprefiles $lib" ;;
3105 if test "$build_libtool_libs" = yes; then
3106 if test -n "$rpath"; then
3108 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3109 # these systems don't actually have a c library (as such)!
3111 *-*-rhapsody* | *-*-darwin1.[012])
3112 # Rhapsody C library is in the System framework
3113 deplibs="$deplibs -framework System"
3116 # Don't link with libc until the a.out ld.so is fixed.
3118 *-*-openbsd* | *-*-freebsd*)
3119 # Do not include libc due to us having libc/libc_r.
3120 test "X$arg" = "X-lc" && continue
3123 # Add libc to deplibs on all other systems if necessary.
3124 if test "$build_libtool_need_lc" = "yes"; then
3125 deplibs="$deplibs -lc"
3131 # Transform deplibs into only deplibs that can be linked in shared.
3133 libname_save=$libname
3134 release_save=$release
3135 versuffix_save=$versuffix
3137 # I'm not sure if I'm treating the release correctly. I think
3138 # release should show up in the -l (ie -lgmp5) so we don't want to
3139 # add it in twice. Is that correct?
3145 case $deplibs_check_method in
3147 # Don't check for shared/static. Everything works.
3148 # This might be a little naive. We might want to check
3149 # whether the library exists or not. But this is on
3150 # osf3 & osf4 and I'm not really sure... Just
3151 # implementing what was already the behavior.
3155 # This code stresses the "libraries are programs" paradigm to its
3156 # limits. Maybe even breaks it. We compile a program, linking it
3157 # against the deplibs as a proxy for the library. Then we can check
3158 # whether they linked in statically or dynamically with ldd.
3160 cat > conftest.c <<EOF
3161 int main() { return 0; }
3164 $LTCC -o conftest conftest.c $deplibs
3165 if test "$?" -eq 0 ; then
3166 ldd_output=`ldd conftest`
3167 for i in $deplibs; do
3168 name="`expr $i : '-l\(.*\)'`"
3169 # If $name is empty we are operating on a -L argument.
3170 if test "$name" != "" && test "$name" -ne "0"; then
3171 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3172 case " $predeps $postdeps " in
3174 newdeplibs="$newdeplibs $i"
3179 if test -n "$i" ; then
3180 libname=`eval \\$echo \"$libname_spec\"`
3181 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3182 set dummy $deplib_matches
3184 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3185 newdeplibs="$newdeplibs $i"
3189 $echo "*** Warning: dynamic linker does not accept needed library $i."
3190 $echo "*** I have the capability to make that library automatically link in when"
3191 $echo "*** you link to this library. But I can only do this if you have a"
3192 $echo "*** shared version of the library, which I believe you do not have"
3193 $echo "*** because a test_compile did reveal that the linker did not use it for"
3194 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3198 newdeplibs="$newdeplibs $i"
3202 # Error occurred in the first compile. Let's try to salvage
3203 # the situation: Compile a separate program for each library.
3204 for i in $deplibs; do
3205 name="`expr $i : '-l\(.*\)'`"
3206 # If $name is empty we are operating on a -L argument.
3207 if test "$name" != "" && test "$name" != "0"; then
3209 $LTCC -o conftest conftest.c $i
3211 if test "$?" -eq 0 ; then
3212 ldd_output=`ldd conftest`
3213 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3214 case " $predeps $postdeps " in
3216 newdeplibs="$newdeplibs $i"
3221 if test -n "$i" ; then
3222 libname=`eval \\$echo \"$libname_spec\"`
3223 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3224 set dummy $deplib_matches
3226 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3227 newdeplibs="$newdeplibs $i"
3231 $echo "*** Warning: dynamic linker does not accept needed library $i."
3232 $echo "*** I have the capability to make that library automatically link in when"
3233 $echo "*** you link to this library. But I can only do this if you have a"
3234 $echo "*** shared version of the library, which you do not appear to have"
3235 $echo "*** because a test_compile did reveal that the linker did not use this one"
3236 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3242 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3243 $echo "*** make it link in! You will probably need to install it or some"
3244 $echo "*** library that it depends on before this library will be fully"
3245 $echo "*** functional. Installing it before continuing would be even better."
3248 newdeplibs="$newdeplibs $i"
3254 set dummy $deplibs_check_method
3255 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3256 for a_deplib in $deplibs; do
3257 name="`expr $a_deplib : '-l\(.*\)'`"
3258 # If $name is empty we are operating on a -L argument.
3259 if test "$name" != "" && test "$name" != "0"; then
3260 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3261 case " $predeps $postdeps " in
3263 newdeplibs="$newdeplibs $a_deplib"
3268 if test -n "$a_deplib" ; then
3269 libname=`eval \\$echo \"$libname_spec\"`
3270 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3271 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3272 for potent_lib in $potential_libs; do
3273 # Follow soft links.
3274 if ls -lLd "$potent_lib" 2>/dev/null \
3275 | grep " -> " >/dev/null; then
3278 # The statement above tries to avoid entering an
3279 # endless loop below, in case of cyclic links.
3280 # We might still enter an endless loop, since a link
3281 # loop can be closed while we follow links,
3283 potlib="$potent_lib"
3284 while test -h "$potlib" 2>/dev/null; do
3285 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3287 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3288 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3291 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3293 | $EGREP "$file_magic_regex" > /dev/null; then
3294 newdeplibs="$newdeplibs $a_deplib"
3301 if test -n "$a_deplib" ; then
3304 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3305 $echo "*** I have the capability to make that library automatically link in when"
3306 $echo "*** you link to this library. But I can only do this if you have a"
3307 $echo "*** shared version of the library, which you do not appear to have"
3308 $echo "*** because I did check the linker path looking for a file starting"
3309 if test -z "$potlib" ; then
3310 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3312 $echo "*** with $libname and none of the candidates passed a file format test"
3313 $echo "*** using a file magic. Last file checked: $potlib"
3317 # Add a -L argument.
3318 newdeplibs="$newdeplibs $a_deplib"
3320 done # Gone through all deplibs.
3323 set dummy $deplibs_check_method
3324 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3325 for a_deplib in $deplibs; do
3326 name="`expr $a_deplib : '-l\(.*\)'`"
3327 # If $name is empty we are operating on a -L argument.
3328 if test -n "$name" && test "$name" != "0"; then
3329 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3330 case " $predeps $postdeps " in
3332 newdeplibs="$newdeplibs $a_deplib"
3337 if test -n "$a_deplib" ; then
3338 libname=`eval \\$echo \"$libname_spec\"`
3339 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3340 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3341 for potent_lib in $potential_libs; do
3342 potlib="$potent_lib" # see symlink-check above in file_magic test
3343 if eval $echo \"$potent_lib\" 2>/dev/null \
3345 | $EGREP "$match_pattern_regex" > /dev/null; then
3346 newdeplibs="$newdeplibs $a_deplib"
3353 if test -n "$a_deplib" ; then
3356 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3357 $echo "*** I have the capability to make that library automatically link in when"
3358 $echo "*** you link to this library. But I can only do this if you have a"
3359 $echo "*** shared version of the library, which you do not appear to have"
3360 $echo "*** because I did check the linker path looking for a file starting"
3361 if test -z "$potlib" ; then
3362 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3364 $echo "*** with $libname and none of the candidates passed a file format test"
3365 $echo "*** using a regex pattern. Last file checked: $potlib"
3369 # Add a -L argument.
3370 newdeplibs="$newdeplibs $a_deplib"
3372 done # Gone through all deplibs.
3376 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3377 -e 's/ -[LR][^ ]*//g'`
3378 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3379 for i in $predeps $postdeps ; do
3380 # can't use Xsed below, because $i might contain '/'
3381 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3384 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3385 | grep . >/dev/null; then
3387 if test "X$deplibs_check_method" = "Xnone"; then
3388 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3390 $echo "*** Warning: inter-library dependencies are not known to be supported."
3392 $echo "*** All declared inter-library dependencies are being dropped."
3397 versuffix=$versuffix_save
3399 release=$release_save
3400 libname=$libname_save
3404 *-*-rhapsody* | *-*-darwin1.[012])
3405 # On Rhapsody replace the C library is the System framework
3406 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3410 if test "$droppeddeps" = yes; then
3411 if test "$module" = yes; then
3413 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3414 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3415 $echo "*** a static module, that should work as long as the dlopening"
3416 $echo "*** application is linked with the -dlopen flag."
3417 if test -z "$global_symbol_pipe"; then
3419 $echo "*** However, this would only work if libtool was able to extract symbol"
3420 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3421 $echo "*** not find such a program. So, this module is probably useless."
3422 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3424 if test "$build_old_libs" = no; then
3425 oldlibs="$output_objdir/$libname.$libext"
3426 build_libtool_libs=module
3429 build_libtool_libs=no
3432 $echo "*** The inter-library dependencies that have been dropped here will be"
3433 $echo "*** automatically added whenever a program is linked with this library"
3434 $echo "*** or is declared to -dlopen it."
3436 if test "$allow_undefined" = no; then
3438 $echo "*** Since this library must not contain undefined symbols,"
3439 $echo "*** because either the platform does not support them or"
3440 $echo "*** it was explicitly requested with -no-undefined,"
3441 $echo "*** libtool will only create a static version of it."
3442 if test "$build_old_libs" = no; then
3443 oldlibs="$output_objdir/$libname.$libext"
3444 build_libtool_libs=module
3447 build_libtool_libs=no
3452 # Done checking deplibs!
3456 # All the library-specific variables (install_libdir is set above).
3461 # Test again, we may have decided not to build it any more
3462 if test "$build_libtool_libs" = yes; then
3463 if test "$hardcode_into_libs" = yes; then
3464 # Hardcode the library paths
3467 rpath="$finalize_rpath"
3468 test "$mode" != relink && rpath="$compile_rpath$rpath"
3469 for libdir in $rpath; do
3470 if test -n "$hardcode_libdir_flag_spec"; then
3471 if test -n "$hardcode_libdir_separator"; then
3472 if test -z "$hardcode_libdirs"; then
3473 hardcode_libdirs="$libdir"
3475 # Just accumulate the unique libdirs.
3476 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3477 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3480 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3485 eval flag=\"$hardcode_libdir_flag_spec\"
3486 dep_rpath="$dep_rpath $flag"
3488 elif test -n "$runpath_var"; then
3489 case "$perm_rpath " in
3491 *) perm_rpath="$perm_rpath $libdir" ;;
3495 # Substitute the hardcoded libdirs into the rpath.
3496 if test -n "$hardcode_libdir_separator" &&
3497 test -n "$hardcode_libdirs"; then
3498 libdir="$hardcode_libdirs"
3499 if test -n "$hardcode_libdir_flag_spec_ld"; then
3500 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3502 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3505 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3506 # We should set the runpath_var.
3508 for dir in $perm_rpath; do
3511 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3513 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3516 shlibpath="$finalize_shlibpath"
3517 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3518 if test -n "$shlibpath"; then
3519 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3522 # Get the real and link names of the library.
3523 eval shared_ext=\"$shrext\"
3524 eval library_names=\"$library_names_spec\"
3525 set dummy $library_names
3529 if test -n "$soname_spec"; then
3530 eval soname=\"$soname_spec\"
3534 if test -z "$dlname"; then
3538 lib="$output_objdir/$realname"
3541 linknames="$linknames $link"
3544 # Use standard objects if they are pic
3545 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3547 # Prepare the list of exported symbols
3548 if test -z "$export_symbols"; then
3549 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3550 $show "generating symbol list for \`$libname.la'"
3551 export_symbols="$output_objdir/$libname.exp"
3552 $run $rm $export_symbols
3553 eval cmds=\"$export_symbols_cmds\"
3554 save_ifs="$IFS"; IFS='~'
3555 for cmd in $cmds; do
3557 if len=`expr "X$cmd" : ".*"` &&
3558 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3560 $run eval "$cmd" || exit $?
3561 skipped_export=false
3563 # The command line is too long to execute in one step.
3564 $show "using reloadable object file for export list..."
3569 if test -n "$export_symbols_regex"; then
3570 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3571 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3572 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3573 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3578 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3579 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3583 for test_deplib in $deplibs; do
3584 case " $convenience " in
3585 *" $test_deplib "*) ;;
3587 tmp_deplibs="$tmp_deplibs $test_deplib"
3591 deplibs="$tmp_deplibs"
3593 if test -n "$convenience"; then
3594 if test -n "$whole_archive_flag_spec"; then
3595 save_libobjs=$libobjs
3596 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3598 gentop="$output_objdir/${outputname}x"
3599 $show "${rm}r $gentop"
3600 $run ${rm}r "$gentop"
3601 $show "$mkdir $gentop"
3602 $run $mkdir "$gentop"
3604 if test "$status" -ne 0 && test ! -d "$gentop"; then
3607 generated="$generated $gentop"
3609 for xlib in $convenience; do
3610 # Extract the objects.
3612 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3613 *) xabs=`pwd`"/$xlib" ;;
3615 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3616 xdir="$gentop/$xlib"
3618 $show "${rm}r $xdir"
3620 $show "$mkdir $xdir"
3623 if test "$status" -ne 0 && test ! -d "$xdir"; then
3626 # We will extract separately just the conflicting names and we will no
3627 # longer touch any unique names. It is faster to leave these extract
3628 # automatically by $AR in one run.
3629 $show "(cd $xdir && $AR x $xabs)"
3630 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3631 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3634 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3635 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3636 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3639 while test "$i" -le "$count"
3641 # Put our $i before any first dot (extension)
3642 # Never overwrite any file
3644 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3646 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3648 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3649 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3655 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3660 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3661 eval flag=\"$thread_safe_flag_spec\"
3662 linker_flags="$linker_flags $flag"
3665 # Make a backup of the uninstalled library when relinking
3666 if test "$mode" = relink; then
3667 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3670 # Do each of the archive commands.
3671 if test "$module" = yes && test -n "$module_cmds" ; then
3672 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3673 eval cmds=\"$module_expsym_cmds\"
3675 eval cmds=\"$module_cmds\"
3678 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3679 eval cmds=\"$archive_expsym_cmds\"
3681 eval cmds=\"$archive_cmds\"
3685 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3686 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3689 # The command line is too long to link in one step, link piecewise.
3690 $echo "creating reloadable object files..."
3692 # Save the value of $output and $libobjs because we want to
3693 # use them later. If we have whole_archive_flag_spec, we
3694 # want to use save_libobjs as it was before
3695 # whole_archive_flag_spec was expanded, because we can't
3696 # assume the linker understands whole_archive_flag_spec.
3697 # This may have to be revisited, in case too many
3698 # convenience libraries get linked in and end up exceeding
3700 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3701 save_libobjs=$libobjs
3705 # Clear the reloadable object creation command queue and
3706 # initialize k to one.
3713 output=$output_objdir/$save_output-${k}.$objext
3714 # Loop over the list of objects to be linked.
3715 for obj in $save_libobjs
3717 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3718 if test "X$objlist" = X ||
3719 { len=`expr "X$test_cmds" : ".*"` &&
3720 test "$len" -le "$max_cmd_len"; }; then
3721 objlist="$objlist $obj"
3723 # The command $test_cmds is almost too long, add a
3724 # command to the queue.
3725 if test "$k" -eq 1 ; then
3726 # The first file doesn't have a previous command to add.
3727 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3729 # All subsequent reloadable object files will link in
3730 # the last one created.
3731 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3733 last_robj=$output_objdir/$save_output-${k}.$objext
3735 output=$output_objdir/$save_output-${k}.$objext
3740 # Handle the remaining objects by creating one last
3741 # reloadable object file. All subsequent reloadable object
3742 # files will link in the last one created.
3743 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3744 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3746 if ${skipped_export-false}; then
3747 $show "generating symbol list for \`$libname.la'"
3748 export_symbols="$output_objdir/$libname.exp"
3749 $run $rm $export_symbols
3751 # Append the command to create the export file.
3752 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3755 # Set up a command to remove the reloadale object files
3756 # after they are used.
3758 while test "$i" -lt "$k"
3761 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3764 $echo "creating a temporary reloadable object file: $output"
3766 # Loop through the commands generated above and execute them.
3767 save_ifs="$IFS"; IFS='~'
3768 for cmd in $concat_cmds; do
3771 $run eval "$cmd" || exit $?
3776 # Restore the value of output.
3779 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3780 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3782 # Expand the library linking commands again to reset the
3783 # value of $libobjs for piecewise linking.
3785 # Do each of the archive commands.
3786 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3787 eval cmds=\"$archive_expsym_cmds\"
3789 eval cmds=\"$archive_cmds\"
3792 # Append the command to remove the reloadable object files
3793 # to the just-reset $cmds.
3794 eval cmds=\"\$cmds~$rm $delfiles\"
3796 save_ifs="$IFS"; IFS='~'
3797 for cmd in $cmds; do
3800 $run eval "$cmd" || exit $?
3804 # Restore the uninstalled library and exit
3805 if test "$mode" = relink; then
3806 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3810 # Create links to the real library.
3811 for linkname in $linknames; do
3812 if test "$realname" != "$linkname"; then
3813 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3814 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3818 # If -module or -export-dynamic was specified, set the dlname.
3819 if test "$module" = yes || test "$export_dynamic" = yes; then
3820 # On all known operating systems, these are identical.
3827 if test -n "$deplibs"; then
3828 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3831 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3832 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3835 if test -n "$rpath"; then
3836 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3839 if test -n "$xrpath"; then
3840 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3843 if test -n "$vinfo"; then
3844 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3847 if test -n "$release"; then
3848 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3853 if test -n "$objs$old_deplibs"; then
3854 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3858 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3866 # Delete the old objects.
3867 $run $rm $obj $libobj
3869 # Objects from convenience libraries. This assumes
3870 # single-version convenience libraries. Whenever we create
3871 # different ones for PIC/non-PIC, this we'll have to duplicate
3875 # reload_cmds runs $LD directly, so let us get rid of
3876 # -Wl from whole_archive_flag_spec
3879 if test -n "$convenience"; then
3880 if test -n "$whole_archive_flag_spec"; then
3881 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3883 gentop="$output_objdir/${obj}x"
3884 $show "${rm}r $gentop"
3885 $run ${rm}r "$gentop"
3886 $show "$mkdir $gentop"
3887 $run $mkdir "$gentop"
3889 if test "$status" -ne 0 && test ! -d "$gentop"; then
3892 generated="$generated $gentop"
3894 for xlib in $convenience; do
3895 # Extract the objects.
3897 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3898 *) xabs=`pwd`"/$xlib" ;;
3900 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3901 xdir="$gentop/$xlib"
3903 $show "${rm}r $xdir"
3905 $show "$mkdir $xdir"
3908 if test "$status" -ne 0 && test ! -d "$xdir"; then
3911 # We will extract separately just the conflicting names and we will no
3912 # longer touch any unique names. It is faster to leave these extract
3913 # automatically by $AR in one run.
3914 $show "(cd $xdir && $AR x $xabs)"
3915 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3916 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3919 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3920 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3921 $AR t "$xabs" | sort | uniq -cd | while read -r count name
3924 while test "$i" -le "$count"
3926 # Put our $i before any first dot (extension)
3927 # Never overwrite any file
3929 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3931 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3933 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3934 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3940 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3945 # Create the old-style object.
3946 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
3949 eval cmds=\"$reload_cmds\"
3950 save_ifs="$IFS"; IFS='~'
3951 for cmd in $cmds; do
3954 $run eval "$cmd" || exit $?
3958 # Exit if we aren't doing a library object file.
3959 if test -z "$libobj"; then
3960 if test -n "$gentop"; then
3961 $show "${rm}r $gentop"
3968 if test "$build_libtool_libs" != yes; then
3969 if test -n "$gentop"; then
3970 $show "${rm}r $gentop"
3974 # Create an invalid libtool object if no PIC, so that we don't
3975 # accidentally link it into a program.
3976 # $show "echo timestamp > $libobj"
3977 # $run eval "echo timestamp > $libobj" || exit $?
3981 if test -n "$pic_flag" || test "$pic_mode" != default; then
3982 # Only do commands if we really have different PIC objects.
3983 reload_objs="$libobjs $reload_conv_objs"
3985 eval cmds=\"$reload_cmds\"
3986 save_ifs="$IFS"; IFS='~'
3987 for cmd in $cmds; do
3990 $run eval "$cmd" || exit $?
3995 if test -n "$gentop"; then
3996 $show "${rm}r $gentop"
4005 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4007 if test -n "$vinfo"; then
4008 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4011 if test -n "$release"; then
4012 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4015 if test "$preload" = yes; then
4016 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4017 test "$dlopen_self_static" = unknown; then
4018 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4023 *-*-rhapsody* | *-*-darwin1.[012])
4024 # On Rhapsody replace the C library is the System framework
4025 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4026 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4032 # Don't allow lazy linking, it breaks C++ global constructors
4033 if test "$tagname" = CXX ; then
4034 compile_command="$compile_command ${wl}-bind_at_load"
4035 finalize_command="$finalize_command ${wl}-bind_at_load"
4040 compile_command="$compile_command $compile_deplibs"
4041 finalize_command="$finalize_command $finalize_deplibs"
4043 if test -n "$rpath$xrpath"; then
4044 # If the user specified any rpath flags, then add them.
4045 for libdir in $rpath $xrpath; do
4046 # This is the magic to use -rpath.
4047 case "$finalize_rpath " in
4049 *) finalize_rpath="$finalize_rpath $libdir" ;;
4054 # Now hardcode the library paths
4057 for libdir in $compile_rpath $finalize_rpath; do
4058 if test -n "$hardcode_libdir_flag_spec"; then
4059 if test -n "$hardcode_libdir_separator"; then
4060 if test -z "$hardcode_libdirs"; then
4061 hardcode_libdirs="$libdir"
4063 # Just accumulate the unique libdirs.
4064 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4065 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4068 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4073 eval flag=\"$hardcode_libdir_flag_spec\"
4074 rpath="$rpath $flag"
4076 elif test -n "$runpath_var"; then
4077 case "$perm_rpath " in
4079 *) perm_rpath="$perm_rpath $libdir" ;;
4083 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4084 case :$dllsearchpath: in
4086 *) dllsearchpath="$dllsearchpath:$libdir";;
4091 # Substitute the hardcoded libdirs into the rpath.
4092 if test -n "$hardcode_libdir_separator" &&
4093 test -n "$hardcode_libdirs"; then
4094 libdir="$hardcode_libdirs"
4095 eval rpath=\" $hardcode_libdir_flag_spec\"
4097 compile_rpath="$rpath"
4101 for libdir in $finalize_rpath; do
4102 if test -n "$hardcode_libdir_flag_spec"; then
4103 if test -n "$hardcode_libdir_separator"; then
4104 if test -z "$hardcode_libdirs"; then
4105 hardcode_libdirs="$libdir"
4107 # Just accumulate the unique libdirs.
4108 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4109 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4112 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4117 eval flag=\"$hardcode_libdir_flag_spec\"
4118 rpath="$rpath $flag"
4120 elif test -n "$runpath_var"; then
4121 case "$finalize_perm_rpath " in
4123 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4127 # Substitute the hardcoded libdirs into the rpath.
4128 if test -n "$hardcode_libdir_separator" &&
4129 test -n "$hardcode_libdirs"; then
4130 libdir="$hardcode_libdirs"
4131 eval rpath=\" $hardcode_libdir_flag_spec\"
4133 finalize_rpath="$rpath"
4135 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4136 # Transform all the library objects into standard objects.
4137 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4138 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4142 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4143 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4144 dlsyms="${outputname}S.c"
4146 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4150 if test -n "$dlsyms"; then
4154 # Discover the nlist of each of the dlfiles.
4155 nlist="$output_objdir/${outputname}.nm"
4157 $show "$rm $nlist ${nlist}S ${nlist}T"
4158 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4160 # Parse the name list into a source file.
4161 $show "creating $output_objdir/$dlsyms"
4163 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4164 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4165 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4171 /* Prevent the only kind of declaration conflicts we can make. */
4172 #define lt_preloaded_symbols some_other_symbol
4174 /* External symbol declarations for the compiler. */\
4177 if test "$dlself" = yes; then
4178 $show "generating symbol list for \`$output'"
4180 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4182 # Add our own program objects to the symbol list.
4183 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4184 for arg in $progfiles; do
4185 $show "extracting global C symbols from \`$arg'"
4186 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4189 if test -n "$exclude_expsyms"; then
4190 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4191 $run eval '$mv "$nlist"T "$nlist"'
4194 if test -n "$export_symbols_regex"; then
4195 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4196 $run eval '$mv "$nlist"T "$nlist"'
4199 # Prepare the list of exported symbols
4200 if test -z "$export_symbols"; then
4201 export_symbols="$output_objdir/$output.exp"
4202 $run $rm $export_symbols
4203 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4205 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4206 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4207 $run eval 'mv "$nlist"T "$nlist"'
4211 for arg in $dlprefiles; do
4212 $show "extracting global C symbols from \`$arg'"
4213 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4214 $run eval '$echo ": $name " >> "$nlist"'
4215 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4218 if test -z "$run"; then
4219 # Make sure we have at least an empty file.
4220 test -f "$nlist" || : > "$nlist"
4222 if test -n "$exclude_expsyms"; then
4223 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4224 $mv "$nlist"T "$nlist"
4227 # Try sorting and uniquifying the output.
4228 if grep -v "^: " < "$nlist" |
4229 if sort -k 3 </dev/null >/dev/null 2>&1; then
4234 uniq > "$nlist"S; then
4237 grep -v "^: " < "$nlist" > "$nlist"S
4240 if test -f "$nlist"S; then
4241 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4243 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4246 $echo >> "$output_objdir/$dlsyms" "\
4248 #undef lt_preloaded_symbols
4250 #if defined (__STDC__) && __STDC__
4251 # define lt_ptr void *
4253 # define lt_ptr char *
4257 /* The mapping between symbol names and symbols. */
4262 lt_preloaded_symbols[] =
4266 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4268 $echo >> "$output_objdir/$dlsyms" "\
4272 /* This works around a problem in FreeBSD linker */
4273 #ifdef FREEBSD_WORKAROUND
4274 static const void *lt_preloaded_setup() {
4275 return lt_preloaded_symbols;
4285 pic_flag_for_symtable=
4287 # compiling the symbol table file with pic_flag works around
4288 # a FreeBSD bug that causes programs to crash when -lm is
4289 # linked before any other PIC object. But we must not use
4290 # pic_flag when linking with -static. The problem exists in
4291 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4292 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4293 case "$compile_command " in
4295 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4298 case "$compile_command " in
4300 *) pic_flag_for_symtable=" $pic_flag";;
4304 # Now compile the dynamic symbol file.
4305 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4306 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4308 # Clean up the generated files.
4309 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4310 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4312 # Transform the symbol file into the correct name.
4313 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4314 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4317 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4322 # We keep going just in case the user didn't refer to
4323 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4324 # really was required.
4326 # Nullify the symbol file.
4327 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4328 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4331 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4332 # Replace the output file specification.
4333 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4334 link_command="$compile_command$compile_rpath"
4336 # We have no uninstalled library dependencies, so finalize right now.
4337 $show "$link_command"
4338 $run eval "$link_command"
4341 # Delete the generated files.
4342 if test -n "$dlsyms"; then
4343 $show "$rm $output_objdir/${outputname}S.${objext}"
4344 $run $rm "$output_objdir/${outputname}S.${objext}"
4350 if test -n "$shlibpath_var"; then
4351 # We should set the shlibpath_var
4353 for dir in $temp_rpath; do
4355 [\\/]* | [A-Za-z]:[\\/]*)
4360 # Relative path: add a thisdir entry.
4361 rpath="$rpath\$thisdir/$dir:"
4368 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4369 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4371 if test -n "$finalize_shlibpath"; then
4372 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4377 if test -n "$runpath_var"; then
4378 if test -n "$perm_rpath"; then
4379 # We should set the runpath_var.
4381 for dir in $perm_rpath; do
4384 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4386 if test -n "$finalize_perm_rpath"; then
4387 # We should set the runpath_var.
4389 for dir in $finalize_perm_rpath; do
4392 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4396 if test "$no_install" = yes; then
4397 # We don't need to create a wrapper script.
4398 link_command="$compile_var$compile_command$compile_rpath"
4399 # Replace the output file specification.
4400 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4401 # Delete the old output file.
4403 # Link the executable and exit
4404 $show "$link_command"
4405 $run eval "$link_command" || exit $?
4409 if test "$hardcode_action" = relink; then
4410 # Fast installation is not supported
4411 link_command="$compile_var$compile_command$compile_rpath"
4412 relink_command="$finalize_var$finalize_command$finalize_rpath"
4414 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4415 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4417 if test "$fast_install" != no; then
4418 link_command="$finalize_var$compile_command$finalize_rpath"
4419 if test "$fast_install" = yes; then
4420 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4422 # fast_install is set to needless
4426 link_command="$compile_var$compile_command$compile_rpath"
4427 relink_command="$finalize_var$finalize_command$finalize_rpath"
4431 # Replace the output file specification.
4432 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4434 # Delete the old output files.
4435 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4437 $show "$link_command"
4438 $run eval "$link_command" || exit $?
4440 # Now create the wrapper script.
4441 $show "creating $output"
4443 # Quote the relink command for shipping.
4444 if test -n "$relink_command"; then
4445 # Preserve any variables that may affect compiler behavior
4446 for var in $variables_saved_for_relink; do
4447 if eval test -z \"\${$var+set}\"; then
4448 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4449 elif eval var_value=\$$var; test -z "$var_value"; then
4450 relink_command="$var=; export $var; $relink_command"
4452 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4453 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4456 relink_command="(cd `pwd`; $relink_command)"
4457 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4460 # Quote $echo for shipping.
4461 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4463 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4464 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4466 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4468 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4471 # Only actually do things if our run command is non-null.
4472 if test -z "$run"; then
4473 # win32 will think the script is a binary if it has
4474 # a .exe suffix, so we strip it off here.
4476 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4478 # test for cygwin because mv fails w/o .exe extensions
4482 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4486 *cygwin* | *mingw* )
4487 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4488 cwrapper=`$echo ${output}.exe`
4489 $rm $cwrappersource $cwrapper
4490 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4492 cat > $cwrappersource <<EOF
4494 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4495 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4497 The $output program cannot be directly executed until all the libtool
4498 libraries that it depends on are installed.
4500 This wrapper executable should never be moved out of the build directory.
4501 If it is, it will not operate correctly.
4503 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4504 but could eventually absorb all of the scripts functionality and
4505 exec $objdir/$outputname directly.
4508 cat >> $cwrappersource<<"EOF"
4516 #if defined(PATH_MAX)
4517 # define LT_PATHMAX PATH_MAX
4518 #elif defined(MAXPATHLEN)
4519 # define LT_PATHMAX MAXPATHLEN
4521 # define LT_PATHMAX 1024
4524 #ifndef DIR_SEPARATOR
4525 #define DIR_SEPARATOR '/'
4528 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4530 #define HAVE_DOS_BASED_FILE_SYSTEM
4531 #ifndef DIR_SEPARATOR_2
4532 #define DIR_SEPARATOR_2 '\\'
4536 #ifndef DIR_SEPARATOR_2
4537 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4538 #else /* DIR_SEPARATOR_2 */
4539 # define IS_DIR_SEPARATOR(ch) \
4540 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4541 #endif /* DIR_SEPARATOR_2 */
4543 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4544 #define XFREE(stale) do { \
4545 if (stale) { free ((void *) stale); stale = 0; } \
4548 const char *program_name = NULL;
4550 void * xmalloc (size_t num);
4551 char * xstrdup (const char *string);
4552 char * basename (const char *name);
4553 char * fnqualify(const char *path);
4554 char * strendzap(char *str, const char *pat);
4555 void lt_fatal (const char *message, ...);
4558 main (int argc, char *argv[])
4563 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4564 newargz = XMALLOC(char *, argc+2);
4567 cat >> $cwrappersource <<EOF
4568 newargz[0] = "$SHELL";
4571 cat >> $cwrappersource <<"EOF"
4572 newargz[1] = fnqualify(argv[0]);
4573 /* we know the script has the same name, without the .exe */
4574 /* so make sure newargz[1] doesn't end in .exe */
4575 strendzap(newargz[1],".exe");
4576 for (i = 1; i < argc; i++)
4577 newargz[i+1] = xstrdup(argv[i]);
4578 newargz[argc+1] = NULL;
4581 cat >> $cwrappersource <<EOF
4582 execv("$SHELL",newargz);
4585 cat >> $cwrappersource <<"EOF"
4589 xmalloc (size_t num)
4591 void * p = (void *) malloc (num);
4593 lt_fatal ("Memory exhausted");
4599 xstrdup (const char *string)
4601 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4606 basename (const char *name)
4610 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4611 /* Skip over the disk name in MSDOS pathnames. */
4612 if (isalpha (name[0]) && name[1] == ':')
4616 for (base = name; *name; name++)
4617 if (IS_DIR_SEPARATOR (*name))
4619 return (char *) base;
4623 fnqualify(const char *path)
4627 char tmp[LT_PATHMAX + 1];
4629 assert(path != NULL);
4631 /* Is it qualified already? */
4632 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4633 if (isalpha (path[0]) && path[1] == ':')
4634 return xstrdup (path);
4636 if (IS_DIR_SEPARATOR (path[0]))
4637 return xstrdup (path);
4639 /* prepend the current directory */
4640 /* doesn't handle '~' */
4641 if (getcwd (tmp, LT_PATHMAX) == NULL)
4642 lt_fatal ("getcwd failed");
4643 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4644 p = XMALLOC(char, size);
4645 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4650 strendzap(char *str, const char *pat)
4654 assert(str != NULL);
4655 assert(pat != NULL);
4658 patlen = strlen(pat);
4662 str += len - patlen;
4663 if (strcmp(str, pat) == 0)
4670 lt_error_core (int exit_status, const char * mode,
4671 const char * message, va_list ap)
4673 fprintf (stderr, "%s: %s: ", program_name, mode);
4674 vfprintf (stderr, message, ap);
4675 fprintf (stderr, ".\n");
4677 if (exit_status >= 0)
4682 lt_fatal (const char *message, ...)
4685 va_start (ap, message);
4686 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4690 # we should really use a build-platform specific compiler
4691 # here, but OTOH, the wrappers (shell script and this C one)
4692 # are only useful if you want to execute the "real" binary.
4693 # Since the "real" binary is built for $host, then this
4694 # wrapper might as well be built for $host, too.
4695 $run $LTCC -s -o $cwrapper $cwrappersource
4699 trap "$rm $output; exit 1" 1 2 15
4704 # $output - temporary wrapper script for $objdir/$outputname
4705 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4707 # The $output program cannot be directly executed until all the libtool
4708 # libraries that it depends on are installed.
4710 # This wrapper script should never be moved out of the build directory.
4711 # If it is, it will not operate correctly.
4713 # Sed substitution that helps us do robust quoting. It backslashifies
4714 # metacharacters that are still active within double-quoted strings.
4715 Xsed='${SED} -e 1s/^X//'
4716 sed_quote_subst='$sed_quote_subst'
4718 # The HP-UX ksh and POSIX shell print the target directory to stdout
4720 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4722 relink_command=\"$relink_command\"
4724 # This environment variable determines our operation mode.
4725 if test \"\$libtool_install_magic\" = \"$magic\"; then
4726 # install mode needs the following variable:
4727 notinst_deplibs='$notinst_deplibs'
4729 # When we are sourced in execute mode, \$file and \$echo are already set.
4730 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4733 # Make sure echo works.
4734 if test \"X\$1\" = X--no-reexec; then
4735 # Discard the --no-reexec flag, and continue.
4737 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4738 # Yippee, \$echo works!
4741 # Restart under the correct shell, and then maybe \$echo will work.
4742 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4748 # Find the directory that this script lives in.
4749 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4750 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4752 # Follow symbolic links until we get to the real thisdir.
4753 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4754 while test -n \"\$file\"; do
4755 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4757 # If there was a directory component, then change thisdir.
4758 if test \"x\$destdir\" != \"x\$file\"; then
4759 case \"\$destdir\" in
4760 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4761 *) thisdir=\"\$thisdir/\$destdir\" ;;
4765 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4766 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4769 # Try to get the absolute directory name.
4770 absdir=\`cd \"\$thisdir\" && pwd\`
4771 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4774 if test "$fast_install" = yes; then
4776 program=lt-'$outputname'$exeext
4777 progdir=\"\$thisdir/$objdir\"
4779 if test ! -f \"\$progdir/\$program\" || \\
4780 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4781 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4783 file=\"\$\$-\$program\"
4785 if test ! -d \"\$progdir\"; then
4786 $mkdir \"\$progdir\"
4788 $rm \"\$progdir/\$file\"
4793 # relink executable if necessary
4794 if test -n \"\$relink_command\"; then
4795 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4797 $echo \"\$relink_command_output\" >&2
4798 $rm \"\$progdir/\$file\"
4803 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4804 { $rm \"\$progdir/\$program\";
4805 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4806 $rm \"\$progdir/\$file\"
4810 program='$outputname'
4811 progdir=\"\$thisdir/$objdir\"
4817 if test -f \"\$progdir/\$program\"; then"
4819 # Export our shlibpath_var if we have one.
4820 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4822 # Add our own library path to $shlibpath_var
4823 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4825 # Some systems cannot cope with colon-terminated $shlibpath_var
4826 # The second colon is a workaround for a bug in BeOS R4 sed
4827 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4829 export $shlibpath_var
4833 # fixup the dll searchpath if we need to.
4834 if test -n "$dllsearchpath"; then
4836 # Add the dll search path components to the executable PATH
4837 PATH=$dllsearchpath:\$PATH
4842 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4843 # Run the actual program with our arguments.
4846 # Backslashes separate directories on plain windows
4847 *-*-mingw | *-*-os2*)
4849 exec \$progdir\\\\\$program \${1+\"\$@\"}
4855 exec \$progdir/\$program \${1+\"\$@\"}
4860 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4864 # The program doesn't exist.
4865 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4866 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4867 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4878 # See if we need to build an old-fashioned archive.
4879 for oldlib in $oldlibs; do
4881 if test "$build_libtool_libs" = convenience; then
4882 oldobjs="$libobjs_save"
4883 addlibs="$convenience"
4884 build_libtool_libs=no
4886 if test "$build_libtool_libs" = module; then
4887 oldobjs="$libobjs_save"
4888 build_libtool_libs=no
4890 oldobjs="$old_deplibs $non_pic_objects"
4892 addlibs="$old_convenience"
4895 if test -n "$addlibs"; then
4896 gentop="$output_objdir/${outputname}x"
4897 $show "${rm}r $gentop"
4898 $run ${rm}r "$gentop"
4899 $show "$mkdir $gentop"
4900 $run $mkdir "$gentop"
4902 if test "$status" -ne 0 && test ! -d "$gentop"; then
4905 generated="$generated $gentop"
4907 # Add in members from convenience archives.
4908 for xlib in $addlibs; do
4909 # Extract the objects.
4911 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4912 *) xabs=`pwd`"/$xlib" ;;
4914 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4915 xdir="$gentop/$xlib"
4917 $show "${rm}r $xdir"
4919 $show "$mkdir $xdir"
4922 if test "$status" -ne 0 && test ! -d "$xdir"; then
4925 # We will extract separately just the conflicting names and we will no
4926 # longer touch any unique names. It is faster to leave these extract
4927 # automatically by $AR in one run.
4928 $show "(cd $xdir && $AR x $xabs)"
4929 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4930 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4933 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4934 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4935 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4938 while test "$i" -le "$count"
4940 # Put our $i before any first dot (extension)
4941 # Never overwrite any file
4943 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4945 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4947 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4948 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4954 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4958 # Do each command in the archive commands.
4959 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4960 eval cmds=\"$old_archive_from_new_cmds\"
4962 eval cmds=\"$old_archive_cmds\"
4964 if len=`expr "X$cmds" : ".*"` &&
4965 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4968 # the command line is too long to link in one step, link in parts
4969 $echo "using piecewise archive linking..."
4974 save_oldobjs=$oldobjs
4975 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4976 # encoded into archives. This makes 'ar r' malfunction in
4977 # this piecewise linking case whenever conflicting object
4978 # names appear in distinct ar calls; check, warn and compensate.
4979 if (for obj in $save_oldobjs
4981 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4982 done | sort | sort -uc >/dev/null 2>&1); then
4985 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4986 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4989 # Is there a better way of finding the last object in the list?
4990 for obj in $save_oldobjs
4994 for obj in $save_oldobjs
4996 oldobjs="$objlist $obj"
4997 objlist="$objlist $obj"
4998 eval test_cmds=\"$old_archive_cmds\"
4999 if len=`expr "X$test_cmds" : ".*"` &&
5000 test "$len" -le "$max_cmd_len"; then
5003 # the above command should be used before it gets too long
5005 if test "$obj" = "$last_oldobj" ; then
5008 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5009 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5015 if test "X$oldobjs" = "X" ; then
5016 eval cmds=\"\$concat_cmds\"
5018 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5022 save_ifs="$IFS"; IFS='~'
5023 for cmd in $cmds; do
5026 $run eval "$cmd" || exit $?
5031 if test -n "$generated"; then
5032 $show "${rm}r$generated"
5033 $run ${rm}r$generated
5036 # Now create the libtool archive.
5040 test "$build_old_libs" = yes && old_library="$libname.$libext"
5041 $show "creating $output"
5043 # Preserve any variables that may affect compiler behavior
5044 for var in $variables_saved_for_relink; do
5045 if eval test -z \"\${$var+set}\"; then
5046 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5047 elif eval var_value=\$$var; test -z "$var_value"; then
5048 relink_command="$var=; export $var; $relink_command"
5050 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5051 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5054 # Quote the link command for shipping.
5055 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5056 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5058 # Only create the output if not a dry run.
5059 if test -z "$run"; then
5060 for installed in no yes; do
5061 if test "$installed" = yes; then
5062 if test -z "$install_libdir"; then
5065 output="$output_objdir/$outputname"i
5066 # Replace all uninstalled libtool libraries with the installed ones
5068 for deplib in $dependency_libs; do
5071 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5072 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5073 if test -z "$libdir"; then
5074 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5077 newdependency_libs="$newdependency_libs $libdir/$name"
5079 *) newdependency_libs="$newdependency_libs $deplib" ;;
5082 dependency_libs="$newdependency_libs"
5084 for lib in $dlfiles; do
5085 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5086 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5087 if test -z "$libdir"; then
5088 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5091 newdlfiles="$newdlfiles $libdir/$name"
5093 dlfiles="$newdlfiles"
5095 for lib in $dlprefiles; do
5096 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5097 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5098 if test -z "$libdir"; then
5099 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5102 newdlprefiles="$newdlprefiles $libdir/$name"
5104 dlprefiles="$newdlprefiles"
5107 # place dlname in correct position for cygwin
5109 case $host,$output,$installed,$module,$dlname in
5110 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5113 # $outputname - a libtool library file
5114 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5116 # Please DO NOT delete this file!
5117 # It is necessary for linking the library.
5119 # The name that we can dlopen(3).
5122 # Names of this library.
5123 library_names='$library_names'
5125 # The name of the static archive.
5126 old_library='$old_library'
5128 # Libraries that this one depends upon.
5129 dependency_libs='$dependency_libs'
5131 # Version information for $libname.
5136 # Is this an already installed library?
5137 installed=$installed
5139 # Should we warn about portability when linking against -modules?
5140 shouldnotlink=$module
5142 # Files to dlopen/dlpreopen
5144 dlpreopen='$dlprefiles'
5146 # Directory that this library needs to be installed in:
5147 libdir='$install_libdir'"
5148 if test "$installed" = no && test "$need_relink" = yes; then
5150 relink_command=\"$relink_command\""
5155 # Do a symbolic link so that the libtool archive can be found in
5156 # LD_LIBRARY_PATH before the program is installed.
5157 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5158 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5164 # libtool install mode
5166 modename="$modename: install"
5168 # There may be an optional sh(1) argument at the beginning of
5169 # install_prog (especially on Windows NT).
5170 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5171 # Allow the use of GNU shtool's install command.
5172 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5173 # Aesthetically quote it.
5174 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5176 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5180 install_prog="$arg "
5188 # The real first argument should be the name of the installation program.
5189 # Aesthetically quote it.
5190 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5192 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5196 install_prog="$install_prog$arg"
5198 # We need to accept at least all the BSD install flags.
5208 if test -n "$dest"; then
5209 files="$files $dest"
5227 # If the previous option needed an argument, then skip it.
5228 if test -n "$prev"; then
5237 # Aesthetically quote the argument.
5238 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5240 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5244 install_prog="$install_prog $arg"
5247 if test -z "$install_prog"; then
5248 $echo "$modename: you must specify an install program" 1>&2
5253 if test -n "$prev"; then
5254 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5259 if test -z "$files"; then
5260 if test -z "$dest"; then
5261 $echo "$modename: no file or destination specified" 1>&2
5263 $echo "$modename: you must specify a destination" 1>&2
5269 # Strip any trailing slash from the destination.
5270 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5272 # Check to see that the destination is a directory.
5273 test -d "$dest" && isdir=yes
5274 if test "$isdir" = yes; then
5278 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5279 test "X$destdir" = "X$dest" && destdir=.
5280 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5282 # Not a directory, so check to see that there is only one file specified.
5284 if test "$#" -gt 2; then
5285 $echo "$modename: \`$dest' is not a directory" 1>&2
5291 [\\/]* | [A-Za-z]:[\\/]*) ;;
5293 for file in $files; do
5297 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5306 # This variable tells wrapper scripts just to set variables rather
5307 # than running their programs.
5308 libtool_install_magic="$magic"
5313 for file in $files; do
5315 # Do each installation.
5318 # Do the static libraries later.
5319 staticlibs="$staticlibs $file"
5323 # Check to see that this really is a libtool archive.
5324 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5326 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5334 # If there is no directory component, then add one.
5336 */* | *\\*) . $file ;;
5340 # Add the libdir to current_libdirs if it is the destination.
5341 if test "X$destdir" = "X$libdir"; then
5342 case "$current_libdirs " in
5344 *) current_libdirs="$current_libdirs $libdir" ;;
5347 # Note the libdir as a future libdir.
5348 case "$future_libdirs " in
5350 *) future_libdirs="$future_libdirs $libdir" ;;
5354 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5355 test "X$dir" = "X$file/" && dir=
5358 if test -n "$relink_command"; then
5359 # Determine the prefix the user has applied to our future dir.
5360 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5362 # Don't allow the user to place us outside of our expected
5363 # location b/c this prevents finding dependent libraries that
5364 # are installed to the same prefix.
5365 # At present, this check doesn't affect windows .dll's that
5366 # are installed into $libdir/../bin (currently, that works fine)
5367 # but it's something to keep an eye on.
5368 if test "$inst_prefix_dir" = "$destdir"; then
5369 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5373 if test -n "$inst_prefix_dir"; then
5374 # Stick the inst_prefix_dir data into the link command.
5375 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5377 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5380 $echo "$modename: warning: relinking \`$file'" 1>&2
5381 $show "$relink_command"
5382 if $run eval "$relink_command"; then :
5384 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5389 # See the names of the shared library.
5390 set dummy $library_names
5391 if test -n "$2"; then
5397 test -n "$relink_command" && srcname="$realname"T
5399 # Install the shared library and build the symlinks.
5400 $show "$install_prog $dir/$srcname $destdir/$realname"
5401 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5402 if test -n "$stripme" && test -n "$striplib"; then
5403 $show "$striplib $destdir/$realname"
5404 $run eval "$striplib $destdir/$realname" || exit $?
5407 if test "$#" -gt 0; then
5408 # Delete the old symlinks, and create new ones.
5411 if test "$linkname" != "$realname"; then
5412 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5413 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5418 # Do each command in the postinstall commands.
5419 lib="$destdir/$realname"
5420 eval cmds=\"$postinstall_cmds\"
5421 save_ifs="$IFS"; IFS='~'
5422 for cmd in $cmds; do
5425 $run eval "$cmd" || exit $?
5430 # Install the pseudo-library for information purposes.
5431 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5432 instname="$dir/$name"i
5433 $show "$install_prog $instname $destdir/$name"
5434 $run eval "$install_prog $instname $destdir/$name" || exit $?
5436 # Maybe install the static library, too.
5437 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5441 # Install (i.e. copy) a libtool object.
5443 # Figure out destination file name, if it wasn't already specified.
5444 if test -n "$destname"; then
5445 destfile="$destdir/$destname"
5447 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5448 destfile="$destdir/$destfile"
5451 # Deduce the name of the destination old-style object file.
5454 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5457 staticdest="$destfile"
5461 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5467 # Install the libtool object if requested.
5468 if test -n "$destfile"; then
5469 $show "$install_prog $file $destfile"
5470 $run eval "$install_prog $file $destfile" || exit $?
5473 # Install the old object if enabled.
5474 if test "$build_old_libs" = yes; then
5475 # Deduce the name of the old-style object file.
5476 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5478 $show "$install_prog $staticobj $staticdest"
5479 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5485 # Figure out destination file name, if it wasn't already specified.
5486 if test -n "$destname"; then
5487 destfile="$destdir/$destname"
5489 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5490 destfile="$destdir/$destfile"
5493 # If the file is missing, and there is a .exe on the end, strip it
5494 # because it is most likely a libtool script we actually want to
5499 if test ! -f "$file"; then
5500 file=`$echo $file|${SED} 's,.exe$,,'`
5506 # Do a test to see if this is really a libtool program.
5509 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5515 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5519 # To insure that "foo" is sourced, and not "foo.exe",
5520 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5521 # which disallows the automatic-append-.exe behavior.
5523 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5524 *) wrapperdot=${wrapper} ;;
5526 # If there is no directory component, then add one.
5528 */* | *\\*) . ${wrapperdot} ;;
5529 *) . ./${wrapperdot} ;;
5532 # Check the variables that should have been set.
5533 if test -z "$notinst_deplibs"; then
5534 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5539 for lib in $notinst_deplibs; do
5540 # Check to see that each library is installed.
5542 if test -f "$lib"; then
5543 # If there is no directory component, then add one.
5545 */* | *\\*) . $lib ;;
5549 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5550 if test -n "$libdir" && test ! -f "$libfile"; then
5551 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5557 # To insure that "foo" is sourced, and not "foo.exe",
5558 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5559 # which disallows the automatic-append-.exe behavior.
5561 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5562 *) wrapperdot=${wrapper} ;;
5564 # If there is no directory component, then add one.
5566 */* | *\\*) . ${wrapperdot} ;;
5567 *) . ./${wrapperdot} ;;
5571 if test "$fast_install" = no && test -n "$relink_command"; then
5572 if test "$finalize" = yes && test -z "$run"; then
5574 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5575 tmpdir_mktemp=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
5576 if test "$?" = 0 ; then
5577 tmpdir="$tmpdir_mktemp"
5580 tmpdir="$tmpdir/libtool-$$"
5582 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5584 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5587 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5588 outputname="$tmpdir/$file"
5589 # Replace the output file specification.
5590 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5592 $show "$relink_command"
5593 if $run eval "$relink_command"; then :
5595 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5601 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5604 # Install the binary that we compiled earlier.
5605 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5609 # remove .exe since cygwin /usr/bin/install will append another
5611 case $install_prog,$host in
5612 */usr/bin/install*,*cygwin*)
5613 case $file:$destfile in
5618 destfile=$destfile.exe
5621 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5626 $show "$install_prog$stripme $file $destfile"
5627 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5628 test -n "$outputname" && ${rm}r "$tmpdir"
5633 for file in $staticlibs; do
5634 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5636 # Set up the ranlib parameters.
5637 oldlib="$destdir/$name"
5639 $show "$install_prog $file $oldlib"
5640 $run eval "$install_prog \$file \$oldlib" || exit $?
5642 if test -n "$stripme" && test -n "$striplib"; then
5643 $show "$old_striplib $oldlib"
5644 $run eval "$old_striplib $oldlib" || exit $?
5647 # Do each command in the postinstall commands.
5648 eval cmds=\"$old_postinstall_cmds\"
5649 save_ifs="$IFS"; IFS='~'
5650 for cmd in $cmds; do
5653 $run eval "$cmd" || exit $?
5658 if test -n "$future_libdirs"; then
5659 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5662 if test -n "$current_libdirs"; then
5663 # Maybe just do a dry run.
5664 test -n "$run" && current_libdirs=" -n$current_libdirs"
5665 exec_cmd='$SHELL $0 --finish$current_libdirs'
5671 # libtool finish mode
5673 modename="$modename: finish"
5677 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5680 libdirs="$libdirs $dir"
5683 for libdir in $libdirs; do
5684 if test -n "$finish_cmds"; then
5685 # Do each command in the finish commands.
5686 eval cmds=\"$finish_cmds\"
5687 save_ifs="$IFS"; IFS='~'
5688 for cmd in $cmds; do
5691 $run eval "$cmd" || admincmds="$admincmds
5696 if test -n "$finish_eval"; then
5697 # Do the single finish_eval.
5698 eval cmds=\"$finish_eval\"
5699 $run eval "$cmds" || admincmds="$admincmds
5705 # Exit here if they wanted silent mode.
5706 test "$show" = : && exit 0
5708 $echo "----------------------------------------------------------------------"
5709 $echo "Libraries have been installed in:"
5710 for libdir in $libdirs; do
5714 $echo "If you ever happen to want to link against installed libraries"
5715 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5716 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5717 $echo "flag during linking and do at least one of the following:"
5718 if test -n "$shlibpath_var"; then
5719 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5720 $echo " during execution"
5722 if test -n "$runpath_var"; then
5723 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5724 $echo " during linking"
5726 if test -n "$hardcode_libdir_flag_spec"; then
5728 eval flag=\"$hardcode_libdir_flag_spec\"
5730 $echo " - use the \`$flag' linker flag"
5732 if test -n "$admincmds"; then
5733 $echo " - have your system administrator run these commands:$admincmds"
5735 if test -f /etc/ld.so.conf; then
5736 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5739 $echo "See any operating system documentation about shared libraries for"
5740 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5741 $echo "----------------------------------------------------------------------"
5745 # libtool execute mode
5747 modename="$modename: execute"
5749 # The first argument is the command name.
5751 if test -z "$cmd"; then
5752 $echo "$modename: you must specify a COMMAND" 1>&2
5757 # Handle -dlopen flags immediately.
5758 for file in $execute_dlfiles; do
5759 if test ! -f "$file"; then
5760 $echo "$modename: \`$file' is not a file" 1>&2
5768 # Check to see that this really is a libtool archive.
5769 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5771 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5776 # Read the libtool library.
5780 # If there is no directory component, then add one.
5782 */* | *\\*) . $file ;;
5786 # Skip this library if it cannot be dlopened.
5787 if test -z "$dlname"; then
5788 # Warn if it was a shared library.
5789 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5793 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5794 test "X$dir" = "X$file" && dir=.
5796 if test -f "$dir/$objdir/$dlname"; then
5799 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5805 # Just add the directory containing the .lo file.
5806 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5807 test "X$dir" = "X$file" && dir=.
5811 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5816 # Get the absolute pathname.
5817 absdir=`cd "$dir" && pwd`
5818 test -n "$absdir" && dir="$absdir"
5820 # Now add the directory to shlibpath_var.
5821 if eval "test -z \"\$$shlibpath_var\""; then
5822 eval "$shlibpath_var=\"\$dir\""
5824 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5828 # This variable tells wrapper scripts just to set shlibpath_var
5829 # rather than running their programs.
5830 libtool_execute_magic="$magic"
5832 # Check if any of the arguments is a wrapper script.
5839 # Do a test to see if this is really a libtool program.
5840 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5841 # If there is no directory component, then add one.
5843 */* | *\\*) . $file ;;
5847 # Transform arg to wrapped name.
5848 file="$progdir/$program"
5852 # Quote arguments (to preserve shell metacharacters).
5853 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5854 args="$args \"$file\""
5857 if test -z "$run"; then
5858 if test -n "$shlibpath_var"; then
5859 # Export the shlibpath_var.
5860 eval "export $shlibpath_var"
5863 # Restore saved environment variables
5864 if test "${save_LC_ALL+set}" = set; then
5865 LC_ALL="$save_LC_ALL"; export LC_ALL
5867 if test "${save_LANG+set}" = set; then
5868 LANG="$save_LANG"; export LANG
5871 # Now prepare to actually exec the command.
5872 exec_cmd="\$cmd$args"
5874 # Display what would be done.
5875 if test -n "$shlibpath_var"; then
5876 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5877 $echo "export $shlibpath_var"
5884 # libtool clean and uninstall mode
5886 modename="$modename: $mode"
5892 # This variable tells wrapper scripts just to set variables rather
5893 # than running their programs.
5894 libtool_install_magic="$magic"
5899 -f) rm="$rm $arg"; rmforce=yes ;;
5900 -*) rm="$rm $arg" ;;
5901 *) files="$files $arg" ;;
5905 if test -z "$rm"; then
5906 $echo "$modename: you must specify an RM program" 1>&2
5913 origobjdir="$objdir"
5914 for file in $files; do
5915 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5916 if test "X$dir" = "X$file"; then
5918 objdir="$origobjdir"
5920 objdir="$dir/$origobjdir"
5922 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5923 test "$mode" = uninstall && objdir="$dir"
5925 # Remember objdir for removal later, being careful to avoid duplicates
5926 if test "$mode" = clean; then
5929 *) rmdirs="$rmdirs $objdir" ;;
5933 # Don't error if the file doesn't exist and rm -f was used.
5934 if (test -L "$file") >/dev/null 2>&1 \
5935 || (test -h "$file") >/dev/null 2>&1 \
5936 || test -f "$file"; then
5938 elif test -d "$file"; then
5941 elif test "$rmforce" = yes; then
5949 # Possibly a libtool archive, so verify it.
5950 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5953 # Delete the libtool libraries and symlinks.
5954 for n in $library_names; do
5955 rmfiles="$rmfiles $objdir/$n"
5957 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5958 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5960 if test "$mode" = uninstall; then
5961 if test -n "$library_names"; then
5962 # Do each command in the postuninstall commands.
5963 eval cmds=\"$postuninstall_cmds\"
5964 save_ifs="$IFS"; IFS='~'
5965 for cmd in $cmds; do
5969 if test "$?" -ne 0 && test "$rmforce" != yes; then
5976 if test -n "$old_library"; then
5977 # Do each command in the old_postuninstall commands.
5978 eval cmds=\"$old_postuninstall_cmds\"
5979 save_ifs="$IFS"; IFS='~'
5980 for cmd in $cmds; do
5984 if test "$?" -ne 0 && test "$rmforce" != yes; then
5990 # FIXME: should reinstall the best remaining shared library.
5996 # Possibly a libtool object, so verify it.
5997 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6002 # Add PIC object to the list of files to remove.
6003 if test -n "$pic_object" \
6004 && test "$pic_object" != none; then
6005 rmfiles="$rmfiles $dir/$pic_object"
6008 # Add non-PIC object to the list of files to remove.
6009 if test -n "$non_pic_object" \
6010 && test "$non_pic_object" != none; then
6011 rmfiles="$rmfiles $dir/$non_pic_object"
6017 if test "$mode" = clean ; then
6021 file=`$echo $file|${SED} 's,.exe$,,'`
6022 noexename=`$echo $name|${SED} 's,.exe$,,'`
6023 # $file with .exe has already been added to rmfiles,
6024 # add $file without .exe
6025 rmfiles="$rmfiles $file"
6028 # Do a test to see if this is a libtool program.
6029 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6033 # note $name still contains .exe if it was in $file originally
6034 # as does the version of $file that was added into $rmfiles
6035 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6036 if test "$fast_install" = yes && test -n "$relink_command"; then
6037 rmfiles="$rmfiles $objdir/lt-$name"
6039 if test "X$noexename" != "X$name" ; then
6040 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6046 $show "$rm $rmfiles"
6047 $run $rm $rmfiles || exit_status=1
6049 objdir="$origobjdir"
6051 # Try to remove the ${objdir}s in the directories where we deleted files
6052 for dir in $rmdirs; do
6053 if test -d "$dir"; then
6055 $run rmdir $dir >/dev/null 2>&1
6063 $echo "$modename: you must specify a MODE" 1>&2
6064 $echo "$generic_help" 1>&2
6069 if test -z "$exec_cmd"; then
6070 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6071 $echo "$generic_help" 1>&2
6074 fi # test -z "$show_help"
6076 if test -n "$exec_cmd"; then
6081 # We need to display help for each of the modes.
6084 "Usage: $modename [OPTION]... [MODE-ARG]...
6086 Provide generalized library-building support services.
6088 --config show all configuration variables
6089 --debug enable verbose shell tracing
6090 -n, --dry-run display commands without modifying any files
6091 --features display basic configuration information and exit
6092 --finish same as \`--mode=finish'
6093 --help display this help message and exit
6094 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6095 --quiet same as \`--silent'
6096 --silent don't print informational messages
6097 --tag=TAG use configuration variables from tag TAG
6098 --version print version information
6100 MODE must be one of the following:
6102 clean remove files from the build directory
6103 compile compile a source file into a libtool object
6104 execute automatically set library path, then run a program
6105 finish complete the installation of libtool libraries
6106 install install libraries or executables
6107 link create a library or an executable
6108 uninstall remove libraries from an installed directory
6110 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6111 a more detailed description of MODE.
6113 Report bugs to <bug-libtool@gnu.org>."
6119 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6121 Remove files from the build directory.
6123 RM is the name of the program to use to delete files associated with each FILE
6124 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6127 If FILE is a libtool library, object or program, all the files associated
6128 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6133 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6135 Compile a source file into a libtool library object.
6137 This mode accepts the following additional options:
6139 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6140 -prefer-pic try to building PIC objects only
6141 -prefer-non-pic try to building non-PIC objects only
6142 -static always build a \`.o' file suitable for static linking
6144 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6145 from the given SOURCEFILE.
6147 The output file name is determined by removing the directory component from
6148 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6149 library object suffix, \`.lo'."
6154 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6156 Automatically set library path, then run a program.
6158 This mode accepts the following additional options:
6160 -dlopen FILE add the directory containing FILE to the library path
6162 This mode sets the library path environment variable according to \`-dlopen'
6165 If any of the ARGS are libtool executable wrappers, then they are translated
6166 into their corresponding uninstalled binary, and any of their required library
6167 directories are added to the library path.
6169 Then, COMMAND is executed, with ARGS as arguments."
6174 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6176 Complete the installation of libtool libraries.
6178 Each LIBDIR is a directory that contains libtool libraries.
6180 The commands that this mode executes may require superuser privileges. Use
6181 the \`--dry-run' option if you just want to see what would be executed."
6186 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6188 Install executables or libraries.
6190 INSTALL-COMMAND is the installation command. The first component should be
6191 either the \`install' or \`cp' program.
6193 The rest of the components are interpreted as arguments to that command (only
6194 BSD-compatible install options are recognized)."
6199 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6201 Link object files or libraries together to form another library, or to
6202 create an executable program.
6204 LINK-COMMAND is a command using the C compiler that you would use to create
6205 a program from several object files.
6207 The following components of LINK-COMMAND are treated specially:
6209 -all-static do not do any dynamic linking at all
6210 -avoid-version do not add a version suffix if possible
6211 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6212 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6213 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6214 -export-symbols SYMFILE
6215 try to export only the symbols listed in SYMFILE
6216 -export-symbols-regex REGEX
6217 try to export only the symbols matching REGEX
6218 -LLIBDIR search LIBDIR for required installed libraries
6219 -lNAME OUTPUT-FILE requires the installed library libNAME
6220 -module build a library that can dlopened
6221 -no-fast-install disable the fast-install mode
6222 -no-install link a not-installable executable
6223 -no-undefined declare that a library does not refer to external symbols
6224 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6225 -objectlist FILE Use a list of object files found in FILE to specify objects
6226 -release RELEASE specify package release information
6227 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6228 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6229 -static do not do any dynamic linking of libtool libraries
6230 -version-info CURRENT[:REVISION[:AGE]]
6231 specify library version info [each variable defaults to 0]
6233 All other options (arguments beginning with \`-') are ignored.
6235 Every other argument is treated as a filename. Files ending in \`.la' are
6236 treated as uninstalled libtool libraries, other files are standard or library
6239 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6240 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6241 required, except when creating a convenience library.
6243 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6244 using \`ar' and \`ranlib', or on Windows using \`lib'.
6246 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6247 is created, otherwise an executable program is created."
6252 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6254 Remove libraries from an installation directory.
6256 RM is the name of the program to use to delete files associated with each FILE
6257 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6260 If FILE is a libtool library, all the files associated with it are deleted.
6261 Otherwise, only FILE itself is deleted using RM."
6265 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6272 $echo "Try \`$modename --help' for more information about other modes."
6276 # The TAGs below are defined such that we never get into a situation
6277 # in which we disable both kinds of libraries. Given conflicting
6278 # choices, we go for a static library, that is the most portable,
6279 # since we can't tell whether shared libraries were disabled because
6280 # the user asked for that or because the platform doesn't support
6281 # them. This is particularly important on AIX, because we don't
6282 # support having both static and shared libraries enabled at the same
6283 # time on that platform, so we default to a shared-only configuration.
6284 # If a disable-shared tag is given, we'll fallback to a static-only
6285 # configuration. But we'll never go from static-only to shared-only.
6287 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6288 build_libtool_libs=no
6290 # ### END LIBTOOL TAG CONFIG: disable-shared
6292 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6293 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6294 # ### END LIBTOOL TAG CONFIG: disable-static