1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec
; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo
; then
43 # used as fallback echo
51 # The name of this program.
52 progname
=`$echo "$0" | sed 's%^.*/%%'`
59 TIMESTAMP
=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
62 help="Try \`$progname --help' for more information."
63 magic
="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
71 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
73 NL2SP
='tr \015\012 \040\040'
76 # Only set LANG and LC_ALL to C if already set.
77 # These must not be set unconditionally because not all systems understand
78 # e.g. LANG=C (notably SCO).
79 # We save the old values to restore during execute mode.
80 if test "${LC_ALL+set}" = set; then
81 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
83 if test "${LANG+set}" = set; then
84 save_LANG
="$LANG"; LANG
=C
; export LANG
87 if test "$LTCONFIG_VERSION" != "$VERSION"; then
88 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
89 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
93 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
94 echo "$modename: not configured to build any kind of library" 1>&2
95 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
108 lo2o
="s/\\.lo\$/.${objext}/"
109 o2lo
="s/\\.${objext}\$/.lo/"
112 # Parse our command line options once, thoroughly.
119 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
123 # If the previous option needs an argument, assign it.
124 if test -n "$prev"; then
127 execute_dlfiles
="$execute_dlfiles $arg"
132 # Check whether tagname contains only valid characters
135 echo "$progname: invalid tag name: $tagname" 1>&2
142 # Don't test for the "default" C tag, as we know, it's there, but
143 # not specially marked.
144 taglist
="$taglist $tagname"
147 if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
148 taglist
="$taglist $tagname"
149 # Evaluate the configuration.
150 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
152 echo "$progname: ignoring unknown tag $tagname" 1>&2
167 # Have we seen a non-optional argument yet?
174 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
179 sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0"
180 # Now print the configurations for the tags.
181 for tagname
in $taglist; do
182 sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
188 echo "$progname: enabling shell trace mode"
198 if test "$build_libtool_libs" = yes; then
199 echo "enable shared libraries"
201 echo "disable shared libraries"
203 if test "$build_old_libs" = yes; then
204 echo "enable static libraries"
206 echo "disable static libraries"
211 --finish) mode
="finish" ;;
213 --mode) prevopt
="--mode" prev
=mode
;;
214 --mode=*) mode
="$optarg" ;;
220 --tag) prevopt
="--tag" prev
=tag
;;
222 set tag
"$optarg" ${1+"$@"}
233 $echo "$modename: unrecognized option \`$arg'" 1>&2
245 if test -n "$prevopt"; then
246 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
251 # If this variable is set in any of the actions, the command in it
252 # will be execed at the end. This prevents here-documents from being
253 # left over by shells.
256 if test -z "$show_help"; then
258 # Infer the operation mode.
259 if test -z "$mode"; then
261 *cc |
*++ | gcc
* |
*-gcc*)
273 *db |
*dbx |
*strace |
*truss
)
283 # If we have no mode, but dlfiles were specified, then do execute mode.
284 test -n "$execute_dlfiles" && mode
=execute
286 # Just use the default operation mode.
287 if test -z "$mode"; then
288 if test -n "$nonopt"; then
289 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
291 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
298 # Only execute mode is allowed to have -dlopen flags.
299 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
300 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
305 # Change the help message to a mode-specific one.
307 help="Try \`$modename --help --mode=$mode' for more information."
309 # These modes are in order of execution frequency so that they run quickly.
311 # libtool compile mode
313 modename
="$modename: compile"
314 # Get the compilation command and the source file.
327 # Aesthetically quote the previous argument.
329 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
332 # Double-quote args containing other shell metacharacters.
333 # Many Bourne shells cannot handle close brackets correctly
334 # in scan sets, so we specify it separately.
335 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
340 # Add the previous argument to base_compile.
341 if test -z "$base_compile"; then
342 base_compile
="$lastarg"
344 base_compile
="$base_compile $lastarg"
350 # Accept any command-line options.
353 if test "$user_target" != "no"; then
354 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
381 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
383 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
387 # Double-quote args containing other shell metacharacters.
388 # Many Bourne shells cannot handle close brackets correctly
389 # in scan sets, so we specify it separately.
391 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
395 lastarg
="$lastarg $arg"
398 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
400 # Add the arguments to base_compile.
401 if test -z "$base_compile"; then
402 base_compile
="$lastarg"
404 base_compile
="$base_compile $lastarg"
412 # The next one is the -o target name
417 # We got the output file
424 # Accept the current argument as the source file.
428 # Aesthetically quote the previous argument.
430 # Backslashify any backslashes, double quotes, and dollar signs.
431 # These are the only characters that are still specially
432 # interpreted inside of double-quoted scrings.
433 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
435 # Double-quote args containing other shell metacharacters.
436 # Many Bourne shells cannot handle close brackets correctly
437 # in scan sets, so we specify it separately.
439 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
440 lastarg
="\"$lastarg\""
444 # Add the previous argument to base_compile.
445 if test -z "$base_compile"; then
446 base_compile
="$lastarg"
448 base_compile
="$base_compile $lastarg"
456 # Get the name of the library object.
457 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
460 $echo "$modename: you must specify a target with \`-o'" 1>&2
465 # Recognize several different file suffixes.
466 # If the user specifies -o file.o, it is replaced with file.lo
475 *.class
) xform
=class
;;
480 *.java
) xform
=java
;;
483 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
486 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
488 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
493 # Infer tagged configuration to use if any are available and
494 # if one wasn't chosen via the "--tag" command line option.
495 # Only attempt this if the compiler in the base compile
496 # command doesn't match the default compiler.
497 if test -n "$available_tags" && test -z "$tagname"; then
498 case $base_compile in
500 # Blanks in the command may have been stripped by the calling shell,
501 # but not from the CC environment variable when ltconfig was run.
504 for z
in $available_tags; do
505 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
506 # Evaluate the configuration.
507 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
508 case $base_compile in
510 # The compiler in the base compile command matches
511 # the one in the tagged configuration.
512 # Assume this is the tagged configuration we want.
523 # If $tagname still isn't set, then no tagged configuration
524 # was found and let the user know that the "--tag" command
525 # line option must be used.
526 if test -z "$tagname"; then
527 echo "$modename: unable to infer tagged configuration"
528 echo "$modename: specify a tag with \`--tag'" 1>&2
531 # echo "$modename: using $tagname tagged configuration"
537 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
538 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
539 if test "X$xdir" = "X$obj"; then
544 lobj
=${xdir}$objdir/$objname
546 if test -z "$base_compile"; then
547 $echo "$modename: you must specify a compilation command" 1>&2
552 # Delete any leftover library objects.
553 if test "$build_old_libs" = yes; then
554 removelist
="$obj $lobj $libobj ${libobj}T"
556 removelist
="$lobj $libobj ${libobj}T"
560 trap "$run $rm $removelist; exit 1" 1 2 15
562 # On Cygwin there's no "real" PIC flag so we must build both object types
564 cygwin
* | mingw
* | pw32
* | os2
*)
568 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
569 # non-PIC code in shared libraries is not supported
573 # Calculate the filename of the output object if compiler does
574 # not support -o with -c
575 if test "$compiler_c_o" = no
; then
576 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
577 lockfile
="$output_obj.lock"
578 removelist
="$removelist $output_obj $lockfile"
579 trap "$run $rm $removelist; exit 1" 1 2 15
586 # Lock this critical section if it is needed
587 # We use this script file to make the link, it avoids creating a new file
588 if test "$need_locks" = yes; then
589 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
590 $show "Waiting for $lockfile to be removed"
593 elif test "$need_locks" = warn
; then
594 if test -f "$lockfile"; then
596 *** ERROR, $lockfile exists and contains:
597 `cat $lockfile 2>/dev/null`
599 This indicates that another process is trying to use the same
600 temporary object file, and libtool could not work around it because
601 your compiler does not support \`-c' and \`-o' together. If you
602 repeat this compilation, it may succeed, by chance, but you had better
603 avoid parallel builds (make -j) in this platform, or get a better
609 echo $srcfile > "$lockfile"
612 if test -n "$fix_srcfile_path"; then
613 eval srcfile
=\"$fix_srcfile_path\"
616 $run $rm "$libobj" "${libobj}T"
618 # Create a libtool object file (analogous to a ".la" file),
619 # but don't create it if we're doing a dry run.
620 test -z "$run" && cat > ${libobj}T
<<EOF
621 # $libobj - a libtool object file
622 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
624 # Please DO NOT delete this file!
625 # It is necessary for linking the library.
627 # Name of the PIC object.
630 # Only build a PIC object if we are building libtool libraries.
631 if test "$build_libtool_libs" = yes; then
632 # Without this assignment, base_compile gets emptied.
633 fbsd_hideous_sh_bug
=$base_compile
635 if test "$pic_mode" != no
; then
636 command="$base_compile $srcfile $pic_flag"
638 # Don't build PIC code
639 command="$base_compile $srcfile"
642 if test ! -d ${xdir}$objdir; then
643 $show "$mkdir ${xdir}$objdir"
644 $run $mkdir ${xdir}$objdir
646 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
651 if test -z "$output_obj"; then
652 # Place PIC objects in $objdir
653 command="$command -o $lobj"
656 $run $rm "$lobj" "$output_obj"
659 if $run eval "$command"; then :
661 test -n "$output_obj" && $run $rm $removelist
665 if test "$need_locks" = warn
&&
666 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
668 *** ERROR, $lockfile contains:
669 `cat $lockfile 2>/dev/null`
671 but it should contain:
674 This indicates that another process is trying to use the same
675 temporary object file, and libtool could not work around it because
676 your compiler does not support \`-c' and \`-o' together. If you
677 repeat this compilation, it may succeed, by chance, but you had better
678 avoid parallel builds (make -j) in this platform, or get a better
685 # Just move the object if needed, then go on to compile the next one
686 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
687 $show "$mv $output_obj $lobj"
688 if $run $mv $output_obj $lobj; then :
696 # Append the name of the PIC object to the libtool object file.
697 test -z "$run" && cat >> ${libobj}T
<<EOF
698 pic_object='$objdir/$objname'
702 # Allow error messages only from the first compilation.
703 suppress_output
=' >/dev/null 2>&1'
705 # No PIC object so indicate it doesn't exist in the libtool
707 test -z "$run" && cat >> ${libobj}T
<<EOF
713 # Only build a position-dependent object if we build old libraries.
714 if test "$build_old_libs" = yes; then
715 if test "$pic_mode" != yes; then
716 # Don't build PIC code
717 command="$base_compile $srcfile"
719 command="$base_compile $srcfile $pic_flag"
721 if test "$compiler_c_o" = yes; then
722 command="$command -o $obj"
725 # Suppress compiler output if we already did a PIC compilation.
726 command="$command$suppress_output"
727 $run $rm "$obj" "$output_obj"
729 if $run eval "$command"; then :
735 if test "$need_locks" = warn
&&
736 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
738 *** ERROR, $lockfile contains:
739 `cat $lockfile 2>/dev/null`
741 but it should contain:
744 This indicates that another process is trying to use the same
745 temporary object file, and libtool could not work around it because
746 your compiler does not support \`-c' and \`-o' together. If you
747 repeat this compilation, it may succeed, by chance, but you had better
748 avoid parallel builds (make -j) in this platform, or get a better
755 # Just move the object if needed
756 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
757 $show "$mv $output_obj $obj"
758 if $run $mv $output_obj $obj; then :
766 # Append the name of the non-PIC object the libtool object file.
767 # Only append if the libtool object file exists.
768 test -z "$run" && cat >> ${libobj}T
<<EOF
769 # Name of the non-PIC object.
770 non_pic_object='$objname'
774 # Append the name of the non-PIC object the libtool object file.
775 # Only append if the libtool object file exists.
776 test -z "$run" && cat >> ${libobj}T
<<EOF
777 # Name of the non-PIC object.
783 $run $mv "${libobj}T" "${libobj}"
785 # Unlock the critical section if it was locked
786 if test "$need_locks" != no
; then
795 modename
="$modename: link"
797 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
798 # It is impossible to link a dll without this setting, and
799 # we shouldn't force the makefile maintainer to figure out
800 # which system we are compiling for in order to pass an extra
801 # flag for every libtool invokation.
804 # FIXME: Unfortunately, there are problems with the above when trying
805 # to make a dll which has undefined symbols, in which case not
806 # even a static library is built. For now, we need to specify
807 # -no-undefined on the libtool link line when we can be certain
808 # that all symbols are satisfied, otherwise we get a static library.
815 libtool_args
="$nonopt"
816 base_compile
="$nonopt"
817 compile_command
="$nonopt"
818 finalize_command
="$nonopt"
831 lib_search_path
=`pwd`
839 export_symbols_regex
=
847 prefer_static_libs
=no
859 # We need to know -static, to get the right output filenames.
863 -all-static |
-static)
864 if test "X$arg" = "X-all-static"; then
865 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
866 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
868 if test -n "$link_static_flag"; then
869 dlopen_self
=$dlopen_self_static
872 if test -z "$pic_flag" && test -n "$link_static_flag"; then
873 dlopen_self
=$dlopen_self_static
876 build_libtool_libs
=no
878 prefer_static_libs
=yes
884 # See if our shared archives depend on static archives.
885 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
887 # Go through the arguments, transforming them on the way.
888 while test $# -gt 0; do
890 base_compile
="$base_compile $arg"
893 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
894 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
898 libtool_args
="$libtool_args $qarg"
900 # If the previous option needs an argument, assign it.
901 if test -n "$prev"; then
904 compile_command
="$compile_command @OUTPUT@"
905 finalize_command
="$finalize_command @OUTPUT@"
911 if test "$preload" = no
; then
912 # Add the symbol object into the linking commands.
913 compile_command
="$compile_command @SYMFILE@"
914 finalize_command
="$finalize_command @SYMFILE@"
918 *.la |
*.lo
) ;; # We handle these cases below.
920 if test "$dlself" = no
; then
928 if test "$prev" = dlprefiles
; then
930 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
940 if test "$prev" = dlfiles
; then
941 dlfiles
="$dlfiles $arg"
943 dlprefiles
="$dlprefiles $arg"
951 export_symbols
="$arg"
952 if test ! -f "$arg"; then
953 $echo "$modename: symbol file \`$arg' does not exist"
960 export_symbols_regex
="$arg"
970 if test -f "$arg"; then
973 for fil
in `cat $save_arg`
975 # moreargs="$moreargs $fil"
977 # A libtool-controlled object.
979 # Check to see that this really is a libtool object.
980 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
985 # If there is no directory component, then add one.
987 */* |
*\\*) .
$arg ;;
991 if test -z "$pic_object" || \
992 test -z "$non_pic_object" ||
993 test "$pic_object" = none
&& \
994 test "$non_pic_object" = none
; then
995 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
999 # Extract subdirectory from the argument.
1000 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1001 if test "X$xdir" = "X$arg"; then
1007 if test "$pic_object" != none
; then
1008 # Prepend the subdirectory the object is found in.
1009 pic_object
="$xdir$pic_object"
1011 if test "$prev" = dlfiles
; then
1012 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1013 dlfiles
="$dlfiles $pic_object"
1017 # If libtool objects are unsupported, then we need to preload.
1022 # CHECK ME: I think I busted this. -Ossama
1023 if test "$prev" = dlprefiles
; then
1024 # Preload the old-style object.
1025 dlprefiles
="$dlprefiles $pic_object"
1030 libobjs
="$libobjs $pic_object"
1035 if test "$non_pic_object" != none
; then
1036 # Prepend the subdirectory the object is found in.
1037 non_pic_object
="$xdir$non_pic_object"
1039 # A standard non-PIC object
1040 non_pic_objects
="$non_pic_objects $non_pic_object"
1041 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1042 arg
="$non_pic_object"
1045 # If the PIC object exists, use it instead.
1046 # $xdir was prepended to $pic_object above.
1047 non_pic_object
="$pic_object"
1048 non_pic_objects
="$non_pic_objects $non_pic_object"
1051 # Only an error if not doing a dry-run.
1052 if test -z "$run"; then
1053 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1058 # Extract subdirectory from the argument.
1059 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1060 if test "X$xdir" = "X$arg"; then
1066 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1067 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1068 libobjs
="$libobjs $pic_object"
1069 non_pic_objects
="$non_pic_objects $non_pic_object"
1074 $echo "$modename: link input file \`$save_arg' does not exist"
1082 # We need an absolute path.
1084 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1086 $echo "$modename: only absolute run-paths are allowed" 1>&2
1090 if test "$prev" = rpath
; then
1093 *) rpath
="$rpath $arg" ;;
1098 *) xrpath
="$xrpath $arg" ;;
1105 compiler_flags
="$compiler_flags $qarg"
1107 compile_command
="$compile_command $qarg"
1108 finalize_command
="$finalize_command $qarg"
1112 linker_flags
="$linker_flags $qarg"
1113 compiler_flags
="$compiler_flags $wl$qarg"
1115 compile_command
="$compile_command $wl$qarg"
1116 finalize_command
="$finalize_command $wl$qarg"
1123 *" $qarg.framework "*) ;;
1124 *) deplibs
="$deplibs $qarg.framework" # this is fixed later
1133 eval "$prev=\"\$arg\""
1144 if test -n "$link_static_flag"; then
1145 compile_command
="$compile_command $link_static_flag"
1146 finalize_command
="$finalize_command $link_static_flag"
1152 # FIXME: remove this flag sometime in the future.
1153 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1177 -export-symbols |
-export-symbols-regex)
1178 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1179 $echo "$modename: more than one -exported-symbols argument is not allowed"
1182 if test "X$arg" = "X-export-symbols"; then
1190 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1191 # so, if we see these flags be careful not to treat them like -L
1193 case $with_gcc/$host in
1195 compile_command
="$compile_command $arg"
1196 finalize_command
="$finalize_command $arg"
1203 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1204 # We need an absolute path.
1206 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1208 absdir
=`cd "$dir" && pwd`
1209 if test -z "$absdir"; then
1210 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1219 deplibs
="$deplibs -L$dir"
1220 lib_search_path
="$lib_search_path $dir"
1224 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1225 case :$dllsearchpath: in
1227 *) dllsearchpath
="$dllsearchpath:$dir";;
1235 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1237 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1238 # These systems don't actually have a C or math library (as such)
1241 *-*-mingw* |
*-*-os2*)
1242 # These systems don't actually have a C library (as such)
1243 test "X$arg" = "X-lc" && continue
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 IFS
="${IFS= }"; 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 IFS
="${IFS= }"; 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/^ //"`
1389 # Some other compiler flag.
1391 # Unknown arguments in both finalize_command and compile_command need
1392 # to be aesthetically quoted because they are evaled later.
1393 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1395 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1402 # A standard object.
1407 # A libtool-controlled object.
1409 # Check to see that this really is a libtool object.
1410 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1415 # If there is no directory component, then add one.
1417 */* |
*\\*) .
$arg ;;
1421 if test -z "$pic_object" || \
1422 test -z "$non_pic_object" ||
1423 test "$pic_object" = none
&& \
1424 test "$non_pic_object" = none
; then
1425 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1429 # Extract subdirectory from the argument.
1430 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1431 if test "X$xdir" = "X$arg"; then
1437 if test "$pic_object" != none
; then
1438 # Prepend the subdirectory the object is found in.
1439 pic_object
="$xdir$pic_object"
1441 if test "$prev" = dlfiles
; then
1442 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1443 dlfiles
="$dlfiles $pic_object"
1447 # If libtool objects are unsupported, then we need to preload.
1452 # CHECK ME: I think I busted this. -Ossama
1453 if test "$prev" = dlprefiles
; then
1454 # Preload the old-style object.
1455 dlprefiles
="$dlprefiles $pic_object"
1460 libobjs
="$libobjs $pic_object"
1465 if test "$non_pic_object" != none
; then
1466 # Prepend the subdirectory the object is found in.
1467 non_pic_object
="$xdir$non_pic_object"
1469 # A standard non-PIC object
1470 non_pic_objects
="$non_pic_objects $non_pic_object"
1471 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1472 arg
="$non_pic_object"
1475 # If the PIC object exists, use it instead.
1476 # $xdir was prepended to $pic_object above.
1477 non_pic_object
="$pic_object"
1478 non_pic_objects
="$non_pic_objects $non_pic_object"
1481 # Only an error if not doing a dry-run.
1482 if test -z "$run"; then
1483 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1488 # Extract subdirectory from the argument.
1489 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1490 if test "X$xdir" = "X$arg"; then
1496 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1497 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1498 libobjs
="$libobjs $pic_object"
1499 non_pic_objects
="$non_pic_objects $non_pic_object"
1506 deplibs
="$deplibs $arg"
1507 old_deplibs
="$old_deplibs $arg"
1512 # A libtool-controlled library.
1514 if test "$prev" = dlfiles
; then
1515 # This library was specified with -dlopen.
1516 dlfiles
="$dlfiles $arg"
1518 elif test "$prev" = dlprefiles
; then
1519 # The library was specified with -dlpreopen.
1520 dlprefiles
="$dlprefiles $arg"
1523 deplibs
="$deplibs $arg"
1528 # Some other compiler argument.
1530 # Unknown arguments in both finalize_command and compile_command need
1531 # to be aesthetically quoted because they are evaled later.
1532 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1534 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1541 # Now actually substitute the argument into the commands.
1542 if test -n "$arg"; then
1543 compile_command
="$compile_command $arg"
1544 finalize_command
="$finalize_command $arg"
1546 done # argument parsing loop
1548 if test -n "$prev"; then
1549 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1554 # Infer tagged configuration to use if any are available and
1555 # if one wasn't chosen via the "--tag" command line option.
1556 # Only attempt this if the compiler in the base link
1557 # command doesn't match the default compiler.
1558 if test -n "$available_tags" && test -z "$tagname"; then
1559 case $base_compile in
1561 # Blanks in the command may have been stripped by the calling shell,
1562 # but not from the CC environment variable when ltconfig was run.
1565 for z
in $available_tags; do
1566 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1567 # Evaluate the configuration.
1568 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1569 case $base_compile in
1571 # The compiler in $compile_command matches
1572 # the one in the tagged configuration.
1573 # Assume this is the tagged configuration we want.
1584 # If $tagname still isn't set, then no tagged configuration
1585 # was found and let the user know that the "--tag" command
1586 # line option must be used.
1587 if test -z "$tagname"; then
1588 echo "$modename: unable to infer tagged configuration"
1589 echo "$modename: specify a tag with \`--tag'" 1>&2
1592 # echo "$modename: using $tagname tagged configuration"
1598 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1599 eval arg
=\"$export_dynamic_flag_spec\"
1600 compile_command
="$compile_command $arg"
1601 finalize_command
="$finalize_command $arg"
1604 # calculate the name of the file, without its directory
1605 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1606 libobjs_save
="$libobjs"
1608 if test -n "$shlibpath_var"; then
1609 # get the directories listed in $shlibpath_var
1610 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1614 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1615 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1617 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1618 if test "X$output_objdir" = "X$output"; then
1619 output_objdir
="$objdir"
1621 output_objdir
="$output_objdir/$objdir"
1623 # Create the object directory.
1624 if test ! -d $output_objdir; then
1625 $show "$mkdir $output_objdir"
1626 $run $mkdir $output_objdir
1628 if test $status -ne 0 && test ! -d $output_objdir; then
1633 # Determine the type of output
1636 $echo "$modename: you must specify an output file" 1>&2
1640 *.
$libext) linkmode
=oldlib
;;
1641 *.lo |
*.
$objext) linkmode
=obj
;;
1642 *.la
) linkmode
=lib
;;
1643 *) linkmode
=prog
;; # Anything else should be a program.
1648 # Find all interdependent deplibs by searching for libraries
1649 # that are linked more than once (e.g. -la -lb -la)
1650 for deplib
in $deplibs; do
1652 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1654 libs
="$libs $deplib"
1657 if test $linkmode = lib
; then
1658 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1660 # Compute libraries that are listed more than once in $predeps
1661 # $postdeps and mark them as special (i.e., whose duplicates are
1662 # not to be eliminated).
1664 for pre_post_dep
in $predeps $postdeps; do
1665 case "$pre_post_deps " in
1666 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1668 pre_post_deps
="$pre_post_deps $pre_post_dep"
1676 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1677 notinst_deplibs
= # not-installed libtool libraries
1678 notinst_path
= # paths that contain not-installed libtool libraries
1682 for file in $dlfiles $dlprefiles; do
1686 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1698 passes
="conv scan dlopen dlpreopen link"
1703 for pass
in $passes; do
1704 if test $linkmode = prog
; then
1705 # Determine which files to process
1709 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1712 dlpreopen
) libs
="$dlprefiles" ;;
1713 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1716 for deplib
in $libs; do
1721 if test $linkmode = oldlib
&& test $linkmode = obj
; then
1722 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1725 if test $pass = conv
; then
1726 deplibs
="$deplib $deplibs"
1729 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1730 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1731 # Search the libtool library
1732 lib
="$searchdir/lib${name}.la"
1733 if test -f "$lib"; then
1738 if test "$found" != yes; then
1739 # deplib doesn't seem to be a libtool library
1740 if test "$linkmode,$pass" = "prog,link"; then
1741 compile_deplibs
="$deplib $compile_deplibs"
1742 finalize_deplibs
="$deplib $finalize_deplibs"
1744 deplibs
="$deplib $deplibs"
1745 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1753 deplibs
="$deplib $deplibs"
1754 test $pass = conv
&& continue
1755 newdependency_libs
="$deplib $newdependency_libs"
1756 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1759 if test $pass = conv
; then
1760 deplibs
="$deplib $deplibs"
1763 if test $pass = scan
; then
1764 deplibs
="$deplib $deplibs"
1765 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1767 compile_deplibs
="$deplib $compile_deplibs"
1768 finalize_deplibs
="$deplib $finalize_deplibs"
1772 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1778 if test $pass = link
; then
1779 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1780 # Make sure the xrpath contains only unique directories.
1783 *) xrpath
="$xrpath $dir" ;;
1786 deplibs
="$deplib $deplibs"
1789 *.la
) lib
="$deplib" ;;
1791 if test $pass = conv
; then
1792 deplibs
="$deplib $deplibs"
1797 if test "$deplibs_check_method" != pass_all
; then
1799 echo "*** Warning: This library needs some functionality provided by $deplib."
1800 echo "*** I have the capability to make that library automatically link in when"
1801 echo "*** you link to this library. But I can only do this if you have a"
1802 echo "*** shared version of the library, which you do not appear to have."
1805 echo "*** Warning: Linking the shared library $output against the"
1806 echo "*** static library $deplib is not portable!"
1807 deplibs
="$deplib $deplibs"
1812 if test $pass != link
; then
1813 deplibs
="$deplib $deplibs"
1815 compile_deplibs
="$deplib $compile_deplibs"
1816 finalize_deplibs
="$deplib $finalize_deplibs"
1823 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1824 # If there is no dlopen support or we're linking statically,
1825 # we need to preload.
1826 newdlprefiles
="$newdlprefiles $deplib"
1827 compile_deplibs
="$deplib $compile_deplibs"
1828 finalize_deplibs
="$deplib $finalize_deplibs"
1830 newdlfiles
="$newdlfiles $deplib"
1839 if test $found = yes ||
test -f "$lib"; then :
1841 $echo "$modename: cannot find the library \`$lib'" 1>&2
1845 # Check to see that this really is a libtool archive.
1846 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1848 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1852 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1853 test "X$ladir" = "X$lib" && ladir
="."
1861 # If the library was installed with an old release of libtool,
1862 # it will not redefine variable installed.
1867 */* |
*\\*) .
$lib ;;
1873 # Convert "-framework foo" to "foo.framework" in dependency_libs
1874 test -n "$dependency_libs" && dependency_libs
=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
1878 if test "$linkmode,$pass" = "lib,link" ||
1879 test "$linkmode,$pass" = "prog,scan" ||
1880 { test $linkmode = oldlib
&& test $linkmode = obj
; }; then
1881 # Add dl[pre]opened files of deplib
1882 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1883 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1886 if test $pass = conv
; then
1887 # Only check for convenience libraries
1888 deplibs
="$lib $deplibs"
1889 if test -z "$libdir"; then
1890 if test -z "$old_library"; then
1891 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1894 # It is a libtool convenience library, so add in its objects.
1895 convenience
="$convenience $ladir/$objdir/$old_library"
1896 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1898 for deplib
in $dependency_libs; do
1899 deplibs
="$deplib $deplibs"
1900 case "$tmp_libs " in
1901 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1903 tmp_libs
="$tmp_libs $deplib"
1905 elif test $linkmode != prog
&& test $linkmode != lib
; then
1906 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1912 # Get the name of the library we link against.
1914 for l
in $old_library $library_names; do
1917 if test -z "$linklib"; then
1918 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1922 # This library was specified with -dlopen.
1923 if test $pass = dlopen
; then
1924 if test -z "$libdir"; then
1925 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1928 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1929 # If there is no dlname, no dlopen support or we're linking
1930 # statically, we need to preload.
1931 dlprefiles
="$dlprefiles $lib"
1933 newdlfiles
="$newdlfiles $lib"
1938 # We need an absolute path.
1940 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1942 abs_ladir
=`cd "$ladir" && pwd`
1943 if test -z "$abs_ladir"; then
1944 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1945 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1950 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1952 # Find the relevant object directory and library name.
1953 if test "X$installed" = Xyes
; then
1954 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1955 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1964 dir
="$ladir/$objdir"
1965 absdir
="$abs_ladir/$objdir"
1966 # Remove this search path later
1967 notinst_path
="$notinst_path $abs_ladir"
1968 fi # $installed = yes
1969 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1971 # This library was specified with -dlpreopen.
1972 if test $pass = dlpreopen
; then
1973 if test -z "$libdir"; then
1974 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1977 # Prefer using a static library (so that no silly _DYNAMIC symbols
1978 # are required to link).
1979 if test -n "$old_library"; then
1980 newdlprefiles
="$newdlprefiles $dir/$old_library"
1981 # Otherwise, use the dlname, so that lt_dlopen finds it.
1982 elif test -n "$dlname"; then
1983 newdlprefiles
="$newdlprefiles $dir/$dlname"
1985 newdlprefiles
="$newdlprefiles $dir/$linklib"
1987 fi # $pass = dlpreopen
1989 if test -z "$libdir"; then
1990 # Link the convenience library
1991 if test $linkmode = lib
; then
1992 deplibs
="$dir/$old_library $deplibs"
1993 elif test "$linkmode,$pass" = "prog,link"; then
1994 compile_deplibs
="$dir/$old_library $compile_deplibs"
1995 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
1997 deplibs
="$lib $deplibs"
2002 if test $linkmode = prog
&& test $pass != link
; then
2003 newlib_search_path
="$newlib_search_path $ladir"
2004 deplibs
="$lib $deplibs"
2007 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2008 test "$build_libtool_libs" = no
; then
2013 for deplib
in $dependency_libs; do
2015 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2017 # Need to link against all dependency_libs?
2018 if test $linkalldeplibs = yes; then
2019 deplibs
="$deplib $deplibs"
2021 # Need to hardcode shared library paths
2022 # or/and link against static libraries
2023 newdependency_libs
="$deplib $newdependency_libs"
2025 case "$tmp_libs " in
2026 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2028 tmp_libs
="$tmp_libs $deplib"
2031 fi # $linkmode = prog...
2033 link_static
=no
# Whether the deplib will be linked statically
2034 if test -n "$library_names" &&
2035 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2036 # Link against this shared library
2038 if test "$linkmode,$pass" = "prog,link" ||
2039 { test $linkmode = lib
&& test $hardcode_into_libs = yes; }; then
2040 # Hardcode the library path.
2041 # Skip directories that are in the system default run-time
2043 case " $sys_lib_dlsearch_path " in
2046 case "$compile_rpath " in
2048 *) compile_rpath
="$compile_rpath $absdir"
2052 case " $sys_lib_dlsearch_path " in
2055 case "$finalize_rpath " in
2057 *) finalize_rpath
="$finalize_rpath $libdir"
2061 if test $linkmode = prog
; then
2062 # We need to hardcode the library path
2063 if test -n "$shlibpath_var"; then
2064 # Make sure the rpath contains only unique directories.
2065 case "$temp_rpath " in
2068 *) temp_rpath
="$temp_rpath $dir" ;;
2072 fi # $linkmode,$pass = prog,link...
2074 if test "$alldeplibs" = yes &&
2075 { test "$deplibs_check_method" = pass_all ||
2076 { test "$build_libtool_libs" = yes &&
2077 test -n "$library_names"; }; }; then
2078 # We only need to search for static libraries
2082 if test "$installed" = no
; then
2083 notinst_deplibs
="$notinst_deplibs $lib"
2087 if test -n "$old_archive_from_expsyms_cmds"; then
2088 # figure out the soname
2089 set dummy
$library_names
2092 libname
=`eval \\$echo \"$libname_spec\"`
2093 # use dlname if we got it. it's perfectly good, no?
2094 if test -n "$dlname"; then
2096 elif test -n "$soname_spec"; then
2100 major
=`expr $current - $age`
2104 eval soname
=\"$soname_spec\"
2109 # Make a new name for the extract_expsyms_cmds to use
2111 soname
=`echo $soroot | sed -e 's/^.*\///'`
2112 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2114 # If the library has no export list, then create one now
2115 if test -f "$output_objdir/$soname-def"; then :
2117 $show "extracting exported symbol list from \`$soname'"
2118 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2119 cmds
=$extract_expsyms_cmds
2120 for cmd
in $cmds; do
2124 $run eval "$cmd" ||
exit $?
2130 if test -f "$output_objdir/$newlib"; then :; else
2131 $show "generating import library for \`$soname'"
2132 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2133 cmds
=$old_archive_from_expsyms_cmds
2134 for cmd
in $cmds; do
2138 $run eval "$cmd" ||
exit $?
2142 # make sure the library variables are pointing to the new library
2145 fi # test -n $old_archive_from_expsyms_cmds
2147 if test $linkmode = prog ||
test "$mode" != relink
; then
2152 case $hardcode_action in
2153 immediate | unsupported
)
2154 if test "$hardcode_direct" = no
; then
2156 elif test "$hardcode_minus_L" = no
; then
2158 *-*-sunos*) add_shlibpath
="$dir" ;;
2162 elif test "$hardcode_shlibpath_var" = no
; then
2163 add_shlibpath
="$dir"
2170 if test "$hardcode_direct" = yes; then
2172 elif test "$hardcode_minus_L" = yes; then
2175 elif test "$hardcode_shlibpath_var" = yes; then
2176 add_shlibpath
="$dir"
2185 if test "$lib_linked" != yes; then
2186 $echo "$modename: configuration error: unsupported hardcode properties"
2190 if test -n "$add_shlibpath"; then
2191 case :$compile_shlibpath: in
2192 *":$add_shlibpath:"*) ;;
2193 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2196 if test $linkmode = prog
; then
2197 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2198 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2200 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2201 test -n "$add" && deplibs
="$add $deplibs"
2202 if test "$hardcode_direct" != yes && \
2203 test "$hardcode_minus_L" != yes && \
2204 test "$hardcode_shlibpath_var" = yes; then
2205 case :$finalize_shlibpath: in
2207 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2213 if test $linkmode = prog ||
test "$mode" = relink
; then
2217 # Finalize command for both is simple: just hardcode it.
2218 if test "$hardcode_direct" = yes; then
2219 add
="$libdir/$linklib"
2220 elif test "$hardcode_minus_L" = yes; then
2223 elif test "$hardcode_shlibpath_var" = yes; then
2224 case :$finalize_shlibpath: in
2226 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2230 # We cannot seem to hardcode it, guess we'll fake it.
2235 if test $linkmode = prog
; then
2236 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2237 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2239 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2240 test -n "$add" && deplibs
="$add $deplibs"
2243 elif test $linkmode = prog
; then
2244 if test "$alldeplibs" = yes &&
2245 { test "$deplibs_check_method" = pass_all ||
2246 { test "$build_libtool_libs" = yes &&
2247 test -n "$library_names"; }; }; then
2248 # We only need to search for static libraries
2252 # Try to link the static library
2253 # Here we assume that one of hardcode_direct or hardcode_minus_L
2254 # is not unsupported. This is valid on all known static and
2256 if test "$hardcode_direct" != unsupported
; then
2257 test -n "$old_library" && linklib
="$old_library"
2258 compile_deplibs
="$dir/$linklib $compile_deplibs"
2259 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2261 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2262 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2264 elif test "$build_libtool_libs" = yes; then
2265 # Not a shared library
2266 if test "$deplibs_check_method" != pass_all
; then
2267 # We're trying link a shared library against a static one
2268 # but the system doesn't support it.
2270 # Just print a warning and add the library to dependency_libs so
2271 # that the program can be linked against the static library.
2273 echo "*** Warning: This library needs some functionality provided by $lib."
2274 echo "*** I have the capability to make that library automatically link in when"
2275 echo "*** you link to this library. But I can only do this if you have a"
2276 echo "*** shared version of the library, which you do not appear to have."
2277 if test "$module" = yes; then
2278 echo "*** Therefore, libtool will create a static module, that should work "
2279 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2280 if test -z "$global_symbol_pipe"; then
2282 echo "*** However, this would only work if libtool was able to extract symbol"
2283 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2284 echo "*** not find such a program. So, this module is probably useless."
2285 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2287 if test "$build_old_libs" = no
; then
2288 build_libtool_libs
=module
2291 build_libtool_libs
=no
2295 convenience
="$convenience $dir/$old_library"
2296 old_convenience
="$old_convenience $dir/$old_library"
2297 deplibs
="$dir/$old_library $deplibs"
2300 fi # link shared/static library?
2302 if test $linkmode = lib
; then
2303 if test -n "$dependency_libs" &&
2304 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
2305 test $link_static = yes; }; then
2306 # Extract -R from dependency_libs
2308 for libdir
in $dependency_libs; do
2310 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2312 *" $temp_xrpath "*) ;;
2313 *) xrpath
="$xrpath $temp_xrpath";;
2315 *) temp_deplibs
="$temp_deplibs $libdir";;
2318 dependency_libs
="$temp_deplibs"
2321 newlib_search_path
="$newlib_search_path $absdir"
2322 # Link against this library
2323 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2324 # ... and its dependency_libs
2326 for deplib
in $dependency_libs; do
2327 newdependency_libs
="$deplib $newdependency_libs"
2328 case "$tmp_libs " in
2329 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2331 tmp_libs
="$tmp_libs $deplib"
2334 if test $link_all_deplibs != no
; then
2335 # Add the search paths of all dependency libraries
2336 for deplib
in $dependency_libs; do
2338 -L*) path
="$deplib" ;;
2340 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2341 test "X$dir" = "X$deplib" && dir
="."
2342 # We need an absolute path.
2344 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2346 absdir
=`cd "$dir" && pwd`
2347 if test -z "$absdir"; then
2348 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2353 if grep "^installed=no" $deplib > /dev
/null
; then
2354 path
="-L$absdir/$objdir"
2356 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2357 if test -z "$libdir"; then
2358 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2361 if test "$absdir" != "$libdir"; then
2362 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2369 case " $deplibs " in
2371 *) deplibs
="$path $deplibs" ;;
2374 fi # link_all_deplibs != no
2376 done # for deplib in $libs
2377 if test $pass = dlpreopen
; then
2378 # Link the dlpreopened libraries before other libraries
2379 for deplib
in $save_deplibs; do
2380 deplibs
="$deplib $deplibs"
2383 if test $pass != dlopen
; then
2384 test $pass != scan
&& dependency_libs
="$newdependency_libs"
2385 if test $pass != conv
; then
2386 # Make sure lib_search_path contains only unique directories.
2388 for dir
in $newlib_search_path; do
2389 case "$lib_search_path " in
2391 *) lib_search_path
="$lib_search_path $dir" ;;
2397 if test "$linkmode,$pass" != "prog,link"; then
2400 vars
="compile_deplibs finalize_deplibs"
2402 for var
in $vars dependency_libs
; do
2403 # Add libraries to $var in reverse order
2404 eval tmp_libs
=\"\$
$var\"
2406 for deplib
in $tmp_libs; do
2408 -L*) new_libs
="$deplib $new_libs" ;;
2410 case " $specialdeplibs " in
2411 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2413 case " $new_libs " in
2415 *) new_libs
="$deplib $new_libs" ;;
2423 for deplib
in $new_libs; do
2426 case " $tmp_libs " in
2428 *) tmp_libs
="$tmp_libs $deplib" ;;
2431 *) tmp_libs
="$tmp_libs $deplib" ;;
2434 eval $var=\"$tmp_libs\"
2437 if test "$pass" = "conv" &&
2438 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2439 libs
="$deplibs" # reset libs
2443 if test $linkmode = prog
; then
2444 dlfiles
="$newdlfiles"
2445 dlprefiles
="$newdlprefiles"
2450 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2451 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2454 if test -n "$rpath"; then
2455 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2458 if test -n "$xrpath"; then
2459 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2462 if test -n "$vinfo"; then
2463 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2466 if test -n "$release"; then
2467 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2470 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2471 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2474 # Now set the variables for building old libraries.
2475 build_libtool_libs
=no
2477 objs
="$objs$old_deplibs"
2481 # Make sure we only generate libraries of the form `libNAME.la'.
2484 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2485 eval shared_ext
=\"$shrext\"
2486 eval libname
=\"$libname_spec\"
2489 if test "$module" = no
; then
2490 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2494 if test "$need_lib_prefix" != no
; then
2495 # Add the "lib" prefix for modules if required
2496 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2497 eval shared_ext
=\"$shrext\"
2498 eval libname
=\"$libname_spec\"
2500 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2505 if test -n "$objs"; then
2506 if test "$deplibs_check_method" != pass_all
; then
2507 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2511 echo "*** Warning: Linking the shared library $output against the non-libtool"
2512 echo "*** objects $objs is not portable!"
2513 libobjs
="$libobjs $objs"
2517 if test "$dlself" != no
; then
2518 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2522 if test $# -gt 2; then
2523 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2528 if test -z "$rpath"; then
2529 if test "$build_libtool_libs" = yes; then
2530 # Building a libtool convenience library.
2531 # Some compilers have problems with a `.al' extension so
2532 # convenience libraries should have the same extension an
2533 # archive normally would.
2534 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2535 build_libtool_libs
=convenience
2539 if test -n "$vinfo"; then
2540 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2543 if test -n "$release"; then
2544 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2548 # Parse the version information argument.
2549 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2550 set dummy
$vinfo 0 0 0
2553 if test -n "$8"; then
2554 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2563 # Check that each of the things are valid numbers.
2565 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2567 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2568 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2574 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2576 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2577 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2583 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2585 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2586 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2591 if test $age -gt $current; then
2592 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2593 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2597 # Calculate the version variables.
2601 case $version_type in
2605 # Like Linux, but with the current version available in
2606 # verstring for coding it into the library header
2607 major
=.
`expr $current - $age`
2608 versuffix
="$major.$age.$revision"
2609 # Darwin ld doesn't like 0 for these options...
2610 minor_current
=`expr $current + 1`
2611 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2616 versuffix
=".$current.$revision";
2621 versuffix
=".$current";
2625 major
=`expr $current - $age + 1`
2626 verstring
="sgi$major.$revision"
2628 # Add in all the interfaces that we are compatible with.
2630 while test $loop != 0; do
2631 iface
=`expr $revision - $loop`
2632 loop
=`expr $loop - 1`
2633 verstring
="sgi$major.$iface:$verstring"
2636 # Before this point, $major must not contain `.'.
2638 versuffix
="$major.$revision"
2642 major
=.
`expr $current - $age`
2643 versuffix
="$major.$age.$revision"
2647 major
=.
`expr $current - $age`
2648 versuffix
=".$current.$age.$revision"
2649 verstring
="$current.$age.$revision"
2651 # Add in all the interfaces that we are compatible with.
2653 while test $loop != 0; do
2654 iface
=`expr $current - $loop`
2655 loop
=`expr $loop - 1`
2656 verstring
="$verstring:${iface}.0"
2659 # Make executables depend on our current version.
2660 verstring
="$verstring:${current}.0"
2665 versuffix
=".$current.$revision"
2669 # Use '-' rather than '.', since we only want one
2670 # extension on DOS 8.3 filesystems.
2671 major
=`expr $current - $age`
2676 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2677 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2682 # Clear the version info if we defaulted, and they specified a release.
2683 if test -z "$vinfo" && test -n "$release"; then
2685 case $version_type in
2687 # we can't check for "0.0" in archive_cmds due to quoting
2688 # problems, so we reset it completely
2695 if test "$need_version" = no
; then
2702 # Remove version info from name if versioning should be avoided
2703 if test "$avoid_version" = yes && test "$need_version" = no
; then
2709 # Check to see if the archive will have undefined symbols.
2710 if test "$allow_undefined" = yes; then
2711 if test "$allow_undefined_flag" = unsupported
; then
2712 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2713 build_libtool_libs
=no
2717 # Don't allow undefined symbols.
2718 allow_undefined_flag
="$no_undefined_flag"
2722 if test "$mode" != relink
; then
2723 # Remove our outputs, but don't remove object files since they
2724 # may have been created when compiling PIC objects.
2726 tempremovelist
=`echo "$output_objdir/*"`
2727 for p
in $tempremovelist; do
2731 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2732 removelist
="$removelist $p"
2737 if test -n "$removelist"; then
2738 $show "${rm}r $removelist"
2739 $run ${rm}r
$removelist
2743 # Now set the variables for building old libraries.
2744 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2745 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2747 # Transform .lo files to .o files.
2748 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2751 # Eliminate all temporary directories.
2752 for path
in $notinst_path; do
2753 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2754 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2755 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2758 if test -n "$xrpath"; then
2759 # If the user specified any rpath flags, then add them.
2761 for libdir
in $xrpath; do
2762 temp_xrpath
="$temp_xrpath -R$libdir"
2763 case "$finalize_rpath " in
2765 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2768 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2769 dependency_libs
="$temp_xrpath $dependency_libs"
2773 # Make sure dlfiles contains only unique files that won't be dlpreopened
2774 old_dlfiles
="$dlfiles"
2776 for lib
in $old_dlfiles; do
2777 case " $dlprefiles $dlfiles " in
2779 *) dlfiles
="$dlfiles $lib" ;;
2783 # Make sure dlprefiles contains only unique files
2784 old_dlprefiles
="$dlprefiles"
2786 for lib
in $old_dlprefiles; do
2787 case "$dlprefiles " in
2789 *) dlprefiles
="$dlprefiles $lib" ;;
2793 if test "$build_libtool_libs" = yes; then
2794 if test -n "$rpath"; then
2796 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2797 # these systems don't actually have a c library (as such)!
2799 *-*-rhapsody* |
*-*-darwin1.
[012])
2800 # Rhapsody C library is in the System framework
2801 deplibs
="$deplibs -framework System"
2804 # Don't link with libc until the a.out ld.so is fixed.
2807 # Add libc to deplibs on all other systems if necessary.
2808 if test $build_libtool_need_lc = "yes"; then
2809 deplibs
="$deplibs -lc"
2815 # Transform deplibs into only deplibs that can be linked in shared.
2817 libname_save
=$libname
2818 release_save
=$release
2819 versuffix_save
=$versuffix
2821 # I'm not sure if I'm treating the release correctly. I think
2822 # release should show up in the -l (ie -lgmp5) so we don't want to
2823 # add it in twice. Is that correct?
2829 case $deplibs_check_method in
2831 # Don't check for shared/static. Everything works.
2832 # This might be a little naive. We might want to check
2833 # whether the library exists or not. But this is on
2834 # osf3 & osf4 and I'm not really sure... Just
2835 # implementing what was already the behaviour.
2839 # This code stresses the "libraries are programs" paradigm to its
2840 # limits. Maybe even breaks it. We compile a program, linking it
2841 # against the deplibs as a proxy for the library. Then we can check
2842 # whether they linked in statically or dynamically with ldd.
2844 cat > conftest.c
<<EOF
2845 int main() { return 0; }
2848 $LTCC -o conftest conftest.c
$deplibs
2849 if test $?
-eq 0 ; then
2850 ldd_output
=`ldd conftest`
2851 for i
in $deplibs; do
2852 name
="`expr $i : '-l\(.*\)'`"
2853 # If $name is empty we are operating on a -L argument.
2854 if test -n "$name" && test "$name" != "0"; then
2855 libname
=`eval \\$echo \"$libname_spec\"`
2856 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2857 set dummy
$deplib_matches
2859 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2860 newdeplibs
="$newdeplibs $i"
2864 echo "*** Warning: This library needs some functionality provided by $i."
2865 echo "*** I have the capability to make that library automatically link in when"
2866 echo "*** you link to this library. But I can only do this if you have a"
2867 echo "*** shared version of the library, which you do not appear to have."
2870 newdeplibs
="$newdeplibs $i"
2874 # Error occured in the first compile. Let's try to salvage the situation:
2875 # Compile a seperate program for each library.
2876 for i
in $deplibs; do
2877 name
="`expr $i : '-l\(.*\)'`"
2878 # If $name is empty we are operating on a -L argument.
2879 if test -n "$name" && test "$name" != "0"; then
2881 $LTCC -o conftest conftest.c
$i
2883 if test $?
-eq 0 ; then
2884 ldd_output
=`ldd conftest`
2885 libname
=`eval \\$echo \"$libname_spec\"`
2886 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2887 set dummy
$deplib_matches
2889 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2890 newdeplibs
="$newdeplibs $i"
2894 echo "*** Warning: This library needs some functionality provided by $i."
2895 echo "*** I have the capability to make that library automatically link in when"
2896 echo "*** you link to this library. But I can only do this if you have a"
2897 echo "*** shared version of the library, which you do not appear to have."
2902 echo "*** Warning! Library $i is needed by this library but I was not able to"
2903 echo "*** make it link in! You will probably need to install it or some"
2904 echo "*** library that it depends on before this library will be fully"
2905 echo "*** functional. Installing it before continuing would be even better."
2908 newdeplibs
="$newdeplibs $i"
2914 set dummy
$deplibs_check_method
2915 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2916 for a_deplib
in $deplibs; do
2917 name
="`expr $a_deplib : '-l\(.*\)'`"
2918 # If $name is empty we are operating on a -L argument.
2919 if test -n "$name" && test "$name" != "0"; then
2920 libname
=`eval \\$echo \"$libname_spec\"`
2921 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2922 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2923 for potent_lib
in $potential_libs; do
2924 # Follow soft links.
2925 if ls -lLd "$potent_lib" 2>/dev
/null \
2926 |
grep " -> " >/dev
/null
; then
2929 # The statement above tries to avoid entering an
2930 # endless loop below, in case of cyclic links.
2931 # We might still enter an endless loop, since a link
2932 # loop can be closed while we follow links,
2934 potlib
="$potent_lib"
2935 while test -h "$potlib" 2>/dev
/null
; do
2936 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2938 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2939 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2942 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2944 |
egrep "$file_magic_regex" > /dev
/null
; then
2945 newdeplibs
="$newdeplibs $a_deplib"
2951 if test -n "$a_deplib" ; then
2954 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2955 echo "*** I have the capability to make that library automatically link in when"
2956 echo "*** you link to this library. But I can only do this if you have a"
2957 echo "*** shared version of the library, which you do not appear to have."
2960 # Add a -L argument.
2961 newdeplibs
="$newdeplibs $a_deplib"
2963 done # Gone through all deplibs.
2966 set dummy
$deplibs_check_method
2967 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2968 for a_deplib
in $deplibs; do
2969 name
="`expr $a_deplib : '-l\(.*\)'`"
2970 # If $name is empty we are operating on a -L argument.
2971 if test -n "$name" && test "$name" != "0"; then
2972 libname
=`eval \\$echo \"$libname_spec\"`
2973 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2974 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2975 for potent_lib
in $potential_libs; do
2976 if eval echo \"$potent_lib\" 2>/dev
/null \
2978 |
egrep "$match_pattern_regex" > /dev
/null
; then
2979 newdeplibs
="$newdeplibs $a_deplib"
2985 if test -n "$a_deplib" ; then
2988 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2989 echo "*** I have the capability to make that library automatically link in when"
2990 echo "*** you link to this library. But I can only do this if you have a"
2991 echo "*** shared version of the library, which you do not appear to have."
2994 # Add a -L argument.
2995 newdeplibs
="$newdeplibs $a_deplib"
2997 done # Gone through all deplibs.
3001 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
3002 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3003 grep .
>/dev
/null
; then
3005 if test "X$deplibs_check_method" = "Xnone"; then
3006 echo "*** Warning: inter-library dependencies are not supported in this platform."
3008 echo "*** Warning: inter-library dependencies are not known to be supported."
3010 echo "*** All declared inter-library dependencies are being dropped."
3015 versuffix
=$versuffix_save
3017 release
=$release_save
3018 libname
=$libname_save
3022 *-*-rhapsody* |
*-*-darwin1.
[012])
3023 # On Rhapsody replace the C library is the System framework
3024 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3028 if test "$droppeddeps" = yes; then
3029 if test "$module" = yes; then
3031 echo "*** Warning: libtool could not satisfy all declared inter-library"
3032 echo "*** dependencies of module $libname. Therefore, libtool will create"
3033 echo "*** a static module, that should work as long as the dlopening"
3034 echo "*** application is linked with the -dlopen flag."
3035 if test -z "$global_symbol_pipe"; then
3037 echo "*** However, this would only work if libtool was able to extract symbol"
3038 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3039 echo "*** not find such a program. So, this module is probably useless."
3040 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3042 if test "$build_old_libs" = no
; then
3043 oldlibs
="$output_objdir/$libname.$libext"
3044 build_libtool_libs
=module
3047 build_libtool_libs
=no
3050 echo "*** The inter-library dependencies that have been dropped here will be"
3051 echo "*** automatically added whenever a program is linked with this library"
3052 echo "*** or is declared to -dlopen it."
3054 if test $allow_undefined = no
; then
3056 echo "*** Since this library must not contain undefined symbols,"
3057 echo "*** because either the platform does not support them or"
3058 echo "*** it was explicitly requested with -no-undefined,"
3059 echo "*** libtool will only create a static version of it."
3060 if test "$build_old_libs" = no
; then
3061 oldlibs
="$output_objdir/$libname.$libext"
3062 build_libtool_libs
=module
3065 build_libtool_libs
=no
3070 # Time to change all our "foo.framework" stuff back to "-framework foo"
3073 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3074 dependency_libs
=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3077 # Done checking deplibs!
3078 # Done checking deplibs!
3082 # All the library-specific variables (install_libdir is set above).
3087 # Test again, we may have decided not to build it any more
3088 if test "$build_libtool_libs" = yes; then
3089 if test $hardcode_into_libs = yes; then
3090 # Hardcode the library paths
3093 rpath
="$finalize_rpath"
3094 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3095 for libdir
in $rpath; do
3096 if test -n "$hardcode_libdir_flag_spec"; then
3097 if test -n "$hardcode_libdir_separator"; then
3098 if test -z "$hardcode_libdirs"; then
3099 hardcode_libdirs
="$libdir"
3101 # Just accumulate the unique libdirs.
3102 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3103 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3106 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3111 eval flag
=\"$hardcode_libdir_flag_spec\"
3112 dep_rpath
="$dep_rpath $flag"
3114 elif test -n "$runpath_var"; then
3115 case "$perm_rpath " in
3117 *) perm_rpath
="$perm_rpath $libdir" ;;
3121 # Substitute the hardcoded libdirs into the rpath.
3122 if test -n "$hardcode_libdir_separator" &&
3123 test -n "$hardcode_libdirs"; then
3124 libdir
="$hardcode_libdirs"
3125 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3127 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3128 # We should set the runpath_var.
3130 for dir
in $perm_rpath; do
3133 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3135 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3138 shlibpath
="$finalize_shlibpath"
3139 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3140 if test -n "$shlibpath"; then
3141 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3144 # Get the real and link names of the library.
3145 eval library_names
=\"$library_names_spec\"
3146 eval shared_ext
=\"$shrext\"
3147 set dummy
$library_names
3151 if test -n "$soname_spec"; then
3152 eval soname
=\"$soname_spec\"
3156 test -z "$dlname" && dlname
=$soname
3158 lib
="$output_objdir/$realname"
3161 linknames
="$linknames $link"
3164 # # Ensure that we have .o objects for linkers which dislike .lo
3165 # # (e.g. aix) in case we are running --disable-static
3166 # for obj in $libobjs; do
3167 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3168 # if test "X$xdir" = "X$obj"; then
3173 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3174 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3175 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3176 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3177 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3181 # Use standard objects if they are pic
3182 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3184 # Prepare the list of exported symbols
3185 if test -z "$export_symbols"; then
3186 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3187 $show "generating symbol list for \`$libname.la'"
3188 export_symbols
="$output_objdir/$libname.exp"
3189 $run $rm $export_symbols
3190 eval cmds
=\"$export_symbols_cmds\"
3191 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3192 for cmd
in $cmds; do
3195 $run eval "$cmd" ||
exit $?
3198 if test -n "$export_symbols_regex"; then
3199 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3200 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3201 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3202 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3207 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3208 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3211 if test -n "$convenience"; then
3212 if test -n "$whole_archive_flag_spec"; then
3213 save_libobjs
=$libobjs
3214 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3216 gentop
="$output_objdir/${outputname}x"
3217 $show "${rm}r $gentop"
3218 $run ${rm}r
"$gentop"
3219 $show "$mkdir $gentop"
3220 $run $mkdir "$gentop"
3222 if test $status -ne 0 && test ! -d "$gentop"; then
3225 generated
="$generated $gentop"
3227 for xlib
in $convenience; do
3228 # Extract the objects.
3230 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3231 *) xabs
=`pwd`"/$xlib" ;;
3233 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3234 xdir
="$gentop/$xlib"
3236 $show "${rm}r $xdir"
3238 $show "$mkdir $xdir"
3241 if test $status -ne 0 && test ! -d "$xdir"; then
3244 $show "(cd $xdir && $AR x $xabs)"
3245 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3247 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3252 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3253 eval flag
=\"$thread_safe_flag_spec\"
3254 linker_flags
="$linker_flags $flag"
3257 # Make a backup of the uninstalled library when relinking
3258 if test "$mode" = relink
; then
3259 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3262 # Do each of the archive commands.
3263 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3264 eval test_cmds
=\"$archive_expsym_cmds\"
3265 cmds
=$archive_expsym_cmds
3267 eval test_cmds
=\"$archive_cmds\"
3270 if len
=`expr "X$test_cmds" : ".*"` &&
3271 test $len -le $max_cmd_len; then
3274 # The command line is too long to link in one step, link piecewise.
3275 $echo "creating reloadable object files..."
3277 # Save the value of $output and $libobjs because we want to
3278 # use them later. If we have whole_archive_flag_spec, we
3279 # want to use save_libobjs as it was before
3280 # whole_archive_flag_spec was expanded, because we can't
3281 # assume the linker understands whole_archive_flag_spec.
3282 # This may have to be revisited, in case too many
3283 # convenience libraries get linked in and end up exceeding
3285 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3286 save_libobjs
=$libobjs
3290 # Clear the reloadable object creation command queue and
3291 # initialize k to one.
3298 output
=$output_objdir/$save_output-${k}.
$objext
3299 # Loop over the list of objects to be linked.
3300 for obj
in $save_libobjs
3302 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3303 if test "X$objlist" = X ||
3304 { len
=`expr "X$test_cmds" : ".*"` &&
3305 test $len -le $max_cmd_len; }; then
3306 objlist
="$objlist $obj"
3308 # The command $test_cmds is almost too long, add a
3309 # command to the queue.
3310 if test $k -eq 1 ; then
3311 # The first file doesn't have a previous command to add.
3312 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3314 # All subsequent reloadable object files will link in
3315 # the last one created.
3316 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3318 last_robj
=$output_objdir/$save_output-${k}.
$objext
3320 output
=$output_objdir/$save_output-${k}.
$objext
3325 # Handle the remaining objects by creating one last
3326 # reloadable object file. All subsequent reloadable object
3327 # files will link in the last one created.
3328 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3329 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3331 # Set up a command to remove the reloadale object files
3332 # after they are used.
3334 while test $i -lt $k
3337 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3340 $echo "creating a temporary reloadable object file: $output"
3342 # Loop through the commands generated above and execute them.
3343 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3344 for cmd
in $concat_cmds; do
3348 $run eval "$cmd" ||
exit $?
3353 # Restore the value of output.
3356 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3357 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3359 # Expand the library linking commands again to reset the
3360 # value of $libobjs for piecewise linking.
3362 # Do each of the archive commands.
3363 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3364 cmds
=$archive_expsym_cmds
3369 # Append the command to remove the reloadable object files
3370 # to the just-reset $cmds.
3371 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3373 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3374 for cmd
in $cmds; do
3378 $run eval "$cmd" ||
exit $?
3382 # Restore the uninstalled library and exit
3383 if test "$mode" = relink
; then
3384 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3388 # Create links to the real library.
3389 for linkname
in $linknames; do
3390 if test "$realname" != "$linkname"; then
3391 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3392 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3396 # If -module or -export-dynamic was specified, set the dlname.
3397 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3398 # On all known operating systems, these are identical.
3405 if test -n "$deplibs"; then
3406 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3409 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3410 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3413 if test -n "$rpath"; then
3414 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3417 if test -n "$xrpath"; then
3418 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3421 if test -n "$vinfo"; then
3422 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3425 if test -n "$release"; then
3426 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3431 if test -n "$objs$old_deplibs"; then
3432 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3436 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3444 # Delete the old objects.
3445 $run $rm $obj $libobj
3447 # Objects from convenience libraries. This assumes
3448 # single-version convenience libraries. Whenever we create
3449 # different ones for PIC/non-PIC, this we'll have to duplicate
3453 # reload_cmds runs $LD directly, so let us get rid of
3454 # -Wl from whole_archive_flag_spec
3457 if test -n "$convenience"; then
3458 if test -n "$whole_archive_flag_spec"; then
3459 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3461 gentop
="$output_objdir/${obj}x"
3462 $show "${rm}r $gentop"
3463 $run ${rm}r
"$gentop"
3464 $show "$mkdir $gentop"
3465 $run $mkdir "$gentop"
3467 if test $status -ne 0 && test ! -d "$gentop"; then
3470 generated
="$generated $gentop"
3472 for xlib
in $convenience; do
3473 # Extract the objects.
3475 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3476 *) xabs
=`pwd`"/$xlib" ;;
3478 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3479 xdir
="$gentop/$xlib"
3481 $show "${rm}r $xdir"
3483 $show "$mkdir $xdir"
3486 if test $status -ne 0 && test ! -d "$xdir"; then
3489 $show "(cd $xdir && $AR x $xabs)"
3490 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3492 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3497 # Create the old-style object.
3498 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
3501 eval cmds
=\"$reload_cmds\"
3502 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3503 for cmd
in $cmds; do
3506 $run eval "$cmd" ||
exit $?
3510 # Exit if we aren't doing a library object file.
3511 if test -z "$libobj"; then
3512 if test -n "$gentop"; then
3513 $show "${rm}r $gentop"
3520 if test "$build_libtool_libs" != yes; then
3521 if test -n "$gentop"; then
3522 $show "${rm}r $gentop"
3526 # Create an invalid libtool object if no PIC, so that we don't
3527 # accidentally link it into a program.
3528 # $show "echo timestamp > $libobj"
3529 # $run eval "echo timestamp > $libobj" || exit $?
3533 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3534 # Only do commands if we really have different PIC objects.
3535 reload_objs
="$libobjs $reload_conv_objs"
3537 eval cmds
=\"$reload_cmds\"
3538 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3539 for cmd
in $cmds; do
3542 $run eval "$cmd" ||
exit $?
3546 # # Just create a symlink.
3549 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3550 # if test "X$xdir" = "X$libobj"; then
3555 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3556 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3557 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3558 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3561 if test -n "$gentop"; then
3562 $show "${rm}r $gentop"
3571 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3573 if test -n "$vinfo"; then
3574 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3577 if test -n "$release"; then
3578 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3581 if test "$preload" = yes; then
3582 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3583 test "$dlopen_self_static" = unknown
; then
3584 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3589 *-*-rhapsody* |
*-*-darwin1.
[012])
3590 # On Rhapsody replace the C library is the System framework
3591 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3592 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3598 # Don't allow lazy linking, it breaks C++ global constructors
3599 if test "$tagname" = CXX
; then
3600 compile_command
="$compile_command ${wl}-bind_at_load"
3601 finalize_command
="$finalize_command ${wl}-bind_at_load"
3603 # Time to change all our "foo.framework" stuff back to "-framework foo"
3604 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3605 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3609 compile_command
="$compile_command $compile_deplibs"
3610 finalize_command
="$finalize_command $finalize_deplibs"
3612 if test -n "$rpath$xrpath"; then
3613 # If the user specified any rpath flags, then add them.
3614 for libdir
in $rpath $xrpath; do
3615 # This is the magic to use -rpath.
3616 case "$finalize_rpath " in
3618 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3623 # Now hardcode the library paths
3626 for libdir
in $compile_rpath $finalize_rpath; do
3627 if test -n "$hardcode_libdir_flag_spec"; then
3628 if test -n "$hardcode_libdir_separator"; then
3629 if test -z "$hardcode_libdirs"; then
3630 hardcode_libdirs
="$libdir"
3632 # Just accumulate the unique libdirs.
3633 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3634 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3637 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3642 eval flag
=\"$hardcode_libdir_flag_spec\"
3643 rpath
="$rpath $flag"
3645 elif test -n "$runpath_var"; then
3646 case "$perm_rpath " in
3648 *) perm_rpath
="$perm_rpath $libdir" ;;
3652 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3653 case :$dllsearchpath: in
3655 *) dllsearchpath
="$dllsearchpath:$libdir";;
3660 # Substitute the hardcoded libdirs into the rpath.
3661 if test -n "$hardcode_libdir_separator" &&
3662 test -n "$hardcode_libdirs"; then
3663 libdir
="$hardcode_libdirs"
3664 eval rpath
=\" $hardcode_libdir_flag_spec\"
3666 compile_rpath
="$rpath"
3670 for libdir
in $finalize_rpath; do
3671 if test -n "$hardcode_libdir_flag_spec"; then
3672 if test -n "$hardcode_libdir_separator"; then
3673 if test -z "$hardcode_libdirs"; then
3674 hardcode_libdirs
="$libdir"
3676 # Just accumulate the unique libdirs.
3677 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3678 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3681 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3686 eval flag
=\"$hardcode_libdir_flag_spec\"
3687 rpath
="$rpath $flag"
3689 elif test -n "$runpath_var"; then
3690 case "$finalize_perm_rpath " in
3692 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3696 # Substitute the hardcoded libdirs into the rpath.
3697 if test -n "$hardcode_libdir_separator" &&
3698 test -n "$hardcode_libdirs"; then
3699 libdir
="$hardcode_libdirs"
3700 eval rpath
=\" $hardcode_libdir_flag_spec\"
3702 finalize_rpath
="$rpath"
3705 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3706 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3707 dlsyms
="${outputname}S.c"
3709 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3713 if test -n "$dlsyms"; then
3717 # Discover the nlist of each of the dlfiles.
3718 nlist
="$output_objdir/${outputname}.nm"
3720 $show "$rm $nlist ${nlist}S ${nlist}T"
3721 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3723 # Parse the name list into a source file.
3724 $show "creating $output_objdir/$dlsyms"
3726 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3727 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3728 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3734 /* Prevent the only kind of declaration conflicts we can make. */
3735 #define lt_preloaded_symbols some_other_symbol
3737 /* External symbol declarations for the compiler. */\
3740 if test "$dlself" = yes; then
3741 $show "generating symbol list for \`$output'"
3743 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3745 # Add our own program objects to the symbol list.
3746 progfiles
="$objs$old_deplibs"
3747 for arg
in $progfiles; do
3748 $show "extracting global C symbols from \`$arg'"
3749 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3752 if test -n "$exclude_expsyms"; then
3753 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3754 $run eval '$mv "$nlist"T "$nlist"'
3757 if test -n "$export_symbols_regex"; then
3758 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3759 $run eval '$mv "$nlist"T "$nlist"'
3762 # Prepare the list of exported symbols
3763 if test -z "$export_symbols"; then
3764 export_symbols
="$output_objdir/$output.exp"
3765 $run $rm $export_symbols
3766 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3768 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3769 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3770 $run eval 'mv "$nlist"T "$nlist"'
3774 for arg
in $dlprefiles; do
3775 $show "extracting global C symbols from \`$arg'"
3776 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3777 $run eval 'echo ": $name " >> "$nlist"'
3778 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3781 if test -z "$run"; then
3782 # Make sure we have at least an empty file.
3783 test -f "$nlist" ||
: > "$nlist"
3785 if test -n "$exclude_expsyms"; then
3786 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3787 $mv "$nlist"T
"$nlist"
3790 # Try sorting and uniquifying the output.
3791 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3794 grep -v "^: " < "$nlist" > "$nlist"S
3797 if test -f "$nlist"S
; then
3798 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3800 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3803 $echo >> "$output_objdir/$dlsyms" "\
3805 #undef lt_preloaded_symbols
3807 #if defined (__STDC__) && __STDC__
3808 # define lt_ptr_t void *
3810 # define lt_ptr_t char *
3814 /* The mapping between symbol names and symbols. */
3819 lt_preloaded_symbols[] =
3823 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3824 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3825 < "$nlist" >> "$output_objdir/$dlsyms"
3827 $echo >> "$output_objdir/$dlsyms" "\
3831 /* This works around a problem in FreeBSD linker */
3832 #ifdef FREEBSD_WORKAROUND
3833 static const void *lt_preloaded_setup() {
3834 return lt_preloaded_symbols;
3844 pic_flag_for_symtable
=
3846 # compiling the symbol table file with pic_flag works around
3847 # a FreeBSD bug that causes programs to crash when -lm is
3848 # linked before any other PIC object. But we must not use
3849 # pic_flag when linking with -static. The problem exists in
3850 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3851 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3852 case "$compile_command " in
3854 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3857 case "$compile_command " in
3859 *) pic_flag_for_symtable
=" $pic_flag";;
3863 # Now compile the dynamic symbol file.
3864 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3865 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3867 # Clean up the generated files.
3868 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3869 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3871 # Transform the symbol file into the correct name.
3872 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3873 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3876 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3881 # We keep going just in case the user didn't refer to
3882 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3883 # really was required.
3885 # Nullify the symbol file.
3886 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3887 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3890 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3891 # Replace the output file specification.
3892 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3893 link_command
="$compile_command$compile_rpath"
3895 # We have no uninstalled library dependencies, so finalize right now.
3896 $show "$link_command"
3897 $run eval "$link_command"
3900 # Delete the generated files.
3901 if test -n "$dlsyms"; then
3902 $show "$rm $output_objdir/${outputname}S.${objext}"
3903 $run $rm "$output_objdir/${outputname}S.${objext}"
3909 if test -n "$shlibpath_var"; then
3910 # We should set the shlibpath_var
3912 for dir
in $temp_rpath; do
3914 [\\/]* |
[A-Za-z
]:[\\/]*)
3919 # Relative path: add a thisdir entry.
3920 rpath
="$rpath\$thisdir/$dir:"
3927 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3928 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3930 if test -n "$finalize_shlibpath"; then
3931 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3936 if test -n "$runpath_var"; then
3937 if test -n "$perm_rpath"; then
3938 # We should set the runpath_var.
3940 for dir
in $perm_rpath; do
3943 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3945 if test -n "$finalize_perm_rpath"; then
3946 # We should set the runpath_var.
3948 for dir
in $finalize_perm_rpath; do
3951 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3955 if test "$no_install" = yes; then
3956 # We don't need to create a wrapper script.
3957 link_command
="$compile_var$compile_command$compile_rpath"
3958 # Replace the output file specification.
3959 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3960 # Delete the old output file.
3962 # Link the executable and exit
3963 $show "$link_command"
3964 $run eval "$link_command" ||
exit $?
3968 if test "$hardcode_action" = relink
; then
3969 # Fast installation is not supported
3970 link_command
="$compile_var$compile_command$compile_rpath"
3971 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3973 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3974 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3976 if test "$fast_install" != no
; then
3977 link_command
="$finalize_var$compile_command$finalize_rpath"
3978 if test "$fast_install" = yes; then
3979 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3981 # fast_install is set to needless
3985 link_command
="$compile_var$compile_command$compile_rpath"
3986 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3990 # Replace the output file specification.
3991 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3993 # Delete the old output files.
3994 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3996 $show "$link_command"
3997 $run eval "$link_command" ||
exit $?
3999 # Now create the wrapper script.
4000 $show "creating $output"
4002 # Quote the relink command for shipping.
4003 if test -n "$relink_command"; then
4004 # Preserve any variables that may affect compiler behavior
4005 for var
in $variables_saved_for_relink; do
4006 if eval test -z \"\
${$var+set}\"; then
4007 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4008 elif eval var_value
=\$
$var; test -z "$var_value"; then
4009 relink_command
="$var=; export $var; $relink_command"
4011 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4012 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4015 relink_command
="cd `pwd`; $relink_command"
4016 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4019 # Quote $echo for shipping.
4020 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4022 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4023 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4025 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4027 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4030 # Only actually do things if our run command is non-null.
4031 if test -z "$run"; then
4032 # win32 will think the script is a binary if it has
4033 # a .exe suffix, so we strip it off here.
4035 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
4037 # test for cygwin because mv fails w/o .exe extensions
4039 *cygwin
*) exeext
=.exe
;;
4043 trap "$rm $output; exit 1" 1 2 15
4048 # $output - temporary wrapper script for $objdir/$outputname
4049 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4051 # The $output program cannot be directly executed until all the libtool
4052 # libraries that it depends on are installed.
4054 # This wrapper script should never be moved out of the build directory.
4055 # If it is, it will not operate correctly.
4057 # Sed substitution that helps us do robust quoting. It backslashifies
4058 # metacharacters that are still active within double-quoted strings.
4059 Xsed='sed -e 1s/^X//'
4060 sed_quote_subst='$sed_quote_subst'
4062 # The HP-UX ksh and POSIX shell print the target directory to stdout
4064 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4066 relink_command=\"$relink_command\"
4068 # This environment variable determines our operation mode.
4069 if test \"\$libtool_install_magic\" = \"$magic\"; then
4070 # install mode needs the following variable:
4071 notinst_deplibs='$notinst_deplibs'
4073 # When we are sourced in execute mode, \$file and \$echo are already set.
4074 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4077 # Make sure echo works.
4078 if test \"X\$1\" = X--no-reexec; then
4079 # Discard the --no-reexec flag, and continue.
4081 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4082 # Yippee, \$echo works!
4085 # Restart under the correct shell, and then maybe \$echo will work.
4086 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4092 # Find the directory that this script lives in.
4093 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4094 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4096 # Follow symbolic links until we get to the real thisdir.
4097 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4098 while test -n \"\$file\"; do
4099 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4101 # If there was a directory component, then change thisdir.
4102 if test \"x\$destdir\" != \"x\$file\"; then
4103 case \"\$destdir\" in
4104 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4105 *) thisdir=\"\$thisdir/\$destdir\" ;;
4109 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4110 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4113 # Try to get the absolute directory name.
4114 absdir=\`cd \"\$thisdir\" && pwd\`
4115 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4118 if test "$fast_install" = yes; then
4120 program=lt-'$outputname'$exeext
4121 progdir=\"\$thisdir/$objdir\"
4123 if test ! -f \"\$progdir/\$program\" || \\
4124 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4125 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4127 file=\"\$\$-\$program\"
4129 if test ! -d \"\$progdir\"; then
4130 $mkdir \"\$progdir\"
4132 $rm \"\$progdir/\$file\"
4137 # relink executable if necessary
4138 if test -n \"\$relink_command\"; then
4139 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4141 $echo \"\$relink_command_output\" >&2
4142 $rm \"\$progdir/\$file\"
4147 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4148 { $rm \"\$progdir/\$program\";
4149 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4150 $rm \"\$progdir/\$file\"
4154 program='$outputname'
4155 progdir=\"\$thisdir/$objdir\"
4161 if test -f \"\$progdir/\$program\"; then"
4163 # Export our shlibpath_var if we have one.
4164 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4166 # Add our own library path to $shlibpath_var
4167 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4169 # Some systems cannot cope with colon-terminated $shlibpath_var
4170 # The second colon is a workaround for a bug in BeOS R4 sed
4171 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4173 export $shlibpath_var
4177 # fixup the dll searchpath if we need to.
4178 if test -n "$dllsearchpath"; then
4180 # Add the dll search path components to the executable PATH
4181 PATH=$dllsearchpath:\$PATH
4186 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4187 # Run the actual program with our arguments.
4190 # win32 systems need to use the prog path for dll
4192 *-*-cygwin* |
*-*-pw32*)
4194 exec \$progdir/\$program \${1+\"\$@\"}
4198 # Backslashes separate directories on plain windows
4199 *-*-mingw |
*-*-os2*)
4201 exec \$progdir\\\\\$program \${1+\"\$@\"}
4207 # Export the path to the program.
4208 PATH=\"\$progdir:\$PATH\"
4211 exec \$program \${1+\"\$@\"}
4216 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4220 # The program doesn't exist.
4221 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4222 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4223 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4234 # See if we need to build an old-fashioned archive.
4235 for oldlib
in $oldlibs; do
4237 if test "$build_libtool_libs" = convenience
; then
4238 oldobjs
="$libobjs_save"
4239 addlibs
="$convenience"
4240 build_libtool_libs
=no
4242 if test "$build_libtool_libs" = module
; then
4243 oldobjs
="$libobjs_save"
4244 build_libtool_libs
=no
4246 oldobjs
="$objs$old_deplibs $non_pic_objects"
4248 addlibs
="$old_convenience"
4251 if test -n "$addlibs"; then
4252 gentop
="$output_objdir/${outputname}x"
4253 $show "${rm}r $gentop"
4254 $run ${rm}r
"$gentop"
4255 $show "$mkdir $gentop"
4256 $run $mkdir "$gentop"
4258 if test $status -ne 0 && test ! -d "$gentop"; then
4261 generated
="$generated $gentop"
4263 # Add in members from convenience archives.
4264 for xlib
in $addlibs; do
4265 # Extract the objects.
4267 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4268 *) xabs
=`pwd`"/$xlib" ;;
4270 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4271 xdir
="$gentop/$xlib"
4273 $show "${rm}r $xdir"
4275 $show "$mkdir $xdir"
4278 if test $status -ne 0 && test ! -d "$xdir"; then
4281 $show "(cd $xdir && $AR x $xabs)"
4282 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4284 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4288 # Do each command in the archive commands.
4289 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4290 eval cmds
=\"$old_archive_from_new_cmds\"
4292 # # Ensure that we have .o objects in place in case we decided
4293 # # not to build a shared library, and have fallen back to building
4294 # # static libs even though --disable-static was passed!
4295 # for oldobj in $oldobjs; do
4296 # if test ! -f $oldobj; then
4297 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4298 # if test "X$xdir" = "X$oldobj"; then
4303 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4304 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4305 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4306 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4310 # POSIX demands no paths to be encoded in archives. We have
4311 # to avoid creating archives with duplicate basenames if we
4312 # might have to extract them afterwards, e.g., when creating a
4313 # static archive out of a convenience library, or when linking
4314 # the entirety of a libtool archive into another (currently
4315 # not supported by libtool).
4316 if (for obj
in $oldobjs
4318 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4319 done |
sort |
sort -uc >/dev
/null
2>&1); then
4322 $echo "copying selected object files to avoid basename conflicts..."
4324 if test -z "$gentop"; then
4325 gentop
="$output_objdir/${outputname}x"
4327 $show "${rm}r $gentop"
4328 $run ${rm}r
"$gentop"
4329 $show "$mkdir $gentop"
4330 $run $mkdir "$gentop"
4332 if test $status -ne 0 && test ! -d "$gentop"; then
4335 generated
="$generated $gentop"
4338 save_oldobjs
=$oldobjs
4341 for obj
in $save_oldobjs
4343 objbase
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
4344 case " $oldobjs " in
4345 " ") oldobjs
=$obj ;;
4348 # Make sure we don't pick an alternate name that also
4350 newobj
=lt
$counter-$objbase
4351 counter
=`expr $counter + 1`
4352 case " $oldobjs " in
4353 *[\
/]"$newobj "*) ;;
4354 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
4357 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
4358 $run ln "$obj" "$gentop/$newobj" ||
4359 $run cp "$obj" "$gentop/$newobj"
4360 oldobjs
="$oldobjs $gentop/$newobj"
4362 *) oldobjs
="$oldobjs $obj" ;;
4367 eval cmds
=\"$old_archive_cmds\"
4369 if len
=`expr "X$cmds" : ".*"` &&
4370 test $len -le $max_cmd_len; then
4373 # the command line is too long to link in one step, link in parts
4374 $echo "using piecewise archive linking..."
4379 save_oldobjs
=$oldobjs
4381 for obj
in $save_oldobjs
4383 oldobjs
="$objlist $obj"
4384 objlist
="$objlist $obj"
4385 eval test_cmds
=\"$old_archive_cmds\"
4386 if len
=`expr "X$test_cmds" : ".*"` &&
4387 test $len -le $max_cmd_len; then
4390 # the above command should be used before it gets too long
4392 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4393 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4399 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4402 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4403 for cmd
in $cmds; do
4406 $run eval "$cmd" ||
exit $?
4411 if test -n "$generated"; then
4412 $show "${rm}r$generated"
4413 $run ${rm}r
$generated
4416 # Now create the libtool archive.
4420 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4421 $show "creating $output"
4423 # Preserve any variables that may affect compiler behavior
4424 for var
in $variables_saved_for_relink; do
4425 if eval test -z \"\
${$var+set}\"; then
4426 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4427 elif eval var_value
=\$
$var; test -z "$var_value"; then
4428 relink_command
="$var=; export $var; $relink_command"
4430 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4431 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4434 # Quote the link command for shipping.
4436 for tag
in $taglist; do
4437 tagopts
="$tagopts --tag $tag"
4439 relink_command
="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args)"
4440 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4442 # Only create the output if not a dry run.
4443 if test -z "$run"; then
4444 for installed
in no
yes; do
4445 if test "$installed" = yes; then
4446 if test -z "$install_libdir"; then
4449 output
="$output_objdir/$outputname"i
4450 # Replace all uninstalled libtool libraries with the installed ones
4452 for deplib
in $dependency_libs; do
4455 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4456 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4457 if test -z "$libdir"; then
4458 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4461 newdependency_libs
="$newdependency_libs $libdir/$name"
4463 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4466 dependency_libs
="$newdependency_libs"
4468 for lib
in $dlfiles; do
4469 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4470 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4471 if test -z "$libdir"; then
4472 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4475 newdlfiles
="$newdlfiles $libdir/$name"
4477 dlfiles
="$newdlfiles"
4479 for lib
in $dlprefiles; do
4480 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4481 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4482 if test -z "$libdir"; then
4483 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4486 newdlprefiles
="$newdlprefiles $libdir/$name"
4488 dlprefiles
="$newdlprefiles"
4491 # place dlname in correct position for cygwin
4493 case $host,$output,$installed,$module,$dlname in
4494 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4497 # $outputname - a libtool library file
4498 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4500 # Please DO NOT delete this file!
4501 # It is necessary for linking the library.
4503 # The name that we can dlopen(3).
4506 # Names of this library.
4507 library_names='$library_names'
4509 # The name of the static archive.
4510 old_library='$old_library'
4512 # Libraries that this one depends upon.
4513 dependency_libs='$dependency_libs'
4515 # Version information for $libname.
4520 # Is this an already installed library?
4521 installed=$installed
4523 # Files to dlopen/dlpreopen
4525 dlpreopen='$dlprefiles'
4527 # Directory that this library needs to be installed in:
4528 libdir='$install_libdir'"
4529 if test "$installed" = no
&& test $need_relink = yes; then
4531 relink_command=\"$relink_command\""
4536 # Do a symbolic link so that the libtool archive can be found in
4537 # LD_LIBRARY_PATH before the program is installed.
4538 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4539 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4545 # libtool install mode
4547 modename
="$modename: install"
4549 # There may be an optional sh(1) argument at the beginning of
4550 # install_prog (especially on Windows NT).
4551 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4552 # Allow the use of GNU shtool's install command.
4553 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4554 # Aesthetically quote it.
4555 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4557 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4561 install_prog
="$arg "
4569 # The real first argument should be the name of the installation program.
4570 # Aesthetically quote it.
4571 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4573 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4577 install_prog
="$install_prog$arg"
4579 # We need to accept at least all the BSD install flags.
4589 if test -n "$dest"; then
4590 files
="$files $dest"
4608 # If the previous option needed an argument, then skip it.
4609 if test -n "$prev"; then
4618 # Aesthetically quote the argument.
4619 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4621 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4625 install_prog
="$install_prog $arg"
4628 if test -z "$install_prog"; then
4629 $echo "$modename: you must specify an install program" 1>&2
4634 if test -n "$prev"; then
4635 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4640 if test -z "$files"; then
4641 if test -z "$dest"; then
4642 $echo "$modename: no file or destination specified" 1>&2
4644 $echo "$modename: you must specify a destination" 1>&2
4650 # Strip any trailing slash from the destination.
4651 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4653 # Check to see that the destination is a directory.
4654 test -d "$dest" && isdir
=yes
4655 if test "$isdir" = yes; then
4659 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4660 test "X$destdir" = "X$dest" && destdir
=.
4661 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4663 # Not a directory, so check to see that there is only one file specified.
4665 if test $# -gt 2; then
4666 $echo "$modename: \`$dest' is not a directory" 1>&2
4672 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4674 for file in $files; do
4678 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4687 # This variable tells wrapper scripts just to set variables rather
4688 # than running their programs.
4689 libtool_install_magic
="$magic"
4694 for file in $files; do
4696 # Do each installation.
4699 # Do the static libraries later.
4700 staticlibs
="$staticlibs $file"
4704 # Check to see that this really is a libtool archive.
4705 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4707 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4715 # If there is no directory component, then add one.
4717 */* |
*\\*) .
$file ;;
4721 # Add the libdir to current_libdirs if it is the destination.
4722 if test "X$destdir" = "X$libdir"; then
4723 case "$current_libdirs " in
4725 *) current_libdirs
="$current_libdirs $libdir" ;;
4728 # Note the libdir as a future libdir.
4729 case "$future_libdirs " in
4731 *) future_libdirs
="$future_libdirs $libdir" ;;
4735 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4736 test "X$dir" = "X$file/" && dir
=
4739 if test -n "$relink_command"; then
4740 $echo "$modename: warning: relinking \`$file'" 1>&2
4741 $show "$relink_command"
4742 if $run eval "$relink_command"; then :
4744 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4749 # See the names of the shared library.
4750 set dummy
$library_names
4751 if test -n "$2"; then
4757 test -n "$relink_command" && srcname
="$realname"T
4759 # Install the shared library and build the symlinks.
4760 $show "$install_prog $dir/$srcname $destdir/$realname"
4761 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4762 if test -n "$stripme" && test -n "$striplib"; then
4763 $show "$striplib $destdir/$realname"
4764 $run eval "$striplib $destdir/$realname" ||
exit $?
4767 if test $# -gt 0; then
4768 # Delete the old symlinks, and create new ones.
4771 if test "$linkname" != "$realname"; then
4772 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4773 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4778 # Do each command in the postinstall commands.
4779 lib
="$destdir/$realname"
4780 eval cmds
=\"$postinstall_cmds\"
4781 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4782 for cmd
in $cmds; do
4785 $run eval "$cmd" ||
exit $?
4790 # Install the pseudo-library for information purposes.
4791 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4792 instname
="$dir/$name"i
4793 $show "$install_prog $instname $destdir/$name"
4794 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4796 # Maybe install the static library, too.
4797 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4801 # Install (i.e. copy) a libtool object.
4803 # Figure out destination file name, if it wasn't already specified.
4804 if test -n "$destname"; then
4805 destfile
="$destdir/$destname"
4807 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4808 destfile
="$destdir/$destfile"
4811 # Deduce the name of the destination old-style object file.
4814 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4817 staticdest
="$destfile"
4821 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4827 # Install the libtool object if requested.
4828 if test -n "$destfile"; then
4829 $show "$install_prog $file $destfile"
4830 $run eval "$install_prog $file $destfile" ||
exit $?
4833 # Install the old object if enabled.
4834 if test "$build_old_libs" = yes; then
4835 # Deduce the name of the old-style object file.
4836 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4838 $show "$install_prog $staticobj $staticdest"
4839 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4845 # Figure out destination file name, if it wasn't already specified.
4846 if test -n "$destname"; then
4847 destfile
="$destdir/$destname"
4849 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4850 destfile
="$destdir/$destfile"
4853 # Do a test to see if this is really a libtool program.
4854 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4858 # If there is no directory component, then add one.
4860 */* |
*\\*) .
$file ;;
4864 # Check the variables that should have been set.
4865 if test -z "$notinst_deplibs"; then
4866 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4871 for lib
in $notinst_deplibs; do
4872 # Check to see that each library is installed.
4874 if test -f "$lib"; then
4875 # If there is no directory component, then add one.
4877 */* |
*\\*) .
$lib ;;
4881 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4882 if test -n "$libdir" && test ! -f "$libfile"; then
4883 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4889 # If there is no directory component, then add one.
4891 */* |
*\\*) .
$file ;;
4896 if test "$fast_install" = no
&& test -n "$relink_command"; then
4897 if test "$finalize" = yes && test -z "$run"; then
4899 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4900 tmpdir
="$tmpdir/libtool-$$"
4901 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4903 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4906 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4907 outputname
="$tmpdir/$file"
4908 # Replace the output file specification.
4909 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4911 $show "$relink_command"
4912 if $run eval "$relink_command"; then :
4914 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4920 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4923 # Install the binary that we compiled earlier.
4924 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4929 # remove .exe since cygwin /usr/bin/install will append another
4931 case $install_prog,$host in
4932 */usr
/bin
/install*,*cygwin
*)
4933 case $file:$destfile in
4938 destfile
=$destfile.exe
4941 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
4947 $show "$install_prog$stripme $file $destfile"
4948 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4949 test -n "$outputname" && ${rm}r
"$tmpdir"
4954 for file in $staticlibs; do
4955 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4957 # Set up the ranlib parameters.
4958 oldlib
="$destdir/$name"
4960 $show "$install_prog $file $oldlib"
4961 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4963 if test -n "$stripme" && test -n "$striplib"; then
4964 $show "$old_striplib $oldlib"
4965 $run eval "$old_striplib $oldlib" ||
exit $?
4968 # Do each command in the postinstall commands.
4969 eval cmds
=\"$old_postinstall_cmds\"
4970 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4971 for cmd
in $cmds; do
4974 $run eval "$cmd" ||
exit $?
4979 if test -n "$future_libdirs"; then
4980 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4983 if test -n "$current_libdirs"; then
4984 # Maybe just do a dry run.
4985 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4986 exec_cmd
='$SHELL $0 --finish$current_libdirs'
4992 # libtool finish mode
4994 modename
="$modename: finish"
4998 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5001 libdirs
="$libdirs $dir"
5004 for libdir
in $libdirs; do
5005 if test -n "$finish_cmds"; then
5006 # Do each command in the finish commands.
5007 eval cmds
=\"$finish_cmds\"
5008 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5009 for cmd
in $cmds; do
5012 $run eval "$cmd" || admincmds
="$admincmds
5017 if test -n "$finish_eval"; then
5018 # Do the single finish_eval.
5019 eval cmds
=\"$finish_eval\"
5020 $run eval "$cmds" || admincmds
="$admincmds
5026 # Exit here if they wanted silent mode.
5027 test "$show" = ":" && exit 0
5029 echo "----------------------------------------------------------------------"
5030 echo "Libraries have been installed in:"
5031 for libdir
in $libdirs; do
5035 echo "If you ever happen to want to link against installed libraries"
5036 echo "in a given directory, LIBDIR, you must either use libtool, and"
5037 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5038 echo "flag during linking and do at least one of the following:"
5039 if test -n "$shlibpath_var"; then
5040 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5041 echo " during execution"
5043 if test -n "$runpath_var"; then
5044 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5045 echo " during linking"
5047 if test -n "$hardcode_libdir_flag_spec"; then
5049 eval flag
=\"$hardcode_libdir_flag_spec\"
5051 echo " - use the \`$flag' linker flag"
5053 if test -n "$admincmds"; then
5054 echo " - have your system administrator run these commands:$admincmds"
5056 if test -f /etc
/ld.so.conf
; then
5057 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5060 echo "See any operating system documentation about shared libraries for"
5061 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5062 echo "----------------------------------------------------------------------"
5066 # libtool execute mode
5068 modename
="$modename: execute"
5070 # The first argument is the command name.
5072 if test -z "$cmd"; then
5073 $echo "$modename: you must specify a COMMAND" 1>&2
5078 # Handle -dlopen flags immediately.
5079 for file in $execute_dlfiles; do
5080 if test ! -f "$file"; then
5081 $echo "$modename: \`$file' is not a file" 1>&2
5089 # Check to see that this really is a libtool archive.
5090 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5092 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5097 # Read the libtool library.
5101 # If there is no directory component, then add one.
5103 */* |
*\\*) .
$file ;;
5107 # Skip this library if it cannot be dlopened.
5108 if test -z "$dlname"; then
5109 # Warn if it was a shared library.
5110 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5114 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5115 test "X$dir" = "X$file" && dir
=.
5117 if test -f "$dir/$objdir/$dlname"; then
5120 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5126 # Just add the directory containing the .lo file.
5127 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5128 test "X$dir" = "X$file" && dir
=.
5132 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5137 # Get the absolute pathname.
5138 absdir
=`cd "$dir" && pwd`
5139 test -n "$absdir" && dir
="$absdir"
5141 # Now add the directory to shlibpath_var.
5142 if eval "test -z \"\$$shlibpath_var\""; then
5143 eval "$shlibpath_var=\"\$dir\""
5145 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5149 # This variable tells wrapper scripts just to set shlibpath_var
5150 # rather than running their programs.
5151 libtool_execute_magic
="$magic"
5153 # Check if any of the arguments is a wrapper script.
5160 # Do a test to see if this is really a libtool program.
5161 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5162 # If there is no directory component, then add one.
5164 */* |
*\\*) .
$file ;;
5168 # Transform arg to wrapped name.
5169 file="$progdir/$program"
5173 # Quote arguments (to preserve shell metacharacters).
5174 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5175 args
="$args \"$file\""
5178 if test -z "$run"; then
5179 if test -n "$shlibpath_var"; then
5180 # Export the shlibpath_var.
5181 eval "export $shlibpath_var"
5184 # Restore saved enviroment variables
5185 if test "${save_LC_ALL+set}" = set; then
5186 LC_ALL
="$save_LC_ALL"; export LC_ALL
5188 if test "${save_LANG+set}" = set; then
5189 LANG
="$save_LANG"; export LANG
5192 # Now prepare to actually exec the command.
5193 exec_cmd
='"$cmd"$args'
5195 # Display what would be done.
5196 if test -n "$shlibpath_var"; then
5197 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5198 $echo "export $shlibpath_var"
5205 # libtool clean and uninstall mode
5207 modename
="$modename: $mode"
5213 # This variable tells wrapper scripts just to set variables rather
5214 # than running their programs.
5215 libtool_install_magic
="$magic"
5220 -f) rm="$rm $arg"; rmforce
=yes ;;
5221 -*) rm="$rm $arg" ;;
5222 *) files
="$files $arg" ;;
5226 if test -z "$rm"; then
5227 $echo "$modename: you must specify an RM program" 1>&2
5234 for file in $files; do
5235 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5236 if test "X$dir" = "X$file"; then
5240 objdir
="$dir/$objdir"
5242 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5243 test $mode = uninstall
&& objdir
="$dir"
5245 # Remember objdir for removal later, being careful to avoid duplicates
5246 if test $mode = clean
; then
5249 *) rmdirs
="$rmdirs $objdir" ;;
5253 # Don't error if the file doesn't exist and rm -f was used.
5254 if (test -L "$file") >/dev
/null
2>&1 \
5255 ||
(test -h "$file") >/dev
/null
2>&1 \
5256 ||
test -f "$file"; then
5258 elif test -d "$file"; then
5261 elif test "$rmforce" = yes; then
5269 # Possibly a libtool archive, so verify it.
5270 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5273 # Delete the libtool libraries and symlinks.
5274 for n
in $library_names; do
5275 rmfiles
="$rmfiles $objdir/$n"
5277 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5278 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5280 if test $mode = uninstall
; then
5281 if test -n "$library_names"; then
5282 # Do each command in the postuninstall commands.
5283 eval cmds
=\"$postuninstall_cmds\"
5284 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5285 for cmd
in $cmds; do
5289 if test $?
!= 0 && test "$rmforce" != yes; then
5296 if test -n "$old_library"; then
5297 # Do each command in the old_postuninstall commands.
5298 eval cmds
=\"$old_postuninstall_cmds\"
5299 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5300 for cmd
in $cmds; do
5304 if test $?
!= 0 && test "$rmforce" != yes; then
5310 # FIXME: should reinstall the best remaining shared library.
5316 # Possibly a libtool object, so verify it.
5317 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5322 # Add PIC object to the list of files to remove.
5323 if test -n "$pic_object" \
5324 && test "$pic_object" != none
; then
5325 rmfiles
="$rmfiles $dir/$pic_object"
5328 # Add non-PIC object to the list of files to remove.
5329 if test -n "$non_pic_object" \
5330 && test "$non_pic_object" != none
; then
5331 rmfiles
="$rmfiles $dir/$non_pic_object"
5337 # Do a test to see if this is a libtool program.
5338 if test $mode = clean
&&
5339 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5343 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5344 if test "$fast_install" = yes && test -n "$relink_command"; then
5345 rmfiles
="$rmfiles $objdir/lt-$name"
5350 $show "$rm $rmfiles"
5351 $run $rm $rmfiles || exit_status
=1
5354 # Try to remove the ${objdir}s in the directories where we deleted files
5355 for dir
in $rmdirs; do
5356 if test -d "$dir"; then
5358 $run rmdir $dir >/dev
/null
2>&1
5366 $echo "$modename: you must specify a MODE" 1>&2
5367 $echo "$generic_help" 1>&2
5372 if test -z "$exec_cmd"; then
5373 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5374 $echo "$generic_help" 1>&2
5377 fi # test -z "$show_help"
5379 if test -n "$exec_cmd"; then
5384 # We need to display help for each of the modes.
5387 "Usage: $modename [OPTION]... [MODE-ARG]...
5389 Provide generalized library-building support services.
5391 --config show all configuration variables
5392 --debug enable verbose shell tracing
5393 -n, --dry-run display commands without modifying any files
5394 --features display basic configuration information and exit
5395 --finish same as \`--mode=finish'
5396 --help display this help message and exit
5397 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5398 --quiet same as \`--silent'
5399 --silent don't print informational messages
5400 --tag=TAG use configuration variables from tag TAG
5401 --version print version information
5403 MODE must be one of the following:
5405 clean remove files from the build directory
5406 compile compile a source file into a libtool object
5407 execute automatically set library path, then run a program
5408 finish complete the installation of libtool libraries
5409 install install libraries or executables
5410 link create a library or an executable
5411 uninstall remove libraries from an installed directory
5413 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5414 a more detailed description of MODE."
5420 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5422 Remove files from the build directory.
5424 RM is the name of the program to use to delete files associated with each FILE
5425 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5428 If FILE is a libtool library, object or program, all the files associated
5429 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5434 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5436 Compile a source file into a libtool library object.
5438 This mode accepts the following additional options:
5440 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5441 -prefer-pic try to building PIC objects only
5442 -prefer-non-pic try to building non-PIC objects only
5443 -static always build a \`.o' file suitable for static linking
5445 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5446 from the given SOURCEFILE.
5448 The output file name is determined by removing the directory component from
5449 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5450 library object suffix, \`.lo'."
5455 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5457 Automatically set library path, then run a program.
5459 This mode accepts the following additional options:
5461 -dlopen FILE add the directory containing FILE to the library path
5463 This mode sets the library path environment variable according to \`-dlopen'
5466 If any of the ARGS are libtool executable wrappers, then they are translated
5467 into their corresponding uninstalled binary, and any of their required library
5468 directories are added to the library path.
5470 Then, COMMAND is executed, with ARGS as arguments."
5475 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5477 Complete the installation of libtool libraries.
5479 Each LIBDIR is a directory that contains libtool libraries.
5481 The commands that this mode executes may require superuser privileges. Use
5482 the \`--dry-run' option if you just want to see what would be executed."
5487 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5489 Install executables or libraries.
5491 INSTALL-COMMAND is the installation command. The first component should be
5492 either the \`install' or \`cp' program.
5494 The rest of the components are interpreted as arguments to that command (only
5495 BSD-compatible install options are recognized)."
5500 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5502 Link object files or libraries together to form another library, or to
5503 create an executable program.
5505 LINK-COMMAND is a command using the C compiler that you would use to create
5506 a program from several object files.
5508 The following components of LINK-COMMAND are treated specially:
5510 -all-static do not do any dynamic linking at all
5511 -avoid-version do not add a version suffix if possible
5512 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5513 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5514 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5515 -export-symbols SYMFILE
5516 try to export only the symbols listed in SYMFILE
5517 -export-symbols-regex REGEX
5518 try to export only the symbols matching REGEX
5519 -LLIBDIR search LIBDIR for required installed libraries
5520 -lNAME OUTPUT-FILE requires the installed library libNAME
5521 -module build a library that can dlopened
5522 -no-fast-install disable the fast-install mode
5523 -no-install link a not-installable executable
5524 -no-undefined declare that a library does not refer to external symbols
5525 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5526 -objectlist FILE Use a list of object files found in FILE to specify objects
5527 -release RELEASE specify package release information
5528 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5529 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5530 -static do not do any dynamic linking of libtool libraries
5531 -version-info CURRENT[:REVISION[:AGE]]
5532 specify library version info [each variable defaults to 0]
5534 All other options (arguments beginning with \`-') are ignored.
5536 Every other argument is treated as a filename. Files ending in \`.la' are
5537 treated as uninstalled libtool libraries, other files are standard or library
5540 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5541 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5542 required, except when creating a convenience library.
5544 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5545 using \`ar' and \`ranlib', or on Windows using \`lib'.
5547 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5548 is created, otherwise an executable program is created."
5553 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5555 Remove libraries from an installation directory.
5557 RM is the name of the program to use to delete files associated with each FILE
5558 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5561 If FILE is a libtool library, all the files associated with it are deleted.
5562 Otherwise, only FILE itself is deleted using RM."
5566 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5573 $echo "Try \`$modename --help' for more information about other modes."
5577 # The TAGs below are defined such that we never get into a situation
5578 # in which we disable both kinds of libraries. Given conflicting
5579 # choices, we go for a static library, that is the most portable,
5580 # since we can't tell whether shared libraries were disabled because
5581 # the user asked for that or because the platform doesn't support
5582 # them. This is particularly important on AIX, because we don't
5583 # support having both static and shared libraries enabled at the same
5584 # time on that platform, so we default to a shared-only configuration.
5585 # If a disable-shared tag is given, we'll fallback to a static-only
5586 # configuration. But we'll never go from static-only to shared-only.
5588 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5589 build_libtool_libs
=no
5591 ### END LIBTOOL TAG CONFIG: disable-shared
5593 ### BEGIN LIBTOOL TAG CONFIG: disable-static
5594 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5595 ### END LIBTOOL TAG CONFIG: disable-static