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
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo; then
43 # used as fallback echo
51 # The name of this program.
52 progname=`$echo "$0" | sed 's%^.*/%%'`
59 TIMESTAMP=" (1.970 2001/07/09 21:36:00)"
62 help="Try \`$progname --help' for more information."
63 magic="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
73 NL2SP='tr \015\012 \040\040'
76 # Only set LANG and LC_ALL to C if already set.
77 # These must not be set unconditionally because not all systems understand
78 # e.g. LANG=C (notably SCO).
79 # We save the old values to restore during execute mode.
80 if test "${LC_ALL+set}" = set; then
81 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
83 if test "${LANG+set}" = set; then
84 save_LANG="$LANG"; LANG=C; export LANG
87 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
88 echo "$modename: not configured to build any kind of library" 1>&2
89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
102 lo2o="s/\\.lo\$/.${objext}/"
103 o2lo="s/\\.${objext}\$/.lo/"
105 # Parse our command line options once, thoroughly.
112 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
116 # If the previous option needs an argument, assign it.
117 if test -n "$prev"; then
120 execute_dlfiles="$execute_dlfiles $arg"
125 # Check whether tagname contains only valid characters
128 echo "$progname: invalid tag name: $tagname" 1>&2
135 # Don't test for the "default" C tag, as we know, it's there, but
136 # not specially marked.
139 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
140 taglist="$taglist $tagname"
141 # Evaluate the configuration.
142 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
144 echo "$progname: ignoring unknown tag $tagname" 1>&2
159 # Have we seen a non-optional argument yet?
166 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
168 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
169 echo "Free Software Foundation, Inc."
170 echo "This is free software; see the source for copying conditions. There is NO"
171 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
176 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
177 # Now print the configurations for the tags.
178 for tagname in $taglist; do
179 sed -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
185 echo "$progname: enabling shell trace mode"
195 if test "$build_libtool_libs" = yes; then
196 echo "enable shared libraries"
198 echo "disable shared libraries"
200 if test "$build_old_libs" = yes; then
201 echo "enable static libraries"
203 echo "disable static libraries"
208 --finish) mode="finish" ;;
210 --mode) prevopt="--mode" prev=mode ;;
211 --mode=*) mode="$optarg" ;;
217 --tag) prevopt="--tag" prev=tag ;;
219 set tag "$optarg" ${1+"$@"}
230 $echo "$modename: unrecognized option \`$arg'" 1>&2
242 if test -n "$prevopt"; then
243 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
248 # If this variable is set in any of the actions, the command in it
249 # will be execed at the end. This prevents here-documents from being
250 # left over by shells.
253 if test -z "$show_help"; then
255 # Infer the operation mode.
256 if test -z "$mode"; then
258 *cc | *++ | gcc* | *-gcc*)
270 *db | *dbx | *strace | *truss)
280 # If we have no mode, but dlfiles were specified, then do execute mode.
281 test -n "$execute_dlfiles" && mode=execute
283 # Just use the default operation mode.
284 if test -z "$mode"; then
285 if test -n "$nonopt"; then
286 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
288 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
295 # Only execute mode is allowed to have -dlopen flags.
296 if test -n "$execute_dlfiles" && test "$mode" != execute; then
297 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
302 # Change the help message to a mode-specific one.
304 help="Try \`$modename --help --mode=$mode' for more information."
306 # These modes are in order of execution frequency so that they run quickly.
308 # libtool compile mode
310 modename="$modename: compile"
311 # Get the compilation command and the source file.
324 # Aesthetically quote the previous argument.
326 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
329 # Double-quote args containing other shell metacharacters.
330 # Many Bourne shells cannot handle close brackets correctly
331 # in scan sets, so we specify it separately.
332 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
337 # Add the previous argument to base_compile.
338 if test -z "$base_compile"; then
339 base_compile="$lastarg"
341 base_compile="$base_compile $lastarg"
347 # Accept any command-line options.
350 if test "$user_target" != "no"; then
351 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
378 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
380 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
384 # Double-quote args containing other shell metacharacters.
385 # Many Bourne shells cannot handle close brackets correctly
386 # in scan sets, so we specify it separately.
388 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
392 lastarg="$lastarg $arg"
395 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
397 # Add the arguments to base_compile.
398 if test -z "$base_compile"; then
399 base_compile="$lastarg"
401 base_compile="$base_compile $lastarg"
409 # The next one is the -o target name
414 # We got the output file
421 # Accept the current argument as the source file.
425 # Aesthetically quote the previous argument.
427 # Backslashify any backslashes, double quotes, and dollar signs.
428 # These are the only characters that are still specially
429 # interpreted inside of double-quoted scrings.
430 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
432 # Double-quote args containing other shell metacharacters.
433 # Many Bourne shells cannot handle close brackets correctly
434 # in scan sets, so we specify it separately.
436 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
437 lastarg="\"$lastarg\""
441 # Add the previous argument to base_compile.
442 if test -z "$base_compile"; then
443 base_compile="$lastarg"
445 base_compile="$base_compile $lastarg"
453 # Get the name of the library object.
454 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
457 $echo "$modename: you must specify a target with \`-o'" 1>&2
462 # Recognize several different file suffixes.
463 # If the user specifies -o file.o, it is replaced with file.lo
472 *.class) xform=class ;;
477 *.java) xform=java ;;
480 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
483 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
485 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
490 # Infer tagged configuration to use if any are available and
491 # if one wasn't chosen via the "--tag" command line option.
492 # Only attempt this if the compiler in the base compile
493 # command doesn't match the default compiler.
494 if test -n "$available_tags" && test -z "$tagname"; then
495 case $base_compile in
497 # Blanks in the command may have been stripped by the calling shell,
498 # but not from the CC environment variable when ltconfig was run.
501 for z in $available_tags; do
502 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
503 # Evaluate the configuration.
504 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
505 case $base_compile in
507 # The compiler in the base compile command matches
508 # the one in the tagged configuration.
509 # Assume this is the tagged configuration we want.
520 # If $tagname still isn't set, then no tagged configuration
521 # was found and let the user know that the "--tag" command
522 # line option must be used.
523 if test -z "$tagname"; then
524 echo "$modename: unable to infer tagged configuration"
525 echo "$modename: specify a tag with \`--tag'" 1>&2
528 # echo "$modename: using $tagname tagged configuration"
534 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
535 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
536 if test "X$xdir" = "X$obj"; then
541 lobj=${xdir}$objdir/$objname
543 if test -z "$base_compile"; then
544 $echo "$modename: you must specify a compilation command" 1>&2
549 # Delete any leftover library objects.
550 if test "$build_old_libs" = yes; then
551 removelist="$obj $lobj $libobj ${libobj}T"
553 removelist="$lobj $libobj ${libobj}T"
557 trap "$run $rm $removelist; exit 1" 1 2 15
559 # On Cygwin there's no "real" PIC flag so we must build both object types
561 cygwin* | mingw* | pw32* | os2*)
565 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
566 # non-PIC code in shared libraries is not supported
570 # Calculate the filename of the output object if compiler does
571 # not support -o with -c
572 if test "$compiler_c_o" = no; then
573 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
574 lockfile="$output_obj.lock"
575 removelist="$removelist $output_obj $lockfile"
576 trap "$run $rm $removelist; exit 1" 1 2 15
583 # Lock this critical section if it is needed
584 # We use this script file to make the link, it avoids creating a new file
585 if test "$need_locks" = yes; then
586 until $run ln "$0" "$lockfile" 2>/dev/null; do
587 $show "Waiting for $lockfile to be removed"
590 elif test "$need_locks" = warn; then
591 if test -f "$lockfile"; then
593 *** ERROR, $lockfile exists and contains:
594 `cat $lockfile 2>/dev/null`
596 This indicates that another process is trying to use the same
597 temporary object file, and libtool could not work around it because
598 your compiler does not support \`-c' and \`-o' together. If you
599 repeat this compilation, it may succeed, by chance, but you had better
600 avoid parallel builds (make -j) in this platform, or get a better
606 echo $srcfile > "$lockfile"
609 if test -n "$fix_srcfile_path"; then
610 eval srcfile=\"$fix_srcfile_path\"
613 $run $rm "$libobj" "${libobj}T"
615 # Create a libtool object file (analogous to a ".la" file),
616 # but don't create it if we're doing a dry run.
617 test -z "$run" && cat > ${libobj}T <<EOF
618 # $libobj - a libtool object file
619 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
621 # Please DO NOT delete this file!
622 # It is necessary for linking the library.
624 # Name of the PIC object.
627 # Only build a PIC object if we are building libtool libraries.
628 if test "$build_libtool_libs" = yes; then
629 # Without this assignment, base_compile gets emptied.
630 fbsd_hideous_sh_bug=$base_compile
632 if test "$pic_mode" != no; then
633 command="$base_compile $srcfile $pic_flag"
635 # Don't build PIC code
636 command="$base_compile $srcfile"
639 if test ! -d ${xdir}$objdir; then
640 $show "$mkdir ${xdir}$objdir"
641 $run $mkdir ${xdir}$objdir
643 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
648 if test -z "$output_obj"; then
649 # Place PIC objects in $objdir
650 command="$command -o $lobj"
653 $run $rm "$lobj" "$output_obj"
656 if $run eval "$command"; then :
658 test -n "$output_obj" && $run $rm $removelist
662 if test "$need_locks" = warn &&
663 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
665 *** ERROR, $lockfile contains:
666 `cat $lockfile 2>/dev/null`
668 but it should contain:
671 This indicates that another process is trying to use the same
672 temporary object file, and libtool could not work around it because
673 your compiler does not support \`-c' and \`-o' together. If you
674 repeat this compilation, it may succeed, by chance, but you had better
675 avoid parallel builds (make -j) in this platform, or get a better
682 # Just move the object if needed, then go on to compile the next one
683 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
684 $show "$mv $output_obj $lobj"
685 if $run $mv $output_obj $lobj; then :
693 # Append the name of the PIC object to the libtool object file.
694 test -z "$run" && cat >> ${libobj}T <<EOF
695 pic_object='$objdir/$objname'
699 # Allow error messages only from the first compilation.
700 suppress_output=' >/dev/null 2>&1'
702 # No PIC object so indicate it doesn't exist in the libtool
704 test -z "$run" && cat >> ${libobj}T <<EOF
710 # Only build a position-dependent object if we build old libraries.
711 if test "$build_old_libs" = yes; then
712 if test "$pic_mode" != yes; then
713 # Don't build PIC code
714 command="$base_compile $srcfile"
716 command="$base_compile $srcfile $pic_flag"
718 if test "$compiler_c_o" = yes; then
719 command="$command -o $obj"
722 # Suppress compiler output if we already did a PIC compilation.
723 command="$command$suppress_output"
724 $run $rm "$obj" "$output_obj"
726 if $run eval "$command"; then :
732 if test "$need_locks" = warn &&
733 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
735 *** ERROR, $lockfile contains:
736 `cat $lockfile 2>/dev/null`
738 but it should contain:
741 This indicates that another process is trying to use the same
742 temporary object file, and libtool could not work around it because
743 your compiler does not support \`-c' and \`-o' together. If you
744 repeat this compilation, it may succeed, by chance, but you had better
745 avoid parallel builds (make -j) in this platform, or get a better
752 # Just move the object if needed
753 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
754 $show "$mv $output_obj $obj"
755 if $run $mv $output_obj $obj; then :
763 # Append the name of the non-PIC object the libtool object file.
764 # Only append if the libtool object file exists.
765 test -z "$run" && cat >> ${libobj}T <<EOF
766 # Name of the non-PIC object.
767 non_pic_object='$objname'
771 # Append the name of the non-PIC object the libtool object file.
772 # Only append if the libtool object file exists.
773 test -z "$run" && cat >> ${libobj}T <<EOF
774 # Name of the non-PIC object.
780 $run $mv "${libobj}T" "${libobj}"
782 # Unlock the critical section if it was locked
783 if test "$need_locks" != no; then
792 modename="$modename: link"
794 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
795 # It is impossible to link a dll without this setting, and
796 # we shouldn't force the makefile maintainer to figure out
797 # which system we are compiling for in order to pass an extra
798 # flag for every libtool invokation.
801 # FIXME: Unfortunately, there are problems with the above when trying
802 # to make a dll which has undefined symbols, in which case not
803 # even a static library is built. For now, we need to specify
804 # -no-undefined on the libtool link line when we can be certain
805 # that all symbols are satisfied, otherwise we get a static library.
812 libtool_args="$nonopt"
813 base_compile="$nonopt"
814 compile_command="$nonopt"
815 finalize_command="$nonopt"
828 lib_search_path=`pwd`
836 export_symbols_regex=
844 prefer_static_libs=no
856 # We need to know -static, to get the right output filenames.
860 -all-static | -static)
861 if test "X$arg" = "X-all-static"; then
862 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
863 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
865 if test -n "$link_static_flag"; then
866 dlopen_self=$dlopen_self_static
869 if test -z "$pic_flag" && test -n "$link_static_flag"; then
870 dlopen_self=$dlopen_self_static
873 build_libtool_libs=no
875 prefer_static_libs=yes
881 # See if our shared archives depend on static archives.
882 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
884 # Go through the arguments, transforming them on the way.
885 while test $# -gt 0; do
887 base_compile="$base_compile $arg"
890 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
891 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
895 libtool_args="$libtool_args $qarg"
897 # If the previous option needs an argument, assign it.
898 if test -n "$prev"; then
901 compile_command="$compile_command @OUTPUT@"
902 finalize_command="$finalize_command @OUTPUT@"
908 if test "$preload" = no; then
909 # Add the symbol object into the linking commands.
910 compile_command="$compile_command @SYMFILE@"
911 finalize_command="$finalize_command @SYMFILE@"
915 *.la | *.lo) ;; # We handle these cases below.
917 if test "$dlself" = no; then
925 if test "$prev" = dlprefiles; then
927 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
937 if test "$prev" = dlfiles; then
938 dlfiles="$dlfiles $arg"
940 dlprefiles="$dlprefiles $arg"
948 export_symbols="$arg"
949 if test ! -f "$arg"; then
950 $echo "$modename: symbol file \`$arg' does not exist"
957 export_symbols_regex="$arg"
967 if test -f "$arg"; then
970 for fil in `cat $save_arg`
972 # moreargs="$moreargs $fil"
974 # A libtool-controlled object.
976 # Check to see that this really is a libtool object.
977 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
982 # If there is no directory component, then add one.
984 */* | *\\*) . $arg ;;
988 if test -z "$pic_object" || \
989 test -z "$non_pic_object" ||
990 test "$pic_object" = none && \
991 test "$non_pic_object" = none; then
992 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
996 # Extract subdirectory from the argument.
997 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
998 if test "X$xdir" = "X$arg"; then
1004 if test "$pic_object" != none; then
1005 # Prepend the subdirectory the object is found in.
1006 pic_object="$xdir$pic_object"
1008 if test "$prev" = dlfiles; then
1009 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1010 dlfiles="$dlfiles $pic_object"
1014 # If libtool objects are unsupported, then we need to preload.
1019 # CHECK ME: I think I busted this. -Ossama
1020 if test "$prev" = dlprefiles; then
1021 # Preload the old-style object.
1022 dlprefiles="$dlprefiles $pic_object"
1027 libobjs="$libobjs $pic_object"
1032 if test "$non_pic_object" != none; then
1033 # Prepend the subdirectory the object is found in.
1034 non_pic_object="$xdir$non_pic_object"
1036 # A standard non-PIC object
1037 non_pic_objects="$non_pic_objects $non_pic_object"
1038 if test -z "$pic_object" || test "$pic_object" = none ; then
1039 arg="$non_pic_object"
1043 # Only an error if not doing a dry-run.
1044 if test -z "$run"; then
1045 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1050 # Extract subdirectory from the argument.
1051 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1052 if test "X$xdir" = "X$arg"; then
1058 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1059 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1060 libobjs="$libobjs $pic_object"
1061 non_pic_objects="$non_pic_objects $non_pic_object"
1066 $echo "$modename: link input file \`$save_arg' does not exist"
1074 # We need an absolute path.
1076 [\\/]* | [A-Za-z]:[\\/]*) ;;
1078 $echo "$modename: only absolute run-paths are allowed" 1>&2
1082 if test "$prev" = rpath; then
1085 *) rpath="$rpath $arg" ;;
1090 *) xrpath="$xrpath $arg" ;;
1097 compiler_flags="$compiler_flags $qarg"
1099 compile_command="$compile_command $qarg"
1100 finalize_command="$finalize_command $qarg"
1104 linker_flags="$linker_flags $qarg"
1105 compiler_flags="$compiler_flags $wl$qarg"
1107 compile_command="$compile_command $wl$qarg"
1108 finalize_command="$finalize_command $wl$qarg"
1112 eval "$prev=\"\$arg\""
1123 if test -n "$link_static_flag"; then
1124 compile_command="$compile_command $link_static_flag"
1125 finalize_command="$finalize_command $link_static_flag"
1131 # FIXME: remove this flag sometime in the future.
1132 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1156 -export-symbols | -export-symbols-regex)
1157 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1158 $echo "$modename: more than one -exported-symbols argument is not allowed"
1161 if test "X$arg" = "X-export-symbols"; then
1169 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1170 # so, if we see these flags be careful not to treat them like -L
1172 case $with_gcc/$host in
1174 compile_command="$compile_command $arg"
1175 finalize_command="$finalize_command $arg"
1182 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1183 # We need an absolute path.
1185 [\\/]* | [A-Za-z]:[\\/]*) ;;
1187 absdir=`cd "$dir" && pwd`
1188 if test -z "$absdir"; then
1189 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1198 deplibs="$deplibs -L$dir"
1199 lib_search_path="$lib_search_path $dir"
1203 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1204 case :$dllsearchpath: in
1206 *) dllsearchpath="$dllsearchpath:$dir";;
1214 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1216 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1217 # These systems don't actually have a C or math library (as such)
1220 *-*-mingw* | *-*-os2*)
1221 # These systems don't actually have a C library (as such)
1222 test "X$arg" = "X-lc" && continue
1225 # OpenBSD uses either libc or libc_r.
1228 *-*-rhapsody* | *-*-darwin1.[012])
1229 # Rhapsody C and math libraries are in the System framework
1230 deplibs="$deplibs -framework System"
1234 if test "X$arg" = "X-lc_r"; then
1237 # Do not include libc_r directly, use -pthread flag.
1242 deplibs="$deplibs $arg"
1258 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1259 # The PATH hackery in wrapper scripts is required on Windows
1260 # in order for the loader to find any dlls it needs.
1261 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1262 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1265 *) no_install=yes ;;
1298 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1299 # We need an absolute path.
1301 [\\/]* | [A-Za-z]:[\\/]*) ;;
1303 $echo "$modename: only absolute run-paths are allowed" 1>&2
1309 *) xrpath="$xrpath $dir" ;;
1315 # The effects of -static are defined in a previous loop.
1316 # We used to do the same as -all-static on platforms that
1317 # didn't have a PIC flag, but the assumption that the effects
1318 # would be equivalent was wrong. It would break on at least
1319 # Digital Unix and AIX.
1334 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1336 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1337 for flag in $args; do
1340 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1345 compiler_flags="$compiler_flags $flag"
1348 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1352 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1354 IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1355 for flag in $args; do
1358 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1363 compiler_flags="$compiler_flags $wl$flag"
1364 linker_flags="$linker_flags $flag"
1367 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1380 # Some other compiler flag.
1382 # Unknown arguments in both finalize_command and compile_command need
1383 # to be aesthetically quoted because they are evaled later.
1384 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1386 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1393 # A standard object.
1398 # A libtool-controlled object.
1400 # Check to see that this really is a libtool object.
1401 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1406 # If there is no directory component, then add one.
1408 */* | *\\*) . $arg ;;
1412 if test -z "$pic_object" || \
1413 test -z "$non_pic_object" ||
1414 test "$pic_object" = none && \
1415 test "$non_pic_object" = none; then
1416 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1420 # Extract subdirectory from the argument.
1421 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1422 if test "X$xdir" = "X$arg"; then
1428 if test "$pic_object" != none; then
1429 # Prepend the subdirectory the object is found in.
1430 pic_object="$xdir$pic_object"
1432 if test "$prev" = dlfiles; then
1433 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1434 dlfiles="$dlfiles $pic_object"
1438 # If libtool objects are unsupported, then we need to preload.
1443 # CHECK ME: I think I busted this. -Ossama
1444 if test "$prev" = dlprefiles; then
1445 # Preload the old-style object.
1446 dlprefiles="$dlprefiles $pic_object"
1451 libobjs="$libobjs $pic_object"
1456 if test "$non_pic_object" != none; then
1457 # Prepend the subdirectory the object is found in.
1458 non_pic_object="$xdir$non_pic_object"
1460 # A standard non-PIC object
1461 non_pic_objects="$non_pic_objects $non_pic_object"
1462 if test -z "$pic_object" || test "$pic_object" = none ; then
1463 arg="$non_pic_object"
1467 # Only an error if not doing a dry-run.
1468 if test -z "$run"; then
1469 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1474 # Extract subdirectory from the argument.
1475 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1476 if test "X$xdir" = "X$arg"; then
1482 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1483 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1484 libobjs="$libobjs $pic_object"
1485 non_pic_objects="$non_pic_objects $non_pic_object"
1492 deplibs="$deplibs $arg"
1493 old_deplibs="$old_deplibs $arg"
1498 # A libtool-controlled library.
1500 if test "$prev" = dlfiles; then
1501 # This library was specified with -dlopen.
1502 dlfiles="$dlfiles $arg"
1504 elif test "$prev" = dlprefiles; then
1505 # The library was specified with -dlpreopen.
1506 dlprefiles="$dlprefiles $arg"
1509 deplibs="$deplibs $arg"
1514 # Some other compiler argument.
1516 # Unknown arguments in both finalize_command and compile_command need
1517 # to be aesthetically quoted because they are evaled later.
1518 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1520 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1527 # Now actually substitute the argument into the commands.
1528 if test -n "$arg"; then
1529 compile_command="$compile_command $arg"
1530 finalize_command="$finalize_command $arg"
1532 done # argument parsing loop
1534 if test -n "$prev"; then
1535 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1540 # Infer tagged configuration to use if any are available and
1541 # if one wasn't chosen via the "--tag" command line option.
1542 # Only attempt this if the compiler in the base link
1543 # command doesn't match the default compiler.
1544 if test -n "$available_tags" && test -z "$tagname"; then
1545 case $base_compile in
1547 # Blanks in the command may have been stripped by the calling shell,
1548 # but not from the CC environment variable when ltconfig was run.
1551 for z in $available_tags; do
1552 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1553 # Evaluate the configuration.
1554 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1555 case $base_compile in
1557 # The compiler in $compile_command matches
1558 # the one in the tagged configuration.
1559 # Assume this is the tagged configuration we want.
1570 # If $tagname still isn't set, then no tagged configuration
1571 # was found and let the user know that the "--tag" command
1572 # line option must be used.
1573 if test -z "$tagname"; then
1574 echo "$modename: unable to infer tagged configuration"
1575 echo "$modename: specify a tag with \`--tag'" 1>&2
1578 # echo "$modename: using $tagname tagged configuration"
1584 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1585 eval arg=\"$export_dynamic_flag_spec\"
1586 compile_command="$compile_command $arg"
1587 finalize_command="$finalize_command $arg"
1591 # calculate the name of the file, without its directory
1592 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1593 libobjs_save="$libobjs"
1595 if test -n "$shlibpath_var"; then
1596 # get the directories listed in $shlibpath_var
1597 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1601 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1602 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1604 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1605 if test "X$output_objdir" = "X$output"; then
1606 output_objdir="$objdir"
1608 output_objdir="$output_objdir/$objdir"
1610 # Create the object directory.
1611 if test ! -d $output_objdir; then
1612 $show "$mkdir $output_objdir"
1613 $run $mkdir $output_objdir
1615 if test $status -ne 0 && test ! -d $output_objdir; then
1620 # Determine the type of output
1623 $echo "$modename: you must specify an output file" 1>&2
1627 *.$libext) linkmode=oldlib ;;
1628 *.lo | *.$objext) linkmode=obj ;;
1629 *.la) linkmode=lib ;;
1630 *) linkmode=prog ;; # Anything else should be a program.
1635 # Find all interdependent deplibs by searching for libraries
1636 # that are linked more than once (e.g. -la -lb -la)
1637 for deplib in $deplibs; do
1639 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1641 libs="$libs $deplib"
1644 if test $linkmode = lib; then
1645 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1647 # Compute libraries that are listed more than once in $predeps
1648 # $postdeps and mark them as special (i.e., whose duplicates are
1649 # not to be eliminated).
1651 for pre_post_dep in $predeps $postdeps; do
1652 case "$pre_post_deps " in
1653 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1655 pre_post_deps="$pre_post_deps $pre_post_dep"
1663 need_relink=no # whether we're linking any uninstalled libtool libraries
1664 notinst_deplibs= # not-installed libtool libraries
1665 notinst_path= # paths that contain not-installed libtool libraries
1669 for file in $dlfiles $dlprefiles; do
1673 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1685 passes="conv scan dlopen dlpreopen link"
1690 for pass in $passes; do
1691 if test "$linkmode,$pass" = "lib,link" ||
1692 test "$linkmode,$pass" = "prog,scan"; then
1696 if test $linkmode = prog; then
1698 dlopen) libs="$dlfiles" ;;
1699 dlpreopen) libs="$dlprefiles" ;;
1700 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1703 if test $pass = dlopen; then
1704 # Collect dlpreopened libraries
1705 save_deplibs="$deplibs"
1708 for deplib in $libs; do
1713 if test $linkmode != lib && test $linkmode != prog; then
1714 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1717 if test $pass = conv; then
1718 deplibs="$deplib $deplibs"
1721 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1722 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1723 # Search the libtool library
1724 lib="$searchdir/lib${name}.la"
1725 if test -f "$lib"; then
1730 if test "$found" != yes; then
1731 # deplib doesn't seem to be a libtool library
1732 if test "$linkmode,$pass" = "prog,link"; then
1733 compile_deplibs="$deplib $compile_deplibs"
1734 finalize_deplibs="$deplib $finalize_deplibs"
1736 deplibs="$deplib $deplibs"
1737 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1745 deplibs="$deplib $deplibs"
1746 test $pass = conv && continue
1747 newdependency_libs="$deplib $newdependency_libs"
1748 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1751 if test $pass = conv; then
1752 deplibs="$deplib $deplibs"
1755 if test $pass = scan; then
1756 deplibs="$deplib $deplibs"
1757 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1759 compile_deplibs="$deplib $compile_deplibs"
1760 finalize_deplibs="$deplib $finalize_deplibs"
1764 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1770 if test $pass = link; then
1771 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1772 # Make sure the xrpath contains only unique directories.
1775 *) xrpath="$xrpath $dir" ;;
1778 deplibs="$deplib $deplibs"
1781 *.la) lib="$deplib" ;;
1783 if test $pass = conv; then
1784 deplibs="$deplib $deplibs"
1789 if test "$deplibs_check_method" != pass_all; then
1791 echo "*** Warning: This library needs some functionality provided by $deplib."
1792 echo "*** I have the capability to make that library automatically link in when"
1793 echo "*** you link to this library. But I can only do this if you have a"
1794 echo "*** shared version of the library, which you do not appear to have."
1797 echo "*** Warning: Linking the shared library $output against the"
1798 echo "*** static library $deplib is not portable!"
1799 deplibs="$deplib $deplibs"
1804 if test $pass != link; then
1805 deplibs="$deplib $deplibs"
1807 compile_deplibs="$deplib $compile_deplibs"
1808 finalize_deplibs="$deplib $finalize_deplibs"
1815 if test $pass = conv; then
1816 deplibs="$deplib $deplibs"
1817 elif test $linkmode = prog; then
1818 if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1819 # If there is no dlopen support or we're linking statically,
1820 # we need to preload.
1821 newdlprefiles="$newdlprefiles $deplib"
1822 compile_deplibs="$deplib $compile_deplibs"
1823 finalize_deplibs="$deplib $finalize_deplibs"
1825 newdlfiles="$newdlfiles $deplib"
1835 if test $found = yes || test -f "$lib"; then :
1837 $echo "$modename: cannot find the library \`$lib'" 1>&2
1841 # Check to see that this really is a libtool archive.
1842 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1844 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1848 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1849 test "X$ladir" = "X$lib" && ladir="."
1857 # If the library was installed with an old release of libtool,
1858 # it will not redefine variable installed.
1863 */* | *\\*) . $lib ;;
1867 if test "$linkmode,$pass" = "lib,link" ||
1868 test "$linkmode,$pass" = "prog,scan" ||
1869 { test $linkmode != prog && test $linkmode != lib; }; then
1870 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1871 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1874 if test $pass = conv; then
1875 # Only check for convenience libraries
1876 deplibs="$lib $deplibs"
1877 if test -z "$libdir"; then
1878 if test -z "$old_library"; then
1879 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1882 # It is a libtool convenience library, so add in its objects.
1883 convenience="$convenience $ladir/$objdir/$old_library"
1884 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1886 for deplib in $dependency_libs; do
1887 deplibs="$deplib $deplibs"
1888 case "$tmp_libs " in
1889 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1891 tmp_libs="$tmp_libs $deplib"
1893 elif test $linkmode != prog && test $linkmode != lib; then
1894 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1900 # Get the name of the library we link against.
1902 for l in $old_library $library_names; do
1905 if test -z "$linklib"; then
1906 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1910 # This library was specified with -dlopen.
1911 if test $pass = dlopen; then
1912 if test -z "$libdir"; then
1913 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1916 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1917 # If there is no dlname, no dlopen support or we're linking
1918 # statically, we need to preload. We also need to preload any
1919 # dependent libraries so libltdl's deplib preloader doesn't
1920 # bomb out in the load deplibs phase.
1921 dlprefiles="$dlprefiles $lib $dependency_libs"
1923 newdlfiles="$newdlfiles $lib"
1928 # We need an absolute path.
1930 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1932 abs_ladir=`cd "$ladir" && pwd`
1933 if test -z "$abs_ladir"; then
1934 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1935 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1940 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1942 # Find the relevant object directory and library name.
1943 if test "X$installed" = Xyes; then
1944 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1945 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1954 dir="$ladir/$objdir"
1955 absdir="$abs_ladir/$objdir"
1956 # Remove this search path later
1957 notinst_path="$notinst_path $abs_ladir"
1958 fi # $installed = yes
1959 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1961 # This library was specified with -dlpreopen.
1962 if test $pass = dlpreopen; then
1963 if test -z "$libdir"; then
1964 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1967 # Prefer using a static library (so that no silly _DYNAMIC symbols
1968 # are required to link).
1969 if test -n "$old_library"; then
1970 newdlprefiles="$newdlprefiles $dir/$old_library"
1971 # Otherwise, use the dlname, so that lt_dlopen finds it.
1972 elif test -n "$dlname"; then
1973 newdlprefiles="$newdlprefiles $dir/$dlname"
1975 newdlprefiles="$newdlprefiles $dir/$linklib"
1977 fi # $pass = dlpreopen
1979 if test -z "$libdir"; then
1980 # Link the convenience library
1981 if test $linkmode = lib; then
1982 deplibs="$dir/$old_library $deplibs"
1983 elif test "$linkmode,$pass" = "prog,link"; then
1984 compile_deplibs="$dir/$old_library $compile_deplibs"
1985 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1987 deplibs="$lib $deplibs" # used for prog,scan pass
1992 if test $linkmode = prog && test $pass != link; then
1993 newlib_search_path="$newlib_search_path $ladir"
1994 deplibs="$lib $deplibs"
1997 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1998 test "$build_libtool_libs" = no; then
2003 for deplib in $dependency_libs; do
2005 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2007 # Need to link against all dependency_libs?
2008 if test $linkalldeplibs = yes; then
2009 deplibs="$deplib $deplibs"
2011 # Need to hardcode shared library paths
2012 # or/and link against static libraries
2013 newdependency_libs="$deplib $newdependency_libs"
2015 case "$tmp_libs " in
2016 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2018 tmp_libs="$tmp_libs $deplib"
2021 fi # $linkmode = prog...
2023 if test "$linkmode,$pass" = "prog,link"; then
2024 if test -n "$library_names" &&
2025 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2026 # We need to hardcode the library path
2027 if test -n "$shlibpath_var"; then
2028 # Make sure the rpath contains only unique directories.
2029 case "$temp_rpath " in
2032 *) temp_rpath="$temp_rpath $dir" ;;
2036 # Hardcode the library path.
2037 # Skip directories that are in the system default run-time
2039 case " $sys_lib_dlsearch_path " in
2042 case "$compile_rpath " in
2044 *) compile_rpath="$compile_rpath $absdir"
2048 case " $sys_lib_dlsearch_path " in
2051 case "$finalize_rpath " in
2053 *) finalize_rpath="$finalize_rpath $libdir"
2057 fi # $linkmode,$pass = prog,link...
2059 if test "$alldeplibs" = yes &&
2060 { test "$deplibs_check_method" = pass_all ||
2061 { test "$build_libtool_libs" = yes &&
2062 test -n "$library_names"; }; }; then
2063 # We only need to search for static libraries
2068 link_static=no # Whether the deplib will be linked statically
2069 if test -n "$library_names" &&
2070 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2071 if test "$installed" = no; then
2072 notinst_deplibs="$notinst_deplibs $lib"
2075 # This is a shared library
2076 if test $linkmode = lib &&
2077 test $hardcode_into_libs = yes; then
2078 # Hardcode the library path.
2079 # Skip directories that are in the system default run-time
2081 case " $sys_lib_dlsearch_path " in
2084 case "$compile_rpath " in
2086 *) compile_rpath="$compile_rpath $absdir"
2090 case " $sys_lib_dlsearch_path " in
2093 case "$finalize_rpath " in
2095 *) finalize_rpath="$finalize_rpath $libdir"
2101 if test -n "$old_archive_from_expsyms_cmds"; then
2102 # figure out the soname
2103 set dummy $library_names
2106 libname=`eval \\$echo \"$libname_spec\"`
2107 # use dlname if we got it. it's perfectly good, no?
2108 if test -n "$dlname"; then
2110 elif test -n "$soname_spec"; then
2114 major=`expr $current - $age`
2118 eval soname=\"$soname_spec\"
2123 # Make a new name for the extract_expsyms_cmds to use
2125 soname=`echo $soroot | sed -e 's/^.*\///'`
2126 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2128 # If the library has no export list, then create one now
2129 if test -f "$output_objdir/$soname-def"; then :
2131 $show "extracting exported symbol list from \`$soname'"
2132 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2133 eval cmds=\"$extract_expsyms_cmds\"
2134 for cmd in $cmds; do
2137 $run eval "$cmd" || exit $?
2143 if test -f "$output_objdir/$newlib"; then :; else
2144 $show "generating import library for \`$soname'"
2145 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2146 eval cmds=\"$old_archive_from_expsyms_cmds\"
2147 for cmd in $cmds; do
2150 $run eval "$cmd" || exit $?
2154 # make sure the library variables are pointing to the new library
2157 fi # test -n $old_archive_from_expsyms_cmds
2159 if test $linkmode = prog || test "$mode" != relink; then
2164 case $hardcode_action in
2165 immediate | unsupported)
2166 if test "$hardcode_direct" = no; then
2168 elif test "$hardcode_minus_L" = no; then
2170 *-*-sunos*) add_shlibpath="$dir" ;;
2174 elif test "$hardcode_shlibpath_var" = no; then
2175 add_shlibpath="$dir"
2182 if test "$hardcode_direct" = yes; then
2184 elif test "$hardcode_minus_L" = yes; then
2187 elif test "$hardcode_shlibpath_var" = yes; then
2188 add_shlibpath="$dir"
2197 if test "$lib_linked" != yes; then
2198 $echo "$modename: configuration error: unsupported hardcode properties"
2202 if test -n "$add_shlibpath"; then
2203 case :$compile_shlibpath: in
2204 *":$add_shlibpath:"*) ;;
2205 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2208 if test $linkmode = prog; then
2209 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2210 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2212 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2213 test -n "$add" && deplibs="$add $deplibs"
2214 if test "$hardcode_direct" != yes && \
2215 test "$hardcode_minus_L" != yes && \
2216 test "$hardcode_shlibpath_var" = yes; then
2217 case :$finalize_shlibpath: in
2219 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2225 if test $linkmode = prog || test "$mode" = relink; then
2229 # Finalize command for both is simple: just hardcode it.
2230 if test "$hardcode_direct" = yes; then
2231 add="$libdir/$linklib"
2232 elif test "$hardcode_minus_L" = yes; then
2235 elif test "$hardcode_shlibpath_var" = yes; then
2236 case :$finalize_shlibpath: in
2238 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2242 # We cannot seem to hardcode it, guess we'll fake it.
2247 if test $linkmode = prog; then
2248 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2249 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2251 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2252 test -n "$add" && deplibs="$add $deplibs"
2255 elif test $linkmode = prog; then
2256 # Here we assume that one of hardcode_direct or hardcode_minus_L
2257 # is not unsupported. This is valid on all known static and
2259 if test "$hardcode_direct" != unsupported; then
2260 test -n "$old_library" && linklib="$old_library"
2261 compile_deplibs="$dir/$linklib $compile_deplibs"
2262 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2264 compile_deplibs="-l$name -L$dir $compile_deplibs"
2265 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2267 elif test "$build_libtool_libs" = yes; then
2268 # Not a shared library
2269 if test "$deplibs_check_method" != pass_all; then
2270 # We're trying link a shared library against a static one
2271 # but the system doesn't support it.
2273 # Just print a warning and add the library to dependency_libs so
2274 # that the program can be linked against the static library.
2276 echo "*** Warning: This library needs some functionality provided by $lib."
2277 echo "*** I have the capability to make that library automatically link in when"
2278 echo "*** you link to this library. But I can only do this if you have a"
2279 echo "*** shared version of the library, which you do not appear to have."
2280 if test "$module" = yes; then
2281 echo "*** Therefore, libtool will create a static module, that should work "
2282 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2283 if test -z "$global_symbol_pipe"; then
2285 echo "*** However, this would only work if libtool was able to extract symbol"
2286 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2287 echo "*** not find such a program. So, this module is probably useless."
2288 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2290 if test "$build_old_libs" = no; then
2291 build_libtool_libs=module
2294 build_libtool_libs=no
2298 convenience="$convenience $dir/$old_library"
2299 old_convenience="$old_convenience $dir/$old_library"
2300 deplibs="$dir/$old_library $deplibs"
2303 fi # link shared/static library?
2305 if test $linkmode = lib; then
2306 if test -n "$dependency_libs" &&
2307 { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
2308 test $link_static = yes; }; then
2309 # Extract -R from dependency_libs
2311 for libdir in $dependency_libs; do
2313 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2315 *" $temp_xrpath "*) ;;
2316 *) xrpath="$xrpath $temp_xrpath";;
2318 *) temp_deplibs="$temp_deplibs $libdir";;
2321 dependency_libs="$temp_deplibs"
2324 newlib_search_path="$newlib_search_path $absdir"
2325 # Link against this library
2326 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2327 # ... and its dependency_libs
2329 for deplib in $dependency_libs; do
2330 newdependency_libs="$deplib $newdependency_libs"
2331 case "$tmp_libs " in
2332 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2334 tmp_libs="$tmp_libs $deplib"
2337 if test $link_all_deplibs != no; then
2338 # Add the search paths of all dependency libraries
2339 for deplib in $dependency_libs; do
2341 -L*) path="$deplib" ;;
2343 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2344 test "X$dir" = "X$deplib" && dir="."
2345 # We need an absolute path.
2347 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2349 absdir=`cd "$dir" && pwd`
2350 if test -z "$absdir"; then
2351 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2356 if grep "^installed=no" $deplib > /dev/null; then
2357 path="-L$absdir/$objdir"
2359 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2360 if test -z "$libdir"; then
2361 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2364 if test "$absdir" != "$libdir"; then
2365 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2372 case " $deplibs " in
2374 *) deplibs="$deplibs $path" ;;
2377 fi # link_all_deplibs != no
2379 done # for deplib in $libs
2380 dependency_libs="$newdependency_libs"
2381 if test $pass = dlpreopen; then
2382 # Link the dlpreopened libraries before other libraries
2383 for deplib in $save_deplibs; do
2384 deplibs="$deplib $deplibs"
2387 if test $pass != dlopen; then
2388 if test $pass != conv; then
2389 # Make sure lib_search_path contains only unique directories.
2391 for dir in $newlib_search_path; do
2392 case "$lib_search_path " in
2394 *) lib_search_path="$lib_search_path $dir" ;;
2400 if test "$linkmode,$pass" != "prog,link"; then
2403 vars="compile_deplibs finalize_deplibs"
2405 for var in $vars dependency_libs; do
2406 # Add libraries to $var in reverse order
2407 eval tmp_libs=\"\$$var\"
2409 for deplib in $tmp_libs; do
2410 # FIXME: Pedantically, this is the right thing to do, so
2411 # that some nasty dependency loop isn't accidentally
2413 #new_libs="$deplib $new_libs"
2414 # Pragmatically, this seems to cause very few problems in
2417 -L*) new_libs="$deplib $new_libs" ;;
2419 # And here is the reason: when a library appears more
2420 # than once as an explicit dependence of a library, or
2421 # is implicitly linked in more than once by the
2422 # compiler, it is considered special, and multiple
2423 # occurrences thereof are not removed. Compare this
2424 # with having the same library being listed as a
2425 # dependency of multiple other libraries: in this case,
2426 # we know (pedantically, we assume) the library does not
2427 # need to be listed more than once, so we keep only the
2428 # last copy. This is not always right, but it is rare
2429 # enough that we require users that really mean to play
2430 # such unportable linking tricks to link the library
2431 # using -Wl,-lname, so that libtool does not consider it
2432 # for duplicate removal.
2433 case " $specialdeplibs " in
2434 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2436 case " $new_libs " in
2438 *) new_libs="$deplib $new_libs" ;;
2446 for deplib in $new_libs; do
2449 case " $tmp_libs " in
2451 *) tmp_libs="$tmp_libs $deplib" ;;
2454 *) tmp_libs="$tmp_libs $deplib" ;;
2457 eval $var=\"$tmp_libs\"
2461 if test $linkmode = prog; then
2462 dlfiles="$newdlfiles"
2463 dlprefiles="$newdlprefiles"
2468 if test -n "$deplibs"; then
2469 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2472 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2473 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2476 if test -n "$rpath"; then
2477 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2480 if test -n "$xrpath"; then
2481 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2484 if test -n "$vinfo"; then
2485 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2488 if test -n "$release"; then
2489 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2492 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2493 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2496 # Now set the variables for building old libraries.
2497 build_libtool_libs=no
2499 objs="$objs$old_deplibs"
2503 # Make sure we only generate libraries of the form `libNAME.la'.
2506 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2507 eval libname=\"$libname_spec\"
2510 if test "$module" = no; then
2511 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2515 if test "$need_lib_prefix" != no; then
2516 # Add the "lib" prefix for modules if required
2517 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2518 eval libname=\"$libname_spec\"
2520 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2525 if test -n "$objs"; then
2526 if test "$deplibs_check_method" != pass_all; then
2527 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2531 echo "*** Warning: Linking the shared library $output against the non-libtool"
2532 echo "*** objects $objs is not portable!"
2533 libobjs="$libobjs $objs"
2537 if test "$dlself" != no; then
2538 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2542 if test $# -gt 2; then
2543 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2548 if test -z "$rpath"; then
2549 if test "$build_libtool_libs" = yes; then
2550 # Building a libtool convenience library.
2551 # Some compilers have problems with a `.al' extension so
2552 # convenience libraries should have the same extension an
2553 # archive normally would.
2554 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2555 build_libtool_libs=convenience
2559 if test -n "$vinfo"; then
2560 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2563 if test -n "$release"; then
2564 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2568 # Parse the version information argument.
2569 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2570 set dummy $vinfo 0 0 0
2573 if test -n "$8"; then
2574 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2583 # Check that each of the things are valid numbers.
2585 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2587 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2588 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2594 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2596 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2597 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2603 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2605 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2606 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2611 if test $age -gt $current; then
2612 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2613 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2617 # Calculate the version variables.
2621 case $version_type in
2625 # Like Linux, but with the current version available in
2626 # verstring for coding it into the library header
2627 major=.`expr $current - $age`
2628 versuffix="$major.$age.$revision"
2629 # Darwin ld doesn't like 0 for these options...
2630 minor_current=`expr $current + 1`
2631 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2636 versuffix=".$current.$revision";
2641 versuffix=".$current";
2645 major=`expr $current - $age + 1`
2646 verstring="sgi$major.$revision"
2648 # Add in all the interfaces that we are compatible with.
2650 while test $loop != 0; do
2651 iface=`expr $revision - $loop`
2652 loop=`expr $loop - 1`
2653 verstring="sgi$major.$iface:$verstring"
2656 # Before this point, $major must not contain `.'.
2658 versuffix="$major.$revision"
2662 major=.`expr $current - $age`
2663 versuffix="$major.$age.$revision"
2667 major=`expr $current - $age`
2668 versuffix=".$current.$age.$revision"
2669 verstring="$current.$age.$revision"
2671 # Add in all the interfaces that we are compatible with.
2673 while test $loop != 0; do
2674 iface=`expr $current - $loop`
2675 loop=`expr $loop - 1`
2676 verstring="$verstring:${iface}.0"
2679 # Make executables depend on our current version.
2680 verstring="$verstring:${current}.0"
2685 versuffix=".$current.$revision"
2689 # Use '-' rather than '.', since we only want one
2690 # extension on DOS 8.3 filesystems.
2691 major=`expr $current - $age`
2696 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2697 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2702 # Clear the version info if we defaulted, and they specified a release.
2703 if test -z "$vinfo" && test -n "$release"; then
2706 if test "$need_version" = no; then
2713 # Remove version info from name if versioning should be avoided
2714 if test "$avoid_version" = yes && test "$need_version" = no; then
2720 # Check to see if the archive will have undefined symbols.
2721 if test "$allow_undefined" = yes; then
2722 if test "$allow_undefined_flag" = unsupported; then
2723 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2724 build_libtool_libs=no
2728 # Don't allow undefined symbols.
2729 allow_undefined_flag="$no_undefined_flag"
2733 if test "$mode" != relink; then
2734 # Remove our outputs, but don't remove object files since they
2735 # may have been created when compiling PIC objects.
2737 tempremovelist=`echo "$output_objdir/*"`
2738 for p in $tempremovelist; do
2742 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2743 removelist="$removelist $p"
2748 if test -n "$removelist"; then
2749 $show "${rm}r $removelist"
2750 $run ${rm}r $removelist
2754 # Now set the variables for building old libraries.
2755 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2756 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2758 # Transform .lo files to .o files.
2759 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2762 # Eliminate all temporary directories.
2763 for path in $notinst_path; do
2764 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2765 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2766 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2769 if test -n "$xrpath"; then
2770 # If the user specified any rpath flags, then add them.
2772 for libdir in $xrpath; do
2773 temp_xrpath="$temp_xrpath -R$libdir"
2774 case "$finalize_rpath " in
2776 *) finalize_rpath="$finalize_rpath $libdir" ;;
2779 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2780 dependency_libs="$temp_xrpath $dependency_libs"
2784 # Make sure dlfiles contains only unique files that won't be dlpreopened
2785 old_dlfiles="$dlfiles"
2787 for lib in $old_dlfiles; do
2788 case " $dlprefiles $dlfiles " in
2790 *) dlfiles="$dlfiles $lib" ;;
2794 # Make sure dlprefiles contains only unique files
2795 old_dlprefiles="$dlprefiles"
2797 for lib in $old_dlprefiles; do
2798 case "$dlprefiles " in
2800 *) dlprefiles="$dlprefiles $lib" ;;
2804 if test "$build_libtool_libs" = yes; then
2805 if test -n "$rpath"; then
2807 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2808 # these systems don't actually have a c library (as such)!
2810 *-*-rhapsody* | *-*-darwin1.[012])
2811 # Rhapsody C library is in the System framework
2812 deplibs="$deplibs -framework System"
2815 # Don't link with libc until the a.out ld.so is fixed.
2818 # OpenBSD uses either libc or libc_r.
2821 # Add libc to deplibs on all other systems if necessary.
2822 if test $build_libtool_need_lc = "yes"; then
2823 deplibs="$deplibs -lc"
2829 # Transform deplibs into only deplibs that can be linked in shared.
2831 libname_save=$libname
2832 release_save=$release
2833 versuffix_save=$versuffix
2835 # I'm not sure if I'm treating the release correctly. I think
2836 # release should show up in the -l (ie -lgmp5) so we don't want to
2837 # add it in twice. Is that correct?
2843 case $deplibs_check_method in
2845 # Don't check for shared/static. Everything works.
2846 # This might be a little naive. We might want to check
2847 # whether the library exists or not. But this is on
2848 # osf3 & osf4 and I'm not really sure... Just
2849 # implementing what was already the behaviour.
2853 # This code stresses the "libraries are programs" paradigm to its
2854 # limits. Maybe even breaks it. We compile a program, linking it
2855 # against the deplibs as a proxy for the library. Then we can check
2856 # whether they linked in statically or dynamically with ldd.
2858 cat > conftest.c <<EOF
2859 int main() { return 0; }
2862 $LTCC -o conftest conftest.c $deplibs
2863 if test $? -eq 0 ; then
2864 ldd_output=`ldd conftest`
2865 for i in $deplibs; do
2866 name="`expr $i : '-l\(.*\)'`"
2867 # If $name is empty we are operating on a -L argument.
2868 if test "$name" != "" -a "$name" != "0"; then
2869 libname=`eval \\$echo \"$libname_spec\"`
2870 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2871 set dummy $deplib_matches
2873 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2874 newdeplibs="$newdeplibs $i"
2878 echo "*** Warning: This library needs some functionality provided by $i."
2879 echo "*** I have the capability to make that library automatically link in when"
2880 echo "*** you link to this library. But I can only do this if you have a"
2881 echo "*** shared version of the library, which you do not appear to have."
2884 newdeplibs="$newdeplibs $i"
2888 # Error occured in the first compile. Let's try to salvage the situation:
2889 # Compile a seperate program for each library.
2890 for i in $deplibs; do
2891 name="`expr $i : '-l\(.*\)'`"
2892 # If $name is empty we are operating on a -L argument.
2893 if test "$name" != "" -a "$name" != "0"; then
2895 $LTCC -o conftest conftest.c $i
2897 if test $? -eq 0 ; then
2898 ldd_output=`ldd conftest`
2899 libname=`eval \\$echo \"$libname_spec\"`
2900 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2901 set dummy $deplib_matches
2903 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2904 newdeplibs="$newdeplibs $i"
2908 echo "*** Warning: This library needs some functionality provided by $i."
2909 echo "*** I have the capability to make that library automatically link in when"
2910 echo "*** you link to this library. But I can only do this if you have a"
2911 echo "*** shared version of the library, which you do not appear to have."
2916 echo "*** Warning! Library $i is needed by this library but I was not able to"
2917 echo "*** make it link in! You will probably need to install it or some"
2918 echo "*** library that it depends on before this library will be fully"
2919 echo "*** functional. Installing it before continuing would be even better."
2922 newdeplibs="$newdeplibs $i"
2928 set dummy $deplibs_check_method
2929 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2930 for a_deplib in $deplibs; do
2931 name="`expr $a_deplib : '-l\(.*\)'`"
2932 # If $name is empty we are operating on a -L argument.
2933 if test "$name" != "" -a "$name" != "0"; then
2934 libname=`eval \\$echo \"$libname_spec\"`
2935 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2936 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2937 for potent_lib in $potential_libs; do
2938 # Follow soft links.
2939 if ls -lLd "$potent_lib" 2>/dev/null \
2940 | grep " -> " >/dev/null; then
2943 # The statement above tries to avoid entering an
2944 # endless loop below, in case of cyclic links.
2945 # We might still enter an endless loop, since a link
2946 # loop can be closed while we follow links,
2948 potlib="$potent_lib"
2949 while test -h "$potlib" 2>/dev/null; do
2950 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2952 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2953 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2956 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2958 | egrep "$file_magic_regex" > /dev/null; then
2959 newdeplibs="$newdeplibs $a_deplib"
2965 if test -n "$a_deplib" ; then
2968 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2969 echo "*** I have the capability to make that library automatically link in when"
2970 echo "*** you link to this library. But I can only do this if you have a"
2971 echo "*** shared version of the library, which you do not appear to have."
2974 # Add a -L argument.
2975 newdeplibs="$newdeplibs $a_deplib"
2977 done # Gone through all deplibs.
2980 set dummy $deplibs_check_method
2981 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2982 for a_deplib in $deplibs; do
2983 name="`expr $a_deplib : '-l\(.*\)'`"
2984 # If $name is empty we are operating on a -L argument.
2985 if test -n "$name" && test "$name" != "0"; then
2986 libname=`eval \\$echo \"$libname_spec\"`
2987 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2988 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2989 for potent_lib in $potential_libs; do
2990 if eval echo \"$potent_lib\" 2>/dev/null \
2992 | egrep "$match_pattern_regex" > /dev/null; then
2993 newdeplibs="$newdeplibs $a_deplib"
2999 if test -n "$a_deplib" ; then
3002 echo "*** Warning: This library needs some functionality provided by $a_deplib."
3003 echo "*** I have the capability to make that library automatically link in when"
3004 echo "*** you link to this library. But I can only do this if you have a"
3005 echo "*** shared version of the library, which you do not appear to have."
3008 # Add a -L argument.
3009 newdeplibs="$newdeplibs $a_deplib"
3011 done # Gone through all deplibs.
3015 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3016 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3017 grep . >/dev/null; then
3019 if test "X$deplibs_check_method" = "Xnone"; then
3020 echo "*** Warning: inter-library dependencies are not supported in this platform."
3022 echo "*** Warning: inter-library dependencies are not known to be supported."
3024 echo "*** All declared inter-library dependencies are being dropped."
3029 versuffix=$versuffix_save
3031 release=$release_save
3032 libname=$libname_save
3036 *-*-rhapsody* | *-*-darwin1.[012])
3037 # On Rhapsody replace the C library is the System framework
3038 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3042 if test "$droppeddeps" = yes; then
3043 if test "$module" = yes; then
3045 echo "*** Warning: libtool could not satisfy all declared inter-library"
3046 echo "*** dependencies of module $libname. Therefore, libtool will create"
3047 echo "*** a static module, that should work as long as the dlopening"
3048 echo "*** application is linked with the -dlopen flag."
3049 if test -z "$global_symbol_pipe"; then
3051 echo "*** However, this would only work if libtool was able to extract symbol"
3052 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3053 echo "*** not find such a program. So, this module is probably useless."
3054 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3056 if test "$build_old_libs" = no; then
3057 oldlibs="$output_objdir/$libname.$libext"
3058 build_libtool_libs=module
3061 build_libtool_libs=no
3064 echo "*** The inter-library dependencies that have been dropped here will be"
3065 echo "*** automatically added whenever a program is linked with this library"
3066 echo "*** or is declared to -dlopen it."
3068 if test $allow_undefined = no; then
3070 echo "*** Since this library must not contain undefined symbols,"
3071 echo "*** because either the platform does not support them or"
3072 echo "*** it was explicitly requested with -no-undefined,"
3073 echo "*** libtool will only create a static version of it."
3074 if test "$build_old_libs" = no; then
3075 oldlibs="$output_objdir/$libname.$libext"
3076 build_libtool_libs=module
3079 build_libtool_libs=no
3084 # Done checking deplibs!
3088 # All the library-specific variables (install_libdir is set above).
3093 # Test again, we may have decided not to build it any more
3094 if test "$build_libtool_libs" = yes; then
3095 if test $hardcode_into_libs = yes; then
3096 # Hardcode the library paths
3099 rpath="$finalize_rpath"
3100 test "$mode" != relink && rpath="$compile_rpath$rpath"
3101 for libdir in $rpath; do
3102 if test -n "$hardcode_libdir_flag_spec"; then
3103 if test -n "$hardcode_libdir_separator"; then
3104 if test -z "$hardcode_libdirs"; then
3105 hardcode_libdirs="$libdir"
3107 # Just accumulate the unique libdirs.
3108 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3109 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3112 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3117 eval flag=\"$hardcode_libdir_flag_spec\"
3118 dep_rpath="$dep_rpath $flag"
3120 elif test -n "$runpath_var"; then
3121 case "$perm_rpath " in
3123 *) perm_rpath="$perm_rpath $libdir" ;;
3127 # Substitute the hardcoded libdirs into the rpath.
3128 if test -n "$hardcode_libdir_separator" &&
3129 test -n "$hardcode_libdirs"; then
3130 libdir="$hardcode_libdirs"
3131 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3133 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3134 # We should set the runpath_var.
3136 for dir in $perm_rpath; do
3139 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3141 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3144 shlibpath="$finalize_shlibpath"
3145 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3146 if test -n "$shlibpath"; then
3147 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3150 # Get the real and link names of the library.
3151 eval library_names=\"$library_names_spec\"
3152 set dummy $library_names
3156 if test -n "$soname_spec"; then
3157 eval soname=\"$soname_spec\"
3161 if test x$dlname = x; then
3165 lib="$output_objdir/$realname"
3168 linknames="$linknames $link"
3171 # Use standard objects if they are pic
3172 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3174 # Prepare the list of exported symbols
3175 if test -z "$export_symbols"; then
3176 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3177 $show "generating symbol list for \`$libname.la'"
3178 export_symbols="$output_objdir/$libname.exp"
3179 $run $rm $export_symbols
3180 eval cmds=\"$export_symbols_cmds\"
3181 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3182 for cmd in $cmds; do
3185 $run eval "$cmd" || exit $?
3188 if test -n "$export_symbols_regex"; then
3189 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3190 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3191 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3192 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3197 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3198 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3201 if test -n "$convenience"; then
3202 if test -n "$whole_archive_flag_spec"; then
3203 save_libobjs=$libobjs
3204 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3206 gentop="$output_objdir/${outputname}x"
3207 $show "${rm}r $gentop"
3208 $run ${rm}r "$gentop"
3209 $show "$mkdir $gentop"
3210 $run $mkdir "$gentop"
3212 if test $status -ne 0 && test ! -d "$gentop"; then
3215 generated="$generated $gentop"
3217 for xlib in $convenience; do
3218 # Extract the objects.
3220 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3221 *) xabs=`pwd`"/$xlib" ;;
3223 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3224 xdir="$gentop/$xlib"
3226 $show "${rm}r $xdir"
3228 $show "$mkdir $xdir"
3231 if test $status -ne 0 && test ! -d "$xdir"; then
3234 $show "(cd $xdir && $AR x $xabs)"
3235 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3237 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3242 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3243 eval flag=\"$thread_safe_flag_spec\"
3244 linker_flags="$linker_flags $flag"
3247 # Make a backup of the uninstalled library when relinking
3248 if test "$mode" = relink; then
3249 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3252 # Do each of the archive commands.
3253 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3254 eval cmds=\"$archive_expsym_cmds\"
3256 eval cmds=\"$archive_cmds\"
3259 if len=`expr "X$cmds" : ".*"` &&
3260 test $len -le $max_cmd_len || test $max_cmd_len -le -1; then
3263 # The command line is too long to link in one step, link piecewise.
3264 $echo "creating reloadable object files..."
3266 # Save the value of $output and $libobjs because we want to
3267 # use them later. If we have whole_archive_flag_spec, we
3268 # want to use save_libobjs as it was before
3269 # whole_archive_flag_spec was expanded, because we can't
3270 # assume the linker understands whole_archive_flag_spec.
3271 # This may have to be revisited, in case too many
3272 # convenience libraries get linked in and end up exceeding
3274 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3275 save_libobjs=$libobjs
3279 # Clear the reloadable object creation command queue and
3280 # initialize k to one.
3287 output=$output_objdir/$save_output-${k}.$objext
3288 # Loop over the list of objects to be linked.
3289 for obj in $save_libobjs
3291 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3292 if test "X$objlist" = X ||
3293 { len=`expr "X$test_cmds" : ".*"` &&
3294 test $len -le $max_cmd_len; }; then
3295 objlist="$objlist $obj"
3297 # The command $test_cmds is almost too long, add a
3298 # command to the queue.
3299 if test $k -eq 1 ; then
3300 # The first file doesn't have a previous command to add.
3301 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3303 # All subsequent reloadable object files will link in
3304 # the last one created.
3305 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3307 last_robj=$output_objdir/$save_output-${k}.$objext
3309 output=$output_objdir/$save_output-${k}.$objext
3314 # Handle the remaining objects by creating one last
3315 # reloadable object file. All subsequent reloadable object
3316 # files will link in the last one created.
3317 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3318 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3320 # Set up a command to remove the reloadale object files
3321 # after they are used.
3323 while test $i -lt $k
3326 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3329 $echo "creating a temporary reloadable object file: $output"
3331 # Loop through the commands generated above and execute them.
3332 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3333 for cmd in $concat_cmds; do
3336 $run eval "$cmd" || exit $?
3341 # Restore the value of output.
3344 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3345 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3347 # Expand the library linking commands again to reset the
3348 # value of $libobjs for piecewise linking.
3350 # Do each of the archive commands.
3351 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3352 eval cmds=\"$archive_expsym_cmds\"
3354 eval cmds=\"$archive_cmds\"
3357 # Append the command to remove the reloadable object files
3358 # to the just-reset $cmds.
3359 eval cmds=\"\$cmds~$rm $delfiles\"
3361 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3362 for cmd in $cmds; do
3365 $run eval "$cmd" || exit $?
3369 # Restore the uninstalled library and exit
3370 if test "$mode" = relink; then
3371 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3375 # Create links to the real library.
3376 for linkname in $linknames; do
3377 if test "$realname" != "$linkname"; then
3378 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3379 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3383 # If -module or -export-dynamic was specified, set the dlname.
3384 if test "$module" = yes || test "$export_dynamic" = yes; then
3385 # On all known operating systems, these are identical.
3392 if test -n "$deplibs"; then
3393 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3396 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3397 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3400 if test -n "$rpath"; then
3401 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3404 if test -n "$xrpath"; then
3405 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3408 if test -n "$vinfo"; then
3409 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3412 if test -n "$release"; then
3413 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3418 if test -n "$objs$old_deplibs"; then
3419 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3423 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3431 # Delete the old objects.
3432 $run $rm $obj $libobj
3434 # Objects from convenience libraries. This assumes
3435 # single-version convenience libraries. Whenever we create
3436 # different ones for PIC/non-PIC, this we'll have to duplicate
3440 # reload_cmds runs $LD directly, so let us get rid of
3441 # -Wl from whole_archive_flag_spec
3444 if test -n "$convenience"; then
3445 if test -n "$whole_archive_flag_spec"; then
3446 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3448 gentop="$output_objdir/${obj}x"
3449 $show "${rm}r $gentop"
3450 $run ${rm}r "$gentop"
3451 $show "$mkdir $gentop"
3452 $run $mkdir "$gentop"
3454 if test $status -ne 0 && test ! -d "$gentop"; then
3457 generated="$generated $gentop"
3459 for xlib in $convenience; do
3460 # Extract the objects.
3462 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3463 *) xabs=`pwd`"/$xlib" ;;
3465 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3466 xdir="$gentop/$xlib"
3468 $show "${rm}r $xdir"
3470 $show "$mkdir $xdir"
3473 if test $status -ne 0 && test ! -d "$xdir"; then
3476 $show "(cd $xdir && $AR x $xabs)"
3477 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3479 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3484 # Create the old-style object.
3485 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
3488 eval cmds=\"$reload_cmds\"
3489 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3490 for cmd in $cmds; do
3493 $run eval "$cmd" || exit $?
3497 # Exit if we aren't doing a library object file.
3498 if test -z "$libobj"; then
3499 if test -n "$gentop"; then
3500 $show "${rm}r $gentop"
3507 if test "$build_libtool_libs" != yes; then
3508 if test -n "$gentop"; then
3509 $show "${rm}r $gentop"
3513 # Create an invalid libtool object if no PIC, so that we don't
3514 # accidentally link it into a program.
3515 # $show "echo timestamp > $libobj"
3516 # $run eval "echo timestamp > $libobj" || exit $?
3520 if test -n "$pic_flag" || test "$pic_mode" != default; then
3521 # Only do commands if we really have different PIC objects.
3522 reload_objs="$libobjs $reload_conv_objs"
3524 eval cmds=\"$reload_cmds\"
3525 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3526 for cmd in $cmds; do
3529 $run eval "$cmd" || exit $?
3534 if test -n "$gentop"; then
3535 $show "${rm}r $gentop"
3544 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3546 if test -n "$vinfo"; then
3547 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3550 if test -n "$release"; then
3551 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3554 if test "$preload" = yes; then
3555 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3556 test "$dlopen_self_static" = unknown; then
3557 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3562 *-*-rhapsody* | *-*-darwin1.[012])
3563 # On Rhapsody replace the C library is the System framework
3564 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3565 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3569 compile_command="$compile_command $compile_deplibs"
3570 finalize_command="$finalize_command $finalize_deplibs"
3572 if test -n "$rpath$xrpath"; then
3573 # If the user specified any rpath flags, then add them.
3574 for libdir in $rpath $xrpath; do
3575 # This is the magic to use -rpath.
3576 case "$finalize_rpath " in
3578 *) finalize_rpath="$finalize_rpath $libdir" ;;
3583 # Now hardcode the library paths
3586 for libdir in $compile_rpath $finalize_rpath; do
3587 if test -n "$hardcode_libdir_flag_spec"; then
3588 if test -n "$hardcode_libdir_separator"; then
3589 if test -z "$hardcode_libdirs"; then
3590 hardcode_libdirs="$libdir"
3592 # Just accumulate the unique libdirs.
3593 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3594 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3597 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3602 eval flag=\"$hardcode_libdir_flag_spec\"
3603 rpath="$rpath $flag"
3605 elif test -n "$runpath_var"; then
3606 case "$perm_rpath " in
3608 *) perm_rpath="$perm_rpath $libdir" ;;
3612 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3613 case :$dllsearchpath: in
3615 *) dllsearchpath="$dllsearchpath:$libdir";;
3620 # Substitute the hardcoded libdirs into the rpath.
3621 if test -n "$hardcode_libdir_separator" &&
3622 test -n "$hardcode_libdirs"; then
3623 libdir="$hardcode_libdirs"
3624 eval rpath=\" $hardcode_libdir_flag_spec\"
3626 compile_rpath="$rpath"
3630 for libdir in $finalize_rpath; do
3631 if test -n "$hardcode_libdir_flag_spec"; then
3632 if test -n "$hardcode_libdir_separator"; then
3633 if test -z "$hardcode_libdirs"; then
3634 hardcode_libdirs="$libdir"
3636 # Just accumulate the unique libdirs.
3637 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3638 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3641 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3646 eval flag=\"$hardcode_libdir_flag_spec\"
3647 rpath="$rpath $flag"
3649 elif test -n "$runpath_var"; then
3650 case "$finalize_perm_rpath " in
3652 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3656 # Substitute the hardcoded libdirs into the rpath.
3657 if test -n "$hardcode_libdir_separator" &&
3658 test -n "$hardcode_libdirs"; then
3659 libdir="$hardcode_libdirs"
3660 eval rpath=\" $hardcode_libdir_flag_spec\"
3662 finalize_rpath="$rpath"
3664 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3665 # Transform all the library objects into standard objects.
3666 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3667 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3671 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3672 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3673 dlsyms="${outputname}S.c"
3675 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3679 if test -n "$dlsyms"; then
3683 # Discover the nlist of each of the dlfiles.
3684 nlist="$output_objdir/${outputname}.nm"
3686 $show "$rm $nlist ${nlist}S ${nlist}T"
3687 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3689 # Parse the name list into a source file.
3690 $show "creating $output_objdir/$dlsyms"
3692 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3693 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3694 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3700 /* Prevent the only kind of declaration conflicts we can make. */
3701 #define lt_preloaded_symbols some_other_symbol
3703 /* External symbol declarations for the compiler. */\
3706 if test "$dlself" = yes; then
3707 $show "generating symbol list for \`$output'"
3709 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3711 # Add our own program objects to the symbol list.
3712 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3713 for arg in $progfiles; do
3714 $show "extracting global C symbols from \`$arg'"
3715 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3718 if test -n "$exclude_expsyms"; then
3719 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3720 $run eval '$mv "$nlist"T "$nlist"'
3723 if test -n "$export_symbols_regex"; then
3724 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3725 $run eval '$mv "$nlist"T "$nlist"'
3728 # Prepare the list of exported symbols
3729 if test -z "$export_symbols"; then
3730 export_symbols="$output_objdir/$output.exp"
3731 $run $rm $export_symbols
3732 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3734 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3735 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3736 $run eval 'mv "$nlist"T "$nlist"'
3740 for arg in $dlprefiles; do
3741 $show "extracting global C symbols from \`$arg'"
3742 name=`echo "$arg" | sed -e 's%^.*/%%'`
3743 $run eval 'echo ": $name " >> "$nlist"'
3744 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3747 if test -z "$run"; then
3748 # Make sure we have at least an empty file.
3749 test -f "$nlist" || : > "$nlist"
3751 if test -n "$exclude_expsyms"; then
3752 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3753 $mv "$nlist"T "$nlist"
3756 # Try sorting and uniquifying the output.
3757 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3760 grep -v "^: " < "$nlist" > "$nlist"S
3763 if test -f "$nlist"S; then
3764 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3766 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3769 $echo >> "$output_objdir/$dlsyms" "\
3771 #undef lt_preloaded_symbols
3773 #if defined (__STDC__) && __STDC__
3774 # define lt_ptr void *
3776 # define lt_ptr char *
3780 /* The mapping between symbol names and symbols. */
3785 lt_preloaded_symbols[] =
3789 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3791 $echo >> "$output_objdir/$dlsyms" "\
3795 /* This works around a problem in FreeBSD linker */
3796 #ifdef FREEBSD_WORKAROUND
3797 static const void *lt_preloaded_setup() {
3798 return lt_preloaded_symbols;
3808 pic_flag_for_symtable=
3810 # compiling the symbol table file with pic_flag works around
3811 # a FreeBSD bug that causes programs to crash when -lm is
3812 # linked before any other PIC object. But we must not use
3813 # pic_flag when linking with -static. The problem exists in
3814 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3815 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3816 case "$compile_command " in
3818 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3821 case "$compile_command " in
3823 *) pic_flag_for_symtable=" $pic_flag";;
3827 # Now compile the dynamic symbol file.
3828 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3829 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3831 # Clean up the generated files.
3832 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3833 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3835 # Transform the symbol file into the correct name.
3836 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3837 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3840 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3845 # We keep going just in case the user didn't refer to
3846 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3847 # really was required.
3849 # Nullify the symbol file.
3850 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3851 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3854 if test $need_relink = no || test "$build_libtool_libs" != yes; then
3855 # Replace the output file specification.
3856 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3857 link_command="$compile_command$compile_rpath"
3859 # We have no uninstalled library dependencies, so finalize right now.
3860 $show "$link_command"
3861 $run eval "$link_command"
3864 # Delete the generated files.
3865 if test -n "$dlsyms"; then
3866 $show "$rm $output_objdir/${outputname}S.${objext}"
3867 $run $rm "$output_objdir/${outputname}S.${objext}"
3873 if test -n "$shlibpath_var"; then
3874 # We should set the shlibpath_var
3876 for dir in $temp_rpath; do
3878 [\\/]* | [A-Za-z]:[\\/]*)
3883 # Relative path: add a thisdir entry.
3884 rpath="$rpath\$thisdir/$dir:"
3891 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3892 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3894 if test -n "$finalize_shlibpath"; then
3895 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3900 if test -n "$runpath_var"; then
3901 if test -n "$perm_rpath"; then
3902 # We should set the runpath_var.
3904 for dir in $perm_rpath; do
3907 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3909 if test -n "$finalize_perm_rpath"; then
3910 # We should set the runpath_var.
3912 for dir in $finalize_perm_rpath; do
3915 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3919 if test "$no_install" = yes; then
3920 # We don't need to create a wrapper script.
3921 link_command="$compile_var$compile_command$compile_rpath"
3922 # Replace the output file specification.
3923 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3924 # Delete the old output file.
3926 # Link the executable and exit
3927 $show "$link_command"
3928 $run eval "$link_command" || exit $?
3932 if test "$hardcode_action" = relink; then
3933 # Fast installation is not supported
3934 link_command="$compile_var$compile_command$compile_rpath"
3935 relink_command="$finalize_var$finalize_command$finalize_rpath"
3937 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3938 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3940 if test "$fast_install" != no; then
3941 link_command="$finalize_var$compile_command$finalize_rpath"
3942 if test "$fast_install" = yes; then
3943 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3945 # fast_install is set to needless
3949 link_command="$compile_var$compile_command$compile_rpath"
3950 relink_command="$finalize_var$finalize_command$finalize_rpath"
3954 # Replace the output file specification.
3955 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3957 # Delete the old output files.
3958 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3960 $show "$link_command"
3961 $run eval "$link_command" || exit $?
3963 # Now create the wrapper script.
3964 $show "creating $output"
3966 # Quote the relink command for shipping.
3967 if test -n "$relink_command"; then
3968 # Preserve any variables that may affect compiler behavior
3969 for var in $variables_saved_for_relink; do
3970 if eval test -z \"\${$var+set}\"; then
3971 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3972 elif eval var_value=\$$var; test -z "$var_value"; then
3973 relink_command="$var=; export $var; $relink_command"
3975 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3976 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3979 relink_command="cd `pwd`; $relink_command"
3980 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3983 # Quote $echo for shipping.
3984 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3986 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3987 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3989 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3991 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3994 # Only actually do things if our run command is non-null.
3995 if test -z "$run"; then
3996 # win32 will think the script is a binary if it has
3997 # a .exe suffix, so we strip it off here.
3999 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4001 # test for cygwin because mv fails w/o .exe extensions
4003 *cygwin*) exeext=.exe ;;
4007 trap "$rm $output; exit 1" 1 2 15
4012 # $output - temporary wrapper script for $objdir/$outputname
4013 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4015 # The $output program cannot be directly executed until all the libtool
4016 # libraries that it depends on are installed.
4018 # This wrapper script should never be moved out of the build directory.
4019 # If it is, it will not operate correctly.
4021 # Sed substitution that helps us do robust quoting. It backslashifies
4022 # metacharacters that are still active within double-quoted strings.
4023 Xsed='sed -e 1s/^X//'
4024 sed_quote_subst='$sed_quote_subst'
4026 # The HP-UX ksh and POSIX shell print the target directory to stdout
4028 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4030 relink_command=\"$relink_command\"
4032 # This environment variable determines our operation mode.
4033 if test \"\$libtool_install_magic\" = \"$magic\"; then
4034 # install mode needs the following variable:
4035 notinst_deplibs='$notinst_deplibs'
4037 # When we are sourced in execute mode, \$file and \$echo are already set.
4038 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4041 # Make sure echo works.
4042 if test \"X\$1\" = X--no-reexec; then
4043 # Discard the --no-reexec flag, and continue.
4045 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4046 # Yippee, \$echo works!
4049 # Restart under the correct shell, and then maybe \$echo will work.
4050 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4056 # Find the directory that this script lives in.
4057 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4058 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4060 # Follow symbolic links until we get to the real thisdir.
4061 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4062 while test -n \"\$file\"; do
4063 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4065 # If there was a directory component, then change thisdir.
4066 if test \"x\$destdir\" != \"x\$file\"; then
4067 case \"\$destdir\" in
4068 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4069 *) thisdir=\"\$thisdir/\$destdir\" ;;
4073 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4074 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4077 # Try to get the absolute directory name.
4078 absdir=\`cd \"\$thisdir\" && pwd\`
4079 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4082 if test "$fast_install" = yes; then
4084 program=lt-'$outputname'$exeext
4085 progdir=\"\$thisdir/$objdir\"
4087 if test ! -f \"\$progdir/\$program\" || \\
4088 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4089 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4091 file=\"\$\$-\$program\"
4093 if test ! -d \"\$progdir\"; then
4094 $mkdir \"\$progdir\"
4096 $rm \"\$progdir/\$file\"
4101 # relink executable if necessary
4102 if test -n \"\$relink_command\"; then
4103 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4105 $echo \"\$relink_command_output\" >&2
4106 $rm \"\$progdir/\$file\"
4111 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4112 { $rm \"\$progdir/\$program\";
4113 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4114 $rm \"\$progdir/\$file\"
4118 program='$outputname'
4119 progdir=\"\$thisdir/$objdir\"
4125 if test -f \"\$progdir/\$program\"; then"
4127 # Export our shlibpath_var if we have one.
4128 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4130 # Add our own library path to $shlibpath_var
4131 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4133 # Some systems cannot cope with colon-terminated $shlibpath_var
4134 # The second colon is a workaround for a bug in BeOS R4 sed
4135 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4137 export $shlibpath_var
4141 # fixup the dll searchpath if we need to.
4142 if test -n "$dllsearchpath"; then
4144 # Add the dll search path components to the executable PATH
4145 PATH=$dllsearchpath:\$PATH
4150 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4151 # Run the actual program with our arguments.
4154 # win32 systems need to use the prog path for dll
4156 *-*-cygwin* | *-*-pw32*)
4158 exec \$progdir/\$program \${1+\"\$@\"}
4162 # Backslashes separate directories on plain windows
4163 *-*-mingw | *-*-os2*)
4165 exec \$progdir\\\\\$program \${1+\"\$@\"}
4171 # Export the path to the program.
4172 PATH=\"\$progdir:\$PATH\"
4175 exec \$program \${1+\"\$@\"}
4180 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4184 # The program doesn't exist.
4185 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4186 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4187 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4198 # See if we need to build an old-fashioned archive.
4199 for oldlib in $oldlibs; do
4201 if test "$build_libtool_libs" = convenience; then
4202 oldobjs="$libobjs_save"
4203 addlibs="$convenience"
4204 build_libtool_libs=no
4206 if test "$build_libtool_libs" = module; then
4207 oldobjs="$libobjs_save"
4208 build_libtool_libs=no
4210 oldobjs="$objs$old_deplibs $non_pic_objects"
4212 addlibs="$old_convenience"
4215 if test -n "$addlibs"; then
4216 gentop="$output_objdir/${outputname}x"
4217 $show "${rm}r $gentop"
4218 $run ${rm}r "$gentop"
4219 $show "$mkdir $gentop"
4220 $run $mkdir "$gentop"
4222 if test $status -ne 0 && test ! -d "$gentop"; then
4225 generated="$generated $gentop"
4227 # Add in members from convenience archives.
4228 for xlib in $addlibs; do
4229 # Extract the objects.
4231 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4232 *) xabs=`pwd`"/$xlib" ;;
4234 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4235 xdir="$gentop/$xlib"
4237 $show "${rm}r $xdir"
4239 $show "$mkdir $xdir"
4242 if test $status -ne 0 && test ! -d "$xdir"; then
4245 $show "(cd $xdir && $AR x $xabs)"
4246 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4248 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4252 # Do each command in the archive commands.
4253 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4254 eval cmds=\"$old_archive_from_new_cmds\"
4256 eval cmds=\"$old_archive_cmds\"
4258 if len=`expr "X$cmds" : ".*"` &&
4259 test $len -le $max_cmd_len || test $max_cmd_len -le -1; then
4262 # the command line is too long to link in one step, link in parts
4263 $echo "using piecewise archive linking..."
4268 save_oldobjs=$oldobjs
4269 for obj in $save_oldobjs
4271 oldobjs="$objlist $obj"
4272 objlist="$objlist $obj"
4273 eval test_cmds=\"$old_archive_cmds\"
4274 if len=`expr "X$test_cmds" : ".*"` &&
4275 test $len -le $max_cmd_len; then
4278 # the above command should be used before it gets too long
4280 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4281 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4287 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4290 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4291 for cmd in $cmds; do
4294 $run eval "$cmd" || exit $?
4299 if test -n "$generated"; then
4300 $show "${rm}r$generated"
4301 $run ${rm}r$generated
4304 # Now create the libtool archive.
4308 test "$build_old_libs" = yes && old_library="$libname.$libext"
4309 $show "creating $output"
4311 # Preserve any variables that may affect compiler behavior
4312 for var in $variables_saved_for_relink; do
4313 if eval test -z \"\${$var+set}\"; then
4314 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4315 elif eval var_value=\$$var; test -z "$var_value"; then
4316 relink_command="$var=; export $var; $relink_command"
4318 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4319 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4322 # Quote the link command for shipping.
4323 relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
4324 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4326 # Only create the output if not a dry run.
4327 if test -z "$run"; then
4328 for installed in no yes; do
4329 if test "$installed" = yes; then
4330 if test -z "$install_libdir"; then
4333 output="$output_objdir/$outputname"i
4334 # Replace all uninstalled libtool libraries with the installed ones
4336 for deplib in $dependency_libs; do
4339 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4340 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4341 if test -z "$libdir"; then
4342 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4345 newdependency_libs="$newdependency_libs $libdir/$name"
4347 *) newdependency_libs="$newdependency_libs $deplib" ;;
4350 dependency_libs="$newdependency_libs"
4352 for lib in $dlfiles; do
4353 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4354 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4355 if test -z "$libdir"; then
4356 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4359 newdlfiles="$newdlfiles $libdir/$name"
4361 dlfiles="$newdlfiles"
4363 for lib in $dlprefiles; do
4364 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4365 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4366 if test -z "$libdir"; then
4367 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4370 newdlprefiles="$newdlprefiles $libdir/$name"
4372 dlprefiles="$newdlprefiles"
4375 # place dlname in correct position for cygwin
4377 case $host,$output,$installed,$module,$dlname in
4378 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4381 # $outputname - a libtool library file
4382 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4384 # Please DO NOT delete this file!
4385 # It is necessary for linking the library.
4387 # The name that we can dlopen(3).
4390 # Names of this library.
4391 library_names='$library_names'
4393 # The name of the static archive.
4394 old_library='$old_library'
4396 # Libraries that this one depends upon.
4397 dependency_libs='$dependency_libs'
4399 # Version information for $libname.
4404 # Is this an already installed library?
4405 installed=$installed
4407 # Files to dlopen/dlpreopen
4409 dlpreopen='$dlprefiles'
4411 # Directory that this library needs to be installed in:
4412 libdir='$install_libdir'"
4413 if test "$installed" = no && test $need_relink = yes; then
4415 relink_command=\"$relink_command\""
4420 # Do a symbolic link so that the libtool archive can be found in
4421 # LD_LIBRARY_PATH before the program is installed.
4422 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4423 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4429 # libtool install mode
4431 modename="$modename: install"
4433 # There may be an optional sh(1) argument at the beginning of
4434 # install_prog (especially on Windows NT).
4435 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4436 # Allow the use of GNU shtool's install command.
4437 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4438 # Aesthetically quote it.
4439 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4441 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4445 install_prog="$arg "
4453 # The real first argument should be the name of the installation program.
4454 # Aesthetically quote it.
4455 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4457 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4461 install_prog="$install_prog$arg"
4463 # We need to accept at least all the BSD install flags.
4473 if test -n "$dest"; then
4474 files="$files $dest"
4492 # If the previous option needed an argument, then skip it.
4493 if test -n "$prev"; then
4502 # Aesthetically quote the argument.
4503 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4505 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4509 install_prog="$install_prog $arg"
4512 if test -z "$install_prog"; then
4513 $echo "$modename: you must specify an install program" 1>&2
4518 if test -n "$prev"; then
4519 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4524 if test -z "$files"; then
4525 if test -z "$dest"; then
4526 $echo "$modename: no file or destination specified" 1>&2
4528 $echo "$modename: you must specify a destination" 1>&2
4534 # Strip any trailing slash from the destination.
4535 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4537 # Check to see that the destination is a directory.
4538 test -d "$dest" && isdir=yes
4539 if test "$isdir" = yes; then
4543 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4544 test "X$destdir" = "X$dest" && destdir=.
4545 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4547 # Not a directory, so check to see that there is only one file specified.
4549 if test $# -gt 2; then
4550 $echo "$modename: \`$dest' is not a directory" 1>&2
4556 [\\/]* | [A-Za-z]:[\\/]*) ;;
4558 for file in $files; do
4562 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4571 # This variable tells wrapper scripts just to set variables rather
4572 # than running their programs.
4573 libtool_install_magic="$magic"
4578 for file in $files; do
4580 # Do each installation.
4583 # Do the static libraries later.
4584 staticlibs="$staticlibs $file"
4588 # Check to see that this really is a libtool archive.
4589 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4591 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4599 # If there is no directory component, then add one.
4601 */* | *\\*) . $file ;;
4605 # Add the libdir to current_libdirs if it is the destination.
4606 if test "X$destdir" = "X$libdir"; then
4607 case "$current_libdirs " in
4609 *) current_libdirs="$current_libdirs $libdir" ;;
4612 # Note the libdir as a future libdir.
4613 case "$future_libdirs " in
4615 *) future_libdirs="$future_libdirs $libdir" ;;
4619 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4620 test "X$dir" = "X$file/" && dir=
4623 if test -n "$relink_command"; then
4624 $echo "$modename: warning: relinking \`$file'" 1>&2
4625 $show "$relink_command"
4626 if $run eval "$relink_command"; then :
4628 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4633 # See the names of the shared library.
4634 set dummy $library_names
4635 if test -n "$2"; then
4641 test -n "$relink_command" && srcname="$realname"T
4643 # Install the shared library and build the symlinks.
4644 $show "$install_prog $dir/$srcname $destdir/$realname"
4645 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4646 if test -n "$stripme" && test -n "$striplib"; then
4647 $show "$striplib $destdir/$realname"
4648 $run eval "$striplib $destdir/$realname" || exit $?
4651 if test $# -gt 0; then
4652 # Delete the old symlinks, and create new ones.
4655 if test "$linkname" != "$realname"; then
4656 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4657 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4662 # Do each command in the postinstall commands.
4663 lib="$destdir/$realname"
4664 eval cmds=\"$postinstall_cmds\"
4665 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4666 for cmd in $cmds; do
4669 $run eval "$cmd" || exit $?
4674 # Install the pseudo-library for information purposes.
4675 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4676 instname="$dir/$name"i
4677 $show "$install_prog $instname $destdir/$name"
4678 $run eval "$install_prog $instname $destdir/$name" || exit $?
4680 # Maybe install the static library, too.
4681 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4685 # Install (i.e. copy) a libtool object.
4687 # Figure out destination file name, if it wasn't already specified.
4688 if test -n "$destname"; then
4689 destfile="$destdir/$destname"
4691 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4692 destfile="$destdir/$destfile"
4695 # Deduce the name of the destination old-style object file.
4698 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4701 staticdest="$destfile"
4705 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4711 # Install the libtool object if requested.
4712 if test -n "$destfile"; then
4713 $show "$install_prog $file $destfile"
4714 $run eval "$install_prog $file $destfile" || exit $?
4717 # Install the old object if enabled.
4718 if test "$build_old_libs" = yes; then
4719 # Deduce the name of the old-style object file.
4720 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4722 $show "$install_prog $staticobj $staticdest"
4723 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4729 # Figure out destination file name, if it wasn't already specified.
4730 if test -n "$destname"; then
4731 destfile="$destdir/$destname"
4733 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4734 destfile="$destdir/$destfile"
4737 # Do a test to see if this is really a libtool program.
4738 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4742 # If there is no directory component, then add one.
4744 */* | *\\*) . $file ;;
4748 # Check the variables that should have been set.
4749 if test -z "$notinst_deplibs"; then
4750 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4755 for lib in $notinst_deplibs; do
4756 # Check to see that each library is installed.
4758 if test -f "$lib"; then
4759 # If there is no directory component, then add one.
4761 */* | *\\*) . $lib ;;
4765 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4766 if test -n "$libdir" && test ! -f "$libfile"; then
4767 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4773 # If there is no directory component, then add one.
4775 */* | *\\*) . $file ;;
4780 if test "$fast_install" = no && test -n "$relink_command"; then
4781 if test "$finalize" = yes && test -z "$run"; then
4783 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4784 tmpdir="$tmpdir/libtool-$$"
4785 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4787 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4790 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4791 outputname="$tmpdir/$file"
4792 # Replace the output file specification.
4793 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4795 $show "$relink_command"
4796 if $run eval "$relink_command"; then :
4798 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4804 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4807 # Install the binary that we compiled earlier.
4808 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4812 # remove .exe since cygwin /usr/bin/install will append another
4814 case $install_prog,$host in
4815 */usr/bin/install*,*cygwin*)
4816 case $file:$destfile in
4821 destfile=$destfile.exe
4824 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4829 $show "$install_prog$stripme $file $destfile"
4830 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4831 test -n "$outputname" && ${rm}r "$tmpdir"
4836 for file in $staticlibs; do
4837 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4839 # Set up the ranlib parameters.
4840 oldlib="$destdir/$name"
4842 $show "$install_prog $file $oldlib"
4843 $run eval "$install_prog \$file \$oldlib" || exit $?
4845 if test -n "$stripme" && test -n "$striplib"; then
4846 $show "$old_striplib $oldlib"
4847 $run eval "$old_striplib $oldlib" || exit $?
4850 # Do each command in the postinstall commands.
4851 eval cmds=\"$old_postinstall_cmds\"
4852 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4853 for cmd in $cmds; do
4856 $run eval "$cmd" || exit $?
4861 if test -n "$future_libdirs"; then
4862 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4865 if test -n "$current_libdirs"; then
4866 # Maybe just do a dry run.
4867 test -n "$run" && current_libdirs=" -n$current_libdirs"
4868 exec_cmd='$SHELL $0 --finish$current_libdirs'
4874 # libtool finish mode
4876 modename="$modename: finish"
4880 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4883 libdirs="$libdirs $dir"
4886 for libdir in $libdirs; do
4887 if test -n "$finish_cmds"; then
4888 # Do each command in the finish commands.
4889 eval cmds=\"$finish_cmds\"
4890 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4891 for cmd in $cmds; do
4894 $run eval "$cmd" || admincmds="$admincmds
4899 if test -n "$finish_eval"; then
4900 # Do the single finish_eval.
4901 eval cmds=\"$finish_eval\"
4902 $run eval "$cmds" || admincmds="$admincmds
4908 # Exit here if they wanted silent mode.
4909 test "$show" = : && exit 0
4911 echo "----------------------------------------------------------------------"
4912 echo "Libraries have been installed in:"
4913 for libdir in $libdirs; do
4917 echo "If you ever happen to want to link against installed libraries"
4918 echo "in a given directory, LIBDIR, you must either use libtool, and"
4919 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4920 echo "flag during linking and do at least one of the following:"
4921 if test -n "$shlibpath_var"; then
4922 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4923 echo " during execution"
4925 if test -n "$runpath_var"; then
4926 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4927 echo " during linking"
4929 if test -n "$hardcode_libdir_flag_spec"; then
4931 eval flag=\"$hardcode_libdir_flag_spec\"
4933 echo " - use the \`$flag' linker flag"
4935 if test -n "$admincmds"; then
4936 echo " - have your system administrator run these commands:$admincmds"
4938 if test -f /etc/ld.so.conf; then
4939 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4942 echo "See any operating system documentation about shared libraries for"
4943 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4944 echo "----------------------------------------------------------------------"
4948 # libtool execute mode
4950 modename="$modename: execute"
4952 # The first argument is the command name.
4954 if test -z "$cmd"; then
4955 $echo "$modename: you must specify a COMMAND" 1>&2
4960 # Handle -dlopen flags immediately.
4961 for file in $execute_dlfiles; do
4962 if test ! -f "$file"; then
4963 $echo "$modename: \`$file' is not a file" 1>&2
4971 # Check to see that this really is a libtool archive.
4972 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4974 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4979 # Read the libtool library.
4983 # If there is no directory component, then add one.
4985 */* | *\\*) . $file ;;
4989 # Skip this library if it cannot be dlopened.
4990 if test -z "$dlname"; then
4991 # Warn if it was a shared library.
4992 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4996 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4997 test "X$dir" = "X$file" && dir=.
4999 if test -f "$dir/$objdir/$dlname"; then
5002 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5008 # Just add the directory containing the .lo file.
5009 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5010 test "X$dir" = "X$file" && dir=.
5014 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5019 # Get the absolute pathname.
5020 absdir=`cd "$dir" && pwd`
5021 test -n "$absdir" && dir="$absdir"
5023 # Now add the directory to shlibpath_var.
5024 if eval "test -z \"\$$shlibpath_var\""; then
5025 eval "$shlibpath_var=\"\$dir\""
5027 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5031 # This variable tells wrapper scripts just to set shlibpath_var
5032 # rather than running their programs.
5033 libtool_execute_magic="$magic"
5035 # Check if any of the arguments is a wrapper script.
5042 # Do a test to see if this is really a libtool program.
5043 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5044 # If there is no directory component, then add one.
5046 */* | *\\*) . $file ;;
5050 # Transform arg to wrapped name.
5051 file="$progdir/$program"
5055 # Quote arguments (to preserve shell metacharacters).
5056 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5057 args="$args \"$file\""
5060 if test -z "$run"; then
5061 if test -n "$shlibpath_var"; then
5062 # Export the shlibpath_var.
5063 eval "export $shlibpath_var"
5066 # Restore saved enviroment variables
5067 if test "${save_LC_ALL+set}" = set; then
5068 LC_ALL="$save_LC_ALL"; export LC_ALL
5070 if test "${save_LANG+set}" = set; then
5071 LANG="$save_LANG"; export LANG
5074 # Now prepare to actually exec the command.
5075 exec_cmd='"$cmd"$args'
5077 # Display what would be done.
5078 if test -n "$shlibpath_var"; then
5079 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5080 $echo "export $shlibpath_var"
5087 # libtool clean and uninstall mode
5089 modename="$modename: $mode"
5095 # This variable tells wrapper scripts just to set variables rather
5096 # than running their programs.
5097 libtool_install_magic="$magic"
5102 -f) rm="$rm $arg"; rmforce=yes ;;
5103 -*) rm="$rm $arg" ;;
5104 *) files="$files $arg" ;;
5108 if test -z "$rm"; then
5109 $echo "$modename: you must specify an RM program" 1>&2
5116 for file in $files; do
5117 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5118 if test "X$dir" = "X$file"; then
5122 objdir="$dir/$objdir"
5124 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5125 test $mode = uninstall && objdir="$dir"
5127 # Remember objdir for removal later, being careful to avoid duplicates
5128 if test $mode = clean; then
5131 *) rmdirs="$rmdirs $objdir" ;;
5135 # Don't error if the file doesn't exist and rm -f was used.
5136 if (test -L "$file") >/dev/null 2>&1 \
5137 || (test -h "$file") >/dev/null 2>&1 \
5138 || test -f "$file"; then
5140 elif test -d "$file"; then
5143 elif test "$rmforce" = yes; then
5151 # Possibly a libtool archive, so verify it.
5152 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5155 # Delete the libtool libraries and symlinks.
5156 for n in $library_names; do
5157 rmfiles="$rmfiles $objdir/$n"
5159 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5160 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5162 if test $mode = uninstall; then
5163 if test -n "$library_names"; then
5164 # Do each command in the postuninstall commands.
5165 eval cmds=\"$postuninstall_cmds\"
5166 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5167 for cmd in $cmds; do
5171 if test $? != 0 && test "$rmforce" != yes; then
5178 if test -n "$old_library"; then
5179 # Do each command in the old_postuninstall commands.
5180 eval cmds=\"$old_postuninstall_cmds\"
5181 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
5182 for cmd in $cmds; do
5186 if test $? != 0 && test "$rmforce" != yes; then
5192 # FIXME: should reinstall the best remaining shared library.
5198 # Possibly a libtool object, so verify it.
5199 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5204 # Add PIC object to the list of files to remove.
5205 if test -n "$pic_object" \
5206 && test "$pic_object" != none; then
5207 rmfiles="$rmfiles $dir/$pic_object"
5210 # Add non-PIC object to the list of files to remove.
5211 if test -n "$non_pic_object" \
5212 && test "$non_pic_object" != none; then
5213 rmfiles="$rmfiles $dir/$non_pic_object"
5219 # Do a test to see if this is a libtool program.
5220 if test $mode = clean &&
5221 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5225 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5226 if test "$fast_install" = yes && test -n "$relink_command"; then
5227 rmfiles="$rmfiles $objdir/lt-$name"
5232 $show "$rm $rmfiles"
5233 $run $rm $rmfiles || exit_status=1
5236 # Try to remove the ${objdir}s in the directories where we deleted files
5237 for dir in $rmdirs; do
5238 if test -d "$dir"; then
5240 $run rmdir $dir >/dev/null 2>&1
5248 $echo "$modename: you must specify a MODE" 1>&2
5249 $echo "$generic_help" 1>&2
5254 if test -z "$exec_cmd"; then
5255 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5256 $echo "$generic_help" 1>&2
5259 fi # test -z "$show_help"
5261 if test -n "$exec_cmd"; then
5266 # We need to display help for each of the modes.
5269 "Usage: $modename [OPTION]... [MODE-ARG]...
5271 Provide generalized library-building support services.
5273 --config show all configuration variables
5274 --debug enable verbose shell tracing
5275 -n, --dry-run display commands without modifying any files
5276 --features display basic configuration information and exit
5277 --finish same as \`--mode=finish'
5278 --help display this help message and exit
5279 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5280 --quiet same as \`--silent'
5281 --silent don't print informational messages
5282 --tag=TAG use configuration variables from tag TAG
5283 --version print version information
5285 MODE must be one of the following:
5287 clean remove files from the build directory
5288 compile compile a source file into a libtool object
5289 execute automatically set library path, then run a program
5290 finish complete the installation of libtool libraries
5291 install install libraries or executables
5292 link create a library or an executable
5293 uninstall remove libraries from an installed directory
5295 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5296 a more detailed description of MODE."
5302 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5304 Remove files from the build directory.
5306 RM is the name of the program to use to delete files associated with each FILE
5307 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5310 If FILE is a libtool library, object or program, all the files associated
5311 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5316 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5318 Compile a source file into a libtool library object.
5320 This mode accepts the following additional options:
5322 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5323 -prefer-pic try to building PIC objects only
5324 -prefer-non-pic try to building non-PIC objects only
5325 -static always build a \`.o' file suitable for static linking
5327 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5328 from the given SOURCEFILE.
5330 The output file name is determined by removing the directory component from
5331 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5332 library object suffix, \`.lo'."
5337 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5339 Automatically set library path, then run a program.
5341 This mode accepts the following additional options:
5343 -dlopen FILE add the directory containing FILE to the library path
5345 This mode sets the library path environment variable according to \`-dlopen'
5348 If any of the ARGS are libtool executable wrappers, then they are translated
5349 into their corresponding uninstalled binary, and any of their required library
5350 directories are added to the library path.
5352 Then, COMMAND is executed, with ARGS as arguments."
5357 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5359 Complete the installation of libtool libraries.
5361 Each LIBDIR is a directory that contains libtool libraries.
5363 The commands that this mode executes may require superuser privileges. Use
5364 the \`--dry-run' option if you just want to see what would be executed."
5369 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5371 Install executables or libraries.
5373 INSTALL-COMMAND is the installation command. The first component should be
5374 either the \`install' or \`cp' program.
5376 The rest of the components are interpreted as arguments to that command (only
5377 BSD-compatible install options are recognized)."
5382 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5384 Link object files or libraries together to form another library, or to
5385 create an executable program.
5387 LINK-COMMAND is a command using the C compiler that you would use to create
5388 a program from several object files.
5390 The following components of LINK-COMMAND are treated specially:
5392 -all-static do not do any dynamic linking at all
5393 -avoid-version do not add a version suffix if possible
5394 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5395 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5396 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5397 -export-symbols SYMFILE
5398 try to export only the symbols listed in SYMFILE
5399 -export-symbols-regex REGEX
5400 try to export only the symbols matching REGEX
5401 -LLIBDIR search LIBDIR for required installed libraries
5402 -lNAME OUTPUT-FILE requires the installed library libNAME
5403 -module build a library that can dlopened
5404 -no-fast-install disable the fast-install mode
5405 -no-install link a not-installable executable
5406 -no-undefined declare that a library does not refer to external symbols
5407 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5408 -objectlist FILE Use a list of object files found in FILE to specify objects
5409 -release RELEASE specify package release information
5410 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5411 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5412 -static do not do any dynamic linking of libtool libraries
5413 -version-info CURRENT[:REVISION[:AGE]]
5414 specify library version info [each variable defaults to 0]
5416 All other options (arguments beginning with \`-') are ignored.
5418 Every other argument is treated as a filename. Files ending in \`.la' are
5419 treated as uninstalled libtool libraries, other files are standard or library
5422 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5423 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5424 required, except when creating a convenience library.
5426 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5427 using \`ar' and \`ranlib', or on Windows using \`lib'.
5429 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5430 is created, otherwise an executable program is created."
5435 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5437 Remove libraries from an installation directory.
5439 RM is the name of the program to use to delete files associated with each FILE
5440 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5443 If FILE is a libtool library, all the files associated with it are deleted.
5444 Otherwise, only FILE itself is deleted using RM."
5448 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5455 $echo "Try \`$modename --help' for more information about other modes."
5459 # The TAGs below are defined such that we never get into a situation
5460 # in which we disable both kinds of libraries. Given conflicting
5461 # choices, we go for a static library, that is the most portable,
5462 # since we can't tell whether shared libraries were disabled because
5463 # the user asked for that or because the platform doesn't support
5464 # them. This is particularly important on AIX, because we don't
5465 # support having both static and shared libraries enabled at the same
5466 # time on that platform, so we default to a shared-only configuration.
5467 # If a disable-shared tag is given, we'll fallback to a static-only
5468 # configuration. But we'll never go from static-only to shared-only.
5470 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5471 build_libtool_libs=no
5473 # ### END LIBTOOL TAG CONFIG: disable-shared
5475 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5476 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5477 # ### END LIBTOOL TAG CONFIG: disable-static