1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec
; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
42 if test "X$1" = X--fallback-echo
; then
43 # used as fallback echo
51 # The name of this program.
52 progname
=`$echo "$0" | sed 's%^.*/%%'`
59 TIMESTAMP
=" (1.1087 2002/01/11 00:25:18)"
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 # Make sure IFS has a sensible default
90 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
91 echo "$modename: not configured to build any kind of library" 1>&2
92 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
105 lo2o
="s/\\.lo\$/.${objext}/"
106 o2lo
="s/\\.${objext}\$/.lo/"
108 # Parse our command line options once, thoroughly.
109 while test "$#" -gt 0
115 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
119 # If the previous option needs an argument, assign it.
120 if test -n "$prev"; then
123 execute_dlfiles
="$execute_dlfiles $arg"
128 # Check whether tagname contains only valid characters
131 echo "$progname: invalid tag name: $tagname" 1>&2
138 # Don't test for the "default" C tag, as we know, it's there, but
139 # not specially marked.
142 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
143 taglist
="$taglist $tagname"
144 # Evaluate the configuration.
145 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
147 echo "$progname: ignoring unknown tag $tagname" 1>&2
162 # Have we seen a non-optional argument yet?
169 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
171 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
172 echo "Free Software Foundation, Inc."
173 echo "This is free software; see the source for copying conditions. There is NO"
174 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
179 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $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" ;;
216 --preserve-dup-deps) duplicate_deps
="yes" ;;
222 --tag) prevopt
="--tag" prev
=tag
;;
224 set tag
"$optarg" ${1+"$@"}
235 $echo "$modename: unrecognized option \`$arg'" 1>&2
247 if test -n "$prevopt"; then
248 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
253 # If this variable is set in any of the actions, the command in it
254 # will be execed at the end. This prevents here-documents from being
255 # left over by shells.
258 if test -z "$show_help"; then
260 # Infer the operation mode.
261 if test -z "$mode"; then
263 *cc |
*++ | gcc
* |
*-gcc*)
275 *db |
*dbx |
*strace |
*truss
)
285 # If we have no mode, but dlfiles were specified, then do execute mode.
286 test -n "$execute_dlfiles" && mode
=execute
288 # Just use the default operation mode.
289 if test -z "$mode"; then
290 if test -n "$nonopt"; then
291 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
293 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
300 # Only execute mode is allowed to have -dlopen flags.
301 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
302 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
307 # Change the help message to a mode-specific one.
309 help="Try \`$modename --help --mode=$mode' for more information."
311 # These modes are in order of execution frequency so that they run quickly.
313 # libtool compile mode
315 modename
="$modename: compile"
316 # Get the compilation command and the source file.
329 # Aesthetically quote the previous argument.
331 lastarg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
334 # Double-quote args containing other shell metacharacters.
335 # Many Bourne shells cannot handle close brackets correctly
336 # in scan sets, so we specify it separately.
337 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
342 # Add the previous argument to base_compile.
343 if test -z "$base_compile"; then
344 base_compile
="$lastarg"
346 base_compile
="$base_compile $lastarg"
352 # Accept any command-line options.
355 if test "$user_target" != "no"; then
356 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
383 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
385 save_ifs
="$IFS"; IFS
=','
389 # Double-quote args containing other shell metacharacters.
390 # Many Bourne shells cannot handle close brackets correctly
391 # in scan sets, so we specify it separately.
393 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
397 lastarg
="$lastarg $arg"
400 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
402 # Add the arguments to base_compile.
403 if test -z "$base_compile"; then
404 base_compile
="$lastarg"
406 base_compile
="$base_compile $lastarg"
414 # The next one is the -o target name
419 # We got the output file
426 # Accept the current argument as the source file.
430 # Aesthetically quote the previous argument.
432 # Backslashify any backslashes, double quotes, and dollar signs.
433 # These are the only characters that are still specially
434 # interpreted inside of double-quoted scrings.
435 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
437 # Double-quote args containing other shell metacharacters.
438 # Many Bourne shells cannot handle close brackets correctly
439 # in scan sets, so we specify it separately.
441 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
442 lastarg
="\"$lastarg\""
446 # Add the previous argument to base_compile.
447 if test -z "$base_compile"; then
448 base_compile
="$lastarg"
450 base_compile
="$base_compile $lastarg"
458 # Get the name of the library object.
459 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
462 $echo "$modename: you must specify a target with \`-o'" 1>&2
467 # Recognize several different file suffixes.
468 # If the user specifies -o file.o, it is replaced with file.lo
478 *.class
) xform
=class
;;
483 *.java
) xform
=java
;;
486 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
489 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
491 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
496 # Infer tagged configuration to use if any are available and
497 # if one wasn't chosen via the "--tag" command line option.
498 # Only attempt this if the compiler in the base compile
499 # command doesn't match the default compiler.
500 if test -n "$available_tags" && test -z "$tagname"; then
501 case "$base_compile " in
503 # Blanks in the command may have been stripped by the calling shell,
504 # but not from the CC environment variable when ltconfig was run.
507 for z
in $available_tags; do
508 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
509 # Evaluate the configuration.
510 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
511 case "$base_compile " in
513 # The compiler in the base compile command matches
514 # the one in the tagged configuration.
515 # Assume this is the tagged configuration we want.
526 # If $tagname still isn't set, then no tagged configuration
527 # was found and let the user know that the "--tag" command
528 # line option must be used.
529 if test -z "$tagname"; then
530 echo "$modename: unable to infer tagged configuration"
531 echo "$modename: specify a tag with \`--tag'" 1>&2
534 # echo "$modename: using $tagname tagged configuration"
540 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
541 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
542 if test "X$xdir" = "X$obj"; then
547 lobj
=${xdir}$objdir/$objname
549 if test -z "$base_compile"; then
550 $echo "$modename: you must specify a compilation command" 1>&2
555 # Delete any leftover library objects.
556 if test "$build_old_libs" = yes; then
557 removelist
="$obj $lobj $libobj ${libobj}T"
559 removelist
="$lobj $libobj ${libobj}T"
563 trap "$run $rm $removelist; exit 1" 1 2 15
565 # On Cygwin there's no "real" PIC flag so we must build both object types
567 cygwin
* | mingw
* | pw32
* | os2
*)
571 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
572 # non-PIC code in shared libraries is not supported
576 # Calculate the filename of the output object if compiler does
577 # not support -o with -c
578 if test "$compiler_c_o" = no
; then
579 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
580 lockfile
="$output_obj.lock"
581 removelist
="$removelist $output_obj $lockfile"
582 trap "$run $rm $removelist; exit 1" 1 2 15
589 # Lock this critical section if it is needed
590 # We use this script file to make the link, it avoids creating a new file
591 if test "$need_locks" = yes; then
592 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
593 $show "Waiting for $lockfile to be removed"
596 elif test "$need_locks" = warn
; then
597 if test -f "$lockfile"; then
599 *** ERROR, $lockfile exists and contains:
600 `cat $lockfile 2>/dev/null`
602 This indicates that another process is trying to use the same
603 temporary object file, and libtool could not work around it because
604 your compiler does not support \`-c' and \`-o' together. If you
605 repeat this compilation, it may succeed, by chance, but you had better
606 avoid parallel builds (make -j) in this platform, or get a better
612 echo $srcfile > "$lockfile"
615 if test -n "$fix_srcfile_path"; then
616 eval srcfile
=\"$fix_srcfile_path\"
619 $run $rm "$libobj" "${libobj}T"
621 # Create a libtool object file (analogous to a ".la" file),
622 # but don't create it if we're doing a dry run.
623 test -z "$run" && cat > ${libobj}T
<<EOF
624 # $libobj - a libtool object file
625 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
627 # Please DO NOT delete this file!
628 # It is necessary for linking the library.
630 # Name of the PIC object.
633 # Only build a PIC object if we are building libtool libraries.
634 if test "$build_libtool_libs" = yes; then
635 # Without this assignment, base_compile gets emptied.
636 fbsd_hideous_sh_bug
=$base_compile
638 if test "$pic_mode" != no
; then
639 command="$base_compile $srcfile $pic_flag"
641 # Don't build PIC code
642 command="$base_compile $srcfile"
645 if test ! -d "${xdir}$objdir"; then
646 $show "$mkdir ${xdir}$objdir"
647 $run $mkdir ${xdir}$objdir
649 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
654 if test -z "$output_obj"; then
655 # Place PIC objects in $objdir
656 command="$command -o $lobj"
659 $run $rm "$lobj" "$output_obj"
662 if $run eval "$command"; then :
664 test -n "$output_obj" && $run $rm $removelist
668 if test "$need_locks" = warn
&&
669 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
671 *** ERROR, $lockfile contains:
672 `cat $lockfile 2>/dev/null`
674 but it should contain:
677 This indicates that another process is trying to use the same
678 temporary object file, and libtool could not work around it because
679 your compiler does not support \`-c' and \`-o' together. If you
680 repeat this compilation, it may succeed, by chance, but you had better
681 avoid parallel builds (make -j) in this platform, or get a better
688 # Just move the object if needed, then go on to compile the next one
689 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
690 $show "$mv $output_obj $lobj"
691 if $run $mv $output_obj $lobj; then :
699 # Append the name of the PIC object to the libtool object file.
700 test -z "$run" && cat >> ${libobj}T
<<EOF
701 pic_object='$objdir/$objname'
705 # Allow error messages only from the first compilation.
706 suppress_output
=' >/dev/null 2>&1'
708 # No PIC object so indicate it doesn't exist in the libtool
710 test -z "$run" && cat >> ${libobj}T
<<EOF
716 # Only build a position-dependent object if we build old libraries.
717 if test "$build_old_libs" = yes; then
718 if test "$pic_mode" != yes; then
719 # Don't build PIC code
720 command="$base_compile $srcfile"
722 command="$base_compile $srcfile $pic_flag"
724 if test "$compiler_c_o" = yes; then
725 command="$command -o $obj"
728 # Suppress compiler output if we already did a PIC compilation.
729 command="$command$suppress_output"
730 $run $rm "$obj" "$output_obj"
732 if $run eval "$command"; then :
738 if test "$need_locks" = warn
&&
739 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
741 *** ERROR, $lockfile contains:
742 `cat $lockfile 2>/dev/null`
744 but it should contain:
747 This indicates that another process is trying to use the same
748 temporary object file, and libtool could not work around it because
749 your compiler does not support \`-c' and \`-o' together. If you
750 repeat this compilation, it may succeed, by chance, but you had better
751 avoid parallel builds (make -j) in this platform, or get a better
758 # Just move the object if needed
759 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
760 $show "$mv $output_obj $obj"
761 if $run $mv $output_obj $obj; then :
769 # Append the name of the non-PIC object the libtool object file.
770 # Only append if the libtool object file exists.
771 test -z "$run" && cat >> ${libobj}T
<<EOF
772 # Name of the non-PIC object.
773 non_pic_object='$objname'
777 # Append the name of the non-PIC object the libtool object file.
778 # Only append if the libtool object file exists.
779 test -z "$run" && cat >> ${libobj}T
<<EOF
780 # Name of the non-PIC object.
786 $run $mv "${libobj}T" "${libobj}"
788 # Unlock the critical section if it was locked
789 if test "$need_locks" != no
; then
798 modename
="$modename: link"
800 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
801 # It is impossible to link a dll without this setting, and
802 # we shouldn't force the makefile maintainer to figure out
803 # which system we are compiling for in order to pass an extra
804 # flag for every libtool invokation.
807 # FIXME: Unfortunately, there are problems with the above when trying
808 # to make a dll which has undefined symbols, in which case not
809 # even a static library is built. For now, we need to specify
810 # -no-undefined on the libtool link line when we can be certain
811 # that all symbols are satisfied, otherwise we get a static library.
818 libtool_args
="$nonopt"
819 base_compile
="$nonopt"
820 compile_command
="$nonopt"
821 finalize_command
="$nonopt"
834 lib_search_path
=`pwd`
842 export_symbols_regex
=
850 prefer_static_libs
=no
862 # We need to know -static, to get the right output filenames.
866 -all-static |
-static)
867 if test "X$arg" = "X-all-static"; then
868 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
869 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
871 if test -n "$link_static_flag"; then
872 dlopen_self
=$dlopen_self_static
875 if test -z "$pic_flag" && test -n "$link_static_flag"; then
876 dlopen_self
=$dlopen_self_static
879 build_libtool_libs
=no
881 prefer_static_libs
=yes
887 # See if our shared archives depend on static archives.
888 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
890 # Go through the arguments, transforming them on the way.
891 while test "$#" -gt 0; do
893 base_compile
="$base_compile $arg"
896 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
897 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
901 libtool_args
="$libtool_args $qarg"
903 # If the previous option needs an argument, assign it.
904 if test -n "$prev"; then
907 compile_command
="$compile_command @OUTPUT@"
908 finalize_command
="$finalize_command @OUTPUT@"
914 if test "$preload" = no
; then
915 # Add the symbol object into the linking commands.
916 compile_command
="$compile_command @SYMFILE@"
917 finalize_command
="$finalize_command @SYMFILE@"
921 *.la |
*.lo
) ;; # We handle these cases below.
923 if test "$dlself" = no
; then
931 if test "$prev" = dlprefiles
; then
933 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
943 if test "$prev" = dlfiles
; then
944 dlfiles
="$dlfiles $arg"
946 dlprefiles
="$dlprefiles $arg"
954 export_symbols
="$arg"
955 if test ! -f "$arg"; then
956 $echo "$modename: symbol file \`$arg' does not exist"
963 export_symbols_regex
="$arg"
973 if test -f "$arg"; then
976 for fil
in `cat $save_arg`
978 # moreargs="$moreargs $fil"
980 # A libtool-controlled object.
982 # Check to see that this really is a libtool object.
983 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
988 # If there is no directory component, then add one.
990 */* |
*\\*) .
$arg ;;
994 if test -z "$pic_object" || \
995 test -z "$non_pic_object" ||
996 test "$pic_object" = none
&& \
997 test "$non_pic_object" = none
; then
998 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1002 # Extract subdirectory from the argument.
1003 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1004 if test "X$xdir" = "X$arg"; then
1010 if test "$pic_object" != none
; then
1011 # Prepend the subdirectory the object is found in.
1012 pic_object
="$xdir$pic_object"
1014 if test "$prev" = dlfiles
; then
1015 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1016 dlfiles
="$dlfiles $pic_object"
1020 # If libtool objects are unsupported, then we need to preload.
1025 # CHECK ME: I think I busted this. -Ossama
1026 if test "$prev" = dlprefiles
; then
1027 # Preload the old-style object.
1028 dlprefiles
="$dlprefiles $pic_object"
1033 libobjs
="$libobjs $pic_object"
1038 if test "$non_pic_object" != none
; then
1039 # Prepend the subdirectory the object is found in.
1040 non_pic_object
="$xdir$non_pic_object"
1042 # A standard non-PIC object
1043 non_pic_objects
="$non_pic_objects $non_pic_object"
1044 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1045 arg
="$non_pic_object"
1049 # Only an error if not doing a dry-run.
1050 if test -z "$run"; then
1051 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1056 # Extract subdirectory from the argument.
1057 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1058 if test "X$xdir" = "X$arg"; then
1064 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1065 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1066 libobjs
="$libobjs $pic_object"
1067 non_pic_objects
="$non_pic_objects $non_pic_object"
1072 $echo "$modename: link input file \`$save_arg' does not exist"
1080 # We need an absolute path.
1082 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1084 $echo "$modename: only absolute run-paths are allowed" 1>&2
1088 if test "$prev" = rpath
; then
1091 *) rpath
="$rpath $arg" ;;
1096 *) xrpath
="$xrpath $arg" ;;
1103 compiler_flags
="$compiler_flags $qarg"
1105 compile_command
="$compile_command $qarg"
1106 finalize_command
="$finalize_command $qarg"
1110 linker_flags
="$linker_flags $qarg"
1111 compiler_flags
="$compiler_flags $wl$qarg"
1113 compile_command
="$compile_command $wl$qarg"
1114 finalize_command
="$finalize_command $wl$qarg"
1118 eval "$prev=\"\$arg\""
1123 fi # test -n "$prev"
1129 if test -n "$link_static_flag"; then
1130 compile_command
="$compile_command $link_static_flag"
1131 finalize_command
="$finalize_command $link_static_flag"
1137 # FIXME: remove this flag sometime in the future.
1138 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1162 -export-symbols |
-export-symbols-regex)
1163 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1164 $echo "$modename: more than one -exported-symbols argument is not allowed"
1167 if test "X$arg" = "X-export-symbols"; then
1175 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1176 # so, if we see these flags be careful not to treat them like -L
1178 case $with_gcc/$host in
1179 no
/*-*-irix* |
/*-*-irix*)
1180 compile_command
="$compile_command $arg"
1181 finalize_command
="$finalize_command $arg"
1188 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1189 # We need an absolute path.
1191 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1193 absdir
=`cd "$dir" && pwd`
1194 if test -z "$absdir"; then
1195 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1204 deplibs
="$deplibs -L$dir"
1205 lib_search_path
="$lib_search_path $dir"
1209 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1210 case :$dllsearchpath: in
1212 *) dllsearchpath
="$dllsearchpath:$dir";;
1220 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1222 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1223 # These systems don't actually have a C or math library (as such)
1226 *-*-mingw* |
*-*-os2*)
1227 # These systems don't actually have a C library (as such)
1228 test "X$arg" = "X-lc" && continue
1230 *-*-openbsd* |
*-*-freebsd*)
1231 # Do not include libc due to us having libc/libc_r.
1232 test "X$arg" = "X-lc" && continue
1234 *-*-rhapsody* |
*-*-darwin1.
[012])
1235 # Rhapsody C and math libraries are in the System framework
1236 deplibs
="$deplibs -framework System"
1239 elif test "X$arg" = "X-lc_r"; then
1241 *-*-openbsd* |
*-*-freebsd*)
1242 # Do not include libc_r directly, use -pthread flag.
1247 deplibs
="$deplibs $arg"
1263 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1264 # The PATH hackery in wrapper scripts is required on Windows
1265 # in order for the loader to find any dlls it needs.
1266 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1267 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1270 *) no_install
=yes ;;
1303 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1304 # We need an absolute path.
1306 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1308 $echo "$modename: only absolute run-paths are allowed" 1>&2
1314 *) xrpath
="$xrpath $dir" ;;
1320 # The effects of -static are defined in a previous loop.
1321 # We used to do the same as -all-static on platforms that
1322 # didn't have a PIC flag, but the assumption that the effects
1323 # would be equivalent was wrong. It would break on at least
1324 # Digital Unix and AIX.
1339 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1341 save_ifs
="$IFS"; IFS
=','
1342 for flag
in $args; do
1345 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1350 compiler_flags
="$compiler_flags $flag"
1353 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1357 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1359 save_ifs
="$IFS"; IFS
=','
1360 for flag
in $args; do
1363 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1368 compiler_flags
="$compiler_flags $wl$flag"
1369 linker_flags
="$linker_flags $flag"
1372 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1385 # Some other compiler flag.
1387 # Unknown arguments in both finalize_command and compile_command need
1388 # to be aesthetically quoted because they are evaled later.
1389 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1391 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1398 # A standard object.
1403 # A libtool-controlled object.
1405 # Check to see that this really is a libtool object.
1406 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1411 # If there is no directory component, then add one.
1413 */* |
*\\*) .
$arg ;;
1417 if test -z "$pic_object" || \
1418 test -z "$non_pic_object" ||
1419 test "$pic_object" = none
&& \
1420 test "$non_pic_object" = none
; then
1421 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1425 # Extract subdirectory from the argument.
1426 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1427 if test "X$xdir" = "X$arg"; then
1433 if test "$pic_object" != none
; then
1434 # Prepend the subdirectory the object is found in.
1435 pic_object
="$xdir$pic_object"
1437 if test "$prev" = dlfiles
; then
1438 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1439 dlfiles
="$dlfiles $pic_object"
1443 # If libtool objects are unsupported, then we need to preload.
1448 # CHECK ME: I think I busted this. -Ossama
1449 if test "$prev" = dlprefiles
; then
1450 # Preload the old-style object.
1451 dlprefiles
="$dlprefiles $pic_object"
1456 libobjs
="$libobjs $pic_object"
1461 if test "$non_pic_object" != none
; then
1462 # Prepend the subdirectory the object is found in.
1463 non_pic_object
="$xdir$non_pic_object"
1465 # A standard non-PIC object
1466 non_pic_objects
="$non_pic_objects $non_pic_object"
1467 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1468 arg
="$non_pic_object"
1472 # Only an error if not doing a dry-run.
1473 if test -z "$run"; then
1474 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1479 # Extract subdirectory from the argument.
1480 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1481 if test "X$xdir" = "X$arg"; then
1487 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1488 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1489 libobjs
="$libobjs $pic_object"
1490 non_pic_objects
="$non_pic_objects $non_pic_object"
1497 deplibs
="$deplibs $arg"
1498 old_deplibs
="$old_deplibs $arg"
1503 # A libtool-controlled library.
1505 if test "$prev" = dlfiles
; then
1506 # This library was specified with -dlopen.
1507 dlfiles
="$dlfiles $arg"
1509 elif test "$prev" = dlprefiles
; then
1510 # The library was specified with -dlpreopen.
1511 dlprefiles
="$dlprefiles $arg"
1514 deplibs
="$deplibs $arg"
1519 # Some other compiler argument.
1521 # Unknown arguments in both finalize_command and compile_command need
1522 # to be aesthetically quoted because they are evaled later.
1523 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1525 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1532 # Now actually substitute the argument into the commands.
1533 if test -n "$arg"; then
1534 compile_command
="$compile_command $arg"
1535 finalize_command
="$finalize_command $arg"
1537 done # argument parsing loop
1539 if test -n "$prev"; then
1540 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1545 # Infer tagged configuration to use if any are available and
1546 # if one wasn't chosen via the "--tag" command line option.
1547 # Only attempt this if the compiler in the base link
1548 # command doesn't match the default compiler.
1549 if test -n "$available_tags" && test -z "$tagname"; then
1550 case $base_compile in
1552 # Blanks in the command may have been stripped by the calling shell,
1553 # but not from the CC environment variable when ltconfig was run.
1556 for z
in $available_tags; do
1557 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1558 # Evaluate the configuration.
1559 eval "`sed -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1560 case $base_compile in
1562 # The compiler in $compile_command matches
1563 # the one in the tagged configuration.
1564 # Assume this is the tagged configuration we want.
1575 # If $tagname still isn't set, then no tagged configuration
1576 # was found and let the user know that the "--tag" command
1577 # line option must be used.
1578 if test -z "$tagname"; then
1579 echo "$modename: unable to infer tagged configuration"
1580 echo "$modename: specify a tag with \`--tag'" 1>&2
1583 # echo "$modename: using $tagname tagged configuration"
1589 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1590 eval arg
=\"$export_dynamic_flag_spec\"
1591 compile_command
="$compile_command $arg"
1592 finalize_command
="$finalize_command $arg"
1596 # calculate the name of the file, without its directory
1597 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1598 libobjs_save
="$libobjs"
1600 if test -n "$shlibpath_var"; then
1601 # get the directories listed in $shlibpath_var
1602 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1606 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1607 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1609 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1610 if test "X$output_objdir" = "X$output"; then
1611 output_objdir
="$objdir"
1613 output_objdir
="$output_objdir/$objdir"
1615 # Create the object directory.
1616 if test ! -d "$output_objdir"; then
1617 $show "$mkdir $output_objdir"
1618 $run $mkdir $output_objdir
1620 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1625 # Determine the type of output
1628 $echo "$modename: you must specify an output file" 1>&2
1632 *.
$libext) linkmode
=oldlib
;;
1633 *.lo |
*.
$objext) linkmode
=obj
;;
1634 *.la
) linkmode
=lib
;;
1635 *) linkmode
=prog
;; # Anything else should be a program.
1640 # Find all interdependent deplibs by searching for libraries
1641 # that are linked more than once (e.g. -la -lb -la)
1642 for deplib
in $deplibs; do
1643 if test "X$duplicate_deps" = "Xyes" ; then
1645 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1648 libs
="$libs $deplib"
1651 if test "$linkmode" = lib
; then
1652 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1654 # Compute libraries that are listed more than once in $predeps
1655 # $postdeps and mark them as special (i.e., whose duplicates are
1656 # not to be eliminated).
1658 if test "X$duplicate_deps" = "Xyes" ; then
1659 for pre_post_dep
in $predeps $postdeps; do
1660 case "$pre_post_deps " in
1661 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1663 pre_post_deps
="$pre_post_deps $pre_post_dep"
1672 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1673 notinst_deplibs
= # not-installed libtool libraries
1674 notinst_path
= # paths that contain not-installed libtool libraries
1678 for file in $dlfiles $dlprefiles; do
1682 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1694 passes
="conv scan dlopen dlpreopen link"
1699 for pass
in $passes; do
1700 if test "$linkmode,$pass" = "lib,link" ||
1701 test "$linkmode,$pass" = "prog,scan"; then
1705 if test "$linkmode" = prog
; then
1707 dlopen
) libs
="$dlfiles" ;;
1708 dlpreopen
) libs
="$dlprefiles" ;;
1709 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1712 if test "$pass" = dlopen
; then
1713 # Collect dlpreopened libraries
1714 save_deplibs
="$deplibs"
1717 for deplib
in $libs; do
1722 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1723 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1726 if test "$pass" = conv
; then
1727 deplibs
="$deplib $deplibs"
1730 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1731 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1732 # Search the libtool library
1733 lib
="$searchdir/lib${name}.la"
1734 if test -f "$lib"; then
1739 if test "$found" != yes; then
1740 # deplib doesn't seem to be a libtool library
1741 if test "$linkmode,$pass" = "prog,link"; then
1742 compile_deplibs
="$deplib $compile_deplibs"
1743 finalize_deplibs
="$deplib $finalize_deplibs"
1745 deplibs
="$deplib $deplibs"
1746 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1754 deplibs
="$deplib $deplibs"
1755 test "$pass" = conv
&& continue
1756 newdependency_libs
="$deplib $newdependency_libs"
1757 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1760 if test "$pass" = conv
; then
1761 deplibs
="$deplib $deplibs"
1764 if test "$pass" = scan
; then
1765 deplibs
="$deplib $deplibs"
1766 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1768 compile_deplibs
="$deplib $compile_deplibs"
1769 finalize_deplibs
="$deplib $finalize_deplibs"
1773 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1779 if test "$pass" = link
; then
1780 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1781 # Make sure the xrpath contains only unique directories.
1784 *) xrpath
="$xrpath $dir" ;;
1787 deplibs
="$deplib $deplibs"
1790 *.la
) lib
="$deplib" ;;
1792 if test "$pass" = conv
; then
1793 deplibs
="$deplib $deplibs"
1798 if test "$deplibs_check_method" != pass_all
; then
1800 echo "*** Warning: Trying to link with static lib archive $deplib."
1801 echo "*** I have the capability to make that library automatically link in when"
1802 echo "*** you link to this library. But I can only do this if you have a"
1803 echo "*** shared version of the library, which you do not appear to have"
1804 echo "*** because the file extensions .$libext of this argument makes me believe"
1805 echo "*** that it is just a static archive that I should not used here."
1808 echo "*** Warning: Linking the shared library $output against the"
1809 echo "*** static library $deplib is not portable!"
1810 deplibs
="$deplib $deplibs"
1815 if test "$pass" != link
; then
1816 deplibs
="$deplib $deplibs"
1818 compile_deplibs
="$deplib $compile_deplibs"
1819 finalize_deplibs
="$deplib $finalize_deplibs"
1826 if test "$pass" = conv
; then
1827 deplibs
="$deplib $deplibs"
1828 elif test "$linkmode" = prog
; then
1829 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1830 # If there is no dlopen support or we're linking statically,
1831 # we need to preload.
1832 newdlprefiles
="$newdlprefiles $deplib"
1833 compile_deplibs
="$deplib $compile_deplibs"
1834 finalize_deplibs
="$deplib $finalize_deplibs"
1836 newdlfiles
="$newdlfiles $deplib"
1846 if test "$found" = yes ||
test -f "$lib"; then :
1848 $echo "$modename: cannot find the library \`$lib'" 1>&2
1852 # Check to see that this really is a libtool archive.
1853 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1855 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1859 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1860 test "X$ladir" = "X$lib" && ladir
="."
1868 # If the library was installed with an old release of libtool,
1869 # it will not redefine variable installed.
1874 */* |
*\\*) .
$lib ;;
1878 if test "$linkmode,$pass" = "lib,link" ||
1879 test "$linkmode,$pass" = "prog,scan" ||
1880 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
1881 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
1882 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
1885 if test "$pass" = conv
; then
1886 # Only check for convenience libraries
1887 deplibs
="$lib $deplibs"
1888 if test -z "$libdir"; then
1889 if test -z "$old_library"; then
1890 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1893 # It is a libtool convenience library, so add in its objects.
1894 convenience
="$convenience $ladir/$objdir/$old_library"
1895 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1897 for deplib
in $dependency_libs; do
1898 deplibs
="$deplib $deplibs"
1899 if test "X$duplicate_deps" = "Xyes" ; then
1900 case "$tmp_libs " in
1901 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1904 tmp_libs
="$tmp_libs $deplib"
1906 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
1907 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1913 # Get the name of the library we link against.
1915 for l
in $old_library $library_names; do
1918 if test -z "$linklib"; then
1919 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1923 # This library was specified with -dlopen.
1924 if test "$pass" = dlopen
; then
1925 if test -z "$libdir"; then
1926 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1929 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
1930 # If there is no dlname, no dlopen support or we're linking
1931 # statically, we need to preload. We also need to preload any
1932 # dependent libraries so libltdl's deplib preloader doesn't
1933 # bomb out in the load deplibs phase.
1934 dlprefiles
="$dlprefiles $lib $dependency_libs"
1936 newdlfiles
="$newdlfiles $lib"
1941 # We need an absolute path.
1943 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1945 abs_ladir
=`cd "$ladir" && pwd`
1946 if test -z "$abs_ladir"; then
1947 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1948 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1953 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1955 # Find the relevant object directory and library name.
1956 if test "X$installed" = Xyes
; then
1957 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1958 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1967 dir
="$ladir/$objdir"
1968 absdir
="$abs_ladir/$objdir"
1969 # Remove this search path later
1970 notinst_path
="$notinst_path $abs_ladir"
1971 fi # $installed = yes
1972 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1974 # This library was specified with -dlpreopen.
1975 if test "$pass" = dlpreopen
; then
1976 if test -z "$libdir"; then
1977 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1980 # Prefer using a static library (so that no silly _DYNAMIC symbols
1981 # are required to link).
1982 if test -n "$old_library"; then
1983 newdlprefiles
="$newdlprefiles $dir/$old_library"
1984 # Otherwise, use the dlname, so that lt_dlopen finds it.
1985 elif test -n "$dlname"; then
1986 newdlprefiles
="$newdlprefiles $dir/$dlname"
1988 newdlprefiles
="$newdlprefiles $dir/$linklib"
1990 fi # $pass = dlpreopen
1992 if test -z "$libdir"; then
1993 # Link the convenience library
1994 if test "$linkmode" = lib
; then
1995 deplibs
="$dir/$old_library $deplibs"
1996 elif test "$linkmode,$pass" = "prog,link"; then
1997 compile_deplibs
="$dir/$old_library $compile_deplibs"
1998 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2000 deplibs
="$lib $deplibs" # used for prog,scan pass
2005 if test "$linkmode" = prog
&& test "$pass" != link
; then
2006 newlib_search_path
="$newlib_search_path $ladir"
2007 deplibs
="$lib $deplibs"
2010 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2011 test "$build_libtool_libs" = no
; then
2016 for deplib
in $dependency_libs; do
2018 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2020 # Need to link against all dependency_libs?
2021 if test "$linkalldeplibs" = yes; then
2022 deplibs
="$deplib $deplibs"
2024 # Need to hardcode shared library paths
2025 # or/and link against static libraries
2026 newdependency_libs
="$deplib $newdependency_libs"
2028 if test "X$duplicate_deps" = "Xyes" ; then
2029 case "$tmp_libs " in
2030 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2033 tmp_libs
="$tmp_libs $deplib"
2036 fi # $linkmode = prog...
2038 if test "$linkmode,$pass" = "prog,link"; then
2039 if test -n "$library_names" &&
2040 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2041 # We need to hardcode the library path
2042 if test -n "$shlibpath_var"; then
2043 # Make sure the rpath contains only unique directories.
2044 case "$temp_rpath " in
2047 *) temp_rpath
="$temp_rpath $dir" ;;
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 fi # $linkmode,$pass = prog,link...
2074 if test "$alldeplibs" = yes &&
2075 { test "$deplibs_check_method" = pass_all ||
2076 { test "$build_libtool_libs" = yes &&
2077 test -n "$library_names"; }; }; then
2078 # We only need to search for static libraries
2083 link_static
=no
# Whether the deplib will be linked statically
2084 if test -n "$library_names" &&
2085 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2086 if test "$installed" = no
; then
2087 notinst_deplibs
="$notinst_deplibs $lib"
2090 # This is a shared library
2091 if test "$linkmode" = lib
&&
2092 test "$hardcode_into_libs" = yes; then
2093 # Hardcode the library path.
2094 # Skip directories that are in the system default run-time
2096 case " $sys_lib_dlsearch_path " in
2099 case "$compile_rpath " in
2101 *) compile_rpath
="$compile_rpath $absdir"
2105 case " $sys_lib_dlsearch_path " in
2108 case "$finalize_rpath " in
2110 *) finalize_rpath
="$finalize_rpath $libdir"
2116 if test -n "$old_archive_from_expsyms_cmds"; then
2117 # figure out the soname
2118 set dummy
$library_names
2121 libname
=`eval \\$echo \"$libname_spec\"`
2122 # use dlname if we got it. it's perfectly good, no?
2123 if test -n "$dlname"; then
2125 elif test -n "$soname_spec"; then
2129 major
=`expr $current - $age`
2133 eval soname
=\"$soname_spec\"
2138 # Make a new name for the extract_expsyms_cmds to use
2140 soname
=`echo $soroot | sed -e 's/^.*\///'`
2141 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2143 # If the library has no export list, then create one now
2144 if test -f "$output_objdir/$soname-def"; then :
2146 $show "extracting exported symbol list from \`$soname'"
2147 save_ifs
="$IFS"; IFS
='~'
2148 eval cmds
=\"$extract_expsyms_cmds\"
2149 for cmd
in $cmds; do
2152 $run eval "$cmd" ||
exit $?
2158 if test -f "$output_objdir/$newlib"; then :; else
2159 $show "generating import library for \`$soname'"
2160 save_ifs
="$IFS"; IFS
='~'
2161 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2162 for cmd
in $cmds; do
2165 $run eval "$cmd" ||
exit $?
2169 # make sure the library variables are pointing to the new library
2172 fi # test -n "$old_archive_from_expsyms_cmds"
2174 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2179 case $hardcode_action in
2180 immediate | unsupported
)
2181 if test "$hardcode_direct" = no
; then
2183 elif test "$hardcode_minus_L" = no
; then
2185 *-*-sunos*) add_shlibpath
="$dir" ;;
2189 elif test "$hardcode_shlibpath_var" = no
; then
2190 add_shlibpath
="$dir"
2197 if test "$hardcode_direct" = yes; then
2199 elif test "$hardcode_minus_L" = yes; then
2202 elif test "$hardcode_shlibpath_var" = yes; then
2203 add_shlibpath
="$dir"
2212 if test "$lib_linked" != yes; then
2213 $echo "$modename: configuration error: unsupported hardcode properties"
2217 if test -n "$add_shlibpath"; then
2218 case :$compile_shlibpath: in
2219 *":$add_shlibpath:"*) ;;
2220 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2223 if test "$linkmode" = prog
; then
2224 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2225 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2227 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2228 test -n "$add" && deplibs
="$add $deplibs"
2229 if test "$hardcode_direct" != yes && \
2230 test "$hardcode_minus_L" != yes && \
2231 test "$hardcode_shlibpath_var" = yes; then
2232 case :$finalize_shlibpath: in
2234 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2240 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2244 # Finalize command for both is simple: just hardcode it.
2245 if test "$hardcode_direct" = yes; then
2246 add
="$libdir/$linklib"
2247 elif test "$hardcode_minus_L" = yes; then
2250 elif test "$hardcode_shlibpath_var" = yes; then
2251 case :$finalize_shlibpath: in
2253 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2257 # We cannot seem to hardcode it, guess we'll fake it.
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 # Here we assume that one of hardcode_direct or hardcode_minus_L
2272 # is not unsupported. This is valid on all known static and
2274 if test "$hardcode_direct" != unsupported
; then
2275 test -n "$old_library" && linklib
="$old_library"
2276 compile_deplibs
="$dir/$linklib $compile_deplibs"
2277 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2279 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2280 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2282 elif test "$build_libtool_libs" = yes; then
2283 # Not a shared library
2284 if test "$deplibs_check_method" != pass_all
; then
2285 # We're trying link a shared library against a static one
2286 # but the system doesn't support it.
2288 # Just print a warning and add the library to dependency_libs so
2289 # that the program can be linked against the static library.
2291 echo "*** Warning: This system can not link to static lib archive $lib."
2292 echo "*** I have the capability to make that library automatically link in when"
2293 echo "*** you link to this library. But I can only do this if you have a"
2294 echo "*** shared version of the library, which you do not appear to have."
2295 if test "$module" = yes; then
2296 echo "*** But as you try to build a module library, libtool will still create "
2297 echo "*** a static module, that should work as long as the dlopening application"
2298 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2299 if test -z "$global_symbol_pipe"; then
2301 echo "*** However, this would only work if libtool was able to extract symbol"
2302 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2303 echo "*** not find such a program. So, this module is probably useless."
2304 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2306 if test "$build_old_libs" = no
; then
2307 build_libtool_libs
=module
2310 build_libtool_libs
=no
2314 convenience
="$convenience $dir/$old_library"
2315 old_convenience
="$old_convenience $dir/$old_library"
2316 deplibs
="$dir/$old_library $deplibs"
2319 fi # link shared/static library?
2321 if test "$linkmode" = lib
; then
2322 if test -n "$dependency_libs" &&
2323 { test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes ||
2324 test "$link_static" = yes; }; then
2325 # Extract -R from dependency_libs
2327 for libdir
in $dependency_libs; do
2329 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2331 *" $temp_xrpath "*) ;;
2332 *) xrpath
="$xrpath $temp_xrpath";;
2334 *) temp_deplibs
="$temp_deplibs $libdir";;
2337 dependency_libs
="$temp_deplibs"
2340 newlib_search_path
="$newlib_search_path $absdir"
2341 # Link against this library
2342 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2343 # ... and its dependency_libs
2345 for deplib
in $dependency_libs; do
2346 newdependency_libs
="$deplib $newdependency_libs"
2347 if test "X$duplicate_deps" = "Xyes" ; then
2348 case "$tmp_libs " in
2349 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2352 tmp_libs
="$tmp_libs $deplib"
2355 if test "$link_all_deplibs" != no
; then
2356 # Add the search paths of all dependency libraries
2357 for deplib
in $dependency_libs; do
2359 -L*) path
="$deplib" ;;
2361 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2362 test "X$dir" = "X$deplib" && dir
="."
2363 # We need an absolute path.
2365 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2367 absdir
=`cd "$dir" && pwd`
2368 if test -z "$absdir"; then
2369 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2374 if grep "^installed=no" $deplib > /dev
/null
; then
2375 path
="-L$absdir/$objdir"
2377 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2378 if test -z "$libdir"; then
2379 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2382 if test "$absdir" != "$libdir"; then
2383 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2390 case " $deplibs " in
2392 *) deplibs
="$deplibs $path" ;;
2395 fi # link_all_deplibs != no
2397 done # for deplib in $libs
2398 dependency_libs
="$newdependency_libs"
2399 if test "$pass" = dlpreopen
; then
2400 # Link the dlpreopened libraries before other libraries
2401 for deplib
in $save_deplibs; do
2402 deplibs
="$deplib $deplibs"
2405 if test "$pass" != dlopen
; then
2406 if test "$pass" != conv
; then
2407 # Make sure lib_search_path contains only unique directories.
2409 for dir
in $newlib_search_path; do
2410 case "$lib_search_path " in
2412 *) lib_search_path
="$lib_search_path $dir" ;;
2418 if test "$linkmode,$pass" != "prog,link"; then
2421 vars
="compile_deplibs finalize_deplibs"
2423 for var
in $vars dependency_libs
; do
2424 # Add libraries to $var in reverse order
2425 eval tmp_libs
=\"\$
$var\"
2427 for deplib
in $tmp_libs; do
2428 # FIXME: Pedantically, this is the right thing to do, so
2429 # that some nasty dependency loop isn't accidentally
2431 #new_libs="$deplib $new_libs"
2432 # Pragmatically, this seems to cause very few problems in
2435 -L*) new_libs
="$deplib $new_libs" ;;
2437 # And here is the reason: when a library appears more
2438 # than once as an explicit dependence of a library, or
2439 # is implicitly linked in more than once by the
2440 # compiler, it is considered special, and multiple
2441 # occurrences thereof are not removed. Compare this
2442 # with having the same library being listed as a
2443 # dependency of multiple other libraries: in this case,
2444 # we know (pedantically, we assume) the library does not
2445 # need to be listed more than once, so we keep only the
2446 # last copy. This is not always right, but it is rare
2447 # enough that we require users that really mean to play
2448 # such unportable linking tricks to link the library
2449 # using -Wl,-lname, so that libtool does not consider it
2450 # for duplicate removal.
2451 case " $specialdeplibs " in
2452 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2454 case " $new_libs " in
2456 *) new_libs
="$deplib $new_libs" ;;
2464 for deplib
in $new_libs; do
2467 case " $tmp_libs " in
2469 *) tmp_libs
="$tmp_libs $deplib" ;;
2472 *) tmp_libs
="$tmp_libs $deplib" ;;
2475 eval $var=\"$tmp_libs\"
2479 if test "$linkmode" = prog
; then
2480 dlfiles
="$newdlfiles"
2481 dlprefiles
="$newdlprefiles"
2486 if test -n "$deplibs"; then
2487 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2490 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2491 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2494 if test -n "$rpath"; then
2495 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2498 if test -n "$xrpath"; then
2499 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2502 if test -n "$vinfo"; then
2503 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2506 if test -n "$release"; then
2507 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2510 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2511 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2514 # Now set the variables for building old libraries.
2515 build_libtool_libs
=no
2517 objs
="$objs$old_deplibs"
2521 # Make sure we only generate libraries of the form `libNAME.la'.
2524 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2525 eval libname
=\"$libname_spec\"
2528 if test "$module" = no
; then
2529 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2533 if test "$need_lib_prefix" != no
; then
2534 # Add the "lib" prefix for modules if required
2535 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2536 eval libname
=\"$libname_spec\"
2538 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2543 if test -n "$objs"; then
2544 if test "$deplibs_check_method" != pass_all
; then
2545 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2549 echo "*** Warning: Linking the shared library $output against the non-libtool"
2550 echo "*** objects $objs is not portable!"
2551 libobjs
="$libobjs $objs"
2555 if test "$dlself" != no
; then
2556 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2560 if test "$#" -gt 2; then
2561 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2566 if test -z "$rpath"; then
2567 if test "$build_libtool_libs" = yes; then
2568 # Building a libtool convenience library.
2569 # Some compilers have problems with a `.al' extension so
2570 # convenience libraries should have the same extension an
2571 # archive normally would.
2572 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2573 build_libtool_libs
=convenience
2577 if test -n "$vinfo"; then
2578 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2581 if test -n "$release"; then
2582 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2586 # Parse the version information argument.
2587 save_ifs
="$IFS"; IFS
=':'
2588 set dummy
$vinfo 0 0 0
2591 if test -n "$8"; then
2592 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2601 # Check that each of the things are valid numbers.
2603 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2605 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2606 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2612 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2614 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2615 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2621 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2623 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2624 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2629 if test "$age" -gt "$current"; then
2630 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2631 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2635 # Calculate the version variables.
2639 case $version_type in
2643 # Like Linux, but with the current version available in
2644 # verstring for coding it into the library header
2645 major
=.
`expr $current - $age`
2646 versuffix
="$major.$age.$revision"
2647 # Darwin ld doesn't like 0 for these options...
2648 minor_current
=`expr $current + 1`
2649 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
2654 versuffix
=".$current.$revision";
2659 versuffix
=".$current";
2663 case $version_type in
2664 nonstopux
) verstring_prefix
=nonstopux
;;
2665 *) verstring_prefix
=sgi
;;
2667 verstring
="$verstring_prefix$major.$revision"
2669 major
=`expr $current - $age + 1`
2671 # Add in all the interfaces that we are compatible with.
2673 while test "$loop" -ne 0; do
2674 iface
=`expr $revision - $loop`
2675 loop
=`expr $loop - 1`
2676 verstring
="$verstring_prefix$major.$iface:$verstring"
2679 # Before this point, $major must not contain `.'.
2681 versuffix
="$major.$revision"
2685 major
=.
`expr $current - $age`
2686 versuffix
="$major.$age.$revision"
2690 major
=`expr $current - $age`
2691 versuffix
=".$current.$age.$revision"
2692 verstring
="$current.$age.$revision"
2694 # Add in all the interfaces that we are compatible with.
2696 while test "$loop" -ne 0; do
2697 iface
=`expr $current - $loop`
2698 loop
=`expr $loop - 1`
2699 verstring
="$verstring:${iface}.0"
2702 # Make executables depend on our current version.
2703 verstring
="$verstring:${current}.0"
2708 versuffix
=".$current.$revision"
2712 # Use '-' rather than '.', since we only want one
2713 # extension on DOS 8.3 filesystems.
2714 major
=`expr $current - $age`
2719 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2720 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2725 # Clear the version info if we defaulted, and they specified a release.
2726 if test -z "$vinfo" && test -n "$release"; then
2728 case $version_type in
2730 # we can't check for "0.0" in archive_cmds due to quoting
2731 # problems, so we reset it completely
2738 if test "$need_version" = no
; then
2745 # Remove version info from name if versioning should be avoided
2746 if test "$avoid_version" = yes && test "$need_version" = no
; then
2752 # Check to see if the archive will have undefined symbols.
2753 if test "$allow_undefined" = yes; then
2754 if test "$allow_undefined_flag" = unsupported
; then
2755 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2756 build_libtool_libs
=no
2760 # Don't allow undefined symbols.
2761 allow_undefined_flag
="$no_undefined_flag"
2765 if test "$mode" != relink
; then
2766 # Remove our outputs, but don't remove object files since they
2767 # may have been created when compiling PIC objects.
2769 tempremovelist
=`echo "$output_objdir/*"`
2770 for p
in $tempremovelist; do
2774 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
2775 removelist
="$removelist $p"
2780 if test -n "$removelist"; then
2781 $show "${rm}r $removelist"
2782 $run ${rm}r
$removelist
2786 # Now set the variables for building old libraries.
2787 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
2788 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
2790 # Transform .lo files to .o files.
2791 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2794 # Eliminate all temporary directories.
2795 for path
in $notinst_path; do
2796 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2797 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2798 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2801 if test -n "$xrpath"; then
2802 # If the user specified any rpath flags, then add them.
2804 for libdir
in $xrpath; do
2805 temp_xrpath
="$temp_xrpath -R$libdir"
2806 case "$finalize_rpath " in
2808 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2811 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
2812 dependency_libs
="$temp_xrpath $dependency_libs"
2816 # Make sure dlfiles contains only unique files that won't be dlpreopened
2817 old_dlfiles
="$dlfiles"
2819 for lib
in $old_dlfiles; do
2820 case " $dlprefiles $dlfiles " in
2822 *) dlfiles
="$dlfiles $lib" ;;
2826 # Make sure dlprefiles contains only unique files
2827 old_dlprefiles
="$dlprefiles"
2829 for lib
in $old_dlprefiles; do
2830 case "$dlprefiles " in
2832 *) dlprefiles
="$dlprefiles $lib" ;;
2836 if test "$build_libtool_libs" = yes; then
2837 if test -n "$rpath"; then
2839 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
2840 # these systems don't actually have a c library (as such)!
2842 *-*-rhapsody* |
*-*-darwin1.
[012])
2843 # Rhapsody C library is in the System framework
2844 deplibs
="$deplibs -framework System"
2847 # Don't link with libc until the a.out ld.so is fixed.
2849 *-*-openbsd* |
*-*-freebsd*)
2850 # Do not include libc due to us having libc/libc_r.
2851 test "X$arg" = "X-lc" && continue
2854 # Add libc to deplibs on all other systems if necessary.
2855 if test "$build_libtool_need_lc" = "yes"; then
2856 deplibs
="$deplibs -lc"
2862 # Transform deplibs into only deplibs that can be linked in shared.
2864 libname_save
=$libname
2865 release_save
=$release
2866 versuffix_save
=$versuffix
2868 # I'm not sure if I'm treating the release correctly. I think
2869 # release should show up in the -l (ie -lgmp5) so we don't want to
2870 # add it in twice. Is that correct?
2876 case $deplibs_check_method in
2878 # Don't check for shared/static. Everything works.
2879 # This might be a little naive. We might want to check
2880 # whether the library exists or not. But this is on
2881 # osf3 & osf4 and I'm not really sure... Just
2882 # implementing what was already the behaviour.
2886 # This code stresses the "libraries are programs" paradigm to its
2887 # limits. Maybe even breaks it. We compile a program, linking it
2888 # against the deplibs as a proxy for the library. Then we can check
2889 # whether they linked in statically or dynamically with ldd.
2891 cat > conftest.c
<<EOF
2892 int main() { return 0; }
2895 $LTCC -o conftest conftest.c
$deplibs
2896 if test "$?" -eq 0 ; then
2897 ldd_output
=`ldd conftest`
2898 for i
in $deplibs; do
2899 name
="`expr $i : '-l\(.*\)'`"
2900 # If $name is empty we are operating on a -L argument.
2901 if test "$name" != "" && test "$name" -ne "0"; then
2902 libname
=`eval \\$echo \"$libname_spec\"`
2903 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2904 set dummy
$deplib_matches
2906 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2907 newdeplibs
="$newdeplibs $i"
2911 echo "*** Warning: dynamic linker does not accept needed library $i."
2912 echo "*** I have the capability to make that library automatically link in when"
2913 echo "*** you link to this library. But I can only do this if you have a"
2914 echo "*** shared version of the library, which I believe you do not have"
2915 echo "*** because a test_compile did reveal that the linker did not use it for"
2916 echo "*** its dynamic dependency list that programs get resolved with at runtime."
2919 newdeplibs
="$newdeplibs $i"
2923 # Error occured in the first compile. Let's try to salvage
2924 # the situation: Compile a separate program for each library.
2925 for i
in $deplibs; do
2926 name
="`expr $i : '-l\(.*\)'`"
2927 # If $name is empty we are operating on a -L argument.
2928 if test "$name" != "" && test "$name" != "0"; then
2930 $LTCC -o conftest conftest.c
$i
2932 if test "$?" -eq 0 ; then
2933 ldd_output
=`ldd conftest`
2934 libname
=`eval \\$echo \"$libname_spec\"`
2935 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2936 set dummy
$deplib_matches
2938 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2939 newdeplibs
="$newdeplibs $i"
2943 echo "*** Warning: dynamic linker does not accept needed library $i."
2944 echo "*** I have the capability to make that library automatically link in when"
2945 echo "*** you link to this library. But I can only do this if you have a"
2946 echo "*** shared version of the library, which you do not appear to have"
2947 echo "*** because a test_compile did reveal that the linker did not use this one"
2948 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
2953 echo "*** Warning! Library $i is needed by this library but I was not able to"
2954 echo "*** make it link in! You will probably need to install it or some"
2955 echo "*** library that it depends on before this library will be fully"
2956 echo "*** functional. Installing it before continuing would be even better."
2959 newdeplibs
="$newdeplibs $i"
2965 set dummy
$deplibs_check_method
2966 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2967 for a_deplib
in $deplibs; do
2968 name
="`expr $a_deplib : '-l\(.*\)'`"
2969 # If $name is empty we are operating on a -L argument.
2970 if test "$name" != "" && test "$name" != "0"; then
2971 libname
=`eval \\$echo \"$libname_spec\"`
2972 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2973 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2974 for potent_lib
in $potential_libs; do
2975 # Follow soft links.
2976 if ls -lLd "$potent_lib" 2>/dev
/null \
2977 |
grep " -> " >/dev
/null
; then
2980 # The statement above tries to avoid entering an
2981 # endless loop below, in case of cyclic links.
2982 # We might still enter an endless loop, since a link
2983 # loop can be closed while we follow links,
2985 potlib
="$potent_lib"
2986 while test -h "$potlib" 2>/dev
/null
; do
2987 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2989 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2990 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2993 # It is ok to link against an archive when
2994 # building a shared library.
2995 if $AR -t $potlib > /dev
/null
2>&1; then
2996 newdeplibs
="$newdeplibs $a_deplib"
3000 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3002 |
egrep "$file_magic_regex" > /dev
/null
; then
3003 newdeplibs
="$newdeplibs $a_deplib"
3009 if test -n "$a_deplib" ; then
3012 echo "*** Warning: linker path does not have real file for library $a_deplib."
3013 echo "*** I have the capability to make that library automatically link in when"
3014 echo "*** you link to this library. But I can only do this if you have a"
3015 echo "*** shared version of the library, which you do not appear to have"
3016 echo "*** because I did check the linker path looking for a file starting"
3017 if test -z "$potlib" ; then
3018 echo "*** with $libname but no candidates were found. (...for file magic test)"
3020 echo "*** with $libname and none of the candidates passed a file format test"
3021 echo "*** using a file magic. Last file checked: $potlib"
3025 # Add a -L argument.
3026 newdeplibs
="$newdeplibs $a_deplib"
3028 done # Gone through all deplibs.
3031 set dummy
$deplibs_check_method
3032 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3033 for a_deplib
in $deplibs; do
3034 name
="`expr $a_deplib : '-l\(.*\)'`"
3035 # If $name is empty we are operating on a -L argument.
3036 if test -n "$name" && test "$name" != "0"; then
3037 libname
=`eval \\$echo \"$libname_spec\"`
3038 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3039 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3040 for potent_lib
in $potential_libs; do
3041 potlib
="$potent_lib" # see symlink-check above in file_magic test
3042 if eval echo \"$potent_lib\" 2>/dev
/null \
3044 |
egrep "$match_pattern_regex" > /dev
/null
; then
3045 newdeplibs
="$newdeplibs $a_deplib"
3051 if test -n "$a_deplib" ; then
3054 echo "*** Warning: linker path does not have real file for library $a_deplib."
3055 echo "*** I have the capability to make that library automatically link in when"
3056 echo "*** you link to this library. But I can only do this if you have a"
3057 echo "*** shared version of the library, which you do not appear to have"
3058 echo "*** because I did check the linker path looking for a file starting"
3059 if test -z "$potlib" ; then
3060 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3062 echo "*** with $libname and none of the candidates passed a file format test"
3063 echo "*** using a regex pattern. Last file checked: $potlib"
3067 # Add a -L argument.
3068 newdeplibs
="$newdeplibs $a_deplib"
3070 done # Gone through all deplibs.
3074 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
3075 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3076 grep .
>/dev
/null
; then
3078 if test "X$deplibs_check_method" = "Xnone"; then
3079 echo "*** Warning: inter-library dependencies are not supported in this platform."
3081 echo "*** Warning: inter-library dependencies are not known to be supported."
3083 echo "*** All declared inter-library dependencies are being dropped."
3088 versuffix
=$versuffix_save
3090 release
=$release_save
3091 libname
=$libname_save
3095 *-*-rhapsody* |
*-*-darwin1.
[012])
3096 # On Rhapsody replace the C library is the System framework
3097 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3101 if test "$droppeddeps" = yes; then
3102 if test "$module" = yes; then
3104 echo "*** Warning: libtool could not satisfy all declared inter-library"
3105 echo "*** dependencies of module $libname. Therefore, libtool will create"
3106 echo "*** a static module, that should work as long as the dlopening"
3107 echo "*** application is linked with the -dlopen flag."
3108 if test -z "$global_symbol_pipe"; then
3110 echo "*** However, this would only work if libtool was able to extract symbol"
3111 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3112 echo "*** not find such a program. So, this module is probably useless."
3113 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3115 if test "$build_old_libs" = no
; then
3116 oldlibs
="$output_objdir/$libname.$libext"
3117 build_libtool_libs
=module
3120 build_libtool_libs
=no
3123 echo "*** The inter-library dependencies that have been dropped here will be"
3124 echo "*** automatically added whenever a program is linked with this library"
3125 echo "*** or is declared to -dlopen it."
3127 if test "$allow_undefined" = no
; then
3129 echo "*** Since this library must not contain undefined symbols,"
3130 echo "*** because either the platform does not support them or"
3131 echo "*** it was explicitly requested with -no-undefined,"
3132 echo "*** libtool will only create a static version of it."
3133 if test "$build_old_libs" = no
; then
3134 oldlibs
="$output_objdir/$libname.$libext"
3135 build_libtool_libs
=module
3138 build_libtool_libs
=no
3143 # Done checking deplibs!
3147 # All the library-specific variables (install_libdir is set above).
3152 # Test again, we may have decided not to build it any more
3153 if test "$build_libtool_libs" = yes; then
3154 if test "$hardcode_into_libs" = yes; then
3155 # Hardcode the library paths
3158 rpath
="$finalize_rpath"
3159 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3160 for libdir
in $rpath; do
3161 if test -n "$hardcode_libdir_flag_spec"; then
3162 if test -n "$hardcode_libdir_separator"; then
3163 if test -z "$hardcode_libdirs"; then
3164 hardcode_libdirs
="$libdir"
3166 # Just accumulate the unique libdirs.
3167 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3168 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3171 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3176 eval flag
=\"$hardcode_libdir_flag_spec\"
3177 dep_rpath
="$dep_rpath $flag"
3179 elif test -n "$runpath_var"; then
3180 case "$perm_rpath " in
3182 *) perm_rpath
="$perm_rpath $libdir" ;;
3186 # Substitute the hardcoded libdirs into the rpath.
3187 if test -n "$hardcode_libdir_separator" &&
3188 test -n "$hardcode_libdirs"; then
3189 libdir
="$hardcode_libdirs"
3190 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3192 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3193 # We should set the runpath_var.
3195 for dir
in $perm_rpath; do
3198 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3200 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3203 shlibpath
="$finalize_shlibpath"
3204 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3205 if test -n "$shlibpath"; then
3206 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3209 # Get the real and link names of the library.
3210 eval library_names
=\"$library_names_spec\"
3211 set dummy
$library_names
3215 if test -n "$soname_spec"; then
3216 eval soname
=\"$soname_spec\"
3220 if test -z "$dlname"; then
3224 lib
="$output_objdir/$realname"
3227 linknames
="$linknames $link"
3230 # Use standard objects if they are pic
3231 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3233 # Prepare the list of exported symbols
3234 if test -z "$export_symbols"; then
3235 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3236 $show "generating symbol list for \`$libname.la'"
3237 export_symbols
="$output_objdir/$libname.exp"
3238 $run $rm $export_symbols
3239 eval cmds
=\"$export_symbols_cmds\"
3240 save_ifs
="$IFS"; IFS
='~'
3241 for cmd
in $cmds; do
3244 $run eval "$cmd" ||
exit $?
3247 if test -n "$export_symbols_regex"; then
3248 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3249 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3250 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3251 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3256 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3257 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3260 if test -n "$convenience"; then
3261 if test -n "$whole_archive_flag_spec"; then
3262 save_libobjs
=$libobjs
3263 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3265 gentop
="$output_objdir/${outputname}x"
3266 $show "${rm}r $gentop"
3267 $run ${rm}r
"$gentop"
3268 $show "$mkdir $gentop"
3269 $run $mkdir "$gentop"
3271 if test "$status" -ne 0 && test ! -d "$gentop"; then
3274 generated
="$generated $gentop"
3276 for xlib
in $convenience; do
3277 # Extract the objects.
3279 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3280 *) xabs
=`pwd`"/$xlib" ;;
3282 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3283 xdir
="$gentop/$xlib"
3285 $show "${rm}r $xdir"
3287 $show "$mkdir $xdir"
3290 if test "$status" -ne 0 && test ! -d "$xdir"; then
3293 $show "(cd $xdir && $AR x $xabs)"
3294 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3296 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3301 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3302 eval flag
=\"$thread_safe_flag_spec\"
3303 linker_flags
="$linker_flags $flag"
3306 # Make a backup of the uninstalled library when relinking
3307 if test "$mode" = relink
; then
3308 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3311 # Do each of the archive commands.
3312 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3313 eval cmds
=\"$archive_expsym_cmds\"
3315 eval cmds
=\"$archive_cmds\"
3318 if len
=`expr "X$cmds" : ".*"` &&
3319 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3322 # The command line is too long to link in one step, link piecewise.
3323 $echo "creating reloadable object files..."
3325 # Save the value of $output and $libobjs because we want to
3326 # use them later. If we have whole_archive_flag_spec, we
3327 # want to use save_libobjs as it was before
3328 # whole_archive_flag_spec was expanded, because we can't
3329 # assume the linker understands whole_archive_flag_spec.
3330 # This may have to be revisited, in case too many
3331 # convenience libraries get linked in and end up exceeding
3333 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3334 save_libobjs
=$libobjs
3338 # Clear the reloadable object creation command queue and
3339 # initialize k to one.
3346 output
=$output_objdir/$save_output-${k}.
$objext
3347 # Loop over the list of objects to be linked.
3348 for obj
in $save_libobjs
3350 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3351 if test "X$objlist" = X ||
3352 { len
=`expr "X$test_cmds" : ".*"` &&
3353 test "$len" -le "$max_cmd_len"; }; then
3354 objlist
="$objlist $obj"
3356 # The command $test_cmds is almost too long, add a
3357 # command to the queue.
3358 if test "$k" -eq 1 ; then
3359 # The first file doesn't have a previous command to add.
3360 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3362 # All subsequent reloadable object files will link in
3363 # the last one created.
3364 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3366 last_robj
=$output_objdir/$save_output-${k}.
$objext
3368 output
=$output_objdir/$save_output-${k}.
$objext
3373 # Handle the remaining objects by creating one last
3374 # reloadable object file. All subsequent reloadable object
3375 # files will link in the last one created.
3376 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3377 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3379 # Set up a command to remove the reloadale object files
3380 # after they are used.
3382 while test "$i" -lt "$k"
3385 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3388 $echo "creating a temporary reloadable object file: $output"
3390 # Loop through the commands generated above and execute them.
3391 save_ifs
="$IFS"; IFS
='~'
3392 for cmd
in $concat_cmds; do
3395 $run eval "$cmd" ||
exit $?
3400 # Restore the value of output.
3403 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3404 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3406 # Expand the library linking commands again to reset the
3407 # value of $libobjs for piecewise linking.
3409 # Do each of the archive commands.
3410 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3411 eval cmds
=\"$archive_expsym_cmds\"
3413 eval cmds
=\"$archive_cmds\"
3416 # Append the command to remove the reloadable object files
3417 # to the just-reset $cmds.
3418 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3420 save_ifs
="$IFS"; IFS
='~'
3421 for cmd
in $cmds; do
3424 $run eval "$cmd" ||
exit $?
3428 # Restore the uninstalled library and exit
3429 if test "$mode" = relink
; then
3430 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3434 # Create links to the real library.
3435 for linkname
in $linknames; do
3436 if test "$realname" != "$linkname"; then
3437 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3438 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3442 # If -module or -export-dynamic was specified, set the dlname.
3443 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3444 # On all known operating systems, these are identical.
3451 if test -n "$deplibs"; then
3452 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3455 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3456 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3459 if test -n "$rpath"; then
3460 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3463 if test -n "$xrpath"; then
3464 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3467 if test -n "$vinfo"; then
3468 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3471 if test -n "$release"; then
3472 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3477 if test -n "$objs$old_deplibs"; then
3478 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3482 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3490 # Delete the old objects.
3491 $run $rm $obj $libobj
3493 # Objects from convenience libraries. This assumes
3494 # single-version convenience libraries. Whenever we create
3495 # different ones for PIC/non-PIC, this we'll have to duplicate
3499 # reload_cmds runs $LD directly, so let us get rid of
3500 # -Wl from whole_archive_flag_spec
3503 if test -n "$convenience"; then
3504 if test -n "$whole_archive_flag_spec"; then
3505 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3507 gentop
="$output_objdir/${obj}x"
3508 $show "${rm}r $gentop"
3509 $run ${rm}r
"$gentop"
3510 $show "$mkdir $gentop"
3511 $run $mkdir "$gentop"
3513 if test "$status" -ne 0 && test ! -d "$gentop"; then
3516 generated
="$generated $gentop"
3518 for xlib
in $convenience; do
3519 # Extract the objects.
3521 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3522 *) xabs
=`pwd`"/$xlib" ;;
3524 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3525 xdir
="$gentop/$xlib"
3527 $show "${rm}r $xdir"
3529 $show "$mkdir $xdir"
3532 if test "$status" -ne 0 && test ! -d "$xdir"; then
3535 $show "(cd $xdir && $AR x $xabs)"
3536 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3538 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3543 # Create the old-style object.
3544 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
3547 eval cmds
=\"$reload_cmds\"
3548 save_ifs
="$IFS"; IFS
='~'
3549 for cmd
in $cmds; do
3552 $run eval "$cmd" ||
exit $?
3556 # Exit if we aren't doing a library object file.
3557 if test -z "$libobj"; then
3558 if test -n "$gentop"; then
3559 $show "${rm}r $gentop"
3566 if test "$build_libtool_libs" != yes; then
3567 if test -n "$gentop"; then
3568 $show "${rm}r $gentop"
3572 # Create an invalid libtool object if no PIC, so that we don't
3573 # accidentally link it into a program.
3574 # $show "echo timestamp > $libobj"
3575 # $run eval "echo timestamp > $libobj" || exit $?
3579 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
3580 # Only do commands if we really have different PIC objects.
3581 reload_objs
="$libobjs $reload_conv_objs"
3583 eval cmds
=\"$reload_cmds\"
3584 save_ifs
="$IFS"; IFS
='~'
3585 for cmd
in $cmds; do
3588 $run eval "$cmd" ||
exit $?
3593 if test -n "$gentop"; then
3594 $show "${rm}r $gentop"
3603 *cygwin
*) output
=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3605 if test -n "$vinfo"; then
3606 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3609 if test -n "$release"; then
3610 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3613 if test "$preload" = yes; then
3614 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
3615 test "$dlopen_self_static" = unknown
; then
3616 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3621 *-*-rhapsody* |
*-*-darwin1.
[012])
3622 # On Rhapsody replace the C library is the System framework
3623 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3624 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3628 compile_command
="$compile_command $compile_deplibs"
3629 finalize_command
="$finalize_command $finalize_deplibs"
3631 if test -n "$rpath$xrpath"; then
3632 # If the user specified any rpath flags, then add them.
3633 for libdir
in $rpath $xrpath; do
3634 # This is the magic to use -rpath.
3635 case "$finalize_rpath " in
3637 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3642 # Now hardcode the library paths
3645 for libdir
in $compile_rpath $finalize_rpath; do
3646 if test -n "$hardcode_libdir_flag_spec"; then
3647 if test -n "$hardcode_libdir_separator"; then
3648 if test -z "$hardcode_libdirs"; then
3649 hardcode_libdirs
="$libdir"
3651 # Just accumulate the unique libdirs.
3652 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3653 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3656 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3661 eval flag
=\"$hardcode_libdir_flag_spec\"
3662 rpath
="$rpath $flag"
3664 elif test -n "$runpath_var"; then
3665 case "$perm_rpath " in
3667 *) perm_rpath
="$perm_rpath $libdir" ;;
3671 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
3672 case :$dllsearchpath: in
3674 *) dllsearchpath
="$dllsearchpath:$libdir";;
3679 # Substitute the hardcoded libdirs into the rpath.
3680 if test -n "$hardcode_libdir_separator" &&
3681 test -n "$hardcode_libdirs"; then
3682 libdir
="$hardcode_libdirs"
3683 eval rpath
=\" $hardcode_libdir_flag_spec\"
3685 compile_rpath
="$rpath"
3689 for libdir
in $finalize_rpath; do
3690 if test -n "$hardcode_libdir_flag_spec"; then
3691 if test -n "$hardcode_libdir_separator"; then
3692 if test -z "$hardcode_libdirs"; then
3693 hardcode_libdirs
="$libdir"
3695 # Just accumulate the unique libdirs.
3696 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3697 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3700 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3705 eval flag
=\"$hardcode_libdir_flag_spec\"
3706 rpath
="$rpath $flag"
3708 elif test -n "$runpath_var"; then
3709 case "$finalize_perm_rpath " in
3711 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
3715 # Substitute the hardcoded libdirs into the rpath.
3716 if test -n "$hardcode_libdir_separator" &&
3717 test -n "$hardcode_libdirs"; then
3718 libdir
="$hardcode_libdirs"
3719 eval rpath
=\" $hardcode_libdir_flag_spec\"
3721 finalize_rpath
="$rpath"
3723 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3724 # Transform all the library objects into standard objects.
3725 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3726 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3730 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3731 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3732 dlsyms
="${outputname}S.c"
3734 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3738 if test -n "$dlsyms"; then
3742 # Discover the nlist of each of the dlfiles.
3743 nlist
="$output_objdir/${outputname}.nm"
3745 $show "$rm $nlist ${nlist}S ${nlist}T"
3746 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3748 # Parse the name list into a source file.
3749 $show "creating $output_objdir/$dlsyms"
3751 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3752 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3753 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3759 /* Prevent the only kind of declaration conflicts we can make. */
3760 #define lt_preloaded_symbols some_other_symbol
3762 /* External symbol declarations for the compiler. */\
3765 if test "$dlself" = yes; then
3766 $show "generating symbol list for \`$output'"
3768 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3770 # Add our own program objects to the symbol list.
3771 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3772 for arg
in $progfiles; do
3773 $show "extracting global C symbols from \`$arg'"
3774 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3777 if test -n "$exclude_expsyms"; then
3778 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3779 $run eval '$mv "$nlist"T "$nlist"'
3782 if test -n "$export_symbols_regex"; then
3783 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3784 $run eval '$mv "$nlist"T "$nlist"'
3787 # Prepare the list of exported symbols
3788 if test -z "$export_symbols"; then
3789 export_symbols
="$output_objdir/$output.exp"
3790 $run $rm $export_symbols
3791 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3793 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3794 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3795 $run eval 'mv "$nlist"T "$nlist"'
3799 for arg
in $dlprefiles; do
3800 $show "extracting global C symbols from \`$arg'"
3801 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3802 $run eval 'echo ": $name " >> "$nlist"'
3803 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3806 if test -z "$run"; then
3807 # Make sure we have at least an empty file.
3808 test -f "$nlist" ||
: > "$nlist"
3810 if test -n "$exclude_expsyms"; then
3811 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3812 $mv "$nlist"T
"$nlist"
3815 # Try sorting and uniquifying the output.
3816 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3819 grep -v "^: " < "$nlist" > "$nlist"S
3822 if test -f "$nlist"S
; then
3823 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3825 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3828 $echo >> "$output_objdir/$dlsyms" "\
3830 #undef lt_preloaded_symbols
3832 #if defined (__STDC__) && __STDC__
3833 # define lt_ptr void *
3835 # define lt_ptr char *
3839 /* The mapping between symbol names and symbols. */
3844 lt_preloaded_symbols[] =
3848 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3850 $echo >> "$output_objdir/$dlsyms" "\
3854 /* This works around a problem in FreeBSD linker */
3855 #ifdef FREEBSD_WORKAROUND
3856 static const void *lt_preloaded_setup() {
3857 return lt_preloaded_symbols;
3867 pic_flag_for_symtable
=
3869 # compiling the symbol table file with pic_flag works around
3870 # a FreeBSD bug that causes programs to crash when -lm is
3871 # linked before any other PIC object. But we must not use
3872 # pic_flag when linking with -static. The problem exists in
3873 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3874 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3875 case "$compile_command " in
3877 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
3880 case "$compile_command " in
3882 *) pic_flag_for_symtable
=" $pic_flag";;
3886 # Now compile the dynamic symbol file.
3887 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3888 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3890 # Clean up the generated files.
3891 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3892 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3894 # Transform the symbol file into the correct name.
3895 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3896 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3899 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3904 # We keep going just in case the user didn't refer to
3905 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3906 # really was required.
3908 # Nullify the symbol file.
3909 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3910 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3913 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
3914 # Replace the output file specification.
3915 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3916 link_command
="$compile_command$compile_rpath"
3918 # We have no uninstalled library dependencies, so finalize right now.
3919 $show "$link_command"
3920 $run eval "$link_command"
3923 # Delete the generated files.
3924 if test -n "$dlsyms"; then
3925 $show "$rm $output_objdir/${outputname}S.${objext}"
3926 $run $rm "$output_objdir/${outputname}S.${objext}"
3932 if test -n "$shlibpath_var"; then
3933 # We should set the shlibpath_var
3935 for dir
in $temp_rpath; do
3937 [\\/]* |
[A-Za-z
]:[\\/]*)
3942 # Relative path: add a thisdir entry.
3943 rpath
="$rpath\$thisdir/$dir:"
3950 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3951 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3953 if test -n "$finalize_shlibpath"; then
3954 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3959 if test -n "$runpath_var"; then
3960 if test -n "$perm_rpath"; then
3961 # We should set the runpath_var.
3963 for dir
in $perm_rpath; do
3966 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3968 if test -n "$finalize_perm_rpath"; then
3969 # We should set the runpath_var.
3971 for dir
in $finalize_perm_rpath; do
3974 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3978 if test "$no_install" = yes; then
3979 # We don't need to create a wrapper script.
3980 link_command
="$compile_var$compile_command$compile_rpath"
3981 # Replace the output file specification.
3982 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3983 # Delete the old output file.
3985 # Link the executable and exit
3986 $show "$link_command"
3987 $run eval "$link_command" ||
exit $?
3991 if test "$hardcode_action" = relink
; then
3992 # Fast installation is not supported
3993 link_command
="$compile_var$compile_command$compile_rpath"
3994 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3996 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3997 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3999 if test "$fast_install" != no
; then
4000 link_command
="$finalize_var$compile_command$finalize_rpath"
4001 if test "$fast_install" = yes; then
4002 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4004 # fast_install is set to needless
4008 link_command
="$compile_var$compile_command$compile_rpath"
4009 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4013 # Replace the output file specification.
4014 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4016 # Delete the old output files.
4017 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4019 $show "$link_command"
4020 $run eval "$link_command" ||
exit $?
4022 # Now create the wrapper script.
4023 $show "creating $output"
4025 # Quote the relink command for shipping.
4026 if test -n "$relink_command"; then
4027 # Preserve any variables that may affect compiler behavior
4028 for var
in $variables_saved_for_relink; do
4029 if eval test -z \"\
${$var+set}\"; then
4030 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4031 elif eval var_value
=\$
$var; test -z "$var_value"; then
4032 relink_command
="$var=; export $var; $relink_command"
4034 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4035 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4038 relink_command
="(cd `pwd`; $relink_command)"
4039 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4042 # Quote $echo for shipping.
4043 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4045 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4046 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4048 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4050 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4053 # Only actually do things if our run command is non-null.
4054 if test -z "$run"; then
4055 # win32 will think the script is a binary if it has
4056 # a .exe suffix, so we strip it off here.
4058 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
4060 # test for cygwin because mv fails w/o .exe extensions
4062 *cygwin
*) exeext
=.exe
;;
4066 trap "$rm $output; exit 1" 1 2 15
4071 # $output - temporary wrapper script for $objdir/$outputname
4072 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4074 # The $output program cannot be directly executed until all the libtool
4075 # libraries that it depends on are installed.
4077 # This wrapper script should never be moved out of the build directory.
4078 # If it is, it will not operate correctly.
4080 # Sed substitution that helps us do robust quoting. It backslashifies
4081 # metacharacters that are still active within double-quoted strings.
4082 Xsed='sed -e 1s/^X//'
4083 sed_quote_subst='$sed_quote_subst'
4085 # The HP-UX ksh and POSIX shell print the target directory to stdout
4087 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4089 relink_command=\"$relink_command\"
4091 # This environment variable determines our operation mode.
4092 if test \"\$libtool_install_magic\" = \"$magic\"; then
4093 # install mode needs the following variable:
4094 notinst_deplibs='$notinst_deplibs'
4096 # When we are sourced in execute mode, \$file and \$echo are already set.
4097 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4100 # Make sure echo works.
4101 if test \"X\$1\" = X--no-reexec; then
4102 # Discard the --no-reexec flag, and continue.
4104 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4105 # Yippee, \$echo works!
4108 # Restart under the correct shell, and then maybe \$echo will work.
4109 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4115 # Find the directory that this script lives in.
4116 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4117 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4119 # Follow symbolic links until we get to the real thisdir.
4120 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
4121 while test -n \"\$file\"; do
4122 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4124 # If there was a directory component, then change thisdir.
4125 if test \"x\$destdir\" != \"x\$file\"; then
4126 case \"\$destdir\" in
4127 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4128 *) thisdir=\"\$thisdir/\$destdir\" ;;
4132 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4133 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4136 # Try to get the absolute directory name.
4137 absdir=\`cd \"\$thisdir\" && pwd\`
4138 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4141 if test "$fast_install" = yes; then
4143 program=lt-'$outputname'$exeext
4144 progdir=\"\$thisdir/$objdir\"
4146 if test ! -f \"\$progdir/\$program\" || \\
4147 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
4148 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4150 file=\"\$\$-\$program\"
4152 if test ! -d \"\$progdir\"; then
4153 $mkdir \"\$progdir\"
4155 $rm \"\$progdir/\$file\"
4160 # relink executable if necessary
4161 if test -n \"\$relink_command\"; then
4162 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4164 $echo \"\$relink_command_output\" >&2
4165 $rm \"\$progdir/\$file\"
4170 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4171 { $rm \"\$progdir/\$program\";
4172 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4173 $rm \"\$progdir/\$file\"
4177 program='$outputname'
4178 progdir=\"\$thisdir/$objdir\"
4184 if test -f \"\$progdir/\$program\"; then"
4186 # Export our shlibpath_var if we have one.
4187 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4189 # Add our own library path to $shlibpath_var
4190 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4192 # Some systems cannot cope with colon-terminated $shlibpath_var
4193 # The second colon is a workaround for a bug in BeOS R4 sed
4194 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4196 export $shlibpath_var
4200 # fixup the dll searchpath if we need to.
4201 if test -n "$dllsearchpath"; then
4203 # Add the dll search path components to the executable PATH
4204 PATH=$dllsearchpath:\$PATH
4209 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4210 # Run the actual program with our arguments.
4213 # win32 systems need to use the prog path for dll
4215 *-*-cygwin* |
*-*-pw32*)
4217 exec \$progdir/\$program \${1+\"\$@\"}
4221 # Backslashes separate directories on plain windows
4222 *-*-mingw |
*-*-os2*)
4224 exec \$progdir\\\\\$program \${1+\"\$@\"}
4230 # Export the path to the program.
4231 PATH=\"\$progdir:\$PATH\"
4234 exec \$program \${1+\"\$@\"}
4239 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4243 # The program doesn't exist.
4244 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4245 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4246 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4257 # See if we need to build an old-fashioned archive.
4258 for oldlib
in $oldlibs; do
4260 if test "$build_libtool_libs" = convenience
; then
4261 oldobjs
="$libobjs_save"
4262 addlibs
="$convenience"
4263 build_libtool_libs
=no
4265 if test "$build_libtool_libs" = module
; then
4266 oldobjs
="$libobjs_save"
4267 build_libtool_libs
=no
4269 oldobjs
="$objs$old_deplibs $non_pic_objects"
4271 addlibs
="$old_convenience"
4274 if test -n "$addlibs"; then
4275 gentop
="$output_objdir/${outputname}x"
4276 $show "${rm}r $gentop"
4277 $run ${rm}r
"$gentop"
4278 $show "$mkdir $gentop"
4279 $run $mkdir "$gentop"
4281 if test "$status" -ne 0 && test ! -d "$gentop"; then
4284 generated
="$generated $gentop"
4286 # Add in members from convenience archives.
4287 for xlib
in $addlibs; do
4288 # Extract the objects.
4290 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4291 *) xabs
=`pwd`"/$xlib" ;;
4293 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4294 xdir
="$gentop/$xlib"
4296 $show "${rm}r $xdir"
4298 $show "$mkdir $xdir"
4301 if test "$status" -ne 0 && test ! -d "$xdir"; then
4304 $show "(cd $xdir && $AR x $xabs)"
4305 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4307 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4311 # Do each command in the archive commands.
4312 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4313 eval cmds
=\"$old_archive_from_new_cmds\"
4315 eval cmds
=\"$old_archive_cmds\"
4317 if len
=`expr "X$cmds" : ".*"` &&
4318 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4321 # the command line is too long to link in one step, link in parts
4322 $echo "using piecewise archive linking..."
4327 save_oldobjs
=$oldobjs
4328 for obj
in $save_oldobjs
4330 oldobjs
="$objlist $obj"
4331 objlist
="$objlist $obj"
4332 eval test_cmds
=\"$old_archive_cmds\"
4333 if len
=`expr "X$test_cmds" : ".*"` &&
4334 test "$len" -le "$max_cmd_len"; then
4337 # the above command should be used before it gets too long
4339 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4340 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
4346 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
4349 save_ifs
="$IFS"; IFS
='~'
4350 for cmd
in $cmds; do
4353 $run eval "$cmd" ||
exit $?
4358 if test -n "$generated"; then
4359 $show "${rm}r$generated"
4360 $run ${rm}r
$generated
4363 # Now create the libtool archive.
4367 test "$build_old_libs" = yes && old_library
="$libname.$libext"
4368 $show "creating $output"
4370 # Preserve any variables that may affect compiler behavior
4371 for var
in $variables_saved_for_relink; do
4372 if eval test -z \"\
${$var+set}\"; then
4373 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4374 elif eval var_value
=\$
$var; test -z "$var_value"; then
4375 relink_command
="$var=; export $var; $relink_command"
4377 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4378 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4381 # Quote the link command for shipping.
4382 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
4383 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4385 # Only create the output if not a dry run.
4386 if test -z "$run"; then
4387 for installed
in no
yes; do
4388 if test "$installed" = yes; then
4389 if test -z "$install_libdir"; then
4392 output
="$output_objdir/$outputname"i
4393 # Replace all uninstalled libtool libraries with the installed ones
4395 for deplib
in $dependency_libs; do
4398 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4399 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4400 if test -z "$libdir"; then
4401 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4404 newdependency_libs
="$newdependency_libs $libdir/$name"
4406 *) newdependency_libs
="$newdependency_libs $deplib" ;;
4409 dependency_libs
="$newdependency_libs"
4411 for lib
in $dlfiles; do
4412 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4413 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4414 if test -z "$libdir"; then
4415 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4418 newdlfiles
="$newdlfiles $libdir/$name"
4420 dlfiles
="$newdlfiles"
4422 for lib
in $dlprefiles; do
4423 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4424 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4425 if test -z "$libdir"; then
4426 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4429 newdlprefiles
="$newdlprefiles $libdir/$name"
4431 dlprefiles
="$newdlprefiles"
4434 # place dlname in correct position for cygwin
4436 case $host,$output,$installed,$module,$dlname in
4437 *cygwin
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
4440 # $outputname - a libtool library file
4441 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4443 # Please DO NOT delete this file!
4444 # It is necessary for linking the library.
4446 # The name that we can dlopen(3).
4449 # Names of this library.
4450 library_names='$library_names'
4452 # The name of the static archive.
4453 old_library='$old_library'
4455 # Libraries that this one depends upon.
4456 dependency_libs='$dependency_libs'
4458 # Version information for $libname.
4463 # Is this an already installed library?
4464 installed=$installed
4466 # Files to dlopen/dlpreopen
4468 dlpreopen='$dlprefiles'
4470 # Directory that this library needs to be installed in:
4471 libdir='$install_libdir'"
4472 if test "$installed" = no
&& test "$need_relink" = yes; then
4474 relink_command=\"$relink_command\""
4479 # Do a symbolic link so that the libtool archive can be found in
4480 # LD_LIBRARY_PATH before the program is installed.
4481 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4482 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
4488 # libtool install mode
4490 modename
="$modename: install"
4492 # There may be an optional sh(1) argument at the beginning of
4493 # install_prog (especially on Windows NT).
4494 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
4495 # Allow the use of GNU shtool's install command.
4496 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
4497 # Aesthetically quote it.
4498 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4500 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4504 install_prog
="$arg "
4512 # The real first argument should be the name of the installation program.
4513 # Aesthetically quote it.
4514 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4516 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4520 install_prog
="$install_prog$arg"
4522 # We need to accept at least all the BSD install flags.
4532 if test -n "$dest"; then
4533 files
="$files $dest"
4551 # If the previous option needed an argument, then skip it.
4552 if test -n "$prev"; then
4561 # Aesthetically quote the argument.
4562 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4564 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4568 install_prog
="$install_prog $arg"
4571 if test -z "$install_prog"; then
4572 $echo "$modename: you must specify an install program" 1>&2
4577 if test -n "$prev"; then
4578 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4583 if test -z "$files"; then
4584 if test -z "$dest"; then
4585 $echo "$modename: no file or destination specified" 1>&2
4587 $echo "$modename: you must specify a destination" 1>&2
4593 # Strip any trailing slash from the destination.
4594 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4596 # Check to see that the destination is a directory.
4597 test -d "$dest" && isdir
=yes
4598 if test "$isdir" = yes; then
4602 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4603 test "X$destdir" = "X$dest" && destdir
=.
4604 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4606 # Not a directory, so check to see that there is only one file specified.
4608 if test "$#" -gt 2; then
4609 $echo "$modename: \`$dest' is not a directory" 1>&2
4615 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
4617 for file in $files; do
4621 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4630 # This variable tells wrapper scripts just to set variables rather
4631 # than running their programs.
4632 libtool_install_magic
="$magic"
4637 for file in $files; do
4639 # Do each installation.
4642 # Do the static libraries later.
4643 staticlibs
="$staticlibs $file"
4647 # Check to see that this really is a libtool archive.
4648 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4650 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4658 # If there is no directory component, then add one.
4660 */* |
*\\*) .
$file ;;
4664 # Add the libdir to current_libdirs if it is the destination.
4665 if test "X$destdir" = "X$libdir"; then
4666 case "$current_libdirs " in
4668 *) current_libdirs
="$current_libdirs $libdir" ;;
4671 # Note the libdir as a future libdir.
4672 case "$future_libdirs " in
4674 *) future_libdirs
="$future_libdirs $libdir" ;;
4678 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4679 test "X$dir" = "X$file/" && dir
=
4682 if test -n "$relink_command"; then
4683 $echo "$modename: warning: relinking \`$file'" 1>&2
4684 $show "$relink_command"
4685 if $run eval "$relink_command"; then :
4687 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4692 # See the names of the shared library.
4693 set dummy
$library_names
4694 if test -n "$2"; then
4700 test -n "$relink_command" && srcname
="$realname"T
4702 # Install the shared library and build the symlinks.
4703 $show "$install_prog $dir/$srcname $destdir/$realname"
4704 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
4705 if test -n "$stripme" && test -n "$striplib"; then
4706 $show "$striplib $destdir/$realname"
4707 $run eval "$striplib $destdir/$realname" ||
exit $?
4710 if test "$#" -gt 0; then
4711 # Delete the old symlinks, and create new ones.
4714 if test "$linkname" != "$realname"; then
4715 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4716 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4721 # Do each command in the postinstall commands.
4722 lib
="$destdir/$realname"
4723 eval cmds
=\"$postinstall_cmds\"
4724 save_ifs
="$IFS"; IFS
='~'
4725 for cmd
in $cmds; do
4728 $run eval "$cmd" ||
exit $?
4733 # Install the pseudo-library for information purposes.
4734 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4735 instname
="$dir/$name"i
4736 $show "$install_prog $instname $destdir/$name"
4737 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
4739 # Maybe install the static library, too.
4740 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
4744 # Install (i.e. copy) a libtool object.
4746 # Figure out destination file name, if it wasn't already specified.
4747 if test -n "$destname"; then
4748 destfile
="$destdir/$destname"
4750 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4751 destfile
="$destdir/$destfile"
4754 # Deduce the name of the destination old-style object file.
4757 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4760 staticdest
="$destfile"
4764 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4770 # Install the libtool object if requested.
4771 if test -n "$destfile"; then
4772 $show "$install_prog $file $destfile"
4773 $run eval "$install_prog $file $destfile" ||
exit $?
4776 # Install the old object if enabled.
4777 if test "$build_old_libs" = yes; then
4778 # Deduce the name of the old-style object file.
4779 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
4781 $show "$install_prog $staticobj $staticdest"
4782 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
4788 # Figure out destination file name, if it wasn't already specified.
4789 if test -n "$destname"; then
4790 destfile
="$destdir/$destname"
4792 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4793 destfile
="$destdir/$destfile"
4796 # Do a test to see if this is really a libtool program.
4799 wrapper
=`echo $file | sed -e 's,.exe$,,'`
4805 if (sed -e '4q' $wrapper |
egrep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
4809 # If there is no directory component, then add one.
4811 */* |
*\\*) .
$wrapper ;;
4815 # Check the variables that should have been set.
4816 if test -z "$notinst_deplibs"; then
4817 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
4822 for lib
in $notinst_deplibs; do
4823 # Check to see that each library is installed.
4825 if test -f "$lib"; then
4826 # If there is no directory component, then add one.
4828 */* |
*\\*) .
$lib ;;
4832 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4833 if test -n "$libdir" && test ! -f "$libfile"; then
4834 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4840 # If there is no directory component, then add one.
4842 */* |
*\\*) .
$file ;;
4847 if test "$fast_install" = no
&& test -n "$relink_command"; then
4848 if test "$finalize" = yes && test -z "$run"; then
4850 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
4851 tmpdir
="$tmpdir/libtool-$$"
4852 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4854 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4857 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4858 outputname
="$tmpdir/$file"
4859 # Replace the output file specification.
4860 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4862 $show "$relink_command"
4863 if $run eval "$relink_command"; then :
4865 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4871 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4874 # Install the binary that we compiled earlier.
4875 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4879 # remove .exe since cygwin /usr/bin/install will append another
4881 case $install_prog,$host in
4882 */usr
/bin
/install*,*cygwin
*)
4883 case $file:$destfile in
4888 destfile
=$destfile.exe
4891 destfile
=`echo $destfile | sed -e 's,.exe$,,'`
4896 $show "$install_prog$stripme $file $destfile"
4897 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
4898 test -n "$outputname" && ${rm}r
"$tmpdir"
4903 for file in $staticlibs; do
4904 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4906 # Set up the ranlib parameters.
4907 oldlib
="$destdir/$name"
4909 $show "$install_prog $file $oldlib"
4910 $run eval "$install_prog \$file \$oldlib" ||
exit $?
4912 if test -n "$stripme" && test -n "$striplib"; then
4913 $show "$old_striplib $oldlib"
4914 $run eval "$old_striplib $oldlib" ||
exit $?
4917 # Do each command in the postinstall commands.
4918 eval cmds
=\"$old_postinstall_cmds\"
4919 save_ifs
="$IFS"; IFS
='~'
4920 for cmd
in $cmds; do
4923 $run eval "$cmd" ||
exit $?
4928 if test -n "$future_libdirs"; then
4929 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4932 if test -n "$current_libdirs"; then
4933 # Maybe just do a dry run.
4934 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4935 exec_cmd
='$SHELL $0 --finish$current_libdirs'
4941 # libtool finish mode
4943 modename
="$modename: finish"
4947 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4950 libdirs
="$libdirs $dir"
4953 for libdir
in $libdirs; do
4954 if test -n "$finish_cmds"; then
4955 # Do each command in the finish commands.
4956 eval cmds
=\"$finish_cmds\"
4957 save_ifs
="$IFS"; IFS
='~'
4958 for cmd
in $cmds; do
4961 $run eval "$cmd" || admincmds
="$admincmds
4966 if test -n "$finish_eval"; then
4967 # Do the single finish_eval.
4968 eval cmds
=\"$finish_eval\"
4969 $run eval "$cmds" || admincmds
="$admincmds
4975 # Exit here if they wanted silent mode.
4976 test "$show" = : && exit 0
4978 echo "----------------------------------------------------------------------"
4979 echo "Libraries have been installed in:"
4980 for libdir
in $libdirs; do
4984 echo "If you ever happen to want to link against installed libraries"
4985 echo "in a given directory, LIBDIR, you must either use libtool, and"
4986 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4987 echo "flag during linking and do at least one of the following:"
4988 if test -n "$shlibpath_var"; then
4989 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4990 echo " during execution"
4992 if test -n "$runpath_var"; then
4993 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4994 echo " during linking"
4996 if test -n "$hardcode_libdir_flag_spec"; then
4998 eval flag
=\"$hardcode_libdir_flag_spec\"
5000 echo " - use the \`$flag' linker flag"
5002 if test -n "$admincmds"; then
5003 echo " - have your system administrator run these commands:$admincmds"
5005 if test -f /etc
/ld.so.conf
; then
5006 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5009 echo "See any operating system documentation about shared libraries for"
5010 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5011 echo "----------------------------------------------------------------------"
5015 # libtool execute mode
5017 modename
="$modename: execute"
5019 # The first argument is the command name.
5021 if test -z "$cmd"; then
5022 $echo "$modename: you must specify a COMMAND" 1>&2
5027 # Handle -dlopen flags immediately.
5028 for file in $execute_dlfiles; do
5029 if test ! -f "$file"; then
5030 $echo "$modename: \`$file' is not a file" 1>&2
5038 # Check to see that this really is a libtool archive.
5039 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5041 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5046 # Read the libtool library.
5050 # If there is no directory component, then add one.
5052 */* |
*\\*) .
$file ;;
5056 # Skip this library if it cannot be dlopened.
5057 if test -z "$dlname"; then
5058 # Warn if it was a shared library.
5059 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5063 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5064 test "X$dir" = "X$file" && dir
=.
5066 if test -f "$dir/$objdir/$dlname"; then
5069 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5075 # Just add the directory containing the .lo file.
5076 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5077 test "X$dir" = "X$file" && dir
=.
5081 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5086 # Get the absolute pathname.
5087 absdir
=`cd "$dir" && pwd`
5088 test -n "$absdir" && dir
="$absdir"
5090 # Now add the directory to shlibpath_var.
5091 if eval "test -z \"\$$shlibpath_var\""; then
5092 eval "$shlibpath_var=\"\$dir\""
5094 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5098 # This variable tells wrapper scripts just to set shlibpath_var
5099 # rather than running their programs.
5100 libtool_execute_magic
="$magic"
5102 # Check if any of the arguments is a wrapper script.
5109 # Do a test to see if this is really a libtool program.
5110 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5111 # If there is no directory component, then add one.
5113 */* |
*\\*) .
$file ;;
5117 # Transform arg to wrapped name.
5118 file="$progdir/$program"
5122 # Quote arguments (to preserve shell metacharacters).
5123 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5124 args
="$args \"$file\""
5127 if test -z "$run"; then
5128 if test -n "$shlibpath_var"; then
5129 # Export the shlibpath_var.
5130 eval "export $shlibpath_var"
5133 # Restore saved enviroment variables
5134 if test "${save_LC_ALL+set}" = set; then
5135 LC_ALL
="$save_LC_ALL"; export LC_ALL
5137 if test "${save_LANG+set}" = set; then
5138 LANG
="$save_LANG"; export LANG
5141 # Now prepare to actually exec the command.
5142 exec_cmd
="\$cmd$args"
5144 # Display what would be done.
5145 if test -n "$shlibpath_var"; then
5146 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5147 $echo "export $shlibpath_var"
5154 # libtool clean and uninstall mode
5156 modename
="$modename: $mode"
5162 # This variable tells wrapper scripts just to set variables rather
5163 # than running their programs.
5164 libtool_install_magic
="$magic"
5169 -f) rm="$rm $arg"; rmforce
=yes ;;
5170 -*) rm="$rm $arg" ;;
5171 *) files
="$files $arg" ;;
5175 if test -z "$rm"; then
5176 $echo "$modename: you must specify an RM program" 1>&2
5183 for file in $files; do
5184 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5185 if test "X$dir" = "X$file"; then
5189 objdir
="$dir/$objdir"
5191 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5192 test "$mode" = uninstall
&& objdir
="$dir"
5194 # Remember objdir for removal later, being careful to avoid duplicates
5195 if test "$mode" = clean
; then
5198 *) rmdirs
="$rmdirs $objdir" ;;
5202 # Don't error if the file doesn't exist and rm -f was used.
5203 if (test -L "$file") >/dev
/null
2>&1 \
5204 ||
(test -h "$file") >/dev
/null
2>&1 \
5205 ||
test -f "$file"; then
5207 elif test -d "$file"; then
5210 elif test "$rmforce" = yes; then
5218 # Possibly a libtool archive, so verify it.
5219 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5222 # Delete the libtool libraries and symlinks.
5223 for n
in $library_names; do
5224 rmfiles
="$rmfiles $objdir/$n"
5226 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
5227 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
5229 if test "$mode" = uninstall
; then
5230 if test -n "$library_names"; then
5231 # Do each command in the postuninstall commands.
5232 eval cmds
=\"$postuninstall_cmds\"
5233 save_ifs
="$IFS"; IFS
='~'
5234 for cmd
in $cmds; do
5238 if test "$?" -ne 0 && test "$rmforce" != yes; then
5245 if test -n "$old_library"; then
5246 # Do each command in the old_postuninstall commands.
5247 eval cmds
=\"$old_postuninstall_cmds\"
5248 save_ifs
="$IFS"; IFS
='~'
5249 for cmd
in $cmds; do
5253 if test "$?" -ne 0 && test "$rmforce" != yes; then
5259 # FIXME: should reinstall the best remaining shared library.
5265 # Possibly a libtool object, so verify it.
5266 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5271 # Add PIC object to the list of files to remove.
5272 if test -n "$pic_object" \
5273 && test "$pic_object" != none
; then
5274 rmfiles
="$rmfiles $dir/$pic_object"
5277 # Add non-PIC object to the list of files to remove.
5278 if test -n "$non_pic_object" \
5279 && test "$non_pic_object" != none
; then
5280 rmfiles
="$rmfiles $dir/$non_pic_object"
5286 # Do a test to see if this is a libtool program.
5287 if test "$mode" = clean
&&
5288 (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
5292 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5293 if test "$fast_install" = yes && test -n "$relink_command"; then
5294 rmfiles
="$rmfiles $objdir/lt-$name"
5299 $show "$rm $rmfiles"
5300 $run $rm $rmfiles || exit_status
=1
5303 # Try to remove the ${objdir}s in the directories where we deleted files
5304 for dir
in $rmdirs; do
5305 if test -d "$dir"; then
5307 $run rmdir $dir >/dev
/null
2>&1
5315 $echo "$modename: you must specify a MODE" 1>&2
5316 $echo "$generic_help" 1>&2
5321 if test -z "$exec_cmd"; then
5322 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5323 $echo "$generic_help" 1>&2
5326 fi # test -z "$show_help"
5328 if test -n "$exec_cmd"; then
5333 # We need to display help for each of the modes.
5336 "Usage: $modename [OPTION]... [MODE-ARG]...
5338 Provide generalized library-building support services.
5340 --config show all configuration variables
5341 --debug enable verbose shell tracing
5342 -n, --dry-run display commands without modifying any files
5343 --features display basic configuration information and exit
5344 --finish same as \`--mode=finish'
5345 --help display this help message and exit
5346 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5347 --quiet same as \`--silent'
5348 --silent don't print informational messages
5349 --tag=TAG use configuration variables from tag TAG
5350 --version print version information
5352 MODE must be one of the following:
5354 clean remove files from the build directory
5355 compile compile a source file into a libtool object
5356 execute automatically set library path, then run a program
5357 finish complete the installation of libtool libraries
5358 install install libraries or executables
5359 link create a library or an executable
5360 uninstall remove libraries from an installed directory
5362 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5363 a more detailed description of MODE."
5369 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5371 Remove files from the build directory.
5373 RM is the name of the program to use to delete files associated with each FILE
5374 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5377 If FILE is a libtool library, object or program, all the files associated
5378 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5383 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5385 Compile a source file into a libtool library object.
5387 This mode accepts the following additional options:
5389 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5390 -prefer-pic try to building PIC objects only
5391 -prefer-non-pic try to building non-PIC objects only
5392 -static always build a \`.o' file suitable for static linking
5394 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5395 from the given SOURCEFILE.
5397 The output file name is determined by removing the directory component from
5398 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5399 library object suffix, \`.lo'."
5404 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5406 Automatically set library path, then run a program.
5408 This mode accepts the following additional options:
5410 -dlopen FILE add the directory containing FILE to the library path
5412 This mode sets the library path environment variable according to \`-dlopen'
5415 If any of the ARGS are libtool executable wrappers, then they are translated
5416 into their corresponding uninstalled binary, and any of their required library
5417 directories are added to the library path.
5419 Then, COMMAND is executed, with ARGS as arguments."
5424 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5426 Complete the installation of libtool libraries.
5428 Each LIBDIR is a directory that contains libtool libraries.
5430 The commands that this mode executes may require superuser privileges. Use
5431 the \`--dry-run' option if you just want to see what would be executed."
5436 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5438 Install executables or libraries.
5440 INSTALL-COMMAND is the installation command. The first component should be
5441 either the \`install' or \`cp' program.
5443 The rest of the components are interpreted as arguments to that command (only
5444 BSD-compatible install options are recognized)."
5449 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5451 Link object files or libraries together to form another library, or to
5452 create an executable program.
5454 LINK-COMMAND is a command using the C compiler that you would use to create
5455 a program from several object files.
5457 The following components of LINK-COMMAND are treated specially:
5459 -all-static do not do any dynamic linking at all
5460 -avoid-version do not add a version suffix if possible
5461 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5462 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5463 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5464 -export-symbols SYMFILE
5465 try to export only the symbols listed in SYMFILE
5466 -export-symbols-regex REGEX
5467 try to export only the symbols matching REGEX
5468 -LLIBDIR search LIBDIR for required installed libraries
5469 -lNAME OUTPUT-FILE requires the installed library libNAME
5470 -module build a library that can dlopened
5471 -no-fast-install disable the fast-install mode
5472 -no-install link a not-installable executable
5473 -no-undefined declare that a library does not refer to external symbols
5474 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5475 -objectlist FILE Use a list of object files found in FILE to specify objects
5476 -release RELEASE specify package release information
5477 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5478 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5479 -static do not do any dynamic linking of libtool libraries
5480 -version-info CURRENT[:REVISION[:AGE]]
5481 specify library version info [each variable defaults to 0]
5483 All other options (arguments beginning with \`-') are ignored.
5485 Every other argument is treated as a filename. Files ending in \`.la' are
5486 treated as uninstalled libtool libraries, other files are standard or library
5489 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5490 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5491 required, except when creating a convenience library.
5493 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5494 using \`ar' and \`ranlib', or on Windows using \`lib'.
5496 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5497 is created, otherwise an executable program is created."
5502 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5504 Remove libraries from an installation directory.
5506 RM is the name of the program to use to delete files associated with each FILE
5507 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5510 If FILE is a libtool library, all the files associated with it are deleted.
5511 Otherwise, only FILE itself is deleted using RM."
5515 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5522 $echo "Try \`$modename --help' for more information about other modes."
5526 # The TAGs below are defined such that we never get into a situation
5527 # in which we disable both kinds of libraries. Given conflicting
5528 # choices, we go for a static library, that is the most portable,
5529 # since we can't tell whether shared libraries were disabled because
5530 # the user asked for that or because the platform doesn't support
5531 # them. This is particularly important on AIX, because we don't
5532 # support having both static and shared libraries enabled at the same
5533 # time on that platform, so we default to a shared-only configuration.
5534 # If a disable-shared tag is given, we'll fallback to a static-only
5535 # configuration. But we'll never go from static-only to shared-only.
5537 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
5538 build_libtool_libs
=no
5540 # ### END LIBTOOL TAG CONFIG: disable-shared
5542 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
5543 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
5544 # ### END LIBTOOL TAG CONFIG: disable-static