1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # This file is distributed with OpenLDAP Software, which contains a
28 # configuration script generated by Autoconf, and is distributable
29 # under the same distributions terms as OpenLDAP inself.
31 ## Copyright 1998-2005 The OpenLDAP Foundation.
32 ## All rights reserved.
34 ## Redistribution and use in source and binary forms, with or without
35 ## modification, are permitted only as authorized by the OpenLDAP
38 ## A copy of this license is available in the file LICENSE in the
39 ## top-level directory of the distribution or, alternatively, at
40 ## <http://www.OpenLDAP.org/license.html>.
44 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
45 # is ksh but when the shell is invoked as "sh" and the current value of
46 # the _XPG environment variable is not equal to 1 (one), the special
47 # positional parameter $0, within a function call, is the name of the
51 # The name of this program:
52 progname=`echo "$progpath" | $SED $basename`
61 VERSION=1.5.18-OpenLDAP
62 TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
64 # See if we are running on zsh, and set the options which allow our
65 # commands through without removal of \ escapes.
66 if test -n "${ZSH_VERSION+set}" ; then
70 # Check that we have a working $echo.
71 if test "X$1" = X--no-reexec; then
72 # Discard the --no-reexec flag, and continue.
74 elif test "X$1" = X--fallback-echo; then
75 # Avoid inline document here, it may be left over
77 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
78 # Yippee, $echo works!
81 # Restart under the correct shell, and then maybe $echo will work.
82 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
85 if test "X$1" = X--fallback-echo; then
86 # used as fallback echo
95 help="Try \`$progname --help' for more information."
96 magic="%%%MAGIC variable%%%"
101 # Sed substitution that helps us do robust quoting. It backslashifies
102 # metacharacters that are still active within double-quoted strings.
103 Xsed="${SED}"' -e 1s/^X//'
104 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
105 # test EBCDIC or ASCII
106 case `echo A|tr A '\301'` in
107 A) # EBCDIC based system
108 SP2NL="tr '\100' '\n'"
109 NL2SP="tr '\r\n' '\100\100'"
111 *) # Assume ASCII based system
112 SP2NL="tr '\040' '\012'"
113 NL2SP="tr '\015\012' '\040\040'"
118 # Only set LANG and LC_ALL to C if already set.
119 # These must not be set unconditionally because not all systems understand
120 # e.g. LANG=C (notably SCO).
121 # We save the old values to restore during execute mode.
122 if test "${LC_ALL+set}" = set; then
123 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
125 if test "${LANG+set}" = set; then
126 save_LANG="$LANG"; LANG=C; export LANG
129 # Make sure IFS has a sensible default
134 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
135 $echo "$modename: not configured to build any kind of library" 1>&2
136 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
149 lo2o="s/\\.lo\$/.${objext}/"
150 o2lo="s/\\.${objext}\$/.lo/"
151 quote_scanset='[[~#^*{};<>?'"'"' ]'
153 #####################################
154 # Shell function definitions:
155 # This seems to be the best place for them
157 # func_win32_libid arg
158 # return the library type of file 'arg'
160 # Need a lot of goo to handle *both* DLLs and import libs
161 # Has to be a shell function in order to 'eat' the argument
162 # that is supplied when $file_magic_command is called.
165 win32_libid_type="unknown"
166 win32_fileres=`file -L $1 2>/dev/null`
167 case $win32_fileres in
168 *ar\ archive\ import\ library*) # definitely import
169 win32_libid_type="x86 archive import"
171 *ar\ archive*) # could be an import, or static
172 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
173 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
174 win32_nmres=`eval $NM -f posix -A $1 | \
175 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
176 if test "X$win32_nmres" = "Ximport" ; then
177 win32_libid_type="x86 archive import"
179 win32_libid_type="x86 archive static"
184 win32_libid_type="x86 DLL"
186 *executable*) # but shell scripts are "executable" too...
187 case $win32_fileres in
188 *MS\ Windows\ PE\ Intel*)
189 win32_libid_type="x86 DLL"
194 $echo $win32_libid_type
199 # Infer tagged configuration to use if any are available and
200 # if one wasn't chosen via the "--tag" command line option.
201 # Only attempt this if the compiler in the base compile
202 # command doesn't match the default compiler.
203 # arg is usually of the form 'gcc ...'
206 if test -n "$available_tags" && test -z "$tagname"; then
210 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
214 CC_quoted="$CC_quoted $arg"
217 # Blanks in the command may have been stripped by the calling shell,
218 # but not from the CC environment variable when configure was run.
219 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
220 # Blanks at the start of $base_compile will cause this to fail
221 # if we don't check for them as well.
223 for z in $available_tags; do
224 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
225 # Evaluate the configuration.
226 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
229 # Double-quote args containing other shell metacharacters.
231 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
235 CC_quoted="$CC_quoted $arg"
238 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
239 # The compiler in the base compile command matches
240 # the one in the tagged configuration.
241 # Assume this is the tagged configuration we want.
248 # If $tagname still isn't set, then no tagged configuration
249 # was found and let the user know that the "--tag" command
250 # line option must be used.
251 if test -z "$tagname"; then
252 $echo "$modename: unable to infer tagged configuration"
253 $echo "$modename: specify a tag with \`--tag'" 1>&2
256 # $echo "$modename: using $tagname tagged configuration"
264 # func_extract_an_archive dir oldlib
265 func_extract_an_archive ()
267 f_ex_an_ar_dir="$1"; shift
268 f_ex_an_ar_oldlib="$1"
270 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
271 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
272 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
275 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
280 # func_extract_archives gentop oldlib ...
281 func_extract_archives ()
283 my_gentop="$1"; shift
291 $show "${rm}r $my_gentop"
292 $run ${rm}r "$my_gentop"
293 $show "$mkdir $my_gentop"
294 $run $mkdir "$my_gentop"
296 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
300 for my_xlib in $my_oldlibs; do
301 # Extract the objects.
303 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
304 *) my_xabs=`pwd`"/$my_xlib" ;;
306 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
307 my_xdir="$my_gentop/$my_xlib"
309 $show "${rm}r $my_xdir"
310 $run ${rm}r "$my_xdir"
311 $show "$mkdir $my_xdir"
312 $run $mkdir "$my_xdir"
314 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
319 $show "Extracting $my_xabs"
320 # Do not bother doing anything if just a dry run
321 if test -z "$run"; then
322 darwin_orig_dir=`pwd`
323 cd $my_xdir || exit $?
324 darwin_archive=$my_xabs
326 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
327 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
328 if test -n "$darwin_arches"; then
329 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
331 $show "$darwin_base_archive has multiple architectures $darwin_arches"
332 for darwin_arch in $darwin_arches ; do
333 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
334 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
335 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
336 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
338 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
339 done # $darwin_arches
340 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
341 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
344 for darwin_file in $darwin_filelist; do
345 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
346 lipo -create -output "$darwin_file" $darwin_files
347 done # $darwin_filelist
349 cd "$darwin_orig_dir"
351 cd "$darwin_orig_dir"
352 func_extract_an_archive "$my_xdir" "$my_xabs"
357 func_extract_an_archive "$my_xdir" "$my_xabs"
360 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
362 func_extract_archives_result="$my_oldobjs"
364 # End of Shell function definitions
365 #####################################
368 eval std_shrext=\"$shrext_cmds\"
370 # Parse our command line options once, thoroughly.
371 while test "$#" -gt 0
377 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
381 # If the previous option needs an argument, assign it.
382 if test -n "$prev"; then
385 execute_dlfiles="$execute_dlfiles $arg"
389 preserve_args="${preserve_args}=$arg"
391 # Check whether tagname contains only valid characters
394 $echo "$progname: invalid tag name: $tagname" 1>&2
401 # Don't test for the "default" C tag, as we know, it's there, but
402 # not specially marked.
405 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
406 taglist="$taglist $tagname"
407 # Evaluate the configuration.
408 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
410 $echo "$progname: ignoring unknown tag $tagname" 1>&2
425 # Have we seen a non-optional argument yet?
432 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
434 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
435 $echo "This is free software; see the source for copying conditions. There is NO"
436 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
441 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
442 # Now print the configurations for the tags.
443 for tagname in $taglist; do
444 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
450 $echo "$progname: enabling shell trace mode"
452 preserve_args="$preserve_args $arg"
461 if test "$build_libtool_libs" = yes; then
462 $echo "enable shared libraries"
464 $echo "disable shared libraries"
466 if test "$build_old_libs" = yes; then
467 $echo "enable static libraries"
469 $echo "disable static libraries"
474 --finish) mode="finish" ;;
476 --mode) prevopt="--mode" prev=mode ;;
477 --mode=*) mode="$optarg" ;;
479 --preserve-dup-deps) duplicate_deps="yes" ;;
483 preserve_args="$preserve_args $arg"
486 --tag) prevopt="--tag" prev=tag ;;
488 set tag "$optarg" ${1+"$@"}
491 preserve_args="$preserve_args --tag"
500 $echo "$modename: unrecognized option \`$arg'" 1>&2
512 if test -n "$prevopt"; then
513 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
518 # If this variable is set in any of the actions, the command in it
519 # will be execed at the end. This prevents here-documents from being
520 # left over by shells.
523 if test -z "$show_help"; then
525 # Infer the operation mode.
526 if test -z "$mode"; then
527 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
528 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
530 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
542 *db | *dbx | *strace | *truss)
552 # If we have no mode, but dlfiles were specified, then do execute mode.
553 test -n "$execute_dlfiles" && mode=execute
555 # Just use the default operation mode.
556 if test -z "$mode"; then
557 if test -n "$nonopt"; then
558 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
560 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
567 # Only execute mode is allowed to have -dlopen flags.
568 if test -n "$execute_dlfiles" && test "$mode" != execute; then
569 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
574 # Change the help message to a mode-specific one.
576 help="Try \`$modename --help --mode=$mode' for more information."
578 # These modes are in order of execution frequency so that they run quickly.
580 # libtool compile mode
582 modename="$modename: compile"
583 # Get the compilation command and the source file.
585 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
596 # do not "continue". Instead, add this to base_compile
608 # Accept any command-line options.
611 if test -n "$libobj" ; then
612 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
619 -static | -prefer-pic | -prefer-non-pic)
630 arg_mode=arg # the next one goes into the "base_compile" arg list
631 continue # The current "srcfile" will either be retained or
632 ;; # replaced later. I would guess that would be a bug.
635 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
637 save_ifs="$IFS"; IFS=','
641 # Double-quote args containing other shell metacharacters.
642 # Many Bourne shells cannot handle close brackets correctly
643 # in scan sets, so we specify it separately.
645 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
649 lastarg="$lastarg $arg"
652 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
654 # Add the arguments to base_compile.
655 base_compile="$base_compile $lastarg"
660 # Accept the current argument as the source file.
661 # The previous "srcfile" becomes the current argument.
668 esac # case $arg_mode
670 # Aesthetically quote the previous argument.
671 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
674 # Double-quote args containing other shell metacharacters.
675 # Many Bourne shells cannot handle close brackets correctly
676 # in scan sets, and some SunOS ksh mistreat backslash-escaping
677 # in scan sets (worked around with variable expansion),
678 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
679 # at all, so we specify them separately.
680 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
681 lastarg="\"$lastarg\""
685 base_compile="$base_compile $lastarg"
690 $echo "$modename: you must specify an argument for -Xcompile"
694 $echo "$modename: you must specify a target with \`-o'" 1>&2
698 # Get the name of the library object.
699 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
703 # Recognize several different file suffixes.
704 # If the user specifies -o file.o, it is replaced with file.lo
714 *.class) xform=class ;;
719 *.java) xform=java ;;
722 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
725 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
727 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
732 func_infer_tag $base_compile
734 for arg in $later; do
753 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
755 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
756 qlibobj="\"$qlibobj\"" ;;
758 if test "X$libobj" != "X$qlibobj"; then
759 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
762 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
763 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
764 if test "X$xdir" = "X$obj"; then
769 lobj=${xdir}$objdir/$objname
771 if test -z "$base_compile"; then
772 $echo "$modename: you must specify a compilation command" 1>&2
777 # Delete any leftover library objects.
778 if test "$build_old_libs" = yes; then
779 removelist="$obj $lobj $libobj ${libobj}T"
781 removelist="$lobj $libobj ${libobj}T"
785 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
787 # On Cygwin there's no "real" PIC flag so we must build both object types
789 cygwin* | mingw* | pw32* | os2*)
793 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
794 # non-PIC code in shared libraries is not supported
798 # Calculate the filename of the output object if compiler does
799 # not support -o with -c
800 if test "$compiler_c_o" = no; then
801 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
802 lockfile="$output_obj.lock"
803 removelist="$removelist $output_obj $lockfile"
804 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
811 # Lock this critical section if it is needed
812 # We use this script file to make the link, it avoids creating a new file
813 if test "$need_locks" = yes; then
814 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
815 $show "Waiting for $lockfile to be removed"
818 elif test "$need_locks" = warn; then
819 if test -f "$lockfile"; then
821 *** ERROR, $lockfile exists and contains:
822 `cat $lockfile 2>/dev/null`
824 This indicates that another process is trying to use the same
825 temporary object file, and libtool could not work around it because
826 your compiler does not support \`-c' and \`-o' together. If you
827 repeat this compilation, it may succeed, by chance, but you had better
828 avoid parallel builds (make -j) in this platform, or get a better
834 $echo "$srcfile" > "$lockfile"
837 if test -n "$fix_srcfile_path"; then
838 eval srcfile=\"$fix_srcfile_path\"
840 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
842 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
843 qsrcfile="\"$qsrcfile\"" ;;
846 $run $rm "$libobj" "${libobj}T"
848 # Create a libtool object file (analogous to a ".la" file),
849 # but don't create it if we're doing a dry run.
850 test -z "$run" && cat > ${libobj}T <<EOF
851 # $libobj - a libtool object file
852 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
854 # Please DO NOT delete this file!
855 # It is necessary for linking the library.
857 # Name of the PIC object.
860 # Only build a PIC object if we are building libtool libraries.
861 if test "$build_libtool_libs" = yes; then
862 # Without this assignment, base_compile gets emptied.
863 fbsd_hideous_sh_bug=$base_compile
865 if test "$pic_mode" != no; then
866 command="$base_compile $qsrcfile $pic_flag"
868 # Don't build PIC code
869 command="$base_compile $qsrcfile"
872 if test ! -d "${xdir}$objdir"; then
873 $show "$mkdir ${xdir}$objdir"
874 $run $mkdir ${xdir}$objdir
876 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
881 if test -z "$output_obj"; then
882 # Place PIC objects in $objdir
883 command="$command -o $lobj"
886 $run $rm "$lobj" "$output_obj"
889 if $run eval "$command"; then :
891 test -n "$output_obj" && $run $rm $removelist
895 if test "$need_locks" = warn &&
896 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
898 *** ERROR, $lockfile contains:
899 `cat $lockfile 2>/dev/null`
901 but it should contain:
904 This indicates that another process is trying to use the same
905 temporary object file, and libtool could not work around it because
906 your compiler does not support \`-c' and \`-o' together. If you
907 repeat this compilation, it may succeed, by chance, but you had better
908 avoid parallel builds (make -j) in this platform, or get a better
915 # Just move the object if needed, then go on to compile the next one
916 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
917 $show "$mv $output_obj $lobj"
918 if $run $mv $output_obj $lobj; then :
926 # Append the name of the PIC object to the libtool object file.
927 test -z "$run" && cat >> ${libobj}T <<EOF
928 pic_object='$objdir/$objname'
932 # Allow error messages only from the first compilation.
933 if test "$suppress_opt" = yes; then
934 suppress_output=' >/dev/null 2>&1'
937 # No PIC object so indicate it doesn't exist in the libtool
939 test -z "$run" && cat >> ${libobj}T <<EOF
945 # Only build a position-dependent object if we build old libraries.
946 if test "$build_old_libs" = yes; then
947 if test "$pic_mode" != yes; then
948 # Don't build PIC code
949 command="$base_compile $qsrcfile"
951 command="$base_compile $qsrcfile $pic_flag"
953 if test "$compiler_c_o" = yes; then
954 command="$command -o $obj"
957 # Suppress compiler output if we already did a PIC compilation.
958 command="$command$suppress_output"
959 $run $rm "$obj" "$output_obj"
961 if $run eval "$command"; then :
967 if test "$need_locks" = warn &&
968 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
970 *** ERROR, $lockfile contains:
971 `cat $lockfile 2>/dev/null`
973 but it should contain:
976 This indicates that another process is trying to use the same
977 temporary object file, and libtool could not work around it because
978 your compiler does not support \`-c' and \`-o' together. If you
979 repeat this compilation, it may succeed, by chance, but you had better
980 avoid parallel builds (make -j) in this platform, or get a better
987 # Just move the object if needed
988 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
989 $show "$mv $output_obj $obj"
990 if $run $mv $output_obj $obj; then :
998 # Append the name of the non-PIC object the libtool object file.
999 # Only append if the libtool object file exists.
1000 test -z "$run" && cat >> ${libobj}T <<EOF
1001 # Name of the non-PIC object.
1002 non_pic_object='$objname'
1006 # Append the name of the non-PIC object the libtool object file.
1007 # Only append if the libtool object file exists.
1008 test -z "$run" && cat >> ${libobj}T <<EOF
1009 # Name of the non-PIC object.
1015 $run $mv "${libobj}T" "${libobj}"
1017 # Unlock the critical section if it was locked
1018 if test "$need_locks" != no; then
1019 $run $rm "$lockfile"
1027 modename="$modename: link"
1029 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1030 # It is impossible to link a dll without this setting, and
1031 # we shouldn't force the makefile maintainer to figure out
1032 # which system we are compiling for in order to pass an extra
1033 # flag for every libtool invocation.
1034 # allow_undefined=no
1036 # FIXME: Unfortunately, there are problems with the above when trying
1037 # to make a dll which has undefined symbols, in which case not
1038 # even a static library is built. For now, we need to specify
1039 # -no-undefined on the libtool link line when we can be certain
1040 # that all symbols are satisfied, otherwise we get a static library.
1047 libtool_args="$nonopt"
1048 base_compile="$nonopt $@"
1049 compile_command="$nonopt"
1050 finalize_command="$nonopt"
1063 lib_search_path=`pwd`
1072 export_symbols_regex=
1080 precious_files_regex=
1081 prefer_static_libs=no
1094 func_infer_tag $base_compile
1096 # We need to know -static, to get the right output filenames.
1100 -all-static | -static)
1101 if test "X$arg" = "X-all-static"; then
1102 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1103 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1105 if test -n "$link_static_flag"; then
1106 dlopen_self=$dlopen_self_static
1108 prefer_static_libs=yes
1110 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1111 dlopen_self=$dlopen_self_static
1113 prefer_static_libs=built
1115 build_libtool_libs=no
1122 # See if our shared archives depend on static archives.
1123 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1125 # Go through the arguments, transforming them on the way.
1126 while test "$#" -gt 0; do
1130 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1131 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1135 libtool_args="$libtool_args $qarg"
1137 # If the previous option needs an argument, assign it.
1138 if test -n "$prev"; then
1141 compile_command="$compile_command @OUTPUT@"
1142 finalize_command="$finalize_command @OUTPUT@"
1148 if test "$preload" = no; then
1149 # Add the symbol object into the linking commands.
1150 compile_command="$compile_command @SYMFILE@"
1151 finalize_command="$finalize_command @SYMFILE@"
1155 *.la | *.lo) ;; # We handle these cases below.
1157 if test "$dlself" = no; then
1165 if test "$prev" = dlprefiles; then
1167 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1177 if test "$prev" = dlfiles; then
1178 dlfiles="$dlfiles $arg"
1180 dlprefiles="$dlprefiles $arg"
1188 export_symbols="$arg"
1189 if test ! -f "$arg"; then
1190 $echo "$modename: symbol file \`$arg' does not exist"
1197 export_symbols_regex="$arg"
1202 inst_prefix_dir="$arg"
1207 precious_files_regex="$arg"
1217 if test -f "$arg"; then
1220 for fil in `cat $save_arg`
1222 # moreargs="$moreargs $fil"
1224 # A libtool-controlled object.
1226 # Check to see that this really is a libtool object.
1227 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1232 # If there is no directory component, then add one.
1234 */* | *\\*) . $arg ;;
1238 if test -z "$pic_object" || \
1239 test -z "$non_pic_object" ||
1240 test "$pic_object" = none && \
1241 test "$non_pic_object" = none; then
1242 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1246 # Extract subdirectory from the argument.
1247 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1248 if test "X$xdir" = "X$arg"; then
1254 if test "$pic_object" != none; then
1255 # Prepend the subdirectory the object is found in.
1256 pic_object="$xdir$pic_object"
1258 if test "$prev" = dlfiles; then
1259 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1260 dlfiles="$dlfiles $pic_object"
1264 # If libtool objects are unsupported, then we need to preload.
1269 # CHECK ME: I think I busted this. -Ossama
1270 if test "$prev" = dlprefiles; then
1271 # Preload the old-style object.
1272 dlprefiles="$dlprefiles $pic_object"
1277 libobjs="$libobjs $pic_object"
1282 if test "$non_pic_object" != none; then
1283 # Prepend the subdirectory the object is found in.
1284 non_pic_object="$xdir$non_pic_object"
1286 # A standard non-PIC object
1287 non_pic_objects="$non_pic_objects $non_pic_object"
1288 if test -z "$pic_object" || test "$pic_object" = none ; then
1289 arg="$non_pic_object"
1293 # Only an error if not doing a dry-run.
1294 if test -z "$run"; then
1295 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1300 # Extract subdirectory from the argument.
1301 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1302 if test "X$xdir" = "X$arg"; then
1308 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1309 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1310 libobjs="$libobjs $pic_object"
1311 non_pic_objects="$non_pic_objects $non_pic_object"
1316 $echo "$modename: link input file \`$save_arg' does not exist"
1324 # We need an absolute path.
1326 [\\/]* | [A-Za-z]:[\\/]*) ;;
1328 $echo "$modename: only absolute run-paths are allowed" 1>&2
1332 if test "$prev" = rpath; then
1335 *) rpath="$rpath $arg" ;;
1340 *) xrpath="$xrpath $arg" ;;
1347 compiler_flags="$compiler_flags $qarg"
1349 compile_command="$compile_command $qarg"
1350 finalize_command="$finalize_command $qarg"
1354 linker_flags="$linker_flags $qarg"
1355 compiler_flags="$compiler_flags $wl$qarg"
1357 compile_command="$compile_command $wl$qarg"
1358 finalize_command="$finalize_command $wl$qarg"
1362 linker_flags="$linker_flags $qarg"
1363 compiler_flags="$compiler_flags $qarg"
1365 compile_command="$compile_command $qarg"
1366 finalize_command="$finalize_command $qarg"
1375 compiler_flags="$compiler_flags $arg"
1376 compile_command="$compile_command $arg"
1377 finalize_command="$finalize_command $arg"
1382 eval "$prev=\"\$arg\""
1387 fi # test -n "$prev"
1393 if test -n "$link_static_flag"; then
1394 compile_command="$compile_command $link_static_flag"
1395 finalize_command="$finalize_command $link_static_flag"
1401 # FIXME: remove this flag sometime in the future.
1402 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1426 -export-symbols | -export-symbols-regex)
1427 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1428 $echo "$modename: more than one -exported-symbols argument is not allowed"
1431 if test "X$arg" = "X-export-symbols"; then
1440 prev=darwin_framework
1441 compiler_flags="$compiler_flags $arg"
1442 compile_command="$compile_command $arg"
1443 finalize_command="$finalize_command $arg"
1452 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1453 # so, if we see these flags be careful not to treat them like -L
1455 case $with_gcc/$host in
1456 no/*-*-irix* | /*-*-irix*)
1457 compile_command="$compile_command $arg"
1458 finalize_command="$finalize_command $arg"
1465 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1466 # We need an absolute path.
1468 [\\/]* | [A-Za-z]:[\\/]*) ;;
1470 absdir=`cd "$dir" && pwd`
1471 if test -z "$absdir"; then
1472 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1481 deplibs="$deplibs -L$dir"
1482 lib_search_path="$lib_search_path $dir"
1486 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1487 case :$dllsearchpath: in
1489 *) dllsearchpath="$dllsearchpath:$dir";;
1497 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1499 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1500 # These systems don't actually have a C or math library (as such)
1503 *-*-mingw* | *-*-os2*)
1504 # These systems don't actually have a C library (as such)
1505 test "X$arg" = "X-lc" && continue
1507 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1508 # Do not include libc due to us having libc/libc_r.
1509 test "X$arg" = "X-lc" && continue
1511 *-*-rhapsody* | *-*-darwin1.[012])
1512 # Rhapsody C and math libraries are in the System framework
1513 deplibs="$deplibs -framework System"
1516 elif test "X$arg" = "X-lc_r"; then
1518 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1519 # Do not include libc_r directly, use -pthread flag.
1524 deplibs="$deplibs $arg"
1528 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1529 # classes, name mangling, and exception handling.
1531 compile_command="$compile_command $arg"
1532 compiler_flags="$compiler_flags $arg"
1533 finalize_command="$finalize_command $arg"
1538 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1539 compiler_flags="$compiler_flags $arg"
1540 compile_command="$compile_command $arg"
1541 finalize_command="$finalize_command $arg"
1542 deplibs="$deplibs $arg"
1550 # Do not build the useless static library
1557 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1558 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1559 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1560 # +DA*, +DD* enable 64-bit mode on the HP compiler
1561 # -q* pass through compiler args for the IBM compiler
1562 # -m* pass through architecture-specific compiler args for GCC
1563 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1565 # Unknown arguments in both finalize_command and compile_command need
1566 # to be aesthetically quoted because they are evaled later.
1567 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1569 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1573 compile_command="$compile_command $arg"
1574 finalize_command="$finalize_command $arg"
1575 if test "$with_gcc" = "yes" ; then
1576 compiler_flags="$compiler_flags $arg"
1593 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1594 # The PATH hackery in wrapper scripts is required on Windows
1595 # in order for the loader to find any dlls it needs.
1596 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1597 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1600 *) no_install=yes ;;
1617 -precious-files-regex)
1638 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1639 # We need an absolute path.
1641 [\\/]* | [A-Za-z]:[\\/]*) ;;
1643 $echo "$modename: only absolute run-paths are allowed" 1>&2
1649 *) xrpath="$xrpath $dir" ;;
1655 # The effects of -static are defined in a previous loop.
1656 # We used to do the same as -all-static on platforms that
1657 # didn't have a PIC flag, but the assumption that the effects
1658 # would be equivalent was wrong. It would break on at least
1659 # Digital Unix and AIX.
1679 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1681 save_ifs="$IFS"; IFS=','
1682 for flag in $args; do
1685 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1690 compiler_flags="$compiler_flags $flag"
1693 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1697 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1699 save_ifs="$IFS"; IFS=','
1700 for flag in $args; do
1703 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1708 compiler_flags="$compiler_flags $wl$flag"
1709 linker_flags="$linker_flags $flag"
1712 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1730 # Some other compiler flag.
1732 # Unknown arguments in both finalize_command and compile_command need
1733 # to be aesthetically quoted because they are evaled later.
1734 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1736 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1743 # A standard object.
1748 # A libtool-controlled object.
1750 # Check to see that this really is a libtool object.
1751 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1756 # If there is no directory component, then add one.
1758 */* | *\\*) . $arg ;;
1762 if test -z "$pic_object" || \
1763 test -z "$non_pic_object" ||
1764 test "$pic_object" = none && \
1765 test "$non_pic_object" = none; then
1766 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1770 # Extract subdirectory from the argument.
1771 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1772 if test "X$xdir" = "X$arg"; then
1778 if test "$pic_object" != none; then
1779 # Prepend the subdirectory the object is found in.
1780 pic_object="$xdir$pic_object"
1782 if test "$prev" = dlfiles; then
1783 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1784 dlfiles="$dlfiles $pic_object"
1788 # If libtool objects are unsupported, then we need to preload.
1793 # CHECK ME: I think I busted this. -Ossama
1794 if test "$prev" = dlprefiles; then
1795 # Preload the old-style object.
1796 dlprefiles="$dlprefiles $pic_object"
1801 libobjs="$libobjs $pic_object"
1806 if test "$non_pic_object" != none; then
1807 # Prepend the subdirectory the object is found in.
1808 non_pic_object="$xdir$non_pic_object"
1810 # A standard non-PIC object
1811 non_pic_objects="$non_pic_objects $non_pic_object"
1812 if test -z "$pic_object" || test "$pic_object" = none ; then
1813 arg="$non_pic_object"
1817 # Only an error if not doing a dry-run.
1818 if test -z "$run"; then
1819 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1824 # Extract subdirectory from the argument.
1825 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1826 if test "X$xdir" = "X$arg"; then
1832 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1833 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1834 libobjs="$libobjs $pic_object"
1835 non_pic_objects="$non_pic_objects $non_pic_object"
1842 deplibs="$deplibs $arg"
1843 old_deplibs="$old_deplibs $arg"
1848 # A libtool-controlled library.
1850 if test "$prev" = dlfiles; then
1851 # This library was specified with -dlopen.
1852 dlfiles="$dlfiles $arg"
1854 elif test "$prev" = dlprefiles; then
1855 # The library was specified with -dlpreopen.
1856 dlprefiles="$dlprefiles $arg"
1859 deplibs="$deplibs $arg"
1864 # Some other compiler argument.
1866 # Unknown arguments in both finalize_command and compile_command need
1867 # to be aesthetically quoted because they are evaled later.
1868 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1870 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1877 # Now actually substitute the argument into the commands.
1878 if test -n "$arg"; then
1879 compile_command="$compile_command $arg"
1880 finalize_command="$finalize_command $arg"
1882 done # argument parsing loop
1884 if test -n "$prev"; then
1885 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1890 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1891 eval arg=\"$export_dynamic_flag_spec\"
1892 compile_command="$compile_command $arg"
1893 finalize_command="$finalize_command $arg"
1897 # calculate the name of the file, without its directory
1898 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1899 libobjs_save="$libobjs"
1901 if test -n "$shlibpath_var"; then
1902 # get the directories listed in $shlibpath_var
1903 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1907 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1908 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1910 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1911 if test "X$output_objdir" = "X$output"; then
1912 output_objdir="$objdir"
1914 output_objdir="$output_objdir/$objdir"
1916 # Create the object directory.
1917 if test ! -d "$output_objdir"; then
1918 $show "$mkdir $output_objdir"
1919 $run $mkdir $output_objdir
1921 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1926 # Determine the type of output
1929 $echo "$modename: you must specify an output file" 1>&2
1933 *.$libext) linkmode=oldlib ;;
1934 *.lo | *.$objext) linkmode=obj ;;
1935 *.la) linkmode=lib ;;
1936 *) linkmode=prog ;; # Anything else should be a program.
1940 *cygwin* | *mingw* | *pw32*)
1941 # don't eliminate duplications in $postdeps and $predeps
1942 duplicate_compiler_generated_deps=yes
1945 duplicate_compiler_generated_deps=$duplicate_deps
1951 # Find all interdependent deplibs by searching for libraries
1952 # that are linked more than once (e.g. -la -lb -la)
1953 for deplib in $deplibs; do
1954 if test "X$duplicate_deps" = "Xyes" ; then
1956 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1959 libs="$libs $deplib"
1962 if test "$linkmode" = lib; then
1963 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1965 # Compute libraries that are listed more than once in $predeps
1966 # $postdeps and mark them as special (i.e., whose duplicates are
1967 # not to be eliminated).
1969 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1970 for pre_post_dep in $predeps $postdeps; do
1971 case "$pre_post_deps " in
1972 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1974 pre_post_deps="$pre_post_deps $pre_post_dep"
1983 need_relink=no # whether we're linking any uninstalled libtool libraries
1984 notinst_deplibs= # not-installed libtool libraries
1985 notinst_path= # paths that contain not-installed libtool libraries
1989 for file in $dlfiles $dlprefiles; do
1993 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2005 passes="conv scan dlopen dlpreopen link"
2010 for pass in $passes; do
2011 if test "$linkmode,$pass" = "lib,link" ||
2012 test "$linkmode,$pass" = "prog,scan"; then
2016 if test "$linkmode" = prog; then
2018 dlopen) libs="$dlfiles" ;;
2019 dlpreopen) libs="$dlprefiles" ;;
2020 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2023 if test "$pass" = dlopen; then
2024 # Collect dlpreopened libraries
2025 save_deplibs="$deplibs"
2028 for deplib in $libs; do
2032 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2033 if test "$linkmode,$pass" = "prog,link"; then
2034 compile_deplibs="$deplib $compile_deplibs"
2035 finalize_deplibs="$deplib $finalize_deplibs"
2037 compiler_flags="$compiler_flags $deplib"
2042 deplibs="$deplib $deplibs"
2043 test "$pass" = conv && continue
2044 newdependency_libs="$deplib $newdependency_libs"
2047 if test "$pass" = conv; then
2048 deplibs="$deplib $deplibs"
2051 if test "$pass" = scan; then
2052 deplibs="$deplib $deplibs"
2054 compile_deplibs="$deplib $compile_deplibs"
2055 finalize_deplibs="$deplib $finalize_deplibs"
2065 if test "$linkmode" != lib && test "$linkmode" != prog; then
2066 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2069 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2070 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2071 for search_ext in .la $std_shrext .so .a; do
2072 # Search the libtool library
2073 lib="$searchdir/lib${name}${search_ext}"
2074 if test -f "$lib"; then
2075 if test "$search_ext" = ".la"; then
2084 if test "$found" != yes; then
2085 # deplib doesn't seem to be a libtool library
2086 if test "$linkmode,$pass" = "prog,link"; then
2087 compile_deplibs="$deplib $compile_deplibs"
2088 finalize_deplibs="$deplib $finalize_deplibs"
2090 deplibs="$deplib $deplibs"
2091 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2094 else # deplib is a libtool library
2095 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2096 # We need to do some special things here, and not later.
2097 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2098 case " $predeps $postdeps " in
2100 if (${SED} -e '2q' $lib |
2101 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2105 */* | *\\*) . $lib ;;
2108 for l in $old_library $library_names; do
2111 if test "X$ll" = "X$old_library" ; then # only static version available
2113 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2114 test "X$ladir" = "X$lib" && ladir="."
2115 lib=$ladir/$old_library
2116 if test "$linkmode,$pass" = "prog,link"; then
2117 compile_deplibs="$deplib $compile_deplibs"
2118 finalize_deplibs="$deplib $finalize_deplibs"
2120 deplibs="$deplib $deplibs"
2121 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2135 deplibs="$deplib $deplibs"
2136 test "$pass" = conv && continue
2137 newdependency_libs="$deplib $newdependency_libs"
2138 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2141 if test "$pass" = conv; then
2142 deplibs="$deplib $deplibs"
2145 if test "$pass" = scan; then
2146 deplibs="$deplib $deplibs"
2148 compile_deplibs="$deplib $compile_deplibs"
2149 finalize_deplibs="$deplib $finalize_deplibs"
2151 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2154 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2160 if test "$pass" = link; then
2161 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2162 # Make sure the xrpath contains only unique directories.
2165 *) xrpath="$xrpath $dir" ;;
2168 deplibs="$deplib $deplibs"
2171 *.la) lib="$deplib" ;;
2173 if test "$pass" = conv; then
2174 deplibs="$deplib $deplibs"
2180 case $deplibs_check_method in
2182 set dummy $deplibs_check_method
2183 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2184 if eval $echo \"$deplib\" 2>/dev/null \
2186 | $EGREP "$match_pattern_regex" > /dev/null; then
2194 if test "$valid_a_lib" != yes; then
2196 $echo "*** Warning: Trying to link with static lib archive $deplib."
2197 $echo "*** I have the capability to make that library automatically link in when"
2198 $echo "*** you link to this library. But I can only do this if you have a"
2199 $echo "*** shared version of the library, which you do not appear to have"
2200 $echo "*** because the file extensions .$libext of this argument makes me believe"
2201 $echo "*** that it is just a static archive that I should not used here."
2204 $echo "*** Warning: Linking the shared library $output against the"
2205 $echo "*** static library $deplib is not portable!"
2206 deplibs="$deplib $deplibs"
2211 if test "$pass" != link; then
2212 deplibs="$deplib $deplibs"
2214 compile_deplibs="$deplib $compile_deplibs"
2215 finalize_deplibs="$deplib $finalize_deplibs"
2222 if test "$pass" = conv; then
2223 deplibs="$deplib $deplibs"
2224 elif test "$linkmode" = prog; then
2225 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2226 # If there is no dlopen support or we're linking statically,
2227 # we need to preload.
2228 newdlprefiles="$newdlprefiles $deplib"
2229 compile_deplibs="$deplib $compile_deplibs"
2230 finalize_deplibs="$deplib $finalize_deplibs"
2232 newdlfiles="$newdlfiles $deplib"
2242 if test "$found" = yes || test -f "$lib"; then :
2244 $echo "$modename: cannot find the library \`$lib'" 1>&2
2248 # Check to see that this really is a libtool archive.
2249 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2251 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2255 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2256 test "X$ladir" = "X$lib" && ladir="."
2264 # If the library was installed with an old release of libtool,
2265 # it will not redefine variables installed, or shouldnotlink
2273 */* | *\\*) . $lib ;;
2277 if test "$linkmode,$pass" = "lib,link" ||
2278 test "$linkmode,$pass" = "prog,scan" ||
2279 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2280 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2281 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2284 if test "$pass" = conv; then
2285 # Only check for convenience libraries
2286 deplibs="$lib $deplibs"
2287 if test -z "$libdir"; then
2288 if test -z "$old_library"; then
2289 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2292 # It is a libtool convenience library, so add in its objects.
2293 convenience="$convenience $ladir/$objdir/$old_library"
2294 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2296 for deplib in $dependency_libs; do
2297 deplibs="$deplib $deplibs"
2298 if test "X$duplicate_deps" = "Xyes" ; then
2299 case "$tmp_libs " in
2300 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2303 tmp_libs="$tmp_libs $deplib"
2305 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2306 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2313 # Get the name of the library we link against.
2315 for l in $old_library $library_names; do
2318 if test -z "$linklib"; then
2319 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2323 # This library was specified with -dlopen.
2324 if test "$pass" = dlopen; then
2325 if test -z "$libdir"; then
2326 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2329 if test -z "$dlname" ||
2330 test "$dlopen_support" != yes ||
2331 test "$build_libtool_libs" = no; then
2332 # If there is no dlname, no dlopen support or we're linking
2333 # statically, we need to preload. We also need to preload any
2334 # dependent libraries so libltdl's deplib preloader doesn't
2335 # bomb out in the load deplibs phase.
2336 dlprefiles="$dlprefiles $lib $dependency_libs"
2338 newdlfiles="$newdlfiles $lib"
2343 # We need an absolute path.
2345 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2347 abs_ladir=`cd "$ladir" && pwd`
2348 if test -z "$abs_ladir"; then
2349 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2350 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2355 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2357 # Find the relevant object directory and library name.
2358 if test "X$installed" = Xyes; then
2359 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2360 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2368 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2370 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2373 # Remove this search path later
2374 notinst_path="$notinst_path $abs_ladir"
2376 dir="$ladir/$objdir"
2377 absdir="$abs_ladir/$objdir"
2378 # Remove this search path later
2379 notinst_path="$notinst_path $abs_ladir"
2381 fi # $installed = yes
2382 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2384 # This library was specified with -dlpreopen.
2385 if test "$pass" = dlpreopen; then
2386 if test -z "$libdir"; then
2387 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2390 # Prefer using a static library (so that no silly _DYNAMIC symbols
2391 # are required to link).
2392 if test -n "$old_library"; then
2393 newdlprefiles="$newdlprefiles $dir/$old_library"
2394 # Otherwise, use the dlname, so that lt_dlopen finds it.
2395 elif test -n "$dlname"; then
2396 newdlprefiles="$newdlprefiles $dir/$dlname"
2398 newdlprefiles="$newdlprefiles $dir/$linklib"
2400 fi # $pass = dlpreopen
2402 if test -z "$libdir"; then
2403 # Link the convenience library
2404 if test "$linkmode" = lib; then
2405 deplibs="$dir/$old_library $deplibs"
2406 elif test "$linkmode,$pass" = "prog,link"; then
2407 compile_deplibs="$dir/$old_library $compile_deplibs"
2408 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2410 deplibs="$lib $deplibs" # used for prog,scan pass
2416 if test "$linkmode" = prog && test "$pass" != link; then
2417 newlib_search_path="$newlib_search_path $ladir"
2418 deplibs="$lib $deplibs"
2421 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2422 test "$build_libtool_libs" = no; then
2427 for deplib in $dependency_libs; do
2429 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2431 # Need to link against all dependency_libs?
2432 if test "$linkalldeplibs" = yes; then
2433 deplibs="$deplib $deplibs"
2435 # Need to hardcode shared library paths
2436 # or/and link against static libraries
2437 newdependency_libs="$deplib $newdependency_libs"
2439 if test "X$duplicate_deps" = "Xyes" ; then
2440 case "$tmp_libs " in
2441 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2444 tmp_libs="$tmp_libs $deplib"
2447 fi # $linkmode = prog...
2449 if test "$linkmode,$pass" = "prog,link"; then
2450 if test -n "$library_names" &&
2451 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2452 # We need to hardcode the library path
2453 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2454 # Make sure the rpath contains only unique directories.
2455 case "$temp_rpath " in
2458 *) temp_rpath="$temp_rpath $dir" ;;
2462 # Hardcode the library path.
2463 # Skip directories that are in the system default run-time
2465 case " $sys_lib_dlsearch_path " in
2468 case "$compile_rpath " in
2470 *) compile_rpath="$compile_rpath $absdir"
2474 case " $sys_lib_dlsearch_path " in
2477 case "$finalize_rpath " in
2479 *) finalize_rpath="$finalize_rpath $libdir"
2483 fi # $linkmode,$pass = prog,link...
2485 if test "$alldeplibs" = yes &&
2486 { test "$deplibs_check_method" = pass_all ||
2487 { test "$build_libtool_libs" = yes &&
2488 test -n "$library_names"; }; }; then
2489 # We only need to search for static libraries
2494 link_static=no # Whether the deplib will be linked statically
2495 use_static_libs="$prefer_static_libs"
2496 if test "$use_static_libs" = built && test "$installed" = yes ; then
2499 if test -n "$library_names" &&
2500 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2501 if test "$installed" = no; then
2502 notinst_deplibs="$notinst_deplibs $lib"
2505 # This is a shared library
2507 # Warn about portability, can't link against -module's on
2508 # some systems (darwin)
2509 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2511 if test "$linkmode" = prog; then
2512 $echo "*** Warning: Linking the executable $output against the loadable module"
2514 $echo "*** Warning: Linking the shared library $output against the loadable module"
2516 $echo "*** $linklib is not portable!"
2518 if test "$linkmode" = lib &&
2519 test "$hardcode_into_libs" = yes; then
2520 # Hardcode the library path.
2521 # Skip directories that are in the system default run-time
2523 case " $sys_lib_dlsearch_path " in
2526 case "$compile_rpath " in
2528 *) compile_rpath="$compile_rpath $absdir"
2532 case " $sys_lib_dlsearch_path " in
2535 case "$finalize_rpath " in
2537 *) finalize_rpath="$finalize_rpath $libdir"
2543 if test -n "$old_archive_from_expsyms_cmds"; then
2544 # figure out the soname
2545 set dummy $library_names
2548 libname=`eval \\$echo \"$libname_spec\"`
2549 # use dlname if we got it. it's perfectly good, no?
2550 if test -n "$dlname"; then
2552 elif test -n "$soname_spec"; then
2556 major=`expr $current - $age`
2560 eval soname=\"$soname_spec\"
2565 # Make a new name for the extract_expsyms_cmds to use
2567 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2568 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2570 # If the library has no export list, then create one now
2571 if test -f "$output_objdir/$soname-def"; then :
2573 $show "extracting exported symbol list from \`$soname'"
2574 save_ifs="$IFS"; IFS='~'
2575 cmds=$extract_expsyms_cmds
2576 for cmd in $cmds; do
2580 $run eval "$cmd" || exit $?
2586 if test -f "$output_objdir/$newlib"; then :; else
2587 $show "generating import library for \`$soname'"
2588 save_ifs="$IFS"; IFS='~'
2589 cmds=$old_archive_from_expsyms_cmds
2590 for cmd in $cmds; do
2594 $run eval "$cmd" || exit $?
2598 # make sure the library variables are pointing to the new library
2601 fi # test -n "$old_archive_from_expsyms_cmds"
2603 if test "$linkmode" = prog || test "$mode" != relink; then
2608 case $hardcode_action in
2609 immediate | unsupported)
2610 if test "$hardcode_direct" = no; then
2613 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2615 # if the lib is a module then we can not link against
2616 # it, someone is ignoring the new warnings I added
2617 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2618 $echo "** Warning, lib $linklib is a module, not a shared library"
2619 if test -z "$old_library" ; then
2621 $echo "** And there doesn't seem to be a static archive available"
2622 $echo "** The link will probably fail, sorry"
2624 add="$dir/$old_library"
2628 elif test "$hardcode_minus_L" = no; then
2630 *-*-sunos*) add_shlibpath="$dir" ;;
2634 elif test "$hardcode_shlibpath_var" = no; then
2635 add_shlibpath="$dir"
2642 if test "$hardcode_direct" = yes; then
2644 elif test "$hardcode_minus_L" = yes; then
2646 # Try looking first in the location we're being installed to.
2647 if test -n "$inst_prefix_dir"; then
2650 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2655 elif test "$hardcode_shlibpath_var" = yes; then
2656 add_shlibpath="$dir"
2665 if test "$lib_linked" != yes; then
2666 $echo "$modename: configuration error: unsupported hardcode properties"
2670 if test -n "$add_shlibpath"; then
2671 case :$compile_shlibpath: in
2672 *":$add_shlibpath:"*) ;;
2673 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2676 if test "$linkmode" = prog; then
2677 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2678 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2680 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2681 test -n "$add" && deplibs="$add $deplibs"
2682 if test "$hardcode_direct" != yes && \
2683 test "$hardcode_minus_L" != yes && \
2684 test "$hardcode_shlibpath_var" = yes; then
2685 case :$finalize_shlibpath: in
2687 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2693 if test "$linkmode" = prog || test "$mode" = relink; then
2697 # Finalize command for both is simple: just hardcode it.
2698 if test "$hardcode_direct" = yes; then
2699 add="$libdir/$linklib"
2700 elif test "$hardcode_minus_L" = yes; then
2703 elif test "$hardcode_shlibpath_var" = yes; then
2704 case :$finalize_shlibpath: in
2706 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2709 elif test "$hardcode_automatic" = yes; then
2710 if test -n "$inst_prefix_dir" &&
2711 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2712 add="$inst_prefix_dir$libdir/$linklib"
2714 add="$libdir/$linklib"
2717 # We cannot seem to hardcode it, guess we'll fake it.
2719 # Try looking first in the location we're being installed to.
2720 if test -n "$inst_prefix_dir"; then
2723 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2730 if test "$linkmode" = prog; then
2731 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2732 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2734 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2735 test -n "$add" && deplibs="$add $deplibs"
2738 elif test "$linkmode" = prog; then
2739 # Here we assume that one of hardcode_direct or hardcode_minus_L
2740 # is not unsupported. This is valid on all known static and
2742 if test "$hardcode_direct" != unsupported; then
2743 test -n "$old_library" && linklib="$old_library"
2744 compile_deplibs="$dir/$linklib $compile_deplibs"
2745 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2747 compile_deplibs="-l$name -L$dir $compile_deplibs"
2748 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2750 elif test "$build_libtool_libs" = yes; then
2751 # Not a shared library
2752 if test "$deplibs_check_method" != pass_all; then
2753 # We're trying link a shared library against a static one
2754 # but the system doesn't support it.
2756 # Just print a warning and add the library to dependency_libs so
2757 # that the program can be linked against the static library.
2759 $echo "*** Warning: This system can not link to static lib archive $lib."
2760 $echo "*** I have the capability to make that library automatically link in when"
2761 $echo "*** you link to this library. But I can only do this if you have a"
2762 $echo "*** shared version of the library, which you do not appear to have."
2763 if test "$module" = yes; then
2764 $echo "*** But as you try to build a module library, libtool will still create "
2765 $echo "*** a static module, that should work as long as the dlopening application"
2766 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2767 if test -z "$global_symbol_pipe"; then
2769 $echo "*** However, this would only work if libtool was able to extract symbol"
2770 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2771 $echo "*** not find such a program. So, this module is probably useless."
2772 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2774 if test "$build_old_libs" = no; then
2775 build_libtool_libs=module
2778 build_libtool_libs=no
2782 convenience="$convenience $dir/$old_library"
2783 old_convenience="$old_convenience $dir/$old_library"
2784 deplibs="$dir/$old_library $deplibs"
2787 fi # link shared/static library?
2789 if test "$linkmode" = lib; then
2790 if test -n "$dependency_libs" &&
2791 { test "$hardcode_into_libs" != yes ||
2792 test "$build_old_libs" = yes ||
2793 test "$link_static" = yes; }; then
2794 # Extract -R from dependency_libs
2796 for libdir in $dependency_libs; do
2798 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2800 *" $temp_xrpath "*) ;;
2801 *) xrpath="$xrpath $temp_xrpath";;
2803 *) temp_deplibs="$temp_deplibs $libdir";;
2806 dependency_libs="$temp_deplibs"
2809 newlib_search_path="$newlib_search_path $absdir"
2810 # Link against this library
2811 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2812 # ... and its dependency_libs
2814 for deplib in $dependency_libs; do
2815 newdependency_libs="$deplib $newdependency_libs"
2816 if test "X$duplicate_deps" = "Xyes" ; then
2817 case "$tmp_libs " in
2818 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2821 tmp_libs="$tmp_libs $deplib"
2824 if test "$link_all_deplibs" != no; then
2825 # Add the search paths of all dependency libraries
2826 for deplib in $dependency_libs; do
2828 -L*) path="$deplib" ;;
2830 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2831 test "X$dir" = "X$deplib" && dir="."
2832 # We need an absolute path.
2834 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2836 absdir=`cd "$dir" && pwd`
2837 if test -z "$absdir"; then
2838 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2843 if grep "^installed=no" $deplib > /dev/null; then
2844 path="$absdir/$objdir"
2846 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2847 if test -z "$libdir"; then
2848 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2851 if test "$absdir" != "$libdir"; then
2852 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2859 # we do not want to link against static libs,
2860 # but need to link against shared
2861 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2862 if test -n "$deplibrary_names" ; then
2863 for tmp in $deplibrary_names ; do
2866 if test -f "$path/$depdepl" ; then
2867 depdepl="$path/$depdepl"
2869 # do not add paths which are already there
2870 case " $newlib_search_path " in
2872 *) newlib_search_path="$newlib_search_path $path";;
2885 # Again, we only want to link against shared libraries
2886 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2887 for tmp in $newlib_search_path ; do
2888 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2889 eval depdepl="$tmp/lib$tmp_libs.dylib"
2900 case " $deplibs " in
2902 *) deplibs="$path $deplibs" ;;
2904 case " $deplibs " in
2906 *) deplibs="$depdepl $deplibs" ;;
2909 fi # link_all_deplibs != no
2911 done # for deplib in $libs
2912 dependency_libs="$newdependency_libs"
2913 if test "$pass" = dlpreopen; then
2914 # Link the dlpreopened libraries before other libraries
2915 for deplib in $save_deplibs; do
2916 deplibs="$deplib $deplibs"
2919 if test "$pass" != dlopen; then
2920 if test "$pass" != conv; then
2921 # Make sure lib_search_path contains only unique directories.
2923 for dir in $newlib_search_path; do
2924 case "$lib_search_path " in
2926 *) lib_search_path="$lib_search_path $dir" ;;
2932 if test "$linkmode,$pass" != "prog,link"; then
2935 vars="compile_deplibs finalize_deplibs"
2937 for var in $vars dependency_libs; do
2938 # Add libraries to $var in reverse order
2939 eval tmp_libs=\"\$$var\"
2941 for deplib in $tmp_libs; do
2942 # FIXME: Pedantically, this is the right thing to do, so
2943 # that some nasty dependency loop isn't accidentally
2945 #new_libs="$deplib $new_libs"
2946 # Pragmatically, this seems to cause very few problems in
2949 -L*) new_libs="$deplib $new_libs" ;;
2952 # And here is the reason: when a library appears more
2953 # than once as an explicit dependence of a library, or
2954 # is implicitly linked in more than once by the
2955 # compiler, it is considered special, and multiple
2956 # occurrences thereof are not removed. Compare this
2957 # with having the same library being listed as a
2958 # dependency of multiple other libraries: in this case,
2959 # we know (pedantically, we assume) the library does not
2960 # need to be listed more than once, so we keep only the
2961 # last copy. This is not always right, but it is rare
2962 # enough that we require users that really mean to play
2963 # such unportable linking tricks to link the library
2964 # using -Wl,-lname, so that libtool does not consider it
2965 # for duplicate removal.
2966 case " $specialdeplibs " in
2967 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2969 case " $new_libs " in
2971 *) new_libs="$deplib $new_libs" ;;
2979 for deplib in $new_libs; do
2982 case " $tmp_libs " in
2984 *) tmp_libs="$tmp_libs $deplib" ;;
2987 *) tmp_libs="$tmp_libs $deplib" ;;
2990 eval $var=\"$tmp_libs\"
2993 # Last step: remove runtime libs from dependency_libs
2994 # (they stay in deplibs)
2996 for i in $dependency_libs ; do
2997 case " $predeps $postdeps $compiler_lib_search_path " in
3002 if test -n "$i" ; then
3003 tmp_libs="$tmp_libs $i"
3006 dependency_libs=$tmp_libs
3008 if test "$linkmode" = prog; then
3009 dlfiles="$newdlfiles"
3010 dlprefiles="$newdlprefiles"
3015 if test -n "$deplibs"; then
3016 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3019 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3020 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3023 if test -n "$rpath"; then
3024 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3027 if test -n "$xrpath"; then
3028 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3031 if test -n "$vinfo"; then
3032 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3035 if test -n "$release"; then
3036 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3039 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3040 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3043 # Now set the variables for building old libraries.
3044 build_libtool_libs=no
3046 objs="$objs$old_deplibs"
3050 # Make sure we only generate libraries of the form `libNAME.la'.
3053 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3054 eval shared_ext=\"$shrext_cmds\"
3055 eval libname=\"$libname_spec\"
3058 if test "$module" = no; then
3059 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3063 if test "$need_lib_prefix" != no; then
3064 # Add the "lib" prefix for modules if required
3065 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3066 eval shared_ext=\"$shrext_cmds\"
3067 eval libname=\"$libname_spec\"
3069 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3074 if test -n "$objs"; then
3075 if test "$deplibs_check_method" != pass_all; then
3076 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3080 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3081 $echo "*** objects $objs is not portable!"
3082 libobjs="$libobjs $objs"
3086 if test "$dlself" != no; then
3087 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3091 if test "$#" -gt 2; then
3092 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3097 if test -z "$rpath"; then
3098 if test "$build_libtool_libs" = yes; then
3099 # Building a libtool convenience library.
3100 # Some compilers have problems with a `.al' extension so
3101 # convenience libraries should have the same extension an
3102 # archive normally would.
3103 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3104 build_libtool_libs=convenience
3108 if test -n "$vinfo"; then
3109 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3112 if test -n "$release"; then
3113 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3117 # Parse the version information argument.
3118 save_ifs="$IFS"; IFS=':'
3119 set dummy $vinfo 0 0 0
3122 if test -n "$8"; then
3123 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3128 # convert absolute version numbers to libtool ages
3129 # this retains compatibility with .la files and attempts
3130 # to make the code below a bit more comprehensible
3132 case $vinfo_number in
3136 number_revision="$4"
3138 # There are really only two kinds -- those that
3139 # use the current revision as the major version
3140 # and those that subtract age and use age as
3141 # a minor version. But, then there is irix
3142 # which has an extra 1 added just for fun
3144 case $version_type in
3145 darwin|linux|osf|windows)
3146 current=`expr $number_major + $number_minor`
3148 revision="$number_revision"
3150 freebsd-aout|freebsd-elf|sunos)
3151 current="$number_major"
3152 revision="$number_minor"
3156 current=`expr $number_major + $number_minor - 1`
3158 revision="$number_minor"
3169 # Check that each of the things are valid numbers.
3171 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3173 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3174 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3180 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3182 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3183 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3189 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3191 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3192 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3197 if test "$age" -gt "$current"; then
3198 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3199 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3203 # Calculate the version variables.
3207 case $version_type in
3211 # Like Linux, but with the current version available in
3212 # verstring for coding it into the library header
3213 major=.`expr $current - $age`
3214 versuffix="$major.$age.$revision"
3215 # Darwin ld doesn't like 0 for these options...
3216 minor_current=`expr $current + 1`
3217 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3222 versuffix=".$current.$revision";
3227 versuffix=".$current";
3231 major=`expr $current - $age + 1`
3233 case $version_type in
3234 nonstopux) verstring_prefix=nonstopux ;;
3235 *) verstring_prefix=sgi ;;
3237 verstring="$verstring_prefix$major.$revision"
3239 # Add in all the interfaces that we are compatible with.
3241 while test "$loop" -ne 0; do
3242 iface=`expr $revision - $loop`
3243 loop=`expr $loop - 1`
3244 verstring="$verstring_prefix$major.$iface:$verstring"
3247 # Before this point, $major must not contain `.'.
3249 versuffix="$major.$revision"
3253 major=.`expr $current - $age`
3254 versuffix="$major.$age.$revision"
3258 major=.`expr $current - $age`
3259 versuffix=".$current.$age.$revision"
3260 verstring="$current.$age.$revision"
3262 # Add in all the interfaces that we are compatible with.
3264 while test "$loop" -ne 0; do
3265 iface=`expr $current - $loop`
3266 loop=`expr $loop - 1`
3267 verstring="$verstring:${iface}.0"
3270 # Make executables depend on our current version.
3271 verstring="$verstring:${current}.0"
3276 versuffix=".$current.$revision"
3280 # Use '-' rather than '.', since we only want one
3281 # extension on DOS 8.3 filesystems.
3282 major=`expr $current - $age`
3287 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3288 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3293 # Clear the version info if we defaulted, and they specified a release.
3294 if test -z "$vinfo" && test -n "$release"; then
3296 case $version_type in
3298 # we can't check for "0.0" in archive_cmds due to quoting
3299 # problems, so we reset it completely
3306 if test "$need_version" = no; then
3313 # Remove version info from name if versioning should be avoided
3314 if test "$avoid_version" = yes && test "$need_version" = no; then
3320 # Check to see if the archive will have undefined symbols.
3321 if test "$allow_undefined" = yes; then
3322 if test "$allow_undefined_flag" = unsupported; then
3323 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3324 build_libtool_libs=no
3328 # Don't allow undefined symbols.
3329 allow_undefined_flag="$no_undefined_flag"
3333 if test "$mode" != relink; then
3334 # Remove our outputs, but don't remove object files since they
3335 # may have been created when compiling PIC objects.
3337 tempremovelist=`$echo "$output_objdir/*"`
3338 for p in $tempremovelist; do
3342 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3343 if test "X$precious_files_regex" != "X"; then
3344 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3349 removelist="$removelist $p"
3354 if test -n "$removelist"; then
3355 $show "${rm}r $removelist"
3356 $run ${rm}r $removelist
3360 # Now set the variables for building old libraries.
3361 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3362 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3364 # Transform .lo files to .o files.
3365 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3368 # Eliminate all temporary directories.
3369 for path in $notinst_path; do
3370 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3371 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3372 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3375 if test -n "$xrpath"; then
3376 # If the user specified any rpath flags, then add them.
3378 for libdir in $xrpath; do
3379 temp_xrpath="$temp_xrpath -R$libdir"
3380 case "$finalize_rpath " in
3382 *) finalize_rpath="$finalize_rpath $libdir" ;;
3385 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3386 dependency_libs="$temp_xrpath $dependency_libs"
3390 # Make sure dlfiles contains only unique files that won't be dlpreopened
3391 old_dlfiles="$dlfiles"
3393 for lib in $old_dlfiles; do
3394 case " $dlprefiles $dlfiles " in
3396 *) dlfiles="$dlfiles $lib" ;;
3400 # Make sure dlprefiles contains only unique files
3401 old_dlprefiles="$dlprefiles"
3403 for lib in $old_dlprefiles; do
3404 case "$dlprefiles " in
3406 *) dlprefiles="$dlprefiles $lib" ;;
3410 if test "$build_libtool_libs" = yes; then
3411 if test -n "$rpath"; then
3413 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3414 # these systems don't actually have a c library (as such)!
3416 *-*-rhapsody* | *-*-darwin1.[012])
3417 # Rhapsody C library is in the System framework
3418 deplibs="$deplibs -framework System"
3421 # Don't link with libc until the a.out ld.so is fixed.
3423 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3424 # Do not include libc due to us having libc/libc_r.
3425 test "X$arg" = "X-lc" && continue
3428 # Add libc to deplibs on all other systems if necessary.
3429 if test "$build_libtool_need_lc" = "yes"; then
3430 deplibs="$deplibs -lc"
3436 # Transform deplibs into only deplibs that can be linked in shared.
3438 libname_save=$libname
3439 release_save=$release
3440 versuffix_save=$versuffix
3442 # I'm not sure if I'm treating the release correctly. I think
3443 # release should show up in the -l (ie -lgmp5) so we don't want to
3444 # add it in twice. Is that correct?
3450 case $deplibs_check_method in
3452 # Don't check for shared/static. Everything works.
3453 # This might be a little naive. We might want to check
3454 # whether the library exists or not. But this is on
3455 # osf3 & osf4 and I'm not really sure... Just
3456 # implementing what was already the behavior.
3460 # This code stresses the "libraries are programs" paradigm to its
3461 # limits. Maybe even breaks it. We compile a program, linking it
3462 # against the deplibs as a proxy for the library. Then we can check
3463 # whether they linked in statically or dynamically with ldd.
3465 cat > conftest.c <<EOF
3466 int main() { return 0; }
3469 $LTCC -o conftest conftest.c $deplibs
3470 if test "$?" -eq 0 ; then
3471 ldd_output=`ldd conftest`
3472 for i in $deplibs; do
3473 name="`expr $i : '-l\(.*\)'`"
3474 # If $name is empty we are operating on a -L argument.
3475 if test "$name" != "" && test "$name" -ne "0"; then
3476 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3477 case " $predeps $postdeps " in
3479 newdeplibs="$newdeplibs $i"
3484 if test -n "$i" ; then
3485 libname=`eval \\$echo \"$libname_spec\"`
3486 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3487 set dummy $deplib_matches
3489 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3490 newdeplibs="$newdeplibs $i"
3494 $echo "*** Warning: dynamic linker does not accept needed library $i."
3495 $echo "*** I have the capability to make that library automatically link in when"
3496 $echo "*** you link to this library. But I can only do this if you have a"
3497 $echo "*** shared version of the library, which I believe you do not have"
3498 $echo "*** because a test_compile did reveal that the linker did not use it for"
3499 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3503 newdeplibs="$newdeplibs $i"
3507 # Error occurred in the first compile. Let's try to salvage
3508 # the situation: Compile a separate program for each library.
3509 for i in $deplibs; do
3510 name="`expr $i : '-l\(.*\)'`"
3511 # If $name is empty we are operating on a -L argument.
3512 if test "$name" != "" && test "$name" != "0"; then
3514 $LTCC -o conftest conftest.c $i
3516 if test "$?" -eq 0 ; then
3517 ldd_output=`ldd conftest`
3518 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3519 case " $predeps $postdeps " in
3521 newdeplibs="$newdeplibs $i"
3526 if test -n "$i" ; then
3527 libname=`eval \\$echo \"$libname_spec\"`
3528 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3529 set dummy $deplib_matches
3531 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3532 newdeplibs="$newdeplibs $i"
3536 $echo "*** Warning: dynamic linker does not accept needed library $i."
3537 $echo "*** I have the capability to make that library automatically link in when"
3538 $echo "*** you link to this library. But I can only do this if you have a"
3539 $echo "*** shared version of the library, which you do not appear to have"
3540 $echo "*** because a test_compile did reveal that the linker did not use this one"
3541 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3547 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3548 $echo "*** make it link in! You will probably need to install it or some"
3549 $echo "*** library that it depends on before this library will be fully"
3550 $echo "*** functional. Installing it before continuing would be even better."
3553 newdeplibs="$newdeplibs $i"
3559 set dummy $deplibs_check_method
3560 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3561 for a_deplib in $deplibs; do
3562 name="`expr $a_deplib : '-l\(.*\)'`"
3563 # If $name is empty we are operating on a -L argument.
3564 if test "$name" != "" && test "$name" != "0"; then
3565 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3566 case " $predeps $postdeps " in
3568 newdeplibs="$newdeplibs $a_deplib"
3573 if test -n "$a_deplib" ; then
3574 libname=`eval \\$echo \"$libname_spec\"`
3575 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3576 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3577 for potent_lib in $potential_libs; do
3578 # Follow soft links.
3579 if ls -lLd "$potent_lib" 2>/dev/null \
3580 | grep " -> " >/dev/null; then
3583 # The statement above tries to avoid entering an
3584 # endless loop below, in case of cyclic links.
3585 # We might still enter an endless loop, since a link
3586 # loop can be closed while we follow links,
3588 potlib="$potent_lib"
3589 while test -h "$potlib" 2>/dev/null; do
3590 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3592 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3593 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3596 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3598 | $EGREP "$file_magic_regex" > /dev/null; then
3599 newdeplibs="$newdeplibs $a_deplib"
3606 if test -n "$a_deplib" ; then
3609 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3610 $echo "*** I have the capability to make that library automatically link in when"
3611 $echo "*** you link to this library. But I can only do this if you have a"
3612 $echo "*** shared version of the library, which you do not appear to have"
3613 $echo "*** because I did check the linker path looking for a file starting"
3614 if test -z "$potlib" ; then
3615 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3617 $echo "*** with $libname and none of the candidates passed a file format test"
3618 $echo "*** using a file magic. Last file checked: $potlib"
3622 # Add a -L argument.
3623 newdeplibs="$newdeplibs $a_deplib"
3625 done # Gone through all deplibs.
3628 set dummy $deplibs_check_method
3629 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3630 for a_deplib in $deplibs; do
3631 name="`expr $a_deplib : '-l\(.*\)'`"
3632 # If $name is empty we are operating on a -L argument.
3633 if test -n "$name" && test "$name" != "0"; then
3634 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3635 case " $predeps $postdeps " in
3637 newdeplibs="$newdeplibs $a_deplib"
3642 if test -n "$a_deplib" ; then
3643 libname=`eval \\$echo \"$libname_spec\"`
3644 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3645 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3646 for potent_lib in $potential_libs; do
3647 potlib="$potent_lib" # see symlink-check above in file_magic test
3648 if eval $echo \"$potent_lib\" 2>/dev/null \
3650 | $EGREP "$match_pattern_regex" > /dev/null; then
3651 newdeplibs="$newdeplibs $a_deplib"
3658 if test -n "$a_deplib" ; then
3661 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3662 $echo "*** I have the capability to make that library automatically link in when"
3663 $echo "*** you link to this library. But I can only do this if you have a"
3664 $echo "*** shared version of the library, which you do not appear to have"
3665 $echo "*** because I did check the linker path looking for a file starting"
3666 if test -z "$potlib" ; then
3667 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3669 $echo "*** with $libname and none of the candidates passed a file format test"
3670 $echo "*** using a regex pattern. Last file checked: $potlib"
3674 # Add a -L argument.
3675 newdeplibs="$newdeplibs $a_deplib"
3677 done # Gone through all deplibs.
3681 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3682 -e 's/ -[LR][^ ]*//g'`
3683 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3684 for i in $predeps $postdeps ; do
3685 # can't use Xsed below, because $i might contain '/'
3686 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3689 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3690 | grep . >/dev/null; then
3692 if test "X$deplibs_check_method" = "Xnone"; then
3693 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3695 $echo "*** Warning: inter-library dependencies are not known to be supported."
3697 $echo "*** All declared inter-library dependencies are being dropped."
3702 versuffix=$versuffix_save
3704 release=$release_save
3705 libname=$libname_save
3709 *-*-rhapsody* | *-*-darwin1.[012])
3710 # On Rhapsody replace the C library is the System framework
3711 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3715 if test "$droppeddeps" = yes; then
3716 if test "$module" = yes; then
3718 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3719 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3720 $echo "*** a static module, that should work as long as the dlopening"
3721 $echo "*** application is linked with the -dlopen flag."
3722 if test -z "$global_symbol_pipe"; then
3724 $echo "*** However, this would only work if libtool was able to extract symbol"
3725 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3726 $echo "*** not find such a program. So, this module is probably useless."
3727 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3729 if test "$build_old_libs" = no; then
3730 oldlibs="$output_objdir/$libname.$libext"
3731 build_libtool_libs=module
3734 build_libtool_libs=no
3737 $echo "*** The inter-library dependencies that have been dropped here will be"
3738 $echo "*** automatically added whenever a program is linked with this library"
3739 $echo "*** or is declared to -dlopen it."
3741 if test "$allow_undefined" = no; then
3743 $echo "*** Since this library must not contain undefined symbols,"
3744 $echo "*** because either the platform does not support them or"
3745 $echo "*** it was explicitly requested with -no-undefined,"
3746 $echo "*** libtool will only create a static version of it."
3747 if test "$build_old_libs" = no; then
3748 oldlibs="$output_objdir/$libname.$libext"
3749 build_libtool_libs=module
3752 build_libtool_libs=no
3757 # Done checking deplibs!
3761 # All the library-specific variables (install_libdir is set above).
3766 # Test again, we may have decided not to build it any more
3767 if test "$build_libtool_libs" = yes; then
3768 if test "$hardcode_into_libs" = yes; then
3769 # Hardcode the library paths
3772 rpath="$finalize_rpath"
3773 test "$mode" != relink && rpath="$compile_rpath$rpath"
3774 for libdir in $rpath; do
3775 if test -n "$hardcode_libdir_flag_spec"; then
3776 if test -n "$hardcode_libdir_separator"; then
3777 if test -z "$hardcode_libdirs"; then
3778 hardcode_libdirs="$libdir"
3780 # Just accumulate the unique libdirs.
3781 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3782 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3785 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3790 eval flag=\"$hardcode_libdir_flag_spec\"
3791 dep_rpath="$dep_rpath $flag"
3793 elif test -n "$runpath_var"; then
3794 case "$perm_rpath " in
3796 *) perm_rpath="$perm_rpath $libdir" ;;
3800 # Substitute the hardcoded libdirs into the rpath.
3801 if test -n "$hardcode_libdir_separator" &&
3802 test -n "$hardcode_libdirs"; then
3803 libdir="$hardcode_libdirs"
3804 if test -n "$hardcode_libdir_flag_spec_ld"; then
3805 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3807 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3810 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3811 # We should set the runpath_var.
3813 for dir in $perm_rpath; do
3816 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3818 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3821 shlibpath="$finalize_shlibpath"
3822 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3823 if test -n "$shlibpath"; then
3824 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3827 # Get the real and link names of the library.
3828 eval shared_ext=\"$shrext_cmds\"
3829 eval library_names=\"$library_names_spec\"
3830 set dummy $library_names
3834 if test -n "$soname_spec"; then
3835 eval soname=\"$soname_spec\"
3839 if test -z "$dlname"; then
3843 lib="$output_objdir/$realname"
3846 linknames="$linknames $link"
3849 # Use standard objects if they are pic
3850 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3852 # Prepare the list of exported symbols
3853 if test -z "$export_symbols"; then
3854 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3855 $show "generating symbol list for \`$libname.la'"
3856 export_symbols="$output_objdir/$libname.exp"
3857 $run $rm $export_symbols
3858 cmds=$export_symbols_cmds
3859 save_ifs="$IFS"; IFS='~'
3860 for cmd in $cmds; do
3863 if len=`expr "X$cmd" : ".*"` &&
3864 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3866 $run eval "$cmd" || exit $?
3867 skipped_export=false
3869 # The command line is too long to execute in one step.
3870 $show "using reloadable object file for export list..."
3875 if test -n "$export_symbols_regex"; then
3876 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3877 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3878 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3879 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3884 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3885 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3889 for test_deplib in $deplibs; do
3890 case " $convenience " in
3891 *" $test_deplib "*) ;;
3893 tmp_deplibs="$tmp_deplibs $test_deplib"
3897 deplibs="$tmp_deplibs"
3899 if test -n "$convenience"; then
3900 if test -n "$whole_archive_flag_spec"; then
3901 save_libobjs=$libobjs
3902 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3904 gentop="$output_objdir/${outputname}x"
3905 generated="$generated $gentop"
3907 func_extract_archives $gentop $convenience
3908 libobjs="$libobjs $func_extract_archives_result"
3912 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3913 eval flag=\"$thread_safe_flag_spec\"
3914 linker_flags="$linker_flags $flag"
3917 # Make a backup of the uninstalled library when relinking
3918 if test "$mode" = relink; then
3919 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3922 # Do each of the archive commands.
3923 if test "$module" = yes && test -n "$module_cmds" ; then
3924 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3925 eval test_cmds=\"$module_expsym_cmds\"
3926 cmds=$module_expsym_cmds
3928 eval test_cmds=\"$module_cmds\"
3932 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3933 eval test_cmds=\"$archive_expsym_cmds\"
3934 cmds=$archive_expsym_cmds
3936 eval test_cmds=\"$archive_cmds\"
3941 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3942 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3945 # The command line is too long to link in one step, link piecewise.
3946 $echo "creating reloadable object files..."
3948 # Save the value of $output and $libobjs because we want to
3949 # use them later. If we have whole_archive_flag_spec, we
3950 # want to use save_libobjs as it was before
3951 # whole_archive_flag_spec was expanded, because we can't
3952 # assume the linker understands whole_archive_flag_spec.
3953 # This may have to be revisited, in case too many
3954 # convenience libraries get linked in and end up exceeding
3956 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3957 save_libobjs=$libobjs
3960 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3962 # Clear the reloadable object creation command queue and
3963 # initialize k to one.
3970 output=$output_objdir/$output_la-${k}.$objext
3971 # Loop over the list of objects to be linked.
3972 for obj in $save_libobjs
3974 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3975 if test "X$objlist" = X ||
3976 { len=`expr "X$test_cmds" : ".*"` &&
3977 test "$len" -le "$max_cmd_len"; }; then
3978 objlist="$objlist $obj"
3980 # The command $test_cmds is almost too long, add a
3981 # command to the queue.
3982 if test "$k" -eq 1 ; then
3983 # The first file doesn't have a previous command to add.
3984 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3986 # All subsequent reloadable object files will link in
3987 # the last one created.
3988 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3990 last_robj=$output_objdir/$output_la-${k}.$objext
3992 output=$output_objdir/$output_la-${k}.$objext
3997 # Handle the remaining objects by creating one last
3998 # reloadable object file. All subsequent reloadable object
3999 # files will link in the last one created.
4000 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4001 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4003 if ${skipped_export-false}; then
4004 $show "generating symbol list for \`$libname.la'"
4005 export_symbols="$output_objdir/$libname.exp"
4006 $run $rm $export_symbols
4008 # Append the command to create the export file.
4009 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4012 # Set up a command to remove the reloadable object files
4013 # after they are used.
4015 while test "$i" -lt "$k"
4018 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4021 $echo "creating a temporary reloadable object file: $output"
4023 # Loop through the commands generated above and execute them.
4024 save_ifs="$IFS"; IFS='~'
4025 for cmd in $concat_cmds; do
4028 $run eval "$cmd" || exit $?
4033 # Restore the value of output.
4036 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4037 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4039 # Expand the library linking commands again to reset the
4040 # value of $libobjs for piecewise linking.
4042 # Do each of the archive commands.
4043 if test "$module" = yes && test -n "$module_cmds" ; then
4044 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4045 cmds=$module_expsym_cmds
4050 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4051 cmds=$archive_expsym_cmds
4057 # Append the command to remove the reloadable object files
4058 # to the just-reset $cmds.
4059 eval cmds=\"\$cmds~\$rm $delfiles\"
4061 save_ifs="$IFS"; IFS='~'
4062 for cmd in $cmds; do
4066 $run eval "$cmd" || exit $?
4070 # Restore the uninstalled library and exit
4071 if test "$mode" = relink; then
4072 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4076 # Create links to the real library.
4077 for linkname in $linknames; do
4078 if test "$realname" != "$linkname"; then
4079 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4080 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4084 # If -module or -export-dynamic was specified, set the dlname.
4085 if test "$module" = yes || test "$export_dynamic" = yes; then
4086 # On all known operating systems, these are identical.
4093 if test -n "$deplibs"; then
4094 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4097 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4098 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4101 if test -n "$rpath"; then
4102 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4105 if test -n "$xrpath"; then
4106 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4109 if test -n "$vinfo"; then
4110 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4113 if test -n "$release"; then
4114 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4119 if test -n "$objs$old_deplibs"; then
4120 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4124 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4132 # Delete the old objects.
4133 $run $rm $obj $libobj
4135 # Objects from convenience libraries. This assumes
4136 # single-version convenience libraries. Whenever we create
4137 # different ones for PIC/non-PIC, this we'll have to duplicate
4141 # reload_cmds runs $LD directly, so let us get rid of
4142 # -Wl from whole_archive_flag_spec
4145 if test -n "$convenience"; then
4146 if test -n "$whole_archive_flag_spec"; then
4147 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4149 gentop="$output_objdir/${obj}x"
4150 generated="$generated $gentop"
4152 func_extract_archives $gentop $convenience
4153 reload_conv_objs="$reload_objs $func_extract_archives_result"
4157 # Create the old-style object.
4158 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
4162 save_ifs="$IFS"; IFS='~'
4163 for cmd in $cmds; do
4167 $run eval "$cmd" || exit $?
4171 # Exit if we aren't doing a library object file.
4172 if test -z "$libobj"; then
4173 if test -n "$gentop"; then
4174 $show "${rm}r $gentop"
4181 if test "$build_libtool_libs" != yes; then
4182 if test -n "$gentop"; then
4183 $show "${rm}r $gentop"
4187 # Create an invalid libtool object if no PIC, so that we don't
4188 # accidentally link it into a program.
4189 # $show "echo timestamp > $libobj"
4190 # $run eval "echo timestamp > $libobj" || exit $?
4194 if test -n "$pic_flag" || test "$pic_mode" != default; then
4195 # Only do commands if we really have different PIC objects.
4196 reload_objs="$libobjs $reload_conv_objs"
4199 save_ifs="$IFS"; IFS='~'
4200 for cmd in $cmds; do
4204 $run eval "$cmd" || exit $?
4209 if test -n "$gentop"; then
4210 $show "${rm}r $gentop"
4219 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4221 if test -n "$vinfo"; then
4222 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4225 if test -n "$release"; then
4226 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4229 if test "$preload" = yes; then
4230 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4231 test "$dlopen_self_static" = unknown; then
4232 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4237 *-*-rhapsody* | *-*-darwin1.[012])
4238 # On Rhapsody replace the C library is the System framework
4239 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4240 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4246 # Don't allow lazy linking, it breaks C++ global constructors
4247 if test "$tagname" = CXX ; then
4248 compile_command="$compile_command ${wl}-bind_at_load"
4249 finalize_command="$finalize_command ${wl}-bind_at_load"
4254 compile_command="$compile_command $compile_deplibs"
4255 finalize_command="$finalize_command $finalize_deplibs"
4257 if test -n "$rpath$xrpath"; then
4258 # If the user specified any rpath flags, then add them.
4259 for libdir in $rpath $xrpath; do
4260 # This is the magic to use -rpath.
4261 case "$finalize_rpath " in
4263 *) finalize_rpath="$finalize_rpath $libdir" ;;
4268 # Now hardcode the library paths
4271 for libdir in $compile_rpath $finalize_rpath; do
4272 if test -n "$hardcode_libdir_flag_spec"; then
4273 if test -n "$hardcode_libdir_separator"; then
4274 if test -z "$hardcode_libdirs"; then
4275 hardcode_libdirs="$libdir"
4277 # Just accumulate the unique libdirs.
4278 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4279 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4282 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4287 eval flag=\"$hardcode_libdir_flag_spec\"
4288 rpath="$rpath $flag"
4290 elif test -n "$runpath_var"; then
4291 case "$perm_rpath " in
4293 *) perm_rpath="$perm_rpath $libdir" ;;
4297 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4298 case :$dllsearchpath: in
4300 *) dllsearchpath="$dllsearchpath:$libdir";;
4305 # Substitute the hardcoded libdirs into the rpath.
4306 if test -n "$hardcode_libdir_separator" &&
4307 test -n "$hardcode_libdirs"; then
4308 libdir="$hardcode_libdirs"
4309 eval rpath=\" $hardcode_libdir_flag_spec\"
4311 compile_rpath="$rpath"
4315 for libdir in $finalize_rpath; do
4316 if test -n "$hardcode_libdir_flag_spec"; then
4317 if test -n "$hardcode_libdir_separator"; then
4318 if test -z "$hardcode_libdirs"; then
4319 hardcode_libdirs="$libdir"
4321 # Just accumulate the unique libdirs.
4322 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4323 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4326 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4331 eval flag=\"$hardcode_libdir_flag_spec\"
4332 rpath="$rpath $flag"
4334 elif test -n "$runpath_var"; then
4335 case "$finalize_perm_rpath " in
4337 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4341 # Substitute the hardcoded libdirs into the rpath.
4342 if test -n "$hardcode_libdir_separator" &&
4343 test -n "$hardcode_libdirs"; then
4344 libdir="$hardcode_libdirs"
4345 eval rpath=\" $hardcode_libdir_flag_spec\"
4347 finalize_rpath="$rpath"
4349 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4350 # Transform all the library objects into standard objects.
4351 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4352 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4356 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4357 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4358 dlsyms="${outputname}S.c"
4360 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4364 if test -n "$dlsyms"; then
4368 # Discover the nlist of each of the dlfiles.
4369 nlist="$output_objdir/${outputname}.nm"
4371 $show "$rm $nlist ${nlist}S ${nlist}T"
4372 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4374 # Parse the name list into a source file.
4375 $show "creating $output_objdir/$dlsyms"
4377 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4378 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4379 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4385 /* Prevent the only kind of declaration conflicts we can make. */
4386 #define lt_preloaded_symbols some_other_symbol
4388 /* External symbol declarations for the compiler. */\
4391 if test "$dlself" = yes; then
4392 $show "generating symbol list for \`$output'"
4394 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4396 # Add our own program objects to the symbol list.
4397 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4398 for arg in $progfiles; do
4399 $show "extracting global C symbols from \`$arg'"
4400 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4403 if test -n "$exclude_expsyms"; then
4404 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4405 $run eval '$mv "$nlist"T "$nlist"'
4408 if test -n "$export_symbols_regex"; then
4409 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4410 $run eval '$mv "$nlist"T "$nlist"'
4413 # Prepare the list of exported symbols
4414 if test -z "$export_symbols"; then
4415 export_symbols="$output_objdir/$outputname.exp"
4416 $run $rm $export_symbols
4417 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4419 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4420 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4421 $run eval 'mv "$nlist"T "$nlist"'
4425 for arg in $dlprefiles; do
4426 $show "extracting global C symbols from \`$arg'"
4427 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4428 $run eval '$echo ": $name " >> "$nlist"'
4429 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4432 if test -z "$run"; then
4433 # Make sure we have at least an empty file.
4434 test -f "$nlist" || : > "$nlist"
4436 if test -n "$exclude_expsyms"; then
4437 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4438 $mv "$nlist"T "$nlist"
4441 # Try sorting and uniquifying the output.
4442 if grep -v "^: " < "$nlist" |
4443 if sort -k 3 </dev/null >/dev/null 2>&1; then
4448 uniq > "$nlist"S; then
4451 grep -v "^: " < "$nlist" > "$nlist"S
4454 if test -f "$nlist"S; then
4455 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4457 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4460 $echo >> "$output_objdir/$dlsyms" "\
4462 #undef lt_preloaded_symbols
4464 #if defined (__STDC__) && __STDC__
4465 # define lt_ptr void *
4467 # define lt_ptr char *
4471 /* The mapping between symbol names and symbols. */
4475 *cygwin* | *mingw* )
4476 $echo >> "$output_objdir/$dlsyms" "\
4477 /* DATA imports from DLLs on WIN32 can't be const, because
4478 runtime relocations are performed -- see ld's documentation
4484 $echo >> "$output_objdir/$dlsyms" "\
4491 $echo >> "$output_objdir/$dlsyms" "\
4495 lt_preloaded_symbols[] =
4499 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4501 $echo >> "$output_objdir/$dlsyms" "\
4505 /* This works around a problem in FreeBSD linker */
4506 #ifdef FREEBSD_WORKAROUND
4507 static const void *lt_preloaded_setup() {
4508 return lt_preloaded_symbols;
4518 pic_flag_for_symtable=
4520 # compiling the symbol table file with pic_flag works around
4521 # a FreeBSD bug that causes programs to crash when -lm is
4522 # linked before any other PIC object. But we must not use
4523 # pic_flag when linking with -static. The problem exists in
4524 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4525 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4526 case "$compile_command " in
4528 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4531 case "$compile_command " in
4533 *) pic_flag_for_symtable=" $pic_flag";;
4537 # Now compile the dynamic symbol file.
4538 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4539 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4541 # Clean up the generated files.
4542 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4543 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4545 # Transform the symbol file into the correct name.
4546 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4547 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4550 # FreeBSD doesn't need this...
4553 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4558 # We keep going just in case the user didn't refer to
4559 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4560 # really was required.
4562 # Nullify the symbol file.
4563 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4564 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4567 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4568 # Replace the output file specification.
4569 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4570 link_command="$compile_command$compile_rpath"
4572 # We have no uninstalled library dependencies, so finalize right now.
4573 $show "$link_command"
4574 $run eval "$link_command"
4577 # Delete the generated files.
4578 if test -n "$dlsyms"; then
4579 $show "$rm $output_objdir/${outputname}S.${objext}"
4580 $run $rm "$output_objdir/${outputname}S.${objext}"
4586 if test -n "$shlibpath_var"; then
4587 # We should set the shlibpath_var
4589 for dir in $temp_rpath; do
4591 [\\/]* | [A-Za-z]:[\\/]*)
4596 # Relative path: add a thisdir entry.
4597 rpath="$rpath\$thisdir/$dir:"
4604 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4605 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4607 if test -n "$finalize_shlibpath"; then
4608 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4613 if test -n "$runpath_var"; then
4614 if test -n "$perm_rpath"; then
4615 # We should set the runpath_var.
4617 for dir in $perm_rpath; do
4620 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4622 if test -n "$finalize_perm_rpath"; then
4623 # We should set the runpath_var.
4625 for dir in $finalize_perm_rpath; do
4628 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4632 if test "$no_install" = yes; then
4633 # We don't need to create a wrapper script.
4634 link_command="$compile_var$compile_command$compile_rpath"
4635 # Replace the output file specification.
4636 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4637 # Delete the old output file.
4639 # Link the executable and exit
4640 $show "$link_command"
4641 $run eval "$link_command" || exit $?
4645 if test "$hardcode_action" = relink; then
4646 # Fast installation is not supported
4647 link_command="$compile_var$compile_command$compile_rpath"
4648 relink_command="$finalize_var$finalize_command$finalize_rpath"
4650 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4651 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4653 if test "$fast_install" != no; then
4654 link_command="$finalize_var$compile_command$finalize_rpath"
4655 if test "$fast_install" = yes; then
4656 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4658 # fast_install is set to needless
4662 link_command="$compile_var$compile_command$compile_rpath"
4663 relink_command="$finalize_var$finalize_command$finalize_rpath"
4667 # Replace the output file specification.
4668 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4670 # Delete the old output files.
4671 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4673 $show "$link_command"
4674 $run eval "$link_command" || exit $?
4676 # Now create the wrapper script.
4677 $show "creating $output"
4679 # Quote the relink command for shipping.
4680 if test -n "$relink_command"; then
4681 # Preserve any variables that may affect compiler behavior
4682 for var in $variables_saved_for_relink; do
4683 if eval test -z \"\${$var+set}\"; then
4684 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4685 elif eval var_value=\$$var; test -z "$var_value"; then
4686 relink_command="$var=; export $var; $relink_command"
4688 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4689 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4692 relink_command="(cd `pwd`; $relink_command)"
4693 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4696 # Quote $echo for shipping.
4697 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4699 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4700 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4702 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4704 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4707 # Only actually do things if our run command is non-null.
4708 if test -z "$run"; then
4709 # win32 will think the script is a binary if it has
4710 # a .exe suffix, so we strip it off here.
4712 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4714 # test for cygwin because mv fails w/o .exe extensions
4718 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4722 *cygwin* | *mingw* )
4723 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4724 cwrapper=`$echo ${output}.exe`
4725 $rm $cwrappersource $cwrapper
4726 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4728 cat > $cwrappersource <<EOF
4730 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4731 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4733 The $output program cannot be directly executed until all the libtool
4734 libraries that it depends on are installed.
4736 This wrapper executable should never be moved out of the build directory.
4737 If it is, it will not operate correctly.
4739 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4740 but could eventually absorb all of the scripts functionality and
4741 exec $objdir/$outputname directly.
4744 cat >> $cwrappersource<<"EOF"
4752 #if defined(PATH_MAX)
4753 # define LT_PATHMAX PATH_MAX
4754 #elif defined(MAXPATHLEN)
4755 # define LT_PATHMAX MAXPATHLEN
4757 # define LT_PATHMAX 1024
4760 #ifndef DIR_SEPARATOR
4761 #define DIR_SEPARATOR '/'
4764 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4766 #define HAVE_DOS_BASED_FILE_SYSTEM
4767 #ifndef DIR_SEPARATOR_2
4768 #define DIR_SEPARATOR_2 '\\'
4772 #ifndef DIR_SEPARATOR_2
4773 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4774 #else /* DIR_SEPARATOR_2 */
4775 # define IS_DIR_SEPARATOR(ch) \
4776 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4777 #endif /* DIR_SEPARATOR_2 */
4779 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4780 #define XFREE(stale) do { \
4781 if (stale) { free ((void *) stale); stale = 0; } \
4784 const char *program_name = NULL;
4786 void * xmalloc (size_t num);
4787 char * xstrdup (const char *string);
4788 char * basename (const char *name);
4789 char * fnqualify(const char *path);
4790 char * strendzap(char *str, const char *pat);
4791 void lt_fatal (const char *message, ...);
4794 main (int argc, char *argv[])
4799 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4800 newargz = XMALLOC(char *, argc+2);
4803 cat >> $cwrappersource <<EOF
4804 newargz[0] = "$SHELL";
4807 cat >> $cwrappersource <<"EOF"
4808 newargz[1] = fnqualify(argv[0]);
4809 /* we know the script has the same name, without the .exe */
4810 /* so make sure newargz[1] doesn't end in .exe */
4811 strendzap(newargz[1],".exe");
4812 for (i = 1; i < argc; i++)
4813 newargz[i+1] = xstrdup(argv[i]);
4814 newargz[argc+1] = NULL;
4817 cat >> $cwrappersource <<EOF
4818 execv("$SHELL",newargz);
4821 cat >> $cwrappersource <<"EOF"
4825 xmalloc (size_t num)
4827 void * p = (void *) malloc (num);
4829 lt_fatal ("Memory exhausted");
4835 xstrdup (const char *string)
4837 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4842 basename (const char *name)
4846 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4847 /* Skip over the disk name in MSDOS pathnames. */
4848 if (isalpha (name[0]) && name[1] == ':')
4852 for (base = name; *name; name++)
4853 if (IS_DIR_SEPARATOR (*name))
4855 return (char *) base;
4859 fnqualify(const char *path)
4863 char tmp[LT_PATHMAX + 1];
4865 assert(path != NULL);
4867 /* Is it qualified already? */
4868 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4869 if (isalpha (path[0]) && path[1] == ':')
4870 return xstrdup (path);
4872 if (IS_DIR_SEPARATOR (path[0]))
4873 return xstrdup (path);
4875 /* prepend the current directory */
4876 /* doesn't handle '~' */
4877 if (getcwd (tmp, LT_PATHMAX) == NULL)
4878 lt_fatal ("getcwd failed");
4879 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4880 p = XMALLOC(char, size);
4881 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4886 strendzap(char *str, const char *pat)
4890 assert(str != NULL);
4891 assert(pat != NULL);
4894 patlen = strlen(pat);
4898 str += len - patlen;
4899 if (strcmp(str, pat) == 0)
4906 lt_error_core (int exit_status, const char * mode,
4907 const char * message, va_list ap)
4909 fprintf (stderr, "%s: %s: ", program_name, mode);
4910 vfprintf (stderr, message, ap);
4911 fprintf (stderr, ".\n");
4913 if (exit_status >= 0)
4918 lt_fatal (const char *message, ...)
4921 va_start (ap, message);
4922 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4926 # we should really use a build-platform specific compiler
4927 # here, but OTOH, the wrappers (shell script and this C one)
4928 # are only useful if you want to execute the "real" binary.
4929 # Since the "real" binary is built for $host, then this
4930 # wrapper might as well be built for $host, too.
4931 $run $LTCC -s -o $cwrapper $cwrappersource
4935 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4940 # $output - temporary wrapper script for $objdir/$outputname
4941 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4943 # The $output program cannot be directly executed until all the libtool
4944 # libraries that it depends on are installed.
4946 # This wrapper script should never be moved out of the build directory.
4947 # If it is, it will not operate correctly.
4949 # Sed substitution that helps us do robust quoting. It backslashifies
4950 # metacharacters that are still active within double-quoted strings.
4951 Xsed='${SED} -e 1s/^X//'
4952 sed_quote_subst='$sed_quote_subst'
4954 # The HP-UX ksh and POSIX shell print the target directory to stdout
4956 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4958 relink_command=\"$relink_command\"
4960 # This environment variable determines our operation mode.
4961 if test \"\$libtool_install_magic\" = \"$magic\"; then
4962 # install mode needs the following variable:
4963 notinst_deplibs='$notinst_deplibs'
4965 # When we are sourced in execute mode, \$file and \$echo are already set.
4966 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4969 # Make sure echo works.
4970 if test \"X\$1\" = X--no-reexec; then
4971 # Discard the --no-reexec flag, and continue.
4973 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4974 # Yippee, \$echo works!
4977 # Restart under the correct shell, and then maybe \$echo will work.
4978 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4984 # Find the directory that this script lives in.
4985 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4986 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4988 # Follow symbolic links until we get to the real thisdir.
4989 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4990 while test -n \"\$file\"; do
4991 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4993 # If there was a directory component, then change thisdir.
4994 if test \"x\$destdir\" != \"x\$file\"; then
4995 case \"\$destdir\" in
4996 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4997 *) thisdir=\"\$thisdir/\$destdir\" ;;
5001 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5002 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5005 # Try to get the absolute directory name.
5006 absdir=\`cd \"\$thisdir\" && pwd\`
5007 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5010 if test "$fast_install" = yes; then
5012 program=lt-'$outputname'$exeext
5013 progdir=\"\$thisdir/$objdir\"
5015 if test ! -f \"\$progdir/\$program\" || \\
5016 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5017 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5019 file=\"\$\$-\$program\"
5021 if test ! -d \"\$progdir\"; then
5022 $mkdir \"\$progdir\"
5024 $rm \"\$progdir/\$file\"
5029 # relink executable if necessary
5030 if test -n \"\$relink_command\"; then
5031 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5033 $echo \"\$relink_command_output\" >&2
5034 $rm \"\$progdir/\$file\"
5039 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5040 { $rm \"\$progdir/\$program\";
5041 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5042 $rm \"\$progdir/\$file\"
5046 program='$outputname'
5047 progdir=\"\$thisdir/$objdir\"
5053 if test -f \"\$progdir/\$program\"; then"
5055 # Export our shlibpath_var if we have one.
5056 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5058 # Add our own library path to $shlibpath_var
5059 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5061 # Some systems cannot cope with colon-terminated $shlibpath_var
5062 # The second colon is a workaround for a bug in BeOS R4 sed
5063 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5065 export $shlibpath_var
5069 # fixup the dll searchpath if we need to.
5070 if test -n "$dllsearchpath"; then
5072 # Add the dll search path components to the executable PATH
5073 PATH=$dllsearchpath:\$PATH
5078 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5079 # Run the actual program with our arguments.
5082 # Backslashes separate directories on plain windows
5083 *-*-mingw | *-*-os2*)
5085 exec \$progdir\\\\\$program \${1+\"\$@\"}
5091 exec \$progdir/\$program \${1+\"\$@\"}
5096 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5100 # The program doesn't exist.
5101 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5102 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5103 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5114 # See if we need to build an old-fashioned archive.
5115 for oldlib in $oldlibs; do
5117 if test "$build_libtool_libs" = convenience; then
5118 oldobjs="$libobjs_save"
5119 addlibs="$convenience"
5120 build_libtool_libs=no
5122 if test "$build_libtool_libs" = module; then
5123 oldobjs="$libobjs_save"
5124 build_libtool_libs=no
5126 oldobjs="$old_deplibs $non_pic_objects"
5128 addlibs="$old_convenience"
5131 if test -n "$addlibs"; then
5132 gentop="$output_objdir/${outputname}x"
5133 generated="$generated $gentop"
5135 func_extract_archives $gentop $addlibs
5136 oldobjs="$oldobjs $func_extract_archives_result"
5139 # Do each command in the archive commands.
5140 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5141 cmds=$old_archive_from_new_cmds
5143 # POSIX demands no paths to be encoded in archives. We have
5144 # to avoid creating archives with duplicate basenames if we
5145 # might have to extract them afterwards, e.g., when creating a
5146 # static archive out of a convenience library, or when linking
5147 # the entirety of a libtool archive into another (currently
5148 # not supported by libtool).
5149 if (for obj in $oldobjs
5151 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5152 done | sort | sort -uc >/dev/null 2>&1); then
5155 $echo "copying selected object files to avoid basename conflicts..."
5157 if test -z "$gentop"; then
5158 gentop="$output_objdir/${outputname}x"
5159 generated="$generated $gentop"
5161 $show "${rm}r $gentop"
5162 $run ${rm}r "$gentop"
5163 $show "$mkdir $gentop"
5164 $run $mkdir "$gentop"
5166 if test "$status" -ne 0 && test ! -d "$gentop"; then
5171 save_oldobjs=$oldobjs
5174 for obj in $save_oldobjs
5176 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5177 case " $oldobjs " in
5178 " ") oldobjs=$obj ;;
5181 # Make sure we don't pick an alternate name that also
5183 newobj=lt$counter-$objbase
5184 counter=`expr $counter + 1`
5185 case " $oldobjs " in
5186 *[\ /]"$newobj "*) ;;
5187 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5190 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5191 $run ln "$obj" "$gentop/$newobj" ||
5192 $run cp "$obj" "$gentop/$newobj"
5193 oldobjs="$oldobjs $gentop/$newobj"
5195 *) oldobjs="$oldobjs $obj" ;;
5200 eval cmds=\"$old_archive_cmds\"
5202 if len=`expr "X$cmds" : ".*"` &&
5203 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5204 cmds=$old_archive_cmds
5206 # the command line is too long to link in one step, link in parts
5207 $echo "using piecewise archive linking..."
5212 save_oldobjs=$oldobjs
5214 # Is there a better way of finding the last object in the list?
5215 for obj in $save_oldobjs
5219 for obj in $save_oldobjs
5221 oldobjs="$objlist $obj"
5222 objlist="$objlist $obj"
5223 eval test_cmds=\"$old_archive_cmds\"
5224 if len=`expr "X$test_cmds" : ".*"` &&
5225 test "$len" -le "$max_cmd_len"; then
5228 # the above command should be used before it gets too long
5230 if test "$obj" = "$last_oldobj" ; then
5233 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5234 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5240 if test "X$oldobjs" = "X" ; then
5241 eval cmds=\"\$concat_cmds\"
5243 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5247 save_ifs="$IFS"; IFS='~'
5248 for cmd in $cmds; do
5252 $run eval "$cmd" || exit $?
5257 if test -n "$generated"; then
5258 $show "${rm}r$generated"
5259 $run ${rm}r$generated
5262 # Now create the libtool archive.
5266 test "$build_old_libs" = yes && old_library="$libname.$libext"
5267 $show "creating $output"
5269 # Preserve any variables that may affect compiler behavior
5270 for var in $variables_saved_for_relink; do
5271 if eval test -z \"\${$var+set}\"; then
5272 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5273 elif eval var_value=\$$var; test -z "$var_value"; then
5274 relink_command="$var=; export $var; $relink_command"
5276 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5277 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5280 # Quote the link command for shipping.
5281 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5282 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5283 if test "$hardcode_automatic" = yes ; then
5288 # Only create the output if not a dry run.
5289 if test -z "$run"; then
5290 for installed in no yes; do
5291 if test "$installed" = yes; then
5292 if test -z "$install_libdir"; then
5295 output="$output_objdir/$outputname"i
5296 # Replace all uninstalled libtool libraries with the installed ones
5298 for deplib in $dependency_libs; do
5301 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5302 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5303 if test -z "$libdir"; then
5304 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5307 newdependency_libs="$newdependency_libs $libdir/$name"
5309 *) newdependency_libs="$newdependency_libs $deplib" ;;
5312 dependency_libs="$newdependency_libs"
5314 for lib in $dlfiles; do
5315 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5316 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5317 if test -z "$libdir"; then
5318 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5321 newdlfiles="$newdlfiles $libdir/$name"
5323 dlfiles="$newdlfiles"
5325 for lib in $dlprefiles; do
5326 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5327 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5328 if test -z "$libdir"; then
5329 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5332 newdlprefiles="$newdlprefiles $libdir/$name"
5334 dlprefiles="$newdlprefiles"
5337 for lib in $dlfiles; do
5339 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5340 *) abs=`pwd`"/$lib" ;;
5342 newdlfiles="$newdlfiles $abs"
5344 dlfiles="$newdlfiles"
5346 for lib in $dlprefiles; do
5348 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5349 *) abs=`pwd`"/$lib" ;;
5351 newdlprefiles="$newdlprefiles $abs"
5353 dlprefiles="$newdlprefiles"
5356 # place dlname in correct position for cygwin
5358 case $host,$output,$installed,$module,$dlname in
5359 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5362 # $outputname - a libtool library file
5363 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5365 # Please DO NOT delete this file!
5366 # It is necessary for linking the library.
5368 # The name that we can dlopen(3).
5371 # Names of this library.
5372 library_names='$library_names'
5374 # The name of the static archive.
5375 old_library='$old_library'
5377 # Libraries that this one depends upon.
5378 dependency_libs='$dependency_libs'
5380 # Version information for $libname.
5385 # Is this an already installed library?
5386 installed=$installed
5388 # Should we warn about portability when linking against -modules?
5389 shouldnotlink=$module
5391 # Files to dlopen/dlpreopen
5393 dlpreopen='$dlprefiles'
5395 # Directory that this library needs to be installed in:
5396 libdir='$install_libdir'"
5397 if test "$installed" = no && test "$need_relink" = yes; then
5399 relink_command=\"$relink_command\""
5404 # Do a symbolic link so that the libtool archive can be found in
5405 # LD_LIBRARY_PATH before the program is installed.
5406 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5407 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5413 # libtool install mode
5415 modename="$modename: install"
5417 # There may be an optional sh(1) argument at the beginning of
5418 # install_prog (especially on Windows NT).
5419 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5420 # Allow the use of GNU shtool's install command.
5421 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5422 # Aesthetically quote it.
5423 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5425 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5429 install_prog="$arg "
5437 # The real first argument should be the name of the installation program.
5438 # Aesthetically quote it.
5439 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5441 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5445 install_prog="$install_prog$arg"
5447 # We need to accept at least all the BSD install flags.
5457 if test -n "$dest"; then
5458 files="$files $dest"
5476 # If the previous option needed an argument, then skip it.
5477 if test -n "$prev"; then
5486 # Aesthetically quote the argument.
5487 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5489 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5493 install_prog="$install_prog $arg"
5496 if test -z "$install_prog"; then
5497 $echo "$modename: you must specify an install program" 1>&2
5502 if test -n "$prev"; then
5503 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5508 if test -z "$files"; then
5509 if test -z "$dest"; then
5510 $echo "$modename: no file or destination specified" 1>&2
5512 $echo "$modename: you must specify a destination" 1>&2
5518 # Strip any trailing slash from the destination.
5519 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5521 # Check to see that the destination is a directory.
5522 test -d "$dest" && isdir=yes
5523 if test "$isdir" = yes; then
5527 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5528 test "X$destdir" = "X$dest" && destdir=.
5529 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5531 # Not a directory, so check to see that there is only one file specified.
5533 if test "$#" -gt 2; then
5534 $echo "$modename: \`$dest' is not a directory" 1>&2
5540 [\\/]* | [A-Za-z]:[\\/]*) ;;
5542 for file in $files; do
5546 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5555 # This variable tells wrapper scripts just to set variables rather
5556 # than running their programs.
5557 libtool_install_magic="$magic"
5562 for file in $files; do
5564 # Do each installation.
5567 # Do the static libraries later.
5568 staticlibs="$staticlibs $file"
5572 # Check to see that this really is a libtool archive.
5573 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5575 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5583 # If there is no directory component, then add one.
5585 */* | *\\*) . $file ;;
5589 # Add the libdir to current_libdirs if it is the destination.
5590 if test "X$destdir" = "X$libdir"; then
5591 case "$current_libdirs " in
5593 *) current_libdirs="$current_libdirs $libdir" ;;
5596 # Note the libdir as a future libdir.
5597 case "$future_libdirs " in
5599 *) future_libdirs="$future_libdirs $libdir" ;;
5603 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5604 test "X$dir" = "X$file/" && dir=
5607 if test -n "$relink_command"; then
5608 # Determine the prefix the user has applied to our future dir.
5609 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5611 # Don't allow the user to place us outside of our expected
5612 # location b/c this prevents finding dependent libraries that
5613 # are installed to the same prefix.
5614 # At present, this check doesn't affect windows .dll's that
5615 # are installed into $libdir/../bin (currently, that works fine)
5616 # but it's something to keep an eye on.
5617 if test "$inst_prefix_dir" = "$destdir"; then
5618 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5622 if test -n "$inst_prefix_dir"; then
5623 # Stick the inst_prefix_dir data into the link command.
5624 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5626 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5629 $echo "$modename: warning: relinking \`$file'" 1>&2
5630 $show "$relink_command"
5631 if $run eval "$relink_command"; then :
5633 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5638 # See the names of the shared library.
5639 set dummy $library_names
5640 if test -n "$2"; then
5646 test -n "$relink_command" && srcname="$realname"T
5648 # Install the shared library and build the symlinks.
5649 $show "$install_prog $dir/$srcname $destdir/$realname"
5650 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5651 if test -n "$stripme" && test -n "$striplib"; then
5652 $show "$striplib $destdir/$realname"
5653 $run eval "$striplib $destdir/$realname" || exit $?
5656 if test "$#" -gt 0; then
5657 # Delete the old symlinks, and create new ones.
5660 if test "$linkname" != "$realname"; then
5661 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5662 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5667 # Do each command in the postinstall commands.
5668 lib="$destdir/$realname"
5669 cmds=$postinstall_cmds
5670 save_ifs="$IFS"; IFS='~'
5671 for cmd in $cmds; do
5675 $run eval "$cmd" || exit $?
5680 # Install the pseudo-library for information purposes.
5683 # Do not install the useless pseudo-library
5686 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5687 instname="$dir/$name"i
5688 $show "$install_prog $instname $destdir/$name"
5689 $run eval "$install_prog $instname $destdir/$name" || exit $?
5693 # Maybe install the static library, too.
5694 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5698 # Install (i.e. copy) a libtool object.
5700 # Figure out destination file name, if it wasn't already specified.
5701 if test -n "$destname"; then
5702 destfile="$destdir/$destname"
5704 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5705 destfile="$destdir/$destfile"
5708 # Deduce the name of the destination old-style object file.
5711 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5714 staticdest="$destfile"
5718 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5724 # Install the libtool object if requested.
5725 if test -n "$destfile"; then
5726 $show "$install_prog $file $destfile"
5727 $run eval "$install_prog $file $destfile" || exit $?
5730 # Install the old object if enabled.
5731 if test "$build_old_libs" = yes; then
5732 # Deduce the name of the old-style object file.
5733 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5735 $show "$install_prog $staticobj $staticdest"
5736 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5742 # Figure out destination file name, if it wasn't already specified.
5743 if test -n "$destname"; then
5744 destfile="$destdir/$destname"
5746 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5747 destfile="$destdir/$destfile"
5750 # If the file is missing, and there is a .exe on the end, strip it
5751 # because it is most likely a libtool script we actually want to
5756 if test ! -f "$file"; then
5757 file=`$echo $file|${SED} 's,.exe$,,'`
5763 # Do a test to see if this is really a libtool program.
5766 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5772 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5776 # To insure that "foo" is sourced, and not "foo.exe",
5777 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5778 # which disallows the automatic-append-.exe behavior.
5780 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5781 *) wrapperdot=${wrapper} ;;
5783 # If there is no directory component, then add one.
5785 */* | *\\*) . ${wrapperdot} ;;
5786 *) . ./${wrapperdot} ;;
5789 # Check the variables that should have been set.
5790 if test -z "$notinst_deplibs"; then
5791 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5796 for lib in $notinst_deplibs; do
5797 # Check to see that each library is installed.
5799 if test -f "$lib"; then
5800 # If there is no directory component, then add one.
5802 */* | *\\*) . $lib ;;
5806 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5807 if test -n "$libdir" && test ! -f "$libfile"; then
5808 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5814 # To insure that "foo" is sourced, and not "foo.exe",
5815 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5816 # which disallows the automatic-append-.exe behavior.
5818 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5819 *) wrapperdot=${wrapper} ;;
5821 # If there is no directory component, then add one.
5823 */* | *\\*) . ${wrapperdot} ;;
5824 *) . ./${wrapperdot} ;;
5828 if test "$fast_install" = no && test -n "$relink_command"; then
5829 if test "$finalize" = yes && test -z "$run"; then
5831 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5832 tmpdir="$tmpdir/libtool-$$"
5835 if $mkdir "$tmpdir"; then
5839 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5842 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5843 outputname="$tmpdir/$file"
5844 # Replace the output file specification.
5845 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5847 $show "$relink_command"
5848 if $run eval "$relink_command"; then :
5850 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5856 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5859 # Install the binary that we compiled earlier.
5860 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5864 # remove .exe since cygwin /usr/bin/install will append another
5866 case $install_prog,$host in
5867 */usr/bin/install*,*cygwin*)
5868 case $file:$destfile in
5873 destfile=$destfile.exe
5876 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5881 $show "$install_prog$stripme $file $destfile"
5882 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5883 test -n "$outputname" && ${rm}r "$tmpdir"
5888 for file in $staticlibs; do
5889 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5891 # Set up the ranlib parameters.
5892 oldlib="$destdir/$name"
5894 $show "$install_prog $file $oldlib"
5895 $run eval "$install_prog \$file \$oldlib" || exit $?
5897 if test -n "$stripme" && test -n "$old_striplib"; then
5898 $show "$old_striplib $oldlib"
5899 $run eval "$old_striplib $oldlib" || exit $?
5902 # Do each command in the postinstall commands.
5903 cmds=$old_postinstall_cmds
5904 save_ifs="$IFS"; IFS='~'
5905 for cmd in $cmds; do
5909 $run eval "$cmd" || exit $?
5914 if test -n "$future_libdirs"; then
5915 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5918 if test -n "$current_libdirs"; then
5919 # Maybe just do a dry run.
5920 test -n "$run" && current_libdirs=" -n$current_libdirs"
5921 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5927 # libtool finish mode
5929 modename="$modename: finish"
5933 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5936 libdirs="$libdirs $dir"
5939 for libdir in $libdirs; do
5940 if test -n "$finish_cmds"; then
5941 # Do each command in the finish commands.
5943 save_ifs="$IFS"; IFS='~'
5944 for cmd in $cmds; do
5948 $run eval "$cmd" || admincmds="$admincmds
5953 if test -n "$finish_eval"; then
5954 # Do the single finish_eval.
5955 eval cmds=\"$finish_eval\"
5956 $run eval "$cmds" || admincmds="$admincmds
5962 # Exit here if they wanted silent mode.
5963 test "$show" = : && exit $EXIT_SUCCESS
5965 $echo "----------------------------------------------------------------------"
5966 $echo "Libraries have been installed in:"
5967 for libdir in $libdirs; do
5971 $echo "If you ever happen to want to link against installed libraries"
5972 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5973 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5974 $echo "flag during linking and do at least one of the following:"
5975 if test -n "$shlibpath_var"; then
5976 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5977 $echo " during execution"
5979 if test -n "$runpath_var"; then
5980 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5981 $echo " during linking"
5983 if test -n "$hardcode_libdir_flag_spec"; then
5985 eval flag=\"$hardcode_libdir_flag_spec\"
5987 $echo " - use the \`$flag' linker flag"
5989 if test -n "$admincmds"; then
5990 $echo " - have your system administrator run these commands:$admincmds"
5992 if test -f /etc/ld.so.conf; then
5993 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5996 $echo "See any operating system documentation about shared libraries for"
5997 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5998 $echo "----------------------------------------------------------------------"
6002 # libtool execute mode
6004 modename="$modename: execute"
6006 # The first argument is the command name.
6008 if test -z "$cmd"; then
6009 $echo "$modename: you must specify a COMMAND" 1>&2
6014 # Handle -dlopen flags immediately.
6015 for file in $execute_dlfiles; do
6016 if test ! -f "$file"; then
6017 $echo "$modename: \`$file' is not a file" 1>&2
6025 # Check to see that this really is a libtool archive.
6026 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6028 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6033 # Read the libtool library.
6037 # If there is no directory component, then add one.
6039 */* | *\\*) . $file ;;
6043 # Skip this library if it cannot be dlopened.
6044 if test -z "$dlname"; then
6045 # Warn if it was a shared library.
6046 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6050 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6051 test "X$dir" = "X$file" && dir=.
6053 if test -f "$dir/$objdir/$dlname"; then
6056 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6062 # Just add the directory containing the .lo file.
6063 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6064 test "X$dir" = "X$file" && dir=.
6068 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6073 # Get the absolute pathname.
6074 absdir=`cd "$dir" && pwd`
6075 test -n "$absdir" && dir="$absdir"
6077 # Now add the directory to shlibpath_var.
6078 if eval "test -z \"\$$shlibpath_var\""; then
6079 eval "$shlibpath_var=\"\$dir\""
6081 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6085 # This variable tells wrapper scripts just to set shlibpath_var
6086 # rather than running their programs.
6087 libtool_execute_magic="$magic"
6089 # Check if any of the arguments is a wrapper script.
6096 # Do a test to see if this is really a libtool program.
6097 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6098 # If there is no directory component, then add one.
6100 */* | *\\*) . $file ;;
6104 # Transform arg to wrapped name.
6105 file="$progdir/$program"
6109 # Quote arguments (to preserve shell metacharacters).
6110 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6111 args="$args \"$file\""
6114 if test -z "$run"; then
6115 if test -n "$shlibpath_var"; then
6116 # Export the shlibpath_var.
6117 eval "export $shlibpath_var"
6120 # Restore saved environment variables
6121 if test "${save_LC_ALL+set}" = set; then
6122 LC_ALL="$save_LC_ALL"; export LC_ALL
6124 if test "${save_LANG+set}" = set; then
6125 LANG="$save_LANG"; export LANG
6128 # Now prepare to actually exec the command.
6129 exec_cmd="\$cmd$args"
6131 # Display what would be done.
6132 if test -n "$shlibpath_var"; then
6133 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6134 $echo "export $shlibpath_var"
6141 # libtool clean and uninstall mode
6143 modename="$modename: $mode"
6149 # This variable tells wrapper scripts just to set variables rather
6150 # than running their programs.
6151 libtool_install_magic="$magic"
6156 -f) rm="$rm $arg"; rmforce=yes ;;
6157 -*) rm="$rm $arg" ;;
6158 *) files="$files $arg" ;;
6162 if test -z "$rm"; then
6163 $echo "$modename: you must specify an RM program" 1>&2
6170 origobjdir="$objdir"
6171 for file in $files; do
6172 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6173 if test "X$dir" = "X$file"; then
6175 objdir="$origobjdir"
6177 objdir="$dir/$origobjdir"
6179 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6180 test "$mode" = uninstall && objdir="$dir"
6182 # Remember objdir for removal later, being careful to avoid duplicates
6183 if test "$mode" = clean; then
6186 *) rmdirs="$rmdirs $objdir" ;;
6190 # Don't error if the file doesn't exist and rm -f was used.
6191 if (test -L "$file") >/dev/null 2>&1 \
6192 || (test -h "$file") >/dev/null 2>&1 \
6193 || test -f "$file"; then
6195 elif test -d "$file"; then
6198 elif test "$rmforce" = yes; then
6206 # Possibly a libtool archive, so verify it.
6207 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6210 # Delete the libtool libraries and symlinks.
6211 for n in $library_names; do
6212 rmfiles="$rmfiles $objdir/$n"
6214 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6215 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6217 if test "$mode" = uninstall; then
6218 if test -n "$library_names"; then
6219 # Do each command in the postuninstall commands.
6220 cmds=$postuninstall_cmds
6221 save_ifs="$IFS"; IFS='~'
6222 for cmd in $cmds; do
6227 if test "$?" -ne 0 && test "$rmforce" != yes; then
6234 if test -n "$old_library"; then
6235 # Do each command in the old_postuninstall commands.
6236 cmds=$old_postuninstall_cmds
6237 save_ifs="$IFS"; IFS='~'
6238 for cmd in $cmds; do
6243 if test "$?" -ne 0 && test "$rmforce" != yes; then
6249 # FIXME: should reinstall the best remaining shared library.
6255 # Possibly a libtool object, so verify it.
6256 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6261 # Add PIC object to the list of files to remove.
6262 if test -n "$pic_object" \
6263 && test "$pic_object" != none; then
6264 rmfiles="$rmfiles $dir/$pic_object"
6267 # Add non-PIC object to the list of files to remove.
6268 if test -n "$non_pic_object" \
6269 && test "$non_pic_object" != none; then
6270 rmfiles="$rmfiles $dir/$non_pic_object"
6276 if test "$mode" = clean ; then
6280 file=`$echo $file|${SED} 's,.exe$,,'`
6281 noexename=`$echo $name|${SED} 's,.exe$,,'`
6282 # $file with .exe has already been added to rmfiles,
6283 # add $file without .exe
6284 rmfiles="$rmfiles $file"
6287 # Do a test to see if this is a libtool program.
6288 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6292 # note $name still contains .exe if it was in $file originally
6293 # as does the version of $file that was added into $rmfiles
6294 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6295 if test "$fast_install" = yes && test -n "$relink_command"; then
6296 rmfiles="$rmfiles $objdir/lt-$name"
6298 if test "X$noexename" != "X$name" ; then
6299 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6305 $show "$rm $rmfiles"
6306 $run $rm $rmfiles || exit_status=1
6308 objdir="$origobjdir"
6310 # Try to remove the ${objdir}s in the directories where we deleted files
6311 for dir in $rmdirs; do
6312 if test -d "$dir"; then
6314 $run rmdir $dir >/dev/null 2>&1
6322 $echo "$modename: you must specify a MODE" 1>&2
6323 $echo "$generic_help" 1>&2
6328 if test -z "$exec_cmd"; then
6329 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6330 $echo "$generic_help" 1>&2
6333 fi # test -z "$show_help"
6335 if test -n "$exec_cmd"; then
6340 # We need to display help for each of the modes.
6343 "Usage: $modename [OPTION]... [MODE-ARG]...
6345 Provide generalized library-building support services.
6347 --config show all configuration variables
6348 --debug enable verbose shell tracing
6349 -n, --dry-run display commands without modifying any files
6350 --features display basic configuration information and exit
6351 --finish same as \`--mode=finish'
6352 --help display this help message and exit
6353 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6354 --quiet same as \`--silent'
6355 --silent don't print informational messages
6356 --tag=TAG use configuration variables from tag TAG
6357 --version print version information
6359 MODE must be one of the following:
6361 clean remove files from the build directory
6362 compile compile a source file into a libtool object
6363 execute automatically set library path, then run a program
6364 finish complete the installation of libtool libraries
6365 install install libraries or executables
6366 link create a library or an executable
6367 uninstall remove libraries from an installed directory
6369 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6370 a more detailed description of MODE.
6372 Report bugs to <bug-libtool@gnu.org>."
6378 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6380 Remove files from the build directory.
6382 RM is the name of the program to use to delete files associated with each FILE
6383 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6386 If FILE is a libtool library, object or program, all the files associated
6387 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6392 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6394 Compile a source file into a libtool library object.
6396 This mode accepts the following additional options:
6398 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6399 -prefer-pic try to building PIC objects only
6400 -prefer-non-pic try to building non-PIC objects only
6401 -static always build a \`.o' file suitable for static linking
6403 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6404 from the given SOURCEFILE.
6406 The output file name is determined by removing the directory component from
6407 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6408 library object suffix, \`.lo'."
6413 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6415 Automatically set library path, then run a program.
6417 This mode accepts the following additional options:
6419 -dlopen FILE add the directory containing FILE to the library path
6421 This mode sets the library path environment variable according to \`-dlopen'
6424 If any of the ARGS are libtool executable wrappers, then they are translated
6425 into their corresponding uninstalled binary, and any of their required library
6426 directories are added to the library path.
6428 Then, COMMAND is executed, with ARGS as arguments."
6433 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6435 Complete the installation of libtool libraries.
6437 Each LIBDIR is a directory that contains libtool libraries.
6439 The commands that this mode executes may require superuser privileges. Use
6440 the \`--dry-run' option if you just want to see what would be executed."
6445 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6447 Install executables or libraries.
6449 INSTALL-COMMAND is the installation command. The first component should be
6450 either the \`install' or \`cp' program.
6452 The rest of the components are interpreted as arguments to that command (only
6453 BSD-compatible install options are recognized)."
6458 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6460 Link object files or libraries together to form another library, or to
6461 create an executable program.
6463 LINK-COMMAND is a command using the C compiler that you would use to create
6464 a program from several object files.
6466 The following components of LINK-COMMAND are treated specially:
6468 -all-static do not do any dynamic linking at all
6469 -avoid-version do not add a version suffix if possible
6470 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6471 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6472 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6473 -export-symbols SYMFILE
6474 try to export only the symbols listed in SYMFILE
6475 -export-symbols-regex REGEX
6476 try to export only the symbols matching REGEX
6477 -LLIBDIR search LIBDIR for required installed libraries
6478 -lNAME OUTPUT-FILE requires the installed library libNAME
6479 -module build a library that can dlopened
6480 -no-fast-install disable the fast-install mode
6481 -no-install link a not-installable executable
6482 -no-undefined declare that a library does not refer to external symbols
6483 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6484 -objectlist FILE Use a list of object files found in FILE to specify objects
6485 -precious-files-regex REGEX
6486 don't remove output files matching REGEX
6487 -release RELEASE specify package release information
6488 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6489 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6490 -static do not do any dynamic linking of libtool libraries
6491 -version-info CURRENT[:REVISION[:AGE]]
6492 specify library version info [each variable defaults to 0]
6494 All other options (arguments beginning with \`-') are ignored.
6496 Every other argument is treated as a filename. Files ending in \`.la' are
6497 treated as uninstalled libtool libraries, other files are standard or library
6500 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6501 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6502 required, except when creating a convenience library.
6504 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6505 using \`ar' and \`ranlib', or on Windows using \`lib'.
6507 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6508 is created, otherwise an executable program is created."
6513 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6515 Remove libraries from an installation directory.
6517 RM is the name of the program to use to delete files associated with each FILE
6518 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6521 If FILE is a libtool library, all the files associated with it are deleted.
6522 Otherwise, only FILE itself is deleted using RM."
6526 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6533 $echo "Try \`$modename --help' for more information about other modes."
6537 # The TAGs below are defined such that we never get into a situation
6538 # in which we disable both kinds of libraries. Given conflicting
6539 # choices, we go for a static library, that is the most portable,
6540 # since we can't tell whether shared libraries were disabled because
6541 # the user asked for that or because the platform doesn't support
6542 # them. This is particularly important on AIX, because we don't
6543 # support having both static and shared libraries enabled at the same
6544 # time on that platform, so we default to a shared-only configuration.
6545 # If a disable-shared tag is given, we'll fallback to a static-only
6546 # configuration. But we'll never go from static-only to shared-only.
6548 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6549 build_libtool_libs=no
6551 # ### END LIBTOOL TAG CONFIG: disable-shared
6553 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6554 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6555 # ### END LIBTOOL TAG CONFIG: disable-static