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 # The name of this program:
37 progname=`echo "$progpath" | $SED $basename`
47 TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
49 # See if we are running on zsh, and set the options which allow our
50 # commands through without removal of \ escapes.
51 if test -n "${ZSH_VERSION+set}" ; then
55 # Check that we have a working $echo.
56 if test "X$1" = X--no-reexec; then
57 # Discard the --no-reexec flag, and continue.
59 elif test "X$1" = X--fallback-echo; then
60 # Avoid inline document here, it may be left over
62 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
63 # Yippee, $echo works!
66 # Restart under the correct shell, and then maybe $echo will work.
67 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
70 if test "X$1" = X--fallback-echo; then
71 # used as fallback echo
80 help="Try \`$progname --help' for more information."
81 magic="%%%MAGIC variable%%%"
86 # Sed substitution that helps us do robust quoting. It backslashifies
87 # metacharacters that are still active within double-quoted strings.
88 Xsed="${SED}"' -e 1s/^X//'
89 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90 # test EBCDIC or ASCII
91 case `echo A|tr A '\301'` in
92 A) # EBCDIC based system
93 SP2NL="tr '\100' '\n'"
94 NL2SP="tr '\r\n' '\100\100'"
96 *) # Assume ASCII based system
97 SP2NL="tr '\040' '\012'"
98 NL2SP="tr '\015\012' '\040\040'"
103 # Only set LANG and LC_ALL to C if already set.
104 # These must not be set unconditionally because not all systems understand
105 # e.g. LANG=C (notably SCO).
106 # We save the old values to restore during execute mode.
107 if test "${LC_ALL+set}" = set; then
108 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
110 if test "${LANG+set}" = set; then
111 save_LANG="$LANG"; LANG=C; export LANG
114 # Make sure IFS has a sensible default
119 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
120 $echo "$modename: not configured to build any kind of library" 1>&2
121 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
134 lo2o="s/\\.lo\$/.${objext}/"
135 o2lo="s/\\.${objext}\$/.lo/"
136 quote_scanset='[[~#^*{};<>?'"'"' ]'
138 #####################################
139 # Shell function definitions:
140 # This seems to be the best place for them
142 # func_win32_libid arg
143 # return the library type of file 'arg'
145 # Need a lot of goo to handle *both* DLLs and import libs
146 # Has to be a shell function in order to 'eat' the argument
147 # that is supplied when $file_magic_command is called.
150 win32_libid_type="unknown"
151 win32_fileres=`file -L $1 2>/dev/null`
152 case $win32_fileres in
153 *ar\ archive\ import\ library*) # definitely import
154 win32_libid_type="x86 archive import"
156 *ar\ archive*) # could be an import, or static
157 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159 win32_nmres=`eval $NM -f posix -A $1 | \
160 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161 if test "X$win32_nmres" = "Ximport" ; then
162 win32_libid_type="x86 archive import"
164 win32_libid_type="x86 archive static"
169 win32_libid_type="x86 DLL"
171 *executable*) # but shell scripts are "executable" too...
172 case $win32_fileres in
173 *MS\ Windows\ PE\ Intel*)
174 win32_libid_type="x86 DLL"
179 $echo $win32_libid_type
184 # Infer tagged configuration to use if any are available and
185 # if one wasn't chosen via the "--tag" command line option.
186 # Only attempt this if the compiler in the base compile
187 # command doesn't match the default compiler.
188 # arg is usually of the form 'gcc ...'
191 if test -n "$available_tags" && test -z "$tagname"; then
195 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
199 CC_quoted="$CC_quoted $arg"
202 # Blanks in the command may have been stripped by the calling shell,
203 # but not from the CC environment variable when configure was run.
204 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
205 # Blanks at the start of $base_compile will cause this to fail
206 # if we don't check for them as well.
208 for z in $available_tags; do
209 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
210 # Evaluate the configuration.
211 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
214 # Double-quote args containing other shell metacharacters.
216 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
220 CC_quoted="$CC_quoted $arg"
223 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224 # The compiler in the base compile command matches
225 # the one in the tagged configuration.
226 # Assume this is the tagged configuration we want.
233 # If $tagname still isn't set, then no tagged configuration
234 # was found and let the user know that the "--tag" command
235 # line option must be used.
236 if test -z "$tagname"; then
237 $echo "$modename: unable to infer tagged configuration"
238 $echo "$modename: specify a tag with \`--tag'" 1>&2
241 # $echo "$modename: using $tagname tagged configuration"
249 # func_extract_an_archive dir oldlib
250 func_extract_an_archive ()
252 f_ex_an_ar_dir="$1"; shift
253 f_ex_an_ar_oldlib="$1"
255 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
256 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
257 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
260 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
265 # func_extract_archives gentop oldlib ...
266 func_extract_archives ()
268 my_gentop="$1"; shift
276 $show "${rm}r $my_gentop"
277 $run ${rm}r "$my_gentop"
278 $show "$mkdir $my_gentop"
279 $run $mkdir "$my_gentop"
281 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
285 for my_xlib in $my_oldlibs; do
286 # Extract the objects.
288 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
289 *) my_xabs=`pwd`"/$my_xlib" ;;
291 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292 my_xdir="$my_gentop/$my_xlib"
294 $show "${rm}r $my_xdir"
295 $run ${rm}r "$my_xdir"
296 $show "$mkdir $my_xdir"
297 $run $mkdir "$my_xdir"
299 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
304 $show "Extracting $my_xabs"
305 # Do not bother doing anything if just a dry run
306 if test -z "$run"; then
307 darwin_orig_dir=`pwd`
308 cd $my_xdir || exit $?
309 darwin_archive=$my_xabs
311 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
312 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
313 if test -n "$darwin_arches"; then
314 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
316 $show "$darwin_base_archive has multiple architectures $darwin_arches"
317 for darwin_arch in $darwin_arches ; do
318 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
319 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
320 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
321 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
323 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
324 done # $darwin_arches
325 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
326 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
329 for darwin_file in $darwin_filelist; do
330 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
331 lipo -create -output "$darwin_file" $darwin_files
332 done # $darwin_filelist
334 cd "$darwin_orig_dir"
336 cd "$darwin_orig_dir"
337 func_extract_an_archive "$my_xdir" "$my_xabs"
342 func_extract_an_archive "$my_xdir" "$my_xabs"
345 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
347 func_extract_archives_result="$my_oldobjs"
349 # End of Shell function definitions
350 #####################################
353 eval std_shrext=\"$shrext_cmds\"
355 # Parse our command line options once, thoroughly.
356 while test "$#" -gt 0
362 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
366 # If the previous option needs an argument, assign it.
367 if test -n "$prev"; then
370 execute_dlfiles="$execute_dlfiles $arg"
374 preserve_args="${preserve_args}=$arg"
376 # Check whether tagname contains only valid characters
379 $echo "$progname: invalid tag name: $tagname" 1>&2
386 # Don't test for the "default" C tag, as we know, it's there, but
387 # not specially marked.
390 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
391 taglist="$taglist $tagname"
392 # Evaluate the configuration.
393 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
395 $echo "$progname: ignoring unknown tag $tagname" 1>&2
410 # Have we seen a non-optional argument yet?
417 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
419 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
420 $echo "This is free software; see the source for copying conditions. There is NO"
421 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
426 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
427 # Now print the configurations for the tags.
428 for tagname in $taglist; do
429 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
435 $echo "$progname: enabling shell trace mode"
437 preserve_args="$preserve_args $arg"
446 if test "$build_libtool_libs" = yes; then
447 $echo "enable shared libraries"
449 $echo "disable shared libraries"
451 if test "$build_old_libs" = yes; then
452 $echo "enable static libraries"
454 $echo "disable static libraries"
459 --finish) mode="finish" ;;
461 --mode) prevopt="--mode" prev=mode ;;
462 --mode=*) mode="$optarg" ;;
464 --preserve-dup-deps) duplicate_deps="yes" ;;
468 preserve_args="$preserve_args $arg"
471 --tag) prevopt="--tag" prev=tag ;;
473 set tag "$optarg" ${1+"$@"}
476 preserve_args="$preserve_args --tag"
485 $echo "$modename: unrecognized option \`$arg'" 1>&2
497 if test -n "$prevopt"; then
498 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
503 # If this variable is set in any of the actions, the command in it
504 # will be execed at the end. This prevents here-documents from being
505 # left over by shells.
508 if test -z "$show_help"; then
510 # Infer the operation mode.
511 if test -z "$mode"; then
512 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
513 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
515 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
527 *db | *dbx | *strace | *truss)
537 # If we have no mode, but dlfiles were specified, then do execute mode.
538 test -n "$execute_dlfiles" && mode=execute
540 # Just use the default operation mode.
541 if test -z "$mode"; then
542 if test -n "$nonopt"; then
543 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
545 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
552 # Only execute mode is allowed to have -dlopen flags.
553 if test -n "$execute_dlfiles" && test "$mode" != execute; then
554 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
559 # Change the help message to a mode-specific one.
561 help="Try \`$modename --help --mode=$mode' for more information."
563 # These modes are in order of execution frequency so that they run quickly.
565 # libtool compile mode
567 modename="$modename: compile"
568 # Get the compilation command and the source file.
570 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
581 # do not "continue". Instead, add this to base_compile
593 # Accept any command-line options.
596 if test -n "$libobj" ; then
597 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
604 -static | -prefer-pic | -prefer-non-pic)
615 arg_mode=arg # the next one goes into the "base_compile" arg list
616 continue # The current "srcfile" will either be retained or
617 ;; # replaced later. I would guess that would be a bug.
620 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
622 save_ifs="$IFS"; IFS=','
626 # Double-quote args containing other shell metacharacters.
627 # Many Bourne shells cannot handle close brackets correctly
628 # in scan sets, so we specify it separately.
630 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
634 lastarg="$lastarg $arg"
637 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
639 # Add the arguments to base_compile.
640 base_compile="$base_compile $lastarg"
645 # Accept the current argument as the source file.
646 # The previous "srcfile" becomes the current argument.
653 esac # case $arg_mode
655 # Aesthetically quote the previous argument.
656 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
659 # Double-quote args containing other shell metacharacters.
660 # Many Bourne shells cannot handle close brackets correctly
661 # in scan sets, and some SunOS ksh mistreat backslash-escaping
662 # in scan sets (worked around with variable expansion),
663 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
664 # at all, so we specify them separately.
665 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
666 lastarg="\"$lastarg\""
670 base_compile="$base_compile $lastarg"
675 $echo "$modename: you must specify an argument for -Xcompile"
679 $echo "$modename: you must specify a target with \`-o'" 1>&2
683 # Get the name of the library object.
684 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
688 # Recognize several different file suffixes.
689 # If the user specifies -o file.o, it is replaced with file.lo
699 *.class) xform=class ;;
704 *.java) xform=java ;;
707 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
710 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
712 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
717 func_infer_tag $base_compile
719 for arg in $later; do
738 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
740 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
741 qlibobj="\"$qlibobj\"" ;;
743 if test "X$libobj" != "X$qlibobj"; then
744 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
747 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
748 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
749 if test "X$xdir" = "X$obj"; then
754 lobj=${xdir}$objdir/$objname
756 if test -z "$base_compile"; then
757 $echo "$modename: you must specify a compilation command" 1>&2
762 # Delete any leftover library objects.
763 if test "$build_old_libs" = yes; then
764 removelist="$obj $lobj $libobj ${libobj}T"
766 removelist="$lobj $libobj ${libobj}T"
770 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
772 # On Cygwin there's no "real" PIC flag so we must build both object types
774 cygwin* | mingw* | pw32* | os2*)
778 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
779 # non-PIC code in shared libraries is not supported
783 # Calculate the filename of the output object if compiler does
784 # not support -o with -c
785 if test "$compiler_c_o" = no; then
786 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
787 lockfile="$output_obj.lock"
788 removelist="$removelist $output_obj $lockfile"
789 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
796 # Lock this critical section if it is needed
797 # We use this script file to make the link, it avoids creating a new file
798 if test "$need_locks" = yes; then
799 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
800 $show "Waiting for $lockfile to be removed"
803 elif test "$need_locks" = warn; then
804 if test -f "$lockfile"; then
806 *** ERROR, $lockfile exists and contains:
807 `cat $lockfile 2>/dev/null`
809 This indicates that another process is trying to use the same
810 temporary object file, and libtool could not work around it because
811 your compiler does not support \`-c' and \`-o' together. If you
812 repeat this compilation, it may succeed, by chance, but you had better
813 avoid parallel builds (make -j) in this platform, or get a better
819 $echo "$srcfile" > "$lockfile"
822 if test -n "$fix_srcfile_path"; then
823 eval srcfile=\"$fix_srcfile_path\"
825 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
827 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
828 qsrcfile="\"$qsrcfile\"" ;;
831 $run $rm "$libobj" "${libobj}T"
833 # Create a libtool object file (analogous to a ".la" file),
834 # but don't create it if we're doing a dry run.
835 test -z "$run" && cat > ${libobj}T <<EOF
836 # $libobj - a libtool object file
837 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
839 # Please DO NOT delete this file!
840 # It is necessary for linking the library.
842 # Name of the PIC object.
845 # Only build a PIC object if we are building libtool libraries.
846 if test "$build_libtool_libs" = yes; then
847 # Without this assignment, base_compile gets emptied.
848 fbsd_hideous_sh_bug=$base_compile
850 if test "$pic_mode" != no; then
851 command="$base_compile $qsrcfile $pic_flag"
853 # Don't build PIC code
854 command="$base_compile $qsrcfile"
857 if test ! -d "${xdir}$objdir"; then
858 $show "$mkdir ${xdir}$objdir"
859 $run $mkdir ${xdir}$objdir
861 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
866 if test -z "$output_obj"; then
867 # Place PIC objects in $objdir
868 command="$command -o $lobj"
871 $run $rm "$lobj" "$output_obj"
874 if $run eval "$command"; then :
876 test -n "$output_obj" && $run $rm $removelist
880 if test "$need_locks" = warn &&
881 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
883 *** ERROR, $lockfile contains:
884 `cat $lockfile 2>/dev/null`
886 but it should contain:
889 This indicates that another process is trying to use the same
890 temporary object file, and libtool could not work around it because
891 your compiler does not support \`-c' and \`-o' together. If you
892 repeat this compilation, it may succeed, by chance, but you had better
893 avoid parallel builds (make -j) in this platform, or get a better
900 # Just move the object if needed, then go on to compile the next one
901 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
902 $show "$mv $output_obj $lobj"
903 if $run $mv $output_obj $lobj; then :
911 # Append the name of the PIC object to the libtool object file.
912 test -z "$run" && cat >> ${libobj}T <<EOF
913 pic_object='$objdir/$objname'
917 # Allow error messages only from the first compilation.
918 if test "$suppress_opt" = yes; then
919 suppress_output=' >/dev/null 2>&1'
922 # No PIC object so indicate it doesn't exist in the libtool
924 test -z "$run" && cat >> ${libobj}T <<EOF
930 # Only build a position-dependent object if we build old libraries.
931 if test "$build_old_libs" = yes; then
932 if test "$pic_mode" != yes; then
933 # Don't build PIC code
934 command="$base_compile $qsrcfile"
936 command="$base_compile $qsrcfile $pic_flag"
938 if test "$compiler_c_o" = yes; then
939 command="$command -o $obj"
942 # Suppress compiler output if we already did a PIC compilation.
943 command="$command$suppress_output"
944 $run $rm "$obj" "$output_obj"
946 if $run eval "$command"; then :
952 if test "$need_locks" = warn &&
953 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
955 *** ERROR, $lockfile contains:
956 `cat $lockfile 2>/dev/null`
958 but it should contain:
961 This indicates that another process is trying to use the same
962 temporary object file, and libtool could not work around it because
963 your compiler does not support \`-c' and \`-o' together. If you
964 repeat this compilation, it may succeed, by chance, but you had better
965 avoid parallel builds (make -j) in this platform, or get a better
972 # Just move the object if needed
973 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
974 $show "$mv $output_obj $obj"
975 if $run $mv $output_obj $obj; then :
983 # Append the name of the non-PIC object the libtool object file.
984 # Only append if the libtool object file exists.
985 test -z "$run" && cat >> ${libobj}T <<EOF
986 # Name of the non-PIC object.
987 non_pic_object='$objname'
991 # Append the name of the non-PIC object the libtool object file.
992 # Only append if the libtool object file exists.
993 test -z "$run" && cat >> ${libobj}T <<EOF
994 # Name of the non-PIC object.
1000 $run $mv "${libobj}T" "${libobj}"
1002 # Unlock the critical section if it was locked
1003 if test "$need_locks" != no; then
1004 $run $rm "$lockfile"
1012 modename="$modename: link"
1014 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1015 # It is impossible to link a dll without this setting, and
1016 # we shouldn't force the makefile maintainer to figure out
1017 # which system we are compiling for in order to pass an extra
1018 # flag for every libtool invocation.
1019 # allow_undefined=no
1021 # FIXME: Unfortunately, there are problems with the above when trying
1022 # to make a dll which has undefined symbols, in which case not
1023 # even a static library is built. For now, we need to specify
1024 # -no-undefined on the libtool link line when we can be certain
1025 # that all symbols are satisfied, otherwise we get a static library.
1032 libtool_args="$nonopt"
1033 base_compile="$nonopt $@"
1034 compile_command="$nonopt"
1035 finalize_command="$nonopt"
1048 lib_search_path=`pwd`
1057 export_symbols_regex=
1065 precious_files_regex=
1066 prefer_static_libs=no
1079 func_infer_tag $base_compile
1081 # We need to know -static, to get the right output filenames.
1085 -all-static | -static)
1086 if test "X$arg" = "X-all-static"; then
1087 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1088 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1090 if test -n "$link_static_flag"; then
1091 dlopen_self=$dlopen_self_static
1094 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1095 dlopen_self=$dlopen_self_static
1098 build_libtool_libs=no
1100 prefer_static_libs=yes
1106 # See if our shared archives depend on static archives.
1107 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1109 # Go through the arguments, transforming them on the way.
1110 while test "$#" -gt 0; do
1114 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1115 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1119 libtool_args="$libtool_args $qarg"
1121 # If the previous option needs an argument, assign it.
1122 if test -n "$prev"; then
1125 compile_command="$compile_command @OUTPUT@"
1126 finalize_command="$finalize_command @OUTPUT@"
1132 if test "$preload" = no; then
1133 # Add the symbol object into the linking commands.
1134 compile_command="$compile_command @SYMFILE@"
1135 finalize_command="$finalize_command @SYMFILE@"
1139 *.la | *.lo) ;; # We handle these cases below.
1141 if test "$dlself" = no; then
1149 if test "$prev" = dlprefiles; then
1151 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1161 if test "$prev" = dlfiles; then
1162 dlfiles="$dlfiles $arg"
1164 dlprefiles="$dlprefiles $arg"
1172 export_symbols="$arg"
1173 if test ! -f "$arg"; then
1174 $echo "$modename: symbol file \`$arg' does not exist"
1181 export_symbols_regex="$arg"
1186 inst_prefix_dir="$arg"
1191 precious_files_regex="$arg"
1201 if test -f "$arg"; then
1204 for fil in `cat $save_arg`
1206 # moreargs="$moreargs $fil"
1208 # A libtool-controlled object.
1210 # Check to see that this really is a libtool object.
1211 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1216 # If there is no directory component, then add one.
1218 */* | *\\*) . $arg ;;
1222 if test -z "$pic_object" || \
1223 test -z "$non_pic_object" ||
1224 test "$pic_object" = none && \
1225 test "$non_pic_object" = none; then
1226 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1230 # Extract subdirectory from the argument.
1231 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1232 if test "X$xdir" = "X$arg"; then
1238 if test "$pic_object" != none; then
1239 # Prepend the subdirectory the object is found in.
1240 pic_object="$xdir$pic_object"
1242 if test "$prev" = dlfiles; then
1243 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1244 dlfiles="$dlfiles $pic_object"
1248 # If libtool objects are unsupported, then we need to preload.
1253 # CHECK ME: I think I busted this. -Ossama
1254 if test "$prev" = dlprefiles; then
1255 # Preload the old-style object.
1256 dlprefiles="$dlprefiles $pic_object"
1261 libobjs="$libobjs $pic_object"
1266 if test "$non_pic_object" != none; then
1267 # Prepend the subdirectory the object is found in.
1268 non_pic_object="$xdir$non_pic_object"
1270 # A standard non-PIC object
1271 non_pic_objects="$non_pic_objects $non_pic_object"
1272 if test -z "$pic_object" || test "$pic_object" = none ; then
1273 arg="$non_pic_object"
1277 # Only an error if not doing a dry-run.
1278 if test -z "$run"; then
1279 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1284 # Extract subdirectory from the argument.
1285 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1286 if test "X$xdir" = "X$arg"; then
1292 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1293 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1294 libobjs="$libobjs $pic_object"
1295 non_pic_objects="$non_pic_objects $non_pic_object"
1300 $echo "$modename: link input file \`$save_arg' does not exist"
1308 # We need an absolute path.
1310 [\\/]* | [A-Za-z]:[\\/]*) ;;
1312 $echo "$modename: only absolute run-paths are allowed" 1>&2
1316 if test "$prev" = rpath; then
1319 *) rpath="$rpath $arg" ;;
1324 *) xrpath="$xrpath $arg" ;;
1331 compiler_flags="$compiler_flags $qarg"
1333 compile_command="$compile_command $qarg"
1334 finalize_command="$finalize_command $qarg"
1338 linker_flags="$linker_flags $qarg"
1339 compiler_flags="$compiler_flags $wl$qarg"
1341 compile_command="$compile_command $wl$qarg"
1342 finalize_command="$finalize_command $wl$qarg"
1346 linker_flags="$linker_flags $qarg"
1347 compiler_flags="$compiler_flags $qarg"
1349 compile_command="$compile_command $qarg"
1350 finalize_command="$finalize_command $qarg"
1359 compiler_flags="$compiler_flags $arg"
1360 compile_command="$compile_command $arg"
1361 finalize_command="$finalize_command $arg"
1366 eval "$prev=\"\$arg\""
1371 fi # test -n "$prev"
1377 if test -n "$link_static_flag"; then
1378 compile_command="$compile_command $link_static_flag"
1379 finalize_command="$finalize_command $link_static_flag"
1385 # FIXME: remove this flag sometime in the future.
1386 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1410 -export-symbols | -export-symbols-regex)
1411 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1412 $echo "$modename: more than one -exported-symbols argument is not allowed"
1415 if test "X$arg" = "X-export-symbols"; then
1424 prev=darwin_framework
1425 compiler_flags="$compiler_flags $arg"
1426 compile_command="$compile_command $arg"
1427 finalize_command="$finalize_command $arg"
1436 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1437 # so, if we see these flags be careful not to treat them like -L
1439 case $with_gcc/$host in
1440 no/*-*-irix* | /*-*-irix*)
1441 compile_command="$compile_command $arg"
1442 finalize_command="$finalize_command $arg"
1449 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1450 # We need an absolute path.
1452 [\\/]* | [A-Za-z]:[\\/]*) ;;
1454 absdir=`cd "$dir" && pwd`
1455 if test -z "$absdir"; then
1456 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1465 deplibs="$deplibs -L$dir"
1466 lib_search_path="$lib_search_path $dir"
1470 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1471 case :$dllsearchpath: in
1473 *) dllsearchpath="$dllsearchpath:$dir";;
1481 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1483 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1484 # These systems don't actually have a C or math library (as such)
1487 *-*-mingw* | *-*-os2*)
1488 # These systems don't actually have a C library (as such)
1489 test "X$arg" = "X-lc" && continue
1491 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1492 # Do not include libc due to us having libc/libc_r.
1493 test "X$arg" = "X-lc" && continue
1495 *-*-rhapsody* | *-*-darwin1.[012])
1496 # Rhapsody C and math libraries are in the System framework
1497 deplibs="$deplibs -framework System"
1500 elif test "X$arg" = "X-lc_r"; then
1502 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1503 # Do not include libc_r directly, use -pthread flag.
1508 deplibs="$deplibs $arg"
1512 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1513 # classes, name mangling, and exception handling.
1515 compile_command="$compile_command $arg"
1516 compiler_flags="$compiler_flags $arg"
1517 finalize_command="$finalize_command $arg"
1522 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1523 compiler_flags="$compiler_flags $arg"
1524 compile_command="$compile_command $arg"
1525 finalize_command="$finalize_command $arg"
1526 deplibs="$deplibs $arg"
1534 # Do not build the useless static library
1541 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1542 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1543 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1544 # +DA*, +DD* enable 64-bit mode on the HP compiler
1545 # -q* pass through compiler args for the IBM compiler
1546 # -m* pass through architecture-specific compiler args for GCC
1547 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1549 # Unknown arguments in both finalize_command and compile_command need
1550 # to be aesthetically quoted because they are evaled later.
1551 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1553 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1557 compile_command="$compile_command $arg"
1558 finalize_command="$finalize_command $arg"
1559 if test "$with_gcc" = "yes" ; then
1560 compiler_flags="$compiler_flags $arg"
1577 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1578 # The PATH hackery in wrapper scripts is required on Windows
1579 # in order for the loader to find any dlls it needs.
1580 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1581 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1584 *) no_install=yes ;;
1601 -precious-files-regex)
1622 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1623 # We need an absolute path.
1625 [\\/]* | [A-Za-z]:[\\/]*) ;;
1627 $echo "$modename: only absolute run-paths are allowed" 1>&2
1633 *) xrpath="$xrpath $dir" ;;
1639 # The effects of -static are defined in a previous loop.
1640 # We used to do the same as -all-static on platforms that
1641 # didn't have a PIC flag, but the assumption that the effects
1642 # would be equivalent was wrong. It would break on at least
1643 # Digital Unix and AIX.
1663 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1665 save_ifs="$IFS"; IFS=','
1666 for flag in $args; do
1669 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1674 compiler_flags="$compiler_flags $flag"
1677 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1681 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1683 save_ifs="$IFS"; IFS=','
1684 for flag in $args; do
1687 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1692 compiler_flags="$compiler_flags $wl$flag"
1693 linker_flags="$linker_flags $flag"
1696 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1714 # Some other compiler flag.
1716 # Unknown arguments in both finalize_command and compile_command need
1717 # to be aesthetically quoted because they are evaled later.
1718 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1720 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1727 # A standard object.
1732 # A libtool-controlled object.
1734 # Check to see that this really is a libtool object.
1735 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1740 # If there is no directory component, then add one.
1742 */* | *\\*) . $arg ;;
1746 if test -z "$pic_object" || \
1747 test -z "$non_pic_object" ||
1748 test "$pic_object" = none && \
1749 test "$non_pic_object" = none; then
1750 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1754 # Extract subdirectory from the argument.
1755 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1756 if test "X$xdir" = "X$arg"; then
1762 if test "$pic_object" != none; then
1763 # Prepend the subdirectory the object is found in.
1764 pic_object="$xdir$pic_object"
1766 if test "$prev" = dlfiles; then
1767 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1768 dlfiles="$dlfiles $pic_object"
1772 # If libtool objects are unsupported, then we need to preload.
1777 # CHECK ME: I think I busted this. -Ossama
1778 if test "$prev" = dlprefiles; then
1779 # Preload the old-style object.
1780 dlprefiles="$dlprefiles $pic_object"
1785 libobjs="$libobjs $pic_object"
1790 if test "$non_pic_object" != none; then
1791 # Prepend the subdirectory the object is found in.
1792 non_pic_object="$xdir$non_pic_object"
1794 # A standard non-PIC object
1795 non_pic_objects="$non_pic_objects $non_pic_object"
1796 if test -z "$pic_object" || test "$pic_object" = none ; then
1797 arg="$non_pic_object"
1801 # Only an error if not doing a dry-run.
1802 if test -z "$run"; then
1803 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1808 # Extract subdirectory from the argument.
1809 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1810 if test "X$xdir" = "X$arg"; then
1816 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1817 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1818 libobjs="$libobjs $pic_object"
1819 non_pic_objects="$non_pic_objects $non_pic_object"
1826 deplibs="$deplibs $arg"
1827 old_deplibs="$old_deplibs $arg"
1832 # A libtool-controlled library.
1834 if test "$prev" = dlfiles; then
1835 # This library was specified with -dlopen.
1836 dlfiles="$dlfiles $arg"
1838 elif test "$prev" = dlprefiles; then
1839 # The library was specified with -dlpreopen.
1840 dlprefiles="$dlprefiles $arg"
1843 deplibs="$deplibs $arg"
1848 # Some other compiler argument.
1850 # Unknown arguments in both finalize_command and compile_command need
1851 # to be aesthetically quoted because they are evaled later.
1852 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1854 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1861 # Now actually substitute the argument into the commands.
1862 if test -n "$arg"; then
1863 compile_command="$compile_command $arg"
1864 finalize_command="$finalize_command $arg"
1866 done # argument parsing loop
1868 if test -n "$prev"; then
1869 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1874 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1875 eval arg=\"$export_dynamic_flag_spec\"
1876 compile_command="$compile_command $arg"
1877 finalize_command="$finalize_command $arg"
1881 # calculate the name of the file, without its directory
1882 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1883 libobjs_save="$libobjs"
1885 if test -n "$shlibpath_var"; then
1886 # get the directories listed in $shlibpath_var
1887 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1891 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1892 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1894 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1895 if test "X$output_objdir" = "X$output"; then
1896 output_objdir="$objdir"
1898 output_objdir="$output_objdir/$objdir"
1900 # Create the object directory.
1901 if test ! -d "$output_objdir"; then
1902 $show "$mkdir $output_objdir"
1903 $run $mkdir $output_objdir
1905 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1910 # Determine the type of output
1913 $echo "$modename: you must specify an output file" 1>&2
1917 *.$libext) linkmode=oldlib ;;
1918 *.lo | *.$objext) linkmode=obj ;;
1919 *.la) linkmode=lib ;;
1920 *) linkmode=prog ;; # Anything else should be a program.
1924 *cygwin* | *mingw* | *pw32*)
1925 # don't eliminate duplications in $postdeps and $predeps
1926 duplicate_compiler_generated_deps=yes
1929 duplicate_compiler_generated_deps=$duplicate_deps
1935 # Find all interdependent deplibs by searching for libraries
1936 # that are linked more than once (e.g. -la -lb -la)
1937 for deplib in $deplibs; do
1938 if test "X$duplicate_deps" = "Xyes" ; then
1940 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1943 libs="$libs $deplib"
1946 if test "$linkmode" = lib; then
1947 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1949 # Compute libraries that are listed more than once in $predeps
1950 # $postdeps and mark them as special (i.e., whose duplicates are
1951 # not to be eliminated).
1953 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1954 for pre_post_dep in $predeps $postdeps; do
1955 case "$pre_post_deps " in
1956 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1958 pre_post_deps="$pre_post_deps $pre_post_dep"
1967 need_relink=no # whether we're linking any uninstalled libtool libraries
1968 notinst_deplibs= # not-installed libtool libraries
1969 notinst_path= # paths that contain not-installed libtool libraries
1973 for file in $dlfiles $dlprefiles; do
1977 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1989 passes="conv scan dlopen dlpreopen link"
1994 for pass in $passes; do
1995 if test "$linkmode,$pass" = "lib,link" ||
1996 test "$linkmode,$pass" = "prog,scan"; then
2000 if test "$linkmode" = prog; then
2002 dlopen) libs="$dlfiles" ;;
2003 dlpreopen) libs="$dlprefiles" ;;
2004 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2007 if test "$pass" = dlopen; then
2008 # Collect dlpreopened libraries
2009 save_deplibs="$deplibs"
2012 for deplib in $libs; do
2016 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2017 if test "$linkmode,$pass" = "prog,link"; then
2018 compile_deplibs="$deplib $compile_deplibs"
2019 finalize_deplibs="$deplib $finalize_deplibs"
2021 compiler_flags="$compiler_flags $deplib"
2026 deplibs="$deplib $deplibs"
2027 test "$pass" = conv && continue
2028 newdependency_libs="$deplib $newdependency_libs"
2031 if test "$pass" = conv; then
2032 deplibs="$deplib $deplibs"
2035 if test "$pass" = scan; then
2036 deplibs="$deplib $deplibs"
2038 compile_deplibs="$deplib $compile_deplibs"
2039 finalize_deplibs="$deplib $finalize_deplibs"
2049 if test "$linkmode" != lib && test "$linkmode" != prog; then
2050 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2053 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2054 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2055 for search_ext in .la $std_shrext .so .a; do
2056 # Search the libtool library
2057 lib="$searchdir/lib${name}${search_ext}"
2058 if test -f "$lib"; then
2059 if test "$search_ext" = ".la"; then
2068 if test "$found" != yes; then
2069 # deplib doesn't seem to be a libtool library
2070 if test "$linkmode,$pass" = "prog,link"; then
2071 compile_deplibs="$deplib $compile_deplibs"
2072 finalize_deplibs="$deplib $finalize_deplibs"
2074 deplibs="$deplib $deplibs"
2075 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2078 else # deplib is a libtool library
2079 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2080 # We need to do some special things here, and not later.
2081 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2082 case " $predeps $postdeps " in
2084 if (${SED} -e '2q' $lib |
2085 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2089 */* | *\\*) . $lib ;;
2092 for l in $old_library $library_names; do
2095 if test "X$ll" = "X$old_library" ; then # only static version available
2097 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2098 test "X$ladir" = "X$lib" && ladir="."
2099 lib=$ladir/$old_library
2100 if test "$linkmode,$pass" = "prog,link"; then
2101 compile_deplibs="$deplib $compile_deplibs"
2102 finalize_deplibs="$deplib $finalize_deplibs"
2104 deplibs="$deplib $deplibs"
2105 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2119 deplibs="$deplib $deplibs"
2120 test "$pass" = conv && continue
2121 newdependency_libs="$deplib $newdependency_libs"
2122 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2125 if test "$pass" = conv; then
2126 deplibs="$deplib $deplibs"
2129 if test "$pass" = scan; then
2130 deplibs="$deplib $deplibs"
2132 compile_deplibs="$deplib $compile_deplibs"
2133 finalize_deplibs="$deplib $finalize_deplibs"
2135 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2138 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2144 if test "$pass" = link; then
2145 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2146 # Make sure the xrpath contains only unique directories.
2149 *) xrpath="$xrpath $dir" ;;
2152 deplibs="$deplib $deplibs"
2155 *.la) lib="$deplib" ;;
2157 if test "$pass" = conv; then
2158 deplibs="$deplib $deplibs"
2164 case $deplibs_check_method in
2166 set dummy $deplibs_check_method
2167 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2168 if eval $echo \"$deplib\" 2>/dev/null \
2170 | $EGREP "$match_pattern_regex" > /dev/null; then
2178 if test "$valid_a_lib" != yes; then
2180 $echo "*** Warning: Trying to link with static lib archive $deplib."
2181 $echo "*** I have the capability to make that library automatically link in when"
2182 $echo "*** you link to this library. But I can only do this if you have a"
2183 $echo "*** shared version of the library, which you do not appear to have"
2184 $echo "*** because the file extensions .$libext of this argument makes me believe"
2185 $echo "*** that it is just a static archive that I should not used here."
2188 $echo "*** Warning: Linking the shared library $output against the"
2189 $echo "*** static library $deplib is not portable!"
2190 deplibs="$deplib $deplibs"
2195 if test "$pass" != link; then
2196 deplibs="$deplib $deplibs"
2198 compile_deplibs="$deplib $compile_deplibs"
2199 finalize_deplibs="$deplib $finalize_deplibs"
2206 if test "$pass" = conv; then
2207 deplibs="$deplib $deplibs"
2208 elif test "$linkmode" = prog; then
2209 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2210 # If there is no dlopen support or we're linking statically,
2211 # we need to preload.
2212 newdlprefiles="$newdlprefiles $deplib"
2213 compile_deplibs="$deplib $compile_deplibs"
2214 finalize_deplibs="$deplib $finalize_deplibs"
2216 newdlfiles="$newdlfiles $deplib"
2226 if test "$found" = yes || test -f "$lib"; then :
2228 $echo "$modename: cannot find the library \`$lib'" 1>&2
2232 # Check to see that this really is a libtool archive.
2233 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2235 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2239 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2240 test "X$ladir" = "X$lib" && ladir="."
2248 # If the library was installed with an old release of libtool,
2249 # it will not redefine variables installed, or shouldnotlink
2257 */* | *\\*) . $lib ;;
2261 if test "$linkmode,$pass" = "lib,link" ||
2262 test "$linkmode,$pass" = "prog,scan" ||
2263 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2264 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2265 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2268 if test "$pass" = conv; then
2269 # Only check for convenience libraries
2270 deplibs="$lib $deplibs"
2271 if test -z "$libdir"; then
2272 if test -z "$old_library"; then
2273 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2276 # It is a libtool convenience library, so add in its objects.
2277 convenience="$convenience $ladir/$objdir/$old_library"
2278 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2280 for deplib in $dependency_libs; do
2281 deplibs="$deplib $deplibs"
2282 if test "X$duplicate_deps" = "Xyes" ; then
2283 case "$tmp_libs " in
2284 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2287 tmp_libs="$tmp_libs $deplib"
2289 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2290 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2297 # Get the name of the library we link against.
2299 for l in $old_library $library_names; do
2302 if test -z "$linklib"; then
2303 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2307 # This library was specified with -dlopen.
2308 if test "$pass" = dlopen; then
2309 if test -z "$libdir"; then
2310 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2313 if test -z "$dlname" ||
2314 test "$dlopen_support" != yes ||
2315 test "$build_libtool_libs" = no; then
2316 # If there is no dlname, no dlopen support or we're linking
2317 # statically, we need to preload. We also need to preload any
2318 # dependent libraries so libltdl's deplib preloader doesn't
2319 # bomb out in the load deplibs phase.
2320 dlprefiles="$dlprefiles $lib $dependency_libs"
2322 newdlfiles="$newdlfiles $lib"
2327 # We need an absolute path.
2329 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2331 abs_ladir=`cd "$ladir" && pwd`
2332 if test -z "$abs_ladir"; then
2333 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2334 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2339 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2341 # Find the relevant object directory and library name.
2342 if test "X$installed" = Xyes; then
2343 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2344 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2352 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2354 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2357 # Remove this search path later
2358 notinst_path="$notinst_path $abs_ladir"
2360 dir="$ladir/$objdir"
2361 absdir="$abs_ladir/$objdir"
2362 # Remove this search path later
2363 notinst_path="$notinst_path $abs_ladir"
2365 fi # $installed = yes
2366 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2368 # This library was specified with -dlpreopen.
2369 if test "$pass" = dlpreopen; then
2370 if test -z "$libdir"; then
2371 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2374 # Prefer using a static library (so that no silly _DYNAMIC symbols
2375 # are required to link).
2376 if test -n "$old_library"; then
2377 newdlprefiles="$newdlprefiles $dir/$old_library"
2378 # Otherwise, use the dlname, so that lt_dlopen finds it.
2379 elif test -n "$dlname"; then
2380 newdlprefiles="$newdlprefiles $dir/$dlname"
2382 newdlprefiles="$newdlprefiles $dir/$linklib"
2384 fi # $pass = dlpreopen
2386 if test -z "$libdir"; then
2387 # Link the convenience library
2388 if test "$linkmode" = lib; then
2389 deplibs="$dir/$old_library $deplibs"
2390 elif test "$linkmode,$pass" = "prog,link"; then
2391 compile_deplibs="$dir/$old_library $compile_deplibs"
2392 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2394 deplibs="$lib $deplibs" # used for prog,scan pass
2400 if test "$linkmode" = prog && test "$pass" != link; then
2401 newlib_search_path="$newlib_search_path $ladir"
2402 deplibs="$lib $deplibs"
2405 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2406 test "$build_libtool_libs" = no; then
2411 for deplib in $dependency_libs; do
2413 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2415 # Need to link against all dependency_libs?
2416 if test "$linkalldeplibs" = yes; then
2417 deplibs="$deplib $deplibs"
2419 # Need to hardcode shared library paths
2420 # or/and link against static libraries
2421 newdependency_libs="$deplib $newdependency_libs"
2423 if test "X$duplicate_deps" = "Xyes" ; then
2424 case "$tmp_libs " in
2425 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2428 tmp_libs="$tmp_libs $deplib"
2431 fi # $linkmode = prog...
2433 if test "$linkmode,$pass" = "prog,link"; then
2434 if test -n "$library_names" &&
2435 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2436 # We need to hardcode the library path
2437 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2438 # Make sure the rpath contains only unique directories.
2439 case "$temp_rpath " in
2442 *) temp_rpath="$temp_rpath $dir" ;;
2446 # Hardcode the library path.
2447 # Skip directories that are in the system default run-time
2449 case " $sys_lib_dlsearch_path " in
2452 case "$compile_rpath " in
2454 *) compile_rpath="$compile_rpath $absdir"
2458 case " $sys_lib_dlsearch_path " in
2461 case "$finalize_rpath " in
2463 *) finalize_rpath="$finalize_rpath $libdir"
2467 fi # $linkmode,$pass = prog,link...
2469 if test "$alldeplibs" = yes &&
2470 { test "$deplibs_check_method" = pass_all ||
2471 { test "$build_libtool_libs" = yes &&
2472 test -n "$library_names"; }; }; then
2473 # We only need to search for static libraries
2478 link_static=no # Whether the deplib will be linked statically
2479 if test -n "$library_names" &&
2480 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2481 if test "$installed" = no; then
2482 notinst_deplibs="$notinst_deplibs $lib"
2485 # This is a shared library
2487 # Warn about portability, can't link against -module's on
2488 # some systems (darwin)
2489 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2491 if test "$linkmode" = prog; then
2492 $echo "*** Warning: Linking the executable $output against the loadable module"
2494 $echo "*** Warning: Linking the shared library $output against the loadable module"
2496 $echo "*** $linklib is not portable!"
2498 if test "$linkmode" = lib &&
2499 test "$hardcode_into_libs" = yes; then
2500 # Hardcode the library path.
2501 # Skip directories that are in the system default run-time
2503 case " $sys_lib_dlsearch_path " in
2506 case "$compile_rpath " in
2508 *) compile_rpath="$compile_rpath $absdir"
2512 case " $sys_lib_dlsearch_path " in
2515 case "$finalize_rpath " in
2517 *) finalize_rpath="$finalize_rpath $libdir"
2523 if test -n "$old_archive_from_expsyms_cmds"; then
2524 # figure out the soname
2525 set dummy $library_names
2528 libname=`eval \\$echo \"$libname_spec\"`
2529 # use dlname if we got it. it's perfectly good, no?
2530 if test -n "$dlname"; then
2532 elif test -n "$soname_spec"; then
2536 major=`expr $current - $age`
2540 eval soname=\"$soname_spec\"
2545 # Make a new name for the extract_expsyms_cmds to use
2547 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2548 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2550 # If the library has no export list, then create one now
2551 if test -f "$output_objdir/$soname-def"; then :
2553 $show "extracting exported symbol list from \`$soname'"
2554 save_ifs="$IFS"; IFS='~'
2555 cmds=$extract_expsyms_cmds
2556 for cmd in $cmds; do
2560 $run eval "$cmd" || exit $?
2566 if test -f "$output_objdir/$newlib"; then :; else
2567 $show "generating import library for \`$soname'"
2568 save_ifs="$IFS"; IFS='~'
2569 cmds=$old_archive_from_expsyms_cmds
2570 for cmd in $cmds; do
2574 $run eval "$cmd" || exit $?
2578 # make sure the library variables are pointing to the new library
2581 fi # test -n "$old_archive_from_expsyms_cmds"
2583 if test "$linkmode" = prog || test "$mode" != relink; then
2588 case $hardcode_action in
2589 immediate | unsupported)
2590 if test "$hardcode_direct" = no; then
2593 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2595 # if the lib is a module then we can not link against
2596 # it, someone is ignoring the new warnings I added
2597 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2598 $echo "** Warning, lib $linklib is a module, not a shared library"
2599 if test -z "$old_library" ; then
2601 $echo "** And there doesn't seem to be a static archive available"
2602 $echo "** The link will probably fail, sorry"
2604 add="$dir/$old_library"
2608 elif test "$hardcode_minus_L" = no; then
2610 *-*-sunos*) add_shlibpath="$dir" ;;
2614 elif test "$hardcode_shlibpath_var" = no; then
2615 add_shlibpath="$dir"
2622 if test "$hardcode_direct" = yes; then
2624 elif test "$hardcode_minus_L" = yes; then
2626 # Try looking first in the location we're being installed to.
2627 if test -n "$inst_prefix_dir"; then
2630 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2635 elif test "$hardcode_shlibpath_var" = yes; then
2636 add_shlibpath="$dir"
2645 if test "$lib_linked" != yes; then
2646 $echo "$modename: configuration error: unsupported hardcode properties"
2650 if test -n "$add_shlibpath"; then
2651 case :$compile_shlibpath: in
2652 *":$add_shlibpath:"*) ;;
2653 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2656 if test "$linkmode" = prog; then
2657 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2658 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2660 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2661 test -n "$add" && deplibs="$add $deplibs"
2662 if test "$hardcode_direct" != yes && \
2663 test "$hardcode_minus_L" != yes && \
2664 test "$hardcode_shlibpath_var" = yes; then
2665 case :$finalize_shlibpath: in
2667 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2673 if test "$linkmode" = prog || test "$mode" = relink; then
2677 # Finalize command for both is simple: just hardcode it.
2678 if test "$hardcode_direct" = yes; then
2679 add="$libdir/$linklib"
2680 elif test "$hardcode_minus_L" = yes; then
2683 elif test "$hardcode_shlibpath_var" = yes; then
2684 case :$finalize_shlibpath: in
2686 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2689 elif test "$hardcode_automatic" = yes; then
2690 if test -n "$inst_prefix_dir" &&
2691 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2692 add="$inst_prefix_dir$libdir/$linklib"
2694 add="$libdir/$linklib"
2697 # We cannot seem to hardcode it, guess we'll fake it.
2699 # Try looking first in the location we're being installed to.
2700 if test -n "$inst_prefix_dir"; then
2703 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2710 if test "$linkmode" = prog; then
2711 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2712 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2714 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2715 test -n "$add" && deplibs="$add $deplibs"
2718 elif test "$linkmode" = prog; then
2719 # Here we assume that one of hardcode_direct or hardcode_minus_L
2720 # is not unsupported. This is valid on all known static and
2722 if test "$hardcode_direct" != unsupported; then
2723 test -n "$old_library" && linklib="$old_library"
2724 compile_deplibs="$dir/$linklib $compile_deplibs"
2725 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2727 compile_deplibs="-l$name -L$dir $compile_deplibs"
2728 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2730 elif test "$build_libtool_libs" = yes; then
2731 # Not a shared library
2732 if test "$deplibs_check_method" != pass_all; then
2733 # We're trying link a shared library against a static one
2734 # but the system doesn't support it.
2736 # Just print a warning and add the library to dependency_libs so
2737 # that the program can be linked against the static library.
2739 $echo "*** Warning: This system can not link to static lib archive $lib."
2740 $echo "*** I have the capability to make that library automatically link in when"
2741 $echo "*** you link to this library. But I can only do this if you have a"
2742 $echo "*** shared version of the library, which you do not appear to have."
2743 if test "$module" = yes; then
2744 $echo "*** But as you try to build a module library, libtool will still create "
2745 $echo "*** a static module, that should work as long as the dlopening application"
2746 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2747 if test -z "$global_symbol_pipe"; then
2749 $echo "*** However, this would only work if libtool was able to extract symbol"
2750 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2751 $echo "*** not find such a program. So, this module is probably useless."
2752 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2754 if test "$build_old_libs" = no; then
2755 build_libtool_libs=module
2758 build_libtool_libs=no
2762 convenience="$convenience $dir/$old_library"
2763 old_convenience="$old_convenience $dir/$old_library"
2764 deplibs="$dir/$old_library $deplibs"
2767 fi # link shared/static library?
2769 if test "$linkmode" = lib; then
2770 if test -n "$dependency_libs" &&
2771 { test "$hardcode_into_libs" != yes ||
2772 test "$build_old_libs" = yes ||
2773 test "$link_static" = yes; }; then
2774 # Extract -R from dependency_libs
2776 for libdir in $dependency_libs; do
2778 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2780 *" $temp_xrpath "*) ;;
2781 *) xrpath="$xrpath $temp_xrpath";;
2783 *) temp_deplibs="$temp_deplibs $libdir";;
2786 dependency_libs="$temp_deplibs"
2789 newlib_search_path="$newlib_search_path $absdir"
2790 # Link against this library
2791 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2792 # ... and its dependency_libs
2794 for deplib in $dependency_libs; do
2795 newdependency_libs="$deplib $newdependency_libs"
2796 if test "X$duplicate_deps" = "Xyes" ; then
2797 case "$tmp_libs " in
2798 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2801 tmp_libs="$tmp_libs $deplib"
2804 if test "$link_all_deplibs" != no; then
2805 # Add the search paths of all dependency libraries
2806 for deplib in $dependency_libs; do
2808 -L*) path="$deplib" ;;
2810 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2811 test "X$dir" = "X$deplib" && dir="."
2812 # We need an absolute path.
2814 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2816 absdir=`cd "$dir" && pwd`
2817 if test -z "$absdir"; then
2818 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2823 if grep "^installed=no" $deplib > /dev/null; then
2824 path="$absdir/$objdir"
2826 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2827 if test -z "$libdir"; then
2828 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2831 if test "$absdir" != "$libdir"; then
2832 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2839 # we do not want to link against static libs,
2840 # but need to link against shared
2841 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2842 if test -n "$deplibrary_names" ; then
2843 for tmp in $deplibrary_names ; do
2846 if test -f "$path/$depdepl" ; then
2847 depdepl="$path/$depdepl"
2849 # do not add paths which are already there
2850 case " $newlib_search_path " in
2852 *) newlib_search_path="$newlib_search_path $path";;
2865 # Again, we only want to link against shared libraries
2866 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2867 for tmp in $newlib_search_path ; do
2868 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2869 eval depdepl="$tmp/lib$tmp_libs.dylib"
2880 case " $deplibs " in
2882 *) deplibs="$path $deplibs" ;;
2884 case " $deplibs " in
2886 *) deplibs="$depdepl $deplibs" ;;
2889 fi # link_all_deplibs != no
2891 done # for deplib in $libs
2892 dependency_libs="$newdependency_libs"
2893 if test "$pass" = dlpreopen; then
2894 # Link the dlpreopened libraries before other libraries
2895 for deplib in $save_deplibs; do
2896 deplibs="$deplib $deplibs"
2899 if test "$pass" != dlopen; then
2900 if test "$pass" != conv; then
2901 # Make sure lib_search_path contains only unique directories.
2903 for dir in $newlib_search_path; do
2904 case "$lib_search_path " in
2906 *) lib_search_path="$lib_search_path $dir" ;;
2912 if test "$linkmode,$pass" != "prog,link"; then
2915 vars="compile_deplibs finalize_deplibs"
2917 for var in $vars dependency_libs; do
2918 # Add libraries to $var in reverse order
2919 eval tmp_libs=\"\$$var\"
2921 for deplib in $tmp_libs; do
2922 # FIXME: Pedantically, this is the right thing to do, so
2923 # that some nasty dependency loop isn't accidentally
2925 #new_libs="$deplib $new_libs"
2926 # Pragmatically, this seems to cause very few problems in
2929 -L*) new_libs="$deplib $new_libs" ;;
2932 # And here is the reason: when a library appears more
2933 # than once as an explicit dependence of a library, or
2934 # is implicitly linked in more than once by the
2935 # compiler, it is considered special, and multiple
2936 # occurrences thereof are not removed. Compare this
2937 # with having the same library being listed as a
2938 # dependency of multiple other libraries: in this case,
2939 # we know (pedantically, we assume) the library does not
2940 # need to be listed more than once, so we keep only the
2941 # last copy. This is not always right, but it is rare
2942 # enough that we require users that really mean to play
2943 # such unportable linking tricks to link the library
2944 # using -Wl,-lname, so that libtool does not consider it
2945 # for duplicate removal.
2946 case " $specialdeplibs " in
2947 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2949 case " $new_libs " in
2951 *) new_libs="$deplib $new_libs" ;;
2959 for deplib in $new_libs; do
2962 case " $tmp_libs " in
2964 *) tmp_libs="$tmp_libs $deplib" ;;
2967 *) tmp_libs="$tmp_libs $deplib" ;;
2970 eval $var=\"$tmp_libs\"
2973 # Last step: remove runtime libs from dependency_libs
2974 # (they stay in deplibs)
2976 for i in $dependency_libs ; do
2977 case " $predeps $postdeps $compiler_lib_search_path " in
2982 if test -n "$i" ; then
2983 tmp_libs="$tmp_libs $i"
2986 dependency_libs=$tmp_libs
2988 if test "$linkmode" = prog; then
2989 dlfiles="$newdlfiles"
2990 dlprefiles="$newdlprefiles"
2995 if test -n "$deplibs"; then
2996 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2999 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3000 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3003 if test -n "$rpath"; then
3004 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3007 if test -n "$xrpath"; then
3008 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3011 if test -n "$vinfo"; then
3012 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3015 if test -n "$release"; then
3016 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3019 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3020 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3023 # Now set the variables for building old libraries.
3024 build_libtool_libs=no
3026 objs="$objs$old_deplibs"
3030 # Make sure we only generate libraries of the form `libNAME.la'.
3033 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3034 eval shared_ext=\"$shrext_cmds\"
3035 eval libname=\"$libname_spec\"
3038 if test "$module" = no; then
3039 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3043 if test "$need_lib_prefix" != no; then
3044 # Add the "lib" prefix for modules if required
3045 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3046 eval shared_ext=\"$shrext_cmds\"
3047 eval libname=\"$libname_spec\"
3049 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3054 if test -n "$objs"; then
3055 if test "$deplibs_check_method" != pass_all; then
3056 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3060 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3061 $echo "*** objects $objs is not portable!"
3062 libobjs="$libobjs $objs"
3066 if test "$dlself" != no; then
3067 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3071 if test "$#" -gt 2; then
3072 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3077 if test -z "$rpath"; then
3078 if test "$build_libtool_libs" = yes; then
3079 # Building a libtool convenience library.
3080 # Some compilers have problems with a `.al' extension so
3081 # convenience libraries should have the same extension an
3082 # archive normally would.
3083 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3084 build_libtool_libs=convenience
3088 if test -n "$vinfo"; then
3089 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3092 if test -n "$release"; then
3093 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3097 # Parse the version information argument.
3098 save_ifs="$IFS"; IFS=':'
3099 set dummy $vinfo 0 0 0
3102 if test -n "$8"; then
3103 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3108 # convert absolute version numbers to libtool ages
3109 # this retains compatibility with .la files and attempts
3110 # to make the code below a bit more comprehensible
3112 case $vinfo_number in
3116 number_revision="$4"
3118 # There are really only two kinds -- those that
3119 # use the current revision as the major version
3120 # and those that subtract age and use age as
3121 # a minor version. But, then there is irix
3122 # which has an extra 1 added just for fun
3124 case $version_type in
3125 darwin|linux|osf|windows)
3126 current=`expr $number_major + $number_minor`
3128 revision="$number_revision"
3130 freebsd-aout|freebsd-elf|sunos)
3131 current="$number_major"
3132 revision="$number_minor"
3136 current=`expr $number_major + $number_minor - 1`
3138 revision="$number_minor"
3149 # Check that each of the things are valid numbers.
3151 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]) ;;
3153 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3154 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3160 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]) ;;
3162 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3163 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3169 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]) ;;
3171 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3172 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3177 if test "$age" -gt "$current"; then
3178 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3179 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3183 # Calculate the version variables.
3187 case $version_type in
3191 # Like Linux, but with the current version available in
3192 # verstring for coding it into the library header
3193 major=.`expr $current - $age`
3194 versuffix="$major.$age.$revision"
3195 # Darwin ld doesn't like 0 for these options...
3196 minor_current=`expr $current + 1`
3197 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3202 versuffix=".$current.$revision";
3207 versuffix=".$current";
3211 major=`expr $current - $age + 1`
3213 case $version_type in
3214 nonstopux) verstring_prefix=nonstopux ;;
3215 *) verstring_prefix=sgi ;;
3217 verstring="$verstring_prefix$major.$revision"
3219 # Add in all the interfaces that we are compatible with.
3221 while test "$loop" -ne 0; do
3222 iface=`expr $revision - $loop`
3223 loop=`expr $loop - 1`
3224 verstring="$verstring_prefix$major.$iface:$verstring"
3227 # Before this point, $major must not contain `.'.
3229 versuffix="$major.$revision"
3233 major=.`expr $current - $age`
3234 versuffix="$major.$age.$revision"
3238 major=.`expr $current - $age`
3239 versuffix=".$current.$age.$revision"
3240 verstring="$current.$age.$revision"
3242 # Add in all the interfaces that we are compatible with.
3244 while test "$loop" -ne 0; do
3245 iface=`expr $current - $loop`
3246 loop=`expr $loop - 1`
3247 verstring="$verstring:${iface}.0"
3250 # Make executables depend on our current version.
3251 verstring="$verstring:${current}.0"
3256 versuffix=".$current.$revision"
3260 # Use '-' rather than '.', since we only want one
3261 # extension on DOS 8.3 filesystems.
3262 major=`expr $current - $age`
3267 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3268 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3273 # Clear the version info if we defaulted, and they specified a release.
3274 if test -z "$vinfo" && test -n "$release"; then
3276 case $version_type in
3278 # we can't check for "0.0" in archive_cmds due to quoting
3279 # problems, so we reset it completely
3286 if test "$need_version" = no; then
3293 # Remove version info from name if versioning should be avoided
3294 if test "$avoid_version" = yes && test "$need_version" = no; then
3300 # Check to see if the archive will have undefined symbols.
3301 if test "$allow_undefined" = yes; then
3302 if test "$allow_undefined_flag" = unsupported; then
3303 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3304 build_libtool_libs=no
3308 # Don't allow undefined symbols.
3309 allow_undefined_flag="$no_undefined_flag"
3313 if test "$mode" != relink; then
3314 # Remove our outputs, but don't remove object files since they
3315 # may have been created when compiling PIC objects.
3317 tempremovelist=`$echo "$output_objdir/*"`
3318 for p in $tempremovelist; do
3322 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3323 if test "X$precious_files_regex" != "X"; then
3324 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3329 removelist="$removelist $p"
3334 if test -n "$removelist"; then
3335 $show "${rm}r $removelist"
3336 $run ${rm}r $removelist
3340 # Now set the variables for building old libraries.
3341 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3342 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3344 # Transform .lo files to .o files.
3345 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3348 # Eliminate all temporary directories.
3349 for path in $notinst_path; do
3350 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3351 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3352 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3355 if test -n "$xrpath"; then
3356 # If the user specified any rpath flags, then add them.
3358 for libdir in $xrpath; do
3359 temp_xrpath="$temp_xrpath -R$libdir"
3360 case "$finalize_rpath " in
3362 *) finalize_rpath="$finalize_rpath $libdir" ;;
3365 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3366 dependency_libs="$temp_xrpath $dependency_libs"
3370 # Make sure dlfiles contains only unique files that won't be dlpreopened
3371 old_dlfiles="$dlfiles"
3373 for lib in $old_dlfiles; do
3374 case " $dlprefiles $dlfiles " in
3376 *) dlfiles="$dlfiles $lib" ;;
3380 # Make sure dlprefiles contains only unique files
3381 old_dlprefiles="$dlprefiles"
3383 for lib in $old_dlprefiles; do
3384 case "$dlprefiles " in
3386 *) dlprefiles="$dlprefiles $lib" ;;
3390 if test "$build_libtool_libs" = yes; then
3391 if test -n "$rpath"; then
3393 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3394 # these systems don't actually have a c library (as such)!
3396 *-*-rhapsody* | *-*-darwin1.[012])
3397 # Rhapsody C library is in the System framework
3398 deplibs="$deplibs -framework System"
3401 # Don't link with libc until the a.out ld.so is fixed.
3403 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3404 # Do not include libc due to us having libc/libc_r.
3405 test "X$arg" = "X-lc" && continue
3408 # Add libc to deplibs on all other systems if necessary.
3409 if test "$build_libtool_need_lc" = "yes"; then
3410 deplibs="$deplibs -lc"
3416 # Transform deplibs into only deplibs that can be linked in shared.
3418 libname_save=$libname
3419 release_save=$release
3420 versuffix_save=$versuffix
3422 # I'm not sure if I'm treating the release correctly. I think
3423 # release should show up in the -l (ie -lgmp5) so we don't want to
3424 # add it in twice. Is that correct?
3430 case $deplibs_check_method in
3432 # Don't check for shared/static. Everything works.
3433 # This might be a little naive. We might want to check
3434 # whether the library exists or not. But this is on
3435 # osf3 & osf4 and I'm not really sure... Just
3436 # implementing what was already the behavior.
3440 # This code stresses the "libraries are programs" paradigm to its
3441 # limits. Maybe even breaks it. We compile a program, linking it
3442 # against the deplibs as a proxy for the library. Then we can check
3443 # whether they linked in statically or dynamically with ldd.
3445 cat > conftest.c <<EOF
3446 int main() { return 0; }
3449 $LTCC -o conftest conftest.c $deplibs
3450 if test "$?" -eq 0 ; then
3451 ldd_output=`ldd conftest`
3452 for i in $deplibs; do
3453 name="`expr $i : '-l\(.*\)'`"
3454 # If $name is empty we are operating on a -L argument.
3455 if test "$name" != "" && test "$name" -ne "0"; then
3456 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3457 case " $predeps $postdeps " in
3459 newdeplibs="$newdeplibs $i"
3464 if test -n "$i" ; then
3465 libname=`eval \\$echo \"$libname_spec\"`
3466 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3467 set dummy $deplib_matches
3469 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3470 newdeplibs="$newdeplibs $i"
3474 $echo "*** Warning: dynamic linker does not accept needed library $i."
3475 $echo "*** I have the capability to make that library automatically link in when"
3476 $echo "*** you link to this library. But I can only do this if you have a"
3477 $echo "*** shared version of the library, which I believe you do not have"
3478 $echo "*** because a test_compile did reveal that the linker did not use it for"
3479 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3483 newdeplibs="$newdeplibs $i"
3487 # Error occurred in the first compile. Let's try to salvage
3488 # the situation: Compile a separate program for each library.
3489 for i in $deplibs; do
3490 name="`expr $i : '-l\(.*\)'`"
3491 # If $name is empty we are operating on a -L argument.
3492 if test "$name" != "" && test "$name" != "0"; then
3494 $LTCC -o conftest conftest.c $i
3496 if test "$?" -eq 0 ; then
3497 ldd_output=`ldd conftest`
3498 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3499 case " $predeps $postdeps " in
3501 newdeplibs="$newdeplibs $i"
3506 if test -n "$i" ; then
3507 libname=`eval \\$echo \"$libname_spec\"`
3508 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3509 set dummy $deplib_matches
3511 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3512 newdeplibs="$newdeplibs $i"
3516 $echo "*** Warning: dynamic linker does not accept needed library $i."
3517 $echo "*** I have the capability to make that library automatically link in when"
3518 $echo "*** you link to this library. But I can only do this if you have a"
3519 $echo "*** shared version of the library, which you do not appear to have"
3520 $echo "*** because a test_compile did reveal that the linker did not use this one"
3521 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3527 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3528 $echo "*** make it link in! You will probably need to install it or some"
3529 $echo "*** library that it depends on before this library will be fully"
3530 $echo "*** functional. Installing it before continuing would be even better."
3533 newdeplibs="$newdeplibs $i"
3539 set dummy $deplibs_check_method
3540 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3541 for a_deplib in $deplibs; do
3542 name="`expr $a_deplib : '-l\(.*\)'`"
3543 # If $name is empty we are operating on a -L argument.
3544 if test "$name" != "" && test "$name" != "0"; then
3545 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3546 case " $predeps $postdeps " in
3548 newdeplibs="$newdeplibs $a_deplib"
3553 if test -n "$a_deplib" ; then
3554 libname=`eval \\$echo \"$libname_spec\"`
3555 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3556 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3557 for potent_lib in $potential_libs; do
3558 # Follow soft links.
3559 if ls -lLd "$potent_lib" 2>/dev/null \
3560 | grep " -> " >/dev/null; then
3563 # The statement above tries to avoid entering an
3564 # endless loop below, in case of cyclic links.
3565 # We might still enter an endless loop, since a link
3566 # loop can be closed while we follow links,
3568 potlib="$potent_lib"
3569 while test -h "$potlib" 2>/dev/null; do
3570 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3572 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3573 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3576 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3578 | $EGREP "$file_magic_regex" > /dev/null; then
3579 newdeplibs="$newdeplibs $a_deplib"
3586 if test -n "$a_deplib" ; then
3589 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3590 $echo "*** I have the capability to make that library automatically link in when"
3591 $echo "*** you link to this library. But I can only do this if you have a"
3592 $echo "*** shared version of the library, which you do not appear to have"
3593 $echo "*** because I did check the linker path looking for a file starting"
3594 if test -z "$potlib" ; then
3595 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3597 $echo "*** with $libname and none of the candidates passed a file format test"
3598 $echo "*** using a file magic. Last file checked: $potlib"
3602 # Add a -L argument.
3603 newdeplibs="$newdeplibs $a_deplib"
3605 done # Gone through all deplibs.
3608 set dummy $deplibs_check_method
3609 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3610 for a_deplib in $deplibs; do
3611 name="`expr $a_deplib : '-l\(.*\)'`"
3612 # If $name is empty we are operating on a -L argument.
3613 if test -n "$name" && test "$name" != "0"; then
3614 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3615 case " $predeps $postdeps " in
3617 newdeplibs="$newdeplibs $a_deplib"
3622 if test -n "$a_deplib" ; then
3623 libname=`eval \\$echo \"$libname_spec\"`
3624 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3625 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3626 for potent_lib in $potential_libs; do
3627 potlib="$potent_lib" # see symlink-check above in file_magic test
3628 if eval $echo \"$potent_lib\" 2>/dev/null \
3630 | $EGREP "$match_pattern_regex" > /dev/null; then
3631 newdeplibs="$newdeplibs $a_deplib"
3638 if test -n "$a_deplib" ; then
3641 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3642 $echo "*** I have the capability to make that library automatically link in when"
3643 $echo "*** you link to this library. But I can only do this if you have a"
3644 $echo "*** shared version of the library, which you do not appear to have"
3645 $echo "*** because I did check the linker path looking for a file starting"
3646 if test -z "$potlib" ; then
3647 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3649 $echo "*** with $libname and none of the candidates passed a file format test"
3650 $echo "*** using a regex pattern. Last file checked: $potlib"
3654 # Add a -L argument.
3655 newdeplibs="$newdeplibs $a_deplib"
3657 done # Gone through all deplibs.
3661 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3662 -e 's/ -[LR][^ ]*//g'`
3663 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3664 for i in $predeps $postdeps ; do
3665 # can't use Xsed below, because $i might contain '/'
3666 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3669 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3670 | grep . >/dev/null; then
3672 if test "X$deplibs_check_method" = "Xnone"; then
3673 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3675 $echo "*** Warning: inter-library dependencies are not known to be supported."
3677 $echo "*** All declared inter-library dependencies are being dropped."
3682 versuffix=$versuffix_save
3684 release=$release_save
3685 libname=$libname_save
3689 *-*-rhapsody* | *-*-darwin1.[012])
3690 # On Rhapsody replace the C library is the System framework
3691 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3695 if test "$droppeddeps" = yes; then
3696 if test "$module" = yes; then
3698 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3699 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3700 $echo "*** a static module, that should work as long as the dlopening"
3701 $echo "*** application is linked with the -dlopen flag."
3702 if test -z "$global_symbol_pipe"; then
3704 $echo "*** However, this would only work if libtool was able to extract symbol"
3705 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3706 $echo "*** not find such a program. So, this module is probably useless."
3707 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3709 if test "$build_old_libs" = no; then
3710 oldlibs="$output_objdir/$libname.$libext"
3711 build_libtool_libs=module
3714 build_libtool_libs=no
3717 $echo "*** The inter-library dependencies that have been dropped here will be"
3718 $echo "*** automatically added whenever a program is linked with this library"
3719 $echo "*** or is declared to -dlopen it."
3721 if test "$allow_undefined" = no; then
3723 $echo "*** Since this library must not contain undefined symbols,"
3724 $echo "*** because either the platform does not support them or"
3725 $echo "*** it was explicitly requested with -no-undefined,"
3726 $echo "*** libtool will only create a static version of it."
3727 if test "$build_old_libs" = no; then
3728 oldlibs="$output_objdir/$libname.$libext"
3729 build_libtool_libs=module
3732 build_libtool_libs=no
3737 # Done checking deplibs!
3741 # All the library-specific variables (install_libdir is set above).
3746 # Test again, we may have decided not to build it any more
3747 if test "$build_libtool_libs" = yes; then
3748 if test "$hardcode_into_libs" = yes; then
3749 # Hardcode the library paths
3752 rpath="$finalize_rpath"
3753 test "$mode" != relink && rpath="$compile_rpath$rpath"
3754 for libdir in $rpath; do
3755 if test -n "$hardcode_libdir_flag_spec"; then
3756 if test -n "$hardcode_libdir_separator"; then
3757 if test -z "$hardcode_libdirs"; then
3758 hardcode_libdirs="$libdir"
3760 # Just accumulate the unique libdirs.
3761 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3762 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3765 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3770 eval flag=\"$hardcode_libdir_flag_spec\"
3771 dep_rpath="$dep_rpath $flag"
3773 elif test -n "$runpath_var"; then
3774 case "$perm_rpath " in
3776 *) perm_rpath="$perm_rpath $libdir" ;;
3780 # Substitute the hardcoded libdirs into the rpath.
3781 if test -n "$hardcode_libdir_separator" &&
3782 test -n "$hardcode_libdirs"; then
3783 libdir="$hardcode_libdirs"
3784 if test -n "$hardcode_libdir_flag_spec_ld"; then
3785 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3787 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3790 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3791 # We should set the runpath_var.
3793 for dir in $perm_rpath; do
3796 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3798 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3801 shlibpath="$finalize_shlibpath"
3802 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3803 if test -n "$shlibpath"; then
3804 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3807 # Get the real and link names of the library.
3808 eval shared_ext=\"$shrext_cmds\"
3809 eval library_names=\"$library_names_spec\"
3810 set dummy $library_names
3814 if test -n "$soname_spec"; then
3815 eval soname=\"$soname_spec\"
3819 if test -z "$dlname"; then
3823 lib="$output_objdir/$realname"
3826 linknames="$linknames $link"
3829 # Use standard objects if they are pic
3830 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3832 # Prepare the list of exported symbols
3833 if test -z "$export_symbols"; then
3834 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3835 $show "generating symbol list for \`$libname.la'"
3836 export_symbols="$output_objdir/$libname.exp"
3837 $run $rm $export_symbols
3838 cmds=$export_symbols_cmds
3839 save_ifs="$IFS"; IFS='~'
3840 for cmd in $cmds; do
3843 if len=`expr "X$cmd" : ".*"` &&
3844 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3846 $run eval "$cmd" || exit $?
3847 skipped_export=false
3849 # The command line is too long to execute in one step.
3850 $show "using reloadable object file for export list..."
3855 if test -n "$export_symbols_regex"; then
3856 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3857 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3858 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3859 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3864 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3865 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3869 for test_deplib in $deplibs; do
3870 case " $convenience " in
3871 *" $test_deplib "*) ;;
3873 tmp_deplibs="$tmp_deplibs $test_deplib"
3877 deplibs="$tmp_deplibs"
3879 if test -n "$convenience"; then
3880 if test -n "$whole_archive_flag_spec"; then
3881 save_libobjs=$libobjs
3882 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3884 gentop="$output_objdir/${outputname}x"
3885 generated="$generated $gentop"
3887 func_extract_archives $gentop $convenience
3888 libobjs="$libobjs $func_extract_archives_result"
3892 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3893 eval flag=\"$thread_safe_flag_spec\"
3894 linker_flags="$linker_flags $flag"
3897 # Make a backup of the uninstalled library when relinking
3898 if test "$mode" = relink; then
3899 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3902 # Do each of the archive commands.
3903 if test "$module" = yes && test -n "$module_cmds" ; then
3904 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3905 eval test_cmds=\"$module_expsym_cmds\"
3906 cmds=$module_expsym_cmds
3908 eval test_cmds=\"$module_cmds\"
3912 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3913 eval test_cmds=\"$archive_expsym_cmds\"
3914 cmds=$archive_expsym_cmds
3916 eval test_cmds=\"$archive_cmds\"
3921 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3922 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3925 # The command line is too long to link in one step, link piecewise.
3926 $echo "creating reloadable object files..."
3928 # Save the value of $output and $libobjs because we want to
3929 # use them later. If we have whole_archive_flag_spec, we
3930 # want to use save_libobjs as it was before
3931 # whole_archive_flag_spec was expanded, because we can't
3932 # assume the linker understands whole_archive_flag_spec.
3933 # This may have to be revisited, in case too many
3934 # convenience libraries get linked in and end up exceeding
3936 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3937 save_libobjs=$libobjs
3940 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3942 # Clear the reloadable object creation command queue and
3943 # initialize k to one.
3950 output=$output_objdir/$output_la-${k}.$objext
3951 # Loop over the list of objects to be linked.
3952 for obj in $save_libobjs
3954 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3955 if test "X$objlist" = X ||
3956 { len=`expr "X$test_cmds" : ".*"` &&
3957 test "$len" -le "$max_cmd_len"; }; then
3958 objlist="$objlist $obj"
3960 # The command $test_cmds is almost too long, add a
3961 # command to the queue.
3962 if test "$k" -eq 1 ; then
3963 # The first file doesn't have a previous command to add.
3964 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3966 # All subsequent reloadable object files will link in
3967 # the last one created.
3968 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3970 last_robj=$output_objdir/$output_la-${k}.$objext
3972 output=$output_objdir/$output_la-${k}.$objext
3977 # Handle the remaining objects by creating one last
3978 # reloadable object file. All subsequent reloadable object
3979 # files will link in the last one created.
3980 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3981 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3983 if ${skipped_export-false}; then
3984 $show "generating symbol list for \`$libname.la'"
3985 export_symbols="$output_objdir/$libname.exp"
3986 $run $rm $export_symbols
3988 # Append the command to create the export file.
3989 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3992 # Set up a command to remove the reloadable object files
3993 # after they are used.
3995 while test "$i" -lt "$k"
3998 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4001 $echo "creating a temporary reloadable object file: $output"
4003 # Loop through the commands generated above and execute them.
4004 save_ifs="$IFS"; IFS='~'
4005 for cmd in $concat_cmds; do
4008 $run eval "$cmd" || exit $?
4013 # Restore the value of output.
4016 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4017 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4019 # Expand the library linking commands again to reset the
4020 # value of $libobjs for piecewise linking.
4022 # Do each of the archive commands.
4023 if test "$module" = yes && test -n "$module_cmds" ; then
4024 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4025 cmds=$module_expsym_cmds
4030 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4031 cmds=$archive_expsym_cmds
4037 # Append the command to remove the reloadable object files
4038 # to the just-reset $cmds.
4039 eval cmds=\"\$cmds~\$rm $delfiles\"
4041 save_ifs="$IFS"; IFS='~'
4042 for cmd in $cmds; do
4046 $run eval "$cmd" || exit $?
4050 # Restore the uninstalled library and exit
4051 if test "$mode" = relink; then
4052 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4056 # Create links to the real library.
4057 for linkname in $linknames; do
4058 if test "$realname" != "$linkname"; then
4059 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4060 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4064 # If -module or -export-dynamic was specified, set the dlname.
4065 if test "$module" = yes || test "$export_dynamic" = yes; then
4066 # On all known operating systems, these are identical.
4073 if test -n "$deplibs"; then
4074 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4077 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4078 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4081 if test -n "$rpath"; then
4082 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4085 if test -n "$xrpath"; then
4086 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4089 if test -n "$vinfo"; then
4090 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4093 if test -n "$release"; then
4094 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4099 if test -n "$objs$old_deplibs"; then
4100 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4104 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4112 # Delete the old objects.
4113 $run $rm $obj $libobj
4115 # Objects from convenience libraries. This assumes
4116 # single-version convenience libraries. Whenever we create
4117 # different ones for PIC/non-PIC, this we'll have to duplicate
4121 # reload_cmds runs $LD directly, so let us get rid of
4122 # -Wl from whole_archive_flag_spec
4125 if test -n "$convenience"; then
4126 if test -n "$whole_archive_flag_spec"; then
4127 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4129 gentop="$output_objdir/${obj}x"
4130 generated="$generated $gentop"
4132 func_extract_archives $gentop $convenience
4133 reload_conv_objs="$reload_objs $func_extract_archives_result"
4137 # Create the old-style object.
4138 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
4142 save_ifs="$IFS"; IFS='~'
4143 for cmd in $cmds; do
4147 $run eval "$cmd" || exit $?
4151 # Exit if we aren't doing a library object file.
4152 if test -z "$libobj"; then
4153 if test -n "$gentop"; then
4154 $show "${rm}r $gentop"
4161 if test "$build_libtool_libs" != yes; then
4162 if test -n "$gentop"; then
4163 $show "${rm}r $gentop"
4167 # Create an invalid libtool object if no PIC, so that we don't
4168 # accidentally link it into a program.
4169 # $show "echo timestamp > $libobj"
4170 # $run eval "echo timestamp > $libobj" || exit $?
4174 if test -n "$pic_flag" || test "$pic_mode" != default; then
4175 # Only do commands if we really have different PIC objects.
4176 reload_objs="$libobjs $reload_conv_objs"
4179 save_ifs="$IFS"; IFS='~'
4180 for cmd in $cmds; do
4184 $run eval "$cmd" || exit $?
4189 if test -n "$gentop"; then
4190 $show "${rm}r $gentop"
4199 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4201 if test -n "$vinfo"; then
4202 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4205 if test -n "$release"; then
4206 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4209 if test "$preload" = yes; then
4210 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4211 test "$dlopen_self_static" = unknown; then
4212 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4217 *-*-rhapsody* | *-*-darwin1.[012])
4218 # On Rhapsody replace the C library is the System framework
4219 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4220 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4226 # Don't allow lazy linking, it breaks C++ global constructors
4227 if test "$tagname" = CXX ; then
4228 compile_command="$compile_command ${wl}-bind_at_load"
4229 finalize_command="$finalize_command ${wl}-bind_at_load"
4234 compile_command="$compile_command $compile_deplibs"
4235 finalize_command="$finalize_command $finalize_deplibs"
4237 if test -n "$rpath$xrpath"; then
4238 # If the user specified any rpath flags, then add them.
4239 for libdir in $rpath $xrpath; do
4240 # This is the magic to use -rpath.
4241 case "$finalize_rpath " in
4243 *) finalize_rpath="$finalize_rpath $libdir" ;;
4248 # Now hardcode the library paths
4251 for libdir in $compile_rpath $finalize_rpath; do
4252 if test -n "$hardcode_libdir_flag_spec"; then
4253 if test -n "$hardcode_libdir_separator"; then
4254 if test -z "$hardcode_libdirs"; then
4255 hardcode_libdirs="$libdir"
4257 # Just accumulate the unique libdirs.
4258 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4259 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4262 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4267 eval flag=\"$hardcode_libdir_flag_spec\"
4268 rpath="$rpath $flag"
4270 elif test -n "$runpath_var"; then
4271 case "$perm_rpath " in
4273 *) perm_rpath="$perm_rpath $libdir" ;;
4277 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4278 case :$dllsearchpath: in
4280 *) dllsearchpath="$dllsearchpath:$libdir";;
4285 # Substitute the hardcoded libdirs into the rpath.
4286 if test -n "$hardcode_libdir_separator" &&
4287 test -n "$hardcode_libdirs"; then
4288 libdir="$hardcode_libdirs"
4289 eval rpath=\" $hardcode_libdir_flag_spec\"
4291 compile_rpath="$rpath"
4295 for libdir in $finalize_rpath; do
4296 if test -n "$hardcode_libdir_flag_spec"; then
4297 if test -n "$hardcode_libdir_separator"; then
4298 if test -z "$hardcode_libdirs"; then
4299 hardcode_libdirs="$libdir"
4301 # Just accumulate the unique libdirs.
4302 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4303 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4306 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4311 eval flag=\"$hardcode_libdir_flag_spec\"
4312 rpath="$rpath $flag"
4314 elif test -n "$runpath_var"; then
4315 case "$finalize_perm_rpath " in
4317 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4321 # Substitute the hardcoded libdirs into the rpath.
4322 if test -n "$hardcode_libdir_separator" &&
4323 test -n "$hardcode_libdirs"; then
4324 libdir="$hardcode_libdirs"
4325 eval rpath=\" $hardcode_libdir_flag_spec\"
4327 finalize_rpath="$rpath"
4329 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4330 # Transform all the library objects into standard objects.
4331 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4332 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4336 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4337 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4338 dlsyms="${outputname}S.c"
4340 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4344 if test -n "$dlsyms"; then
4348 # Discover the nlist of each of the dlfiles.
4349 nlist="$output_objdir/${outputname}.nm"
4351 $show "$rm $nlist ${nlist}S ${nlist}T"
4352 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4354 # Parse the name list into a source file.
4355 $show "creating $output_objdir/$dlsyms"
4357 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4358 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4359 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4365 /* Prevent the only kind of declaration conflicts we can make. */
4366 #define lt_preloaded_symbols some_other_symbol
4368 /* External symbol declarations for the compiler. */\
4371 if test "$dlself" = yes; then
4372 $show "generating symbol list for \`$output'"
4374 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4376 # Add our own program objects to the symbol list.
4377 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4378 for arg in $progfiles; do
4379 $show "extracting global C symbols from \`$arg'"
4380 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4383 if test -n "$exclude_expsyms"; then
4384 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4385 $run eval '$mv "$nlist"T "$nlist"'
4388 if test -n "$export_symbols_regex"; then
4389 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4390 $run eval '$mv "$nlist"T "$nlist"'
4393 # Prepare the list of exported symbols
4394 if test -z "$export_symbols"; then
4395 export_symbols="$output_objdir/$outputname.exp"
4396 $run $rm $export_symbols
4397 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4399 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4400 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4401 $run eval 'mv "$nlist"T "$nlist"'
4405 for arg in $dlprefiles; do
4406 $show "extracting global C symbols from \`$arg'"
4407 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4408 $run eval '$echo ": $name " >> "$nlist"'
4409 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4412 if test -z "$run"; then
4413 # Make sure we have at least an empty file.
4414 test -f "$nlist" || : > "$nlist"
4416 if test -n "$exclude_expsyms"; then
4417 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4418 $mv "$nlist"T "$nlist"
4421 # Try sorting and uniquifying the output.
4422 if grep -v "^: " < "$nlist" |
4423 if sort -k 3 </dev/null >/dev/null 2>&1; then
4428 uniq > "$nlist"S; then
4431 grep -v "^: " < "$nlist" > "$nlist"S
4434 if test -f "$nlist"S; then
4435 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4437 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4440 $echo >> "$output_objdir/$dlsyms" "\
4442 #undef lt_preloaded_symbols
4444 #if defined (__STDC__) && __STDC__
4445 # define lt_ptr void *
4447 # define lt_ptr char *
4451 /* The mapping between symbol names and symbols. */
4455 *cygwin* | *mingw* )
4456 $echo >> "$output_objdir/$dlsyms" "\
4457 /* DATA imports from DLLs on WIN32 can't be const, because
4458 runtime relocations are performed -- see ld's documentation
4464 $echo >> "$output_objdir/$dlsyms" "\
4471 $echo >> "$output_objdir/$dlsyms" "\
4475 lt_preloaded_symbols[] =
4479 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4481 $echo >> "$output_objdir/$dlsyms" "\
4485 /* This works around a problem in FreeBSD linker */
4486 #ifdef FREEBSD_WORKAROUND
4487 static const void *lt_preloaded_setup() {
4488 return lt_preloaded_symbols;
4498 pic_flag_for_symtable=
4500 # compiling the symbol table file with pic_flag works around
4501 # a FreeBSD bug that causes programs to crash when -lm is
4502 # linked before any other PIC object. But we must not use
4503 # pic_flag when linking with -static. The problem exists in
4504 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4505 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4506 case "$compile_command " in
4508 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4511 case "$compile_command " in
4513 *) pic_flag_for_symtable=" $pic_flag";;
4517 # Now compile the dynamic symbol file.
4518 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4519 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4521 # Clean up the generated files.
4522 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4523 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4525 # Transform the symbol file into the correct name.
4526 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4527 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4530 # FreeBSD doesn't need this...
4533 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4538 # We keep going just in case the user didn't refer to
4539 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4540 # really was required.
4542 # Nullify the symbol file.
4543 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4544 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4547 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4548 # Replace the output file specification.
4549 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4550 link_command="$compile_command$compile_rpath"
4552 # We have no uninstalled library dependencies, so finalize right now.
4553 $show "$link_command"
4554 $run eval "$link_command"
4557 # Delete the generated files.
4558 if test -n "$dlsyms"; then
4559 $show "$rm $output_objdir/${outputname}S.${objext}"
4560 $run $rm "$output_objdir/${outputname}S.${objext}"
4566 if test -n "$shlibpath_var"; then
4567 # We should set the shlibpath_var
4569 for dir in $temp_rpath; do
4571 [\\/]* | [A-Za-z]:[\\/]*)
4576 # Relative path: add a thisdir entry.
4577 rpath="$rpath\$thisdir/$dir:"
4584 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4585 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4587 if test -n "$finalize_shlibpath"; then
4588 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4593 if test -n "$runpath_var"; then
4594 if test -n "$perm_rpath"; then
4595 # We should set the runpath_var.
4597 for dir in $perm_rpath; do
4600 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4602 if test -n "$finalize_perm_rpath"; then
4603 # We should set the runpath_var.
4605 for dir in $finalize_perm_rpath; do
4608 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4612 if test "$no_install" = yes; then
4613 # We don't need to create a wrapper script.
4614 link_command="$compile_var$compile_command$compile_rpath"
4615 # Replace the output file specification.
4616 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4617 # Delete the old output file.
4619 # Link the executable and exit
4620 $show "$link_command"
4621 $run eval "$link_command" || exit $?
4625 if test "$hardcode_action" = relink; then
4626 # Fast installation is not supported
4627 link_command="$compile_var$compile_command$compile_rpath"
4628 relink_command="$finalize_var$finalize_command$finalize_rpath"
4630 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4631 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4633 if test "$fast_install" != no; then
4634 link_command="$finalize_var$compile_command$finalize_rpath"
4635 if test "$fast_install" = yes; then
4636 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4638 # fast_install is set to needless
4642 link_command="$compile_var$compile_command$compile_rpath"
4643 relink_command="$finalize_var$finalize_command$finalize_rpath"
4647 # Replace the output file specification.
4648 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4650 # Delete the old output files.
4651 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4653 $show "$link_command"
4654 $run eval "$link_command" || exit $?
4656 # Now create the wrapper script.
4657 $show "creating $output"
4659 # Quote the relink command for shipping.
4660 if test -n "$relink_command"; then
4661 # Preserve any variables that may affect compiler behavior
4662 for var in $variables_saved_for_relink; do
4663 if eval test -z \"\${$var+set}\"; then
4664 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4665 elif eval var_value=\$$var; test -z "$var_value"; then
4666 relink_command="$var=; export $var; $relink_command"
4668 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4669 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4672 relink_command="(cd `pwd`; $relink_command)"
4673 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4676 # Quote $echo for shipping.
4677 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4679 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4680 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4682 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4684 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4687 # Only actually do things if our run command is non-null.
4688 if test -z "$run"; then
4689 # win32 will think the script is a binary if it has
4690 # a .exe suffix, so we strip it off here.
4692 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4694 # test for cygwin because mv fails w/o .exe extensions
4698 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4702 *cygwin* | *mingw* )
4703 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4704 cwrapper=`$echo ${output}.exe`
4705 $rm $cwrappersource $cwrapper
4706 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4708 cat > $cwrappersource <<EOF
4710 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4711 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4713 The $output program cannot be directly executed until all the libtool
4714 libraries that it depends on are installed.
4716 This wrapper executable should never be moved out of the build directory.
4717 If it is, it will not operate correctly.
4719 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4720 but could eventually absorb all of the scripts functionality and
4721 exec $objdir/$outputname directly.
4724 cat >> $cwrappersource<<"EOF"
4732 #if defined(PATH_MAX)
4733 # define LT_PATHMAX PATH_MAX
4734 #elif defined(MAXPATHLEN)
4735 # define LT_PATHMAX MAXPATHLEN
4737 # define LT_PATHMAX 1024
4740 #ifndef DIR_SEPARATOR
4741 #define DIR_SEPARATOR '/'
4744 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4746 #define HAVE_DOS_BASED_FILE_SYSTEM
4747 #ifndef DIR_SEPARATOR_2
4748 #define DIR_SEPARATOR_2 '\\'
4752 #ifndef DIR_SEPARATOR_2
4753 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4754 #else /* DIR_SEPARATOR_2 */
4755 # define IS_DIR_SEPARATOR(ch) \
4756 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4757 #endif /* DIR_SEPARATOR_2 */
4759 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4760 #define XFREE(stale) do { \
4761 if (stale) { free ((void *) stale); stale = 0; } \
4764 const char *program_name = NULL;
4766 void * xmalloc (size_t num);
4767 char * xstrdup (const char *string);
4768 char * basename (const char *name);
4769 char * fnqualify(const char *path);
4770 char * strendzap(char *str, const char *pat);
4771 void lt_fatal (const char *message, ...);
4774 main (int argc, char *argv[])
4779 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4780 newargz = XMALLOC(char *, argc+2);
4783 cat >> $cwrappersource <<EOF
4784 newargz[0] = "$SHELL";
4787 cat >> $cwrappersource <<"EOF"
4788 newargz[1] = fnqualify(argv[0]);
4789 /* we know the script has the same name, without the .exe */
4790 /* so make sure newargz[1] doesn't end in .exe */
4791 strendzap(newargz[1],".exe");
4792 for (i = 1; i < argc; i++)
4793 newargz[i+1] = xstrdup(argv[i]);
4794 newargz[argc+1] = NULL;
4797 cat >> $cwrappersource <<EOF
4798 execv("$SHELL",newargz);
4801 cat >> $cwrappersource <<"EOF"
4805 xmalloc (size_t num)
4807 void * p = (void *) malloc (num);
4809 lt_fatal ("Memory exhausted");
4815 xstrdup (const char *string)
4817 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4822 basename (const char *name)
4826 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4827 /* Skip over the disk name in MSDOS pathnames. */
4828 if (isalpha (name[0]) && name[1] == ':')
4832 for (base = name; *name; name++)
4833 if (IS_DIR_SEPARATOR (*name))
4835 return (char *) base;
4839 fnqualify(const char *path)
4843 char tmp[LT_PATHMAX + 1];
4845 assert(path != NULL);
4847 /* Is it qualified already? */
4848 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4849 if (isalpha (path[0]) && path[1] == ':')
4850 return xstrdup (path);
4852 if (IS_DIR_SEPARATOR (path[0]))
4853 return xstrdup (path);
4855 /* prepend the current directory */
4856 /* doesn't handle '~' */
4857 if (getcwd (tmp, LT_PATHMAX) == NULL)
4858 lt_fatal ("getcwd failed");
4859 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4860 p = XMALLOC(char, size);
4861 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4866 strendzap(char *str, const char *pat)
4870 assert(str != NULL);
4871 assert(pat != NULL);
4874 patlen = strlen(pat);
4878 str += len - patlen;
4879 if (strcmp(str, pat) == 0)
4886 lt_error_core (int exit_status, const char * mode,
4887 const char * message, va_list ap)
4889 fprintf (stderr, "%s: %s: ", program_name, mode);
4890 vfprintf (stderr, message, ap);
4891 fprintf (stderr, ".\n");
4893 if (exit_status >= 0)
4898 lt_fatal (const char *message, ...)
4901 va_start (ap, message);
4902 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4906 # we should really use a build-platform specific compiler
4907 # here, but OTOH, the wrappers (shell script and this C one)
4908 # are only useful if you want to execute the "real" binary.
4909 # Since the "real" binary is built for $host, then this
4910 # wrapper might as well be built for $host, too.
4911 $run $LTCC -s -o $cwrapper $cwrappersource
4915 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4920 # $output - temporary wrapper script for $objdir/$outputname
4921 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4923 # The $output program cannot be directly executed until all the libtool
4924 # libraries that it depends on are installed.
4926 # This wrapper script should never be moved out of the build directory.
4927 # If it is, it will not operate correctly.
4929 # Sed substitution that helps us do robust quoting. It backslashifies
4930 # metacharacters that are still active within double-quoted strings.
4931 Xsed='${SED} -e 1s/^X//'
4932 sed_quote_subst='$sed_quote_subst'
4934 # The HP-UX ksh and POSIX shell print the target directory to stdout
4936 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4938 relink_command=\"$relink_command\"
4940 # This environment variable determines our operation mode.
4941 if test \"\$libtool_install_magic\" = \"$magic\"; then
4942 # install mode needs the following variable:
4943 notinst_deplibs='$notinst_deplibs'
4945 # When we are sourced in execute mode, \$file and \$echo are already set.
4946 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4949 # Make sure echo works.
4950 if test \"X\$1\" = X--no-reexec; then
4951 # Discard the --no-reexec flag, and continue.
4953 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4954 # Yippee, \$echo works!
4957 # Restart under the correct shell, and then maybe \$echo will work.
4958 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4964 # Find the directory that this script lives in.
4965 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4966 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4968 # Follow symbolic links until we get to the real thisdir.
4969 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4970 while test -n \"\$file\"; do
4971 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4973 # If there was a directory component, then change thisdir.
4974 if test \"x\$destdir\" != \"x\$file\"; then
4975 case \"\$destdir\" in
4976 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4977 *) thisdir=\"\$thisdir/\$destdir\" ;;
4981 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4982 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4985 # Try to get the absolute directory name.
4986 absdir=\`cd \"\$thisdir\" && pwd\`
4987 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4990 if test "$fast_install" = yes; then
4992 program=lt-'$outputname'$exeext
4993 progdir=\"\$thisdir/$objdir\"
4995 if test ! -f \"\$progdir/\$program\" || \\
4996 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4997 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4999 file=\"\$\$-\$program\"
5001 if test ! -d \"\$progdir\"; then
5002 $mkdir \"\$progdir\"
5004 $rm \"\$progdir/\$file\"
5009 # relink executable if necessary
5010 if test -n \"\$relink_command\"; then
5011 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5013 $echo \"\$relink_command_output\" >&2
5014 $rm \"\$progdir/\$file\"
5019 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5020 { $rm \"\$progdir/\$program\";
5021 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5022 $rm \"\$progdir/\$file\"
5026 program='$outputname'
5027 progdir=\"\$thisdir/$objdir\"
5033 if test -f \"\$progdir/\$program\"; then"
5035 # Export our shlibpath_var if we have one.
5036 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5038 # Add our own library path to $shlibpath_var
5039 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5041 # Some systems cannot cope with colon-terminated $shlibpath_var
5042 # The second colon is a workaround for a bug in BeOS R4 sed
5043 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5045 export $shlibpath_var
5049 # fixup the dll searchpath if we need to.
5050 if test -n "$dllsearchpath"; then
5052 # Add the dll search path components to the executable PATH
5053 PATH=$dllsearchpath:\$PATH
5058 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5059 # Run the actual program with our arguments.
5062 # Backslashes separate directories on plain windows
5063 *-*-mingw | *-*-os2*)
5065 exec \$progdir\\\\\$program \${1+\"\$@\"}
5071 exec \$progdir/\$program \${1+\"\$@\"}
5076 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5080 # The program doesn't exist.
5081 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5082 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5083 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5094 # See if we need to build an old-fashioned archive.
5095 for oldlib in $oldlibs; do
5097 if test "$build_libtool_libs" = convenience; then
5098 oldobjs="$libobjs_save"
5099 addlibs="$convenience"
5100 build_libtool_libs=no
5102 if test "$build_libtool_libs" = module; then
5103 oldobjs="$libobjs_save"
5104 build_libtool_libs=no
5106 oldobjs="$old_deplibs $non_pic_objects"
5108 addlibs="$old_convenience"
5111 if test -n "$addlibs"; then
5112 gentop="$output_objdir/${outputname}x"
5113 generated="$generated $gentop"
5115 func_extract_archives $gentop $addlibs
5116 oldobjs="$oldobjs $func_extract_archives_result"
5119 # Do each command in the archive commands.
5120 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5121 cmds=$old_archive_from_new_cmds
5123 # POSIX demands no paths to be encoded in archives. We have
5124 # to avoid creating archives with duplicate basenames if we
5125 # might have to extract them afterwards, e.g., when creating a
5126 # static archive out of a convenience library, or when linking
5127 # the entirety of a libtool archive into another (currently
5128 # not supported by libtool).
5129 if (for obj in $oldobjs
5131 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5132 done | sort | sort -uc >/dev/null 2>&1); then
5135 $echo "copying selected object files to avoid basename conflicts..."
5137 if test -z "$gentop"; then
5138 gentop="$output_objdir/${outputname}x"
5139 generated="$generated $gentop"
5141 $show "${rm}r $gentop"
5142 $run ${rm}r "$gentop"
5143 $show "$mkdir $gentop"
5144 $run $mkdir "$gentop"
5146 if test "$status" -ne 0 && test ! -d "$gentop"; then
5151 save_oldobjs=$oldobjs
5154 for obj in $save_oldobjs
5156 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5157 case " $oldobjs " in
5158 " ") oldobjs=$obj ;;
5161 # Make sure we don't pick an alternate name that also
5163 newobj=lt$counter-$objbase
5164 counter=`expr $counter + 1`
5165 case " $oldobjs " in
5166 *[\ /]"$newobj "*) ;;
5167 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5170 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5171 $run ln "$obj" "$gentop/$newobj" ||
5172 $run cp "$obj" "$gentop/$newobj"
5173 oldobjs="$oldobjs $gentop/$newobj"
5175 *) oldobjs="$oldobjs $obj" ;;
5180 eval cmds=\"$old_archive_cmds\"
5182 if len=`expr "X$cmds" : ".*"` &&
5183 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5184 cmds=$old_archive_cmds
5186 # the command line is too long to link in one step, link in parts
5187 $echo "using piecewise archive linking..."
5192 save_oldobjs=$oldobjs
5194 # Is there a better way of finding the last object in the list?
5195 for obj in $save_oldobjs
5199 for obj in $save_oldobjs
5201 oldobjs="$objlist $obj"
5202 objlist="$objlist $obj"
5203 eval test_cmds=\"$old_archive_cmds\"
5204 if len=`expr "X$test_cmds" : ".*"` &&
5205 test "$len" -le "$max_cmd_len"; then
5208 # the above command should be used before it gets too long
5210 if test "$obj" = "$last_oldobj" ; then
5213 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5214 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5220 if test "X$oldobjs" = "X" ; then
5221 eval cmds=\"\$concat_cmds\"
5223 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5227 save_ifs="$IFS"; IFS='~'
5228 for cmd in $cmds; do
5232 $run eval "$cmd" || exit $?
5237 if test -n "$generated"; then
5238 $show "${rm}r$generated"
5239 $run ${rm}r$generated
5242 # Now create the libtool archive.
5246 test "$build_old_libs" = yes && old_library="$libname.$libext"
5247 $show "creating $output"
5249 # Preserve any variables that may affect compiler behavior
5250 for var in $variables_saved_for_relink; do
5251 if eval test -z \"\${$var+set}\"; then
5252 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5253 elif eval var_value=\$$var; test -z "$var_value"; then
5254 relink_command="$var=; export $var; $relink_command"
5256 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5257 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5260 # Quote the link command for shipping.
5261 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5262 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5263 if test "$hardcode_automatic" = yes ; then
5268 # Only create the output if not a dry run.
5269 if test -z "$run"; then
5270 for installed in no yes; do
5271 if test "$installed" = yes; then
5272 if test -z "$install_libdir"; then
5275 output="$output_objdir/$outputname"i
5276 # Replace all uninstalled libtool libraries with the installed ones
5278 for deplib in $dependency_libs; do
5281 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5282 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5283 if test -z "$libdir"; then
5284 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5287 newdependency_libs="$newdependency_libs $libdir/$name"
5289 *) newdependency_libs="$newdependency_libs $deplib" ;;
5292 dependency_libs="$newdependency_libs"
5294 for lib in $dlfiles; do
5295 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5296 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5297 if test -z "$libdir"; then
5298 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5301 newdlfiles="$newdlfiles $libdir/$name"
5303 dlfiles="$newdlfiles"
5305 for lib in $dlprefiles; do
5306 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5307 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5308 if test -z "$libdir"; then
5309 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5312 newdlprefiles="$newdlprefiles $libdir/$name"
5314 dlprefiles="$newdlprefiles"
5317 for lib in $dlfiles; do
5319 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5320 *) abs=`pwd`"/$lib" ;;
5322 newdlfiles="$newdlfiles $abs"
5324 dlfiles="$newdlfiles"
5326 for lib in $dlprefiles; do
5328 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5329 *) abs=`pwd`"/$lib" ;;
5331 newdlprefiles="$newdlprefiles $abs"
5333 dlprefiles="$newdlprefiles"
5336 # place dlname in correct position for cygwin
5338 case $host,$output,$installed,$module,$dlname in
5339 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5342 # $outputname - a libtool library file
5343 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5345 # Please DO NOT delete this file!
5346 # It is necessary for linking the library.
5348 # The name that we can dlopen(3).
5351 # Names of this library.
5352 library_names='$library_names'
5354 # The name of the static archive.
5355 old_library='$old_library'
5357 # Libraries that this one depends upon.
5358 dependency_libs='$dependency_libs'
5360 # Version information for $libname.
5365 # Is this an already installed library?
5366 installed=$installed
5368 # Should we warn about portability when linking against -modules?
5369 shouldnotlink=$module
5371 # Files to dlopen/dlpreopen
5373 dlpreopen='$dlprefiles'
5375 # Directory that this library needs to be installed in:
5376 libdir='$install_libdir'"
5377 if test "$installed" = no && test "$need_relink" = yes; then
5379 relink_command=\"$relink_command\""
5384 # Do a symbolic link so that the libtool archive can be found in
5385 # LD_LIBRARY_PATH before the program is installed.
5386 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5387 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5393 # libtool install mode
5395 modename="$modename: install"
5397 # There may be an optional sh(1) argument at the beginning of
5398 # install_prog (especially on Windows NT).
5399 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5400 # Allow the use of GNU shtool's install command.
5401 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5402 # Aesthetically quote it.
5403 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5405 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5409 install_prog="$arg "
5417 # The real first argument should be the name of the installation program.
5418 # Aesthetically quote it.
5419 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5421 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5425 install_prog="$install_prog$arg"
5427 # We need to accept at least all the BSD install flags.
5437 if test -n "$dest"; then
5438 files="$files $dest"
5456 # If the previous option needed an argument, then skip it.
5457 if test -n "$prev"; then
5466 # Aesthetically quote the argument.
5467 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5469 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5473 install_prog="$install_prog $arg"
5476 if test -z "$install_prog"; then
5477 $echo "$modename: you must specify an install program" 1>&2
5482 if test -n "$prev"; then
5483 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5488 if test -z "$files"; then
5489 if test -z "$dest"; then
5490 $echo "$modename: no file or destination specified" 1>&2
5492 $echo "$modename: you must specify a destination" 1>&2
5498 # Strip any trailing slash from the destination.
5499 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5501 # Check to see that the destination is a directory.
5502 test -d "$dest" && isdir=yes
5503 if test "$isdir" = yes; then
5507 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5508 test "X$destdir" = "X$dest" && destdir=.
5509 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5511 # Not a directory, so check to see that there is only one file specified.
5513 if test "$#" -gt 2; then
5514 $echo "$modename: \`$dest' is not a directory" 1>&2
5520 [\\/]* | [A-Za-z]:[\\/]*) ;;
5522 for file in $files; do
5526 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5535 # This variable tells wrapper scripts just to set variables rather
5536 # than running their programs.
5537 libtool_install_magic="$magic"
5542 for file in $files; do
5544 # Do each installation.
5547 # Do the static libraries later.
5548 staticlibs="$staticlibs $file"
5552 # Check to see that this really is a libtool archive.
5553 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5555 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5563 # If there is no directory component, then add one.
5565 */* | *\\*) . $file ;;
5569 # Add the libdir to current_libdirs if it is the destination.
5570 if test "X$destdir" = "X$libdir"; then
5571 case "$current_libdirs " in
5573 *) current_libdirs="$current_libdirs $libdir" ;;
5576 # Note the libdir as a future libdir.
5577 case "$future_libdirs " in
5579 *) future_libdirs="$future_libdirs $libdir" ;;
5583 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5584 test "X$dir" = "X$file/" && dir=
5587 if test -n "$relink_command"; then
5588 # Determine the prefix the user has applied to our future dir.
5589 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5591 # Don't allow the user to place us outside of our expected
5592 # location b/c this prevents finding dependent libraries that
5593 # are installed to the same prefix.
5594 # At present, this check doesn't affect windows .dll's that
5595 # are installed into $libdir/../bin (currently, that works fine)
5596 # but it's something to keep an eye on.
5597 if test "$inst_prefix_dir" = "$destdir"; then
5598 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5602 if test -n "$inst_prefix_dir"; then
5603 # Stick the inst_prefix_dir data into the link command.
5604 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5606 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5609 $echo "$modename: warning: relinking \`$file'" 1>&2
5610 $show "$relink_command"
5611 if $run eval "$relink_command"; then :
5613 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5618 # See the names of the shared library.
5619 set dummy $library_names
5620 if test -n "$2"; then
5626 test -n "$relink_command" && srcname="$realname"T
5628 # Install the shared library and build the symlinks.
5629 $show "$install_prog $dir/$srcname $destdir/$realname"
5630 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5631 if test -n "$stripme" && test -n "$striplib"; then
5632 $show "$striplib $destdir/$realname"
5633 $run eval "$striplib $destdir/$realname" || exit $?
5636 if test "$#" -gt 0; then
5637 # Delete the old symlinks, and create new ones.
5640 if test "$linkname" != "$realname"; then
5641 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5642 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5647 # Do each command in the postinstall commands.
5648 lib="$destdir/$realname"
5649 cmds=$postinstall_cmds
5650 save_ifs="$IFS"; IFS='~'
5651 for cmd in $cmds; do
5655 $run eval "$cmd" || exit $?
5660 # Install the pseudo-library for information purposes.
5663 # Do not install the useless pseudo-library
5666 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5667 instname="$dir/$name"i
5668 $show "$install_prog $instname $destdir/$name"
5669 $run eval "$install_prog $instname $destdir/$name" || exit $?
5673 # Maybe install the static library, too.
5674 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5678 # Install (i.e. copy) a libtool object.
5680 # Figure out destination file name, if it wasn't already specified.
5681 if test -n "$destname"; then
5682 destfile="$destdir/$destname"
5684 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5685 destfile="$destdir/$destfile"
5688 # Deduce the name of the destination old-style object file.
5691 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5694 staticdest="$destfile"
5698 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5704 # Install the libtool object if requested.
5705 if test -n "$destfile"; then
5706 $show "$install_prog $file $destfile"
5707 $run eval "$install_prog $file $destfile" || exit $?
5710 # Install the old object if enabled.
5711 if test "$build_old_libs" = yes; then
5712 # Deduce the name of the old-style object file.
5713 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5715 $show "$install_prog $staticobj $staticdest"
5716 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5722 # Figure out destination file name, if it wasn't already specified.
5723 if test -n "$destname"; then
5724 destfile="$destdir/$destname"
5726 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5727 destfile="$destdir/$destfile"
5730 # If the file is missing, and there is a .exe on the end, strip it
5731 # because it is most likely a libtool script we actually want to
5736 if test ! -f "$file"; then
5737 file=`$echo $file|${SED} 's,.exe$,,'`
5743 # Do a test to see if this is really a libtool program.
5746 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5752 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5756 # To insure that "foo" is sourced, and not "foo.exe",
5757 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5758 # which disallows the automatic-append-.exe behavior.
5760 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5761 *) wrapperdot=${wrapper} ;;
5763 # If there is no directory component, then add one.
5765 */* | *\\*) . ${wrapperdot} ;;
5766 *) . ./${wrapperdot} ;;
5769 # Check the variables that should have been set.
5770 if test -z "$notinst_deplibs"; then
5771 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5776 for lib in $notinst_deplibs; do
5777 # Check to see that each library is installed.
5779 if test -f "$lib"; then
5780 # If there is no directory component, then add one.
5782 */* | *\\*) . $lib ;;
5786 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5787 if test -n "$libdir" && test ! -f "$libfile"; then
5788 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5794 # To insure that "foo" is sourced, and not "foo.exe",
5795 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5796 # which disallows the automatic-append-.exe behavior.
5798 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5799 *) wrapperdot=${wrapper} ;;
5801 # If there is no directory component, then add one.
5803 */* | *\\*) . ${wrapperdot} ;;
5804 *) . ./${wrapperdot} ;;
5808 if test "$fast_install" = no && test -n "$relink_command"; then
5809 if test "$finalize" = yes && test -z "$run"; then
5811 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5812 tmpdir="$tmpdir/libtool-$$"
5815 if $mkdir "$tmpdir"; then
5819 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5822 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5823 outputname="$tmpdir/$file"
5824 # Replace the output file specification.
5825 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5827 $show "$relink_command"
5828 if $run eval "$relink_command"; then :
5830 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5836 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5839 # Install the binary that we compiled earlier.
5840 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5844 # remove .exe since cygwin /usr/bin/install will append another
5846 case $install_prog,$host in
5847 */usr/bin/install*,*cygwin*)
5848 case $file:$destfile in
5853 destfile=$destfile.exe
5856 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5861 $show "$install_prog$stripme $file $destfile"
5862 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5863 test -n "$outputname" && ${rm}r "$tmpdir"
5868 for file in $staticlibs; do
5869 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5871 # Set up the ranlib parameters.
5872 oldlib="$destdir/$name"
5874 $show "$install_prog $file $oldlib"
5875 $run eval "$install_prog \$file \$oldlib" || exit $?
5877 if test -n "$stripme" && test -n "$old_striplib"; then
5878 $show "$old_striplib $oldlib"
5879 $run eval "$old_striplib $oldlib" || exit $?
5882 # Do each command in the postinstall commands.
5883 cmds=$old_postinstall_cmds
5884 save_ifs="$IFS"; IFS='~'
5885 for cmd in $cmds; do
5889 $run eval "$cmd" || exit $?
5894 if test -n "$future_libdirs"; then
5895 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5898 if test -n "$current_libdirs"; then
5899 # Maybe just do a dry run.
5900 test -n "$run" && current_libdirs=" -n$current_libdirs"
5901 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5907 # libtool finish mode
5909 modename="$modename: finish"
5913 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5916 libdirs="$libdirs $dir"
5919 for libdir in $libdirs; do
5920 if test -n "$finish_cmds"; then
5921 # Do each command in the finish commands.
5923 save_ifs="$IFS"; IFS='~'
5924 for cmd in $cmds; do
5928 $run eval "$cmd" || admincmds="$admincmds
5933 if test -n "$finish_eval"; then
5934 # Do the single finish_eval.
5935 eval cmds=\"$finish_eval\"
5936 $run eval "$cmds" || admincmds="$admincmds
5942 # Exit here if they wanted silent mode.
5943 test "$show" = : && exit $EXIT_SUCCESS
5945 $echo "----------------------------------------------------------------------"
5946 $echo "Libraries have been installed in:"
5947 for libdir in $libdirs; do
5951 $echo "If you ever happen to want to link against installed libraries"
5952 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5953 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5954 $echo "flag during linking and do at least one of the following:"
5955 if test -n "$shlibpath_var"; then
5956 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5957 $echo " during execution"
5959 if test -n "$runpath_var"; then
5960 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5961 $echo " during linking"
5963 if test -n "$hardcode_libdir_flag_spec"; then
5965 eval flag=\"$hardcode_libdir_flag_spec\"
5967 $echo " - use the \`$flag' linker flag"
5969 if test -n "$admincmds"; then
5970 $echo " - have your system administrator run these commands:$admincmds"
5972 if test -f /etc/ld.so.conf; then
5973 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5976 $echo "See any operating system documentation about shared libraries for"
5977 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5978 $echo "----------------------------------------------------------------------"
5982 # libtool execute mode
5984 modename="$modename: execute"
5986 # The first argument is the command name.
5988 if test -z "$cmd"; then
5989 $echo "$modename: you must specify a COMMAND" 1>&2
5994 # Handle -dlopen flags immediately.
5995 for file in $execute_dlfiles; do
5996 if test ! -f "$file"; then
5997 $echo "$modename: \`$file' is not a file" 1>&2
6005 # Check to see that this really is a libtool archive.
6006 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6008 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6013 # Read the libtool library.
6017 # If there is no directory component, then add one.
6019 */* | *\\*) . $file ;;
6023 # Skip this library if it cannot be dlopened.
6024 if test -z "$dlname"; then
6025 # Warn if it was a shared library.
6026 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6030 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6031 test "X$dir" = "X$file" && dir=.
6033 if test -f "$dir/$objdir/$dlname"; then
6036 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6042 # Just add the directory containing the .lo file.
6043 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6044 test "X$dir" = "X$file" && dir=.
6048 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6053 # Get the absolute pathname.
6054 absdir=`cd "$dir" && pwd`
6055 test -n "$absdir" && dir="$absdir"
6057 # Now add the directory to shlibpath_var.
6058 if eval "test -z \"\$$shlibpath_var\""; then
6059 eval "$shlibpath_var=\"\$dir\""
6061 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6065 # This variable tells wrapper scripts just to set shlibpath_var
6066 # rather than running their programs.
6067 libtool_execute_magic="$magic"
6069 # Check if any of the arguments is a wrapper script.
6076 # Do a test to see if this is really a libtool program.
6077 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6078 # If there is no directory component, then add one.
6080 */* | *\\*) . $file ;;
6084 # Transform arg to wrapped name.
6085 file="$progdir/$program"
6089 # Quote arguments (to preserve shell metacharacters).
6090 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6091 args="$args \"$file\""
6094 if test -z "$run"; then
6095 if test -n "$shlibpath_var"; then
6096 # Export the shlibpath_var.
6097 eval "export $shlibpath_var"
6100 # Restore saved environment variables
6101 if test "${save_LC_ALL+set}" = set; then
6102 LC_ALL="$save_LC_ALL"; export LC_ALL
6104 if test "${save_LANG+set}" = set; then
6105 LANG="$save_LANG"; export LANG
6108 # Now prepare to actually exec the command.
6109 exec_cmd="\$cmd$args"
6111 # Display what would be done.
6112 if test -n "$shlibpath_var"; then
6113 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6114 $echo "export $shlibpath_var"
6121 # libtool clean and uninstall mode
6123 modename="$modename: $mode"
6129 # This variable tells wrapper scripts just to set variables rather
6130 # than running their programs.
6131 libtool_install_magic="$magic"
6136 -f) rm="$rm $arg"; rmforce=yes ;;
6137 -*) rm="$rm $arg" ;;
6138 *) files="$files $arg" ;;
6142 if test -z "$rm"; then
6143 $echo "$modename: you must specify an RM program" 1>&2
6150 origobjdir="$objdir"
6151 for file in $files; do
6152 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6153 if test "X$dir" = "X$file"; then
6155 objdir="$origobjdir"
6157 objdir="$dir/$origobjdir"
6159 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6160 test "$mode" = uninstall && objdir="$dir"
6162 # Remember objdir for removal later, being careful to avoid duplicates
6163 if test "$mode" = clean; then
6166 *) rmdirs="$rmdirs $objdir" ;;
6170 # Don't error if the file doesn't exist and rm -f was used.
6171 if (test -L "$file") >/dev/null 2>&1 \
6172 || (test -h "$file") >/dev/null 2>&1 \
6173 || test -f "$file"; then
6175 elif test -d "$file"; then
6178 elif test "$rmforce" = yes; then
6186 # Possibly a libtool archive, so verify it.
6187 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6190 # Delete the libtool libraries and symlinks.
6191 for n in $library_names; do
6192 rmfiles="$rmfiles $objdir/$n"
6194 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6195 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6197 if test "$mode" = uninstall; then
6198 if test -n "$library_names"; then
6199 # Do each command in the postuninstall commands.
6200 cmds=$postuninstall_cmds
6201 save_ifs="$IFS"; IFS='~'
6202 for cmd in $cmds; do
6207 if test "$?" -ne 0 && test "$rmforce" != yes; then
6214 if test -n "$old_library"; then
6215 # Do each command in the old_postuninstall commands.
6216 cmds=$old_postuninstall_cmds
6217 save_ifs="$IFS"; IFS='~'
6218 for cmd in $cmds; do
6223 if test "$?" -ne 0 && test "$rmforce" != yes; then
6229 # FIXME: should reinstall the best remaining shared library.
6235 # Possibly a libtool object, so verify it.
6236 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6241 # Add PIC object to the list of files to remove.
6242 if test -n "$pic_object" \
6243 && test "$pic_object" != none; then
6244 rmfiles="$rmfiles $dir/$pic_object"
6247 # Add non-PIC object to the list of files to remove.
6248 if test -n "$non_pic_object" \
6249 && test "$non_pic_object" != none; then
6250 rmfiles="$rmfiles $dir/$non_pic_object"
6256 if test "$mode" = clean ; then
6260 file=`$echo $file|${SED} 's,.exe$,,'`
6261 noexename=`$echo $name|${SED} 's,.exe$,,'`
6262 # $file with .exe has already been added to rmfiles,
6263 # add $file without .exe
6264 rmfiles="$rmfiles $file"
6267 # Do a test to see if this is a libtool program.
6268 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6272 # note $name still contains .exe if it was in $file originally
6273 # as does the version of $file that was added into $rmfiles
6274 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6275 if test "$fast_install" = yes && test -n "$relink_command"; then
6276 rmfiles="$rmfiles $objdir/lt-$name"
6278 if test "X$noexename" != "X$name" ; then
6279 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6285 $show "$rm $rmfiles"
6286 $run $rm $rmfiles || exit_status=1
6288 objdir="$origobjdir"
6290 # Try to remove the ${objdir}s in the directories where we deleted files
6291 for dir in $rmdirs; do
6292 if test -d "$dir"; then
6294 $run rmdir $dir >/dev/null 2>&1
6302 $echo "$modename: you must specify a MODE" 1>&2
6303 $echo "$generic_help" 1>&2
6308 if test -z "$exec_cmd"; then
6309 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6310 $echo "$generic_help" 1>&2
6313 fi # test -z "$show_help"
6315 if test -n "$exec_cmd"; then
6320 # We need to display help for each of the modes.
6323 "Usage: $modename [OPTION]... [MODE-ARG]...
6325 Provide generalized library-building support services.
6327 --config show all configuration variables
6328 --debug enable verbose shell tracing
6329 -n, --dry-run display commands without modifying any files
6330 --features display basic configuration information and exit
6331 --finish same as \`--mode=finish'
6332 --help display this help message and exit
6333 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6334 --quiet same as \`--silent'
6335 --silent don't print informational messages
6336 --tag=TAG use configuration variables from tag TAG
6337 --version print version information
6339 MODE must be one of the following:
6341 clean remove files from the build directory
6342 compile compile a source file into a libtool object
6343 execute automatically set library path, then run a program
6344 finish complete the installation of libtool libraries
6345 install install libraries or executables
6346 link create a library or an executable
6347 uninstall remove libraries from an installed directory
6349 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6350 a more detailed description of MODE.
6352 Report bugs to <bug-libtool@gnu.org>."
6358 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6360 Remove files from the build directory.
6362 RM is the name of the program to use to delete files associated with each FILE
6363 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6366 If FILE is a libtool library, object or program, all the files associated
6367 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6372 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6374 Compile a source file into a libtool library object.
6376 This mode accepts the following additional options:
6378 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6379 -prefer-pic try to building PIC objects only
6380 -prefer-non-pic try to building non-PIC objects only
6381 -static always build a \`.o' file suitable for static linking
6383 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6384 from the given SOURCEFILE.
6386 The output file name is determined by removing the directory component from
6387 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6388 library object suffix, \`.lo'."
6393 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6395 Automatically set library path, then run a program.
6397 This mode accepts the following additional options:
6399 -dlopen FILE add the directory containing FILE to the library path
6401 This mode sets the library path environment variable according to \`-dlopen'
6404 If any of the ARGS are libtool executable wrappers, then they are translated
6405 into their corresponding uninstalled binary, and any of their required library
6406 directories are added to the library path.
6408 Then, COMMAND is executed, with ARGS as arguments."
6413 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6415 Complete the installation of libtool libraries.
6417 Each LIBDIR is a directory that contains libtool libraries.
6419 The commands that this mode executes may require superuser privileges. Use
6420 the \`--dry-run' option if you just want to see what would be executed."
6425 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6427 Install executables or libraries.
6429 INSTALL-COMMAND is the installation command. The first component should be
6430 either the \`install' or \`cp' program.
6432 The rest of the components are interpreted as arguments to that command (only
6433 BSD-compatible install options are recognized)."
6438 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6440 Link object files or libraries together to form another library, or to
6441 create an executable program.
6443 LINK-COMMAND is a command using the C compiler that you would use to create
6444 a program from several object files.
6446 The following components of LINK-COMMAND are treated specially:
6448 -all-static do not do any dynamic linking at all
6449 -avoid-version do not add a version suffix if possible
6450 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6451 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6452 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6453 -export-symbols SYMFILE
6454 try to export only the symbols listed in SYMFILE
6455 -export-symbols-regex REGEX
6456 try to export only the symbols matching REGEX
6457 -LLIBDIR search LIBDIR for required installed libraries
6458 -lNAME OUTPUT-FILE requires the installed library libNAME
6459 -module build a library that can dlopened
6460 -no-fast-install disable the fast-install mode
6461 -no-install link a not-installable executable
6462 -no-undefined declare that a library does not refer to external symbols
6463 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6464 -objectlist FILE Use a list of object files found in FILE to specify objects
6465 -precious-files-regex REGEX
6466 don't remove output files matching REGEX
6467 -release RELEASE specify package release information
6468 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6469 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6470 -static do not do any dynamic linking of libtool libraries
6471 -version-info CURRENT[:REVISION[:AGE]]
6472 specify library version info [each variable defaults to 0]
6474 All other options (arguments beginning with \`-') are ignored.
6476 Every other argument is treated as a filename. Files ending in \`.la' are
6477 treated as uninstalled libtool libraries, other files are standard or library
6480 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6481 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6482 required, except when creating a convenience library.
6484 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6485 using \`ar' and \`ranlib', or on Windows using \`lib'.
6487 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6488 is created, otherwise an executable program is created."
6493 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6495 Remove libraries from an installation directory.
6497 RM is the name of the program to use to delete files associated with each FILE
6498 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6501 If FILE is a libtool library, all the files associated with it are deleted.
6502 Otherwise, only FILE itself is deleted using RM."
6506 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6513 $echo "Try \`$modename --help' for more information about other modes."
6517 # The TAGs below are defined such that we never get into a situation
6518 # in which we disable both kinds of libraries. Given conflicting
6519 # choices, we go for a static library, that is the most portable,
6520 # since we can't tell whether shared libraries were disabled because
6521 # the user asked for that or because the platform doesn't support
6522 # them. This is particularly important on AIX, because we don't
6523 # support having both static and shared libraries enabled at the same
6524 # time on that platform, so we default to a shared-only configuration.
6525 # If a disable-shared tag is given, we'll fallback to a static-only
6526 # configuration. But we'll never go from static-only to shared-only.
6528 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6529 build_libtool_libs=no
6531 # ### END LIBTOOL TAG CONFIG: disable-shared
6533 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6534 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6535 # ### END LIBTOOL TAG CONFIG: disable-static