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
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
33 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
34 # is ksh but when the shell is invoked as "sh" and the current value of
35 # the _XPG environment variable is not equal to 1 (one), the special
36 # positional parameter $0, within a function call, is the name of the
40 # The name of this program:
41 progname=`echo "$progpath" | $SED $basename`
44 LTCC="`pwd`/$progname --mode=compile $CC"
53 TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
55 # See if we are running on zsh, and set the options which allow our
56 # commands through without removal of \ escapes.
57 if test -n "${ZSH_VERSION+set}" ; then
61 # Check that we have a working $echo.
62 if test "X$1" = X--no-reexec; then
63 # Discard the --no-reexec flag, and continue.
65 elif test "X$1" = X--fallback-echo; then
66 # Avoid inline document here, it may be left over
68 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
69 # Yippee, $echo works!
72 # Restart under the correct shell, and then maybe $echo will work.
73 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
76 if test "X$1" = X--fallback-echo; then
77 # used as fallback echo
86 help="Try \`$progname --help' for more information."
87 magic="%%%MAGIC variable%%%"
92 # Sed substitution that helps us do robust quoting. It backslashifies
93 # metacharacters that are still active within double-quoted strings.
94 Xsed="${SED}"' -e 1s/^X//'
95 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
96 # test EBCDIC or ASCII
97 case `echo A|tr A '\301'` in
98 A) # EBCDIC based system
99 SP2NL="tr '\100' '\n'"
100 NL2SP="tr '\r\n' '\100\100'"
102 *) # Assume ASCII based system
103 SP2NL="tr '\040' '\012'"
104 NL2SP="tr '\015\012' '\040\040'"
109 # Only set LANG and LC_ALL to C if already set.
110 # These must not be set unconditionally because not all systems understand
111 # e.g. LANG=C (notably SCO).
112 # We save the old values to restore during execute mode.
113 if test "${LC_ALL+set}" = set; then
114 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
116 if test "${LANG+set}" = set; then
117 save_LANG="$LANG"; LANG=C; export LANG
120 # Make sure IFS has a sensible default
124 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
125 $echo "$modename: not configured to build any kind of library" 1>&2
126 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
139 lo2o="s/\\.lo\$/.${objext}/"
140 o2lo="s/\\.${objext}\$/.lo/"
142 #####################################
143 # Shell function definitions:
144 # This seems to be the best place for them
146 # func_win32_libid arg
147 # return the library type of file 'arg'
149 # Need a lot of goo to handle *both* DLLs and import libs
150 # Has to be a shell function in order to 'eat' the argument
151 # that is supplied when $file_magic_command is called.
152 func_win32_libid () {
153 win32_libid_type="unknown"
154 win32_fileres=`file -L $1 2>/dev/null`
155 case $win32_fileres in
156 *ar\ archive\ import\ library*) # definitely import
157 win32_libid_type="x86 archive import"
159 *ar\ archive*) # could be an import, or static
160 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
161 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
162 win32_nmres=`eval $NM -f posix -A $1 | \
163 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
164 if test "X$win32_nmres" = "Ximport" ; then
165 win32_libid_type="x86 archive import"
167 win32_libid_type="x86 archive static"
172 win32_libid_type="x86 DLL"
174 *executable*) # but shell scripts are "executable" too...
175 case $win32_fileres in
176 *MS\ Windows\ PE\ Intel*)
177 win32_libid_type="x86 DLL"
182 $echo $win32_libid_type
187 # Infer tagged configuration to use if any are available and
188 # if one wasn't chosen via the "--tag" command line option.
189 # Only attempt this if the compiler in the base compile
190 # command doesn't match the default compiler.
191 # arg is usually of the form 'gcc ...'
193 if test -n "$available_tags" && test -z "$tagname"; then
197 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
201 CC_quoted="$CC_quoted $arg"
204 # Blanks in the command may have been stripped by the calling shell,
205 # but not from the CC environment variable when configure was run.
206 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
207 # Blanks at the start of $base_compile will cause this to fail
208 # if we don't check for them as well.
210 for z in $available_tags; do
211 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
212 # Evaluate the configuration.
213 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
216 # Double-quote args containing other shell metacharacters.
218 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
222 CC_quoted="$CC_quoted $arg"
225 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
226 # The compiler in the base compile command matches
227 # the one in the tagged configuration.
228 # Assume this is the tagged configuration we want.
235 # If $tagname still isn't set, then no tagged configuration
236 # was found and let the user know that the "--tag" command
237 # line option must be used.
238 if test -z "$tagname"; then
239 $echo "$modename: unable to infer tagged configuration"
240 $echo "$modename: specify a tag with \`--tag'" 1>&2
243 # $echo "$modename: using $tagname tagged configuration"
251 # func_extract_archives gentop oldlib ...
252 func_extract_archives () {
253 my_gentop="$1"; shift
261 $show "${rm}r $my_gentop"
262 $run ${rm}r "$my_gentop"
263 $show "$mkdir $my_gentop"
264 $run $mkdir "$my_gentop"
266 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
270 for my_xlib in $my_oldlibs; do
271 # Extract the objects.
273 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
274 *) my_xabs=`pwd`"/$my_xlib" ;;
276 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
277 my_xdir="$my_gentop/$my_xlib"
279 $show "${rm}r $my_xdir"
280 $run ${rm}r "$my_xdir"
281 $show "$mkdir $my_xdir"
282 $run $mkdir "$my_xdir"
284 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
289 $show "Extracting $my_xabs"
290 # Do not bother doing anything if just a dry run
291 if test -z "$run"; then
292 darwin_orig_dir=`pwd`
293 cd $my_xdir || exit $?
294 darwin_archive=$my_xabs
296 darwin_base_archive=`basename $darwin_archive`
297 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
298 if test -n "$darwin_arches"; then
299 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
301 $show "$darwin_base_archive has multiple architectures $darwin_arches"
302 for darwin_arch in $darwin_arches ; do
303 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
304 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
305 # Remove the table of contents from the thin files.
306 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
307 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
308 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
309 $AR -xo "${darwin_base_archive}"
310 rm "${darwin_base_archive}"
312 done # $darwin_arches
313 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
314 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
317 for darwin_file in $darwin_filelist; do
318 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
319 lipo -create -output "$darwin_file" $darwin_files
320 done # $darwin_filelist
322 cd "$darwin_orig_dir"
325 (cd $my_xdir && $AR x $my_xabs) || exit $?
330 # We will extract separately just the conflicting names and we will
331 # no longer touch any unique names. It is faster to leave these
332 # extract automatically by $AR in one run.
333 $show "(cd $my_xdir && $AR x $my_xabs)"
334 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
335 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
338 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
339 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
340 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
343 while test "$i" -le "$count"
345 # Put our $i before any first dot (extension)
346 # Never overwrite any file
348 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
350 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
352 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
353 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
360 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
363 func_extract_archives_result="$my_oldobjs"
365 # End of Shell function definitions
366 #####################################
369 eval std_shrext=\"$shrext_cmds\"
371 # Parse our command line options once, thoroughly.
372 while test "$#" -gt 0
378 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
382 # If the previous option needs an argument, assign it.
383 if test -n "$prev"; then
386 execute_dlfiles="$execute_dlfiles $arg"
390 preserve_args="${preserve_args}=$arg"
392 # Check whether tagname contains only valid characters
395 $echo "$progname: invalid tag name: $tagname" 1>&2
402 # Don't test for the "default" C tag, as we know, it's there, but
403 # not specially marked.
406 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
407 taglist="$taglist $tagname"
408 # Evaluate the configuration.
409 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
411 $echo "$progname: ignoring unknown tag $tagname" 1>&2
426 # Have we seen a non-optional argument yet?
433 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
435 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
436 $echo "This is free software; see the source for copying conditions. There is NO"
437 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
442 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
443 # Now print the configurations for the tags.
444 for tagname in $taglist; do
445 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
451 $echo "$progname: enabling shell trace mode"
453 preserve_args="$preserve_args $arg"
462 if test "$build_libtool_libs" = yes; then
463 $echo "enable shared libraries"
465 $echo "disable shared libraries"
467 if test "$build_old_libs" = yes; then
468 $echo "enable static libraries"
470 $echo "disable static libraries"
475 --finish) mode="finish" ;;
477 --mode) prevopt="--mode" prev=mode ;;
478 --mode=*) mode="$optarg" ;;
480 --preserve-dup-deps) duplicate_deps="yes" ;;
484 preserve_args="$preserve_args $arg"
487 --tag) prevopt="--tag" prev=tag ;;
489 set tag "$optarg" ${1+"$@"}
492 preserve_args="$preserve_args --tag"
501 $echo "$modename: unrecognized option \`$arg'" 1>&2
513 if test -n "$prevopt"; then
514 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
519 # If this variable is set in any of the actions, the command in it
520 # will be execed at the end. This prevents here-documents from being
521 # left over by shells.
524 if test -z "$show_help"; then
526 # Infer the operation mode.
527 if test -z "$mode"; then
528 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
529 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
531 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
543 *db | *dbx | *strace | *truss)
553 # If we have no mode, but dlfiles were specified, then do execute mode.
554 test -n "$execute_dlfiles" && mode=execute
556 # Just use the default operation mode.
557 if test -z "$mode"; then
558 if test -n "$nonopt"; then
559 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
561 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
568 # Only execute mode is allowed to have -dlopen flags.
569 if test -n "$execute_dlfiles" && test "$mode" != execute; then
570 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
575 # Change the help message to a mode-specific one.
577 help="Try \`$modename --help --mode=$mode' for more information."
579 # These modes are in order of execution frequency so that they run quickly.
581 # libtool compile mode
583 modename="$modename: compile"
584 # Get the compilation command and the source file.
586 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
597 # do not "continue". Instead, add this to base_compile
609 # Accept any command-line options.
612 if test -n "$libobj" ; then
613 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
620 -static | -prefer-pic | -prefer-non-pic)
631 arg_mode=arg # the next one goes into the "base_compile" arg list
632 continue # The current "srcfile" will either be retained or
633 ;; # replaced later. I would guess that would be a bug.
636 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
638 save_ifs="$IFS"; IFS=','
642 # Double-quote args containing other shell metacharacters.
643 # Many Bourne shells cannot handle close brackets correctly
644 # in scan sets, so we specify it separately.
646 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
650 lastarg="$lastarg $arg"
653 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
655 # Add the arguments to base_compile.
656 base_compile="$base_compile $lastarg"
661 # Accept the current argument as the source file.
662 # The previous "srcfile" becomes the current argument.
669 esac # case $arg_mode
671 # Aesthetically quote the previous argument.
672 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
675 # Double-quote args containing other shell metacharacters.
676 # Many Bourne shells cannot handle close brackets correctly
677 # in scan sets, so we specify it separately.
678 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
679 lastarg="\"$lastarg\""
683 base_compile="$base_compile $lastarg"
688 $echo "$modename: you must specify an argument for -Xcompile"
692 $echo "$modename: you must specify a target with \`-o'" 1>&2
696 # Get the name of the library object.
697 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
701 # Recognize several different file suffixes.
702 # If the user specifies -o file.o, it is replaced with file.lo
712 *.class) xform=class ;;
717 *.java) xform=java ;;
720 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
723 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
725 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
730 func_infer_tag $base_compile
732 for arg in $later; do
751 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
752 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
753 if test "X$xdir" = "X$obj"; then
758 lobj=${xdir}$objdir/$objname
760 if test -z "$base_compile"; then
761 $echo "$modename: you must specify a compilation command" 1>&2
766 # Delete any leftover library objects.
767 if test "$build_old_libs" = yes; then
768 removelist="$obj $lobj $libobj ${libobj}T"
770 removelist="$lobj $libobj ${libobj}T"
774 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
776 # On Cygwin there's no "real" PIC flag so we must build both object types
778 cygwin* | mingw* | pw32* | os2*)
782 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
783 # non-PIC code in shared libraries is not supported
787 # Calculate the filename of the output object if compiler does
788 # not support -o with -c
789 if test "$compiler_c_o" = no; then
790 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
791 lockfile="$output_obj.lock"
792 removelist="$removelist $output_obj $lockfile"
793 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
800 # Lock this critical section if it is needed
801 # We use this script file to make the link, it avoids creating a new file
802 if test "$need_locks" = yes; then
803 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
804 $show "Waiting for $lockfile to be removed"
807 elif test "$need_locks" = warn; then
808 if test -f "$lockfile"; then
810 *** ERROR, $lockfile exists and contains:
811 `cat $lockfile 2>/dev/null`
813 This indicates that another process is trying to use the same
814 temporary object file, and libtool could not work around it because
815 your compiler does not support \`-c' and \`-o' together. If you
816 repeat this compilation, it may succeed, by chance, but you had better
817 avoid parallel builds (make -j) in this platform, or get a better
823 $echo $srcfile > "$lockfile"
826 if test -n "$fix_srcfile_path"; then
827 eval srcfile=\"$fix_srcfile_path\"
830 $run $rm "$libobj" "${libobj}T"
832 # Create a libtool object file (analogous to a ".la" file),
833 # but don't create it if we're doing a dry run.
834 test -z "$run" && cat > ${libobj}T <<EOF
835 # $libobj - a libtool object file
836 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
838 # Please DO NOT delete this file!
839 # It is necessary for linking the library.
841 # Name of the PIC object.
844 # Only build a PIC object if we are building libtool libraries.
845 if test "$build_libtool_libs" = yes; then
846 # Without this assignment, base_compile gets emptied.
847 fbsd_hideous_sh_bug=$base_compile
849 if test "$pic_mode" != no; then
850 command="$base_compile $srcfile $pic_flag"
852 # Don't build PIC code
853 command="$base_compile $srcfile"
856 if test ! -d "${xdir}$objdir"; then
857 $show "$mkdir ${xdir}$objdir"
858 $run $mkdir ${xdir}$objdir
860 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
865 if test -z "$output_obj"; then
866 # Place PIC objects in $objdir
867 command="$command -o $lobj"
870 $run $rm "$lobj" "$output_obj"
873 if $run eval "$command"; then :
875 test -n "$output_obj" && $run $rm $removelist
879 if test "$need_locks" = warn &&
880 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
882 *** ERROR, $lockfile contains:
883 `cat $lockfile 2>/dev/null`
885 but it should contain:
888 This indicates that another process is trying to use the same
889 temporary object file, and libtool could not work around it because
890 your compiler does not support \`-c' and \`-o' together. If you
891 repeat this compilation, it may succeed, by chance, but you had better
892 avoid parallel builds (make -j) in this platform, or get a better
899 # Just move the object if needed, then go on to compile the next one
900 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
901 $show "$mv $output_obj $lobj"
902 if $run $mv $output_obj $lobj; then :
910 # Append the name of the PIC object to the libtool object file.
911 test -z "$run" && cat >> ${libobj}T <<EOF
912 pic_object='$objdir/$objname'
916 # Allow error messages only from the first compilation.
917 if test "$suppress_opt" = yes; then
918 suppress_output=' >/dev/null 2>&1'
921 # No PIC object so indicate it doesn't exist in the libtool
923 test -z "$run" && cat >> ${libobj}T <<EOF
929 # Only build a position-dependent object if we build old libraries.
930 if test "$build_old_libs" = yes; then
931 if test "$pic_mode" != yes; then
932 # Don't build PIC code
933 command="$base_compile $srcfile"
935 command="$base_compile $srcfile $pic_flag"
937 if test "$compiler_c_o" = yes; then
938 command="$command -o $obj"
941 # Suppress compiler output if we already did a PIC compilation.
942 command="$command$suppress_output"
943 $run $rm "$obj" "$output_obj"
945 if $run eval "$command"; then :
951 if test "$need_locks" = warn &&
952 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
954 *** ERROR, $lockfile contains:
955 `cat $lockfile 2>/dev/null`
957 but it should contain:
960 This indicates that another process is trying to use the same
961 temporary object file, and libtool could not work around it because
962 your compiler does not support \`-c' and \`-o' together. If you
963 repeat this compilation, it may succeed, by chance, but you had better
964 avoid parallel builds (make -j) in this platform, or get a better
971 # Just move the object if needed
972 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
973 $show "$mv $output_obj $obj"
974 if $run $mv $output_obj $obj; then :
982 # Append the name of the non-PIC object the libtool object file.
983 # Only append if the libtool object file exists.
984 test -z "$run" && cat >> ${libobj}T <<EOF
985 # Name of the non-PIC object.
986 non_pic_object='$objname'
990 # Append the name of the non-PIC object the libtool object file.
991 # Only append if the libtool object file exists.
992 test -z "$run" && cat >> ${libobj}T <<EOF
993 # Name of the non-PIC object.
999 $run $mv "${libobj}T" "${libobj}"
1001 # Unlock the critical section if it was locked
1002 if test "$need_locks" != no; then
1003 $run $rm "$lockfile"
1011 modename="$modename: link"
1013 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1014 # It is impossible to link a dll without this setting, and
1015 # we shouldn't force the makefile maintainer to figure out
1016 # which system we are compiling for in order to pass an extra
1017 # flag for every libtool invocation.
1018 # allow_undefined=no
1020 # FIXME: Unfortunately, there are problems with the above when trying
1021 # to make a dll which has undefined symbols, in which case not
1022 # even a static library is built. For now, we need to specify
1023 # -no-undefined on the libtool link line when we can be certain
1024 # that all symbols are satisfied, otherwise we get a static library.
1031 libtool_args="$nonopt"
1032 base_compile="$nonopt $@"
1033 compile_command="$nonopt"
1034 finalize_command="$nonopt"
1047 lib_search_path=`pwd`
1056 export_symbols_regex=
1064 precious_files_regex=
1065 prefer_static_libs=no
1078 func_infer_tag $base_compile
1080 # We need to know -static, to get the right output filenames.
1084 -all-static | -static)
1085 if test "X$arg" = "X-all-static"; then
1086 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1087 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1089 if test -n "$link_static_flag"; then
1090 dlopen_self=$dlopen_self_static
1093 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1094 dlopen_self=$dlopen_self_static
1097 build_libtool_libs=no
1099 prefer_static_libs=yes
1105 # See if our shared archives depend on static archives.
1106 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1108 # Go through the arguments, transforming them on the way.
1109 while test "$#" -gt 0; do
1113 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1114 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1118 libtool_args="$libtool_args $qarg"
1120 # If the previous option needs an argument, assign it.
1121 if test -n "$prev"; then
1124 compile_command="$compile_command @OUTPUT@"
1125 finalize_command="$finalize_command @OUTPUT@"
1131 if test "$preload" = no; then
1132 # Add the symbol object into the linking commands.
1133 compile_command="$compile_command @SYMFILE@"
1134 finalize_command="$finalize_command @SYMFILE@"
1138 *.la | *.lo) ;; # We handle these cases below.
1140 if test "$dlself" = no; then
1148 if test "$prev" = dlprefiles; then
1150 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1160 if test "$prev" = dlfiles; then
1161 dlfiles="$dlfiles $arg"
1163 dlprefiles="$dlprefiles $arg"
1171 export_symbols="$arg"
1172 if test ! -f "$arg"; then
1173 $echo "$modename: symbol file \`$arg' does not exist"
1180 export_symbols_regex="$arg"
1185 inst_prefix_dir="$arg"
1190 precious_files_regex="$arg"
1200 if test -f "$arg"; then
1203 for fil in `cat $save_arg`
1205 # moreargs="$moreargs $fil"
1207 # A libtool-controlled object.
1209 # Check to see that this really is a libtool object.
1210 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1215 # If there is no directory component, then add one.
1217 */* | *\\*) . $arg ;;
1221 if test -z "$pic_object" || \
1222 test -z "$non_pic_object" ||
1223 test "$pic_object" = none && \
1224 test "$non_pic_object" = none; then
1225 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1229 # Extract subdirectory from the argument.
1230 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1231 if test "X$xdir" = "X$arg"; then
1237 if test "$pic_object" != none; then
1238 # Prepend the subdirectory the object is found in.
1239 pic_object="$xdir$pic_object"
1241 if test "$prev" = dlfiles; then
1242 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1243 dlfiles="$dlfiles $pic_object"
1247 # If libtool objects are unsupported, then we need to preload.
1252 # CHECK ME: I think I busted this. -Ossama
1253 if test "$prev" = dlprefiles; then
1254 # Preload the old-style object.
1255 dlprefiles="$dlprefiles $pic_object"
1260 libobjs="$libobjs $pic_object"
1265 if test "$non_pic_object" != none; then
1266 # Prepend the subdirectory the object is found in.
1267 non_pic_object="$xdir$non_pic_object"
1269 # A standard non-PIC object
1270 non_pic_objects="$non_pic_objects $non_pic_object"
1271 if test -z "$pic_object" || test "$pic_object" = none ; then
1272 arg="$non_pic_object"
1276 # Only an error if not doing a dry-run.
1277 if test -z "$run"; then
1278 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1283 # Extract subdirectory from the argument.
1284 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1285 if test "X$xdir" = "X$arg"; then
1291 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1292 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1293 libobjs="$libobjs $pic_object"
1294 non_pic_objects="$non_pic_objects $non_pic_object"
1299 $echo "$modename: link input file \`$save_arg' does not exist"
1307 # We need an absolute path.
1309 [\\/]* | [A-Za-z]:[\\/]*) ;;
1311 $echo "$modename: only absolute run-paths are allowed" 1>&2
1315 if test "$prev" = rpath; then
1318 *) rpath="$rpath $arg" ;;
1323 *) xrpath="$xrpath $arg" ;;
1330 compiler_flags="$compiler_flags $qarg"
1332 compile_command="$compile_command $qarg"
1333 finalize_command="$finalize_command $qarg"
1337 linker_flags="$linker_flags $qarg"
1338 compiler_flags="$compiler_flags $wl$qarg"
1340 compile_command="$compile_command $wl$qarg"
1341 finalize_command="$finalize_command $wl$qarg"
1345 linker_flags="$linker_flags $qarg"
1346 compiler_flags="$compiler_flags $qarg"
1348 compile_command="$compile_command $qarg"
1349 finalize_command="$finalize_command $qarg"
1358 eval "$prev=\"\$arg\""
1363 fi # test -n "$prev"
1369 if test -n "$link_static_flag"; then
1370 compile_command="$compile_command $link_static_flag"
1371 finalize_command="$finalize_command $link_static_flag"
1377 # FIXME: remove this flag sometime in the future.
1378 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1402 -export-symbols | -export-symbols-regex)
1403 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1404 $echo "$modename: more than one -exported-symbols argument is not allowed"
1407 if test "X$arg" = "X-export-symbols"; then
1420 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1421 # so, if we see these flags be careful not to treat them like -L
1423 case $with_gcc/$host in
1424 no/*-*-irix* | /*-*-irix*)
1425 compile_command="$compile_command $arg"
1426 finalize_command="$finalize_command $arg"
1433 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1434 # We need an absolute path.
1436 [\\/]* | [A-Za-z]:[\\/]*) ;;
1438 absdir=`cd "$dir" && pwd`
1439 if test -z "$absdir"; then
1440 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1449 deplibs="$deplibs -L$dir"
1450 lib_search_path="$lib_search_path $dir"
1454 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1455 case :$dllsearchpath: in
1457 *) dllsearchpath="$dllsearchpath:$dir";;
1465 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1467 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1468 # These systems don't actually have a C or math library (as such)
1471 *-*-mingw* | *-*-os2*)
1472 # These systems don't actually have a C library (as such)
1473 test "X$arg" = "X-lc" && continue
1475 *-*-openbsd* | *-*-freebsd*)
1476 # Do not include libc due to us having libc/libc_r.
1477 test "X$arg" = "X-lc" && continue
1479 *-*-rhapsody* | *-*-darwin1.[012])
1480 # Rhapsody C and math libraries are in the System framework
1481 deplibs="$deplibs -framework System"
1484 elif test "X$arg" = "X-lc_r"; then
1486 *-*-openbsd* | *-*-freebsd*)
1487 # Do not include libc_r directly, use -pthread flag.
1492 deplibs="$deplibs $arg"
1496 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1497 deplibs="$deplibs $arg"
1506 # gcc -m* arguments should be passed to the linker via $compiler_flags
1507 # in order to pass architecture information to the linker
1508 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1509 # but this is not reliable with gcc because gcc may use -mfoo to
1510 # select a different linker, different libraries, etc, while
1511 # -Wl,-mfoo simply passes -mfoo to the linker.
1513 # Unknown arguments in both finalize_command and compile_command need
1514 # to be aesthetically quoted because they are evaled later.
1515 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1517 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1521 compile_command="$compile_command $arg"
1522 finalize_command="$finalize_command $arg"
1523 if test "$with_gcc" = "yes" ; then
1524 compiler_flags="$compiler_flags $arg"
1541 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1542 # The PATH hackery in wrapper scripts is required on Windows
1543 # in order for the loader to find any dlls it needs.
1544 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1545 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1548 *) no_install=yes ;;
1565 -precious-files-regex)
1586 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1587 # We need an absolute path.
1589 [\\/]* | [A-Za-z]:[\\/]*) ;;
1591 $echo "$modename: only absolute run-paths are allowed" 1>&2
1597 *) xrpath="$xrpath $dir" ;;
1603 # The effects of -static are defined in a previous loop.
1604 # We used to do the same as -all-static on platforms that
1605 # didn't have a PIC flag, but the assumption that the effects
1606 # would be equivalent was wrong. It would break on at least
1607 # Digital Unix and AIX.
1627 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1629 save_ifs="$IFS"; IFS=','
1630 for flag in $args; do
1633 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1638 compiler_flags="$compiler_flags $flag"
1641 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1645 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1647 save_ifs="$IFS"; IFS=','
1648 for flag in $args; do
1651 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1656 compiler_flags="$compiler_flags $wl$flag"
1657 linker_flags="$linker_flags $flag"
1660 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1678 # Some other compiler flag.
1680 # Unknown arguments in both finalize_command and compile_command need
1681 # to be aesthetically quoted because they are evaled later.
1682 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1691 # A standard object.
1696 # A libtool-controlled object.
1698 # Check to see that this really is a libtool object.
1699 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1704 # If there is no directory component, then add one.
1706 */* | *\\*) . $arg ;;
1710 if test -z "$pic_object" || \
1711 test -z "$non_pic_object" ||
1712 test "$pic_object" = none && \
1713 test "$non_pic_object" = none; then
1714 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1718 # Extract subdirectory from the argument.
1719 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1720 if test "X$xdir" = "X$arg"; then
1726 if test "$pic_object" != none; then
1727 # Prepend the subdirectory the object is found in.
1728 pic_object="$xdir$pic_object"
1730 if test "$prev" = dlfiles; then
1731 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1732 dlfiles="$dlfiles $pic_object"
1736 # If libtool objects are unsupported, then we need to preload.
1741 # CHECK ME: I think I busted this. -Ossama
1742 if test "$prev" = dlprefiles; then
1743 # Preload the old-style object.
1744 dlprefiles="$dlprefiles $pic_object"
1749 libobjs="$libobjs $pic_object"
1754 if test "$non_pic_object" != none; then
1755 # Prepend the subdirectory the object is found in.
1756 non_pic_object="$xdir$non_pic_object"
1758 # A standard non-PIC object
1759 non_pic_objects="$non_pic_objects $non_pic_object"
1760 if test -z "$pic_object" || test "$pic_object" = none ; then
1761 arg="$non_pic_object"
1765 # Only an error if not doing a dry-run.
1766 if test -z "$run"; then
1767 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1772 # Extract subdirectory from the argument.
1773 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1774 if test "X$xdir" = "X$arg"; then
1780 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1781 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1782 libobjs="$libobjs $pic_object"
1783 non_pic_objects="$non_pic_objects $non_pic_object"
1790 deplibs="$deplibs $arg"
1791 old_deplibs="$old_deplibs $arg"
1796 # A libtool-controlled library.
1798 if test "$prev" = dlfiles; then
1799 # This library was specified with -dlopen.
1800 dlfiles="$dlfiles $arg"
1802 elif test "$prev" = dlprefiles; then
1803 # The library was specified with -dlpreopen.
1804 dlprefiles="$dlprefiles $arg"
1807 deplibs="$deplibs $arg"
1812 # Some other compiler argument.
1814 # Unknown arguments in both finalize_command and compile_command need
1815 # to be aesthetically quoted because they are evaled later.
1816 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1818 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1825 # Now actually substitute the argument into the commands.
1826 if test -n "$arg"; then
1827 compile_command="$compile_command $arg"
1828 finalize_command="$finalize_command $arg"
1830 done # argument parsing loop
1832 if test -n "$prev"; then
1833 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1838 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1839 eval arg=\"$export_dynamic_flag_spec\"
1840 compile_command="$compile_command $arg"
1841 finalize_command="$finalize_command $arg"
1845 # calculate the name of the file, without its directory
1846 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1847 libobjs_save="$libobjs"
1849 if test -n "$shlibpath_var"; then
1850 # get the directories listed in $shlibpath_var
1851 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1855 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1856 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1858 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1859 if test "X$output_objdir" = "X$output"; then
1860 output_objdir="$objdir"
1862 output_objdir="$output_objdir/$objdir"
1864 # Create the object directory.
1865 if test ! -d "$output_objdir"; then
1866 $show "$mkdir $output_objdir"
1867 $run $mkdir $output_objdir
1869 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1874 # Determine the type of output
1877 $echo "$modename: you must specify an output file" 1>&2
1881 *.$libext) linkmode=oldlib ;;
1882 *.lo | *.$objext) linkmode=obj ;;
1883 *.la) linkmode=lib ;;
1884 *) linkmode=prog ;; # Anything else should be a program.
1888 *cygwin* | *mingw* | *pw32*)
1889 # don't eliminate duplications in $postdeps and $predeps
1890 duplicate_compiler_generated_deps=yes
1893 duplicate_compiler_generated_deps=$duplicate_deps
1899 # Find all interdependent deplibs by searching for libraries
1900 # that are linked more than once (e.g. -la -lb -la)
1901 for deplib in $deplibs; do
1902 if test "X$duplicate_deps" = "Xyes" ; then
1904 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1907 libs="$libs $deplib"
1910 if test "$linkmode" = lib; then
1911 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1913 # Compute libraries that are listed more than once in $predeps
1914 # $postdeps and mark them as special (i.e., whose duplicates are
1915 # not to be eliminated).
1917 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1918 for pre_post_dep in $predeps $postdeps; do
1919 case "$pre_post_deps " in
1920 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1922 pre_post_deps="$pre_post_deps $pre_post_dep"
1931 need_relink=no # whether we're linking any uninstalled libtool libraries
1932 notinst_deplibs= # not-installed libtool libraries
1933 notinst_path= # paths that contain not-installed libtool libraries
1937 for file in $dlfiles $dlprefiles; do
1941 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1953 passes="conv scan dlopen dlpreopen link"
1958 for pass in $passes; do
1959 if test "$linkmode,$pass" = "lib,link" ||
1960 test "$linkmode,$pass" = "prog,scan"; then
1964 if test "$linkmode" = prog; then
1966 dlopen) libs="$dlfiles" ;;
1967 dlpreopen) libs="$dlprefiles" ;;
1968 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1971 if test "$pass" = dlopen; then
1972 # Collect dlpreopened libraries
1973 save_deplibs="$deplibs"
1976 for deplib in $libs; do
1980 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1981 if test "$linkmode,$pass" = "prog,link"; then
1982 compile_deplibs="$deplib $compile_deplibs"
1983 finalize_deplibs="$deplib $finalize_deplibs"
1985 deplibs="$deplib $deplibs"
1990 if test "$linkmode" != lib && test "$linkmode" != prog; then
1991 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1994 if test "$pass" = conv; then
1995 deplibs="$deplib $deplibs"
1998 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1999 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2000 for search_ext in .la $std_shrext .so .a; do
2001 # Search the libtool library
2002 lib="$searchdir/lib${name}${search_ext}"
2003 if test -f "$lib"; then
2004 if test "$search_ext" = ".la"; then
2013 if test "$found" != yes; then
2014 # deplib doesn't seem to be a libtool library
2015 if test "$linkmode,$pass" = "prog,link"; then
2016 compile_deplibs="$deplib $compile_deplibs"
2017 finalize_deplibs="$deplib $finalize_deplibs"
2019 deplibs="$deplib $deplibs"
2020 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2023 else # deplib is a libtool library
2024 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2025 # We need to do some special things here, and not later.
2026 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2027 case " $predeps $postdeps " in
2029 if (${SED} -e '2q' $lib |
2030 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2034 */* | *\\*) . $lib ;;
2037 for l in $old_library $library_names; do
2040 if test "X$ll" = "X$old_library" ; then # only static version available
2042 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2043 test "X$ladir" = "X$lib" && ladir="."
2044 lib=$ladir/$old_library
2045 if test "$linkmode,$pass" = "prog,link"; then
2046 compile_deplibs="$deplib $compile_deplibs"
2047 finalize_deplibs="$deplib $finalize_deplibs"
2049 deplibs="$deplib $deplibs"
2050 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2064 deplibs="$deplib $deplibs"
2065 test "$pass" = conv && continue
2066 newdependency_libs="$deplib $newdependency_libs"
2067 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2070 if test "$pass" = conv; then
2071 deplibs="$deplib $deplibs"
2074 if test "$pass" = scan; then
2075 deplibs="$deplib $deplibs"
2077 compile_deplibs="$deplib $compile_deplibs"
2078 finalize_deplibs="$deplib $finalize_deplibs"
2080 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2083 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2089 if test "$pass" = link; then
2090 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2091 # Make sure the xrpath contains only unique directories.
2094 *) xrpath="$xrpath $dir" ;;
2097 deplibs="$deplib $deplibs"
2100 *.la) lib="$deplib" ;;
2102 if test "$pass" = conv; then
2103 deplibs="$deplib $deplibs"
2109 case $deplibs_check_method in
2111 set dummy $deplibs_check_method
2112 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2113 if eval $echo \"$deplib\" 2>/dev/null \
2115 | $EGREP "$match_pattern_regex" > /dev/null; then
2123 if test "$valid_a_lib" != yes; then
2125 $echo "*** Warning: Trying to link with static lib archive $deplib."
2126 $echo "*** I have the capability to make that library automatically link in when"
2127 $echo "*** you link to this library. But I can only do this if you have a"
2128 $echo "*** shared version of the library, which you do not appear to have"
2129 $echo "*** because the file extensions .$libext of this argument makes me believe"
2130 $echo "*** that it is just a static archive that I should not used here."
2133 $echo "*** Warning: Linking the shared library $output against the"
2134 $echo "*** static library $deplib is not portable!"
2135 deplibs="$deplib $deplibs"
2140 if test "$pass" != link; then
2141 deplibs="$deplib $deplibs"
2143 compile_deplibs="$deplib $compile_deplibs"
2144 finalize_deplibs="$deplib $finalize_deplibs"
2151 if test "$pass" = conv; then
2152 deplibs="$deplib $deplibs"
2153 elif test "$linkmode" = prog; then
2154 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2155 # If there is no dlopen support or we're linking statically,
2156 # we need to preload.
2157 newdlprefiles="$newdlprefiles $deplib"
2158 compile_deplibs="$deplib $compile_deplibs"
2159 finalize_deplibs="$deplib $finalize_deplibs"
2161 newdlfiles="$newdlfiles $deplib"
2171 if test "$found" = yes || test -f "$lib"; then :
2173 $echo "$modename: cannot find the library \`$lib'" 1>&2
2177 # Check to see that this really is a libtool archive.
2178 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2180 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2184 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2185 test "X$ladir" = "X$lib" && ladir="."
2193 # If the library was installed with an old release of libtool,
2194 # it will not redefine variables installed, or shouldnotlink
2200 */* | *\\*) . $lib ;;
2204 if test "$linkmode,$pass" = "lib,link" ||
2205 test "$linkmode,$pass" = "prog,scan" ||
2206 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2207 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2208 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2211 if test "$pass" = conv; then
2212 # Only check for convenience libraries
2213 deplibs="$lib $deplibs"
2214 if test -z "$libdir"; then
2215 if test -z "$old_library"; then
2216 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2219 # It is a libtool convenience library, so add in its objects.
2220 convenience="$convenience $ladir/$objdir/$old_library"
2221 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2223 for deplib in $dependency_libs; do
2224 deplibs="$deplib $deplibs"
2225 if test "X$duplicate_deps" = "Xyes" ; then
2226 case "$tmp_libs " in
2227 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2230 tmp_libs="$tmp_libs $deplib"
2232 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2233 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2240 # Get the name of the library we link against.
2242 for l in $old_library $library_names; do
2245 if test -z "$linklib"; then
2246 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2250 # This library was specified with -dlopen.
2251 if test "$pass" = dlopen; then
2252 if test -z "$libdir"; then
2253 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2256 if test -z "$dlname" ||
2257 test "$dlopen_support" != yes ||
2258 test "$build_libtool_libs" = no; then
2259 # If there is no dlname, no dlopen support or we're linking
2260 # statically, we need to preload. We also need to preload any
2261 # dependent libraries so libltdl's deplib preloader doesn't
2262 # bomb out in the load deplibs phase.
2263 dlprefiles="$dlprefiles $lib $dependency_libs"
2265 newdlfiles="$newdlfiles $lib"
2270 # We need an absolute path.
2272 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2274 abs_ladir=`cd "$ladir" && pwd`
2275 if test -z "$abs_ladir"; then
2276 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2277 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2282 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2284 # Find the relevant object directory and library name.
2285 if test "X$installed" = Xyes; then
2286 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2287 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2296 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2299 # Remove this search path later
2300 notinst_path="$notinst_path $abs_ladir"
2302 dir="$ladir/$objdir"
2303 absdir="$abs_ladir/$objdir"
2304 # Remove this search path later
2305 notinst_path="$notinst_path $abs_ladir"
2307 fi # $installed = yes
2308 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2310 # This library was specified with -dlpreopen.
2311 if test "$pass" = dlpreopen; then
2312 if test -z "$libdir"; then
2313 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2316 # Prefer using a static library (so that no silly _DYNAMIC symbols
2317 # are required to link).
2318 if test -n "$old_library"; then
2319 newdlprefiles="$newdlprefiles $dir/$old_library"
2320 # Otherwise, use the dlname, so that lt_dlopen finds it.
2321 elif test -n "$dlname"; then
2322 newdlprefiles="$newdlprefiles $dir/$dlname"
2324 newdlprefiles="$newdlprefiles $dir/$linklib"
2326 fi # $pass = dlpreopen
2328 if test -z "$libdir"; then
2329 # Link the convenience library
2330 if test "$linkmode" = lib; then
2331 deplibs="$dir/$old_library $deplibs"
2332 elif test "$linkmode,$pass" = "prog,link"; then
2333 compile_deplibs="$dir/$old_library $compile_deplibs"
2334 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2336 deplibs="$lib $deplibs" # used for prog,scan pass
2342 if test "$linkmode" = prog && test "$pass" != link; then
2343 newlib_search_path="$newlib_search_path $ladir"
2344 deplibs="$lib $deplibs"
2347 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2348 test "$build_libtool_libs" = no; then
2353 for deplib in $dependency_libs; do
2355 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2357 # Need to link against all dependency_libs?
2358 if test "$linkalldeplibs" = yes; then
2359 deplibs="$deplib $deplibs"
2361 # Need to hardcode shared library paths
2362 # or/and link against static libraries
2363 newdependency_libs="$deplib $newdependency_libs"
2365 if test "X$duplicate_deps" = "Xyes" ; then
2366 case "$tmp_libs " in
2367 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2370 tmp_libs="$tmp_libs $deplib"
2373 fi # $linkmode = prog...
2375 if test "$linkmode,$pass" = "prog,link"; then
2376 if test -n "$library_names" &&
2377 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2378 # We need to hardcode the library path
2379 if test -n "$shlibpath_var"; then
2380 # Make sure the rpath contains only unique directories.
2381 case "$temp_rpath " in
2384 *) temp_rpath="$temp_rpath $dir" ;;
2388 # Hardcode the library path.
2389 # Skip directories that are in the system default run-time
2391 case " $sys_lib_dlsearch_path " in
2394 case "$compile_rpath " in
2396 *) compile_rpath="$compile_rpath $absdir"
2400 case " $sys_lib_dlsearch_path " in
2403 case "$finalize_rpath " in
2405 *) finalize_rpath="$finalize_rpath $libdir"
2409 fi # $linkmode,$pass = prog,link...
2411 if test "$alldeplibs" = yes &&
2412 { test "$deplibs_check_method" = pass_all ||
2413 { test "$build_libtool_libs" = yes &&
2414 test -n "$library_names"; }; }; then
2415 # We only need to search for static libraries
2420 link_static=no # Whether the deplib will be linked statically
2421 if test -n "$library_names" &&
2422 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2423 if test "$installed" = no; then
2424 notinst_deplibs="$notinst_deplibs $lib"
2427 # This is a shared library
2429 # Warn about portability, can't link against -module's on
2430 # some systems (darwin)
2431 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2433 if test "$linkmode" = prog; then
2434 $echo "*** Warning: Linking the executable $output against the loadable module"
2436 $echo "*** Warning: Linking the shared library $output against the loadable module"
2438 $echo "*** $linklib is not portable!"
2440 if test "$linkmode" = lib &&
2441 test "$hardcode_into_libs" = yes; then
2442 # Hardcode the library path.
2443 # Skip directories that are in the system default run-time
2445 case " $sys_lib_dlsearch_path " in
2448 case "$compile_rpath " in
2450 *) compile_rpath="$compile_rpath $absdir"
2454 case " $sys_lib_dlsearch_path " in
2457 case "$finalize_rpath " in
2459 *) finalize_rpath="$finalize_rpath $libdir"
2465 if test -n "$old_archive_from_expsyms_cmds"; then
2466 # figure out the soname
2467 set dummy $library_names
2470 libname=`eval \\$echo \"$libname_spec\"`
2471 # use dlname if we got it. it's perfectly good, no?
2472 if test -n "$dlname"; then
2474 elif test -n "$soname_spec"; then
2478 major=`expr $current - $age`
2482 eval soname=\"$soname_spec\"
2487 # Make a new name for the extract_expsyms_cmds to use
2489 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2490 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2492 # If the library has no export list, then create one now
2493 if test -f "$output_objdir/$soname-def"; then :
2495 $show "extracting exported symbol list from \`$soname'"
2496 save_ifs="$IFS"; IFS='~'
2497 cmds=$extract_expsyms_cmds
2498 for cmd in $cmds; do
2502 $run eval "$cmd" || exit $?
2508 if test -f "$output_objdir/$newlib"; then :; else
2509 $show "generating import library for \`$soname'"
2510 save_ifs="$IFS"; IFS='~'
2511 cmds=$old_archive_from_expsyms_cmds
2512 for cmd in $cmds; do
2516 $run eval "$cmd" || exit $?
2520 # make sure the library variables are pointing to the new library
2523 fi # test -n "$old_archive_from_expsyms_cmds"
2525 if test "$linkmode" = prog || test "$mode" != relink; then
2530 case $hardcode_action in
2531 immediate | unsupported)
2532 if test "$hardcode_direct" = no; then
2535 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2537 # if the lib is a module then we can not link against
2538 # it, someone is ignoring the new warnings I added
2539 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2540 $echo "** Warning, lib $linklib is a module, not a shared library"
2541 if test -z "$old_library" ; then
2543 $echo "** And there doesn't seem to be a static archive available"
2544 $echo "** The link will probably fail, sorry"
2546 add="$dir/$old_library"
2550 elif test "$hardcode_minus_L" = no; then
2552 *-*-sunos*) add_shlibpath="$dir" ;;
2556 elif test "$hardcode_shlibpath_var" = no; then
2557 add_shlibpath="$dir"
2564 if test "$hardcode_direct" = yes; then
2566 elif test "$hardcode_minus_L" = yes; then
2568 # Try looking first in the location we're being installed to.
2569 if test -n "$inst_prefix_dir"; then
2572 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2577 elif test "$hardcode_shlibpath_var" = yes; then
2578 add_shlibpath="$dir"
2587 if test "$lib_linked" != yes; then
2588 $echo "$modename: configuration error: unsupported hardcode properties"
2592 if test -n "$add_shlibpath"; then
2593 case :$compile_shlibpath: in
2594 *":$add_shlibpath:"*) ;;
2595 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2598 if test "$linkmode" = prog; then
2599 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2600 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2602 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2603 test -n "$add" && deplibs="$add $deplibs"
2604 if test "$hardcode_direct" != yes && \
2605 test "$hardcode_minus_L" != yes && \
2606 test "$hardcode_shlibpath_var" = yes; then
2607 case :$finalize_shlibpath: in
2609 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2615 if test "$linkmode" = prog || test "$mode" = relink; then
2619 # Finalize command for both is simple: just hardcode it.
2620 if test "$hardcode_direct" = yes; then
2621 add="$libdir/$linklib"
2622 elif test "$hardcode_minus_L" = yes; then
2625 elif test "$hardcode_shlibpath_var" = yes; then
2626 case :$finalize_shlibpath: in
2628 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2631 elif test "$hardcode_automatic" = yes; then
2632 if test -n "$inst_prefix_dir" &&
2633 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2634 add="$inst_prefix_dir$libdir/$linklib"
2636 add="$libdir/$linklib"
2639 # We cannot seem to hardcode it, guess we'll fake it.
2641 # Try looking first in the location we're being installed to.
2642 if test -n "$inst_prefix_dir"; then
2645 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2652 if test "$linkmode" = prog; then
2653 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2654 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2656 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2657 test -n "$add" && deplibs="$add $deplibs"
2660 elif test "$linkmode" = prog; then
2661 # Here we assume that one of hardcode_direct or hardcode_minus_L
2662 # is not unsupported. This is valid on all known static and
2664 if test "$hardcode_direct" != unsupported; then
2665 test -n "$old_library" && linklib="$old_library"
2666 compile_deplibs="$dir/$linklib $compile_deplibs"
2667 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2669 compile_deplibs="-l$name -L$dir $compile_deplibs"
2670 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2672 elif test "$build_libtool_libs" = yes; then
2673 # Not a shared library
2674 if test "$deplibs_check_method" != pass_all; then
2675 # We're trying link a shared library against a static one
2676 # but the system doesn't support it.
2678 # Just print a warning and add the library to dependency_libs so
2679 # that the program can be linked against the static library.
2681 $echo "*** Warning: This system can not link to static lib archive $lib."
2682 $echo "*** I have the capability to make that library automatically link in when"
2683 $echo "*** you link to this library. But I can only do this if you have a"
2684 $echo "*** shared version of the library, which you do not appear to have."
2685 if test "$module" = yes; then
2686 $echo "*** But as you try to build a module library, libtool will still create "
2687 $echo "*** a static module, that should work as long as the dlopening application"
2688 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2689 if test -z "$global_symbol_pipe"; then
2691 $echo "*** However, this would only work if libtool was able to extract symbol"
2692 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2693 $echo "*** not find such a program. So, this module is probably useless."
2694 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2696 if test "$build_old_libs" = no; then
2697 build_libtool_libs=module
2700 build_libtool_libs=no
2704 convenience="$convenience $dir/$old_library"
2705 old_convenience="$old_convenience $dir/$old_library"
2706 deplibs="$dir/$old_library $deplibs"
2709 fi # link shared/static library?
2711 if test "$linkmode" = lib; then
2712 if test -n "$dependency_libs" &&
2713 { test "$hardcode_into_libs" != yes ||
2714 test "$build_old_libs" = yes ||
2715 test "$link_static" = yes; }; then
2716 # Extract -R from dependency_libs
2718 for libdir in $dependency_libs; do
2720 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2722 *" $temp_xrpath "*) ;;
2723 *) xrpath="$xrpath $temp_xrpath";;
2725 *) temp_deplibs="$temp_deplibs $libdir";;
2728 dependency_libs="$temp_deplibs"
2731 newlib_search_path="$newlib_search_path $absdir"
2732 # Link against this library
2733 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2734 # ... and its dependency_libs
2736 for deplib in $dependency_libs; do
2737 newdependency_libs="$deplib $newdependency_libs"
2738 if test "X$duplicate_deps" = "Xyes" ; then
2739 case "$tmp_libs " in
2740 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2743 tmp_libs="$tmp_libs $deplib"
2746 if test "$link_all_deplibs" != no; then
2747 # Add the search paths of all dependency libraries
2748 for deplib in $dependency_libs; do
2750 -L*) path="$deplib" ;;
2752 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2753 test "X$dir" = "X$deplib" && dir="."
2754 # We need an absolute path.
2756 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2758 absdir=`cd "$dir" && pwd`
2759 if test -z "$absdir"; then
2760 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2765 if grep "^installed=no" $deplib > /dev/null; then
2766 path="$absdir/$objdir"
2768 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2769 if test -z "$libdir"; then
2770 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2773 if test "$absdir" != "$libdir"; then
2774 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2781 # we do not want to link against static libs,
2782 # but need to link against shared
2783 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2784 if test -n "$deplibrary_names" ; then
2785 for tmp in $deplibrary_names ; do
2788 if test -f "$path/$depdepl" ; then
2789 depdepl="$path/$depdepl"
2791 # do not add paths which are already there
2792 case " $newlib_search_path " in
2794 *) newlib_search_path="$newlib_search_path $path";;
2807 # Again, we only want to link against shared libraries
2808 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2809 for tmp in $newlib_search_path ; do
2810 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2811 eval depdepl="$tmp/lib$tmp_libs.dylib"
2822 case " $deplibs " in
2824 *) deplibs="$depdepl $deplibs" ;;
2826 case " $deplibs " in
2828 *) deplibs="$deplibs $path" ;;
2831 fi # link_all_deplibs != no
2833 done # for deplib in $libs
2834 dependency_libs="$newdependency_libs"
2835 if test "$pass" = dlpreopen; then
2836 # Link the dlpreopened libraries before other libraries
2837 for deplib in $save_deplibs; do
2838 deplibs="$deplib $deplibs"
2841 if test "$pass" != dlopen; then
2842 if test "$pass" != conv; then
2843 # Make sure lib_search_path contains only unique directories.
2845 for dir in $newlib_search_path; do
2846 case "$lib_search_path " in
2848 *) lib_search_path="$lib_search_path $dir" ;;
2854 if test "$linkmode,$pass" != "prog,link"; then
2857 vars="compile_deplibs finalize_deplibs"
2859 for var in $vars dependency_libs; do
2860 # Add libraries to $var in reverse order
2861 eval tmp_libs=\"\$$var\"
2863 for deplib in $tmp_libs; do
2864 # FIXME: Pedantically, this is the right thing to do, so
2865 # that some nasty dependency loop isn't accidentally
2867 #new_libs="$deplib $new_libs"
2868 # Pragmatically, this seems to cause very few problems in
2871 -L*) new_libs="$deplib $new_libs" ;;
2874 # And here is the reason: when a library appears more
2875 # than once as an explicit dependence of a library, or
2876 # is implicitly linked in more than once by the
2877 # compiler, it is considered special, and multiple
2878 # occurrences thereof are not removed. Compare this
2879 # with having the same library being listed as a
2880 # dependency of multiple other libraries: in this case,
2881 # we know (pedantically, we assume) the library does not
2882 # need to be listed more than once, so we keep only the
2883 # last copy. This is not always right, but it is rare
2884 # enough that we require users that really mean to play
2885 # such unportable linking tricks to link the library
2886 # using -Wl,-lname, so that libtool does not consider it
2887 # for duplicate removal.
2888 case " $specialdeplibs " in
2889 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2891 case " $new_libs " in
2893 *) new_libs="$deplib $new_libs" ;;
2901 for deplib in $new_libs; do
2904 case " $tmp_libs " in
2906 *) tmp_libs="$tmp_libs $deplib" ;;
2909 *) tmp_libs="$tmp_libs $deplib" ;;
2912 eval $var=\"$tmp_libs\"
2915 # Last step: remove runtime libs from dependency_libs
2916 # (they stay in deplibs)
2918 for i in $dependency_libs ; do
2919 case " $predeps $postdeps $compiler_lib_search_path " in
2924 if test -n "$i" ; then
2925 tmp_libs="$tmp_libs $i"
2928 dependency_libs=$tmp_libs
2930 if test "$linkmode" = prog; then
2931 dlfiles="$newdlfiles"
2932 dlprefiles="$newdlprefiles"
2937 if test -n "$deplibs"; then
2938 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2941 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2942 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2945 if test -n "$rpath"; then
2946 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2949 if test -n "$xrpath"; then
2950 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2953 if test -n "$vinfo"; then
2954 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2957 if test -n "$release"; then
2958 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2961 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2962 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2965 # Now set the variables for building old libraries.
2966 build_libtool_libs=no
2968 objs="$objs$old_deplibs"
2972 # Make sure we only generate libraries of the form `libNAME.la'.
2975 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2976 eval shared_ext=\"$shrext_cmds\"
2977 eval libname=\"$libname_spec\"
2980 if test "$module" = no; then
2981 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2985 if test "$need_lib_prefix" != no; then
2986 # Add the "lib" prefix for modules if required
2987 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2988 eval shared_ext=\"$shrext_cmds\"
2989 eval libname=\"$libname_spec\"
2991 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2996 if test -n "$objs"; then
2997 if test "$deplibs_check_method" != pass_all; then
2998 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3002 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3003 $echo "*** objects $objs is not portable!"
3004 libobjs="$libobjs $objs"
3008 if test "$dlself" != no; then
3009 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3013 if test "$#" -gt 2; then
3014 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3019 if test -z "$rpath"; then
3020 if test "$build_libtool_libs" = yes; then
3021 # Building a libtool convenience library.
3022 # Some compilers have problems with a `.al' extension so
3023 # convenience libraries should have the same extension an
3024 # archive normally would.
3025 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3026 build_libtool_libs=convenience
3030 if test -n "$vinfo"; then
3031 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3034 if test -n "$release"; then
3035 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3039 # Parse the version information argument.
3040 save_ifs="$IFS"; IFS=':'
3041 set dummy $vinfo 0 0 0
3044 if test -n "$8"; then
3045 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3050 # convert absolute version numbers to libtool ages
3051 # this retains compatibility with .la files and attempts
3052 # to make the code below a bit more comprehensible
3054 case $vinfo_number in
3058 number_revision="$4"
3060 # There are really only two kinds -- those that
3061 # use the current revision as the major version
3062 # and those that subtract age and use age as
3063 # a minor version. But, then there is irix
3064 # which has an extra 1 added just for fun
3066 case $version_type in
3067 darwin|linux|osf|windows)
3068 current=`expr $number_major + $number_minor`
3070 revision="$number_revision"
3072 freebsd-aout|freebsd-elf|sunos)
3073 current="$number_major"
3074 revision="$number_minor"
3078 current=`expr $number_major + $number_minor - 1`
3080 revision="$number_minor"
3091 # Check that each of the things are valid numbers.
3093 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3095 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3096 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3102 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3104 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3105 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3111 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3113 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3114 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3119 if test "$age" -gt "$current"; then
3120 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3121 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3125 # Calculate the version variables.
3129 case $version_type in
3133 # Like Linux, but with the current version available in
3134 # verstring for coding it into the library header
3135 major=.`expr $current - $age`
3136 versuffix="$major.$age.$revision"
3137 # Darwin ld doesn't like 0 for these options...
3138 minor_current=`expr $current + 1`
3139 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3144 versuffix=".$current.$revision";
3149 versuffix=".$current";
3153 major=`expr $current - $age + 1`
3155 case $version_type in
3156 nonstopux) verstring_prefix=nonstopux ;;
3157 *) verstring_prefix=sgi ;;
3159 verstring="$verstring_prefix$major.$revision"
3161 # Add in all the interfaces that we are compatible with.
3163 while test "$loop" -ne 0; do
3164 iface=`expr $revision - $loop`
3165 loop=`expr $loop - 1`
3166 verstring="$verstring_prefix$major.$iface:$verstring"
3169 # Before this point, $major must not contain `.'.
3171 versuffix="$major.$revision"
3175 major=.`expr $current - $age`
3176 versuffix="$major.$age.$revision"
3180 major=.`expr $current - $age`
3181 versuffix=".$current.$age.$revision"
3182 verstring="$current.$age.$revision"
3184 # Add in all the interfaces that we are compatible with.
3186 while test "$loop" -ne 0; do
3187 iface=`expr $current - $loop`
3188 loop=`expr $loop - 1`
3189 verstring="$verstring:${iface}.0"
3192 # Make executables depend on our current version.
3193 verstring="$verstring:${current}.0"
3198 versuffix=".$current.$revision"
3202 # Use '-' rather than '.', since we only want one
3203 # extension on DOS 8.3 filesystems.
3204 major=`expr $current - $age`
3209 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3210 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3215 # Clear the version info if we defaulted, and they specified a release.
3216 if test -z "$vinfo" && test -n "$release"; then
3218 case $version_type in
3220 # we can't check for "0.0" in archive_cmds due to quoting
3221 # problems, so we reset it completely
3228 if test "$need_version" = no; then
3235 # Remove version info from name if versioning should be avoided
3236 if test "$avoid_version" = yes && test "$need_version" = no; then
3242 # Check to see if the archive will have undefined symbols.
3243 if test "$allow_undefined" = yes; then
3244 if test "$allow_undefined_flag" = unsupported; then
3245 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3246 build_libtool_libs=no
3250 # Don't allow undefined symbols.
3251 allow_undefined_flag="$no_undefined_flag"
3255 if test "$mode" != relink; then
3256 # Remove our outputs, but don't remove object files since they
3257 # may have been created when compiling PIC objects.
3259 tempremovelist=`$echo "$output_objdir/*"`
3260 for p in $tempremovelist; do
3264 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3265 if test "X$precious_files_regex" != "X"; then
3266 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3271 removelist="$removelist $p"
3276 if test -n "$removelist"; then
3277 $show "${rm}r $removelist"
3278 $run ${rm}r $removelist
3282 # Now set the variables for building old libraries.
3283 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3284 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3286 # Transform .lo files to .o files.
3287 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3290 # Eliminate all temporary directories.
3291 for path in $notinst_path; do
3292 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3293 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3294 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3297 if test -n "$xrpath"; then
3298 # If the user specified any rpath flags, then add them.
3300 for libdir in $xrpath; do
3301 temp_xrpath="$temp_xrpath -R$libdir"
3302 case "$finalize_rpath " in
3304 *) finalize_rpath="$finalize_rpath $libdir" ;;
3307 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3308 dependency_libs="$temp_xrpath $dependency_libs"
3312 # Make sure dlfiles contains only unique files that won't be dlpreopened
3313 old_dlfiles="$dlfiles"
3315 for lib in $old_dlfiles; do
3316 case " $dlprefiles $dlfiles " in
3318 *) dlfiles="$dlfiles $lib" ;;
3322 # Make sure dlprefiles contains only unique files
3323 old_dlprefiles="$dlprefiles"
3325 for lib in $old_dlprefiles; do
3326 case "$dlprefiles " in
3328 *) dlprefiles="$dlprefiles $lib" ;;
3332 if test "$build_libtool_libs" = yes; then
3333 if test -n "$rpath"; then
3335 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3336 # these systems don't actually have a c library (as such)!
3338 *-*-rhapsody* | *-*-darwin1.[012])
3339 # Rhapsody C library is in the System framework
3340 deplibs="$deplibs -framework System"
3343 # Don't link with libc until the a.out ld.so is fixed.
3345 *-*-openbsd* | *-*-freebsd*)
3346 # Do not include libc due to us having libc/libc_r.
3347 test "X$arg" = "X-lc" && continue
3350 # Add libc to deplibs on all other systems if necessary.
3351 if test "$build_libtool_need_lc" = "yes"; then
3352 deplibs="$deplibs -lc"
3358 # Transform deplibs into only deplibs that can be linked in shared.
3360 libname_save=$libname
3361 release_save=$release
3362 versuffix_save=$versuffix
3364 # I'm not sure if I'm treating the release correctly. I think
3365 # release should show up in the -l (ie -lgmp5) so we don't want to
3366 # add it in twice. Is that correct?
3372 case $deplibs_check_method in
3374 # Don't check for shared/static. Everything works.
3375 # This might be a little naive. We might want to check
3376 # whether the library exists or not. But this is on
3377 # osf3 & osf4 and I'm not really sure... Just
3378 # implementing what was already the behavior.
3382 # This code stresses the "libraries are programs" paradigm to its
3383 # limits. Maybe even breaks it. We compile a program, linking it
3384 # against the deplibs as a proxy for the library. Then we can check
3385 # whether they linked in statically or dynamically with ldd.
3387 cat > conftest.c <<EOF
3388 int main() { return 0; }
3391 $LTCC -o conftest conftest.c $deplibs
3392 if test "$?" -eq 0 ; then
3393 ldd_output=`ldd conftest`
3394 for i in $deplibs; do
3395 name="`expr $i : '-l\(.*\)'`"
3396 # If $name is empty we are operating on a -L argument.
3397 if test "$name" != "" && test "$name" -ne "0"; then
3398 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3399 case " $predeps $postdeps " in
3401 newdeplibs="$newdeplibs $i"
3406 if test -n "$i" ; then
3407 libname=`eval \\$echo \"$libname_spec\"`
3408 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3409 set dummy $deplib_matches
3411 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3412 newdeplibs="$newdeplibs $i"
3416 $echo "*** Warning: dynamic linker does not accept needed library $i."
3417 $echo "*** I have the capability to make that library automatically link in when"
3418 $echo "*** you link to this library. But I can only do this if you have a"
3419 $echo "*** shared version of the library, which I believe you do not have"
3420 $echo "*** because a test_compile did reveal that the linker did not use it for"
3421 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3425 newdeplibs="$newdeplibs $i"
3429 # Error occurred in the first compile. Let's try to salvage
3430 # the situation: Compile a separate program for each library.
3431 for i in $deplibs; do
3432 name="`expr $i : '-l\(.*\)'`"
3433 # If $name is empty we are operating on a -L argument.
3434 if test "$name" != "" && test "$name" != "0"; then
3436 $LTCC -o conftest conftest.c $i
3438 if test "$?" -eq 0 ; then
3439 ldd_output=`ldd conftest`
3440 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3441 case " $predeps $postdeps " in
3443 newdeplibs="$newdeplibs $i"
3448 if test -n "$i" ; then
3449 libname=`eval \\$echo \"$libname_spec\"`
3450 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3451 set dummy $deplib_matches
3453 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3454 newdeplibs="$newdeplibs $i"
3458 $echo "*** Warning: dynamic linker does not accept needed library $i."
3459 $echo "*** I have the capability to make that library automatically link in when"
3460 $echo "*** you link to this library. But I can only do this if you have a"
3461 $echo "*** shared version of the library, which you do not appear to have"
3462 $echo "*** because a test_compile did reveal that the linker did not use this one"
3463 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3469 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3470 $echo "*** make it link in! You will probably need to install it or some"
3471 $echo "*** library that it depends on before this library will be fully"
3472 $echo "*** functional. Installing it before continuing would be even better."
3475 newdeplibs="$newdeplibs $i"
3481 set dummy $deplibs_check_method
3482 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3483 for a_deplib in $deplibs; do
3484 name="`expr $a_deplib : '-l\(.*\)'`"
3485 # If $name is empty we are operating on a -L argument.
3486 if test "$name" != "" && test "$name" != "0"; then
3487 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3488 case " $predeps $postdeps " in
3490 newdeplibs="$newdeplibs $a_deplib"
3495 if test -n "$a_deplib" ; then
3496 libname=`eval \\$echo \"$libname_spec\"`
3497 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3498 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3499 for potent_lib in $potential_libs; do
3500 # Follow soft links.
3501 if ls -lLd "$potent_lib" 2>/dev/null \
3502 | grep " -> " >/dev/null; then
3505 # The statement above tries to avoid entering an
3506 # endless loop below, in case of cyclic links.
3507 # We might still enter an endless loop, since a link
3508 # loop can be closed while we follow links,
3510 potlib="$potent_lib"
3511 while test -h "$potlib" 2>/dev/null; do
3512 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3514 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3515 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3518 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3520 | $EGREP "$file_magic_regex" > /dev/null; then
3521 newdeplibs="$newdeplibs $a_deplib"
3528 if test -n "$a_deplib" ; then
3531 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3532 $echo "*** I have the capability to make that library automatically link in when"
3533 $echo "*** you link to this library. But I can only do this if you have a"
3534 $echo "*** shared version of the library, which you do not appear to have"
3535 $echo "*** because I did check the linker path looking for a file starting"
3536 if test -z "$potlib" ; then
3537 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3539 $echo "*** with $libname and none of the candidates passed a file format test"
3540 $echo "*** using a file magic. Last file checked: $potlib"
3544 # Add a -L argument.
3545 newdeplibs="$newdeplibs $a_deplib"
3547 done # Gone through all deplibs.
3550 set dummy $deplibs_check_method
3551 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3552 for a_deplib in $deplibs; do
3553 name="`expr $a_deplib : '-l\(.*\)'`"
3554 # If $name is empty we are operating on a -L argument.
3555 if test -n "$name" && test "$name" != "0"; then
3556 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3557 case " $predeps $postdeps " in
3559 newdeplibs="$newdeplibs $a_deplib"
3564 if test -n "$a_deplib" ; then
3565 libname=`eval \\$echo \"$libname_spec\"`
3566 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3567 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3568 for potent_lib in $potential_libs; do
3569 potlib="$potent_lib" # see symlink-check above in file_magic test
3570 if eval $echo \"$potent_lib\" 2>/dev/null \
3572 | $EGREP "$match_pattern_regex" > /dev/null; then
3573 newdeplibs="$newdeplibs $a_deplib"
3580 if test -n "$a_deplib" ; then
3583 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3584 $echo "*** I have the capability to make that library automatically link in when"
3585 $echo "*** you link to this library. But I can only do this if you have a"
3586 $echo "*** shared version of the library, which you do not appear to have"
3587 $echo "*** because I did check the linker path looking for a file starting"
3588 if test -z "$potlib" ; then
3589 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3591 $echo "*** with $libname and none of the candidates passed a file format test"
3592 $echo "*** using a regex pattern. Last file checked: $potlib"
3596 # Add a -L argument.
3597 newdeplibs="$newdeplibs $a_deplib"
3599 done # Gone through all deplibs.
3603 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3604 -e 's/ -[LR][^ ]*//g'`
3605 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3606 for i in $predeps $postdeps ; do
3607 # can't use Xsed below, because $i might contain '/'
3608 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3611 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3612 | grep . >/dev/null; then
3614 if test "X$deplibs_check_method" = "Xnone"; then
3615 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3617 $echo "*** Warning: inter-library dependencies are not known to be supported."
3619 $echo "*** All declared inter-library dependencies are being dropped."
3624 versuffix=$versuffix_save
3626 release=$release_save
3627 libname=$libname_save
3631 *-*-rhapsody* | *-*-darwin1.[012])
3632 # On Rhapsody replace the C library is the System framework
3633 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3637 if test "$droppeddeps" = yes; then
3638 if test "$module" = yes; then
3640 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3641 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3642 $echo "*** a static module, that should work as long as the dlopening"
3643 $echo "*** application is linked with the -dlopen flag."
3644 if test -z "$global_symbol_pipe"; then
3646 $echo "*** However, this would only work if libtool was able to extract symbol"
3647 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3648 $echo "*** not find such a program. So, this module is probably useless."
3649 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3651 if test "$build_old_libs" = no; then
3652 oldlibs="$output_objdir/$libname.$libext"
3653 build_libtool_libs=module
3656 build_libtool_libs=no
3659 $echo "*** The inter-library dependencies that have been dropped here will be"
3660 $echo "*** automatically added whenever a program is linked with this library"
3661 $echo "*** or is declared to -dlopen it."
3663 if test "$allow_undefined" = no; then
3665 $echo "*** Since this library must not contain undefined symbols,"
3666 $echo "*** because either the platform does not support them or"
3667 $echo "*** it was explicitly requested with -no-undefined,"
3668 $echo "*** libtool will only create a static version of it."
3669 if test "$build_old_libs" = no; then
3670 oldlibs="$output_objdir/$libname.$libext"
3671 build_libtool_libs=module
3674 build_libtool_libs=no
3679 # Done checking deplibs!
3683 # All the library-specific variables (install_libdir is set above).
3688 # Test again, we may have decided not to build it any more
3689 if test "$build_libtool_libs" = yes; then
3690 if test "$hardcode_into_libs" = yes; then
3691 # Hardcode the library paths
3694 rpath="$finalize_rpath"
3695 test "$mode" != relink && rpath="$compile_rpath$rpath"
3696 for libdir in $rpath; do
3697 if test -n "$hardcode_libdir_flag_spec"; then
3698 if test -n "$hardcode_libdir_separator"; then
3699 if test -z "$hardcode_libdirs"; then
3700 hardcode_libdirs="$libdir"
3702 # Just accumulate the unique libdirs.
3703 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3704 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3707 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3712 eval flag=\"$hardcode_libdir_flag_spec\"
3713 dep_rpath="$dep_rpath $flag"
3715 elif test -n "$runpath_var"; then
3716 case "$perm_rpath " in
3718 *) perm_rpath="$perm_rpath $libdir" ;;
3722 # Substitute the hardcoded libdirs into the rpath.
3723 if test -n "$hardcode_libdir_separator" &&
3724 test -n "$hardcode_libdirs"; then
3725 libdir="$hardcode_libdirs"
3726 if test -n "$hardcode_libdir_flag_spec_ld"; then
3727 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3729 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3732 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3733 # We should set the runpath_var.
3735 for dir in $perm_rpath; do
3738 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3740 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3743 shlibpath="$finalize_shlibpath"
3744 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3745 if test -n "$shlibpath"; then
3746 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3749 # Get the real and link names of the library.
3750 eval shared_ext=\"$shrext_cmds\"
3751 eval library_names=\"$library_names_spec\"
3752 set dummy $library_names
3756 if test -n "$soname_spec"; then
3757 eval soname=\"$soname_spec\"
3761 if test -z "$dlname"; then
3765 lib="$output_objdir/$realname"
3768 linknames="$linknames $link"
3771 # Use standard objects if they are pic
3772 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3774 # Prepare the list of exported symbols
3775 if test -z "$export_symbols"; then
3776 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3777 $show "generating symbol list for \`$libname.la'"
3778 export_symbols="$output_objdir/$libname.exp"
3779 $run $rm $export_symbols
3780 cmds=$export_symbols_cmds
3781 save_ifs="$IFS"; IFS='~'
3782 for cmd in $cmds; do
3785 if len=`expr "X$cmd" : ".*"` &&
3786 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3788 $run eval "$cmd" || exit $?
3789 skipped_export=false
3791 # The command line is too long to execute in one step.
3792 $show "using reloadable object file for export list..."
3797 if test -n "$export_symbols_regex"; then
3798 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3799 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3800 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3801 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3806 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3807 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3811 for test_deplib in $deplibs; do
3812 case " $convenience " in
3813 *" $test_deplib "*) ;;
3815 tmp_deplibs="$tmp_deplibs $test_deplib"
3819 deplibs="$tmp_deplibs"
3821 if test -n "$convenience"; then
3822 if test -n "$whole_archive_flag_spec"; then
3823 save_libobjs=$libobjs
3824 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3826 gentop="$output_objdir/${outputname}x"
3827 generated="$generated $gentop"
3829 func_extract_archives $gentop $convenience
3830 libobjs="$libobjs $func_extract_archives_result"
3834 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3835 eval flag=\"$thread_safe_flag_spec\"
3836 linker_flags="$linker_flags $flag"
3839 # Make a backup of the uninstalled library when relinking
3840 if test "$mode" = relink; then
3841 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3844 # Do each of the archive commands.
3845 if test "$module" = yes && test -n "$module_cmds" ; then
3846 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3847 eval test_cmds=\"$module_expsym_cmds\"
3848 cmds=$module_expsym_cmds
3850 eval test_cmds=\"$module_cmds\"
3854 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3855 eval test_cmds=\"$archive_expsym_cmds\"
3856 cmds=$archive_expsym_cmds
3858 eval test_cmds=\"$archive_cmds\"
3863 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3864 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3867 # The command line is too long to link in one step, link piecewise.
3868 $echo "creating reloadable object files..."
3870 # Save the value of $output and $libobjs because we want to
3871 # use them later. If we have whole_archive_flag_spec, we
3872 # want to use save_libobjs as it was before
3873 # whole_archive_flag_spec was expanded, because we can't
3874 # assume the linker understands whole_archive_flag_spec.
3875 # This may have to be revisited, in case too many
3876 # convenience libraries get linked in and end up exceeding
3878 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3879 save_libobjs=$libobjs
3883 # Clear the reloadable object creation command queue and
3884 # initialize k to one.
3891 output=$output_objdir/$save_output-${k}.$objext
3892 # Loop over the list of objects to be linked.
3893 for obj in $save_libobjs
3895 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3896 if test "X$objlist" = X ||
3897 { len=`expr "X$test_cmds" : ".*"` &&
3898 test "$len" -le "$max_cmd_len"; }; then
3899 objlist="$objlist $obj"
3901 # The command $test_cmds is almost too long, add a
3902 # command to the queue.
3903 if test "$k" -eq 1 ; then
3904 # The first file doesn't have a previous command to add.
3905 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3907 # All subsequent reloadable object files will link in
3908 # the last one created.
3909 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3911 last_robj=$output_objdir/$save_output-${k}.$objext
3913 output=$output_objdir/$save_output-${k}.$objext
3918 # Handle the remaining objects by creating one last
3919 # reloadable object file. All subsequent reloadable object
3920 # files will link in the last one created.
3921 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3922 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3924 if ${skipped_export-false}; then
3925 $show "generating symbol list for \`$libname.la'"
3926 export_symbols="$output_objdir/$libname.exp"
3927 $run $rm $export_symbols
3929 # Append the command to create the export file.
3930 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3933 # Set up a command to remove the reloadale object files
3934 # after they are used.
3936 while test "$i" -lt "$k"
3939 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3942 $echo "creating a temporary reloadable object file: $output"
3944 # Loop through the commands generated above and execute them.
3945 save_ifs="$IFS"; IFS='~'
3946 for cmd in $concat_cmds; do
3949 $run eval "$cmd" || exit $?
3954 # Restore the value of output.
3957 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3958 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3960 # Expand the library linking commands again to reset the
3961 # value of $libobjs for piecewise linking.
3963 # Do each of the archive commands.
3964 if test "$module" = yes && test -n "$module_cmds" ; then
3965 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3966 cmds=$module_expsym_cmds
3971 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3972 cmds=$archive_expsym_cmds
3978 # Append the command to remove the reloadable object files
3979 # to the just-reset $cmds.
3980 eval cmds=\"\$cmds~\$rm $delfiles\"
3982 save_ifs="$IFS"; IFS='~'
3983 for cmd in $cmds; do
3987 $run eval "$cmd" || exit $?
3991 # Restore the uninstalled library and exit
3992 if test "$mode" = relink; then
3993 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3997 # Create links to the real library.
3998 for linkname in $linknames; do
3999 if test "$realname" != "$linkname"; then
4000 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4001 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4005 # If -module or -export-dynamic was specified, set the dlname.
4006 if test "$module" = yes || test "$export_dynamic" = yes; then
4007 # On all known operating systems, these are identical.
4014 if test -n "$deplibs"; then
4015 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4018 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4019 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4022 if test -n "$rpath"; then
4023 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4026 if test -n "$xrpath"; then
4027 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4030 if test -n "$vinfo"; then
4031 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4034 if test -n "$release"; then
4035 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4040 if test -n "$objs$old_deplibs"; then
4041 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4045 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4053 # Delete the old objects.
4054 $run $rm $obj $libobj
4056 # Objects from convenience libraries. This assumes
4057 # single-version convenience libraries. Whenever we create
4058 # different ones for PIC/non-PIC, this we'll have to duplicate
4062 # reload_cmds runs $LD directly, so let us get rid of
4063 # -Wl from whole_archive_flag_spec
4066 if test -n "$convenience"; then
4067 if test -n "$whole_archive_flag_spec"; then
4068 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4070 gentop="$output_objdir/${obj}x"
4071 generated="$generated $gentop"
4073 func_extract_archives $gentop $convenience
4074 reload_conv_objs="$reload_objs $func_extract_archives_result"
4078 # Create the old-style object.
4079 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
4083 save_ifs="$IFS"; IFS='~'
4084 for cmd in $cmds; do
4088 $run eval "$cmd" || exit $?
4092 # Exit if we aren't doing a library object file.
4093 if test -z "$libobj"; then
4094 if test -n "$gentop"; then
4095 $show "${rm}r $gentop"
4102 if test "$build_libtool_libs" != yes; then
4103 if test -n "$gentop"; then
4104 $show "${rm}r $gentop"
4108 # Create an invalid libtool object if no PIC, so that we don't
4109 # accidentally link it into a program.
4110 # $show "echo timestamp > $libobj"
4111 # $run eval "echo timestamp > $libobj" || exit $?
4115 if test -n "$pic_flag" || test "$pic_mode" != default; then
4116 # Only do commands if we really have different PIC objects.
4117 reload_objs="$libobjs $reload_conv_objs"
4120 save_ifs="$IFS"; IFS='~'
4121 for cmd in $cmds; do
4125 $run eval "$cmd" || exit $?
4130 if test -n "$gentop"; then
4131 $show "${rm}r $gentop"
4140 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4142 if test -n "$vinfo"; then
4143 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4146 if test -n "$release"; then
4147 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4150 if test "$preload" = yes; then
4151 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4152 test "$dlopen_self_static" = unknown; then
4153 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4158 *-*-rhapsody* | *-*-darwin1.[012])
4159 # On Rhapsody replace the C library is the System framework
4160 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4161 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4167 # Don't allow lazy linking, it breaks C++ global constructors
4168 if test "$tagname" = CXX ; then
4169 compile_command="$compile_command ${wl}-bind_at_load"
4170 finalize_command="$finalize_command ${wl}-bind_at_load"
4175 compile_command="$compile_command $compile_deplibs"
4176 finalize_command="$finalize_command $finalize_deplibs"
4178 if test -n "$rpath$xrpath"; then
4179 # If the user specified any rpath flags, then add them.
4180 for libdir in $rpath $xrpath; do
4181 # This is the magic to use -rpath.
4182 case "$finalize_rpath " in
4184 *) finalize_rpath="$finalize_rpath $libdir" ;;
4189 # Now hardcode the library paths
4192 for libdir in $compile_rpath $finalize_rpath; do
4193 if test -n "$hardcode_libdir_flag_spec"; then
4194 if test -n "$hardcode_libdir_separator"; then
4195 if test -z "$hardcode_libdirs"; then
4196 hardcode_libdirs="$libdir"
4198 # Just accumulate the unique libdirs.
4199 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4200 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4203 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4208 eval flag=\"$hardcode_libdir_flag_spec\"
4209 rpath="$rpath $flag"
4211 elif test -n "$runpath_var"; then
4212 case "$perm_rpath " in
4214 *) perm_rpath="$perm_rpath $libdir" ;;
4218 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4219 case :$dllsearchpath: in
4221 *) dllsearchpath="$dllsearchpath:$libdir";;
4226 # Substitute the hardcoded libdirs into the rpath.
4227 if test -n "$hardcode_libdir_separator" &&
4228 test -n "$hardcode_libdirs"; then
4229 libdir="$hardcode_libdirs"
4230 eval rpath=\" $hardcode_libdir_flag_spec\"
4232 compile_rpath="$rpath"
4236 for libdir in $finalize_rpath; do
4237 if test -n "$hardcode_libdir_flag_spec"; then
4238 if test -n "$hardcode_libdir_separator"; then
4239 if test -z "$hardcode_libdirs"; then
4240 hardcode_libdirs="$libdir"
4242 # Just accumulate the unique libdirs.
4243 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4244 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4247 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4252 eval flag=\"$hardcode_libdir_flag_spec\"
4253 rpath="$rpath $flag"
4255 elif test -n "$runpath_var"; then
4256 case "$finalize_perm_rpath " in
4258 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4262 # Substitute the hardcoded libdirs into the rpath.
4263 if test -n "$hardcode_libdir_separator" &&
4264 test -n "$hardcode_libdirs"; then
4265 libdir="$hardcode_libdirs"
4266 eval rpath=\" $hardcode_libdir_flag_spec\"
4268 finalize_rpath="$rpath"
4270 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4271 # Transform all the library objects into standard objects.
4272 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4273 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4277 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4278 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4279 dlsyms="${outputname}S.c"
4281 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4285 if test -n "$dlsyms"; then
4289 # Discover the nlist of each of the dlfiles.
4290 nlist="$output_objdir/${outputname}.nm"
4292 $show "$rm $nlist ${nlist}S ${nlist}T"
4293 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4295 # Parse the name list into a source file.
4296 $show "creating $output_objdir/$dlsyms"
4298 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4299 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4300 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4306 /* Prevent the only kind of declaration conflicts we can make. */
4307 #define lt_preloaded_symbols some_other_symbol
4309 /* External symbol declarations for the compiler. */\
4312 if test "$dlself" = yes; then
4313 $show "generating symbol list for \`$output'"
4315 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4317 # Add our own program objects to the symbol list.
4318 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4319 for arg in $progfiles; do
4320 $show "extracting global C symbols from \`$arg'"
4321 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4324 if test -n "$exclude_expsyms"; then
4325 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4326 $run eval '$mv "$nlist"T "$nlist"'
4329 if test -n "$export_symbols_regex"; then
4330 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4331 $run eval '$mv "$nlist"T "$nlist"'
4334 # Prepare the list of exported symbols
4335 if test -z "$export_symbols"; then
4336 export_symbols="$output_objdir/$output.exp"
4337 $run $rm $export_symbols
4338 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4340 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4341 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4342 $run eval 'mv "$nlist"T "$nlist"'
4346 for arg in $dlprefiles; do
4347 $show "extracting global C symbols from \`$arg'"
4348 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4349 $run eval '$echo ": $name " >> "$nlist"'
4350 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4353 if test -z "$run"; then
4354 # Make sure we have at least an empty file.
4355 test -f "$nlist" || : > "$nlist"
4357 if test -n "$exclude_expsyms"; then
4358 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4359 $mv "$nlist"T "$nlist"
4362 # Try sorting and uniquifying the output.
4363 if grep -v "^: " < "$nlist" |
4364 if sort -k 3 </dev/null >/dev/null 2>&1; then
4369 uniq > "$nlist"S; then
4372 grep -v "^: " < "$nlist" > "$nlist"S
4375 if test -f "$nlist"S; then
4376 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4378 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4381 $echo >> "$output_objdir/$dlsyms" "\
4383 #undef lt_preloaded_symbols
4385 #if defined (__STDC__) && __STDC__
4386 # define lt_ptr void *
4388 # define lt_ptr char *
4392 /* The mapping between symbol names and symbols. */
4397 lt_preloaded_symbols[] =
4401 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4403 $echo >> "$output_objdir/$dlsyms" "\
4407 /* This works around a problem in FreeBSD linker */
4408 #ifdef FREEBSD_WORKAROUND
4409 static const void *lt_preloaded_setup() {
4410 return lt_preloaded_symbols;
4420 pic_flag_for_symtable=
4422 # compiling the symbol table file with pic_flag works around
4423 # a FreeBSD bug that causes programs to crash when -lm is
4424 # linked before any other PIC object. But we must not use
4425 # pic_flag when linking with -static. The problem exists in
4426 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4427 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4428 case "$compile_command " in
4430 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4433 case "$compile_command " in
4435 *) pic_flag_for_symtable=" $pic_flag";;
4439 # Now compile the dynamic symbol file.
4440 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4441 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4443 # Clean up the generated files.
4444 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4445 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4447 # Transform the symbol file into the correct name.
4448 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4449 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4452 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4457 # We keep going just in case the user didn't refer to
4458 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4459 # really was required.
4461 # Nullify the symbol file.
4462 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4463 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4466 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4467 # Replace the output file specification.
4468 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4469 link_command="$compile_command$compile_rpath"
4471 # We have no uninstalled library dependencies, so finalize right now.
4472 $show "$link_command"
4473 $run eval "$link_command"
4476 # Delete the generated files.
4477 if test -n "$dlsyms"; then
4478 $show "$rm $output_objdir/${outputname}S.${objext}"
4479 $run $rm "$output_objdir/${outputname}S.${objext}"
4485 if test -n "$shlibpath_var"; then
4486 # We should set the shlibpath_var
4488 for dir in $temp_rpath; do
4490 [\\/]* | [A-Za-z]:[\\/]*)
4495 # Relative path: add a thisdir entry.
4496 rpath="$rpath\$thisdir/$dir:"
4503 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4504 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4506 if test -n "$finalize_shlibpath"; then
4507 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4512 if test -n "$runpath_var"; then
4513 if test -n "$perm_rpath"; then
4514 # We should set the runpath_var.
4516 for dir in $perm_rpath; do
4519 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4521 if test -n "$finalize_perm_rpath"; then
4522 # We should set the runpath_var.
4524 for dir in $finalize_perm_rpath; do
4527 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4531 if test "$no_install" = yes; then
4532 # We don't need to create a wrapper script.
4533 link_command="$compile_var$compile_command$compile_rpath"
4534 # Replace the output file specification.
4535 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4536 # Delete the old output file.
4538 # Link the executable and exit
4539 $show "$link_command"
4540 $run eval "$link_command" || exit $?
4544 if test "$hardcode_action" = relink; then
4545 # Fast installation is not supported
4546 link_command="$compile_var$compile_command$compile_rpath"
4547 relink_command="$finalize_var$finalize_command$finalize_rpath"
4549 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4550 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4552 if test "$fast_install" != no; then
4553 link_command="$finalize_var$compile_command$finalize_rpath"
4554 if test "$fast_install" = yes; then
4555 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4557 # fast_install is set to needless
4561 link_command="$compile_var$compile_command$compile_rpath"
4562 relink_command="$finalize_var$finalize_command$finalize_rpath"
4566 # Replace the output file specification.
4567 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4569 # Delete the old output files.
4570 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4572 $show "$link_command"
4573 $run eval "$link_command" || exit $?
4575 # Now create the wrapper script.
4576 $show "creating $output"
4578 # Quote the relink command for shipping.
4579 if test -n "$relink_command"; then
4580 # Preserve any variables that may affect compiler behavior
4581 for var in $variables_saved_for_relink; do
4582 if eval test -z \"\${$var+set}\"; then
4583 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4584 elif eval var_value=\$$var; test -z "$var_value"; then
4585 relink_command="$var=; export $var; $relink_command"
4587 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4588 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4591 relink_command="(cd `pwd`; $relink_command)"
4592 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4595 # Quote $echo for shipping.
4596 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4598 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4599 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4601 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4603 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4606 # Only actually do things if our run command is non-null.
4607 if test -z "$run"; then
4608 # win32 will think the script is a binary if it has
4609 # a .exe suffix, so we strip it off here.
4611 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4613 # test for cygwin because mv fails w/o .exe extensions
4617 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4621 *cygwin* | *mingw* )
4622 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4623 cwrapper=`$echo ${output}.exe`
4624 $rm $cwrappersource $cwrapper
4625 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4627 cat > $cwrappersource <<EOF
4629 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4630 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4632 The $output program cannot be directly executed until all the libtool
4633 libraries that it depends on are installed.
4635 This wrapper executable should never be moved out of the build directory.
4636 If it is, it will not operate correctly.
4638 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4639 but could eventually absorb all of the scripts functionality and
4640 exec $objdir/$outputname directly.
4643 cat >> $cwrappersource<<"EOF"
4651 #if defined(PATH_MAX)
4652 # define LT_PATHMAX PATH_MAX
4653 #elif defined(MAXPATHLEN)
4654 # define LT_PATHMAX MAXPATHLEN
4656 # define LT_PATHMAX 1024
4659 #ifndef DIR_SEPARATOR
4660 #define DIR_SEPARATOR '/'
4663 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4665 #define HAVE_DOS_BASED_FILE_SYSTEM
4666 #ifndef DIR_SEPARATOR_2
4667 #define DIR_SEPARATOR_2 '\\'
4671 #ifndef DIR_SEPARATOR_2
4672 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4673 #else /* DIR_SEPARATOR_2 */
4674 # define IS_DIR_SEPARATOR(ch) \
4675 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4676 #endif /* DIR_SEPARATOR_2 */
4678 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4679 #define XFREE(stale) do { \
4680 if (stale) { free ((void *) stale); stale = 0; } \
4683 const char *program_name = NULL;
4685 void * xmalloc (size_t num);
4686 char * xstrdup (const char *string);
4687 char * basename (const char *name);
4688 char * fnqualify(const char *path);
4689 char * strendzap(char *str, const char *pat);
4690 void lt_fatal (const char *message, ...);
4693 main (int argc, char *argv[])
4698 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4699 newargz = XMALLOC(char *, argc+2);
4702 cat >> $cwrappersource <<EOF
4703 newargz[0] = "$SHELL";
4706 cat >> $cwrappersource <<"EOF"
4707 newargz[1] = fnqualify(argv[0]);
4708 /* we know the script has the same name, without the .exe */
4709 /* so make sure newargz[1] doesn't end in .exe */
4710 strendzap(newargz[1],".exe");
4711 for (i = 1; i < argc; i++)
4712 newargz[i+1] = xstrdup(argv[i]);
4713 newargz[argc+1] = NULL;
4716 cat >> $cwrappersource <<EOF
4717 execv("$SHELL",newargz);
4720 cat >> $cwrappersource <<"EOF"
4724 xmalloc (size_t num)
4726 void * p = (void *) malloc (num);
4728 lt_fatal ("Memory exhausted");
4734 xstrdup (const char *string)
4736 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4741 basename (const char *name)
4745 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4746 /* Skip over the disk name in MSDOS pathnames. */
4747 if (isalpha (name[0]) && name[1] == ':')
4751 for (base = name; *name; name++)
4752 if (IS_DIR_SEPARATOR (*name))
4754 return (char *) base;
4758 fnqualify(const char *path)
4762 char tmp[LT_PATHMAX + 1];
4764 assert(path != NULL);
4766 /* Is it qualified already? */
4767 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4768 if (isalpha (path[0]) && path[1] == ':')
4769 return xstrdup (path);
4771 if (IS_DIR_SEPARATOR (path[0]))
4772 return xstrdup (path);
4774 /* prepend the current directory */
4775 /* doesn't handle '~' */
4776 if (getcwd (tmp, LT_PATHMAX) == NULL)
4777 lt_fatal ("getcwd failed");
4778 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4779 p = XMALLOC(char, size);
4780 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4785 strendzap(char *str, const char *pat)
4789 assert(str != NULL);
4790 assert(pat != NULL);
4793 patlen = strlen(pat);
4797 str += len - patlen;
4798 if (strcmp(str, pat) == 0)
4805 lt_error_core (int exit_status, const char * mode,
4806 const char * message, va_list ap)
4808 fprintf (stderr, "%s: %s: ", program_name, mode);
4809 vfprintf (stderr, message, ap);
4810 fprintf (stderr, ".\n");
4812 if (exit_status >= 0)
4817 lt_fatal (const char *message, ...)
4820 va_start (ap, message);
4821 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4825 # we should really use a build-platform specific compiler
4826 # here, but OTOH, the wrappers (shell script and this C one)
4827 # are only useful if you want to execute the "real" binary.
4828 # Since the "real" binary is built for $host, then this
4829 # wrapper might as well be built for $host, too.
4830 $run $LTCC -s -o $cwrapper $cwrappersource
4834 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4839 # $output - temporary wrapper script for $objdir/$outputname
4840 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4842 # The $output program cannot be directly executed until all the libtool
4843 # libraries that it depends on are installed.
4845 # This wrapper script should never be moved out of the build directory.
4846 # If it is, it will not operate correctly.
4848 # Sed substitution that helps us do robust quoting. It backslashifies
4849 # metacharacters that are still active within double-quoted strings.
4850 Xsed='${SED} -e 1s/^X//'
4851 sed_quote_subst='$sed_quote_subst'
4853 # The HP-UX ksh and POSIX shell print the target directory to stdout
4855 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4857 relink_command=\"$relink_command\"
4859 # This environment variable determines our operation mode.
4860 if test \"\$libtool_install_magic\" = \"$magic\"; then
4861 # install mode needs the following variable:
4862 notinst_deplibs='$notinst_deplibs'
4864 # When we are sourced in execute mode, \$file and \$echo are already set.
4865 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4868 # Make sure echo works.
4869 if test \"X\$1\" = X--no-reexec; then
4870 # Discard the --no-reexec flag, and continue.
4872 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4873 # Yippee, \$echo works!
4876 # Restart under the correct shell, and then maybe \$echo will work.
4877 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4883 # Find the directory that this script lives in.
4884 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4885 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4887 # Follow symbolic links until we get to the real thisdir.
4888 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4889 while test -n \"\$file\"; do
4890 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4892 # If there was a directory component, then change thisdir.
4893 if test \"x\$destdir\" != \"x\$file\"; then
4894 case \"\$destdir\" in
4895 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4896 *) thisdir=\"\$thisdir/\$destdir\" ;;
4900 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4901 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4904 # Try to get the absolute directory name.
4905 absdir=\`cd \"\$thisdir\" && pwd\`
4906 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4909 if test "$fast_install" = yes; then
4911 program=lt-'$outputname'$exeext
4912 progdir=\"\$thisdir/$objdir\"
4914 if test ! -f \"\$progdir/\$program\" || \\
4915 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4916 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4918 file=\"\$\$-\$program\"
4920 if test ! -d \"\$progdir\"; then
4921 $mkdir \"\$progdir\"
4923 $rm \"\$progdir/\$file\"
4928 # relink executable if necessary
4929 if test -n \"\$relink_command\"; then
4930 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4932 $echo \"\$relink_command_output\" >&2
4933 $rm \"\$progdir/\$file\"
4938 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4939 { $rm \"\$progdir/\$program\";
4940 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4941 $rm \"\$progdir/\$file\"
4945 program='$outputname'
4946 progdir=\"\$thisdir/$objdir\"
4952 if test -f \"\$progdir/\$program\"; then"
4954 # Export our shlibpath_var if we have one.
4955 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4957 # Add our own library path to $shlibpath_var
4958 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4960 # Some systems cannot cope with colon-terminated $shlibpath_var
4961 # The second colon is a workaround for a bug in BeOS R4 sed
4962 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4964 export $shlibpath_var
4968 # fixup the dll searchpath if we need to.
4969 if test -n "$dllsearchpath"; then
4971 # Add the dll search path components to the executable PATH
4972 PATH=$dllsearchpath:\$PATH
4977 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4978 # Run the actual program with our arguments.
4981 # Backslashes separate directories on plain windows
4982 *-*-mingw | *-*-os2*)
4984 exec \$progdir\\\\\$program \${1+\"\$@\"}
4990 exec \$progdir/\$program \${1+\"\$@\"}
4995 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4999 # The program doesn't exist.
5000 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5001 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5002 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5013 # See if we need to build an old-fashioned archive.
5014 for oldlib in $oldlibs; do
5016 if test "$build_libtool_libs" = convenience; then
5017 oldobjs="$libobjs_save"
5018 addlibs="$convenience"
5019 build_libtool_libs=no
5021 if test "$build_libtool_libs" = module; then
5022 oldobjs="$libobjs_save"
5023 build_libtool_libs=no
5025 oldobjs="$old_deplibs $non_pic_objects"
5027 addlibs="$old_convenience"
5030 if test -n "$addlibs"; then
5031 gentop="$output_objdir/${outputname}x"
5032 generated="$generated $gentop"
5034 func_extract_archives $gentop $addlibs
5035 oldobjs="$oldobjs $func_extract_archives_result"
5038 # Do each command in the archive commands.
5039 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5040 cmds=$old_archive_from_new_cmds
5042 eval cmds=\"$old_archive_cmds\"
5044 if len=`expr "X$cmds" : ".*"` &&
5045 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5046 cmds=$old_archive_cmds
5048 # the command line is too long to link in one step, link in parts
5049 $echo "using piecewise archive linking..."
5054 save_oldobjs=$oldobjs
5055 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5056 # encoded into archives. This makes 'ar r' malfunction in
5057 # this piecewise linking case whenever conflicting object
5058 # names appear in distinct ar calls; check, warn and compensate.
5059 if (for obj in $save_oldobjs
5061 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5062 done | sort | sort -uc >/dev/null 2>&1); then
5065 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5066 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5069 # Is there a better way of finding the last object in the list?
5070 for obj in $save_oldobjs
5074 for obj in $save_oldobjs
5076 oldobjs="$objlist $obj"
5077 objlist="$objlist $obj"
5078 eval test_cmds=\"$old_archive_cmds\"
5079 if len=`expr "X$test_cmds" : ".*"` &&
5080 test "$len" -le "$max_cmd_len"; then
5083 # the above command should be used before it gets too long
5085 if test "$obj" = "$last_oldobj" ; then
5088 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5089 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5095 if test "X$oldobjs" = "X" ; then
5096 eval cmds=\"\$concat_cmds\"
5098 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5102 save_ifs="$IFS"; IFS='~'
5103 for cmd in $cmds; do
5107 $run eval "$cmd" || exit $?
5112 if test -n "$generated"; then
5113 $show "${rm}r$generated"
5114 $run ${rm}r$generated
5117 # Now create the libtool archive.
5121 test "$build_old_libs" = yes && old_library="$libname.$libext"
5122 $show "creating $output"
5124 # Preserve any variables that may affect compiler behavior
5125 for var in $variables_saved_for_relink; do
5126 if eval test -z \"\${$var+set}\"; then
5127 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5128 elif eval var_value=\$$var; test -z "$var_value"; then
5129 relink_command="$var=; export $var; $relink_command"
5131 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5132 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5135 # Quote the link command for shipping.
5136 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5137 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5138 if test "$hardcode_automatic" = yes ; then
5143 # Only create the output if not a dry run.
5144 if test -z "$run"; then
5145 for installed in no yes; do
5146 if test "$installed" = yes; then
5147 if test -z "$install_libdir"; then
5150 output="$output_objdir/$outputname"i
5151 # Replace all uninstalled libtool libraries with the installed ones
5153 for deplib in $dependency_libs; do
5156 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5157 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5158 if test -z "$libdir"; then
5159 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5162 newdependency_libs="$newdependency_libs $libdir/$name"
5164 *) newdependency_libs="$newdependency_libs $deplib" ;;
5167 dependency_libs="$newdependency_libs"
5169 for lib in $dlfiles; do
5170 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5171 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5172 if test -z "$libdir"; then
5173 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5176 newdlfiles="$newdlfiles $libdir/$name"
5178 dlfiles="$newdlfiles"
5180 for lib in $dlprefiles; do
5181 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5182 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5183 if test -z "$libdir"; then
5184 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5187 newdlprefiles="$newdlprefiles $libdir/$name"
5189 dlprefiles="$newdlprefiles"
5192 for lib in $dlfiles; do
5194 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5195 *) abs=`pwd`"/$lib" ;;
5197 newdlfiles="$newdlfiles $abs"
5199 dlfiles="$newdlfiles"
5201 for lib in $dlprefiles; do
5203 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5204 *) abs=`pwd`"/$lib" ;;
5206 newdlprefiles="$newdlprefiles $abs"
5208 dlprefiles="$newdlprefiles"
5211 # place dlname in correct position for cygwin
5213 case $host,$output,$installed,$module,$dlname in
5214 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5217 # $outputname - a libtool library file
5218 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5220 # Please DO NOT delete this file!
5221 # It is necessary for linking the library.
5223 # The name that we can dlopen(3).
5226 # Names of this library.
5227 library_names='$library_names'
5229 # The name of the static archive.
5230 old_library='$old_library'
5232 # Libraries that this one depends upon.
5233 dependency_libs='$dependency_libs'
5235 # Version information for $libname.
5240 # Is this an already installed library?
5241 installed=$installed
5243 # Should we warn about portability when linking against -modules?
5244 shouldnotlink=$module
5246 # Files to dlopen/dlpreopen
5248 dlpreopen='$dlprefiles'
5250 # Directory that this library needs to be installed in:
5251 libdir='$install_libdir'"
5252 if test "$installed" = no && test "$need_relink" = yes; then
5254 relink_command=\"$relink_command\""
5259 # Do a symbolic link so that the libtool archive can be found in
5260 # LD_LIBRARY_PATH before the program is installed.
5261 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5262 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5268 # libtool install mode
5270 modename="$modename: install"
5272 # There may be an optional sh(1) argument at the beginning of
5273 # install_prog (especially on Windows NT).
5274 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5275 # Allow the use of GNU shtool's install command.
5276 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5277 # Aesthetically quote it.
5278 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5280 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5284 install_prog="$arg "
5292 # The real first argument should be the name of the installation program.
5293 # Aesthetically quote it.
5294 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5296 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5300 install_prog="$install_prog$arg"
5302 # We need to accept at least all the BSD install flags.
5312 if test -n "$dest"; then
5313 files="$files $dest"
5331 # If the previous option needed an argument, then skip it.
5332 if test -n "$prev"; then
5341 # Aesthetically quote the argument.
5342 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5344 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5348 install_prog="$install_prog $arg"
5351 if test -z "$install_prog"; then
5352 $echo "$modename: you must specify an install program" 1>&2
5357 if test -n "$prev"; then
5358 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5363 if test -z "$files"; then
5364 if test -z "$dest"; then
5365 $echo "$modename: no file or destination specified" 1>&2
5367 $echo "$modename: you must specify a destination" 1>&2
5373 # Strip any trailing slash from the destination.
5374 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5376 # Check to see that the destination is a directory.
5377 test -d "$dest" && isdir=yes
5378 if test "$isdir" = yes; then
5382 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5383 test "X$destdir" = "X$dest" && destdir=.
5384 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5386 # Not a directory, so check to see that there is only one file specified.
5388 if test "$#" -gt 2; then
5389 $echo "$modename: \`$dest' is not a directory" 1>&2
5395 [\\/]* | [A-Za-z]:[\\/]*) ;;
5397 for file in $files; do
5401 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5410 # This variable tells wrapper scripts just to set variables rather
5411 # than running their programs.
5412 libtool_install_magic="$magic"
5417 for file in $files; do
5419 # Do each installation.
5422 # Do the static libraries later.
5423 staticlibs="$staticlibs $file"
5427 # Check to see that this really is a libtool archive.
5428 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5430 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5438 # If there is no directory component, then add one.
5440 */* | *\\*) . $file ;;
5444 # Add the libdir to current_libdirs if it is the destination.
5445 if test "X$destdir" = "X$libdir"; then
5446 case "$current_libdirs " in
5448 *) current_libdirs="$current_libdirs $libdir" ;;
5451 # Note the libdir as a future libdir.
5452 case "$future_libdirs " in
5454 *) future_libdirs="$future_libdirs $libdir" ;;
5458 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5459 test "X$dir" = "X$file/" && dir=
5462 if test -n "$relink_command"; then
5463 # Determine the prefix the user has applied to our future dir.
5464 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5466 # Don't allow the user to place us outside of our expected
5467 # location b/c this prevents finding dependent libraries that
5468 # are installed to the same prefix.
5469 # At present, this check doesn't affect windows .dll's that
5470 # are installed into $libdir/../bin (currently, that works fine)
5471 # but it's something to keep an eye on.
5472 if test "$inst_prefix_dir" = "$destdir"; then
5473 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5477 if test -n "$inst_prefix_dir"; then
5478 # Stick the inst_prefix_dir data into the link command.
5479 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5481 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5484 $echo "$modename: warning: relinking \`$file'" 1>&2
5485 $show "$relink_command"
5486 if $run eval "$relink_command"; then :
5488 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5493 # See the names of the shared library.
5494 set dummy $library_names
5495 if test -n "$2"; then
5501 test -n "$relink_command" && srcname="$realname"T
5503 # Install the shared library and build the symlinks.
5504 $show "$install_prog $dir/$srcname $destdir/$realname"
5505 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5506 if test -n "$stripme" && test -n "$striplib"; then
5507 $show "$striplib $destdir/$realname"
5508 $run eval "$striplib $destdir/$realname" || exit $?
5511 if test "$#" -gt 0; then
5512 # Delete the old symlinks, and create new ones.
5515 if test "$linkname" != "$realname"; then
5516 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5517 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5522 # Do each command in the postinstall commands.
5523 lib="$destdir/$realname"
5524 cmds=$postinstall_cmds
5525 save_ifs="$IFS"; IFS='~'
5526 for cmd in $cmds; do
5530 $run eval "$cmd" || exit $?
5535 # Install the pseudo-library for information purposes.
5536 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5537 instname="$dir/$name"i
5538 $show "$install_prog $instname $destdir/$name"
5539 $run eval "$install_prog $instname $destdir/$name" || exit $?
5541 # Maybe install the static library, too.
5542 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5546 # Install (i.e. copy) a libtool object.
5548 # Figure out destination file name, if it wasn't already specified.
5549 if test -n "$destname"; then
5550 destfile="$destdir/$destname"
5552 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5553 destfile="$destdir/$destfile"
5556 # Deduce the name of the destination old-style object file.
5559 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5562 staticdest="$destfile"
5566 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5572 # Install the libtool object if requested.
5573 if test -n "$destfile"; then
5574 $show "$install_prog $file $destfile"
5575 $run eval "$install_prog $file $destfile" || exit $?
5578 # Install the old object if enabled.
5579 if test "$build_old_libs" = yes; then
5580 # Deduce the name of the old-style object file.
5581 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5583 $show "$install_prog $staticobj $staticdest"
5584 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5590 # Figure out destination file name, if it wasn't already specified.
5591 if test -n "$destname"; then
5592 destfile="$destdir/$destname"
5594 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5595 destfile="$destdir/$destfile"
5598 # If the file is missing, and there is a .exe on the end, strip it
5599 # because it is most likely a libtool script we actually want to
5604 if test ! -f "$file"; then
5605 file=`$echo $file|${SED} 's,.exe$,,'`
5611 # Do a test to see if this is really a libtool program.
5614 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5620 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5624 # To insure that "foo" is sourced, and not "foo.exe",
5625 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5626 # which disallows the automatic-append-.exe behavior.
5628 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5629 *) wrapperdot=${wrapper} ;;
5631 # If there is no directory component, then add one.
5633 */* | *\\*) . ${wrapperdot} ;;
5634 *) . ./${wrapperdot} ;;
5637 # Check the variables that should have been set.
5638 if test -z "$notinst_deplibs"; then
5639 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5644 for lib in $notinst_deplibs; do
5645 # Check to see that each library is installed.
5647 if test -f "$lib"; then
5648 # If there is no directory component, then add one.
5650 */* | *\\*) . $lib ;;
5654 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5655 if test -n "$libdir" && test ! -f "$libfile"; then
5656 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5662 # To insure that "foo" is sourced, and not "foo.exe",
5663 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5664 # which disallows the automatic-append-.exe behavior.
5666 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5667 *) wrapperdot=${wrapper} ;;
5669 # If there is no directory component, then add one.
5671 */* | *\\*) . ${wrapperdot} ;;
5672 *) . ./${wrapperdot} ;;
5676 if test "$fast_install" = no && test -n "$relink_command"; then
5677 if test "$finalize" = yes && test -z "$run"; then
5679 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5680 tmpdir="$tmpdir/libtool-$$"
5683 if $mkdir "$tmpdir"; then
5687 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5690 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5691 outputname="$tmpdir/$file"
5692 # Replace the output file specification.
5693 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5695 $show "$relink_command"
5696 if $run eval "$relink_command"; then :
5698 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5704 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5707 # Install the binary that we compiled earlier.
5708 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5712 # remove .exe since cygwin /usr/bin/install will append another
5714 case $install_prog,$host in
5715 */usr/bin/install*,*cygwin*)
5716 case $file:$destfile in
5721 destfile=$destfile.exe
5724 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5729 $show "$install_prog$stripme $file $destfile"
5730 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5731 test -n "$outputname" && ${rm}r "$tmpdir"
5736 for file in $staticlibs; do
5737 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5739 # Set up the ranlib parameters.
5740 oldlib="$destdir/$name"
5742 $show "$install_prog $file $oldlib"
5743 $run eval "$install_prog \$file \$oldlib" || exit $?
5745 if test -n "$stripme" && test -n "$old_striplib"; then
5746 $show "$old_striplib $oldlib"
5747 $run eval "$old_striplib $oldlib" || exit $?
5750 # Do each command in the postinstall commands.
5751 cmds=$old_postinstall_cmds
5752 save_ifs="$IFS"; IFS='~'
5753 for cmd in $cmds; do
5757 $run eval "$cmd" || exit $?
5762 if test -n "$future_libdirs"; then
5763 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5766 if test -n "$current_libdirs"; then
5767 # Maybe just do a dry run.
5768 test -n "$run" && current_libdirs=" -n$current_libdirs"
5769 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5775 # libtool finish mode
5777 modename="$modename: finish"
5781 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5784 libdirs="$libdirs $dir"
5787 for libdir in $libdirs; do
5788 if test -n "$finish_cmds"; then
5789 # Do each command in the finish commands.
5791 save_ifs="$IFS"; IFS='~'
5792 for cmd in $cmds; do
5796 $run eval "$cmd" || admincmds="$admincmds
5801 if test -n "$finish_eval"; then
5802 # Do the single finish_eval.
5803 eval cmds=\"$finish_eval\"
5804 $run eval "$cmds" || admincmds="$admincmds
5810 # Exit here if they wanted silent mode.
5811 test "$show" = : && exit $EXIT_SUCCESS
5813 $echo "----------------------------------------------------------------------"
5814 $echo "Libraries have been installed in:"
5815 for libdir in $libdirs; do
5819 $echo "If you ever happen to want to link against installed libraries"
5820 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5821 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5822 $echo "flag during linking and do at least one of the following:"
5823 if test -n "$shlibpath_var"; then
5824 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5825 $echo " during execution"
5827 if test -n "$runpath_var"; then
5828 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5829 $echo " during linking"
5831 if test -n "$hardcode_libdir_flag_spec"; then
5833 eval flag=\"$hardcode_libdir_flag_spec\"
5835 $echo " - use the \`$flag' linker flag"
5837 if test -n "$admincmds"; then
5838 $echo " - have your system administrator run these commands:$admincmds"
5840 if test -f /etc/ld.so.conf; then
5841 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5844 $echo "See any operating system documentation about shared libraries for"
5845 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5846 $echo "----------------------------------------------------------------------"
5850 # libtool execute mode
5852 modename="$modename: execute"
5854 # The first argument is the command name.
5856 if test -z "$cmd"; then
5857 $echo "$modename: you must specify a COMMAND" 1>&2
5862 # Handle -dlopen flags immediately.
5863 for file in $execute_dlfiles; do
5864 if test ! -f "$file"; then
5865 $echo "$modename: \`$file' is not a file" 1>&2
5873 # Check to see that this really is a libtool archive.
5874 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5876 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5881 # Read the libtool library.
5885 # If there is no directory component, then add one.
5887 */* | *\\*) . $file ;;
5891 # Skip this library if it cannot be dlopened.
5892 if test -z "$dlname"; then
5893 # Warn if it was a shared library.
5894 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5898 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5899 test "X$dir" = "X$file" && dir=.
5901 if test -f "$dir/$objdir/$dlname"; then
5904 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5910 # Just add the directory containing the .lo file.
5911 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5912 test "X$dir" = "X$file" && dir=.
5916 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5921 # Get the absolute pathname.
5922 absdir=`cd "$dir" && pwd`
5923 test -n "$absdir" && dir="$absdir"
5925 # Now add the directory to shlibpath_var.
5926 if eval "test -z \"\$$shlibpath_var\""; then
5927 eval "$shlibpath_var=\"\$dir\""
5929 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5933 # This variable tells wrapper scripts just to set shlibpath_var
5934 # rather than running their programs.
5935 libtool_execute_magic="$magic"
5937 # Check if any of the arguments is a wrapper script.
5944 # Do a test to see if this is really a libtool program.
5945 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5946 # If there is no directory component, then add one.
5948 */* | *\\*) . $file ;;
5952 # Transform arg to wrapped name.
5953 file="$progdir/$program"
5957 # Quote arguments (to preserve shell metacharacters).
5958 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5959 args="$args \"$file\""
5962 if test -z "$run"; then
5963 if test -n "$shlibpath_var"; then
5964 # Export the shlibpath_var.
5965 eval "export $shlibpath_var"
5968 # Restore saved environment variables
5969 if test "${save_LC_ALL+set}" = set; then
5970 LC_ALL="$save_LC_ALL"; export LC_ALL
5972 if test "${save_LANG+set}" = set; then
5973 LANG="$save_LANG"; export LANG
5976 # Now prepare to actually exec the command.
5977 exec_cmd="\$cmd$args"
5979 # Display what would be done.
5980 if test -n "$shlibpath_var"; then
5981 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5982 $echo "export $shlibpath_var"
5989 # libtool clean and uninstall mode
5991 modename="$modename: $mode"
5997 # This variable tells wrapper scripts just to set variables rather
5998 # than running their programs.
5999 libtool_install_magic="$magic"
6004 -f) rm="$rm $arg"; rmforce=yes ;;
6005 -*) rm="$rm $arg" ;;
6006 *) files="$files $arg" ;;
6010 if test -z "$rm"; then
6011 $echo "$modename: you must specify an RM program" 1>&2
6018 origobjdir="$objdir"
6019 for file in $files; do
6020 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6021 if test "X$dir" = "X$file"; then
6023 objdir="$origobjdir"
6025 objdir="$dir/$origobjdir"
6027 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6028 test "$mode" = uninstall && objdir="$dir"
6030 # Remember objdir for removal later, being careful to avoid duplicates
6031 if test "$mode" = clean; then
6034 *) rmdirs="$rmdirs $objdir" ;;
6038 # Don't error if the file doesn't exist and rm -f was used.
6039 if (test -L "$file") >/dev/null 2>&1 \
6040 || (test -h "$file") >/dev/null 2>&1 \
6041 || test -f "$file"; then
6043 elif test -d "$file"; then
6046 elif test "$rmforce" = yes; then
6054 # Possibly a libtool archive, so verify it.
6055 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6058 # Delete the libtool libraries and symlinks.
6059 for n in $library_names; do
6060 rmfiles="$rmfiles $objdir/$n"
6062 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6063 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6065 if test "$mode" = uninstall; then
6066 if test -n "$library_names"; then
6067 # Do each command in the postuninstall commands.
6068 cmds=$postuninstall_cmds
6069 save_ifs="$IFS"; IFS='~'
6070 for cmd in $cmds; do
6075 if test "$?" -ne 0 && test "$rmforce" != yes; then
6082 if test -n "$old_library"; then
6083 # Do each command in the old_postuninstall commands.
6084 cmds=$old_postuninstall_cmds
6085 save_ifs="$IFS"; IFS='~'
6086 for cmd in $cmds; do
6091 if test "$?" -ne 0 && test "$rmforce" != yes; then
6097 # FIXME: should reinstall the best remaining shared library.
6103 # Possibly a libtool object, so verify it.
6104 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6109 # Add PIC object to the list of files to remove.
6110 if test -n "$pic_object" \
6111 && test "$pic_object" != none; then
6112 rmfiles="$rmfiles $dir/$pic_object"
6115 # Add non-PIC object to the list of files to remove.
6116 if test -n "$non_pic_object" \
6117 && test "$non_pic_object" != none; then
6118 rmfiles="$rmfiles $dir/$non_pic_object"
6124 if test "$mode" = clean ; then
6128 file=`$echo $file|${SED} 's,.exe$,,'`
6129 noexename=`$echo $name|${SED} 's,.exe$,,'`
6130 # $file with .exe has already been added to rmfiles,
6131 # add $file without .exe
6132 rmfiles="$rmfiles $file"
6135 # Do a test to see if this is a libtool program.
6136 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6140 # note $name still contains .exe if it was in $file originally
6141 # as does the version of $file that was added into $rmfiles
6142 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6143 if test "$fast_install" = yes && test -n "$relink_command"; then
6144 rmfiles="$rmfiles $objdir/lt-$name"
6146 if test "X$noexename" != "X$name" ; then
6147 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6153 $show "$rm $rmfiles"
6154 $run $rm $rmfiles || exit_status=1
6156 objdir="$origobjdir"
6158 # Try to remove the ${objdir}s in the directories where we deleted files
6159 for dir in $rmdirs; do
6160 if test -d "$dir"; then
6162 $run rmdir $dir >/dev/null 2>&1
6170 $echo "$modename: you must specify a MODE" 1>&2
6171 $echo "$generic_help" 1>&2
6176 if test -z "$exec_cmd"; then
6177 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6178 $echo "$generic_help" 1>&2
6181 fi # test -z "$show_help"
6183 if test -n "$exec_cmd"; then
6188 # We need to display help for each of the modes.
6191 "Usage: $modename [OPTION]... [MODE-ARG]...
6193 Provide generalized library-building support services.
6195 --config show all configuration variables
6196 --debug enable verbose shell tracing
6197 -n, --dry-run display commands without modifying any files
6198 --features display basic configuration information and exit
6199 --finish same as \`--mode=finish'
6200 --help display this help message and exit
6201 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6202 --quiet same as \`--silent'
6203 --silent don't print informational messages
6204 --tag=TAG use configuration variables from tag TAG
6205 --version print version information
6207 MODE must be one of the following:
6209 clean remove files from the build directory
6210 compile compile a source file into a libtool object
6211 execute automatically set library path, then run a program
6212 finish complete the installation of libtool libraries
6213 install install libraries or executables
6214 link create a library or an executable
6215 uninstall remove libraries from an installed directory
6217 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6218 a more detailed description of MODE.
6220 Report bugs to <bug-libtool@gnu.org>."
6226 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6228 Remove files from the build directory.
6230 RM is the name of the program to use to delete files associated with each FILE
6231 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6234 If FILE is a libtool library, object or program, all the files associated
6235 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6240 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6242 Compile a source file into a libtool library object.
6244 This mode accepts the following additional options:
6246 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6247 -prefer-pic try to building PIC objects only
6248 -prefer-non-pic try to building non-PIC objects only
6249 -static always build a \`.o' file suitable for static linking
6251 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6252 from the given SOURCEFILE.
6254 The output file name is determined by removing the directory component from
6255 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6256 library object suffix, \`.lo'."
6261 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6263 Automatically set library path, then run a program.
6265 This mode accepts the following additional options:
6267 -dlopen FILE add the directory containing FILE to the library path
6269 This mode sets the library path environment variable according to \`-dlopen'
6272 If any of the ARGS are libtool executable wrappers, then they are translated
6273 into their corresponding uninstalled binary, and any of their required library
6274 directories are added to the library path.
6276 Then, COMMAND is executed, with ARGS as arguments."
6281 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6283 Complete the installation of libtool libraries.
6285 Each LIBDIR is a directory that contains libtool libraries.
6287 The commands that this mode executes may require superuser privileges. Use
6288 the \`--dry-run' option if you just want to see what would be executed."
6293 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6295 Install executables or libraries.
6297 INSTALL-COMMAND is the installation command. The first component should be
6298 either the \`install' or \`cp' program.
6300 The rest of the components are interpreted as arguments to that command (only
6301 BSD-compatible install options are recognized)."
6306 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6308 Link object files or libraries together to form another library, or to
6309 create an executable program.
6311 LINK-COMMAND is a command using the C compiler that you would use to create
6312 a program from several object files.
6314 The following components of LINK-COMMAND are treated specially:
6316 -all-static do not do any dynamic linking at all
6317 -avoid-version do not add a version suffix if possible
6318 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6319 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6320 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6321 -export-symbols SYMFILE
6322 try to export only the symbols listed in SYMFILE
6323 -export-symbols-regex REGEX
6324 try to export only the symbols matching REGEX
6325 -LLIBDIR search LIBDIR for required installed libraries
6326 -lNAME OUTPUT-FILE requires the installed library libNAME
6327 -module build a library that can dlopened
6328 -no-fast-install disable the fast-install mode
6329 -no-install link a not-installable executable
6330 -no-undefined declare that a library does not refer to external symbols
6331 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6332 -objectlist FILE Use a list of object files found in FILE to specify objects
6333 -precious-files-regex REGEX
6334 don't remove output files matching REGEX
6335 -release RELEASE specify package release information
6336 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6337 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6338 -static do not do any dynamic linking of libtool libraries
6339 -version-info CURRENT[:REVISION[:AGE]]
6340 specify library version info [each variable defaults to 0]
6342 All other options (arguments beginning with \`-') are ignored.
6344 Every other argument is treated as a filename. Files ending in \`.la' are
6345 treated as uninstalled libtool libraries, other files are standard or library
6348 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6349 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6350 required, except when creating a convenience library.
6352 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6353 using \`ar' and \`ranlib', or on Windows using \`lib'.
6355 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6356 is created, otherwise an executable program is created."
6361 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6363 Remove libraries from an installation directory.
6365 RM is the name of the program to use to delete files associated with each FILE
6366 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6369 If FILE is a libtool library, all the files associated with it are deleted.
6370 Otherwise, only FILE itself is deleted using RM."
6374 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6381 $echo "Try \`$modename --help' for more information about other modes."
6385 # The TAGs below are defined such that we never get into a situation
6386 # in which we disable both kinds of libraries. Given conflicting
6387 # choices, we go for a static library, that is the most portable,
6388 # since we can't tell whether shared libraries were disabled because
6389 # the user asked for that or because the platform doesn't support
6390 # them. This is particularly important on AIX, because we don't
6391 # support having both static and shared libraries enabled at the same
6392 # time on that platform, so we default to a shared-only configuration.
6393 # If a disable-shared tag is given, we'll fallback to a static-only
6394 # configuration. But we'll never go from static-only to shared-only.
6396 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6397 build_libtool_libs=no
6399 # ### END LIBTOOL TAG CONFIG: disable-shared
6401 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6402 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6403 # ### END LIBTOOL TAG CONFIG: disable-static