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 case $base_compile in
500 # Blanks in the command may have been stripped by the calling shell,
501 # but not from the CC environment variable when ltconfig was run.
504 for z
in $available_tags; do
505 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
506 # Evaluate the configuration.
507 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
508 case $base_compile in
510 # The compiler in the base compile command matches
511 # the one in the tagged configuration.
512 # Assume this is the tagged configuration we want.
523 # If $tagname still isn't set, then no tagged configuration
524 # was found and let the user know that the "--tag" command
525 # line option must be used.
526 if test -z "$tagname"; then
527 echo "$modename: unable to infer tagged configuration"
528 echo "$modename: specify a tag with \`--tag'" 1>&2
531 # echo "$modename: using $tagname tagged configuration"
537 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
538 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
539 if test "X$xdir" = "X$obj"; then
544 lobj
=${xdir}$objdir/$objname
546 if test -z "$base_compile"; then
547 $echo "$modename: you must specify a compilation command" 1>&2
552 # Delete any leftover library objects.
553 if test "$build_old_libs" = yes; then
554 removelist
="$obj $lobj $libobj ${libobj}T"
556 removelist
="$lobj $libobj ${libobj}T"
560 trap "$run $rm $removelist; exit 1" 1 2 15
562 # On Cygwin there's no "real" PIC flag so we must build both object types
564 cygwin
* | mingw
* | pw32
* | os2
*)
568 if test $pic_mode = no
&& test "$deplibs_check_method" != pass_all
; then
569 # non-PIC code in shared libraries is not supported
573 # Calculate the filename of the output object if compiler does
574 # not support -o with -c
575 if test "$compiler_c_o" = no
; then
576 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
577 lockfile
="$output_obj.lock"
578 removelist
="$removelist $output_obj $lockfile"
579 trap "$run $rm $removelist; exit 1" 1 2 15
586 # Lock this critical section if it is needed
587 # We use this script file to make the link, it avoids creating a new file
588 if test "$need_locks" = yes; then
589 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
590 $show "Waiting for $lockfile to be removed"
593 elif test "$need_locks" = warn
; then
594 if test -f "$lockfile"; then
596 *** ERROR, $lockfile exists and contains:
597 `cat $lockfile 2>/dev/null`
599 This indicates that another process is trying to use the same
600 temporary object file, and libtool could not work around it because
601 your compiler does not support \`-c' and \`-o' together. If you
602 repeat this compilation, it may succeed, by chance, but you had better
603 avoid parallel builds (make -j) in this platform, or get a better
609 echo $srcfile > "$lockfile"
612 if test -n "$fix_srcfile_path"; then
613 eval srcfile
=\"$fix_srcfile_path\"
616 $run $rm "$libobj" "${libobj}T"
618 # Create a libtool object file (analogous to a ".la" file),
619 # but don't create it if we're doing a dry run.
620 test -z "$run" && cat > ${libobj}T
<<EOF
621 # $libobj - a libtool object file
622 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
624 # Please DO NOT delete this file!
625 # It is necessary for linking the library.
627 # Name of the PIC object.
630 # Only build a PIC object if we are building libtool libraries.
631 if test "$build_libtool_libs" = yes; then
632 # Without this assignment, base_compile gets emptied.
633 fbsd_hideous_sh_bug
=$base_compile
635 if test "$pic_mode" != no
; then
636 command="$base_compile $srcfile $pic_flag"
638 # Don't build PIC code
639 command="$base_compile $srcfile"
642 if test ! -d ${xdir}$objdir; then
643 $show "$mkdir ${xdir}$objdir"
644 $run $mkdir ${xdir}$objdir
646 if test $status -ne 0 && test ! -d ${xdir}$objdir; then
651 if test -z "$output_obj"; then
652 # Place PIC objects in $objdir
653 command="$command -o $lobj"
656 $run $rm "$lobj" "$output_obj"
659 if $run eval "$command"; then :
661 test -n "$output_obj" && $run $rm $removelist
665 if test "$need_locks" = warn
&&
666 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
668 *** ERROR, $lockfile contains:
669 `cat $lockfile 2>/dev/null`
671 but it should contain:
674 This indicates that another process is trying to use the same
675 temporary object file, and libtool could not work around it because
676 your compiler does not support \`-c' and \`-o' together. If you
677 repeat this compilation, it may succeed, by chance, but you had better
678 avoid parallel builds (make -j) in this platform, or get a better
685 # Just move the object if needed, then go on to compile the next one
686 if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
687 $show "$mv $output_obj $lobj"
688 if $run $mv $output_obj $lobj; then :
696 # Append the name of the PIC object to the libtool object file.
697 test -z "$run" && cat >> ${libobj}T
<<EOF
698 pic_object='$objdir/$objname'
702 # Allow error messages only from the first compilation.
703 suppress_output
=' >/dev/null 2>&1'
705 # No PIC object so indicate it doesn't exist in the libtool
707 test -z "$run" && cat >> ${libobj}T
<<EOF
713 # Only build a position-dependent object if we build old libraries.
714 if test "$build_old_libs" = yes; then
715 if test "$pic_mode" != yes; then
716 # Don't build PIC code
717 command="$base_compile $srcfile"
719 command="$base_compile $srcfile $pic_flag"
721 if test "$compiler_c_o" = yes; then
722 command="$command -o $obj"
725 # Suppress compiler output if we already did a PIC compilation.
726 command="$command$suppress_output"
727 $run $rm "$obj" "$output_obj"
729 if $run eval "$command"; then :
735 if test "$need_locks" = warn
&&
736 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
738 *** ERROR, $lockfile contains:
739 `cat $lockfile 2>/dev/null`
741 but it should contain:
744 This indicates that another process is trying to use the same
745 temporary object file, and libtool could not work around it because
746 your compiler does not support \`-c' and \`-o' together. If you
747 repeat this compilation, it may succeed, by chance, but you had better
748 avoid parallel builds (make -j) in this platform, or get a better
755 # Just move the object if needed
756 if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
757 $show "$mv $output_obj $obj"
758 if $run $mv $output_obj $obj; then :
766 # Append the name of the non-PIC object the libtool object file.
767 # Only append if the libtool object file exists.
768 test -z "$run" && cat >> ${libobj}T
<<EOF
769 # Name of the non-PIC object.
770 non_pic_object='$objname'
774 # Append the name of the non-PIC object the libtool object file.
775 # Only append if the libtool object file exists.
776 test -z "$run" && cat >> ${libobj}T
<<EOF
777 # Name of the non-PIC object.
783 $run $mv "${libobj}T" "${libobj}"
785 # Unlock the critical section if it was locked
786 if test "$need_locks" != no
; then
795 modename
="$modename: link"
797 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
798 # It is impossible to link a dll without this setting, and
799 # we shouldn't force the makefile maintainer to figure out
800 # which system we are compiling for in order to pass an extra
801 # flag for every libtool invokation.
804 # FIXME: Unfortunately, there are problems with the above when trying
805 # to make a dll which has undefined symbols, in which case not
806 # even a static library is built. For now, we need to specify
807 # -no-undefined on the libtool link line when we can be certain
808 # that all symbols are satisfied, otherwise we get a static library.
815 libtool_args
="$nonopt"
816 base_compile
="$nonopt"
817 compile_command
="$nonopt"
818 finalize_command
="$nonopt"
831 lib_search_path
=`pwd`
840 export_symbols_regex
=
848 prefer_static_libs
=no
860 # We need to know -static, to get the right output filenames.
864 -all-static |
-static)
865 if test "X$arg" = "X-all-static"; then
866 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
867 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
869 if test -n "$link_static_flag"; then
870 dlopen_self
=$dlopen_self_static
873 if test -z "$pic_flag" && test -n "$link_static_flag"; then
874 dlopen_self
=$dlopen_self_static
877 build_libtool_libs
=no
879 prefer_static_libs
=yes
885 # See if our shared archives depend on static archives.
886 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
888 # Go through the arguments, transforming them on the way.
889 while test $# -gt 0; do
891 base_compile
="$base_compile $arg"
894 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
895 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
899 libtool_args
="$libtool_args $qarg"
901 # If the previous option needs an argument, assign it.
902 if test -n "$prev"; then
905 compile_command
="$compile_command @OUTPUT@"
906 finalize_command
="$finalize_command @OUTPUT@"
912 if test "$preload" = no
; then
913 # Add the symbol object into the linking commands.
914 compile_command
="$compile_command @SYMFILE@"
915 finalize_command
="$finalize_command @SYMFILE@"
919 *.la |
*.lo
) ;; # We handle these cases below.
921 if test "$dlself" = no
; then
929 if test "$prev" = dlprefiles
; then
931 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
941 if test "$prev" = dlfiles
; then
942 dlfiles
="$dlfiles $arg"
944 dlprefiles
="$dlprefiles $arg"
952 export_symbols
="$arg"
953 if test ! -f "$arg"; then
954 $echo "$modename: symbol file \`$arg' does not exist"
961 export_symbols_regex
="$arg"
966 inst_prefix_dir
="$arg"
976 if test -f "$arg"; then
979 for fil
in `cat $save_arg`
981 # moreargs="$moreargs $fil"
983 # A libtool-controlled object.
985 # Check to see that this really is a libtool object.
986 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
991 # If there is no directory component, then add one.
993 */* |
*\\*) .
$arg ;;
997 if test -z "$pic_object" || \
998 test -z "$non_pic_object" ||
999 test "$pic_object" = none
&& \
1000 test "$non_pic_object" = none
; then
1001 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1005 # Extract subdirectory from the argument.
1006 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1007 if test "X$xdir" = "X$arg"; then
1013 if test "$pic_object" != none
; then
1014 # Prepend the subdirectory the object is found in.
1015 pic_object
="$xdir$pic_object"
1017 if test "$prev" = dlfiles
; then
1018 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1019 dlfiles
="$dlfiles $pic_object"
1023 # If libtool objects are unsupported, then we need to preload.
1028 # CHECK ME: I think I busted this. -Ossama
1029 if test "$prev" = dlprefiles
; then
1030 # Preload the old-style object.
1031 dlprefiles
="$dlprefiles $pic_object"
1036 libobjs
="$libobjs $pic_object"
1041 if test "$non_pic_object" != none
; then
1042 # Prepend the subdirectory the object is found in.
1043 non_pic_object
="$xdir$non_pic_object"
1045 # A standard non-PIC object
1046 non_pic_objects
="$non_pic_objects $non_pic_object"
1047 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1048 arg
="$non_pic_object"
1051 # If the PIC object exists, use it instead.
1052 # $xdir was prepended to $pic_object above.
1053 non_pic_object
="$pic_object"
1054 non_pic_objects
="$non_pic_objects $non_pic_object"
1057 # Only an error if not doing a dry-run.
1058 if test -z "$run"; then
1059 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1064 # Extract subdirectory from the argument.
1065 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1066 if test "X$xdir" = "X$arg"; then
1072 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1073 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1074 libobjs
="$libobjs $pic_object"
1075 non_pic_objects
="$non_pic_objects $non_pic_object"
1080 $echo "$modename: link input file \`$save_arg' does not exist"
1088 # We need an absolute path.
1090 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1092 $echo "$modename: only absolute run-paths are allowed" 1>&2
1096 if test "$prev" = rpath
; then
1099 *) rpath
="$rpath $arg" ;;
1104 *) xrpath
="$xrpath $arg" ;;
1111 compiler_flags
="$compiler_flags $qarg"
1113 compile_command
="$compile_command $qarg"
1114 finalize_command
="$finalize_command $qarg"
1118 linker_flags
="$linker_flags $qarg"
1119 compiler_flags
="$compiler_flags $wl$qarg"
1121 compile_command
="$compile_command $wl$qarg"
1122 finalize_command
="$finalize_command $wl$qarg"
1129 *" $qarg.framework "*) ;;
1130 *) deplibs
="$deplibs $qarg.framework" # this is fixed later
1139 eval "$prev=\"\$arg\""
1150 if test -n "$link_static_flag"; then
1151 compile_command
="$compile_command $link_static_flag"
1152 finalize_command
="$finalize_command $link_static_flag"
1158 # FIXME: remove this flag sometime in the future.
1159 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1183 -export-symbols |
-export-symbols-regex)
1184 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1185 $echo "$modename: more than one -exported-symbols argument is not allowed"
1188 if test "X$arg" = "X-export-symbols"; then
1201 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1202 # so, if we see these flags be careful not to treat them like -L
1204 case $with_gcc/$host in
1206 compile_command
="$compile_command $arg"
1207 finalize_command
="$finalize_command $arg"
1214 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1215 # We need an absolute path.
1217 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1219 absdir
=`cd "$dir" && pwd`
1220 if test -z "$absdir"; then
1221 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1230 deplibs
="$deplibs -L$dir"
1231 lib_search_path
="$lib_search_path $dir"
1235 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1236 case :$dllsearchpath: in
1238 *) dllsearchpath
="$dllsearchpath:$dir";;
1246 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1248 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1249 # These systems don't actually have a C or math library (as such)
1252 *-*-mingw* |
*-*-os2*)
1253 # These systems don't actually have a C library (as such)
1254 test "X$arg" = "X-lc" && continue
1258 deplibs
="$deplibs $arg"
1274 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1275 # The PATH hackery in wrapper scripts is required on Windows
1276 # in order for the loader to find any dlls it needs.
1277 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1278 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1281 *) no_install
=yes ;;
1314 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1315 # We need an absolute path.
1317 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1319 $echo "$modename: only absolute run-paths are allowed" 1>&2
1325 *) xrpath
="$xrpath $dir" ;;
1331 # The effects of -static are defined in a previous loop.
1332 # We used to do the same as -all-static on platforms that
1333 # didn't have a PIC flag, but the assumption that the effects
1334 # would be equivalent was wrong. It would break on at least
1335 # Digital Unix and AIX.
1350 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1352 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1353 for flag
in $args; do
1356 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1361 compiler_flags
="$compiler_flags $flag"
1364 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1368 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1370 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=','
1371 for flag
in $args; do
1374 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1379 compiler_flags
="$compiler_flags $wl$flag"
1380 linker_flags
="$linker_flags $flag"
1383 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1400 # Some other compiler flag.
1402 # Unknown arguments in both finalize_command and compile_command need
1403 # to be aesthetically quoted because they are evaled later.
1404 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1406 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1413 # A standard object.
1418 # A libtool-controlled object.
1420 # Check to see that this really is a libtool object.
1421 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1426 # If there is no directory component, then add one.
1428 */* |
*\\*) .
$arg ;;
1432 if test -z "$pic_object" || \
1433 test -z "$non_pic_object" ||
1434 test "$pic_object" = none
&& \
1435 test "$non_pic_object" = none
; then
1436 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1440 # Extract subdirectory from the argument.
1441 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1442 if test "X$xdir" = "X$arg"; then
1448 if test "$pic_object" != none
; then
1449 # Prepend the subdirectory the object is found in.
1450 pic_object
="$xdir$pic_object"
1452 if test "$prev" = dlfiles
; then
1453 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1454 dlfiles
="$dlfiles $pic_object"
1458 # If libtool objects are unsupported, then we need to preload.
1463 # CHECK ME: I think I busted this. -Ossama
1464 if test "$prev" = dlprefiles
; then
1465 # Preload the old-style object.
1466 dlprefiles
="$dlprefiles $pic_object"
1471 libobjs
="$libobjs $pic_object"
1476 if test "$non_pic_object" != none
; then
1477 # Prepend the subdirectory the object is found in.
1478 non_pic_object
="$xdir$non_pic_object"
1480 # A standard non-PIC object
1481 non_pic_objects
="$non_pic_objects $non_pic_object"
1482 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1483 arg
="$non_pic_object"
1486 # If the PIC object exists, use it instead.
1487 # $xdir was prepended to $pic_object above.
1488 non_pic_object
="$pic_object"
1489 non_pic_objects
="$non_pic_objects $non_pic_object"
1492 # Only an error if not doing a dry-run.
1493 if test -z "$run"; then
1494 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1499 # Extract subdirectory from the argument.
1500 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1501 if test "X$xdir" = "X$arg"; then
1507 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1508 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1509 libobjs
="$libobjs $pic_object"
1510 non_pic_objects
="$non_pic_objects $non_pic_object"
1517 deplibs
="$deplibs $arg"
1518 old_deplibs
="$old_deplibs $arg"
1523 # A libtool-controlled library.
1525 if test "$prev" = dlfiles
; then
1526 # This library was specified with -dlopen.
1527 dlfiles
="$dlfiles $arg"
1529 elif test "$prev" = dlprefiles
; then
1530 # The library was specified with -dlpreopen.
1531 dlprefiles
="$dlprefiles $arg"
1534 deplibs
="$deplibs $arg"
1539 # Some other compiler argument.
1541 # Unknown arguments in both finalize_command and compile_command need
1542 # to be aesthetically quoted because they are evaled later.
1543 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1545 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1552 # Now actually substitute the argument into the commands.
1553 if test -n "$arg"; then
1554 compile_command
="$compile_command $arg"
1555 finalize_command
="$finalize_command $arg"
1557 done # argument parsing loop
1559 if test -n "$prev"; then
1560 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1565 # Infer tagged configuration to use if any are available and
1566 # if one wasn't chosen via the "--tag" command line option.
1567 # Only attempt this if the compiler in the base link
1568 # command doesn't match the default compiler.
1569 if test -n "$available_tags" && test -z "$tagname"; then
1570 case $base_compile in
1572 # Blanks in the command may have been stripped by the calling shell,
1573 # but not from the CC environment variable when ltconfig was run.
1576 for z
in $available_tags; do
1577 if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1578 # Evaluate the configuration.
1579 eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1580 case $base_compile in
1582 # The compiler in $compile_command matches
1583 # the one in the tagged configuration.
1584 # Assume this is the tagged configuration we want.
1595 # If $tagname still isn't set, then no tagged configuration
1596 # was found and let the user know that the "--tag" command
1597 # line option must be used.
1598 if test -z "$tagname"; then
1599 echo "$modename: unable to infer tagged configuration"
1600 echo "$modename: specify a tag with \`--tag'" 1>&2
1603 # echo "$modename: using $tagname tagged configuration"
1609 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1610 eval arg
=\"$export_dynamic_flag_spec\"
1611 compile_command
="$compile_command $arg"
1612 finalize_command
="$finalize_command $arg"
1615 # calculate the name of the file, without its directory
1616 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1617 libobjs_save
="$libobjs"
1619 if test -n "$shlibpath_var"; then
1620 # get the directories listed in $shlibpath_var
1621 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1625 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1626 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1628 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1629 if test "X$output_objdir" = "X$output"; then
1630 output_objdir
="$objdir"
1632 output_objdir
="$output_objdir/$objdir"
1634 # Create the object directory.
1635 if test ! -d $output_objdir; then
1636 $show "$mkdir $output_objdir"
1637 $run $mkdir $output_objdir
1639 if test $status -ne 0 && test ! -d $output_objdir; then
1644 # Determine the type of output
1647 $echo "$modename: you must specify an output file" 1>&2
1651 *.
$libext) linkmode
=oldlib
;;
1652 *.lo |
*.
$objext) linkmode
=obj
;;
1653 *.la
) linkmode
=lib
;;
1654 *) linkmode
=prog
;; # Anything else should be a program.
1659 # Find all interdependent deplibs by searching for libraries
1660 # that are linked more than once (e.g. -la -lb -la)
1661 for deplib
in $deplibs; do
1663 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1665 libs
="$libs $deplib"
1668 if test $linkmode = lib
; then
1669 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1671 # Compute libraries that are listed more than once in $predeps
1672 # $postdeps and mark them as special (i.e., whose duplicates are
1673 # not to be eliminated).
1675 for pre_post_dep
in $predeps $postdeps; do
1676 case "$pre_post_deps " in
1677 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1679 pre_post_deps
="$pre_post_deps $pre_post_dep"
1687 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1688 notinst_deplibs
= # not-installed libtool libraries
1689 notinst_path
= # paths that contain not-installed libtool libraries
1693 for file in $dlfiles $dlprefiles; do
1697 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1709 passes
="conv scan dlopen dlpreopen link"
1714 for pass
in $passes; do
1715 if test $linkmode = prog
; then
1716 # Determine which files to process
1720 save_deplibs
="$deplibs" # Collect dlpreopened libraries
1723 dlpreopen
) libs
="$dlprefiles" ;;
1724 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1727 for deplib
in $libs; do
1732 if test $linkmode = oldlib
&& test $linkmode = obj
; then
1733 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1736 if test $pass = conv
; then
1737 deplibs
="$deplib $deplibs"
1740 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1741 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1742 # Search the libtool library
1743 lib
="$searchdir/lib${name}.la"
1744 if test -f "$lib"; then
1749 if test "$found" != yes; then
1750 # deplib doesn't seem to be a libtool library
1751 if test "$linkmode,$pass" = "prog,link"; then
1752 compile_deplibs
="$deplib $compile_deplibs"
1753 finalize_deplibs
="$deplib $finalize_deplibs"
1755 deplibs
="$deplib $deplibs"
1756 test $linkmode = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1764 deplibs
="$deplib $deplibs"
1765 test $pass = conv
&& continue
1766 newdependency_libs
="$deplib $newdependency_libs"
1767 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1770 if test $pass = conv
; then
1771 deplibs
="$deplib $deplibs"
1774 if test $pass = scan
; then
1775 deplibs
="$deplib $deplibs"
1776 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1778 compile_deplibs
="$deplib $compile_deplibs"
1779 finalize_deplibs
="$deplib $finalize_deplibs"
1783 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1789 if test $pass = link
; then
1790 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1791 # Make sure the xrpath contains only unique directories.
1794 *) xrpath
="$xrpath $dir" ;;
1797 deplibs
="$deplib $deplibs"
1800 *.la
) lib
="$deplib" ;;
1802 if test $pass = conv
; then
1803 deplibs
="$deplib $deplibs"
1808 if test "$deplibs_check_method" != pass_all
; then
1810 echo "*** Warning: This library needs some functionality provided by $deplib."
1811 echo "*** I have the capability to make that library automatically link in when"
1812 echo "*** you link to this library. But I can only do this if you have a"
1813 echo "*** shared version of the library, which you do not appear to have."
1816 echo "*** Warning: Linking the shared library $output against the"
1817 echo "*** static library $deplib is not portable!"
1818 deplibs
="$deplib $deplibs"
1823 if test $pass != link
; then
1824 deplibs
="$deplib $deplibs"
1826 compile_deplibs
="$deplib $compile_deplibs"
1827 finalize_deplibs
="$deplib $finalize_deplibs"
1834 if test $pass = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1835 # If there is no dlopen support or we're linking statically,
1836 # we need to preload.
1837 newdlprefiles
="$newdlprefiles $deplib"
1838 compile_deplibs
="$deplib $compile_deplibs"
1839 finalize_deplibs
="$deplib $finalize_deplibs"
1841 newdlfiles
="$newdlfiles $deplib"
1850 if test $found = yes ||
test -f "$lib"; then :
1852 $echo "$modename: cannot find the library \`$lib'" 1>&2
1856 # Check to see that this really is a libtool archive.
1857 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1859 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1863 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1864 test "X$ladir" = "X$lib" && ladir
="."
1872 # If the library was installed with an old release of libtool,
1873 # it will not redefine variable installed.
1878 */* |
*\\*) .
$lib ;;
1884 # Convert "-framework foo" to "foo.framework" in dependency_libs
1885 test -n "$dependency_libs" && dependency_libs
=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
1889 if test "$linkmode,$pass" = "lib,link" ||
1890 test "$linkmode,$pass" = "prog,scan" ||
1891 { test $linkmode = oldlib
&& test $linkmode = obj
; }; then
1892 # Add dl[pre]opened files of deplib
1893 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1894 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1897 if test $pass = conv
; then
1898 # Only check for convenience libraries
1899 deplibs
="$lib $deplibs"
1900 if test -z "$libdir"; then
1901 if test -z "$old_library"; then
1902 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1905 # It is a libtool convenience library, so add in its objects.
1906 convenience
="$convenience $ladir/$objdir/$old_library"
1907 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1909 for deplib
in $dependency_libs; do
1910 deplibs
="$deplib $deplibs"
1911 case "$tmp_libs " in
1912 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1914 tmp_libs
="$tmp_libs $deplib"
1916 elif test $linkmode != prog
&& test $linkmode != lib
; then
1917 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1923 # Get the name of the library we link against.
1925 for l
in $old_library $library_names; do
1928 if test -z "$linklib"; then
1929 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1933 # This library was specified with -dlopen.
1934 if test $pass = dlopen
; then
1935 if test -z "$libdir"; then
1936 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1939 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1940 # If there is no dlname, no dlopen support or we're linking
1941 # statically, we need to preload.
1942 dlprefiles
="$dlprefiles $lib"
1944 newdlfiles
="$newdlfiles $lib"
1949 # We need an absolute path.
1951 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1953 abs_ladir
=`cd "$ladir" && pwd`
1954 if test -z "$abs_ladir"; then
1955 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1956 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1961 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1963 # Find the relevant object directory and library name.
1964 if test "X$installed" = Xyes
; then
1965 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1966 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1975 dir
="$ladir/$objdir"
1976 absdir
="$abs_ladir/$objdir"
1977 # Remove this search path later
1978 notinst_path
="$notinst_path $abs_ladir"
1979 fi # $installed = yes
1980 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1982 # This library was specified with -dlpreopen.
1983 if test $pass = dlpreopen
; then
1984 if test -z "$libdir"; then
1985 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1988 # Prefer using a static library (so that no silly _DYNAMIC symbols
1989 # are required to link).
1990 if test -n "$old_library"; then
1991 newdlprefiles
="$newdlprefiles $dir/$old_library"
1992 # Otherwise, use the dlname, so that lt_dlopen finds it.
1993 elif test -n "$dlname"; then
1994 newdlprefiles
="$newdlprefiles $dir/$dlname"
1996 newdlprefiles
="$newdlprefiles $dir/$linklib"
1998 fi # $pass = dlpreopen
2000 if test -z "$libdir"; then
2001 # Link the convenience library
2002 if test $linkmode = lib
; then
2003 deplibs
="$dir/$old_library $deplibs"
2004 elif test "$linkmode,$pass" = "prog,link"; then
2005 compile_deplibs
="$dir/$old_library $compile_deplibs"
2006 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2008 deplibs
="$lib $deplibs"
2013 if test $linkmode = prog
&& test $pass != link
; then
2014 newlib_search_path
="$newlib_search_path $ladir"
2015 deplibs
="$lib $deplibs"
2018 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2019 test "$build_libtool_libs" = no
; then
2024 for deplib
in $dependency_libs; do
2026 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2028 # Need to link against all dependency_libs?
2029 if test $linkalldeplibs = yes; then
2030 deplibs
="$deplib $deplibs"
2032 # Need to hardcode shared library paths
2033 # or/and link against static libraries
2034 newdependency_libs
="$deplib $newdependency_libs"
2036 case "$tmp_libs " in
2037 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2039 tmp_libs
="$tmp_libs $deplib"
2042 fi # $linkmode = prog...
2044 link_static
=no
# Whether the deplib will be linked statically
2045 if test -n "$library_names" &&
2046 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2047 # Link against this shared library
2049 if test "$linkmode,$pass" = "prog,link" ||
2050 { test $linkmode = lib
&& test $hardcode_into_libs = yes; }; then
2051 # Hardcode the library path.
2052 # Skip directories that are in the system default run-time
2054 case " $sys_lib_dlsearch_path " in
2057 case "$compile_rpath " in
2059 *) compile_rpath
="$compile_rpath $absdir"
2063 case " $sys_lib_dlsearch_path " in
2066 case "$finalize_rpath " in
2068 *) finalize_rpath
="$finalize_rpath $libdir"
2072 if test $linkmode = prog
; then
2073 # We need to hardcode the library path
2074 if test -n "$shlibpath_var"; then
2075 # Make sure the rpath contains only unique directories.
2076 case "$temp_rpath " in
2079 *) temp_rpath
="$temp_rpath $dir" ;;
2083 fi # $linkmode,$pass = prog,link...
2085 if test "$alldeplibs" = yes &&
2086 { test "$deplibs_check_method" = pass_all ||
2087 { test "$build_libtool_libs" = yes &&
2088 test -n "$library_names"; }; }; then
2089 # We only need to search for static libraries
2093 if test "$installed" = no
; then
2094 notinst_deplibs
="$notinst_deplibs $lib"
2098 if test -n "$old_archive_from_expsyms_cmds"; then
2099 # figure out the soname
2100 set dummy
$library_names
2103 libname
=`eval \\$echo \"$libname_spec\"`
2104 # use dlname if we got it. it's perfectly good, no?
2105 if test -n "$dlname"; then
2107 elif test -n "$soname_spec"; then
2111 major
=`expr $current - $age`
2115 eval soname
=\"$soname_spec\"
2120 # Make a new name for the extract_expsyms_cmds to use
2122 soname
=`echo $soroot | sed -e 's/^.*\///'`
2123 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2125 # If the library has no export list, then create one now
2126 if test -f "$output_objdir/$soname-def"; then :
2128 $show "extracting exported symbol list from \`$soname'"
2129 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2130 cmds
=$extract_expsyms_cmds
2131 for cmd
in $cmds; do
2135 $run eval "$cmd" ||
exit $?
2141 if test -f "$output_objdir/$newlib"; then :; else
2142 $show "generating import library for \`$soname'"
2143 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2144 cmds
=$old_archive_from_expsyms_cmds
2145 for cmd
in $cmds; do
2149 $run eval "$cmd" ||
exit $?
2153 # make sure the library variables are pointing to the new library
2156 fi # test -n $old_archive_from_expsyms_cmds
2158 if test $linkmode = prog ||
test "$mode" != relink
; then
2163 case $hardcode_action in
2164 immediate | unsupported
)
2165 if test "$hardcode_direct" = no
; then
2167 elif test "$hardcode_minus_L" = no
; then
2169 *-*-sunos*) add_shlibpath
="$dir" ;;
2173 elif test "$hardcode_shlibpath_var" = no
; then
2174 add_shlibpath
="$dir"
2181 if test "$hardcode_direct" = yes; then
2183 elif test "$hardcode_minus_L" = yes; then
2185 # Try looking first in the location we're being installed to.
2186 if test -n "$inst_prefix_dir"; then
2189 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2194 elif test "$hardcode_shlibpath_var" = yes; then
2195 add_shlibpath
="$dir"
2204 if test "$lib_linked" != yes; then
2205 $echo "$modename: configuration error: unsupported hardcode properties"
2209 if test -n "$add_shlibpath"; then
2210 case :$compile_shlibpath: in
2211 *":$add_shlibpath:"*) ;;
2212 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2215 if test $linkmode = prog
; then
2216 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2217 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2219 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2220 test -n "$add" && deplibs
="$add $deplibs"
2221 if test "$hardcode_direct" != yes && \
2222 test "$hardcode_minus_L" != yes && \
2223 test "$hardcode_shlibpath_var" = yes; then
2224 case :$finalize_shlibpath: in
2226 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2232 if test $linkmode = prog ||
test "$mode" = relink
; then
2236 # Finalize command for both is simple: just hardcode it.
2237 if test "$hardcode_direct" = yes; then
2238 add
="$libdir/$linklib"
2239 elif test "$hardcode_minus_L" = yes; then
2242 elif test "$hardcode_shlibpath_var" = yes; then
2243 case :$finalize_shlibpath: in
2245 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2249 # We cannot seem to hardcode it, guess we'll fake it.
2251 # Try looking first in the location we're being installed to.
2252 if test -n "$inst_prefix_dir"; then
2255 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2262 if test $linkmode = prog
; then
2263 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2264 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2266 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2267 test -n "$add" && deplibs
="$add $deplibs"
2270 elif test $linkmode = prog
; then
2271 if test "$alldeplibs" = yes &&
2272 { test "$deplibs_check_method" = pass_all ||
2273 { test "$build_libtool_libs" = yes &&
2274 test -n "$library_names"; }; }; then
2275 # We only need to search for static libraries
2279 # Try to link the static library
2280 # Here we assume that one of hardcode_direct or hardcode_minus_L
2281 # is not unsupported. This is valid on all known static and
2283 if test "$hardcode_direct" != unsupported
; then
2284 test -n "$old_library" && linklib
="$old_library"
2285 compile_deplibs
="$dir/$linklib $compile_deplibs"
2286 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2288 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2289 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2291 elif test "$build_libtool_libs" = yes; then
2292 # Not a shared library
2293 if test "$deplibs_check_method" != pass_all
; then
2294 # We're trying link a shared library against a static one
2295 # but the system doesn't support it.
2297 # Just print a warning and add the library to dependency_libs so
2298 # that the program can be linked against the static library.
2300 echo "*** Warning: This library needs some functionality provided by $lib."
2301 echo "*** I have the capability to make that library automatically link in when"
2302 echo "*** you link to this library. But I can only do this if you have a"
2303 echo "*** shared version of the library, which you do not appear to have."
2304 if test "$module" = yes; then
2305 echo "*** Therefore, libtool will create a static module, that should work "
2306 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2307 if test -z "$global_symbol_pipe"; then
2309 echo "*** However, this would only work if libtool was able to extract symbol"
2310 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2311 echo "*** not find such a program. So, this module is probably useless."
2312 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2314 if test "$build_old_libs" = no
; then
2315 build_libtool_libs
=module
2318 build_libtool_libs
=no
2322 convenience
="$convenience $dir/$old_library"
2323 old_convenience
="$old_convenience $dir/$old_library"
2324 deplibs
="$dir/$old_library $deplibs"
2327 fi # link shared/static library?
2329 if test $linkmode = lib
; then
2330 if test -n "$dependency_libs" &&
2331 { test $hardcode_into_libs != yes ||
test $build_old_libs = yes ||
2332 test $link_static = yes; }; then
2333 # Extract -R from dependency_libs
2335 for libdir
in $dependency_libs; do
2337 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2339 *" $temp_xrpath "*) ;;
2340 *) xrpath
="$xrpath $temp_xrpath";;
2342 *) temp_deplibs
="$temp_deplibs $libdir";;
2345 dependency_libs
="$temp_deplibs"
2348 newlib_search_path
="$newlib_search_path $absdir"
2349 # Link against this library
2350 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2351 # ... and its dependency_libs
2353 for deplib
in $dependency_libs; do
2354 newdependency_libs
="$deplib $newdependency_libs"
2355 case "$tmp_libs " in
2356 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2358 tmp_libs
="$tmp_libs $deplib"
2361 if test $link_all_deplibs != no
; then
2362 # Add the search paths of all dependency libraries
2363 for deplib
in $dependency_libs; do
2365 -L*) path
="$deplib" ;;
2367 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2368 test "X$dir" = "X$deplib" && dir
="."
2369 # We need an absolute path.
2371 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2373 absdir
=`cd "$dir" && pwd`
2374 if test -z "$absdir"; then
2375 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2380 if grep "^installed=no" $deplib > /dev
/null
; then
2381 path
="-L$absdir/$objdir"
2383 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2384 if test -z "$libdir"; then
2385 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2388 if test "$absdir" != "$libdir"; then
2389 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2396 case " $deplibs " in
2398 *) deplibs
="$path $deplibs" ;;
2401 fi # link_all_deplibs != no
2403 done # for deplib in $libs
2404 if test $pass = dlpreopen
; then
2405 # Link the dlpreopened libraries before other libraries
2406 for deplib
in $save_deplibs; do
2407 deplibs
="$deplib $deplibs"
2410 if test $pass != dlopen
; then
2411 test $pass != scan
&& dependency_libs
="$newdependency_libs"
2412 if test $pass != conv
; then
2413 # Make sure lib_search_path contains only unique directories.
2415 for dir
in $newlib_search_path; do
2416 case "$lib_search_path " in
2418 *) lib_search_path
="$lib_search_path $dir" ;;
2424 if test "$linkmode,$pass" != "prog,link"; then
2427 vars
="compile_deplibs finalize_deplibs"
2429 for var
in $vars dependency_libs
; do
2430 # Add libraries to $var in reverse order
2431 eval tmp_libs
=\"\$
$var\"
2433 for deplib
in $tmp_libs; do
2435 -L*) new_libs
="$deplib $new_libs" ;;
2437 case " $specialdeplibs " in
2438 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2440 case " $new_libs " in
2442 *) new_libs
="$deplib $new_libs" ;;
2450 for deplib
in $new_libs; do
2453 case " $tmp_libs " in
2455 *) tmp_libs
="$tmp_libs $deplib" ;;
2458 *) tmp_libs
="$tmp_libs $deplib" ;;
2461 eval $var=\"$tmp_libs\"
2464 if test "$pass" = "conv" &&
2465 { test "$linkmode" = "lib" ||
test "$linkmode" = "prog"; }; then
2466 libs
="$deplibs" # reset libs
2470 if test $linkmode = prog
; then
2471 dlfiles
="$newdlfiles"
2472 dlprefiles
="$newdlprefiles"
2477 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2478 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2481 if test -n "$rpath"; then
2482 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2485 if test -n "$xrpath"; then
2486 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2489 if test -n "$vinfo"; then
2490 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2493 if test -n "$release"; then
2494 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2497 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2498 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2501 # Now set the variables for building old libraries.
2502 build_libtool_libs
=no
2504 objs
="$objs$old_deplibs"
2508 # Make sure we only generate libraries of the form `libNAME.la'.
2511 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2512 eval shared_ext
=\"$shrext\"
2513 eval libname
=\"$libname_spec\"
2516 if test "$module" = no
; then
2517 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2521 if test "$need_lib_prefix" != no
; then
2522 # Add the "lib" prefix for modules if required
2523 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2524 eval shared_ext
=\"$shrext\"
2525 eval libname
=\"$libname_spec\"
2527 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2532 if test -n "$objs"; then
2533 if test "$deplibs_check_method" != pass_all
; then
2534 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2538 echo "*** Warning: Linking the shared library $output against the non-libtool"
2539 echo "*** objects $objs is not portable!"
2540 libobjs
="$libobjs $objs"
2544 if test "$dlself" != no
; then
2545 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2549 if test $# -gt 2; then
2550 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2555 if test -z "$rpath"; then
2556 if test "$build_libtool_libs" = yes; then
2557 # Building a libtool convenience library.
2558 # Some compilers have problems with a `.al' extension so
2559 # convenience libraries should have the same extension an
2560 # archive normally would.
2561 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2562 build_libtool_libs
=convenience
2566 if test -n "$vinfo"; then
2567 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2570 if test -n "$release"; then
2571 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2575 # Parse the version information argument.
2576 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
2577 set dummy
$vinfo 0 0 0
2580 if test -n "$8"; then
2581 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2590 # Check that each of the things are valid numbers.
2592 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2594 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2595 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2601 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2603 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2604 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2610 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2612 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2613 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2618 if test $age -gt $current; then
2619 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2620 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2624 # Calculate the version variables.
2628 case $version_type in
2632 # Like Linux, but with the current version available in
2633 # verstring for coding it into the library header
2634 major
=.
`expr $current - $age`
2635 versuffix
="$major.$age.$revision"
2636 # Darwin ld doesn't like 0 for these options...
2637 minor_current
=`expr $current + 1`
2638 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2643 versuffix
=".$current.$revision";
2648 versuffix
=".$current";
2652 major
=`expr $current - $age + 1`
2653 verstring
="sgi$major.$revision"
2655 # Add in all the interfaces that we are compatible with.
2657 while test $loop != 0; do
2658 iface
=`expr $revision - $loop`
2659 loop
=`expr $loop - 1`
2660 verstring
="sgi$major.$iface:$verstring"
2663 # Before this point, $major must not contain `.'.
2665 versuffix
="$major.$revision"
2669 major
=.
`expr $current - $age`
2670 versuffix
="$major.$age.$revision"
2674 major
=.
`expr $current - $age`
2675 versuffix
=".$current.$age.$revision"
2676 verstring
="$current.$age.$revision"
2678 # Add in all the interfaces that we are compatible with.
2680 while test $loop != 0; do
2681 iface
=`expr $current - $loop`
2682 loop
=`expr $loop - 1`
2683 verstring
="$verstring:${iface}.0"
2686 # Make executables depend on our current version.
2687 verstring
="$verstring:${current}.0"
2692 versuffix
=".$current.$revision"
2696 # Use '-' rather than '.', since we only want one
2697 # extension on DOS 8.3 filesystems.
2698 major
=`expr $current - $age`
2703 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2704 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2709 # Clear the version info if we defaulted, and they specified a release.
2710 if test -z "$vinfo" && test -n "$release"; then
2712 case $version_type in
2714 # we can't check for "0.0" in archive_cmds due to quoting
2715 # problems, so we reset it completely
2722 if test "$need_version" = no
; then
2729 # Remove version info from name if versioning should be avoided
2730 if test "$avoid_version" = yes && test "$need_version" = no
; then
2736 # Check to see if the archive will have undefined symbols.
2737 if test "$allow_undefined" = yes; then
2738 if test "$allow_undefined_flag" = unsupported
; then
2739 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2740 build_libtool_libs
=no
2744 # Don't allow undefined symbols.
2745 allow_undefined_flag
="$no_undefined_flag"
2749 if test "$mode" != relink
; then
2750 # Remove our outputs, but don't remove object files since they
2751 # may have been created when compiling PIC objects.
2753 tempremovelist
=`echo "$output_objdir/*"`
2754 for p
in $tempremovelist; do
2758 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2759 removelist
="$removelist $p"
2764 if test -n "$removelist"; then
2765 $show "${rm}r $removelist"
2766 $run ${rm}r
$removelist
2770 # Now set the variables for building old libraries.
2771 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2772 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2774 # Transform .lo files to .o files.
2775 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2778 # Eliminate all temporary directories.
2779 for path
in $notinst_path; do
2780 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2781 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2782 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2785 if test -n "$xrpath"; then
2786 # If the user specified any rpath flags, then add them.
2788 for libdir
in $xrpath; do
2789 temp_xrpath
="$temp_xrpath -R$libdir"
2790 case "$finalize_rpath " in
2792 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2795 if test $hardcode_into_libs != yes ||
test $build_old_libs = yes; then
2796 dependency_libs
="$temp_xrpath $dependency_libs"
2800 # Make sure dlfiles contains only unique files that won't be dlpreopened
2801 old_dlfiles
="$dlfiles"
2803 for lib
in $old_dlfiles; do
2804 case " $dlprefiles $dlfiles " in
2806 *) dlfiles
="$dlfiles $lib" ;;
2810 # Make sure dlprefiles contains only unique files
2811 old_dlprefiles
="$dlprefiles"
2813 for lib
in $old_dlprefiles; do
2814 case "$dlprefiles " in
2816 *) dlprefiles
="$dlprefiles $lib" ;;
2820 if test "$build_libtool_libs" = yes; then
2821 if test -n "$rpath"; then
2823 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2824 # these systems don't actually have a c library (as such)!
2826 *-*-rhapsody* |
*-*-darwin1.
[012])
2827 # Rhapsody C library is in the System framework
2828 deplibs
="$deplibs -framework System"
2831 # Don't link with libc until the a.out ld.so is fixed.
2834 # Add libc to deplibs on all other systems if necessary.
2835 if test $build_libtool_need_lc = "yes"; then
2836 deplibs
="$deplibs -lc"
2842 # Transform deplibs into only deplibs that can be linked in shared.
2844 libname_save
=$libname
2845 release_save
=$release
2846 versuffix_save
=$versuffix
2848 # I'm not sure if I'm treating the release correctly. I think
2849 # release should show up in the -l (ie -lgmp5) so we don't want to
2850 # add it in twice. Is that correct?
2856 case $deplibs_check_method in
2858 # Don't check for shared/static. Everything works.
2859 # This might be a little naive. We might want to check
2860 # whether the library exists or not. But this is on
2861 # osf3 & osf4 and I'm not really sure... Just
2862 # implementing what was already the behaviour.
2866 # This code stresses the "libraries are programs" paradigm to its
2867 # limits. Maybe even breaks it. We compile a program, linking it
2868 # against the deplibs as a proxy for the library. Then we can check
2869 # whether they linked in statically or dynamically with ldd.
2871 cat > conftest.c
<<EOF
2872 int main() { return 0; }
2875 $LTCC -o conftest conftest.c
$deplibs
2876 if test $?
-eq 0 ; then
2877 ldd_output
=`ldd conftest`
2878 for i
in $deplibs; do
2879 name
="`expr $i : '-l\(.*\)'`"
2880 # If $name is empty we are operating on a -L argument.
2881 if test -n "$name" && test "$name" != "0"; then
2882 libname
=`eval \\$echo \"$libname_spec\"`
2883 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2884 set dummy
$deplib_matches
2886 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2887 newdeplibs
="$newdeplibs $i"
2891 echo "*** Warning: This library needs some functionality provided by $i."
2892 echo "*** I have the capability to make that library automatically link in when"
2893 echo "*** you link to this library. But I can only do this if you have a"
2894 echo "*** shared version of the library, which you do not appear to have."
2897 newdeplibs
="$newdeplibs $i"
2901 # Error occured in the first compile. Let's try to salvage the situation:
2902 # Compile a seperate program for each library.
2903 for i
in $deplibs; do
2904 name
="`expr $i : '-l\(.*\)'`"
2905 # If $name is empty we are operating on a -L argument.
2906 if test -n "$name" && test "$name" != "0"; then
2908 $LTCC -o conftest conftest.c
$i
2910 if test $?
-eq 0 ; then
2911 ldd_output
=`ldd conftest`
2912 libname
=`eval \\$echo \"$libname_spec\"`
2913 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2914 set dummy
$deplib_matches
2916 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2917 newdeplibs
="$newdeplibs $i"
2921 echo "*** Warning: This library needs some functionality provided by $i."
2922 echo "*** I have the capability to make that library automatically link in when"
2923 echo "*** you link to this library. But I can only do this if you have a"
2924 echo "*** shared version of the library, which you do not appear to have."
2929 echo "*** Warning! Library $i is needed by this library but I was not able to"
2930 echo "*** make it link in! You will probably need to install it or some"
2931 echo "*** library that it depends on before this library will be fully"
2932 echo "*** functional. Installing it before continuing would be even better."
2935 newdeplibs
="$newdeplibs $i"
2941 set dummy
$deplibs_check_method
2942 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2943 for a_deplib
in $deplibs; do
2944 name
="`expr $a_deplib : '-l\(.*\)'`"
2945 # If $name is empty we are operating on a -L argument.
2946 if test -n "$name" && test "$name" != "0"; then
2947 libname
=`eval \\$echo \"$libname_spec\"`
2948 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2949 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2950 for potent_lib
in $potential_libs; do
2951 # Follow soft links.
2952 if ls -lLd "$potent_lib" 2>/dev
/null \
2953 |
grep " -> " >/dev
/null
; then
2956 # The statement above tries to avoid entering an
2957 # endless loop below, in case of cyclic links.
2958 # We might still enter an endless loop, since a link
2959 # loop can be closed while we follow links,
2961 potlib
="$potent_lib"
2962 while test -h "$potlib" 2>/dev
/null
; do
2963 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2965 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2966 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2969 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2971 |
egrep "$file_magic_regex" > /dev
/null
; then
2972 newdeplibs
="$newdeplibs $a_deplib"
2978 if test -n "$a_deplib" ; then
2981 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2982 echo "*** I have the capability to make that library automatically link in when"
2983 echo "*** you link to this library. But I can only do this if you have a"
2984 echo "*** shared version of the library, which you do not appear to have."
2987 # Add a -L argument.
2988 newdeplibs
="$newdeplibs $a_deplib"
2990 done # Gone through all deplibs.
2993 set dummy
$deplibs_check_method
2994 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2995 for a_deplib
in $deplibs; do
2996 name
="`expr $a_deplib : '-l\(.*\)'`"
2997 # If $name is empty we are operating on a -L argument.
2998 if test -n "$name" && test "$name" != "0"; then
2999 libname
=`eval \\$echo \"$libname_spec\"`
3000 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3001 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3002 for potent_lib
in $potential_libs; do
3003 if eval echo \"$potent_lib\" 2>/dev
/null \
3005 |
egrep "$match_pattern_regex" > /dev
/null
; then
3006 newdeplibs
="$newdeplibs $a_deplib"
3012 if test -n "$a_deplib" ; then
3015 echo "*** Warning: This library needs some functionality provided by $a_deplib."
3016 echo "*** I have the capability to make that library automatically link in when"
3017 echo "*** you link to this library. But I can only do this if you have a"
3018 echo "*** shared version of the library, which you do not appear to have."
3021 # Add a -L argument.
3022 newdeplibs
="$newdeplibs $a_deplib"
3024 done # Gone through all deplibs.
3028 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
3029 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3030 grep .
>/dev
/null
; then
3032 if test "X$deplibs_check_method" = "Xnone"; then
3033 echo "*** Warning: inter-library dependencies are not supported in this platform."
3035 echo "*** Warning: inter-library dependencies are not known to be supported."
3037 echo "*** All declared inter-library dependencies are being dropped."
3042 versuffix
=$versuffix_save
3044 release
=$release_save
3045 libname
=$libname_save
3049 *-*-rhapsody* |
*-*-darwin1.
[012])
3050 # On Rhapsody replace the C library is the System framework
3051 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3055 if test "$droppeddeps" = yes; then
3056 if test "$module" = yes; then
3058 echo "*** Warning: libtool could not satisfy all declared inter-library"
3059 echo "*** dependencies of module $libname. Therefore, libtool will create"
3060 echo "*** a static module, that should work as long as the dlopening"
3061 echo "*** application is linked with the -dlopen flag."
3062 if test -z "$global_symbol_pipe"; then
3064 echo "*** However, this would only work if libtool was able to extract symbol"
3065 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3066 echo "*** not find such a program. So, this module is probably useless."
3067 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3069 if test "$build_old_libs" = no
; then
3070 oldlibs
="$output_objdir/$libname.$libext"
3071 build_libtool_libs
=module
3074 build_libtool_libs
=no
3077 echo "*** The inter-library dependencies that have been dropped here will be"
3078 echo "*** automatically added whenever a program is linked with this library"
3079 echo "*** or is declared to -dlopen it."
3081 if test $allow_undefined = no
; then
3083 echo "*** Since this library must not contain undefined symbols,"
3084 echo "*** because either the platform does not support them or"
3085 echo "*** it was explicitly requested with -no-undefined,"
3086 echo "*** libtool will only create a static version of it."
3087 if test "$build_old_libs" = no
; then
3088 oldlibs
="$output_objdir/$libname.$libext"
3089 build_libtool_libs
=module
3092 build_libtool_libs
=no
3097 # Time to change all our "foo.framework" stuff back to "-framework foo"
3100 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3101 dependency_libs
=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3104 # Done checking deplibs!
3105 # Done checking deplibs!
3109 # All the library-specific variables (install_libdir is set above).
3114 # Test again, we may have decided not to build it any more
3115 if test "$build_libtool_libs" = yes; then
3116 if test $hardcode_into_libs = yes; then
3117 # Hardcode the library paths
3120 rpath
="$finalize_rpath"
3121 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3122 for libdir
in $rpath; do
3123 if test -n "$hardcode_libdir_flag_spec"; then
3124 if test -n "$hardcode_libdir_separator"; then
3125 if test -z "$hardcode_libdirs"; then
3126 hardcode_libdirs
="$libdir"
3128 # Just accumulate the unique libdirs.
3129 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3130 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3133 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3138 eval flag
=\"$hardcode_libdir_flag_spec\"
3139 dep_rpath
="$dep_rpath $flag"
3141 elif test -n "$runpath_var"; then
3142 case "$perm_rpath " in
3144 *) perm_rpath
="$perm_rpath $libdir" ;;
3148 # Substitute the hardcoded libdirs into the rpath.
3149 if test -n "$hardcode_libdir_separator" &&
3150 test -n "$hardcode_libdirs"; then
3151 libdir
="$hardcode_libdirs"
3152 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3154 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3155 # We should set the runpath_var.
3157 for dir
in $perm_rpath; do
3160 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3162 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3165 shlibpath
="$finalize_shlibpath"
3166 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3167 if test -n "$shlibpath"; then
3168 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3171 # Get the real and link names of the library.
3172 eval library_names
=\"$library_names_spec\"
3173 eval shared_ext
=\"$shrext\"
3174 set dummy
$library_names
3178 if test -n "$soname_spec"; then
3179 eval soname
=\"$soname_spec\"
3183 test -z "$dlname" && dlname
=$soname
3185 lib
="$output_objdir/$realname"
3188 linknames
="$linknames $link"
3191 # # Ensure that we have .o objects for linkers which dislike .lo
3192 # # (e.g. aix) in case we are running --disable-static
3193 # for obj in $libobjs; do
3194 # xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3195 # if test "X$xdir" = "X$obj"; then
3200 # baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3201 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3202 # if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
3203 # $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3204 # $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3208 # Use standard objects if they are pic
3209 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3211 # Prepare the list of exported symbols
3212 if test -z "$export_symbols"; then
3213 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3214 $show "generating symbol list for \`$libname.la'"
3215 export_symbols
="$output_objdir/$libname.exp"
3216 $run $rm $export_symbols
3217 eval cmds
=\"$export_symbols_cmds\"
3218 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3219 for cmd
in $cmds; do
3222 $run eval "$cmd" ||
exit $?
3225 if test -n "$export_symbols_regex"; then
3226 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3227 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3228 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3229 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3234 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3235 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3238 if test -n "$convenience"; then
3239 if test -n "$whole_archive_flag_spec"; then
3240 save_libobjs
=$libobjs
3241 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3243 gentop
="$output_objdir/${outputname}x"
3244 $show "${rm}r $gentop"
3245 $run ${rm}r
"$gentop"
3246 $show "$mkdir $gentop"
3247 $run $mkdir "$gentop"
3249 if test $status -ne 0 && test ! -d "$gentop"; then
3252 generated
="$generated $gentop"
3254 for xlib
in $convenience; do
3255 # Extract the objects.
3257 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3258 *) xabs
=`pwd`"/$xlib" ;;
3260 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3261 xdir
="$gentop/$xlib"
3263 $show "${rm}r $xdir"
3265 $show "$mkdir $xdir"
3268 if test $status -ne 0 && test ! -d "$xdir"; then
3271 $show "(cd $xdir && $AR x $xabs)"
3272 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3274 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3279 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3280 eval flag
=\"$thread_safe_flag_spec\"
3281 linker_flags
="$linker_flags $flag"
3284 # Make a backup of the uninstalled library when relinking
3285 if test "$mode" = relink
; then
3286 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3289 # Do each of the archive commands.
3290 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3291 eval test_cmds
=\"$archive_expsym_cmds\"
3292 cmds
=$archive_expsym_cmds
3294 eval test_cmds
=\"$archive_cmds\"
3297 if len
=`expr "X$test_cmds" : ".*"` &&
3298 test $len -le $max_cmd_len; then
3301 # The command line is too long to link in one step, link piecewise.
3303 # Save the value of $output and $libobjs because we want to
3304 # use them later. If we have whole_archive_flag_spec, we
3305 # want to use save_libobjs as it was before
3306 # whole_archive_flag_spec was expanded, because we can't
3307 # assume the linker understands whole_archive_flag_spec.
3308 # This may have to be revisited, in case too many
3309 # convenience libraries get linked in and end up exceeding
3311 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3312 save_libobjs
=$libobjs
3315 output_la
=`$echo "X$output" | $Xsed -e "s,^.*/,,"`
3317 # Clear the reloadable object creation command queue and
3318 # initialize k to one.
3326 if test "$with_gnu_ld" = yes; then
3327 output
=${output_objdir}/${output_la}.lnkscript
3328 $echo "creating GNU ld script: $output"
3329 $echo 'INPUT (' > $output
3330 for obj
in $save_libobjs
3332 $echo \""$obj"\" >> $output
3334 $echo ')' >> $output
3335 delfiles
="$delfiles $output"
3336 elif test "X$file_list_spec" != X
; then
3337 output
=${output_objdir}/${output_la}.lnk
3338 $echo "creating linker input file list: $output"
3340 for obj
in $save_libobjs
3342 $echo "$obj" >> $output
3344 delfiles
="$delfiles $output"
3345 output
=\"$file_list_spec$output\"
3347 $echo "creating reloadable object files..."
3348 output
=$output_objdir/$save_output-${k}.
$objext
3349 # Loop over the list of objects to be linked.
3350 for obj
in $save_libobjs
3352 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3353 if test "X$objlist" = X ||
3354 { len
=`expr "X$test_cmds" : ".*"` &&
3355 test $len -le $max_cmd_len; }; then
3356 objlist
="$objlist $obj"
3358 # The command $test_cmds is almost too long, add a
3359 # command to the queue.
3360 if test $k -eq 1 ; then
3361 # The first file doesn't have a previous command to add.
3362 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3364 # All subsequent reloadable object files will link in
3365 # the last one created.
3366 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3368 last_robj
=$output_objdir/$save_output-${k}.
$objext
3370 output
=$output_objdir/$save_output-${k}.
$objext
3375 # Handle the remaining objects by creating one last
3376 # reloadable object file. All subsequent reloadable object
3377 # files will link in the last one created.
3378 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3379 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3381 # Set up a command to remove the reloadale object files
3382 # after they are used.
3384 while test $i -lt $k
3387 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3390 $echo "creating a temporary reloadable object file: $output"
3392 # Loop through the commands generated above and execute them.
3393 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3394 for cmd
in $concat_cmds; do
3398 $run eval "$cmd" ||
exit $?
3404 # Restore the value of output.
3407 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3408 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3410 # Expand the library linking commands again to reset the
3411 # value of $libobjs for piecewise linking.
3413 # Do each of the archive commands.
3414 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3415 cmds
=$archive_expsym_cmds
3420 # Append the command to remove the reloadable object files
3421 # to the just-reset $cmds.
3422 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3424 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3425 for cmd
in $cmds; do
3429 $run eval "$cmd" ||
exit $?
3433 # Restore the uninstalled library and exit
3434 if test "$mode" = relink
; then
3435 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3439 # Create links to the real library.
3440 for linkname
in $linknames; do
3441 if test "$realname" != "$linkname"; then
3442 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3443 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3447 # If -module or -export-dynamic was specified, set the dlname.
3448 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3449 # On all known operating systems, these are identical.
3456 if test -n "$deplibs"; then
3457 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3460 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3461 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3464 if test -n "$rpath"; then
3465 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3468 if test -n "$xrpath"; then
3469 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3472 if test -n "$vinfo"; then
3473 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3476 if test -n "$release"; then
3477 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3482 if test -n "$objs$old_deplibs"; then
3483 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3487 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3495 # Delete the old objects.
3496 $run $rm $obj $libobj
3498 # Objects from convenience libraries. This assumes
3499 # single-version convenience libraries. Whenever we create
3500 # different ones for PIC/non-PIC, this we'll have to duplicate
3504 # reload_cmds runs $LD directly, so let us get rid of
3505 # -Wl from whole_archive_flag_spec
3508 if test -n "$convenience"; then
3509 if test -n "$whole_archive_flag_spec"; then
3510 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3512 gentop
="$output_objdir/${obj}x"
3513 $show "${rm}r $gentop"
3514 $run ${rm}r
"$gentop"
3515 $show "$mkdir $gentop"
3516 $run $mkdir "$gentop"
3518 if test $status -ne 0 && test ! -d "$gentop"; then
3521 generated
="$generated $gentop"
3523 for xlib
in $convenience; do
3524 # Extract the objects.
3526 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3527 *) xabs
=`pwd`"/$xlib" ;;
3529 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3530 xdir
="$gentop/$xlib"
3532 $show "${rm}r $xdir"
3534 $show "$mkdir $xdir"
3537 if test $status -ne 0 && test ! -d "$xdir"; then
3540 $show "(cd $xdir && $AR x $xabs)"
3541 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3543 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3548 # Create the old-style object.
3549 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
3552 eval cmds
=\"$reload_cmds\"
3553 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3554 for cmd
in $cmds; do
3557 $run eval "$cmd" ||
exit $?
3561 # Exit if we aren't doing a library object file.
3562 if test -z "$libobj"; then
3563 if test -n "$gentop"; then
3564 $show "${rm}r $gentop"
3571 if test "$build_libtool_libs" != yes; then
3572 if test -n "$gentop"; then
3573 $show "${rm}r $gentop"
3577 # Create an invalid libtool object if no PIC, so that we don't
3578 # accidentally link it into a program.
3579 # $show "echo timestamp > $libobj"
3580 # $run eval "echo timestamp > $libobj" || exit $?
3584 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3585 # Only do commands if we really have different PIC objects.
3586 reload_objs
="$libobjs $reload_conv_objs"
3588 eval cmds
=\"$reload_cmds\"
3589 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3590 for cmd
in $cmds; do
3593 $run eval "$cmd" ||
exit $?
3597 # # Just create a symlink.
3600 # xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3601 # if test "X$xdir" = "X$libobj"; then
3606 # baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3607 # oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3608 # $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3609 # $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3612 if test -n "$gentop"; then
3613 $show "${rm}r $gentop"
3622 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3624 if test -n "$vinfo"; then
3625 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3628 if test -n "$release"; then
3629 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3632 if test "$preload" = yes; then
3633 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3634 test "$dlopen_self_static" = unknown
; then
3635 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3640 *-*-rhapsody* |
*-*-darwin1.
[012])
3641 # On Rhapsody replace the C library is the System framework
3642 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3643 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3649 # Don't allow lazy linking, it breaks C++ global constructors
3650 if test "$tagname" = CXX
; then
3651 compile_command
="$compile_command ${wl}-bind_at_load"
3652 finalize_command
="$finalize_command ${wl}-bind_at_load"
3654 # Time to change all our "foo.framework" stuff back to "-framework foo"
3655 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3656 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3660 compile_command
="$compile_command $compile_deplibs"
3661 finalize_command
="$finalize_command $finalize_deplibs"
3663 if test -n "$rpath$xrpath"; then
3664 # If the user specified any rpath flags, then add them.
3665 for libdir
in $rpath $xrpath; do
3666 # This is the magic to use -rpath.
3667 case "$finalize_rpath " in
3669 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3674 # Now hardcode the library paths
3677 for libdir
in $compile_rpath; do
3678 if test -n "$hardcode_libdir_flag_spec"; then
3679 if test -n "$hardcode_libdir_separator"; then
3680 if test -z "$hardcode_libdirs"; then
3681 hardcode_libdirs
="$libdir"
3683 # Just accumulate the unique libdirs.
3684 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3685 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3688 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3693 eval flag
=\"$hardcode_libdir_flag_spec\"
3694 rpath
="$rpath $flag"
3696 elif test -n "$runpath_var"; then
3697 case "$perm_rpath " in
3699 *) perm_rpath
="$perm_rpath $libdir" ;;
3703 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3704 case :$dllsearchpath: in
3706 *) dllsearchpath
="$dllsearchpath:$libdir";;
3711 # Substitute the hardcoded libdirs into the rpath.
3712 if test -n "$hardcode_libdir_separator" &&
3713 test -n "$hardcode_libdirs"; then
3714 libdir
="$hardcode_libdirs"
3715 eval rpath
=\" $hardcode_libdir_flag_spec\"
3717 compile_rpath
="$rpath"
3721 for libdir
in $finalize_rpath; do
3722 if test -n "$hardcode_libdir_flag_spec"; then
3723 if test -n "$hardcode_libdir_separator"; then
3724 if test -z "$hardcode_libdirs"; then
3725 hardcode_libdirs
="$libdir"
3727 # Just accumulate the unique libdirs.
3728 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3729 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3732 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3737 eval flag
=\"$hardcode_libdir_flag_spec\"
3738 rpath
="$rpath $flag"
3740 elif test -n "$runpath_var"; then
3741 case "$finalize_perm_rpath " in
3743 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3747 # Substitute the hardcoded libdirs into the rpath.
3748 if test -n "$hardcode_libdir_separator" &&
3749 test -n "$hardcode_libdirs"; then
3750 libdir
="$hardcode_libdirs"
3751 eval rpath
=\" $hardcode_libdir_flag_spec\"
3753 finalize_rpath
="$rpath"
3756 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3757 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3758 dlsyms
="${outputname}S.c"
3760 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3764 if test -n "$dlsyms"; then
3768 # Discover the nlist of each of the dlfiles.
3769 nlist
="$output_objdir/${outputname}.nm"
3771 $show "$rm $nlist ${nlist}S ${nlist}T"
3772 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3774 # Parse the name list into a source file.
3775 $show "creating $output_objdir/$dlsyms"
3777 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3778 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3779 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3785 /* Prevent the only kind of declaration conflicts we can make. */
3786 #define lt_preloaded_symbols some_other_symbol
3788 /* External symbol declarations for the compiler. */\
3791 if test "$dlself" = yes; then
3792 $show "generating symbol list for \`$output'"
3794 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3796 # Add our own program objects to the symbol list.
3797 progfiles
="$objs$old_deplibs"
3798 for arg
in $progfiles; do
3799 $show "extracting global C symbols from \`$arg'"
3800 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3803 if test -n "$exclude_expsyms"; then
3804 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3805 $run eval '$mv "$nlist"T "$nlist"'
3808 if test -n "$export_symbols_regex"; then
3809 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3810 $run eval '$mv "$nlist"T "$nlist"'
3813 # Prepare the list of exported symbols
3814 if test -z "$export_symbols"; then
3815 export_symbols
="$output_objdir/$output.exp"
3816 $run $rm $export_symbols
3817 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3819 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3820 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3821 $run eval 'mv "$nlist"T "$nlist"'
3825 for arg
in $dlprefiles; do
3826 $show "extracting global C symbols from \`$arg'"
3827 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3828 $run eval 'echo ": $name " >> "$nlist"'
3829 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3832 if test -z "$run"; then
3833 # Make sure we have at least an empty file.
3834 test -f "$nlist" ||
: > "$nlist"
3836 if test -n "$exclude_expsyms"; then
3837 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3838 $mv "$nlist"T
"$nlist"
3841 # Try sorting and uniquifying the output.
3842 if grep -v "^: " < "$nlist" |
3843 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
3848 uniq > "$nlist"S
; then
3851 grep -v "^: " < "$nlist" > "$nlist"S
3854 if test -f "$nlist"S
; then
3855 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3857 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3860 $echo >> "$output_objdir/$dlsyms" "\
3862 #undef lt_preloaded_symbols
3864 #if defined (__STDC__) && __STDC__
3865 # define lt_ptr_t void *
3867 # define lt_ptr_t char *
3871 /* The mapping between symbol names and symbols. */
3876 lt_preloaded_symbols[] =
3880 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3881 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3882 < "$nlist" >> "$output_objdir/$dlsyms"
3884 $echo >> "$output_objdir/$dlsyms" "\
3888 /* This works around a problem in FreeBSD linker */
3889 #ifdef FREEBSD_WORKAROUND
3890 static const void *lt_preloaded_setup() {
3891 return lt_preloaded_symbols;
3901 pic_flag_for_symtable
=
3903 # compiling the symbol table file with pic_flag works around
3904 # a FreeBSD bug that causes programs to crash when -lm is
3905 # linked before any other PIC object. But we must not use
3906 # pic_flag when linking with -static. The problem exists in
3907 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3908 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3909 case "$compile_command " in
3911 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3914 case "$compile_command " in
3916 *) pic_flag_for_symtable
=" $pic_flag";;
3920 # Now compile the dynamic symbol file.
3921 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3922 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3924 # Clean up the generated files.
3925 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3926 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3928 # Transform the symbol file into the correct name.
3929 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3930 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3933 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3938 # We keep going just in case the user didn't refer to
3939 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3940 # really was required.
3942 # Nullify the symbol file.
3943 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3944 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3947 if test $need_relink = no ||
test "$build_libtool_libs" != yes; then
3948 # Replace the output file specification.
3949 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3950 link_command
="$compile_command$compile_rpath"
3952 # We have no uninstalled library dependencies, so finalize right now.
3953 $show "$link_command"
3954 $run eval "$link_command"
3957 # Delete the generated files.
3958 if test -n "$dlsyms"; then
3959 $show "$rm $output_objdir/${outputname}S.${objext}"
3960 $run $rm "$output_objdir/${outputname}S.${objext}"
3966 if test -n "$shlibpath_var"; then
3967 # We should set the shlibpath_var
3969 for dir
in $temp_rpath; do
3971 [\\/]* |
[A-Za-z
]:[\\/]*)
3976 # Relative path: add a thisdir entry.
3977 rpath
="$rpath\$thisdir/$dir:"
3984 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3985 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3987 if test -n "$finalize_shlibpath"; then
3988 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3993 if test -n "$runpath_var"; then
3994 if test -n "$perm_rpath"; then
3995 # We should set the runpath_var.
3997 for dir
in $perm_rpath; do
4000 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4002 if test -n "$finalize_perm_rpath"; then
4003 # We should set the runpath_var.
4005 for dir
in $finalize_perm_rpath; do
4008 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4012 if test "$no_install" = yes; then
4013 # We don't need to create a wrapper script.
4014 link_command
="$compile_var$compile_command$compile_rpath"
4015 # Replace the output file specification.
4016 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4017 # Delete the old output file.
4019 # Link the executable and exit
4020 $show "$link_command"
4021 $run eval "$link_command" ||
exit $?
4025 if test "$hardcode_action" = relink
; then
4026 # Fast installation is not supported
4027 link_command
="$compile_var$compile_command$compile_rpath"
4028 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4030 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4031 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4033 if test "$fast_install" != no
; then
4034 link_command
="$finalize_var$compile_command$finalize_rpath"
4035 if test "$fast_install" = yes; then
4036 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4038 # fast_install is set to needless
4042 link_command
="$compile_var$compile_command$compile_rpath"
4043 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4047 # Replace the output file specification.
4048 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4050 # Delete the old output files.
4051 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4053 $show "$link_command"
4054 $run eval "$link_command" ||
exit $?
4056 # Now create the wrapper script.
4057 $show "creating $output"
4059 # Quote the relink command for shipping.
4060 if test -n "$relink_command"; then
4061 # Preserve any variables that may affect compiler behavior
4062 for var
in $variables_saved_for_relink; do
4063 if eval test -z \"\
${$var+set}\"; then
4064 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4065 elif eval var_value
=\$
$var; test -z "$var_value"; then
4066 relink_command
="$var=; export $var; $relink_command"
4068 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4069 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4072 relink_command
="cd `pwd`; $relink_command"
4073 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4076 # Quote $echo for shipping.
4077 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4079 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4080 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4082 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4084 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4087 # Only actually do things if our run command is non-null.
4088 if test -z "$run"; then
4089 # win32 will think the script is a binary if it has
4090 # a .exe suffix, so we strip it off here.
4092 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
4094 # test for cygwin because mv fails w/o .exe extensions
4096 *cygwin
*) exeext
=.exe
;;
4100 trap "$rm $output; exit 1" 1 2 15
4105 # $output - temporary wrapper script for $objdir/$outputname
4106 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4108 # The $output program cannot be directly executed until all the libtool
4109 # libraries that it depends on are installed.
4111 # This wrapper script should never be moved out of the build directory.
4112 # If it is, it will not operate correctly.
4114 # Sed substitution that helps us do robust quoting. It backslashifies
4115 # metacharacters that are still active within double-quoted strings.
4116 Xsed='sed -e 1s/^X//'
4117 sed_quote_subst='$sed_quote_subst'
4119 # The HP-UX ksh and POSIX shell print the target directory to stdout
4121 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4123 relink_command=\"$relink_command\"
4125 # This environment variable determines our operation mode.
4126 if test \"\$libtool_install_magic\" = \"$magic\"; then
4127 # install mode needs the following variable:
4128 notinst_deplibs='$notinst_deplibs'
4130 # When we are sourced in execute mode, \$file and \$echo are already set.
4131 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4134 # Make sure echo works.
4135 if test \"X\$1\" = X--no-reexec; then
4136 # Discard the --no-reexec flag, and continue.
4138 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4139 # Yippee, \$echo works!
4142 # Restart under the correct shell, and then maybe \$echo will work.
4143 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4149 # Find the directory that this script lives in.
4150 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4151 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4153 # Follow symbolic links until we get to the real thisdir.
4154 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4155 while test -n \"\$file\"; do
4156 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4158 # If there was a directory component, then change thisdir.
4159 if test \"x\$destdir\" != \"x\$file\"; then
4160 case \"\$destdir\" in
4161 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4162 *) thisdir=\"\$thisdir/\$destdir\" ;;
4166 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4167 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4170 # Try to get the absolute directory name.
4171 absdir=\`cd \"\$thisdir\" && pwd\`
4172 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4175 if test "$fast_install" = yes; then
4177 program=lt-'$outputname'$exeext
4178 progdir=\"\$thisdir/$objdir\"
4180 if test ! -f \"\$progdir/\$program\" || \\
4181 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4182 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4184 file=\"\$\$-\$program\"
4186 if test ! -d \"\$progdir\"; then
4187 $mkdir \"\$progdir\"
4189 $rm \"\$progdir/\$file\"
4194 # relink executable if necessary
4195 if test -n \"\$relink_command\"; then
4196 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4198 $echo \"\$relink_command_output\" >&2
4199 $rm \"\$progdir/\$file\"
4204 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4205 { $rm \"\$progdir/\$program\";
4206 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4207 $rm \"\$progdir/\$file\"
4211 program='$outputname'
4212 progdir=\"\$thisdir/$objdir\"
4218 if test -f \"\$progdir/\$program\"; then"
4220 # Export our shlibpath_var if we have one.
4221 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4223 # Add our own library path to $shlibpath_var
4224 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4226 # Some systems cannot cope with colon-terminated $shlibpath_var
4227 # The second colon is a workaround for a bug in BeOS R4 sed
4228 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4230 export $shlibpath_var
4234 # fixup the dll searchpath if we need to.
4235 if test -n "$dllsearchpath"; then
4237 # Add the dll search path components to the executable PATH
4238 PATH=$dllsearchpath:\$PATH
4243 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4244 # Run the actual program with our arguments.
4247 # win32 systems need to use the prog path for dll
4249 *-*-cygwin* |
*-*-pw32*)
4251 exec \$progdir/\$program \${1+\"\$@\"}
4255 # Backslashes separate directories on plain windows
4256 *-*-mingw |
*-*-os2*)
4258 exec \$progdir\\\\\$program \${1+\"\$@\"}
4264 # Export the path to the program.
4265 PATH=\"\$progdir:\$PATH\"
4268 exec \$program \${1+\"\$@\"}
4273 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4277 # The program doesn't exist.
4278 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4279 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4280 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4291 # See if we need to build an old-fashioned archive.
4292 for oldlib
in $oldlibs; do
4294 if test "$build_libtool_libs" = convenience
; then
4295 oldobjs
="$libobjs_save"
4296 addlibs
="$convenience"
4297 build_libtool_libs
=no
4299 if test "$build_libtool_libs" = module
; then
4300 oldobjs
="$libobjs_save"
4301 build_libtool_libs
=no
4303 oldobjs
="$objs$old_deplibs $non_pic_objects"
4305 addlibs
="$old_convenience"
4308 if test -n "$addlibs"; then
4309 gentop
="$output_objdir/${outputname}x"
4310 $show "${rm}r $gentop"
4311 $run ${rm}r
"$gentop"
4312 $show "$mkdir $gentop"
4313 $run $mkdir "$gentop"
4315 if test $status -ne 0 && test ! -d "$gentop"; then
4318 generated
="$generated $gentop"
4320 # Add in members from convenience archives.
4321 for xlib
in $addlibs; do
4322 # Extract the objects.
4324 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4325 *) xabs
=`pwd`"/$xlib" ;;
4327 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4328 xdir
="$gentop/$xlib"
4330 $show "${rm}r $xdir"
4332 $show "$mkdir $xdir"
4335 if test $status -ne 0 && test ! -d "$xdir"; then
4338 $show "(cd $xdir && $AR x $xabs)"
4339 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4341 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
4345 # Do each command in the archive commands.
4346 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4347 eval cmds
=\"$old_archive_from_new_cmds\"
4349 # # Ensure that we have .o objects in place in case we decided
4350 # # not to build a shared library, and have fallen back to building
4351 # # static libs even though --disable-static was passed!
4352 # for oldobj in $oldobjs; do
4353 # if test ! -f $oldobj; then
4354 # xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4355 # if test "X$xdir" = "X$oldobj"; then
4360 # baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4361 # obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4362 # $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4363 # $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4367 # POSIX demands no paths to be encoded in archives. We have
4368 # to avoid creating archives with duplicate basenames if we
4369 # might have to extract them afterwards, e.g., when creating a
4370 # static archive out of a convenience library, or when linking
4371 # the entirety of a libtool archive into another (currently
4372 # not supported by libtool).
4373 if (for obj
in $oldobjs
4375 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
4376 done |
sort |
sort -uc >/dev
/null
2>&1); then
4379 $echo "copying selected object files to avoid basename conflicts..."
4381 if test -z "$gentop"; then
4382 gentop
="$output_objdir/${outputname}x"
4384 $show "${rm}r $gentop"
4385 $run ${rm}r
"$gentop"
4386 $show "$mkdir $gentop"
4387 $run $mkdir "$gentop"
4389 if test $status -ne 0 && test ! -d "$gentop"; then
4392 generated
="$generated $gentop"
4395 save_oldobjs
=$oldobjs
4398 for obj
in $save_oldobjs
4400 objbase
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
4401 case " $oldobjs " in
4402 " ") oldobjs
=$obj ;;
4405 # Make sure we don't pick an alternate name that also
4407 newobj
=lt
$counter-$objbase
4408 counter
=`expr $counter + 1`
4409 case " $oldobjs " in
4410 *[\
/]"$newobj "*) ;;
4411 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
4414 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
4415 $run ln "$obj" "$gentop/$newobj" ||
4416 $run cp "$obj" "$gentop/$newobj"
4417 oldobjs
="$oldobjs $gentop/$newobj"
4419 *) oldobjs
="$oldobjs $obj" ;;
4424 eval cmds
=\"$old_archive_cmds\"
4426 if len
=`expr "X$cmds" : ".*"` &&
4427 test $len -le $max_cmd_len; then
4430 # the command line is too long to link in one step, link in parts
4431 $echo "using piecewise archive linking..."
4436 save_oldobjs
=$oldobjs
4438 for obj
in $save_oldobjs
4440 oldobjs
="$objlist $obj"
4441 objlist
="$objlist $obj"
4442 eval test_cmds
=\"$old_archive_cmds\"
4443 if len
=`expr "X$test_cmds" : ".*"` &&
4444 test $len -le $max_cmd_len; then
4447 # the above command should be used before it gets too long
4449 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4450 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4456 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4459 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4460 for cmd
in $cmds; do
4463 $run eval "$cmd" ||
exit $?
4468 if test -n "$generated"; then
4469 $show "${rm}r$generated"
4470 $run ${rm}r
$generated
4473 # Now create the libtool archive.
4477 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4478 $show "creating $output"
4480 # Preserve any variables that may affect compiler behavior
4481 for var
in $variables_saved_for_relink; do
4482 if eval test -z \"\
${$var+set}\"; then
4483 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4484 elif eval var_value
=\$
$var; test -z "$var_value"; then
4485 relink_command
="$var=; export $var; $relink_command"
4487 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4488 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4491 # Quote the link command for shipping.
4493 for tag
in $taglist; do
4494 tagopts
="$tagopts --tag $tag"
4496 relink_command
="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args @inst_prefix_dir@)"
4497 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4499 # Only create the output if not a dry run.
4500 if test -z "$run"; then
4501 for installed
in no
yes; do
4502 if test "$installed" = yes; then
4503 if test -z "$install_libdir"; then
4506 output
="$output_objdir/$outputname"i
4507 # Replace all uninstalled libtool libraries with the installed ones
4509 for deplib
in $dependency_libs; do
4512 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4513 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4514 if test -z "$libdir"; then
4515 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4518 newdependency_libs
="$newdependency_libs $libdir/$name"
4520 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4523 dependency_libs
="$newdependency_libs"
4525 for lib
in $dlfiles; do
4526 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4527 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4528 if test -z "$libdir"; then
4529 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4532 newdlfiles
="$newdlfiles $libdir/$name"
4534 dlfiles
="$newdlfiles"
4536 for lib
in $dlprefiles; do
4537 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4538 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4539 if test -z "$libdir"; then
4540 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4543 newdlprefiles
="$newdlprefiles $libdir/$name"
4545 dlprefiles
="$newdlprefiles"
4548 # place dlname in correct position for cygwin
4550 case $host,$output,$installed,$module,$dlname in
4551 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4554 # $outputname - a libtool library file
4555 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4557 # Please DO NOT delete this file!
4558 # It is necessary for linking the library.
4560 # The name that we can dlopen(3).
4563 # Names of this library.
4564 library_names='$library_names'
4566 # The name of the static archive.
4567 old_library='$old_library'
4569 # Libraries that this one depends upon.
4570 dependency_libs='$dependency_libs'
4572 # Version information for $libname.
4577 # Is this an already installed library?
4578 installed=$installed
4580 # Files to dlopen/dlpreopen
4582 dlpreopen='$dlprefiles'
4584 # Directory that this library needs to be installed in:
4585 libdir='$install_libdir'"
4586 if test "$installed" = no
&& test $need_relink = yes; then
4588 relink_command=\"$relink_command\""
4593 # Do a symbolic link so that the libtool archive can be found in
4594 # LD_LIBRARY_PATH before the program is installed.
4595 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4596 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4602 # libtool install mode
4604 modename
="$modename: install"
4606 # There may be an optional sh(1) argument at the beginning of
4607 # install_prog (especially on Windows NT).
4608 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4609 # Allow the use of GNU shtool's install command.
4610 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4611 # Aesthetically quote it.
4612 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4614 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4618 install_prog
="$arg "
4626 # The real first argument should be the name of the installation program.
4627 # Aesthetically quote it.
4628 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4630 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4634 install_prog
="$install_prog$arg"
4636 # We need to accept at least all the BSD install flags.
4646 if test -n "$dest"; then
4647 files
="$files $dest"
4665 # If the previous option needed an argument, then skip it.
4666 if test -n "$prev"; then
4675 # Aesthetically quote the argument.
4676 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4678 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4682 install_prog
="$install_prog $arg"
4685 if test -z "$install_prog"; then
4686 $echo "$modename: you must specify an install program" 1>&2
4691 if test -n "$prev"; then
4692 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4697 if test -z "$files"; then
4698 if test -z "$dest"; then
4699 $echo "$modename: no file or destination specified" 1>&2
4701 $echo "$modename: you must specify a destination" 1>&2
4707 # Strip any trailing slash from the destination.
4708 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4710 # Check to see that the destination is a directory.
4711 test -d "$dest" && isdir
=yes
4712 if test "$isdir" = yes; then
4716 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4717 test "X$destdir" = "X$dest" && destdir
=.
4718 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4720 # Not a directory, so check to see that there is only one file specified.
4722 if test $# -gt 2; then
4723 $echo "$modename: \`$dest' is not a directory" 1>&2
4729 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4731 for file in $files; do
4735 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4744 # This variable tells wrapper scripts just to set variables rather
4745 # than running their programs.
4746 libtool_install_magic
="$magic"
4751 for file in $files; do
4753 # Do each installation.
4756 # Do the static libraries later.
4757 staticlibs
="$staticlibs $file"
4761 # Check to see that this really is a libtool archive.
4762 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4764 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4772 # If there is no directory component, then add one.
4774 */* |
*\\*) .
$file ;;
4778 # Add the libdir to current_libdirs if it is the destination.
4779 if test "X$destdir" = "X$libdir"; then
4780 case "$current_libdirs " in
4782 *) current_libdirs
="$current_libdirs $libdir" ;;
4785 # Note the libdir as a future libdir.
4786 case "$future_libdirs " in
4788 *) future_libdirs
="$future_libdirs $libdir" ;;
4792 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4793 test "X$dir" = "X$file/" && dir
=
4796 if test -n "$relink_command"; then
4797 # Determine the prefix the user has applied to our future dir.
4798 inst_prefix_dir
=`$echo "$destdir" | sed "s%$libdir\$%%"`
4800 # Don't allow the user to place us outside of our expected
4801 # location b/c this prevents finding dependent libraries that
4802 # are installed to the same prefix.
4803 # At present, this check doesn't affect windows .dll's that
4804 # are installed into $libdir/../bin (currently, that works fine)
4805 # but it's something to keep an eye on.
4806 if test "$inst_prefix_dir" = "$destdir"; then
4807 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4811 if test -n "$inst_prefix_dir"; then
4812 # Stick the inst_prefix_dir data into the link command.
4813 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4815 relink_command
=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4818 $echo "$modename: warning: relinking \`$file'" 1>&2
4819 $show "$relink_command"
4820 if $run eval "$relink_command"; then :
4822 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4827 # See the names of the shared library.
4828 set dummy
$library_names
4829 if test -n "$2"; then
4835 test -n "$relink_command" && srcname
="$realname"T
4837 # Install the shared library and build the symlinks.
4838 $show "$install_prog $dir/$srcname $destdir/$realname"
4839 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4840 if test -n "$stripme" && test -n "$striplib"; then
4841 $show "$striplib $destdir/$realname"
4842 $run eval "$striplib $destdir/$realname" ||
exit $?
4845 if test $# -gt 0; then
4846 # Delete the old symlinks, and create new ones.
4849 if test "$linkname" != "$realname"; then
4850 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4851 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4856 # Do each command in the postinstall commands.
4857 lib
="$destdir/$realname"
4858 eval cmds
=\"$postinstall_cmds\"
4859 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4860 for cmd
in $cmds; do
4863 $run eval "$cmd" ||
exit $?
4868 # Install the pseudo-library for information purposes.
4869 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4870 instname
="$dir/$name"i
4871 $show "$install_prog $instname $destdir/$name"
4872 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4874 # Maybe install the static library, too.
4875 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4879 # Install (i.e. copy) a libtool object.
4881 # Figure out destination file name, if it wasn't already specified.
4882 if test -n "$destname"; then
4883 destfile
="$destdir/$destname"
4885 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4886 destfile
="$destdir/$destfile"
4889 # Deduce the name of the destination old-style object file.
4892 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4895 staticdest
="$destfile"
4899 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4905 # Install the libtool object if requested.
4906 if test -n "$destfile"; then
4907 $show "$install_prog $file $destfile"
4908 $run eval "$install_prog $file $destfile" ||
exit $?
4911 # Install the old object if enabled.
4912 if test "$build_old_libs" = yes; then
4913 # Deduce the name of the old-style object file.
4914 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4916 $show "$install_prog $staticobj $staticdest"
4917 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4923 # Figure out destination file name, if it wasn't already specified.
4924 if test -n "$destname"; then
4925 destfile
="$destdir/$destname"
4927 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4928 destfile
="$destdir/$destfile"
4931 # Do a test to see if this is really a libtool program.
4932 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4936 # If there is no directory component, then add one.
4938 */* |
*\\*) .
$file ;;
4942 # Check the variables that should have been set.
4943 if test -z "$notinst_deplibs"; then
4944 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4949 for lib
in $notinst_deplibs; do
4950 # Check to see that each library is installed.
4952 if test -f "$lib"; then
4953 # If there is no directory component, then add one.
4955 */* |
*\\*) .
$lib ;;
4959 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4960 if test -n "$libdir" && test ! -f "$libfile"; then
4961 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4967 # If there is no directory component, then add one.
4969 */* |
*\\*) .
$file ;;
4974 if test "$fast_install" = no
&& test -n "$relink_command"; then
4975 if test "$finalize" = yes && test -z "$run"; then
4977 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4978 tmpdir
="$tmpdir/libtool-$$"
4979 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4981 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4984 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4985 outputname
="$tmpdir/$file"
4986 # Replace the output file specification.
4987 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4989 $show "$relink_command"
4990 if $run eval "$relink_command"; then :
4992 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4998 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5001 # Install the binary that we compiled earlier.
5002 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5007 # remove .exe since cygwin /usr/bin/install will append another
5009 case $install_prog,$host in
5010 */usr
/bin
/install*,*cygwin
*)
5011 case $file:$destfile in
5016 destfile
=$destfile.exe
5019 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
5025 $show "$install_prog$stripme $file $destfile"
5026 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5027 test -n "$outputname" && ${rm}r
"$tmpdir"
5032 for file in $staticlibs; do
5033 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5035 # Set up the ranlib parameters.
5036 oldlib
="$destdir/$name"
5038 $show "$install_prog $file $oldlib"
5039 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5041 if test -n "$stripme" && test -n "$striplib"; then
5042 $show "$old_striplib $oldlib"
5043 $run eval "$old_striplib $oldlib" ||
exit $?
5046 # Do each command in the postinstall commands.
5047 eval cmds
=\"$old_postinstall_cmds\"
5048 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5049 for cmd
in $cmds; do
5052 $run eval "$cmd" ||
exit $?
5057 if test -n "$future_libdirs"; then
5058 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5061 if test -n "$current_libdirs"; then
5062 # Maybe just do a dry run.
5063 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5064 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5070 # libtool finish mode
5072 modename
="$modename: finish"
5076 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5079 libdirs
="$libdirs $dir"
5082 for libdir
in $libdirs; do
5083 if test -n "$finish_cmds"; then
5084 # Do each command in the finish commands.
5085 eval cmds
=\"$finish_cmds\"
5086 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5087 for cmd
in $cmds; do
5090 $run eval "$cmd" || admincmds
="$admincmds
5095 if test -n "$finish_eval"; then
5096 # Do the single finish_eval.
5097 eval cmds
=\"$finish_eval\"
5098 $run eval "$cmds" || admincmds
="$admincmds
5104 # Exit here if they wanted silent mode.
5105 test "$show" = ":" && exit 0
5107 echo "----------------------------------------------------------------------"
5108 echo "Libraries have been installed in:"
5109 for libdir
in $libdirs; do
5113 echo "If you ever happen to want to link against installed libraries"
5114 echo "in a given directory, LIBDIR, you must either use libtool, and"
5115 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5116 echo "flag during linking and do at least one of the following:"
5117 if test -n "$shlibpath_var"; then
5118 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5119 echo " during execution"
5121 if test -n "$runpath_var"; then
5122 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5123 echo " during linking"
5125 if test -n "$hardcode_libdir_flag_spec"; then
5127 eval flag
=\"$hardcode_libdir_flag_spec\"
5129 echo " - use the \`$flag' linker flag"
5131 if test -n "$admincmds"; then
5132 echo " - have your system administrator run these commands:$admincmds"
5134 if test -f /etc
/ld.so.conf
; then
5135 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5138 echo "See any operating system documentation about shared libraries for"
5139 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5140 echo "----------------------------------------------------------------------"
5144 # libtool execute mode
5146 modename
="$modename: execute"
5148 # The first argument is the command name.
5150 if test -z "$cmd"; then
5151 $echo "$modename: you must specify a COMMAND" 1>&2
5156 # Handle -dlopen flags immediately.
5157 for file in $execute_dlfiles; do
5158 if test ! -f "$file"; then
5159 $echo "$modename: \`$file' is not a file" 1>&2
5167 # Check to see that this really is a libtool archive.
5168 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5170 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5175 # Read the libtool library.
5179 # If there is no directory component, then add one.
5181 */* |
*\\*) .
$file ;;
5185 # Skip this library if it cannot be dlopened.
5186 if test -z "$dlname"; then
5187 # Warn if it was a shared library.
5188 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5192 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5193 test "X$dir" = "X$file" && dir
=.
5195 if test -f "$dir/$objdir/$dlname"; then
5198 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5204 # Just add the directory containing the .lo file.
5205 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5206 test "X$dir" = "X$file" && dir
=.
5210 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5215 # Get the absolute pathname.
5216 absdir
=`cd "$dir" && pwd`
5217 test -n "$absdir" && dir
="$absdir"
5219 # Now add the directory to shlibpath_var.
5220 if eval "test -z \"\$$shlibpath_var\""; then
5221 eval "$shlibpath_var=\"\$dir\""
5223 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5227 # This variable tells wrapper scripts just to set shlibpath_var
5228 # rather than running their programs.
5229 libtool_execute_magic
="$magic"
5231 # Check if any of the arguments is a wrapper script.
5238 # Do a test to see if this is really a libtool program.
5239 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5240 # If there is no directory component, then add one.
5242 */* |
*\\*) .
$file ;;
5246 # Transform arg to wrapped name.
5247 file="$progdir/$program"
5251 # Quote arguments (to preserve shell metacharacters).
5252 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5253 args
="$args \"$file\""
5256 if test -z "$run"; then
5257 if test -n "$shlibpath_var"; then
5258 # Export the shlibpath_var.
5259 eval "export $shlibpath_var"
5262 # Restore saved enviroment variables
5263 if test "${save_LC_ALL+set}" = set; then
5264 LC_ALL
="$save_LC_ALL"; export LC_ALL
5266 if test "${save_LANG+set}" = set; then
5267 LANG
="$save_LANG"; export LANG
5270 # Now prepare to actually exec the command.
5271 exec_cmd
='"$cmd"$args'
5273 # Display what would be done.
5274 if test -n "$shlibpath_var"; then
5275 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5276 $echo "export $shlibpath_var"
5283 # libtool clean and uninstall mode
5285 modename
="$modename: $mode"
5291 # This variable tells wrapper scripts just to set variables rather
5292 # than running their programs.
5293 libtool_install_magic
="$magic"
5298 -f) rm="$rm $arg"; rmforce
=yes ;;
5299 -*) rm="$rm $arg" ;;
5300 *) files
="$files $arg" ;;
5304 if test -z "$rm"; then
5305 $echo "$modename: you must specify an RM program" 1>&2
5312 for file in $files; do
5313 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5314 if test "X$dir" = "X$file"; then
5318 objdir
="$dir/$objdir"
5320 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5321 test $mode = uninstall
&& objdir
="$dir"
5323 # Remember objdir for removal later, being careful to avoid duplicates
5324 if test $mode = clean
; then
5327 *) rmdirs
="$rmdirs $objdir" ;;
5331 # Don't error if the file doesn't exist and rm -f was used.
5332 if (test -L "$file") >/dev
/null
2>&1 \
5333 ||
(test -h "$file") >/dev
/null
2>&1 \
5334 ||
test -f "$file"; then
5336 elif test -d "$file"; then
5339 elif test "$rmforce" = yes; then
5347 # Possibly a libtool archive, so verify it.
5348 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5351 # Delete the libtool libraries and symlinks.
5352 for n
in $library_names; do
5353 rmfiles
="$rmfiles $objdir/$n"
5355 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5356 test $mode = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5358 if test $mode = uninstall
; then
5359 if test -n "$library_names"; then
5360 # Do each command in the postuninstall commands.
5361 eval cmds
=\"$postuninstall_cmds\"
5362 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5363 for cmd
in $cmds; do
5367 if test $?
!= 0 && test "$rmforce" != yes; then
5374 if test -n "$old_library"; then
5375 # Do each command in the old_postuninstall commands.
5376 eval cmds
=\"$old_postuninstall_cmds\"
5377 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
5378 for cmd
in $cmds; do
5382 if test $?
!= 0 && test "$rmforce" != yes; then
5388 # FIXME: should reinstall the best remaining shared library.
5394 # Possibly a libtool object, so verify it.
5395 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5400 # Add PIC object to the list of files to remove.
5401 if test -n "$pic_object" \
5402 && test "$pic_object" != none
; then
5403 rmfiles
="$rmfiles $dir/$pic_object"
5406 # Add non-PIC object to the list of files to remove.
5407 if test -n "$non_pic_object" \
5408 && test "$non_pic_object" != none
; then
5409 rmfiles
="$rmfiles $dir/$non_pic_object"
5415 # Do a test to see if this is a libtool program.
5416 if test $mode = clean
&&
5417 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5421 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5422 if test "$fast_install" = yes && test -n "$relink_command"; then
5423 rmfiles
="$rmfiles $objdir/lt-$name"
5428 $show "$rm $rmfiles"
5429 $run $rm $rmfiles || exit_status
=1
5432 # Try to remove the ${objdir}s in the directories where we deleted files
5433 for dir
in $rmdirs; do
5434 if test -d "$dir"; then
5436 $run rmdir $dir >/dev
/null
2>&1
5444 $echo "$modename: you must specify a MODE" 1>&2
5445 $echo "$generic_help" 1>&2
5450 if test -z "$exec_cmd"; then
5451 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5452 $echo "$generic_help" 1>&2
5455 fi # test -z "$show_help"
5457 if test -n "$exec_cmd"; then
5462 # We need to display help for each of the modes.
5465 "Usage: $modename [OPTION]... [MODE-ARG]...
5467 Provide generalized library-building support services.
5469 --config show all configuration variables
5470 --debug enable verbose shell tracing
5471 -n, --dry-run display commands without modifying any files
5472 --features display basic configuration information and exit
5473 --finish same as \`--mode=finish'
5474 --help display this help message and exit
5475 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5476 --quiet same as \`--silent'
5477 --silent don't print informational messages
5478 --tag=TAG use configuration variables from tag TAG
5479 --version print version information
5481 MODE must be one of the following:
5483 clean remove files from the build directory
5484 compile compile a source file into a libtool object
5485 execute automatically set library path, then run a program
5486 finish complete the installation of libtool libraries
5487 install install libraries or executables
5488 link create a library or an executable
5489 uninstall remove libraries from an installed directory
5491 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5492 a more detailed description of MODE."
5498 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5500 Remove files from the build directory.
5502 RM is the name of the program to use to delete files associated with each FILE
5503 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5506 If FILE is a libtool library, object or program, all the files associated
5507 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5512 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5514 Compile a source file into a libtool library object.
5516 This mode accepts the following additional options:
5518 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5519 -prefer-pic try to building PIC objects only
5520 -prefer-non-pic try to building non-PIC objects only
5521 -static always build a \`.o' file suitable for static linking
5523 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5524 from the given SOURCEFILE.
5526 The output file name is determined by removing the directory component from
5527 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5528 library object suffix, \`.lo'."
5533 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5535 Automatically set library path, then run a program.
5537 This mode accepts the following additional options:
5539 -dlopen FILE add the directory containing FILE to the library path
5541 This mode sets the library path environment variable according to \`-dlopen'
5544 If any of the ARGS are libtool executable wrappers, then they are translated
5545 into their corresponding uninstalled binary, and any of their required library
5546 directories are added to the library path.
5548 Then, COMMAND is executed, with ARGS as arguments."
5553 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5555 Complete the installation of libtool libraries.
5557 Each LIBDIR is a directory that contains libtool libraries.
5559 The commands that this mode executes may require superuser privileges. Use
5560 the \`--dry-run' option if you just want to see what would be executed."
5565 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5567 Install executables or libraries.
5569 INSTALL-COMMAND is the installation command. The first component should be
5570 either the \`install' or \`cp' program.
5572 The rest of the components are interpreted as arguments to that command (only
5573 BSD-compatible install options are recognized)."
5578 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5580 Link object files or libraries together to form another library, or to
5581 create an executable program.
5583 LINK-COMMAND is a command using the C compiler that you would use to create
5584 a program from several object files.
5586 The following components of LINK-COMMAND are treated specially:
5588 -all-static do not do any dynamic linking at all
5589 -avoid-version do not add a version suffix if possible
5590 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5591 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5592 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5593 -export-symbols SYMFILE
5594 try to export only the symbols listed in SYMFILE
5595 -export-symbols-regex REGEX
5596 try to export only the symbols matching REGEX
5597 -LLIBDIR search LIBDIR for required installed libraries
5598 -lNAME OUTPUT-FILE requires the installed library libNAME
5599 -module build a library that can dlopened
5600 -no-fast-install disable the fast-install mode
5601 -no-install link a not-installable executable
5602 -no-undefined declare that a library does not refer to external symbols
5603 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5604 -objectlist FILE Use a list of object files found in FILE to specify objects
5605 -release RELEASE specify package release information
5606 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5607 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5608 -static do not do any dynamic linking of libtool libraries
5609 -version-info CURRENT[:REVISION[:AGE]]
5610 specify library version info [each variable defaults to 0]
5612 All other options (arguments beginning with \`-') are ignored.
5614 Every other argument is treated as a filename. Files ending in \`.la' are
5615 treated as uninstalled libtool libraries, other files are standard or library
5618 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5619 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5620 required, except when creating a convenience library.
5622 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5623 using \`ar' and \`ranlib', or on Windows using \`lib'.
5625 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5626 is created, otherwise an executable program is created."
5631 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5633 Remove libraries from an installation directory.
5635 RM is the name of the program to use to delete files associated with each FILE
5636 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5639 If FILE is a libtool library, all the files associated with it are deleted.
5640 Otherwise, only FILE itself is deleted using RM."
5644 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5651 $echo "Try \`$modename --help' for more information about other modes."
5655 # The TAGs below are defined such that we never get into a situation
5656 # in which we disable both kinds of libraries. Given conflicting
5657 # choices, we go for a static library, that is the most portable,
5658 # since we can't tell whether shared libraries were disabled because
5659 # the user asked for that or because the platform doesn't support
5660 # them. This is particularly important on AIX, because we don't
5661 # support having both static and shared libraries enabled at the same
5662 # time on that platform, so we default to a shared-only configuration.
5663 # If a disable-shared tag is given, we'll fallback to a static-only
5664 # configuration. But we'll never go from static-only to shared-only.
5666 ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5667 build_libtool_libs
=no
5669 ### END LIBTOOL TAG CONFIG: disable-shared
5671 ### BEGIN LIBTOOL TAG CONFIG: disable-static
5672 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5673 ### END LIBTOOL TAG CONFIG: disable-static