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, 2004, 2005
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.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # define SED for historic ltconfig's generated by Libtool 1.3
37 test -z "$SED" && SED=sed
39 # The name of this program:
40 progname=`echo "$progpath" | $SED $basename`
50 TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)"
52 # See if we are running on zsh, and set the options which allow our
53 # commands through without removal of \ escapes.
54 if test -n "${ZSH_VERSION+set}" ; then
57 # Same for EGREP, and just to be sure, do LTCC as well
58 if test "X$EGREP" = X ; then
61 if test "X$LTCC" = X ; then
65 # Check that we have a working $echo.
66 if test "X$1" = X--no-reexec; then
67 # Discard the --no-reexec flag, and continue.
69 elif test "X$1" = X--fallback-echo; then
70 # Avoid inline document here, it may be left over
72 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
73 # Yippee, $echo works!
76 # Restart under the correct shell, and then maybe $echo will work.
77 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
80 if test "X$1" = X--fallback-echo; then
81 # used as fallback echo
90 help="Try \`$progname --help' for more information."
91 magic="%%%MAGIC variable%%%"
96 # Sed substitution that helps us do robust quoting. It backslashifies
97 # metacharacters that are still active within double-quoted strings.
98 Xsed="${SED}"' -e 1s/^X//'
99 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
100 # test EBCDIC or ASCII
101 case `echo A|tr A '\301'` in
102 A) # EBCDIC based system
103 SP2NL="tr '\100' '\n'"
104 NL2SP="tr '\r\n' '\100\100'"
106 *) # Assume ASCII based system
107 SP2NL="tr '\040' '\012'"
108 NL2SP="tr '\015\012' '\040\040'"
113 # Only set LANG and LC_ALL to C if already set.
114 # These must not be set unconditionally because not all systems understand
115 # e.g. LANG=C (notably SCO).
116 # We save the old values to restore during execute mode.
117 if test "${LC_ALL+set}" = set; then
118 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
120 if test "${LANG+set}" = set; then
121 save_LANG="$LANG"; LANG=C; export LANG
124 # Make sure IFS has a sensible default
129 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
130 $echo "$modename: not configured to build any kind of library" 1>&2
131 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
144 lo2o="s/\\.lo\$/.${objext}/"
145 o2lo="s/\\.${objext}\$/.lo/"
146 quote_scanset='[[~#^*{};<>?'"'"' ]'
148 if test -z "$max_cmd_len"; then
153 # If test is not a shell built-in, we'll probably end up computing a
154 # maximum length that is only half of the actual maximum length, but
156 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
157 = "XX$testring") >/dev/null 2>&1 &&
158 new_result=`expr "X$testring" : ".*" 2>&1` &&
159 max_cmd_len="$new_result" &&
160 test "$i" != 17 # 1/2 MB should be enough
163 testring="$testring$testring"
166 # Add a significant safety factor because C++ compilers can tack on massive
167 # amounts of additional arguments before passing them to the linker.
168 # It appears as though 1/2 is a usable value.
169 max_cmd_len=`expr $max_cmd_len \/ 2`
172 #####################################
173 # Shell function definitions:
174 # This seems to be the best place for them
176 # func_win32_libid arg
177 # return the library type of file 'arg'
179 # Need a lot of goo to handle *both* DLLs and import libs
180 # Has to be a shell function in order to 'eat' the argument
181 # that is supplied when $file_magic_command is called.
184 win32_libid_type="unknown"
185 win32_fileres=`file -L $1 2>/dev/null`
186 case $win32_fileres in
187 *ar\ archive\ import\ library*) # definitely import
188 win32_libid_type="x86 archive import"
190 *ar\ archive*) # could be an import, or static
191 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
192 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
193 win32_nmres=`eval $NM -f posix -A $1 | \
194 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
195 if test "X$win32_nmres" = "Ximport" ; then
196 win32_libid_type="x86 archive import"
198 win32_libid_type="x86 archive static"
203 win32_libid_type="x86 DLL"
205 *executable*) # but shell scripts are "executable" too...
206 case $win32_fileres in
207 *MS\ Windows\ PE\ Intel*)
208 win32_libid_type="x86 DLL"
213 $echo $win32_libid_type
218 # Infer tagged configuration to use if any are available and
219 # if one wasn't chosen via the "--tag" command line option.
220 # Only attempt this if the compiler in the base compile
221 # command doesn't match the default compiler.
222 # arg is usually of the form 'gcc ...'
225 if test -n "$available_tags" && test -z "$tagname"; then
229 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
233 CC_quoted="$CC_quoted $arg"
236 # Blanks in the command may have been stripped by the calling shell,
237 # but not from the CC environment variable when configure was run.
238 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
239 # Blanks at the start of $base_compile will cause this to fail
240 # if we don't check for them as well.
242 for z in $available_tags; do
243 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
244 # Evaluate the configuration.
245 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
248 # Double-quote args containing other shell metacharacters.
250 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
254 CC_quoted="$CC_quoted $arg"
256 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
257 trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
258 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
259 extendcc=${host}-${CC}
261 "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
262 "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
265 "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
266 "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
267 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
268 # The compiler in the base compile command matches
269 # the one in the tagged configuration.
270 # Assume this is the tagged configuration we want.
277 # If $tagname still isn't set, then no tagged configuration
278 # was found and let the user know that the "--tag" command
279 # line option must be used.
280 if test -z "$tagname"; then
281 $echo "$modename: unable to infer tagged configuration"
282 $echo "$modename: specify a tag with \`--tag'" 1>&2
285 # $echo "$modename: using $tagname tagged configuration"
293 # func_extract_an_archive dir oldlib
294 func_extract_an_archive ()
296 f_ex_an_ar_dir="$1"; shift
297 f_ex_an_ar_oldlib="$1"
299 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
300 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
301 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
304 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
309 # func_extract_archives gentop oldlib ...
310 func_extract_archives ()
312 my_gentop="$1"; shift
320 $show "${rm}r $my_gentop"
321 $run ${rm}r "$my_gentop"
322 $show "$mkdir $my_gentop"
323 $run $mkdir "$my_gentop"
325 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
329 for my_xlib in $my_oldlibs; do
330 # Extract the objects.
332 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
333 *) my_xabs=`pwd`"/$my_xlib" ;;
335 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
336 my_xdir="$my_gentop/$my_xlib"
338 $show "${rm}r $my_xdir"
339 $run ${rm}r "$my_xdir"
340 $show "$mkdir $my_xdir"
341 $run $mkdir "$my_xdir"
343 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
348 $show "Extracting $my_xabs"
349 # Do not bother doing anything if just a dry run
350 if test -z "$run"; then
351 darwin_orig_dir=`pwd`
352 cd $my_xdir || exit $?
353 darwin_archive=$my_xabs
355 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
356 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
357 if test -n "$darwin_arches"; then
358 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
360 $show "$darwin_base_archive has multiple architectures $darwin_arches"
361 for darwin_arch in $darwin_arches ; do
362 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
363 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
364 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
365 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
367 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
368 done # $darwin_arches
369 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
370 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
373 for darwin_file in $darwin_filelist; do
374 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
375 lipo -create -output "$darwin_file" $darwin_files
376 done # $darwin_filelist
378 cd "$darwin_orig_dir"
380 cd "$darwin_orig_dir"
381 func_extract_an_archive "$my_xdir" "$my_xabs"
386 func_extract_an_archive "$my_xdir" "$my_xabs"
389 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
391 func_extract_archives_result="$my_oldobjs"
393 # End of Shell function definitions
394 #####################################
397 eval std_shrext=\"$shrext_cmds\"
399 # Parse our command line options once, thoroughly.
400 while test "$#" -gt 0
406 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
410 # If the previous option needs an argument, assign it.
411 if test -n "$prev"; then
414 execute_dlfiles="$execute_dlfiles $arg"
418 preserve_args="${preserve_args}=$arg"
420 # Check whether tagname contains only valid characters
423 $echo "$progname: invalid tag name: $tagname" 1>&2
430 # Don't test for the "default" C tag, as we know, it's there, but
431 # not specially marked.
434 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
435 taglist="$taglist $tagname"
436 # Evaluate the configuration.
437 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
439 $echo "$progname: ignoring unknown tag $tagname" 1>&2
454 # Have we seen a non-optional argument yet?
461 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
463 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
464 $echo "This is free software; see the source for copying conditions. There is NO"
465 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
470 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
471 # Now print the configurations for the tags.
472 for tagname in $taglist; do
473 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
479 $echo "$progname: enabling shell trace mode"
481 preserve_args="$preserve_args $arg"
490 if test "$build_libtool_libs" = yes; then
491 $echo "enable shared libraries"
493 $echo "disable shared libraries"
495 if test "$build_old_libs" = yes; then
496 $echo "enable static libraries"
498 $echo "disable static libraries"
503 --finish) mode="finish" ;;
505 --mode) prevopt="--mode" prev=mode ;;
506 --mode=*) mode="$optarg" ;;
508 --preserve-dup-deps) duplicate_deps="yes" ;;
512 preserve_args="$preserve_args $arg"
515 --tag) prevopt="--tag" prev=tag ;;
517 set tag "$optarg" ${1+"$@"}
520 preserve_args="$preserve_args --tag"
529 $echo "$modename: unrecognized option \`$arg'" 1>&2
541 if test -n "$prevopt"; then
542 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
547 # If this variable is set in any of the actions, the command in it
548 # will be execed at the end. This prevents here-documents from being
549 # left over by shells.
552 if test -z "$show_help"; then
554 # Infer the operation mode.
555 if test -z "$mode"; then
556 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
557 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
559 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
571 *db | *dbx | *strace | *truss)
581 # If we have no mode, but dlfiles were specified, then do execute mode.
582 test -n "$execute_dlfiles" && mode=execute
584 # Just use the default operation mode.
585 if test -z "$mode"; then
586 if test -n "$nonopt"; then
587 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
589 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
596 # Only execute mode is allowed to have -dlopen flags.
597 if test -n "$execute_dlfiles" && test "$mode" != execute; then
598 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
603 # Change the help message to a mode-specific one.
605 help="Try \`$modename --help --mode=$mode' for more information."
607 # These modes are in order of execution frequency so that they run quickly.
609 # libtool compile mode
611 modename="$modename: compile"
612 # Get the compilation command and the source file.
614 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
625 # do not "continue". Instead, add this to base_compile
637 # Accept any command-line options.
640 if test -n "$libobj" ; then
641 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
648 -static | -prefer-pic | -prefer-non-pic)
659 arg_mode=arg # the next one goes into the "base_compile" arg list
660 continue # The current "srcfile" will either be retained or
661 ;; # replaced later. I would guess that would be a bug.
664 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
666 save_ifs="$IFS"; IFS=','
670 # Double-quote args containing other shell metacharacters.
671 # Many Bourne shells cannot handle close brackets correctly
672 # in scan sets, so we specify it separately.
674 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
678 lastarg="$lastarg $arg"
681 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
683 # Add the arguments to base_compile.
684 base_compile="$base_compile $lastarg"
689 # Accept the current argument as the source file.
690 # The previous "srcfile" becomes the current argument.
697 esac # case $arg_mode
699 # Aesthetically quote the previous argument.
700 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
703 # Double-quote args containing other shell metacharacters.
704 # Many Bourne shells cannot handle close brackets correctly
705 # in scan sets, and some SunOS ksh mistreat backslash-escaping
706 # in scan sets (worked around with variable expansion),
707 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
708 # at all, so we specify them separately.
709 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
710 lastarg="\"$lastarg\""
714 base_compile="$base_compile $lastarg"
719 $echo "$modename: you must specify an argument for -Xcompile"
723 $echo "$modename: you must specify a target with \`-o'" 1>&2
727 # Get the name of the library object.
728 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
732 # Recognize several different file suffixes.
733 # If the user specifies -o file.o, it is replaced with file.lo
743 *.class) xform=class ;;
748 *.java) xform=java ;;
751 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
754 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
756 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
761 func_infer_tag $base_compile
763 for arg in $later; do
782 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
784 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
785 qlibobj="\"$qlibobj\"" ;;
787 if test "X$libobj" != "X$qlibobj"; then
788 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
791 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
792 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
793 if test "X$xdir" = "X$obj"; then
798 lobj=${xdir}$objdir/$objname
800 if test -z "$base_compile"; then
801 $echo "$modename: you must specify a compilation command" 1>&2
806 # Delete any leftover library objects.
807 if test "$build_old_libs" = yes; then
808 removelist="$obj $lobj $libobj ${libobj}T"
810 removelist="$lobj $libobj ${libobj}T"
814 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
816 # On Cygwin there's no "real" PIC flag so we must build both object types
818 cygwin* | mingw* | pw32* | os2*)
822 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
823 # non-PIC code in shared libraries is not supported
827 # Calculate the filename of the output object if compiler does
828 # not support -o with -c
829 if test "$compiler_c_o" = no; then
830 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
831 lockfile="$output_obj.lock"
832 removelist="$removelist $output_obj $lockfile"
833 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
840 # Lock this critical section if it is needed
841 # We use this script file to make the link, it avoids creating a new file
842 if test "$need_locks" = yes; then
843 until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
844 $show "Waiting for $lockfile to be removed"
847 elif test "$need_locks" = warn; then
848 if test -f "$lockfile"; then
850 *** ERROR, $lockfile exists and contains:
851 `cat $lockfile 2>/dev/null`
853 This indicates that another process is trying to use the same
854 temporary object file, and libtool could not work around it because
855 your compiler does not support \`-c' and \`-o' together. If you
856 repeat this compilation, it may succeed, by chance, but you had better
857 avoid parallel builds (make -j) in this platform, or get a better
863 $echo "$srcfile" > "$lockfile"
866 if test -n "$fix_srcfile_path"; then
867 eval srcfile=\"$fix_srcfile_path\"
869 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
871 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
872 qsrcfile="\"$qsrcfile\"" ;;
875 $run $rm "$libobj" "${libobj}T"
877 # Create a libtool object file (analogous to a ".la" file),
878 # but don't create it if we're doing a dry run.
879 test -z "$run" && cat > ${libobj}T <<EOF
880 # $libobj - a libtool object file
881 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
883 # Please DO NOT delete this file!
884 # It is necessary for linking the library.
886 # Name of the PIC object.
889 # Only build a PIC object if we are building libtool libraries.
890 if test "$build_libtool_libs" = yes; then
891 # Without this assignment, base_compile gets emptied.
892 fbsd_hideous_sh_bug=$base_compile
894 if test "$pic_mode" != no; then
895 command="$base_compile $qsrcfile $pic_flag"
897 # Don't build PIC code
898 command="$base_compile $qsrcfile"
901 if test ! -d "${xdir}$objdir"; then
902 $show "$mkdir ${xdir}$objdir"
903 $run $mkdir ${xdir}$objdir
905 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
910 if test -z "$output_obj"; then
911 # Place PIC objects in $objdir
912 command="$command -o $lobj"
915 $run $rm "$lobj" "$output_obj"
918 if $run eval "$command"; then :
920 test -n "$output_obj" && $run $rm $removelist
924 if test "$need_locks" = warn &&
925 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
927 *** ERROR, $lockfile contains:
928 `cat $lockfile 2>/dev/null`
930 but it should contain:
933 This indicates that another process is trying to use the same
934 temporary object file, and libtool could not work around it because
935 your compiler does not support \`-c' and \`-o' together. If you
936 repeat this compilation, it may succeed, by chance, but you had better
937 avoid parallel builds (make -j) in this platform, or get a better
944 # Just move the object if needed, then go on to compile the next one
945 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
946 $show "$mv $output_obj $lobj"
947 if $run $mv $output_obj $lobj; then :
955 # Append the name of the PIC object to the libtool object file.
956 test -z "$run" && cat >> ${libobj}T <<EOF
957 pic_object='$objdir/$objname'
961 # Allow error messages only from the first compilation.
962 if test "$suppress_opt" = yes; then
963 suppress_output=' >/dev/null 2>&1'
966 # No PIC object so indicate it doesn't exist in the libtool
968 test -z "$run" && cat >> ${libobj}T <<EOF
974 # Only build a position-dependent object if we build old libraries.
975 if test "$build_old_libs" = yes; then
976 if test "$pic_mode" != yes; then
977 # Don't build PIC code
978 command="$base_compile $qsrcfile"
980 command="$base_compile $qsrcfile $pic_flag"
982 if test "$compiler_c_o" = yes; then
983 command="$command -o $obj"
986 # Suppress compiler output if we already did a PIC compilation.
987 command="$command$suppress_output"
988 $run $rm "$obj" "$output_obj"
990 if $run eval "$command"; then :
996 if test "$need_locks" = warn &&
997 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
999 *** ERROR, $lockfile contains:
1000 `cat $lockfile 2>/dev/null`
1002 but it should contain:
1005 This indicates that another process is trying to use the same
1006 temporary object file, and libtool could not work around it because
1007 your compiler does not support \`-c' and \`-o' together. If you
1008 repeat this compilation, it may succeed, by chance, but you had better
1009 avoid parallel builds (make -j) in this platform, or get a better
1012 $run $rm $removelist
1016 # Just move the object if needed
1017 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1018 $show "$mv $output_obj $obj"
1019 if $run $mv $output_obj $obj; then :
1022 $run $rm $removelist
1027 # Append the name of the non-PIC object the libtool object file.
1028 # Only append if the libtool object file exists.
1029 test -z "$run" && cat >> ${libobj}T <<EOF
1030 # Name of the non-PIC object.
1031 non_pic_object='$objname'
1035 # Append the name of the non-PIC object the libtool object file.
1036 # Only append if the libtool object file exists.
1037 test -z "$run" && cat >> ${libobj}T <<EOF
1038 # Name of the non-PIC object.
1044 $run $mv "${libobj}T" "${libobj}"
1046 # Unlock the critical section if it was locked
1047 if test "$need_locks" != no; then
1048 $run $rm "$lockfile"
1056 modename="$modename: link"
1058 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1059 # It is impossible to link a dll without this setting, and
1060 # we shouldn't force the makefile maintainer to figure out
1061 # which system we are compiling for in order to pass an extra
1062 # flag for every libtool invocation.
1063 # allow_undefined=no
1065 # FIXME: Unfortunately, there are problems with the above when trying
1066 # to make a dll which has undefined symbols, in which case not
1067 # even a static library is built. For now, we need to specify
1068 # -no-undefined on the libtool link line when we can be certain
1069 # that all symbols are satisfied, otherwise we get a static library.
1076 libtool_args="$nonopt"
1077 base_compile="$nonopt $@"
1078 compile_command="$nonopt"
1079 finalize_command="$nonopt"
1092 lib_search_path=`pwd`
1101 export_symbols_regex=
1109 precious_files_regex=
1110 prefer_static_libs=no
1123 func_infer_tag $base_compile
1125 # We need to know -static, to get the right output filenames.
1129 -all-static | -static)
1130 if test "X$arg" = "X-all-static"; then
1131 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1132 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1134 if test -n "$link_static_flag"; then
1135 dlopen_self=$dlopen_self_static
1138 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1139 dlopen_self=$dlopen_self_static
1142 build_libtool_libs=no
1144 prefer_static_libs=yes
1150 # See if our shared archives depend on static archives.
1151 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1153 # Go through the arguments, transforming them on the way.
1154 while test "$#" -gt 0; do
1158 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1159 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1163 libtool_args="$libtool_args $qarg"
1165 # If the previous option needs an argument, assign it.
1166 if test -n "$prev"; then
1169 compile_command="$compile_command @OUTPUT@"
1170 finalize_command="$finalize_command @OUTPUT@"
1176 if test "$preload" = no; then
1177 # Add the symbol object into the linking commands.
1178 compile_command="$compile_command @SYMFILE@"
1179 finalize_command="$finalize_command @SYMFILE@"
1183 *.la | *.lo) ;; # We handle these cases below.
1185 if test "$dlself" = no; then
1193 if test "$prev" = dlprefiles; then
1195 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1205 if test "$prev" = dlfiles; then
1206 dlfiles="$dlfiles $arg"
1208 dlprefiles="$dlprefiles $arg"
1216 export_symbols="$arg"
1217 if test ! -f "$arg"; then
1218 $echo "$modename: symbol file \`$arg' does not exist"
1225 export_symbols_regex="$arg"
1230 inst_prefix_dir="$arg"
1235 precious_files_regex="$arg"
1245 if test -f "$arg"; then
1248 for fil in `cat $save_arg`
1250 # moreargs="$moreargs $fil"
1252 # A libtool-controlled object.
1254 # Check to see that this really is a libtool object.
1255 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1260 # If there is no directory component, then add one.
1262 */* | *\\*) . $arg ;;
1266 if test -z "$pic_object" || \
1267 test -z "$non_pic_object" ||
1268 test "$pic_object" = none && \
1269 test "$non_pic_object" = none; then
1270 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1274 # Extract subdirectory from the argument.
1275 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1276 if test "X$xdir" = "X$arg"; then
1282 if test "$pic_object" != none; then
1283 # Prepend the subdirectory the object is found in.
1284 pic_object="$xdir$pic_object"
1286 if test "$prev" = dlfiles; then
1287 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1288 dlfiles="$dlfiles $pic_object"
1292 # If libtool objects are unsupported, then we need to preload.
1297 # CHECK ME: I think I busted this. -Ossama
1298 if test "$prev" = dlprefiles; then
1299 # Preload the old-style object.
1300 dlprefiles="$dlprefiles $pic_object"
1305 libobjs="$libobjs $pic_object"
1310 if test "$non_pic_object" != none; then
1311 # Prepend the subdirectory the object is found in.
1312 non_pic_object="$xdir$non_pic_object"
1314 # A standard non-PIC object
1315 non_pic_objects="$non_pic_objects $non_pic_object"
1316 if test -z "$pic_object" || test "$pic_object" = none ; then
1317 arg="$non_pic_object"
1321 # Only an error if not doing a dry-run.
1322 if test -z "$run"; then
1323 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1328 # Extract subdirectory from the argument.
1329 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1330 if test "X$xdir" = "X$arg"; then
1336 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1337 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1338 libobjs="$libobjs $pic_object"
1339 non_pic_objects="$non_pic_objects $non_pic_object"
1344 $echo "$modename: link input file \`$save_arg' does not exist"
1352 # We need an absolute path.
1354 [\\/]* | [A-Za-z]:[\\/]*) ;;
1356 $echo "$modename: only absolute run-paths are allowed" 1>&2
1360 if test "$prev" = rpath; then
1363 *) rpath="$rpath $arg" ;;
1368 *) xrpath="$xrpath $arg" ;;
1375 compiler_flags="$compiler_flags $qarg"
1377 compile_command="$compile_command $qarg"
1378 finalize_command="$finalize_command $qarg"
1382 linker_flags="$linker_flags $qarg"
1383 compiler_flags="$compiler_flags $wl$qarg"
1385 compile_command="$compile_command $wl$qarg"
1386 finalize_command="$finalize_command $wl$qarg"
1390 linker_flags="$linker_flags $qarg"
1391 compiler_flags="$compiler_flags $qarg"
1393 compile_command="$compile_command $qarg"
1394 finalize_command="$finalize_command $qarg"
1403 compiler_flags="$compiler_flags $arg"
1404 compile_command="$compile_command $arg"
1405 finalize_command="$finalize_command $arg"
1410 eval "$prev=\"\$arg\""
1415 fi # test -n "$prev"
1421 if test -n "$link_static_flag"; then
1422 compile_command="$compile_command $link_static_flag"
1423 finalize_command="$finalize_command $link_static_flag"
1429 # FIXME: remove this flag sometime in the future.
1430 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1454 -export-symbols | -export-symbols-regex)
1455 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1456 $echo "$modename: more than one -exported-symbols argument is not allowed"
1459 if test "X$arg" = "X-export-symbols"; then
1468 prev=darwin_framework
1469 compiler_flags="$compiler_flags $arg"
1470 compile_command="$compile_command $arg"
1471 finalize_command="$finalize_command $arg"
1480 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1481 # so, if we see these flags be careful not to treat them like -L
1483 case $with_gcc/$host in
1484 no/*-*-irix* | /*-*-irix*)
1485 compile_command="$compile_command $arg"
1486 finalize_command="$finalize_command $arg"
1493 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1494 # We need an absolute path.
1496 [\\/]* | [A-Za-z]:[\\/]*) ;;
1498 absdir=`cd "$dir" && pwd`
1499 if test -z "$absdir"; then
1500 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1509 deplibs="$deplibs -L$dir"
1510 lib_search_path="$lib_search_path $dir"
1514 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1515 case :$dllsearchpath: in
1517 *) dllsearchpath="$dllsearchpath:$dir";;
1525 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1527 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1528 # These systems don't actually have a C or math library (as such)
1531 *-*-mingw* | *-*-os2*)
1532 # These systems don't actually have a C library (as such)
1533 test "X$arg" = "X-lc" && continue
1535 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1536 # Do not include libc due to us having libc/libc_r.
1537 test "X$arg" = "X-lc" && continue
1539 *-*-rhapsody* | *-*-darwin1.[012])
1540 # Rhapsody C and math libraries are in the System framework
1541 deplibs="$deplibs -framework System"
1544 elif test "X$arg" = "X-lc_r"; then
1546 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1547 # Do not include libc_r directly, use -pthread flag.
1552 deplibs="$deplibs $arg"
1556 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1557 # classes, name mangling, and exception handling.
1559 compile_command="$compile_command $arg"
1560 compiler_flags="$compiler_flags $arg"
1561 finalize_command="$finalize_command $arg"
1566 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1567 compiler_flags="$compiler_flags $arg"
1568 compile_command="$compile_command $arg"
1569 finalize_command="$finalize_command $arg"
1578 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1579 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1580 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1581 # +DA*, +DD* enable 64-bit mode on the HP compiler
1582 # -q* pass through compiler args for the IBM compiler
1583 # -m* pass through architecture-specific compiler args for GCC
1584 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1586 # Unknown arguments in both finalize_command and compile_command need
1587 # to be aesthetically quoted because they are evaled later.
1588 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1590 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1594 compile_command="$compile_command $arg"
1595 finalize_command="$finalize_command $arg"
1596 if test "$with_gcc" = "yes" ; then
1597 compiler_flags="$compiler_flags $arg"
1614 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1615 # The PATH hackery in wrapper scripts is required on Windows
1616 # in order for the loader to find any dlls it needs.
1617 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1618 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1621 *) no_install=yes ;;
1638 -precious-files-regex)
1659 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1660 # We need an absolute path.
1662 [\\/]* | [A-Za-z]:[\\/]*) ;;
1664 $echo "$modename: only absolute run-paths are allowed" 1>&2
1670 *) xrpath="$xrpath $dir" ;;
1676 # The effects of -static are defined in a previous loop.
1677 # We used to do the same as -all-static on platforms that
1678 # didn't have a PIC flag, but the assumption that the effects
1679 # would be equivalent was wrong. It would break on at least
1680 # Digital Unix and AIX.
1700 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1702 save_ifs="$IFS"; IFS=','
1703 for flag in $args; do
1706 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1711 compiler_flags="$compiler_flags $flag"
1714 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1718 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1720 save_ifs="$IFS"; IFS=','
1721 for flag in $args; do
1724 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1729 compiler_flags="$compiler_flags $wl$flag"
1730 linker_flags="$linker_flags $flag"
1733 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1751 -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread )
1752 compiler_flags="$compiler_flags $arg"
1756 # Some other compiler flag.
1758 # Unknown arguments in both finalize_command and compile_command need
1759 # to be aesthetically quoted because they are evaled later.
1760 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1762 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1769 # A standard object.
1774 # A libtool-controlled object.
1776 # Check to see that this really is a libtool object.
1777 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1782 # If there is no directory component, then add one.
1784 */* | *\\*) . $arg ;;
1788 if test -z "$pic_object" || \
1789 test -z "$non_pic_object" ||
1790 test "$pic_object" = none && \
1791 test "$non_pic_object" = none; then
1792 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1796 # Extract subdirectory from the argument.
1797 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1798 if test "X$xdir" = "X$arg"; then
1804 if test "$pic_object" != none; then
1805 # Prepend the subdirectory the object is found in.
1806 pic_object="$xdir$pic_object"
1808 if test "$prev" = dlfiles; then
1809 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1810 dlfiles="$dlfiles $pic_object"
1814 # If libtool objects are unsupported, then we need to preload.
1819 # CHECK ME: I think I busted this. -Ossama
1820 if test "$prev" = dlprefiles; then
1821 # Preload the old-style object.
1822 dlprefiles="$dlprefiles $pic_object"
1827 libobjs="$libobjs $pic_object"
1832 if test "$non_pic_object" != none; then
1833 # Prepend the subdirectory the object is found in.
1834 non_pic_object="$xdir$non_pic_object"
1836 # A standard non-PIC object
1837 non_pic_objects="$non_pic_objects $non_pic_object"
1838 if test -z "$pic_object" || test "$pic_object" = none ; then
1839 arg="$non_pic_object"
1843 # Only an error if not doing a dry-run.
1844 if test -z "$run"; then
1845 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1850 # Extract subdirectory from the argument.
1851 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1852 if test "X$xdir" = "X$arg"; then
1858 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1859 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1860 libobjs="$libobjs $pic_object"
1861 non_pic_objects="$non_pic_objects $non_pic_object"
1868 deplibs="$deplibs $arg"
1869 old_deplibs="$old_deplibs $arg"
1874 # A libtool-controlled library.
1876 if test "$prev" = dlfiles; then
1877 # This library was specified with -dlopen.
1878 dlfiles="$dlfiles $arg"
1880 elif test "$prev" = dlprefiles; then
1881 # The library was specified with -dlpreopen.
1882 dlprefiles="$dlprefiles $arg"
1885 deplibs="$deplibs $arg"
1890 # Some other compiler argument.
1892 # Unknown arguments in both finalize_command and compile_command need
1893 # to be aesthetically quoted because they are evaled later.
1894 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1896 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1903 # Now actually substitute the argument into the commands.
1904 if test -n "$arg"; then
1905 compile_command="$compile_command $arg"
1906 finalize_command="$finalize_command $arg"
1908 done # argument parsing loop
1910 if test -n "$prev"; then
1911 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1916 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1917 eval arg=\"$export_dynamic_flag_spec\"
1918 compile_command="$compile_command $arg"
1919 finalize_command="$finalize_command $arg"
1923 # calculate the name of the file, without its directory
1924 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1925 libobjs_save="$libobjs"
1927 if test -n "$shlibpath_var"; then
1928 # get the directories listed in $shlibpath_var
1929 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1933 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1934 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1936 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1937 if test "X$output_objdir" = "X$output"; then
1938 output_objdir="$objdir"
1940 output_objdir="$output_objdir/$objdir"
1942 # Create the object directory.
1943 if test ! -d "$output_objdir"; then
1944 $show "$mkdir $output_objdir"
1945 $run $mkdir $output_objdir
1947 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1952 # Determine the type of output
1955 $echo "$modename: you must specify an output file" 1>&2
1959 *.$libext) linkmode=oldlib ;;
1960 *.lo | *.$objext) linkmode=obj ;;
1961 *.la) linkmode=lib ;;
1962 *) linkmode=prog ;; # Anything else should be a program.
1966 *cygwin* | *mingw* | *pw32*)
1967 # don't eliminate duplications in $postdeps and $predeps
1968 duplicate_compiler_generated_deps=yes
1971 duplicate_compiler_generated_deps=$duplicate_deps
1977 # Find all interdependent deplibs by searching for libraries
1978 # that are linked more than once (e.g. -la -lb -la)
1979 for deplib in $deplibs; do
1980 if test "X$duplicate_deps" = "Xyes" ; then
1982 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1985 libs="$libs $deplib"
1988 if test "$linkmode" = lib; then
1989 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1991 # Compute libraries that are listed more than once in $predeps
1992 # $postdeps and mark them as special (i.e., whose duplicates are
1993 # not to be eliminated).
1995 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1996 for pre_post_dep in $predeps $postdeps; do
1997 case "$pre_post_deps " in
1998 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2000 pre_post_deps="$pre_post_deps $pre_post_dep"
2009 need_relink=no # whether we're linking any uninstalled libtool libraries
2010 notinst_deplibs= # not-installed libtool libraries
2011 notinst_path= # paths that contain not-installed libtool libraries
2015 for file in $dlfiles $dlprefiles; do
2019 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2031 passes="conv scan dlopen dlpreopen link"
2036 for pass in $passes; do
2037 if test "$linkmode,$pass" = "lib,link" ||
2038 test "$linkmode,$pass" = "prog,scan"; then
2042 if test "$linkmode" = prog; then
2044 dlopen) libs="$dlfiles" ;;
2045 dlpreopen) libs="$dlprefiles" ;;
2046 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2049 if test "$pass" = dlopen; then
2050 # Collect dlpreopened libraries
2051 save_deplibs="$deplibs"
2054 for deplib in $libs; do
2058 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2059 if test "$linkmode,$pass" = "prog,link"; then
2060 compile_deplibs="$deplib $compile_deplibs"
2061 finalize_deplibs="$deplib $finalize_deplibs"
2063 compiler_flags="$compiler_flags $deplib"
2068 if test "$linkmode" != lib && test "$linkmode" != prog; then
2069 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2072 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2073 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2074 for search_ext in .la $std_shrext .so .a; do
2075 # Search the libtool library
2076 lib="$searchdir/lib${name}${search_ext}"
2077 if test -f "$lib"; then
2078 if test "$search_ext" = ".la"; then
2087 if test "$found" != yes; then
2088 # deplib doesn't seem to be a libtool library
2089 if test "$linkmode,$pass" = "prog,link"; then
2090 compile_deplibs="$deplib $compile_deplibs"
2091 finalize_deplibs="$deplib $finalize_deplibs"
2093 deplibs="$deplib $deplibs"
2094 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2097 else # deplib is a libtool library
2098 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2099 # We need to do some special things here, and not later.
2100 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2101 case " $predeps $postdeps " in
2103 if (${SED} -e '2q' $lib |
2104 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2108 */* | *\\*) . $lib ;;
2111 for l in $old_library $library_names; do
2114 if test "X$ll" = "X$old_library" ; then # only static version available
2116 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2117 test "X$ladir" = "X$lib" && ladir="."
2118 lib=$ladir/$old_library
2119 if test "$linkmode,$pass" = "prog,link"; then
2120 compile_deplibs="$deplib $compile_deplibs"
2121 finalize_deplibs="$deplib $finalize_deplibs"
2123 deplibs="$deplib $deplibs"
2124 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2138 deplibs="$deplib $deplibs"
2139 test "$pass" = conv && continue
2140 newdependency_libs="$deplib $newdependency_libs"
2141 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2144 if test "$pass" = conv; then
2145 deplibs="$deplib $deplibs"
2148 if test "$pass" = scan; then
2149 deplibs="$deplib $deplibs"
2151 compile_deplibs="$deplib $compile_deplibs"
2152 finalize_deplibs="$deplib $finalize_deplibs"
2154 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2157 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2163 if test "$pass" = link; then
2164 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2165 # Make sure the xrpath contains only unique directories.
2168 *) xrpath="$xrpath $dir" ;;
2171 deplibs="$deplib $deplibs"
2174 *.la) lib="$deplib" ;;
2176 if test "$pass" = conv; then
2177 deplibs="$deplib $deplibs"
2183 case $deplibs_check_method in
2185 set dummy $deplibs_check_method
2186 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2187 if eval $echo \"$deplib\" 2>/dev/null \
2189 | $EGREP "$match_pattern_regex" > /dev/null; then
2197 if test "$valid_a_lib" != yes; then
2199 $echo "*** Warning: Trying to link with static lib archive $deplib."
2200 $echo "*** I have the capability to make that library automatically link in when"
2201 $echo "*** you link to this library. But I can only do this if you have a"
2202 $echo "*** shared version of the library, which you do not appear to have"
2203 $echo "*** because the file extensions .$libext of this argument makes me believe"
2204 $echo "*** that it is just a static archive that I should not used here."
2207 $echo "*** Warning: Linking the shared library $output against the"
2208 $echo "*** static library $deplib is not portable!"
2209 deplibs="$deplib $deplibs"
2214 if test "$pass" != link; then
2215 deplibs="$deplib $deplibs"
2217 compile_deplibs="$deplib $compile_deplibs"
2218 finalize_deplibs="$deplib $finalize_deplibs"
2225 if test "$pass" = conv; then
2226 deplibs="$deplib $deplibs"
2227 elif test "$linkmode" = prog; then
2228 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2229 # If there is no dlopen support or we're linking statically,
2230 # we need to preload.
2231 newdlprefiles="$newdlprefiles $deplib"
2232 compile_deplibs="$deplib $compile_deplibs"
2233 finalize_deplibs="$deplib $finalize_deplibs"
2235 newdlfiles="$newdlfiles $deplib"
2245 if test "$found" = yes || test -f "$lib"; then :
2247 $echo "$modename: cannot find the library \`$lib'" 1>&2
2251 # Check to see that this really is a libtool archive.
2252 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2254 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2258 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2259 test "X$ladir" = "X$lib" && ladir="."
2267 # If the library was installed with an old release of libtool,
2268 # it will not redefine variables installed, or shouldnotlink
2276 */* | *\\*) . $lib ;;
2280 if test "$linkmode,$pass" = "lib,link" ||
2281 test "$linkmode,$pass" = "prog,scan" ||
2282 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2283 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2284 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2287 if test "$pass" = conv; then
2288 # Only check for convenience libraries
2289 deplibs="$lib $deplibs"
2290 if test -z "$libdir"; then
2291 if test -z "$old_library"; then
2292 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2295 # It is a libtool convenience library, so add in its objects.
2296 convenience="$convenience $ladir/$objdir/$old_library"
2297 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2299 for deplib in $dependency_libs; do
2300 deplibs="$deplib $deplibs"
2301 if test "X$duplicate_deps" = "Xyes" ; then
2302 case "$tmp_libs " in
2303 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2306 tmp_libs="$tmp_libs $deplib"
2308 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2309 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2316 # Get the name of the library we link against.
2318 for l in $old_library $library_names; do
2321 if test -z "$linklib"; then
2322 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2326 # This library was specified with -dlopen.
2327 if test "$pass" = dlopen; then
2328 if test -z "$libdir"; then
2329 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2332 if test -z "$dlname" ||
2333 test "$dlopen_support" != yes ||
2334 test "$build_libtool_libs" = no; then
2335 # If there is no dlname, no dlopen support or we're linking
2336 # statically, we need to preload. We also need to preload any
2337 # dependent libraries so libltdl's deplib preloader doesn't
2338 # bomb out in the load deplibs phase.
2339 dlprefiles="$dlprefiles $lib $dependency_libs"
2341 newdlfiles="$newdlfiles $lib"
2346 # We need an absolute path.
2348 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2350 abs_ladir=`cd "$ladir" && pwd`
2351 if test -z "$abs_ladir"; then
2352 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2353 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2358 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2360 # Find the relevant object directory and library name.
2361 if test "X$installed" = Xyes; then
2362 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2363 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2371 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2373 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2376 # Remove this search path later
2377 notinst_path="$notinst_path $abs_ladir"
2379 dir="$ladir/$objdir"
2380 absdir="$abs_ladir/$objdir"
2381 # Remove this search path later
2382 notinst_path="$notinst_path $abs_ladir"
2384 fi # $installed = yes
2385 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2387 # This library was specified with -dlpreopen.
2388 if test "$pass" = dlpreopen; then
2389 if test -z "$libdir"; then
2390 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2393 # Prefer using a static library (so that no silly _DYNAMIC symbols
2394 # are required to link).
2395 if test -n "$old_library"; then
2396 newdlprefiles="$newdlprefiles $dir/$old_library"
2397 # Otherwise, use the dlname, so that lt_dlopen finds it.
2398 elif test -n "$dlname"; then
2399 newdlprefiles="$newdlprefiles $dir/$dlname"
2401 newdlprefiles="$newdlprefiles $dir/$linklib"
2403 fi # $pass = dlpreopen
2405 if test -z "$libdir"; then
2406 # Link the convenience library
2407 if test "$linkmode" = lib; then
2408 deplibs="$dir/$old_library $deplibs"
2409 elif test "$linkmode,$pass" = "prog,link"; then
2410 compile_deplibs="$dir/$old_library $compile_deplibs"
2411 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2413 deplibs="$lib $deplibs" # used for prog,scan pass
2419 if test "$linkmode" = prog && test "$pass" != link; then
2420 newlib_search_path="$newlib_search_path $ladir"
2421 deplibs="$lib $deplibs"
2424 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2425 test "$build_libtool_libs" = no; then
2430 for deplib in $dependency_libs; do
2432 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2434 # Need to link against all dependency_libs?
2435 if test "$linkalldeplibs" = yes; then
2436 deplibs="$deplib $deplibs"
2438 # Need to hardcode shared library paths
2439 # or/and link against static libraries
2440 newdependency_libs="$deplib $newdependency_libs"
2442 if test "X$duplicate_deps" = "Xyes" ; then
2443 case "$tmp_libs " in
2444 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2447 tmp_libs="$tmp_libs $deplib"
2450 fi # $linkmode = prog...
2452 if test "$linkmode,$pass" = "prog,link"; then
2453 if test -n "$library_names" &&
2454 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2455 # We need to hardcode the library path
2456 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2457 # Make sure the rpath contains only unique directories.
2458 case "$temp_rpath " in
2461 *) temp_rpath="$temp_rpath $dir" ;;
2465 # Hardcode the library path.
2466 # Skip directories that are in the system default run-time
2468 case " $sys_lib_dlsearch_path " in
2471 case "$compile_rpath " in
2473 *) compile_rpath="$compile_rpath $absdir"
2477 case " $sys_lib_dlsearch_path " in
2480 case "$finalize_rpath " in
2482 *) finalize_rpath="$finalize_rpath $libdir"
2486 fi # $linkmode,$pass = prog,link...
2488 if test "$alldeplibs" = yes &&
2489 { test "$deplibs_check_method" = pass_all ||
2490 { test "$build_libtool_libs" = yes &&
2491 test -n "$library_names"; }; }; then
2492 # We only need to search for static libraries
2497 link_static=no # Whether the deplib will be linked statically
2498 if test -n "$library_names" &&
2499 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2500 if test "$installed" = no; then
2501 notinst_deplibs="$notinst_deplibs $lib"
2504 # This is a shared library
2506 # Warn about portability, can't link against -module's on
2507 # some systems (darwin)
2508 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2510 if test "$linkmode" = prog; then
2511 $echo "*** Warning: Linking the executable $output against the loadable module"
2513 $echo "*** Warning: Linking the shared library $output against the loadable module"
2515 $echo "*** $linklib is not portable!"
2517 if test "$linkmode" = lib &&
2518 test "$hardcode_into_libs" = yes; then
2519 # Hardcode the library path.
2520 # Skip directories that are in the system default run-time
2522 case " $sys_lib_dlsearch_path " in
2525 case "$compile_rpath " in
2527 *) compile_rpath="$compile_rpath $absdir"
2531 case " $sys_lib_dlsearch_path " in
2534 case "$finalize_rpath " in
2536 *) finalize_rpath="$finalize_rpath $libdir"
2542 if test -n "$old_archive_from_expsyms_cmds"; then
2543 # figure out the soname
2544 set dummy $library_names
2547 libname=`eval \\$echo \"$libname_spec\"`
2548 # use dlname if we got it. it's perfectly good, no?
2549 if test -n "$dlname"; then
2551 elif test -n "$soname_spec"; then
2555 major=`expr $current - $age`
2559 eval soname=\"$soname_spec\"
2564 # Make a new name for the extract_expsyms_cmds to use
2566 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2567 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2569 # If the library has no export list, then create one now
2570 if test -f "$output_objdir/$soname-def"; then :
2572 $show "extracting exported symbol list from \`$soname'"
2573 save_ifs="$IFS"; IFS='~'
2574 cmds=$extract_expsyms_cmds
2575 for cmd in $cmds; do
2579 $run eval "$cmd" || exit $?
2585 if test -f "$output_objdir/$newlib"; then :; else
2586 $show "generating import library for \`$soname'"
2587 save_ifs="$IFS"; IFS='~'
2588 cmds=$old_archive_from_expsyms_cmds
2589 for cmd in $cmds; do
2593 $run eval "$cmd" || exit $?
2597 # make sure the library variables are pointing to the new library
2600 fi # test -n "$old_archive_from_expsyms_cmds"
2602 if test "$linkmode" = prog || test "$mode" != relink; then
2607 case $hardcode_action in
2608 immediate | unsupported)
2609 if test "$hardcode_direct" = no; then
2612 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2614 # if the lib is a module then we can not link against
2615 # it, someone is ignoring the new warnings I added
2616 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2617 $echo "** Warning, lib $linklib is a module, not a shared library"
2618 if test -z "$old_library" ; then
2620 $echo "** And there doesn't seem to be a static archive available"
2621 $echo "** The link will probably fail, sorry"
2623 add="$dir/$old_library"
2627 elif test "$hardcode_minus_L" = no; then
2629 *-*-sunos*) add_shlibpath="$dir" ;;
2633 elif test "$hardcode_shlibpath_var" = no; then
2634 add_shlibpath="$dir"
2641 if test "$hardcode_direct" = yes; then
2643 elif test "$hardcode_minus_L" = yes; then
2645 # Try looking first in the location we're being installed to.
2646 if test -n "$inst_prefix_dir"; then
2649 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2654 elif test "$hardcode_shlibpath_var" = yes; then
2655 add_shlibpath="$dir"
2664 if test "$lib_linked" != yes; then
2665 $echo "$modename: configuration error: unsupported hardcode properties"
2669 if test -n "$add_shlibpath"; then
2670 case :$compile_shlibpath: in
2671 *":$add_shlibpath:"*) ;;
2672 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2675 if test "$linkmode" = prog; then
2676 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2677 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2679 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2680 test -n "$add" && deplibs="$add $deplibs"
2681 if test "$hardcode_direct" != yes && \
2682 test "$hardcode_minus_L" != yes && \
2683 test "$hardcode_shlibpath_var" = yes; then
2684 case :$finalize_shlibpath: in
2686 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2692 if test "$linkmode" = prog || test "$mode" = relink; then
2696 # Finalize command for both is simple: just hardcode it.
2697 if test "$hardcode_direct" = yes; then
2698 add="$libdir/$linklib"
2699 elif test "$hardcode_minus_L" = yes; then
2702 elif test "$hardcode_shlibpath_var" = yes; then
2703 case :$finalize_shlibpath: in
2705 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2708 elif test "$hardcode_automatic" = yes; then
2709 if test -n "$inst_prefix_dir" &&
2710 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2711 add="$inst_prefix_dir$libdir/$linklib"
2713 add="$libdir/$linklib"
2716 # We cannot seem to hardcode it, guess we'll fake it.
2718 # Try looking first in the location we're being installed to.
2719 if test -n "$inst_prefix_dir"; then
2722 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2729 if test "$linkmode" = prog; then
2730 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2731 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2733 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2734 test -n "$add" && deplibs="$add $deplibs"
2737 elif test "$linkmode" = prog; then
2738 # Here we assume that one of hardcode_direct or hardcode_minus_L
2739 # is not unsupported. This is valid on all known static and
2741 if test "$hardcode_direct" != unsupported; then
2742 test -n "$old_library" && linklib="$old_library"
2743 compile_deplibs="$dir/$linklib $compile_deplibs"
2744 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2746 compile_deplibs="-l$name -L$dir $compile_deplibs"
2747 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2749 elif test "$build_libtool_libs" = yes; then
2750 # Not a shared library
2751 if test "$deplibs_check_method" != pass_all; then
2752 # We're trying link a shared library against a static one
2753 # but the system doesn't support it.
2755 # Just print a warning and add the library to dependency_libs so
2756 # that the program can be linked against the static library.
2758 $echo "*** Warning: This system can not link to static lib archive $lib."
2759 $echo "*** I have the capability to make that library automatically link in when"
2760 $echo "*** you link to this library. But I can only do this if you have a"
2761 $echo "*** shared version of the library, which you do not appear to have."
2762 if test "$module" = yes; then
2763 $echo "*** But as you try to build a module library, libtool will still create "
2764 $echo "*** a static module, that should work as long as the dlopening application"
2765 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2766 if test -z "$global_symbol_pipe"; then
2768 $echo "*** However, this would only work if libtool was able to extract symbol"
2769 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2770 $echo "*** not find such a program. So, this module is probably useless."
2771 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2773 if test "$build_old_libs" = no; then
2774 build_libtool_libs=module
2777 build_libtool_libs=no
2781 convenience="$convenience $dir/$old_library"
2782 old_convenience="$old_convenience $dir/$old_library"
2783 deplibs="$dir/$old_library $deplibs"
2786 fi # link shared/static library?
2788 if test "$linkmode" = lib; then
2789 if test -n "$dependency_libs" &&
2790 { test "$hardcode_into_libs" != yes ||
2791 test "$build_old_libs" = yes ||
2792 test "$link_static" = yes; }; then
2793 # Extract -R from dependency_libs
2795 for libdir in $dependency_libs; do
2797 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2799 *" $temp_xrpath "*) ;;
2800 *) xrpath="$xrpath $temp_xrpath";;
2802 *) temp_deplibs="$temp_deplibs $libdir";;
2805 dependency_libs="$temp_deplibs"
2808 newlib_search_path="$newlib_search_path $absdir"
2809 # Link against this library
2810 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2811 # ... and its dependency_libs
2813 for deplib in $dependency_libs; do
2814 newdependency_libs="$deplib $newdependency_libs"
2815 if test "X$duplicate_deps" = "Xyes" ; then
2816 case "$tmp_libs " in
2817 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2820 tmp_libs="$tmp_libs $deplib"
2823 if test "$link_all_deplibs" != no; then
2824 # Add the search paths of all dependency libraries
2825 for deplib in $dependency_libs; do
2827 -L*) path="$deplib" ;;
2829 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2830 test "X$dir" = "X$deplib" && dir="."
2831 # We need an absolute path.
2833 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2835 absdir=`cd "$dir" && pwd`
2836 if test -z "$absdir"; then
2837 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2842 if grep "^installed=no" $deplib > /dev/null; then
2843 path="$absdir/$objdir"
2845 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2846 if test -z "$libdir"; then
2847 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2850 if test "$absdir" != "$libdir"; then
2851 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2858 # we do not want to link against static libs,
2859 # but need to link against shared
2860 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2861 if test -n "$deplibrary_names" ; then
2862 for tmp in $deplibrary_names ; do
2865 if test -f "$path/$depdepl" ; then
2866 depdepl="$path/$depdepl"
2868 # do not add paths which are already there
2869 case " $newlib_search_path " in
2871 *) newlib_search_path="$newlib_search_path $path";;
2884 # Again, we only want to link against shared libraries
2885 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2886 for tmp in $newlib_search_path ; do
2887 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2888 eval depdepl="$tmp/lib$tmp_libs.dylib"
2899 case " $deplibs " in
2901 *) deplibs="$path $deplibs" ;;
2903 case " $deplibs " in
2905 *) deplibs="$depdepl $deplibs" ;;
2908 fi # link_all_deplibs != no
2910 done # for deplib in $libs
2911 dependency_libs="$newdependency_libs"
2912 if test "$pass" = dlpreopen; then
2913 # Link the dlpreopened libraries before other libraries
2914 for deplib in $save_deplibs; do
2915 deplibs="$deplib $deplibs"
2918 if test "$pass" != dlopen; then
2919 if test "$pass" != conv; then
2920 # Make sure lib_search_path contains only unique directories.
2922 for dir in $newlib_search_path; do
2923 case "$lib_search_path " in
2925 *) lib_search_path="$lib_search_path $dir" ;;
2931 if test "$linkmode,$pass" != "prog,link"; then
2934 vars="compile_deplibs finalize_deplibs"
2936 for var in $vars dependency_libs; do
2937 # Add libraries to $var in reverse order
2938 eval tmp_libs=\"\$$var\"
2940 for deplib in $tmp_libs; do
2941 # FIXME: Pedantically, this is the right thing to do, so
2942 # that some nasty dependency loop isn't accidentally
2944 #new_libs="$deplib $new_libs"
2945 # Pragmatically, this seems to cause very few problems in
2948 -L*) new_libs="$deplib $new_libs" ;;
2951 # And here is the reason: when a library appears more
2952 # than once as an explicit dependence of a library, or
2953 # is implicitly linked in more than once by the
2954 # compiler, it is considered special, and multiple
2955 # occurrences thereof are not removed. Compare this
2956 # with having the same library being listed as a
2957 # dependency of multiple other libraries: in this case,
2958 # we know (pedantically, we assume) the library does not
2959 # need to be listed more than once, so we keep only the
2960 # last copy. This is not always right, but it is rare
2961 # enough that we require users that really mean to play
2962 # such unportable linking tricks to link the library
2963 # using -Wl,-lname, so that libtool does not consider it
2964 # for duplicate removal.
2965 case " $specialdeplibs " in
2966 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2968 case " $new_libs " in
2970 *) new_libs="$deplib $new_libs" ;;
2978 for deplib in $new_libs; do
2981 case " $tmp_libs " in
2983 *) tmp_libs="$tmp_libs $deplib" ;;
2986 *) tmp_libs="$tmp_libs $deplib" ;;
2989 eval $var=\"$tmp_libs\"
2992 # Last step: remove runtime libs from dependency_libs
2993 # (they stay in deplibs)
2995 for i in $dependency_libs ; do
2996 case " $predeps $postdeps $compiler_lib_search_path " in
3001 if test -n "$i" ; then
3002 tmp_libs="$tmp_libs $i"
3005 dependency_libs=$tmp_libs
3007 if test "$linkmode" = prog; then
3008 dlfiles="$newdlfiles"
3009 dlprefiles="$newdlprefiles"
3014 if test -n "$deplibs"; then
3015 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3018 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3019 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3022 if test -n "$rpath"; then
3023 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3026 if test -n "$xrpath"; then
3027 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3030 if test -n "$vinfo"; then
3031 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3034 if test -n "$release"; then
3035 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3038 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3039 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3042 # Now set the variables for building old libraries.
3043 build_libtool_libs=no
3045 objs="$objs$old_deplibs"
3049 # Make sure we only generate libraries of the form `libNAME.la'.
3052 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3053 eval shared_ext=\"$shrext_cmds\"
3054 eval libname=\"$libname_spec\"
3057 if test "$module" = no; then
3058 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3062 if test "$need_lib_prefix" != no; then
3063 # Add the "lib" prefix for modules if required
3064 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3065 eval shared_ext=\"$shrext_cmds\"
3066 eval libname=\"$libname_spec\"
3068 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3073 if test -n "$objs"; then
3074 if test "$deplibs_check_method" != pass_all; then
3075 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3079 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3080 $echo "*** objects $objs is not portable!"
3081 libobjs="$libobjs $objs"
3085 if test "$dlself" != no; then
3086 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3090 if test "$#" -gt 2; then
3091 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3096 if test -z "$rpath"; then
3097 if test "$build_libtool_libs" = yes; then
3098 # Building a libtool convenience library.
3099 # Some compilers have problems with a `.al' extension so
3100 # convenience libraries should have the same extension an
3101 # archive normally would.
3102 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3103 build_libtool_libs=convenience
3107 if test -n "$vinfo"; then
3108 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3111 if test -n "$release"; then
3112 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3116 # Parse the version information argument.
3117 save_ifs="$IFS"; IFS=':'
3118 set dummy $vinfo 0 0 0
3121 if test -n "$8"; then
3122 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3127 # convert absolute version numbers to libtool ages
3128 # this retains compatibility with .la files and attempts
3129 # to make the code below a bit more comprehensible
3131 case $vinfo_number in
3135 number_revision="$4"
3137 # There are really only two kinds -- those that
3138 # use the current revision as the major version
3139 # and those that subtract age and use age as
3140 # a minor version. But, then there is irix
3141 # which has an extra 1 added just for fun
3143 case $version_type in
3144 darwin|linux|osf|windows)
3145 current=`expr $number_major + $number_minor`
3147 revision="$number_revision"
3149 freebsd-aout|freebsd-elf|sunos)
3150 current="$number_major"
3151 revision="$number_minor"
3155 current=`expr $number_major + $number_minor - 1`
3157 revision="$number_minor"
3168 # Check that each of the things are valid numbers.
3170 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3172 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3173 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3179 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3181 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3182 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3188 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3190 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3191 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3196 if test "$age" -gt "$current"; then
3197 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3198 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3202 # Calculate the version variables.
3206 case $version_type in
3210 # Like Linux, but with the current version available in
3211 # verstring for coding it into the library header
3212 major=.`expr $current - $age`
3213 versuffix="$major.$age.$revision"
3214 # Darwin ld doesn't like 0 for these options...
3215 minor_current=`expr $current + 1`
3216 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3221 versuffix=".$current.$revision";
3226 versuffix=".$current";
3230 major=`expr $current - $age + 1`
3232 case $version_type in
3233 nonstopux) verstring_prefix=nonstopux ;;
3234 *) verstring_prefix=sgi ;;
3236 verstring="$verstring_prefix$major.$revision"
3238 # Add in all the interfaces that we are compatible with.
3240 while test "$loop" -ne 0; do
3241 iface=`expr $revision - $loop`
3242 loop=`expr $loop - 1`
3243 verstring="$verstring_prefix$major.$iface:$verstring"
3246 # Before this point, $major must not contain `.'.
3248 versuffix="$major.$revision"
3252 major=.`expr $current - $age`
3253 versuffix="$major.$age.$revision"
3257 major=.`expr $current - $age`
3258 versuffix=".$current.$age.$revision"
3259 verstring="$current.$age.$revision"
3261 # Add in all the interfaces that we are compatible with.
3263 while test "$loop" -ne 0; do
3264 iface=`expr $current - $loop`
3265 loop=`expr $loop - 1`
3266 verstring="$verstring:${iface}.0"
3269 # Make executables depend on our current version.
3270 verstring="$verstring:${current}.0"
3275 versuffix=".$current.$revision"
3279 # Use '-' rather than '.', since we only want one
3280 # extension on DOS 8.3 filesystems.
3281 major=`expr $current - $age`
3286 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3287 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3292 # Clear the version info if we defaulted, and they specified a release.
3293 if test -z "$vinfo" && test -n "$release"; then
3295 case $version_type in
3297 # we can't check for "0.0" in archive_cmds due to quoting
3298 # problems, so we reset it completely
3305 if test "$need_version" = no; then
3312 # Remove version info from name if versioning should be avoided
3313 if test "$avoid_version" = yes && test "$need_version" = no; then
3319 # Check to see if the archive will have undefined symbols.
3320 if test "$allow_undefined" = yes; then
3321 if test "$allow_undefined_flag" = unsupported; then
3322 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3323 build_libtool_libs=no
3327 # Don't allow undefined symbols.
3328 allow_undefined_flag="$no_undefined_flag"
3332 if test "$mode" != relink; then
3333 # Remove our outputs, but don't remove object files since they
3334 # may have been created when compiling PIC objects.
3336 tempremovelist=`$echo "$output_objdir/*"`
3337 for p in $tempremovelist; do
3341 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3342 if test "X$precious_files_regex" != "X"; then
3343 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3348 removelist="$removelist $p"
3353 if test -n "$removelist"; then
3354 $show "${rm}r $removelist"
3355 $run ${rm}r $removelist
3359 # Now set the variables for building old libraries.
3360 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3361 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3363 # Transform .lo files to .o files.
3364 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3367 # Eliminate all temporary directories.
3368 for path in $notinst_path; do
3369 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3370 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3371 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3374 if test -n "$xrpath"; then
3375 # If the user specified any rpath flags, then add them.
3377 for libdir in $xrpath; do
3378 temp_xrpath="$temp_xrpath -R$libdir"
3379 case "$finalize_rpath " in
3381 *) finalize_rpath="$finalize_rpath $libdir" ;;
3384 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3385 dependency_libs="$temp_xrpath $dependency_libs"
3389 # Make sure dlfiles contains only unique files that won't be dlpreopened
3390 old_dlfiles="$dlfiles"
3392 for lib in $old_dlfiles; do
3393 case " $dlprefiles $dlfiles " in
3395 *) dlfiles="$dlfiles $lib" ;;
3399 # Make sure dlprefiles contains only unique files
3400 old_dlprefiles="$dlprefiles"
3402 for lib in $old_dlprefiles; do
3403 case "$dlprefiles " in
3405 *) dlprefiles="$dlprefiles $lib" ;;
3409 if test "$build_libtool_libs" = yes; then
3410 if test -n "$rpath"; then
3412 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3413 # these systems don't actually have a c library (as such)!
3415 *-*-rhapsody* | *-*-darwin1.[012])
3416 # Rhapsody C library is in the System framework
3417 deplibs="$deplibs -framework System"
3420 # Don't link with libc until the a.out ld.so is fixed.
3422 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3423 # Do not include libc due to us having libc/libc_r.
3424 test "X$arg" = "X-lc" && continue
3427 # Add libc to deplibs on all other systems if necessary.
3428 if test "$build_libtool_need_lc" = "yes"; then
3429 deplibs="$deplibs -lc"
3435 # Transform deplibs into only deplibs that can be linked in shared.
3437 libname_save=$libname
3438 release_save=$release
3439 versuffix_save=$versuffix
3441 # I'm not sure if I'm treating the release correctly. I think
3442 # release should show up in the -l (ie -lgmp5) so we don't want to
3443 # add it in twice. Is that correct?
3449 case $deplibs_check_method in
3451 # Don't check for shared/static. Everything works.
3452 # This might be a little naive. We might want to check
3453 # whether the library exists or not. But this is on
3454 # osf3 & osf4 and I'm not really sure... Just
3455 # implementing what was already the behavior.
3459 # This code stresses the "libraries are programs" paradigm to its
3460 # limits. Maybe even breaks it. We compile a program, linking it
3461 # against the deplibs as a proxy for the library. Then we can check
3462 # whether they linked in statically or dynamically with ldd.
3464 cat > conftest.c <<EOF
3465 int main() { return 0; }
3468 $LTCC -o conftest conftest.c $deplibs
3469 if test "$?" -eq 0 ; then
3470 ldd_output=`ldd conftest`
3471 for i in $deplibs; do
3472 name="`expr $i : '-l\(.*\)'`"
3473 # If $name is empty we are operating on a -L argument.
3474 if test "$name" != "" && test "$name" -ne "0"; then
3475 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3476 case " $predeps $postdeps " in
3478 newdeplibs="$newdeplibs $i"
3483 if test -n "$i" ; then
3484 libname=`eval \\$echo \"$libname_spec\"`
3485 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3486 set dummy $deplib_matches
3488 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3489 newdeplibs="$newdeplibs $i"
3493 $echo "*** Warning: dynamic linker does not accept needed library $i."
3494 $echo "*** I have the capability to make that library automatically link in when"
3495 $echo "*** you link to this library. But I can only do this if you have a"
3496 $echo "*** shared version of the library, which I believe you do not have"
3497 $echo "*** because a test_compile did reveal that the linker did not use it for"
3498 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3502 newdeplibs="$newdeplibs $i"
3506 # Error occurred in the first compile. Let's try to salvage
3507 # the situation: Compile a separate program for each library.
3508 for i in $deplibs; do
3509 name="`expr $i : '-l\(.*\)'`"
3510 # If $name is empty we are operating on a -L argument.
3511 if test "$name" != "" && test "$name" != "0"; then
3513 $LTCC -o conftest conftest.c $i
3515 if test "$?" -eq 0 ; then
3516 ldd_output=`ldd conftest`
3517 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3518 case " $predeps $postdeps " in
3520 newdeplibs="$newdeplibs $i"
3525 if test -n "$i" ; then
3526 libname=`eval \\$echo \"$libname_spec\"`
3527 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3528 set dummy $deplib_matches
3530 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3531 newdeplibs="$newdeplibs $i"
3535 $echo "*** Warning: dynamic linker does not accept needed library $i."
3536 $echo "*** I have the capability to make that library automatically link in when"
3537 $echo "*** you link to this library. But I can only do this if you have a"
3538 $echo "*** shared version of the library, which you do not appear to have"
3539 $echo "*** because a test_compile did reveal that the linker did not use this one"
3540 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3546 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3547 $echo "*** make it link in! You will probably need to install it or some"
3548 $echo "*** library that it depends on before this library will be fully"
3549 $echo "*** functional. Installing it before continuing would be even better."
3552 newdeplibs="$newdeplibs $i"
3558 set dummy $deplibs_check_method
3559 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3560 for a_deplib in $deplibs; do
3561 name="`expr $a_deplib : '-l\(.*\)'`"
3562 # If $name is empty we are operating on a -L argument.
3563 if test "$name" != "" && test "$name" != "0"; then
3564 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3565 case " $predeps $postdeps " in
3567 newdeplibs="$newdeplibs $a_deplib"
3572 if test -n "$a_deplib" ; then
3573 libname=`eval \\$echo \"$libname_spec\"`
3574 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3575 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3576 for potent_lib in $potential_libs; do
3577 # Follow soft links.
3578 if ls -lLd "$potent_lib" 2>/dev/null \
3579 | grep " -> " >/dev/null; then
3582 # The statement above tries to avoid entering an
3583 # endless loop below, in case of cyclic links.
3584 # We might still enter an endless loop, since a link
3585 # loop can be closed while we follow links,
3587 potlib="$potent_lib"
3588 while test -h "$potlib" 2>/dev/null; do
3589 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3591 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3592 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3595 # It is ok to link against an archive when
3596 # building a shared library.
3597 if $AR -t $potlib > /dev/null 2>&1; then
3598 newdeplibs="$newdeplibs $a_deplib"
3602 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3604 | $EGREP "$file_magic_regex" > /dev/null; then
3605 newdeplibs="$newdeplibs $a_deplib"
3612 if test -n "$a_deplib" ; then
3615 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3616 $echo "*** I have the capability to make that library automatically link in when"
3617 $echo "*** you link to this library. But I can only do this if you have a"
3618 $echo "*** shared version of the library, which you do not appear to have"
3619 $echo "*** because I did check the linker path looking for a file starting"
3620 if test -z "$potlib" ; then
3621 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3623 $echo "*** with $libname and none of the candidates passed a file format test"
3624 $echo "*** using a file magic. Last file checked: $potlib"
3628 # Add a -L argument.
3629 newdeplibs="$newdeplibs $a_deplib"
3631 done # Gone through all deplibs.
3634 set dummy $deplibs_check_method
3635 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3636 for a_deplib in $deplibs; do
3637 name="`expr $a_deplib : '-l\(.*\)'`"
3638 # If $name is empty we are operating on a -L argument.
3639 if test -n "$name" && test "$name" != "0"; then
3640 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3641 case " $predeps $postdeps " in
3643 newdeplibs="$newdeplibs $a_deplib"
3648 if test -n "$a_deplib" ; then
3649 libname=`eval \\$echo \"$libname_spec\"`
3650 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3651 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3652 for potent_lib in $potential_libs; do
3653 potlib="$potent_lib" # see symlink-check above in file_magic test
3654 if eval $echo \"$potent_lib\" 2>/dev/null \
3656 | $EGREP "$match_pattern_regex" > /dev/null; then
3657 newdeplibs="$newdeplibs $a_deplib"
3664 if test -n "$a_deplib" ; then
3667 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3668 $echo "*** I have the capability to make that library automatically link in when"
3669 $echo "*** you link to this library. But I can only do this if you have a"
3670 $echo "*** shared version of the library, which you do not appear to have"
3671 $echo "*** because I did check the linker path looking for a file starting"
3672 if test -z "$potlib" ; then
3673 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3675 $echo "*** with $libname and none of the candidates passed a file format test"
3676 $echo "*** using a regex pattern. Last file checked: $potlib"
3680 # Add a -L argument.
3681 newdeplibs="$newdeplibs $a_deplib"
3683 done # Gone through all deplibs.
3687 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3688 -e 's/ -[LR][^ ]*//g'`
3689 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3690 for i in $predeps $postdeps ; do
3691 # can't use Xsed below, because $i might contain '/'
3692 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3695 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3696 | grep . >/dev/null; then
3698 if test "X$deplibs_check_method" = "Xnone"; then
3699 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3701 $echo "*** Warning: inter-library dependencies are not known to be supported."
3703 $echo "*** All declared inter-library dependencies are being dropped."
3708 versuffix=$versuffix_save
3710 release=$release_save
3711 libname=$libname_save
3715 *-*-rhapsody* | *-*-darwin1.[012])
3716 # On Rhapsody replace the C library is the System framework
3717 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3721 if test "$droppeddeps" = yes; then
3722 if test "$module" = yes; then
3724 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3725 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3726 $echo "*** a static module, that should work as long as the dlopening"
3727 $echo "*** application is linked with the -dlopen flag."
3728 if test -z "$global_symbol_pipe"; then
3730 $echo "*** However, this would only work if libtool was able to extract symbol"
3731 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3732 $echo "*** not find such a program. So, this module is probably useless."
3733 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3735 if test "$build_old_libs" = no; then
3736 oldlibs="$output_objdir/$libname.$libext"
3737 build_libtool_libs=module
3740 build_libtool_libs=no
3743 $echo "*** The inter-library dependencies that have been dropped here will be"
3744 $echo "*** automatically added whenever a program is linked with this library"
3745 $echo "*** or is declared to -dlopen it."
3747 if test "$allow_undefined" = no; then
3749 $echo "*** Since this library must not contain undefined symbols,"
3750 $echo "*** because either the platform does not support them or"
3751 $echo "*** it was explicitly requested with -no-undefined,"
3752 $echo "*** libtool will only create a static version of it."
3753 if test "$build_old_libs" = no; then
3754 oldlibs="$output_objdir/$libname.$libext"
3755 build_libtool_libs=module
3758 build_libtool_libs=no
3763 # Done checking deplibs!
3767 # All the library-specific variables (install_libdir is set above).
3772 # Test again, we may have decided not to build it any more
3773 if test "$build_libtool_libs" = yes; then
3774 if test "$hardcode_into_libs" = yes; then
3775 # Hardcode the library paths
3778 rpath="$finalize_rpath"
3779 test "$mode" != relink && rpath="$compile_rpath$rpath"
3780 for libdir in $rpath; do
3781 if test -n "$hardcode_libdir_flag_spec"; then
3782 if test -n "$hardcode_libdir_separator"; then
3783 if test -z "$hardcode_libdirs"; then
3784 hardcode_libdirs="$libdir"
3786 # Just accumulate the unique libdirs.
3787 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3788 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3791 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3796 eval flag=\"$hardcode_libdir_flag_spec\"
3797 dep_rpath="$dep_rpath $flag"
3799 elif test -n "$runpath_var"; then
3800 case "$perm_rpath " in
3802 *) perm_rpath="$perm_rpath $libdir" ;;
3806 # Substitute the hardcoded libdirs into the rpath.
3807 if test -n "$hardcode_libdir_separator" &&
3808 test -n "$hardcode_libdirs"; then
3809 libdir="$hardcode_libdirs"
3810 if test -n "$hardcode_libdir_flag_spec_ld"; then
3811 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3813 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3816 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3817 # We should set the runpath_var.
3819 for dir in $perm_rpath; do
3822 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3824 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3827 shlibpath="$finalize_shlibpath"
3828 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3829 if test -n "$shlibpath"; then
3830 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3833 # Get the real and link names of the library.
3834 eval shared_ext=\"$shrext_cmds\"
3835 eval library_names=\"$library_names_spec\"
3836 set dummy $library_names
3840 if test -n "$soname_spec"; then
3841 eval soname=\"$soname_spec\"
3845 if test -z "$dlname"; then
3849 lib="$output_objdir/$realname"
3852 linknames="$linknames $link"
3855 # Use standard objects if they are pic
3856 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3858 # Prepare the list of exported symbols
3859 if test -z "$export_symbols"; then
3860 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3861 $show "generating symbol list for \`$libname.la'"
3862 export_symbols="$output_objdir/$libname.exp"
3863 $run $rm $export_symbols
3864 cmds=$export_symbols_cmds
3865 save_ifs="$IFS"; IFS='~'
3866 for cmd in $cmds; do
3869 if len=`expr "X$cmd" : ".*"` &&
3870 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3872 $run eval "$cmd" || exit $?
3873 skipped_export=false
3875 # The command line is too long to execute in one step.
3876 $show "using reloadable object file for export list..."
3881 if test -n "$export_symbols_regex"; then
3882 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3883 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3884 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3885 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3890 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3891 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3895 for test_deplib in $deplibs; do
3896 case " $convenience " in
3897 *" $test_deplib "*) ;;
3899 tmp_deplibs="$tmp_deplibs $test_deplib"
3903 deplibs="$tmp_deplibs"
3905 if test -n "$convenience"; then
3906 if test -n "$whole_archive_flag_spec"; then
3907 save_libobjs=$libobjs
3908 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3910 gentop="$output_objdir/${outputname}x"
3911 generated="$generated $gentop"
3913 func_extract_archives $gentop $convenience
3914 libobjs="$libobjs $func_extract_archives_result"
3918 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3919 eval flag=\"$thread_safe_flag_spec\"
3920 linker_flags="$linker_flags $flag"
3923 # Make a backup of the uninstalled library when relinking
3924 if test "$mode" = relink; then
3925 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3928 # Do each of the archive commands.
3929 if test "$module" = yes && test -n "$module_cmds" ; then
3930 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3931 eval test_cmds=\"$module_expsym_cmds\"
3932 cmds=$module_expsym_cmds
3934 eval test_cmds=\"$module_cmds\"
3938 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3939 eval test_cmds=\"$archive_expsym_cmds\"
3940 cmds=$archive_expsym_cmds
3942 eval test_cmds=\"$archive_cmds\"
3947 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3948 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3951 # The command line is too long to link in one step, link piecewise.
3952 $echo "creating reloadable object files..."
3954 # Save the value of $output and $libobjs because we want to
3955 # use them later. If we have whole_archive_flag_spec, we
3956 # want to use save_libobjs as it was before
3957 # whole_archive_flag_spec was expanded, because we can't
3958 # assume the linker understands whole_archive_flag_spec.
3959 # This may have to be revisited, in case too many
3960 # convenience libraries get linked in and end up exceeding
3962 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3963 save_libobjs=$libobjs
3966 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3968 # Clear the reloadable object creation command queue and
3969 # initialize k to one.
3976 output=$output_objdir/$output_la-${k}.$objext
3977 # Loop over the list of objects to be linked.
3978 for obj in $save_libobjs
3980 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3981 if test "X$objlist" = X ||
3982 { len=`expr "X$test_cmds" : ".*"` &&
3983 test "$len" -le "$max_cmd_len"; }; then
3984 objlist="$objlist $obj"
3986 # The command $test_cmds is almost too long, add a
3987 # command to the queue.
3988 if test "$k" -eq 1 ; then
3989 # The first file doesn't have a previous command to add.
3990 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3992 # All subsequent reloadable object files will link in
3993 # the last one created.
3994 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3996 last_robj=$output_objdir/$output_la-${k}.$objext
3998 output=$output_objdir/$output_la-${k}.$objext
4003 # Handle the remaining objects by creating one last
4004 # reloadable object file. All subsequent reloadable object
4005 # files will link in the last one created.
4006 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4007 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4009 if ${skipped_export-false}; then
4010 $show "generating symbol list for \`$libname.la'"
4011 export_symbols="$output_objdir/$libname.exp"
4012 $run $rm $export_symbols
4014 # Append the command to create the export file.
4015 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4018 # Set up a command to remove the reloadable object files
4019 # after they are used.
4021 while test "$i" -lt "$k"
4024 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4027 $echo "creating a temporary reloadable object file: $output"
4029 # Loop through the commands generated above and execute them.
4030 save_ifs="$IFS"; IFS='~'
4031 for cmd in $concat_cmds; do
4034 $run eval "$cmd" || exit $?
4039 # Restore the value of output.
4042 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4043 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4045 # Expand the library linking commands again to reset the
4046 # value of $libobjs for piecewise linking.
4048 # Do each of the archive commands.
4049 if test "$module" = yes && test -n "$module_cmds" ; then
4050 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4051 cmds=$module_expsym_cmds
4056 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4057 cmds=$archive_expsym_cmds
4063 # Append the command to remove the reloadable object files
4064 # to the just-reset $cmds.
4065 eval cmds=\"\$cmds~\$rm $delfiles\"
4067 save_ifs="$IFS"; IFS='~'
4068 for cmd in $cmds; do
4072 $run eval "$cmd" || exit $?
4076 # Restore the uninstalled library and exit
4077 if test "$mode" = relink; then
4078 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4082 # Create links to the real library.
4083 for linkname in $linknames; do
4084 if test "$realname" != "$linkname"; then
4085 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4086 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4090 # If -module or -export-dynamic was specified, set the dlname.
4091 if test "$module" = yes || test "$export_dynamic" = yes; then
4092 # On all known operating systems, these are identical.
4099 if test -n "$deplibs"; then
4100 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4103 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4104 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4107 if test -n "$rpath"; then
4108 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4111 if test -n "$xrpath"; then
4112 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4115 if test -n "$vinfo"; then
4116 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4119 if test -n "$release"; then
4120 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4125 if test -n "$objs$old_deplibs"; then
4126 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4130 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4138 # Delete the old objects.
4139 $run $rm $obj $libobj
4141 # Objects from convenience libraries. This assumes
4142 # single-version convenience libraries. Whenever we create
4143 # different ones for PIC/non-PIC, this we'll have to duplicate
4147 # reload_cmds runs $LD directly, so let us get rid of
4148 # -Wl from whole_archive_flag_spec
4151 if test -n "$convenience"; then
4152 if test -n "$whole_archive_flag_spec"; then
4153 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4155 gentop="$output_objdir/${obj}x"
4156 generated="$generated $gentop"
4158 func_extract_archives $gentop $convenience
4159 reload_conv_objs="$reload_objs $func_extract_archives_result"
4163 # Create the old-style object.
4164 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
4168 save_ifs="$IFS"; IFS='~'
4169 for cmd in $cmds; do
4173 $run eval "$cmd" || exit $?
4177 # Exit if we aren't doing a library object file.
4178 if test -z "$libobj"; then
4179 if test -n "$gentop"; then
4180 $show "${rm}r $gentop"
4187 if test "$build_libtool_libs" != yes; then
4188 if test -n "$gentop"; then
4189 $show "${rm}r $gentop"
4193 # Create an invalid libtool object if no PIC, so that we don't
4194 # accidentally link it into a program.
4195 # $show "echo timestamp > $libobj"
4196 # $run eval "echo timestamp > $libobj" || exit $?
4200 if test -n "$pic_flag" || test "$pic_mode" != default; then
4201 # Only do commands if we really have different PIC objects.
4202 reload_objs="$libobjs $reload_conv_objs"
4205 save_ifs="$IFS"; IFS='~'
4206 for cmd in $cmds; do
4210 $run eval "$cmd" || exit $?
4215 if test -n "$gentop"; then
4216 $show "${rm}r $gentop"
4225 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4227 if test -n "$vinfo"; then
4228 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4231 if test -n "$release"; then
4232 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4235 if test "$preload" = yes; then
4236 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4237 test "$dlopen_self_static" = unknown; then
4238 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4243 *-*-rhapsody* | *-*-darwin1.[012])
4244 # On Rhapsody replace the C library is the System framework
4245 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4246 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4252 # Don't allow lazy linking, it breaks C++ global constructors
4253 if test "$tagname" = CXX ; then
4254 compile_command="$compile_command ${wl}-bind_at_load"
4255 finalize_command="$finalize_command ${wl}-bind_at_load"
4260 compile_command="$compile_command $compile_deplibs"
4261 finalize_command="$finalize_command $finalize_deplibs"
4263 if test -n "$rpath$xrpath"; then
4264 # If the user specified any rpath flags, then add them.
4265 for libdir in $rpath $xrpath; do
4266 # This is the magic to use -rpath.
4267 case "$finalize_rpath " in
4269 *) finalize_rpath="$finalize_rpath $libdir" ;;
4274 # Now hardcode the library paths
4277 for libdir in $compile_rpath $finalize_rpath; do
4278 if test -n "$hardcode_libdir_flag_spec"; then
4279 if test -n "$hardcode_libdir_separator"; then
4280 if test -z "$hardcode_libdirs"; then
4281 hardcode_libdirs="$libdir"
4283 # Just accumulate the unique libdirs.
4284 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4285 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4288 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4293 eval flag=\"$hardcode_libdir_flag_spec\"
4294 rpath="$rpath $flag"
4296 elif test -n "$runpath_var"; then
4297 case "$perm_rpath " in
4299 *) perm_rpath="$perm_rpath $libdir" ;;
4303 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4304 case :$dllsearchpath: in
4306 *) dllsearchpath="$dllsearchpath:$libdir";;
4311 # Substitute the hardcoded libdirs into the rpath.
4312 if test -n "$hardcode_libdir_separator" &&
4313 test -n "$hardcode_libdirs"; then
4314 libdir="$hardcode_libdirs"
4315 eval rpath=\" $hardcode_libdir_flag_spec\"
4317 compile_rpath="$rpath"
4321 for libdir in $finalize_rpath; do
4322 if test -n "$hardcode_libdir_flag_spec"; then
4323 if test -n "$hardcode_libdir_separator"; then
4324 if test -z "$hardcode_libdirs"; then
4325 hardcode_libdirs="$libdir"
4327 # Just accumulate the unique libdirs.
4328 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4329 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4332 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4337 eval flag=\"$hardcode_libdir_flag_spec\"
4338 rpath="$rpath $flag"
4340 elif test -n "$runpath_var"; then
4341 case "$finalize_perm_rpath " in
4343 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4347 # Substitute the hardcoded libdirs into the rpath.
4348 if test -n "$hardcode_libdir_separator" &&
4349 test -n "$hardcode_libdirs"; then
4350 libdir="$hardcode_libdirs"
4351 eval rpath=\" $hardcode_libdir_flag_spec\"
4353 finalize_rpath="$rpath"
4355 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4356 # Transform all the library objects into standard objects.
4357 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4358 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4362 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4363 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4364 dlsyms="${outputname}S.c"
4366 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4370 if test -n "$dlsyms"; then
4374 # Discover the nlist of each of the dlfiles.
4375 nlist="$output_objdir/${outputname}.nm"
4377 $show "$rm $nlist ${nlist}S ${nlist}T"
4378 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4380 # Parse the name list into a source file.
4381 $show "creating $output_objdir/$dlsyms"
4383 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4384 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4385 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4391 /* Prevent the only kind of declaration conflicts we can make. */
4392 #define lt_preloaded_symbols some_other_symbol
4394 /* External symbol declarations for the compiler. */\
4397 if test "$dlself" = yes; then
4398 $show "generating symbol list for \`$output'"
4400 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4402 # Add our own program objects to the symbol list.
4403 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4404 for arg in $progfiles; do
4405 $show "extracting global C symbols from \`$arg'"
4406 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4409 if test -n "$exclude_expsyms"; then
4410 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4411 $run eval '$mv "$nlist"T "$nlist"'
4414 if test -n "$export_symbols_regex"; then
4415 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4416 $run eval '$mv "$nlist"T "$nlist"'
4419 # Prepare the list of exported symbols
4420 if test -z "$export_symbols"; then
4421 export_symbols="$output_objdir/$outputname.exp"
4422 $run $rm $export_symbols
4423 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4425 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4426 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4427 $run eval 'mv "$nlist"T "$nlist"'
4431 for arg in $dlprefiles; do
4432 $show "extracting global C symbols from \`$arg'"
4433 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4434 $run eval '$echo ": $name " >> "$nlist"'
4435 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4438 if test -z "$run"; then
4439 # Make sure we have at least an empty file.
4440 test -f "$nlist" || : > "$nlist"
4442 if test -n "$exclude_expsyms"; then
4443 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4444 $mv "$nlist"T "$nlist"
4447 # Try sorting and uniquifying the output.
4448 if grep -v "^: " < "$nlist" |
4449 if sort -k 3 </dev/null >/dev/null 2>&1; then
4454 uniq > "$nlist"S; then
4457 grep -v "^: " < "$nlist" > "$nlist"S
4460 if test -f "$nlist"S; then
4461 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4463 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4466 $echo >> "$output_objdir/$dlsyms" "\
4468 #undef lt_preloaded_symbols
4470 #if defined (__STDC__) && __STDC__
4471 # define lt_ptr void *
4473 # define lt_ptr char *
4477 /* The mapping between symbol names and symbols. */
4481 *cygwin* | *mingw* )
4482 $echo >> "$output_objdir/$dlsyms" "\
4483 /* DATA imports from DLLs on WIN32 can't be const, because
4484 runtime relocations are performed -- see ld's documentation
4490 $echo >> "$output_objdir/$dlsyms" "\
4497 $echo >> "$output_objdir/$dlsyms" "\
4501 lt_preloaded_symbols[] =
4505 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4507 $echo >> "$output_objdir/$dlsyms" "\
4511 /* This works around a problem in FreeBSD linker */
4512 #ifdef FREEBSD_WORKAROUND
4513 static const void *lt_preloaded_setup() {
4514 return lt_preloaded_symbols;
4524 pic_flag_for_symtable=
4526 # compiling the symbol table file with pic_flag works around
4527 # a FreeBSD bug that causes programs to crash when -lm is
4528 # linked before any other PIC object. But we must not use
4529 # pic_flag when linking with -static. The problem exists in
4530 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4531 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4532 case "$compile_command " in
4534 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4537 case "$compile_command " in
4539 *) pic_flag_for_symtable=" $pic_flag";;
4543 # Now compile the dynamic symbol file.
4544 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4545 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4547 # Clean up the generated files.
4548 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4549 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4551 # Transform the symbol file into the correct name.
4552 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4553 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4556 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4561 # We keep going just in case the user didn't refer to
4562 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4563 # really was required.
4565 # Nullify the symbol file.
4566 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4567 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4570 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4571 # Replace the output file specification.
4572 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4573 link_command="$compile_command$compile_rpath"
4575 # We have no uninstalled library dependencies, so finalize right now.
4576 $show "$link_command"
4577 $run eval "$link_command"
4580 # Delete the generated files.
4581 if test -n "$dlsyms"; then
4582 $show "$rm $output_objdir/${outputname}S.${objext}"
4583 $run $rm "$output_objdir/${outputname}S.${objext}"
4589 if test -n "$shlibpath_var"; then
4590 # We should set the shlibpath_var
4592 for dir in $temp_rpath; do
4594 [\\/]* | [A-Za-z]:[\\/]*)
4599 # Relative path: add a thisdir entry.
4600 rpath="$rpath\$thisdir/$dir:"
4607 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4608 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4610 if test -n "$finalize_shlibpath"; then
4611 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4616 if test -n "$runpath_var"; then
4617 if test -n "$perm_rpath"; then
4618 # We should set the runpath_var.
4620 for dir in $perm_rpath; do
4623 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4625 if test -n "$finalize_perm_rpath"; then
4626 # We should set the runpath_var.
4628 for dir in $finalize_perm_rpath; do
4631 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4635 if test "$no_install" = yes; then
4636 # We don't need to create a wrapper script.
4637 link_command="$compile_var$compile_command$compile_rpath"
4638 # Replace the output file specification.
4639 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4640 # Delete the old output file.
4642 # Link the executable and exit
4643 $show "$link_command"
4644 $run eval "$link_command" || exit $?
4648 if test "$hardcode_action" = relink; then
4649 # Fast installation is not supported
4650 link_command="$compile_var$compile_command$compile_rpath"
4651 relink_command="$finalize_var$finalize_command$finalize_rpath"
4653 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4654 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4656 if test "$fast_install" != no; then
4657 link_command="$finalize_var$compile_command$finalize_rpath"
4658 if test "$fast_install" = yes; then
4659 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4661 # fast_install is set to needless
4665 link_command="$compile_var$compile_command$compile_rpath"
4666 relink_command="$finalize_var$finalize_command$finalize_rpath"
4670 # Replace the output file specification.
4671 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4673 # Delete the old output files.
4674 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4676 $show "$link_command"
4677 $run eval "$link_command" || exit $?
4679 # Now create the wrapper script.
4680 $show "creating $output"
4682 # Quote the relink command for shipping.
4683 if test -n "$relink_command"; then
4684 # Preserve any variables that may affect compiler behavior
4685 for var in $variables_saved_for_relink; do
4686 if eval test -z \"\${$var+set}\"; then
4687 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4688 elif eval var_value=\$$var; test -z "$var_value"; then
4689 relink_command="$var=; export $var; $relink_command"
4691 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4692 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4695 relink_command="(cd `pwd`; $relink_command)"
4696 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4699 # Quote $echo for shipping.
4700 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4702 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4703 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4705 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4707 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4710 # Only actually do things if our run command is non-null.
4711 if test -z "$run"; then
4712 # win32 will think the script is a binary if it has
4713 # a .exe suffix, so we strip it off here.
4715 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4717 # test for cygwin because mv fails w/o .exe extensions
4721 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4725 *cygwin* | *mingw* )
4726 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4727 cwrapper=`$echo ${output}.exe`
4728 $rm $cwrappersource $cwrapper
4729 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4731 cat > $cwrappersource <<EOF
4733 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4734 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4736 The $output program cannot be directly executed until all the libtool
4737 libraries that it depends on are installed.
4739 This wrapper executable should never be moved out of the build directory.
4740 If it is, it will not operate correctly.
4742 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4743 but could eventually absorb all of the scripts functionality and
4744 exec $objdir/$outputname directly.
4747 cat >> $cwrappersource<<"EOF"
4755 #if defined(PATH_MAX)
4756 # define LT_PATHMAX PATH_MAX
4757 #elif defined(MAXPATHLEN)
4758 # define LT_PATHMAX MAXPATHLEN
4760 # define LT_PATHMAX 1024
4763 #ifndef DIR_SEPARATOR
4764 #define DIR_SEPARATOR '/'
4767 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4769 #define HAVE_DOS_BASED_FILE_SYSTEM
4770 #ifndef DIR_SEPARATOR_2
4771 #define DIR_SEPARATOR_2 '\\'
4775 #ifndef DIR_SEPARATOR_2
4776 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4777 #else /* DIR_SEPARATOR_2 */
4778 # define IS_DIR_SEPARATOR(ch) \
4779 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4780 #endif /* DIR_SEPARATOR_2 */
4782 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4783 #define XFREE(stale) do { \
4784 if (stale) { free ((void *) stale); stale = 0; } \
4787 const char *program_name = NULL;
4789 void * xmalloc (size_t num);
4790 char * xstrdup (const char *string);
4791 char * basename (const char *name);
4792 char * fnqualify(const char *path);
4793 char * strendzap(char *str, const char *pat);
4794 void lt_fatal (const char *message, ...);
4797 main (int argc, char *argv[])
4802 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4803 newargz = XMALLOC(char *, argc+2);
4806 cat >> $cwrappersource <<EOF
4807 newargz[0] = "$SHELL";
4810 cat >> $cwrappersource <<"EOF"
4811 newargz[1] = fnqualify(argv[0]);
4812 /* we know the script has the same name, without the .exe */
4813 /* so make sure newargz[1] doesn't end in .exe */
4814 strendzap(newargz[1],".exe");
4815 for (i = 1; i < argc; i++)
4816 newargz[i+1] = xstrdup(argv[i]);
4817 newargz[argc+1] = NULL;
4820 cat >> $cwrappersource <<EOF
4821 execv("$SHELL",newargz);
4824 cat >> $cwrappersource <<"EOF"
4828 xmalloc (size_t num)
4830 void * p = (void *) malloc (num);
4832 lt_fatal ("Memory exhausted");
4838 xstrdup (const char *string)
4840 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4845 basename (const char *name)
4849 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4850 /* Skip over the disk name in MSDOS pathnames. */
4851 if (isalpha (name[0]) && name[1] == ':')
4855 for (base = name; *name; name++)
4856 if (IS_DIR_SEPARATOR (*name))
4858 return (char *) base;
4862 fnqualify(const char *path)
4866 char tmp[LT_PATHMAX + 1];
4868 assert(path != NULL);
4870 /* Is it qualified already? */
4871 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4872 if (isalpha (path[0]) && path[1] == ':')
4873 return xstrdup (path);
4875 if (IS_DIR_SEPARATOR (path[0]))
4876 return xstrdup (path);
4878 /* prepend the current directory */
4879 /* doesn't handle '~' */
4880 if (getcwd (tmp, LT_PATHMAX) == NULL)
4881 lt_fatal ("getcwd failed");
4882 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4883 p = XMALLOC(char, size);
4884 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4889 strendzap(char *str, const char *pat)
4893 assert(str != NULL);
4894 assert(pat != NULL);
4897 patlen = strlen(pat);
4901 str += len - patlen;
4902 if (strcmp(str, pat) == 0)
4909 lt_error_core (int exit_status, const char * mode,
4910 const char * message, va_list ap)
4912 fprintf (stderr, "%s: %s: ", program_name, mode);
4913 vfprintf (stderr, message, ap);
4914 fprintf (stderr, ".\n");
4916 if (exit_status >= 0)
4921 lt_fatal (const char *message, ...)
4924 va_start (ap, message);
4925 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4929 # we should really use a build-platform specific compiler
4930 # here, but OTOH, the wrappers (shell script and this C one)
4931 # are only useful if you want to execute the "real" binary.
4932 # Since the "real" binary is built for $host, then this
4933 # wrapper might as well be built for $host, too.
4934 $run $LTCC -s -o $cwrapper $cwrappersource
4938 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4943 # $output - temporary wrapper script for $objdir/$outputname
4944 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4946 # The $output program cannot be directly executed until all the libtool
4947 # libraries that it depends on are installed.
4949 # This wrapper script should never be moved out of the build directory.
4950 # If it is, it will not operate correctly.
4952 # Sed substitution that helps us do robust quoting. It backslashifies
4953 # metacharacters that are still active within double-quoted strings.
4954 Xsed='${SED} -e 1s/^X//'
4955 sed_quote_subst='$sed_quote_subst'
4957 # The HP-UX ksh and POSIX shell print the target directory to stdout
4959 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4961 relink_command=\"$relink_command\"
4963 # This environment variable determines our operation mode.
4964 if test \"\$libtool_install_magic\" = \"$magic\"; then
4965 # install mode needs the following variable:
4966 notinst_deplibs='$notinst_deplibs'
4968 # When we are sourced in execute mode, \$file and \$echo are already set.
4969 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4972 # Make sure echo works.
4973 if test \"X\$1\" = X--no-reexec; then
4974 # Discard the --no-reexec flag, and continue.
4976 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4977 # Yippee, \$echo works!
4980 # Restart under the correct shell, and then maybe \$echo will work.
4981 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4987 # Find the directory that this script lives in.
4988 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4989 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4991 # Follow symbolic links until we get to the real thisdir.
4992 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4993 while test -n \"\$file\"; do
4994 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4996 # If there was a directory component, then change thisdir.
4997 if test \"x\$destdir\" != \"x\$file\"; then
4998 case \"\$destdir\" in
4999 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5000 *) thisdir=\"\$thisdir/\$destdir\" ;;
5004 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5005 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5008 # Try to get the absolute directory name.
5009 absdir=\`cd \"\$thisdir\" && pwd\`
5010 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5013 if test "$fast_install" = yes; then
5015 program=lt-'$outputname'$exeext
5016 progdir=\"\$thisdir/$objdir\"
5018 if test ! -f \"\$progdir/\$program\" || \\
5019 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5020 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5022 file=\"\$\$-\$program\"
5024 if test ! -d \"\$progdir\"; then
5025 $mkdir \"\$progdir\"
5027 $rm \"\$progdir/\$file\"
5032 # relink executable if necessary
5033 if test -n \"\$relink_command\"; then
5034 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5036 $echo \"\$relink_command_output\" >&2
5037 $rm \"\$progdir/\$file\"
5042 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5043 { $rm \"\$progdir/\$program\";
5044 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5045 $rm \"\$progdir/\$file\"
5049 program='$outputname'
5050 progdir=\"\$thisdir/$objdir\"
5056 if test -f \"\$progdir/\$program\"; then"
5058 # Export our shlibpath_var if we have one.
5059 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5061 # Add our own library path to $shlibpath_var
5062 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5064 # Some systems cannot cope with colon-terminated $shlibpath_var
5065 # The second colon is a workaround for a bug in BeOS R4 sed
5066 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5068 export $shlibpath_var
5072 # fixup the dll searchpath if we need to.
5073 if test -n "$dllsearchpath"; then
5075 # Add the dll search path components to the executable PATH
5076 PATH=$dllsearchpath:\$PATH
5081 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5082 # Run the actual program with our arguments.
5085 # Backslashes separate directories on plain windows
5086 *-*-mingw | *-*-os2*)
5088 exec \$progdir\\\\\$program \${1+\"\$@\"}
5094 exec \$progdir/\$program \${1+\"\$@\"}
5099 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5103 # The program doesn't exist.
5104 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5105 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5106 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5117 # See if we need to build an old-fashioned archive.
5118 for oldlib in $oldlibs; do
5120 if test "$build_libtool_libs" = convenience; then
5121 oldobjs="$libobjs_save"
5122 addlibs="$convenience"
5123 build_libtool_libs=no
5125 if test "$build_libtool_libs" = module; then
5126 oldobjs="$libobjs_save"
5127 build_libtool_libs=no
5129 oldobjs="$old_deplibs $non_pic_objects"
5131 addlibs="$old_convenience"
5134 if test -n "$addlibs"; then
5135 gentop="$output_objdir/${outputname}x"
5136 generated="$generated $gentop"
5138 func_extract_archives $gentop $addlibs
5139 oldobjs="$oldobjs $func_extract_archives_result"
5142 # Do each command in the archive commands.
5143 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5144 cmds=$old_archive_from_new_cmds
5146 # POSIX demands no paths to be encoded in archives. We have
5147 # to avoid creating archives with duplicate basenames if we
5148 # might have to extract them afterwards, e.g., when creating a
5149 # static archive out of a convenience library, or when linking
5150 # the entirety of a libtool archive into another (currently
5151 # not supported by libtool).
5152 if (for obj in $oldobjs
5154 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5155 done | sort | sort -uc >/dev/null 2>&1); then
5158 $echo "copying selected object files to avoid basename conflicts..."
5160 if test -z "$gentop"; then
5161 gentop="$output_objdir/${outputname}x"
5162 generated="$generated $gentop"
5164 $show "${rm}r $gentop"
5165 $run ${rm}r "$gentop"
5166 $show "$mkdir $gentop"
5167 $run $mkdir "$gentop"
5169 if test "$status" -ne 0 && test ! -d "$gentop"; then
5174 save_oldobjs=$oldobjs
5177 for obj in $save_oldobjs
5179 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5180 case " $oldobjs " in
5181 " ") oldobjs=$obj ;;
5184 # Make sure we don't pick an alternate name that also
5186 newobj=lt$counter-$objbase
5187 counter=`expr $counter + 1`
5188 case " $oldobjs " in
5189 *[\ /]"$newobj "*) ;;
5190 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5193 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5194 $run ln "$obj" "$gentop/$newobj" ||
5195 $run cp "$obj" "$gentop/$newobj"
5196 oldobjs="$oldobjs $gentop/$newobj"
5198 *) oldobjs="$oldobjs $obj" ;;
5203 eval cmds=\"$old_archive_cmds\"
5205 if len=`expr "X$cmds" : ".*"` &&
5206 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5207 cmds=$old_archive_cmds
5209 # the command line is too long to link in one step, link in parts
5210 $echo "using piecewise archive linking..."
5215 save_oldobjs=$oldobjs
5217 # Is there a better way of finding the last object in the list?
5218 for obj in $save_oldobjs
5222 for obj in $save_oldobjs
5224 oldobjs="$objlist $obj"
5225 objlist="$objlist $obj"
5226 eval test_cmds=\"$old_archive_cmds\"
5227 if len=`expr "X$test_cmds" : ".*"` &&
5228 test "$len" -le "$max_cmd_len"; then
5231 # the above command should be used before it gets too long
5233 if test "$obj" = "$last_oldobj" ; then
5236 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5237 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5243 if test "X$oldobjs" = "X" ; then
5244 eval cmds=\"\$concat_cmds\"
5246 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5250 save_ifs="$IFS"; IFS='~'
5251 for cmd in $cmds; do
5255 $run eval "$cmd" || exit $?
5260 if test -n "$generated"; then
5261 $show "${rm}r$generated"
5262 $run ${rm}r$generated
5265 # Now create the libtool archive.
5269 test "$build_old_libs" = yes && old_library="$libname.$libext"
5270 $show "creating $output"
5272 # Preserve any variables that may affect compiler behavior
5273 for var in $variables_saved_for_relink; do
5274 if eval test -z \"\${$var+set}\"; then
5275 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5276 elif eval var_value=\$$var; test -z "$var_value"; then
5277 relink_command="$var=; export $var; $relink_command"
5279 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5280 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5283 # Quote the link command for shipping.
5284 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5285 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5286 if test "$hardcode_automatic" = yes ; then
5291 # Only create the output if not a dry run.
5292 if test -z "$run"; then
5293 for installed in no yes; do
5294 if test "$installed" = yes; then
5295 if test -z "$install_libdir"; then
5298 output="$output_objdir/$outputname"i
5299 # Replace all uninstalled libtool libraries with the installed ones
5301 for deplib in $dependency_libs; do
5304 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5305 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5306 if test -z "$libdir"; then
5307 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5310 if test "X$EGREP" = X ; then
5313 # We do not want portage's install root ($D) present. Check only for
5314 # this if the .la is being installed.
5315 if test "$installed" = yes && test "$D"; then
5316 eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5318 mynewdependency_lib="$libdir/$name"
5320 # Do not add duplicates
5321 if test "$mynewdependency_lib"; then
5322 my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5323 if test -z "$my_little_ninja_foo_1"; then
5324 newdependency_libs="$newdependency_libs $mynewdependency_lib"
5329 if test "$installed" = yes; then
5330 # Rather use S=WORKDIR if our version of portage supports it.
5331 # This is because some ebuild (gcc) do not use $S as buildroot.
5332 if test "$PWORKDIR"; then
5335 # We do not want portage's build root ($S) present.
5336 my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
5337 if test -n "$my_little_ninja_foo_2" && test "$S"; then
5338 mynewdependency_lib=""
5339 # We do not want portage's install root ($D) present.
5340 my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
5341 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
5342 eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5344 mynewdependency_lib="$deplib"
5347 mynewdependency_lib="$deplib"
5349 # Do not add duplicates
5350 if test "$mynewdependency_lib"; then
5351 my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
5352 if test -z "$my_little_ninja_foo_4"; then
5353 newdependency_libs="$newdependency_libs $mynewdependency_lib"
5359 dependency_libs="$newdependency_libs"
5361 for lib in $dlfiles; do
5362 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5363 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5364 if test -z "$libdir"; then
5365 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5368 newdlfiles="$newdlfiles $libdir/$name"
5370 dlfiles="$newdlfiles"
5372 for lib in $dlprefiles; do
5373 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5374 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5375 if test -z "$libdir"; then
5376 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5379 newdlprefiles="$newdlprefiles $libdir/$name"
5381 dlprefiles="$newdlprefiles"
5384 for lib in $dlfiles; do
5386 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5387 *) abs=`pwd`"/$lib" ;;
5389 newdlfiles="$newdlfiles $abs"
5391 dlfiles="$newdlfiles"
5393 for lib in $dlprefiles; do
5395 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5396 *) abs=`pwd`"/$lib" ;;
5398 newdlprefiles="$newdlprefiles $abs"
5400 dlprefiles="$newdlprefiles"
5403 # place dlname in correct position for cygwin
5405 case $host,$output,$installed,$module,$dlname in
5406 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5408 # Do not add duplicates
5409 if test "$installed" = yes && test "$D"; then
5410 install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
5413 # $outputname - a libtool library file
5414 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5416 # Please DO NOT delete this file!
5417 # It is necessary for linking the library.
5419 # The name that we can dlopen(3).
5422 # Names of this library.
5423 library_names='$library_names'
5425 # The name of the static archive.
5426 old_library='$old_library'
5428 # Libraries that this one depends upon.
5429 dependency_libs='$dependency_libs'
5431 # Version information for $libname.
5436 # Is this an already installed library?
5437 installed=$installed
5439 # Should we warn about portability when linking against -modules?
5440 shouldnotlink=$module
5442 # Files to dlopen/dlpreopen
5444 dlpreopen='$dlprefiles'
5446 # Directory that this library needs to be installed in:
5447 libdir='$install_libdir'"
5448 if test "$installed" = no && test "$need_relink" = yes; then
5450 relink_command=\"$relink_command\""
5455 # Do a symbolic link so that the libtool archive can be found in
5456 # LD_LIBRARY_PATH before the program is installed.
5457 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5458 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5464 # libtool install mode
5466 modename="$modename: install"
5468 # There may be an optional sh(1) argument at the beginning of
5469 # install_prog (especially on Windows NT).
5470 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5471 # Allow the use of GNU shtool's install command.
5472 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5473 # Aesthetically quote it.
5474 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5476 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5480 install_prog="$arg "
5488 # The real first argument should be the name of the installation program.
5489 # Aesthetically quote it.
5490 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5492 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5496 install_prog="$install_prog$arg"
5498 # We need to accept at least all the BSD install flags.
5508 if test -n "$dest"; then
5509 files="$files $dest"
5527 # If the previous option needed an argument, then skip it.
5528 if test -n "$prev"; then
5537 # Aesthetically quote the argument.
5538 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5540 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5544 install_prog="$install_prog $arg"
5547 if test -z "$install_prog"; then
5548 $echo "$modename: you must specify an install program" 1>&2
5553 if test -n "$prev"; then
5554 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5559 if test -z "$files"; then
5560 if test -z "$dest"; then
5561 $echo "$modename: no file or destination specified" 1>&2
5563 $echo "$modename: you must specify a destination" 1>&2
5569 # Strip any trailing slash from the destination.
5570 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5572 # Check to see that the destination is a directory.
5573 test -d "$dest" && isdir=yes
5574 if test "$isdir" = yes; then
5578 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5579 test "X$destdir" = "X$dest" && destdir=.
5580 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5582 # Not a directory, so check to see that there is only one file specified.
5584 if test "$#" -gt 2; then
5585 $echo "$modename: \`$dest' is not a directory" 1>&2
5591 [\\/]* | [A-Za-z]:[\\/]*) ;;
5593 for file in $files; do
5597 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5606 # This variable tells wrapper scripts just to set variables rather
5607 # than running their programs.
5608 libtool_install_magic="$magic"
5613 for file in $files; do
5615 # Do each installation.
5618 # Do the static libraries later.
5619 staticlibs="$staticlibs $file"
5623 # Check to see that this really is a libtool archive.
5624 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5626 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5634 # If there is no directory component, then add one.
5636 */* | *\\*) . $file ;;
5640 # Add the libdir to current_libdirs if it is the destination.
5641 if test "X$destdir" = "X$libdir"; then
5642 case "$current_libdirs " in
5644 *) current_libdirs="$current_libdirs $libdir" ;;
5647 # Note the libdir as a future libdir.
5648 case "$future_libdirs " in
5650 *) future_libdirs="$future_libdirs $libdir" ;;
5654 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5655 test "X$dir" = "X$file/" && dir=
5658 if test -n "$relink_command"; then
5659 # Determine the prefix the user has applied to our future dir.
5660 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5662 # Don't allow the user to place us outside of our expected
5663 # location b/c this prevents finding dependent libraries that
5664 # are installed to the same prefix.
5665 # At present, this check doesn't affect windows .dll's that
5666 # are installed into $libdir/../bin (currently, that works fine)
5667 # but it's something to keep an eye on.
5668 if test "$inst_prefix_dir" = "$destdir"; then
5669 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5673 if test -n "$inst_prefix_dir"; then
5674 # Stick the inst_prefix_dir data into the link command.
5675 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5677 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5680 $echo "$modename: warning: relinking \`$file'" 1>&2
5681 $show "$relink_command"
5682 if $run eval "$relink_command"; then :
5684 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5689 # See the names of the shared library.
5690 set dummy $library_names
5691 if test -n "$2"; then
5697 test -n "$relink_command" && srcname="$realname"T
5699 # Install the shared library and build the symlinks.
5700 $show "$install_prog $dir/$srcname $destdir/$realname"
5701 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5702 if test -n "$stripme" && test -n "$striplib"; then
5703 $show "$striplib $destdir/$realname"
5704 $run eval "$striplib $destdir/$realname" || exit $?
5707 if test "$#" -gt 0; then
5708 # Delete the old symlinks, and create new ones.
5711 if test "$linkname" != "$realname"; then
5712 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5713 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5718 # Do each command in the postinstall commands.
5719 lib="$destdir/$realname"
5720 cmds=$postinstall_cmds
5721 save_ifs="$IFS"; IFS='~'
5722 for cmd in $cmds; do
5726 $run eval "$cmd" || exit $?
5731 # Install the pseudo-library for information purposes.
5732 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5733 instname="$dir/$name"i
5734 $show "$install_prog $instname $destdir/$name"
5735 $run eval "$install_prog $instname $destdir/$name" || exit $?
5737 # Maybe install the static library, too.
5738 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5742 # Install (i.e. copy) a libtool object.
5744 # Figure out destination file name, if it wasn't already specified.
5745 if test -n "$destname"; then
5746 destfile="$destdir/$destname"
5748 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5749 destfile="$destdir/$destfile"
5752 # Deduce the name of the destination old-style object file.
5755 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5758 staticdest="$destfile"
5762 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5768 # Install the libtool object if requested.
5769 if test -n "$destfile"; then
5770 $show "$install_prog $file $destfile"
5771 $run eval "$install_prog $file $destfile" || exit $?
5774 # Install the old object if enabled.
5775 if test "$build_old_libs" = yes; then
5776 # Deduce the name of the old-style object file.
5777 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5779 $show "$install_prog $staticobj $staticdest"
5780 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5786 # Figure out destination file name, if it wasn't already specified.
5787 if test -n "$destname"; then
5788 destfile="$destdir/$destname"
5790 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5791 destfile="$destdir/$destfile"
5794 # If the file is missing, and there is a .exe on the end, strip it
5795 # because it is most likely a libtool script we actually want to
5800 if test ! -f "$file"; then
5801 file=`$echo $file|${SED} 's,.exe$,,'`
5807 # Do a test to see if this is really a libtool program.
5810 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5816 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5820 # To insure that "foo" is sourced, and not "foo.exe",
5821 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5822 # which disallows the automatic-append-.exe behavior.
5824 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5825 *) wrapperdot=${wrapper} ;;
5827 # If there is no directory component, then add one.
5829 */* | *\\*) . ${wrapperdot} ;;
5830 *) . ./${wrapperdot} ;;
5833 # Check the variables that should have been set.
5834 if test -z "$notinst_deplibs"; then
5835 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5840 for lib in $notinst_deplibs; do
5841 # Check to see that each library is installed.
5843 if test -f "$lib"; then
5844 # If there is no directory component, then add one.
5846 */* | *\\*) . $lib ;;
5850 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5851 if test -n "$libdir" && test ! -f "$libfile"; then
5852 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5858 # To insure that "foo" is sourced, and not "foo.exe",
5859 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5860 # which disallows the automatic-append-.exe behavior.
5862 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5863 *) wrapperdot=${wrapper} ;;
5865 # If there is no directory component, then add one.
5867 */* | *\\*) . ${wrapperdot} ;;
5868 *) . ./${wrapperdot} ;;
5872 if test "$fast_install" = no && test -n "$relink_command"; then
5873 if test "$finalize" = yes && test -z "$run"; then
5875 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5876 tmpdir="$tmpdir/libtool-$$"
5879 if $mkdir "$tmpdir"; then
5883 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5886 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5887 outputname="$tmpdir/$file"
5888 # Replace the output file specification.
5889 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5891 $show "$relink_command"
5892 if $run eval "$relink_command"; then :
5894 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5900 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5903 # Install the binary that we compiled earlier.
5904 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5908 # remove .exe since cygwin /usr/bin/install will append another
5910 case $install_prog,$host in
5911 */usr/bin/install*,*cygwin*)
5912 case $file:$destfile in
5917 destfile=$destfile.exe
5920 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5925 $show "$install_prog$stripme $file $destfile"
5926 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5927 test -n "$outputname" && ${rm}r "$tmpdir"
5932 for file in $staticlibs; do
5933 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5935 # Set up the ranlib parameters.
5936 oldlib="$destdir/$name"
5938 $show "$install_prog $file $oldlib"
5939 $run eval "$install_prog \$file \$oldlib" || exit $?
5941 if test -n "$stripme" && test -n "$old_striplib"; then
5942 $show "$old_striplib $oldlib"
5943 $run eval "$old_striplib $oldlib" || exit $?
5946 # Do each command in the postinstall commands.
5947 cmds=$old_postinstall_cmds
5948 save_ifs="$IFS"; IFS='~'
5949 for cmd in $cmds; do
5953 $run eval "$cmd" || exit $?
5958 if test -n "$future_libdirs"; then
5959 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5962 if test -n "$current_libdirs"; then
5963 # Maybe just do a dry run.
5964 test -n "$run" && current_libdirs=" -n$current_libdirs"
5965 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5971 # libtool finish mode
5973 modename="$modename: finish"
5977 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5980 libdirs="$libdirs $dir"
5983 for libdir in $libdirs; do
5984 if test -n "$finish_cmds"; then
5985 # Do each command in the finish commands.
5987 save_ifs="$IFS"; IFS='~'
5988 for cmd in $cmds; do
5992 $run eval "$cmd" || admincmds="$admincmds
5997 if test -n "$finish_eval"; then
5998 # Do the single finish_eval.
5999 eval cmds=\"$finish_eval\"
6000 $run eval "$cmds" || admincmds="$admincmds
6006 # Exit here if they wanted silent mode.
6007 test "$show" = : && exit $EXIT_SUCCESS
6009 $echo "----------------------------------------------------------------------"
6010 $echo "Libraries have been installed in:"
6011 for libdir in $libdirs; do
6015 $echo "If you ever happen to want to link against installed libraries"
6016 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6017 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6018 $echo "flag during linking and do at least one of the following:"
6019 if test -n "$shlibpath_var"; then
6020 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6021 $echo " during execution"
6023 if test -n "$runpath_var"; then
6024 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6025 $echo " during linking"
6027 if test -n "$hardcode_libdir_flag_spec"; then
6029 eval flag=\"$hardcode_libdir_flag_spec\"
6031 $echo " - use the \`$flag' linker flag"
6033 if test -n "$admincmds"; then
6034 $echo " - have your system administrator run these commands:$admincmds"
6036 if test -f /etc/ld.so.conf; then
6037 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6040 $echo "See any operating system documentation about shared libraries for"
6041 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6042 $echo "----------------------------------------------------------------------"
6046 # libtool execute mode
6048 modename="$modename: execute"
6050 # The first argument is the command name.
6052 if test -z "$cmd"; then
6053 $echo "$modename: you must specify a COMMAND" 1>&2
6058 # Handle -dlopen flags immediately.
6059 for file in $execute_dlfiles; do
6060 if test ! -f "$file"; then
6061 $echo "$modename: \`$file' is not a file" 1>&2
6069 # Check to see that this really is a libtool archive.
6070 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6072 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6077 # Read the libtool library.
6081 # If there is no directory component, then add one.
6083 */* | *\\*) . $file ;;
6087 # Skip this library if it cannot be dlopened.
6088 if test -z "$dlname"; then
6089 # Warn if it was a shared library.
6090 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6094 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6095 test "X$dir" = "X$file" && dir=.
6097 if test -f "$dir/$objdir/$dlname"; then
6100 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6106 # Just add the directory containing the .lo file.
6107 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6108 test "X$dir" = "X$file" && dir=.
6112 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6117 # Get the absolute pathname.
6118 absdir=`cd "$dir" && pwd`
6119 test -n "$absdir" && dir="$absdir"
6121 # Now add the directory to shlibpath_var.
6122 if eval "test -z \"\$$shlibpath_var\""; then
6123 eval "$shlibpath_var=\"\$dir\""
6125 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6129 # This variable tells wrapper scripts just to set shlibpath_var
6130 # rather than running their programs.
6131 libtool_execute_magic="$magic"
6133 # Check if any of the arguments is a wrapper script.
6140 # Do a test to see if this is really a libtool program.
6141 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6142 # If there is no directory component, then add one.
6144 */* | *\\*) . $file ;;
6148 # Transform arg to wrapped name.
6149 file="$progdir/$program"
6153 # Quote arguments (to preserve shell metacharacters).
6154 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6155 args="$args \"$file\""
6158 if test -z "$run"; then
6159 if test -n "$shlibpath_var"; then
6160 # Export the shlibpath_var.
6161 eval "export $shlibpath_var"
6164 # Restore saved environment variables
6165 if test "${save_LC_ALL+set}" = set; then
6166 LC_ALL="$save_LC_ALL"; export LC_ALL
6168 if test "${save_LANG+set}" = set; then
6169 LANG="$save_LANG"; export LANG
6172 # Now prepare to actually exec the command.
6173 exec_cmd="\$cmd$args"
6175 # Display what would be done.
6176 if test -n "$shlibpath_var"; then
6177 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6178 $echo "export $shlibpath_var"
6185 # libtool clean and uninstall mode
6187 modename="$modename: $mode"
6193 # This variable tells wrapper scripts just to set variables rather
6194 # than running their programs.
6195 libtool_install_magic="$magic"
6200 -f) rm="$rm $arg"; rmforce=yes ;;
6201 -*) rm="$rm $arg" ;;
6202 *) files="$files $arg" ;;
6206 if test -z "$rm"; then
6207 $echo "$modename: you must specify an RM program" 1>&2
6214 origobjdir="$objdir"
6215 for file in $files; do
6216 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6217 if test "X$dir" = "X$file"; then
6219 objdir="$origobjdir"
6221 objdir="$dir/$origobjdir"
6223 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6224 test "$mode" = uninstall && objdir="$dir"
6226 # Remember objdir for removal later, being careful to avoid duplicates
6227 if test "$mode" = clean; then
6230 *) rmdirs="$rmdirs $objdir" ;;
6234 # Don't error if the file doesn't exist and rm -f was used.
6235 if (test -L "$file") >/dev/null 2>&1 \
6236 || (test -h "$file") >/dev/null 2>&1 \
6237 || test -f "$file"; then
6239 elif test -d "$file"; then
6242 elif test "$rmforce" = yes; then
6250 # Possibly a libtool archive, so verify it.
6251 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6254 # Delete the libtool libraries and symlinks.
6255 for n in $library_names; do
6256 rmfiles="$rmfiles $objdir/$n"
6258 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6259 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6261 if test "$mode" = uninstall; then
6262 if test -n "$library_names"; then
6263 # Do each command in the postuninstall commands.
6264 cmds=$postuninstall_cmds
6265 save_ifs="$IFS"; IFS='~'
6266 for cmd in $cmds; do
6271 if test "$?" -ne 0 && test "$rmforce" != yes; then
6278 if test -n "$old_library"; then
6279 # Do each command in the old_postuninstall commands.
6280 cmds=$old_postuninstall_cmds
6281 save_ifs="$IFS"; IFS='~'
6282 for cmd in $cmds; do
6287 if test "$?" -ne 0 && test "$rmforce" != yes; then
6293 # FIXME: should reinstall the best remaining shared library.
6299 # Possibly a libtool object, so verify it.
6300 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6305 # Add PIC object to the list of files to remove.
6306 if test -n "$pic_object" \
6307 && test "$pic_object" != none; then
6308 rmfiles="$rmfiles $dir/$pic_object"
6311 # Add non-PIC object to the list of files to remove.
6312 if test -n "$non_pic_object" \
6313 && test "$non_pic_object" != none; then
6314 rmfiles="$rmfiles $dir/$non_pic_object"
6320 if test "$mode" = clean ; then
6324 file=`$echo $file|${SED} 's,.exe$,,'`
6325 noexename=`$echo $name|${SED} 's,.exe$,,'`
6326 # $file with .exe has already been added to rmfiles,
6327 # add $file without .exe
6328 rmfiles="$rmfiles $file"
6331 # Do a test to see if this is a libtool program.
6332 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6336 # note $name still contains .exe if it was in $file originally
6337 # as does the version of $file that was added into $rmfiles
6338 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6339 if test "$fast_install" = yes && test -n "$relink_command"; then
6340 rmfiles="$rmfiles $objdir/lt-$name"
6342 if test "X$noexename" != "X$name" ; then
6343 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6349 $show "$rm $rmfiles"
6350 $run $rm $rmfiles || exit_status=1
6352 objdir="$origobjdir"
6354 # Try to remove the ${objdir}s in the directories where we deleted files
6355 for dir in $rmdirs; do
6356 if test -d "$dir"; then
6358 $run rmdir $dir >/dev/null 2>&1
6366 $echo "$modename: you must specify a MODE" 1>&2
6367 $echo "$generic_help" 1>&2
6372 if test -z "$exec_cmd"; then
6373 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6374 $echo "$generic_help" 1>&2
6377 fi # test -z "$show_help"
6379 if test -n "$exec_cmd"; then
6384 # We need to display help for each of the modes.
6387 "Usage: $modename [OPTION]... [MODE-ARG]...
6389 Provide generalized library-building support services.
6391 --config show all configuration variables
6392 --debug enable verbose shell tracing
6393 -n, --dry-run display commands without modifying any files
6394 --features display basic configuration information and exit
6395 --finish same as \`--mode=finish'
6396 --help display this help message and exit
6397 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6398 --quiet same as \`--silent'
6399 --silent don't print informational messages
6400 --tag=TAG use configuration variables from tag TAG
6401 --version print version information
6403 MODE must be one of the following:
6405 clean remove files from the build directory
6406 compile compile a source file into a libtool object
6407 execute automatically set library path, then run a program
6408 finish complete the installation of libtool libraries
6409 install install libraries or executables
6410 link create a library or an executable
6411 uninstall remove libraries from an installed directory
6413 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6414 a more detailed description of MODE.
6416 Report bugs to <bug-libtool@gnu.org>."
6422 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6424 Remove files from the build directory.
6426 RM is the name of the program to use to delete files associated with each FILE
6427 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6430 If FILE is a libtool library, object or program, all the files associated
6431 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6436 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6438 Compile a source file into a libtool library object.
6440 This mode accepts the following additional options:
6442 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6443 -prefer-pic try to building PIC objects only
6444 -prefer-non-pic try to building non-PIC objects only
6445 -static always build a \`.o' file suitable for static linking
6447 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6448 from the given SOURCEFILE.
6450 The output file name is determined by removing the directory component from
6451 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6452 library object suffix, \`.lo'."
6457 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6459 Automatically set library path, then run a program.
6461 This mode accepts the following additional options:
6463 -dlopen FILE add the directory containing FILE to the library path
6465 This mode sets the library path environment variable according to \`-dlopen'
6468 If any of the ARGS are libtool executable wrappers, then they are translated
6469 into their corresponding uninstalled binary, and any of their required library
6470 directories are added to the library path.
6472 Then, COMMAND is executed, with ARGS as arguments."
6477 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6479 Complete the installation of libtool libraries.
6481 Each LIBDIR is a directory that contains libtool libraries.
6483 The commands that this mode executes may require superuser privileges. Use
6484 the \`--dry-run' option if you just want to see what would be executed."
6489 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6491 Install executables or libraries.
6493 INSTALL-COMMAND is the installation command. The first component should be
6494 either the \`install' or \`cp' program.
6496 The rest of the components are interpreted as arguments to that command (only
6497 BSD-compatible install options are recognized)."
6502 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6504 Link object files or libraries together to form another library, or to
6505 create an executable program.
6507 LINK-COMMAND is a command using the C compiler that you would use to create
6508 a program from several object files.
6510 The following components of LINK-COMMAND are treated specially:
6512 -all-static do not do any dynamic linking at all
6513 -avoid-version do not add a version suffix if possible
6514 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6515 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6516 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6517 -export-symbols SYMFILE
6518 try to export only the symbols listed in SYMFILE
6519 -export-symbols-regex REGEX
6520 try to export only the symbols matching REGEX
6521 -LLIBDIR search LIBDIR for required installed libraries
6522 -lNAME OUTPUT-FILE requires the installed library libNAME
6523 -module build a library that can dlopened
6524 -no-fast-install disable the fast-install mode
6525 -no-install link a not-installable executable
6526 -no-undefined declare that a library does not refer to external symbols
6527 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6528 -objectlist FILE Use a list of object files found in FILE to specify objects
6529 -precious-files-regex REGEX
6530 don't remove output files matching REGEX
6531 -release RELEASE specify package release information
6532 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6533 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6534 -static do not do any dynamic linking of libtool libraries
6535 -version-info CURRENT[:REVISION[:AGE]]
6536 specify library version info [each variable defaults to 0]
6538 All other options (arguments beginning with \`-') are ignored.
6540 Every other argument is treated as a filename. Files ending in \`.la' are
6541 treated as uninstalled libtool libraries, other files are standard or library
6544 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6545 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6546 required, except when creating a convenience library.
6548 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6549 using \`ar' and \`ranlib', or on Windows using \`lib'.
6551 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6552 is created, otherwise an executable program is created."
6557 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6559 Remove libraries from an installation directory.
6561 RM is the name of the program to use to delete files associated with each FILE
6562 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6565 If FILE is a libtool library, all the files associated with it are deleted.
6566 Otherwise, only FILE itself is deleted using RM."
6570 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6577 $echo "Try \`$modename --help' for more information about other modes."
6581 # The TAGs below are defined such that we never get into a situation
6582 # in which we disable both kinds of libraries. Given conflicting
6583 # choices, we go for a static library, that is the most portable,
6584 # since we can't tell whether shared libraries were disabled because
6585 # the user asked for that or because the platform doesn't support
6586 # them. This is particularly important on AIX, because we don't
6587 # support having both static and shared libraries enabled at the same
6588 # time on that platform, so we default to a shared-only configuration.
6589 # If a disable-shared tag is given, we'll fallback to a static-only
6590 # configuration. But we'll never go from static-only to shared-only.
6592 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6593 build_libtool_libs=no
6595 # ### END LIBTOOL TAG CONFIG: disable-shared
6597 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6598 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6599 # ### END LIBTOOL TAG CONFIG: disable-static