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, 2003
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Check that we have a working $echo.
28 if test "X$1" = X--no-reexec
; then
29 # Discard the --no-reexec flag, and continue.
31 elif test "X$1" = X--fallback-echo
; then
32 # Avoid inline document here, it may be left over
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
35 # Yippee, $echo works!
38 # Restart under the correct shell, and then maybe $echo will work.
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 # Same for EGREP, and just to be sure, do LTCC as well
42 if test "x$EGREP" = x
; then
45 if test "x$LTCC" = x
; then
49 if test "X$1" = X--fallback-echo
; then
50 # used as fallback echo
58 # The name of this program.
59 progname
=`$echo "$0" | ${SED} 's%^.*/%%'`
66 TIMESTAMP
=" (1.1240 2003/06/26 06:55:19)"
69 help="Try \`$progname --help' for more information."
70 magic
="%%%MAGIC variable%%%"
75 # Sed substitution that helps us do robust quoting. It backslashifies
76 # metacharacters that are still active within double-quoted strings.
77 Xsed
="${SED}"' -e 1s/^X//'
78 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
79 # test EBCDIC or ASCII
80 case `echo A|tr A '\301'` in
81 A
) # EBCDIC based system
82 SP2NL
="tr '\100' '\n'"
83 NL2SP
="tr '\r\n' '\100\100'"
85 *) # Assume ASCII based system
86 SP2NL
="tr '\040' '\012'"
87 NL2SP
="tr '\015\012' '\040\040'"
92 # Only set LANG and LC_ALL to C if already set.
93 # These must not be set unconditionally because not all systems understand
94 # e.g. LANG=C (notably SCO).
95 # We save the old values to restore during execute mode.
96 if test "${LC_ALL+set}" = set; then
97 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
99 if test "${LANG+set}" = set; then
100 save_LANG
="$LANG"; LANG
=C
; export LANG
103 # Make sure IFS has a sensible default
106 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
107 $echo "$modename: not configured to build any kind of library" 1>&2
108 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
121 lo2o
="s/\\.lo\$/.${objext}/"
122 o2lo
="s/\\.${objext}\$/.lo/"
124 if test -z "$max_cmd_len"; then
129 # If test is not a shell built-in, we'll probably end up computing a
130 # maximum length that is only half of the actual maximum length, but
132 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
133 = "XX$testring") >/dev
/null
2>&1 &&
134 new_result
=`expr "X$testring" : ".*" 2>&1` &&
135 max_cmd_len
="$new_result" &&
136 test "$i" != 17 # 1/2 MB should be enough
139 testring
="$testring$testring"
142 # Add a significant safety factor because C++ compilers can tack on massive
143 # amounts of additional arguments before passing them to the linker.
144 # It appears as though 1/2 is a usable value.
145 max_cmd_len
=`expr $max_cmd_len \/ 2`
148 #####################################
149 # Shell function definitions:
150 # This seems to be the best place for them
152 # Need a lot of goo to handle *both* DLLs and import libs
153 # Has to be a shell function in order to 'eat' the argument
154 # that is supplied when $file_magic_command is called.
156 win32_libid_type
="unknown"
157 win32_fileres
=`file -L $1 2>/dev/null`
158 case $win32_fileres in
159 *ar\ archive\ import\ library
*) # definitely import
160 win32_libid_type
="x86 archive import"
162 *ar\ archive
*) # could be an import, or static
163 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
164 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
165 win32_nmres
=`eval $NM -f posix -A $1 | \
166 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
167 if test "X$win32_nmres" = "Ximport" ; then
168 win32_libid_type
="x86 archive import"
170 win32_libid_type
="x86 archive static"
175 win32_libid_type
="x86 DLL"
177 *executable
*) # but shell scripts are "executable" too...
178 case $win32_fileres in
179 *MS\ Windows\ PE\ Intel
*)
180 win32_libid_type
="x86 DLL"
185 $echo $win32_libid_type
188 # End of Shell function definitions
189 #####################################
191 # Parse our command line options once, thoroughly.
192 while test "$#" -gt 0
198 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
202 # If the previous option needs an argument, assign it.
203 if test -n "$prev"; then
206 execute_dlfiles
="$execute_dlfiles $arg"
211 # Check whether tagname contains only valid characters
214 $echo "$progname: invalid tag name: $tagname" 1>&2
221 # Don't test for the "default" C tag, as we know, it's there, but
222 # not specially marked.
225 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev
/null
; then
226 taglist
="$taglist $tagname"
227 # Evaluate the configuration.
228 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
230 $echo "$progname: ignoring unknown tag $tagname" 1>&2
245 # Have we seen a non-optional argument yet?
252 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
254 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
255 $echo "This is free software; see the source for copying conditions. There is NO"
256 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
261 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
262 # Now print the configurations for the tags.
263 for tagname
in $taglist; do
264 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
270 $echo "$progname: enabling shell trace mode"
280 if test "$build_libtool_libs" = yes; then
281 $echo "enable shared libraries"
283 $echo "disable shared libraries"
285 if test "$build_old_libs" = yes; then
286 $echo "enable static libraries"
288 $echo "disable static libraries"
293 --finish) mode
="finish" ;;
295 --mode) prevopt
="--mode" prev
=mode
;;
296 --mode=*) mode
="$optarg" ;;
298 --preserve-dup-deps) duplicate_deps
="yes" ;;
304 --tag) prevopt
="--tag" prev
=tag
;;
306 set tag
"$optarg" ${1+"$@"}
317 $echo "$modename: unrecognized option \`$arg'" 1>&2
329 if test -n "$prevopt"; then
330 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
335 # If this variable is set in any of the actions, the command in it
336 # will be execed at the end. This prevents here-documents from being
337 # left over by shells.
340 if test -z "$show_help"; then
342 # Infer the operation mode.
343 if test -z "$mode"; then
344 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
345 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
347 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
*)
359 *db |
*dbx |
*strace |
*truss
)
369 # If we have no mode, but dlfiles were specified, then do execute mode.
370 test -n "$execute_dlfiles" && mode
=execute
372 # Just use the default operation mode.
373 if test -z "$mode"; then
374 if test -n "$nonopt"; then
375 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
377 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
384 # Only execute mode is allowed to have -dlopen flags.
385 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
386 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
391 # Change the help message to a mode-specific one.
393 help="Try \`$modename --help --mode=$mode' for more information."
395 # These modes are in order of execution frequency so that they run quickly.
397 # libtool compile mode
399 modename
="$modename: compile"
400 # Get the compilation command and the source file.
402 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
411 # do not "continue". Instead, add this to base_compile
423 # Accept any command-line options.
426 if test -n "$libobj" ; then
427 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
450 arg_mode
=arg
# the next one goes into the "base_compile" arg list
451 continue # The current "srcfile" will either be retained or
452 ;; # replaced later. I would guess that would be a bug.
455 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
457 save_ifs
="$IFS"; IFS
=','
461 # Double-quote args containing other shell metacharacters.
462 # Many Bourne shells cannot handle close brackets correctly
463 # in scan sets, so we specify it separately.
465 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
469 lastarg
="$lastarg $arg"
472 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
474 # Add the arguments to base_compile.
475 base_compile
="$base_compile $lastarg"
480 # Accept the current argument as the source file.
481 # The previous "srcfile" becomes the current argument.
488 esac # case $arg_mode
490 # Aesthetically quote the previous argument.
491 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
494 # Double-quote args containing other shell metacharacters.
495 # Many Bourne shells cannot handle close brackets correctly
496 # in scan sets, so we specify it separately.
497 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
498 lastarg
="\"$lastarg\""
502 base_compile
="$base_compile $lastarg"
507 $echo "$modename: you must specify an argument for -Xcompile"
511 $echo "$modename: you must specify a target with \`-o'" 1>&2
515 # Get the name of the library object.
516 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
520 # Recognize several different file suffixes.
521 # If the user specifies -o file.o, it is replaced with file.lo
531 *.class
) xform
=class
;;
536 *.java
) xform
=java
;;
539 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
542 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
544 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
549 # Infer tagged configuration to use if any are available and
550 # if one wasn't chosen via the "--tag" command line option.
551 # Only attempt this if the compiler in the base compile
552 # command doesn't match the default compiler.
553 if test -n "$available_tags" && test -z "$tagname"; then
554 case $base_compile in
555 # Blanks in the command may have been stripped by the calling shell,
556 # but not from the CC environment variable when configure was run.
557 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "*) ;;
558 # Blanks at the start of $base_compile will cause this to fail
559 # if we don't check for them as well.
561 for z
in $available_tags; do
562 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
563 # Evaluate the configuration.
564 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
565 case "$base_compile " in
566 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
567 # The compiler in the base compile command matches
568 # the one in the tagged configuration.
569 # Assume this is the tagged configuration we want.
576 # If $tagname still isn't set, then no tagged configuration
577 # was found and let the user know that the "--tag" command
578 # line option must be used.
579 if test -z "$tagname"; then
580 $echo "$modename: unable to infer tagged configuration"
581 $echo "$modename: specify a tag with \`--tag'" 1>&2
584 # $echo "$modename: using $tagname tagged configuration"
590 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
591 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
592 if test "X$xdir" = "X$obj"; then
597 lobj
=${xdir}$objdir/$objname
599 if test -z "$base_compile"; then
600 $echo "$modename: you must specify a compilation command" 1>&2
605 # Delete any leftover library objects.
606 if test "$build_old_libs" = yes; then
607 removelist
="$obj $lobj $libobj ${libobj}T"
609 removelist
="$lobj $libobj ${libobj}T"
613 trap "$run $rm $removelist; exit 1" 1 2 15
615 # On Cygwin there's no "real" PIC flag so we must build both object types
617 cygwin
* | mingw
* | pw32
* | os2
*)
621 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
622 # non-PIC code in shared libraries is not supported
626 # Calculate the filename of the output object if compiler does
627 # not support -o with -c
628 if test "$compiler_c_o" = no
; then
629 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
630 lockfile
="$output_obj.lock"
631 removelist
="$removelist $output_obj $lockfile"
632 trap "$run $rm $removelist; exit 1" 1 2 15
639 # Lock this critical section if it is needed
640 # We use this script file to make the link, it avoids creating a new file
641 if test "$need_locks" = yes; then
642 until $run ln "$0" "$lockfile" 2>/dev
/null
; do
643 $show "Waiting for $lockfile to be removed"
646 elif test "$need_locks" = warn
; then
647 if test -f "$lockfile"; then
649 *** ERROR, $lockfile exists and contains:
650 `cat $lockfile 2>/dev/null`
652 This indicates that another process is trying to use the same
653 temporary object file, and libtool could not work around it because
654 your compiler does not support \`-c' and \`-o' together. If you
655 repeat this compilation, it may succeed, by chance, but you had better
656 avoid parallel builds (make -j) in this platform, or get a better
662 $echo $srcfile > "$lockfile"
665 if test -n "$fix_srcfile_path"; then
666 eval srcfile
=\"$fix_srcfile_path\"
669 $run $rm "$libobj" "${libobj}T"
671 # Create a libtool object file (analogous to a ".la" file),
672 # but don't create it if we're doing a dry run.
673 test -z "$run" && cat > ${libobj}T
<<EOF
674 # $libobj - a libtool object file
675 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
677 # Please DO NOT delete this file!
678 # It is necessary for linking the library.
680 # Name of the PIC object.
683 # Only build a PIC object if we are building libtool libraries.
684 if test "$build_libtool_libs" = yes; then
685 # Without this assignment, base_compile gets emptied.
686 fbsd_hideous_sh_bug
=$base_compile
688 if test "$pic_mode" != no
; then
689 command="$base_compile $srcfile $pic_flag"
691 # Don't build PIC code
692 command="$base_compile $srcfile"
695 if test ! -d "${xdir}$objdir"; then
696 $show "$mkdir ${xdir}$objdir"
697 $run $mkdir ${xdir}$objdir
699 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
704 if test -z "$output_obj"; then
705 # Place PIC objects in $objdir
706 command="$command -o $lobj"
709 $run $rm "$lobj" "$output_obj"
712 if $run eval "$command"; then :
714 test -n "$output_obj" && $run $rm $removelist
718 if test "$need_locks" = warn
&&
719 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
721 *** ERROR, $lockfile contains:
722 `cat $lockfile 2>/dev/null`
724 but it should contain:
727 This indicates that another process is trying to use the same
728 temporary object file, and libtool could not work around it because
729 your compiler does not support \`-c' and \`-o' together. If you
730 repeat this compilation, it may succeed, by chance, but you had better
731 avoid parallel builds (make -j) in this platform, or get a better
738 # Just move the object if needed, then go on to compile the next one
739 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
740 $show "$mv $output_obj $lobj"
741 if $run $mv $output_obj $lobj; then :
749 # Append the name of the PIC object to the libtool object file.
750 test -z "$run" && cat >> ${libobj}T
<<EOF
751 pic_object='$objdir/$objname'
755 # Allow error messages only from the first compilation.
756 suppress_output
=' >/dev/null 2>&1'
758 # No PIC object so indicate it doesn't exist in the libtool
760 test -z "$run" && cat >> ${libobj}T
<<EOF
766 # Only build a position-dependent object if we build old libraries.
767 if test "$build_old_libs" = yes; then
768 if test "$pic_mode" != yes; then
769 # Don't build PIC code
770 command="$base_compile $srcfile"
772 command="$base_compile $srcfile $pic_flag"
774 if test "$compiler_c_o" = yes; then
775 command="$command -o $obj"
778 # Suppress compiler output if we already did a PIC compilation.
779 command="$command$suppress_output"
780 $run $rm "$obj" "$output_obj"
782 if $run eval "$command"; then :
788 if test "$need_locks" = warn
&&
789 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
791 *** ERROR, $lockfile contains:
792 `cat $lockfile 2>/dev/null`
794 but it should contain:
797 This indicates that another process is trying to use the same
798 temporary object file, and libtool could not work around it because
799 your compiler does not support \`-c' and \`-o' together. If you
800 repeat this compilation, it may succeed, by chance, but you had better
801 avoid parallel builds (make -j) in this platform, or get a better
808 # Just move the object if needed
809 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
810 $show "$mv $output_obj $obj"
811 if $run $mv $output_obj $obj; then :
819 # Append the name of the non-PIC object the libtool object file.
820 # Only append if the libtool object file exists.
821 test -z "$run" && cat >> ${libobj}T
<<EOF
822 # Name of the non-PIC object.
823 non_pic_object='$objname'
827 # Append the name of the non-PIC object the libtool object file.
828 # Only append if the libtool object file exists.
829 test -z "$run" && cat >> ${libobj}T
<<EOF
830 # Name of the non-PIC object.
836 $run $mv "${libobj}T" "${libobj}"
838 # Unlock the critical section if it was locked
839 if test "$need_locks" != no
; then
848 modename
="$modename: link"
850 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
851 # It is impossible to link a dll without this setting, and
852 # we shouldn't force the makefile maintainer to figure out
853 # which system we are compiling for in order to pass an extra
854 # flag for every libtool invocation.
857 # FIXME: Unfortunately, there are problems with the above when trying
858 # to make a dll which has undefined symbols, in which case not
859 # even a static library is built. For now, we need to specify
860 # -no-undefined on the libtool link line when we can be certain
861 # that all symbols are satisfied, otherwise we get a static library.
868 libtool_args
="$nonopt"
869 base_compile
="$nonopt"
870 compile_command
="$nonopt"
871 finalize_command
="$nonopt"
885 lib_search_path
=`pwd`
894 export_symbols_regex
=
902 prefer_static_libs
=no
915 # We need to know -static, to get the right output filenames.
919 -all-static |
-static)
920 if test "X$arg" = "X-all-static"; then
921 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
922 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
924 if test -n "$link_static_flag"; then
925 dlopen_self
=$dlopen_self_static
928 if test -z "$pic_flag" && test -n "$link_static_flag"; then
929 dlopen_self
=$dlopen_self_static
932 build_libtool_libs
=no
934 prefer_static_libs
=yes
940 # See if our shared archives depend on static archives.
941 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
943 # Go through the arguments, transforming them on the way.
944 while test "$#" -gt 0; do
946 base_compile
="$base_compile $arg"
949 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
950 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
954 libtool_args
="$libtool_args $qarg"
956 # If the previous option needs an argument, assign it.
957 if test -n "$prev"; then
960 compile_command
="$compile_command @OUTPUT@"
961 finalize_command
="$finalize_command @OUTPUT@"
967 if test "$preload" = no
; then
968 # Add the symbol object into the linking commands.
969 compile_command
="$compile_command @SYMFILE@"
970 finalize_command
="$finalize_command @SYMFILE@"
974 *.la |
*.lo
) ;; # We handle these cases below.
976 if test "$dlself" = no
; then
984 if test "$prev" = dlprefiles
; then
986 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
996 if test "$prev" = dlfiles
; then
997 dlfiles
="$dlfiles $arg"
999 dlprefiles
="$dlprefiles $arg"
1007 export_symbols
="$arg"
1008 if test ! -f "$arg"; then
1009 $echo "$modename: symbol file \`$arg' does not exist"
1016 export_symbols_regex
="$arg"
1021 inst_prefix_dir
="$arg"
1031 if test -f "$arg"; then
1034 for fil
in `cat $save_arg`
1036 # moreargs="$moreargs $fil"
1038 # A libtool-controlled object.
1040 # Check to see that this really is a libtool object.
1041 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1046 # If there is no directory component, then add one.
1048 */* |
*\\*) .
$arg ;;
1052 if test -z "$pic_object" || \
1053 test -z "$non_pic_object" ||
1054 test "$pic_object" = none
&& \
1055 test "$non_pic_object" = none
; then
1056 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1060 # Extract subdirectory from the argument.
1061 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1062 if test "X$xdir" = "X$arg"; then
1068 if test "$pic_object" != none
; then
1069 # Prepend the subdirectory the object is found in.
1070 pic_object
="$xdir$pic_object"
1072 if test "$prev" = dlfiles
; then
1073 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1074 dlfiles
="$dlfiles $pic_object"
1078 # If libtool objects are unsupported, then we need to preload.
1083 # CHECK ME: I think I busted this. -Ossama
1084 if test "$prev" = dlprefiles
; then
1085 # Preload the old-style object.
1086 dlprefiles
="$dlprefiles $pic_object"
1091 libobjs
="$libobjs $pic_object"
1096 if test "$non_pic_object" != none
; then
1097 # Prepend the subdirectory the object is found in.
1098 non_pic_object
="$xdir$non_pic_object"
1100 # A standard non-PIC object
1101 non_pic_objects
="$non_pic_objects $non_pic_object"
1102 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1103 arg
="$non_pic_object"
1107 # Only an error if not doing a dry-run.
1108 if test -z "$run"; then
1109 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1114 # Extract subdirectory from the argument.
1115 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1116 if test "X$xdir" = "X$arg"; then
1122 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1123 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1124 libobjs
="$libobjs $pic_object"
1125 non_pic_objects
="$non_pic_objects $non_pic_object"
1130 $echo "$modename: link input file \`$save_arg' does not exist"
1138 # We need an absolute path.
1140 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1142 $echo "$modename: only absolute run-paths are allowed" 1>&2
1146 if test "$prev" = rpath
; then
1149 *) rpath
="$rpath $arg" ;;
1154 *) xrpath
="$xrpath $arg" ;;
1161 compiler_flags
="$compiler_flags $qarg"
1163 compile_command
="$compile_command $qarg"
1164 finalize_command
="$finalize_command $qarg"
1168 linker_flags
="$linker_flags $qarg"
1169 compiler_flags
="$compiler_flags $wl$qarg"
1171 compile_command
="$compile_command $wl$qarg"
1172 finalize_command
="$finalize_command $wl$qarg"
1176 linker_flags
="$linker_flags $qarg"
1177 compiler_flags
="$compiler_flags $qarg"
1179 compile_command
="$compile_command $qarg"
1180 finalize_command
="$finalize_command $qarg"
1187 *" $qarg.ltframework "*) ;;
1188 *) deplibs
="$deplibs $qarg.ltframework" # this is fixed later
1197 eval "$prev=\"\$arg\""
1202 fi # test -n "$prev"
1208 if test -n "$link_static_flag"; then
1209 compile_command
="$compile_command $link_static_flag"
1210 finalize_command
="$finalize_command $link_static_flag"
1216 # FIXME: remove this flag sometime in the future.
1217 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1241 -export-symbols |
-export-symbols-regex)
1242 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1243 $echo "$modename: more than one -exported-symbols argument is not allowed"
1246 if test "X$arg" = "X-export-symbols"; then
1259 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1260 # so, if we see these flags be careful not to treat them like -L
1262 case $with_gcc/$host in
1263 no
/*-*-irix* |
/*-*-irix*)
1264 compile_command
="$compile_command $arg"
1265 finalize_command
="$finalize_command $arg"
1272 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1273 # We need an absolute path.
1275 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1277 absdir
=`cd "$dir" && pwd`
1278 if test -z "$absdir"; then
1279 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1288 deplibs
="$deplibs -L$dir"
1289 lib_search_path
="$lib_search_path $dir"
1293 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1294 case :$dllsearchpath: in
1296 *) dllsearchpath
="$dllsearchpath:$dir";;
1304 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1306 *-*-cygwin* |
*-*-pw32* |
*-*-beos*)
1307 # These systems don't actually have a C or math library (as such)
1310 *-*-mingw* |
*-*-os2*)
1311 # These systems don't actually have a C library (as such)
1312 test "X$arg" = "X-lc" && continue
1314 *-*-openbsd* |
*-*-freebsd*)
1315 # Do not include libc due to us having libc/libc_r.
1316 test "X$arg" = "X-lc" && continue
1318 *-*-rhapsody* |
*-*-darwin1.
[012])
1319 # Rhapsody C and math libraries are in the System framework
1320 deplibs
="$deplibs System.ltframework"
1323 elif test "X$arg" = "X-lc_r"; then
1326 # Do not include libc_r directly, use -pthread flag.
1331 deplibs
="$deplibs $arg"
1340 # gcc -m* arguments should be passed to the linker via $compiler_flags
1341 # in order to pass architecture information to the linker
1342 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1343 # but this is not reliable with gcc because gcc may use -mfoo to
1344 # select a different linker, different libraries, etc, while
1345 # -Wl,-mfoo simply passes -mfoo to the linker.
1347 # Unknown arguments in both finalize_command and compile_command need
1348 # to be aesthetically quoted because they are evaled later.
1349 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1351 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1355 compile_command
="$compile_command $arg"
1356 finalize_command
="$finalize_command $arg"
1357 if test "$with_gcc" = "yes" ; then
1358 compiler_flags
="$compiler_flags $arg"
1375 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1376 # The PATH hackery in wrapper scripts is required on Windows
1377 # in order for the loader to find any dlls it needs.
1378 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1379 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1382 *) no_install
=yes ;;
1415 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1416 # We need an absolute path.
1418 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1420 $echo "$modename: only absolute run-paths are allowed" 1>&2
1426 *) xrpath
="$xrpath $dir" ;;
1432 # The effects of -static are defined in a previous loop.
1433 # We used to do the same as -all-static on platforms that
1434 # didn't have a PIC flag, but the assumption that the effects
1435 # would be equivalent was wrong. It would break on at least
1436 # Digital Unix and AIX.
1456 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1458 save_ifs
="$IFS"; IFS
=','
1459 for flag
in $args; do
1462 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1467 compiler_flags
="$compiler_flags $flag"
1470 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1474 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1476 save_ifs
="$IFS"; IFS
=','
1477 for flag
in $args; do
1480 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1485 compiler_flags
="$compiler_flags $wl$flag"
1486 linker_flags
="$linker_flags $flag"
1489 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1512 # Some other compiler flag.
1514 # Unknown arguments in both finalize_command and compile_command need
1515 # to be aesthetically quoted because they are evaled later.
1516 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1518 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1522 add_flags
="$add_flags $arg"
1526 # A standard object.
1531 # A libtool-controlled object.
1533 # Check to see that this really is a libtool object.
1534 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1539 # If there is no directory component, then add one.
1541 */* |
*\\*) .
$arg ;;
1545 if test -z "$pic_object" || \
1546 test -z "$non_pic_object" ||
1547 test "$pic_object" = none
&& \
1548 test "$non_pic_object" = none
; then
1549 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1553 # Extract subdirectory from the argument.
1554 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1555 if test "X$xdir" = "X$arg"; then
1561 if test "$pic_object" != none
; then
1562 # Prepend the subdirectory the object is found in.
1563 pic_object
="$xdir$pic_object"
1565 if test "$prev" = dlfiles
; then
1566 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1567 dlfiles
="$dlfiles $pic_object"
1571 # If libtool objects are unsupported, then we need to preload.
1576 # CHECK ME: I think I busted this. -Ossama
1577 if test "$prev" = dlprefiles
; then
1578 # Preload the old-style object.
1579 dlprefiles
="$dlprefiles $pic_object"
1584 libobjs
="$libobjs $pic_object"
1589 if test "$non_pic_object" != none
; then
1590 # Prepend the subdirectory the object is found in.
1591 non_pic_object
="$xdir$non_pic_object"
1593 # A standard non-PIC object
1594 non_pic_objects
="$non_pic_objects $non_pic_object"
1595 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1596 arg
="$non_pic_object"
1600 # Only an error if not doing a dry-run.
1601 if test -z "$run"; then
1602 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1607 # Extract subdirectory from the argument.
1608 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1609 if test "X$xdir" = "X$arg"; then
1615 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1616 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1617 libobjs
="$libobjs $pic_object"
1618 non_pic_objects
="$non_pic_objects $non_pic_object"
1625 deplibs
="$deplibs $arg"
1626 old_deplibs
="$old_deplibs $arg"
1631 # A libtool-controlled library.
1633 if test "$prev" = dlfiles
; then
1634 # This library was specified with -dlopen.
1635 dlfiles
="$dlfiles $arg"
1637 elif test "$prev" = dlprefiles
; then
1638 # The library was specified with -dlpreopen.
1639 dlprefiles
="$dlprefiles $arg"
1642 deplibs
="$deplibs $arg"
1647 # Some other compiler argument.
1649 # Unknown arguments in both finalize_command and compile_command need
1650 # to be aesthetically quoted because they are evaled later.
1651 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1653 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1657 add_flags
="$add_flags $arg"
1661 # Now actually substitute the argument into the commands.
1662 if test -n "$arg"; then
1663 compile_command
="$compile_command $arg"
1664 finalize_command
="$finalize_command $arg"
1666 done # argument parsing loop
1668 if test -n "$prev"; then
1669 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1674 # Infer tagged configuration to use if any are available and
1675 # if one wasn't chosen via the "--tag" command line option.
1676 # Only attempt this if the compiler in the base link
1677 # command doesn't match the default compiler.
1678 if test -n "$available_tags" && test -z "$tagname"; then
1679 case $base_compile in
1680 # Blanks in the command may have been stripped by the calling shell,
1681 # but not from the CC environment variable when configure was run.
1682 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*) ;;
1683 # Blanks at the start of $base_compile will cause this to fail
1684 # if we don't check for them as well.
1686 for z
in $available_tags; do
1687 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev
/null
; then
1688 # Evaluate the configuration.
1689 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1690 case $base_compile in
1691 "$CC "* |
" $CC "* |
"`$echo $CC` "* |
" `$echo $CC` "*)
1692 # The compiler in $compile_command matches
1693 # the one in the tagged configuration.
1694 # Assume this is the tagged configuration we want.
1701 # If $tagname still isn't set, then no tagged configuration
1702 # was found and let the user know that the "--tag" command
1703 # line option must be used.
1704 if test -z "$tagname"; then
1705 $echo "$modename: unable to infer tagged configuration"
1706 $echo "$modename: specify a tag with \`--tag'" 1>&2
1709 # $echo "$modename: using $tagname tagged configuration"
1715 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1716 eval arg
=\"$export_dynamic_flag_spec\"
1717 compile_command
="$compile_command $arg"
1718 finalize_command
="$finalize_command $arg"
1722 # calculate the name of the file, without its directory
1723 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1724 libobjs_save
="$libobjs"
1726 if test -n "$shlibpath_var"; then
1727 # get the directories listed in $shlibpath_var
1728 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1732 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1733 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1735 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1736 if test "X$output_objdir" = "X$output"; then
1737 output_objdir
="$objdir"
1739 output_objdir
="$output_objdir/$objdir"
1741 # Create the object directory.
1742 if test ! -d "$output_objdir"; then
1743 $show "$mkdir $output_objdir"
1744 $run $mkdir $output_objdir
1746 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1751 # Determine the type of output
1754 $echo "$modename: you must specify an output file" 1>&2
1758 *.
$libext) linkmode
=oldlib
;;
1759 *.lo |
*.
$objext) linkmode
=obj
;;
1760 *.la
) linkmode
=lib
;;
1761 *) linkmode
=prog
;; # Anything else should be a program.
1765 *cygwin
* |
*mingw
* |
*pw32
*)
1766 # don't eliminate duplcations in $postdeps and $predeps
1767 duplicate_compiler_generated_deps
=yes
1770 duplicate_compiler_generated_deps
=$duplicate_deps
1776 # Find all interdependent deplibs by searching for libraries
1777 # that are linked more than once (e.g. -la -lb -la)
1778 for deplib
in $deplibs; do
1779 if test "X$duplicate_deps" = "Xyes" ; then
1781 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
1784 libs
="$libs $deplib"
1787 if test "$linkmode" = lib
; then
1788 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
1790 # Compute libraries that are listed more than once in $predeps
1791 # $postdeps and mark them as special (i.e., whose duplicates are
1792 # not to be eliminated).
1794 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1795 for pre_post_dep
in $predeps $postdeps; do
1796 case "$pre_post_deps " in
1797 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
1799 pre_post_deps
="$pre_post_deps $pre_post_dep"
1808 need_relink
=no
# whether we're linking any uninstalled libtool libraries
1809 notinst_deplibs
= # not-installed libtool libraries
1810 notinst_path
= # paths that contain not-installed libtool libraries
1814 for file in $dlfiles $dlprefiles; do
1818 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1830 passes
="conv scan dlopen dlpreopen link"
1835 for pass
in $passes; do
1836 if test "$linkmode,$pass" = "lib,link" ||
1837 test "$linkmode,$pass" = "prog,scan"; then
1841 if test "$linkmode" = prog
; then
1843 dlopen
) libs
="$dlfiles" ;;
1844 dlpreopen
) libs
="$dlprefiles" ;;
1845 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1848 if test "$pass" = dlopen
; then
1849 # Collect dlpreopened libraries
1850 save_deplibs
="$deplibs"
1853 for deplib
in $libs; do
1857 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
1858 if test "$linkmode,$pass" = "prog,link"; then
1859 compile_deplibs
="$deplib $compile_deplibs"
1860 finalize_deplibs
="$deplib $finalize_deplibs"
1862 deplibs
="$deplib $deplibs"
1867 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
1868 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1871 if test "$pass" = conv
&& test "$allow_undefined" = yes; then
1872 deplibs
="$deplib $deplibs"
1875 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1876 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1877 for search_ext
in .la
$shrext .so .a
; do
1878 # Search the libtool library
1879 lib
="$searchdir/lib${name}${search_ext}"
1880 if test -f "$lib"; then
1881 if test "$search_ext" = ".la"; then
1890 if test "$found" != yes; then
1891 # deplib doesn't seem to be a libtool library
1892 if test "$linkmode,$pass" = "prog,link"; then
1893 compile_deplibs
="$deplib $compile_deplibs"
1894 finalize_deplibs
="$deplib $finalize_deplibs"
1896 deplibs
="$deplib $deplibs"
1897 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1900 else # deplib is a libtool library
1901 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1902 # We need to do some special things here, and not later.
1903 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1904 case " $predeps $postdeps " in
1906 if (${SED} -e '2q' $lib |
1907 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1911 */* |
*\\*) .
$lib ;;
1914 for l
in $old_library $library_names; do
1917 if test "X$ll" = "X$old_library" ; then # only static version available
1919 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1920 test "X$ladir" = "X$lib" && ladir
="."
1921 lib
=$ladir/$old_library
1922 if test "$linkmode,$pass" = "prog,link"; then
1923 compile_deplibs
="$deplib $compile_deplibs"
1924 finalize_deplibs
="$deplib $finalize_deplibs"
1926 deplibs
="$deplib $deplibs"
1927 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
1939 if test "$linkmode,$pass" = "prog,link"; then
1940 compile_deplibs
="$deplib $compile_deplibs"
1941 finalize_deplibs
="$deplib $finalize_deplibs"
1943 deplibs
="$deplib $deplibs"
1944 if test "$linkmode" = lib
; then
1945 newdependency_libs
="$deplib $newdependency_libs"
1953 deplibs
="$deplib $deplibs"
1954 test "$pass" = conv
&& continue
1955 newdependency_libs
="$deplib $newdependency_libs"
1956 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1959 if test "$pass" = conv
; then
1960 deplibs
="$deplib $deplibs"
1963 if test "$pass" = scan
; then
1964 deplibs
="$deplib $deplibs"
1965 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1967 compile_deplibs
="$deplib $compile_deplibs"
1968 finalize_deplibs
="$deplib $finalize_deplibs"
1972 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1978 if test "$pass" = link
; then
1979 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1980 # Make sure the xrpath contains only unique directories.
1983 *) xrpath
="$xrpath $dir" ;;
1986 deplibs
="$deplib $deplibs"
1989 *.la
) lib
="$deplib" ;;
1991 if test "$pass" = conv
; then
1992 deplibs
="$deplib $deplibs"
1997 if test "$deplibs_check_method" != pass_all
; then
1999 $echo "*** Warning: Trying to link with static lib archive $deplib."
2000 $echo "*** I have the capability to make that library automatically link in when"
2001 $echo "*** you link to this library. But I can only do this if you have a"
2002 $echo "*** shared version of the library, which you do not appear to have"
2003 $echo "*** because the file extensions .$libext of this argument makes me believe"
2004 $echo "*** that it is just a static archive that I should not used here."
2007 $echo "*** Warning: Linking the shared library $output against the"
2008 $echo "*** static library $deplib is not portable!"
2009 deplibs
="$deplib $deplibs"
2014 if test "$pass" != link
; then
2015 deplibs
="$deplib $deplibs"
2017 compile_deplibs
="$deplib $compile_deplibs"
2018 finalize_deplibs
="$deplib $finalize_deplibs"
2025 if test "$pass" = conv
; then
2026 deplibs
="$deplib $deplibs"
2027 elif test "$linkmode" = prog
; then
2028 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2029 # If there is no dlopen support or we're linking statically,
2030 # we need to preload.
2031 newdlprefiles
="$newdlprefiles $deplib"
2032 compile_deplibs
="$deplib $compile_deplibs"
2033 finalize_deplibs
="$deplib $finalize_deplibs"
2035 newdlfiles
="$newdlfiles $deplib"
2045 if test "$found" = yes ||
test -f "$lib"; then :
2047 $echo "$modename: cannot find the library \`$lib'" 1>&2
2051 # Check to see that this really is a libtool archive.
2052 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2054 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2058 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2059 test "X$ladir" = "X$lib" && ladir
="."
2067 # If the library was installed with an old release of libtool,
2068 # it will not redefine variables installed, or shouldnotlink
2074 */* |
*\\*) .
$lib ;;
2080 # Convert "-framework foo" to "foo.ltframework" in dependency_libs
2081 test -n "$dependency_libs" && dependency_libs
=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
2085 if test "$linkmode,$pass" = "lib,link" ||
2086 test "$linkmode,$pass" = "prog,scan" ||
2087 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2088 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2089 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2092 if test "$pass" = conv
; then
2093 # Only check for convenience libraries
2094 deplibs
="$lib $deplibs"
2096 for deplib
in $dependency_libs; do
2097 #echo "Adding $deplib to \$deplibs"
2098 deplibs
="$deplib $deplibs"
2099 if test "X$duplicate_deps" = "Xyes" ; then
2100 case "$tmp_libs " in
2101 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2104 tmp_libs
="$tmp_libs $deplib"
2106 if test -z "$libdir"; then
2107 if test -z "$old_library"; then
2108 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2111 # It is a libtool convenience library, so add in its objects.
2112 convenience
="$convenience $ladir/$objdir/$old_library"
2113 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2114 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2115 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2122 # Get the name of the library we link against.
2124 for l
in $old_library $library_names; do
2127 if test -z "$linklib"; then
2128 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2132 # This library was specified with -dlopen.
2133 if test "$pass" = dlopen
; then
2134 if test -z "$libdir"; then
2135 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2138 if test -z "$dlname" ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2139 # If there is no dlname, no dlopen support or we're linking
2140 # statically, we need to preload. We also need to preload any
2141 # dependent libraries so libltdl's deplib preloader doesn't
2142 # bomb out in the load deplibs phase.
2143 dlprefiles
="$dlprefiles $lib $dependency_libs"
2145 newdlfiles
="$newdlfiles $lib"
2150 # We need an absolute path.
2152 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2154 abs_ladir
=`cd "$ladir" && pwd`
2155 if test -z "$abs_ladir"; then
2156 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2157 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2162 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2164 # Find the relevant object directory and library name.
2165 if test "X$installed" = Xyes
; then
2166 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2167 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2176 dir
="$ladir/$objdir"
2177 absdir
="$abs_ladir/$objdir"
2178 # Remove this search path later
2179 notinst_path
="$notinst_path $abs_ladir"
2180 fi # $installed = yes
2181 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2183 # This library was specified with -dlpreopen.
2184 if test "$pass" = dlpreopen
; then
2185 if test -z "$libdir"; then
2186 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2189 # Prefer using a static library (so that no silly _DYNAMIC symbols
2190 # are required to link).
2191 if test -n "$old_library"; then
2192 newdlprefiles
="$newdlprefiles $dir/$old_library"
2193 # Otherwise, use the dlname, so that lt_dlopen finds it.
2194 elif test -n "$dlname"; then
2195 newdlprefiles
="$newdlprefiles $dir/$dlname"
2197 newdlprefiles
="$newdlprefiles $dir/$linklib"
2199 fi # $pass = dlpreopen
2201 if test -z "$libdir"; then
2202 # Link the convenience library
2203 if test "$linkmode" = lib
; then
2204 deplibs
="$dir/$old_library $deplibs"
2205 elif test "$linkmode,$pass" = "prog,link"; then
2206 compile_deplibs
="$dir/$old_library $compile_deplibs"
2207 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2209 deplibs
="$lib $deplibs" # used for prog,scan pass
2215 if test "$linkmode" = prog
&& test "$pass" != link
; then
2216 newlib_search_path
="$newlib_search_path $ladir"
2217 deplibs
="$lib $deplibs"
2220 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2221 test "$build_libtool_libs" = no
; then
2226 for deplib
in $dependency_libs; do
2228 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2230 # Need to link against all dependency_libs?
2231 if test "$linkalldeplibs" = yes; then
2232 deplibs
="$deplib $deplibs"
2234 # Need to hardcode shared library paths
2235 # or/and link against static libraries
2236 newdependency_libs
="$deplib $newdependency_libs"
2238 if test "X$duplicate_deps" = "Xyes" ; then
2239 case "$tmp_libs " in
2240 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2243 tmp_libs
="$tmp_libs $deplib"
2246 fi # $linkmode = prog...
2248 if test "$linkmode,$pass" = "prog,link"; then
2249 if test -n "$library_names" &&
2250 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2251 # We need to hardcode the library path
2252 if test -n "$shlibpath_var"; then
2253 # Make sure the rpath contains only unique directories.
2254 case "$temp_rpath " in
2257 *) temp_rpath
="$temp_rpath $dir" ;;
2261 # Hardcode the library path.
2262 # Skip directories that are in the system default run-time
2264 case " $sys_lib_dlsearch_path " in
2267 case "$compile_rpath " in
2269 *) compile_rpath
="$compile_rpath $absdir"
2273 case " $sys_lib_dlsearch_path " in
2276 case "$finalize_rpath " in
2278 *) finalize_rpath
="$finalize_rpath $libdir"
2282 fi # $linkmode,$pass = prog,link...
2284 if test "$alldeplibs" = yes &&
2285 { test "$deplibs_check_method" = pass_all ||
2286 { test "$build_libtool_libs" = yes &&
2287 test -n "$library_names"; }; }; then
2288 # We only need to search for static libraries
2293 link_static
=no
# Whether the deplib will be linked statically
2294 if test -n "$library_names" &&
2295 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2296 if test "$installed" = no
; then
2297 notinst_deplibs
="$notinst_deplibs $lib"
2300 # This is a shared library
2302 # Warn about portability, can't link against -module's on some systems (darwin)
2303 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2305 if test "$linkmode" = prog
; then
2306 $echo "*** Warning: Linking the executable $output against the loadable module"
2308 $echo "*** Warning: Linking the shared library $output against the loadable module"
2310 $echo "*** $linklib is not portable!"
2312 if test "$linkmode" = lib
&&
2313 test "$hardcode_into_libs" = yes; then
2314 # Hardcode the library path.
2315 # Skip directories that are in the system default run-time
2317 case " $sys_lib_dlsearch_path " in
2320 case "$compile_rpath " in
2322 *) compile_rpath
="$compile_rpath $absdir"
2326 case " $sys_lib_dlsearch_path " in
2329 case "$finalize_rpath " in
2331 *) finalize_rpath
="$finalize_rpath $libdir"
2337 if test -n "$old_archive_from_expsyms_cmds"; then
2338 # figure out the soname
2339 set dummy
$library_names
2342 libname
=`eval \\$echo \"$libname_spec\"`
2343 # use dlname if we got it. it's perfectly good, no?
2344 if test -n "$dlname"; then
2346 elif test -n "$soname_spec"; then
2350 major
=`expr $current - $age`
2354 eval soname
=\"$soname_spec\"
2359 # Make a new name for the extract_expsyms_cmds to use
2361 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2362 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2364 # If the library has no export list, then create one now
2365 if test -f "$output_objdir/$soname-def"; then :
2367 $show "extracting exported symbol list from \`$soname'"
2368 save_ifs
="$IFS"; IFS
='~'
2369 eval cmds
=\"$extract_expsyms_cmds\"
2370 for cmd
in $cmds; do
2373 $run eval "$cmd" ||
exit $?
2379 if test -f "$output_objdir/$newlib"; then :; else
2380 $show "generating import library for \`$soname'"
2381 save_ifs
="$IFS"; IFS
='~'
2382 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2383 for cmd
in $cmds; do
2386 $run eval "$cmd" ||
exit $?
2390 # make sure the library variables are pointing to the new library
2393 fi # test -n "$old_archive_from_expsyms_cmds"
2395 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2400 case $hardcode_action in
2401 immediate | unsupported
)
2402 if test "$hardcode_direct" = no
; then
2405 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2407 # if the lib is a module then we can not link against it, someone
2408 # is ignoring the new warnings I added
2409 if /usr
/bin
/file -L $add 2> /dev
/null |
grep "bundle" >/dev
/null
; then
2410 $echo "** Warning, lib $linklib is a module, not a shared library"
2411 if test -z "$old_library" ; then
2413 $echo "** And there doesn't seem to be a static archive available"
2414 $echo "** The link will probably fail, sorry"
2416 add
="$dir/$old_library"
2420 elif test "$hardcode_minus_L" = no
; then
2422 *-*-sunos*) add_shlibpath
="$dir" ;;
2426 elif test "$hardcode_shlibpath_var" = no
; then
2427 add_shlibpath
="$dir"
2434 if test "$hardcode_direct" = yes; then
2436 elif test "$hardcode_minus_L" = yes; then
2438 # Try looking first in the location we're being installed to.
2439 if test -n "$inst_prefix_dir"; then
2442 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2447 elif test "$hardcode_shlibpath_var" = yes; then
2448 add_shlibpath
="$dir"
2457 if test "$lib_linked" != yes; then
2458 $echo "$modename: configuration error: unsupported hardcode properties"
2462 if test -n "$add_shlibpath"; then
2463 case :$compile_shlibpath: in
2464 *":$add_shlibpath:"*) ;;
2465 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2468 if test "$linkmode" = prog
; then
2469 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2470 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2472 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2473 test -n "$add" && deplibs
="$add $deplibs"
2474 if test "$hardcode_direct" != yes && \
2475 test "$hardcode_minus_L" != yes && \
2476 test "$hardcode_shlibpath_var" = yes; then
2477 case :$finalize_shlibpath: in
2479 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2485 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2489 # Finalize command for both is simple: just hardcode it.
2490 if test "$hardcode_direct" = yes; then
2491 add
="$libdir/$linklib"
2492 elif test "$hardcode_minus_L" = yes; then
2495 elif test "$hardcode_shlibpath_var" = yes; then
2496 case :$finalize_shlibpath: in
2498 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2501 elif test "$hardcode_automatic" = yes; then
2502 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2503 add
="$inst_prefix_dir$libdir/$linklib"
2505 add
="$libdir/$linklib"
2508 # We cannot seem to hardcode it, guess we'll fake it.
2510 # Try looking first in the location we're being installed to.
2511 if test -n "$inst_prefix_dir"; then
2514 add_dir
="-L$inst_prefix_dir$libdir $add_dir"
2521 if test "$linkmode" = prog
; then
2522 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2523 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2525 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2526 test -n "$add" && deplibs
="$add $deplibs"
2529 elif test "$linkmode" = prog
; then
2530 # Here we assume that one of hardcode_direct or hardcode_minus_L
2531 # is not unsupported. This is valid on all known static and
2533 if test "$hardcode_direct" != unsupported
; then
2534 test -n "$old_library" && linklib
="$old_library"
2535 compile_deplibs
="$dir/$linklib $compile_deplibs"
2536 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2538 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2539 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2541 elif test "$build_libtool_libs" = yes; then
2542 # Not a shared library
2543 if test "$deplibs_check_method" != pass_all
; then
2544 # We're trying link a shared library against a static one
2545 # but the system doesn't support it.
2547 # Just print a warning and add the library to dependency_libs so
2548 # that the program can be linked against the static library.
2550 $echo "*** Warning: This system can not link to static lib archive $lib."
2551 $echo "*** I have the capability to make that library automatically link in when"
2552 $echo "*** you link to this library. But I can only do this if you have a"
2553 $echo "*** shared version of the library, which you do not appear to have."
2554 if test "$module" = yes; then
2555 $echo "*** But as you try to build a module library, libtool will still create "
2556 $echo "*** a static module, that should work as long as the dlopening application"
2557 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2558 if test -z "$global_symbol_pipe"; then
2560 $echo "*** However, this would only work if libtool was able to extract symbol"
2561 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2562 $echo "*** not find such a program. So, this module is probably useless."
2563 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2565 if test "$build_old_libs" = no
; then
2566 build_libtool_libs
=module
2569 build_libtool_libs
=no
2573 convenience
="$convenience $dir/$old_library"
2574 old_convenience
="$old_convenience $dir/$old_library"
2575 deplibs
="$dir/$old_library $deplibs"
2578 fi # link shared/static library?
2580 if test "$linkmode" = lib
; then
2581 #if test -n "$dependency_libs" &&
2582 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2583 # test "$link_static" = yes; }; then
2584 # Extract -R from dependency_libs
2586 for libdir
in $dependency_libs; do
2588 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2590 *" $temp_xrpath "*) ;;
2591 *) xrpath
="$xrpath $temp_xrpath";;
2593 *) temp_deplibs
="$temp_deplibs $libdir";;
2596 dependency_libs
="$temp_deplibs"
2599 newlib_search_path
="$newlib_search_path $absdir"
2600 # Link against this library
2601 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2602 # ... and its dependency_libs
2604 for deplib
in $dependency_libs; do
2605 newdependency_libs
="$deplib $newdependency_libs"
2606 if test "X$duplicate_deps" = "Xyes" ; then
2607 case "$tmp_libs " in
2608 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2611 tmp_libs
="$tmp_libs $deplib"
2614 if test "$link_all_deplibs" != no
; then
2615 # Add the search paths of all dependency libraries
2616 for deplib
in $dependency_libs; do
2618 -L*) path
="$deplib" ;;
2620 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2621 test "X$dir" = "X$deplib" && dir
="."
2622 # We need an absolute path.
2624 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2626 absdir
=`cd "$dir" && pwd`
2627 if test -z "$absdir"; then
2628 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2633 if grep "^installed=no" $deplib > /dev
/null
; then
2634 path
="$absdir/$objdir"
2636 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2637 if test -z "$libdir"; then
2638 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2641 if test "$absdir" != "$libdir"; then
2642 # Sure, some shells/systems don't implement the -ef.
2643 # Those will have to live with the warning.
2644 test "$absdir" -ef "$libdir" > /dev
/null
2>&1 ||
2645 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2652 # we do not want to link against static libs, but need to link against shared
2653 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2654 if test -n "$deplibrary_names" ; then
2655 for tmp
in $deplibrary_names ; do
2658 if test -f "$path/$depdepl" ; then
2659 depdepl
="$path/$depdepl"
2661 # do not add paths which are already there
2662 case " $newlib_search_path " in
2664 *) newlib_search_path
="$newlib_search_path $path";;
2678 # Again, we only want to link against shared libraries
2679 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2680 for tmp
in $newlib_search_path ; do
2681 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2682 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2702 case " $deplibs " in
2704 *) deplibs
="$deplibs $depdepl" ;;
2706 case " $deplibs " in
2708 *) deplibs
="$deplibs $path" ;;
2711 fi # link_all_deplibs != no
2713 done # for deplib in $libs
2714 dependency_libs
="$newdependency_libs"
2715 if test "$pass" = dlpreopen
; then
2716 # Link the dlpreopened libraries before other libraries
2717 for deplib
in $save_deplibs; do
2718 deplibs
="$deplib $deplibs"
2721 if test "$pass" != dlopen
; then
2722 if test "$pass" != conv
; then
2723 # Make sure lib_search_path contains only unique directories.
2725 for dir
in $newlib_search_path; do
2726 case "$lib_search_path " in
2728 *) lib_search_path
="$lib_search_path $dir" ;;
2734 if test "$linkmode,$pass" != "prog,link"; then
2737 vars
="compile_deplibs finalize_deplibs"
2739 for var
in $vars dependency_libs
; do
2740 # Add libraries to $var in reverse order
2741 eval tmp_libs
=\"\$
$var\"
2743 for deplib
in $tmp_libs; do
2744 # FIXME: Pedantically, this is the right thing to do, so
2745 # that some nasty dependency loop isn't accidentally
2747 #new_libs="$deplib $new_libs"
2748 # Pragmatically, this seems to cause very few problems in
2751 -L*) new_libs
="$deplib $new_libs" ;;
2754 # And here is the reason: when a library appears more
2755 # than once as an explicit dependence of a library, or
2756 # is implicitly linked in more than once by the
2757 # compiler, it is considered special, and multiple
2758 # occurrences thereof are not removed. Compare this
2759 # with having the same library being listed as a
2760 # dependency of multiple other libraries: in this case,
2761 # we know (pedantically, we assume) the library does not
2762 # need to be listed more than once, so we keep only the
2763 # last copy. This is not always right, but it is rare
2764 # enough that we require users that really mean to play
2765 # such unportable linking tricks to link the library
2766 # using -Wl,-lname, so that libtool does not consider it
2767 # for duplicate removal.
2768 case " $specialdeplibs " in
2769 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2771 case " $new_libs " in
2773 *) new_libs
="$deplib $new_libs" ;;
2781 for deplib
in $new_libs; do
2784 case " $tmp_libs " in
2786 *) tmp_libs
="$tmp_libs $deplib" ;;
2789 *) tmp_libs
="$tmp_libs $deplib" ;;
2792 eval $var=\"$tmp_libs\"
2795 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2797 for i
in $dependency_libs ; do
2798 case " $predeps $postdeps $compiler_lib_search_path " in
2803 if test -n "$i" ; then
2804 tmp_libs
="$tmp_libs $i"
2807 dependency_libs
=$tmp_libs
2809 if test "$linkmode" = prog
; then
2810 dlfiles
="$newdlfiles"
2811 dlprefiles
="$newdlprefiles"
2816 if test -n "$deplibs"; then
2817 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2820 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2821 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2824 if test -n "$rpath"; then
2825 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2828 if test -n "$xrpath"; then
2829 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2832 if test -n "$vinfo"; then
2833 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2836 if test -n "$release"; then
2837 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2840 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2841 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2844 # Now set the variables for building old libraries.
2845 build_libtool_libs
=no
2847 objs
="$objs$old_deplibs"
2851 # Make sure we only generate libraries of the form `libNAME.la'.
2854 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2855 eval shared_ext
=\"$shrext\"
2856 eval libname
=\"$libname_spec\"
2859 if test "$module" = no
; then
2860 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2864 if test "$need_lib_prefix" != no
; then
2865 # Add the "lib" prefix for modules if required
2866 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2867 eval shared_ext
=\"$shrext\"
2868 eval libname
=\"$libname_spec\"
2870 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2875 if test -n "$objs"; then
2876 if test "$deplibs_check_method" != pass_all
; then
2877 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2881 $echo "*** Warning: Linking the shared library $output against the non-libtool"
2882 $echo "*** objects $objs is not portable!"
2883 libobjs
="$libobjs $objs"
2887 if test "$dlself" != no
; then
2888 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2892 if test "$#" -gt 2; then
2893 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2898 if test -z "$rpath"; then
2899 if test "$build_libtool_libs" = yes; then
2900 # Building a libtool convenience library.
2901 # Some compilers have problems with a `.al' extension so
2902 # convenience libraries should have the same extension an
2903 # archive normally would.
2904 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
2905 build_libtool_libs
=convenience
2909 if test -n "$vinfo"; then
2910 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2913 if test -n "$release"; then
2914 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2918 # Parse the version information argument.
2919 save_ifs
="$IFS"; IFS
=':'
2920 set dummy
$vinfo 0 0 0
2923 if test -n "$8"; then
2924 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2929 # convert absolute version numbers to libtool ages
2930 # this retains compatibility with .la files and attempts
2931 # to make the code below a bit more comprehensible
2933 case $vinfo_number in
2937 number_revision
="$4"
2939 # There are really only two kinds -- those that
2940 # use the current revision as the major version
2941 # and those that subtract age and use age as
2942 # a minor version. But, then there is irix
2943 # which has an extra 1 added just for fun
2945 case $version_type in
2946 darwin|linux|osf|windows
)
2947 current
=`expr $number_major + $number_minor`
2949 revision
="$number_revision"
2951 freebsd-aout|freebsd-elf|sunos
)
2952 current
="$number_major"
2953 revision
="$number_minor"
2957 current
=`expr $number_major + $number_minor - 1`
2959 revision
="$number_minor"
2970 # Check that each of the things are valid numbers.
2972 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2974 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2975 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2981 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2983 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2984 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2990 0 |
[1-9] |
[1-9][0-9] |
[1-9][0-9][0-9]) ;;
2992 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2993 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2998 if test "$age" -gt "$current"; then
2999 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3000 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3004 # Calculate the version variables.
3008 case $version_type in
3012 # Like Linux, but with the current version available in
3013 # verstring for coding it into the library header
3014 major
=.
`expr $current - $age`
3015 versuffix
="$major.$age.$revision"
3016 # Darwin ld doesn't like 0 for these options...
3017 minor_current
=`expr $current + 1`
3018 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
3023 versuffix
=".$current.$revision";
3028 versuffix
=".$current";
3032 major
=`expr $current - $age + 1`
3034 case $version_type in
3035 nonstopux
) verstring_prefix
=nonstopux
;;
3036 *) verstring_prefix
=sgi
;;
3038 verstring
="$verstring_prefix$major.$revision"
3040 # Add in all the interfaces that we are compatible with.
3042 while test "$loop" -ne 0; do
3043 iface
=`expr $revision - $loop`
3044 loop
=`expr $loop - 1`
3045 verstring
="$verstring_prefix$major.$iface:$verstring"
3048 # Before this point, $major must not contain `.'.
3050 versuffix
="$major.$revision"
3054 major
=.
`expr $current - $age`
3055 versuffix
="$major.$age.$revision"
3059 major
=.
`expr $current - $age`
3060 versuffix
=".$current.$age.$revision"
3061 verstring
="$current.$age.$revision"
3063 # Add in all the interfaces that we are compatible with.
3065 while test "$loop" -ne 0; do
3066 iface
=`expr $current - $loop`
3067 loop
=`expr $loop - 1`
3068 verstring
="$verstring:${iface}.0"
3071 # Make executables depend on our current version.
3072 verstring
="$verstring:${current}.0"
3077 versuffix
=".$current.$revision"
3081 # Use '-' rather than '.', since we only want one
3082 # extension on DOS 8.3 filesystems.
3083 major
=`expr $current - $age`
3088 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3089 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3094 # Clear the version info if we defaulted, and they specified a release.
3095 if test -z "$vinfo" && test -n "$release"; then
3097 case $version_type in
3099 # we can't check for "0.0" in archive_cmds due to quoting
3100 # problems, so we reset it completely
3107 if test "$need_version" = no
; then
3114 # Remove version info from name if versioning should be avoided
3115 if test "$avoid_version" = yes && test "$need_version" = no
; then
3121 # Check to see if the archive will have undefined symbols.
3122 if test "$allow_undefined" = yes; then
3123 if test "$allow_undefined_flag" = unsupported
; then
3124 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3125 build_libtool_libs
=no
3129 # Don't allow undefined symbols.
3130 allow_undefined_flag
="$no_undefined_flag"
3134 if test "$mode" != relink
; then
3135 # Remove our outputs, but don't remove object files since they
3136 # may have been created when compiling PIC objects.
3138 tempremovelist
=`$echo "$output_objdir/*"`
3139 for p
in $tempremovelist; do
3141 *.
$objext |
*$exeext)
3143 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3144 removelist
="$removelist $p"
3149 if test -n "$removelist"; then
3150 $show "${rm}r $removelist"
3151 $run ${rm}r
$removelist
3155 # Now set the variables for building old libraries.
3156 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3157 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3159 # Transform .lo files to .o files.
3160 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3163 # Eliminate all temporary directories.
3164 for path
in $notinst_path; do
3165 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3166 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3167 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3170 if test -n "$xrpath"; then
3171 # If the user specified any rpath flags, then add them.
3173 for libdir
in $xrpath; do
3174 temp_xrpath
="$temp_xrpath -R$libdir"
3175 case "$finalize_rpath " in
3177 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3180 if true ||
test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3181 dependency_libs
="$temp_xrpath $dependency_libs"
3185 # Make sure dlfiles contains only unique files that won't be dlpreopened
3186 old_dlfiles
="$dlfiles"
3188 for lib
in $old_dlfiles; do
3189 case " $dlprefiles $dlfiles " in
3191 *) dlfiles
="$dlfiles $lib" ;;
3195 # Make sure dlprefiles contains only unique files
3196 old_dlprefiles
="$dlprefiles"
3198 for lib
in $old_dlprefiles; do
3199 case "$dlprefiles " in
3201 *) dlprefiles
="$dlprefiles $lib" ;;
3205 if test "$build_libtool_libs" = yes; then
3206 if test -n "$rpath"; then
3208 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3209 # these systems don't actually have a c library (as such)!
3211 *-*-rhapsody* |
*-*-darwin1.
[012])
3212 # Rhapsody C library is in the System framework
3213 deplibs
="$deplibs System.ltframework"
3216 # Don't link with libc until the a.out ld.so is fixed.
3218 *-*-openbsd* |
*-*-freebsd*)
3219 # Do not include libc due to us having libc/libc_r.
3220 test "X$arg" = "X-lc" && continue
3223 # Add libc to deplibs on all other systems if necessary.
3224 if test "$build_libtool_need_lc" = "yes"; then
3225 deplibs
="$deplibs -lc"
3231 # Transform deplibs into only deplibs that can be linked in shared.
3233 libname_save
=$libname
3234 release_save
=$release
3235 versuffix_save
=$versuffix
3237 # I'm not sure if I'm treating the release correctly. I think
3238 # release should show up in the -l (ie -lgmp5) so we don't want to
3239 # add it in twice. Is that correct?
3245 case $deplibs_check_method in
3247 # Don't check for shared/static. Everything works.
3248 # This might be a little naive. We might want to check
3249 # whether the library exists or not. But this is on
3250 # osf3 & osf4 and I'm not really sure... Just
3251 # implementing what was already the behavior.
3255 # This code stresses the "libraries are programs" paradigm to its
3256 # limits. Maybe even breaks it. We compile a program, linking it
3257 # against the deplibs as a proxy for the library. Then we can check
3258 # whether they linked in statically or dynamically with ldd.
3260 cat > conftest.c
<<EOF
3261 int main() { return 0; }
3264 $LTCC -o conftest conftest.c
$deplibs
3265 if test "$?" -eq 0 ; then
3266 ldd_output
=`ldd conftest`
3267 for i
in $deplibs; do
3268 name
="`expr $i : '-l\(.*\)'`"
3269 # If $name is empty we are operating on a -L argument.
3270 if test "$name" != "" && test "$name" -ne "0"; then
3271 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3272 case " $predeps $postdeps " in
3274 newdeplibs
="$newdeplibs $i"
3279 if test -n "$i" ; then
3280 libname
=`eval \\$echo \"$libname_spec\"`
3281 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3282 set dummy
$deplib_matches
3284 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3285 newdeplibs
="$newdeplibs $i"
3289 $echo "*** Warning: dynamic linker does not accept needed library $i."
3290 $echo "*** I have the capability to make that library automatically link in when"
3291 $echo "*** you link to this library. But I can only do this if you have a"
3292 $echo "*** shared version of the library, which I believe you do not have"
3293 $echo "*** because a test_compile did reveal that the linker did not use it for"
3294 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3298 newdeplibs
="$newdeplibs $i"
3302 # Error occurred in the first compile. Let's try to salvage
3303 # the situation: Compile a separate program for each library.
3304 for i
in $deplibs; do
3305 name
="`expr $i : '-l\(.*\)'`"
3306 # If $name is empty we are operating on a -L argument.
3307 if test "$name" != "" && test "$name" != "0"; then
3309 $LTCC -o conftest conftest.c
$i
3311 if test "$?" -eq 0 ; then
3312 ldd_output
=`ldd conftest`
3313 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3314 case " $predeps $postdeps " in
3316 newdeplibs
="$newdeplibs $i"
3321 if test -n "$i" ; then
3322 libname
=`eval \\$echo \"$libname_spec\"`
3323 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3324 set dummy
$deplib_matches
3326 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3327 newdeplibs
="$newdeplibs $i"
3331 $echo "*** Warning: dynamic linker does not accept needed library $i."
3332 $echo "*** I have the capability to make that library automatically link in when"
3333 $echo "*** you link to this library. But I can only do this if you have a"
3334 $echo "*** shared version of the library, which you do not appear to have"
3335 $echo "*** because a test_compile did reveal that the linker did not use this one"
3336 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3342 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3343 $echo "*** make it link in! You will probably need to install it or some"
3344 $echo "*** library that it depends on before this library will be fully"
3345 $echo "*** functional. Installing it before continuing would be even better."
3348 newdeplibs
="$newdeplibs $i"
3354 set dummy
$deplibs_check_method
3355 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3356 for a_deplib
in $deplibs; do
3357 name
="`expr $a_deplib : '-l\(.*\)'`"
3358 # If $name is empty we are operating on a -L argument.
3359 if test "$name" != "" && test "$name" != "0"; then
3360 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3361 case " $predeps $postdeps " in
3363 newdeplibs
="$newdeplibs $a_deplib"
3368 if test -n "$a_deplib" ; then
3369 libname
=`eval \\$echo \"$libname_spec\"`
3370 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3371 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3372 for potent_lib
in $potential_libs; do
3373 # Follow soft links.
3374 if ls -lLd "$potent_lib" 2>/dev
/null \
3375 |
grep " -> " >/dev
/null
; then
3378 # The statement above tries to avoid entering an
3379 # endless loop below, in case of cyclic links.
3380 # We might still enter an endless loop, since a link
3381 # loop can be closed while we follow links,
3383 potlib
="$potent_lib"
3384 while test -h "$potlib" 2>/dev
/null
; do
3385 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3387 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3388 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3391 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3393 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3394 newdeplibs
="$newdeplibs $a_deplib"
3401 if test -n "$a_deplib" ; then
3404 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3405 $echo "*** I have the capability to make that library automatically link in when"
3406 $echo "*** you link to this library. But I can only do this if you have a"
3407 $echo "*** shared version of the library, which you do not appear to have"
3408 $echo "*** because I did check the linker path looking for a file starting"
3409 if test -z "$potlib" ; then
3410 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3412 $echo "*** with $libname and none of the candidates passed a file format test"
3413 $echo "*** using a file magic. Last file checked: $potlib"
3417 # Add a -L argument.
3418 newdeplibs
="$newdeplibs $a_deplib"
3420 done # Gone through all deplibs.
3423 set dummy
$deplibs_check_method
3424 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3425 for a_deplib
in $deplibs; do
3426 name
="`expr $a_deplib : '-l\(.*\)'`"
3427 # If $name is empty we are operating on a -L argument.
3428 if test -n "$name" && test "$name" != "0"; then
3429 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3430 case " $predeps $postdeps " in
3432 newdeplibs
="$newdeplibs $a_deplib"
3437 if test -n "$a_deplib" ; then
3438 libname
=`eval \\$echo \"$libname_spec\"`
3439 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3440 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3441 for potent_lib
in $potential_libs; do
3442 potlib
="$potent_lib" # see symlink-check above in file_magic test
3443 if eval $echo \"$potent_lib\" 2>/dev
/null \
3445 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3446 newdeplibs
="$newdeplibs $a_deplib"
3453 if test -n "$a_deplib" ; then
3456 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3457 $echo "*** I have the capability to make that library automatically link in when"
3458 $echo "*** you link to this library. But I can only do this if you have a"
3459 $echo "*** shared version of the library, which you do not appear to have"
3460 $echo "*** because I did check the linker path looking for a file starting"
3461 if test -z "$potlib" ; then
3462 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3464 $echo "*** with $libname and none of the candidates passed a file format test"
3465 $echo "*** using a regex pattern. Last file checked: $potlib"
3469 # Add a -L argument.
3470 newdeplibs
="$newdeplibs $a_deplib"
3472 done # Gone through all deplibs.
3476 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3477 -e 's/ -[LR][^ ]*//g'`
3478 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3479 for i
in $predeps $postdeps ; do
3480 # can't use Xsed below, because $i might contain '/'
3481 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3484 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3485 |
grep .
>/dev
/null
; then
3487 if test "X$deplibs_check_method" = "Xnone"; then
3488 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3490 $echo "*** Warning: inter-library dependencies are not known to be supported."
3492 $echo "*** All declared inter-library dependencies are being dropped."
3497 versuffix
=$versuffix_save
3499 release
=$release_save
3500 libname
=$libname_save
3504 *-*-rhapsody* |
*-*-darwin1.
[012])
3505 # On Rhapsody replace the C library is the System framework
3506 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
3510 if test "$droppeddeps" = yes; then
3511 if test "$module" = yes; then
3513 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3514 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3515 $echo "*** a static module, that should work as long as the dlopening"
3516 $echo "*** application is linked with the -dlopen flag."
3517 if test -z "$global_symbol_pipe"; then
3519 $echo "*** However, this would only work if libtool was able to extract symbol"
3520 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3521 $echo "*** not find such a program. So, this module is probably useless."
3522 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3524 if test "$build_old_libs" = no
; then
3525 oldlibs
="$output_objdir/$libname.$libext"
3526 build_libtool_libs
=module
3529 build_libtool_libs
=no
3532 $echo "*** The inter-library dependencies that have been dropped here will be"
3533 $echo "*** automatically added whenever a program is linked with this library"
3534 $echo "*** or is declared to -dlopen it."
3536 if test "$allow_undefined" = no
; then
3538 $echo "*** Since this library must not contain undefined symbols,"
3539 $echo "*** because either the platform does not support them or"
3540 $echo "*** it was explicitly requested with -no-undefined,"
3541 $echo "*** libtool will only create a static version of it."
3542 if test "$build_old_libs" = no
; then
3543 oldlibs
="$output_objdir/$libname.$libext"
3544 build_libtool_libs
=module
3547 build_libtool_libs
=no
3552 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
3555 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3556 dependency_libs
=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3559 # Done checking deplibs!
3563 # All the library-specific variables (install_libdir is set above).
3568 # Test again, we may have decided not to build it any more
3569 if test "$build_libtool_libs" = yes; then
3570 if test "$hardcode_into_libs" = yes; then
3571 # Hardcode the library paths
3574 rpath
="$finalize_rpath"
3575 test "$mode" != relink
&& test "$fast_install" = no
&& rpath
="$compile_rpath$rpath"
3576 for libdir
in $rpath; do
3577 if test -n "$hardcode_libdir_flag_spec"; then
3578 if test -n "$hardcode_libdir_separator"; then
3579 if test -z "$hardcode_libdirs"; then
3580 hardcode_libdirs
="$libdir"
3582 # Just accumulate the unique libdirs.
3583 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3584 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3587 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3592 eval flag
=\"$hardcode_libdir_flag_spec\"
3593 dep_rpath
="$dep_rpath $flag"
3595 elif test -n "$runpath_var"; then
3596 case "$perm_rpath " in
3598 *) perm_rpath
="$perm_rpath $libdir" ;;
3602 # Substitute the hardcoded libdirs into the rpath.
3603 if test -n "$hardcode_libdir_separator" &&
3604 test -n "$hardcode_libdirs"; then
3605 libdir
="$hardcode_libdirs"
3606 if test -n "$hardcode_libdir_flag_spec_ld"; then
3607 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3609 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3612 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3613 # We should set the runpath_var.
3615 for dir
in $perm_rpath; do
3618 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3620 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3623 shlibpath
="$finalize_shlibpath"
3624 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3625 if test -n "$shlibpath"; then
3626 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3629 # Get the real and link names of the library.
3630 eval shared_ext
=\"$shrext\"
3631 eval library_names
=\"$library_names_spec\"
3632 set dummy
$library_names
3636 if test -n "$soname_spec"; then
3637 eval soname
=\"$soname_spec\"
3641 if test -z "$dlname"; then
3645 lib
="$output_objdir/$realname"
3648 linknames
="$linknames $link"
3651 # Use standard objects if they are pic
3652 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3654 # Prepare the list of exported symbols
3655 if test -z "$export_symbols"; then
3656 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3657 $show "generating symbol list for \`$libname.la'"
3658 export_symbols
="$output_objdir/$libname.exp"
3659 $run $rm $export_symbols
3660 eval cmds
=\"$export_symbols_cmds\"
3661 save_ifs
="$IFS"; IFS
='~'
3662 for cmd
in $cmds; do
3664 if len
=`expr "X$cmd" : ".*"` &&
3665 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3667 $run eval "$cmd" ||
exit $?
3668 skipped_export
=false
3670 # The command line is too long to execute in one step.
3671 $show "using reloadable object file for export list..."
3676 if test -n "$export_symbols_regex"; then
3677 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3678 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3679 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3680 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3685 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3686 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3690 for test_deplib
in $deplibs; do
3691 case " $convenience " in
3692 *" $test_deplib "*) ;;
3694 tmp_deplibs
="$tmp_deplibs $test_deplib"
3698 deplibs
="$tmp_deplibs"
3700 if test -n "$convenience"; then
3701 if test -n "$whole_archive_flag_spec"; then
3702 save_libobjs
=$libobjs
3703 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3705 gentop
="$output_objdir/${outputname}x"
3706 $show "${rm}r $gentop"
3707 $run ${rm}r
"$gentop"
3708 $show "$mkdir $gentop"
3709 $run $mkdir "$gentop"
3711 if test "$status" -ne 0 && test ! -d "$gentop"; then
3714 generated
="$generated $gentop"
3716 for xlib
in $convenience; do
3717 # Extract the objects.
3719 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3720 *) xabs
=`pwd`"/$xlib" ;;
3722 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3723 xdir
="$gentop/$xlib"
3725 $show "${rm}r $xdir"
3727 $show "$mkdir $xdir"
3730 if test "$status" -ne 0 && test ! -d "$xdir"; then
3733 # We will extract separately just the conflicting names and we will no
3734 # longer touch any unique names. It is faster to leave these extract
3735 # automatically by $AR in one run.
3736 $show "(cd $xdir && $AR x $xabs)"
3737 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3738 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
3741 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3742 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3743 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
3746 while test "$i" -le "$count"
3748 # Put our $i before any first dot (extension)
3749 # Never overwrite any file
3751 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
3753 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3755 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3756 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
3762 libobjs
="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3767 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3768 eval flag
=\"$thread_safe_flag_spec\"
3769 linker_flags
="$linker_flags $flag"
3772 # Make a backup of the uninstalled library when relinking
3773 if test "$mode" = relink
; then
3774 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3777 # Add all flags from the command line. We here create a library,
3778 # but those flags were only added to compile_command and
3779 # finalize_command, which are only used when creating executables.
3780 # So do it by hand here.
3781 compiler_flags
="$compiler_flags $add_flags"
3782 # Only add it to commands which use CC, instead of LD, i.e.
3783 # only to $compiler_flags
3784 #linker_flags="$linker_flags $add_flags"
3786 # Do each of the archive commands.
3787 if test "$module" = yes && test -n "$module_cmds" ; then
3788 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3789 eval cmds
=\"$module_expsym_cmds\"
3791 eval cmds
=\"$module_cmds\"
3794 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3795 eval cmds
=\"$archive_expsym_cmds\"
3797 eval cmds
=\"$archive_cmds\"
3801 if test "X$skipped_export" != "X:" && len
=`expr "X$cmds" : ".*"` &&
3802 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3805 # The command line is too long to link in one step, link piecewise.
3806 $echo "creating reloadable object files..."
3808 # Save the value of $output and $libobjs because we want to
3809 # use them later. If we have whole_archive_flag_spec, we
3810 # want to use save_libobjs as it was before
3811 # whole_archive_flag_spec was expanded, because we can't
3812 # assume the linker understands whole_archive_flag_spec.
3813 # This may have to be revisited, in case too many
3814 # convenience libraries get linked in and end up exceeding
3816 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3817 save_libobjs
=$libobjs
3821 # Clear the reloadable object creation command queue and
3822 # initialize k to one.
3829 output
=$output_objdir/$save_output-${k}.
$objext
3830 # Loop over the list of objects to be linked.
3831 for obj
in $save_libobjs
3833 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3834 if test "X$objlist" = X ||
3835 { len
=`expr "X$test_cmds" : ".*"` &&
3836 test "$len" -le "$max_cmd_len"; }; then
3837 objlist
="$objlist $obj"
3839 # The command $test_cmds is almost too long, add a
3840 # command to the queue.
3841 if test "$k" -eq 1 ; then
3842 # The first file doesn't have a previous command to add.
3843 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3845 # All subsequent reloadable object files will link in
3846 # the last one created.
3847 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3849 last_robj
=$output_objdir/$save_output-${k}.
$objext
3851 output
=$output_objdir/$save_output-${k}.
$objext
3856 # Handle the remaining objects by creating one last
3857 # reloadable object file. All subsequent reloadable object
3858 # files will link in the last one created.
3859 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3860 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3862 if ${skipped_export-false}; then
3863 $show "generating symbol list for \`$libname.la'"
3864 export_symbols
="$output_objdir/$libname.exp"
3865 $run $rm $export_symbols
3867 # Append the command to create the export file.
3868 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3871 # Set up a command to remove the reloadale object files
3872 # after they are used.
3874 while test "$i" -lt "$k"
3877 delfiles
="$delfiles $output_objdir/$save_output-${i}.$objext"
3880 $echo "creating a temporary reloadable object file: $output"
3882 # Loop through the commands generated above and execute them.
3883 save_ifs
="$IFS"; IFS
='~'
3884 for cmd
in $concat_cmds; do
3887 $run eval "$cmd" ||
exit $?
3892 # Restore the value of output.
3895 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3896 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3898 # Expand the library linking commands again to reset the
3899 # value of $libobjs for piecewise linking.
3901 # Do each of the archive commands.
3902 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3903 eval cmds
=\"$archive_expsym_cmds\"
3905 eval cmds
=\"$archive_cmds\"
3908 # Append the command to remove the reloadable object files
3909 # to the just-reset $cmds.
3910 eval cmds
=\"\
$cmds~
$rm $delfiles\"
3912 save_ifs
="$IFS"; IFS
='~'
3913 for cmd
in $cmds; do
3916 $run eval "$cmd" ||
exit $?
3920 # Restore the uninstalled library and exit
3921 if test "$mode" = relink
; then
3922 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
3926 # Create links to the real library.
3927 for linkname
in $linknames; do
3928 if test "$realname" != "$linkname"; then
3929 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3930 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
3934 # If -module or -export-dynamic was specified, set the dlname.
3935 if test "$module" = yes ||
test "$export_dynamic" = yes; then
3936 # On all known operating systems, these are identical.
3943 if test -n "$deplibs"; then
3944 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3947 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3948 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3951 if test -n "$rpath"; then
3952 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3955 if test -n "$xrpath"; then
3956 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3959 if test -n "$vinfo"; then
3960 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3963 if test -n "$release"; then
3964 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3969 if test -n "$objs$old_deplibs"; then
3970 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3974 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
3982 # Delete the old objects.
3983 $run $rm $obj $libobj
3985 # Objects from convenience libraries. This assumes
3986 # single-version convenience libraries. Whenever we create
3987 # different ones for PIC/non-PIC, this we'll have to duplicate
3991 # reload_cmds runs $LD directly, so let us get rid of
3992 # -Wl from whole_archive_flag_spec
3995 if test -n "$convenience"; then
3996 if test -n "$whole_archive_flag_spec"; then
3997 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
3999 gentop
="$output_objdir/${obj}x"
4000 $show "${rm}r $gentop"
4001 $run ${rm}r
"$gentop"
4002 $show "$mkdir $gentop"
4003 $run $mkdir "$gentop"
4005 if test "$status" -ne 0 && test ! -d "$gentop"; then
4008 generated
="$generated $gentop"
4010 for xlib
in $convenience; do
4011 # Extract the objects.
4013 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
4014 *) xabs
=`pwd`"/$xlib" ;;
4016 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4017 xdir
="$gentop/$xlib"
4019 $show "${rm}r $xdir"
4021 $show "$mkdir $xdir"
4024 if test "$status" -ne 0 && test ! -d "$xdir"; then
4027 # We will extract separately just the conflicting names and we will no
4028 # longer touch any unique names. It is faster to leave these extract
4029 # automatically by $AR in one run.
4030 $show "(cd $xdir && $AR x $xabs)"
4031 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
4032 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
4035 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4036 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4037 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
4040 while test "$i" -le "$count"
4042 # Put our $i before any first dot (extension)
4043 # Never overwrite any file
4045 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
4047 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4049 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4050 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
4056 reload_conv_objs
="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4061 # Create the old-style object.
4062 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
4065 eval cmds
=\"$reload_cmds\"
4066 save_ifs
="$IFS"; IFS
='~'
4067 for cmd
in $cmds; do
4070 $run eval "$cmd" ||
exit $?
4074 # Exit if we aren't doing a library object file.
4075 if test -z "$libobj"; then
4076 if test -n "$gentop"; then
4077 $show "${rm}r $gentop"
4084 if test "$build_libtool_libs" != yes; then
4085 if test -n "$gentop"; then
4086 $show "${rm}r $gentop"
4090 # Create an invalid libtool object if no PIC, so that we don't
4091 # accidentally link it into a program.
4092 # $show "echo timestamp > $libobj"
4093 # $run eval "echo timestamp > $libobj" || exit $?
4097 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4098 # Only do commands if we really have different PIC objects.
4099 reload_objs
="$libobjs $reload_conv_objs"
4101 eval cmds
=\"$reload_cmds\"
4102 save_ifs
="$IFS"; IFS
='~'
4103 for cmd
in $cmds; do
4106 $run eval "$cmd" ||
exit $?
4111 if test -n "$gentop"; then
4112 $show "${rm}r $gentop"
4121 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4123 if test -n "$vinfo"; then
4124 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4127 if test -n "$release"; then
4128 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4131 if test "$preload" = yes; then
4132 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4133 test "$dlopen_self_static" = unknown
; then
4134 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4139 *-*-rhapsody* |
*-*-darwin1.
[012])
4140 # On Rhapsody replace the C library is the System framework
4141 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4142 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4148 # Don't allow lazy linking, it breaks C++ global constructors
4149 if test "$tagname" = CXX
; then
4150 compile_command
="$compile_command ${wl}-bind_at_load"
4151 finalize_command
="$finalize_command ${wl}-bind_at_load"
4153 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
4154 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4155 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4159 compile_command
="$compile_command $compile_deplibs"
4160 finalize_command
="$finalize_command $finalize_deplibs"
4162 if test -n "$rpath$xrpath"; then
4163 # If the user specified any rpath flags, then add them.
4164 for libdir
in $rpath $xrpath; do
4165 # This is the magic to use -rpath.
4166 case "$finalize_rpath " in
4168 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4173 # Now hardcode the library paths
4176 for libdir
in $compile_rpath $finalize_rpath; do
4177 if test -n "$hardcode_libdir_flag_spec"; then
4178 if test -n "$hardcode_libdir_separator"; then
4179 if test -z "$hardcode_libdirs"; then
4180 hardcode_libdirs
="$libdir"
4182 # Just accumulate the unique libdirs.
4183 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4184 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4187 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4192 eval flag
=\"$hardcode_libdir_flag_spec\"
4193 rpath
="$rpath $flag"
4195 elif test -n "$runpath_var"; then
4196 case "$perm_rpath " in
4198 *) perm_rpath
="$perm_rpath $libdir" ;;
4202 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4203 case :$dllsearchpath: in
4205 *) dllsearchpath
="$dllsearchpath:$libdir";;
4210 # Substitute the hardcoded libdirs into the rpath.
4211 if test -n "$hardcode_libdir_separator" &&
4212 test -n "$hardcode_libdirs"; then
4213 libdir
="$hardcode_libdirs"
4214 eval rpath
=\" $hardcode_libdir_flag_spec\"
4216 compile_rpath
="$rpath"
4220 for libdir
in $finalize_rpath; do
4221 if test -n "$hardcode_libdir_flag_spec"; then
4222 if test -n "$hardcode_libdir_separator"; then
4223 if test -z "$hardcode_libdirs"; then
4224 hardcode_libdirs
="$libdir"
4226 # Just accumulate the unique libdirs.
4227 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4228 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4231 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4236 eval flag
=\"$hardcode_libdir_flag_spec\"
4237 rpath
="$rpath $flag"
4239 elif test -n "$runpath_var"; then
4240 case "$finalize_perm_rpath " in
4242 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4246 # Substitute the hardcoded libdirs into the rpath.
4247 if test -n "$hardcode_libdir_separator" &&
4248 test -n "$hardcode_libdirs"; then
4249 libdir
="$hardcode_libdirs"
4250 eval rpath
=\" $hardcode_libdir_flag_spec\"
4252 finalize_rpath
="$rpath"
4254 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4255 # Transform all the library objects into standard objects.
4256 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4257 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4261 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4262 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4263 dlsyms
="${outputname}S.c"
4265 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4269 if test -n "$dlsyms"; then
4273 # Discover the nlist of each of the dlfiles.
4274 nlist
="$output_objdir/${outputname}.nm"
4276 $show "$rm $nlist ${nlist}S ${nlist}T"
4277 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4279 # Parse the name list into a source file.
4280 $show "creating $output_objdir/$dlsyms"
4282 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4283 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4284 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4290 /* Prevent the only kind of declaration conflicts we can make. */
4291 #define lt_preloaded_symbols some_other_symbol
4293 /* External symbol declarations for the compiler. */\
4296 if test "$dlself" = yes; then
4297 $show "generating symbol list for \`$output'"
4299 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4301 # Add our own program objects to the symbol list.
4302 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4303 for arg
in $progfiles; do
4304 $show "extracting global C symbols from \`$arg'"
4305 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4308 if test -n "$exclude_expsyms"; then
4309 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4310 $run eval '$mv "$nlist"T "$nlist"'
4313 if test -n "$export_symbols_regex"; then
4314 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4315 $run eval '$mv "$nlist"T "$nlist"'
4318 # Prepare the list of exported symbols
4319 if test -z "$export_symbols"; then
4320 export_symbols
="$output_objdir/$output.exp"
4321 $run $rm $export_symbols
4322 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4324 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4325 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4326 $run eval 'mv "$nlist"T "$nlist"'
4330 for arg
in $dlprefiles; do
4331 $show "extracting global C symbols from \`$arg'"
4332 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4333 $run eval '$echo ": $name " >> "$nlist"'
4334 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4337 if test -z "$run"; then
4338 # Make sure we have at least an empty file.
4339 test -f "$nlist" ||
: > "$nlist"
4341 if test -n "$exclude_expsyms"; then
4342 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4343 $mv "$nlist"T
"$nlist"
4346 # Try sorting and uniquifying the output.
4347 if grep -v "^: " < "$nlist" |
4348 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4353 uniq > "$nlist"S
; then
4356 grep -v "^: " < "$nlist" > "$nlist"S
4359 if test -f "$nlist"S
; then
4360 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4362 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4365 $echo >> "$output_objdir/$dlsyms" "\
4367 #undef lt_preloaded_symbols
4369 #if defined (__STDC__) && __STDC__
4370 # define lt_ptr void *
4372 # define lt_ptr char *
4376 /* The mapping between symbol names and symbols. */
4381 lt_preloaded_symbols[] =
4385 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4387 $echo >> "$output_objdir/$dlsyms" "\
4391 /* This works around a problem in FreeBSD linker */
4392 #ifdef FREEBSD_WORKAROUND
4393 static const void *lt_preloaded_setup() {
4394 return lt_preloaded_symbols;
4404 pic_flag_for_symtable
=
4406 # compiling the symbol table file with pic_flag works around
4407 # a FreeBSD bug that causes programs to crash when -lm is
4408 # linked before any other PIC object. But we must not use
4409 # pic_flag when linking with -static. The problem exists in
4410 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4411 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4412 case "$compile_command " in
4414 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4417 case "$compile_command " in
4419 *) pic_flag_for_symtable
=" $pic_flag";;
4423 # Now compile the dynamic symbol file.
4424 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4425 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4427 # Clean up the generated files.
4428 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4429 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4431 # Transform the symbol file into the correct name.
4432 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4433 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4436 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4441 # We keep going just in case the user didn't refer to
4442 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4443 # really was required.
4445 # Nullify the symbol file.
4446 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4447 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4450 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
4451 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
4452 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
4453 # This does not apply on AIX for ia64, which uses a SysV linker.
4456 *-*-aix4* |
*-*-aix5*)
4457 compile_command
=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
4458 finalize_command
=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
4461 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4462 # Replace the output file specification.
4463 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4464 link_command
="$compile_command$compile_rpath"
4466 # We have no uninstalled library dependencies, so finalize right now.
4467 $show "$link_command"
4468 $run eval "$link_command"
4471 # Delete the generated files.
4472 if test -n "$dlsyms"; then
4473 $show "$rm $output_objdir/${outputname}S.${objext}"
4474 $run $rm "$output_objdir/${outputname}S.${objext}"
4480 if test -n "$shlibpath_var"; then
4481 # We should set the shlibpath_var
4483 for dir
in $temp_rpath; do
4485 [\\/]* |
[A-Za-z
]:[\\/]*)
4490 # Relative path: add a thisdir entry.
4491 rpath
="$rpath\$thisdir/$dir:"
4498 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4499 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4501 if test -n "$finalize_shlibpath"; then
4502 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4507 if test -n "$runpath_var"; then
4508 if test -n "$perm_rpath"; then
4509 # We should set the runpath_var.
4511 for dir
in $perm_rpath; do
4514 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4516 if test -n "$finalize_perm_rpath"; then
4517 # We should set the runpath_var.
4519 for dir
in $finalize_perm_rpath; do
4522 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4526 if test "$no_install" = yes; then
4527 # We don't need to create a wrapper script.
4528 link_command
="$compile_var$compile_command$compile_rpath"
4529 # Replace the output file specification.
4530 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4531 # Delete the old output file.
4533 # Link the executable and exit
4534 $show "$link_command"
4535 $run eval "$link_command" ||
exit $?
4539 if test "$hardcode_action" = relink
; then
4540 # Fast installation is not supported
4541 link_command
="$compile_var$compile_command$compile_rpath"
4542 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4544 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4545 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4547 if test "$fast_install" != no
; then
4548 link_command
="$finalize_var$compile_command$finalize_rpath"
4549 if test "$fast_install" = yes; then
4550 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4552 # fast_install is set to needless
4556 link_command
="$compile_var$compile_command$compile_rpath"
4557 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4561 # Replace the output file specification.
4562 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4564 # Delete the old output files.
4565 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4567 $show "$link_command"
4568 $run eval "$link_command" ||
exit $?
4570 # Now create the wrapper script.
4571 $show "creating $output"
4573 # Quote the relink command for shipping.
4574 if test -n "$relink_command"; then
4575 # Preserve any variables that may affect compiler behavior
4576 for var
in $variables_saved_for_relink; do
4577 if eval test -z \"\
${$var+set}\"; then
4578 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4579 elif eval var_value
=\$
$var; test -z "$var_value"; then
4580 relink_command
="$var=; export $var; $relink_command"
4582 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4583 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4586 relink_command
="(cd `pwd`; $relink_command)"
4587 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4590 # Quote $echo for shipping.
4591 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4593 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
4594 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
4596 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4598 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4601 # Only actually do things if our run command is non-null.
4602 if test -z "$run"; then
4603 # win32 will think the script is a binary if it has
4604 # a .exe suffix, so we strip it off here.
4606 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4608 # test for cygwin because mv fails w/o .exe extensions
4612 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4617 cwrappersource
=`$echo ${output_objdir}/lt-${outputname}.c`
4618 cwrapper
=`$echo ${output}.exe`
4619 $rm $cwrappersource $cwrapper
4620 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4622 cat > $cwrappersource <<EOF
4624 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4625 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4627 The $output program cannot be directly executed until all the libtool
4628 libraries that it depends on are installed.
4630 This wrapper executable should never be moved out of the build directory.
4631 If it is, it will not operate correctly.
4633 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4634 but could eventually absorb all of the scripts functionality and
4635 exec $objdir/$outputname directly.
4638 cat >> $cwrappersource<<"EOF"
4646 #if defined(PATH_MAX)
4647 # define LT_PATHMAX PATH_MAX
4648 #elif defined(MAXPATHLEN)
4649 # define LT_PATHMAX MAXPATHLEN
4651 # define LT_PATHMAX 1024
4654 #ifndef DIR_SEPARATOR
4655 #define DIR_SEPARATOR '/'
4658 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4660 #define HAVE_DOS_BASED_FILE_SYSTEM
4661 #ifndef DIR_SEPARATOR_2
4662 #define DIR_SEPARATOR_2 '\\'
4666 #ifndef DIR_SEPARATOR_2
4667 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4668 #else /* DIR_SEPARATOR_2 */
4669 # define IS_DIR_SEPARATOR(ch) \
4670 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4671 #endif /* DIR_SEPARATOR_2 */
4673 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4674 #define XFREE(stale) do { \
4675 if (stale) { free ((void *) stale); stale = 0; } \
4678 const char *program_name = NULL;
4680 void * xmalloc (size_t num);
4681 char * xstrdup (const char *string);
4682 char * basename (const char *name);
4683 char * fnqualify(const char *path);
4684 char * strendzap(char *str, const char *pat);
4685 void lt_fatal (const char *message, ...);
4688 main (int argc, char *argv[])
4693 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4694 newargz = XMALLOC(char *, argc+2);
4697 cat >> $cwrappersource <<EOF
4698 newargz[0] = "$SHELL";
4701 cat >> $cwrappersource <<"EOF"
4702 newargz
[1] = fnqualify
(argv
[0]);
4703 /* we know the
script has the same name
, without the .exe
*/
4704 /* so
make sure newargz
[1] doesn
't end in .exe */
4705 strendzap(newargz[1],".exe");
4706 for (i = 1; i < argc; i++)
4707 newargz[i+1] = xstrdup(argv[i]);
4708 newargz[argc+1] = NULL;
4711 cat >> $cwrappersource <<EOF
4712 execv("$SHELL",newargz);
4715 cat >> $cwrappersource <<"EOF"
4719 xmalloc (size_t num)
4721 void * p = (void *) malloc (num);
4723 lt_fatal ("Memory exhausted");
4729 xstrdup (const char *string)
4731 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4736 basename (const char *name)
4740 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4741 /* Skip over the disk name in MSDOS pathnames. */
4742 if (isalpha (name[0]) && name[1] == ':')
4746 for (base = name; *name; name++)
4747 if (IS_DIR_SEPARATOR (*name))
4749 return (char *) base;
4753 fnqualify(const char *path)
4757 char tmp[LT_PATHMAX + 1];
4759 assert(path != NULL);
4761 /* Is it qualified already? */
4762 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4763 if (isalpha (path[0]) && path[1] == ':')
4764 return xstrdup (path);
4766 if (IS_DIR_SEPARATOR (path[0]))
4767 return xstrdup (path);
4769 /* prepend the current directory */
4770 /* doesn't handle
'~' */
4771 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4772 lt_fatal
("getcwd failed");
4773 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4774 p
= XMALLOC
(char
, size
);
4775 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4780 strendzap
(char
*str
, const char
*pat
)
4784 assert
(str
!= NULL
);
4785 assert
(pat
!= NULL
);
4788 patlen
= strlen
(pat
);
4792 str
+= len
- patlen
;
4793 if (strcmp
(str
, pat
) == 0)
4800 lt_error_core
(int exit_status
, const char
* mode
,
4801 const char
* message
, va_list ap
)
4803 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4804 vfprintf
(stderr
, message
, ap
);
4805 fprintf
(stderr
, ".\n");
4807 if (exit_status
>= 0)
4812 lt_fatal
(const char
*message
, ...
)
4815 va_start
(ap
, message
);
4816 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4820 # we should really use a build-platform specific compiler
4821 # here, but OTOH, the wrappers (shell script and this C one)
4822 # are only useful if you want to execute the "real" binary.
4823 # Since the "real" binary is built for $host, then this
4824 # wrapper might as well be built for $host, too.
4825 $run $LTCC -s -o $cwrapper $cwrappersource
4829 trap "$rm $output; exit 1" 1 2 15
4834 # $output - temporary wrapper script for $objdir/$outputname
4835 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4837 # The $output program cannot be directly executed until all the libtool
4838 # libraries that it depends on are installed.
4840 # This wrapper script should never be moved out of the build directory.
4841 # If it is, it will not operate correctly.
4843 # Sed substitution that helps us do robust quoting. It backslashifies
4844 # metacharacters that are still active within double-quoted strings.
4845 Xsed='${SED} -e 1s/^X//'
4846 sed_quote_subst='$sed_quote_subst'
4848 # The HP-UX ksh and POSIX shell print the target directory to stdout
4850 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4852 relink_command=\"$relink_command\"
4854 # This environment variable determines our operation mode.
4855 if test \"\$libtool_install_magic\" = \"$magic\"; then
4856 # install mode needs the following variable:
4857 notinst_deplibs='$notinst_deplibs'
4859 # When we are sourced in execute mode, \$file and \$echo are already set.
4860 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4863 # Make sure echo works.
4864 if test \"X\$1\" = X--no-reexec; then
4865 # Discard the --no-reexec flag, and continue.
4867 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4868 # Yippee, \$echo works!
4871 # Restart under the correct shell, and then maybe \$echo will work.
4872 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4878 # Find the directory that this script lives in.
4879 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4880 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4882 # Follow symbolic links until we get to the real thisdir.
4883 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4884 while test -n \"\$file\"; do
4885 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4887 # If there was a directory component, then change thisdir.
4888 if test \"x\$destdir\" != \"x\$file\"; then
4889 case \"\$destdir\" in
4890 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4891 *) thisdir=\"\$thisdir/\$destdir\" ;;
4895 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4896 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4899 # Try to get the absolute directory name.
4900 absdir=\`cd \"\$thisdir\" && pwd\`
4901 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4904 if test "$fast_install" = yes; then
4906 program=lt-'$outputname'$exeext
4907 progdir=\"\$thisdir/$objdir\"
4909 if test ! -f \"\$progdir/\$program\" || \\
4910 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4911 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4913 file=\"\$\$-\$program\"
4915 if test ! -d \"\$progdir\"; then
4916 $mkdir \"\$progdir\"
4918 $rm \"\$progdir/\$file\"
4923 # relink executable if necessary
4924 if test -n \"\$relink_command\"; then
4925 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4927 $echo \"\$relink_command_output\" >&2
4928 $rm \"\$progdir/\$file\"
4933 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4934 { $rm \"\$progdir/\$program\";
4935 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4936 $rm \"\$progdir/\$file\"
4940 program='$outputname'
4941 progdir=\"\$thisdir/$objdir\"
4947 if test -f \"\$progdir/\$program\"; then"
4949 # Export our shlibpath_var if we have one.
4950 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4952 # Add our own library path to $shlibpath_var
4953 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4955 # Some systems cannot cope with colon-terminated $shlibpath_var
4956 # The second colon is a workaround for a bug in BeOS R4 sed
4957 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4959 export $shlibpath_var
4963 # fixup the dll searchpath if we need to.
4964 if test -n "$dllsearchpath"; then
4966 # Add the dll search path components to the executable PATH
4967 PATH=$dllsearchpath:\$PATH
4972 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4973 # Run the actual program with our arguments.
4976 # Backslashes separate directories on plain windows
4977 *-*-mingw |
*-*-os2*)
4979 exec \$progdir\\\\\$program \${1+\"\$@\"}
4984 # Need to set LD_LIBRARY_PATH, to the value already
4985 # computed within libtool.
4987 LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"}
4992 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4996 # The program doesn't exist.
4997 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4998 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4999 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5010 # See if we need to build an old-fashioned archive.
5011 for oldlib
in $oldlibs; do
5013 if test "$build_libtool_libs" = convenience
; then
5014 oldobjs
="$libobjs_save"
5015 addlibs
="$convenience"
5016 build_libtool_libs
=no
5018 if test "$build_libtool_libs" = module
; then
5019 oldobjs
="$libobjs_save"
5020 build_libtool_libs
=no
5022 oldobjs
="$old_deplibs $non_pic_objects"
5024 addlibs
="$old_convenience"
5027 if test -n "$addlibs"; then
5028 gentop
="$output_objdir/${outputname}x"
5029 $show "${rm}r $gentop"
5030 $run ${rm}r
"$gentop"
5031 $show "$mkdir $gentop"
5032 $run $mkdir "$gentop"
5034 if test "$status" -ne 0 && test ! -d "$gentop"; then
5037 generated
="$generated $gentop"
5039 # Add in members from convenience archives.
5040 for xlib
in $addlibs; do
5041 # Extract the objects.
5043 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
5044 *) xabs
=`pwd`"/$xlib" ;;
5046 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5047 xdir
="$gentop/$xlib"
5049 $show "${rm}r $xdir"
5051 $show "$mkdir $xdir"
5054 if test "$status" -ne 0 && test ! -d "$xdir"; then
5057 # We will extract separately just the conflicting names and we will no
5058 # longer touch any unique names. It is faster to leave these extract
5059 # automatically by $AR in one run.
5060 $show "(cd $xdir && $AR x $xabs)"
5061 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
5062 if ($AR t
"$xabs" |
sort |
sort -uc >/dev
/null
2>&1); then
5065 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5066 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5067 $AR t
"$xabs" |
sort |
uniq -cd |
while read -r count name
5070 while test "$i" -le "$count"
5072 # Put our $i before any first dot (extension)
5073 # Never overwrite any file
5075 while test "X$name_to" = "X$name" ||
test -f "$xdir/$name_to"
5077 name_to
=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5079 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5080 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" ||
exit $?
5086 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5090 compiler_flags
="$compiler_flags $add_flags"
5092 # Do each command in the archive commands.
5093 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5094 eval cmds
=\"$old_archive_from_new_cmds\"
5096 eval cmds
=\"$old_archive_cmds\"
5098 if len
=`expr "X$cmds" : ".*"` &&
5099 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5102 # the command line is too long to link in one step, link in parts
5103 $echo "using piecewise archive linking..."
5108 save_oldobjs
=$oldobjs
5109 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5110 # encoded into archives. This makes 'ar r' malfunction in
5111 # this piecewise linking case whenever conflicting object
5112 # names appear in distinct ar calls; check, warn and compensate.
5113 if (for obj
in $save_oldobjs
5115 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
5116 done |
sort |
sort -uc >/dev
/null
2>&1); then
5119 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5120 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5123 # Is there a better way of finding the last object in the list?
5124 for obj
in $save_oldobjs
5128 for obj
in $save_oldobjs
5130 oldobjs
="$objlist $obj"
5131 objlist
="$objlist $obj"
5132 eval test_cmds
=\"$old_archive_cmds\"
5133 if len
=`expr "X$test_cmds" : ".*"` &&
5134 test "$len" -le "$max_cmd_len"; then
5137 # the above command should be used before it gets too long
5139 if test "$obj" = "$last_oldobj" ; then
5142 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5143 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5149 if test "X$oldobjs" = "X" ; then
5150 eval cmds
=\"\
$concat_cmds\"
5152 eval cmds
=\"\
$concat_cmds~
$old_archive_cmds\"
5156 save_ifs
="$IFS"; IFS
='~'
5157 for cmd
in $cmds; do
5160 $run eval "$cmd" ||
exit $?
5165 if test -n "$generated"; then
5166 $show "${rm}r$generated"
5167 $run ${rm}r
$generated
5170 # Now create the libtool archive.
5174 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5175 $show "creating $output"
5177 # Preserve any variables that may affect compiler behavior
5178 for var
in $variables_saved_for_relink; do
5179 if eval test -z \"\
${$var+set}\"; then
5180 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5181 elif eval var_value
=\$
$var; test -z "$var_value"; then
5182 relink_command
="$var=; export $var; $relink_command"
5184 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5185 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5188 # Quote the link command for shipping.
5189 relink_command
="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5190 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5191 if test "$hardcode_automatic" = yes ; then
5194 # Only create the output if not a dry run.
5195 if test -z "$run"; then
5196 for installed
in no
yes; do
5197 if test "$installed" = yes; then
5198 if test -z "$install_libdir"; then
5201 output
="$output_objdir/$outputname"i
5202 # Replace all uninstalled libtool libraries with the installed ones
5204 for deplib
in $dependency_libs; do
5207 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5208 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5209 if test -z "$libdir"; then
5210 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5213 if test "x$EGREP" = x
; then
5216 # We do not want portage's install root ($D) present. Check only for
5217 # this if the .la is being installed.
5218 if test "$installed" = yes && test "$D"; then
5219 eval mynewdependency_lib
=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5221 mynewdependency_lib
="$libdir/$name"
5223 # Do not add duplicates
5224 if test "$mynewdependency_lib"; then
5225 my_little_ninja_foo_1
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5226 if test -z "$my_little_ninja_foo_1"; then
5227 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
5232 if test "$installed" = yes; then
5233 # Rather use S=WORKDIR if our version of portage supports it.
5234 # This is because some ebuild (gcc) do not use $S as buildroot.
5235 if test "$PWORKDIR"; then
5238 # We do not want portage's build root ($S) present.
5239 my_little_ninja_foo_2
=`echo $deplib |$EGREP -e "$S"`
5240 # We do not want portage's install root ($D) present.
5241 my_little_ninja_foo_3
=`echo $deplib |$EGREP -e "$D"`
5242 if test -n "$my_little_ninja_foo_2" && test "$S"; then
5243 mynewdependency_lib
=""
5244 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
5245 eval mynewdependency_lib
=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5247 mynewdependency_lib
="$deplib"
5250 mynewdependency_lib
="$deplib"
5252 # Do not add duplicates
5253 if test "$mynewdependency_lib"; then
5254 my_little_ninja_foo_4
=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5255 if test -z "$my_little_ninja_foo_4"; then
5256 newdependency_libs
="$newdependency_libs $mynewdependency_lib"
5262 dependency_libs
="$newdependency_libs"
5264 for lib
in $dlfiles; do
5265 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5266 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5267 if test -z "$libdir"; then
5268 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5271 newdlfiles
="$newdlfiles $libdir/$name"
5273 dlfiles
="$newdlfiles"
5275 for lib
in $dlprefiles; do
5276 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5277 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5278 if test -z "$libdir"; then
5279 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5282 newdlprefiles
="$newdlprefiles $libdir/$name"
5284 dlprefiles
="$newdlprefiles"
5287 # place dlname in correct position for cygwin
5289 case $host,$output,$installed,$module,$dlname in
5290 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5292 # Do not add duplicates
5293 if test "$installed" = yes && test "$D"; then
5294 install_libdir
=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5297 # $outputname - a libtool library file
5298 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5300 # Please DO NOT delete this file!
5301 # It is necessary for linking the library.
5303 # The name that we can dlopen(3).
5306 # Names of this library.
5307 library_names='$library_names'
5309 # The name of the static archive.
5310 old_library='$old_library'
5312 # Libraries that this one depends upon.
5313 dependency_libs='$dependency_libs'
5315 # Version information for $libname.
5320 # Is this an already installed library?
5321 installed=$installed
5323 # Should we warn about portability when linking against -modules?
5324 shouldnotlink=$module
5326 # Files to dlopen/dlpreopen
5328 dlpreopen='$dlprefiles'
5330 # Directory that this library needs to be installed in:
5331 libdir='$install_libdir'"
5332 if test "$installed" = no
&& test "$need_relink" = yes && test "$fast_install" = no
; then
5334 relink_command=\"$relink_command\""
5339 # Do a symbolic link so that the libtool archive can be found in
5340 # LD_LIBRARY_PATH before the program is installed.
5341 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5342 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5348 # libtool install mode
5350 modename
="$modename: install"
5352 # There may be an optional sh(1) argument at the beginning of
5353 # install_prog (especially on Windows NT).
5354 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5355 # Allow the use of GNU shtool's install command.
5356 $echo "X$nonopt" |
$Xsed |
grep shtool
> /dev
/null
; then
5357 # Aesthetically quote it.
5358 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5360 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5364 install_prog
="$arg "
5372 # The real first argument should be the name of the installation program.
5373 # Aesthetically quote it.
5374 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5376 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5380 install_prog
="$install_prog$arg"
5382 # We need to accept at least all the BSD install flags.
5392 if test -n "$dest"; then
5393 files
="$files $dest"
5411 # If the previous option needed an argument, then skip it.
5412 if test -n "$prev"; then
5421 # Aesthetically quote the argument.
5422 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5424 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5428 install_prog
="$install_prog $arg"
5431 if test -z "$install_prog"; then
5432 $echo "$modename: you must specify an install program" 1>&2
5437 if test -n "$prev"; then
5438 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5443 if test -z "$files"; then
5444 if test -z "$dest"; then
5445 $echo "$modename: no file or destination specified" 1>&2
5447 $echo "$modename: you must specify a destination" 1>&2
5453 # Strip any trailing slash from the destination.
5454 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5456 # Check to see that the destination is a directory.
5457 test -d "$dest" && isdir
=yes
5458 if test "$isdir" = yes; then
5462 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5463 test "X$destdir" = "X$dest" && destdir
=.
5464 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5466 # Not a directory, so check to see that there is only one file specified.
5468 if test "$#" -gt 2; then
5469 $echo "$modename: \`$dest' is not a directory" 1>&2
5475 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5477 for file in $files; do
5481 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5490 # This variable tells wrapper scripts just to set variables rather
5491 # than running their programs.
5492 libtool_install_magic
="$magic"
5497 for file in $files; do
5499 # Do each installation.
5502 # Do the static libraries later.
5503 staticlibs
="$staticlibs $file"
5507 # Check to see that this really is a libtool archive.
5508 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5510 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5518 # If there is no directory component, then add one.
5520 */* |
*\\*) .
$file ;;
5524 # Add the libdir to current_libdirs if it is the destination.
5525 if test "X$destdir" = "X$libdir"; then
5526 case "$current_libdirs " in
5528 *) current_libdirs
="$current_libdirs $libdir" ;;
5531 # Note the libdir as a future libdir.
5532 case "$future_libdirs " in
5534 *) future_libdirs
="$future_libdirs $libdir" ;;
5538 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5539 test "X$dir" = "X$file/" && dir
=
5542 if test -n "$relink_command"; then
5543 # Determine the prefix the user has applied to our future dir.
5544 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5546 # Don't allow the user to place us outside of our expected
5547 # location b/c this prevents finding dependent libraries that
5548 # are installed to the same prefix.
5549 # At present, this check doesn't affect windows .dll's that
5550 # are installed into $libdir/../bin (currently, that works fine)
5551 # but it's something to keep an eye on.
5552 if test "$inst_prefix_dir" = "$destdir"; then
5553 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5557 if test -n "$inst_prefix_dir"; then
5558 # Stick the inst_prefix_dir data into the link command.
5559 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5561 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5564 $echo "$modename: warning: relinking \`$file'" 1>&2
5565 $show "$relink_command"
5566 if $run eval "$relink_command"; then :
5568 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5573 # See the names of the shared library.
5574 set dummy
$library_names
5575 if test -n "$2"; then
5581 test -n "$relink_command" && srcname
="$realname"T
5583 # Install the shared library and build the symlinks.
5584 $show "$install_prog $dir/$srcname $destdir/$realname"
5585 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5586 if test -n "$stripme" && test -n "$striplib"; then
5587 $show "$striplib $destdir/$realname"
5588 $run eval "$striplib $destdir/$realname" ||
exit $?
5591 if test "$#" -gt 0; then
5592 # Delete the old symlinks, and create new ones.
5595 if test "$linkname" != "$realname"; then
5596 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5597 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5602 # Do each command in the postinstall commands.
5603 lib
="$destdir/$realname"
5604 eval cmds
=\"$postinstall_cmds\"
5605 save_ifs
="$IFS"; IFS
='~'
5606 for cmd
in $cmds; do
5609 $run eval "$cmd" ||
exit $?
5614 # Install the pseudo-library for information purposes.
5615 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5616 instname
="$dir/$name"i
5617 $show "$install_prog $instname $destdir/$name"
5618 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5620 # Maybe install the static library, too.
5621 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5625 # Install (i.e. copy) a libtool object.
5627 # Figure out destination file name, if it wasn't already specified.
5628 if test -n "$destname"; then
5629 destfile
="$destdir/$destname"
5631 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5632 destfile
="$destdir/$destfile"
5635 # Deduce the name of the destination old-style object file.
5638 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5641 staticdest
="$destfile"
5645 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5651 # Install the libtool object if requested.
5652 if test -n "$destfile"; then
5653 $show "$install_prog $file $destfile"
5654 $run eval "$install_prog $file $destfile" ||
exit $?
5657 # Install the old object if enabled.
5658 if test "$build_old_libs" = yes; then
5659 # Deduce the name of the old-style object file.
5660 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5662 $show "$install_prog $staticobj $staticdest"
5663 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5669 # Figure out destination file name, if it wasn't already specified.
5670 if test -n "$destname"; then
5671 destfile
="$destdir/$destname"
5673 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5674 destfile
="$destdir/$destfile"
5677 # If the file is missing, and there is a .exe on the end, strip it
5678 # because it is most likely a libtool script we actually want to
5683 if test ! -f "$file"; then
5684 file=`$echo $file|${SED} 's,.exe$,,'`
5690 # Do a test to see if this is really a libtool program.
5693 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5699 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5703 # To insure that "foo" is sourced, and not "foo.exe",
5704 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5705 # which disallows the automatic-append-.exe behavior.
5707 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5708 *) wrapperdot
=${wrapper} ;;
5710 # If there is no directory component, then add one.
5712 */* |
*\\*) .
${wrapperdot} ;;
5713 *) . .
/${wrapperdot} ;;
5716 # Check the variables that should have been set.
5717 if test -z "$notinst_deplibs"; then
5718 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5723 for lib
in $notinst_deplibs; do
5724 # Check to see that each library is installed.
5726 if test -f "$lib"; then
5727 # If there is no directory component, then add one.
5729 */* |
*\\*) .
$lib ;;
5733 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5734 if test -n "$libdir" && test ! -f "$libfile"; then
5735 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5741 # To insure that "foo" is sourced, and not "foo.exe",
5742 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5743 # which disallows the automatic-append-.exe behavior.
5745 *cygwin
* |
*mingw
*) wrapperdot
=${wrapper}.
;;
5746 *) wrapperdot
=${wrapper} ;;
5748 # If there is no directory component, then add one.
5750 */* |
*\\*) .
${wrapperdot} ;;
5751 *) . .
/${wrapperdot} ;;
5755 if test "$fast_install" = no
&& test -n "$relink_command"; then
5756 if test "$finalize" = yes && test -z "$run"; then
5758 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5759 tmpdir
="$tmpdir/libtool-$$"
5760 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
5762 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5765 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5766 outputname
="$tmpdir/$file"
5767 # Replace the output file specification.
5768 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5770 $show "$relink_command"
5771 if $run eval "$relink_command"; then :
5773 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5779 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5782 # Install the binary that we compiled earlier.
5783 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5787 # remove .exe since cygwin /usr/bin/install will append another
5789 case $install_prog,$host in
5790 */usr
/bin
/install*,*cygwin
*)
5791 case $file:$destfile in
5796 destfile
=$destfile.exe
5799 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5804 $show "$install_prog$stripme $file $destfile"
5805 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5806 test -n "$outputname" && ${rm}r
"$tmpdir"
5811 for file in $staticlibs; do
5812 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5814 # Set up the ranlib parameters.
5815 oldlib
="$destdir/$name"
5817 $show "$install_prog $file $oldlib"
5818 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5820 if test -n "$stripme" && test -n "$striplib"; then
5821 $show "$old_striplib $oldlib"
5822 $run eval "$old_striplib $oldlib" ||
exit $?
5825 # Do each command in the postinstall commands.
5826 eval cmds
=\"$old_postinstall_cmds\"
5827 save_ifs
="$IFS"; IFS
='~'
5828 for cmd
in $cmds; do
5831 $run eval "$cmd" ||
exit $?
5836 if test -n "$future_libdirs"; then
5837 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5840 if test -n "$current_libdirs"; then
5841 # Maybe just do a dry run.
5842 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5843 exec_cmd
='$SHELL $0 --finish$current_libdirs'
5849 # libtool finish mode
5851 modename
="$modename: finish"
5855 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5858 libdirs
="$libdirs $dir"
5861 for libdir
in $libdirs; do
5862 if test -n "$finish_cmds"; then
5863 # Do each command in the finish commands.
5864 eval cmds
=\"$finish_cmds\"
5865 save_ifs
="$IFS"; IFS
='~'
5866 for cmd
in $cmds; do
5869 $run eval "$cmd" || admincmds
="$admincmds
5874 if test -n "$finish_eval"; then
5875 # Do the single finish_eval.
5876 eval cmds
=\"$finish_eval\"
5877 $run eval "$cmds" || admincmds
="$admincmds
5883 # Exit here if they wanted silent mode.
5886 $echo "----------------------------------------------------------------------"
5887 $echo "Libraries have been installed in:"
5888 for libdir
in $libdirs; do
5892 $echo "If you ever happen to want to link against installed libraries"
5893 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5894 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5895 $echo "flag during linking and do at least one of the following:"
5896 if test -n "$shlibpath_var"; then
5897 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5898 $echo " during execution"
5900 if test -n "$runpath_var"; then
5901 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5902 $echo " during linking"
5904 if test -n "$hardcode_libdir_flag_spec"; then
5906 eval flag
=\"$hardcode_libdir_flag_spec\"
5908 $echo " - use the \`$flag' linker flag"
5910 if test -n "$admincmds"; then
5911 $echo " - have your system administrator run these commands:$admincmds"
5913 if test -f /etc
/ld.so.conf
; then
5914 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5917 $echo "See any operating system documentation about shared libraries for"
5918 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5919 $echo "----------------------------------------------------------------------"
5923 # libtool execute mode
5925 modename
="$modename: execute"
5927 # The first argument is the command name.
5929 if test -z "$cmd"; then
5930 $echo "$modename: you must specify a COMMAND" 1>&2
5935 # Handle -dlopen flags immediately.
5936 for file in $execute_dlfiles; do
5937 if test ! -f "$file"; then
5938 $echo "$modename: \`$file' is not a file" 1>&2
5946 # Check to see that this really is a libtool archive.
5947 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5949 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5954 # Read the libtool library.
5958 # If there is no directory component, then add one.
5960 */* |
*\\*) .
$file ;;
5964 # Skip this library if it cannot be dlopened.
5965 if test -z "$dlname"; then
5966 # Warn if it was a shared library.
5967 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5971 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5972 test "X$dir" = "X$file" && dir
=.
5974 if test -f "$dir/$objdir/$dlname"; then
5977 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5983 # Just add the directory containing the .lo file.
5984 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5985 test "X$dir" = "X$file" && dir
=.
5989 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5994 # Get the absolute pathname.
5995 absdir
=`cd "$dir" && pwd`
5996 test -n "$absdir" && dir
="$absdir"
5998 # Now add the directory to shlibpath_var.
5999 if eval "test -z \"\$$shlibpath_var\""; then
6000 eval "$shlibpath_var=\"\$dir\""
6002 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6006 # This variable tells wrapper scripts just to set shlibpath_var
6007 # rather than running their programs.
6008 libtool_execute_magic
="$magic"
6010 # Check if any of the arguments is a wrapper script.
6017 # Do a test to see if this is really a libtool program.
6018 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6019 # If there is no directory component, then add one.
6021 */* |
*\\*) .
$file ;;
6025 # Transform arg to wrapped name.
6026 file="$progdir/$program"
6030 # Quote arguments (to preserve shell metacharacters).
6031 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6032 args
="$args \"$file\""
6035 if test -z "$run"; then
6036 if test -n "$shlibpath_var"; then
6037 # Export the shlibpath_var.
6038 eval "export $shlibpath_var"
6041 # Restore saved environment variables
6042 if test "${save_LC_ALL+set}" = set; then
6043 LC_ALL
="$save_LC_ALL"; export LC_ALL
6045 if test "${save_LANG+set}" = set; then
6046 LANG
="$save_LANG"; export LANG
6049 # Now prepare to actually exec the command.
6050 exec_cmd
="\$cmd$args"
6052 # Display what would be done.
6053 if test -n "$shlibpath_var"; then
6054 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6055 $echo "export $shlibpath_var"
6062 # libtool clean and uninstall mode
6064 modename
="$modename: $mode"
6070 # This variable tells wrapper scripts just to set variables rather
6071 # than running their programs.
6072 libtool_install_magic
="$magic"
6077 -f) rm="$rm $arg"; rmforce
=yes ;;
6078 -*) rm="$rm $arg" ;;
6079 *) files
="$files $arg" ;;
6083 if test -z "$rm"; then
6084 $echo "$modename: you must specify an RM program" 1>&2
6091 origobjdir
="$objdir"
6092 for file in $files; do
6093 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6094 if test "X$dir" = "X$file"; then
6096 objdir
="$origobjdir"
6098 objdir
="$dir/$origobjdir"
6100 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6101 test "$mode" = uninstall
&& objdir
="$dir"
6103 # Remember objdir for removal later, being careful to avoid duplicates
6104 if test "$mode" = clean
; then
6107 *) rmdirs
="$rmdirs $objdir" ;;
6111 # Don't error if the file doesn't exist and rm -f was used.
6112 if (test -L "$file") >/dev
/null
2>&1 \
6113 ||
(test -h "$file") >/dev
/null
2>&1 \
6114 ||
test -f "$file"; then
6116 elif test -d "$file"; then
6119 elif test "$rmforce" = yes; then
6127 # Possibly a libtool archive, so verify it.
6128 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6131 # Delete the libtool libraries and symlinks.
6132 for n
in $library_names; do
6133 rmfiles
="$rmfiles $objdir/$n"
6135 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6136 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6138 if test "$mode" = uninstall
; then
6139 if test -n "$library_names"; then
6140 # Do each command in the postuninstall commands.
6141 eval cmds
=\"$postuninstall_cmds\"
6142 save_ifs
="$IFS"; IFS
='~'
6143 for cmd
in $cmds; do
6147 if test "$?" -ne 0 && test "$rmforce" != yes; then
6154 if test -n "$old_library"; then
6155 # Do each command in the old_postuninstall commands.
6156 eval cmds
=\"$old_postuninstall_cmds\"
6157 save_ifs
="$IFS"; IFS
='~'
6158 for cmd
in $cmds; do
6162 if test "$?" -ne 0 && test "$rmforce" != yes; then
6168 # FIXME: should reinstall the best remaining shared library.
6174 # Possibly a libtool object, so verify it.
6175 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6180 # Add PIC object to the list of files to remove.
6181 if test -n "$pic_object" \
6182 && test "$pic_object" != none
; then
6183 rmfiles
="$rmfiles $dir/$pic_object"
6186 # Add non-PIC object to the list of files to remove.
6187 if test -n "$non_pic_object" \
6188 && test "$non_pic_object" != none
; then
6189 rmfiles
="$rmfiles $dir/$non_pic_object"
6195 if test "$mode" = clean
; then
6199 file=`$echo $file|${SED} 's,.exe$,,'`
6200 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6201 # $file with .exe has already been added to rmfiles,
6202 # add $file without .exe
6203 rmfiles
="$rmfiles $file"
6206 # Do a test to see if this is a libtool program.
6207 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6211 # note $name still contains .exe if it was in $file originally
6212 # as does the version of $file that was added into $rmfiles
6213 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6214 if test "$fast_install" = yes && test -n "$relink_command"; then
6215 rmfiles
="$rmfiles $objdir/lt-$name"
6217 if test "X$noexename" != "X$name" ; then
6218 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6224 $show "$rm $rmfiles"
6225 $run $rm $rmfiles || exit_status
=1
6227 objdir
="$origobjdir"
6229 # Try to remove the ${objdir}s in the directories where we deleted files
6230 for dir
in $rmdirs; do
6231 if test -d "$dir"; then
6233 $run rmdir $dir >/dev
/null
2>&1
6241 $echo "$modename: you must specify a MODE" 1>&2
6242 $echo "$generic_help" 1>&2
6247 if test -z "$exec_cmd"; then
6248 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6249 $echo "$generic_help" 1>&2
6252 fi # test -z "$show_help"
6254 if test -n "$exec_cmd"; then
6259 # We need to display help for each of the modes.
6262 "Usage: $modename [OPTION]... [MODE-ARG]...
6264 Provide generalized library-building support services.
6266 --config show all configuration variables
6267 --debug enable verbose shell tracing
6268 -n, --dry-run display commands without modifying any files
6269 --features display basic configuration information and exit
6270 --finish same as \`--mode=finish'
6271 --help display this help message and exit
6272 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6273 --quiet same as \`--silent'
6274 --silent don't print informational messages
6275 --tag=TAG use configuration variables from tag TAG
6276 --version print version information
6278 MODE must be one of the following:
6280 clean remove files from the build directory
6281 compile compile a source file into a libtool object
6282 execute automatically set library path, then run a program
6283 finish complete the installation of libtool libraries
6284 install install libraries or executables
6285 link create a library or an executable
6286 uninstall remove libraries from an installed directory
6288 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6289 a more detailed description of MODE.
6291 Report bugs to <bug-libtool@gnu.org>."
6297 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6299 Remove files from the build directory.
6301 RM is the name of the program to use to delete files associated with each FILE
6302 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6305 If FILE is a libtool library, object or program, all the files associated
6306 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6311 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6313 Compile a source file into a libtool library object.
6315 This mode accepts the following additional options:
6317 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6318 -prefer-pic try to building PIC objects only
6319 -prefer-non-pic try to building non-PIC objects only
6320 -static always build a \`.o' file suitable for static linking
6322 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6323 from the given SOURCEFILE.
6325 The output file name is determined by removing the directory component from
6326 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6327 library object suffix, \`.lo'."
6332 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6334 Automatically set library path, then run a program.
6336 This mode accepts the following additional options:
6338 -dlopen FILE add the directory containing FILE to the library path
6340 This mode sets the library path environment variable according to \`-dlopen'
6343 If any of the ARGS are libtool executable wrappers, then they are translated
6344 into their corresponding uninstalled binary, and any of their required library
6345 directories are added to the library path.
6347 Then, COMMAND is executed, with ARGS as arguments."
6352 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6354 Complete the installation of libtool libraries.
6356 Each LIBDIR is a directory that contains libtool libraries.
6358 The commands that this mode executes may require superuser privileges. Use
6359 the \`--dry-run' option if you just want to see what would be executed."
6364 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6366 Install executables or libraries.
6368 INSTALL-COMMAND is the installation command. The first component should be
6369 either the \`install' or \`cp' program.
6371 The rest of the components are interpreted as arguments to that command (only
6372 BSD-compatible install options are recognized)."
6377 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6379 Link object files or libraries together to form another library, or to
6380 create an executable program.
6382 LINK-COMMAND is a command using the C compiler that you would use to create
6383 a program from several object files.
6385 The following components of LINK-COMMAND are treated specially:
6387 -all-static do not do any dynamic linking at all
6388 -avoid-version do not add a version suffix if possible
6389 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6390 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6391 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6392 -export-symbols SYMFILE
6393 try to export only the symbols listed in SYMFILE
6394 -export-symbols-regex REGEX
6395 try to export only the symbols matching REGEX
6396 -LLIBDIR search LIBDIR for required installed libraries
6397 -lNAME OUTPUT-FILE requires the installed library libNAME
6398 -module build a library that can dlopened
6399 -no-fast-install disable the fast-install mode
6400 -no-install link a not-installable executable
6401 -no-undefined declare that a library does not refer to external symbols
6402 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6403 -objectlist FILE Use a list of object files found in FILE to specify objects
6404 -release RELEASE specify package release information
6405 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6406 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6407 -static do not do any dynamic linking of libtool libraries
6408 -version-info CURRENT[:REVISION[:AGE]]
6409 specify library version info [each variable defaults to 0]
6411 All other options (arguments beginning with \`-') are ignored.
6413 Every other argument is treated as a filename. Files ending in \`.la' are
6414 treated as uninstalled libtool libraries, other files are standard or library
6417 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6418 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6419 required, except when creating a convenience library.
6421 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6422 using \`ar' and \`ranlib', or on Windows using \`lib'.
6424 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6425 is created, otherwise an executable program is created."
6430 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6432 Remove libraries from an installation directory.
6434 RM is the name of the program to use to delete files associated with each FILE
6435 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6438 If FILE is a libtool library, all the files associated with it are deleted.
6439 Otherwise, only FILE itself is deleted using RM."
6443 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6450 $echo "Try \`$modename --help' for more information about other modes."
6454 # The TAGs below are defined such that we never get into a situation
6455 # in which we disable both kinds of libraries. Given conflicting
6456 # choices, we go for a static library, that is the most portable,
6457 # since we can't tell whether shared libraries were disabled because
6458 # the user asked for that or because the platform doesn't support
6459 # them. This is particularly important on AIX, because we don't
6460 # support having both static and shared libraries enabled at the same
6461 # time on that platform, so we default to a shared-only configuration.
6462 # If a disable-shared tag is given, we'll fallback to a static-only
6463 # configuration. But we'll never go from static-only to shared-only.
6465 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6466 build_libtool_libs
=no
6468 # ### END LIBTOOL TAG CONFIG: disable-shared
6470 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6471 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6472 # ### END LIBTOOL TAG CONFIG: disable-static