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
1109 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1110 dlopen_self=$dlopen_self_static
1113 build_libtool_libs=no
1115 prefer_static_libs=yes
1121 # See if our shared archives depend on static archives.
1122 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1124 # Go through the arguments, transforming them on the way.
1125 while test "$#" -gt 0; do
1129 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1130 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1134 libtool_args="$libtool_args $qarg"
1136 # If the previous option needs an argument, assign it.
1137 if test -n "$prev"; then
1140 compile_command="$compile_command @OUTPUT@"
1141 finalize_command="$finalize_command @OUTPUT@"
1147 if test "$preload" = no; then
1148 # Add the symbol object into the linking commands.
1149 compile_command="$compile_command @SYMFILE@"
1150 finalize_command="$finalize_command @SYMFILE@"
1154 *.la | *.lo) ;; # We handle these cases below.
1156 if test "$dlself" = no; then
1164 if test "$prev" = dlprefiles; then
1166 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1176 if test "$prev" = dlfiles; then
1177 dlfiles="$dlfiles $arg"
1179 dlprefiles="$dlprefiles $arg"
1187 export_symbols="$arg"
1188 if test ! -f "$arg"; then
1189 $echo "$modename: symbol file \`$arg' does not exist"
1196 export_symbols_regex="$arg"
1201 inst_prefix_dir="$arg"
1206 precious_files_regex="$arg"
1216 if test -f "$arg"; then
1219 for fil in `cat $save_arg`
1221 # moreargs="$moreargs $fil"
1223 # A libtool-controlled object.
1225 # Check to see that this really is a libtool object.
1226 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1231 # If there is no directory component, then add one.
1233 */* | *\\*) . $arg ;;
1237 if test -z "$pic_object" || \
1238 test -z "$non_pic_object" ||
1239 test "$pic_object" = none && \
1240 test "$non_pic_object" = none; then
1241 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1245 # Extract subdirectory from the argument.
1246 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1247 if test "X$xdir" = "X$arg"; then
1253 if test "$pic_object" != none; then
1254 # Prepend the subdirectory the object is found in.
1255 pic_object="$xdir$pic_object"
1257 if test "$prev" = dlfiles; then
1258 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1259 dlfiles="$dlfiles $pic_object"
1263 # If libtool objects are unsupported, then we need to preload.
1268 # CHECK ME: I think I busted this. -Ossama
1269 if test "$prev" = dlprefiles; then
1270 # Preload the old-style object.
1271 dlprefiles="$dlprefiles $pic_object"
1276 libobjs="$libobjs $pic_object"
1281 if test "$non_pic_object" != none; then
1282 # Prepend the subdirectory the object is found in.
1283 non_pic_object="$xdir$non_pic_object"
1285 # A standard non-PIC object
1286 non_pic_objects="$non_pic_objects $non_pic_object"
1287 if test -z "$pic_object" || test "$pic_object" = none ; then
1288 arg="$non_pic_object"
1292 # Only an error if not doing a dry-run.
1293 if test -z "$run"; then
1294 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1299 # Extract subdirectory from the argument.
1300 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1301 if test "X$xdir" = "X$arg"; then
1307 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1308 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1309 libobjs="$libobjs $pic_object"
1310 non_pic_objects="$non_pic_objects $non_pic_object"
1315 $echo "$modename: link input file \`$save_arg' does not exist"
1323 # We need an absolute path.
1325 [\\/]* | [A-Za-z]:[\\/]*) ;;
1327 $echo "$modename: only absolute run-paths are allowed" 1>&2
1331 if test "$prev" = rpath; then
1334 *) rpath="$rpath $arg" ;;
1339 *) xrpath="$xrpath $arg" ;;
1346 compiler_flags="$compiler_flags $qarg"
1348 compile_command="$compile_command $qarg"
1349 finalize_command="$finalize_command $qarg"
1353 linker_flags="$linker_flags $qarg"
1354 compiler_flags="$compiler_flags $wl$qarg"
1356 compile_command="$compile_command $wl$qarg"
1357 finalize_command="$finalize_command $wl$qarg"
1361 linker_flags="$linker_flags $qarg"
1362 compiler_flags="$compiler_flags $qarg"
1364 compile_command="$compile_command $qarg"
1365 finalize_command="$finalize_command $qarg"
1374 compiler_flags="$compiler_flags $arg"
1375 compile_command="$compile_command $arg"
1376 finalize_command="$finalize_command $arg"
1381 eval "$prev=\"\$arg\""
1386 fi # test -n "$prev"
1392 if test -n "$link_static_flag"; then
1393 compile_command="$compile_command $link_static_flag"
1394 finalize_command="$finalize_command $link_static_flag"
1400 # FIXME: remove this flag sometime in the future.
1401 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1425 -export-symbols | -export-symbols-regex)
1426 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1427 $echo "$modename: more than one -exported-symbols argument is not allowed"
1430 if test "X$arg" = "X-export-symbols"; then
1439 prev=darwin_framework
1440 compiler_flags="$compiler_flags $arg"
1441 compile_command="$compile_command $arg"
1442 finalize_command="$finalize_command $arg"
1451 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1452 # so, if we see these flags be careful not to treat them like -L
1454 case $with_gcc/$host in
1455 no/*-*-irix* | /*-*-irix*)
1456 compile_command="$compile_command $arg"
1457 finalize_command="$finalize_command $arg"
1464 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1465 # We need an absolute path.
1467 [\\/]* | [A-Za-z]:[\\/]*) ;;
1469 absdir=`cd "$dir" && pwd`
1470 if test -z "$absdir"; then
1471 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1480 deplibs="$deplibs -L$dir"
1481 lib_search_path="$lib_search_path $dir"
1485 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1486 case :$dllsearchpath: in
1488 *) dllsearchpath="$dllsearchpath:$dir";;
1496 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1498 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1499 # These systems don't actually have a C or math library (as such)
1502 *-*-mingw* | *-*-os2*)
1503 # These systems don't actually have a C library (as such)
1504 test "X$arg" = "X-lc" && continue
1506 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1507 # Do not include libc due to us having libc/libc_r.
1508 test "X$arg" = "X-lc" && continue
1510 *-*-rhapsody* | *-*-darwin1.[012])
1511 # Rhapsody C and math libraries are in the System framework
1512 deplibs="$deplibs -framework System"
1515 elif test "X$arg" = "X-lc_r"; then
1517 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1518 # Do not include libc_r directly, use -pthread flag.
1523 deplibs="$deplibs $arg"
1527 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1528 # classes, name mangling, and exception handling.
1530 compile_command="$compile_command $arg"
1531 compiler_flags="$compiler_flags $arg"
1532 finalize_command="$finalize_command $arg"
1537 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1538 compiler_flags="$compiler_flags $arg"
1539 compile_command="$compile_command $arg"
1540 finalize_command="$finalize_command $arg"
1541 deplibs="$deplibs $arg"
1549 # Do not build the useless static library
1556 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1557 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1558 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1559 # +DA*, +DD* enable 64-bit mode on the HP compiler
1560 # -q* pass through compiler args for the IBM compiler
1561 # -m* pass through architecture-specific compiler args for GCC
1562 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1564 # Unknown arguments in both finalize_command and compile_command need
1565 # to be aesthetically quoted because they are evaled later.
1566 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1568 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1572 compile_command="$compile_command $arg"
1573 finalize_command="$finalize_command $arg"
1574 if test "$with_gcc" = "yes" ; then
1575 compiler_flags="$compiler_flags $arg"
1592 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1593 # The PATH hackery in wrapper scripts is required on Windows
1594 # in order for the loader to find any dlls it needs.
1595 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1596 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1599 *) no_install=yes ;;
1616 -precious-files-regex)
1637 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1638 # We need an absolute path.
1640 [\\/]* | [A-Za-z]:[\\/]*) ;;
1642 $echo "$modename: only absolute run-paths are allowed" 1>&2
1648 *) xrpath="$xrpath $dir" ;;
1654 # The effects of -static are defined in a previous loop.
1655 # We used to do the same as -all-static on platforms that
1656 # didn't have a PIC flag, but the assumption that the effects
1657 # would be equivalent was wrong. It would break on at least
1658 # Digital Unix and AIX.
1678 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1680 save_ifs="$IFS"; IFS=','
1681 for flag in $args; do
1684 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1689 compiler_flags="$compiler_flags $flag"
1692 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1696 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1698 save_ifs="$IFS"; IFS=','
1699 for flag in $args; do
1702 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1707 compiler_flags="$compiler_flags $wl$flag"
1708 linker_flags="$linker_flags $flag"
1711 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1729 # Some other compiler flag.
1731 # Unknown arguments in both finalize_command and compile_command need
1732 # to be aesthetically quoted because they are evaled later.
1733 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1735 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1742 # A standard object.
1747 # A libtool-controlled object.
1749 # Check to see that this really is a libtool object.
1750 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1755 # If there is no directory component, then add one.
1757 */* | *\\*) . $arg ;;
1761 if test -z "$pic_object" || \
1762 test -z "$non_pic_object" ||
1763 test "$pic_object" = none && \
1764 test "$non_pic_object" = none; then
1765 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1769 # Extract subdirectory from the argument.
1770 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1771 if test "X$xdir" = "X$arg"; then
1777 if test "$pic_object" != none; then
1778 # Prepend the subdirectory the object is found in.
1779 pic_object="$xdir$pic_object"
1781 if test "$prev" = dlfiles; then
1782 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1783 dlfiles="$dlfiles $pic_object"
1787 # If libtool objects are unsupported, then we need to preload.
1792 # CHECK ME: I think I busted this. -Ossama
1793 if test "$prev" = dlprefiles; then
1794 # Preload the old-style object.
1795 dlprefiles="$dlprefiles $pic_object"
1800 libobjs="$libobjs $pic_object"
1805 if test "$non_pic_object" != none; then
1806 # Prepend the subdirectory the object is found in.
1807 non_pic_object="$xdir$non_pic_object"
1809 # A standard non-PIC object
1810 non_pic_objects="$non_pic_objects $non_pic_object"
1811 if test -z "$pic_object" || test "$pic_object" = none ; then
1812 arg="$non_pic_object"
1816 # Only an error if not doing a dry-run.
1817 if test -z "$run"; then
1818 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1823 # Extract subdirectory from the argument.
1824 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1825 if test "X$xdir" = "X$arg"; then
1831 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1832 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1833 libobjs="$libobjs $pic_object"
1834 non_pic_objects="$non_pic_objects $non_pic_object"
1841 deplibs="$deplibs $arg"
1842 old_deplibs="$old_deplibs $arg"
1847 # A libtool-controlled library.
1849 if test "$prev" = dlfiles; then
1850 # This library was specified with -dlopen.
1851 dlfiles="$dlfiles $arg"
1853 elif test "$prev" = dlprefiles; then
1854 # The library was specified with -dlpreopen.
1855 dlprefiles="$dlprefiles $arg"
1858 deplibs="$deplibs $arg"
1863 # Some other compiler argument.
1865 # Unknown arguments in both finalize_command and compile_command need
1866 # to be aesthetically quoted because they are evaled later.
1867 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1869 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1876 # Now actually substitute the argument into the commands.
1877 if test -n "$arg"; then
1878 compile_command="$compile_command $arg"
1879 finalize_command="$finalize_command $arg"
1881 done # argument parsing loop
1883 if test -n "$prev"; then
1884 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1889 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1890 eval arg=\"$export_dynamic_flag_spec\"
1891 compile_command="$compile_command $arg"
1892 finalize_command="$finalize_command $arg"
1896 # calculate the name of the file, without its directory
1897 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1898 libobjs_save="$libobjs"
1900 if test -n "$shlibpath_var"; then
1901 # get the directories listed in $shlibpath_var
1902 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1906 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1907 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1909 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1910 if test "X$output_objdir" = "X$output"; then
1911 output_objdir="$objdir"
1913 output_objdir="$output_objdir/$objdir"
1915 # Create the object directory.
1916 if test ! -d "$output_objdir"; then
1917 $show "$mkdir $output_objdir"
1918 $run $mkdir $output_objdir
1920 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1925 # Determine the type of output
1928 $echo "$modename: you must specify an output file" 1>&2
1932 *.$libext) linkmode=oldlib ;;
1933 *.lo | *.$objext) linkmode=obj ;;
1934 *.la) linkmode=lib ;;
1935 *) linkmode=prog ;; # Anything else should be a program.
1939 *cygwin* | *mingw* | *pw32*)
1940 # don't eliminate duplications in $postdeps and $predeps
1941 duplicate_compiler_generated_deps=yes
1944 duplicate_compiler_generated_deps=$duplicate_deps
1950 # Find all interdependent deplibs by searching for libraries
1951 # that are linked more than once (e.g. -la -lb -la)
1952 for deplib in $deplibs; do
1953 if test "X$duplicate_deps" = "Xyes" ; then
1955 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1958 libs="$libs $deplib"
1961 if test "$linkmode" = lib; then
1962 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1964 # Compute libraries that are listed more than once in $predeps
1965 # $postdeps and mark them as special (i.e., whose duplicates are
1966 # not to be eliminated).
1968 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1969 for pre_post_dep in $predeps $postdeps; do
1970 case "$pre_post_deps " in
1971 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1973 pre_post_deps="$pre_post_deps $pre_post_dep"
1982 need_relink=no # whether we're linking any uninstalled libtool libraries
1983 notinst_deplibs= # not-installed libtool libraries
1984 notinst_path= # paths that contain not-installed libtool libraries
1988 for file in $dlfiles $dlprefiles; do
1992 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2004 passes="conv scan dlopen dlpreopen link"
2009 for pass in $passes; do
2010 if test "$linkmode,$pass" = "lib,link" ||
2011 test "$linkmode,$pass" = "prog,scan"; then
2015 if test "$linkmode" = prog; then
2017 dlopen) libs="$dlfiles" ;;
2018 dlpreopen) libs="$dlprefiles" ;;
2019 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2022 if test "$pass" = dlopen; then
2023 # Collect dlpreopened libraries
2024 save_deplibs="$deplibs"
2027 for deplib in $libs; do
2031 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2032 if test "$linkmode,$pass" = "prog,link"; then
2033 compile_deplibs="$deplib $compile_deplibs"
2034 finalize_deplibs="$deplib $finalize_deplibs"
2036 compiler_flags="$compiler_flags $deplib"
2041 deplibs="$deplib $deplibs"
2042 test "$pass" = conv && continue
2043 newdependency_libs="$deplib $newdependency_libs"
2046 if test "$pass" = conv; then
2047 deplibs="$deplib $deplibs"
2050 if test "$pass" = scan; then
2051 deplibs="$deplib $deplibs"
2053 compile_deplibs="$deplib $compile_deplibs"
2054 finalize_deplibs="$deplib $finalize_deplibs"
2064 if test "$linkmode" != lib && test "$linkmode" != prog; then
2065 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2068 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2069 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2070 for search_ext in .la $std_shrext .so .a; do
2071 # Search the libtool library
2072 lib="$searchdir/lib${name}${search_ext}"
2073 if test -f "$lib"; then
2074 if test "$search_ext" = ".la"; then
2083 if test "$found" != yes; then
2084 # deplib doesn't seem to be a libtool library
2085 if test "$linkmode,$pass" = "prog,link"; then
2086 compile_deplibs="$deplib $compile_deplibs"
2087 finalize_deplibs="$deplib $finalize_deplibs"
2089 deplibs="$deplib $deplibs"
2090 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2093 else # deplib is a libtool library
2094 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2095 # We need to do some special things here, and not later.
2096 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2097 case " $predeps $postdeps " in
2099 if (${SED} -e '2q' $lib |
2100 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2104 */* | *\\*) . $lib ;;
2107 for l in $old_library $library_names; do
2110 if test "X$ll" = "X$old_library" ; then # only static version available
2112 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2113 test "X$ladir" = "X$lib" && ladir="."
2114 lib=$ladir/$old_library
2115 if test "$linkmode,$pass" = "prog,link"; then
2116 compile_deplibs="$deplib $compile_deplibs"
2117 finalize_deplibs="$deplib $finalize_deplibs"
2119 deplibs="$deplib $deplibs"
2120 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2134 deplibs="$deplib $deplibs"
2135 test "$pass" = conv && continue
2136 newdependency_libs="$deplib $newdependency_libs"
2137 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2140 if test "$pass" = conv; then
2141 deplibs="$deplib $deplibs"
2144 if test "$pass" = scan; then
2145 deplibs="$deplib $deplibs"
2147 compile_deplibs="$deplib $compile_deplibs"
2148 finalize_deplibs="$deplib $finalize_deplibs"
2150 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2153 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2159 if test "$pass" = link; then
2160 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2161 # Make sure the xrpath contains only unique directories.
2164 *) xrpath="$xrpath $dir" ;;
2167 deplibs="$deplib $deplibs"
2170 *.la) lib="$deplib" ;;
2172 if test "$pass" = conv; then
2173 deplibs="$deplib $deplibs"
2179 case $deplibs_check_method in
2181 set dummy $deplibs_check_method
2182 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2183 if eval $echo \"$deplib\" 2>/dev/null \
2185 | $EGREP "$match_pattern_regex" > /dev/null; then
2193 if test "$valid_a_lib" != yes; then
2195 $echo "*** Warning: Trying to link with static lib archive $deplib."
2196 $echo "*** I have the capability to make that library automatically link in when"
2197 $echo "*** you link to this library. But I can only do this if you have a"
2198 $echo "*** shared version of the library, which you do not appear to have"
2199 $echo "*** because the file extensions .$libext of this argument makes me believe"
2200 $echo "*** that it is just a static archive that I should not used here."
2203 $echo "*** Warning: Linking the shared library $output against the"
2204 $echo "*** static library $deplib is not portable!"
2205 deplibs="$deplib $deplibs"
2210 if test "$pass" != link; then
2211 deplibs="$deplib $deplibs"
2213 compile_deplibs="$deplib $compile_deplibs"
2214 finalize_deplibs="$deplib $finalize_deplibs"
2221 if test "$pass" = conv; then
2222 deplibs="$deplib $deplibs"
2223 elif test "$linkmode" = prog; then
2224 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2225 # If there is no dlopen support or we're linking statically,
2226 # we need to preload.
2227 newdlprefiles="$newdlprefiles $deplib"
2228 compile_deplibs="$deplib $compile_deplibs"
2229 finalize_deplibs="$deplib $finalize_deplibs"
2231 newdlfiles="$newdlfiles $deplib"
2241 if test "$found" = yes || test -f "$lib"; then :
2243 $echo "$modename: cannot find the library \`$lib'" 1>&2
2247 # Check to see that this really is a libtool archive.
2248 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2250 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2254 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2255 test "X$ladir" = "X$lib" && ladir="."
2263 # If the library was installed with an old release of libtool,
2264 # it will not redefine variables installed, or shouldnotlink
2272 */* | *\\*) . $lib ;;
2276 if test "$linkmode,$pass" = "lib,link" ||
2277 test "$linkmode,$pass" = "prog,scan" ||
2278 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2279 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2280 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2283 if test "$pass" = conv; then
2284 # Only check for convenience libraries
2285 deplibs="$lib $deplibs"
2286 if test -z "$libdir"; then
2287 if test -z "$old_library"; then
2288 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2291 # It is a libtool convenience library, so add in its objects.
2292 convenience="$convenience $ladir/$objdir/$old_library"
2293 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2295 for deplib in $dependency_libs; do
2296 deplibs="$deplib $deplibs"
2297 if test "X$duplicate_deps" = "Xyes" ; then
2298 case "$tmp_libs " in
2299 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2302 tmp_libs="$tmp_libs $deplib"
2304 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2305 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2312 # Get the name of the library we link against.
2314 for l in $old_library $library_names; do
2317 if test -z "$linklib"; then
2318 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2322 # This library was specified with -dlopen.
2323 if test "$pass" = dlopen; then
2324 if test -z "$libdir"; then
2325 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2328 if test -z "$dlname" ||
2329 test "$dlopen_support" != yes ||
2330 test "$build_libtool_libs" = no; then
2331 # If there is no dlname, no dlopen support or we're linking
2332 # statically, we need to preload. We also need to preload any
2333 # dependent libraries so libltdl's deplib preloader doesn't
2334 # bomb out in the load deplibs phase.
2335 dlprefiles="$dlprefiles $lib $dependency_libs"
2337 newdlfiles="$newdlfiles $lib"
2342 # We need an absolute path.
2344 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2346 abs_ladir=`cd "$ladir" && pwd`
2347 if test -z "$abs_ladir"; then
2348 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2349 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2354 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2356 # Find the relevant object directory and library name.
2357 if test "X$installed" = Xyes; then
2358 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2359 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2367 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2369 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2372 # Remove this search path later
2373 notinst_path="$notinst_path $abs_ladir"
2375 dir="$ladir/$objdir"
2376 absdir="$abs_ladir/$objdir"
2377 # Remove this search path later
2378 notinst_path="$notinst_path $abs_ladir"
2380 fi # $installed = yes
2381 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2383 # This library was specified with -dlpreopen.
2384 if test "$pass" = dlpreopen; then
2385 if test -z "$libdir"; then
2386 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2389 # Prefer using a static library (so that no silly _DYNAMIC symbols
2390 # are required to link).
2391 if test -n "$old_library"; then
2392 newdlprefiles="$newdlprefiles $dir/$old_library"
2393 # Otherwise, use the dlname, so that lt_dlopen finds it.
2394 elif test -n "$dlname"; then
2395 newdlprefiles="$newdlprefiles $dir/$dlname"
2397 newdlprefiles="$newdlprefiles $dir/$linklib"
2399 fi # $pass = dlpreopen
2401 if test -z "$libdir"; then
2402 # Link the convenience library
2403 if test "$linkmode" = lib; then
2404 deplibs="$dir/$old_library $deplibs"
2405 elif test "$linkmode,$pass" = "prog,link"; then
2406 compile_deplibs="$dir/$old_library $compile_deplibs"
2407 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2409 deplibs="$lib $deplibs" # used for prog,scan pass
2415 if test "$linkmode" = prog && test "$pass" != link; then
2416 newlib_search_path="$newlib_search_path $ladir"
2417 deplibs="$lib $deplibs"
2420 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2421 test "$build_libtool_libs" = no; then
2426 for deplib in $dependency_libs; do
2428 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2430 # Need to link against all dependency_libs?
2431 if test "$linkalldeplibs" = yes; then
2432 deplibs="$deplib $deplibs"
2434 # Need to hardcode shared library paths
2435 # or/and link against static libraries
2436 newdependency_libs="$deplib $newdependency_libs"
2438 if test "X$duplicate_deps" = "Xyes" ; then
2439 case "$tmp_libs " in
2440 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2443 tmp_libs="$tmp_libs $deplib"
2446 fi # $linkmode = prog...
2448 if test "$linkmode,$pass" = "prog,link"; then
2449 if test -n "$library_names" &&
2450 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2451 # We need to hardcode the library path
2452 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2453 # Make sure the rpath contains only unique directories.
2454 case "$temp_rpath " in
2457 *) temp_rpath="$temp_rpath $dir" ;;
2461 # Hardcode the library path.
2462 # Skip directories that are in the system default run-time
2464 case " $sys_lib_dlsearch_path " in
2467 case "$compile_rpath " in
2469 *) compile_rpath="$compile_rpath $absdir"
2473 case " $sys_lib_dlsearch_path " in
2476 case "$finalize_rpath " in
2478 *) finalize_rpath="$finalize_rpath $libdir"
2482 fi # $linkmode,$pass = prog,link...
2484 if test "$alldeplibs" = yes &&
2485 { test "$deplibs_check_method" = pass_all ||
2486 { test "$build_libtool_libs" = yes &&
2487 test -n "$library_names"; }; }; then
2488 # We only need to search for static libraries
2493 link_static=no # Whether the deplib will be linked statically
2494 if test -n "$library_names" &&
2495 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2496 if test "$installed" = no; then
2497 notinst_deplibs="$notinst_deplibs $lib"
2500 # This is a shared library
2502 # Warn about portability, can't link against -module's on
2503 # some systems (darwin)
2504 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2506 if test "$linkmode" = prog; then
2507 $echo "*** Warning: Linking the executable $output against the loadable module"
2509 $echo "*** Warning: Linking the shared library $output against the loadable module"
2511 $echo "*** $linklib is not portable!"
2513 if test "$linkmode" = lib &&
2514 test "$hardcode_into_libs" = yes; then
2515 # Hardcode the library path.
2516 # Skip directories that are in the system default run-time
2518 case " $sys_lib_dlsearch_path " in
2521 case "$compile_rpath " in
2523 *) compile_rpath="$compile_rpath $absdir"
2527 case " $sys_lib_dlsearch_path " in
2530 case "$finalize_rpath " in
2532 *) finalize_rpath="$finalize_rpath $libdir"
2538 if test -n "$old_archive_from_expsyms_cmds"; then
2539 # figure out the soname
2540 set dummy $library_names
2543 libname=`eval \\$echo \"$libname_spec\"`
2544 # use dlname if we got it. it's perfectly good, no?
2545 if test -n "$dlname"; then
2547 elif test -n "$soname_spec"; then
2551 major=`expr $current - $age`
2555 eval soname=\"$soname_spec\"
2560 # Make a new name for the extract_expsyms_cmds to use
2562 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2563 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2565 # If the library has no export list, then create one now
2566 if test -f "$output_objdir/$soname-def"; then :
2568 $show "extracting exported symbol list from \`$soname'"
2569 save_ifs="$IFS"; IFS='~'
2570 cmds=$extract_expsyms_cmds
2571 for cmd in $cmds; do
2575 $run eval "$cmd" || exit $?
2581 if test -f "$output_objdir/$newlib"; then :; else
2582 $show "generating import library for \`$soname'"
2583 save_ifs="$IFS"; IFS='~'
2584 cmds=$old_archive_from_expsyms_cmds
2585 for cmd in $cmds; do
2589 $run eval "$cmd" || exit $?
2593 # make sure the library variables are pointing to the new library
2596 fi # test -n "$old_archive_from_expsyms_cmds"
2598 if test "$linkmode" = prog || test "$mode" != relink; then
2603 case $hardcode_action in
2604 immediate | unsupported)
2605 if test "$hardcode_direct" = no; then
2608 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2610 # if the lib is a module then we can not link against
2611 # it, someone is ignoring the new warnings I added
2612 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2613 $echo "** Warning, lib $linklib is a module, not a shared library"
2614 if test -z "$old_library" ; then
2616 $echo "** And there doesn't seem to be a static archive available"
2617 $echo "** The link will probably fail, sorry"
2619 add="$dir/$old_library"
2623 elif test "$hardcode_minus_L" = no; then
2625 *-*-sunos*) add_shlibpath="$dir" ;;
2629 elif test "$hardcode_shlibpath_var" = no; then
2630 add_shlibpath="$dir"
2637 if test "$hardcode_direct" = yes; then
2639 elif test "$hardcode_minus_L" = yes; then
2641 # Try looking first in the location we're being installed to.
2642 if test -n "$inst_prefix_dir"; then
2645 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2650 elif test "$hardcode_shlibpath_var" = yes; then
2651 add_shlibpath="$dir"
2660 if test "$lib_linked" != yes; then
2661 $echo "$modename: configuration error: unsupported hardcode properties"
2665 if test -n "$add_shlibpath"; then
2666 case :$compile_shlibpath: in
2667 *":$add_shlibpath:"*) ;;
2668 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2671 if test "$linkmode" = prog; then
2672 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2673 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2675 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2676 test -n "$add" && deplibs="$add $deplibs"
2677 if test "$hardcode_direct" != yes && \
2678 test "$hardcode_minus_L" != yes && \
2679 test "$hardcode_shlibpath_var" = yes; then
2680 case :$finalize_shlibpath: in
2682 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2688 if test "$linkmode" = prog || test "$mode" = relink; then
2692 # Finalize command for both is simple: just hardcode it.
2693 if test "$hardcode_direct" = yes; then
2694 add="$libdir/$linklib"
2695 elif test "$hardcode_minus_L" = yes; then
2698 elif test "$hardcode_shlibpath_var" = yes; then
2699 case :$finalize_shlibpath: in
2701 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2704 elif test "$hardcode_automatic" = yes; then
2705 if test -n "$inst_prefix_dir" &&
2706 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2707 add="$inst_prefix_dir$libdir/$linklib"
2709 add="$libdir/$linklib"
2712 # We cannot seem to hardcode it, guess we'll fake it.
2714 # Try looking first in the location we're being installed to.
2715 if test -n "$inst_prefix_dir"; then
2718 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2725 if test "$linkmode" = prog; then
2726 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2727 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2729 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2730 test -n "$add" && deplibs="$add $deplibs"
2733 elif test "$linkmode" = prog; then
2734 # Here we assume that one of hardcode_direct or hardcode_minus_L
2735 # is not unsupported. This is valid on all known static and
2737 if test "$hardcode_direct" != unsupported; then
2738 test -n "$old_library" && linklib="$old_library"
2739 compile_deplibs="$dir/$linklib $compile_deplibs"
2740 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2742 compile_deplibs="-l$name -L$dir $compile_deplibs"
2743 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2745 elif test "$build_libtool_libs" = yes; then
2746 # Not a shared library
2747 if test "$deplibs_check_method" != pass_all; then
2748 # We're trying link a shared library against a static one
2749 # but the system doesn't support it.
2751 # Just print a warning and add the library to dependency_libs so
2752 # that the program can be linked against the static library.
2754 $echo "*** Warning: This system can not link to static lib archive $lib."
2755 $echo "*** I have the capability to make that library automatically link in when"
2756 $echo "*** you link to this library. But I can only do this if you have a"
2757 $echo "*** shared version of the library, which you do not appear to have."
2758 if test "$module" = yes; then
2759 $echo "*** But as you try to build a module library, libtool will still create "
2760 $echo "*** a static module, that should work as long as the dlopening application"
2761 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2762 if test -z "$global_symbol_pipe"; then
2764 $echo "*** However, this would only work if libtool was able to extract symbol"
2765 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2766 $echo "*** not find such a program. So, this module is probably useless."
2767 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2769 if test "$build_old_libs" = no; then
2770 build_libtool_libs=module
2773 build_libtool_libs=no
2777 convenience="$convenience $dir/$old_library"
2778 old_convenience="$old_convenience $dir/$old_library"
2779 deplibs="$dir/$old_library $deplibs"
2782 fi # link shared/static library?
2784 if test "$linkmode" = lib; then
2785 if test -n "$dependency_libs" &&
2786 { test "$hardcode_into_libs" != yes ||
2787 test "$build_old_libs" = yes ||
2788 test "$link_static" = yes; }; then
2789 # Extract -R from dependency_libs
2791 for libdir in $dependency_libs; do
2793 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2795 *" $temp_xrpath "*) ;;
2796 *) xrpath="$xrpath $temp_xrpath";;
2798 *) temp_deplibs="$temp_deplibs $libdir";;
2801 dependency_libs="$temp_deplibs"
2804 newlib_search_path="$newlib_search_path $absdir"
2805 # Link against this library
2806 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2807 # ... and its dependency_libs
2809 for deplib in $dependency_libs; do
2810 newdependency_libs="$deplib $newdependency_libs"
2811 if test "X$duplicate_deps" = "Xyes" ; then
2812 case "$tmp_libs " in
2813 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2816 tmp_libs="$tmp_libs $deplib"
2819 if test "$link_all_deplibs" != no; then
2820 # Add the search paths of all dependency libraries
2821 for deplib in $dependency_libs; do
2823 -L*) path="$deplib" ;;
2825 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2826 test "X$dir" = "X$deplib" && dir="."
2827 # We need an absolute path.
2829 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2831 absdir=`cd "$dir" && pwd`
2832 if test -z "$absdir"; then
2833 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2838 if grep "^installed=no" $deplib > /dev/null; then
2839 path="$absdir/$objdir"
2841 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2842 if test -z "$libdir"; then
2843 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2846 if test "$absdir" != "$libdir"; then
2847 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2854 # we do not want to link against static libs,
2855 # but need to link against shared
2856 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2857 if test -n "$deplibrary_names" ; then
2858 for tmp in $deplibrary_names ; do
2861 if test -f "$path/$depdepl" ; then
2862 depdepl="$path/$depdepl"
2864 # do not add paths which are already there
2865 case " $newlib_search_path " in
2867 *) newlib_search_path="$newlib_search_path $path";;
2880 # Again, we only want to link against shared libraries
2881 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2882 for tmp in $newlib_search_path ; do
2883 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2884 eval depdepl="$tmp/lib$tmp_libs.dylib"
2895 case " $deplibs " in
2897 *) deplibs="$path $deplibs" ;;
2899 case " $deplibs " in
2901 *) deplibs="$depdepl $deplibs" ;;
2904 fi # link_all_deplibs != no
2906 done # for deplib in $libs
2907 dependency_libs="$newdependency_libs"
2908 if test "$pass" = dlpreopen; then
2909 # Link the dlpreopened libraries before other libraries
2910 for deplib in $save_deplibs; do
2911 deplibs="$deplib $deplibs"
2914 if test "$pass" != dlopen; then
2915 if test "$pass" != conv; then
2916 # Make sure lib_search_path contains only unique directories.
2918 for dir in $newlib_search_path; do
2919 case "$lib_search_path " in
2921 *) lib_search_path="$lib_search_path $dir" ;;
2927 if test "$linkmode,$pass" != "prog,link"; then
2930 vars="compile_deplibs finalize_deplibs"
2932 for var in $vars dependency_libs; do
2933 # Add libraries to $var in reverse order
2934 eval tmp_libs=\"\$$var\"
2936 for deplib in $tmp_libs; do
2937 # FIXME: Pedantically, this is the right thing to do, so
2938 # that some nasty dependency loop isn't accidentally
2940 #new_libs="$deplib $new_libs"
2941 # Pragmatically, this seems to cause very few problems in
2944 -L*) new_libs="$deplib $new_libs" ;;
2947 # And here is the reason: when a library appears more
2948 # than once as an explicit dependence of a library, or
2949 # is implicitly linked in more than once by the
2950 # compiler, it is considered special, and multiple
2951 # occurrences thereof are not removed. Compare this
2952 # with having the same library being listed as a
2953 # dependency of multiple other libraries: in this case,
2954 # we know (pedantically, we assume) the library does not
2955 # need to be listed more than once, so we keep only the
2956 # last copy. This is not always right, but it is rare
2957 # enough that we require users that really mean to play
2958 # such unportable linking tricks to link the library
2959 # using -Wl,-lname, so that libtool does not consider it
2960 # for duplicate removal.
2961 case " $specialdeplibs " in
2962 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2964 case " $new_libs " in
2966 *) new_libs="$deplib $new_libs" ;;
2974 for deplib in $new_libs; do
2977 case " $tmp_libs " in
2979 *) tmp_libs="$tmp_libs $deplib" ;;
2982 *) tmp_libs="$tmp_libs $deplib" ;;
2985 eval $var=\"$tmp_libs\"
2988 # Last step: remove runtime libs from dependency_libs
2989 # (they stay in deplibs)
2991 for i in $dependency_libs ; do
2992 case " $predeps $postdeps $compiler_lib_search_path " in
2997 if test -n "$i" ; then
2998 tmp_libs="$tmp_libs $i"
3001 dependency_libs=$tmp_libs
3003 if test "$linkmode" = prog; then
3004 dlfiles="$newdlfiles"
3005 dlprefiles="$newdlprefiles"
3010 if test -n "$deplibs"; then
3011 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3014 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3015 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3018 if test -n "$rpath"; then
3019 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3022 if test -n "$xrpath"; then
3023 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3026 if test -n "$vinfo"; then
3027 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3030 if test -n "$release"; then
3031 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3034 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3035 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3038 # Now set the variables for building old libraries.
3039 build_libtool_libs=no
3041 objs="$objs$old_deplibs"
3045 # Make sure we only generate libraries of the form `libNAME.la'.
3048 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3049 eval shared_ext=\"$shrext_cmds\"
3050 eval libname=\"$libname_spec\"
3053 if test "$module" = no; then
3054 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3058 if test "$need_lib_prefix" != no; then
3059 # Add the "lib" prefix for modules if required
3060 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3061 eval shared_ext=\"$shrext_cmds\"
3062 eval libname=\"$libname_spec\"
3064 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3069 if test -n "$objs"; then
3070 if test "$deplibs_check_method" != pass_all; then
3071 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3075 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3076 $echo "*** objects $objs is not portable!"
3077 libobjs="$libobjs $objs"
3081 if test "$dlself" != no; then
3082 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3086 if test "$#" -gt 2; then
3087 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3092 if test -z "$rpath"; then
3093 if test "$build_libtool_libs" = yes; then
3094 # Building a libtool convenience library.
3095 # Some compilers have problems with a `.al' extension so
3096 # convenience libraries should have the same extension an
3097 # archive normally would.
3098 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3099 build_libtool_libs=convenience
3103 if test -n "$vinfo"; then
3104 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3107 if test -n "$release"; then
3108 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3112 # Parse the version information argument.
3113 save_ifs="$IFS"; IFS=':'
3114 set dummy $vinfo 0 0 0
3117 if test -n "$8"; then
3118 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3123 # convert absolute version numbers to libtool ages
3124 # this retains compatibility with .la files and attempts
3125 # to make the code below a bit more comprehensible
3127 case $vinfo_number in
3131 number_revision="$4"
3133 # There are really only two kinds -- those that
3134 # use the current revision as the major version
3135 # and those that subtract age and use age as
3136 # a minor version. But, then there is irix
3137 # which has an extra 1 added just for fun
3139 case $version_type in
3140 darwin|linux|osf|windows)
3141 current=`expr $number_major + $number_minor`
3143 revision="$number_revision"
3145 freebsd-aout|freebsd-elf|sunos)
3146 current="$number_major"
3147 revision="$number_minor"
3151 current=`expr $number_major + $number_minor - 1`
3153 revision="$number_minor"
3164 # Check that each of the things are valid numbers.
3166 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]) ;;
3168 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3169 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3175 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]) ;;
3177 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3178 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3184 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]) ;;
3186 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3187 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3192 if test "$age" -gt "$current"; then
3193 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3194 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3198 # Calculate the version variables.
3202 case $version_type in
3206 # Like Linux, but with the current version available in
3207 # verstring for coding it into the library header
3208 major=.`expr $current - $age`
3209 versuffix="$major.$age.$revision"
3210 # Darwin ld doesn't like 0 for these options...
3211 minor_current=`expr $current + 1`
3212 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3217 versuffix=".$current.$revision";
3222 versuffix=".$current";
3226 major=`expr $current - $age + 1`
3228 case $version_type in
3229 nonstopux) verstring_prefix=nonstopux ;;
3230 *) verstring_prefix=sgi ;;
3232 verstring="$verstring_prefix$major.$revision"
3234 # Add in all the interfaces that we are compatible with.
3236 while test "$loop" -ne 0; do
3237 iface=`expr $revision - $loop`
3238 loop=`expr $loop - 1`
3239 verstring="$verstring_prefix$major.$iface:$verstring"
3242 # Before this point, $major must not contain `.'.
3244 versuffix="$major.$revision"
3248 major=.`expr $current - $age`
3249 versuffix="$major.$age.$revision"
3253 major=.`expr $current - $age`
3254 versuffix=".$current.$age.$revision"
3255 verstring="$current.$age.$revision"
3257 # Add in all the interfaces that we are compatible with.
3259 while test "$loop" -ne 0; do
3260 iface=`expr $current - $loop`
3261 loop=`expr $loop - 1`
3262 verstring="$verstring:${iface}.0"
3265 # Make executables depend on our current version.
3266 verstring="$verstring:${current}.0"
3271 versuffix=".$current.$revision"
3275 # Use '-' rather than '.', since we only want one
3276 # extension on DOS 8.3 filesystems.
3277 major=`expr $current - $age`
3282 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3283 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3288 # Clear the version info if we defaulted, and they specified a release.
3289 if test -z "$vinfo" && test -n "$release"; then
3291 case $version_type in
3293 # we can't check for "0.0" in archive_cmds due to quoting
3294 # problems, so we reset it completely
3301 if test "$need_version" = no; then
3308 # Remove version info from name if versioning should be avoided
3309 if test "$avoid_version" = yes && test "$need_version" = no; then
3315 # Check to see if the archive will have undefined symbols.
3316 if test "$allow_undefined" = yes; then
3317 if test "$allow_undefined_flag" = unsupported; then
3318 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3319 build_libtool_libs=no
3323 # Don't allow undefined symbols.
3324 allow_undefined_flag="$no_undefined_flag"
3328 if test "$mode" != relink; then
3329 # Remove our outputs, but don't remove object files since they
3330 # may have been created when compiling PIC objects.
3332 tempremovelist=`$echo "$output_objdir/*"`
3333 for p in $tempremovelist; do
3337 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3338 if test "X$precious_files_regex" != "X"; then
3339 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3344 removelist="$removelist $p"
3349 if test -n "$removelist"; then
3350 $show "${rm}r $removelist"
3351 $run ${rm}r $removelist
3355 # Now set the variables for building old libraries.
3356 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3357 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3359 # Transform .lo files to .o files.
3360 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3363 # Eliminate all temporary directories.
3364 for path in $notinst_path; do
3365 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3366 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3367 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3370 if test -n "$xrpath"; then
3371 # If the user specified any rpath flags, then add them.
3373 for libdir in $xrpath; do
3374 temp_xrpath="$temp_xrpath -R$libdir"
3375 case "$finalize_rpath " in
3377 *) finalize_rpath="$finalize_rpath $libdir" ;;
3380 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3381 dependency_libs="$temp_xrpath $dependency_libs"
3385 # Make sure dlfiles contains only unique files that won't be dlpreopened
3386 old_dlfiles="$dlfiles"
3388 for lib in $old_dlfiles; do
3389 case " $dlprefiles $dlfiles " in
3391 *) dlfiles="$dlfiles $lib" ;;
3395 # Make sure dlprefiles contains only unique files
3396 old_dlprefiles="$dlprefiles"
3398 for lib in $old_dlprefiles; do
3399 case "$dlprefiles " in
3401 *) dlprefiles="$dlprefiles $lib" ;;
3405 if test "$build_libtool_libs" = yes; then
3406 if test -n "$rpath"; then
3408 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3409 # these systems don't actually have a c library (as such)!
3411 *-*-rhapsody* | *-*-darwin1.[012])
3412 # Rhapsody C library is in the System framework
3413 deplibs="$deplibs -framework System"
3416 # Don't link with libc until the a.out ld.so is fixed.
3418 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3419 # Do not include libc due to us having libc/libc_r.
3420 test "X$arg" = "X-lc" && continue
3423 # Add libc to deplibs on all other systems if necessary.
3424 if test "$build_libtool_need_lc" = "yes"; then
3425 deplibs="$deplibs -lc"
3431 # Transform deplibs into only deplibs that can be linked in shared.
3433 libname_save=$libname
3434 release_save=$release
3435 versuffix_save=$versuffix
3437 # I'm not sure if I'm treating the release correctly. I think
3438 # release should show up in the -l (ie -lgmp5) so we don't want to
3439 # add it in twice. Is that correct?
3445 case $deplibs_check_method in
3447 # Don't check for shared/static. Everything works.
3448 # This might be a little naive. We might want to check
3449 # whether the library exists or not. But this is on
3450 # osf3 & osf4 and I'm not really sure... Just
3451 # implementing what was already the behavior.
3455 # This code stresses the "libraries are programs" paradigm to its
3456 # limits. Maybe even breaks it. We compile a program, linking it
3457 # against the deplibs as a proxy for the library. Then we can check
3458 # whether they linked in statically or dynamically with ldd.
3460 cat > conftest.c <<EOF
3461 int main() { return 0; }
3464 $LTCC -o conftest conftest.c $deplibs
3465 if test "$?" -eq 0 ; then
3466 ldd_output=`ldd conftest`
3467 for i in $deplibs; do
3468 name="`expr $i : '-l\(.*\)'`"
3469 # If $name is empty we are operating on a -L argument.
3470 if test "$name" != "" && test "$name" -ne "0"; then
3471 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3472 case " $predeps $postdeps " in
3474 newdeplibs="$newdeplibs $i"
3479 if test -n "$i" ; then
3480 libname=`eval \\$echo \"$libname_spec\"`
3481 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3482 set dummy $deplib_matches
3484 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3485 newdeplibs="$newdeplibs $i"
3489 $echo "*** Warning: dynamic linker does not accept needed library $i."
3490 $echo "*** I have the capability to make that library automatically link in when"
3491 $echo "*** you link to this library. But I can only do this if you have a"
3492 $echo "*** shared version of the library, which I believe you do not have"
3493 $echo "*** because a test_compile did reveal that the linker did not use it for"
3494 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3498 newdeplibs="$newdeplibs $i"
3502 # Error occurred in the first compile. Let's try to salvage
3503 # the situation: Compile a separate program for each library.
3504 for i in $deplibs; do
3505 name="`expr $i : '-l\(.*\)'`"
3506 # If $name is empty we are operating on a -L argument.
3507 if test "$name" != "" && test "$name" != "0"; then
3509 $LTCC -o conftest conftest.c $i
3511 if test "$?" -eq 0 ; then
3512 ldd_output=`ldd conftest`
3513 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3514 case " $predeps $postdeps " in
3516 newdeplibs="$newdeplibs $i"
3521 if test -n "$i" ; then
3522 libname=`eval \\$echo \"$libname_spec\"`
3523 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3524 set dummy $deplib_matches
3526 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3527 newdeplibs="$newdeplibs $i"
3531 $echo "*** Warning: dynamic linker does not accept needed library $i."
3532 $echo "*** I have the capability to make that library automatically link in when"
3533 $echo "*** you link to this library. But I can only do this if you have a"
3534 $echo "*** shared version of the library, which you do not appear to have"
3535 $echo "*** because a test_compile did reveal that the linker did not use this one"
3536 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3542 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3543 $echo "*** make it link in! You will probably need to install it or some"
3544 $echo "*** library that it depends on before this library will be fully"
3545 $echo "*** functional. Installing it before continuing would be even better."
3548 newdeplibs="$newdeplibs $i"
3554 set dummy $deplibs_check_method
3555 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3556 for a_deplib in $deplibs; do
3557 name="`expr $a_deplib : '-l\(.*\)'`"
3558 # If $name is empty we are operating on a -L argument.
3559 if test "$name" != "" && test "$name" != "0"; then
3560 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3561 case " $predeps $postdeps " in
3563 newdeplibs="$newdeplibs $a_deplib"
3568 if test -n "$a_deplib" ; then
3569 libname=`eval \\$echo \"$libname_spec\"`
3570 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3571 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3572 for potent_lib in $potential_libs; do
3573 # Follow soft links.
3574 if ls -lLd "$potent_lib" 2>/dev/null \
3575 | grep " -> " >/dev/null; then
3578 # The statement above tries to avoid entering an
3579 # endless loop below, in case of cyclic links.
3580 # We might still enter an endless loop, since a link
3581 # loop can be closed while we follow links,
3583 potlib="$potent_lib"
3584 while test -h "$potlib" 2>/dev/null; do
3585 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3587 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3588 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3591 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3593 | $EGREP "$file_magic_regex" > /dev/null; then
3594 newdeplibs="$newdeplibs $a_deplib"
3601 if test -n "$a_deplib" ; then
3604 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3605 $echo "*** I have the capability to make that library automatically link in when"
3606 $echo "*** you link to this library. But I can only do this if you have a"
3607 $echo "*** shared version of the library, which you do not appear to have"
3608 $echo "*** because I did check the linker path looking for a file starting"
3609 if test -z "$potlib" ; then
3610 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3612 $echo "*** with $libname and none of the candidates passed a file format test"
3613 $echo "*** using a file magic. Last file checked: $potlib"
3617 # Add a -L argument.
3618 newdeplibs="$newdeplibs $a_deplib"
3620 done # Gone through all deplibs.
3623 set dummy $deplibs_check_method
3624 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3625 for a_deplib in $deplibs; do
3626 name="`expr $a_deplib : '-l\(.*\)'`"
3627 # If $name is empty we are operating on a -L argument.
3628 if test -n "$name" && test "$name" != "0"; then
3629 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3630 case " $predeps $postdeps " in
3632 newdeplibs="$newdeplibs $a_deplib"
3637 if test -n "$a_deplib" ; then
3638 libname=`eval \\$echo \"$libname_spec\"`
3639 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3640 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3641 for potent_lib in $potential_libs; do
3642 potlib="$potent_lib" # see symlink-check above in file_magic test
3643 if eval $echo \"$potent_lib\" 2>/dev/null \
3645 | $EGREP "$match_pattern_regex" > /dev/null; then
3646 newdeplibs="$newdeplibs $a_deplib"
3653 if test -n "$a_deplib" ; then
3656 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3657 $echo "*** I have the capability to make that library automatically link in when"
3658 $echo "*** you link to this library. But I can only do this if you have a"
3659 $echo "*** shared version of the library, which you do not appear to have"
3660 $echo "*** because I did check the linker path looking for a file starting"
3661 if test -z "$potlib" ; then
3662 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3664 $echo "*** with $libname and none of the candidates passed a file format test"
3665 $echo "*** using a regex pattern. Last file checked: $potlib"
3669 # Add a -L argument.
3670 newdeplibs="$newdeplibs $a_deplib"
3672 done # Gone through all deplibs.
3676 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3677 -e 's/ -[LR][^ ]*//g'`
3678 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3679 for i in $predeps $postdeps ; do
3680 # can't use Xsed below, because $i might contain '/'
3681 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3684 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3685 | grep . >/dev/null; then
3687 if test "X$deplibs_check_method" = "Xnone"; then
3688 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3690 $echo "*** Warning: inter-library dependencies are not known to be supported."
3692 $echo "*** All declared inter-library dependencies are being dropped."
3697 versuffix=$versuffix_save
3699 release=$release_save
3700 libname=$libname_save
3704 *-*-rhapsody* | *-*-darwin1.[012])
3705 # On Rhapsody replace the C library is the System framework
3706 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3710 if test "$droppeddeps" = yes; then
3711 if test "$module" = yes; then
3713 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3714 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3715 $echo "*** a static module, that should work as long as the dlopening"
3716 $echo "*** application is linked with the -dlopen flag."
3717 if test -z "$global_symbol_pipe"; then
3719 $echo "*** However, this would only work if libtool was able to extract symbol"
3720 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3721 $echo "*** not find such a program. So, this module is probably useless."
3722 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3724 if test "$build_old_libs" = no; then
3725 oldlibs="$output_objdir/$libname.$libext"
3726 build_libtool_libs=module
3729 build_libtool_libs=no
3732 $echo "*** The inter-library dependencies that have been dropped here will be"
3733 $echo "*** automatically added whenever a program is linked with this library"
3734 $echo "*** or is declared to -dlopen it."
3736 if test "$allow_undefined" = no; then
3738 $echo "*** Since this library must not contain undefined symbols,"
3739 $echo "*** because either the platform does not support them or"
3740 $echo "*** it was explicitly requested with -no-undefined,"
3741 $echo "*** libtool will only create a static version of it."
3742 if test "$build_old_libs" = no; then
3743 oldlibs="$output_objdir/$libname.$libext"
3744 build_libtool_libs=module
3747 build_libtool_libs=no
3752 # Done checking deplibs!
3756 # All the library-specific variables (install_libdir is set above).
3761 # Test again, we may have decided not to build it any more
3762 if test "$build_libtool_libs" = yes; then
3763 if test "$hardcode_into_libs" = yes; then
3764 # Hardcode the library paths
3767 rpath="$finalize_rpath"
3768 test "$mode" != relink && rpath="$compile_rpath$rpath"
3769 for libdir in $rpath; do
3770 if test -n "$hardcode_libdir_flag_spec"; then
3771 if test -n "$hardcode_libdir_separator"; then
3772 if test -z "$hardcode_libdirs"; then
3773 hardcode_libdirs="$libdir"
3775 # Just accumulate the unique libdirs.
3776 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3777 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3780 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3785 eval flag=\"$hardcode_libdir_flag_spec\"
3786 dep_rpath="$dep_rpath $flag"
3788 elif test -n "$runpath_var"; then
3789 case "$perm_rpath " in
3791 *) perm_rpath="$perm_rpath $libdir" ;;
3795 # Substitute the hardcoded libdirs into the rpath.
3796 if test -n "$hardcode_libdir_separator" &&
3797 test -n "$hardcode_libdirs"; then
3798 libdir="$hardcode_libdirs"
3799 if test -n "$hardcode_libdir_flag_spec_ld"; then
3800 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3802 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3805 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3806 # We should set the runpath_var.
3808 for dir in $perm_rpath; do
3811 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3813 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3816 shlibpath="$finalize_shlibpath"
3817 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3818 if test -n "$shlibpath"; then
3819 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3822 # Get the real and link names of the library.
3823 eval shared_ext=\"$shrext_cmds\"
3824 eval library_names=\"$library_names_spec\"
3825 set dummy $library_names
3829 if test -n "$soname_spec"; then
3830 eval soname=\"$soname_spec\"
3834 if test -z "$dlname"; then
3838 lib="$output_objdir/$realname"
3841 linknames="$linknames $link"
3844 # Use standard objects if they are pic
3845 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3847 # Prepare the list of exported symbols
3848 if test -z "$export_symbols"; then
3849 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3850 $show "generating symbol list for \`$libname.la'"
3851 export_symbols="$output_objdir/$libname.exp"
3852 $run $rm $export_symbols
3853 cmds=$export_symbols_cmds
3854 save_ifs="$IFS"; IFS='~'
3855 for cmd in $cmds; do
3858 if len=`expr "X$cmd" : ".*"` &&
3859 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3861 $run eval "$cmd" || exit $?
3862 skipped_export=false
3864 # The command line is too long to execute in one step.
3865 $show "using reloadable object file for export list..."
3870 if test -n "$export_symbols_regex"; then
3871 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3872 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3873 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3874 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3879 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3880 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3884 for test_deplib in $deplibs; do
3885 case " $convenience " in
3886 *" $test_deplib "*) ;;
3888 tmp_deplibs="$tmp_deplibs $test_deplib"
3892 deplibs="$tmp_deplibs"
3894 if test -n "$convenience"; then
3895 if test -n "$whole_archive_flag_spec"; then
3896 save_libobjs=$libobjs
3897 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3899 gentop="$output_objdir/${outputname}x"
3900 generated="$generated $gentop"
3902 func_extract_archives $gentop $convenience
3903 libobjs="$libobjs $func_extract_archives_result"
3907 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3908 eval flag=\"$thread_safe_flag_spec\"
3909 linker_flags="$linker_flags $flag"
3912 # Make a backup of the uninstalled library when relinking
3913 if test "$mode" = relink; then
3914 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3917 # Do each of the archive commands.
3918 if test "$module" = yes && test -n "$module_cmds" ; then
3919 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3920 eval test_cmds=\"$module_expsym_cmds\"
3921 cmds=$module_expsym_cmds
3923 eval test_cmds=\"$module_cmds\"
3927 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3928 eval test_cmds=\"$archive_expsym_cmds\"
3929 cmds=$archive_expsym_cmds
3931 eval test_cmds=\"$archive_cmds\"
3936 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3937 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3940 # The command line is too long to link in one step, link piecewise.
3941 $echo "creating reloadable object files..."
3943 # Save the value of $output and $libobjs because we want to
3944 # use them later. If we have whole_archive_flag_spec, we
3945 # want to use save_libobjs as it was before
3946 # whole_archive_flag_spec was expanded, because we can't
3947 # assume the linker understands whole_archive_flag_spec.
3948 # This may have to be revisited, in case too many
3949 # convenience libraries get linked in and end up exceeding
3951 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3952 save_libobjs=$libobjs
3955 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3957 # Clear the reloadable object creation command queue and
3958 # initialize k to one.
3965 output=$output_objdir/$output_la-${k}.$objext
3966 # Loop over the list of objects to be linked.
3967 for obj in $save_libobjs
3969 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3970 if test "X$objlist" = X ||
3971 { len=`expr "X$test_cmds" : ".*"` &&
3972 test "$len" -le "$max_cmd_len"; }; then
3973 objlist="$objlist $obj"
3975 # The command $test_cmds is almost too long, add a
3976 # command to the queue.
3977 if test "$k" -eq 1 ; then
3978 # The first file doesn't have a previous command to add.
3979 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3981 # All subsequent reloadable object files will link in
3982 # the last one created.
3983 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3985 last_robj=$output_objdir/$output_la-${k}.$objext
3987 output=$output_objdir/$output_la-${k}.$objext
3992 # Handle the remaining objects by creating one last
3993 # reloadable object file. All subsequent reloadable object
3994 # files will link in the last one created.
3995 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3996 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3998 if ${skipped_export-false}; then
3999 $show "generating symbol list for \`$libname.la'"
4000 export_symbols="$output_objdir/$libname.exp"
4001 $run $rm $export_symbols
4003 # Append the command to create the export file.
4004 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4007 # Set up a command to remove the reloadable object files
4008 # after they are used.
4010 while test "$i" -lt "$k"
4013 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4016 $echo "creating a temporary reloadable object file: $output"
4018 # Loop through the commands generated above and execute them.
4019 save_ifs="$IFS"; IFS='~'
4020 for cmd in $concat_cmds; do
4023 $run eval "$cmd" || exit $?
4028 # Restore the value of output.
4031 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4032 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4034 # Expand the library linking commands again to reset the
4035 # value of $libobjs for piecewise linking.
4037 # Do each of the archive commands.
4038 if test "$module" = yes && test -n "$module_cmds" ; then
4039 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4040 cmds=$module_expsym_cmds
4045 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4046 cmds=$archive_expsym_cmds
4052 # Append the command to remove the reloadable object files
4053 # to the just-reset $cmds.
4054 eval cmds=\"\$cmds~\$rm $delfiles\"
4056 save_ifs="$IFS"; IFS='~'
4057 for cmd in $cmds; do
4061 $run eval "$cmd" || exit $?
4065 # Restore the uninstalled library and exit
4066 if test "$mode" = relink; then
4067 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4071 # Create links to the real library.
4072 for linkname in $linknames; do
4073 if test "$realname" != "$linkname"; then
4074 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4075 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4079 # If -module or -export-dynamic was specified, set the dlname.
4080 if test "$module" = yes || test "$export_dynamic" = yes; then
4081 # On all known operating systems, these are identical.
4088 if test -n "$deplibs"; then
4089 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4092 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4093 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4096 if test -n "$rpath"; then
4097 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4100 if test -n "$xrpath"; then
4101 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4104 if test -n "$vinfo"; then
4105 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4108 if test -n "$release"; then
4109 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4114 if test -n "$objs$old_deplibs"; then
4115 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4119 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4127 # Delete the old objects.
4128 $run $rm $obj $libobj
4130 # Objects from convenience libraries. This assumes
4131 # single-version convenience libraries. Whenever we create
4132 # different ones for PIC/non-PIC, this we'll have to duplicate
4136 # reload_cmds runs $LD directly, so let us get rid of
4137 # -Wl from whole_archive_flag_spec
4140 if test -n "$convenience"; then
4141 if test -n "$whole_archive_flag_spec"; then
4142 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4144 gentop="$output_objdir/${obj}x"
4145 generated="$generated $gentop"
4147 func_extract_archives $gentop $convenience
4148 reload_conv_objs="$reload_objs $func_extract_archives_result"
4152 # Create the old-style object.
4153 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
4157 save_ifs="$IFS"; IFS='~'
4158 for cmd in $cmds; do
4162 $run eval "$cmd" || exit $?
4166 # Exit if we aren't doing a library object file.
4167 if test -z "$libobj"; then
4168 if test -n "$gentop"; then
4169 $show "${rm}r $gentop"
4176 if test "$build_libtool_libs" != yes; then
4177 if test -n "$gentop"; then
4178 $show "${rm}r $gentop"
4182 # Create an invalid libtool object if no PIC, so that we don't
4183 # accidentally link it into a program.
4184 # $show "echo timestamp > $libobj"
4185 # $run eval "echo timestamp > $libobj" || exit $?
4189 if test -n "$pic_flag" || test "$pic_mode" != default; then
4190 # Only do commands if we really have different PIC objects.
4191 reload_objs="$libobjs $reload_conv_objs"
4194 save_ifs="$IFS"; IFS='~'
4195 for cmd in $cmds; do
4199 $run eval "$cmd" || exit $?
4204 if test -n "$gentop"; then
4205 $show "${rm}r $gentop"
4214 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4216 if test -n "$vinfo"; then
4217 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4220 if test -n "$release"; then
4221 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4224 if test "$preload" = yes; then
4225 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4226 test "$dlopen_self_static" = unknown; then
4227 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4232 *-*-rhapsody* | *-*-darwin1.[012])
4233 # On Rhapsody replace the C library is the System framework
4234 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4235 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4241 # Don't allow lazy linking, it breaks C++ global constructors
4242 if test "$tagname" = CXX ; then
4243 compile_command="$compile_command ${wl}-bind_at_load"
4244 finalize_command="$finalize_command ${wl}-bind_at_load"
4249 compile_command="$compile_command $compile_deplibs"
4250 finalize_command="$finalize_command $finalize_deplibs"
4252 if test -n "$rpath$xrpath"; then
4253 # If the user specified any rpath flags, then add them.
4254 for libdir in $rpath $xrpath; do
4255 # This is the magic to use -rpath.
4256 case "$finalize_rpath " in
4258 *) finalize_rpath="$finalize_rpath $libdir" ;;
4263 # Now hardcode the library paths
4266 for libdir in $compile_rpath $finalize_rpath; do
4267 if test -n "$hardcode_libdir_flag_spec"; then
4268 if test -n "$hardcode_libdir_separator"; then
4269 if test -z "$hardcode_libdirs"; then
4270 hardcode_libdirs="$libdir"
4272 # Just accumulate the unique libdirs.
4273 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4274 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4277 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4282 eval flag=\"$hardcode_libdir_flag_spec\"
4283 rpath="$rpath $flag"
4285 elif test -n "$runpath_var"; then
4286 case "$perm_rpath " in
4288 *) perm_rpath="$perm_rpath $libdir" ;;
4292 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4293 case :$dllsearchpath: in
4295 *) dllsearchpath="$dllsearchpath:$libdir";;
4300 # Substitute the hardcoded libdirs into the rpath.
4301 if test -n "$hardcode_libdir_separator" &&
4302 test -n "$hardcode_libdirs"; then
4303 libdir="$hardcode_libdirs"
4304 eval rpath=\" $hardcode_libdir_flag_spec\"
4306 compile_rpath="$rpath"
4310 for libdir in $finalize_rpath; do
4311 if test -n "$hardcode_libdir_flag_spec"; then
4312 if test -n "$hardcode_libdir_separator"; then
4313 if test -z "$hardcode_libdirs"; then
4314 hardcode_libdirs="$libdir"
4316 # Just accumulate the unique libdirs.
4317 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4318 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4321 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4326 eval flag=\"$hardcode_libdir_flag_spec\"
4327 rpath="$rpath $flag"
4329 elif test -n "$runpath_var"; then
4330 case "$finalize_perm_rpath " in
4332 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4336 # Substitute the hardcoded libdirs into the rpath.
4337 if test -n "$hardcode_libdir_separator" &&
4338 test -n "$hardcode_libdirs"; then
4339 libdir="$hardcode_libdirs"
4340 eval rpath=\" $hardcode_libdir_flag_spec\"
4342 finalize_rpath="$rpath"
4344 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4345 # Transform all the library objects into standard objects.
4346 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4347 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4351 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4352 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4353 dlsyms="${outputname}S.c"
4355 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4359 if test -n "$dlsyms"; then
4363 # Discover the nlist of each of the dlfiles.
4364 nlist="$output_objdir/${outputname}.nm"
4366 $show "$rm $nlist ${nlist}S ${nlist}T"
4367 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4369 # Parse the name list into a source file.
4370 $show "creating $output_objdir/$dlsyms"
4372 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4373 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4374 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4380 /* Prevent the only kind of declaration conflicts we can make. */
4381 #define lt_preloaded_symbols some_other_symbol
4383 /* External symbol declarations for the compiler. */\
4386 if test "$dlself" = yes; then
4387 $show "generating symbol list for \`$output'"
4389 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4391 # Add our own program objects to the symbol list.
4392 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4393 for arg in $progfiles; do
4394 $show "extracting global C symbols from \`$arg'"
4395 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4398 if test -n "$exclude_expsyms"; then
4399 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4400 $run eval '$mv "$nlist"T "$nlist"'
4403 if test -n "$export_symbols_regex"; then
4404 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4405 $run eval '$mv "$nlist"T "$nlist"'
4408 # Prepare the list of exported symbols
4409 if test -z "$export_symbols"; then
4410 export_symbols="$output_objdir/$outputname.exp"
4411 $run $rm $export_symbols
4412 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4414 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4415 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4416 $run eval 'mv "$nlist"T "$nlist"'
4420 for arg in $dlprefiles; do
4421 $show "extracting global C symbols from \`$arg'"
4422 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4423 $run eval '$echo ": $name " >> "$nlist"'
4424 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4427 if test -z "$run"; then
4428 # Make sure we have at least an empty file.
4429 test -f "$nlist" || : > "$nlist"
4431 if test -n "$exclude_expsyms"; then
4432 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4433 $mv "$nlist"T "$nlist"
4436 # Try sorting and uniquifying the output.
4437 if grep -v "^: " < "$nlist" |
4438 if sort -k 3 </dev/null >/dev/null 2>&1; then
4443 uniq > "$nlist"S; then
4446 grep -v "^: " < "$nlist" > "$nlist"S
4449 if test -f "$nlist"S; then
4450 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4452 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4455 $echo >> "$output_objdir/$dlsyms" "\
4457 #undef lt_preloaded_symbols
4459 #if defined (__STDC__) && __STDC__
4460 # define lt_ptr void *
4462 # define lt_ptr char *
4466 /* The mapping between symbol names and symbols. */
4470 *cygwin* | *mingw* )
4471 $echo >> "$output_objdir/$dlsyms" "\
4472 /* DATA imports from DLLs on WIN32 can't be const, because
4473 runtime relocations are performed -- see ld's documentation
4479 $echo >> "$output_objdir/$dlsyms" "\
4486 $echo >> "$output_objdir/$dlsyms" "\
4490 lt_preloaded_symbols[] =
4494 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4496 $echo >> "$output_objdir/$dlsyms" "\
4500 /* This works around a problem in FreeBSD linker */
4501 #ifdef FREEBSD_WORKAROUND
4502 static const void *lt_preloaded_setup() {
4503 return lt_preloaded_symbols;
4513 pic_flag_for_symtable=
4515 # compiling the symbol table file with pic_flag works around
4516 # a FreeBSD bug that causes programs to crash when -lm is
4517 # linked before any other PIC object. But we must not use
4518 # pic_flag when linking with -static. The problem exists in
4519 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4520 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4521 case "$compile_command " in
4523 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4526 case "$compile_command " in
4528 *) pic_flag_for_symtable=" $pic_flag";;
4532 # Now compile the dynamic symbol file.
4533 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4534 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4536 # Clean up the generated files.
4537 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4538 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4540 # Transform the symbol file into the correct name.
4541 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4542 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4545 # FreeBSD doesn't need this...
4548 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4553 # We keep going just in case the user didn't refer to
4554 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4555 # really was required.
4557 # Nullify the symbol file.
4558 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4559 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4562 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4563 # Replace the output file specification.
4564 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4565 link_command="$compile_command$compile_rpath"
4567 # We have no uninstalled library dependencies, so finalize right now.
4568 $show "$link_command"
4569 $run eval "$link_command"
4572 # Delete the generated files.
4573 if test -n "$dlsyms"; then
4574 $show "$rm $output_objdir/${outputname}S.${objext}"
4575 $run $rm "$output_objdir/${outputname}S.${objext}"
4581 if test -n "$shlibpath_var"; then
4582 # We should set the shlibpath_var
4584 for dir in $temp_rpath; do
4586 [\\/]* | [A-Za-z]:[\\/]*)
4591 # Relative path: add a thisdir entry.
4592 rpath="$rpath\$thisdir/$dir:"
4599 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4600 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4602 if test -n "$finalize_shlibpath"; then
4603 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4608 if test -n "$runpath_var"; then
4609 if test -n "$perm_rpath"; then
4610 # We should set the runpath_var.
4612 for dir in $perm_rpath; do
4615 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4617 if test -n "$finalize_perm_rpath"; then
4618 # We should set the runpath_var.
4620 for dir in $finalize_perm_rpath; do
4623 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4627 if test "$no_install" = yes; then
4628 # We don't need to create a wrapper script.
4629 link_command="$compile_var$compile_command$compile_rpath"
4630 # Replace the output file specification.
4631 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4632 # Delete the old output file.
4634 # Link the executable and exit
4635 $show "$link_command"
4636 $run eval "$link_command" || exit $?
4640 if test "$hardcode_action" = relink; then
4641 # Fast installation is not supported
4642 link_command="$compile_var$compile_command$compile_rpath"
4643 relink_command="$finalize_var$finalize_command$finalize_rpath"
4645 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4646 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4648 if test "$fast_install" != no; then
4649 link_command="$finalize_var$compile_command$finalize_rpath"
4650 if test "$fast_install" = yes; then
4651 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4653 # fast_install is set to needless
4657 link_command="$compile_var$compile_command$compile_rpath"
4658 relink_command="$finalize_var$finalize_command$finalize_rpath"
4662 # Replace the output file specification.
4663 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4665 # Delete the old output files.
4666 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4668 $show "$link_command"
4669 $run eval "$link_command" || exit $?
4671 # Now create the wrapper script.
4672 $show "creating $output"
4674 # Quote the relink command for shipping.
4675 if test -n "$relink_command"; then
4676 # Preserve any variables that may affect compiler behavior
4677 for var in $variables_saved_for_relink; do
4678 if eval test -z \"\${$var+set}\"; then
4679 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4680 elif eval var_value=\$$var; test -z "$var_value"; then
4681 relink_command="$var=; export $var; $relink_command"
4683 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4684 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4687 relink_command="(cd `pwd`; $relink_command)"
4688 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4691 # Quote $echo for shipping.
4692 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4694 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4695 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4697 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4699 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4702 # Only actually do things if our run command is non-null.
4703 if test -z "$run"; then
4704 # win32 will think the script is a binary if it has
4705 # a .exe suffix, so we strip it off here.
4707 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4709 # test for cygwin because mv fails w/o .exe extensions
4713 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4717 *cygwin* | *mingw* )
4718 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4719 cwrapper=`$echo ${output}.exe`
4720 $rm $cwrappersource $cwrapper
4721 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4723 cat > $cwrappersource <<EOF
4725 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4726 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4728 The $output program cannot be directly executed until all the libtool
4729 libraries that it depends on are installed.
4731 This wrapper executable should never be moved out of the build directory.
4732 If it is, it will not operate correctly.
4734 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4735 but could eventually absorb all of the scripts functionality and
4736 exec $objdir/$outputname directly.
4739 cat >> $cwrappersource<<"EOF"
4747 #if defined(PATH_MAX)
4748 # define LT_PATHMAX PATH_MAX
4749 #elif defined(MAXPATHLEN)
4750 # define LT_PATHMAX MAXPATHLEN
4752 # define LT_PATHMAX 1024
4755 #ifndef DIR_SEPARATOR
4756 #define DIR_SEPARATOR '/'
4759 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4761 #define HAVE_DOS_BASED_FILE_SYSTEM
4762 #ifndef DIR_SEPARATOR_2
4763 #define DIR_SEPARATOR_2 '\\'
4767 #ifndef DIR_SEPARATOR_2
4768 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4769 #else /* DIR_SEPARATOR_2 */
4770 # define IS_DIR_SEPARATOR(ch) \
4771 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4772 #endif /* DIR_SEPARATOR_2 */
4774 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4775 #define XFREE(stale) do { \
4776 if (stale) { free ((void *) stale); stale = 0; } \
4779 const char *program_name = NULL;
4781 void * xmalloc (size_t num);
4782 char * xstrdup (const char *string);
4783 char * basename (const char *name);
4784 char * fnqualify(const char *path);
4785 char * strendzap(char *str, const char *pat);
4786 void lt_fatal (const char *message, ...);
4789 main (int argc, char *argv[])
4794 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4795 newargz = XMALLOC(char *, argc+2);
4798 cat >> $cwrappersource <<EOF
4799 newargz[0] = "$SHELL";
4802 cat >> $cwrappersource <<"EOF"
4803 newargz[1] = fnqualify(argv[0]);
4804 /* we know the script has the same name, without the .exe */
4805 /* so make sure newargz[1] doesn't end in .exe */
4806 strendzap(newargz[1],".exe");
4807 for (i = 1; i < argc; i++)
4808 newargz[i+1] = xstrdup(argv[i]);
4809 newargz[argc+1] = NULL;
4812 cat >> $cwrappersource <<EOF
4813 execv("$SHELL",newargz);
4816 cat >> $cwrappersource <<"EOF"
4820 xmalloc (size_t num)
4822 void * p = (void *) malloc (num);
4824 lt_fatal ("Memory exhausted");
4830 xstrdup (const char *string)
4832 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4837 basename (const char *name)
4841 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4842 /* Skip over the disk name in MSDOS pathnames. */
4843 if (isalpha (name[0]) && name[1] == ':')
4847 for (base = name; *name; name++)
4848 if (IS_DIR_SEPARATOR (*name))
4850 return (char *) base;
4854 fnqualify(const char *path)
4858 char tmp[LT_PATHMAX + 1];
4860 assert(path != NULL);
4862 /* Is it qualified already? */
4863 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4864 if (isalpha (path[0]) && path[1] == ':')
4865 return xstrdup (path);
4867 if (IS_DIR_SEPARATOR (path[0]))
4868 return xstrdup (path);
4870 /* prepend the current directory */
4871 /* doesn't handle '~' */
4872 if (getcwd (tmp, LT_PATHMAX) == NULL)
4873 lt_fatal ("getcwd failed");
4874 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4875 p = XMALLOC(char, size);
4876 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4881 strendzap(char *str, const char *pat)
4885 assert(str != NULL);
4886 assert(pat != NULL);
4889 patlen = strlen(pat);
4893 str += len - patlen;
4894 if (strcmp(str, pat) == 0)
4901 lt_error_core (int exit_status, const char * mode,
4902 const char * message, va_list ap)
4904 fprintf (stderr, "%s: %s: ", program_name, mode);
4905 vfprintf (stderr, message, ap);
4906 fprintf (stderr, ".\n");
4908 if (exit_status >= 0)
4913 lt_fatal (const char *message, ...)
4916 va_start (ap, message);
4917 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4921 # we should really use a build-platform specific compiler
4922 # here, but OTOH, the wrappers (shell script and this C one)
4923 # are only useful if you want to execute the "real" binary.
4924 # Since the "real" binary is built for $host, then this
4925 # wrapper might as well be built for $host, too.
4926 $run $LTCC -s -o $cwrapper $cwrappersource
4930 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4935 # $output - temporary wrapper script for $objdir/$outputname
4936 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4938 # The $output program cannot be directly executed until all the libtool
4939 # libraries that it depends on are installed.
4941 # This wrapper script should never be moved out of the build directory.
4942 # If it is, it will not operate correctly.
4944 # Sed substitution that helps us do robust quoting. It backslashifies
4945 # metacharacters that are still active within double-quoted strings.
4946 Xsed='${SED} -e 1s/^X//'
4947 sed_quote_subst='$sed_quote_subst'
4949 # The HP-UX ksh and POSIX shell print the target directory to stdout
4951 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4953 relink_command=\"$relink_command\"
4955 # This environment variable determines our operation mode.
4956 if test \"\$libtool_install_magic\" = \"$magic\"; then
4957 # install mode needs the following variable:
4958 notinst_deplibs='$notinst_deplibs'
4960 # When we are sourced in execute mode, \$file and \$echo are already set.
4961 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4964 # Make sure echo works.
4965 if test \"X\$1\" = X--no-reexec; then
4966 # Discard the --no-reexec flag, and continue.
4968 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4969 # Yippee, \$echo works!
4972 # Restart under the correct shell, and then maybe \$echo will work.
4973 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4979 # Find the directory that this script lives in.
4980 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4981 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4983 # Follow symbolic links until we get to the real thisdir.
4984 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4985 while test -n \"\$file\"; do
4986 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4988 # If there was a directory component, then change thisdir.
4989 if test \"x\$destdir\" != \"x\$file\"; then
4990 case \"\$destdir\" in
4991 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4992 *) thisdir=\"\$thisdir/\$destdir\" ;;
4996 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4997 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5000 # Try to get the absolute directory name.
5001 absdir=\`cd \"\$thisdir\" && pwd\`
5002 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5005 if test "$fast_install" = yes; then
5007 program=lt-'$outputname'$exeext
5008 progdir=\"\$thisdir/$objdir\"
5010 if test ! -f \"\$progdir/\$program\" || \\
5011 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5012 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5014 file=\"\$\$-\$program\"
5016 if test ! -d \"\$progdir\"; then
5017 $mkdir \"\$progdir\"
5019 $rm \"\$progdir/\$file\"
5024 # relink executable if necessary
5025 if test -n \"\$relink_command\"; then
5026 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5028 $echo \"\$relink_command_output\" >&2
5029 $rm \"\$progdir/\$file\"
5034 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5035 { $rm \"\$progdir/\$program\";
5036 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5037 $rm \"\$progdir/\$file\"
5041 program='$outputname'
5042 progdir=\"\$thisdir/$objdir\"
5048 if test -f \"\$progdir/\$program\"; then"
5050 # Export our shlibpath_var if we have one.
5051 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5053 # Add our own library path to $shlibpath_var
5054 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5056 # Some systems cannot cope with colon-terminated $shlibpath_var
5057 # The second colon is a workaround for a bug in BeOS R4 sed
5058 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5060 export $shlibpath_var
5064 # fixup the dll searchpath if we need to.
5065 if test -n "$dllsearchpath"; then
5067 # Add the dll search path components to the executable PATH
5068 PATH=$dllsearchpath:\$PATH
5073 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5074 # Run the actual program with our arguments.
5077 # Backslashes separate directories on plain windows
5078 *-*-mingw | *-*-os2*)
5080 exec \$progdir\\\\\$program \${1+\"\$@\"}
5086 exec \$progdir/\$program \${1+\"\$@\"}
5091 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5095 # The program doesn't exist.
5096 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5097 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5098 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5109 # See if we need to build an old-fashioned archive.
5110 for oldlib in $oldlibs; do
5112 if test "$build_libtool_libs" = convenience; then
5113 oldobjs="$libobjs_save"
5114 addlibs="$convenience"
5115 build_libtool_libs=no
5117 if test "$build_libtool_libs" = module; then
5118 oldobjs="$libobjs_save"
5119 build_libtool_libs=no
5121 oldobjs="$old_deplibs $non_pic_objects"
5123 addlibs="$old_convenience"
5126 if test -n "$addlibs"; then
5127 gentop="$output_objdir/${outputname}x"
5128 generated="$generated $gentop"
5130 func_extract_archives $gentop $addlibs
5131 oldobjs="$oldobjs $func_extract_archives_result"
5134 # Do each command in the archive commands.
5135 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5136 cmds=$old_archive_from_new_cmds
5138 # POSIX demands no paths to be encoded in archives. We have
5139 # to avoid creating archives with duplicate basenames if we
5140 # might have to extract them afterwards, e.g., when creating a
5141 # static archive out of a convenience library, or when linking
5142 # the entirety of a libtool archive into another (currently
5143 # not supported by libtool).
5144 if (for obj in $oldobjs
5146 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5147 done | sort | sort -uc >/dev/null 2>&1); then
5150 $echo "copying selected object files to avoid basename conflicts..."
5152 if test -z "$gentop"; then
5153 gentop="$output_objdir/${outputname}x"
5154 generated="$generated $gentop"
5156 $show "${rm}r $gentop"
5157 $run ${rm}r "$gentop"
5158 $show "$mkdir $gentop"
5159 $run $mkdir "$gentop"
5161 if test "$status" -ne 0 && test ! -d "$gentop"; then
5166 save_oldobjs=$oldobjs
5169 for obj in $save_oldobjs
5171 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5172 case " $oldobjs " in
5173 " ") oldobjs=$obj ;;
5176 # Make sure we don't pick an alternate name that also
5178 newobj=lt$counter-$objbase
5179 counter=`expr $counter + 1`
5180 case " $oldobjs " in
5181 *[\ /]"$newobj "*) ;;
5182 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5185 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5186 $run ln "$obj" "$gentop/$newobj" ||
5187 $run cp "$obj" "$gentop/$newobj"
5188 oldobjs="$oldobjs $gentop/$newobj"
5190 *) oldobjs="$oldobjs $obj" ;;
5195 eval cmds=\"$old_archive_cmds\"
5197 if len=`expr "X$cmds" : ".*"` &&
5198 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5199 cmds=$old_archive_cmds
5201 # the command line is too long to link in one step, link in parts
5202 $echo "using piecewise archive linking..."
5207 save_oldobjs=$oldobjs
5209 # Is there a better way of finding the last object in the list?
5210 for obj in $save_oldobjs
5214 for obj in $save_oldobjs
5216 oldobjs="$objlist $obj"
5217 objlist="$objlist $obj"
5218 eval test_cmds=\"$old_archive_cmds\"
5219 if len=`expr "X$test_cmds" : ".*"` &&
5220 test "$len" -le "$max_cmd_len"; then
5223 # the above command should be used before it gets too long
5225 if test "$obj" = "$last_oldobj" ; then
5228 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5229 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5235 if test "X$oldobjs" = "X" ; then
5236 eval cmds=\"\$concat_cmds\"
5238 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5242 save_ifs="$IFS"; IFS='~'
5243 for cmd in $cmds; do
5247 $run eval "$cmd" || exit $?
5252 if test -n "$generated"; then
5253 $show "${rm}r$generated"
5254 $run ${rm}r$generated
5257 # Now create the libtool archive.
5261 test "$build_old_libs" = yes && old_library="$libname.$libext"
5262 $show "creating $output"
5264 # Preserve any variables that may affect compiler behavior
5265 for var in $variables_saved_for_relink; do
5266 if eval test -z \"\${$var+set}\"; then
5267 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5268 elif eval var_value=\$$var; test -z "$var_value"; then
5269 relink_command="$var=; export $var; $relink_command"
5271 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5272 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5275 # Quote the link command for shipping.
5276 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5277 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5278 if test "$hardcode_automatic" = yes ; then
5283 # Only create the output if not a dry run.
5284 if test -z "$run"; then
5285 for installed in no yes; do
5286 if test "$installed" = yes; then
5287 if test -z "$install_libdir"; then
5290 output="$output_objdir/$outputname"i
5291 # Replace all uninstalled libtool libraries with the installed ones
5293 for deplib in $dependency_libs; do
5296 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5297 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5298 if test -z "$libdir"; then
5299 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5302 newdependency_libs="$newdependency_libs $libdir/$name"
5304 *) newdependency_libs="$newdependency_libs $deplib" ;;
5307 dependency_libs="$newdependency_libs"
5309 for lib in $dlfiles; do
5310 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5311 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5312 if test -z "$libdir"; then
5313 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5316 newdlfiles="$newdlfiles $libdir/$name"
5318 dlfiles="$newdlfiles"
5320 for lib in $dlprefiles; do
5321 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5322 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5323 if test -z "$libdir"; then
5324 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5327 newdlprefiles="$newdlprefiles $libdir/$name"
5329 dlprefiles="$newdlprefiles"
5332 for lib in $dlfiles; do
5334 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5335 *) abs=`pwd`"/$lib" ;;
5337 newdlfiles="$newdlfiles $abs"
5339 dlfiles="$newdlfiles"
5341 for lib in $dlprefiles; do
5343 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5344 *) abs=`pwd`"/$lib" ;;
5346 newdlprefiles="$newdlprefiles $abs"
5348 dlprefiles="$newdlprefiles"
5351 # place dlname in correct position for cygwin
5353 case $host,$output,$installed,$module,$dlname in
5354 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5357 # $outputname - a libtool library file
5358 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5360 # Please DO NOT delete this file!
5361 # It is necessary for linking the library.
5363 # The name that we can dlopen(3).
5366 # Names of this library.
5367 library_names='$library_names'
5369 # The name of the static archive.
5370 old_library='$old_library'
5372 # Libraries that this one depends upon.
5373 dependency_libs='$dependency_libs'
5375 # Version information for $libname.
5380 # Is this an already installed library?
5381 installed=$installed
5383 # Should we warn about portability when linking against -modules?
5384 shouldnotlink=$module
5386 # Files to dlopen/dlpreopen
5388 dlpreopen='$dlprefiles'
5390 # Directory that this library needs to be installed in:
5391 libdir='$install_libdir'"
5392 if test "$installed" = no && test "$need_relink" = yes; then
5394 relink_command=\"$relink_command\""
5399 # Do a symbolic link so that the libtool archive can be found in
5400 # LD_LIBRARY_PATH before the program is installed.
5401 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5402 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5408 # libtool install mode
5410 modename="$modename: install"
5412 # There may be an optional sh(1) argument at the beginning of
5413 # install_prog (especially on Windows NT).
5414 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5415 # Allow the use of GNU shtool's install command.
5416 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5417 # Aesthetically quote it.
5418 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5420 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5424 install_prog="$arg "
5432 # The real first argument should be the name of the installation program.
5433 # Aesthetically quote it.
5434 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5436 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5440 install_prog="$install_prog$arg"
5442 # We need to accept at least all the BSD install flags.
5452 if test -n "$dest"; then
5453 files="$files $dest"
5471 # If the previous option needed an argument, then skip it.
5472 if test -n "$prev"; then
5481 # Aesthetically quote the argument.
5482 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5484 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5488 install_prog="$install_prog $arg"
5491 if test -z "$install_prog"; then
5492 $echo "$modename: you must specify an install program" 1>&2
5497 if test -n "$prev"; then
5498 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5503 if test -z "$files"; then
5504 if test -z "$dest"; then
5505 $echo "$modename: no file or destination specified" 1>&2
5507 $echo "$modename: you must specify a destination" 1>&2
5513 # Strip any trailing slash from the destination.
5514 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5516 # Check to see that the destination is a directory.
5517 test -d "$dest" && isdir=yes
5518 if test "$isdir" = yes; then
5522 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5523 test "X$destdir" = "X$dest" && destdir=.
5524 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5526 # Not a directory, so check to see that there is only one file specified.
5528 if test "$#" -gt 2; then
5529 $echo "$modename: \`$dest' is not a directory" 1>&2
5535 [\\/]* | [A-Za-z]:[\\/]*) ;;
5537 for file in $files; do
5541 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5550 # This variable tells wrapper scripts just to set variables rather
5551 # than running their programs.
5552 libtool_install_magic="$magic"
5557 for file in $files; do
5559 # Do each installation.
5562 # Do the static libraries later.
5563 staticlibs="$staticlibs $file"
5567 # Check to see that this really is a libtool archive.
5568 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5570 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5578 # If there is no directory component, then add one.
5580 */* | *\\*) . $file ;;
5584 # Add the libdir to current_libdirs if it is the destination.
5585 if test "X$destdir" = "X$libdir"; then
5586 case "$current_libdirs " in
5588 *) current_libdirs="$current_libdirs $libdir" ;;
5591 # Note the libdir as a future libdir.
5592 case "$future_libdirs " in
5594 *) future_libdirs="$future_libdirs $libdir" ;;
5598 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5599 test "X$dir" = "X$file/" && dir=
5602 if test -n "$relink_command"; then
5603 # Determine the prefix the user has applied to our future dir.
5604 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5606 # Don't allow the user to place us outside of our expected
5607 # location b/c this prevents finding dependent libraries that
5608 # are installed to the same prefix.
5609 # At present, this check doesn't affect windows .dll's that
5610 # are installed into $libdir/../bin (currently, that works fine)
5611 # but it's something to keep an eye on.
5612 if test "$inst_prefix_dir" = "$destdir"; then
5613 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5617 if test -n "$inst_prefix_dir"; then
5618 # Stick the inst_prefix_dir data into the link command.
5619 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5621 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5624 $echo "$modename: warning: relinking \`$file'" 1>&2
5625 $show "$relink_command"
5626 if $run eval "$relink_command"; then :
5628 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5633 # See the names of the shared library.
5634 set dummy $library_names
5635 if test -n "$2"; then
5641 test -n "$relink_command" && srcname="$realname"T
5643 # Install the shared library and build the symlinks.
5644 $show "$install_prog $dir/$srcname $destdir/$realname"
5645 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5646 if test -n "$stripme" && test -n "$striplib"; then
5647 $show "$striplib $destdir/$realname"
5648 $run eval "$striplib $destdir/$realname" || exit $?
5651 if test "$#" -gt 0; then
5652 # Delete the old symlinks, and create new ones.
5655 if test "$linkname" != "$realname"; then
5656 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5657 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5662 # Do each command in the postinstall commands.
5663 lib="$destdir/$realname"
5664 cmds=$postinstall_cmds
5665 save_ifs="$IFS"; IFS='~'
5666 for cmd in $cmds; do
5670 $run eval "$cmd" || exit $?
5675 # Install the pseudo-library for information purposes.
5678 # Do not install the useless pseudo-library
5681 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5682 instname="$dir/$name"i
5683 $show "$install_prog $instname $destdir/$name"
5684 $run eval "$install_prog $instname $destdir/$name" || exit $?
5688 # Maybe install the static library, too.
5689 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5693 # Install (i.e. copy) a libtool object.
5695 # Figure out destination file name, if it wasn't already specified.
5696 if test -n "$destname"; then
5697 destfile="$destdir/$destname"
5699 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5700 destfile="$destdir/$destfile"
5703 # Deduce the name of the destination old-style object file.
5706 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5709 staticdest="$destfile"
5713 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5719 # Install the libtool object if requested.
5720 if test -n "$destfile"; then
5721 $show "$install_prog $file $destfile"
5722 $run eval "$install_prog $file $destfile" || exit $?
5725 # Install the old object if enabled.
5726 if test "$build_old_libs" = yes; then
5727 # Deduce the name of the old-style object file.
5728 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5730 $show "$install_prog $staticobj $staticdest"
5731 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5737 # Figure out destination file name, if it wasn't already specified.
5738 if test -n "$destname"; then
5739 destfile="$destdir/$destname"
5741 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5742 destfile="$destdir/$destfile"
5745 # If the file is missing, and there is a .exe on the end, strip it
5746 # because it is most likely a libtool script we actually want to
5751 if test ! -f "$file"; then
5752 file=`$echo $file|${SED} 's,.exe$,,'`
5758 # Do a test to see if this is really a libtool program.
5761 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5767 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5771 # To insure that "foo" is sourced, and not "foo.exe",
5772 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5773 # which disallows the automatic-append-.exe behavior.
5775 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5776 *) wrapperdot=${wrapper} ;;
5778 # If there is no directory component, then add one.
5780 */* | *\\*) . ${wrapperdot} ;;
5781 *) . ./${wrapperdot} ;;
5784 # Check the variables that should have been set.
5785 if test -z "$notinst_deplibs"; then
5786 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5791 for lib in $notinst_deplibs; do
5792 # Check to see that each library is installed.
5794 if test -f "$lib"; then
5795 # If there is no directory component, then add one.
5797 */* | *\\*) . $lib ;;
5801 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5802 if test -n "$libdir" && test ! -f "$libfile"; then
5803 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5809 # To insure that "foo" is sourced, and not "foo.exe",
5810 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5811 # which disallows the automatic-append-.exe behavior.
5813 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5814 *) wrapperdot=${wrapper} ;;
5816 # If there is no directory component, then add one.
5818 */* | *\\*) . ${wrapperdot} ;;
5819 *) . ./${wrapperdot} ;;
5823 if test "$fast_install" = no && test -n "$relink_command"; then
5824 if test "$finalize" = yes && test -z "$run"; then
5826 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5827 tmpdir="$tmpdir/libtool-$$"
5830 if $mkdir "$tmpdir"; then
5834 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5837 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5838 outputname="$tmpdir/$file"
5839 # Replace the output file specification.
5840 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5842 $show "$relink_command"
5843 if $run eval "$relink_command"; then :
5845 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5851 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5854 # Install the binary that we compiled earlier.
5855 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5859 # remove .exe since cygwin /usr/bin/install will append another
5861 case $install_prog,$host in
5862 */usr/bin/install*,*cygwin*)
5863 case $file:$destfile in
5868 destfile=$destfile.exe
5871 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5876 $show "$install_prog$stripme $file $destfile"
5877 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5878 test -n "$outputname" && ${rm}r "$tmpdir"
5883 for file in $staticlibs; do
5884 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5886 # Set up the ranlib parameters.
5887 oldlib="$destdir/$name"
5889 $show "$install_prog $file $oldlib"
5890 $run eval "$install_prog \$file \$oldlib" || exit $?
5892 if test -n "$stripme" && test -n "$old_striplib"; then
5893 $show "$old_striplib $oldlib"
5894 $run eval "$old_striplib $oldlib" || exit $?
5897 # Do each command in the postinstall commands.
5898 cmds=$old_postinstall_cmds
5899 save_ifs="$IFS"; IFS='~'
5900 for cmd in $cmds; do
5904 $run eval "$cmd" || exit $?
5909 if test -n "$future_libdirs"; then
5910 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5913 if test -n "$current_libdirs"; then
5914 # Maybe just do a dry run.
5915 test -n "$run" && current_libdirs=" -n$current_libdirs"
5916 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5922 # libtool finish mode
5924 modename="$modename: finish"
5928 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5931 libdirs="$libdirs $dir"
5934 for libdir in $libdirs; do
5935 if test -n "$finish_cmds"; then
5936 # Do each command in the finish commands.
5938 save_ifs="$IFS"; IFS='~'
5939 for cmd in $cmds; do
5943 $run eval "$cmd" || admincmds="$admincmds
5948 if test -n "$finish_eval"; then
5949 # Do the single finish_eval.
5950 eval cmds=\"$finish_eval\"
5951 $run eval "$cmds" || admincmds="$admincmds
5957 # Exit here if they wanted silent mode.
5958 test "$show" = : && exit $EXIT_SUCCESS
5960 $echo "----------------------------------------------------------------------"
5961 $echo "Libraries have been installed in:"
5962 for libdir in $libdirs; do
5966 $echo "If you ever happen to want to link against installed libraries"
5967 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5968 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5969 $echo "flag during linking and do at least one of the following:"
5970 if test -n "$shlibpath_var"; then
5971 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5972 $echo " during execution"
5974 if test -n "$runpath_var"; then
5975 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5976 $echo " during linking"
5978 if test -n "$hardcode_libdir_flag_spec"; then
5980 eval flag=\"$hardcode_libdir_flag_spec\"
5982 $echo " - use the \`$flag' linker flag"
5984 if test -n "$admincmds"; then
5985 $echo " - have your system administrator run these commands:$admincmds"
5987 if test -f /etc/ld.so.conf; then
5988 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5991 $echo "See any operating system documentation about shared libraries for"
5992 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5993 $echo "----------------------------------------------------------------------"
5997 # libtool execute mode
5999 modename="$modename: execute"
6001 # The first argument is the command name.
6003 if test -z "$cmd"; then
6004 $echo "$modename: you must specify a COMMAND" 1>&2
6009 # Handle -dlopen flags immediately.
6010 for file in $execute_dlfiles; do
6011 if test ! -f "$file"; then
6012 $echo "$modename: \`$file' is not a file" 1>&2
6020 # Check to see that this really is a libtool archive.
6021 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6023 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6028 # Read the libtool library.
6032 # If there is no directory component, then add one.
6034 */* | *\\*) . $file ;;
6038 # Skip this library if it cannot be dlopened.
6039 if test -z "$dlname"; then
6040 # Warn if it was a shared library.
6041 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6045 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6046 test "X$dir" = "X$file" && dir=.
6048 if test -f "$dir/$objdir/$dlname"; then
6051 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6057 # Just add the directory containing the .lo file.
6058 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6059 test "X$dir" = "X$file" && dir=.
6063 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6068 # Get the absolute pathname.
6069 absdir=`cd "$dir" && pwd`
6070 test -n "$absdir" && dir="$absdir"
6072 # Now add the directory to shlibpath_var.
6073 if eval "test -z \"\$$shlibpath_var\""; then
6074 eval "$shlibpath_var=\"\$dir\""
6076 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6080 # This variable tells wrapper scripts just to set shlibpath_var
6081 # rather than running their programs.
6082 libtool_execute_magic="$magic"
6084 # Check if any of the arguments is a wrapper script.
6091 # Do a test to see if this is really a libtool program.
6092 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6093 # If there is no directory component, then add one.
6095 */* | *\\*) . $file ;;
6099 # Transform arg to wrapped name.
6100 file="$progdir/$program"
6104 # Quote arguments (to preserve shell metacharacters).
6105 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6106 args="$args \"$file\""
6109 if test -z "$run"; then
6110 if test -n "$shlibpath_var"; then
6111 # Export the shlibpath_var.
6112 eval "export $shlibpath_var"
6115 # Restore saved environment variables
6116 if test "${save_LC_ALL+set}" = set; then
6117 LC_ALL="$save_LC_ALL"; export LC_ALL
6119 if test "${save_LANG+set}" = set; then
6120 LANG="$save_LANG"; export LANG
6123 # Now prepare to actually exec the command.
6124 exec_cmd="\$cmd$args"
6126 # Display what would be done.
6127 if test -n "$shlibpath_var"; then
6128 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6129 $echo "export $shlibpath_var"
6136 # libtool clean and uninstall mode
6138 modename="$modename: $mode"
6144 # This variable tells wrapper scripts just to set variables rather
6145 # than running their programs.
6146 libtool_install_magic="$magic"
6151 -f) rm="$rm $arg"; rmforce=yes ;;
6152 -*) rm="$rm $arg" ;;
6153 *) files="$files $arg" ;;
6157 if test -z "$rm"; then
6158 $echo "$modename: you must specify an RM program" 1>&2
6165 origobjdir="$objdir"
6166 for file in $files; do
6167 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6168 if test "X$dir" = "X$file"; then
6170 objdir="$origobjdir"
6172 objdir="$dir/$origobjdir"
6174 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6175 test "$mode" = uninstall && objdir="$dir"
6177 # Remember objdir for removal later, being careful to avoid duplicates
6178 if test "$mode" = clean; then
6181 *) rmdirs="$rmdirs $objdir" ;;
6185 # Don't error if the file doesn't exist and rm -f was used.
6186 if (test -L "$file") >/dev/null 2>&1 \
6187 || (test -h "$file") >/dev/null 2>&1 \
6188 || test -f "$file"; then
6190 elif test -d "$file"; then
6193 elif test "$rmforce" = yes; then
6201 # Possibly a libtool archive, so verify it.
6202 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6205 # Delete the libtool libraries and symlinks.
6206 for n in $library_names; do
6207 rmfiles="$rmfiles $objdir/$n"
6209 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6210 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6212 if test "$mode" = uninstall; then
6213 if test -n "$library_names"; then
6214 # Do each command in the postuninstall commands.
6215 cmds=$postuninstall_cmds
6216 save_ifs="$IFS"; IFS='~'
6217 for cmd in $cmds; do
6222 if test "$?" -ne 0 && test "$rmforce" != yes; then
6229 if test -n "$old_library"; then
6230 # Do each command in the old_postuninstall commands.
6231 cmds=$old_postuninstall_cmds
6232 save_ifs="$IFS"; IFS='~'
6233 for cmd in $cmds; do
6238 if test "$?" -ne 0 && test "$rmforce" != yes; then
6244 # FIXME: should reinstall the best remaining shared library.
6250 # Possibly a libtool object, so verify it.
6251 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6256 # Add PIC object to the list of files to remove.
6257 if test -n "$pic_object" \
6258 && test "$pic_object" != none; then
6259 rmfiles="$rmfiles $dir/$pic_object"
6262 # Add non-PIC object to the list of files to remove.
6263 if test -n "$non_pic_object" \
6264 && test "$non_pic_object" != none; then
6265 rmfiles="$rmfiles $dir/$non_pic_object"
6271 if test "$mode" = clean ; then
6275 file=`$echo $file|${SED} 's,.exe$,,'`
6276 noexename=`$echo $name|${SED} 's,.exe$,,'`
6277 # $file with .exe has already been added to rmfiles,
6278 # add $file without .exe
6279 rmfiles="$rmfiles $file"
6282 # Do a test to see if this is a libtool program.
6283 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6287 # note $name still contains .exe if it was in $file originally
6288 # as does the version of $file that was added into $rmfiles
6289 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6290 if test "$fast_install" = yes && test -n "$relink_command"; then
6291 rmfiles="$rmfiles $objdir/lt-$name"
6293 if test "X$noexename" != "X$name" ; then
6294 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6300 $show "$rm $rmfiles"
6301 $run $rm $rmfiles || exit_status=1
6303 objdir="$origobjdir"
6305 # Try to remove the ${objdir}s in the directories where we deleted files
6306 for dir in $rmdirs; do
6307 if test -d "$dir"; then
6309 $run rmdir $dir >/dev/null 2>&1
6317 $echo "$modename: you must specify a MODE" 1>&2
6318 $echo "$generic_help" 1>&2
6323 if test -z "$exec_cmd"; then
6324 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6325 $echo "$generic_help" 1>&2
6328 fi # test -z "$show_help"
6330 if test -n "$exec_cmd"; then
6335 # We need to display help for each of the modes.
6338 "Usage: $modename [OPTION]... [MODE-ARG]...
6340 Provide generalized library-building support services.
6342 --config show all configuration variables
6343 --debug enable verbose shell tracing
6344 -n, --dry-run display commands without modifying any files
6345 --features display basic configuration information and exit
6346 --finish same as \`--mode=finish'
6347 --help display this help message and exit
6348 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6349 --quiet same as \`--silent'
6350 --silent don't print informational messages
6351 --tag=TAG use configuration variables from tag TAG
6352 --version print version information
6354 MODE must be one of the following:
6356 clean remove files from the build directory
6357 compile compile a source file into a libtool object
6358 execute automatically set library path, then run a program
6359 finish complete the installation of libtool libraries
6360 install install libraries or executables
6361 link create a library or an executable
6362 uninstall remove libraries from an installed directory
6364 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6365 a more detailed description of MODE.
6367 Report bugs to <bug-libtool@gnu.org>."
6373 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6375 Remove files from the build directory.
6377 RM is the name of the program to use to delete files associated with each FILE
6378 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6381 If FILE is a libtool library, object or program, all the files associated
6382 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6387 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6389 Compile a source file into a libtool library object.
6391 This mode accepts the following additional options:
6393 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6394 -prefer-pic try to building PIC objects only
6395 -prefer-non-pic try to building non-PIC objects only
6396 -static always build a \`.o' file suitable for static linking
6398 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6399 from the given SOURCEFILE.
6401 The output file name is determined by removing the directory component from
6402 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6403 library object suffix, \`.lo'."
6408 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6410 Automatically set library path, then run a program.
6412 This mode accepts the following additional options:
6414 -dlopen FILE add the directory containing FILE to the library path
6416 This mode sets the library path environment variable according to \`-dlopen'
6419 If any of the ARGS are libtool executable wrappers, then they are translated
6420 into their corresponding uninstalled binary, and any of their required library
6421 directories are added to the library path.
6423 Then, COMMAND is executed, with ARGS as arguments."
6428 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6430 Complete the installation of libtool libraries.
6432 Each LIBDIR is a directory that contains libtool libraries.
6434 The commands that this mode executes may require superuser privileges. Use
6435 the \`--dry-run' option if you just want to see what would be executed."
6440 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6442 Install executables or libraries.
6444 INSTALL-COMMAND is the installation command. The first component should be
6445 either the \`install' or \`cp' program.
6447 The rest of the components are interpreted as arguments to that command (only
6448 BSD-compatible install options are recognized)."
6453 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6455 Link object files or libraries together to form another library, or to
6456 create an executable program.
6458 LINK-COMMAND is a command using the C compiler that you would use to create
6459 a program from several object files.
6461 The following components of LINK-COMMAND are treated specially:
6463 -all-static do not do any dynamic linking at all
6464 -avoid-version do not add a version suffix if possible
6465 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6466 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6467 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6468 -export-symbols SYMFILE
6469 try to export only the symbols listed in SYMFILE
6470 -export-symbols-regex REGEX
6471 try to export only the symbols matching REGEX
6472 -LLIBDIR search LIBDIR for required installed libraries
6473 -lNAME OUTPUT-FILE requires the installed library libNAME
6474 -module build a library that can dlopened
6475 -no-fast-install disable the fast-install mode
6476 -no-install link a not-installable executable
6477 -no-undefined declare that a library does not refer to external symbols
6478 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6479 -objectlist FILE Use a list of object files found in FILE to specify objects
6480 -precious-files-regex REGEX
6481 don't remove output files matching REGEX
6482 -release RELEASE specify package release information
6483 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6484 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6485 -static do not do any dynamic linking of libtool libraries
6486 -version-info CURRENT[:REVISION[:AGE]]
6487 specify library version info [each variable defaults to 0]
6489 All other options (arguments beginning with \`-') are ignored.
6491 Every other argument is treated as a filename. Files ending in \`.la' are
6492 treated as uninstalled libtool libraries, other files are standard or library
6495 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6496 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6497 required, except when creating a convenience library.
6499 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6500 using \`ar' and \`ranlib', or on Windows using \`lib'.
6502 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6503 is created, otherwise an executable program is created."
6508 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6510 Remove libraries from an installation directory.
6512 RM is the name of the program to use to delete files associated with each FILE
6513 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6516 If FILE is a libtool library, all the files associated with it are deleted.
6517 Otherwise, only FILE itself is deleted using RM."
6521 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6528 $echo "Try \`$modename --help' for more information about other modes."
6532 # The TAGs below are defined such that we never get into a situation
6533 # in which we disable both kinds of libraries. Given conflicting
6534 # choices, we go for a static library, that is the most portable,
6535 # since we can't tell whether shared libraries were disabled because
6536 # the user asked for that or because the platform doesn't support
6537 # them. This is particularly important on AIX, because we don't
6538 # support having both static and shared libraries enabled at the same
6539 # time on that platform, so we default to a shared-only configuration.
6540 # If a disable-shared tag is given, we'll fallback to a static-only
6541 # configuration. But we'll never go from static-only to shared-only.
6543 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6544 build_libtool_libs=no
6546 # ### END LIBTOOL TAG CONFIG: disable-shared
6548 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6549 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6550 # ### END LIBTOOL TAG CONFIG: disable-static