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-2001, 2015 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo; then
42 # used as fallback echo
50 # The name of this program.
51 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
58 TIMESTAMP=" (1.1090 2002/02/07 19:54:36)"
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
69 Xsed="${SED}"' -e 1s/^X//'
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG="$LANG"; LANG=C; export LANG
86 # Make sure IFS has a sensible default
89 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
90 echo "$modename: not configured to build any kind of library" 1>&2
91 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
104 lo2o="s/\\.lo\$/.${objext}/"
105 o2lo="s/\\.${objext}\$/.lo/"
107 # Parse our command line options once, thoroughly.
108 while test "$#" -gt 0
114 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
118 # If the previous option needs an argument, assign it.
119 if test -n "$prev"; then
122 execute_dlfiles="$execute_dlfiles $arg"
127 # Check whether tagname contains only valid characters
130 echo "$progname: invalid tag name: $tagname" 1>&2
137 # Don't test for the "default" C tag, as we know, it's there, but
138 # not specially marked.
141 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
142 taglist="$taglist $tagname"
143 # Evaluate the configuration.
144 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
146 echo "$progname: ignoring unknown tag $tagname" 1>&2
161 # Have we seen a non-optional argument yet?
168 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
170 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
171 echo "Free Software Foundation, Inc."
172 echo "This is free software; see the source for copying conditions. There is NO"
173 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
178 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
179 # Now print the configurations for the tags.
180 for tagname in $taglist; do
181 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
187 echo "$progname: enabling shell trace mode"
197 if test "$build_libtool_libs" = yes; then
198 echo "enable shared libraries"
200 echo "disable shared libraries"
202 if test "$build_old_libs" = yes; then
203 echo "enable static libraries"
205 echo "disable static libraries"
210 --finish) mode="finish" ;;
212 --mode) prevopt="--mode" prev=mode ;;
213 --mode=*) mode="$optarg" ;;
215 --preserve-dup-deps) duplicate_deps="yes" ;;
221 --tag) prevopt="--tag" prev=tag ;;
223 set tag "$optarg" ${1+"$@"}
234 $echo "$modename: unrecognized option \`$arg'" 1>&2
246 if test -n "$prevopt"; then
247 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
252 # If this variable is set in any of the actions, the command in it
253 # will be execed at the end. This prevents here-documents from being
254 # left over by shells.
257 if test -z "$show_help"; then
259 # Infer the operation mode.
260 if test -z "$mode"; then
262 *cc | *++ | gcc* | *-gcc*)
274 *db | *dbx | *strace | *truss)
284 # If we have no mode, but dlfiles were specified, then do execute mode.
285 test -n "$execute_dlfiles" && mode=execute
287 # Just use the default operation mode.
288 if test -z "$mode"; then
289 if test -n "$nonopt"; then
290 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
292 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
299 # Only execute mode is allowed to have -dlopen flags.
300 if test -n "$execute_dlfiles" && test "$mode" != execute; then
301 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
306 # Change the help message to a mode-specific one.
308 help="Try \`$modename --help --mode=$mode' for more information."
310 # These modes are in order of execution frequency so that they run quickly.
312 # libtool compile mode
314 modename="$modename: compile"
315 # Get the compilation command and the source file.
328 # Aesthetically quote the previous argument.
330 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
333 # Double-quote args containing other shell metacharacters.
334 # Many Bourne shells cannot handle close brackets correctly
335 # in scan sets, so we specify it separately.
336 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
341 # Add the previous argument to base_compile.
342 if test -z "$base_compile"; then
343 base_compile="$lastarg"
345 base_compile="$base_compile $lastarg"
351 # Accept any command-line options.
354 if test "$user_target" != "no"; then
355 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
382 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
384 save_ifs="$IFS"; IFS=','
388 # Double-quote args containing other shell metacharacters.
389 # Many Bourne shells cannot handle close brackets correctly
390 # in scan sets, so we specify it separately.
392 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
396 lastarg="$lastarg $arg"
399 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
401 # Add the arguments to base_compile.
402 if test -z "$base_compile"; then
403 base_compile="$lastarg"
405 base_compile="$base_compile $lastarg"
413 # The next one is the -o target name
418 # We got the output file
425 # Accept the current argument as the source file.
429 # Aesthetically quote the previous argument.
431 # Backslashify any backslashes, double quotes, and dollar signs.
432 # These are the only characters that are still specially
433 # interpreted inside of double-quoted scrings.
434 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
436 # Double-quote args containing other shell metacharacters.
437 # Many Bourne shells cannot handle close brackets correctly
438 # in scan sets, so we specify it separately.
440 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
441 lastarg="\"$lastarg\""
445 # Add the previous argument to base_compile.
446 if test -z "$base_compile"; then
447 base_compile="$lastarg"
449 base_compile="$base_compile $lastarg"
457 # Get the name of the library object.
458 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
461 $echo "$modename: you must specify a target with \`-o'" 1>&2
466 # Recognize several different file suffixes.
467 # If the user specifies -o file.o, it is replaced with file.lo
477 *.class) xform=class ;;
482 *.java) xform=java ;;
485 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
488 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
490 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
495 # Infer tagged configuration to use if any are available and
496 # if one wasn't chosen via the "--tag" command line option.
497 # Only attempt this if the compiler in the base compile
498 # command doesn't match the default compiler.
499 if test -n "$available_tags" && test -z "$tagname"; then
500 case "$base_compile " in
502 # Blanks in the command may have been stripped by the calling shell,
503 # but not from the CC environment variable when ltconfig was run.
506 for z in $available_tags; do
507 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
508 # Evaluate the configuration.
509 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
510 case "$base_compile " in
512 # The compiler in the base compile command matches
513 # the one in the tagged configuration.
514 # Assume this is the tagged configuration we want.
525 # If $tagname still isn't set, then no tagged configuration
526 # was found and let the user know that the "--tag" command
527 # line option must be used.
528 if test -z "$tagname"; then
529 echo "$modename: unable to infer tagged configuration"
530 echo "$modename: specify a tag with \`--tag'" 1>&2
533 # echo "$modename: using $tagname tagged configuration"
539 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
540 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
541 if test "X$xdir" = "X$obj"; then
546 lobj=${xdir}$objdir/$objname
548 if test -z "$base_compile"; then
549 $echo "$modename: you must specify a compilation command" 1>&2
554 # Delete any leftover library objects.
555 if test "$build_old_libs" = yes; then
556 removelist="$obj $lobj $libobj ${libobj}T"
558 removelist="$lobj $libobj ${libobj}T"
562 trap "$run $rm $removelist; exit 1" 1 2 15
564 # On Cygwin there's no "real" PIC flag so we must build both object types
566 cygwin* | mingw* | pw32* | os2*)
570 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
571 # non-PIC code in shared libraries is not supported
575 # Calculate the filename of the output object if compiler does
576 # not support -o with -c
577 if test "$compiler_c_o" = no; then
578 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
579 lockfile="$output_obj.lock"
580 removelist="$removelist $output_obj $lockfile"
581 trap "$run $rm $removelist; exit 1" 1 2 15
588 # Lock this critical section if it is needed
589 # We use this script file to make the link, it avoids creating a new file
590 if test "$need_locks" = yes; then
591 until $run ln "$0" "$lockfile" 2>/dev/null; do
592 $show "Waiting for $lockfile to be removed"
595 elif test "$need_locks" = warn; then
596 if test -f "$lockfile"; then
598 *** ERROR, $lockfile exists and contains:
599 `cat $lockfile 2>/dev/null`
601 This indicates that another process is trying to use the same
602 temporary object file, and libtool could not work around it because
603 your compiler does not support \`-c' and \`-o' together. If you
604 repeat this compilation, it may succeed, by chance, but you had better
605 avoid parallel builds (make -j) in this platform, or get a better
611 echo $srcfile > "$lockfile"
614 if test -n "$fix_srcfile_path"; then
615 eval srcfile=\"$fix_srcfile_path\"
618 $run $rm "$libobj" "${libobj}T"
620 # Create a libtool object file (analogous to a ".la" file),
621 # but don't create it if we're doing a dry run.
622 test -z "$run" && cat > ${libobj}T <<EOF
623 # $libobj - a libtool object file
624 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
626 # Please DO NOT delete this file!
627 # It is necessary for linking the library.
629 # Name of the PIC object.
632 # Only build a PIC object if we are building libtool libraries.
633 if test "$build_libtool_libs" = yes; then
634 # Without this assignment, base_compile gets emptied.
635 fbsd_hideous_sh_bug=$base_compile
637 if test "$pic_mode" != no; then
638 command="$base_compile $srcfile $pic_flag"
640 # Don't build PIC code
641 command="$base_compile $srcfile"
644 if test ! -d "${xdir}$objdir"; then
645 $show "$mkdir ${xdir}$objdir"
646 $run $mkdir ${xdir}$objdir
648 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
653 if test -z "$output_obj"; then
654 # Place PIC objects in $objdir
655 command="$command -o $lobj"
658 $run $rm "$lobj" "$output_obj"
661 if $run eval "$command"; then :
663 test -n "$output_obj" && $run $rm $removelist
667 if test "$need_locks" = warn &&
668 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
670 *** ERROR, $lockfile contains:
671 `cat $lockfile 2>/dev/null`
673 but it should contain:
676 This indicates that another process is trying to use the same
677 temporary object file, and libtool could not work around it because
678 your compiler does not support \`-c' and \`-o' together. If you
679 repeat this compilation, it may succeed, by chance, but you had better
680 avoid parallel builds (make -j) in this platform, or get a better
687 # Just move the object if needed, then go on to compile the next one
688 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
689 $show "$mv $output_obj $lobj"
690 if $run $mv $output_obj $lobj; then :
698 # Append the name of the PIC object to the libtool object file.
699 test -z "$run" && cat >> ${libobj}T <<EOF
700 pic_object='$objdir/$objname'
704 # Allow error messages only from the first compilation.
705 suppress_output=' >/dev/null 2>&1'
707 # No PIC object so indicate it doesn't exist in the libtool
709 test -z "$run" && cat >> ${libobj}T <<EOF
715 # Only build a position-dependent object if we build old libraries.
716 if test "$build_old_libs" = yes; then
717 if test "$pic_mode" != yes; then
718 # Don't build PIC code
719 command="$base_compile $srcfile"
721 command="$base_compile $srcfile $pic_flag"
723 if test "$compiler_c_o" = yes; then
724 command="$command -o $obj"
727 # Suppress compiler output if we already did a PIC compilation.
728 command="$command$suppress_output"
729 $run $rm "$obj" "$output_obj"
731 if $run eval "$command"; then :
737 if test "$need_locks" = warn &&
738 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
740 *** ERROR, $lockfile contains:
741 `cat $lockfile 2>/dev/null`
743 but it should contain:
746 This indicates that another process is trying to use the same
747 temporary object file, and libtool could not work around it because
748 your compiler does not support \`-c' and \`-o' together. If you
749 repeat this compilation, it may succeed, by chance, but you had better
750 avoid parallel builds (make -j) in this platform, or get a better
757 # Just move the object if needed
758 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
759 $show "$mv $output_obj $obj"
760 if $run $mv $output_obj $obj; then :
768 # Append the name of the non-PIC object the libtool object file.
769 # Only append if the libtool object file exists.
770 test -z "$run" && cat >> ${libobj}T <<EOF
771 # Name of the non-PIC object.
772 non_pic_object='$objname'
776 # Append the name of the non-PIC object the libtool object file.
777 # Only append if the libtool object file exists.
778 test -z "$run" && cat >> ${libobj}T <<EOF
779 # Name of the non-PIC object.
785 $run $mv "${libobj}T" "${libobj}"
787 # Unlock the critical section if it was locked
788 if test "$need_locks" != no; then
797 modename="$modename: link"
799 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
800 # It is impossible to link a dll without this setting, and
801 # we shouldn't force the makefile maintainer to figure out
802 # which system we are compiling for in order to pass an extra
803 # flag for every libtool invokation.
806 # FIXME: Unfortunately, there are problems with the above when trying
807 # to make a dll which has undefined symbols, in which case not
808 # even a static library is built. For now, we need to specify
809 # -no-undefined on the libtool link line when we can be certain
810 # that all symbols are satisfied, otherwise we get a static library.
817 libtool_args="$nonopt"
818 base_compile="$nonopt"
819 compile_command="$nonopt"
820 finalize_command="$nonopt"
834 lib_search_path=`pwd`
842 export_symbols_regex=
850 prefer_static_libs=no
862 # We need to know -static, to get the right output filenames.
866 -all-static | -static)
867 if test "X$arg" = "X-all-static"; then
868 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
869 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
871 if test -n "$link_static_flag"; then
872 dlopen_self=$dlopen_self_static
875 if test -z "$pic_flag" && test -n "$link_static_flag"; then
876 dlopen_self=$dlopen_self_static
879 build_libtool_libs=no
881 prefer_static_libs=yes
887 # See if our shared archives depend on static archives.
888 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
890 # Go through the arguments, transforming them on the way.
891 while test "$#" -gt 0; do
893 base_compile="$base_compile $arg"
896 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
897 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
901 libtool_args="$libtool_args $qarg"
903 # If the previous option needs an argument, assign it.
904 if test -n "$prev"; then
907 compile_command="$compile_command @OUTPUT@"
908 finalize_command="$finalize_command @OUTPUT@"
914 if test "$preload" = no; then
915 # Add the symbol object into the linking commands.
916 compile_command="$compile_command @SYMFILE@"
917 finalize_command="$finalize_command @SYMFILE@"
921 *.la | *.lo) ;; # We handle these cases below.
923 if test "$dlself" = no; then
931 if test "$prev" = dlprefiles; then
933 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
943 if test "$prev" = dlfiles; then
944 dlfiles="$dlfiles $arg"
946 dlprefiles="$dlprefiles $arg"
954 export_symbols="$arg"
955 if test ! -f "$arg"; then
956 $echo "$modename: symbol file \`$arg' does not exist"
963 export_symbols_regex="$arg"
973 if test -f "$arg"; then
976 for fil in `cat $save_arg`
978 # moreargs="$moreargs $fil"
980 # A libtool-controlled object.
982 # Check to see that this really is a libtool object.
983 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
988 # If there is no directory component, then add one.
990 */* | *\\*) . $arg ;;
994 if test -z "$pic_object" || \
995 test -z "$non_pic_object" ||
996 test "$pic_object" = none && \
997 test "$non_pic_object" = none; then
998 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1002 # Extract subdirectory from the argument.
1003 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1004 if test "X$xdir" = "X$arg"; then
1010 if test "$pic_object" != none; then
1011 # Prepend the subdirectory the object is found in.
1012 pic_object="$xdir$pic_object"
1014 if test "$prev" = dlfiles; then
1015 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1016 dlfiles="$dlfiles $pic_object"
1020 # If libtool objects are unsupported, then we need to preload.
1025 # CHECK ME: I think I busted this. -Ossama
1026 if test "$prev" = dlprefiles; then
1027 # Preload the old-style object.
1028 dlprefiles="$dlprefiles $pic_object"
1033 libobjs="$libobjs $pic_object"
1038 if test "$non_pic_object" != none; then
1039 # Prepend the subdirectory the object is found in.
1040 non_pic_object="$xdir$non_pic_object"
1042 # A standard non-PIC object
1043 non_pic_objects="$non_pic_objects $non_pic_object"
1044 if test -z "$pic_object" || test "$pic_object" = none ; then
1045 arg="$non_pic_object"
1049 # Only an error if not doing a dry-run.
1050 if test -z "$run"; then
1051 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1056 # Extract subdirectory from the argument.
1057 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1058 if test "X$xdir" = "X$arg"; then
1064 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1065 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1066 libobjs="$libobjs $pic_object"
1067 non_pic_objects="$non_pic_objects $non_pic_object"
1072 $echo "$modename: link input file \`$save_arg' does not exist"
1080 # We need an absolute path.
1082 [\\/]* | [A-Za-z]:[\\/]*) ;;
1084 $echo "$modename: only absolute run-paths are allowed" 1>&2
1088 if test "$prev" = rpath; then
1091 *) rpath="$rpath $arg" ;;
1096 *) xrpath="$xrpath $arg" ;;
1103 compiler_flags="$compiler_flags $qarg"
1105 compile_command="$compile_command $qarg"
1106 finalize_command="$finalize_command $qarg"
1110 linker_flags="$linker_flags $qarg"
1111 compiler_flags="$compiler_flags $wl$qarg"
1113 compile_command="$compile_command $wl$qarg"
1114 finalize_command="$finalize_command $wl$qarg"
1118 eval "$prev=\"\$arg\""
1123 fi # test -n "$prev"
1129 if test -n "$link_static_flag"; then
1130 compile_command="$compile_command $link_static_flag"
1131 finalize_command="$finalize_command $link_static_flag"
1137 # FIXME: remove this flag sometime in the future.
1138 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1162 -export-symbols | -export-symbols-regex)
1163 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1164 $echo "$modename: more than one -exported-symbols argument is not allowed"
1167 if test "X$arg" = "X-export-symbols"; then
1175 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1176 # so, if we see these flags be careful not to treat them like -L
1178 case $with_gcc/$host in
1179 no/*-*-irix* | /*-*-irix*)
1180 compile_command="$compile_command $arg"
1181 finalize_command="$finalize_command $arg"
1188 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1189 # We need an absolute path.
1191 [\\/]* | [A-Za-z]:[\\/]*) ;;
1193 absdir=`cd "$dir" && pwd`
1194 if test -z "$absdir"; then
1195 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1204 deplibs="$deplibs -L$dir"
1205 lib_search_path="$lib_search_path $dir"
1209 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1210 case :$dllsearchpath: in
1212 *) dllsearchpath="$dllsearchpath:$dir";;
1220 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1222 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1223 # These systems don't actually have a C or math library (as such)
1226 *-*-mingw* | *-*-os2*)
1227 # These systems don't actually have a C library (as such)
1228 test "X$arg" = "X-lc" && continue
1230 *-*-openbsd* | *-*-freebsd*)
1231 # Do not include libc due to us having libc/libc_r.
1232 test "X$arg" = "X-lc" && continue
1234 *-*-rhapsody* | *-*-darwin1.[012])
1235 # Rhapsody C and math libraries are in the System framework
1236 deplibs="$deplibs -framework System"
1239 elif test "X$arg" = "X-lc_r"; then
1241 *-*-openbsd* | *-*-freebsd*)
1242 # Do not include libc_r directly, use -pthread flag.
1247 deplibs="$deplibs $arg"
1263 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1264 # The PATH hackery in wrapper scripts is required on Windows
1265 # in order for the loader to find any dlls it needs.
1266 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1267 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1270 *) no_install=yes ;;
1303 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1304 # We need an absolute path.
1306 [\\/]* | [A-Za-z]:[\\/]*) ;;
1308 $echo "$modename: only absolute run-paths are allowed" 1>&2
1314 *) xrpath="$xrpath $dir" ;;
1320 # The effects of -static are defined in a previous loop.
1321 # We used to do the same as -all-static on platforms that
1322 # didn't have a PIC flag, but the assumption that the effects
1323 # would be equivalent was wrong. It would break on at least
1324 # Digital Unix and AIX.
1339 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1341 save_ifs="$IFS"; IFS=','
1342 for flag in $args; do
1345 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1350 compiler_flags="$compiler_flags $flag"
1353 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1357 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1359 save_ifs="$IFS"; IFS=','
1360 for flag in $args; do
1363 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1368 compiler_flags="$compiler_flags $wl$flag"
1369 linker_flags="$linker_flags $flag"
1372 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1385 # Some other compiler flag.
1387 # Unknown arguments in both finalize_command and compile_command need
1388 # to be aesthetically quoted because they are evaled later.
1389 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1391 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1395 add_flags="$add_flags $arg"
1399 # A standard object.
1404 # A libtool-controlled object.
1406 # Check to see that this really is a libtool object.
1407 if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1412 # If there is no directory component, then add one.
1414 */* | *\\*) . $arg ;;
1418 if test -z "$pic_object" || \
1419 test -z "$non_pic_object" ||
1420 test "$pic_object" = none && \
1421 test "$non_pic_object" = none; then
1422 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1426 # Extract subdirectory from the argument.
1427 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1428 if test "X$xdir" = "X$arg"; then
1434 if test "$pic_object" != none; then
1435 # Prepend the subdirectory the object is found in.
1436 pic_object="$xdir$pic_object"
1438 if test "$prev" = dlfiles; then
1439 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1440 dlfiles="$dlfiles $pic_object"
1444 # If libtool objects are unsupported, then we need to preload.
1449 # CHECK ME: I think I busted this. -Ossama
1450 if test "$prev" = dlprefiles; then
1451 # Preload the old-style object.
1452 dlprefiles="$dlprefiles $pic_object"
1457 libobjs="$libobjs $pic_object"
1462 if test "$non_pic_object" != none; then
1463 # Prepend the subdirectory the object is found in.
1464 non_pic_object="$xdir$non_pic_object"
1466 # A standard non-PIC object
1467 non_pic_objects="$non_pic_objects $non_pic_object"
1468 if test -z "$pic_object" || test "$pic_object" = none ; then
1469 arg="$non_pic_object"
1473 # Only an error if not doing a dry-run.
1474 if test -z "$run"; then
1475 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1480 # Extract subdirectory from the argument.
1481 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1482 if test "X$xdir" = "X$arg"; then
1488 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1489 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1490 libobjs="$libobjs $pic_object"
1491 non_pic_objects="$non_pic_objects $non_pic_object"
1498 deplibs="$deplibs $arg"
1499 old_deplibs="$old_deplibs $arg"
1504 # A libtool-controlled library.
1506 if test "$prev" = dlfiles; then
1507 # This library was specified with -dlopen.
1508 dlfiles="$dlfiles $arg"
1510 elif test "$prev" = dlprefiles; then
1511 # The library was specified with -dlpreopen.
1512 dlprefiles="$dlprefiles $arg"
1515 deplibs="$deplibs $arg"
1520 # Some other compiler argument.
1522 # Unknown arguments in both finalize_command and compile_command need
1523 # to be aesthetically quoted because they are evaled later.
1524 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1526 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1530 add_flags="$add_flags $arg"
1534 # Now actually substitute the argument into the commands.
1535 if test -n "$arg"; then
1536 compile_command="$compile_command $arg"
1537 finalize_command="$finalize_command $arg"
1539 done # argument parsing loop
1541 if test -n "$prev"; then
1542 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1547 # Infer tagged configuration to use if any are available and
1548 # if one wasn't chosen via the "--tag" command line option.
1549 # Only attempt this if the compiler in the base link
1550 # command doesn't match the default compiler.
1551 if test -n "$available_tags" && test -z "$tagname"; then
1552 case $base_compile in
1554 # Blanks in the command may have been stripped by the calling shell,
1555 # but not from the CC environment variable when ltconfig was run.
1558 for z in $available_tags; do
1559 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1560 # Evaluate the configuration.
1561 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1562 case $base_compile in
1564 # The compiler in $compile_command matches
1565 # the one in the tagged configuration.
1566 # Assume this is the tagged configuration we want.
1577 # If $tagname still isn't set, then no tagged configuration
1578 # was found and let the user know that the "--tag" command
1579 # line option must be used.
1580 if test -z "$tagname"; then
1581 echo "$modename: unable to infer tagged configuration"
1582 echo "$modename: specify a tag with \`--tag'" 1>&2
1585 # echo "$modename: using $tagname tagged configuration"
1591 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1592 eval arg=\"$export_dynamic_flag_spec\"
1593 compile_command="$compile_command $arg"
1594 finalize_command="$finalize_command $arg"
1598 # calculate the name of the file, without its directory
1599 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1600 libobjs_save="$libobjs"
1602 if test -n "$shlibpath_var"; then
1603 # get the directories listed in $shlibpath_var
1604 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1608 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1609 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1611 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1612 if test "X$output_objdir" = "X$output"; then
1613 output_objdir="$objdir"
1615 output_objdir="$output_objdir/$objdir"
1617 # Create the object directory.
1618 if test ! -d "$output_objdir"; then
1619 $show "$mkdir $output_objdir"
1620 $run $mkdir $output_objdir
1622 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1627 # Determine the type of output
1630 $echo "$modename: you must specify an output file" 1>&2
1634 *.$libext) linkmode=oldlib ;;
1635 *.lo | *.$objext) linkmode=obj ;;
1636 *.la) linkmode=lib ;;
1637 *) linkmode=prog ;; # Anything else should be a program.
1642 # Find all interdependent deplibs by searching for libraries
1643 # that are linked more than once (e.g. -la -lb -la)
1644 for deplib in $deplibs; do
1645 if test "X$duplicate_deps" = "Xyes" ; then
1647 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1650 libs="$libs $deplib"
1653 if test "$linkmode" = lib; then
1654 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1656 # Compute libraries that are listed more than once in $predeps
1657 # $postdeps and mark them as special (i.e., whose duplicates are
1658 # not to be eliminated).
1660 if test "X$duplicate_deps" = "Xyes" ; then
1661 for pre_post_dep in $predeps $postdeps; do
1662 case "$pre_post_deps " in
1663 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1665 pre_post_deps="$pre_post_deps $pre_post_dep"
1674 need_relink=no # whether we're linking any uninstalled libtool libraries
1675 notinst_deplibs= # not-installed libtool libraries
1676 notinst_path= # paths that contain not-installed libtool libraries
1680 for file in $dlfiles $dlprefiles; do
1684 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1696 passes="conv scan dlopen dlpreopen link"
1701 for pass in $passes; do
1702 if test "$linkmode,$pass" = "lib,link" ||
1703 test "$linkmode,$pass" = "prog,scan"; then
1707 if test "$linkmode" = prog; then
1709 dlopen) libs="$dlfiles" ;;
1710 dlpreopen) libs="$dlprefiles" ;;
1711 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1714 if test "$pass" = dlopen; then
1715 # Collect dlpreopened libraries
1716 save_deplibs="$deplibs"
1719 for deplib in $libs; do
1724 if test "$linkmode" != lib && test "$linkmode" != prog; then
1725 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1728 if test "$pass" = conv && test "$allow_undefined" = yes; then
1729 deplibs="$deplib $deplibs"
1732 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1733 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1734 # Search the libtool library
1735 lib="$searchdir/lib${name}.la"
1736 if test -f "$lib"; then
1741 if test "$found" != yes; then
1742 # deplib doesn't seem to be a libtool library
1743 if test "$linkmode,$pass" = "prog,link"; then
1744 compile_deplibs="$deplib $compile_deplibs"
1745 finalize_deplibs="$deplib $finalize_deplibs"
1747 deplibs="$deplib $deplibs"
1748 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1756 deplibs="$deplib $deplibs"
1757 test "$pass" = conv && continue
1758 newdependency_libs="$deplib $newdependency_libs"
1759 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1762 if test "$pass" = conv; then
1763 deplibs="$deplib $deplibs"
1766 if test "$pass" = scan; then
1767 deplibs="$deplib $deplibs"
1768 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1770 compile_deplibs="$deplib $compile_deplibs"
1771 finalize_deplibs="$deplib $finalize_deplibs"
1775 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1781 if test "$pass" = link; then
1782 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1783 # Make sure the xrpath contains only unique directories.
1786 *) xrpath="$xrpath $dir" ;;
1789 deplibs="$deplib $deplibs"
1792 *.la) lib="$deplib" ;;
1794 if test "$pass" = conv; then
1795 deplibs="$deplib $deplibs"
1800 if test "$deplibs_check_method" != pass_all; then
1802 echo "*** Warning: Trying to link with static lib archive $deplib."
1803 echo "*** I have the capability to make that library automatically link in when"
1804 echo "*** you link to this library. But I can only do this if you have a"
1805 echo "*** shared version of the library, which you do not appear to have"
1806 echo "*** because the file extensions .$libext of this argument makes me believe"
1807 echo "*** that it is just a static archive that I should not used here."
1810 echo "*** Warning: Linking the shared library $output against the"
1811 echo "*** static library $deplib is not portable!"
1812 deplibs="$deplib $deplibs"
1817 if test "$pass" != link; then
1818 deplibs="$deplib $deplibs"
1820 compile_deplibs="$deplib $compile_deplibs"
1821 finalize_deplibs="$deplib $finalize_deplibs"
1828 if test "$pass" = conv; then
1829 deplibs="$deplib $deplibs"
1830 elif test "$linkmode" = prog; then
1831 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1832 # If there is no dlopen support or we're linking statically,
1833 # we need to preload.
1834 newdlprefiles="$newdlprefiles $deplib"
1835 compile_deplibs="$deplib $compile_deplibs"
1836 finalize_deplibs="$deplib $finalize_deplibs"
1838 newdlfiles="$newdlfiles $deplib"
1848 if test "$found" = yes || test -f "$lib"; then :
1850 $echo "$modename: cannot find the library \`$lib'" 1>&2
1854 # Check to see that this really is a libtool archive.
1855 if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1857 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1861 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1862 test "X$ladir" = "X$lib" && ladir="."
1870 # If the library was installed with an old release of libtool,
1871 # it will not redefine variable installed.
1876 */* | *\\*) . $lib ;;
1880 if test "$linkmode,$pass" = "lib,link" ||
1881 test "$linkmode,$pass" = "prog,scan" ||
1882 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1883 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1884 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1887 if test "$pass" = conv; then
1888 # Only check for convenience libraries
1889 deplibs="$lib $deplibs"
1891 for deplib in $dependency_libs; do
1892 #echo "Adding $deplib to \$deplibs"
1893 deplibs="$deplib $deplibs"
1894 if test "X$duplicate_deps" = "Xyes" ; then
1895 case "$tmp_libs " in
1896 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1899 tmp_libs="$tmp_libs $deplib"
1901 if test -z "$libdir"; then
1902 if test -z "$old_library"; then
1903 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1906 # It is a libtool convenience library, so add in its objects.
1907 convenience="$convenience $ladir/$objdir/$old_library"
1908 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1909 elif test "$linkmode" != prog && test "$linkmode" != lib; then
1910 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1916 # Get the name of the library we link against.
1918 for l in $old_library $library_names; do
1921 if test -z "$linklib"; then
1922 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1926 # This library was specified with -dlopen.
1927 if test "$pass" = dlopen; then
1928 if test -z "$libdir"; then
1929 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1932 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1933 # If there is no dlname, no dlopen support or we're linking
1934 # statically, we need to preload. We also need to preload any
1935 # dependent libraries so libltdl's deplib preloader doesn't
1936 # bomb out in the load deplibs phase.
1937 dlprefiles="$dlprefiles $lib $dependency_libs"
1939 newdlfiles="$newdlfiles $lib"
1944 # We need an absolute path.
1946 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1948 abs_ladir=`cd "$ladir" && pwd`
1949 if test -z "$abs_ladir"; then
1950 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1951 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1956 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1958 # Find the relevant object directory and library name.
1959 if test "X$installed" = Xyes; then
1960 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1961 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1970 dir="$ladir/$objdir"
1971 absdir="$abs_ladir/$objdir"
1972 # Remove this search path later
1973 notinst_path="$notinst_path $abs_ladir"
1974 fi # $installed = yes
1975 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1977 # This library was specified with -dlpreopen.
1978 if test "$pass" = dlpreopen; then
1979 if test -z "$libdir"; then
1980 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1983 # Prefer using a static library (so that no silly _DYNAMIC symbols
1984 # are required to link).
1985 if test -n "$old_library"; then
1986 newdlprefiles="$newdlprefiles $dir/$old_library"
1987 # Otherwise, use the dlname, so that lt_dlopen finds it.
1988 elif test -n "$dlname"; then
1989 newdlprefiles="$newdlprefiles $dir/$dlname"
1991 newdlprefiles="$newdlprefiles $dir/$linklib"
1993 fi # $pass = dlpreopen
1995 if test -z "$libdir"; then
1996 # Link the convenience library
1997 if test "$linkmode" = lib; then
1998 deplibs="$dir/$old_library $deplibs"
1999 elif test "$linkmode,$pass" = "prog,link"; then
2000 compile_deplibs="$dir/$old_library $compile_deplibs"
2001 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2003 deplibs="$lib $deplibs" # used for prog,scan pass
2008 if test "$linkmode" = prog && test "$pass" != link; then
2009 newlib_search_path="$newlib_search_path $ladir"
2010 deplibs="$lib $deplibs"
2013 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2014 test "$build_libtool_libs" = no; then
2019 for deplib in $dependency_libs; do
2021 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2023 # Need to link against all dependency_libs?
2024 if test "$linkalldeplibs" = yes; then
2025 deplibs="$deplib $deplibs"
2027 # Need to hardcode shared library paths
2028 # or/and link against static libraries
2029 newdependency_libs="$deplib $newdependency_libs"
2031 if test "X$duplicate_deps" = "Xyes" ; then
2032 case "$tmp_libs " in
2033 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2036 tmp_libs="$tmp_libs $deplib"
2039 fi # $linkmode = prog...
2041 if test "$linkmode,$pass" = "prog,link"; then
2042 if test -n "$library_names" &&
2043 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2044 # We need to hardcode the library path
2045 if test -n "$shlibpath_var"; then
2046 # Make sure the rpath contains only unique directories.
2047 case "$temp_rpath " in
2050 *) temp_rpath="$temp_rpath $dir" ;;
2054 # Hardcode the library path.
2055 # Skip directories that are in the system default run-time
2057 case " $sys_lib_dlsearch_path " in
2060 case "$compile_rpath " in
2062 *) compile_rpath="$compile_rpath $absdir"
2066 case " $sys_lib_dlsearch_path " in
2069 case "$finalize_rpath " in
2071 *) finalize_rpath="$finalize_rpath $libdir"
2075 fi # $linkmode,$pass = prog,link...
2077 if test "$alldeplibs" = yes &&
2078 { test "$deplibs_check_method" = pass_all ||
2079 { test "$build_libtool_libs" = yes &&
2080 test -n "$library_names"; }; }; then
2081 # We only need to search for static libraries
2086 link_static=no # Whether the deplib will be linked statically
2087 if test -n "$library_names" &&
2088 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2089 if test "$installed" = no; then
2090 notinst_deplibs="$notinst_deplibs $lib"
2093 # This is a shared library
2094 if test "$linkmode" = lib &&
2095 test "$hardcode_into_libs" = yes; then
2096 # Hardcode the library path.
2097 # Skip directories that are in the system default run-time
2099 case " $sys_lib_dlsearch_path " in
2102 case "$compile_rpath " in
2104 *) compile_rpath="$compile_rpath $absdir"
2108 case " $sys_lib_dlsearch_path " in
2111 case "$finalize_rpath " in
2113 *) finalize_rpath="$finalize_rpath $libdir"
2119 if test -n "$old_archive_from_expsyms_cmds"; then
2120 # figure out the soname
2121 set dummy $library_names
2124 libname=`eval \\$echo \"$libname_spec\"`
2125 # use dlname if we got it. it's perfectly good, no?
2126 if test -n "$dlname"; then
2128 elif test -n "$soname_spec"; then
2132 major=`expr $current - $age`
2136 eval soname=\"$soname_spec\"
2141 # Make a new name for the extract_expsyms_cmds to use
2143 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2144 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2146 # If the library has no export list, then create one now
2147 if test -f "$output_objdir/$soname-def"; then :
2149 $show "extracting exported symbol list from \`$soname'"
2150 save_ifs="$IFS"; IFS='~'
2151 eval cmds=\"$extract_expsyms_cmds\"
2152 for cmd in $cmds; do
2155 $run eval "$cmd" || exit $?
2161 if test -f "$output_objdir/$newlib"; then :; else
2162 $show "generating import library for \`$soname'"
2163 save_ifs="$IFS"; IFS='~'
2164 eval cmds=\"$old_archive_from_expsyms_cmds\"
2165 for cmd in $cmds; do
2168 $run eval "$cmd" || exit $?
2172 # make sure the library variables are pointing to the new library
2175 fi # test -n "$old_archive_from_expsyms_cmds"
2177 if test "$linkmode" = prog || test "$mode" != relink; then
2182 case $hardcode_action in
2183 immediate | unsupported)
2184 if test "$hardcode_direct" = no; then
2186 elif test "$hardcode_minus_L" = no; then
2188 *-*-sunos*) add_shlibpath="$dir" ;;
2192 elif test "$hardcode_shlibpath_var" = no; then
2193 add_shlibpath="$dir"
2200 if test "$hardcode_direct" = yes; then
2202 elif test "$hardcode_minus_L" = yes; then
2205 elif test "$hardcode_shlibpath_var" = yes; then
2206 add_shlibpath="$dir"
2215 if test "$lib_linked" != yes; then
2216 $echo "$modename: configuration error: unsupported hardcode properties"
2220 if test -n "$add_shlibpath"; then
2221 case :$compile_shlibpath: in
2222 *":$add_shlibpath:"*) ;;
2223 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2226 if test "$linkmode" = prog; then
2227 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2228 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2230 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2231 test -n "$add" && deplibs="$add $deplibs"
2232 if test "$hardcode_direct" != yes && \
2233 test "$hardcode_minus_L" != yes && \
2234 test "$hardcode_shlibpath_var" = yes; then
2235 case :$finalize_shlibpath: in
2237 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2243 if test "$linkmode" = prog || test "$mode" = relink; then
2247 # Finalize command for both is simple: just hardcode it.
2248 if test "$hardcode_direct" = yes; then
2249 add="$libdir/$linklib"
2250 elif test "$hardcode_minus_L" = yes; then
2253 elif test "$hardcode_shlibpath_var" = yes; then
2254 case :$finalize_shlibpath: in
2256 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2260 # We cannot seem to hardcode it, guess we'll fake it.
2265 if test "$linkmode" = prog; then
2266 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2267 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2269 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2270 test -n "$add" && deplibs="$add $deplibs"
2273 elif test "$linkmode" = prog; then
2274 # Here we assume that one of hardcode_direct or hardcode_minus_L
2275 # is not unsupported. This is valid on all known static and
2277 if test "$hardcode_direct" != unsupported; then
2278 test -n "$old_library" && linklib="$old_library"
2279 compile_deplibs="$dir/$linklib $compile_deplibs"
2280 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2282 compile_deplibs="-l$name -L$dir $compile_deplibs"
2283 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2285 elif test "$build_libtool_libs" = yes; then
2286 # Not a shared library
2287 if test "$deplibs_check_method" != pass_all; then
2288 # We're trying link a shared library against a static one
2289 # but the system doesn't support it.
2291 # Just print a warning and add the library to dependency_libs so
2292 # that the program can be linked against the static library.
2294 echo "*** Warning: This system can not link to static lib archive $lib."
2295 echo "*** I have the capability to make that library automatically link in when"
2296 echo "*** you link to this library. But I can only do this if you have a"
2297 echo "*** shared version of the library, which you do not appear to have."
2298 if test "$module" = yes; then
2299 echo "*** But as you try to build a module library, libtool will still create "
2300 echo "*** a static module, that should work as long as the dlopening application"
2301 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2302 if test -z "$global_symbol_pipe"; then
2304 echo "*** However, this would only work if libtool was able to extract symbol"
2305 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2306 echo "*** not find such a program. So, this module is probably useless."
2307 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2309 if test "$build_old_libs" = no; then
2310 build_libtool_libs=module
2313 build_libtool_libs=no
2317 convenience="$convenience $dir/$old_library"
2318 old_convenience="$old_convenience $dir/$old_library"
2319 deplibs="$dir/$old_library $deplibs"
2322 fi # link shared/static library?
2324 if test "$linkmode" = lib; then
2325 #if test -n "$dependency_libs" &&
2326 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2327 # test "$link_static" = yes; }; then
2328 # Extract -R from dependency_libs
2330 for libdir in $dependency_libs; do
2332 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2334 *" $temp_xrpath "*) ;;
2335 *) xrpath="$xrpath $temp_xrpath";;
2337 *) temp_deplibs="$temp_deplibs $libdir";;
2340 dependency_libs="$temp_deplibs"
2343 newlib_search_path="$newlib_search_path $absdir"
2344 # Link against this library
2345 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2346 # ... and its dependency_libs
2348 for deplib in $dependency_libs; do
2349 newdependency_libs="$deplib $newdependency_libs"
2350 if test "X$duplicate_deps" = "Xyes" ; then
2351 case "$tmp_libs " in
2352 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2355 tmp_libs="$tmp_libs $deplib"
2358 if test "$link_all_deplibs" != no; then
2359 # Add the search paths of all dependency libraries
2360 for deplib in $dependency_libs; do
2362 -L*) path="$deplib" ;;
2364 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2365 test "X$dir" = "X$deplib" && dir="."
2366 # We need an absolute path.
2368 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2370 absdir=`cd "$dir" && pwd`
2371 if test -z "$absdir"; then
2372 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2377 if grep "^installed=no" $deplib > /dev/null; then
2378 path="-L$absdir/$objdir"
2380 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2381 if test -z "$libdir"; then
2382 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2390 case " $deplibs " in
2392 *) deplibs="$deplibs $path" ;;
2395 fi # link_all_deplibs != no
2397 done # for deplib in $libs
2398 dependency_libs="$newdependency_libs"
2399 if test "$pass" = dlpreopen; then
2400 # Link the dlpreopened libraries before other libraries
2401 for deplib in $save_deplibs; do
2402 deplibs="$deplib $deplibs"
2405 if test "$pass" != dlopen; then
2406 if test "$pass" != conv; then
2407 # Make sure lib_search_path contains only unique directories.
2409 for dir in $newlib_search_path; do
2410 case "$lib_search_path " in
2412 *) lib_search_path="$lib_search_path $dir" ;;
2418 if test "$linkmode,$pass" != "prog,link"; then
2421 vars="compile_deplibs finalize_deplibs"
2423 for var in $vars dependency_libs; do
2424 # Add libraries to $var in reverse order
2425 eval tmp_libs=\"\$$var\"
2427 for deplib in $tmp_libs; do
2428 # FIXME: Pedantically, this is the right thing to do, so
2429 # that some nasty dependency loop isn't accidentally
2431 #new_libs="$deplib $new_libs"
2432 # Pragmatically, this seems to cause very few problems in
2435 -L*) new_libs="$deplib $new_libs" ;;
2437 # And here is the reason: when a library appears more
2438 # than once as an explicit dependence of a library, or
2439 # is implicitly linked in more than once by the
2440 # compiler, it is considered special, and multiple
2441 # occurrences thereof are not removed. Compare this
2442 # with having the same library being listed as a
2443 # dependency of multiple other libraries: in this case,
2444 # we know (pedantically, we assume) the library does not
2445 # need to be listed more than once, so we keep only the
2446 # last copy. This is not always right, but it is rare
2447 # enough that we require users that really mean to play
2448 # such unportable linking tricks to link the library
2449 # using -Wl,-lname, so that libtool does not consider it
2450 # for duplicate removal.
2451 case " $specialdeplibs " in
2452 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2454 case " $new_libs " in
2456 *) new_libs="$deplib $new_libs" ;;
2464 for deplib in $new_libs; do
2467 case " $tmp_libs " in
2469 *) tmp_libs="$tmp_libs $deplib" ;;
2473 temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2475 *" $temp_xrpath "*) ;;
2476 *) xrpath="$xrpath $temp_xrpath";;
2478 *) tmp_libs="$tmp_libs $deplib" ;;
2481 eval $var=\"$tmp_libs\"
2485 if test "$linkmode" = prog; then
2486 dlfiles="$newdlfiles"
2487 dlprefiles="$newdlprefiles"
2492 if test -n "$deplibs"; then
2493 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2496 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2497 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2500 if test -n "$rpath"; then
2501 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2504 if test -n "$xrpath"; then
2505 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2508 if test -n "$vinfo"; then
2509 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2512 if test -n "$release"; then
2513 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2516 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2517 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2520 # Now set the variables for building old libraries.
2521 build_libtool_libs=no
2523 objs="$objs$old_deplibs"
2527 # Make sure we only generate libraries of the form `libNAME.la'.
2530 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2531 eval libname=\"$libname_spec\"
2534 if test "$module" = no; then
2535 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2539 if test "$need_lib_prefix" != no; then
2540 # Add the "lib" prefix for modules if required
2541 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2542 eval libname=\"$libname_spec\"
2544 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2549 if test -n "$objs"; then
2550 if test "$deplibs_check_method" != pass_all; then
2551 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2555 echo "*** Warning: Linking the shared library $output against the non-libtool"
2556 echo "*** objects $objs is not portable!"
2557 libobjs="$libobjs $objs"
2561 if test "$dlself" != no; then
2562 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2566 if test "$#" -gt 2; then
2567 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2572 if test -z "$rpath"; then
2573 if test "$build_libtool_libs" = yes; then
2574 # Building a libtool convenience library.
2575 # Some compilers have problems with a `.al' extension so
2576 # convenience libraries should have the same extension an
2577 # archive normally would.
2578 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2579 build_libtool_libs=convenience
2583 if test -n "$vinfo"; then
2584 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2587 if test -n "$release"; then
2588 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2592 # Parse the version information argument.
2593 save_ifs="$IFS"; IFS=':'
2594 set dummy $vinfo 0 0 0
2597 if test -n "$8"; then
2598 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2607 # Check that each of the things are valid numbers.
2609 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2611 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2612 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2618 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2620 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2621 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2627 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2629 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2630 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2635 if test "$age" -gt "$current"; then
2636 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2637 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2641 # Calculate the version variables.
2645 case $version_type in
2649 # Like Linux, but with the current version available in
2650 # verstring for coding it into the library header
2651 major=.`expr $current - $age`
2652 versuffix="$major.$age.$revision"
2653 # Darwin ld doesn't like 0 for these options...
2654 minor_current=`expr $current + 1`
2655 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2660 versuffix=".$current.$revision";
2665 versuffix=".$current";
2669 case $version_type in
2670 nonstopux) verstring_prefix=nonstopux ;;
2671 *) verstring_prefix=sgi ;;
2673 verstring="$verstring_prefix$major.$revision"
2675 major=`expr $current - $age + 1`
2677 # Add in all the interfaces that we are compatible with.
2679 while test "$loop" -ne 0; do
2680 iface=`expr $revision - $loop`
2681 loop=`expr $loop - 1`
2682 verstring="$verstring_prefix$major.$iface:$verstring"
2685 # Before this point, $major must not contain `.'.
2687 versuffix="$major.$revision"
2691 major=.`expr $current - $age`
2692 versuffix="$major.$age.$revision"
2696 major=`expr $current - $age`
2697 versuffix=".$current.$age.$revision"
2698 verstring="$current.$age.$revision"
2700 # Add in all the interfaces that we are compatible with.
2702 while test "$loop" -ne 0; do
2703 iface=`expr $current - $loop`
2704 loop=`expr $loop - 1`
2705 verstring="$verstring:${iface}.0"
2708 # Make executables depend on our current version.
2709 verstring="$verstring:${current}.0"
2714 versuffix=".$current.$revision"
2718 # Use '-' rather than '.', since we only want one
2719 # extension on DOS 8.3 filesystems.
2720 major=`expr $current - $age`
2725 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2726 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2731 # Clear the version info if we defaulted, and they specified a release.
2732 if test -z "$vinfo" && test -n "$release"; then
2734 case $version_type in
2736 # we can't check for "0.0" in archive_cmds due to quoting
2737 # problems, so we reset it completely
2744 if test "$need_version" = no; then
2751 # Remove version info from name if versioning should be avoided
2752 if test "$avoid_version" = yes && test "$need_version" = no; then
2758 # Check to see if the archive will have undefined symbols.
2759 if test "$allow_undefined" = yes; then
2760 if test "$allow_undefined_flag" = unsupported; then
2761 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2762 build_libtool_libs=no
2766 # Don't allow undefined symbols.
2767 allow_undefined_flag="$no_undefined_flag"
2771 if test "$mode" != relink; then
2772 # Remove our outputs, but don't remove object files since they
2773 # may have been created when compiling PIC objects.
2775 tempremovelist=`echo "$output_objdir/*"`
2776 for p in $tempremovelist; do
2780 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
2781 removelist="$removelist $p"
2786 if test -n "$removelist"; then
2787 $show "${rm}r $removelist"
2788 $run ${rm}r $removelist
2792 # Now set the variables for building old libraries.
2793 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2794 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2796 # Transform .lo files to .o files.
2797 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2800 # Eliminate all temporary directories.
2801 for path in $notinst_path; do
2802 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
2803 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
2804 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
2807 if test -n "$xrpath"; then
2808 # If the user specified any rpath flags, then add them.
2810 for libdir in $xrpath; do
2811 temp_xrpath="$temp_xrpath -R$libdir"
2812 case "$finalize_rpath " in
2814 *) finalize_rpath="$finalize_rpath $libdir" ;;
2817 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2818 dependency_libs="$temp_xrpath $dependency_libs"
2822 # Make sure dlfiles contains only unique files that won't be dlpreopened
2823 old_dlfiles="$dlfiles"
2825 for lib in $old_dlfiles; do
2826 case " $dlprefiles $dlfiles " in
2828 *) dlfiles="$dlfiles $lib" ;;
2832 # Make sure dlprefiles contains only unique files
2833 old_dlprefiles="$dlprefiles"
2835 for lib in $old_dlprefiles; do
2836 case "$dlprefiles " in
2838 *) dlprefiles="$dlprefiles $lib" ;;
2842 if test "$build_libtool_libs" = yes; then
2843 if test -n "$rpath"; then
2845 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2846 # these systems don't actually have a c library (as such)!
2848 *-*-rhapsody* | *-*-darwin1.[012])
2849 # Rhapsody C library is in the System framework
2850 deplibs="$deplibs -framework System"
2853 # Don't link with libc until the a.out ld.so is fixed.
2855 *-*-openbsd* | *-*-freebsd*)
2856 # Do not include libc due to us having libc/libc_r.
2857 test "X$arg" = "X-lc" && continue
2860 # Add libc to deplibs on all other systems if necessary.
2861 if test "$build_libtool_need_lc" = "yes"; then
2862 deplibs="$deplibs -lc"
2868 # Transform deplibs into only deplibs that can be linked in shared.
2870 libname_save=$libname
2871 release_save=$release
2872 versuffix_save=$versuffix
2874 # I'm not sure if I'm treating the release correctly. I think
2875 # release should show up in the -l (ie -lgmp5) so we don't want to
2876 # add it in twice. Is that correct?
2882 case $deplibs_check_method in
2884 # Don't check for shared/static. Everything works.
2885 # This might be a little naive. We might want to check
2886 # whether the library exists or not. But this is on
2887 # osf3 & osf4 and I'm not really sure... Just
2888 # implementing what was already the behaviour.
2892 # This code stresses the "libraries are programs" paradigm to its
2893 # limits. Maybe even breaks it. We compile a program, linking it
2894 # against the deplibs as a proxy for the library. Then we can check
2895 # whether they linked in statically or dynamically with ldd.
2897 cat > conftest.c <<EOF
2898 int main() { return 0; }
2901 $LTCC -o conftest conftest.c $deplibs
2902 if test "$?" -eq 0 ; then
2903 ldd_output=`ldd conftest`
2904 for i in $deplibs; do
2905 name="`expr $i : '-l\(.*\)'`"
2906 # If $name is empty we are operating on a -L argument.
2907 if test "$name" != "" && test "$name" -ne "0"; then
2908 libname=`eval \\$echo \"$libname_spec\"`
2909 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2910 set dummy $deplib_matches
2912 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2913 newdeplibs="$newdeplibs $i"
2917 echo "*** Warning: dynamic linker does not accept needed library $i."
2918 echo "*** I have the capability to make that library automatically link in when"
2919 echo "*** you link to this library. But I can only do this if you have a"
2920 echo "*** shared version of the library, which I believe you do not have"
2921 echo "*** because a test_compile did reveal that the linker did not use it for"
2922 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2925 newdeplibs="$newdeplibs $i"
2929 # Error occured in the first compile. Let's try to salvage
2930 # the situation: Compile a separate program for each library.
2931 for i in $deplibs; do
2932 name="`expr $i : '-l\(.*\)'`"
2933 # If $name is empty we are operating on a -L argument.
2934 if test "$name" != "" && test "$name" != "0"; then
2936 $LTCC -o conftest conftest.c $i
2938 if test "$?" -eq 0 ; then
2939 ldd_output=`ldd conftest`
2940 libname=`eval \\$echo \"$libname_spec\"`
2941 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2942 set dummy $deplib_matches
2944 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2945 newdeplibs="$newdeplibs $i"
2949 echo "*** Warning: dynamic linker does not accept needed library $i."
2950 echo "*** I have the capability to make that library automatically link in when"
2951 echo "*** you link to this library. But I can only do this if you have a"
2952 echo "*** shared version of the library, which you do not appear to have"
2953 echo "*** because a test_compile did reveal that the linker did not use this one"
2954 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2959 echo "*** Warning! Library $i is needed by this library but I was not able to"
2960 echo "*** make it link in! You will probably need to install it or some"
2961 echo "*** library that it depends on before this library will be fully"
2962 echo "*** functional. Installing it before continuing would be even better."
2965 newdeplibs="$newdeplibs $i"
2971 set dummy $deplibs_check_method
2972 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2973 for a_deplib in $deplibs; do
2974 name="`expr $a_deplib : '-l\(.*\)'`"
2975 # If $name is empty we are operating on a -L argument.
2976 if test "$name" != "" && test "$name" != "0"; then
2977 libname=`eval \\$echo \"$libname_spec\"`
2978 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2979 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2980 for potent_lib in $potential_libs; do
2981 # Follow soft links.
2982 if ls -lLd "$potent_lib" 2>/dev/null \
2983 | grep " -> " >/dev/null; then
2986 # The statement above tries to avoid entering an
2987 # endless loop below, in case of cyclic links.
2988 # We might still enter an endless loop, since a link
2989 # loop can be closed while we follow links,
2991 potlib="$potent_lib"
2992 while test -h "$potlib" 2>/dev/null; do
2993 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
2995 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2996 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2999 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3001 | egrep "$file_magic_regex" > /dev/null; then
3002 newdeplibs="$newdeplibs $a_deplib"
3008 if test -n "$a_deplib" ; then
3011 echo "*** Warning: linker path does not have real file for library $a_deplib."
3012 echo "*** I have the capability to make that library automatically link in when"
3013 echo "*** you link to this library. But I can only do this if you have a"
3014 echo "*** shared version of the library, which you do not appear to have"
3015 echo "*** because I did check the linker path looking for a file starting"
3016 if test -z "$potlib" ; then
3017 echo "*** with $libname but no candidates were found. (...for file magic test)"
3019 echo "*** with $libname and none of the candidates passed a file format test"
3020 echo "*** using a file magic. Last file checked: $potlib"
3024 # Add a -L argument.
3025 newdeplibs="$newdeplibs $a_deplib"
3027 done # Gone through all deplibs.
3030 set dummy $deplibs_check_method
3031 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3032 for a_deplib in $deplibs; do
3033 name="`expr $a_deplib : '-l\(.*\)'`"
3034 # If $name is empty we are operating on a -L argument.
3035 if test -n "$name" && test "$name" != "0"; then
3036 libname=`eval \\$echo \"$libname_spec\"`
3037 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3038 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3039 for potent_lib in $potential_libs; do
3040 potlib="$potent_lib" # see symlink-check above in file_magic test
3041 if eval echo \"$potent_lib\" 2>/dev/null \
3043 | egrep "$match_pattern_regex" > /dev/null; then
3044 newdeplibs="$newdeplibs $a_deplib"
3050 if test -n "$a_deplib" ; then
3053 echo "*** Warning: linker path does not have real file for library $a_deplib."
3054 echo "*** I have the capability to make that library automatically link in when"
3055 echo "*** you link to this library. But I can only do this if you have a"
3056 echo "*** shared version of the library, which you do not appear to have"
3057 echo "*** because I did check the linker path looking for a file starting"
3058 if test -z "$potlib" ; then
3059 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3061 echo "*** with $libname and none of the candidates passed a file format test"
3062 echo "*** using a regex pattern. Last file checked: $potlib"
3066 # Add a -L argument.
3067 newdeplibs="$newdeplibs $a_deplib"
3069 done # Gone through all deplibs.
3073 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3074 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3075 grep . >/dev/null; then
3077 if test "X$deplibs_check_method" = "Xnone"; then
3078 echo "*** Warning: inter-library dependencies are not supported in this platform."
3080 echo "*** Warning: inter-library dependencies are not known to be supported."
3082 echo "*** All declared inter-library dependencies are being dropped."
3087 versuffix=$versuffix_save
3089 release=$release_save
3090 libname=$libname_save
3094 *-*-rhapsody* | *-*-darwin1.[012])
3095 # On Rhapsody replace the C library is the System framework
3096 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3100 if test "$droppeddeps" = yes; then
3101 if test "$module" = yes; then
3103 echo "*** Warning: libtool could not satisfy all declared inter-library"
3104 echo "*** dependencies of module $libname. Therefore, libtool will create"
3105 echo "*** a static module, that should work as long as the dlopening"
3106 echo "*** application is linked with the -dlopen flag."
3107 if test -z "$global_symbol_pipe"; then
3109 echo "*** However, this would only work if libtool was able to extract symbol"
3110 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3111 echo "*** not find such a program. So, this module is probably useless."
3112 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3114 if test "$build_old_libs" = no; then
3115 oldlibs="$output_objdir/$libname.$libext"
3116 build_libtool_libs=module
3119 build_libtool_libs=no
3122 echo "*** The inter-library dependencies that have been dropped here will be"
3123 echo "*** automatically added whenever a program is linked with this library"
3124 echo "*** or is declared to -dlopen it."
3126 if test "$allow_undefined" = no; then
3128 echo "*** Since this library must not contain undefined symbols,"
3129 echo "*** because either the platform does not support them or"
3130 echo "*** it was explicitly requested with -no-undefined,"
3131 echo "*** libtool will only create a static version of it."
3132 if test "$build_old_libs" = no; then
3133 oldlibs="$output_objdir/$libname.$libext"
3134 build_libtool_libs=module
3137 build_libtool_libs=no
3142 # Done checking deplibs!
3146 # All the library-specific variables (install_libdir is set above).
3151 # Test again, we may have decided not to build it any more
3152 if test "$build_libtool_libs" = yes; then
3153 if test "$hardcode_into_libs" = yes; then
3154 # Hardcode the library paths
3157 rpath="$finalize_rpath"
3158 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
3159 for libdir in $rpath; do
3160 if test -n "$hardcode_libdir_flag_spec"; then
3161 if test -n "$hardcode_libdir_separator"; then
3162 if test -z "$hardcode_libdirs"; then
3163 hardcode_libdirs="$libdir"
3165 # Just accumulate the unique libdirs.
3166 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3167 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3170 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3175 eval flag=\"$hardcode_libdir_flag_spec\"
3176 dep_rpath="$dep_rpath $flag"
3178 elif test -n "$runpath_var"; then
3179 case "$perm_rpath " in
3181 *) perm_rpath="$perm_rpath $libdir" ;;
3185 # Substitute the hardcoded libdirs into the rpath.
3186 if test -n "$hardcode_libdir_separator" &&
3187 test -n "$hardcode_libdirs"; then
3188 libdir="$hardcode_libdirs"
3189 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3191 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3192 # We should set the runpath_var.
3194 for dir in $perm_rpath; do
3197 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3199 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3202 shlibpath="$finalize_shlibpath"
3203 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3204 if test -n "$shlibpath"; then
3205 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3208 # Get the real and link names of the library.
3209 eval library_names=\"$library_names_spec\"
3210 set dummy $library_names
3214 if test -n "$soname_spec"; then
3215 eval soname=\"$soname_spec\"
3219 if test -z "$dlname"; then
3223 lib="$output_objdir/$realname"
3226 linknames="$linknames $link"
3229 # Use standard objects if they are pic
3230 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3232 # Prepare the list of exported symbols
3233 if test -z "$export_symbols"; then
3234 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3235 $show "generating symbol list for \`$libname.la'"
3236 export_symbols="$output_objdir/$libname.exp"
3237 $run $rm $export_symbols
3238 eval cmds=\"$export_symbols_cmds\"
3239 save_ifs="$IFS"; IFS='~'
3240 for cmd in $cmds; do
3243 $run eval "$cmd" || exit $?
3246 if test -n "$export_symbols_regex"; then
3247 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3248 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3249 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3250 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3255 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3256 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3259 if test -n "$convenience"; then
3260 if test -n "$whole_archive_flag_spec"; then
3261 save_libobjs=$libobjs
3262 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3264 gentop="$output_objdir/${outputname}x"
3265 $show "${rm}r $gentop"
3266 $run ${rm}r "$gentop"
3267 $show "$mkdir $gentop"
3268 $run $mkdir "$gentop"
3270 if test "$status" -ne 0 && test ! -d "$gentop"; then
3273 generated="$generated $gentop"
3275 for xlib in $convenience; do
3276 # Extract the objects.
3278 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3279 *) xabs=`pwd`"/$xlib" ;;
3281 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3282 xdir="$gentop/$xlib"
3284 $show "${rm}r $xdir"
3286 $show "$mkdir $xdir"
3289 if test "$status" -ne 0 && test ! -d "$xdir"; then
3292 $show "(cd $xdir && $AR x $xabs)"
3293 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3295 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3300 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3301 eval flag=\"$thread_safe_flag_spec\"
3302 linker_flags="$linker_flags $flag"
3305 # Make a backup of the uninstalled library when relinking
3306 if test "$mode" = relink; then
3307 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3310 # Add all flags from the command line. We here create a library,
3311 # but those flags were only added to compile_command and
3312 # finalize_command, which are only used when creating executables.
3313 # So do it by hand here.
3314 compiler_flags="$compiler_flags $add_flags"
3315 # Only add it to commands which use CC, instead of LD, i.e.
3316 # only to $compiler_flags
3317 #linker_flags="$linker_flags $add_flags"
3319 # Do each of the archive commands.
3320 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3321 eval cmds=\"$archive_expsym_cmds\"
3323 eval cmds=\"$archive_cmds\"
3326 if len=`expr "X$cmds" : ".*"` &&
3327 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3330 # The command line is too long to link in one step, link piecewise.
3331 $echo "creating reloadable object files..."
3333 # Save the value of $output and $libobjs because we want to
3334 # use them later. If we have whole_archive_flag_spec, we
3335 # want to use save_libobjs as it was before
3336 # whole_archive_flag_spec was expanded, because we can't
3337 # assume the linker understands whole_archive_flag_spec.
3338 # This may have to be revisited, in case too many
3339 # convenience libraries get linked in and end up exceeding
3341 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3342 save_libobjs=$libobjs
3346 # Clear the reloadable object creation command queue and
3347 # initialize k to one.
3354 output=$output_objdir/$save_output-${k}.$objext
3355 # Loop over the list of objects to be linked.
3356 for obj in $save_libobjs
3358 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3359 if test "X$objlist" = X ||
3360 { len=`expr "X$test_cmds" : ".*"` &&
3361 test "$len" -le "$max_cmd_len"; }; then
3362 objlist="$objlist $obj"
3364 # The command $test_cmds is almost too long, add a
3365 # command to the queue.
3366 if test "$k" -eq 1 ; then
3367 # The first file doesn't have a previous command to add.
3368 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3370 # All subsequent reloadable object files will link in
3371 # the last one created.
3372 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3374 last_robj=$output_objdir/$save_output-${k}.$objext
3376 output=$output_objdir/$save_output-${k}.$objext
3381 # Handle the remaining objects by creating one last
3382 # reloadable object file. All subsequent reloadable object
3383 # files will link in the last one created.
3384 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3385 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3387 # Set up a command to remove the reloadale object files
3388 # after they are used.
3390 while test "$i" -lt "$k"
3393 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3396 $echo "creating a temporary reloadable object file: $output"
3398 # Loop through the commands generated above and execute them.
3399 save_ifs="$IFS"; IFS='~'
3400 for cmd in $concat_cmds; do
3403 $run eval "$cmd" || exit $?
3408 # Restore the value of output.
3411 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3412 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3414 # Expand the library linking commands again to reset the
3415 # value of $libobjs for piecewise linking.
3417 # Do each of the archive commands.
3418 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3419 eval cmds=\"$archive_expsym_cmds\"
3421 eval cmds=\"$archive_cmds\"
3424 # Append the command to remove the reloadable object files
3425 # to the just-reset $cmds.
3426 eval cmds=\"\$cmds~$rm $delfiles\"
3428 save_ifs="$IFS"; IFS='~'
3429 for cmd in $cmds; do
3432 $run eval "$cmd" || exit $?
3436 # Restore the uninstalled library and exit
3437 if test "$mode" = relink; then
3438 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3442 # Create links to the real library.
3443 for linkname in $linknames; do
3444 if test "$realname" != "$linkname"; then
3445 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3446 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3450 # If -module or -export-dynamic was specified, set the dlname.
3451 if test "$module" = yes || test "$export_dynamic" = yes; then
3452 # On all known operating systems, these are identical.
3459 if test -n "$deplibs"; then
3460 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3463 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3464 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3467 if test -n "$rpath"; then
3468 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3471 if test -n "$xrpath"; then
3472 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3475 if test -n "$vinfo"; then
3476 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3479 if test -n "$release"; then
3480 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3485 if test -n "$objs$old_deplibs"; then
3486 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3490 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3498 # Delete the old objects.
3499 $run $rm $obj $libobj
3501 # Objects from convenience libraries. This assumes
3502 # single-version convenience libraries. Whenever we create
3503 # different ones for PIC/non-PIC, this we'll have to duplicate
3507 # reload_cmds runs $LD directly, so let us get rid of
3508 # -Wl from whole_archive_flag_spec
3511 if test -n "$convenience"; then
3512 if test -n "$whole_archive_flag_spec"; then
3513 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3515 gentop="$output_objdir/${obj}x"
3516 $show "${rm}r $gentop"
3517 $run ${rm}r "$gentop"
3518 $show "$mkdir $gentop"
3519 $run $mkdir "$gentop"
3521 if test "$status" -ne 0 && test ! -d "$gentop"; then
3524 generated="$generated $gentop"
3526 for xlib in $convenience; do
3527 # Extract the objects.
3529 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3530 *) xabs=`pwd`"/$xlib" ;;
3532 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3533 xdir="$gentop/$xlib"
3535 $show "${rm}r $xdir"
3537 $show "$mkdir $xdir"
3540 if test "$status" -ne 0 && test ! -d "$xdir"; then
3543 $show "(cd $xdir && $AR x $xabs)"
3544 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3546 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3551 # Create the old-style object.
3552 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
3555 eval cmds=\"$reload_cmds\"
3556 save_ifs="$IFS"; IFS='~'
3557 for cmd in $cmds; do
3560 $run eval "$cmd" || exit $?
3564 # Exit if we aren't doing a library object file.
3565 if test -z "$libobj"; then
3566 if test -n "$gentop"; then
3567 $show "${rm}r $gentop"
3574 if test "$build_libtool_libs" != yes; then
3575 if test -n "$gentop"; then
3576 $show "${rm}r $gentop"
3580 # Create an invalid libtool object if no PIC, so that we don't
3581 # accidentally link it into a program.
3582 # $show "echo timestamp > $libobj"
3583 # $run eval "echo timestamp > $libobj" || exit $?
3587 if test -n "$pic_flag" || test "$pic_mode" != default; then
3588 # Only do commands if we really have different PIC objects.
3589 reload_objs="$libobjs $reload_conv_objs"
3591 eval cmds=\"$reload_cmds\"
3592 save_ifs="$IFS"; IFS='~'
3593 for cmd in $cmds; do
3596 $run eval "$cmd" || exit $?
3601 if test -n "$gentop"; then
3602 $show "${rm}r $gentop"
3611 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3613 if test -n "$vinfo"; then
3614 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3617 if test -n "$release"; then
3618 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3621 if test "$preload" = yes; then
3622 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3623 test "$dlopen_self_static" = unknown; then
3624 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3629 *-*-rhapsody* | *-*-darwin1.[012])
3630 # On Rhapsody replace the C library is the System framework
3631 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3632 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3636 compile_command="$compile_command $compile_deplibs"
3637 finalize_command="$finalize_command $finalize_deplibs"
3639 if test -n "$rpath$xrpath"; then
3640 # If the user specified any rpath flags, then add them.
3641 for libdir in $rpath $xrpath; do
3642 # This is the magic to use -rpath.
3643 case "$finalize_rpath " in
3645 *) finalize_rpath="$finalize_rpath $libdir" ;;
3650 # Now hardcode the library paths
3653 for libdir in $compile_rpath $finalize_rpath; do
3654 if test -n "$hardcode_libdir_flag_spec"; then
3655 if test -n "$hardcode_libdir_separator"; then
3656 if test -z "$hardcode_libdirs"; then
3657 hardcode_libdirs="$libdir"
3659 # Just accumulate the unique libdirs.
3660 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3661 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3664 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3669 eval flag=\"$hardcode_libdir_flag_spec\"
3670 rpath="$rpath $flag"
3672 elif test -n "$runpath_var"; then
3673 case "$perm_rpath " in
3675 *) perm_rpath="$perm_rpath $libdir" ;;
3679 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3680 case :$dllsearchpath: in
3682 *) dllsearchpath="$dllsearchpath:$libdir";;
3687 # Substitute the hardcoded libdirs into the rpath.
3688 if test -n "$hardcode_libdir_separator" &&
3689 test -n "$hardcode_libdirs"; then
3690 libdir="$hardcode_libdirs"
3691 eval rpath=\" $hardcode_libdir_flag_spec\"
3693 compile_rpath="$rpath"
3697 for libdir in $finalize_rpath; do
3698 if test -n "$hardcode_libdir_flag_spec"; then
3699 if test -n "$hardcode_libdir_separator"; then
3700 if test -z "$hardcode_libdirs"; then
3701 hardcode_libdirs="$libdir"
3703 # Just accumulate the unique libdirs.
3704 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3705 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3708 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3713 eval flag=\"$hardcode_libdir_flag_spec\"
3714 rpath="$rpath $flag"
3716 elif test -n "$runpath_var"; then
3717 case "$finalize_perm_rpath " in
3719 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3723 # Substitute the hardcoded libdirs into the rpath.
3724 if test -n "$hardcode_libdir_separator" &&
3725 test -n "$hardcode_libdirs"; then
3726 libdir="$hardcode_libdirs"
3727 eval rpath=\" $hardcode_libdir_flag_spec\"
3729 finalize_rpath="$rpath"
3731 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3732 # Transform all the library objects into standard objects.
3733 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3734 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3738 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3739 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3740 dlsyms="${outputname}S.c"
3742 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3746 if test -n "$dlsyms"; then
3750 # Discover the nlist of each of the dlfiles.
3751 nlist="$output_objdir/${outputname}.nm"
3753 $show "$rm $nlist ${nlist}S ${nlist}T"
3754 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3756 # Parse the name list into a source file.
3757 $show "creating $output_objdir/$dlsyms"
3759 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3760 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3761 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3767 /* Prevent the only kind of declaration conflicts we can make. */
3768 #define lt_preloaded_symbols some_other_symbol
3770 /* External symbol declarations for the compiler. */\
3773 if test "$dlself" = yes; then
3774 $show "generating symbol list for \`$output'"
3776 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3778 # Add our own program objects to the symbol list.
3779 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3780 for arg in $progfiles; do
3781 $show "extracting global C symbols from \`$arg'"
3782 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3785 if test -n "$exclude_expsyms"; then
3786 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3787 $run eval '$mv "$nlist"T "$nlist"'
3790 if test -n "$export_symbols_regex"; then
3791 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3792 $run eval '$mv "$nlist"T "$nlist"'
3795 # Prepare the list of exported symbols
3796 if test -z "$export_symbols"; then
3797 export_symbols="$output_objdir/$output.exp"
3798 $run $rm $export_symbols
3799 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3801 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3802 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3803 $run eval 'mv "$nlist"T "$nlist"'
3807 for arg in $dlprefiles; do
3808 $show "extracting global C symbols from \`$arg'"
3809 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
3810 $run eval 'echo ": $name " >> "$nlist"'
3811 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3814 if test -z "$run"; then
3815 # Make sure we have at least an empty file.
3816 test -f "$nlist" || : > "$nlist"
3818 if test -n "$exclude_expsyms"; then
3819 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3820 $mv "$nlist"T "$nlist"
3823 # Try sorting and uniquifying the output.
3824 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3827 grep -v "^: " < "$nlist" > "$nlist"S
3830 if test -f "$nlist"S; then
3831 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3833 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3836 $echo >> "$output_objdir/$dlsyms" "\
3838 #undef lt_preloaded_symbols
3840 #if defined (__STDC__) && __STDC__
3841 # define lt_ptr void *
3843 # define lt_ptr char *
3847 /* The mapping between symbol names and symbols. */
3852 lt_preloaded_symbols[] =
3856 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3858 $echo >> "$output_objdir/$dlsyms" "\
3862 /* This works around a problem in FreeBSD linker */
3863 #ifdef FREEBSD_WORKAROUND
3864 static const void *lt_preloaded_setup() {
3865 return lt_preloaded_symbols;
3875 pic_flag_for_symtable=
3877 # compiling the symbol table file with pic_flag works around
3878 # a FreeBSD bug that causes programs to crash when -lm is
3879 # linked before any other PIC object. But we must not use
3880 # pic_flag when linking with -static. The problem exists in
3881 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3882 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3883 case "$compile_command " in
3885 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3888 case "$compile_command " in
3890 *) pic_flag_for_symtable=" $pic_flag";;
3894 # Now compile the dynamic symbol file.
3895 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3896 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3898 # Clean up the generated files.
3899 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3900 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3902 # Transform the symbol file into the correct name.
3903 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3904 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3907 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3912 # We keep going just in case the user didn't refer to
3913 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3914 # really was required.
3916 # Nullify the symbol file.
3917 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3918 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3921 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
3922 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
3923 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
3924 # This does not apply on AIX for ia64, which uses a SysV linker.
3927 *-*-aix4* | *-*-aix5*)
3928 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
3929 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
3932 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3933 # Replace the output file specification.
3934 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3935 link_command="$compile_command$compile_rpath"
3937 # We have no uninstalled library dependencies, so finalize right now.
3938 $show "$link_command"
3939 $run eval "$link_command"
3942 # Delete the generated files.
3943 if test -n "$dlsyms"; then
3944 $show "$rm $output_objdir/${outputname}S.${objext}"
3945 $run $rm "$output_objdir/${outputname}S.${objext}"
3951 if test -n "$shlibpath_var"; then
3952 # We should set the shlibpath_var
3954 for dir in $temp_rpath; do
3956 [\\/]* | [A-Za-z]:[\\/]*)
3961 # Relative path: add a thisdir entry.
3962 rpath="$rpath\$thisdir/$dir:"
3969 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3970 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3972 if test -n "$finalize_shlibpath"; then
3973 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3978 if test -n "$runpath_var"; then
3979 if test -n "$perm_rpath"; then
3980 # We should set the runpath_var.
3982 for dir in $perm_rpath; do
3985 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3987 if test -n "$finalize_perm_rpath"; then
3988 # We should set the runpath_var.
3990 for dir in $finalize_perm_rpath; do
3993 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3997 if test "$no_install" = yes; then
3998 # We don't need to create a wrapper script.
3999 link_command="$compile_var$compile_command$compile_rpath"
4000 # Replace the output file specification.
4001 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4002 # Delete the old output file.
4004 # Link the executable and exit
4005 $show "$link_command"
4006 $run eval "$link_command" || exit $?
4010 if test "$hardcode_action" = relink; then
4011 # Fast installation is not supported
4012 link_command="$compile_var$compile_command$compile_rpath"
4013 relink_command="$finalize_var$finalize_command$finalize_rpath"
4015 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4016 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4018 if test "$fast_install" != no; then
4019 link_command="$finalize_var$compile_command$finalize_rpath"
4020 if test "$fast_install" = yes; then
4021 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4023 # fast_install is set to needless
4027 link_command="$compile_var$compile_command$compile_rpath"
4028 relink_command="$finalize_var$finalize_command$finalize_rpath"
4032 # Replace the output file specification.
4033 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4035 # Delete the old output files.
4036 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4038 $show "$link_command"
4039 $run eval "$link_command" || exit $?
4041 # Now create the wrapper script.
4042 $show "creating $output"
4044 # Quote the relink command for shipping.
4045 if test -n "$relink_command"; then
4046 # Preserve any variables that may affect compiler behavior
4047 for var in $variables_saved_for_relink; do
4048 if eval test -z \"\${$var+set}\"; then
4049 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4050 elif eval var_value=\$$var; test -z "$var_value"; then
4051 relink_command="$var=; export $var; $relink_command"
4053 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4054 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4057 relink_command="(cd `pwd`; $relink_command)"
4058 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4061 # Quote $echo for shipping.
4062 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4064 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4065 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4067 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4069 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4072 # Only actually do things if our run command is non-null.
4073 if test -z "$run"; then
4074 # win32 will think the script is a binary if it has
4075 # a .exe suffix, so we strip it off here.
4077 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4079 # test for cygwin because mv fails w/o .exe extensions
4081 *cygwin*) exeext=.exe ;;
4085 trap "$rm $output; exit 1" 1 2 15
4090 # $output - temporary wrapper script for $objdir/$outputname
4091 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4093 # The $output program cannot be directly executed until all the libtool
4094 # libraries that it depends on are installed.
4096 # This wrapper script should never be moved out of the build directory.
4097 # If it is, it will not operate correctly.
4099 # Sed substitution that helps us do robust quoting. It backslashifies
4100 # metacharacters that are still active within double-quoted strings.
4101 Xsed='${SED} -e 1s/^X//'
4102 sed_quote_subst='$sed_quote_subst'
4104 # The HP-UX ksh and POSIX shell print the target directory to stdout
4106 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4108 relink_command=\"$relink_command\"
4110 # This environment variable determines our operation mode.
4111 if test \"\$libtool_install_magic\" = \"$magic\"; then
4112 # install mode needs the following variable:
4113 notinst_deplibs='$notinst_deplibs'
4115 # When we are sourced in execute mode, \$file and \$echo are already set.
4116 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4119 # Make sure echo works.
4120 if test \"X\$1\" = X--no-reexec; then
4121 # Discard the --no-reexec flag, and continue.
4123 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4124 # Yippee, \$echo works!
4127 # Restart under the correct shell, and then maybe \$echo will work.
4128 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4134 # Find the directory that this script lives in.
4135 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4136 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4138 # Follow symbolic links until we get to the real thisdir.
4139 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4140 while test -n \"\$file\"; do
4141 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4143 # If there was a directory component, then change thisdir.
4144 if test \"x\$destdir\" != \"x\$file\"; then
4145 case \"\$destdir\" in
4146 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4147 *) thisdir=\"\$thisdir/\$destdir\" ;;
4151 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4152 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4155 # Try to get the absolute directory name.
4156 absdir=\`cd \"\$thisdir\" && pwd\`
4157 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4160 if test "$fast_install" = yes; then
4162 program=lt-'$outputname'$exeext
4163 progdir=\"\$thisdir/$objdir\"
4165 if test ! -f \"\$progdir/\$program\" || \\
4166 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4167 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4169 file=\"\$\$-\$program\"
4171 if test ! -d \"\$progdir\"; then
4172 $mkdir \"\$progdir\"
4174 $rm \"\$progdir/\$file\"
4179 # relink executable if necessary
4180 if test -n \"\$relink_command\"; then
4181 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4183 $echo \"\$relink_command_output\" >&2
4184 $rm \"\$progdir/\$file\"
4189 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4190 { $rm \"\$progdir/\$program\";
4191 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4192 $rm \"\$progdir/\$file\"
4196 program='$outputname'
4197 progdir=\"\$thisdir/$objdir\"
4203 if test -f \"\$progdir/\$program\"; then"
4205 # Export our shlibpath_var if we have one.
4206 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4208 # Add our own library path to $shlibpath_var
4209 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4211 # Some systems cannot cope with colon-terminated $shlibpath_var
4212 # The second colon is a workaround for a bug in BeOS R4 sed
4213 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4215 export $shlibpath_var
4219 # fixup the dll searchpath if we need to.
4220 if test -n "$dllsearchpath"; then
4222 # Add the dll search path components to the executable PATH
4223 PATH=$dllsearchpath:\$PATH
4228 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4229 # Run the actual program with our arguments.
4232 # win32 systems need to use the prog path for dll
4234 *-*-cygwin* | *-*-pw32*)
4236 exec \$progdir/\$program \${1+\"\$@\"}
4240 # Backslashes separate directories on plain windows
4241 *-*-mingw | *-*-os2*)
4243 exec \$progdir\\\\\$program \${1+\"\$@\"}
4249 # Export the path to the program.
4250 PATH=\"\$progdir:\$PATH\"
4253 exec \$program \${1+\"\$@\"}
4258 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4262 # The program doesn't exist.
4263 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4264 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4265 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4276 # See if we need to build an old-fashioned archive.
4277 for oldlib in $oldlibs; do
4279 if test "$build_libtool_libs" = convenience; then
4280 oldobjs="$libobjs_save"
4281 addlibs="$convenience"
4282 build_libtool_libs=no
4284 if test "$build_libtool_libs" = module; then
4285 oldobjs="$libobjs_save"
4286 build_libtool_libs=no
4288 #oldobjs="$oldobjs$old_deplibs $non_pic_objects"
4289 oldobjs="$old_deplibs $non_pic_objects"
4291 addlibs="$old_convenience"
4294 if test -n "$addlibs"; then
4295 gentop="$output_objdir/${outputname}x"
4296 $show "${rm}r $gentop"
4297 $run ${rm}r "$gentop"
4298 $show "$mkdir $gentop"
4299 $run $mkdir "$gentop"
4301 if test "$status" -ne 0 && test ! -d "$gentop"; then
4304 generated="$generated $gentop"
4306 # Add in members from convenience archives.
4307 for xlib in $addlibs; do
4308 # Extract the objects.
4310 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4311 *) xabs=`pwd`"/$xlib" ;;
4313 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4314 xdir="$gentop/$xlib"
4316 $show "${rm}r $xdir"
4318 $show "$mkdir $xdir"
4321 if test "$status" -ne 0 && test ! -d "$xdir"; then
4324 $show "(cd $xdir && $AR x $xabs)"
4325 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4327 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4331 compiler_flags="$compiler_flags $add_flags"
4333 # Do each command in the archive commands.
4334 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4335 eval cmds=\"$old_archive_from_new_cmds\"
4337 eval cmds=\"$old_archive_cmds\"
4339 if len=`expr "X$cmds" : ".*"` &&
4340 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4343 # the command line is too long to link in one step, link in parts
4344 $echo "using piecewise archive linking..."
4349 save_oldobjs=$oldobjs
4350 for obj in $save_oldobjs
4352 oldobjs="$objlist $obj"
4353 objlist="$objlist $obj"
4354 eval test_cmds=\"$old_archive_cmds\"
4355 if len=`expr "X$test_cmds" : ".*"` &&
4356 test "$len" -le "$max_cmd_len"; then
4359 # the above command should be used before it gets too long
4361 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4362 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4368 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4371 save_ifs="$IFS"; IFS='~'
4372 for cmd in $cmds; do
4375 $run eval "$cmd" || exit $?
4380 if test -n "$generated"; then
4381 $show "${rm}r$generated"
4382 $run ${rm}r$generated
4385 # Now create the libtool archive.
4389 test "$build_old_libs" = yes && old_library="$libname.$libext"
4390 $show "creating $output"
4392 # Preserve any variables that may affect compiler behavior
4393 for var in $variables_saved_for_relink; do
4394 if eval test -z \"\${$var+set}\"; then
4395 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4396 elif eval var_value=\$$var; test -z "$var_value"; then
4397 relink_command="$var=; export $var; $relink_command"
4399 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4400 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4403 # Quote the link command for shipping.
4404 relink_command="($relink_command; cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4405 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4407 # Only create the output if not a dry run.
4408 if test -z "$run"; then
4409 for installed in no yes; do
4410 if test "$installed" = yes; then
4411 if test -z "$install_libdir"; then
4414 output="$output_objdir/$outputname"i
4415 # Replace all uninstalled libtool libraries with the installed ones
4417 for deplib in $dependency_libs; do
4420 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4421 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4422 if test -z "$libdir"; then
4423 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4426 newdependency_libs="$newdependency_libs $libdir/$name"
4428 *) newdependency_libs="$newdependency_libs $deplib" ;;
4431 dependency_libs="$newdependency_libs"
4433 for lib in $dlfiles; do
4434 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4435 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4436 if test -z "$libdir"; then
4437 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4440 newdlfiles="$newdlfiles $libdir/$name"
4442 dlfiles="$newdlfiles"
4444 for lib in $dlprefiles; do
4445 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4446 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4447 if test -z "$libdir"; then
4448 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4451 newdlprefiles="$newdlprefiles $libdir/$name"
4453 dlprefiles="$newdlprefiles"
4456 # place dlname in correct position for cygwin
4458 case $host,$output,$installed,$module,$dlname in
4459 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4462 # $outputname - a libtool library file
4463 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4465 # Please DO NOT delete this file!
4466 # It is necessary for linking the library.
4468 # The name that we can dlopen(3).
4471 # Names of this library.
4472 library_names='$library_names'
4474 # The name of the static archive.
4475 old_library='$old_library'
4477 # Libraries that this one depends upon.
4478 dependency_libs='$dependency_libs'
4480 # Version information for $libname.
4485 # Is this an already installed library?
4486 installed=$installed
4488 # Files to dlopen/dlpreopen
4490 dlpreopen='$dlprefiles'
4492 # Directory that this library needs to be installed in:
4493 libdir='$install_libdir'"
4494 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
4496 relink_command=\"$relink_command\""
4501 # Do a symbolic link so that the libtool archive can be found in
4502 # LD_LIBRARY_PATH before the program is installed.
4503 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4504 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4510 # libtool install mode
4512 modename="$modename: install"
4514 # There may be an optional sh(1) argument at the beginning of
4515 # install_prog (especially on Windows NT).
4516 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4517 # Allow the use of GNU shtool's install command.
4518 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4519 # Aesthetically quote it.
4520 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4522 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4526 install_prog="$arg "
4534 # The real first argument should be the name of the installation program.
4535 # Aesthetically quote it.
4536 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4538 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4542 install_prog="$install_prog$arg"
4544 # We need to accept at least all the BSD install flags.
4554 if test -n "$dest"; then
4555 files="$files $dest"
4573 # If the previous option needed an argument, then skip it.
4574 if test -n "$prev"; then
4583 # Aesthetically quote the argument.
4584 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4586 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4590 install_prog="$install_prog $arg"
4593 if test -z "$install_prog"; then
4594 $echo "$modename: you must specify an install program" 1>&2
4599 if test -n "$prev"; then
4600 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4605 if test -z "$files"; then
4606 if test -z "$dest"; then
4607 $echo "$modename: no file or destination specified" 1>&2
4609 $echo "$modename: you must specify a destination" 1>&2
4615 # Strip any trailing slash from the destination.
4616 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4618 # Check to see that the destination is a directory.
4619 test -d "$dest" && isdir=yes
4620 if test "$isdir" = yes; then
4624 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4625 test "X$destdir" = "X$dest" && destdir=.
4626 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4628 # Not a directory, so check to see that there is only one file specified.
4630 if test "$#" -gt 2; then
4631 $echo "$modename: \`$dest' is not a directory" 1>&2
4637 [\\/]* | [A-Za-z]:[\\/]*) ;;
4639 for file in $files; do
4643 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4652 # This variable tells wrapper scripts just to set variables rather
4653 # than running their programs.
4654 libtool_install_magic="$magic"
4659 for file in $files; do
4661 # Do each installation.
4664 # Do the static libraries later.
4665 staticlibs="$staticlibs $file"
4669 # Check to see that this really is a libtool archive.
4670 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4672 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4680 # If there is no directory component, then add one.
4682 */* | *\\*) . $file ;;
4686 # Add the libdir to current_libdirs if it is the destination.
4687 if test "X$destdir" = "X$libdir"; then
4688 case "$current_libdirs " in
4690 *) current_libdirs="$current_libdirs $libdir" ;;
4693 # Note the libdir as a future libdir.
4694 case "$future_libdirs " in
4696 *) future_libdirs="$future_libdirs $libdir" ;;
4700 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4701 test "X$dir" = "X$file/" && dir=
4704 if test -n "$relink_command"; then
4705 $echo "$modename: warning: relinking \`$file'" 1>&2
4706 $show "$relink_command"
4707 if $run eval "$relink_command"; then :
4709 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4714 # See the names of the shared library.
4715 set dummy $library_names
4716 if test -n "$2"; then
4722 test -n "$relink_command" && srcname="$realname"T
4724 # Install the shared library and build the symlinks.
4725 $show "$install_prog $dir/$srcname $destdir/$realname"
4726 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4727 if test -n "$stripme" && test -n "$striplib"; then
4728 $show "$striplib $destdir/$realname"
4729 $run eval "$striplib $destdir/$realname" || exit $?
4732 if test "$#" -gt 0; then
4733 # Delete the old symlinks, and create new ones.
4736 if test "$linkname" != "$realname"; then
4737 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4738 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4743 # Do each command in the postinstall commands.
4744 lib="$destdir/$realname"
4745 eval cmds=\"$postinstall_cmds\"
4746 save_ifs="$IFS"; IFS='~'
4747 for cmd in $cmds; do
4750 $run eval "$cmd" || exit $?
4755 # Install the pseudo-library for information purposes.
4756 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4757 instname="$dir/$name"i
4758 $show "$install_prog $instname $destdir/$name"
4759 $run eval "$install_prog $instname $destdir/$name" || exit $?
4761 # Maybe install the static library, too.
4762 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4766 # Install (i.e. copy) a libtool object.
4768 # Figure out destination file name, if it wasn't already specified.
4769 if test -n "$destname"; then
4770 destfile="$destdir/$destname"
4772 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4773 destfile="$destdir/$destfile"
4776 # Deduce the name of the destination old-style object file.
4779 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4782 staticdest="$destfile"
4786 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4792 # Install the libtool object if requested.
4793 if test -n "$destfile"; then
4794 $show "$install_prog $file $destfile"
4795 $run eval "$install_prog $file $destfile" || exit $?
4798 # Install the old object if enabled.
4799 if test "$build_old_libs" = yes; then
4800 # Deduce the name of the old-style object file.
4801 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4803 $show "$install_prog $staticobj $staticdest"
4804 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4810 # Figure out destination file name, if it wasn't already specified.
4811 if test -n "$destname"; then
4812 destfile="$destdir/$destname"
4814 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4815 destfile="$destdir/$destfile"
4818 # Do a test to see if this is really a libtool program.
4821 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
4827 if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4831 # If there is no directory component, then add one.
4833 */* | *\\*) . $wrapper ;;
4837 # Check the variables that should have been set.
4838 if test -z "$notinst_deplibs"; then
4839 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4844 for lib in $notinst_deplibs; do
4845 # Check to see that each library is installed.
4847 if test -f "$lib"; then
4848 # If there is no directory component, then add one.
4850 */* | *\\*) . $lib ;;
4854 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4855 if test -n "$libdir" && test ! -f "$libfile"; then
4856 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4862 # If there is no directory component, then add one.
4864 */* | *\\*) . $file ;;
4869 if test "$fast_install" = no && test -n "$relink_command"; then
4870 if test "$finalize" = yes && test -z "$run"; then
4872 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4873 tmpdir="$tmpdir/libtool-$$"
4874 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4876 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4879 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4880 outputname="$tmpdir/$file"
4881 # Replace the output file specification.
4882 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4884 $show "$relink_command"
4885 if $run eval "$relink_command"; then :
4887 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4893 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4896 # Install the binary that we compiled earlier.
4897 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4901 # remove .exe since cygwin /usr/bin/install will append another
4903 case $install_prog,$host in
4904 */usr/bin/install*,*cygwin*)
4905 case $file:$destfile in
4910 destfile=$destfile.exe
4913 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
4918 $show "$install_prog$stripme $file $destfile"
4919 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4920 test -n "$outputname" && ${rm}r "$tmpdir"
4925 for file in $staticlibs; do
4926 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4928 # Set up the ranlib parameters.
4929 oldlib="$destdir/$name"
4931 $show "$install_prog $file $oldlib"
4932 $run eval "$install_prog \$file \$oldlib" || exit $?
4934 if test -n "$stripme" && test -n "$striplib"; then
4935 $show "$old_striplib $oldlib"
4936 $run eval "$old_striplib $oldlib" || exit $?
4939 # Do each command in the postinstall commands.
4940 eval cmds=\"$old_postinstall_cmds\"
4941 save_ifs="$IFS"; IFS='~'
4942 for cmd in $cmds; do
4945 $run eval "$cmd" || exit $?
4950 if test -n "$future_libdirs"; then
4951 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4954 if test -n "$current_libdirs"; then
4955 # Maybe just do a dry run.
4956 test -n "$run" && current_libdirs=" -n$current_libdirs"
4957 exec_cmd='$SHELL $0 --finish$current_libdirs'
4963 # libtool finish mode
4965 modename="$modename: finish"
4969 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4972 libdirs="$libdirs $dir"
4975 for libdir in $libdirs; do
4976 if test -n "$finish_cmds"; then
4977 # Do each command in the finish commands.
4978 eval cmds=\"$finish_cmds\"
4979 save_ifs="$IFS"; IFS='~'
4980 for cmd in $cmds; do
4983 $run eval "$cmd" || admincmds="$admincmds
4988 if test -n "$finish_eval"; then
4989 # Do the single finish_eval.
4990 eval cmds=\"$finish_eval\"
4991 $run eval "$cmds" || admincmds="$admincmds
4997 # Exit here if they wanted silent mode.
5000 echo "----------------------------------------------------------------------"
5001 echo "Libraries have been installed in:"
5002 for libdir in $libdirs; do
5006 echo "If you ever happen to want to link against installed libraries"
5007 echo "in a given directory, LIBDIR, you must either use libtool, and"
5008 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5009 echo "flag during linking and do at least one of the following:"
5010 if test -n "$shlibpath_var"; then
5011 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5012 echo " during execution"
5014 if test -n "$runpath_var"; then
5015 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5016 echo " during linking"
5018 if test -n "$hardcode_libdir_flag_spec"; then
5020 eval flag=\"$hardcode_libdir_flag_spec\"
5022 echo " - use the \`$flag' linker flag"
5024 if test -n "$admincmds"; then
5025 echo " - have your system administrator run these commands:$admincmds"
5027 if test -f /etc/ld.so.conf; then
5028 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5031 echo "See any operating system documentation about shared libraries for"
5032 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5033 echo "----------------------------------------------------------------------"
5037 # libtool execute mode
5039 modename="$modename: execute"
5041 # The first argument is the command name.
5043 if test -z "$cmd"; then
5044 $echo "$modename: you must specify a COMMAND" 1>&2
5049 # Handle -dlopen flags immediately.
5050 for file in $execute_dlfiles; do
5051 if test ! -f "$file"; then
5052 $echo "$modename: \`$file' is not a file" 1>&2
5060 # Check to see that this really is a libtool archive.
5061 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5063 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5068 # Read the libtool library.
5072 # If there is no directory component, then add one.
5074 */* | *\\*) . $file ;;
5078 # Skip this library if it cannot be dlopened.
5079 if test -z "$dlname"; then
5080 # Warn if it was a shared library.
5081 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5085 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5086 test "X$dir" = "X$file" && dir=.
5088 if test -f "$dir/$objdir/$dlname"; then
5091 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5097 # Just add the directory containing the .lo file.
5098 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5099 test "X$dir" = "X$file" && dir=.
5103 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5108 # Get the absolute pathname.
5109 absdir=`cd "$dir" && pwd`
5110 test -n "$absdir" && dir="$absdir"
5112 # Now add the directory to shlibpath_var.
5113 if eval "test -z \"\$$shlibpath_var\""; then
5114 eval "$shlibpath_var=\"\$dir\""
5116 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5120 # This variable tells wrapper scripts just to set shlibpath_var
5121 # rather than running their programs.
5122 libtool_execute_magic="$magic"
5124 # Check if any of the arguments is a wrapper script.
5131 # Do a test to see if this is really a libtool program.
5132 if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5133 # If there is no directory component, then add one.
5135 */* | *\\*) . $file ;;
5139 # Transform arg to wrapped name.
5140 file="$progdir/$program"
5144 # Quote arguments (to preserve shell metacharacters).
5145 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5146 args="$args \"$file\""
5149 if test -z "$run"; then
5150 if test -n "$shlibpath_var"; then
5151 # Export the shlibpath_var.
5152 eval "export $shlibpath_var"
5155 # Restore saved enviroment variables
5156 if test "${save_LC_ALL+set}" = set; then
5157 LC_ALL="$save_LC_ALL"; export LC_ALL
5159 if test "${save_LANG+set}" = set; then
5160 LANG="$save_LANG"; export LANG
5163 # Now prepare to actually exec the command.
5164 exec_cmd="\$cmd$args"
5166 # Display what would be done.
5167 if test -n "$shlibpath_var"; then
5168 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5169 $echo "export $shlibpath_var"
5176 # libtool clean and uninstall mode
5178 modename="$modename: $mode"
5184 # This variable tells wrapper scripts just to set variables rather
5185 # than running their programs.
5186 libtool_install_magic="$magic"
5191 -f) rm="$rm $arg"; rmforce=yes ;;
5192 -*) rm="$rm $arg" ;;
5193 *) files="$files $arg" ;;
5197 if test -z "$rm"; then
5198 $echo "$modename: you must specify an RM program" 1>&2
5205 for file in $files; do
5206 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5207 if test "X$dir" = "X$file"; then
5211 objdir="$dir/$objdir"
5213 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5214 test "$mode" = uninstall && objdir="$dir"
5216 # Remember objdir for removal later, being careful to avoid duplicates
5217 if test "$mode" = clean; then
5220 *) rmdirs="$rmdirs $objdir" ;;
5224 # Don't error if the file doesn't exist and rm -f was used.
5225 if (test -L "$file") >/dev/null 2>&1 \
5226 || (test -h "$file") >/dev/null 2>&1 \
5227 || test -f "$file"; then
5229 elif test -d "$file"; then
5232 elif test "$rmforce" = yes; then
5240 # Possibly a libtool archive, so verify it.
5241 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5244 # Delete the libtool libraries and symlinks.
5245 for n in $library_names; do
5246 rmfiles="$rmfiles $objdir/$n"
5248 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5249 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5251 if test "$mode" = uninstall; then
5252 if test -n "$library_names"; then
5253 # Do each command in the postuninstall commands.
5254 eval cmds=\"$postuninstall_cmds\"
5255 save_ifs="$IFS"; IFS='~'
5256 for cmd in $cmds; do
5260 if test "$?" -ne 0 && test "$rmforce" != yes; then
5267 if test -n "$old_library"; then
5268 # Do each command in the old_postuninstall commands.
5269 eval cmds=\"$old_postuninstall_cmds\"
5270 save_ifs="$IFS"; IFS='~'
5271 for cmd in $cmds; do
5275 if test "$?" -ne 0 && test "$rmforce" != yes; then
5281 # FIXME: should reinstall the best remaining shared library.
5287 # Possibly a libtool object, so verify it.
5288 if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5293 # Add PIC object to the list of files to remove.
5294 if test -n "$pic_object" \
5295 && test "$pic_object" != none; then
5296 rmfiles="$rmfiles $dir/$pic_object"
5299 # Add non-PIC object to the list of files to remove.
5300 if test -n "$non_pic_object" \
5301 && test "$non_pic_object" != none; then
5302 rmfiles="$rmfiles $dir/$non_pic_object"
5308 # Do a test to see if this is a libtool program.
5309 if test "$mode" = clean &&
5310 (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5314 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5315 if test "$fast_install" = yes && test -n "$relink_command"; then
5316 rmfiles="$rmfiles $objdir/lt-$name"
5321 $show "$rm $rmfiles"
5322 $run $rm $rmfiles || exit_status=1
5325 # Try to remove the ${objdir}s in the directories where we deleted files
5326 for dir in $rmdirs; do
5327 if test -d "$dir"; then
5329 $run rmdir $dir >/dev/null 2>&1
5337 $echo "$modename: you must specify a MODE" 1>&2
5338 $echo "$generic_help" 1>&2
5343 if test -z "$exec_cmd"; then
5344 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5345 $echo "$generic_help" 1>&2
5348 fi # test -z "$show_help"
5350 if test -n "$exec_cmd"; then
5355 # We need to display help for each of the modes.
5358 "Usage: $modename [OPTION]... [MODE-ARG]...
5360 Provide generalized library-building support services.
5362 --config show all configuration variables
5363 --debug enable verbose shell tracing
5364 -n, --dry-run display commands without modifying any files
5365 --features display basic configuration information and exit
5366 --finish same as \`--mode=finish'
5367 --help display this help message and exit
5368 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5369 --quiet same as \`--silent'
5370 --silent don't print informational messages
5371 --tag=TAG use configuration variables from tag TAG
5372 --version print version information
5374 MODE must be one of the following:
5376 clean remove files from the build directory
5377 compile compile a source file into a libtool object
5378 execute automatically set library path, then run a program
5379 finish complete the installation of libtool libraries
5380 install install libraries or executables
5381 link create a library or an executable
5382 uninstall remove libraries from an installed directory
5384 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5385 a more detailed description of MODE."
5391 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5393 Remove files from the build directory.
5395 RM is the name of the program to use to delete files associated with each FILE
5396 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5399 If FILE is a libtool library, object or program, all the files associated
5400 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5405 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5407 Compile a source file into a libtool library object.
5409 This mode accepts the following additional options:
5411 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5412 -prefer-pic try to building PIC objects only
5413 -prefer-non-pic try to building non-PIC objects only
5414 -static always build a \`.o' file suitable for static linking
5416 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5417 from the given SOURCEFILE.
5419 The output file name is determined by removing the directory component from
5420 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5421 library object suffix, \`.lo'."
5426 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5428 Automatically set library path, then run a program.
5430 This mode accepts the following additional options:
5432 -dlopen FILE add the directory containing FILE to the library path
5434 This mode sets the library path environment variable according to \`-dlopen'
5437 If any of the ARGS are libtool executable wrappers, then they are translated
5438 into their corresponding uninstalled binary, and any of their required library
5439 directories are added to the library path.
5441 Then, COMMAND is executed, with ARGS as arguments."
5446 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5448 Complete the installation of libtool libraries.
5450 Each LIBDIR is a directory that contains libtool libraries.
5452 The commands that this mode executes may require superuser privileges. Use
5453 the \`--dry-run' option if you just want to see what would be executed."
5458 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5460 Install executables or libraries.
5462 INSTALL-COMMAND is the installation command. The first component should be
5463 either the \`install' or \`cp' program.
5465 The rest of the components are interpreted as arguments to that command (only
5466 BSD-compatible install options are recognized)."
5471 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5473 Link object files or libraries together to form another library, or to
5474 create an executable program.
5476 LINK-COMMAND is a command using the C compiler that you would use to create
5477 a program from several object files.
5479 The following components of LINK-COMMAND are treated specially:
5481 -all-static do not do any dynamic linking at all
5482 -avoid-version do not add a version suffix if possible
5483 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5484 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5485 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5486 -export-symbols SYMFILE
5487 try to export only the symbols listed in SYMFILE
5488 -export-symbols-regex REGEX
5489 try to export only the symbols matching REGEX
5490 -LLIBDIR search LIBDIR for required installed libraries
5491 -lNAME OUTPUT-FILE requires the installed library libNAME
5492 -module build a library that can dlopened
5493 -no-fast-install disable the fast-install mode
5494 -no-install link a not-installable executable
5495 -no-undefined declare that a library does not refer to external symbols
5496 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5497 -objectlist FILE Use a list of object files found in FILE to specify objects
5498 -release RELEASE specify package release information
5499 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5500 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5501 -static do not do any dynamic linking of libtool libraries
5502 -version-info CURRENT[:REVISION[:AGE]]
5503 specify library version info [each variable defaults to 0]
5505 All other options (arguments beginning with \`-') are ignored.
5507 Every other argument is treated as a filename. Files ending in \`.la' are
5508 treated as uninstalled libtool libraries, other files are standard or library
5511 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5512 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5513 required, except when creating a convenience library.
5515 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5516 using \`ar' and \`ranlib', or on Windows using \`lib'.
5518 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5519 is created, otherwise an executable program is created."
5524 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5526 Remove libraries from an installation directory.
5528 RM is the name of the program to use to delete files associated with each FILE
5529 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5532 If FILE is a libtool library, all the files associated with it are deleted.
5533 Otherwise, only FILE itself is deleted using RM."
5537 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5544 $echo "Try \`$modename --help' for more information about other modes."
5548 # The TAGs below are defined such that we never get into a situation
5549 # in which we disable both kinds of libraries. Given conflicting
5550 # choices, we go for a static library, that is the most portable,
5551 # since we can't tell whether shared libraries were disabled because
5552 # the user asked for that or because the platform doesn't support
5553 # them. This is particularly important on AIX, because we don't
5554 # support having both static and shared libraries enabled at the same
5555 # time on that platform, so we default to a shared-only configuration.
5556 # If a disable-shared tag is given, we'll fallback to a static-only
5557 # configuration. But we'll never go from static-only to shared-only.
5559 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5560 build_libtool_libs=no
5562 # ### END LIBTOOL TAG CONFIG: disable-shared
5564 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5565 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5566 # ### END LIBTOOL TAG CONFIG: disable-static