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 # APPLE LOCAL begin handle ~ in pathnames 2002-01-14 --sts
499 # Since CC may have args with shell metachars in them, add
500 # doublequotes to args so it looks the same as $base_compile.
504 # Double-quote args containing other shell metacharacters.
505 # Many Bourne shells cannot handle close brackets correctly
506 # in scan sets, so we specify it separately.
507 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
511 # Add the previous argument to qCC.
512 if test -z "$qCC"; then
518 # APPLE LOCAL end handle ~ in pathnames 2002-01-14 --sts
519 case $base_compile in
520 # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
522 # Blanks in the command may have been stripped by the calling shell,
523 # but not from the CC environment variable when ltconfig was run.
524 # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
527 for z
in $available_tags; do
528 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
529 # Evaluate the configuration.
530 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
531 case $base_compile in
533 # The compiler in the base compile command matches
534 # the one in the tagged configuration.
535 # Assume this is the tagged configuration we want.
546 # If $tagname still isn't set, then no tagged configuration
547 # was found and let the user know that the "--tag" command
548 # line option must be used.
549 if test -z "$tagname"; then
550 echo "$modename: unable to infer tagged configuration"
551 echo "$modename: specify a tag with \`--tag'" 1>&2
554 # echo "$modename: using $tagname tagged configuration"
560 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
561 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
562 if test "X$xdir" = "X$obj"; then
567 lobj
=${xdir}$objdir/$objname
569 if test -z "$base_compile"; then
570 $echo "$modename: you must specify a compilation command" 1>&2
575 # Delete any leftover library objects.
576 if test "$build_old_libs" = yes; then
577 removelist
="$obj $lobj $libobj ${libobj}T"
579 removelist
="$lobj $libobj ${libobj}T"
583 trap "$run $rm $removelist; exit 1" 1 2 15
585 # On Cygwin there's no "real" PIC flag so we must build both object types
587 cygwin
* | mingw
* | pw32
* | os2
*)
591 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
592 # non-PIC code in shared libraries is not supported
596 # Calculate the filename of the output object if compiler does
597 # not support -o with -c
598 if test "$compiler_c_o" = no
; then
599 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
600 lockfile
="$output_obj.lock"
601 removelist
="$removelist $output_obj $lockfile"
602 trap "$run $rm $removelist; exit 1" 1 2 15
609 # Lock this critical section if it is needed
610 # We use this script file to make the link, it avoids creating a new file
611 if test "$need_locks" = yes; then
612 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
613 $show "Waiting for $lockfile to be removed"
616 elif test "$need_locks" = warn
; then
617 if test -f "$lockfile"; then
619 *** ERROR, $lockfile exists and contains:
620 `cat $lockfile 2>/dev/null`
622 This indicates that another process is trying to use the same
623 temporary object file, and libtool could not work around it because
624 your compiler does not support \`-c' and \`-o' together. If you
625 repeat this compilation, it may succeed, by chance, but you had better
626 avoid parallel builds (make -j) in this platform, or get a better
632 echo $srcfile > "$lockfile"
635 if test -n "$fix_srcfile_path"; then
636 eval srcfile
=\"$fix_srcfile_path\"
639 $run $rm "$libobj" "${libobj}T"
641 # Create a libtool object file (analogous to a ".la" file),
642 # but don't create it if we're doing a dry run.
643 test -z "$run" && cat > ${libobj}T
<<EOF
644 # $libobj - a libtool object file
645 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
647 # Please DO NOT delete this file!
648 # It is necessary for linking the library.
650 # Name of the PIC object.
653 # Only build a PIC object if we are building libtool libraries.
654 if test "$build_libtool_libs" = yes; then
655 # Without this assignment, base_compile gets emptied.
656 fbsd_hideous_sh_bug
=$base_compile
658 if test "$pic_mode" != no
; then
659 command="$base_compile $srcfile $pic_flag"
661 # Don't build PIC code
662 command="$base_compile $srcfile"
665 if test ! -d ${xdir}$objdir; then
666 $show "$mkdir ${xdir}$objdir"
667 $run $mkdir ${xdir}$objdir
669 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
674 if test -z "$output_obj"; then
675 # Place PIC objects in $objdir
676 command="$command -o $lobj"
679 $run $rm "$lobj" "$output_obj"
682 if $run eval "$command"; then :
684 test -n "$output_obj" && $run $rm $removelist
688 if test "$need_locks" = warn
&&
689 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
691 *** ERROR, $lockfile contains:
692 `cat $lockfile 2>/dev/null`
694 but it should contain:
697 This indicates that another process is trying to use the same
698 temporary object file, and libtool could not work around it because
699 your compiler does not support \`-c' and \`-o' together. If you
700 repeat this compilation, it may succeed, by chance, but you had better
701 avoid parallel builds (make -j) in this platform, or get a better
708 # Just move the object if needed, then go on to compile the next one
709 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
710 $show "$mv $output_obj $lobj"
711 if $run $mv $output_obj $lobj; then :
719 # Append the name of the PIC object to the libtool object file.
720 test -z "$run" && cat >> ${libobj}T
<<EOF
721 pic_object='$objdir/$objname'
725 # Allow error messages only from the first compilation.
726 suppress_output
=' >/dev/null 2>&1'
728 # No PIC object so indicate it doesn't exist in the libtool
730 test -z "$run" && cat >> ${libobj}T
<<EOF
736 # Only build a position-dependent object if we build old libraries.
737 if test "$build_old_libs" = yes; then
738 if test "$pic_mode" != yes; then
739 # Don't build PIC code
740 command="$base_compile $srcfile"
742 command="$base_compile $srcfile $pic_flag"
744 if test "$compiler_c_o" = yes; then
745 command="$command -o $obj"
748 # Suppress compiler output if we already did a PIC compilation.
749 command="$command$suppress_output"
750 $run $rm "$obj" "$output_obj"
752 if $run eval "$command"; then :
758 if test "$need_locks" = warn
&&
759 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
761 *** ERROR, $lockfile contains:
762 `cat $lockfile 2>/dev/null`
764 but it should contain:
767 This indicates that another process is trying to use the same
768 temporary object file, and libtool could not work around it because
769 your compiler does not support \`-c' and \`-o' together. If you
770 repeat this compilation, it may succeed, by chance, but you had better
771 avoid parallel builds (make -j) in this platform, or get a better
778 # Just move the object if needed
779 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
780 $show "$mv $output_obj $obj"
781 if $run $mv $output_obj $obj; then :
789 # Append the name of the non-PIC object the libtool object file.
790 # Only append if the libtool object file exists.
791 test -z "$run" && cat >> ${libobj}T
<<EOF
792 # Name of the non-PIC object.
793 non_pic_object='$objname'
797 # Append the name of the non-PIC object the libtool object file.
798 # Only append if the libtool object file exists.
799 test -z "$run" && cat >> ${libobj}T
<<EOF
800 # Name of the non-PIC object.
806 $run $mv "${libobj}T" "${libobj}"
808 # Unlock the critical section if it was locked
809 if test "$need_locks" != no
; then
818 modename
="$modename: link"
820 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
821 # It is impossible to link a dll without this setting, and
822 # we shouldn't force the makefile maintainer to figure out
823 # which system we are compiling for in order to pass an extra
824 # flag for every libtool invokation.
827 # FIXME: Unfortunately, there are problems with the above when trying
828 # to make a dll which has undefined symbols, in which case not
829 # even a static library is built. For now, we need to specify
830 # -no-undefined on the libtool link line when we can be certain
831 # that all symbols are satisfied, otherwise we get a static library.
838 libtool_args
="$nonopt"
839 base_compile
="$nonopt"
840 compile_command
="$nonopt"
841 finalize_command
="$nonopt"
854 lib_search_path
=`pwd`
862 export_symbols_regex
=
870 prefer_static_libs
=no
882 # We need to know -static, to get the right output filenames.
886 -all-static |
-static)
887 if test "X$arg" = "X-all-static"; then
888 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
889 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
891 if test -n "$link_static_flag"; then
892 dlopen_self
=$dlopen_self_static
895 if test -z "$pic_flag" && test -n "$link_static_flag"; then
896 dlopen_self
=$dlopen_self_static
899 build_libtool_libs
=no
901 prefer_static_libs
=yes
907 # See if our shared archives depend on static archives.
908 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
910 # Go through the arguments, transforming them on the way.
911 while test $# -gt 0; do
913 base_compile
="$base_compile $arg"
916 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
917 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
921 libtool_args
="$libtool_args $qarg"
923 # If the previous option needs an argument, assign it.
924 if test -n "$prev"; then
927 compile_command
="$compile_command @OUTPUT@"
928 finalize_command
="$finalize_command @OUTPUT@"
934 if test "$preload" = no
; then
935 # Add the symbol object into the linking commands.
936 compile_command
="$compile_command @SYMFILE@"
937 finalize_command
="$finalize_command @SYMFILE@"
941 *.la |
*.lo
) ;; # We handle these cases below.
943 if test "$dlself" = no
; then
951 if test "$prev" = dlprefiles
; then
953 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
963 if test "$prev" = dlfiles
; then
964 dlfiles
="$dlfiles $arg"
966 dlprefiles
="$dlprefiles $arg"
974 export_symbols
="$arg"
975 if test ! -f "$arg"; then
976 $echo "$modename: symbol file \`$arg' does not exist"
983 export_symbols_regex
="$arg"
993 if test -f "$arg"; then
996 for fil
in `cat $save_arg`
998 # moreargs="$moreargs $fil"
1000 # A libtool-controlled object.
1002 # Check to see that this really is a libtool object.
1003 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1008 # If there is no directory component, then add one.
1010 */* |
*\\*) .
$arg ;;
1014 if test -z "$pic_object" || \
1015 test -z "$non_pic_object" ||
1016 test "$pic_object" = none
&& \
1017 test "$non_pic_object" = none
; then
1018 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1022 # Extract subdirectory from the argument.
1023 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1024 if test "X$xdir" = "X$arg"; then
1030 if test "$pic_object" != none
; then
1031 # Prepend the subdirectory the object is found in.
1032 pic_object
="$xdir$pic_object"
1034 if test "$prev" = dlfiles
; then
1035 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1036 dlfiles
="$dlfiles $pic_object"
1040 # If libtool objects are unsupported, then we need to preload.
1045 # CHECK ME: I think I busted this. -Ossama
1046 if test "$prev" = dlprefiles
; then
1047 # Preload the old-style object.
1048 dlprefiles
="$dlprefiles $pic_object"
1053 libobjs
="$libobjs $pic_object"
1058 if test "$non_pic_object" != none
; then
1059 # Prepend the subdirectory the object is found in.
1060 non_pic_object
="$xdir$non_pic_object"
1062 # A standard non-PIC object
1063 non_pic_objects
="$non_pic_objects $non_pic_object"
1064 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1065 arg
="$non_pic_object"
1068 # If the PIC object exists, use it instead.
1069 # $xdir was prepended to $pic_object above.
1070 non_pic_object
="$pic_object"
1071 non_pic_objects
="$non_pic_objects $non_pic_object"
1074 # Only an error if not doing a dry-run.
1075 if test -z "$run"; then
1076 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1081 # Extract subdirectory from the argument.
1082 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1083 if test "X$xdir" = "X$arg"; then
1089 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1090 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1091 libobjs
="$libobjs $pic_object"
1092 non_pic_objects
="$non_pic_objects $non_pic_object"
1097 $echo "$modename: link input file \`$save_arg' does not exist"
1105 # We need an absolute path.
1107 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1109 $echo "$modename: only absolute run-paths are allowed" 1>&2
1113 if test "$prev" = rpath
; then
1116 *) rpath
="$rpath $arg" ;;
1121 *) xrpath
="$xrpath $arg" ;;
1128 compiler_flags
="$compiler_flags $qarg"
1130 compile_command
="$compile_command $qarg"
1131 finalize_command
="$finalize_command $qarg"
1135 linker_flags
="$linker_flags $qarg"
1136 compiler_flags
="$compiler_flags $wl$qarg"
1138 compile_command
="$compile_command $wl$qarg"
1139 finalize_command
="$finalize_command $wl$qarg"
1146 *" $qarg.framework "*) ;;
1147 *) deplibs
="$deplibs $qarg.framework" # this is fixed later
1156 eval "$prev=\"\$arg\""
1167 if test -n "$link_static_flag"; then
1168 compile_command
="$compile_command $link_static_flag"
1169 finalize_command
="$finalize_command $link_static_flag"
1175 # FIXME: remove this flag sometime in the future.
1176 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1200 -export-symbols |
-export-symbols-regex)
1201 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1202 $echo "$modename: more than one -exported-symbols argument is not allowed"
1205 if test "X$arg" = "X-export-symbols"; then
1213 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1214 # so, if we see these flags be careful not to treat them like -L
1216 case $with_gcc/$host in
1218 compile_command
="$compile_command $arg"
1219 finalize_command
="$finalize_command $arg"
1226 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1227 # We need an absolute path.
1229 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1231 absdir
=`cd "$dir" && pwd`
1232 if test -z "$absdir"; then
1233 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1242 deplibs
="$deplibs -L$dir"
1243 lib_search_path
="$lib_search_path $dir"
1247 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1248 case :$dllsearchpath: in
1250 *) dllsearchpath
="$dllsearchpath:$dir";;
1258 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1260 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1261 # These systems don't actually have a C or math library (as such)
1264 *-*-mingw* |
*-*-os2*)
1265 # These systems don't actually have a C library (as such)
1266 test "X$arg" = "X-lc" && continue
1270 deplibs
="$deplibs $arg"
1286 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1287 # The PATH hackery in wrapper scripts is required on Windows
1288 # in order for the loader to find any dlls it needs.
1289 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1290 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1293 *) no_install
=yes ;;
1326 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1327 # We need an absolute path.
1329 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1331 $echo "$modename: only absolute run-paths are allowed" 1>&2
1337 *) xrpath
="$xrpath $dir" ;;
1343 # The effects of -static are defined in a previous loop.
1344 # We used to do the same as -all-static on platforms that
1345 # didn't have a PIC flag, but the assumption that the effects
1346 # would be equivalent was wrong. It would break on at least
1347 # Digital Unix and AIX.
1362 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1364 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1365 for flag
in $args; do
1368 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1373 compiler_flags
="$compiler_flags $flag"
1376 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1380 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1382 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1383 for flag
in $args; do
1386 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1391 compiler_flags
="$compiler_flags $wl$flag"
1392 linker_flags
="$linker_flags $flag"
1395 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1412 # Some other compiler flag.
1414 # Unknown arguments in both finalize_command and compile_command need
1415 # to be aesthetically quoted because they are evaled later.
1416 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1418 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1425 # A standard object.
1430 # A libtool-controlled object.
1432 # Check to see that this really is a libtool object.
1433 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1438 # If there is no directory component, then add one.
1440 */* |
*\\*) .
$arg ;;
1444 if test -z "$pic_object" || \
1445 test -z "$non_pic_object" ||
1446 test "$pic_object" = none
&& \
1447 test "$non_pic_object" = none
; then
1448 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1452 # Extract subdirectory from the argument.
1453 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1454 if test "X$xdir" = "X$arg"; then
1460 if test "$pic_object" != none
; then
1461 # Prepend the subdirectory the object is found in.
1462 pic_object
="$xdir$pic_object"
1464 if test "$prev" = dlfiles
; then
1465 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1466 dlfiles
="$dlfiles $pic_object"
1470 # If libtool objects are unsupported, then we need to preload.
1475 # CHECK ME: I think I busted this. -Ossama
1476 if test "$prev" = dlprefiles
; then
1477 # Preload the old-style object.
1478 dlprefiles
="$dlprefiles $pic_object"
1483 libobjs
="$libobjs $pic_object"
1488 if test "$non_pic_object" != none
; then
1489 # Prepend the subdirectory the object is found in.
1490 non_pic_object
="$xdir$non_pic_object"
1492 # A standard non-PIC object
1493 non_pic_objects
="$non_pic_objects $non_pic_object"
1494 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1495 arg
="$non_pic_object"
1498 # If the PIC object exists, use it instead.
1499 # $xdir was prepended to $pic_object above.
1500 non_pic_object
="$pic_object"
1501 non_pic_objects
="$non_pic_objects $non_pic_object"
1504 # Only an error if not doing a dry-run.
1505 if test -z "$run"; then
1506 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1511 # Extract subdirectory from the argument.
1512 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1513 if test "X$xdir" = "X$arg"; then
1519 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1520 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1521 libobjs
="$libobjs $pic_object"
1522 non_pic_objects
="$non_pic_objects $non_pic_object"
1529 deplibs
="$deplibs $arg"
1530 old_deplibs
="$old_deplibs $arg"
1535 # A libtool-controlled library.
1537 if test "$prev" = dlfiles
; then
1538 # This library was specified with -dlopen.
1539 dlfiles
="$dlfiles $arg"
1541 elif test "$prev" = dlprefiles
; then
1542 # The library was specified with -dlpreopen.
1543 dlprefiles
="$dlprefiles $arg"
1546 deplibs
="$deplibs $arg"
1551 # Some other compiler argument.
1553 # Unknown arguments in both finalize_command and compile_command need
1554 # to be aesthetically quoted because they are evaled later.
1555 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1557 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1564 # Now actually substitute the argument into the commands.
1565 if test -n "$arg"; then
1566 compile_command
="$compile_command $arg"
1567 finalize_command
="$finalize_command $arg"
1569 done # argument parsing loop
1571 if test -n "$prev"; then
1572 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1577 # Infer tagged configuration to use if any are available and
1578 # if one wasn't chosen via the "--tag" command line option.
1579 # Only attempt this if the compiler in the base link
1580 # command doesn't match the default compiler.
1581 if test -n "$available_tags" && test -z "$tagname"; then
1582 case $base_compile in
1584 # Blanks in the command may have been stripped by the calling shell,
1585 # but not from the CC environment variable when ltconfig was run.
1588 for z
in $available_tags; do
1589 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1590 # Evaluate the configuration.
1591 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1592 case $base_compile in
1594 # The compiler in $compile_command matches
1595 # the one in the tagged configuration.
1596 # Assume this is the tagged configuration we want.
1607 # If $tagname still isn't set, then no tagged configuration
1608 # was found and let the user know that the "--tag" command
1609 # line option must be used.
1610 if test -z "$tagname"; then
1611 echo "$modename: unable to infer tagged configuration"
1612 echo "$modename: specify a tag with \`--tag'" 1>&2
1615 # echo "$modename: using $tagname tagged configuration"
1621 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1622 eval arg
=\"$export_dynamic_flag_spec\"
1623 compile_command
="$compile_command $arg"
1624 finalize_command
="$finalize_command $arg"
1627 # calculate the name of the file, without its directory
1628 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1629 libobjs_save
="$libobjs"
1631 if test -n "$shlibpath_var"; then
1632 # get the directories listed in $shlibpath_var
1633 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1637 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1638 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1640 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1641 if test "X$output_objdir" = "X$output"; then
1642 output_objdir
="$objdir"
1644 output_objdir
="$output_objdir/$objdir"
1646 # Create the object directory.
1647 if test ! -d $output_objdir; then
1648 $show "$mkdir $output_objdir"
1649 $run $mkdir $output_objdir
1651 if test $status -ne 0 && test ! -d $output_objdir; then
1656 # Determine the type of output
1659 $echo "$modename: you must specify an output file" 1>&2
1663 *.
$libext) linkmode
=oldlib
;;
1664 *.lo |
*.
$objext) linkmode
=obj
;;
1665 *.la
) linkmode
=lib
;;
1666 *) linkmode
=prog
;; # Anything else should be a program.
1671 # Find all interdependent deplibs by searching for libraries
1672 # that are linked more than once (e.g. -la -lb -la)
1673 for deplib
in $deplibs; do
1675 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1677 libs
="$libs $deplib"
1680 if test $linkmode = lib
; then
1681 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1683 # Compute libraries that are listed more than once in $predeps
1684 # $postdeps and mark them as special (i.e., whose duplicates are
1685 # not to be eliminated).
1687 for pre_post_dep
in $predeps $postdeps; do
1688 case "$pre_post_deps " in
1689 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1691 pre_post_deps
="$pre_post_deps $pre_post_dep"
1699 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1700 notinst_deplibs
= # not-installed libtool libraries
1701 notinst_path
= # paths that contain not-installed libtool libraries
1705 for file in $dlfiles $dlprefiles; do
1709 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1721 passes
="conv scan dlopen dlpreopen link"
1726 for pass
in $passes; do
1727 if test $linkmode = prog
; then
1728 # Determine which files to process
1732 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1735 dlpreopen
) libs
="$dlprefiles" ;;
1736 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1739 for deplib
in $libs; do
1744 if test $linkmode = oldlib
&& test $linkmode = obj
; then
1745 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1748 if test $pass = conv
; then
1749 deplibs
="$deplib $deplibs"
1752 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1753 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1754 # Search the libtool library
1755 lib
="$searchdir/lib${name}.la"
1756 if test -f "$lib"; then
1761 if test "$found" != yes; then
1762 # deplib doesn't seem to be a libtool library
1763 if test "$linkmode,$pass" = "prog,link"; then
1764 compile_deplibs
="$deplib $compile_deplibs"
1765 finalize_deplibs
="$deplib $finalize_deplibs"
1767 deplibs
="$deplib $deplibs"
1768 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1776 deplibs
="$deplib $deplibs"
1777 test $pass = conv
&& continue
1778 newdependency_libs
="$deplib $newdependency_libs"
1779 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1782 if test $pass = conv
; then
1783 deplibs
="$deplib $deplibs"
1786 if test $pass = scan
; then
1787 deplibs
="$deplib $deplibs"
1788 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1790 compile_deplibs
="$deplib $compile_deplibs"
1791 finalize_deplibs
="$deplib $finalize_deplibs"
1795 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1801 if test $pass = link
; then
1802 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1803 # Make sure the xrpath contains only unique directories.
1806 *) xrpath
="$xrpath $dir" ;;
1809 deplibs
="$deplib $deplibs"
1812 *.la
) lib
="$deplib" ;;
1814 if test $pass = conv
; then
1815 deplibs
="$deplib $deplibs"
1820 if test "$deplibs_check_method" != pass_all
; then
1822 echo "*** Warning: This library needs some functionality provided by $deplib."
1823 echo "*** I have the capability to make that library automatically link in when"
1824 echo "*** you link to this library. But I can only do this if you have a"
1825 echo "*** shared version of the library, which you do not appear to have."
1828 echo "*** Warning: Linking the shared library $output against the"
1829 echo "*** static library $deplib is not portable!"
1830 deplibs
="$deplib $deplibs"
1835 if test $pass != link
; then
1836 deplibs
="$deplib $deplibs"
1838 compile_deplibs
="$deplib $compile_deplibs"
1839 finalize_deplibs
="$deplib $finalize_deplibs"
1846 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1847 # If there is no dlopen support or we're linking statically,
1848 # we need to preload.
1849 newdlprefiles
="$newdlprefiles $deplib"
1850 compile_deplibs
="$deplib $compile_deplibs"
1851 finalize_deplibs
="$deplib $finalize_deplibs"
1853 newdlfiles
="$newdlfiles $deplib"
1862 if test $found = yes ||
test -f "$lib"; then :
1864 $echo "$modename: cannot find the library \`$lib'" 1>&2
1868 # Check to see that this really is a libtool archive.
1869 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1871 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1875 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1876 test "X$ladir" = "X$lib" && ladir
="."
1884 # If the library was installed with an old release of libtool,
1885 # it will not redefine variable installed.
1890 */* |
*\\*) .
$lib ;;
1896 # Convert "-framework foo" to "foo.framework" in dependency_libs
1897 test -n "$dependency_libs" && dependency_libs
=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
1901 if test "$linkmode,$pass" = "lib,link" ||
1902 test "$linkmode,$pass" = "prog,scan" ||
1903 { test $linkmode = oldlib
&& test $linkmode = obj
; }; then
1904 # Add dl[pre]opened files of deplib
1905 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1906 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1909 if test $pass = conv
; then
1910 # Only check for convenience libraries
1911 deplibs
="$lib $deplibs"
1912 if test -z "$libdir"; then
1913 if test -z "$old_library"; then
1914 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1917 # It is a libtool convenience library, so add in its objects.
1918 convenience
="$convenience $ladir/$objdir/$old_library"
1919 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1921 for deplib
in $dependency_libs; do
1922 deplibs
="$deplib $deplibs"
1923 case "$tmp_libs " in
1924 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1926 tmp_libs
="$tmp_libs $deplib"
1928 elif test $linkmode != prog
&& test $linkmode != lib
; then
1929 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1935 # Get the name of the library we link against.
1937 for l
in $old_library $library_names; do
1940 if test -z "$linklib"; then
1941 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1945 # This library was specified with -dlopen.
1946 if test $pass = dlopen
; then
1947 if test -z "$libdir"; then
1948 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1951 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1952 # If there is no dlname, no dlopen support or we're linking
1953 # statically, we need to preload.
1954 dlprefiles
="$dlprefiles $lib"
1956 newdlfiles
="$newdlfiles $lib"
1961 # We need an absolute path.
1963 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1965 abs_ladir
=`cd "$ladir" && pwd`
1966 if test -z "$abs_ladir"; then
1967 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1968 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1973 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1975 # Find the relevant object directory and library name.
1976 if test "X$installed" = Xyes
; then
1977 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1978 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1987 dir
="$ladir/$objdir"
1988 absdir
="$abs_ladir/$objdir"
1989 # Remove this search path later
1990 notinst_path
="$notinst_path $abs_ladir"
1991 fi # $installed = yes
1992 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1994 # This library was specified with -dlpreopen.
1995 if test $pass = dlpreopen
; then
1996 if test -z "$libdir"; then
1997 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2000 # Prefer using a static library (so that no silly _DYNAMIC symbols
2001 # are required to link).
2002 if test -n "$old_library"; then
2003 newdlprefiles
="$newdlprefiles $dir/$old_library"
2004 # Otherwise, use the dlname, so that lt_dlopen finds it.
2005 elif test -n "$dlname"; then
2006 newdlprefiles
="$newdlprefiles $dir/$dlname"
2008 newdlprefiles
="$newdlprefiles $dir/$linklib"
2010 fi # $pass = dlpreopen
2012 if test -z "$libdir"; then
2013 # Link the convenience library
2014 if test $linkmode = lib
; then
2015 deplibs
="$dir/$old_library $deplibs"
2016 elif test "$linkmode,$pass" = "prog,link"; then
2017 compile_deplibs
="$dir/$old_library $compile_deplibs"
2018 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2020 deplibs
="$lib $deplibs"
2025 if test $linkmode = prog
&& test $pass != link
; then
2026 newlib_search_path
="$newlib_search_path $ladir"
2027 deplibs
="$lib $deplibs"
2030 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2031 test "$build_libtool_libs" = no
; then
2036 for deplib
in $dependency_libs; do
2038 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2040 # Need to link against all dependency_libs?
2041 if test $linkalldeplibs = yes; then
2042 deplibs
="$deplib $deplibs"
2044 # Need to hardcode shared library paths
2045 # or/and link against static libraries
2046 newdependency_libs
="$deplib $newdependency_libs"
2048 case "$tmp_libs " in
2049 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2051 tmp_libs
="$tmp_libs $deplib"
2054 fi # $linkmode = prog...
2056 link_static
=no
# Whether the deplib will be linked statically
2057 if test -n "$library_names" &&
2058 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2059 # Link against this shared library
2061 if test "$linkmode,$pass" = "prog,link" ||
2062 { test $linkmode = lib
&& test $hardcode_into_libs = yes; }; then
2063 # Hardcode the library path.
2064 # Skip directories that are in the system default run-time
2066 case " $sys_lib_dlsearch_path " in
2069 case "$compile_rpath " in
2071 *) compile_rpath
="$compile_rpath $absdir"
2075 case " $sys_lib_dlsearch_path " in
2078 case "$finalize_rpath " in
2080 *) finalize_rpath
="$finalize_rpath $libdir"
2084 if test $linkmode = prog
; then
2085 # We need to hardcode the library path
2086 if test -n "$shlibpath_var"; then
2087 # Make sure the rpath contains only unique directories.
2088 case "$temp_rpath " in
2091 *) temp_rpath
="$temp_rpath $dir" ;;
2095 fi # $linkmode,$pass = prog,link...
2097 if test "$alldeplibs" = yes &&
2098 { test "$deplibs_check_method" = pass_all ||
2099 { test "$build_libtool_libs" = yes &&
2100 test -n "$library_names"; }; }; then
2101 # We only need to search for static libraries
2105 if test "$installed" = no
; then
2106 notinst_deplibs
="$notinst_deplibs $lib"
2110 if test -n "$old_archive_from_expsyms_cmds"; then
2111 # figure out the soname
2112 set dummy
$library_names
2115 libname
=`eval \\$echo \"$libname_spec\"`
2116 # use dlname if we got it. it's perfectly good, no?
2117 if test -n "$dlname"; then
2119 elif test -n "$soname_spec"; then
2123 major
=`expr $current - $age`
2127 eval soname
=\"$soname_spec\"
2132 # Make a new name for the extract_expsyms_cmds to use
2134 soname
=`echo $soroot | sed -e 's/^.*\///'`
2135 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2137 # If the library has no export list, then create one now
2138 if test -f "$output_objdir/$soname-def"; then :
2140 $show "extracting exported symbol list from \`$soname'"
2141 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2142 cmds
=$extract_expsyms_cmds
2143 for cmd
in $cmds; do
2147 $run eval "$cmd" ||
exit $?
2153 if test -f "$output_objdir/$newlib"; then :; else
2154 $show "generating import library for \`$soname'"
2155 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2156 cmds
=$old_archive_from_expsyms_cmds
2157 for cmd
in $cmds; do
2161 $run eval "$cmd" ||
exit $?
2165 # make sure the library variables are pointing to the new library
2168 fi # test -n $old_archive_from_expsyms_cmds
2170 if test $linkmode = prog ||
test "$mode" != relink
; then
2175 case $hardcode_action in
2176 immediate | unsupported
)
2177 if test "$hardcode_direct" = no
; then
2179 elif test "$hardcode_minus_L" = no
; then
2181 *-*-sunos*) add_shlibpath
="$dir" ;;
2185 elif test "$hardcode_shlibpath_var" = no
; then
2186 add_shlibpath
="$dir"
2193 if test "$hardcode_direct" = yes; then
2195 elif test "$hardcode_minus_L" = yes; then
2198 elif test "$hardcode_shlibpath_var" = yes; then
2199 add_shlibpath
="$dir"
2208 if test "$lib_linked" != yes; then
2209 $echo "$modename: configuration error: unsupported hardcode properties"
2213 if test -n "$add_shlibpath"; then
2214 case :$compile_shlibpath: in
2215 *":$add_shlibpath:"*) ;;
2216 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2219 if test $linkmode = prog
; then
2220 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2221 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2223 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2224 test -n "$add" && deplibs
="$add $deplibs"
2225 if test "$hardcode_direct" != yes && \
2226 test "$hardcode_minus_L" != yes && \
2227 test "$hardcode_shlibpath_var" = yes; then
2228 case :$finalize_shlibpath: in
2230 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2236 if test $linkmode = prog ||
test "$mode" = relink
; then
2240 # Finalize command for both is simple: just hardcode it.
2241 if test "$hardcode_direct" = yes; then
2242 add
="$libdir/$linklib"
2243 elif test "$hardcode_minus_L" = yes; then
2246 elif test "$hardcode_shlibpath_var" = yes; then
2247 case :$finalize_shlibpath: in
2249 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2253 # We cannot seem to hardcode it, guess we'll fake it.
2258 if test $linkmode = prog
; then
2259 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2260 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2262 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2263 test -n "$add" && deplibs
="$add $deplibs"
2266 elif test $linkmode = prog
; then
2267 if test "$alldeplibs" = yes &&
2268 { test "$deplibs_check_method" = pass_all ||
2269 { test "$build_libtool_libs" = yes &&
2270 test -n "$library_names"; }; }; then
2271 # We only need to search for static libraries
2275 # Try to link the static library
2276 # Here we assume that one of hardcode_direct or hardcode_minus_L
2277 # is not unsupported. This is valid on all known static and
2279 if test "$hardcode_direct" != unsupported
; then
2280 test -n "$old_library" && linklib
="$old_library"
2281 compile_deplibs
="$dir/$linklib $compile_deplibs"
2282 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2284 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2285 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2287 elif test "$build_libtool_libs" = yes; then
2288 # Not a shared library
2289 if test "$deplibs_check_method" != pass_all
; then
2290 # We're trying link a shared library against a static one
2291 # but the system doesn't support it.
2293 # Just print a warning and add the library to dependency_libs so
2294 # that the program can be linked against the static library.
2296 echo "*** Warning: This library needs some functionality provided by $lib."
2297 echo "*** I have the capability to make that library automatically link in when"
2298 echo "*** you link to this library. But I can only do this if you have a"
2299 echo "*** shared version of the library, which you do not appear to have."
2300 if test "$module" = yes; then
2301 echo "*** Therefore, libtool will create a static module, that should work "
2302 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2303 if test -z "$global_symbol_pipe"; then
2305 echo "*** However, this would only work if libtool was able to extract symbol"
2306 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2307 echo "*** not find such a program. So, this module is probably useless."
2308 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2310 if test "$build_old_libs" = no
; then
2311 build_libtool_libs
=module
2314 build_libtool_libs
=no
2318 convenience
="$convenience $dir/$old_library"
2319 old_convenience
="$old_convenience $dir/$old_library"
2320 deplibs
="$dir/$old_library $deplibs"
2323 fi # link shared/static library?
2325 if test $linkmode = lib
; then
2326 if test -n "$dependency_libs" &&
2327 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
2328 test $link_static = yes; }; then
2329 # Extract -R from dependency_libs
2331 for libdir
in $dependency_libs; do
2333 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2335 *" $temp_xrpath "*) ;;
2336 *) xrpath
="$xrpath $temp_xrpath";;
2338 *) temp_deplibs
="$temp_deplibs $libdir";;
2341 dependency_libs
="$temp_deplibs"
2344 newlib_search_path
="$newlib_search_path $absdir"
2345 # Link against this library
2346 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2347 # ... and its dependency_libs
2349 for deplib
in $dependency_libs; do
2350 newdependency_libs
="$deplib $newdependency_libs"
2351 case "$tmp_libs " in
2352 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2354 tmp_libs
="$tmp_libs $deplib"
2357 if test $link_all_deplibs != no
; then
2358 # Add the search paths of all dependency libraries
2359 for deplib
in $dependency_libs; do
2361 -L*) path
="$deplib" ;;
2363 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2364 test "X$dir" = "X$deplib" && dir
="."
2365 # We need an absolute path.
2367 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2369 absdir
=`cd "$dir" && pwd`
2370 if test -z "$absdir"; then
2371 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2376 if grep "^installed=no" $deplib > /dev
/null
; then
2377 path
="-L$absdir/$objdir"
2379 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2380 if test -z "$libdir"; then
2381 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2384 if test "$absdir" != "$libdir"; then
2385 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2392 case " $deplibs " in
2394 *) deplibs
="$path $deplibs" ;;
2397 fi # link_all_deplibs != no
2399 done # for deplib in $libs
2400 if test $pass = dlpreopen
; then
2401 # Link the dlpreopened libraries before other libraries
2402 for deplib
in $save_deplibs; do
2403 deplibs
="$deplib $deplibs"
2406 if test $pass != dlopen
; then
2407 test $pass != scan
&& dependency_libs
="$newdependency_libs"
2408 if test $pass != conv
; then
2409 # Make sure lib_search_path contains only unique directories.
2411 for dir
in $newlib_search_path; do
2412 case "$lib_search_path " in
2414 *) lib_search_path
="$lib_search_path $dir" ;;
2420 if test "$linkmode,$pass" != "prog,link"; then
2423 vars
="compile_deplibs finalize_deplibs"
2425 for var
in $vars dependency_libs
; do
2426 # Add libraries to $var in reverse order
2427 eval tmp_libs
=\"\$
$var\"
2429 for deplib
in $tmp_libs; do
2431 -L*) new_libs
="$deplib $new_libs" ;;
2433 case " $specialdeplibs " in
2434 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2436 case " $new_libs " in
2438 *) new_libs
="$deplib $new_libs" ;;
2446 for deplib
in $new_libs; do
2449 case " $tmp_libs " in
2451 *) tmp_libs
="$tmp_libs $deplib" ;;
2454 *) tmp_libs
="$tmp_libs $deplib" ;;
2457 eval $var=\"$tmp_libs\"
2460 if test "$pass" = "conv" &&
2461 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2462 libs
="$deplibs" # reset libs
2466 if test $linkmode = prog
; then
2467 dlfiles
="$newdlfiles"
2468 dlprefiles
="$newdlprefiles"
2473 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2474 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2477 if test -n "$rpath"; then
2478 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2481 if test -n "$xrpath"; then
2482 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2485 if test -n "$vinfo"; then
2486 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2489 if test -n "$release"; then
2490 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2493 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2494 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2497 # Now set the variables for building old libraries.
2498 build_libtool_libs
=no
2500 objs
="$objs$old_deplibs"
2504 # Make sure we only generate libraries of the form `libNAME.la'.
2507 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2508 eval shared_ext
=\"$shrext\"
2509 eval libname
=\"$libname_spec\"
2512 if test "$module" = no
; then
2513 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2517 if test "$need_lib_prefix" != no
; then
2518 # Add the "lib" prefix for modules if required
2519 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2520 eval shared_ext
=\"$shrext\"
2521 eval libname
=\"$libname_spec\"
2523 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2528 if test -n "$objs"; then
2529 if test "$deplibs_check_method" != pass_all
; then
2530 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2534 echo "*** Warning: Linking the shared library $output against the non-libtool"
2535 echo "*** objects $objs is not portable!"
2536 libobjs
="$libobjs $objs"
2540 if test "$dlself" != no
; then
2541 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2545 if test $# -gt 2; then
2546 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2551 if test -z "$rpath"; then
2552 if test "$build_libtool_libs" = yes; then
2553 # Building a libtool convenience library.
2554 # Some compilers have problems with a `.al' extension so
2555 # convenience libraries should have the same extension an
2556 # archive normally would.
2557 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2558 build_libtool_libs
=convenience
2562 if test -n "$vinfo"; then
2563 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2566 if test -n "$release"; then
2567 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2571 # Parse the version information argument.
2572 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2573 set dummy
$vinfo 0 0 0
2576 if test -n "$8"; then
2577 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2586 # Check that each of the things are valid numbers.
2588 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2590 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2591 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2597 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2599 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2600 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2606 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2608 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2609 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2614 if test $age -gt $current; then
2615 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2616 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2620 # Calculate the version variables.
2624 case $version_type in
2628 # Like Linux, but with the current version available in
2629 # verstring for coding it into the library header
2630 major
=.
`expr $current - $age`
2631 versuffix
="$major.$age.$revision"
2632 # Darwin ld doesn't like 0 for these options...
2633 minor_current
=`expr $current + 1`
2634 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2639 versuffix
=".$current.$revision";
2644 versuffix
=".$current";
2648 major
=`expr $current - $age + 1`
2649 verstring
="sgi$major.$revision"
2651 # Add in all the interfaces that we are compatible with.
2653 while test $loop != 0; do
2654 iface
=`expr $revision - $loop`
2655 loop
=`expr $loop - 1`
2656 verstring
="sgi$major.$iface:$verstring"
2659 # Before this point, $major must not contain `.'.
2661 versuffix
="$major.$revision"
2665 major
=.
`expr $current - $age`
2666 versuffix
="$major.$age.$revision"
2670 major
=.
`expr $current - $age`
2671 versuffix
=".$current.$age.$revision"
2672 verstring
="$current.$age.$revision"
2674 # Add in all the interfaces that we are compatible with.
2676 while test $loop != 0; do
2677 iface
=`expr $current - $loop`
2678 loop
=`expr $loop - 1`
2679 verstring
="$verstring:${iface}.0"
2682 # Make executables depend on our current version.
2683 verstring
="$verstring:${current}.0"
2688 versuffix
=".$current.$revision"
2692 # Use '-' rather than '.', since we only want one
2693 # extension on DOS 8.3 filesystems.
2694 major
=`expr $current - $age`
2699 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2700 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2705 # Clear the version info if we defaulted, and they specified a release.
2706 if test -z "$vinfo" && test -n "$release"; then
2708 case $version_type in
2710 # we can't check for "0.0" in archive_cmds due to quoting
2711 # problems, so we reset it completely
2718 if test "$need_version" = no
; then
2725 # Remove version info from name if versioning should be avoided
2726 if test "$avoid_version" = yes && test "$need_version" = no
; then
2732 # Check to see if the archive will have undefined symbols.
2733 if test "$allow_undefined" = yes; then
2734 if test "$allow_undefined_flag" = unsupported
; then
2735 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2736 build_libtool_libs
=no
2740 # Don't allow undefined symbols.
2741 allow_undefined_flag
="$no_undefined_flag"
2745 if test "$mode" != relink
; then
2746 # Remove our outputs, but don't remove object files since they
2747 # may have been created when compiling PIC objects.
2749 tempremovelist
=`echo "$output_objdir/*"`
2750 for p
in $tempremovelist; do
2754 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2755 removelist
="$removelist $p"
2760 if test -n "$removelist"; then
2761 $show "${rm}r $removelist"
2762 $run ${rm}r
$removelist
2766 # Now set the variables for building old libraries.
2767 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2768 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2770 # Transform .lo files to .o files.
2771 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2774 # Eliminate all temporary directories.
2775 for path
in $notinst_path; do
2776 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2777 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2778 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2781 if test -n "$xrpath"; then
2782 # If the user specified any rpath flags, then add them.
2784 for libdir
in $xrpath; do
2785 temp_xrpath
="$temp_xrpath -R$libdir"
2786 case "$finalize_rpath " in
2788 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2791 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2792 dependency_libs
="$temp_xrpath $dependency_libs"
2796 # Make sure dlfiles contains only unique files that won't be dlpreopened
2797 old_dlfiles
="$dlfiles"
2799 for lib
in $old_dlfiles; do
2800 case " $dlprefiles $dlfiles " in
2802 *) dlfiles
="$dlfiles $lib" ;;
2806 # Make sure dlprefiles contains only unique files
2807 old_dlprefiles
="$dlprefiles"
2809 for lib
in $old_dlprefiles; do
2810 case "$dlprefiles " in
2812 *) dlprefiles
="$dlprefiles $lib" ;;
2816 if test "$build_libtool_libs" = yes; then
2817 if test -n "$rpath"; then
2819 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2820 # these systems don't actually have a c library (as such)!
2822 *-*-rhapsody* |
*-*-darwin1.
[012])
2823 # Rhapsody C library is in the System framework
2824 deplibs
="$deplibs -framework System"
2827 # Don't link with libc until the a.out ld.so is fixed.
2830 # Add libc to deplibs on all other systems if necessary.
2831 if test $build_libtool_need_lc = "yes"; then
2832 deplibs
="$deplibs -lc"
2838 # Transform deplibs into only deplibs that can be linked in shared.
2840 libname_save
=$libname
2841 release_save
=$release
2842 versuffix_save
=$versuffix
2844 # I'm not sure if I'm treating the release correctly. I think
2845 # release should show up in the -l (ie -lgmp5) so we don't want to
2846 # add it in twice. Is that correct?
2852 case $deplibs_check_method in
2854 # Don't check for shared/static. Everything works.
2855 # This might be a little naive. We might want to check
2856 # whether the library exists or not. But this is on
2857 # osf3 & osf4 and I'm not really sure... Just
2858 # implementing what was already the behaviour.
2862 # This code stresses the "libraries are programs" paradigm to its
2863 # limits. Maybe even breaks it. We compile a program, linking it
2864 # against the deplibs as a proxy for the library. Then we can check
2865 # whether they linked in statically or dynamically with ldd.
2867 cat > conftest.c
<<EOF
2868 int main() { return 0; }
2871 $LTCC -o conftest conftest.c
$deplibs
2872 if test $?
-eq 0 ; then
2873 ldd_output
=`ldd conftest`
2874 for i
in $deplibs; do
2875 name
="`expr $i : '-l\(.*\)'`"
2876 # If $name is empty we are operating on a -L argument.
2877 if test -n "$name" && test "$name" != "0"; then
2878 libname
=`eval \\$echo \"$libname_spec\"`
2879 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2880 set dummy
$deplib_matches
2882 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2883 newdeplibs
="$newdeplibs $i"
2887 echo "*** Warning: This library needs some functionality provided by $i."
2888 echo "*** I have the capability to make that library automatically link in when"
2889 echo "*** you link to this library. But I can only do this if you have a"
2890 echo "*** shared version of the library, which you do not appear to have."
2893 newdeplibs
="$newdeplibs $i"
2897 # Error occured in the first compile. Let's try to salvage the situation:
2898 # Compile a seperate program for each library.
2899 for i
in $deplibs; do
2900 name
="`expr $i : '-l\(.*\)'`"
2901 # If $name is empty we are operating on a -L argument.
2902 if test -n "$name" && test "$name" != "0"; then
2904 $LTCC -o conftest conftest.c
$i
2906 if test $?
-eq 0 ; then
2907 ldd_output
=`ldd conftest`
2908 libname
=`eval \\$echo \"$libname_spec\"`
2909 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2910 set dummy
$deplib_matches
2912 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2913 newdeplibs
="$newdeplibs $i"
2917 echo "*** Warning: This library needs some functionality provided by $i."
2918 echo "*** I have the capability to make that library automatically link in when"
2919 echo "*** you link to this library. But I can only do this if you have a"
2920 echo "*** shared version of the library, which you do not appear to have."
2925 echo "*** Warning! Library $i is needed by this library but I was not able to"
2926 echo "*** make it link in! You will probably need to install it or some"
2927 echo "*** library that it depends on before this library will be fully"
2928 echo "*** functional. Installing it before continuing would be even better."
2931 newdeplibs
="$newdeplibs $i"
2937 set dummy
$deplibs_check_method
2938 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2939 for a_deplib
in $deplibs; do
2940 name
="`expr $a_deplib : '-l\(.*\)'`"
2941 # If $name is empty we are operating on a -L argument.
2942 if test -n "$name" && test "$name" != "0"; then
2943 libname
=`eval \\$echo \"$libname_spec\"`
2944 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2945 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2946 for potent_lib
in $potential_libs; do
2947 # Follow soft links.
2948 if ls -lLd "$potent_lib" 2>/dev
/null \
2949 |
grep " -> " >/dev
/null
; then
2952 # The statement above tries to avoid entering an
2953 # endless loop below, in case of cyclic links.
2954 # We might still enter an endless loop, since a link
2955 # loop can be closed while we follow links,
2957 potlib
="$potent_lib"
2958 while test -h "$potlib" 2>/dev
/null
; do
2959 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2961 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2962 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2965 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2967 |
egrep "$file_magic_regex" > /dev
/null
; then
2968 newdeplibs
="$newdeplibs $a_deplib"
2974 if test -n "$a_deplib" ; then
2977 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2978 echo "*** I have the capability to make that library automatically link in when"
2979 echo "*** you link to this library. But I can only do this if you have a"
2980 echo "*** shared version of the library, which you do not appear to have."
2983 # Add a -L argument.
2984 newdeplibs
="$newdeplibs $a_deplib"
2986 done # Gone through all deplibs.
2989 set dummy
$deplibs_check_method
2990 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2991 for a_deplib
in $deplibs; do
2992 name
="`expr $a_deplib : '-l\(.*\)'`"
2993 # If $name is empty we are operating on a -L argument.
2994 if test -n "$name" && test "$name" != "0"; then
2995 libname
=`eval \\$echo \"$libname_spec\"`
2996 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2997 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2998 for potent_lib
in $potential_libs; do
2999 if eval echo \"$potent_lib\" 2>/dev
/null \
3001 |
egrep "$match_pattern_regex" > /dev
/null
; then
3002 newdeplibs
="$newdeplibs $a_deplib"
3008 if test -n "$a_deplib" ; then
3011 echo "*** Warning: This library needs some functionality provided by $a_deplib."
3012 echo "*** I have the capability to make that library automatically link in when"
3013 echo "*** you link to this library. But I can only do this if you have a"
3014 echo "*** shared version of the library, which you do not appear to have."
3017 # Add a -L argument.
3018 newdeplibs
="$newdeplibs $a_deplib"
3020 done # Gone through all deplibs.
3024 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
3025 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3026 grep .
>/dev
/null
; then
3028 if test "X$deplibs_check_method" = "Xnone"; then
3029 echo "*** Warning: inter-library dependencies are not supported in this platform."
3031 echo "*** Warning: inter-library dependencies are not known to be supported."
3033 echo "*** All declared inter-library dependencies are being dropped."
3038 versuffix
=$versuffix_save
3040 release
=$release_save
3041 libname
=$libname_save
3045 *-*-rhapsody* |
*-*-darwin1.
[012])
3046 # On Rhapsody replace the C library is the System framework
3047 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3051 if test "$droppeddeps" = yes; then
3052 if test "$module" = yes; then
3054 echo "*** Warning: libtool could not satisfy all declared inter-library"
3055 echo "*** dependencies of module $libname. Therefore, libtool will create"
3056 echo "*** a static module, that should work as long as the dlopening"
3057 echo "*** application is linked with the -dlopen flag."
3058 if test -z "$global_symbol_pipe"; then
3060 echo "*** However, this would only work if libtool was able to extract symbol"
3061 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3062 echo "*** not find such a program. So, this module is probably useless."
3063 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3065 if test "$build_old_libs" = no
; then
3066 oldlibs
="$output_objdir/$libname.$libext"
3067 build_libtool_libs
=module
3070 build_libtool_libs
=no
3073 echo "*** The inter-library dependencies that have been dropped here will be"
3074 echo "*** automatically added whenever a program is linked with this library"
3075 echo "*** or is declared to -dlopen it."
3077 if test $allow_undefined = no
; then
3079 echo "*** Since this library must not contain undefined symbols,"
3080 echo "*** because either the platform does not support them or"
3081 echo "*** it was explicitly requested with -no-undefined,"
3082 echo "*** libtool will only create a static version of it."
3083 if test "$build_old_libs" = no
; then
3084 oldlibs
="$output_objdir/$libname.$libext"
3085 build_libtool_libs
=module
3088 build_libtool_libs
=no
3093 # Time to change all our "foo.framework" stuff back to "-framework foo"
3096 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3097 dependency_libs
=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3100 # Done checking deplibs!
3101 # Done checking deplibs!
3105 # All the library-specific variables (install_libdir is set above).
3110 # Test again, we may have decided not to build it any more
3111 if test "$build_libtool_libs" = yes; then
3112 if test $hardcode_into_libs = yes; then
3113 # Hardcode the library paths
3116 rpath
="$finalize_rpath"
3117 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3118 for libdir
in $rpath; do
3119 if test -n "$hardcode_libdir_flag_spec"; then
3120 if test -n "$hardcode_libdir_separator"; then
3121 if test -z "$hardcode_libdirs"; then
3122 hardcode_libdirs
="$libdir"
3124 # Just accumulate the unique libdirs.
3125 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3126 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3129 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3134 eval flag
=\"$hardcode_libdir_flag_spec\"
3135 dep_rpath
="$dep_rpath $flag"
3137 elif test -n "$runpath_var"; then
3138 case "$perm_rpath " in
3140 *) perm_rpath
="$perm_rpath $libdir" ;;
3144 # Substitute the hardcoded libdirs into the rpath.
3145 if test -n "$hardcode_libdir_separator" &&
3146 test -n "$hardcode_libdirs"; then
3147 libdir
="$hardcode_libdirs"
3148 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3150 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3151 # We should set the runpath_var.
3153 for dir
in $perm_rpath; do
3156 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3158 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3161 shlibpath
="$finalize_shlibpath"
3162 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3163 if test -n "$shlibpath"; then
3164 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3167 # Get the real and link names of the library.
3168 eval library_names
=\"$library_names_spec\"
3169 eval shared_ext
=\"$shrext\"
3170 set dummy
$library_names
3174 if test -n "$soname_spec"; then
3175 eval soname
=\"$soname_spec\"
3179 test -z "$dlname" && dlname
=$soname
3181 lib
="$output_objdir/$realname"
3184 linknames
="$linknames $link"
3187 # # Ensure that we have .o objects for linkers which dislike .lo
3188 # # (e.g. aix) in case we are running --disable-static
3189 # for obj in $libobjs; do
3190 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3191 # if test "X$xdir" = "X$obj"; then
3196 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3197 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3198 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3199 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3200 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3204 # Use standard objects if they are pic
3205 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3207 # Prepare the list of exported symbols
3208 if test -z "$export_symbols"; then
3209 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3210 $show "generating symbol list for \`$libname.la'"
3211 export_symbols
="$output_objdir/$libname.exp"
3212 $run $rm $export_symbols
3213 eval cmds
=\"$export_symbols_cmds\"
3214 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3215 for cmd
in $cmds; do
3218 $run eval "$cmd" ||
exit $?
3221 if test -n "$export_symbols_regex"; then
3222 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3223 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3224 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3225 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3230 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3231 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3234 if test -n "$convenience"; then
3235 if test -n "$whole_archive_flag_spec"; then
3236 save_libobjs
=$libobjs
3237 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3239 gentop
="$output_objdir/${outputname}x"
3240 $show "${rm}r $gentop"
3241 $run ${rm}r
"$gentop"
3242 $show "$mkdir $gentop"
3243 $run $mkdir "$gentop"
3245 if test $status -ne 0 && test ! -d "$gentop"; then
3248 generated
="$generated $gentop"
3250 for xlib
in $convenience; do
3251 # Extract the objects.
3253 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3254 *) xabs
=`pwd`"/$xlib" ;;
3256 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3257 xdir
="$gentop/$xlib"
3259 $show "${rm}r $xdir"
3261 $show "$mkdir $xdir"
3264 if test $status -ne 0 && test ! -d "$xdir"; then
3267 $show "(cd $xdir && $AR x $xabs)"
3268 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3270 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3275 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3276 eval flag
=\"$thread_safe_flag_spec\"
3277 linker_flags
="$linker_flags $flag"
3280 # Make a backup of the uninstalled library when relinking
3281 if test "$mode" = relink
; then
3282 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3285 # Do each of the archive commands.
3286 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3287 eval test_cmds
=\"$archive_expsym_cmds\"
3288 cmds
=$archive_expsym_cmds
3290 eval test_cmds
=\"$archive_cmds\"
3293 if len
=`expr "X$test_cmds" : ".*"` &&
3294 test $len -le $max_cmd_len; then
3297 # The command line is too long to link in one step, link piecewise.
3298 $echo "creating reloadable object files..."
3300 # Save the value of $output and $libobjs because we want to
3301 # use them later. If we have whole_archive_flag_spec, we
3302 # want to use save_libobjs as it was before
3303 # whole_archive_flag_spec was expanded, because we can't
3304 # assume the linker understands whole_archive_flag_spec.
3305 # This may have to be revisited, in case too many
3306 # convenience libraries get linked in and end up exceeding
3308 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3309 save_libobjs
=$libobjs
3313 # Clear the reloadable object creation command queue and
3314 # initialize k to one.
3321 output
=$output_objdir/$save_output-${k}.
$objext
3322 # Loop over the list of objects to be linked.
3323 for obj
in $save_libobjs
3325 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3326 if test "X$objlist" = X ||
3327 { len
=`expr "X$test_cmds" : ".*"` &&
3328 test $len -le $max_cmd_len; }; then
3329 objlist
="$objlist $obj"
3331 # The command $test_cmds is almost too long, add a
3332 # command to the queue.
3333 if test $k -eq 1 ; then
3334 # The first file doesn't have a previous command to add.
3335 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3337 # All subsequent reloadable object files will link in
3338 # the last one created.
3339 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3341 last_robj
=$output_objdir/$save_output-${k}.
$objext
3343 output
=$output_objdir/$save_output-${k}.
$objext
3348 # Handle the remaining objects by creating one last
3349 # reloadable object file. All subsequent reloadable object
3350 # files will link in the last one created.
3351 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3352 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3354 # Set up a command to remove the reloadale object files
3355 # after they are used.
3357 while test $i -lt $k
3360 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3363 $echo "creating a temporary reloadable object file: $output"
3365 # Loop through the commands generated above and execute them.
3366 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3367 for cmd
in $concat_cmds; do
3371 $run eval "$cmd" ||
exit $?
3376 # Restore the value of output.
3379 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3380 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3382 # Expand the library linking commands again to reset the
3383 # value of $libobjs for piecewise linking.
3385 # Do each of the archive commands.
3386 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3387 cmds
=$archive_expsym_cmds
3392 # Append the command to remove the reloadable object files
3393 # to the just-reset $cmds.
3394 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3396 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3397 for cmd
in $cmds; do
3401 $run eval "$cmd" ||
exit $?
3405 # Restore the uninstalled library and exit
3406 if test "$mode" = relink
; then
3407 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3411 # Create links to the real library.
3412 for linkname
in $linknames; do
3413 if test "$realname" != "$linkname"; then
3414 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3415 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3419 # If -module or -export-dynamic was specified, set the dlname.
3420 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3421 # On all known operating systems, these are identical.
3428 if test -n "$deplibs"; then
3429 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3432 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3433 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3436 if test -n "$rpath"; then
3437 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3440 if test -n "$xrpath"; then
3441 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3444 if test -n "$vinfo"; then
3445 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3448 if test -n "$release"; then
3449 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3454 if test -n "$objs$old_deplibs"; then
3455 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3459 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3467 # Delete the old objects.
3468 $run $rm $obj $libobj
3470 # Objects from convenience libraries. This assumes
3471 # single-version convenience libraries. Whenever we create
3472 # different ones for PIC/non-PIC, this we'll have to duplicate
3476 # reload_cmds runs $LD directly, so let us get rid of
3477 # -Wl from whole_archive_flag_spec
3480 if test -n "$convenience"; then
3481 if test -n "$whole_archive_flag_spec"; then
3482 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3484 gentop
="$output_objdir/${obj}x"
3485 $show "${rm}r $gentop"
3486 $run ${rm}r
"$gentop"
3487 $show "$mkdir $gentop"
3488 $run $mkdir "$gentop"
3490 if test $status -ne 0 && test ! -d "$gentop"; then
3493 generated
="$generated $gentop"
3495 for xlib
in $convenience; do
3496 # Extract the objects.
3498 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3499 *) xabs
=`pwd`"/$xlib" ;;
3501 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3502 xdir
="$gentop/$xlib"
3504 $show "${rm}r $xdir"
3506 $show "$mkdir $xdir"
3509 if test $status -ne 0 && test ! -d "$xdir"; then
3512 $show "(cd $xdir && $AR x $xabs)"
3513 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3515 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3520 # Create the old-style object.
3521 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
3524 eval cmds
=\"$reload_cmds\"
3525 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3526 for cmd
in $cmds; do
3529 $run eval "$cmd" ||
exit $?
3533 # Exit if we aren't doing a library object file.
3534 if test -z "$libobj"; then
3535 if test -n "$gentop"; then
3536 $show "${rm}r $gentop"
3543 if test "$build_libtool_libs" != yes; then
3544 if test -n "$gentop"; then
3545 $show "${rm}r $gentop"
3549 # Create an invalid libtool object if no PIC, so that we don't
3550 # accidentally link it into a program.
3551 # $show "echo timestamp > $libobj"
3552 # $run eval "echo timestamp > $libobj" || exit $?
3556 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3557 # Only do commands if we really have different PIC objects.
3558 reload_objs
="$libobjs $reload_conv_objs"
3560 eval cmds
=\"$reload_cmds\"
3561 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3562 for cmd
in $cmds; do
3565 $run eval "$cmd" ||
exit $?
3569 # # Just create a symlink.
3572 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3573 # if test "X$xdir" = "X$libobj"; then
3578 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3579 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3580 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3581 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3584 if test -n "$gentop"; then
3585 $show "${rm}r $gentop"
3594 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3596 if test -n "$vinfo"; then
3597 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3600 if test -n "$release"; then
3601 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3604 if test "$preload" = yes; then
3605 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3606 test "$dlopen_self_static" = unknown
; then
3607 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3612 *-*-rhapsody* |
*-*-darwin1.
[012])
3613 # On Rhapsody replace the C library is the System framework
3614 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3615 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3621 # Don't allow lazy linking, it breaks C++ global constructors
3622 if test "$tagname" = CXX
; then
3623 compile_command
="$compile_command ${wl}-bind_at_load"
3624 finalize_command
="$finalize_command ${wl}-bind_at_load"
3626 # Time to change all our "foo.framework" stuff back to "-framework foo"
3627 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3628 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3632 compile_command
="$compile_command $compile_deplibs"
3633 finalize_command
="$finalize_command $finalize_deplibs"
3635 if test -n "$rpath$xrpath"; then
3636 # If the user specified any rpath flags, then add them.
3637 for libdir
in $rpath $xrpath; do
3638 # This is the magic to use -rpath.
3639 case "$finalize_rpath " in
3641 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3646 # Now hardcode the library paths
3649 for libdir
in $compile_rpath $finalize_rpath; do
3650 if test -n "$hardcode_libdir_flag_spec"; then
3651 if test -n "$hardcode_libdir_separator"; then
3652 if test -z "$hardcode_libdirs"; then
3653 hardcode_libdirs
="$libdir"
3655 # Just accumulate the unique libdirs.
3656 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3657 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3660 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3665 eval flag
=\"$hardcode_libdir_flag_spec\"
3666 rpath
="$rpath $flag"
3668 elif test -n "$runpath_var"; then
3669 case "$perm_rpath " in
3671 *) perm_rpath
="$perm_rpath $libdir" ;;
3675 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3676 case :$dllsearchpath: in
3678 *) dllsearchpath
="$dllsearchpath:$libdir";;
3683 # Substitute the hardcoded libdirs into the rpath.
3684 if test -n "$hardcode_libdir_separator" &&
3685 test -n "$hardcode_libdirs"; then
3686 libdir
="$hardcode_libdirs"
3687 eval rpath
=\" $hardcode_libdir_flag_spec\"
3689 compile_rpath
="$rpath"
3693 for libdir
in $finalize_rpath; do
3694 if test -n "$hardcode_libdir_flag_spec"; then
3695 if test -n "$hardcode_libdir_separator"; then
3696 if test -z "$hardcode_libdirs"; then
3697 hardcode_libdirs
="$libdir"
3699 # Just accumulate the unique libdirs.
3700 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3701 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3704 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3709 eval flag
=\"$hardcode_libdir_flag_spec\"
3710 rpath
="$rpath $flag"
3712 elif test -n "$runpath_var"; then
3713 case "$finalize_perm_rpath " in
3715 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3719 # Substitute the hardcoded libdirs into the rpath.
3720 if test -n "$hardcode_libdir_separator" &&
3721 test -n "$hardcode_libdirs"; then
3722 libdir
="$hardcode_libdirs"
3723 eval rpath
=\" $hardcode_libdir_flag_spec\"
3725 finalize_rpath
="$rpath"
3728 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3729 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3730 dlsyms
="${outputname}S.c"
3732 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3736 if test -n "$dlsyms"; then
3740 # Discover the nlist of each of the dlfiles.
3741 nlist
="$output_objdir/${outputname}.nm"
3743 $show "$rm $nlist ${nlist}S ${nlist}T"
3744 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3746 # Parse the name list into a source file.
3747 $show "creating $output_objdir/$dlsyms"
3749 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3750 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3751 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3757 /* Prevent the only kind of declaration conflicts we can make. */
3758 #define lt_preloaded_symbols some_other_symbol
3760 /* External symbol declarations for the compiler. */\
3763 if test "$dlself" = yes; then
3764 $show "generating symbol list for \`$output'"
3766 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3768 # Add our own program objects to the symbol list.
3769 progfiles
="$objs$old_deplibs"
3770 for arg
in $progfiles; do
3771 $show "extracting global C symbols from \`$arg'"
3772 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3775 if test -n "$exclude_expsyms"; then
3776 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3777 $run eval '$mv "$nlist"T "$nlist"'
3780 if test -n "$export_symbols_regex"; then
3781 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3782 $run eval '$mv "$nlist"T "$nlist"'
3785 # Prepare the list of exported symbols
3786 if test -z "$export_symbols"; then
3787 export_symbols
="$output_objdir/$output.exp"
3788 $run $rm $export_symbols
3789 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3791 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3792 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3793 $run eval 'mv "$nlist"T "$nlist"'
3797 for arg
in $dlprefiles; do
3798 $show "extracting global C symbols from \`$arg'"
3799 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3800 $run eval 'echo ": $name " >> "$nlist"'
3801 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3804 if test -z "$run"; then
3805 # Make sure we have at least an empty file.
3806 test -f "$nlist" ||
: > "$nlist"
3808 if test -n "$exclude_expsyms"; then
3809 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3810 $mv "$nlist"T
"$nlist"
3813 # Try sorting and uniquifying the output.
3814 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3817 grep -v "^: " < "$nlist" > "$nlist"S
3820 if test -f "$nlist"S
; then
3821 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3823 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3826 $echo >> "$output_objdir/$dlsyms" "\
3828 #undef lt_preloaded_symbols
3830 #if defined (__STDC__) && __STDC__
3831 # define lt_ptr_t void *
3833 # define lt_ptr_t char *
3837 /* The mapping between symbol names and symbols. */
3842 lt_preloaded_symbols[] =
3846 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3847 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3848 < "$nlist" >> "$output_objdir/$dlsyms"
3850 $echo >> "$output_objdir/$dlsyms" "\
3854 /* This works around a problem in FreeBSD linker */
3855 #ifdef FREEBSD_WORKAROUND
3856 static const void *lt_preloaded_setup() {
3857 return lt_preloaded_symbols;
3867 pic_flag_for_symtable
=
3869 # compiling the symbol table file with pic_flag works around
3870 # a FreeBSD bug that causes programs to crash when -lm is
3871 # linked before any other PIC object. But we must not use
3872 # pic_flag when linking with -static. The problem exists in
3873 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3874 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3875 case "$compile_command " in
3877 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3880 case "$compile_command " in
3882 *) pic_flag_for_symtable
=" $pic_flag";;
3886 # Now compile the dynamic symbol file.
3887 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3888 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3890 # Clean up the generated files.
3891 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3892 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3894 # Transform the symbol file into the correct name.
3895 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3896 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3899 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3904 # We keep going just in case the user didn't refer to
3905 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3906 # really was required.
3908 # Nullify the symbol file.
3909 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3910 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3913 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3914 # Replace the output file specification.
3915 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3916 link_command
="$compile_command$compile_rpath"
3918 # We have no uninstalled library dependencies, so finalize right now.
3919 $show "$link_command"
3920 $run eval "$link_command"
3923 # Delete the generated files.
3924 if test -n "$dlsyms"; then
3925 $show "$rm $output_objdir/${outputname}S.${objext}"
3926 $run $rm "$output_objdir/${outputname}S.${objext}"
3932 if test -n "$shlibpath_var"; then
3933 # We should set the shlibpath_var
3935 for dir
in $temp_rpath; do
3937 [\\/]* |
[A-Za-z
]:[\\/]*)
3942 # Relative path: add a thisdir entry.
3943 rpath
="$rpath\$thisdir/$dir:"
3950 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3951 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3953 if test -n "$finalize_shlibpath"; then
3954 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3959 if test -n "$runpath_var"; then
3960 if test -n "$perm_rpath"; then
3961 # We should set the runpath_var.
3963 for dir
in $perm_rpath; do
3966 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3968 if test -n "$finalize_perm_rpath"; then
3969 # We should set the runpath_var.
3971 for dir
in $finalize_perm_rpath; do
3974 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3978 if test "$no_install" = yes; then
3979 # We don't need to create a wrapper script.
3980 link_command
="$compile_var$compile_command$compile_rpath"
3981 # Replace the output file specification.
3982 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3983 # Delete the old output file.
3985 # Link the executable and exit
3986 $show "$link_command"
3987 $run eval "$link_command" ||
exit $?
3991 if test "$hardcode_action" = relink
; then
3992 # Fast installation is not supported
3993 link_command
="$compile_var$compile_command$compile_rpath"
3994 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3996 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3997 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3999 if test "$fast_install" != no
; then
4000 link_command
="$finalize_var$compile_command$finalize_rpath"
4001 if test "$fast_install" = yes; then
4002 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4004 # fast_install is set to needless
4008 link_command
="$compile_var$compile_command$compile_rpath"
4009 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4013 # Replace the output file specification.
4014 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4016 # Delete the old output files.
4017 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4019 $show "$link_command"
4020 $run eval "$link_command" ||
exit $?
4022 # Now create the wrapper script.
4023 $show "creating $output"
4025 # Quote the relink command for shipping.
4026 if test -n "$relink_command"; then
4027 # Preserve any variables that may affect compiler behavior
4028 for var
in $variables_saved_for_relink; do
4029 if eval test -z \"\
${$var+set}\"; then
4030 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4031 elif eval var_value
=\$
$var; test -z "$var_value"; then
4032 relink_command
="$var=; export $var; $relink_command"
4034 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4035 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4038 relink_command
="cd `pwd`; $relink_command"
4039 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4042 # Quote $echo for shipping.
4043 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4045 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4046 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4048 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4050 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4053 # Only actually do things if our run command is non-null.
4054 if test -z "$run"; then
4055 # win32 will think the script is a binary if it has
4056 # a .exe suffix, so we strip it off here.
4058 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
4060 # test for cygwin because mv fails w/o .exe extensions
4062 *cygwin
*) exeext
=.exe
;;
4066 trap "$rm $output; exit 1" 1 2 15
4071 # $output - temporary wrapper script for $objdir/$outputname
4072 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4074 # The $output program cannot be directly executed until all the libtool
4075 # libraries that it depends on are installed.
4077 # This wrapper script should never be moved out of the build directory.
4078 # If it is, it will not operate correctly.
4080 # Sed substitution that helps us do robust quoting. It backslashifies
4081 # metacharacters that are still active within double-quoted strings.
4082 Xsed='sed -e 1s/^X//'
4083 sed_quote_subst='$sed_quote_subst'
4085 # The HP-UX ksh and POSIX shell print the target directory to stdout
4087 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4089 relink_command=\"$relink_command\"
4091 # This environment variable determines our operation mode.
4092 if test \"\$libtool_install_magic\" = \"$magic\"; then
4093 # install mode needs the following variable:
4094 notinst_deplibs='$notinst_deplibs'
4096 # When we are sourced in execute mode, \$file and \$echo are already set.
4097 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4100 # Make sure echo works.
4101 if test \"X\$1\" = X--no-reexec; then
4102 # Discard the --no-reexec flag, and continue.
4104 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4105 # Yippee, \$echo works!
4108 # Restart under the correct shell, and then maybe \$echo will work.
4109 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4115 # Find the directory that this script lives in.
4116 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4117 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4119 # Follow symbolic links until we get to the real thisdir.
4120 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4121 while test -n \"\$file\"; do
4122 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4124 # If there was a directory component, then change thisdir.
4125 if test \"x\$destdir\" != \"x\$file\"; then
4126 case \"\$destdir\" in
4127 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4128 *) thisdir=\"\$thisdir/\$destdir\" ;;
4132 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4133 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4136 # Try to get the absolute directory name.
4137 absdir=\`cd \"\$thisdir\" && pwd\`
4138 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4141 if test "$fast_install" = yes; then
4143 program=lt-'$outputname'$exeext
4144 progdir=\"\$thisdir/$objdir\"
4146 if test ! -f \"\$progdir/\$program\" || \\
4147 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4148 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4150 file=\"\$\$-\$program\"
4152 if test ! -d \"\$progdir\"; then
4153 $mkdir \"\$progdir\"
4155 $rm \"\$progdir/\$file\"
4160 # relink executable if necessary
4161 if test -n \"\$relink_command\"; then
4162 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4164 $echo \"\$relink_command_output\" >&2
4165 $rm \"\$progdir/\$file\"
4170 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4171 { $rm \"\$progdir/\$program\";
4172 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4173 $rm \"\$progdir/\$file\"
4177 program='$outputname'
4178 progdir=\"\$thisdir/$objdir\"
4184 if test -f \"\$progdir/\$program\"; then"
4186 # Export our shlibpath_var if we have one.
4187 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4189 # Add our own library path to $shlibpath_var
4190 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4192 # Some systems cannot cope with colon-terminated $shlibpath_var
4193 # The second colon is a workaround for a bug in BeOS R4 sed
4194 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4196 export $shlibpath_var
4200 # fixup the dll searchpath if we need to.
4201 if test -n "$dllsearchpath"; then
4203 # Add the dll search path components to the executable PATH
4204 PATH=$dllsearchpath:\$PATH
4209 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4210 # Run the actual program with our arguments.
4213 # win32 systems need to use the prog path for dll
4215 *-*-cygwin* |
*-*-pw32*)
4217 exec \$progdir/\$program \${1+\"\$@\"}
4221 # Backslashes separate directories on plain windows
4222 *-*-mingw |
*-*-os2*)
4224 exec \$progdir\\\\\$program \${1+\"\$@\"}
4230 # Export the path to the program.
4231 PATH=\"\$progdir:\$PATH\"
4234 exec \$program \${1+\"\$@\"}
4239 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4243 # The program doesn't exist.
4244 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4245 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4246 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4257 # See if we need to build an old-fashioned archive.
4258 for oldlib
in $oldlibs; do
4260 if test "$build_libtool_libs" = convenience
; then
4261 oldobjs
="$libobjs_save"
4262 addlibs
="$convenience"
4263 build_libtool_libs
=no
4265 if test "$build_libtool_libs" = module
; then
4266 oldobjs
="$libobjs_save"
4267 build_libtool_libs
=no
4269 oldobjs
="$objs$old_deplibs $non_pic_objects"
4271 addlibs
="$old_convenience"
4274 if test -n "$addlibs"; then
4275 gentop
="$output_objdir/${outputname}x"
4276 $show "${rm}r $gentop"
4277 $run ${rm}r
"$gentop"
4278 $show "$mkdir $gentop"
4279 $run $mkdir "$gentop"
4281 if test $status -ne 0 && test ! -d "$gentop"; then
4284 generated
="$generated $gentop"
4286 # Add in members from convenience archives.
4287 for xlib
in $addlibs; do
4288 # Extract the objects.
4290 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4291 *) xabs
=`pwd`"/$xlib" ;;
4293 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4294 xdir
="$gentop/$xlib"
4296 $show "${rm}r $xdir"
4298 $show "$mkdir $xdir"
4301 if test $status -ne 0 && test ! -d "$xdir"; then
4304 $show "(cd $xdir && $AR x $xabs)"
4305 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4307 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4311 # Do each command in the archive commands.
4312 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4313 eval cmds
=\"$old_archive_from_new_cmds\"
4315 # # Ensure that we have .o objects in place in case we decided
4316 # # not to build a shared library, and have fallen back to building
4317 # # static libs even though --disable-static was passed!
4318 # for oldobj in $oldobjs; do
4319 # if test ! -f $oldobj; then
4320 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4321 # if test "X$xdir" = "X$oldobj"; then
4326 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4327 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4328 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4329 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4333 eval cmds
=\"$old_archive_cmds\"
4335 if len
=`expr "X$cmds" : ".*"` &&
4336 test $len -le $max_cmd_len; then
4339 # the command line is too long to link in one step, link in parts
4340 $echo "using piecewise archive linking..."
4345 save_oldobjs
=$oldobjs
4346 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4347 # encoded into archives. This makes 'ar r' malfunction in
4348 # this piecewise linking case whenever conflicting object
4349 # names appear in distinct ar calls; check, warn and compensate.
4350 if (for obj
in $save_oldobjs
4352 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4353 done |
sort |
sort -uc >/dev
/null
2>&1); then
4356 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4357 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4360 for obj
in $save_oldobjs
4362 oldobjs
="$objlist $obj"
4363 objlist
="$objlist $obj"
4364 eval test_cmds
=\"$old_archive_cmds\"
4365 if len
=`expr "X$test_cmds" : ".*"` &&
4366 test $len -le $max_cmd_len; then
4369 # the above command should be used before it gets too long
4371 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4372 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4378 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4381 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4382 for cmd
in $cmds; do
4385 $run eval "$cmd" ||
exit $?
4390 if test -n "$generated"; then
4391 $show "${rm}r$generated"
4392 $run ${rm}r
$generated
4395 # Now create the libtool archive.
4399 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4400 $show "creating $output"
4402 # Preserve any variables that may affect compiler behavior
4403 for var
in $variables_saved_for_relink; do
4404 if eval test -z \"\
${$var+set}\"; then
4405 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4406 elif eval var_value
=\$
$var; test -z "$var_value"; then
4407 relink_command
="$var=; export $var; $relink_command"
4409 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4410 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4413 # Quote the link command for shipping.
4415 for tag
in $taglist; do
4416 tagopts
="$tagopts --tag $tag"
4418 relink_command
="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args)"
4419 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4421 # Only create the output if not a dry run.
4422 if test -z "$run"; then
4423 for installed
in no
yes; do
4424 if test "$installed" = yes; then
4425 if test -z "$install_libdir"; then
4428 output
="$output_objdir/$outputname"i
4429 # Replace all uninstalled libtool libraries with the installed ones
4431 for deplib
in $dependency_libs; do
4434 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4435 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4436 if test -z "$libdir"; then
4437 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4440 newdependency_libs
="$newdependency_libs $libdir/$name"
4442 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4445 dependency_libs
="$newdependency_libs"
4447 for lib
in $dlfiles; do
4448 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4449 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4450 if test -z "$libdir"; then
4451 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4454 newdlfiles
="$newdlfiles $libdir/$name"
4456 dlfiles
="$newdlfiles"
4458 for lib
in $dlprefiles; do
4459 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4460 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4461 if test -z "$libdir"; then
4462 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4465 newdlprefiles
="$newdlprefiles $libdir/$name"
4467 dlprefiles
="$newdlprefiles"
4470 # place dlname in correct position for cygwin
4472 case $host,$output,$installed,$module,$dlname in
4473 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4476 # $outputname - a libtool library file
4477 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4479 # Please DO NOT delete this file!
4480 # It is necessary for linking the library.
4482 # The name that we can dlopen(3).
4485 # Names of this library.
4486 library_names='$library_names'
4488 # The name of the static archive.
4489 old_library='$old_library'
4491 # Libraries that this one depends upon.
4492 dependency_libs='$dependency_libs'
4494 # Version information for $libname.
4499 # Is this an already installed library?
4500 installed=$installed
4502 # Files to dlopen/dlpreopen
4504 dlpreopen='$dlprefiles'
4506 # Directory that this library needs to be installed in:
4507 libdir='$install_libdir'"
4508 if test "$installed" = no
&& test $need_relink = yes; then
4510 relink_command=\"$relink_command\""
4515 # Do a symbolic link so that the libtool archive can be found in
4516 # LD_LIBRARY_PATH before the program is installed.
4517 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4518 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4524 # libtool install mode
4526 modename
="$modename: install"
4528 # There may be an optional sh(1) argument at the beginning of
4529 # install_prog (especially on Windows NT).
4530 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4531 # Allow the use of GNU shtool's install command.
4532 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4533 # Aesthetically quote it.
4534 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4536 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4540 install_prog
="$arg "
4548 # The real first argument should be the name of the installation program.
4549 # Aesthetically quote it.
4550 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4552 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4556 install_prog
="$install_prog$arg"
4558 # We need to accept at least all the BSD install flags.
4568 if test -n "$dest"; then
4569 files
="$files $dest"
4587 # If the previous option needed an argument, then skip it.
4588 if test -n "$prev"; then
4597 # Aesthetically quote the argument.
4598 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4600 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4604 install_prog
="$install_prog $arg"
4607 if test -z "$install_prog"; then
4608 $echo "$modename: you must specify an install program" 1>&2
4613 if test -n "$prev"; then
4614 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4619 if test -z "$files"; then
4620 if test -z "$dest"; then
4621 $echo "$modename: no file or destination specified" 1>&2
4623 $echo "$modename: you must specify a destination" 1>&2
4629 # Strip any trailing slash from the destination.
4630 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4632 # Check to see that the destination is a directory.
4633 test -d "$dest" && isdir
=yes
4634 if test "$isdir" = yes; then
4638 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4639 test "X$destdir" = "X$dest" && destdir
=.
4640 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4642 # Not a directory, so check to see that there is only one file specified.
4644 if test $# -gt 2; then
4645 $echo "$modename: \`$dest' is not a directory" 1>&2
4651 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4653 for file in $files; do
4657 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4666 # This variable tells wrapper scripts just to set variables rather
4667 # than running their programs.
4668 libtool_install_magic
="$magic"
4673 for file in $files; do
4675 # Do each installation.
4678 # Do the static libraries later.
4679 staticlibs
="$staticlibs $file"
4683 # Check to see that this really is a libtool archive.
4684 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4686 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4694 # If there is no directory component, then add one.
4696 */* |
*\\*) .
$file ;;
4700 # Add the libdir to current_libdirs if it is the destination.
4701 if test "X$destdir" = "X$libdir"; then
4702 case "$current_libdirs " in
4704 *) current_libdirs
="$current_libdirs $libdir" ;;
4707 # Note the libdir as a future libdir.
4708 case "$future_libdirs " in
4710 *) future_libdirs
="$future_libdirs $libdir" ;;
4714 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4715 test "X$dir" = "X$file/" && dir
=
4718 if test -n "$relink_command"; then
4719 $echo "$modename: warning: relinking \`$file'" 1>&2
4720 $show "$relink_command"
4721 if $run eval "$relink_command"; then :
4723 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4728 # See the names of the shared library.
4729 set dummy
$library_names
4730 if test -n "$2"; then
4736 test -n "$relink_command" && srcname
="$realname"T
4738 # Install the shared library and build the symlinks.
4739 $show "$install_prog $dir/$srcname $destdir/$realname"
4740 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4741 if test -n "$stripme" && test -n "$striplib"; then
4742 $show "$striplib $destdir/$realname"
4743 $run eval "$striplib $destdir/$realname" ||
exit $?
4746 if test $# -gt 0; then
4747 # Delete the old symlinks, and create new ones.
4750 if test "$linkname" != "$realname"; then
4751 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4752 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4757 # Do each command in the postinstall commands.
4758 lib
="$destdir/$realname"
4759 eval cmds
=\"$postinstall_cmds\"
4760 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4761 for cmd
in $cmds; do
4764 $run eval "$cmd" ||
exit $?
4769 # Install the pseudo-library for information purposes.
4770 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4771 instname
="$dir/$name"i
4772 $show "$install_prog $instname $destdir/$name"
4773 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4775 # Maybe install the static library, too.
4776 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4780 # Install (i.e. copy) a libtool object.
4782 # Figure out destination file name, if it wasn't already specified.
4783 if test -n "$destname"; then
4784 destfile
="$destdir/$destname"
4786 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4787 destfile
="$destdir/$destfile"
4790 # Deduce the name of the destination old-style object file.
4793 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4796 staticdest
="$destfile"
4800 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4806 # Install the libtool object if requested.
4807 if test -n "$destfile"; then
4808 $show "$install_prog $file $destfile"
4809 $run eval "$install_prog $file $destfile" ||
exit $?
4812 # Install the old object if enabled.
4813 if test "$build_old_libs" = yes; then
4814 # Deduce the name of the old-style object file.
4815 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4817 $show "$install_prog $staticobj $staticdest"
4818 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4824 # Figure out destination file name, if it wasn't already specified.
4825 if test -n "$destname"; then
4826 destfile
="$destdir/$destname"
4828 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4829 destfile
="$destdir/$destfile"
4832 # Do a test to see if this is really a libtool program.
4833 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4837 # If there is no directory component, then add one.
4839 */* |
*\\*) .
$file ;;
4843 # Check the variables that should have been set.
4844 if test -z "$notinst_deplibs"; then
4845 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4850 for lib
in $notinst_deplibs; do
4851 # Check to see that each library is installed.
4853 if test -f "$lib"; then
4854 # If there is no directory component, then add one.
4856 */* |
*\\*) .
$lib ;;
4860 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4861 if test -n "$libdir" && test ! -f "$libfile"; then
4862 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4868 # If there is no directory component, then add one.
4870 */* |
*\\*) .
$file ;;
4875 if test "$fast_install" = no
&& test -n "$relink_command"; then
4876 if test "$finalize" = yes && test -z "$run"; then
4878 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4879 tmpdir
="$tmpdir/libtool-$$"
4880 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4882 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4885 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4886 outputname
="$tmpdir/$file"
4887 # Replace the output file specification.
4888 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4890 $show "$relink_command"
4891 if $run eval "$relink_command"; then :
4893 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4899 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4902 # Install the binary that we compiled earlier.
4903 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4908 # remove .exe since cygwin /usr/bin/install will append another
4910 case $install_prog,$host in
4911 */usr
/bin
/install*,*cygwin
*)
4912 case $file:$destfile in
4917 destfile
=$destfile.exe
4920 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
4926 $show "$install_prog$stripme $file $destfile"
4927 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4928 test -n "$outputname" && ${rm}r
"$tmpdir"
4933 for file in $staticlibs; do
4934 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4936 # Set up the ranlib parameters.
4937 oldlib
="$destdir/$name"
4939 $show "$install_prog $file $oldlib"
4940 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4942 if test -n "$stripme" && test -n "$striplib"; then
4943 $show "$old_striplib $oldlib"
4944 $run eval "$old_striplib $oldlib" ||
exit $?
4947 # Do each command in the postinstall commands.
4948 eval cmds
=\"$old_postinstall_cmds\"
4949 # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
4950 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='@'
4951 for cmd
in $cmds; do
4954 $run eval "$cmd" ||
exit $?
4959 if test -n "$future_libdirs"; then
4960 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4963 if test -n "$current_libdirs"; then
4964 # Maybe just do a dry run.
4965 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4966 exec_cmd
='$SHELL $0 --finish$current_libdirs'
4972 # libtool finish mode
4974 modename
="$modename: finish"
4978 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4981 libdirs
="$libdirs $dir"
4984 for libdir
in $libdirs; do
4985 if test -n "$finish_cmds"; then
4986 # Do each command in the finish commands.
4987 eval cmds
=\"$finish_cmds\"
4988 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4989 for cmd
in $cmds; do
4992 $run eval "$cmd" || admincmds
="$admincmds
4997 if test -n "$finish_eval"; then
4998 # Do the single finish_eval.
4999 eval cmds
=\"$finish_eval\"
5000 $run eval "$cmds" || admincmds
="$admincmds
5006 # Exit here if they wanted silent mode.
5007 test "$show" = ":" && exit 0
5009 echo "----------------------------------------------------------------------"
5010 echo "Libraries have been installed in:"
5011 for libdir
in $libdirs; do
5015 echo "If you ever happen to want to link against installed libraries"
5016 echo "in a given directory, LIBDIR, you must either use libtool, and"
5017 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5018 echo "flag during linking and do at least one of the following:"
5019 if test -n "$shlibpath_var"; then
5020 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5021 echo " during execution"
5023 if test -n "$runpath_var"; then
5024 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5025 echo " during linking"
5027 if test -n "$hardcode_libdir_flag_spec"; then
5029 eval flag
=\"$hardcode_libdir_flag_spec\"
5031 echo " - use the \`$flag' linker flag"
5033 if test -n "$admincmds"; then
5034 echo " - have your system administrator run these commands:$admincmds"
5036 if test -f /etc
/ld.so.conf
; then
5037 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5040 echo "See any operating system documentation about shared libraries for"
5041 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5042 echo "----------------------------------------------------------------------"
5046 # libtool execute mode
5048 modename
="$modename: execute"
5050 # The first argument is the command name.
5052 if test -z "$cmd"; then
5053 $echo "$modename: you must specify a COMMAND" 1>&2
5058 # Handle -dlopen flags immediately.
5059 for file in $execute_dlfiles; do
5060 if test ! -f "$file"; then
5061 $echo "$modename: \`$file' is not a file" 1>&2
5069 # Check to see that this really is a libtool archive.
5070 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5072 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5077 # Read the libtool library.
5081 # If there is no directory component, then add one.
5083 */* |
*\\*) .
$file ;;
5087 # Skip this library if it cannot be dlopened.
5088 if test -z "$dlname"; then
5089 # Warn if it was a shared library.
5090 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5094 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5095 test "X$dir" = "X$file" && dir
=.
5097 if test -f "$dir/$objdir/$dlname"; then
5100 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5106 # Just add the directory containing the .lo file.
5107 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5108 test "X$dir" = "X$file" && dir
=.
5112 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5117 # Get the absolute pathname.
5118 absdir
=`cd "$dir" && pwd`
5119 test -n "$absdir" && dir
="$absdir"
5121 # Now add the directory to shlibpath_var.
5122 if eval "test -z \"\$$shlibpath_var\""; then
5123 eval "$shlibpath_var=\"\$dir\""
5125 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5129 # This variable tells wrapper scripts just to set shlibpath_var
5130 # rather than running their programs.
5131 libtool_execute_magic
="$magic"
5133 # Check if any of the arguments is a wrapper script.
5140 # Do a test to see if this is really a libtool program.
5141 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5142 # If there is no directory component, then add one.
5144 */* |
*\\*) .
$file ;;
5148 # Transform arg to wrapped name.
5149 file="$progdir/$program"
5153 # Quote arguments (to preserve shell metacharacters).
5154 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5155 args
="$args \"$file\""
5158 if test -z "$run"; then
5159 if test -n "$shlibpath_var"; then
5160 # Export the shlibpath_var.
5161 eval "export $shlibpath_var"
5164 # Restore saved enviroment variables
5165 if test "${save_LC_ALL+set}" = set; then
5166 LC_ALL
="$save_LC_ALL"; export LC_ALL
5168 if test "${save_LANG+set}" = set; then
5169 LANG
="$save_LANG"; export LANG
5172 # Now prepare to actually exec the command.
5173 exec_cmd
='"$cmd"$args'
5175 # Display what would be done.
5176 if test -n "$shlibpath_var"; then
5177 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5178 $echo "export $shlibpath_var"
5185 # libtool clean and uninstall mode
5187 modename
="$modename: $mode"
5193 # This variable tells wrapper scripts just to set variables rather
5194 # than running their programs.
5195 libtool_install_magic
="$magic"
5200 -f) rm="$rm $arg"; rmforce
=yes ;;
5201 -*) rm="$rm $arg" ;;
5202 *) files
="$files $arg" ;;
5206 if test -z "$rm"; then
5207 $echo "$modename: you must specify an RM program" 1>&2
5214 for file in $files; do
5215 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5216 if test "X$dir" = "X$file"; then
5220 objdir
="$dir/$objdir"
5222 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5223 test $mode = uninstall
&& objdir
="$dir"
5225 # Remember objdir for removal later, being careful to avoid duplicates
5226 if test $mode = clean
; then
5229 *) rmdirs
="$rmdirs $objdir" ;;
5233 # Don't error if the file doesn't exist and rm -f was used.
5234 if (test -L "$file") >/dev
/null
2>&1 \
5235 ||
(test -h "$file") >/dev
/null
2>&1 \
5236 ||
test -f "$file"; then
5238 elif test -d "$file"; then
5241 elif test "$rmforce" = yes; then
5249 # Possibly a libtool archive, so verify it.
5250 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5253 # Delete the libtool libraries and symlinks.
5254 for n
in $library_names; do
5255 rmfiles
="$rmfiles $objdir/$n"
5257 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5258 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5260 if test $mode = uninstall
; then
5261 if test -n "$library_names"; then
5262 # Do each command in the postuninstall commands.
5263 eval cmds
=\"$postuninstall_cmds\"
5264 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5265 for cmd
in $cmds; do
5269 if test $?
!= 0 && test "$rmforce" != yes; then
5276 if test -n "$old_library"; then
5277 # Do each command in the old_postuninstall commands.
5278 eval cmds
=\"$old_postuninstall_cmds\"
5279 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5280 for cmd
in $cmds; do
5284 if test $?
!= 0 && test "$rmforce" != yes; then
5290 # FIXME: should reinstall the best remaining shared library.
5296 # Possibly a libtool object, so verify it.
5297 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5302 # Add PIC object to the list of files to remove.
5303 if test -n "$pic_object" \
5304 && test "$pic_object" != none
; then
5305 rmfiles
="$rmfiles $dir/$pic_object"
5308 # Add non-PIC object to the list of files to remove.
5309 if test -n "$non_pic_object" \
5310 && test "$non_pic_object" != none
; then
5311 rmfiles
="$rmfiles $dir/$non_pic_object"
5317 # Do a test to see if this is a libtool program.
5318 if test $mode = clean
&&
5319 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5323 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5324 if test "$fast_install" = yes && test -n "$relink_command"; then
5325 rmfiles
="$rmfiles $objdir/lt-$name"
5330 $show "$rm $rmfiles"
5331 $run $rm $rmfiles || exit_status
=1
5334 # Try to remove the ${objdir}s in the directories where we deleted files
5335 for dir
in $rmdirs; do
5336 if test -d "$dir"; then
5338 $run rmdir $dir >/dev
/null
2>&1
5346 $echo "$modename: you must specify a MODE" 1>&2
5347 $echo "$generic_help" 1>&2
5352 if test -z "$exec_cmd"; then
5353 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5354 $echo "$generic_help" 1>&2
5357 fi # test -z "$show_help"
5359 if test -n "$exec_cmd"; then
5364 # We need to display help for each of the modes.
5367 "Usage: $modename [OPTION]... [MODE-ARG]...
5369 Provide generalized library-building support services.
5371 --config show all configuration variables
5372 --debug enable verbose shell tracing
5373 -n, --dry-run display commands without modifying any files
5374 --features display basic configuration information and exit
5375 --finish same as \`--mode=finish'
5376 --help display this help message and exit
5377 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5378 --quiet same as \`--silent'
5379 --silent don't print informational messages
5380 --tag=TAG use configuration variables from tag TAG
5381 --version print version information
5383 MODE must be one of the following:
5385 clean remove files from the build directory
5386 compile compile a source file into a libtool object
5387 execute automatically set library path, then run a program
5388 finish complete the installation of libtool libraries
5389 install install libraries or executables
5390 link create a library or an executable
5391 uninstall remove libraries from an installed directory
5393 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5394 a more detailed description of MODE."
5400 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5402 Remove files from the build directory.
5404 RM is the name of the program to use to delete files associated with each FILE
5405 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5408 If FILE is a libtool library, object or program, all the files associated
5409 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5414 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5416 Compile a source file into a libtool library object.
5418 This mode accepts the following additional options:
5420 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5421 -prefer-pic try to building PIC objects only
5422 -prefer-non-pic try to building non-PIC objects only
5423 -static always build a \`.o' file suitable for static linking
5425 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5426 from the given SOURCEFILE.
5428 The output file name is determined by removing the directory component from
5429 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5430 library object suffix, \`.lo'."
5435 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5437 Automatically set library path, then run a program.
5439 This mode accepts the following additional options:
5441 -dlopen FILE add the directory containing FILE to the library path
5443 This mode sets the library path environment variable according to \`-dlopen'
5446 If any of the ARGS are libtool executable wrappers, then they are translated
5447 into their corresponding uninstalled binary, and any of their required library
5448 directories are added to the library path.
5450 Then, COMMAND is executed, with ARGS as arguments."
5455 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5457 Complete the installation of libtool libraries.
5459 Each LIBDIR is a directory that contains libtool libraries.
5461 The commands that this mode executes may require superuser privileges. Use
5462 the \`--dry-run' option if you just want to see what would be executed."
5467 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5469 Install executables or libraries.
5471 INSTALL-COMMAND is the installation command. The first component should be
5472 either the \`install' or \`cp' program.
5474 The rest of the components are interpreted as arguments to that command (only
5475 BSD-compatible install options are recognized)."
5480 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5482 Link object files or libraries together to form another library, or to
5483 create an executable program.
5485 LINK-COMMAND is a command using the C compiler that you would use to create
5486 a program from several object files.
5488 The following components of LINK-COMMAND are treated specially:
5490 -all-static do not do any dynamic linking at all
5491 -avoid-version do not add a version suffix if possible
5492 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5493 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5494 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5495 -export-symbols SYMFILE
5496 try to export only the symbols listed in SYMFILE
5497 -export-symbols-regex REGEX
5498 try to export only the symbols matching REGEX
5499 -LLIBDIR search LIBDIR for required installed libraries
5500 -lNAME OUTPUT-FILE requires the installed library libNAME
5501 -module build a library that can dlopened
5502 -no-fast-install disable the fast-install mode
5503 -no-install link a not-installable executable
5504 -no-undefined declare that a library does not refer to external symbols
5505 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5506 -objectlist FILE Use a list of object files found in FILE to specify objects
5507 -release RELEASE specify package release information
5508 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5509 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5510 -static do not do any dynamic linking of libtool libraries
5511 -version-info CURRENT[:REVISION[:AGE]]
5512 specify library version info [each variable defaults to 0]
5514 All other options (arguments beginning with \`-') are ignored.
5516 Every other argument is treated as a filename. Files ending in \`.la' are
5517 treated as uninstalled libtool libraries, other files are standard or library
5520 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5521 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5522 required, except when creating a convenience library.
5524 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5525 using \`ar' and \`ranlib', or on Windows using \`lib'.
5527 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5528 is created, otherwise an executable program is created."
5533 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5535 Remove libraries from an installation directory.
5537 RM is the name of the program to use to delete files associated with each FILE
5538 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5541 If FILE is a libtool library, all the files associated with it are deleted.
5542 Otherwise, only FILE itself is deleted using RM."
5546 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5553 $echo "Try \`$modename --help' for more information about other modes."
5557 # The TAGs below are defined such that we never get into a situation
5558 # in which we disable both kinds of libraries. Given conflicting
5559 # choices, we go for a static library, that is the most portable,
5560 # since we can't tell whether shared libraries were disabled because
5561 # the user asked for that or because the platform doesn't support
5562 # them. This is particularly important on AIX, because we don't
5563 # support having both static and shared libraries enabled at the same
5564 # time on that platform, so we default to a shared-only configuration.
5565 # If a disable-shared tag is given, we'll fallback to a static-only
5566 # configuration. But we'll never go from static-only to shared-only.
5568 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5569 build_libtool_libs
=no
5571 ### END LIBTOOL TAG CONFIG: disable-shared
5573 ### BEGIN LIBTOOL TAG CONFIG: disable-static
5574 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5575 ### END LIBTOOL TAG CONFIG: disable-static