1 # ltmain.sh - Provide generalized library-building support services.
\r
2 # NOTE: Changing this file will not affect anything until you rerun configure.
\r
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
\r
5 # Free Software Foundation, Inc.
\r
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
\r
8 # This program is free software; you can redistribute it and/or modify
\r
9 # it under the terms of the GNU General Public License as published by
\r
10 # the Free Software Foundation; either version 2 of the License, or
\r
11 # (at your option) any later version.
\r
13 # This program is distributed in the hope that it will be useful, but
\r
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
16 # General Public License for more details.
\r
18 # You should have received a copy of the GNU General Public License
\r
19 # along with this program; if not, write to the Free Software
\r
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
22 # As a special exception to the GNU General Public License, if you
\r
23 # distribute this file as part of a program that contains a
\r
24 # configuration script generated by Autoconf, you may include it under
\r
25 # the same distribution terms that you use for the rest of that program.
\r
27 basename="s,^.*/,,g"
\r
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
\r
30 # is ksh but when the shell is invoked as "sh" and the current value of
\r
31 # the _XPG environment variable is not equal to 1 (one), the special
\r
32 # positional parameter $0, within a function call, is the name of the
\r
36 # RH: define SED for historic ltconfig's generated by Libtool 1.3
\r
37 [ -z "$SED" ] && SED=sed
\r
39 # The name of this program:
\r
40 progname=`echo "$progpath" | $SED $basename`
\r
41 modename="$progname"
\r
50 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
\r
53 # Check that we have a working $echo.
\r
54 if test "X$1" = X--no-reexec; then
\r
55 # Discard the --no-reexec flag, and continue.
\r
57 elif test "X$1" = X--fallback-echo; then
\r
58 # Avoid inline document here, it may be left over
\r
60 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
\r
61 # Yippee, $echo works!
\r
64 # Restart under the correct shell, and then maybe $echo will work.
\r
65 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
\r
68 if test "X$1" = X--fallback-echo; then
\r
69 # used as fallback echo
\r
78 help="Try \`$progname --help' for more information."
\r
79 magic="%%%MAGIC variable%%%"
\r
84 # Sed substitution that helps us do robust quoting. It backslashifies
\r
85 # metacharacters that are still active within double-quoted strings.
\r
86 Xsed="${SED}"' -e 1s/^X//'
\r
87 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
\r
88 # test EBCDIC or ASCII
\r
89 case `echo A|tr A '\301'` in
\r
90 A) # EBCDIC based system
\r
91 SP2NL="tr '\100' '\n'"
\r
92 NL2SP="tr '\r\n' '\100\100'"
\r
94 *) # Assume ASCII based system
\r
95 SP2NL="tr '\040' '\012'"
\r
96 NL2SP="tr '\015\012' '\040\040'"
\r
101 # Only set LANG and LC_ALL to C if already set.
\r
102 # These must not be set unconditionally because not all systems understand
\r
103 # e.g. LANG=C (notably SCO).
\r
104 # We save the old values to restore during execute mode.
\r
105 if test "${LC_ALL+set}" = set; then
\r
106 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
\r
108 if test "${LANG+set}" = set; then
\r
109 save_LANG="$LANG"; LANG=C; export LANG
\r
112 # Make sure IFS has a sensible default
\r
116 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
\r
117 $echo "$modename: not configured to build any kind of library" 1>&2
\r
118 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
\r
122 # Global variables.
\r
131 lo2o="s/\\.lo\$/.${objext}/"
\r
132 o2lo="s/\\.${objext}\$/.lo/"
\r
134 #####################################
\r
135 # Shell function definitions:
\r
136 # This seems to be the best place for them
\r
138 # func_win32_libid arg
\r
139 # return the library type of file 'arg'
\r
141 # Need a lot of goo to handle *both* DLLs and import libs
\r
142 # Has to be a shell function in order to 'eat' the argument
\r
143 # that is supplied when $file_magic_command is called.
\r
144 func_win32_libid () {
\r
145 win32_libid_type="unknown"
\r
146 win32_fileres=`file -L $1 2>/dev/null`
\r
147 case $win32_fileres in
\r
148 *ar\ archive\ import\ library*) # definitely import
\r
149 win32_libid_type="x86 archive import"
\r
151 *ar\ archive*) # could be an import, or static
\r
152 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
\r
153 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
\r
154 win32_nmres=`eval $NM -f posix -A $1 | \
\r
155 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
\r
156 if test "X$win32_nmres" = "Ximport" ; then
\r
157 win32_libid_type="x86 archive import"
\r
159 win32_libid_type="x86 archive static"
\r
164 win32_libid_type="x86 DLL"
\r
166 *executable*) # but shell scripts are "executable" too...
\r
167 case $win32_fileres in
\r
168 *MS\ Windows\ PE\ Intel*)
\r
169 win32_libid_type="x86 DLL"
\r
174 $echo $win32_libid_type
\r
178 # func_infer_tag arg
\r
179 # Infer tagged configuration to use if any are available and
\r
180 # if one wasn't chosen via the "--tag" command line option.
\r
181 # Only attempt this if the compiler in the base compile
\r
182 # command doesn't match the default compiler.
\r
183 # arg is usually of the form 'gcc ...'
\r
184 func_infer_tag () {
\r
185 if test -n "$available_tags" && test -z "$tagname"; then
\r
189 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
193 CC_quoted="$CC_quoted $arg"
\r
196 # Blanks in the command may have been stripped by the calling shell,
\r
197 # but not from the CC environment variable when configure was run.
\r
198 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
\r
199 # Blanks at the start of $base_compile will cause this to fail
\r
200 # if we don't check for them as well.
\r
202 for z in $available_tags; do
\r
203 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
\r
204 # Evaluate the configuration.
\r
205 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
\r
208 # Double-quote args containing other shell metacharacters.
\r
210 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
214 CC_quoted="$CC_quoted $arg"
\r
217 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
\r
218 # The compiler in the base compile command matches
\r
219 # the one in the tagged configuration.
\r
220 # Assume this is the tagged configuration we want.
\r
227 # If $tagname still isn't set, then no tagged configuration
\r
228 # was found and let the user know that the "--tag" command
\r
229 # line option must be used.
\r
230 if test -z "$tagname"; then
\r
231 $echo "$modename: unable to infer tagged configuration"
\r
232 $echo "$modename: specify a tag with \`--tag'" 1>&2
\r
235 # $echo "$modename: using $tagname tagged configuration"
\r
241 # End of Shell function definitions
\r
242 #####################################
\r
245 eval std_shrext=\"$shrext_cmds\"
\r
247 # Parse our command line options once, thoroughly.
\r
248 while test "$#" -gt 0
\r
254 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
\r
258 # If the previous option needs an argument, assign it.
\r
259 if test -n "$prev"; then
\r
262 execute_dlfiles="$execute_dlfiles $arg"
\r
266 preserve_args="${preserve_args}=$arg"
\r
268 # Check whether tagname contains only valid characters
\r
270 *[!-_A-Za-z0-9,/]*)
\r
271 $echo "$progname: invalid tag name: $tagname" 1>&2
\r
278 # Don't test for the "default" C tag, as we know, it's there, but
\r
279 # not specially marked.
\r
282 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
\r
283 taglist="$taglist $tagname"
\r
284 # Evaluate the configuration.
\r
285 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
\r
287 $echo "$progname: ignoring unknown tag $tagname" 1>&2
\r
302 # Have we seen a non-optional argument yet?
\r
309 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
\r
311 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
\r
312 $echo "This is free software; see the source for copying conditions. There is NO"
\r
313 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
\r
318 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
\r
319 # Now print the configurations for the tags.
\r
320 for tagname in $taglist; do
\r
321 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
\r
327 $echo "$progname: enabling shell trace mode"
\r
329 preserve_args="$preserve_args $arg"
\r
337 $echo "host: $host"
\r
338 if test "$build_libtool_libs" = yes; then
\r
339 $echo "enable shared libraries"
\r
341 $echo "disable shared libraries"
\r
343 if test "$build_old_libs" = yes; then
\r
344 $echo "enable static libraries"
\r
346 $echo "disable static libraries"
\r
351 --finish) mode="finish" ;;
\r
353 --mode) prevopt="--mode" prev=mode ;;
\r
354 --mode=*) mode="$optarg" ;;
\r
356 --preserve-dup-deps) duplicate_deps="yes" ;;
\r
358 --quiet | --silent)
\r
360 preserve_args="$preserve_args $arg"
\r
363 --tag) prevopt="--tag" prev=tag ;;
\r
365 set tag "$optarg" ${1+"$@"}
\r
368 preserve_args="$preserve_args --tag"
\r
373 prev=execute_dlfiles
\r
377 $echo "$modename: unrecognized option \`$arg'" 1>&2
\r
389 if test -n "$prevopt"; then
\r
390 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
\r
395 # If this variable is set in any of the actions, the command in it
\r
396 # will be execed at the end. This prevents here-documents from being
\r
397 # left over by shells.
\r
400 if test -z "$show_help"; then
\r
402 # Infer the operation mode.
\r
403 if test -z "$mode"; then
\r
404 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
\r
405 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
\r
407 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
\r
419 *db | *dbx | *strace | *truss)
\r
429 # If we have no mode, but dlfiles were specified, then do execute mode.
\r
430 test -n "$execute_dlfiles" && mode=execute
\r
432 # Just use the default operation mode.
\r
433 if test -z "$mode"; then
\r
434 if test -n "$nonopt"; then
\r
435 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
\r
437 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
\r
444 # Only execute mode is allowed to have -dlopen flags.
\r
445 if test -n "$execute_dlfiles" && test "$mode" != execute; then
\r
446 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
\r
451 # Change the help message to a mode-specific one.
\r
452 generic_help="$help"
\r
453 help="Try \`$modename --help --mode=$mode' for more information."
\r
455 # These modes are in order of execution frequency so that they run quickly.
\r
457 # libtool compile mode
\r
459 modename="$modename: compile"
\r
460 # Get the compilation command and the source file.
\r
462 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
\r
471 case "$arg_mode" in
\r
473 # do not "continue". Instead, add this to base_compile
\r
485 # Accept any command-line options.
\r
488 if test -n "$libobj" ; then
\r
489 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
\r
496 -static | -prefer-pic | -prefer-non-pic)
\r
497 later="$later $arg"
\r
507 arg_mode=arg # the next one goes into the "base_compile" arg list
\r
508 continue # The current "srcfile" will either be retained or
\r
509 ;; # replaced later. I would guess that would be a bug.
\r
512 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
\r
514 save_ifs="$IFS"; IFS=','
\r
515 for arg in $args; do
\r
518 # Double-quote args containing other shell metacharacters.
\r
519 # Many Bourne shells cannot handle close brackets correctly
\r
520 # in scan sets, so we specify it separately.
\r
522 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
526 lastarg="$lastarg $arg"
\r
529 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
\r
531 # Add the arguments to base_compile.
\r
532 base_compile="$base_compile $lastarg"
\r
537 # Accept the current argument as the source file.
\r
538 # The previous "srcfile" becomes the current argument.
\r
545 esac # case $arg_mode
\r
547 # Aesthetically quote the previous argument.
\r
548 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
\r
551 # Double-quote args containing other shell metacharacters.
\r
552 # Many Bourne shells cannot handle close brackets correctly
\r
553 # in scan sets, so we specify it separately.
\r
554 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
555 lastarg="\"$lastarg\""
\r
559 base_compile="$base_compile $lastarg"
\r
564 $echo "$modename: you must specify an argument for -Xcompile"
\r
568 $echo "$modename: you must specify a target with \`-o'" 1>&2
\r
572 # Get the name of the library object.
\r
573 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
\r
577 # Recognize several different file suffixes.
\r
578 # If the user specifies -o file.o, it is replaced with file.lo
\r
579 xform='[cCFSifmso]'
\r
581 *.ada) xform=ada ;;
\r
582 *.adb) xform=adb ;;
\r
583 *.ads) xform=ads ;;
\r
584 *.asm) xform=asm ;;
\r
585 *.c++) xform=c++ ;;
\r
588 *.class) xform=class ;;
\r
589 *.cpp) xform=cpp ;;
\r
590 *.cxx) xform=cxx ;;
\r
591 *.f90) xform=f90 ;;
\r
592 *.for) xform=for ;;
\r
593 *.java) xform=java ;;
\r
596 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
\r
599 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
\r
601 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
\r
606 func_infer_tag $base_compile
\r
608 for arg in $later; do
\r
627 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
\r
628 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
\r
629 if test "X$xdir" = "X$obj"; then
\r
634 lobj=${xdir}$objdir/$objname
\r
636 if test -z "$base_compile"; then
\r
637 $echo "$modename: you must specify a compilation command" 1>&2
\r
642 # Delete any leftover library objects.
\r
643 if test "$build_old_libs" = yes; then
\r
644 removelist="$obj $lobj $libobj ${libobj}T"
\r
646 removelist="$lobj $libobj ${libobj}T"
\r
649 $run $rm $removelist
\r
650 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
\r
652 # On Cygwin there's no "real" PIC flag so we must build both object types
\r
654 cygwin* | mingw* | pw32* | os2*)
\r
658 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
\r
659 # non-PIC code in shared libraries is not supported
\r
663 # Calculate the filename of the output object if compiler does
\r
664 # not support -o with -c
\r
665 if test "$compiler_c_o" = no; then
\r
666 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
\r
667 lockfile="$output_obj.lock"
\r
668 removelist="$removelist $output_obj $lockfile"
\r
669 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
\r
676 # Lock this critical section if it is needed
\r
677 # We use this script file to make the link, it avoids creating a new file
\r
678 if test "$need_locks" = yes; then
\r
679 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
\r
680 $show "Waiting for $lockfile to be removed"
\r
683 elif test "$need_locks" = warn; then
\r
684 if test -f "$lockfile"; then
\r
686 *** ERROR, $lockfile exists and contains:
\r
687 `cat $lockfile 2>/dev/null`
\r
689 This indicates that another process is trying to use the same
\r
690 temporary object file, and libtool could not work around it because
\r
691 your compiler does not support \`-c' and \`-o' together. If you
\r
692 repeat this compilation, it may succeed, by chance, but you had better
\r
693 avoid parallel builds (make -j) in this platform, or get a better
\r
696 $run $rm $removelist
\r
699 $echo $srcfile > "$lockfile"
\r
702 if test -n "$fix_srcfile_path"; then
\r
703 eval srcfile=\"$fix_srcfile_path\"
\r
706 $run $rm "$libobj" "${libobj}T"
\r
708 # Create a libtool object file (analogous to a ".la" file),
\r
709 # but don't create it if we're doing a dry run.
\r
710 test -z "$run" && cat > ${libobj}T <<EOF
\r
711 # $libobj - a libtool object file
\r
712 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
\r
714 # Please DO NOT delete this file!
\r
715 # It is necessary for linking the library.
\r
717 # Name of the PIC object.
\r
720 # Only build a PIC object if we are building libtool libraries.
\r
721 if test "$build_libtool_libs" = yes; then
\r
722 # Without this assignment, base_compile gets emptied.
\r
723 fbsd_hideous_sh_bug=$base_compile
\r
725 if test "$pic_mode" != no; then
\r
726 command="$base_compile $srcfile $pic_flag"
\r
728 # Don't build PIC code
\r
729 command="$base_compile $srcfile"
\r
732 if test ! -d "${xdir}$objdir"; then
\r
733 $show "$mkdir ${xdir}$objdir"
\r
734 $run $mkdir ${xdir}$objdir
\r
736 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
\r
741 if test -z "$output_obj"; then
\r
742 # Place PIC objects in $objdir
\r
743 command="$command -o $lobj"
\r
746 $run $rm "$lobj" "$output_obj"
\r
749 if $run eval "$command"; then :
\r
751 test -n "$output_obj" && $run $rm $removelist
\r
755 if test "$need_locks" = warn &&
\r
756 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
\r
758 *** ERROR, $lockfile contains:
\r
759 `cat $lockfile 2>/dev/null`
\r
761 but it should contain:
\r
764 This indicates that another process is trying to use the same
\r
765 temporary object file, and libtool could not work around it because
\r
766 your compiler does not support \`-c' and \`-o' together. If you
\r
767 repeat this compilation, it may succeed, by chance, but you had better
\r
768 avoid parallel builds (make -j) in this platform, or get a better
\r
771 $run $rm $removelist
\r
775 # Just move the object if needed, then go on to compile the next one
\r
776 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
\r
777 $show "$mv $output_obj $lobj"
\r
778 if $run $mv $output_obj $lobj; then :
\r
781 $run $rm $removelist
\r
786 # Append the name of the PIC object to the libtool object file.
\r
787 test -z "$run" && cat >> ${libobj}T <<EOF
\r
788 pic_object='$objdir/$objname'
\r
792 # Allow error messages only from the first compilation.
\r
793 if test "$suppress_opt" = yes; then
\r
794 suppress_output=' >/dev/null 2>&1'
\r
797 # No PIC object so indicate it doesn't exist in the libtool
\r
799 test -z "$run" && cat >> ${libobj}T <<EOF
\r
805 # Only build a position-dependent object if we build old libraries.
\r
806 if test "$build_old_libs" = yes; then
\r
807 if test "$pic_mode" != yes; then
\r
808 # Don't build PIC code
\r
809 command="$base_compile $srcfile"
\r
811 command="$base_compile $srcfile $pic_flag"
\r
813 if test "$compiler_c_o" = yes; then
\r
814 command="$command -o $obj"
\r
817 # Suppress compiler output if we already did a PIC compilation.
\r
818 command="$command$suppress_output"
\r
819 $run $rm "$obj" "$output_obj"
\r
821 if $run eval "$command"; then :
\r
823 $run $rm $removelist
\r
827 if test "$need_locks" = warn &&
\r
828 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
\r
830 *** ERROR, $lockfile contains:
\r
831 `cat $lockfile 2>/dev/null`
\r
833 but it should contain:
\r
836 This indicates that another process is trying to use the same
\r
837 temporary object file, and libtool could not work around it because
\r
838 your compiler does not support \`-c' and \`-o' together. If you
\r
839 repeat this compilation, it may succeed, by chance, but you had better
\r
840 avoid parallel builds (make -j) in this platform, or get a better
\r
843 $run $rm $removelist
\r
847 # Just move the object if needed
\r
848 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
\r
849 $show "$mv $output_obj $obj"
\r
850 if $run $mv $output_obj $obj; then :
\r
853 $run $rm $removelist
\r
858 # Append the name of the non-PIC object the libtool object file.
\r
859 # Only append if the libtool object file exists.
\r
860 test -z "$run" && cat >> ${libobj}T <<EOF
\r
861 # Name of the non-PIC object.
\r
862 non_pic_object='$objname'
\r
866 # Append the name of the non-PIC object the libtool object file.
\r
867 # Only append if the libtool object file exists.
\r
868 test -z "$run" && cat >> ${libobj}T <<EOF
\r
869 # Name of the non-PIC object.
\r
870 non_pic_object=none
\r
875 $run $mv "${libobj}T" "${libobj}"
\r
877 # Unlock the critical section if it was locked
\r
878 if test "$need_locks" != no; then
\r
879 $run $rm "$lockfile"
\r
885 # libtool link mode
\r
887 modename="$modename: link"
\r
889 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
\r
890 # It is impossible to link a dll without this setting, and
\r
891 # we shouldn't force the makefile maintainer to figure out
\r
892 # which system we are compiling for in order to pass an extra
\r
893 # flag for every libtool invocation.
\r
894 # allow_undefined=no
\r
896 # FIXME: Unfortunately, there are problems with the above when trying
\r
897 # to make a dll which has undefined symbols, in which case not
\r
898 # even a static library is built. For now, we need to specify
\r
899 # -no-undefined on the libtool link line when we can be certain
\r
900 # that all symbols are satisfied, otherwise we get a static library.
\r
901 allow_undefined=yes
\r
904 allow_undefined=yes
\r
907 libtool_args="$nonopt"
\r
908 base_compile="$nonopt $@"
\r
909 compile_command="$nonopt"
\r
910 finalize_command="$nonopt"
\r
915 finalize_shlibpath=
\r
923 lib_search_path=`pwd`
\r
932 export_symbols_regex=
\r
940 precious_files_regex=
\r
941 prefer_static_libs=no
\r
954 func_infer_tag $base_compile
\r
956 # We need to know -static, to get the right output filenames.
\r
960 -all-static | -static)
\r
961 if test "X$arg" = "X-all-static"; then
\r
962 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
\r
963 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
\r
965 if test -n "$link_static_flag"; then
\r
966 dlopen_self=$dlopen_self_static
\r
969 if test -z "$pic_flag" && test -n "$link_static_flag"; then
\r
970 dlopen_self=$dlopen_self_static
\r
973 build_libtool_libs=no
\r
975 prefer_static_libs=yes
\r
981 # See if our shared archives depend on static archives.
\r
982 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
\r
984 # Go through the arguments, transforming them on the way.
\r
985 while test "$#" -gt 0; do
\r
989 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
990 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
\r
994 libtool_args="$libtool_args $qarg"
\r
996 # If the previous option needs an argument, assign it.
\r
997 if test -n "$prev"; then
\r
1000 compile_command="$compile_command @OUTPUT@"
\r
1001 finalize_command="$finalize_command @OUTPUT@"
\r
1006 dlfiles|dlprefiles)
\r
1007 if test "$preload" = no; then
\r
1008 # Add the symbol object into the linking commands.
\r
1009 compile_command="$compile_command @SYMFILE@"
\r
1010 finalize_command="$finalize_command @SYMFILE@"
\r
1014 *.la | *.lo) ;; # We handle these cases below.
\r
1016 if test "$dlself" = no; then
\r
1018 export_dynamic=yes
\r
1024 if test "$prev" = dlprefiles; then
\r
1026 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
\r
1030 export_dynamic=yes
\r
1036 if test "$prev" = dlfiles; then
\r
1037 dlfiles="$dlfiles $arg"
\r
1039 dlprefiles="$dlprefiles $arg"
\r
1047 export_symbols="$arg"
\r
1048 if test ! -f "$arg"; then
\r
1049 $echo "$modename: symbol file \`$arg' does not exist"
\r
1050 exit $EXIT_FAILURE
\r
1056 export_symbols_regex="$arg"
\r
1061 inst_prefix_dir="$arg"
\r
1066 precious_files_regex="$arg"
\r
1076 if test -f "$arg"; then
\r
1079 for fil in `cat $save_arg`
\r
1081 # moreargs="$moreargs $fil"
\r
1083 # A libtool-controlled object.
\r
1085 # Check to see that this really is a libtool object.
\r
1086 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
\r
1090 # Read the .lo file
\r
1091 # If there is no directory component, then add one.
\r
1093 */* | *\\*) . $arg ;;
\r
1097 if test -z "$pic_object" || \
\r
1098 test -z "$non_pic_object" ||
\r
1099 test "$pic_object" = none && \
\r
1100 test "$non_pic_object" = none; then
\r
1101 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
\r
1102 exit $EXIT_FAILURE
\r
1105 # Extract subdirectory from the argument.
\r
1106 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
\r
1107 if test "X$xdir" = "X$arg"; then
\r
1113 if test "$pic_object" != none; then
\r
1114 # Prepend the subdirectory the object is found in.
\r
1115 pic_object="$xdir$pic_object"
\r
1117 if test "$prev" = dlfiles; then
\r
1118 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
\r
1119 dlfiles="$dlfiles $pic_object"
\r
1123 # If libtool objects are unsupported, then we need to preload.
\r
1128 # CHECK ME: I think I busted this. -Ossama
\r
1129 if test "$prev" = dlprefiles; then
\r
1130 # Preload the old-style object.
\r
1131 dlprefiles="$dlprefiles $pic_object"
\r
1136 libobjs="$libobjs $pic_object"
\r
1141 if test "$non_pic_object" != none; then
\r
1142 # Prepend the subdirectory the object is found in.
\r
1143 non_pic_object="$xdir$non_pic_object"
\r
1145 # A standard non-PIC object
\r
1146 non_pic_objects="$non_pic_objects $non_pic_object"
\r
1147 if test -z "$pic_object" || test "$pic_object" = none ; then
\r
1148 arg="$non_pic_object"
\r
1152 # Only an error if not doing a dry-run.
\r
1153 if test -z "$run"; then
\r
1154 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
\r
1155 exit $EXIT_FAILURE
\r
1159 # Extract subdirectory from the argument.
\r
1160 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
\r
1161 if test "X$xdir" = "X$arg"; then
\r
1167 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
\r
1168 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
\r
1169 libobjs="$libobjs $pic_object"
\r
1170 non_pic_objects="$non_pic_objects $non_pic_object"
\r
1175 $echo "$modename: link input file \`$save_arg' does not exist"
\r
1176 exit $EXIT_FAILURE
\r
1183 # We need an absolute path.
\r
1185 [\\/]* | [A-Za-z]:[\\/]*) ;;
\r
1187 $echo "$modename: only absolute run-paths are allowed" 1>&2
\r
1188 exit $EXIT_FAILURE
\r
1191 if test "$prev" = rpath; then
\r
1194 *) rpath="$rpath $arg" ;;
\r
1197 case "$xrpath " in
\r
1199 *) xrpath="$xrpath $arg" ;;
\r
1206 compiler_flags="$compiler_flags $qarg"
\r
1208 compile_command="$compile_command $qarg"
\r
1209 finalize_command="$finalize_command $qarg"
\r
1213 linker_flags="$linker_flags $qarg"
\r
1214 compiler_flags="$compiler_flags $wl$qarg"
\r
1216 compile_command="$compile_command $wl$qarg"
\r
1217 finalize_command="$finalize_command $wl$qarg"
\r
1221 linker_flags="$linker_flags $qarg"
\r
1222 compiler_flags="$compiler_flags $qarg"
\r
1224 compile_command="$compile_command $qarg"
\r
1225 finalize_command="$finalize_command $qarg"
\r
1229 shrext_cmds="$arg"
\r
1234 eval "$prev=\"\$arg\""
\r
1239 fi # test -n "$prev"
\r
1245 if test -n "$link_static_flag"; then
\r
1246 compile_command="$compile_command $link_static_flag"
\r
1247 finalize_command="$finalize_command $link_static_flag"
\r
1253 # FIXME: remove this flag sometime in the future.
\r
1254 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
\r
1274 export_dynamic=yes
\r
1278 -export-symbols | -export-symbols-regex)
\r
1279 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
\r
1280 $echo "$modename: more than one -exported-symbols argument is not allowed"
\r
1281 exit $EXIT_FAILURE
\r
1283 if test "X$arg" = "X-export-symbols"; then
\r
1286 prev=expsyms_regex
\r
1296 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
\r
1297 # so, if we see these flags be careful not to treat them like -L
\r
1299 case $with_gcc/$host in
\r
1300 no/*-*-irix* | /*-*-irix*)
\r
1301 compile_command="$compile_command $arg"
\r
1302 finalize_command="$finalize_command $arg"
\r
1309 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
\r
1310 # We need an absolute path.
\r
1312 [\\/]* | [A-Za-z]:[\\/]*) ;;
\r
1314 absdir=`cd "$dir" && pwd`
\r
1315 if test -z "$absdir"; then
\r
1316 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
\r
1317 exit $EXIT_FAILURE
\r
1322 case "$deplibs " in
\r
1325 deplibs="$deplibs -L$dir"
\r
1326 lib_search_path="$lib_search_path $dir"
\r
1330 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
\r
1331 case :$dllsearchpath: in
\r
1333 *) dllsearchpath="$dllsearchpath:$dir";;
\r
1341 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
\r
1343 *-*-cygwin* | *-*-pw32* | *-*-beos*)
\r
1344 # These systems don't actually have a C or math library (as such)
\r
1347 *-*-mingw* | *-*-os2*)
\r
1348 # These systems don't actually have a C library (as such)
\r
1349 test "X$arg" = "X-lc" && continue
\r
1351 *-*-openbsd* | *-*-freebsd*)
\r
1352 # Do not include libc due to us having libc/libc_r.
\r
1353 test "X$arg" = "X-lc" && continue
\r
1355 *-*-rhapsody* | *-*-darwin1.[012])
\r
1356 # Rhapsody C and math libraries are in the System framework
\r
1357 deplibs="$deplibs -framework System"
\r
1360 elif test "X$arg" = "X-lc_r"; then
\r
1362 *-*-openbsd* | *-*-freebsd*)
\r
1363 # Do not include libc_r directly, use -pthread flag.
\r
1368 deplibs="$deplibs $arg"
\r
1372 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
\r
1373 deplibs="$deplibs $arg"
\r
1382 # gcc -m* arguments should be passed to the linker via $compiler_flags
\r
1383 # in order to pass architecture information to the linker
\r
1384 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
\r
1385 # but this is not reliable with gcc because gcc may use -mfoo to
\r
1386 # select a different linker, different libraries, etc, while
\r
1387 # -Wl,-mfoo simply passes -mfoo to the linker.
\r
1389 # Unknown arguments in both finalize_command and compile_command need
\r
1390 # to be aesthetically quoted because they are evaled later.
\r
1391 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
\r
1393 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
1397 compile_command="$compile_command $arg"
\r
1398 finalize_command="$finalize_command $arg"
\r
1399 if test "$with_gcc" = "yes" ; then
\r
1400 compiler_flags="$compiler_flags $arg"
\r
1417 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
\r
1418 # The PATH hackery in wrapper scripts is required on Windows
\r
1419 # in order for the loader to find any dlls it needs.
\r
1420 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
\r
1421 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
\r
1424 *) no_install=yes ;;
\r
1430 allow_undefined=no
\r
1439 -o) prev=output ;;
\r
1441 -precious-files-regex)
\r
1442 prev=precious_regex
\r
1462 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
\r
1463 # We need an absolute path.
\r
1465 [\\/]* | [A-Za-z]:[\\/]*) ;;
\r
1467 $echo "$modename: only absolute run-paths are allowed" 1>&2
\r
1468 exit $EXIT_FAILURE
\r
1471 case "$xrpath " in
\r
1473 *) xrpath="$xrpath $dir" ;;
\r
1479 # The effects of -static are defined in a previous loop.
\r
1480 # We used to do the same as -all-static on platforms that
\r
1481 # didn't have a PIC flag, but the assumption that the effects
\r
1482 # would be equivalent was wrong. It would break on at least
\r
1483 # Digital Unix and AIX.
\r
1503 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
\r
1505 save_ifs="$IFS"; IFS=','
\r
1506 for flag in $args; do
\r
1509 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
1513 arg="$arg $wl$flag"
\r
1514 compiler_flags="$compiler_flags $flag"
\r
1517 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
\r
1521 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
\r
1523 save_ifs="$IFS"; IFS=','
\r
1524 for flag in $args; do
\r
1527 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
1531 arg="$arg $wl$flag"
\r
1532 compiler_flags="$compiler_flags $wl$flag"
\r
1533 linker_flags="$linker_flags $flag"
\r
1536 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
\r
1554 # Some other compiler flag.
\r
1556 # Unknown arguments in both finalize_command and compile_command need
\r
1557 # to be aesthetically quoted because they are evaled later.
\r
1558 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
\r
1560 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
1567 # A standard object.
\r
1572 # A libtool-controlled object.
\r
1574 # Check to see that this really is a libtool object.
\r
1575 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
\r
1579 # Read the .lo file
\r
1580 # If there is no directory component, then add one.
\r
1582 */* | *\\*) . $arg ;;
\r
1586 if test -z "$pic_object" || \
\r
1587 test -z "$non_pic_object" ||
\r
1588 test "$pic_object" = none && \
\r
1589 test "$non_pic_object" = none; then
\r
1590 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
\r
1591 exit $EXIT_FAILURE
\r
1594 # Extract subdirectory from the argument.
\r
1595 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
\r
1596 if test "X$xdir" = "X$arg"; then
\r
1602 if test "$pic_object" != none; then
\r
1603 # Prepend the subdirectory the object is found in.
\r
1604 pic_object="$xdir$pic_object"
\r
1606 if test "$prev" = dlfiles; then
\r
1607 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
\r
1608 dlfiles="$dlfiles $pic_object"
\r
1612 # If libtool objects are unsupported, then we need to preload.
\r
1617 # CHECK ME: I think I busted this. -Ossama
\r
1618 if test "$prev" = dlprefiles; then
\r
1619 # Preload the old-style object.
\r
1620 dlprefiles="$dlprefiles $pic_object"
\r
1625 libobjs="$libobjs $pic_object"
\r
1630 if test "$non_pic_object" != none; then
\r
1631 # Prepend the subdirectory the object is found in.
\r
1632 non_pic_object="$xdir$non_pic_object"
\r
1634 # A standard non-PIC object
\r
1635 non_pic_objects="$non_pic_objects $non_pic_object"
\r
1636 if test -z "$pic_object" || test "$pic_object" = none ; then
\r
1637 arg="$non_pic_object"
\r
1641 # Only an error if not doing a dry-run.
\r
1642 if test -z "$run"; then
\r
1643 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
\r
1644 exit $EXIT_FAILURE
\r
1648 # Extract subdirectory from the argument.
\r
1649 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
\r
1650 if test "X$xdir" = "X$arg"; then
\r
1656 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
\r
1657 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
\r
1658 libobjs="$libobjs $pic_object"
\r
1659 non_pic_objects="$non_pic_objects $non_pic_object"
\r
1666 deplibs="$deplibs $arg"
\r
1667 old_deplibs="$old_deplibs $arg"
\r
1672 # A libtool-controlled library.
\r
1674 if test "$prev" = dlfiles; then
\r
1675 # This library was specified with -dlopen.
\r
1676 dlfiles="$dlfiles $arg"
\r
1678 elif test "$prev" = dlprefiles; then
\r
1679 # The library was specified with -dlpreopen.
\r
1680 dlprefiles="$dlprefiles $arg"
\r
1683 deplibs="$deplibs $arg"
\r
1688 # Some other compiler argument.
\r
1690 # Unknown arguments in both finalize_command and compile_command need
\r
1691 # to be aesthetically quoted because they are evaled later.
\r
1692 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
\r
1694 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
\r
1701 # Now actually substitute the argument into the commands.
\r
1702 if test -n "$arg"; then
\r
1703 compile_command="$compile_command $arg"
\r
1704 finalize_command="$finalize_command $arg"
\r
1706 done # argument parsing loop
\r
1708 if test -n "$prev"; then
\r
1709 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
\r
1710 $echo "$help" 1>&2
\r
1711 exit $EXIT_FAILURE
\r
1714 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
\r
1715 eval arg=\"$export_dynamic_flag_spec\"
\r
1716 compile_command="$compile_command $arg"
\r
1717 finalize_command="$finalize_command $arg"
\r
1721 # calculate the name of the file, without its directory
\r
1722 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
\r
1723 libobjs_save="$libobjs"
\r
1725 if test -n "$shlibpath_var"; then
\r
1726 # get the directories listed in $shlibpath_var
\r
1727 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
\r
1729 shlib_search_path=
\r
1731 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
\r
1732 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
\r
1734 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
\r
1735 if test "X$output_objdir" = "X$output"; then
\r
1736 output_objdir="$objdir"
\r
1738 output_objdir="$output_objdir/$objdir"
\r
1740 # Create the object directory.
\r
1741 if test ! -d "$output_objdir"; then
\r
1742 $show "$mkdir $output_objdir"
\r
1743 $run $mkdir $output_objdir
\r
1745 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
\r
1750 # Determine the type of output
\r
1753 $echo "$modename: you must specify an output file" 1>&2
\r
1754 $echo "$help" 1>&2
\r
1755 exit $EXIT_FAILURE
\r
1757 *.$libext) linkmode=oldlib ;;
\r
1758 *.lo | *.$objext) linkmode=obj ;;
\r
1759 *.la) linkmode=lib ;;
\r
1760 *) linkmode=prog ;; # Anything else should be a program.
\r
1764 *cygwin* | *mingw* | *pw32*)
\r
1765 # don't eliminate duplications in $postdeps and $predeps
\r
1766 duplicate_compiler_generated_deps=yes
\r
1769 duplicate_compiler_generated_deps=$duplicate_deps
\r
1775 # Find all interdependent deplibs by searching for libraries
\r
1776 # that are linked more than once (e.g. -la -lb -la)
\r
1777 for deplib in $deplibs; do
\r
1778 if test "X$duplicate_deps" = "Xyes" ; then
\r
1780 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
\r
1783 libs="$libs $deplib"
\r
1786 if test "$linkmode" = lib; then
\r
1787 libs="$predeps $libs $compiler_lib_search_path $postdeps"
\r
1789 # Compute libraries that are listed more than once in $predeps
\r
1790 # $postdeps and mark them as special (i.e., whose duplicates are
\r
1791 # not to be eliminated).
\r
1793 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
\r
1794 for pre_post_dep in $predeps $postdeps; do
\r
1795 case "$pre_post_deps " in
\r
1796 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
\r
1798 pre_post_deps="$pre_post_deps $pre_post_dep"
\r
1805 newdependency_libs=
\r
1806 newlib_search_path=
\r
1807 need_relink=no # whether we're linking any uninstalled libtool libraries
\r
1808 notinst_deplibs= # not-installed libtool libraries
\r
1809 notinst_path= # paths that contain not-installed libtool libraries
\r
1812 passes="conv link"
\r
1813 for file in $dlfiles $dlprefiles; do
\r
1817 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
\r
1818 exit $EXIT_FAILURE
\r
1829 passes="conv scan dlopen dlpreopen link"
\r
1834 for pass in $passes; do
\r
1835 if test "$linkmode,$pass" = "lib,link" ||
\r
1836 test "$linkmode,$pass" = "prog,scan"; then
\r
1840 if test "$linkmode" = prog; then
\r
1842 dlopen) libs="$dlfiles" ;;
\r
1843 dlpreopen) libs="$dlprefiles" ;;
\r
1844 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
\r
1847 if test "$pass" = dlopen; then
\r
1848 # Collect dlpreopened libraries
\r
1849 save_deplibs="$deplibs"
\r
1852 for deplib in $libs; do
\r
1856 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
\r
1857 if test "$linkmode,$pass" = "prog,link"; then
\r
1858 compile_deplibs="$deplib $compile_deplibs"
\r
1859 finalize_deplibs="$deplib $finalize_deplibs"
\r
1861 deplibs="$deplib $deplibs"
\r
1866 if test "$linkmode" != lib && test "$linkmode" != prog; then
\r
1867 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
\r
1870 if test "$pass" = conv; then
\r
1871 deplibs="$deplib $deplibs"
\r
1874 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
\r
1875 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
\r
1876 for search_ext in .la $std_shrext .so .a; do
\r
1877 # Search the libtool library
\r
1878 lib="$searchdir/lib${name}${search_ext}"
\r
1879 if test -f "$lib"; then
\r
1880 if test "$search_ext" = ".la"; then
\r
1889 if test "$found" != yes; then
\r
1890 # deplib doesn't seem to be a libtool library
\r
1891 if test "$linkmode,$pass" = "prog,link"; then
\r
1892 compile_deplibs="$deplib $compile_deplibs"
\r
1893 finalize_deplibs="$deplib $finalize_deplibs"
\r
1895 deplibs="$deplib $deplibs"
\r
1896 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
\r
1899 else # deplib is a libtool library
\r
1900 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
\r
1901 # We need to do some special things here, and not later.
\r
1902 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
\r
1903 case " $predeps $postdeps " in
\r
1905 if (${SED} -e '2q' $lib |
\r
1906 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
\r
1910 */* | *\\*) . $lib ;;
\r
1913 for l in $old_library $library_names; do
\r
1916 if test "X$ll" = "X$old_library" ; then # only static version available
\r
1918 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
\r
1919 test "X$ladir" = "X$lib" && ladir="."
\r
1920 lib=$ladir/$old_library
\r
1921 if test "$linkmode,$pass" = "prog,link"; then
\r
1922 compile_deplibs="$deplib $compile_deplibs"
\r
1923 finalize_deplibs="$deplib $finalize_deplibs"
\r
1925 deplibs="$deplib $deplibs"
\r
1926 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
\r
1940 deplibs="$deplib $deplibs"
\r
1941 test "$pass" = conv && continue
\r
1942 newdependency_libs="$deplib $newdependency_libs"
\r
1943 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
\r
1946 if test "$pass" = conv; then
\r
1947 deplibs="$deplib $deplibs"
\r
1950 if test "$pass" = scan; then
\r
1951 deplibs="$deplib $deplibs"
\r
1953 compile_deplibs="$deplib $compile_deplibs"
\r
1954 finalize_deplibs="$deplib $finalize_deplibs"
\r
1956 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
\r
1959 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
\r
1965 if test "$pass" = link; then
\r
1966 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
\r
1967 # Make sure the xrpath contains only unique directories.
\r
1968 case "$xrpath " in
\r
1970 *) xrpath="$xrpath $dir" ;;
\r
1973 deplibs="$deplib $deplibs"
\r
1976 *.la) lib="$deplib" ;;
\r
1978 if test "$pass" = conv; then
\r
1979 deplibs="$deplib $deplibs"
\r
1984 if test "$deplibs_check_method" != pass_all; then
\r
1986 $echo "*** Warning: Trying to link with static lib archive $deplib."
\r
1987 $echo "*** I have the capability to make that library automatically link in when"
\r
1988 $echo "*** you link to this library. But I can only do this if you have a"
\r
1989 $echo "*** shared version of the library, which you do not appear to have"
\r
1990 $echo "*** because the file extensions .$libext of this argument makes me believe"
\r
1991 $echo "*** that it is just a static archive that I should not used here."
\r
1994 $echo "*** Warning: Linking the shared library $output against the"
\r
1995 $echo "*** static library $deplib is not portable!"
\r
1996 deplibs="$deplib $deplibs"
\r
2001 if test "$pass" != link; then
\r
2002 deplibs="$deplib $deplibs"
\r
2004 compile_deplibs="$deplib $compile_deplibs"
\r
2005 finalize_deplibs="$deplib $finalize_deplibs"
\r
2012 if test "$pass" = conv; then
\r
2013 deplibs="$deplib $deplibs"
\r
2014 elif test "$linkmode" = prog; then
\r
2015 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
\r
2016 # If there is no dlopen support or we're linking statically,
\r
2017 # we need to preload.
\r
2018 newdlprefiles="$newdlprefiles $deplib"
\r
2019 compile_deplibs="$deplib $compile_deplibs"
\r
2020 finalize_deplibs="$deplib $finalize_deplibs"
\r
2022 newdlfiles="$newdlfiles $deplib"
\r
2031 esac # case $deplib
\r
2032 if test "$found" = yes || test -f "$lib"; then :
\r
2034 $echo "$modename: cannot find the library \`$lib'" 1>&2
\r
2035 exit $EXIT_FAILURE
\r
2038 # Check to see that this really is a libtool archive.
\r
2039 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
\r
2041 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
\r
2042 exit $EXIT_FAILURE
\r
2045 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
\r
2046 test "X$ladir" = "X$lib" && ladir="."
\r
2054 # If the library was installed with an old release of libtool,
\r
2055 # it will not redefine variables installed, or shouldnotlink
\r
2059 # Read the .la file
\r
2061 */* | *\\*) . $lib ;;
\r
2065 if test "$linkmode,$pass" = "lib,link" ||
\r
2066 test "$linkmode,$pass" = "prog,scan" ||
\r
2067 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
\r
2068 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
\r
2069 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
\r
2072 if test "$pass" = conv; then
\r
2073 # Only check for convenience libraries
\r
2074 deplibs="$lib $deplibs"
\r
2075 if test -z "$libdir"; then
\r
2076 if test -z "$old_library"; then
\r
2077 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
\r
2078 exit $EXIT_FAILURE
\r
2080 # It is a libtool convenience library, so add in its objects.
\r
2081 convenience="$convenience $ladir/$objdir/$old_library"
\r
2082 old_convenience="$old_convenience $ladir/$objdir/$old_library"
\r
2084 for deplib in $dependency_libs; do
\r
2085 deplibs="$deplib $deplibs"
\r
2086 if test "X$duplicate_deps" = "Xyes" ; then
\r
2087 case "$tmp_libs " in
\r
2088 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
\r
2091 tmp_libs="$tmp_libs $deplib"
\r
2093 elif test "$linkmode" != prog && test "$linkmode" != lib; then
\r
2094 $echo "$modename: \`$lib' is not a convenience library" 1>&2
\r
2095 exit $EXIT_FAILURE
\r
2101 # Get the name of the library we link against.
\r
2103 for l in $old_library $library_names; do
\r
2106 if test -z "$linklib"; then
\r
2107 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
\r
2108 exit $EXIT_FAILURE
\r
2111 # This library was specified with -dlopen.
\r
2112 if test "$pass" = dlopen; then
\r
2113 if test -z "$libdir"; then
\r
2114 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
\r
2115 exit $EXIT_FAILURE
\r
2117 if test -z "$dlname" ||
\r
2118 test "$dlopen_support" != yes ||
\r
2119 test "$build_libtool_libs" = no; then
\r
2120 # If there is no dlname, no dlopen support or we're linking
\r
2121 # statically, we need to preload. We also need to preload any
\r
2122 # dependent libraries so libltdl's deplib preloader doesn't
\r
2123 # bomb out in the load deplibs phase.
\r
2124 dlprefiles="$dlprefiles $lib $dependency_libs"
\r
2126 newdlfiles="$newdlfiles $lib"
\r
2129 fi # $pass = dlopen
\r
2131 # We need an absolute path.
\r
2133 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
\r
2135 abs_ladir=`cd "$ladir" && pwd`
\r
2136 if test -z "$abs_ladir"; then
\r
2137 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
\r
2138 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
\r
2139 abs_ladir="$ladir"
\r
2143 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
\r
2145 # Find the relevant object directory and library name.
\r
2146 if test "X$installed" = Xyes; then
\r
2147 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
\r
2148 $echo "$modename: warning: library \`$lib' was moved." 1>&2
\r
2150 absdir="$abs_ladir"
\r
2151 libdir="$abs_ladir"
\r
2157 dir="$ladir/$objdir"
\r
2158 absdir="$abs_ladir/$objdir"
\r
2159 # Remove this search path later
\r
2160 notinst_path="$notinst_path $abs_ladir"
\r
2161 fi # $installed = yes
\r
2162 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
\r
2164 # This library was specified with -dlpreopen.
\r
2165 if test "$pass" = dlpreopen; then
\r
2166 if test -z "$libdir"; then
\r
2167 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
\r
2168 exit $EXIT_FAILURE
\r
2170 # Prefer using a static library (so that no silly _DYNAMIC symbols
\r
2171 # are required to link).
\r
2172 if test -n "$old_library"; then
\r
2173 newdlprefiles="$newdlprefiles $dir/$old_library"
\r
2174 # Otherwise, use the dlname, so that lt_dlopen finds it.
\r
2175 elif test -n "$dlname"; then
\r
2176 newdlprefiles="$newdlprefiles $dir/$dlname"
\r
2178 newdlprefiles="$newdlprefiles $dir/$linklib"
\r
2180 fi # $pass = dlpreopen
\r
2182 if test -z "$libdir"; then
\r
2183 # Link the convenience library
\r
2184 if test "$linkmode" = lib; then
\r
2185 deplibs="$dir/$old_library $deplibs"
\r
2186 elif test "$linkmode,$pass" = "prog,link"; then
\r
2187 compile_deplibs="$dir/$old_library $compile_deplibs"
\r
2188 finalize_deplibs="$dir/$old_library $finalize_deplibs"
\r
2190 deplibs="$lib $deplibs" # used for prog,scan pass
\r
2196 if test "$linkmode" = prog && test "$pass" != link; then
\r
2197 newlib_search_path="$newlib_search_path $ladir"
\r
2198 deplibs="$lib $deplibs"
\r
2201 if test "$link_all_deplibs" != no || test -z "$library_names" ||
\r
2202 test "$build_libtool_libs" = no; then
\r
2203 linkalldeplibs=yes
\r
2207 for deplib in $dependency_libs; do
\r
2209 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
\r
2211 # Need to link against all dependency_libs?
\r
2212 if test "$linkalldeplibs" = yes; then
\r
2213 deplibs="$deplib $deplibs"
\r
2215 # Need to hardcode shared library paths
\r
2216 # or/and link against static libraries
\r
2217 newdependency_libs="$deplib $newdependency_libs"
\r
2219 if test "X$duplicate_deps" = "Xyes" ; then
\r
2220 case "$tmp_libs " in
\r
2221 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
\r
2224 tmp_libs="$tmp_libs $deplib"
\r
2227 fi # $linkmode = prog...
\r
2229 if test "$linkmode,$pass" = "prog,link"; then
\r
2230 if test -n "$library_names" &&
\r
2231 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
\r
2232 # We need to hardcode the library path
\r
2233 if test -n "$shlibpath_var"; then
\r
2234 # Make sure the rpath contains only unique directories.
\r
2235 case "$temp_rpath " in
\r
2238 *) temp_rpath="$temp_rpath $dir" ;;
\r
2242 # Hardcode the library path.
\r
2243 # Skip directories that are in the system default run-time
\r
2245 case " $sys_lib_dlsearch_path " in
\r
2248 case "$compile_rpath " in
\r
2250 *) compile_rpath="$compile_rpath $absdir"
\r
2254 case " $sys_lib_dlsearch_path " in
\r
2257 case "$finalize_rpath " in
\r
2259 *) finalize_rpath="$finalize_rpath $libdir"
\r
2263 fi # $linkmode,$pass = prog,link...
\r
2265 if test "$alldeplibs" = yes &&
\r
2266 { test "$deplibs_check_method" = pass_all ||
\r
2267 { test "$build_libtool_libs" = yes &&
\r
2268 test -n "$library_names"; }; }; then
\r
2269 # We only need to search for static libraries
\r
2274 link_static=no # Whether the deplib will be linked statically
\r
2275 if test -n "$library_names" &&
\r
2276 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
\r
2277 if test "$installed" = no; then
\r
2278 notinst_deplibs="$notinst_deplibs $lib"
\r
2281 # This is a shared library
\r
2283 # Warn about portability, can't link against -module's on
\r
2284 # some systems (darwin)
\r
2285 if test "$shouldnotlink" = yes && test "$pass" = link ; then
\r
2287 if test "$linkmode" = prog; then
\r
2288 $echo "*** Warning: Linking the executable $output against the loadable module"
\r
2290 $echo "*** Warning: Linking the shared library $output against the loadable module"
\r
2292 $echo "*** $linklib is not portable!"
\r
2294 if test "$linkmode" = lib &&
\r
2295 test "$hardcode_into_libs" = yes; then
\r
2296 # Hardcode the library path.
\r
2297 # Skip directories that are in the system default run-time
\r
2299 case " $sys_lib_dlsearch_path " in
\r
2302 case "$compile_rpath " in
\r
2304 *) compile_rpath="$compile_rpath $absdir"
\r
2308 case " $sys_lib_dlsearch_path " in
\r
2311 case "$finalize_rpath " in
\r
2313 *) finalize_rpath="$finalize_rpath $libdir"
\r
2319 if test -n "$old_archive_from_expsyms_cmds"; then
\r
2320 # figure out the soname
\r
2321 set dummy $library_names
\r
2324 libname=`eval \\$echo \"$libname_spec\"`
\r
2325 # use dlname if we got it. it's perfectly good, no?
\r
2326 if test -n "$dlname"; then
\r
2328 elif test -n "$soname_spec"; then
\r
2331 *cygwin* | mingw*)
\r
2332 major=`expr $current - $age`
\r
2333 versuffix="-$major"
\r
2336 eval soname=\"$soname_spec\"
\r
2338 soname="$realname"
\r
2341 # Make a new name for the extract_expsyms_cmds to use
\r
2343 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
\r
2344 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
\r
2346 # If the library has no export list, then create one now
\r
2347 if test -f "$output_objdir/$soname-def"; then :
\r
2349 $show "extracting exported symbol list from \`$soname'"
\r
2350 save_ifs="$IFS"; IFS='~'
\r
2351 cmds=$extract_expsyms_cmds
\r
2352 for cmd in $cmds; do
\r
2356 $run eval "$cmd" || exit $?
\r
2362 if test -f "$output_objdir/$newlib"; then :; else
\r
2363 $show "generating import library for \`$soname'"
\r
2364 save_ifs="$IFS"; IFS='~'
\r
2365 cmds=$old_archive_from_expsyms_cmds
\r
2366 for cmd in $cmds; do
\r
2370 $run eval "$cmd" || exit $?
\r
2374 # make sure the library variables are pointing to the new library
\r
2375 dir=$output_objdir
\r
2377 fi # test -n "$old_archive_from_expsyms_cmds"
\r
2379 if test "$linkmode" = prog || test "$mode" != relink; then
\r
2384 case $hardcode_action in
\r
2385 immediate | unsupported)
\r
2386 if test "$hardcode_direct" = no; then
\r
2387 add="$dir/$linklib"
\r
2389 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
\r
2391 # if the lib is a module then we can not link against
\r
2392 # it, someone is ignoring the new warnings I added
\r
2393 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
\r
2394 $echo "** Warning, lib $linklib is a module, not a shared library"
\r
2395 if test -z "$old_library" ; then
\r
2397 $echo "** And there doesn't seem to be a static archive available"
\r
2398 $echo "** The link will probably fail, sorry"
\r
2400 add="$dir/$old_library"
\r
2404 elif test "$hardcode_minus_L" = no; then
\r
2406 *-*-sunos*) add_shlibpath="$dir" ;;
\r
2410 elif test "$hardcode_shlibpath_var" = no; then
\r
2411 add_shlibpath="$dir"
\r
2418 if test "$hardcode_direct" = yes; then
\r
2419 add="$dir/$linklib"
\r
2420 elif test "$hardcode_minus_L" = yes; then
\r
2422 # Try looking first in the location we're being installed to.
\r
2423 if test -n "$inst_prefix_dir"; then
\r
2426 add_dir="$add_dir -L$inst_prefix_dir$libdir"
\r
2431 elif test "$hardcode_shlibpath_var" = yes; then
\r
2432 add_shlibpath="$dir"
\r
2438 *) lib_linked=no ;;
\r
2441 if test "$lib_linked" != yes; then
\r
2442 $echo "$modename: configuration error: unsupported hardcode properties"
\r
2443 exit $EXIT_FAILURE
\r
2446 if test -n "$add_shlibpath"; then
\r
2447 case :$compile_shlibpath: in
\r
2448 *":$add_shlibpath:"*) ;;
\r
2449 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
\r
2452 if test "$linkmode" = prog; then
\r
2453 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
\r
2454 test -n "$add" && compile_deplibs="$add $compile_deplibs"
\r
2456 test -n "$add_dir" && deplibs="$add_dir $deplibs"
\r
2457 test -n "$add" && deplibs="$add $deplibs"
\r
2458 if test "$hardcode_direct" != yes && \
\r
2459 test "$hardcode_minus_L" != yes && \
\r
2460 test "$hardcode_shlibpath_var" = yes; then
\r
2461 case :$finalize_shlibpath: in
\r
2463 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
\r
2469 if test "$linkmode" = prog || test "$mode" = relink; then
\r
2473 # Finalize command for both is simple: just hardcode it.
\r
2474 if test "$hardcode_direct" = yes; then
\r
2475 add="$libdir/$linklib"
\r
2476 elif test "$hardcode_minus_L" = yes; then
\r
2477 add_dir="-L$libdir"
\r
2479 elif test "$hardcode_shlibpath_var" = yes; then
\r
2480 case :$finalize_shlibpath: in
\r
2482 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
\r
2485 elif test "$hardcode_automatic" = yes; then
\r
2486 if test -n "$inst_prefix_dir" &&
\r
2487 test -f "$inst_prefix_dir$libdir/$linklib" ; then
\r
2488 add="$inst_prefix_dir$libdir/$linklib"
\r
2490 add="$libdir/$linklib"
\r
2493 # We cannot seem to hardcode it, guess we'll fake it.
\r
2494 add_dir="-L$libdir"
\r
2495 # Try looking first in the location we're being installed to.
\r
2496 if test -n "$inst_prefix_dir"; then
\r
2499 add_dir="$add_dir -L$inst_prefix_dir$libdir"
\r
2506 if test "$linkmode" = prog; then
\r
2507 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
\r
2508 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
\r
2510 test -n "$add_dir" && deplibs="$add_dir $deplibs"
\r
2511 test -n "$add" && deplibs="$add $deplibs"
\r
2514 elif test "$linkmode" = prog; then
\r
2515 # Here we assume that one of hardcode_direct or hardcode_minus_L
\r
2516 # is not unsupported. This is valid on all known static and
\r
2517 # shared platforms.
\r
2518 if test "$hardcode_direct" != unsupported; then
\r
2519 test -n "$old_library" && linklib="$old_library"
\r
2520 compile_deplibs="$dir/$linklib $compile_deplibs"
\r
2521 finalize_deplibs="$dir/$linklib $finalize_deplibs"
\r
2523 compile_deplibs="-l$name -L$dir $compile_deplibs"
\r
2524 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
\r
2526 elif test "$build_libtool_libs" = yes; then
\r
2527 # Not a shared library
\r
2528 if test "$deplibs_check_method" != pass_all; then
\r
2529 # We're trying link a shared library against a static one
\r
2530 # but the system doesn't support it.
\r
2532 # Just print a warning and add the library to dependency_libs so
\r
2533 # that the program can be linked against the static library.
\r
2535 $echo "*** Warning: This system can not link to static lib archive $lib."
\r
2536 $echo "*** I have the capability to make that library automatically link in when"
\r
2537 $echo "*** you link to this library. But I can only do this if you have a"
\r
2538 $echo "*** shared version of the library, which you do not appear to have."
\r
2539 if test "$module" = yes; then
\r
2540 $echo "*** But as you try to build a module library, libtool will still create "
\r
2541 $echo "*** a static module, that should work as long as the dlopening application"
\r
2542 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
\r
2543 if test -z "$global_symbol_pipe"; then
\r
2545 $echo "*** However, this would only work if libtool was able to extract symbol"
\r
2546 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
\r
2547 $echo "*** not find such a program. So, this module is probably useless."
\r
2548 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
\r
2550 if test "$build_old_libs" = no; then
\r
2551 build_libtool_libs=module
\r
2552 build_old_libs=yes
\r
2554 build_libtool_libs=no
\r
2558 convenience="$convenience $dir/$old_library"
\r
2559 old_convenience="$old_convenience $dir/$old_library"
\r
2560 deplibs="$dir/$old_library $deplibs"
\r
2563 fi # link shared/static library?
\r
2565 if test "$linkmode" = lib; then
\r
2566 if test -n "$dependency_libs" &&
\r
2567 { test "$hardcode_into_libs" != yes ||
\r
2568 test "$build_old_libs" = yes ||
\r
2569 test "$link_static" = yes; }; then
\r
2570 # Extract -R from dependency_libs
\r
2572 for libdir in $dependency_libs; do
\r
2574 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
\r
2575 case " $xrpath " in
\r
2576 *" $temp_xrpath "*) ;;
\r
2577 *) xrpath="$xrpath $temp_xrpath";;
\r
2579 *) temp_deplibs="$temp_deplibs $libdir";;
\r
2582 dependency_libs="$temp_deplibs"
\r
2585 newlib_search_path="$newlib_search_path $absdir"
\r
2586 # Link against this library
\r
2587 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
\r
2588 # ... and its dependency_libs
\r
2590 for deplib in $dependency_libs; do
\r
2591 newdependency_libs="$deplib $newdependency_libs"
\r
2592 if test "X$duplicate_deps" = "Xyes" ; then
\r
2593 case "$tmp_libs " in
\r
2594 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
\r
2597 tmp_libs="$tmp_libs $deplib"
\r
2600 if test "$link_all_deplibs" != no; then
\r
2601 # Add the search paths of all dependency libraries
\r
2602 for deplib in $dependency_libs; do
\r
2604 -L*) path="$deplib" ;;
\r
2606 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
\r
2607 test "X$dir" = "X$deplib" && dir="."
\r
2608 # We need an absolute path.
\r
2610 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
\r
2612 absdir=`cd "$dir" && pwd`
\r
2613 if test -z "$absdir"; then
\r
2614 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
\r
2619 if grep "^installed=no" $deplib > /dev/null; then
\r
2620 path="$absdir/$objdir"
\r
2622 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
\r
2623 if test -z "$libdir"; then
\r
2624 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
\r
2625 exit $EXIT_FAILURE
\r
2627 if test "$absdir" != "$libdir"; then
\r
2628 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
\r
2635 # we do not want to link against static libs,
\r
2636 # but need to link against shared
\r
2637 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
\r
2638 if test -n "$deplibrary_names" ; then
\r
2639 for tmp in $deplibrary_names ; do
\r
2642 if test -f "$path/$depdepl" ; then
\r
2643 depdepl="$path/$depdepl"
\r
2645 # do not add paths which are already there
\r
2646 case " $newlib_search_path " in
\r
2648 *) newlib_search_path="$newlib_search_path $path";;
\r
2661 # Again, we only want to link against shared libraries
\r
2662 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
\r
2663 for tmp in $newlib_search_path ; do
\r
2664 if test -f "$tmp/lib$tmp_libs.dylib" ; then
\r
2665 eval depdepl="$tmp/lib$tmp_libs.dylib"
\r
2676 case " $deplibs " in
\r
2677 *" $depdepl "*) ;;
\r
2678 *) deplibs="$depdepl $deplibs" ;;
\r
2680 case " $deplibs " in
\r
2682 *) deplibs="$deplibs $path" ;;
\r
2685 fi # link_all_deplibs != no
\r
2686 fi # linkmode = lib
\r
2687 done # for deplib in $libs
\r
2688 dependency_libs="$newdependency_libs"
\r
2689 if test "$pass" = dlpreopen; then
\r
2690 # Link the dlpreopened libraries before other libraries
\r
2691 for deplib in $save_deplibs; do
\r
2692 deplibs="$deplib $deplibs"
\r
2695 if test "$pass" != dlopen; then
\r
2696 if test "$pass" != conv; then
\r
2697 # Make sure lib_search_path contains only unique directories.
\r
2699 for dir in $newlib_search_path; do
\r
2700 case "$lib_search_path " in
\r
2702 *) lib_search_path="$lib_search_path $dir" ;;
\r
2705 newlib_search_path=
\r
2708 if test "$linkmode,$pass" != "prog,link"; then
\r
2711 vars="compile_deplibs finalize_deplibs"
\r
2713 for var in $vars dependency_libs; do
\r
2714 # Add libraries to $var in reverse order
\r
2715 eval tmp_libs=\"\$$var\"
\r
2717 for deplib in $tmp_libs; do
\r
2718 # FIXME: Pedantically, this is the right thing to do, so
\r
2719 # that some nasty dependency loop isn't accidentally
\r
2721 #new_libs="$deplib $new_libs"
\r
2722 # Pragmatically, this seems to cause very few problems in
\r
2725 -L*) new_libs="$deplib $new_libs" ;;
\r
2728 # And here is the reason: when a library appears more
\r
2729 # than once as an explicit dependence of a library, or
\r
2730 # is implicitly linked in more than once by the
\r
2731 # compiler, it is considered special, and multiple
\r
2732 # occurrences thereof are not removed. Compare this
\r
2733 # with having the same library being listed as a
\r
2734 # dependency of multiple other libraries: in this case,
\r
2735 # we know (pedantically, we assume) the library does not
\r
2736 # need to be listed more than once, so we keep only the
\r
2737 # last copy. This is not always right, but it is rare
\r
2738 # enough that we require users that really mean to play
\r
2739 # such unportable linking tricks to link the library
\r
2740 # using -Wl,-lname, so that libtool does not consider it
\r
2741 # for duplicate removal.
\r
2742 case " $specialdeplibs " in
\r
2743 *" $deplib "*) new_libs="$deplib $new_libs" ;;
\r
2745 case " $new_libs " in
\r
2747 *) new_libs="$deplib $new_libs" ;;
\r
2755 for deplib in $new_libs; do
\r
2758 case " $tmp_libs " in
\r
2760 *) tmp_libs="$tmp_libs $deplib" ;;
\r
2763 *) tmp_libs="$tmp_libs $deplib" ;;
\r
2766 eval $var=\"$tmp_libs\"
\r
2769 # Last step: remove runtime libs from dependency_libs
\r
2770 # (they stay in deplibs)
\r
2772 for i in $dependency_libs ; do
\r
2773 case " $predeps $postdeps $compiler_lib_search_path " in
\r
2778 if test -n "$i" ; then
\r
2779 tmp_libs="$tmp_libs $i"
\r
2782 dependency_libs=$tmp_libs
\r
2784 if test "$linkmode" = prog; then
\r
2785 dlfiles="$newdlfiles"
\r
2786 dlprefiles="$newdlprefiles"
\r
2791 if test -n "$deplibs"; then
\r
2792 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
\r
2795 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
\r
2796 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
\r
2799 if test -n "$rpath"; then
\r
2800 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
\r
2803 if test -n "$xrpath"; then
\r
2804 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
\r
2807 if test -n "$vinfo"; then
\r
2808 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
\r
2811 if test -n "$release"; then
\r
2812 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
\r
2815 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
\r
2816 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
\r
2819 # Now set the variables for building old libraries.
\r
2820 build_libtool_libs=no
\r
2822 objs="$objs$old_deplibs"
\r
2826 # Make sure we only generate libraries of the form `libNAME.la'.
\r
2827 case $outputname in
\r
2829 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
\r
2830 eval shared_ext=\"$shrext_cmds\"
\r
2831 eval libname=\"$libname_spec\"
\r
2834 if test "$module" = no; then
\r
2835 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
\r
2836 $echo "$help" 1>&2
\r
2837 exit $EXIT_FAILURE
\r
2839 if test "$need_lib_prefix" != no; then
\r
2840 # Add the "lib" prefix for modules if required
\r
2841 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
\r
2842 eval shared_ext=\"$shrext_cmds\"
\r
2843 eval libname=\"$libname_spec\"
\r
2845 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
\r
2850 if test -n "$objs"; then
\r
2851 if test "$deplibs_check_method" != pass_all; then
\r
2852 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
\r
2853 exit $EXIT_FAILURE
\r
2856 $echo "*** Warning: Linking the shared library $output against the non-libtool"
\r
2857 $echo "*** objects $objs is not portable!"
\r
2858 libobjs="$libobjs $objs"
\r
2862 if test "$dlself" != no; then
\r
2863 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
\r
2867 if test "$#" -gt 2; then
\r
2868 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
\r
2870 install_libdir="$2"
\r
2873 if test -z "$rpath"; then
\r
2874 if test "$build_libtool_libs" = yes; then
\r