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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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`
863 export_symbols_regex
=
871 prefer_static_libs
=no
883 # We need to know -static, to get the right output filenames.
887 -all-static |
-static)
888 if test "X$arg" = "X-all-static"; then
889 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
890 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
892 if test -n "$link_static_flag"; then
893 dlopen_self
=$dlopen_self_static
896 if test -z "$pic_flag" && test -n "$link_static_flag"; then
897 dlopen_self
=$dlopen_self_static
900 build_libtool_libs
=no
902 prefer_static_libs
=yes
908 # See if our shared archives depend on static archives.
909 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
911 # Go through the arguments, transforming them on the way.
912 while test $# -gt 0; do
914 base_compile
="$base_compile $arg"
917 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
918 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
922 libtool_args
="$libtool_args $qarg"
924 # If the previous option needs an argument, assign it.
925 if test -n "$prev"; then
928 compile_command
="$compile_command @OUTPUT@"
929 finalize_command
="$finalize_command @OUTPUT@"
935 if test "$preload" = no
; then
936 # Add the symbol object into the linking commands.
937 compile_command
="$compile_command @SYMFILE@"
938 finalize_command
="$finalize_command @SYMFILE@"
942 *.la |
*.lo
) ;; # We handle these cases below.
944 if test "$dlself" = no
; then
952 if test "$prev" = dlprefiles
; then
954 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
964 if test "$prev" = dlfiles
; then
965 dlfiles
="$dlfiles $arg"
967 dlprefiles
="$dlprefiles $arg"
975 export_symbols
="$arg"
976 if test ! -f "$arg"; then
977 $echo "$modename: symbol file \`$arg' does not exist"
984 export_symbols_regex
="$arg"
989 inst_prefix_dir
="$arg"
999 if test -f "$arg"; then
1002 for fil
in `cat $save_arg`
1004 # moreargs="$moreargs $fil"
1006 # A libtool-controlled object.
1008 # Check to see that this really is a libtool object.
1009 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1014 # If there is no directory component, then add one.
1016 */* |
*\\*) .
$arg ;;
1020 if test -z "$pic_object" || \
1021 test -z "$non_pic_object" ||
1022 test "$pic_object" = none
&& \
1023 test "$non_pic_object" = none
; then
1024 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1028 # Extract subdirectory from the argument.
1029 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1030 if test "X$xdir" = "X$arg"; then
1036 if test "$pic_object" != none
; then
1037 # Prepend the subdirectory the object is found in.
1038 pic_object
="$xdir$pic_object"
1040 if test "$prev" = dlfiles
; then
1041 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1042 dlfiles
="$dlfiles $pic_object"
1046 # If libtool objects are unsupported, then we need to preload.
1051 # CHECK ME: I think I busted this. -Ossama
1052 if test "$prev" = dlprefiles
; then
1053 # Preload the old-style object.
1054 dlprefiles
="$dlprefiles $pic_object"
1059 libobjs
="$libobjs $pic_object"
1064 if test "$non_pic_object" != none
; then
1065 # Prepend the subdirectory the object is found in.
1066 non_pic_object
="$xdir$non_pic_object"
1068 # A standard non-PIC object
1069 non_pic_objects
="$non_pic_objects $non_pic_object"
1070 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1071 arg
="$non_pic_object"
1074 # If the PIC object exists, use it instead.
1075 # $xdir was prepended to $pic_object above.
1076 non_pic_object
="$pic_object"
1077 non_pic_objects
="$non_pic_objects $non_pic_object"
1080 # Only an error if not doing a dry-run.
1081 if test -z "$run"; then
1082 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1087 # Extract subdirectory from the argument.
1088 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1089 if test "X$xdir" = "X$arg"; then
1095 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1096 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1097 libobjs
="$libobjs $pic_object"
1098 non_pic_objects
="$non_pic_objects $non_pic_object"
1103 $echo "$modename: link input file \`$save_arg' does not exist"
1111 # We need an absolute path.
1113 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1115 $echo "$modename: only absolute run-paths are allowed" 1>&2
1119 if test "$prev" = rpath
; then
1122 *) rpath
="$rpath $arg" ;;
1127 *) xrpath
="$xrpath $arg" ;;
1134 compiler_flags
="$compiler_flags $qarg"
1136 compile_command
="$compile_command $qarg"
1137 finalize_command
="$finalize_command $qarg"
1141 linker_flags
="$linker_flags $qarg"
1142 compiler_flags
="$compiler_flags $wl$qarg"
1144 compile_command
="$compile_command $wl$qarg"
1145 finalize_command
="$finalize_command $wl$qarg"
1152 *" $qarg.framework "*) ;;
1153 *) deplibs
="$deplibs $qarg.framework" # this is fixed later
1162 eval "$prev=\"\$arg\""
1173 if test -n "$link_static_flag"; then
1174 compile_command
="$compile_command $link_static_flag"
1175 finalize_command
="$finalize_command $link_static_flag"
1181 # FIXME: remove this flag sometime in the future.
1182 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1206 -export-symbols |
-export-symbols-regex)
1207 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1208 $echo "$modename: more than one -exported-symbols argument is not allowed"
1211 if test "X$arg" = "X-export-symbols"; then
1224 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1225 # so, if we see these flags be careful not to treat them like -L
1227 case $with_gcc/$host in
1229 compile_command
="$compile_command $arg"
1230 finalize_command
="$finalize_command $arg"
1237 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1238 # We need an absolute path.
1240 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1242 absdir
=`cd "$dir" && pwd`
1243 if test -z "$absdir"; then
1244 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1253 deplibs
="$deplibs -L$dir"
1254 lib_search_path
="$lib_search_path $dir"
1258 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1259 case :$dllsearchpath: in
1261 *) dllsearchpath
="$dllsearchpath:$dir";;
1269 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1271 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1272 # These systems don't actually have a C or math library (as such)
1275 *-*-mingw* |
*-*-os2*)
1276 # These systems don't actually have a C library (as such)
1277 test "X$arg" = "X-lc" && continue
1281 deplibs
="$deplibs $arg"
1297 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1298 # The PATH hackery in wrapper scripts is required on Windows
1299 # in order for the loader to find any dlls it needs.
1300 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1301 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1304 *) no_install
=yes ;;
1337 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1338 # We need an absolute path.
1340 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1342 $echo "$modename: only absolute run-paths are allowed" 1>&2
1348 *) xrpath
="$xrpath $dir" ;;
1354 # The effects of -static are defined in a previous loop.
1355 # We used to do the same as -all-static on platforms that
1356 # didn't have a PIC flag, but the assumption that the effects
1357 # would be equivalent was wrong. It would break on at least
1358 # Digital Unix and AIX.
1373 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1375 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1376 for flag
in $args; do
1379 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1384 compiler_flags
="$compiler_flags $flag"
1387 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1391 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1393 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1394 for flag
in $args; do
1397 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1402 compiler_flags
="$compiler_flags $wl$flag"
1403 linker_flags
="$linker_flags $flag"
1406 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1423 # Some other compiler flag.
1425 # Unknown arguments in both finalize_command and compile_command need
1426 # to be aesthetically quoted because they are evaled later.
1427 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1429 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1436 # A standard object.
1441 # A libtool-controlled object.
1443 # Check to see that this really is a libtool object.
1444 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1449 # If there is no directory component, then add one.
1451 */* |
*\\*) .
$arg ;;
1455 if test -z "$pic_object" || \
1456 test -z "$non_pic_object" ||
1457 test "$pic_object" = none
&& \
1458 test "$non_pic_object" = none
; then
1459 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1463 # Extract subdirectory from the argument.
1464 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1465 if test "X$xdir" = "X$arg"; then
1471 if test "$pic_object" != none
; then
1472 # Prepend the subdirectory the object is found in.
1473 pic_object
="$xdir$pic_object"
1475 if test "$prev" = dlfiles
; then
1476 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1477 dlfiles
="$dlfiles $pic_object"
1481 # If libtool objects are unsupported, then we need to preload.
1486 # CHECK ME: I think I busted this. -Ossama
1487 if test "$prev" = dlprefiles
; then
1488 # Preload the old-style object.
1489 dlprefiles
="$dlprefiles $pic_object"
1494 libobjs
="$libobjs $pic_object"
1499 if test "$non_pic_object" != none
; then
1500 # Prepend the subdirectory the object is found in.
1501 non_pic_object
="$xdir$non_pic_object"
1503 # A standard non-PIC object
1504 non_pic_objects
="$non_pic_objects $non_pic_object"
1505 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1506 arg
="$non_pic_object"
1509 # If the PIC object exists, use it instead.
1510 # $xdir was prepended to $pic_object above.
1511 non_pic_object
="$pic_object"
1512 non_pic_objects
="$non_pic_objects $non_pic_object"
1515 # Only an error if not doing a dry-run.
1516 if test -z "$run"; then
1517 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1522 # Extract subdirectory from the argument.
1523 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1524 if test "X$xdir" = "X$arg"; then
1530 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1531 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1532 libobjs
="$libobjs $pic_object"
1533 non_pic_objects
="$non_pic_objects $non_pic_object"
1540 deplibs
="$deplibs $arg"
1541 old_deplibs
="$old_deplibs $arg"
1546 # A libtool-controlled library.
1548 if test "$prev" = dlfiles
; then
1549 # This library was specified with -dlopen.
1550 dlfiles
="$dlfiles $arg"
1552 elif test "$prev" = dlprefiles
; then
1553 # The library was specified with -dlpreopen.
1554 dlprefiles
="$dlprefiles $arg"
1557 deplibs
="$deplibs $arg"
1562 # Some other compiler argument.
1564 # Unknown arguments in both finalize_command and compile_command need
1565 # to be aesthetically quoted because they are evaled later.
1566 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1568 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1575 # Now actually substitute the argument into the commands.
1576 if test -n "$arg"; then
1577 compile_command
="$compile_command $arg"
1578 finalize_command
="$finalize_command $arg"
1580 done # argument parsing loop
1582 if test -n "$prev"; then
1583 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1588 # Infer tagged configuration to use if any are available and
1589 # if one wasn't chosen via the "--tag" command line option.
1590 # Only attempt this if the compiler in the base link
1591 # command doesn't match the default compiler.
1592 if test -n "$available_tags" && test -z "$tagname"; then
1593 case $base_compile in
1595 # Blanks in the command may have been stripped by the calling shell,
1596 # but not from the CC environment variable when ltconfig was run.
1599 for z
in $available_tags; do
1600 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1601 # Evaluate the configuration.
1602 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1603 case $base_compile in
1605 # The compiler in $compile_command matches
1606 # the one in the tagged configuration.
1607 # Assume this is the tagged configuration we want.
1618 # If $tagname still isn't set, then no tagged configuration
1619 # was found and let the user know that the "--tag" command
1620 # line option must be used.
1621 if test -z "$tagname"; then
1622 echo "$modename: unable to infer tagged configuration"
1623 echo "$modename: specify a tag with \`--tag'" 1>&2
1626 # echo "$modename: using $tagname tagged configuration"
1632 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1633 eval arg
=\"$export_dynamic_flag_spec\"
1634 compile_command
="$compile_command $arg"
1635 finalize_command
="$finalize_command $arg"
1638 # calculate the name of the file, without its directory
1639 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1640 libobjs_save
="$libobjs"
1642 if test -n "$shlibpath_var"; then
1643 # get the directories listed in $shlibpath_var
1644 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1648 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1649 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1651 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1652 if test "X$output_objdir" = "X$output"; then
1653 output_objdir
="$objdir"
1655 output_objdir
="$output_objdir/$objdir"
1657 # Create the object directory.
1658 if test ! -d $output_objdir; then
1659 $show "$mkdir $output_objdir"
1660 $run $mkdir $output_objdir
1662 if test $status -ne 0 && test ! -d $output_objdir; then
1667 # Determine the type of output
1670 $echo "$modename: you must specify an output file" 1>&2
1674 *.
$libext) linkmode
=oldlib
;;
1675 *.lo |
*.
$objext) linkmode
=obj
;;
1676 *.la
) linkmode
=lib
;;
1677 *) linkmode
=prog
;; # Anything else should be a program.
1682 # Find all interdependent deplibs by searching for libraries
1683 # that are linked more than once (e.g. -la -lb -la)
1684 for deplib
in $deplibs; do
1686 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1688 libs
="$libs $deplib"
1691 if test $linkmode = lib
; then
1692 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1694 # Compute libraries that are listed more than once in $predeps
1695 # $postdeps and mark them as special (i.e., whose duplicates are
1696 # not to be eliminated).
1698 for pre_post_dep
in $predeps $postdeps; do
1699 case "$pre_post_deps " in
1700 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1702 pre_post_deps
="$pre_post_deps $pre_post_dep"
1710 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1711 notinst_deplibs
= # not-installed libtool libraries
1712 notinst_path
= # paths that contain not-installed libtool libraries
1716 for file in $dlfiles $dlprefiles; do
1720 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1732 passes
="conv scan dlopen dlpreopen link"
1737 for pass
in $passes; do
1738 if test $linkmode = prog
; then
1739 # Determine which files to process
1743 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1746 dlpreopen
) libs
="$dlprefiles" ;;
1747 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1750 for deplib
in $libs; do
1755 if test $linkmode = oldlib
&& test $linkmode = obj
; then
1756 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1759 if test $pass = conv
; then
1760 deplibs
="$deplib $deplibs"
1763 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1764 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1765 # Search the libtool library
1766 lib
="$searchdir/lib${name}.la"
1767 if test -f "$lib"; then
1772 if test "$found" != yes; then
1773 # deplib doesn't seem to be a libtool library
1774 if test "$linkmode,$pass" = "prog,link"; then
1775 compile_deplibs
="$deplib $compile_deplibs"
1776 finalize_deplibs
="$deplib $finalize_deplibs"
1778 deplibs
="$deplib $deplibs"
1779 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1787 deplibs
="$deplib $deplibs"
1788 test $pass = conv
&& continue
1789 newdependency_libs
="$deplib $newdependency_libs"
1790 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1793 if test $pass = conv
; then
1794 deplibs
="$deplib $deplibs"
1797 if test $pass = scan
; then
1798 deplibs
="$deplib $deplibs"
1799 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1801 compile_deplibs
="$deplib $compile_deplibs"
1802 finalize_deplibs
="$deplib $finalize_deplibs"
1806 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1812 if test $pass = link
; then
1813 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1814 # Make sure the xrpath contains only unique directories.
1817 *) xrpath
="$xrpath $dir" ;;
1820 deplibs
="$deplib $deplibs"
1823 *.la
) lib
="$deplib" ;;
1825 if test $pass = conv
; then
1826 deplibs
="$deplib $deplibs"
1831 if test "$deplibs_check_method" != pass_all
; then
1833 echo "*** Warning: This library needs some functionality provided by $deplib."
1834 echo "*** I have the capability to make that library automatically link in when"
1835 echo "*** you link to this library. But I can only do this if you have a"
1836 echo "*** shared version of the library, which you do not appear to have."
1839 echo "*** Warning: Linking the shared library $output against the"
1840 echo "*** static library $deplib is not portable!"
1841 deplibs
="$deplib $deplibs"
1846 if test $pass != link
; then
1847 deplibs
="$deplib $deplibs"
1849 compile_deplibs
="$deplib $compile_deplibs"
1850 finalize_deplibs
="$deplib $finalize_deplibs"
1857 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1858 # If there is no dlopen support or we're linking statically,
1859 # we need to preload.
1860 newdlprefiles
="$newdlprefiles $deplib"
1861 compile_deplibs
="$deplib $compile_deplibs"
1862 finalize_deplibs
="$deplib $finalize_deplibs"
1864 newdlfiles
="$newdlfiles $deplib"
1873 if test $found = yes ||
test -f "$lib"; then :
1875 $echo "$modename: cannot find the library \`$lib'" 1>&2
1879 # Check to see that this really is a libtool archive.
1880 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1882 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1886 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1887 test "X$ladir" = "X$lib" && ladir
="."
1895 # If the library was installed with an old release of libtool,
1896 # it will not redefine variable installed.
1901 */* |
*\\*) .
$lib ;;
1907 # Convert "-framework foo" to "foo.framework" in dependency_libs
1908 test -n "$dependency_libs" && dependency_libs
=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
1912 if test "$linkmode,$pass" = "lib,link" ||
1913 test "$linkmode,$pass" = "prog,scan" ||
1914 { test $linkmode = oldlib
&& test $linkmode = obj
; }; then
1915 # Add dl[pre]opened files of deplib
1916 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1917 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1920 if test $pass = conv
; then
1921 # Only check for convenience libraries
1922 deplibs
="$lib $deplibs"
1923 if test -z "$libdir"; then
1924 if test -z "$old_library"; then
1925 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1928 # It is a libtool convenience library, so add in its objects.
1929 convenience
="$convenience $ladir/$objdir/$old_library"
1930 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1932 for deplib
in $dependency_libs; do
1933 deplibs
="$deplib $deplibs"
1934 case "$tmp_libs " in
1935 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1937 tmp_libs
="$tmp_libs $deplib"
1939 elif test $linkmode != prog
&& test $linkmode != lib
; then
1940 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1946 # Get the name of the library we link against.
1948 for l
in $old_library $library_names; do
1951 if test -z "$linklib"; then
1952 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1956 # This library was specified with -dlopen.
1957 if test $pass = dlopen
; then
1958 if test -z "$libdir"; then
1959 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1962 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1963 # If there is no dlname, no dlopen support or we're linking
1964 # statically, we need to preload.
1965 dlprefiles
="$dlprefiles $lib"
1967 newdlfiles
="$newdlfiles $lib"
1972 # We need an absolute path.
1974 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1976 abs_ladir
=`cd "$ladir" && pwd`
1977 if test -z "$abs_ladir"; then
1978 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1979 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1984 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1986 # Find the relevant object directory and library name.
1987 if test "X$installed" = Xyes
; then
1988 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1989 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1998 dir
="$ladir/$objdir"
1999 absdir
="$abs_ladir/$objdir"
2000 # Remove this search path later
2001 notinst_path
="$notinst_path $abs_ladir"
2002 fi # $installed = yes
2003 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2005 # This library was specified with -dlpreopen.
2006 if test $pass = dlpreopen
; then
2007 if test -z "$libdir"; then
2008 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2011 # Prefer using a static library (so that no silly _DYNAMIC symbols
2012 # are required to link).
2013 if test -n "$old_library"; then
2014 newdlprefiles
="$newdlprefiles $dir/$old_library"
2015 # Otherwise, use the dlname, so that lt_dlopen finds it.
2016 elif test -n "$dlname"; then
2017 newdlprefiles
="$newdlprefiles $dir/$dlname"
2019 newdlprefiles
="$newdlprefiles $dir/$linklib"
2021 fi # $pass = dlpreopen
2023 if test -z "$libdir"; then
2024 # Link the convenience library
2025 if test $linkmode = lib
; then
2026 deplibs
="$dir/$old_library $deplibs"
2027 elif test "$linkmode,$pass" = "prog,link"; then
2028 compile_deplibs
="$dir/$old_library $compile_deplibs"
2029 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2031 deplibs
="$lib $deplibs"
2036 if test $linkmode = prog
&& test $pass != link
; then
2037 newlib_search_path
="$newlib_search_path $ladir"
2038 deplibs
="$lib $deplibs"
2041 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2042 test "$build_libtool_libs" = no
; then
2047 for deplib
in $dependency_libs; do
2049 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2051 # Need to link against all dependency_libs?
2052 if test $linkalldeplibs = yes; then
2053 deplibs
="$deplib $deplibs"
2055 # Need to hardcode shared library paths
2056 # or/and link against static libraries
2057 newdependency_libs
="$deplib $newdependency_libs"
2059 case "$tmp_libs " in
2060 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2062 tmp_libs
="$tmp_libs $deplib"
2065 fi # $linkmode = prog...
2067 link_static
=no
# Whether the deplib will be linked statically
2068 if test -n "$library_names" &&
2069 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2070 # Link against this shared library
2072 if test "$linkmode,$pass" = "prog,link" ||
2073 { test $linkmode = lib
&& test $hardcode_into_libs = yes; }; then
2074 # Hardcode the library path.
2075 # Skip directories that are in the system default run-time
2077 case " $sys_lib_dlsearch_path " in
2080 case "$compile_rpath " in
2082 *) compile_rpath
="$compile_rpath $absdir"
2086 case " $sys_lib_dlsearch_path " in
2089 case "$finalize_rpath " in
2091 *) finalize_rpath
="$finalize_rpath $libdir"
2095 if test $linkmode = prog
; then
2096 # We need to hardcode the library path
2097 if test -n "$shlibpath_var"; then
2098 # Make sure the rpath contains only unique directories.
2099 case "$temp_rpath " in
2102 *) temp_rpath
="$temp_rpath $dir" ;;
2106 fi # $linkmode,$pass = prog,link...
2108 if test "$alldeplibs" = yes &&
2109 { test "$deplibs_check_method" = pass_all ||
2110 { test "$build_libtool_libs" = yes &&
2111 test -n "$library_names"; }; }; then
2112 # We only need to search for static libraries
2116 if test "$installed" = no
; then
2117 notinst_deplibs
="$notinst_deplibs $lib"
2121 if test -n "$old_archive_from_expsyms_cmds"; then
2122 # figure out the soname
2123 set dummy
$library_names
2126 libname
=`eval \\$echo \"$libname_spec\"`
2127 # use dlname if we got it. it's perfectly good, no?
2128 if test -n "$dlname"; then
2130 elif test -n "$soname_spec"; then
2134 major
=`expr $current - $age`
2138 eval soname
=\"$soname_spec\"
2143 # Make a new name for the extract_expsyms_cmds to use
2145 soname
=`echo $soroot | sed -e 's/^.*\///'`
2146 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2148 # If the library has no export list, then create one now
2149 if test -f "$output_objdir/$soname-def"; then :
2151 $show "extracting exported symbol list from \`$soname'"
2152 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2153 cmds
=$extract_expsyms_cmds
2154 for cmd
in $cmds; do
2158 $run eval "$cmd" ||
exit $?
2164 if test -f "$output_objdir/$newlib"; then :; else
2165 $show "generating import library for \`$soname'"
2166 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2167 cmds
=$old_archive_from_expsyms_cmds
2168 for cmd
in $cmds; do
2172 $run eval "$cmd" ||
exit $?
2176 # make sure the library variables are pointing to the new library
2179 fi # test -n $old_archive_from_expsyms_cmds
2181 if test $linkmode = prog ||
test "$mode" != relink
; then
2186 case $hardcode_action in
2187 immediate | unsupported
)
2188 if test "$hardcode_direct" = no
; then
2190 elif test "$hardcode_minus_L" = no
; then
2192 *-*-sunos*) add_shlibpath
="$dir" ;;
2196 elif test "$hardcode_shlibpath_var" = no
; then
2197 add_shlibpath
="$dir"
2204 if test "$hardcode_direct" = yes; then
2206 elif test "$hardcode_minus_L" = yes; then
2208 # Try looking first in the location we're being installed to.
2209 if test -n "$inst_prefix_dir"; then
2212 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2217 elif test "$hardcode_shlibpath_var" = yes; then
2218 add_shlibpath
="$dir"
2227 if test "$lib_linked" != yes; then
2228 $echo "$modename: configuration error: unsupported hardcode properties"
2232 if test -n "$add_shlibpath"; then
2233 case :$compile_shlibpath: in
2234 *":$add_shlibpath:"*) ;;
2235 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2238 if test $linkmode = prog
; then
2239 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2240 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2242 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2243 test -n "$add" && deplibs
="$add $deplibs"
2244 if test "$hardcode_direct" != yes && \
2245 test "$hardcode_minus_L" != yes && \
2246 test "$hardcode_shlibpath_var" = yes; then
2247 case :$finalize_shlibpath: in
2249 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2255 if test $linkmode = prog ||
test "$mode" = relink
; then
2259 # Finalize command for both is simple: just hardcode it.
2260 if test "$hardcode_direct" = yes; then
2261 add
="$libdir/$linklib"
2262 elif test "$hardcode_minus_L" = yes; then
2265 elif test "$hardcode_shlibpath_var" = yes; then
2266 case :$finalize_shlibpath: in
2268 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2272 # We cannot seem to hardcode it, guess we'll fake it.
2274 # Try looking first in the location we're being installed to.
2275 if test -n "$inst_prefix_dir"; then
2278 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2285 if test $linkmode = prog
; then
2286 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2287 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2289 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2290 test -n "$add" && deplibs
="$add $deplibs"
2293 elif test $linkmode = prog
; then
2294 if test "$alldeplibs" = yes &&
2295 { test "$deplibs_check_method" = pass_all ||
2296 { test "$build_libtool_libs" = yes &&
2297 test -n "$library_names"; }; }; then
2298 # We only need to search for static libraries
2302 # Try to link the static library
2303 # Here we assume that one of hardcode_direct or hardcode_minus_L
2304 # is not unsupported. This is valid on all known static and
2306 if test "$hardcode_direct" != unsupported
; then
2307 test -n "$old_library" && linklib
="$old_library"
2308 compile_deplibs
="$dir/$linklib $compile_deplibs"
2309 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2311 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2312 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2314 elif test "$build_libtool_libs" = yes; then
2315 # Not a shared library
2316 if test "$deplibs_check_method" != pass_all
; then
2317 # We're trying link a shared library against a static one
2318 # but the system doesn't support it.
2320 # Just print a warning and add the library to dependency_libs so
2321 # that the program can be linked against the static library.
2323 echo "*** Warning: This library needs some functionality provided by $lib."
2324 echo "*** I have the capability to make that library automatically link in when"
2325 echo "*** you link to this library. But I can only do this if you have a"
2326 echo "*** shared version of the library, which you do not appear to have."
2327 if test "$module" = yes; then
2328 echo "*** Therefore, libtool will create a static module, that should work "
2329 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2330 if test -z "$global_symbol_pipe"; then
2332 echo "*** However, this would only work if libtool was able to extract symbol"
2333 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2334 echo "*** not find such a program. So, this module is probably useless."
2335 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2337 if test "$build_old_libs" = no
; then
2338 build_libtool_libs
=module
2341 build_libtool_libs
=no
2345 convenience
="$convenience $dir/$old_library"
2346 old_convenience
="$old_convenience $dir/$old_library"
2347 deplibs
="$dir/$old_library $deplibs"
2350 fi # link shared/static library?
2352 if test $linkmode = lib
; then
2353 if test -n "$dependency_libs" &&
2354 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
2355 test $link_static = yes; }; then
2356 # Extract -R from dependency_libs
2358 for libdir
in $dependency_libs; do
2360 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2362 *" $temp_xrpath "*) ;;
2363 *) xrpath
="$xrpath $temp_xrpath";;
2365 *) temp_deplibs
="$temp_deplibs $libdir";;
2368 dependency_libs
="$temp_deplibs"
2371 newlib_search_path
="$newlib_search_path $absdir"
2372 # Link against this library
2373 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2374 # ... and its dependency_libs
2376 for deplib
in $dependency_libs; do
2377 newdependency_libs
="$deplib $newdependency_libs"
2378 case "$tmp_libs " in
2379 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2381 tmp_libs
="$tmp_libs $deplib"
2384 if test $link_all_deplibs != no
; then
2385 # Add the search paths of all dependency libraries
2386 for deplib
in $dependency_libs; do
2388 -L*) path
="$deplib" ;;
2390 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2391 test "X$dir" = "X$deplib" && dir
="."
2392 # We need an absolute path.
2394 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2396 absdir
=`cd "$dir" && pwd`
2397 if test -z "$absdir"; then
2398 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2403 if grep "^installed=no" $deplib > /dev
/null
; then
2404 path
="-L$absdir/$objdir"
2406 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2407 if test -z "$libdir"; then
2408 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2411 if test "$absdir" != "$libdir"; then
2412 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2419 case " $deplibs " in
2421 *) deplibs
="$path $deplibs" ;;
2424 fi # link_all_deplibs != no
2426 done # for deplib in $libs
2427 if test $pass = dlpreopen
; then
2428 # Link the dlpreopened libraries before other libraries
2429 for deplib
in $save_deplibs; do
2430 deplibs
="$deplib $deplibs"
2433 if test $pass != dlopen
; then
2434 test $pass != scan
&& dependency_libs
="$newdependency_libs"
2435 if test $pass != conv
; then
2436 # Make sure lib_search_path contains only unique directories.
2438 for dir
in $newlib_search_path; do
2439 case "$lib_search_path " in
2441 *) lib_search_path
="$lib_search_path $dir" ;;
2447 if test "$linkmode,$pass" != "prog,link"; then
2450 vars
="compile_deplibs finalize_deplibs"
2452 for var
in $vars dependency_libs
; do
2453 # Add libraries to $var in reverse order
2454 eval tmp_libs
=\"\$
$var\"
2456 for deplib
in $tmp_libs; do
2458 -L*) new_libs
="$deplib $new_libs" ;;
2460 case " $specialdeplibs " in
2461 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2463 case " $new_libs " in
2465 *) new_libs
="$deplib $new_libs" ;;
2473 for deplib
in $new_libs; do
2476 case " $tmp_libs " in
2478 *) tmp_libs
="$tmp_libs $deplib" ;;
2481 *) tmp_libs
="$tmp_libs $deplib" ;;
2484 eval $var=\"$tmp_libs\"
2487 if test "$pass" = "conv" &&
2488 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2489 libs
="$deplibs" # reset libs
2493 if test $linkmode = prog
; then
2494 dlfiles
="$newdlfiles"
2495 dlprefiles
="$newdlprefiles"
2500 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2501 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2504 if test -n "$rpath"; then
2505 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2508 if test -n "$xrpath"; then
2509 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2512 if test -n "$vinfo"; then
2513 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2516 if test -n "$release"; then
2517 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2520 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2521 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2524 # Now set the variables for building old libraries.
2525 build_libtool_libs
=no
2527 objs
="$objs$old_deplibs"
2531 # Make sure we only generate libraries of the form `libNAME.la'.
2534 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2535 eval shared_ext
=\"$shrext\"
2536 eval libname
=\"$libname_spec\"
2539 if test "$module" = no
; then
2540 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2544 if test "$need_lib_prefix" != no
; then
2545 # Add the "lib" prefix for modules if required
2546 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2547 eval shared_ext
=\"$shrext\"
2548 eval libname
=\"$libname_spec\"
2550 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2555 if test -n "$objs"; then
2556 if test "$deplibs_check_method" != pass_all
; then
2557 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2561 echo "*** Warning: Linking the shared library $output against the non-libtool"
2562 echo "*** objects $objs is not portable!"
2563 libobjs
="$libobjs $objs"
2567 if test "$dlself" != no
; then
2568 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2572 if test $# -gt 2; then
2573 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2578 if test -z "$rpath"; then
2579 if test "$build_libtool_libs" = yes; then
2580 # Building a libtool convenience library.
2581 # Some compilers have problems with a `.al' extension so
2582 # convenience libraries should have the same extension an
2583 # archive normally would.
2584 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2585 build_libtool_libs
=convenience
2589 if test -n "$vinfo"; then
2590 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2593 if test -n "$release"; then
2594 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2598 # Parse the version information argument.
2599 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2600 set dummy
$vinfo 0 0 0
2603 if test -n "$8"; then
2604 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2613 # Check that each of the things are valid numbers.
2615 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2617 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2618 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2624 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2626 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2627 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2633 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2635 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2636 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2641 if test $age -gt $current; then
2642 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2643 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2647 # Calculate the version variables.
2651 case $version_type in
2655 # Like Linux, but with the current version available in
2656 # verstring for coding it into the library header
2657 major
=.
`expr $current - $age`
2658 versuffix
="$major.$age.$revision"
2659 # Darwin ld doesn't like 0 for these options...
2660 minor_current
=`expr $current + 1`
2661 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2666 versuffix
=".$current.$revision";
2671 versuffix
=".$current";
2675 major
=`expr $current - $age + 1`
2676 verstring
="sgi$major.$revision"
2678 # Add in all the interfaces that we are compatible with.
2680 while test $loop != 0; do
2681 iface
=`expr $revision - $loop`
2682 loop
=`expr $loop - 1`
2683 verstring
="sgi$major.$iface:$verstring"
2686 # Before this point, $major must not contain `.'.
2688 versuffix
="$major.$revision"
2692 major
=.
`expr $current - $age`
2693 versuffix
="$major.$age.$revision"
2697 major
=.
`expr $current - $age`
2698 versuffix
=".$current.$age.$revision"
2699 verstring
="$current.$age.$revision"
2701 # Add in all the interfaces that we are compatible with.
2703 while test $loop != 0; do
2704 iface
=`expr $current - $loop`
2705 loop
=`expr $loop - 1`
2706 verstring
="$verstring:${iface}.0"
2709 # Make executables depend on our current version.
2710 verstring
="$verstring:${current}.0"
2715 versuffix
=".$current.$revision"
2719 # Use '-' rather than '.', since we only want one
2720 # extension on DOS 8.3 filesystems.
2721 major
=`expr $current - $age`
2726 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2727 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2732 # Clear the version info if we defaulted, and they specified a release.
2733 if test -z "$vinfo" && test -n "$release"; then
2735 case $version_type in
2737 # we can't check for "0.0" in archive_cmds due to quoting
2738 # problems, so we reset it completely
2745 if test "$need_version" = no
; then
2752 # Remove version info from name if versioning should be avoided
2753 if test "$avoid_version" = yes && test "$need_version" = no
; then
2759 # Check to see if the archive will have undefined symbols.
2760 if test "$allow_undefined" = yes; then
2761 if test "$allow_undefined_flag" = unsupported
; then
2762 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2763 build_libtool_libs
=no
2767 # Don't allow undefined symbols.
2768 allow_undefined_flag
="$no_undefined_flag"
2772 if test "$mode" != relink
; then
2773 # Remove our outputs, but don't remove object files since they
2774 # may have been created when compiling PIC objects.
2776 tempremovelist
=`echo "$output_objdir/*"`
2777 for p
in $tempremovelist; do
2781 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2782 removelist
="$removelist $p"
2787 if test -n "$removelist"; then
2788 $show "${rm}r $removelist"
2789 $run ${rm}r
$removelist
2793 # Now set the variables for building old libraries.
2794 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2795 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2797 # Transform .lo files to .o files.
2798 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2801 # Eliminate all temporary directories.
2802 for path
in $notinst_path; do
2803 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2804 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2805 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2808 if test -n "$xrpath"; then
2809 # If the user specified any rpath flags, then add them.
2811 for libdir
in $xrpath; do
2812 temp_xrpath
="$temp_xrpath -R$libdir"
2813 case "$finalize_rpath " in
2815 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2818 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2819 dependency_libs
="$temp_xrpath $dependency_libs"
2823 # Make sure dlfiles contains only unique files that won't be dlpreopened
2824 old_dlfiles
="$dlfiles"
2826 for lib
in $old_dlfiles; do
2827 case " $dlprefiles $dlfiles " in
2829 *) dlfiles
="$dlfiles $lib" ;;
2833 # Make sure dlprefiles contains only unique files
2834 old_dlprefiles
="$dlprefiles"
2836 for lib
in $old_dlprefiles; do
2837 case "$dlprefiles " in
2839 *) dlprefiles
="$dlprefiles $lib" ;;
2843 if test "$build_libtool_libs" = yes; then
2844 if test -n "$rpath"; then
2846 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2847 # these systems don't actually have a c library (as such)!
2849 *-*-rhapsody* |
*-*-darwin1.
[012])
2850 # Rhapsody C library is in the System framework
2851 deplibs
="$deplibs -framework System"
2854 # Don't link with libc until the a.out ld.so is fixed.
2857 # Add libc to deplibs on all other systems if necessary.
2858 if test $build_libtool_need_lc = "yes"; then
2859 deplibs
="$deplibs -lc"
2865 # Transform deplibs into only deplibs that can be linked in shared.
2867 libname_save
=$libname
2868 release_save
=$release
2869 versuffix_save
=$versuffix
2871 # I'm not sure if I'm treating the release correctly. I think
2872 # release should show up in the -l (ie -lgmp5) so we don't want to
2873 # add it in twice. Is that correct?
2879 case $deplibs_check_method in
2881 # Don't check for shared/static. Everything works.
2882 # This might be a little naive. We might want to check
2883 # whether the library exists or not. But this is on
2884 # osf3 & osf4 and I'm not really sure... Just
2885 # implementing what was already the behaviour.
2889 # This code stresses the "libraries are programs" paradigm to its
2890 # limits. Maybe even breaks it. We compile a program, linking it
2891 # against the deplibs as a proxy for the library. Then we can check
2892 # whether they linked in statically or dynamically with ldd.
2894 cat > conftest.c
<<EOF
2895 int main() { return 0; }
2898 $LTCC -o conftest conftest.c
$deplibs
2899 if test $?
-eq 0 ; then
2900 ldd_output
=`ldd conftest`
2901 for i
in $deplibs; do
2902 name
="`expr $i : '-l\(.*\)'`"
2903 # If $name is empty we are operating on a -L argument.
2904 if test -n "$name" && test "$name" != "0"; then
2905 libname
=`eval \\$echo \"$libname_spec\"`
2906 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2907 set dummy
$deplib_matches
2909 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2910 newdeplibs
="$newdeplibs $i"
2914 echo "*** Warning: This library needs some functionality provided by $i."
2915 echo "*** I have the capability to make that library automatically link in when"
2916 echo "*** you link to this library. But I can only do this if you have a"
2917 echo "*** shared version of the library, which you do not appear to have."
2920 newdeplibs
="$newdeplibs $i"
2924 # Error occured in the first compile. Let's try to salvage the situation:
2925 # Compile a seperate program for each library.
2926 for i
in $deplibs; do
2927 name
="`expr $i : '-l\(.*\)'`"
2928 # If $name is empty we are operating on a -L argument.
2929 if test -n "$name" && test "$name" != "0"; then
2931 $LTCC -o conftest conftest.c
$i
2933 if test $?
-eq 0 ; then
2934 ldd_output
=`ldd conftest`
2935 libname
=`eval \\$echo \"$libname_spec\"`
2936 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2937 set dummy
$deplib_matches
2939 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2940 newdeplibs
="$newdeplibs $i"
2944 echo "*** Warning: This library needs some functionality provided by $i."
2945 echo "*** I have the capability to make that library automatically link in when"
2946 echo "*** you link to this library. But I can only do this if you have a"
2947 echo "*** shared version of the library, which you do not appear to have."
2952 echo "*** Warning! Library $i is needed by this library but I was not able to"
2953 echo "*** make it link in! You will probably need to install it or some"
2954 echo "*** library that it depends on before this library will be fully"
2955 echo "*** functional. Installing it before continuing would be even better."
2958 newdeplibs
="$newdeplibs $i"
2964 set dummy
$deplibs_check_method
2965 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2966 for a_deplib
in $deplibs; do
2967 name
="`expr $a_deplib : '-l\(.*\)'`"
2968 # If $name is empty we are operating on a -L argument.
2969 if test -n "$name" && test "$name" != "0"; then
2970 libname
=`eval \\$echo \"$libname_spec\"`
2971 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2972 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2973 for potent_lib
in $potential_libs; do
2974 # Follow soft links.
2975 if ls -lLd "$potent_lib" 2>/dev
/null \
2976 |
grep " -> " >/dev
/null
; then
2979 # The statement above tries to avoid entering an
2980 # endless loop below, in case of cyclic links.
2981 # We might still enter an endless loop, since a link
2982 # loop can be closed while we follow links,
2984 potlib
="$potent_lib"
2985 while test -h "$potlib" 2>/dev
/null
; do
2986 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2988 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2989 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2992 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2994 |
egrep "$file_magic_regex" > /dev
/null
; then
2995 newdeplibs
="$newdeplibs $a_deplib"
3001 if test -n "$a_deplib" ; then
3004 echo "*** Warning: This library needs some functionality provided by $a_deplib."
3005 echo "*** I have the capability to make that library automatically link in when"
3006 echo "*** you link to this library. But I can only do this if you have a"
3007 echo "*** shared version of the library, which you do not appear to have."
3010 # Add a -L argument.
3011 newdeplibs
="$newdeplibs $a_deplib"
3013 done # Gone through all deplibs.
3016 set dummy
$deplibs_check_method
3017 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3018 for a_deplib
in $deplibs; do
3019 name
="`expr $a_deplib : '-l\(.*\)'`"
3020 # If $name is empty we are operating on a -L argument.
3021 if test -n "$name" && test "$name" != "0"; then
3022 libname
=`eval \\$echo \"$libname_spec\"`
3023 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3024 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3025 for potent_lib
in $potential_libs; do
3026 if eval echo \"$potent_lib\" 2>/dev
/null \
3028 |
egrep "$match_pattern_regex" > /dev
/null
; then
3029 newdeplibs
="$newdeplibs $a_deplib"
3035 if test -n "$a_deplib" ; then
3038 echo "*** Warning: This library needs some functionality provided by $a_deplib."
3039 echo "*** I have the capability to make that library automatically link in when"
3040 echo "*** you link to this library. But I can only do this if you have a"
3041 echo "*** shared version of the library, which you do not appear to have."
3044 # Add a -L argument.
3045 newdeplibs
="$newdeplibs $a_deplib"
3047 done # Gone through all deplibs.
3051 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
3052 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3053 grep .
>/dev
/null
; then
3055 if test "X$deplibs_check_method" = "Xnone"; then
3056 echo "*** Warning: inter-library dependencies are not supported in this platform."
3058 echo "*** Warning: inter-library dependencies are not known to be supported."
3060 echo "*** All declared inter-library dependencies are being dropped."
3065 versuffix
=$versuffix_save
3067 release
=$release_save
3068 libname
=$libname_save
3072 *-*-rhapsody* |
*-*-darwin1.
[012])
3073 # On Rhapsody replace the C library is the System framework
3074 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3078 if test "$droppeddeps" = yes; then
3079 if test "$module" = yes; then
3081 echo "*** Warning: libtool could not satisfy all declared inter-library"
3082 echo "*** dependencies of module $libname. Therefore, libtool will create"
3083 echo "*** a static module, that should work as long as the dlopening"
3084 echo "*** application is linked with the -dlopen flag."
3085 if test -z "$global_symbol_pipe"; then
3087 echo "*** However, this would only work if libtool was able to extract symbol"
3088 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3089 echo "*** not find such a program. So, this module is probably useless."
3090 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3092 if test "$build_old_libs" = no
; then
3093 oldlibs
="$output_objdir/$libname.$libext"
3094 build_libtool_libs
=module
3097 build_libtool_libs
=no
3100 echo "*** The inter-library dependencies that have been dropped here will be"
3101 echo "*** automatically added whenever a program is linked with this library"
3102 echo "*** or is declared to -dlopen it."
3104 if test $allow_undefined = no
; then
3106 echo "*** Since this library must not contain undefined symbols,"
3107 echo "*** because either the platform does not support them or"
3108 echo "*** it was explicitly requested with -no-undefined,"
3109 echo "*** libtool will only create a static version of it."
3110 if test "$build_old_libs" = no
; then
3111 oldlibs
="$output_objdir/$libname.$libext"
3112 build_libtool_libs
=module
3115 build_libtool_libs
=no
3120 # Time to change all our "foo.framework" stuff back to "-framework foo"
3123 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3124 dependency_libs
=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3127 # Done checking deplibs!
3128 # Done checking deplibs!
3132 # All the library-specific variables (install_libdir is set above).
3137 # Test again, we may have decided not to build it any more
3138 if test "$build_libtool_libs" = yes; then
3139 if test $hardcode_into_libs = yes; then
3140 # Hardcode the library paths
3143 rpath
="$finalize_rpath"
3144 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3145 for libdir
in $rpath; do
3146 if test -n "$hardcode_libdir_flag_spec"; then
3147 if test -n "$hardcode_libdir_separator"; then
3148 if test -z "$hardcode_libdirs"; then
3149 hardcode_libdirs
="$libdir"
3151 # Just accumulate the unique libdirs.
3152 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3153 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3156 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3161 eval flag
=\"$hardcode_libdir_flag_spec\"
3162 dep_rpath
="$dep_rpath $flag"
3164 elif test -n "$runpath_var"; then
3165 case "$perm_rpath " in
3167 *) perm_rpath
="$perm_rpath $libdir" ;;
3171 # Substitute the hardcoded libdirs into the rpath.
3172 if test -n "$hardcode_libdir_separator" &&
3173 test -n "$hardcode_libdirs"; then
3174 libdir
="$hardcode_libdirs"
3175 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3177 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3178 # We should set the runpath_var.
3180 for dir
in $perm_rpath; do
3183 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3185 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3188 shlibpath
="$finalize_shlibpath"
3189 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3190 if test -n "$shlibpath"; then
3191 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3194 # Get the real and link names of the library.
3195 eval library_names
=\"$library_names_spec\"
3196 eval shared_ext
=\"$shrext\"
3197 set dummy
$library_names
3201 if test -n "$soname_spec"; then
3202 eval soname
=\"$soname_spec\"
3206 test -z "$dlname" && dlname
=$soname
3208 lib
="$output_objdir/$realname"
3211 linknames
="$linknames $link"
3214 # # Ensure that we have .o objects for linkers which dislike .lo
3215 # # (e.g. aix) in case we are running --disable-static
3216 # for obj in $libobjs; do
3217 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3218 # if test "X$xdir" = "X$obj"; then
3223 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3224 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3225 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3226 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3227 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3231 # Use standard objects if they are pic
3232 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3234 # Prepare the list of exported symbols
3235 if test -z "$export_symbols"; then
3236 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3237 $show "generating symbol list for \`$libname.la'"
3238 export_symbols
="$output_objdir/$libname.exp"
3239 $run $rm $export_symbols
3240 eval cmds
=\"$export_symbols_cmds\"
3241 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3242 for cmd
in $cmds; do
3245 $run eval "$cmd" ||
exit $?
3248 if test -n "$export_symbols_regex"; then
3249 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3250 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3251 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3252 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3257 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3258 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3261 if test -n "$convenience"; then
3262 if test -n "$whole_archive_flag_spec"; then
3263 save_libobjs
=$libobjs
3264 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3266 gentop
="$output_objdir/${outputname}x"
3267 $show "${rm}r $gentop"
3268 $run ${rm}r
"$gentop"
3269 $show "$mkdir $gentop"
3270 $run $mkdir "$gentop"
3272 if test $status -ne 0 && test ! -d "$gentop"; then
3275 generated
="$generated $gentop"
3277 for xlib
in $convenience; do
3278 # Extract the objects.
3280 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3281 *) xabs
=`pwd`"/$xlib" ;;
3283 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3284 xdir
="$gentop/$xlib"
3286 $show "${rm}r $xdir"
3288 $show "$mkdir $xdir"
3291 if test $status -ne 0 && test ! -d "$xdir"; then
3294 $show "(cd $xdir && $AR x $xabs)"
3295 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3297 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3302 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3303 eval flag
=\"$thread_safe_flag_spec\"
3304 linker_flags
="$linker_flags $flag"
3307 # Make a backup of the uninstalled library when relinking
3308 if test "$mode" = relink
; then
3309 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3312 # Do each of the archive commands.
3313 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3314 eval test_cmds
=\"$archive_expsym_cmds\"
3315 cmds
=$archive_expsym_cmds
3317 eval test_cmds
=\"$archive_cmds\"
3320 if len
=`expr "X$test_cmds" : ".*"` &&
3321 test $len -le $max_cmd_len; then
3324 # The command line is too long to link in one step, link piecewise.
3326 # Save the value of $output and $libobjs because we want to
3327 # use them later. If we have whole_archive_flag_spec, we
3328 # want to use save_libobjs as it was before
3329 # whole_archive_flag_spec was expanded, because we can't
3330 # assume the linker understands whole_archive_flag_spec.
3331 # This may have to be revisited, in case too many
3332 # convenience libraries get linked in and end up exceeding
3334 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3335 save_libobjs
=$libobjs
3338 output_la
=`$echo "X$output" | $Xsed -e "s,^.*/,,"`
3340 # Clear the reloadable object creation command queue and
3341 # initialize k to one.
3349 if test "$with_gnu_ld" = yes; then
3350 output
=${output_objdir}/${output_la}.lnkscript
3351 $echo "creating GNU ld script: $output"
3352 $echo 'INPUT (' > $output
3353 for obj
in $save_libobjs
3355 $echo \""$obj"\" >> $output
3357 $echo ')' >> $output
3358 delfiles
="$delfiles $output"
3359 elif test "X$file_list_spec" != X
; then
3360 output
=${output_objdir}/${output_la}.lnk
3361 $echo "creating linker input file list: $output"
3363 for obj
in $save_libobjs
3365 $echo "$obj" >> $output
3367 delfiles
="$delfiles $output"
3368 output
=\"$file_list_spec$output\"
3370 $echo "creating reloadable object files..."
3371 output
=$output_objdir/$save_output-${k}.
$objext
3372 # Loop over the list of objects to be linked.
3373 for obj
in $save_libobjs
3375 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3376 if test "X$objlist" = X ||
3377 { len
=`expr "X$test_cmds" : ".*"` &&
3378 test $len -le $max_cmd_len; }; then
3379 objlist
="$objlist $obj"
3381 # The command $test_cmds is almost too long, add a
3382 # command to the queue.
3383 if test $k -eq 1 ; then
3384 # The first file doesn't have a previous command to add.
3385 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3387 # All subsequent reloadable object files will link in
3388 # the last one created.
3389 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3391 last_robj
=$output_objdir/$save_output-${k}.
$objext
3393 output
=$output_objdir/$save_output-${k}.
$objext
3398 # Handle the remaining objects by creating one last
3399 # reloadable object file. All subsequent reloadable object
3400 # files will link in the last one created.
3401 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3402 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3404 # Set up a command to remove the reloadale object files
3405 # after they are used.
3407 while test $i -lt $k
3410 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3413 $echo "creating a temporary reloadable object file: $output"
3415 # Loop through the commands generated above and execute them.
3416 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3417 for cmd
in $concat_cmds; do
3421 $run eval "$cmd" ||
exit $?
3427 # Restore the value of output.
3430 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3431 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3433 # Expand the library linking commands again to reset the
3434 # value of $libobjs for piecewise linking.
3436 # Do each of the archive commands.
3437 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3438 cmds
=$archive_expsym_cmds
3443 # Append the command to remove the reloadable object files
3444 # to the just-reset $cmds.
3445 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3447 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3448 for cmd
in $cmds; do
3452 $run eval "$cmd" ||
exit $?
3456 # Restore the uninstalled library and exit
3457 if test "$mode" = relink
; then
3458 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3462 # Create links to the real library.
3463 for linkname
in $linknames; do
3464 if test "$realname" != "$linkname"; then
3465 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3466 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3470 # If -module or -export-dynamic was specified, set the dlname.
3471 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3472 # On all known operating systems, these are identical.
3479 if test -n "$deplibs"; then
3480 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3483 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3484 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3487 if test -n "$rpath"; then
3488 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3491 if test -n "$xrpath"; then
3492 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3495 if test -n "$vinfo"; then
3496 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3499 if test -n "$release"; then
3500 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3505 if test -n "$objs$old_deplibs"; then
3506 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3510 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3518 # Delete the old objects.
3519 $run $rm $obj $libobj
3521 # Objects from convenience libraries. This assumes
3522 # single-version convenience libraries. Whenever we create
3523 # different ones for PIC/non-PIC, this we'll have to duplicate
3527 # reload_cmds runs $LD directly, so let us get rid of
3528 # -Wl from whole_archive_flag_spec
3531 if test -n "$convenience"; then
3532 if test -n "$whole_archive_flag_spec"; then
3533 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3535 gentop
="$output_objdir/${obj}x"
3536 $show "${rm}r $gentop"
3537 $run ${rm}r
"$gentop"
3538 $show "$mkdir $gentop"
3539 $run $mkdir "$gentop"
3541 if test $status -ne 0 && test ! -d "$gentop"; then
3544 generated
="$generated $gentop"
3546 for xlib
in $convenience; do
3547 # Extract the objects.
3549 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3550 *) xabs
=`pwd`"/$xlib" ;;
3552 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3553 xdir
="$gentop/$xlib"
3555 $show "${rm}r $xdir"
3557 $show "$mkdir $xdir"
3560 if test $status -ne 0 && test ! -d "$xdir"; then
3563 $show "(cd $xdir && $AR x $xabs)"
3564 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3566 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3571 # Create the old-style object.
3572 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
3575 eval cmds
=\"$reload_cmds\"
3576 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3577 for cmd
in $cmds; do
3580 $run eval "$cmd" ||
exit $?
3584 # Exit if we aren't doing a library object file.
3585 if test -z "$libobj"; then
3586 if test -n "$gentop"; then
3587 $show "${rm}r $gentop"
3594 if test "$build_libtool_libs" != yes; then
3595 if test -n "$gentop"; then
3596 $show "${rm}r $gentop"
3600 # Create an invalid libtool object if no PIC, so that we don't
3601 # accidentally link it into a program.
3602 # $show "echo timestamp > $libobj"
3603 # $run eval "echo timestamp > $libobj" || exit $?
3607 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3608 # Only do commands if we really have different PIC objects.
3609 reload_objs
="$libobjs $reload_conv_objs"
3611 eval cmds
=\"$reload_cmds\"
3612 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3613 for cmd
in $cmds; do
3616 $run eval "$cmd" ||
exit $?
3620 # # Just create a symlink.
3623 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3624 # if test "X$xdir" = "X$libobj"; then
3629 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3630 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3631 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3632 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3635 if test -n "$gentop"; then
3636 $show "${rm}r $gentop"
3645 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3647 if test -n "$vinfo"; then
3648 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3651 if test -n "$release"; then
3652 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3655 if test "$preload" = yes; then
3656 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3657 test "$dlopen_self_static" = unknown
; then
3658 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3663 *-*-rhapsody* |
*-*-darwin1.
[012])
3664 # On Rhapsody replace the C library is the System framework
3665 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3666 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3672 # Don't allow lazy linking, it breaks C++ global constructors
3673 if test "$tagname" = CXX
; then
3674 compile_command
="$compile_command ${wl}-bind_at_load"
3675 finalize_command
="$finalize_command ${wl}-bind_at_load"
3677 # Time to change all our "foo.framework" stuff back to "-framework foo"
3678 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3679 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3683 compile_command
="$compile_command $compile_deplibs"
3684 finalize_command
="$finalize_command $finalize_deplibs"
3686 if test -n "$rpath$xrpath"; then
3687 # If the user specified any rpath flags, then add them.
3688 for libdir
in $rpath $xrpath; do
3689 # This is the magic to use -rpath.
3690 case "$finalize_rpath " in
3692 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3697 # Now hardcode the library paths
3700 for libdir
in $compile_rpath; do
3701 if test -n "$hardcode_libdir_flag_spec"; then
3702 if test -n "$hardcode_libdir_separator"; then
3703 if test -z "$hardcode_libdirs"; then
3704 hardcode_libdirs
="$libdir"
3706 # Just accumulate the unique libdirs.
3707 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3708 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3711 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3716 eval flag
=\"$hardcode_libdir_flag_spec\"
3717 rpath
="$rpath $flag"
3719 elif test -n "$runpath_var"; then
3720 case "$perm_rpath " in
3722 *) perm_rpath
="$perm_rpath $libdir" ;;
3726 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3727 case :$dllsearchpath: in
3729 *) dllsearchpath
="$dllsearchpath:$libdir";;
3734 # Substitute the hardcoded libdirs into the rpath.
3735 if test -n "$hardcode_libdir_separator" &&
3736 test -n "$hardcode_libdirs"; then
3737 libdir
="$hardcode_libdirs"
3738 eval rpath
=\" $hardcode_libdir_flag_spec\"
3740 compile_rpath
="$rpath"
3744 for libdir
in $finalize_rpath; do
3745 if test -n "$hardcode_libdir_flag_spec"; then
3746 if test -n "$hardcode_libdir_separator"; then
3747 if test -z "$hardcode_libdirs"; then
3748 hardcode_libdirs
="$libdir"
3750 # Just accumulate the unique libdirs.
3751 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3752 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3755 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3760 eval flag
=\"$hardcode_libdir_flag_spec\"
3761 rpath
="$rpath $flag"
3763 elif test -n "$runpath_var"; then
3764 case "$finalize_perm_rpath " in
3766 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3770 # Substitute the hardcoded libdirs into the rpath.
3771 if test -n "$hardcode_libdir_separator" &&
3772 test -n "$hardcode_libdirs"; then
3773 libdir
="$hardcode_libdirs"
3774 eval rpath
=\" $hardcode_libdir_flag_spec\"
3776 finalize_rpath
="$rpath"
3779 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3780 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3781 dlsyms
="${outputname}S.c"
3783 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3787 if test -n "$dlsyms"; then
3791 # Discover the nlist of each of the dlfiles.
3792 nlist
="$output_objdir/${outputname}.nm"
3794 $show "$rm $nlist ${nlist}S ${nlist}T"
3795 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3797 # Parse the name list into a source file.
3798 $show "creating $output_objdir/$dlsyms"
3800 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3801 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3802 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3808 /* Prevent the only kind of declaration conflicts we can make. */
3809 #define lt_preloaded_symbols some_other_symbol
3811 /* External symbol declarations for the compiler. */\
3814 if test "$dlself" = yes; then
3815 $show "generating symbol list for \`$output'"
3817 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3819 # Add our own program objects to the symbol list.
3820 progfiles
="$objs$old_deplibs"
3821 for arg
in $progfiles; do
3822 $show "extracting global C symbols from \`$arg'"
3823 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3826 if test -n "$exclude_expsyms"; then
3827 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3828 $run eval '$mv "$nlist"T "$nlist"'
3831 if test -n "$export_symbols_regex"; then
3832 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3833 $run eval '$mv "$nlist"T "$nlist"'
3836 # Prepare the list of exported symbols
3837 if test -z "$export_symbols"; then
3838 export_symbols
="$output_objdir/$output.exp"
3839 $run $rm $export_symbols
3840 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3842 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3843 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3844 $run eval 'mv "$nlist"T "$nlist"'
3848 for arg
in $dlprefiles; do
3849 $show "extracting global C symbols from \`$arg'"
3850 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3851 $run eval 'echo ": $name " >> "$nlist"'
3852 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3855 if test -z "$run"; then
3856 # Make sure we have at least an empty file.
3857 test -f "$nlist" ||
: > "$nlist"
3859 if test -n "$exclude_expsyms"; then
3860 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3861 $mv "$nlist"T
"$nlist"
3864 # Try sorting and uniquifying the output.
3865 if grep -v "^: " < "$nlist" |
3866 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
3871 uniq > "$nlist"S
; then
3874 grep -v "^: " < "$nlist" > "$nlist"S
3877 if test -f "$nlist"S
; then
3878 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3880 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3883 $echo >> "$output_objdir/$dlsyms" "\
3885 #undef lt_preloaded_symbols
3887 #if defined (__STDC__) && __STDC__
3888 # define lt_ptr_t void *
3890 # define lt_ptr_t char *
3894 /* The mapping between symbol names and symbols. */
3899 lt_preloaded_symbols[] =
3903 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3904 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3905 < "$nlist" >> "$output_objdir/$dlsyms"
3907 $echo >> "$output_objdir/$dlsyms" "\
3911 /* This works around a problem in FreeBSD linker */
3912 #ifdef FREEBSD_WORKAROUND
3913 static const void *lt_preloaded_setup() {
3914 return lt_preloaded_symbols;
3924 pic_flag_for_symtable
=
3926 # compiling the symbol table file with pic_flag works around
3927 # a FreeBSD bug that causes programs to crash when -lm is
3928 # linked before any other PIC object. But we must not use
3929 # pic_flag when linking with -static. The problem exists in
3930 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3931 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3932 case "$compile_command " in
3934 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3937 case "$compile_command " in
3939 *) pic_flag_for_symtable
=" $pic_flag";;
3943 # Now compile the dynamic symbol file.
3944 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3945 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3947 # Clean up the generated files.
3948 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3949 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3951 # Transform the symbol file into the correct name.
3952 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3953 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3956 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3961 # We keep going just in case the user didn't refer to
3962 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3963 # really was required.
3965 # Nullify the symbol file.
3966 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3967 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3970 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3971 # Replace the output file specification.
3972 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3973 link_command
="$compile_command$compile_rpath"
3975 # We have no uninstalled library dependencies, so finalize right now.
3976 $show "$link_command"
3977 $run eval "$link_command"
3980 # Delete the generated files.
3981 if test -n "$dlsyms"; then
3982 $show "$rm $output_objdir/${outputname}S.${objext}"
3983 $run $rm "$output_objdir/${outputname}S.${objext}"
3989 if test -n "$shlibpath_var"; then
3990 # We should set the shlibpath_var
3992 for dir
in $temp_rpath; do
3994 [\\/]* |
[A-Za-z
]:[\\/]*)
3999 # Relative path: add a thisdir entry.
4000 rpath
="$rpath\$thisdir/$dir:"
4007 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4008 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4010 if test -n "$finalize_shlibpath"; then
4011 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4016 if test -n "$runpath_var"; then
4017 if test -n "$perm_rpath"; then
4018 # We should set the runpath_var.
4020 for dir
in $perm_rpath; do
4023 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4025 if test -n "$finalize_perm_rpath"; then
4026 # We should set the runpath_var.
4028 for dir
in $finalize_perm_rpath; do
4031 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4035 if test "$no_install" = yes; then
4036 # We don't need to create a wrapper script.
4037 link_command
="$compile_var$compile_command$compile_rpath"
4038 # Replace the output file specification.
4039 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4040 # Delete the old output file.
4042 # Link the executable and exit
4043 $show "$link_command"
4044 $run eval "$link_command" ||
exit $?
4048 if test "$hardcode_action" = relink
; then
4049 # Fast installation is not supported
4050 link_command
="$compile_var$compile_command$compile_rpath"
4051 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4053 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4054 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4056 if test "$fast_install" != no
; then
4057 link_command
="$finalize_var$compile_command$finalize_rpath"
4058 if test "$fast_install" = yes; then
4059 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4061 # fast_install is set to needless
4065 link_command
="$compile_var$compile_command$compile_rpath"
4066 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4070 # Replace the output file specification.
4071 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4073 # Delete the old output files.
4074 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4076 $show "$link_command"
4077 $run eval "$link_command" ||
exit $?
4079 # Now create the wrapper script.
4080 $show "creating $output"
4082 # Quote the relink command for shipping.
4083 if test -n "$relink_command"; then
4084 # Preserve any variables that may affect compiler behavior
4085 for var
in $variables_saved_for_relink; do
4086 if eval test -z \"\
${$var+set}\"; then
4087 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4088 elif eval var_value
=\$
$var; test -z "$var_value"; then
4089 relink_command
="$var=; export $var; $relink_command"
4091 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4092 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4095 relink_command
="cd `pwd`; $relink_command"
4096 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4099 # Quote $echo for shipping.
4100 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4102 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4103 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4105 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4107 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4110 # Only actually do things if our run command is non-null.
4111 if test -z "$run"; then
4112 # win32 will think the script is a binary if it has
4113 # a .exe suffix, so we strip it off here.
4115 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
4117 # test for cygwin because mv fails w/o .exe extensions
4119 *cygwin
*) exeext
=.exe
;;
4123 trap "$rm $output; exit 1" 1 2 15
4128 # $output - temporary wrapper script for $objdir/$outputname
4129 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4131 # The $output program cannot be directly executed until all the libtool
4132 # libraries that it depends on are installed.
4134 # This wrapper script should never be moved out of the build directory.
4135 # If it is, it will not operate correctly.
4137 # Sed substitution that helps us do robust quoting. It backslashifies
4138 # metacharacters that are still active within double-quoted strings.
4139 Xsed='sed -e 1s/^X//'
4140 sed_quote_subst='$sed_quote_subst'
4142 # The HP-UX ksh and POSIX shell print the target directory to stdout
4144 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4146 relink_command=\"$relink_command\"
4148 # This environment variable determines our operation mode.
4149 if test \"\$libtool_install_magic\" = \"$magic\"; then
4150 # install mode needs the following variable:
4151 notinst_deplibs='$notinst_deplibs'
4153 # When we are sourced in execute mode, \$file and \$echo are already set.
4154 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4157 # Make sure echo works.
4158 if test \"X\$1\" = X--no-reexec; then
4159 # Discard the --no-reexec flag, and continue.
4161 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4162 # Yippee, \$echo works!
4165 # Restart under the correct shell, and then maybe \$echo will work.
4166 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4172 # Find the directory that this script lives in.
4173 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4174 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4176 # Follow symbolic links until we get to the real thisdir.
4177 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4178 while test -n \"\$file\"; do
4179 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4181 # If there was a directory component, then change thisdir.
4182 if test \"x\$destdir\" != \"x\$file\"; then
4183 case \"\$destdir\" in
4184 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4185 *) thisdir=\"\$thisdir/\$destdir\" ;;
4189 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4190 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4193 # Try to get the absolute directory name.
4194 absdir=\`cd \"\$thisdir\" && pwd\`
4195 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4198 if test "$fast_install" = yes; then
4200 program=lt-'$outputname'$exeext
4201 progdir=\"\$thisdir/$objdir\"
4203 if test ! -f \"\$progdir/\$program\" || \\
4204 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4205 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4207 file=\"\$\$-\$program\"
4209 if test ! -d \"\$progdir\"; then
4210 $mkdir \"\$progdir\"
4212 $rm \"\$progdir/\$file\"
4217 # relink executable if necessary
4218 if test -n \"\$relink_command\"; then
4219 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4221 $echo \"\$relink_command_output\" >&2
4222 $rm \"\$progdir/\$file\"
4227 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4228 { $rm \"\$progdir/\$program\";
4229 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4230 $rm \"\$progdir/\$file\"
4234 program='$outputname'
4235 progdir=\"\$thisdir/$objdir\"
4241 if test -f \"\$progdir/\$program\"; then"
4243 # Export our shlibpath_var if we have one.
4244 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4246 # Add our own library path to $shlibpath_var
4247 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4249 # Some systems cannot cope with colon-terminated $shlibpath_var
4250 # The second colon is a workaround for a bug in BeOS R4 sed
4251 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4253 export $shlibpath_var
4257 # fixup the dll searchpath if we need to.
4258 if test -n "$dllsearchpath"; then
4260 # Add the dll search path components to the executable PATH
4261 PATH=$dllsearchpath:\$PATH
4266 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4267 # Run the actual program with our arguments.
4270 # win32 systems need to use the prog path for dll
4272 *-*-cygwin* |
*-*-pw32*)
4274 exec \$progdir/\$program \${1+\"\$@\"}
4278 # Backslashes separate directories on plain windows
4279 *-*-mingw |
*-*-os2*)
4281 exec \$progdir\\\\\$program \${1+\"\$@\"}
4287 # Export the path to the program.
4288 PATH=\"\$progdir:\$PATH\"
4291 exec \$program \${1+\"\$@\"}
4296 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4300 # The program doesn't exist.
4301 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4302 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4303 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4314 # See if we need to build an old-fashioned archive.
4315 for oldlib
in $oldlibs; do
4317 if test "$build_libtool_libs" = convenience
; then
4318 oldobjs
="$libobjs_save"
4319 addlibs
="$convenience"
4320 build_libtool_libs
=no
4322 if test "$build_libtool_libs" = module
; then
4323 oldobjs
="$libobjs_save"
4324 build_libtool_libs
=no
4326 oldobjs
="$objs$old_deplibs $non_pic_objects"
4328 addlibs
="$old_convenience"
4331 if test -n "$addlibs"; then
4332 gentop
="$output_objdir/${outputname}x"
4333 $show "${rm}r $gentop"
4334 $run ${rm}r
"$gentop"
4335 $show "$mkdir $gentop"
4336 $run $mkdir "$gentop"
4338 if test $status -ne 0 && test ! -d "$gentop"; then
4341 generated
="$generated $gentop"
4343 # Add in members from convenience archives.
4344 for xlib
in $addlibs; do
4345 # Extract the objects.
4347 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4348 *) xabs
=`pwd`"/$xlib" ;;
4350 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4351 xdir
="$gentop/$xlib"
4353 $show "${rm}r $xdir"
4355 $show "$mkdir $xdir"
4358 if test $status -ne 0 && test ! -d "$xdir"; then
4361 $show "(cd $xdir && $AR x $xabs)"
4362 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4364 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4368 # Do each command in the archive commands.
4369 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4370 eval cmds
=\"$old_archive_from_new_cmds\"
4372 # # Ensure that we have .o objects in place in case we decided
4373 # # not to build a shared library, and have fallen back to building
4374 # # static libs even though --disable-static was passed!
4375 # for oldobj in $oldobjs; do
4376 # if test ! -f $oldobj; then
4377 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4378 # if test "X$xdir" = "X$oldobj"; then
4383 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4384 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4385 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4386 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4390 # POSIX demands no paths to be encoded in archives. We have
4391 # to avoid creating archives with duplicate basenames if we
4392 # might have to extract them afterwards, e.g., when creating a
4393 # static archive out of a convenience library, or when linking
4394 # the entirety of a libtool archive into another (currently
4395 # not supported by libtool).
4396 if (for obj
in $oldobjs
4398 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4399 done |
sort |
sort -uc >/dev
/null
2>&1); then
4402 $echo "copying selected object files to avoid basename conflicts..."
4404 if test -z "$gentop"; then
4405 gentop
="$output_objdir/${outputname}x"
4407 $show "${rm}r $gentop"
4408 $run ${rm}r
"$gentop"
4409 $show "$mkdir $gentop"
4410 $run $mkdir "$gentop"
4412 if test $status -ne 0 && test ! -d "$gentop"; then
4415 generated
="$generated $gentop"
4418 save_oldobjs
=$oldobjs
4421 for obj
in $save_oldobjs
4423 objbase
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
4424 case " $oldobjs " in
4425 " ") oldobjs
=$obj ;;
4428 # Make sure we don't pick an alternate name that also
4430 newobj
=lt
$counter-$objbase
4431 counter
=`expr $counter + 1`
4432 case " $oldobjs " in
4433 *[\
/]"$newobj "*) ;;
4434 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
4437 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
4438 $run ln "$obj" "$gentop/$newobj" ||
4439 $run cp "$obj" "$gentop/$newobj"
4440 oldobjs
="$oldobjs $gentop/$newobj"
4442 *) oldobjs
="$oldobjs $obj" ;;
4447 eval cmds
=\"$old_archive_cmds\"
4449 if len
=`expr "X$cmds" : ".*"` &&
4450 test $len -le $max_cmd_len; then
4453 # the command line is too long to link in one step, link in parts
4454 $echo "using piecewise archive linking..."
4459 save_oldobjs
=$oldobjs
4461 for obj
in $save_oldobjs
4463 oldobjs
="$objlist $obj"
4464 objlist
="$objlist $obj"
4465 eval test_cmds
=\"$old_archive_cmds\"
4466 if len
=`expr "X$test_cmds" : ".*"` &&
4467 test $len -le $max_cmd_len; then
4470 # the above command should be used before it gets too long
4472 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4473 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4479 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4482 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4483 for cmd
in $cmds; do
4486 $run eval "$cmd" ||
exit $?
4491 if test -n "$generated"; then
4492 $show "${rm}r$generated"
4493 $run ${rm}r
$generated
4496 # Now create the libtool archive.
4500 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4501 $show "creating $output"
4503 # Preserve any variables that may affect compiler behavior
4504 for var
in $variables_saved_for_relink; do
4505 if eval test -z \"\
${$var+set}\"; then
4506 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4507 elif eval var_value
=\$
$var; test -z "$var_value"; then
4508 relink_command
="$var=; export $var; $relink_command"
4510 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4511 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4514 # Quote the link command for shipping.
4516 for tag
in $taglist; do
4517 tagopts
="$tagopts --tag $tag"
4519 relink_command
="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args @inst_prefix_dir@)"
4520 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4522 # Only create the output if not a dry run.
4523 if test -z "$run"; then
4524 for installed
in no
yes; do
4525 if test "$installed" = yes; then
4526 if test -z "$install_libdir"; then
4529 output
="$output_objdir/$outputname"i
4530 # Replace all uninstalled libtool libraries with the installed ones
4532 for deplib
in $dependency_libs; do
4535 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4536 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4537 if test -z "$libdir"; then
4538 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4541 newdependency_libs
="$newdependency_libs $libdir/$name"
4543 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4546 dependency_libs
="$newdependency_libs"
4548 for lib
in $dlfiles; do
4549 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4550 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4551 if test -z "$libdir"; then
4552 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4555 newdlfiles
="$newdlfiles $libdir/$name"
4557 dlfiles
="$newdlfiles"
4559 for lib
in $dlprefiles; do
4560 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4561 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4562 if test -z "$libdir"; then
4563 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4566 newdlprefiles
="$newdlprefiles $libdir/$name"
4568 dlprefiles
="$newdlprefiles"
4571 # place dlname in correct position for cygwin
4573 case $host,$output,$installed,$module,$dlname in
4574 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4577 # $outputname - a libtool library file
4578 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4580 # Please DO NOT delete this file!
4581 # It is necessary for linking the library.
4583 # The name that we can dlopen(3).
4586 # Names of this library.
4587 library_names='$library_names'
4589 # The name of the static archive.
4590 old_library='$old_library'
4592 # Libraries that this one depends upon.
4593 dependency_libs='$dependency_libs'
4595 # Version information for $libname.
4600 # Is this an already installed library?
4601 installed=$installed
4603 # Files to dlopen/dlpreopen
4605 dlpreopen='$dlprefiles'
4607 # Directory that this library needs to be installed in:
4608 libdir='$install_libdir'"
4609 if test "$installed" = no
&& test $need_relink = yes; then
4611 relink_command=\"$relink_command\""
4616 # Do a symbolic link so that the libtool archive can be found in
4617 # LD_LIBRARY_PATH before the program is installed.
4618 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4619 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4625 # libtool install mode
4627 modename
="$modename: install"
4629 # There may be an optional sh(1) argument at the beginning of
4630 # install_prog (especially on Windows NT).
4631 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4632 # Allow the use of GNU shtool's install command.
4633 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4634 # Aesthetically quote it.
4635 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4637 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4641 install_prog
="$arg "
4649 # The real first argument should be the name of the installation program.
4650 # Aesthetically quote it.
4651 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4653 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4657 install_prog
="$install_prog$arg"
4659 # We need to accept at least all the BSD install flags.
4669 if test -n "$dest"; then
4670 files
="$files $dest"
4688 # If the previous option needed an argument, then skip it.
4689 if test -n "$prev"; then
4698 # Aesthetically quote the argument.
4699 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4701 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4705 install_prog
="$install_prog $arg"
4708 if test -z "$install_prog"; then
4709 $echo "$modename: you must specify an install program" 1>&2
4714 if test -n "$prev"; then
4715 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4720 if test -z "$files"; then
4721 if test -z "$dest"; then
4722 $echo "$modename: no file or destination specified" 1>&2
4724 $echo "$modename: you must specify a destination" 1>&2
4730 # Strip any trailing slash from the destination.
4731 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4733 # Check to see that the destination is a directory.
4734 test -d "$dest" && isdir
=yes
4735 if test "$isdir" = yes; then
4739 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4740 test "X$destdir" = "X$dest" && destdir
=.
4741 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4743 # Not a directory, so check to see that there is only one file specified.
4745 if test $# -gt 2; then
4746 $echo "$modename: \`$dest' is not a directory" 1>&2
4752 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4754 for file in $files; do
4758 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4767 # This variable tells wrapper scripts just to set variables rather
4768 # than running their programs.
4769 libtool_install_magic
="$magic"
4774 for file in $files; do
4776 # Do each installation.
4779 # Do the static libraries later.
4780 staticlibs
="$staticlibs $file"
4784 # Check to see that this really is a libtool archive.
4785 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4787 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4795 # If there is no directory component, then add one.
4797 */* |
*\\*) .
$file ;;
4801 # Add the libdir to current_libdirs if it is the destination.
4802 if test "X$destdir" = "X$libdir"; then
4803 case "$current_libdirs " in
4805 *) current_libdirs
="$current_libdirs $libdir" ;;
4808 # Note the libdir as a future libdir.
4809 case "$future_libdirs " in
4811 *) future_libdirs
="$future_libdirs $libdir" ;;
4815 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4816 test "X$dir" = "X$file/" && dir
=
4819 if test -n "$relink_command"; then
4820 # Determine the prefix the user has applied to our future dir.
4821 inst_prefix_dir
=`$echo "$destdir" | sed "s%$libdir\$%%"`
4823 # Don't allow the user to place us outside of our expected
4824 # location b/c this prevents finding dependent libraries that
4825 # are installed to the same prefix.
4826 # At present, this check doesn't affect windows .dll's that
4827 # are installed into $libdir/../bin (currently, that works fine)
4828 # but it's something to keep an eye on.
4829 if test "$inst_prefix_dir" = "$destdir"; then
4830 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4834 if test -n "$inst_prefix_dir"; then
4835 # Stick the inst_prefix_dir data into the link command.
4836 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4838 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4841 $echo "$modename: warning: relinking \`$file'" 1>&2
4842 $show "$relink_command"
4843 if $run eval "$relink_command"; then :
4845 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4850 # See the names of the shared library.
4851 set dummy
$library_names
4852 if test -n "$2"; then
4858 test -n "$relink_command" && srcname
="$realname"T
4860 # Install the shared library and build the symlinks.
4861 $show "$install_prog $dir/$srcname $destdir/$realname"
4862 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4863 if test -n "$stripme" && test -n "$striplib"; then
4864 $show "$striplib $destdir/$realname"
4865 $run eval "$striplib $destdir/$realname" ||
exit $?
4868 if test $# -gt 0; then
4869 # Delete the old symlinks, and create new ones.
4872 if test "$linkname" != "$realname"; then
4873 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4874 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4879 # Do each command in the postinstall commands.
4880 lib
="$destdir/$realname"
4881 eval cmds
=\"$postinstall_cmds\"
4882 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4883 for cmd
in $cmds; do
4886 $run eval "$cmd" ||
exit $?
4891 # Install the pseudo-library for information purposes.
4892 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4893 instname
="$dir/$name"i
4894 $show "$install_prog $instname $destdir/$name"
4895 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4897 # Maybe install the static library, too.
4898 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4902 # Install (i.e. copy) a libtool object.
4904 # Figure out destination file name, if it wasn't already specified.
4905 if test -n "$destname"; then
4906 destfile
="$destdir/$destname"
4908 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4909 destfile
="$destdir/$destfile"
4912 # Deduce the name of the destination old-style object file.
4915 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4918 staticdest
="$destfile"
4922 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4928 # Install the libtool object if requested.
4929 if test -n "$destfile"; then
4930 $show "$install_prog $file $destfile"
4931 $run eval "$install_prog $file $destfile" ||
exit $?
4934 # Install the old object if enabled.
4935 if test "$build_old_libs" = yes; then
4936 # Deduce the name of the old-style object file.
4937 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4939 $show "$install_prog $staticobj $staticdest"
4940 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4946 # Figure out destination file name, if it wasn't already specified.
4947 if test -n "$destname"; then
4948 destfile
="$destdir/$destname"
4950 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4951 destfile
="$destdir/$destfile"
4954 # Do a test to see if this is really a libtool program.
4955 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4959 # If there is no directory component, then add one.
4961 */* |
*\\*) .
$file ;;
4965 # Check the variables that should have been set.
4966 if test -z "$notinst_deplibs"; then
4967 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4972 for lib
in $notinst_deplibs; do
4973 # Check to see that each library is installed.
4975 if test -f "$lib"; then
4976 # If there is no directory component, then add one.
4978 */* |
*\\*) .
$lib ;;
4982 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4983 if test -n "$libdir" && test ! -f "$libfile"; then
4984 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4990 # If there is no directory component, then add one.
4992 */* |
*\\*) .
$file ;;
4997 if test "$fast_install" = no
&& test -n "$relink_command"; then
4998 if test "$finalize" = yes && test -z "$run"; then
5000 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5001 tmpdir
="$tmpdir/libtool-$$"
5002 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5004 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5007 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5008 outputname
="$tmpdir/$file"
5009 # Replace the output file specification.
5010 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5012 $show "$relink_command"
5013 if $run eval "$relink_command"; then :
5015 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5021 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5024 # Install the binary that we compiled earlier.
5025 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5030 # remove .exe since cygwin /usr/bin/install will append another
5032 case $install_prog,$host in
5033 */usr
/bin
/install*,*cygwin
*)
5034 case $file:$destfile in
5039 destfile
=$destfile.exe
5042 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
5048 $show "$install_prog$stripme $file $destfile"
5049 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5050 test -n "$outputname" && ${rm}r
"$tmpdir"
5055 for file in $staticlibs; do
5056 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5058 # Set up the ranlib parameters.
5059 oldlib
="$destdir/$name"
5061 $show "$install_prog $file $oldlib"
5062 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5064 if test -n "$stripme" && test -n "$striplib"; then
5065 $show "$old_striplib $oldlib"
5066 $run eval "$old_striplib $oldlib" ||
exit $?
5069 # Do each command in the postinstall commands.
5070 eval cmds
=\"$old_postinstall_cmds\"
5071 # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
5072 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='@'
5073 for cmd
in $cmds; do
5076 $run eval "$cmd" ||
exit $?
5081 if test -n "$future_libdirs"; then
5082 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5085 if test -n "$current_libdirs"; then
5086 # Maybe just do a dry run.
5087 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5088 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5094 # libtool finish mode
5096 modename
="$modename: finish"
5100 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5103 libdirs
="$libdirs $dir"
5106 for libdir
in $libdirs; do
5107 if test -n "$finish_cmds"; then
5108 # Do each command in the finish commands.
5109 eval cmds
=\"$finish_cmds\"
5110 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5111 for cmd
in $cmds; do
5114 $run eval "$cmd" || admincmds
="$admincmds
5119 if test -n "$finish_eval"; then
5120 # Do the single finish_eval.
5121 eval cmds
=\"$finish_eval\"
5122 $run eval "$cmds" || admincmds
="$admincmds
5128 # Exit here if they wanted silent mode.
5129 test "$show" = ":" && exit 0
5131 echo "----------------------------------------------------------------------"
5132 echo "Libraries have been installed in:"
5133 for libdir
in $libdirs; do
5137 echo "If you ever happen to want to link against installed libraries"
5138 echo "in a given directory, LIBDIR, you must either use libtool, and"
5139 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5140 echo "flag during linking and do at least one of the following:"
5141 if test -n "$shlibpath_var"; then
5142 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5143 echo " during execution"
5145 if test -n "$runpath_var"; then
5146 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5147 echo " during linking"
5149 if test -n "$hardcode_libdir_flag_spec"; then
5151 eval flag
=\"$hardcode_libdir_flag_spec\"
5153 echo " - use the \`$flag' linker flag"
5155 if test -n "$admincmds"; then
5156 echo " - have your system administrator run these commands:$admincmds"
5158 if test -f /etc
/ld.so.conf
; then
5159 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5162 echo "See any operating system documentation about shared libraries for"
5163 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5164 echo "----------------------------------------------------------------------"
5168 # libtool execute mode
5170 modename
="$modename: execute"
5172 # The first argument is the command name.
5174 if test -z "$cmd"; then
5175 $echo "$modename: you must specify a COMMAND" 1>&2
5180 # Handle -dlopen flags immediately.
5181 for file in $execute_dlfiles; do
5182 if test ! -f "$file"; then
5183 $echo "$modename: \`$file' is not a file" 1>&2
5191 # Check to see that this really is a libtool archive.
5192 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5194 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5199 # Read the libtool library.
5203 # If there is no directory component, then add one.
5205 */* |
*\\*) .
$file ;;
5209 # Skip this library if it cannot be dlopened.
5210 if test -z "$dlname"; then
5211 # Warn if it was a shared library.
5212 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5216 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5217 test "X$dir" = "X$file" && dir
=.
5219 if test -f "$dir/$objdir/$dlname"; then
5222 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5228 # Just add the directory containing the .lo file.
5229 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5230 test "X$dir" = "X$file" && dir
=.
5234 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5239 # Get the absolute pathname.
5240 absdir
=`cd "$dir" && pwd`
5241 test -n "$absdir" && dir
="$absdir"
5243 # Now add the directory to shlibpath_var.
5244 if eval "test -z \"\$$shlibpath_var\""; then
5245 eval "$shlibpath_var=\"\$dir\""
5247 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5251 # This variable tells wrapper scripts just to set shlibpath_var
5252 # rather than running their programs.
5253 libtool_execute_magic
="$magic"
5255 # Check if any of the arguments is a wrapper script.
5262 # Do a test to see if this is really a libtool program.
5263 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5264 # If there is no directory component, then add one.
5266 */* |
*\\*) .
$file ;;
5270 # Transform arg to wrapped name.
5271 file="$progdir/$program"
5275 # Quote arguments (to preserve shell metacharacters).
5276 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5277 args
="$args \"$file\""
5280 if test -z "$run"; then
5281 if test -n "$shlibpath_var"; then
5282 # Export the shlibpath_var.
5283 eval "export $shlibpath_var"
5286 # Restore saved enviroment variables
5287 if test "${save_LC_ALL+set}" = set; then
5288 LC_ALL
="$save_LC_ALL"; export LC_ALL
5290 if test "${save_LANG+set}" = set; then
5291 LANG
="$save_LANG"; export LANG
5294 # Now prepare to actually exec the command.
5295 exec_cmd
='"$cmd"$args'
5297 # Display what would be done.
5298 if test -n "$shlibpath_var"; then
5299 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5300 $echo "export $shlibpath_var"
5307 # libtool clean and uninstall mode
5309 modename
="$modename: $mode"
5315 # This variable tells wrapper scripts just to set variables rather
5316 # than running their programs.
5317 libtool_install_magic
="$magic"
5322 -f) rm="$rm $arg"; rmforce
=yes ;;
5323 -*) rm="$rm $arg" ;;
5324 *) files
="$files $arg" ;;
5328 if test -z "$rm"; then
5329 $echo "$modename: you must specify an RM program" 1>&2
5336 for file in $files; do
5337 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5338 if test "X$dir" = "X$file"; then
5342 objdir
="$dir/$objdir"
5344 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5345 test $mode = uninstall
&& objdir
="$dir"
5347 # Remember objdir for removal later, being careful to avoid duplicates
5348 if test $mode = clean
; then
5351 *) rmdirs
="$rmdirs $objdir" ;;
5355 # Don't error if the file doesn't exist and rm -f was used.
5356 if (test -L "$file") >/dev
/null
2>&1 \
5357 ||
(test -h "$file") >/dev
/null
2>&1 \
5358 ||
test -f "$file"; then
5360 elif test -d "$file"; then
5363 elif test "$rmforce" = yes; then
5371 # Possibly a libtool archive, so verify it.
5372 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5375 # Delete the libtool libraries and symlinks.
5376 for n
in $library_names; do
5377 rmfiles
="$rmfiles $objdir/$n"
5379 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5380 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5382 if test $mode = uninstall
; then
5383 if test -n "$library_names"; then
5384 # Do each command in the postuninstall commands.
5385 eval cmds
=\"$postuninstall_cmds\"
5386 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5387 for cmd
in $cmds; do
5391 if test $?
!= 0 && test "$rmforce" != yes; then
5398 if test -n "$old_library"; then
5399 # Do each command in the old_postuninstall commands.
5400 eval cmds
=\"$old_postuninstall_cmds\"
5401 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5402 for cmd
in $cmds; do
5406 if test $?
!= 0 && test "$rmforce" != yes; then
5412 # FIXME: should reinstall the best remaining shared library.
5418 # Possibly a libtool object, so verify it.
5419 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5424 # Add PIC object to the list of files to remove.
5425 if test -n "$pic_object" \
5426 && test "$pic_object" != none
; then
5427 rmfiles
="$rmfiles $dir/$pic_object"
5430 # Add non-PIC object to the list of files to remove.
5431 if test -n "$non_pic_object" \
5432 && test "$non_pic_object" != none
; then
5433 rmfiles
="$rmfiles $dir/$non_pic_object"
5439 # Do a test to see if this is a libtool program.
5440 if test $mode = clean
&&
5441 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5445 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5446 if test "$fast_install" = yes && test -n "$relink_command"; then
5447 rmfiles
="$rmfiles $objdir/lt-$name"
5452 $show "$rm $rmfiles"
5453 $run $rm $rmfiles || exit_status
=1
5456 # Try to remove the ${objdir}s in the directories where we deleted files
5457 for dir
in $rmdirs; do
5458 if test -d "$dir"; then
5460 $run rmdir $dir >/dev
/null
2>&1
5468 $echo "$modename: you must specify a MODE" 1>&2
5469 $echo "$generic_help" 1>&2
5474 if test -z "$exec_cmd"; then
5475 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5476 $echo "$generic_help" 1>&2
5479 fi # test -z "$show_help"
5481 if test -n "$exec_cmd"; then
5486 # We need to display help for each of the modes.
5489 "Usage: $modename [OPTION]... [MODE-ARG]...
5491 Provide generalized library-building support services.
5493 --config show all configuration variables
5494 --debug enable verbose shell tracing
5495 -n, --dry-run display commands without modifying any files
5496 --features display basic configuration information and exit
5497 --finish same as \`--mode=finish'
5498 --help display this help message and exit
5499 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5500 --quiet same as \`--silent'
5501 --silent don't print informational messages
5502 --tag=TAG use configuration variables from tag TAG
5503 --version print version information
5505 MODE must be one of the following:
5507 clean remove files from the build directory
5508 compile compile a source file into a libtool object
5509 execute automatically set library path, then run a program
5510 finish complete the installation of libtool libraries
5511 install install libraries or executables
5512 link create a library or an executable
5513 uninstall remove libraries from an installed directory
5515 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5516 a more detailed description of MODE."
5522 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5524 Remove files from the build directory.
5526 RM is the name of the program to use to delete files associated with each FILE
5527 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5530 If FILE is a libtool library, object or program, all the files associated
5531 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5536 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5538 Compile a source file into a libtool library object.
5540 This mode accepts the following additional options:
5542 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5543 -prefer-pic try to building PIC objects only
5544 -prefer-non-pic try to building non-PIC objects only
5545 -static always build a \`.o' file suitable for static linking
5547 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5548 from the given SOURCEFILE.
5550 The output file name is determined by removing the directory component from
5551 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5552 library object suffix, \`.lo'."
5557 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5559 Automatically set library path, then run a program.
5561 This mode accepts the following additional options:
5563 -dlopen FILE add the directory containing FILE to the library path
5565 This mode sets the library path environment variable according to \`-dlopen'
5568 If any of the ARGS are libtool executable wrappers, then they are translated
5569 into their corresponding uninstalled binary, and any of their required library
5570 directories are added to the library path.
5572 Then, COMMAND is executed, with ARGS as arguments."
5577 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5579 Complete the installation of libtool libraries.
5581 Each LIBDIR is a directory that contains libtool libraries.
5583 The commands that this mode executes may require superuser privileges. Use
5584 the \`--dry-run' option if you just want to see what would be executed."
5589 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5591 Install executables or libraries.
5593 INSTALL-COMMAND is the installation command. The first component should be
5594 either the \`install' or \`cp' program.
5596 The rest of the components are interpreted as arguments to that command (only
5597 BSD-compatible install options are recognized)."
5602 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5604 Link object files or libraries together to form another library, or to
5605 create an executable program.
5607 LINK-COMMAND is a command using the C compiler that you would use to create
5608 a program from several object files.
5610 The following components of LINK-COMMAND are treated specially:
5612 -all-static do not do any dynamic linking at all
5613 -avoid-version do not add a version suffix if possible
5614 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5615 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5616 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5617 -export-symbols SYMFILE
5618 try to export only the symbols listed in SYMFILE
5619 -export-symbols-regex REGEX
5620 try to export only the symbols matching REGEX
5621 -LLIBDIR search LIBDIR for required installed libraries
5622 -lNAME OUTPUT-FILE requires the installed library libNAME
5623 -module build a library that can dlopened
5624 -no-fast-install disable the fast-install mode
5625 -no-install link a not-installable executable
5626 -no-undefined declare that a library does not refer to external symbols
5627 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5628 -objectlist FILE Use a list of object files found in FILE to specify objects
5629 -release RELEASE specify package release information
5630 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5631 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5632 -static do not do any dynamic linking of libtool libraries
5633 -version-info CURRENT[:REVISION[:AGE]]
5634 specify library version info [each variable defaults to 0]
5636 All other options (arguments beginning with \`-') are ignored.
5638 Every other argument is treated as a filename. Files ending in \`.la' are
5639 treated as uninstalled libtool libraries, other files are standard or library
5642 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5643 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5644 required, except when creating a convenience library.
5646 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5647 using \`ar' and \`ranlib', or on Windows using \`lib'.
5649 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5650 is created, otherwise an executable program is created."
5655 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5657 Remove libraries from an installation directory.
5659 RM is the name of the program to use to delete files associated with each FILE
5660 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5663 If FILE is a libtool library, all the files associated with it are deleted.
5664 Otherwise, only FILE itself is deleted using RM."
5668 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5675 $echo "Try \`$modename --help' for more information about other modes."
5679 # The TAGs below are defined such that we never get into a situation
5680 # in which we disable both kinds of libraries. Given conflicting
5681 # choices, we go for a static library, that is the most portable,
5682 # since we can't tell whether shared libraries were disabled because
5683 # the user asked for that or because the platform doesn't support
5684 # them. This is particularly important on AIX, because we don't
5685 # support having both static and shared libraries enabled at the same
5686 # time on that platform, so we default to a shared-only configuration.
5687 # If a disable-shared tag is given, we'll fallback to a static-only
5688 # configuration. But we'll never go from static-only to shared-only.
5690 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5691 build_libtool_libs
=no
5693 ### END LIBTOOL TAG CONFIG: disable-shared
5695 ### BEGIN LIBTOOL TAG CONFIG: disable-static
5696 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5697 ### END LIBTOOL TAG CONFIG: disable-static