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.20-OpenLDAP
62 TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
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 X|tr X '\101'` in
107 A) # ASCII based system
108 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
110 NL2SP='tr \015\012 \040\040'
112 *) # EBCDIC based system
114 NL2SP='tr \r\n \100\100'
119 # Only set LANG and LC_ALL to C if already set.
120 # These must not be set unconditionally because not all systems understand
121 # e.g. LANG=C (notably SCO).
122 # We save the old values to restore during execute mode.
123 if test "${LC_ALL+set}" = set; then
124 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
126 if test "${LANG+set}" = set; then
127 save_LANG="$LANG"; LANG=C; export LANG
130 # Make sure IFS has a sensible default
135 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
136 $echo "$modename: not configured to build any kind of library" 1>&2
137 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
150 lo2o="s/\\.lo\$/.${objext}/"
151 o2lo="s/\\.${objext}\$/.lo/"
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
756 qlibobj="\"$qlibobj\"" ;;
758 test "X$libobj" != "X$qlibobj" \
759 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
760 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
761 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
762 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
763 if test "X$xdir" = "X$obj"; then
768 lobj=${xdir}$objdir/$objname
770 if test -z "$base_compile"; then
771 $echo "$modename: you must specify a compilation command" 1>&2
776 # Delete any leftover library objects.
777 if test "$build_old_libs" = yes; then
778 removelist="$obj $lobj $libobj ${libobj}T"
780 removelist="$lobj $libobj ${libobj}T"
784 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
786 # On Cygwin there's no "real" PIC flag so we must build both object types
788 cygwin* | mingw* | pw32* | os2*)
792 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
793 # non-PIC code in shared libraries is not supported
797 # Calculate the filename of the output object if compiler does
798 # not support -o with -c
799 if test "$compiler_c_o" = no; then
800 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
801 lockfile="$output_obj.lock"
802 removelist="$removelist $output_obj $lockfile"
803 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
810 # Lock this critical section if it is needed
811 # We use this script file to make the link, it avoids creating a new file
812 if test "$need_locks" = yes; then
813 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
814 $show "Waiting for $lockfile to be removed"
817 elif test "$need_locks" = warn; then
818 if test -f "$lockfile"; then
820 *** ERROR, $lockfile exists and contains:
821 `cat $lockfile 2>/dev/null`
823 This indicates that another process is trying to use the same
824 temporary object file, and libtool could not work around it because
825 your compiler does not support \`-c' and \`-o' together. If you
826 repeat this compilation, it may succeed, by chance, but you had better
827 avoid parallel builds (make -j) in this platform, or get a better
833 $echo "$srcfile" > "$lockfile"
836 if test -n "$fix_srcfile_path"; then
837 eval srcfile=\"$fix_srcfile_path\"
839 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
841 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
842 qsrcfile="\"$qsrcfile\"" ;;
845 $run $rm "$libobj" "${libobj}T"
847 # Create a libtool object file (analogous to a ".la" file),
848 # but don't create it if we're doing a dry run.
849 test -z "$run" && cat > ${libobj}T <<EOF
850 # $libobj - a libtool object file
851 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
853 # Please DO NOT delete this file!
854 # It is necessary for linking the library.
856 # Name of the PIC object.
859 # Only build a PIC object if we are building libtool libraries.
860 if test "$build_libtool_libs" = yes; then
861 # Without this assignment, base_compile gets emptied.
862 fbsd_hideous_sh_bug=$base_compile
864 if test "$pic_mode" != no; then
865 command="$base_compile $qsrcfile $pic_flag"
867 # Don't build PIC code
868 command="$base_compile $qsrcfile"
871 if test ! -d "${xdir}$objdir"; then
872 $show "$mkdir ${xdir}$objdir"
873 $run $mkdir ${xdir}$objdir
875 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
880 if test -z "$output_obj"; then
881 # Place PIC objects in $objdir
882 command="$command -o $lobj"
885 $run $rm "$lobj" "$output_obj"
888 if $run eval "$command"; then :
890 test -n "$output_obj" && $run $rm $removelist
894 if test "$need_locks" = warn &&
895 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
897 *** ERROR, $lockfile contains:
898 `cat $lockfile 2>/dev/null`
900 but it should contain:
903 This indicates that another process is trying to use the same
904 temporary object file, and libtool could not work around it because
905 your compiler does not support \`-c' and \`-o' together. If you
906 repeat this compilation, it may succeed, by chance, but you had better
907 avoid parallel builds (make -j) in this platform, or get a better
914 # Just move the object if needed, then go on to compile the next one
915 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
916 $show "$mv $output_obj $lobj"
917 if $run $mv $output_obj $lobj; then :
925 # Append the name of the PIC object to the libtool object file.
926 test -z "$run" && cat >> ${libobj}T <<EOF
927 pic_object='$objdir/$objname'
931 # Allow error messages only from the first compilation.
932 if test "$suppress_opt" = yes; then
933 suppress_output=' >/dev/null 2>&1'
936 # No PIC object so indicate it doesn't exist in the libtool
938 test -z "$run" && cat >> ${libobj}T <<EOF
944 # Only build a position-dependent object if we build old libraries.
945 if test "$build_old_libs" = yes; then
946 if test "$pic_mode" != yes; then
947 # Don't build PIC code
948 command="$base_compile $qsrcfile"
950 command="$base_compile $qsrcfile $pic_flag"
952 if test "$compiler_c_o" = yes; then
953 command="$command -o $obj"
956 # Suppress compiler output if we already did a PIC compilation.
957 command="$command$suppress_output"
958 $run $rm "$obj" "$output_obj"
960 if $run eval "$command"; then :
966 if test "$need_locks" = warn &&
967 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
969 *** ERROR, $lockfile contains:
970 `cat $lockfile 2>/dev/null`
972 but it should contain:
975 This indicates that another process is trying to use the same
976 temporary object file, and libtool could not work around it because
977 your compiler does not support \`-c' and \`-o' together. If you
978 repeat this compilation, it may succeed, by chance, but you had better
979 avoid parallel builds (make -j) in this platform, or get a better
986 # Just move the object if needed
987 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
988 $show "$mv $output_obj $obj"
989 if $run $mv $output_obj $obj; then :
997 # Append the name of the non-PIC object the libtool object file.
998 # Only append if the libtool object file exists.
999 test -z "$run" && cat >> ${libobj}T <<EOF
1000 # Name of the non-PIC object.
1001 non_pic_object='$objname'
1005 # Append the name of the non-PIC object the libtool object file.
1006 # Only append if the libtool object file exists.
1007 test -z "$run" && cat >> ${libobj}T <<EOF
1008 # Name of the non-PIC object.
1014 $run $mv "${libobj}T" "${libobj}"
1016 # Unlock the critical section if it was locked
1017 if test "$need_locks" != no; then
1018 $run $rm "$lockfile"
1026 modename="$modename: link"
1028 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1029 # It is impossible to link a dll without this setting, and
1030 # we shouldn't force the makefile maintainer to figure out
1031 # which system we are compiling for in order to pass an extra
1032 # flag for every libtool invocation.
1033 # allow_undefined=no
1035 # FIXME: Unfortunately, there are problems with the above when trying
1036 # to make a dll which has undefined symbols, in which case not
1037 # even a static library is built. For now, we need to specify
1038 # -no-undefined on the libtool link line when we can be certain
1039 # that all symbols are satisfied, otherwise we get a static library.
1046 libtool_args="$nonopt"
1047 base_compile="$nonopt $@"
1048 compile_command="$nonopt"
1049 finalize_command="$nonopt"
1062 lib_search_path=`pwd`
1071 export_symbols_regex=
1079 precious_files_regex=
1080 prefer_static_libs=no
1093 func_infer_tag $base_compile
1095 # We need to know -static, to get the right output filenames.
1099 -all-static | -static)
1100 if test "X$arg" = "X-all-static"; then
1101 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1102 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1104 if test -n "$link_static_flag"; then
1105 dlopen_self=$dlopen_self_static
1108 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1109 dlopen_self=$dlopen_self_static
1112 build_libtool_libs=no
1114 prefer_static_libs=yes
1120 # See if our shared archives depend on static archives.
1121 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1123 # Go through the arguments, transforming them on the way.
1124 while test "$#" -gt 0; do
1128 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1129 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1133 libtool_args="$libtool_args $qarg"
1135 # If the previous option needs an argument, assign it.
1136 if test -n "$prev"; then
1139 compile_command="$compile_command @OUTPUT@"
1140 finalize_command="$finalize_command @OUTPUT@"
1146 if test "$preload" = no; then
1147 # Add the symbol object into the linking commands.
1148 compile_command="$compile_command @SYMFILE@"
1149 finalize_command="$finalize_command @SYMFILE@"
1153 *.la | *.lo) ;; # We handle these cases below.
1155 if test "$dlself" = no; then
1163 if test "$prev" = dlprefiles; then
1165 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1175 if test "$prev" = dlfiles; then
1176 dlfiles="$dlfiles $arg"
1178 dlprefiles="$dlprefiles $arg"
1186 export_symbols="$arg"
1187 if test ! -f "$arg"; then
1188 $echo "$modename: symbol file \`$arg' does not exist"
1195 export_symbols_regex="$arg"
1200 inst_prefix_dir="$arg"
1205 precious_files_regex="$arg"
1215 if test -f "$arg"; then
1218 for fil in `cat $save_arg`
1220 # moreargs="$moreargs $fil"
1222 # A libtool-controlled object.
1224 # Check to see that this really is a libtool object.
1225 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1230 # If there is no directory component, then add one.
1232 */* | *\\*) . $arg ;;
1236 if test -z "$pic_object" || \
1237 test -z "$non_pic_object" ||
1238 test "$pic_object" = none && \
1239 test "$non_pic_object" = none; then
1240 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1244 # Extract subdirectory from the argument.
1245 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1246 if test "X$xdir" = "X$arg"; then
1252 if test "$pic_object" != none; then
1253 # Prepend the subdirectory the object is found in.
1254 pic_object="$xdir$pic_object"
1256 if test "$prev" = dlfiles; then
1257 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1258 dlfiles="$dlfiles $pic_object"
1262 # If libtool objects are unsupported, then we need to preload.
1267 # CHECK ME: I think I busted this. -Ossama
1268 if test "$prev" = dlprefiles; then
1269 # Preload the old-style object.
1270 dlprefiles="$dlprefiles $pic_object"
1275 libobjs="$libobjs $pic_object"
1280 if test "$non_pic_object" != none; then
1281 # Prepend the subdirectory the object is found in.
1282 non_pic_object="$xdir$non_pic_object"
1284 # A standard non-PIC object
1285 non_pic_objects="$non_pic_objects $non_pic_object"
1286 if test -z "$pic_object" || test "$pic_object" = none ; then
1287 arg="$non_pic_object"
1291 # Only an error if not doing a dry-run.
1292 if test -z "$run"; then
1293 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1298 # Extract subdirectory from the argument.
1299 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1300 if test "X$xdir" = "X$arg"; then
1306 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1307 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1308 libobjs="$libobjs $pic_object"
1309 non_pic_objects="$non_pic_objects $non_pic_object"
1314 $echo "$modename: link input file \`$save_arg' does not exist"
1322 # We need an absolute path.
1324 [\\/]* | [A-Za-z]:[\\/]*) ;;
1326 $echo "$modename: only absolute run-paths are allowed" 1>&2
1330 if test "$prev" = rpath; then
1333 *) rpath="$rpath $arg" ;;
1338 *) xrpath="$xrpath $arg" ;;
1345 compiler_flags="$compiler_flags $qarg"
1347 compile_command="$compile_command $qarg"
1348 finalize_command="$finalize_command $qarg"
1352 linker_flags="$linker_flags $qarg"
1353 compiler_flags="$compiler_flags $wl$qarg"
1355 compile_command="$compile_command $wl$qarg"
1356 finalize_command="$finalize_command $wl$qarg"
1360 linker_flags="$linker_flags $qarg"
1361 compiler_flags="$compiler_flags $qarg"
1363 compile_command="$compile_command $qarg"
1364 finalize_command="$finalize_command $qarg"
1373 compiler_flags="$compiler_flags $arg"
1374 compile_command="$compile_command $arg"
1375 finalize_command="$finalize_command $arg"
1380 eval "$prev=\"\$arg\""
1385 fi # test -n "$prev"
1391 if test -n "$link_static_flag"; then
1392 compile_command="$compile_command $link_static_flag"
1393 finalize_command="$finalize_command $link_static_flag"
1399 # FIXME: remove this flag sometime in the future.
1400 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1424 -export-symbols | -export-symbols-regex)
1425 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1426 $echo "$modename: more than one -exported-symbols argument is not allowed"
1429 if test "X$arg" = "X-export-symbols"; then
1438 prev=darwin_framework
1439 compiler_flags="$compiler_flags $arg"
1440 compile_command="$compile_command $arg"
1441 finalize_command="$finalize_command $arg"
1450 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1451 # so, if we see these flags be careful not to treat them like -L
1453 case $with_gcc/$host in
1454 no/*-*-irix* | /*-*-irix*)
1455 compile_command="$compile_command $arg"
1456 finalize_command="$finalize_command $arg"
1463 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1464 # We need an absolute path.
1466 [\\/]* | [A-Za-z]:[\\/]*) ;;
1468 absdir=`cd "$dir" && pwd`
1469 if test -z "$absdir"; then
1470 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1479 deplibs="$deplibs -L$dir"
1480 lib_search_path="$lib_search_path $dir"
1484 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1485 case :$dllsearchpath: in
1487 *) dllsearchpath="$dllsearchpath:$dir";;
1495 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1497 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1498 # These systems don't actually have a C or math library (as such)
1501 *-*-mingw* | *-*-os2*)
1502 # These systems don't actually have a C library (as such)
1503 test "X$arg" = "X-lc" && continue
1505 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1506 # Do not include libc due to us having libc/libc_r.
1507 test "X$arg" = "X-lc" && continue
1509 *-*-rhapsody* | *-*-darwin1.[012])
1510 # Rhapsody C and math libraries are in the System framework
1511 deplibs="$deplibs -framework System"
1514 elif test "X$arg" = "X-lc_r"; then
1516 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1517 # Do not include libc_r directly, use -pthread flag.
1522 deplibs="$deplibs $arg"
1526 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1527 # classes, name mangling, and exception handling.
1529 compile_command="$compile_command $arg"
1530 compiler_flags="$compiler_flags $arg"
1531 finalize_command="$finalize_command $arg"
1536 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1537 compiler_flags="$compiler_flags $arg"
1538 compile_command="$compile_command $arg"
1539 finalize_command="$finalize_command $arg"
1540 deplibs="$deplibs $arg"
1548 # Do not build the useless static library
1555 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1556 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1557 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1558 # +DA*, +DD* enable 64-bit mode on the HP compiler
1559 # -q* pass through compiler args for the IBM compiler
1560 # -m* pass through architecture-specific compiler args for GCC
1561 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1563 # Unknown arguments in both finalize_command and compile_command need
1564 # to be aesthetically quoted because they are evaled later.
1565 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1567 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1571 compile_command="$compile_command $arg"
1572 finalize_command="$finalize_command $arg"
1573 if test "$with_gcc" = "yes" ; then
1574 compiler_flags="$compiler_flags $arg"
1591 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1592 # The PATH hackery in wrapper scripts is required on Windows
1593 # in order for the loader to find any dlls it needs.
1594 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1595 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1598 *) no_install=yes ;;
1615 -precious-files-regex)
1636 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1637 # We need an absolute path.
1639 [\\/]* | [A-Za-z]:[\\/]*) ;;
1641 $echo "$modename: only absolute run-paths are allowed" 1>&2
1647 *) xrpath="$xrpath $dir" ;;
1653 # The effects of -static are defined in a previous loop.
1654 # We used to do the same as -all-static on platforms that
1655 # didn't have a PIC flag, but the assumption that the effects
1656 # would be equivalent was wrong. It would break on at least
1657 # Digital Unix and AIX.
1677 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1679 save_ifs="$IFS"; IFS=','
1680 for flag in $args; do
1683 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1688 compiler_flags="$compiler_flags $flag"
1691 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1695 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1697 save_ifs="$IFS"; IFS=','
1698 for flag in $args; do
1701 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1706 compiler_flags="$compiler_flags $wl$flag"
1707 linker_flags="$linker_flags $flag"
1710 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1728 # Some other compiler flag.
1730 # Unknown arguments in both finalize_command and compile_command need
1731 # to be aesthetically quoted because they are evaled later.
1732 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1734 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1741 # A standard object.
1746 # A libtool-controlled object.
1748 # Check to see that this really is a libtool object.
1749 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1754 # If there is no directory component, then add one.
1756 */* | *\\*) . $arg ;;
1760 if test -z "$pic_object" || \
1761 test -z "$non_pic_object" ||
1762 test "$pic_object" = none && \
1763 test "$non_pic_object" = none; then
1764 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1768 # Extract subdirectory from the argument.
1769 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1770 if test "X$xdir" = "X$arg"; then
1776 if test "$pic_object" != none; then
1777 # Prepend the subdirectory the object is found in.
1778 pic_object="$xdir$pic_object"
1780 if test "$prev" = dlfiles; then
1781 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1782 dlfiles="$dlfiles $pic_object"
1786 # If libtool objects are unsupported, then we need to preload.
1791 # CHECK ME: I think I busted this. -Ossama
1792 if test "$prev" = dlprefiles; then
1793 # Preload the old-style object.
1794 dlprefiles="$dlprefiles $pic_object"
1799 libobjs="$libobjs $pic_object"
1804 if test "$non_pic_object" != none; then
1805 # Prepend the subdirectory the object is found in.
1806 non_pic_object="$xdir$non_pic_object"
1808 # A standard non-PIC object
1809 non_pic_objects="$non_pic_objects $non_pic_object"
1810 if test -z "$pic_object" || test "$pic_object" = none ; then
1811 arg="$non_pic_object"
1815 # Only an error if not doing a dry-run.
1816 if test -z "$run"; then
1817 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1822 # Extract subdirectory from the argument.
1823 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1824 if test "X$xdir" = "X$arg"; then
1830 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1831 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1832 libobjs="$libobjs $pic_object"
1833 non_pic_objects="$non_pic_objects $non_pic_object"
1840 deplibs="$deplibs $arg"
1841 old_deplibs="$old_deplibs $arg"
1846 # A libtool-controlled library.
1848 if test "$prev" = dlfiles; then
1849 # This library was specified with -dlopen.
1850 dlfiles="$dlfiles $arg"
1852 elif test "$prev" = dlprefiles; then
1853 # The library was specified with -dlpreopen.
1854 dlprefiles="$dlprefiles $arg"
1857 deplibs="$deplibs $arg"
1862 # Some other compiler argument.
1864 # Unknown arguments in both finalize_command and compile_command need
1865 # to be aesthetically quoted because they are evaled later.
1866 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1868 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1875 # Now actually substitute the argument into the commands.
1876 if test -n "$arg"; then
1877 compile_command="$compile_command $arg"
1878 finalize_command="$finalize_command $arg"
1880 done # argument parsing loop
1882 if test -n "$prev"; then
1883 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1888 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1889 eval arg=\"$export_dynamic_flag_spec\"
1890 compile_command="$compile_command $arg"
1891 finalize_command="$finalize_command $arg"
1895 # calculate the name of the file, without its directory
1896 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1897 libobjs_save="$libobjs"
1899 if test -n "$shlibpath_var"; then
1900 # get the directories listed in $shlibpath_var
1901 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1905 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1906 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1908 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1909 if test "X$output_objdir" = "X$output"; then
1910 output_objdir="$objdir"
1912 output_objdir="$output_objdir/$objdir"
1914 # Create the object directory.
1915 if test ! -d "$output_objdir"; then
1916 $show "$mkdir $output_objdir"
1917 $run $mkdir $output_objdir
1919 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1924 # Determine the type of output
1927 $echo "$modename: you must specify an output file" 1>&2
1931 *.$libext) linkmode=oldlib ;;
1932 *.lo | *.$objext) linkmode=obj ;;
1933 *.la) linkmode=lib ;;
1934 *) linkmode=prog ;; # Anything else should be a program.
1938 *cygwin* | *mingw* | *pw32*)
1939 # don't eliminate duplications in $postdeps and $predeps
1940 duplicate_compiler_generated_deps=yes
1943 duplicate_compiler_generated_deps=$duplicate_deps
1949 # Find all interdependent deplibs by searching for libraries
1950 # that are linked more than once (e.g. -la -lb -la)
1951 for deplib in $deplibs; do
1952 if test "X$duplicate_deps" = "Xyes" ; then
1954 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1957 libs="$libs $deplib"
1960 if test "$linkmode" = lib; then
1961 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1963 # Compute libraries that are listed more than once in $predeps
1964 # $postdeps and mark them as special (i.e., whose duplicates are
1965 # not to be eliminated).
1967 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1968 for pre_post_dep in $predeps $postdeps; do
1969 case "$pre_post_deps " in
1970 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1972 pre_post_deps="$pre_post_deps $pre_post_dep"
1981 need_relink=no # whether we're linking any uninstalled libtool libraries
1982 notinst_deplibs= # not-installed libtool libraries
1983 notinst_path= # paths that contain not-installed libtool libraries
1987 for file in $dlfiles $dlprefiles; do
1991 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2003 passes="conv scan dlopen dlpreopen link"
2008 for pass in $passes; do
2009 if test "$linkmode,$pass" = "lib,link" ||
2010 test "$linkmode,$pass" = "prog,scan"; then
2014 if test "$linkmode" = prog; then
2016 dlopen) libs="$dlfiles" ;;
2017 dlpreopen) libs="$dlprefiles" ;;
2018 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2021 if test "$pass" = dlopen; then
2022 # Collect dlpreopened libraries
2023 save_deplibs="$deplibs"
2026 for deplib in $libs; do
2030 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2031 if test "$linkmode,$pass" = "prog,link"; then
2032 compile_deplibs="$deplib $compile_deplibs"
2033 finalize_deplibs="$deplib $finalize_deplibs"
2035 compiler_flags="$compiler_flags $deplib"
2040 deplibs="$deplib $deplibs"
2041 test "$pass" = conv && continue
2042 newdependency_libs="$deplib $newdependency_libs"
2045 if test "$pass" = conv; then
2046 deplibs="$deplib $deplibs"
2049 if test "$pass" = scan; then
2050 deplibs="$deplib $deplibs"
2052 compile_deplibs="$deplib $compile_deplibs"
2053 finalize_deplibs="$deplib $finalize_deplibs"
2063 if test "$linkmode" != lib && test "$linkmode" != prog; then
2064 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2067 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2068 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2069 for search_ext in .la $std_shrext .so .a; do
2070 # Search the libtool library
2071 lib="$searchdir/lib${name}${search_ext}"
2072 if test -f "$lib"; then
2073 if test "$search_ext" = ".la"; then
2082 if test "$found" != yes; then
2083 # deplib doesn't seem to be a libtool library
2084 if test "$linkmode,$pass" = "prog,link"; then
2085 compile_deplibs="$deplib $compile_deplibs"
2086 finalize_deplibs="$deplib $finalize_deplibs"
2088 deplibs="$deplib $deplibs"
2089 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2092 else # deplib is a libtool library
2093 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2094 # We need to do some special things here, and not later.
2095 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2096 case " $predeps $postdeps " in
2098 if (${SED} -e '2q' $lib |
2099 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2103 */* | *\\*) . $lib ;;
2106 for l in $old_library $library_names; do
2109 if test "X$ll" = "X$old_library" ; then # only static version available
2111 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2112 test "X$ladir" = "X$lib" && ladir="."
2113 lib=$ladir/$old_library
2114 if test "$linkmode,$pass" = "prog,link"; then
2115 compile_deplibs="$deplib $compile_deplibs"
2116 finalize_deplibs="$deplib $finalize_deplibs"
2118 deplibs="$deplib $deplibs"
2119 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2133 deplibs="$deplib $deplibs"
2134 test "$pass" = conv && continue
2135 newdependency_libs="$deplib $newdependency_libs"
2136 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2139 if test "$pass" = conv; then
2140 deplibs="$deplib $deplibs"
2143 if test "$pass" = scan; then
2144 deplibs="$deplib $deplibs"
2146 compile_deplibs="$deplib $compile_deplibs"
2147 finalize_deplibs="$deplib $finalize_deplibs"
2149 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2152 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2158 if test "$pass" = link; then
2159 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2160 # Make sure the xrpath contains only unique directories.
2163 *) xrpath="$xrpath $dir" ;;
2166 deplibs="$deplib $deplibs"
2169 *.la) lib="$deplib" ;;
2171 if test "$pass" = conv; then
2172 deplibs="$deplib $deplibs"
2178 case $deplibs_check_method in
2180 set dummy $deplibs_check_method
2181 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2182 if eval $echo \"$deplib\" 2>/dev/null \
2184 | $EGREP "$match_pattern_regex" > /dev/null; then
2192 if test "$valid_a_lib" != yes; then
2194 $echo "*** Warning: Trying to link with static lib archive $deplib."
2195 $echo "*** I have the capability to make that library automatically link in when"
2196 $echo "*** you link to this library. But I can only do this if you have a"
2197 $echo "*** shared version of the library, which you do not appear to have"
2198 $echo "*** because the file extensions .$libext of this argument makes me believe"
2199 $echo "*** that it is just a static archive that I should not used here."
2202 $echo "*** Warning: Linking the shared library $output against the"
2203 $echo "*** static library $deplib is not portable!"
2204 deplibs="$deplib $deplibs"
2209 if test "$pass" != link; then
2210 deplibs="$deplib $deplibs"
2212 compile_deplibs="$deplib $compile_deplibs"
2213 finalize_deplibs="$deplib $finalize_deplibs"
2220 if test "$pass" = conv; then
2221 deplibs="$deplib $deplibs"
2222 elif test "$linkmode" = prog; then
2223 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2224 # If there is no dlopen support or we're linking statically,
2225 # we need to preload.
2226 newdlprefiles="$newdlprefiles $deplib"
2227 compile_deplibs="$deplib $compile_deplibs"
2228 finalize_deplibs="$deplib $finalize_deplibs"
2230 newdlfiles="$newdlfiles $deplib"
2240 if test "$found" = yes || test -f "$lib"; then :
2242 $echo "$modename: cannot find the library \`$lib'" 1>&2
2246 # Check to see that this really is a libtool archive.
2247 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2249 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2253 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2254 test "X$ladir" = "X$lib" && ladir="."
2262 # If the library was installed with an old release of libtool,
2263 # it will not redefine variables installed, or shouldnotlink
2271 */* | *\\*) . $lib ;;
2275 if test "$linkmode,$pass" = "lib,link" ||
2276 test "$linkmode,$pass" = "prog,scan" ||
2277 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2278 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2279 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2282 if test "$pass" = conv; then
2283 # Only check for convenience libraries
2284 deplibs="$lib $deplibs"
2285 if test -z "$libdir"; then
2286 if test -z "$old_library"; then
2287 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2290 # It is a libtool convenience library, so add in its objects.
2291 convenience="$convenience $ladir/$objdir/$old_library"
2292 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2294 for deplib in $dependency_libs; do
2295 deplibs="$deplib $deplibs"
2296 if test "X$duplicate_deps" = "Xyes" ; then
2297 case "$tmp_libs " in
2298 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2301 tmp_libs="$tmp_libs $deplib"
2303 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2304 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2311 # Get the name of the library we link against.
2313 for l in $old_library $library_names; do
2316 if test -z "$linklib"; then
2317 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2321 # This library was specified with -dlopen.
2322 if test "$pass" = dlopen; then
2323 if test -z "$libdir"; then
2324 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2327 if test -z "$dlname" ||
2328 test "$dlopen_support" != yes ||
2329 test "$build_libtool_libs" = no; then
2330 # If there is no dlname, no dlopen support or we're linking
2331 # statically, we need to preload. We also need to preload any
2332 # dependent libraries so libltdl's deplib preloader doesn't
2333 # bomb out in the load deplibs phase.
2334 dlprefiles="$dlprefiles $lib $dependency_libs"
2336 newdlfiles="$newdlfiles $lib"
2341 # We need an absolute path.
2343 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2345 abs_ladir=`cd "$ladir" && pwd`
2346 if test -z "$abs_ladir"; then
2347 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2348 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2353 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2355 # Find the relevant object directory and library name.
2356 if test "X$installed" = Xyes; then
2357 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2358 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2366 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2368 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2371 # Remove this search path later
2372 notinst_path="$notinst_path $abs_ladir"
2374 dir="$ladir/$objdir"
2375 absdir="$abs_ladir/$objdir"
2376 # Remove this search path later
2377 notinst_path="$notinst_path $abs_ladir"
2379 fi # $installed = yes
2380 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2382 # This library was specified with -dlpreopen.
2383 if test "$pass" = dlpreopen; then
2384 if test -z "$libdir"; then
2385 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2388 # Prefer using a static library (so that no silly _DYNAMIC symbols
2389 # are required to link).
2390 if test -n "$old_library"; then
2391 newdlprefiles="$newdlprefiles $dir/$old_library"
2392 # Otherwise, use the dlname, so that lt_dlopen finds it.
2393 elif test -n "$dlname"; then
2394 newdlprefiles="$newdlprefiles $dir/$dlname"
2396 newdlprefiles="$newdlprefiles $dir/$linklib"
2398 fi # $pass = dlpreopen
2400 if test -z "$libdir"; then
2401 # Link the convenience library
2402 if test "$linkmode" = lib; then
2403 deplibs="$dir/$old_library $deplibs"
2404 elif test "$linkmode,$pass" = "prog,link"; then
2405 compile_deplibs="$dir/$old_library $compile_deplibs"
2406 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2408 deplibs="$lib $deplibs" # used for prog,scan pass
2414 if test "$linkmode" = prog && test "$pass" != link; then
2415 newlib_search_path="$newlib_search_path $ladir"
2416 deplibs="$lib $deplibs"
2419 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2420 test "$build_libtool_libs" = no; then
2425 for deplib in $dependency_libs; do
2427 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2429 # Need to link against all dependency_libs?
2430 if test "$linkalldeplibs" = yes; then
2431 deplibs="$deplib $deplibs"
2433 # Need to hardcode shared library paths
2434 # or/and link against static libraries
2435 newdependency_libs="$deplib $newdependency_libs"
2437 if test "X$duplicate_deps" = "Xyes" ; then
2438 case "$tmp_libs " in
2439 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2442 tmp_libs="$tmp_libs $deplib"
2445 fi # $linkmode = prog...
2447 if test "$linkmode,$pass" = "prog,link"; then
2448 if test -n "$library_names" &&
2449 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2450 # We need to hardcode the library path
2451 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2452 # Make sure the rpath contains only unique directories.
2453 case "$temp_rpath " in
2456 *) temp_rpath="$temp_rpath $absdir" ;;
2460 # Hardcode the library path.
2461 # Skip directories that are in the system default run-time
2463 case " $sys_lib_dlsearch_path " in
2466 case "$compile_rpath " in
2468 *) compile_rpath="$compile_rpath $absdir"
2472 case " $sys_lib_dlsearch_path " in
2475 case "$finalize_rpath " in
2477 *) finalize_rpath="$finalize_rpath $libdir"
2481 fi # $linkmode,$pass = prog,link...
2483 if test "$alldeplibs" = yes &&
2484 { test "$deplibs_check_method" = pass_all ||
2485 { test "$build_libtool_libs" = yes &&
2486 test -n "$library_names"; }; }; then
2487 # We only need to search for static libraries
2492 link_static=no # Whether the deplib will be linked statically
2493 if test -n "$library_names" &&
2494 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2495 if test "$installed" = no; then
2496 notinst_deplibs="$notinst_deplibs $lib"
2499 # This is a shared library
2501 # Warn about portability, can't link against -module's on
2502 # some systems (darwin)
2503 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2505 if test "$linkmode" = prog; then
2506 $echo "*** Warning: Linking the executable $output against the loadable module"
2508 $echo "*** Warning: Linking the shared library $output against the loadable module"
2510 $echo "*** $linklib is not portable!"
2512 if test "$linkmode" = lib &&
2513 test "$hardcode_into_libs" = yes; then
2514 # Hardcode the library path.
2515 # Skip directories that are in the system default run-time
2517 case " $sys_lib_dlsearch_path " in
2520 case "$compile_rpath " in
2522 *) compile_rpath="$compile_rpath $absdir"
2526 case " $sys_lib_dlsearch_path " in
2529 case "$finalize_rpath " in
2531 *) finalize_rpath="$finalize_rpath $libdir"
2537 if test -n "$old_archive_from_expsyms_cmds"; then
2538 # figure out the soname
2539 set dummy $library_names
2542 libname=`eval \\$echo \"$libname_spec\"`
2543 # use dlname if we got it. it's perfectly good, no?
2544 if test -n "$dlname"; then
2546 elif test -n "$soname_spec"; then
2550 major=`expr $current - $age`
2554 eval soname=\"$soname_spec\"
2559 # Make a new name for the extract_expsyms_cmds to use
2561 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2562 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2564 # If the library has no export list, then create one now
2565 if test -f "$output_objdir/$soname-def"; then :
2567 $show "extracting exported symbol list from \`$soname'"
2568 save_ifs="$IFS"; IFS='~'
2569 cmds=$extract_expsyms_cmds
2570 for cmd in $cmds; do
2574 $run eval "$cmd" || exit $?
2580 if test -f "$output_objdir/$newlib"; then :; else
2581 $show "generating import library for \`$soname'"
2582 save_ifs="$IFS"; IFS='~'
2583 cmds=$old_archive_from_expsyms_cmds
2584 for cmd in $cmds; do
2588 $run eval "$cmd" || exit $?
2592 # make sure the library variables are pointing to the new library
2595 fi # test -n "$old_archive_from_expsyms_cmds"
2597 if test "$linkmode" = prog || test "$mode" != relink; then
2602 case $hardcode_action in
2603 immediate | unsupported)
2604 if test "$hardcode_direct" = no; then
2607 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2609 # if the lib is a module then we can not link against
2610 # it, someone is ignoring the new warnings I added
2611 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2612 $echo "** Warning, lib $linklib is a module, not a shared library"
2613 if test -z "$old_library" ; then
2615 $echo "** And there doesn't seem to be a static archive available"
2616 $echo "** The link will probably fail, sorry"
2618 add="$dir/$old_library"
2622 elif test "$hardcode_minus_L" = no; then
2624 *-*-sunos*) add_shlibpath="$dir" ;;
2628 elif test "$hardcode_shlibpath_var" = no; then
2629 add_shlibpath="$dir"
2636 if test "$hardcode_direct" = yes; then
2638 elif test "$hardcode_minus_L" = yes; then
2640 # Try looking first in the location we're being installed to.
2641 if test -n "$inst_prefix_dir"; then
2644 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2649 elif test "$hardcode_shlibpath_var" = yes; then
2650 add_shlibpath="$dir"
2659 if test "$lib_linked" != yes; then
2660 $echo "$modename: configuration error: unsupported hardcode properties"
2664 if test -n "$add_shlibpath"; then
2665 case :$compile_shlibpath: in
2666 *":$add_shlibpath:"*) ;;
2667 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2670 if test "$linkmode" = prog; then
2671 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2672 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2674 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2675 test -n "$add" && deplibs="$add $deplibs"
2676 if test "$hardcode_direct" != yes && \
2677 test "$hardcode_minus_L" != yes && \
2678 test "$hardcode_shlibpath_var" = yes; then
2679 case :$finalize_shlibpath: in
2681 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2687 if test "$linkmode" = prog || test "$mode" = relink; then
2691 # Finalize command for both is simple: just hardcode it.
2692 if test "$hardcode_direct" = yes; then
2693 add="$libdir/$linklib"
2694 elif test "$hardcode_minus_L" = yes; then
2697 elif test "$hardcode_shlibpath_var" = yes; then
2698 case :$finalize_shlibpath: in
2700 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2703 elif test "$hardcode_automatic" = yes; then
2704 if test -n "$inst_prefix_dir" &&
2705 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2706 add="$inst_prefix_dir$libdir/$linklib"
2708 add="$libdir/$linklib"
2711 # We cannot seem to hardcode it, guess we'll fake it.
2713 # Try looking first in the location we're being installed to.
2714 if test -n "$inst_prefix_dir"; then
2717 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2724 if test "$linkmode" = prog; then
2725 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2726 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2728 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2729 test -n "$add" && deplibs="$add $deplibs"
2732 elif test "$linkmode" = prog; then
2733 # Here we assume that one of hardcode_direct or hardcode_minus_L
2734 # is not unsupported. This is valid on all known static and
2736 if test "$hardcode_direct" != unsupported; then
2737 test -n "$old_library" && linklib="$old_library"
2738 compile_deplibs="$dir/$linklib $compile_deplibs"
2739 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2741 compile_deplibs="-l$name -L$dir $compile_deplibs"
2742 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2744 elif test "$build_libtool_libs" = yes; then
2745 # Not a shared library
2746 if test "$deplibs_check_method" != pass_all; then
2747 # We're trying link a shared library against a static one
2748 # but the system doesn't support it.
2750 # Just print a warning and add the library to dependency_libs so
2751 # that the program can be linked against the static library.
2753 $echo "*** Warning: This system can not link to static lib archive $lib."
2754 $echo "*** I have the capability to make that library automatically link in when"
2755 $echo "*** you link to this library. But I can only do this if you have a"
2756 $echo "*** shared version of the library, which you do not appear to have."
2757 if test "$module" = yes; then
2758 $echo "*** But as you try to build a module library, libtool will still create "
2759 $echo "*** a static module, that should work as long as the dlopening application"
2760 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2761 if test -z "$global_symbol_pipe"; then
2763 $echo "*** However, this would only work if libtool was able to extract symbol"
2764 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2765 $echo "*** not find such a program. So, this module is probably useless."
2766 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2768 if test "$build_old_libs" = no; then
2769 build_libtool_libs=module
2772 build_libtool_libs=no
2776 deplibs="$dir/$old_library $deplibs"
2779 fi # link shared/static library?
2781 if test "$linkmode" = lib; then
2782 if test -n "$dependency_libs" &&
2783 { test "$hardcode_into_libs" != yes ||
2784 test "$build_old_libs" = yes ||
2785 test "$link_static" = yes; }; then
2786 # Extract -R from dependency_libs
2788 for libdir in $dependency_libs; do
2790 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2792 *" $temp_xrpath "*) ;;
2793 *) xrpath="$xrpath $temp_xrpath";;
2795 *) temp_deplibs="$temp_deplibs $libdir";;
2798 dependency_libs="$temp_deplibs"
2801 newlib_search_path="$newlib_search_path $absdir"
2802 # Link against this library
2803 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2804 # ... and its dependency_libs
2806 for deplib in $dependency_libs; do
2807 newdependency_libs="$deplib $newdependency_libs"
2808 if test "X$duplicate_deps" = "Xyes" ; then
2809 case "$tmp_libs " in
2810 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2813 tmp_libs="$tmp_libs $deplib"
2816 if test "$link_all_deplibs" != no; then
2817 # Add the search paths of all dependency libraries
2818 for deplib in $dependency_libs; do
2820 -L*) path="$deplib" ;;
2822 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2823 test "X$dir" = "X$deplib" && dir="."
2824 # We need an absolute path.
2826 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2828 absdir=`cd "$dir" && pwd`
2829 if test -z "$absdir"; then
2830 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2835 if grep "^installed=no" $deplib > /dev/null; then
2836 path="$absdir/$objdir"
2838 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2839 if test -z "$libdir"; then
2840 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2843 if test "$absdir" != "$libdir"; then
2844 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2851 # we do not want to link against static libs,
2852 # but need to link against shared
2853 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2854 if test -n "$deplibrary_names" ; then
2855 for tmp in $deplibrary_names ; do
2858 if test -f "$path/$depdepl" ; then
2859 depdepl="$path/$depdepl"
2861 # do not add paths which are already there
2862 case " $newlib_search_path " in
2864 *) newlib_search_path="$newlib_search_path $path";;
2877 # Again, we only want to link against shared libraries
2878 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2879 for tmp in $newlib_search_path ; do
2880 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2881 eval depdepl="$tmp/lib$tmp_libs.dylib"
2892 case " $deplibs " in
2894 *) deplibs="$path $deplibs" ;;
2896 case " $deplibs " in
2898 *) deplibs="$depdepl $deplibs" ;;
2901 fi # link_all_deplibs != no
2903 done # for deplib in $libs
2904 dependency_libs="$newdependency_libs"
2905 if test "$pass" = dlpreopen; then
2906 # Link the dlpreopened libraries before other libraries
2907 for deplib in $save_deplibs; do
2908 deplibs="$deplib $deplibs"
2911 if test "$pass" != dlopen; then
2912 if test "$pass" != conv; then
2913 # Make sure lib_search_path contains only unique directories.
2915 for dir in $newlib_search_path; do
2916 case "$lib_search_path " in
2918 *) lib_search_path="$lib_search_path $dir" ;;
2924 if test "$linkmode,$pass" != "prog,link"; then
2927 vars="compile_deplibs finalize_deplibs"
2929 for var in $vars dependency_libs; do
2930 # Add libraries to $var in reverse order
2931 eval tmp_libs=\"\$$var\"
2933 for deplib in $tmp_libs; do
2934 # FIXME: Pedantically, this is the right thing to do, so
2935 # that some nasty dependency loop isn't accidentally
2937 #new_libs="$deplib $new_libs"
2938 # Pragmatically, this seems to cause very few problems in
2941 -L*) new_libs="$deplib $new_libs" ;;
2944 # And here is the reason: when a library appears more
2945 # than once as an explicit dependence of a library, or
2946 # is implicitly linked in more than once by the
2947 # compiler, it is considered special, and multiple
2948 # occurrences thereof are not removed. Compare this
2949 # with having the same library being listed as a
2950 # dependency of multiple other libraries: in this case,
2951 # we know (pedantically, we assume) the library does not
2952 # need to be listed more than once, so we keep only the
2953 # last copy. This is not always right, but it is rare
2954 # enough that we require users that really mean to play
2955 # such unportable linking tricks to link the library
2956 # using -Wl,-lname, so that libtool does not consider it
2957 # for duplicate removal.
2958 case " $specialdeplibs " in
2959 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2961 case " $new_libs " in
2963 *) new_libs="$deplib $new_libs" ;;
2971 for deplib in $new_libs; do
2974 case " $tmp_libs " in
2976 *) tmp_libs="$tmp_libs $deplib" ;;
2979 *) tmp_libs="$tmp_libs $deplib" ;;
2982 eval $var=\"$tmp_libs\"
2985 # Last step: remove runtime libs from dependency_libs
2986 # (they stay in deplibs)
2988 for i in $dependency_libs ; do
2989 case " $predeps $postdeps $compiler_lib_search_path " in
2994 if test -n "$i" ; then
2995 tmp_libs="$tmp_libs $i"
2998 dependency_libs=$tmp_libs
3000 if test "$linkmode" = prog; then
3001 dlfiles="$newdlfiles"
3002 dlprefiles="$newdlprefiles"
3007 if test -n "$deplibs"; then
3008 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3011 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3012 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3015 if test -n "$rpath"; then
3016 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3019 if test -n "$xrpath"; then
3020 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3023 if test -n "$vinfo"; then
3024 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3027 if test -n "$release"; then
3028 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3031 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3032 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3035 # Now set the variables for building old libraries.
3036 build_libtool_libs=no
3038 objs="$objs$old_deplibs"
3042 # Make sure we only generate libraries of the form `libNAME.la'.
3045 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3046 eval shared_ext=\"$shrext_cmds\"
3047 eval libname=\"$libname_spec\"
3050 if test "$module" = no; then
3051 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3055 if test "$need_lib_prefix" != no; then
3056 # Add the "lib" prefix for modules if required
3057 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3058 eval shared_ext=\"$shrext_cmds\"
3059 eval libname=\"$libname_spec\"
3061 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3066 if test -n "$objs"; then
3067 if test "$deplibs_check_method" != pass_all; then
3068 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3072 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3073 $echo "*** objects $objs is not portable!"
3074 libobjs="$libobjs $objs"
3078 if test "$dlself" != no; then
3079 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3083 if test "$#" -gt 2; then
3084 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3089 if test -z "$rpath"; then
3090 if test "$build_libtool_libs" = yes; then
3091 # Building a libtool convenience library.
3092 # Some compilers have problems with a `.al' extension so
3093 # convenience libraries should have the same extension an
3094 # archive normally would.
3095 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3096 build_libtool_libs=convenience
3100 if test -n "$vinfo"; then
3101 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3104 if test -n "$release"; then
3105 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3109 # Parse the version information argument.
3110 save_ifs="$IFS"; IFS=':'
3111 set dummy $vinfo 0 0 0
3114 if test -n "$8"; then
3115 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3120 # convert absolute version numbers to libtool ages
3121 # this retains compatibility with .la files and attempts
3122 # to make the code below a bit more comprehensible
3124 case $vinfo_number in
3128 number_revision="$4"
3130 # There are really only two kinds -- those that
3131 # use the current revision as the major version
3132 # and those that subtract age and use age as
3133 # a minor version. But, then there is irix
3134 # which has an extra 1 added just for fun
3136 case $version_type in
3137 darwin|linux|osf|windows)
3138 current=`expr $number_major + $number_minor`
3140 revision="$number_revision"
3142 freebsd-aout|freebsd-elf|sunos)
3143 current="$number_major"
3144 revision="$number_minor"
3148 current=`expr $number_major + $number_minor - 1`
3150 revision="$number_minor"
3161 # Check that each of the things are valid numbers.
3163 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]) ;;
3165 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3166 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3172 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]) ;;
3174 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3175 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3181 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]) ;;
3183 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3184 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3189 if test "$age" -gt "$current"; then
3190 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3191 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3195 # Calculate the version variables.
3199 case $version_type in
3203 # Like Linux, but with the current version available in
3204 # verstring for coding it into the library header
3205 major=.`expr $current - $age`
3206 versuffix="$major.$age.$revision"
3207 # Darwin ld doesn't like 0 for these options...
3208 minor_current=`expr $current + 1`
3209 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3214 versuffix=".$current.$revision";
3219 versuffix=".$current";
3223 major=`expr $current - $age + 1`
3225 case $version_type in
3226 nonstopux) verstring_prefix=nonstopux ;;
3227 *) verstring_prefix=sgi ;;
3229 verstring="$verstring_prefix$major.$revision"
3231 # Add in all the interfaces that we are compatible with.
3233 while test "$loop" -ne 0; do
3234 iface=`expr $revision - $loop`
3235 loop=`expr $loop - 1`
3236 verstring="$verstring_prefix$major.$iface:$verstring"
3239 # Before this point, $major must not contain `.'.
3241 versuffix="$major.$revision"
3245 major=.`expr $current - $age`
3246 versuffix="$major.$age.$revision"
3250 major=.`expr $current - $age`
3251 versuffix=".$current.$age.$revision"
3252 verstring="$current.$age.$revision"
3254 # Add in all the interfaces that we are compatible with.
3256 while test "$loop" -ne 0; do
3257 iface=`expr $current - $loop`
3258 loop=`expr $loop - 1`
3259 verstring="$verstring:${iface}.0"
3262 # Make executables depend on our current version.
3263 verstring="$verstring:${current}.0"
3268 versuffix=".$current.$revision"
3272 # Use '-' rather than '.', since we only want one
3273 # extension on DOS 8.3 filesystems.
3274 major=`expr $current - $age`
3279 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3280 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3285 # Clear the version info if we defaulted, and they specified a release.
3286 if test -z "$vinfo" && test -n "$release"; then
3288 case $version_type in
3290 # we can't check for "0.0" in archive_cmds due to quoting
3291 # problems, so we reset it completely
3298 if test "$need_version" = no; then
3305 # Remove version info from name if versioning should be avoided
3306 if test "$avoid_version" = yes && test "$need_version" = no; then
3312 # Check to see if the archive will have undefined symbols.
3313 if test "$allow_undefined" = yes; then
3314 if test "$allow_undefined_flag" = unsupported; then
3315 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3316 build_libtool_libs=no
3320 # Don't allow undefined symbols.
3321 allow_undefined_flag="$no_undefined_flag"
3325 if test "$mode" != relink; then
3326 # Remove our outputs, but don't remove object files since they
3327 # may have been created when compiling PIC objects.
3329 tempremovelist=`$echo "$output_objdir/*"`
3330 for p in $tempremovelist; do
3334 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3335 if test "X$precious_files_regex" != "X"; then
3336 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3341 removelist="$removelist $p"
3346 if test -n "$removelist"; then
3347 $show "${rm}r $removelist"
3348 $run ${rm}r $removelist
3352 # Now set the variables for building old libraries.
3353 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3354 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3356 # Transform .lo files to .o files.
3357 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3360 # Eliminate all temporary directories.
3361 for path in $notinst_path; do
3362 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3363 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3364 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3367 if test -n "$xrpath"; then
3368 # If the user specified any rpath flags, then add them.
3370 for libdir in $xrpath; do
3371 temp_xrpath="$temp_xrpath -R$libdir"
3372 case "$finalize_rpath " in
3374 *) finalize_rpath="$finalize_rpath $libdir" ;;
3377 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3378 dependency_libs="$temp_xrpath $dependency_libs"
3382 # Make sure dlfiles contains only unique files that won't be dlpreopened
3383 old_dlfiles="$dlfiles"
3385 for lib in $old_dlfiles; do
3386 case " $dlprefiles $dlfiles " in
3388 *) dlfiles="$dlfiles $lib" ;;
3392 # Make sure dlprefiles contains only unique files
3393 old_dlprefiles="$dlprefiles"
3395 for lib in $old_dlprefiles; do
3396 case "$dlprefiles " in
3398 *) dlprefiles="$dlprefiles $lib" ;;
3402 if test "$build_libtool_libs" = yes; then
3403 if test -n "$rpath"; then
3405 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3406 # these systems don't actually have a c library (as such)!
3408 *-*-rhapsody* | *-*-darwin1.[012])
3409 # Rhapsody C library is in the System framework
3410 deplibs="$deplibs -framework System"
3413 # Don't link with libc until the a.out ld.so is fixed.
3415 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3416 # Do not include libc due to us having libc/libc_r.
3417 test "X$arg" = "X-lc" && continue
3420 # Add libc to deplibs on all other systems if necessary.
3421 if test "$build_libtool_need_lc" = "yes"; then
3422 deplibs="$deplibs -lc"
3428 # Transform deplibs into only deplibs that can be linked in shared.
3430 libname_save=$libname
3431 release_save=$release
3432 versuffix_save=$versuffix
3434 # I'm not sure if I'm treating the release correctly. I think
3435 # release should show up in the -l (ie -lgmp5) so we don't want to
3436 # add it in twice. Is that correct?
3442 case $deplibs_check_method in
3444 # Don't check for shared/static. Everything works.
3445 # This might be a little naive. We might want to check
3446 # whether the library exists or not. But this is on
3447 # osf3 & osf4 and I'm not really sure... Just
3448 # implementing what was already the behavior.
3452 # This code stresses the "libraries are programs" paradigm to its
3453 # limits. Maybe even breaks it. We compile a program, linking it
3454 # against the deplibs as a proxy for the library. Then we can check
3455 # whether they linked in statically or dynamically with ldd.
3457 cat > conftest.c <<EOF
3458 int main() { return 0; }
3461 $LTCC -o conftest conftest.c $deplibs
3462 if test "$?" -eq 0 ; then
3463 ldd_output=`ldd conftest`
3464 for i in $deplibs; do
3465 name=`expr $i : '-l\(.*\)'`
3466 # If $name is empty we are operating on a -L argument.
3467 if test "$name" != "" && test "$name" -ne "0"; then
3468 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3469 case " $predeps $postdeps " in
3471 newdeplibs="$newdeplibs $i"
3476 if test -n "$i" ; then
3477 libname=`eval \\$echo \"$libname_spec\"`
3478 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3479 set dummy $deplib_matches
3481 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3482 newdeplibs="$newdeplibs $i"
3486 $echo "*** Warning: dynamic linker does not accept needed library $i."
3487 $echo "*** I have the capability to make that library automatically link in when"
3488 $echo "*** you link to this library. But I can only do this if you have a"
3489 $echo "*** shared version of the library, which I believe you do not have"
3490 $echo "*** because a test_compile did reveal that the linker did not use it for"
3491 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3495 newdeplibs="$newdeplibs $i"
3499 # Error occurred in the first compile. Let's try to salvage
3500 # the situation: Compile a separate program for each library.
3501 for i in $deplibs; do
3502 name=`expr $i : '-l\(.*\)'`
3503 # If $name is empty we are operating on a -L argument.
3504 if test "$name" != "" && test "$name" != "0"; then
3506 $LTCC -o conftest conftest.c $i
3508 if test "$?" -eq 0 ; then
3509 ldd_output=`ldd conftest`
3510 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3511 case " $predeps $postdeps " in
3513 newdeplibs="$newdeplibs $i"
3518 if test -n "$i" ; then
3519 libname=`eval \\$echo \"$libname_spec\"`
3520 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3521 set dummy $deplib_matches
3523 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3524 newdeplibs="$newdeplibs $i"
3528 $echo "*** Warning: dynamic linker does not accept needed library $i."
3529 $echo "*** I have the capability to make that library automatically link in when"
3530 $echo "*** you link to this library. But I can only do this if you have a"
3531 $echo "*** shared version of the library, which you do not appear to have"
3532 $echo "*** because a test_compile did reveal that the linker did not use this one"
3533 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3539 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3540 $echo "*** make it link in! You will probably need to install it or some"
3541 $echo "*** library that it depends on before this library will be fully"
3542 $echo "*** functional. Installing it before continuing would be even better."
3545 newdeplibs="$newdeplibs $i"
3551 set dummy $deplibs_check_method
3552 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3553 for a_deplib in $deplibs; do
3554 name=`expr $a_deplib : '-l\(.*\)'`
3555 # If $name is empty we are operating on a -L argument.
3556 if test "$name" != "" && test "$name" != "0"; then
3557 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3558 case " $predeps $postdeps " in
3560 newdeplibs="$newdeplibs $a_deplib"
3565 if test -n "$a_deplib" ; then
3566 libname=`eval \\$echo \"$libname_spec\"`
3567 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3568 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3569 for potent_lib in $potential_libs; do
3570 # Follow soft links.
3571 if ls -lLd "$potent_lib" 2>/dev/null \
3572 | grep " -> " >/dev/null; then
3575 # The statement above tries to avoid entering an
3576 # endless loop below, in case of cyclic links.
3577 # We might still enter an endless loop, since a link
3578 # loop can be closed while we follow links,
3580 potlib="$potent_lib"
3581 while test -h "$potlib" 2>/dev/null; do
3582 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3584 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3585 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3588 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3590 | $EGREP "$file_magic_regex" > /dev/null; then
3591 newdeplibs="$newdeplibs $a_deplib"
3598 if test -n "$a_deplib" ; then
3601 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3602 $echo "*** I have the capability to make that library automatically link in when"
3603 $echo "*** you link to this library. But I can only do this if you have a"
3604 $echo "*** shared version of the library, which you do not appear to have"
3605 $echo "*** because I did check the linker path looking for a file starting"
3606 if test -z "$potlib" ; then
3607 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3609 $echo "*** with $libname and none of the candidates passed a file format test"
3610 $echo "*** using a file magic. Last file checked: $potlib"
3614 # Add a -L argument.
3615 newdeplibs="$newdeplibs $a_deplib"
3617 done # Gone through all deplibs.
3620 set dummy $deplibs_check_method
3621 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3622 for a_deplib in $deplibs; do
3623 name=`expr $a_deplib : '-l\(.*\)'`
3624 # If $name is empty we are operating on a -L argument.
3625 if test -n "$name" && test "$name" != "0"; then
3626 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3627 case " $predeps $postdeps " in
3629 newdeplibs="$newdeplibs $a_deplib"
3634 if test -n "$a_deplib" ; then
3635 libname=`eval \\$echo \"$libname_spec\"`
3636 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3637 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3638 for potent_lib in $potential_libs; do
3639 potlib="$potent_lib" # see symlink-check above in file_magic test
3640 if eval $echo \"$potent_lib\" 2>/dev/null \
3642 | $EGREP "$match_pattern_regex" > /dev/null; then
3643 newdeplibs="$newdeplibs $a_deplib"
3650 if test -n "$a_deplib" ; then
3653 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3654 $echo "*** I have the capability to make that library automatically link in when"
3655 $echo "*** you link to this library. But I can only do this if you have a"
3656 $echo "*** shared version of the library, which you do not appear to have"
3657 $echo "*** because I did check the linker path looking for a file starting"
3658 if test -z "$potlib" ; then
3659 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3661 $echo "*** with $libname and none of the candidates passed a file format test"
3662 $echo "*** using a regex pattern. Last file checked: $potlib"
3666 # Add a -L argument.
3667 newdeplibs="$newdeplibs $a_deplib"
3669 done # Gone through all deplibs.
3673 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3674 -e 's/ -[LR][^ ]*//g'`
3675 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3676 for i in $predeps $postdeps ; do
3677 # can't use Xsed below, because $i might contain '/'
3678 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3681 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3682 | grep . >/dev/null; then
3684 if test "X$deplibs_check_method" = "Xnone"; then
3685 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3687 $echo "*** Warning: inter-library dependencies are not known to be supported."
3689 $echo "*** All declared inter-library dependencies are being dropped."
3694 versuffix=$versuffix_save
3696 release=$release_save
3697 libname=$libname_save
3701 *-*-rhapsody* | *-*-darwin1.[012])
3702 # On Rhapsody replace the C library is the System framework
3703 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3707 if test "$droppeddeps" = yes; then
3708 if test "$module" = yes; then
3710 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3711 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3712 $echo "*** a static module, that should work as long as the dlopening"
3713 $echo "*** application is linked with the -dlopen flag."
3714 if test -z "$global_symbol_pipe"; then
3716 $echo "*** However, this would only work if libtool was able to extract symbol"
3717 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3718 $echo "*** not find such a program. So, this module is probably useless."
3719 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3721 if test "$build_old_libs" = no; then
3722 oldlibs="$output_objdir/$libname.$libext"
3723 build_libtool_libs=module
3726 build_libtool_libs=no
3729 $echo "*** The inter-library dependencies that have been dropped here will be"
3730 $echo "*** automatically added whenever a program is linked with this library"
3731 $echo "*** or is declared to -dlopen it."
3733 if test "$allow_undefined" = no; then
3735 $echo "*** Since this library must not contain undefined symbols,"
3736 $echo "*** because either the platform does not support them or"
3737 $echo "*** it was explicitly requested with -no-undefined,"
3738 $echo "*** libtool will only create a static version of it."
3739 if test "$build_old_libs" = no; then
3740 oldlibs="$output_objdir/$libname.$libext"
3741 build_libtool_libs=module
3744 build_libtool_libs=no
3749 # Done checking deplibs!
3753 # All the library-specific variables (install_libdir is set above).
3758 # Test again, we may have decided not to build it any more
3759 if test "$build_libtool_libs" = yes; then
3760 if test "$hardcode_into_libs" = yes; then
3761 # Hardcode the library paths
3764 rpath="$finalize_rpath"
3765 test "$mode" != relink && rpath="$compile_rpath$rpath"
3766 for libdir in $rpath; do
3767 if test -n "$hardcode_libdir_flag_spec"; then
3768 if test -n "$hardcode_libdir_separator"; then
3769 if test -z "$hardcode_libdirs"; then
3770 hardcode_libdirs="$libdir"
3772 # Just accumulate the unique libdirs.
3773 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3774 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3777 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3782 eval flag=\"$hardcode_libdir_flag_spec\"
3783 dep_rpath="$dep_rpath $flag"
3785 elif test -n "$runpath_var"; then
3786 case "$perm_rpath " in
3788 *) perm_rpath="$perm_rpath $libdir" ;;
3792 # Substitute the hardcoded libdirs into the rpath.
3793 if test -n "$hardcode_libdir_separator" &&
3794 test -n "$hardcode_libdirs"; then
3795 libdir="$hardcode_libdirs"
3796 if test -n "$hardcode_libdir_flag_spec_ld"; then
3797 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3799 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3802 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3803 # We should set the runpath_var.
3805 for dir in $perm_rpath; do
3808 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3810 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3813 shlibpath="$finalize_shlibpath"
3814 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3815 if test -n "$shlibpath"; then
3816 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3819 # Get the real and link names of the library.
3820 eval shared_ext=\"$shrext_cmds\"
3821 eval library_names=\"$library_names_spec\"
3822 set dummy $library_names
3826 if test -n "$soname_spec"; then
3827 eval soname=\"$soname_spec\"
3831 if test -z "$dlname"; then
3835 lib="$output_objdir/$realname"
3838 linknames="$linknames $link"
3841 # Use standard objects if they are pic
3842 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3844 # Prepare the list of exported symbols
3845 if test -z "$export_symbols"; then
3846 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3847 $show "generating symbol list for \`$libname.la'"
3848 export_symbols="$output_objdir/$libname.exp"
3849 $run $rm $export_symbols
3850 cmds=$export_symbols_cmds
3851 save_ifs="$IFS"; IFS='~'
3852 for cmd in $cmds; do
3855 if len=`expr "X$cmd" : ".*"` &&
3856 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3858 $run eval "$cmd" || exit $?
3859 skipped_export=false
3861 # The command line is too long to execute in one step.
3862 $show "using reloadable object file for export list..."
3864 # Break out early, otherwise skipped_export may be
3865 # set to false by a later but shorter cmd.
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:" &&
3937 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3938 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3941 # The command line is too long to link in one step, link piecewise.
3942 $echo "creating reloadable object files..."
3944 # Save the value of $output and $libobjs because we want to
3945 # use them later. If we have whole_archive_flag_spec, we
3946 # want to use save_libobjs as it was before
3947 # whole_archive_flag_spec was expanded, because we can't
3948 # assume the linker understands whole_archive_flag_spec.
3949 # This may have to be revisited, in case too many
3950 # convenience libraries get linked in and end up exceeding
3952 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3953 save_libobjs=$libobjs
3956 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3958 # Clear the reloadable object creation command queue and
3959 # initialize k to one.
3966 output=$output_objdir/$output_la-${k}.$objext
3967 # Loop over the list of objects to be linked.
3968 for obj in $save_libobjs
3970 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3971 if test "X$objlist" = X ||
3972 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3973 test "$len" -le "$max_cmd_len"; }; then
3974 objlist="$objlist $obj"
3976 # The command $test_cmds is almost too long, add a
3977 # command to the queue.
3978 if test "$k" -eq 1 ; then
3979 # The first file doesn't have a previous command to add.
3980 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3982 # All subsequent reloadable object files will link in
3983 # the last one created.
3984 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3986 last_robj=$output_objdir/$output_la-${k}.$objext
3988 output=$output_objdir/$output_la-${k}.$objext
3993 # Handle the remaining objects by creating one last
3994 # reloadable object file. All subsequent reloadable object
3995 # files will link in the last one created.
3996 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3997 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3999 if ${skipped_export-false}; then
4000 $show "generating symbol list for \`$libname.la'"
4001 export_symbols="$output_objdir/$libname.exp"
4002 $run $rm $export_symbols
4004 # Append the command to create the export file.
4005 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4008 # Set up a command to remove the reloadable object files
4009 # after they are used.
4011 while test "$i" -lt "$k"
4014 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4017 $echo "creating a temporary reloadable object file: $output"
4019 # Loop through the commands generated above and execute them.
4020 save_ifs="$IFS"; IFS='~'
4021 for cmd in $concat_cmds; do
4024 $run eval "$cmd" || exit $?
4029 # Restore the value of output.
4032 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4033 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4035 # Expand the library linking commands again to reset the
4036 # value of $libobjs for piecewise linking.
4038 # Do each of the archive commands.
4039 if test "$module" = yes && test -n "$module_cmds" ; then
4040 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4041 cmds=$module_expsym_cmds
4046 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4047 cmds=$archive_expsym_cmds
4053 # Append the command to remove the reloadable object files
4054 # to the just-reset $cmds.
4055 eval cmds=\"\$cmds~\$rm $delfiles\"
4057 save_ifs="$IFS"; IFS='~'
4058 for cmd in $cmds; do
4062 $run eval "$cmd" || {
4065 # Restore the uninstalled library and exit
4066 if test "$mode" = relink; then
4067 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4075 # Restore the uninstalled library and exit
4076 if test "$mode" = relink; then
4077 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4079 if test -n "$convenience"; then
4080 if test -z "$whole_archive_flag_spec"; then
4081 $show "${rm}r $gentop"
4082 $run ${rm}r "$gentop"
4089 # Create links to the real library.
4090 for linkname in $linknames; do
4091 if test "$realname" != "$linkname"; then
4092 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4093 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4097 # If -module or -export-dynamic was specified, set the dlname.
4098 if test "$module" = yes || test "$export_dynamic" = yes; then
4099 # On all known operating systems, these are identical.
4106 if test -n "$deplibs"; then
4107 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4110 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4111 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4114 if test -n "$rpath"; then
4115 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4118 if test -n "$xrpath"; then
4119 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4122 if test -n "$vinfo"; then
4123 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4126 if test -n "$release"; then
4127 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4132 if test -n "$objs$old_deplibs"; then
4133 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4137 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4145 # Delete the old objects.
4146 $run $rm $obj $libobj
4148 # Objects from convenience libraries. This assumes
4149 # single-version convenience libraries. Whenever we create
4150 # different ones for PIC/non-PIC, this we'll have to duplicate
4154 # reload_cmds runs $LD directly, so let us get rid of
4155 # -Wl from whole_archive_flag_spec
4158 if test -n "$convenience"; then
4159 if test -n "$whole_archive_flag_spec"; then
4160 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4162 gentop="$output_objdir/${obj}x"
4163 generated="$generated $gentop"
4165 func_extract_archives $gentop $convenience
4166 reload_conv_objs="$reload_objs $func_extract_archives_result"
4170 # Create the old-style object.
4171 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
4175 save_ifs="$IFS"; IFS='~'
4176 for cmd in $cmds; do
4180 $run eval "$cmd" || exit $?
4184 # Exit if we aren't doing a library object file.
4185 if test -z "$libobj"; then
4186 if test -n "$gentop"; then
4187 $show "${rm}r $gentop"
4194 if test "$build_libtool_libs" != yes; then
4195 if test -n "$gentop"; then
4196 $show "${rm}r $gentop"
4200 # Create an invalid libtool object if no PIC, so that we don't
4201 # accidentally link it into a program.
4202 # $show "echo timestamp > $libobj"
4203 # $run eval "echo timestamp > $libobj" || exit $?
4207 if test -n "$pic_flag" || test "$pic_mode" != default; then
4208 # Only do commands if we really have different PIC objects.
4209 reload_objs="$libobjs $reload_conv_objs"
4212 save_ifs="$IFS"; IFS='~'
4213 for cmd in $cmds; do
4217 $run eval "$cmd" || exit $?
4222 if test -n "$gentop"; then
4223 $show "${rm}r $gentop"
4232 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4234 if test -n "$vinfo"; then
4235 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4238 if test -n "$release"; then
4239 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4242 if test "$preload" = yes; then
4243 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4244 test "$dlopen_self_static" = unknown; then
4245 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4250 *-*-rhapsody* | *-*-darwin1.[012])
4251 # On Rhapsody replace the C library is the System framework
4252 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4253 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4259 # Don't allow lazy linking, it breaks C++ global constructors
4260 if test "$tagname" = CXX ; then
4261 compile_command="$compile_command ${wl}-bind_at_load"
4262 finalize_command="$finalize_command ${wl}-bind_at_load"
4267 compile_command="$compile_command $compile_deplibs"
4268 finalize_command="$finalize_command $finalize_deplibs"
4270 if test -n "$rpath$xrpath"; then
4271 # If the user specified any rpath flags, then add them.
4272 for libdir in $rpath $xrpath; do
4273 # This is the magic to use -rpath.
4274 case "$finalize_rpath " in
4276 *) finalize_rpath="$finalize_rpath $libdir" ;;
4281 # Now hardcode the library paths
4284 for libdir in $compile_rpath $finalize_rpath; do
4285 if test -n "$hardcode_libdir_flag_spec"; then
4286 if test -n "$hardcode_libdir_separator"; then
4287 if test -z "$hardcode_libdirs"; then
4288 hardcode_libdirs="$libdir"
4290 # Just accumulate the unique libdirs.
4291 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4292 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4295 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4300 eval flag=\"$hardcode_libdir_flag_spec\"
4301 rpath="$rpath $flag"
4303 elif test -n "$runpath_var"; then
4304 case "$perm_rpath " in
4306 *) perm_rpath="$perm_rpath $libdir" ;;
4310 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4311 case :$dllsearchpath: in
4313 *) dllsearchpath="$dllsearchpath:$libdir";;
4318 # Substitute the hardcoded libdirs into the rpath.
4319 if test -n "$hardcode_libdir_separator" &&
4320 test -n "$hardcode_libdirs"; then
4321 libdir="$hardcode_libdirs"
4322 eval rpath=\" $hardcode_libdir_flag_spec\"
4324 compile_rpath="$rpath"
4328 for libdir in $finalize_rpath; do
4329 if test -n "$hardcode_libdir_flag_spec"; then
4330 if test -n "$hardcode_libdir_separator"; then
4331 if test -z "$hardcode_libdirs"; then
4332 hardcode_libdirs="$libdir"
4334 # Just accumulate the unique libdirs.
4335 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4336 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4339 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4344 eval flag=\"$hardcode_libdir_flag_spec\"
4345 rpath="$rpath $flag"
4347 elif test -n "$runpath_var"; then
4348 case "$finalize_perm_rpath " in
4350 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4354 # Substitute the hardcoded libdirs into the rpath.
4355 if test -n "$hardcode_libdir_separator" &&
4356 test -n "$hardcode_libdirs"; then
4357 libdir="$hardcode_libdirs"
4358 eval rpath=\" $hardcode_libdir_flag_spec\"
4360 finalize_rpath="$rpath"
4362 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4363 # Transform all the library objects into standard objects.
4364 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4365 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4369 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4370 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4371 dlsyms="${outputname}S.c"
4373 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4377 if test -n "$dlsyms"; then
4381 # Discover the nlist of each of the dlfiles.
4382 nlist="$output_objdir/${outputname}.nm"
4384 $show "$rm $nlist ${nlist}S ${nlist}T"
4385 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4387 # Parse the name list into a source file.
4388 $show "creating $output_objdir/$dlsyms"
4390 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4391 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4392 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4398 /* Prevent the only kind of declaration conflicts we can make. */
4399 #define lt_preloaded_symbols some_other_symbol
4401 /* External symbol declarations for the compiler. */\
4404 if test "$dlself" = yes; then
4405 $show "generating symbol list for \`$output'"
4407 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4409 # Add our own program objects to the symbol list.
4410 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4411 for arg in $progfiles; do
4412 $show "extracting global C symbols from \`$arg'"
4413 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4416 if test -n "$exclude_expsyms"; then
4417 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4418 $run eval '$mv "$nlist"T "$nlist"'
4421 if test -n "$export_symbols_regex"; then
4422 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4423 $run eval '$mv "$nlist"T "$nlist"'
4426 # Prepare the list of exported symbols
4427 if test -z "$export_symbols"; then
4428 export_symbols="$output_objdir/$outputname.exp"
4429 $run $rm $export_symbols
4430 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4432 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4433 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4434 $run eval 'mv "$nlist"T "$nlist"'
4438 for arg in $dlprefiles; do
4439 $show "extracting global C symbols from \`$arg'"
4440 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4441 $run eval '$echo ": $name " >> "$nlist"'
4442 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4445 if test -z "$run"; then
4446 # Make sure we have at least an empty file.
4447 test -f "$nlist" || : > "$nlist"
4449 if test -n "$exclude_expsyms"; then
4450 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4451 $mv "$nlist"T "$nlist"
4454 # Try sorting and uniquifying the output.
4455 if grep -v "^: " < "$nlist" |
4456 if sort -k 3 </dev/null >/dev/null 2>&1; then
4461 uniq > "$nlist"S; then
4464 grep -v "^: " < "$nlist" > "$nlist"S
4467 if test -f "$nlist"S; then
4468 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4470 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4473 $echo >> "$output_objdir/$dlsyms" "\
4475 #undef lt_preloaded_symbols
4477 #if defined (__STDC__) && __STDC__
4478 # define lt_ptr void *
4480 # define lt_ptr char *
4484 /* The mapping between symbol names and symbols. */
4488 *cygwin* | *mingw* )
4489 $echo >> "$output_objdir/$dlsyms" "\
4490 /* DATA imports from DLLs on WIN32 can't be const, because
4491 runtime relocations are performed -- see ld's documentation
4497 $echo >> "$output_objdir/$dlsyms" "\
4504 $echo >> "$output_objdir/$dlsyms" "\
4508 lt_preloaded_symbols[] =
4512 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4514 $echo >> "$output_objdir/$dlsyms" "\
4518 /* This works around a problem in FreeBSD linker */
4519 #ifdef FREEBSD_WORKAROUND
4520 static const void *lt_preloaded_setup() {
4521 return lt_preloaded_symbols;
4531 pic_flag_for_symtable=
4533 # compiling the symbol table file with pic_flag works around
4534 # a FreeBSD bug that causes programs to crash when -lm is
4535 # linked before any other PIC object. But we must not use
4536 # pic_flag when linking with -static. The problem exists in
4537 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4538 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4539 case "$compile_command " in
4541 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4544 case "$compile_command " in
4546 *) pic_flag_for_symtable=" $pic_flag";;
4550 # Now compile the dynamic symbol file.
4551 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4552 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4554 # Clean up the generated files.
4555 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4556 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4558 # Transform the symbol file into the correct name.
4559 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4560 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4563 # FreeBSD doesn't need this...
4566 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4571 # We keep going just in case the user didn't refer to
4572 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4573 # really was required.
4575 # Nullify the symbol file.
4576 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4577 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4580 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4581 # Replace the output file specification.
4582 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4583 link_command="$compile_command$compile_rpath"
4585 # We have no uninstalled library dependencies, so finalize right now.
4586 $show "$link_command"
4587 $run eval "$link_command"
4590 # Delete the generated files.
4591 if test -n "$dlsyms"; then
4592 $show "$rm $output_objdir/${outputname}S.${objext}"
4593 $run $rm "$output_objdir/${outputname}S.${objext}"
4599 if test -n "$shlibpath_var"; then
4600 # We should set the shlibpath_var
4602 for dir in $temp_rpath; do
4604 [\\/]* | [A-Za-z]:[\\/]*)
4609 # Relative path: add a thisdir entry.
4610 rpath="$rpath\$thisdir/$dir:"
4617 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4618 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4620 if test -n "$finalize_shlibpath"; then
4621 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4626 if test -n "$runpath_var"; then
4627 if test -n "$perm_rpath"; then
4628 # We should set the runpath_var.
4630 for dir in $perm_rpath; do
4633 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4635 if test -n "$finalize_perm_rpath"; then
4636 # We should set the runpath_var.
4638 for dir in $finalize_perm_rpath; do
4641 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4645 if test "$no_install" = yes; then
4646 # We don't need to create a wrapper script.
4647 link_command="$compile_var$compile_command$compile_rpath"
4648 # Replace the output file specification.
4649 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4650 # Delete the old output file.
4652 # Link the executable and exit
4653 $show "$link_command"
4654 $run eval "$link_command" || exit $?
4658 if test "$hardcode_action" = relink; then
4659 # Fast installation is not supported
4660 link_command="$compile_var$compile_command$compile_rpath"
4661 relink_command="$finalize_var$finalize_command$finalize_rpath"
4663 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4664 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4666 if test "$fast_install" != no; then
4667 link_command="$finalize_var$compile_command$finalize_rpath"
4668 if test "$fast_install" = yes; then
4669 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4671 # fast_install is set to needless
4675 link_command="$compile_var$compile_command$compile_rpath"
4676 relink_command="$finalize_var$finalize_command$finalize_rpath"
4680 # Replace the output file specification.
4681 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4683 # Delete the old output files.
4684 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4686 $show "$link_command"
4687 $run eval "$link_command" || exit $?
4689 # Now create the wrapper script.
4690 $show "creating $output"
4692 # Quote the relink command for shipping.
4693 if test -n "$relink_command"; then
4694 # Preserve any variables that may affect compiler behavior
4695 for var in $variables_saved_for_relink; do
4696 if eval test -z \"\${$var+set}\"; then
4697 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4698 elif eval var_value=\$$var; test -z "$var_value"; then
4699 relink_command="$var=; export $var; $relink_command"
4701 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4702 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4705 relink_command="(cd `pwd`; $relink_command)"
4706 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4709 # Quote $echo for shipping.
4710 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4712 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4713 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4715 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4717 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4720 # Only actually do things if our run command is non-null.
4721 if test -z "$run"; then
4722 # win32 will think the script is a binary if it has
4723 # a .exe suffix, so we strip it off here.
4725 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4727 # test for cygwin because mv fails w/o .exe extensions
4731 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4735 *cygwin* | *mingw* )
4736 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4737 cwrapper=`$echo ${output}.exe`
4738 $rm $cwrappersource $cwrapper
4739 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4741 cat > $cwrappersource <<EOF
4743 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4744 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4746 The $output program cannot be directly executed until all the libtool
4747 libraries that it depends on are installed.
4749 This wrapper executable should never be moved out of the build directory.
4750 If it is, it will not operate correctly.
4752 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4753 but could eventually absorb all of the scripts functionality and
4754 exec $objdir/$outputname directly.
4757 cat >> $cwrappersource<<"EOF"
4765 #if defined(PATH_MAX)
4766 # define LT_PATHMAX PATH_MAX
4767 #elif defined(MAXPATHLEN)
4768 # define LT_PATHMAX MAXPATHLEN
4770 # define LT_PATHMAX 1024
4773 #ifndef DIR_SEPARATOR
4774 #define DIR_SEPARATOR '/'
4777 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4779 #define HAVE_DOS_BASED_FILE_SYSTEM
4780 #ifndef DIR_SEPARATOR_2
4781 #define DIR_SEPARATOR_2 '\\'
4785 #ifndef DIR_SEPARATOR_2
4786 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4787 #else /* DIR_SEPARATOR_2 */
4788 # define IS_DIR_SEPARATOR(ch) \
4789 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4790 #endif /* DIR_SEPARATOR_2 */
4792 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4793 #define XFREE(stale) do { \
4794 if (stale) { free ((void *) stale); stale = 0; } \
4797 const char *program_name = NULL;
4799 void * xmalloc (size_t num);
4800 char * xstrdup (const char *string);
4801 char * basename (const char *name);
4802 char * fnqualify(const char *path);
4803 char * strendzap(char *str, const char *pat);
4804 void lt_fatal (const char *message, ...);
4807 main (int argc, char *argv[])
4812 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4813 newargz = XMALLOC(char *, argc+2);
4816 cat >> $cwrappersource <<EOF
4817 newargz[0] = "$SHELL";
4820 cat >> $cwrappersource <<"EOF"
4821 newargz[1] = fnqualify(argv[0]);
4822 /* we know the script has the same name, without the .exe */
4823 /* so make sure newargz[1] doesn't end in .exe */
4824 strendzap(newargz[1],".exe");
4825 for (i = 1; i < argc; i++)
4826 newargz[i+1] = xstrdup(argv[i]);
4827 newargz[argc+1] = NULL;
4830 cat >> $cwrappersource <<EOF
4831 execv("$SHELL",newargz);
4834 cat >> $cwrappersource <<"EOF"
4839 xmalloc (size_t num)
4841 void * p = (void *) malloc (num);
4843 lt_fatal ("Memory exhausted");
4849 xstrdup (const char *string)
4851 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4856 basename (const char *name)
4860 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4861 /* Skip over the disk name in MSDOS pathnames. */
4862 if (isalpha (name[0]) && name[1] == ':')
4866 for (base = name; *name; name++)
4867 if (IS_DIR_SEPARATOR (*name))
4869 return (char *) base;
4873 fnqualify(const char *path)
4877 char tmp[LT_PATHMAX + 1];
4879 assert(path != NULL);
4881 /* Is it qualified already? */
4882 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4883 if (isalpha (path[0]) && path[1] == ':')
4884 return xstrdup (path);
4886 if (IS_DIR_SEPARATOR (path[0]))
4887 return xstrdup (path);
4889 /* prepend the current directory */
4890 /* doesn't handle '~' */
4891 if (getcwd (tmp, LT_PATHMAX) == NULL)
4892 lt_fatal ("getcwd failed");
4893 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4894 p = XMALLOC(char, size);
4895 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4900 strendzap(char *str, const char *pat)
4904 assert(str != NULL);
4905 assert(pat != NULL);
4908 patlen = strlen(pat);
4912 str += len - patlen;
4913 if (strcmp(str, pat) == 0)
4920 lt_error_core (int exit_status, const char * mode,
4921 const char * message, va_list ap)
4923 fprintf (stderr, "%s: %s: ", program_name, mode);
4924 vfprintf (stderr, message, ap);
4925 fprintf (stderr, ".\n");
4927 if (exit_status >= 0)
4932 lt_fatal (const char *message, ...)
4935 va_start (ap, message);
4936 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4940 # we should really use a build-platform specific compiler
4941 # here, but OTOH, the wrappers (shell script and this C one)
4942 # are only useful if you want to execute the "real" binary.
4943 # Since the "real" binary is built for $host, then this
4944 # wrapper might as well be built for $host, too.
4945 $run $LTCC -s -o $cwrapper $cwrappersource
4949 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4954 # $output - temporary wrapper script for $objdir/$outputname
4955 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4957 # The $output program cannot be directly executed until all the libtool
4958 # libraries that it depends on are installed.
4960 # This wrapper script should never be moved out of the build directory.
4961 # If it is, it will not operate correctly.
4963 # Sed substitution that helps us do robust quoting. It backslashifies
4964 # metacharacters that are still active within double-quoted strings.
4965 Xsed='${SED} -e 1s/^X//'
4966 sed_quote_subst='$sed_quote_subst'
4968 # The HP-UX ksh and POSIX shell print the target directory to stdout
4970 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4972 relink_command=\"$relink_command\"
4974 # This environment variable determines our operation mode.
4975 if test \"\$libtool_install_magic\" = \"$magic\"; then
4976 # install mode needs the following variable:
4977 notinst_deplibs='$notinst_deplibs'
4979 # When we are sourced in execute mode, \$file and \$echo are already set.
4980 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4983 # Make sure echo works.
4984 if test \"X\$1\" = X--no-reexec; then
4985 # Discard the --no-reexec flag, and continue.
4987 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4988 # Yippee, \$echo works!
4991 # Restart under the correct shell, and then maybe \$echo will work.
4992 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4998 # Find the directory that this script lives in.
4999 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5000 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5002 # Follow symbolic links until we get to the real thisdir.
5003 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5004 while test -n \"\$file\"; do
5005 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5007 # If there was a directory component, then change thisdir.
5008 if test \"x\$destdir\" != \"x\$file\"; then
5009 case \"\$destdir\" in
5010 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5011 *) thisdir=\"\$thisdir/\$destdir\" ;;
5015 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5016 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5019 # Try to get the absolute directory name.
5020 absdir=\`cd \"\$thisdir\" && pwd\`
5021 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5024 if test "$fast_install" = yes; then
5026 program=lt-'$outputname'$exeext
5027 progdir=\"\$thisdir/$objdir\"
5029 if test ! -f \"\$progdir/\$program\" || \\
5030 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5031 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5033 file=\"\$\$-\$program\"
5035 if test ! -d \"\$progdir\"; then
5036 $mkdir \"\$progdir\"
5038 $rm \"\$progdir/\$file\"
5043 # relink executable if necessary
5044 if test -n \"\$relink_command\"; then
5045 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5047 $echo \"\$relink_command_output\" >&2
5048 $rm \"\$progdir/\$file\"
5053 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5054 { $rm \"\$progdir/\$program\";
5055 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5056 $rm \"\$progdir/\$file\"
5060 program='$outputname'
5061 progdir=\"\$thisdir/$objdir\"
5067 if test -f \"\$progdir/\$program\"; then"
5069 # Export our shlibpath_var if we have one.
5070 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5072 # Add our own library path to $shlibpath_var
5073 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5075 # Some systems cannot cope with colon-terminated $shlibpath_var
5076 # The second colon is a workaround for a bug in BeOS R4 sed
5077 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5079 export $shlibpath_var
5083 # fixup the dll searchpath if we need to.
5084 if test -n "$dllsearchpath"; then
5086 # Add the dll search path components to the executable PATH
5087 PATH=$dllsearchpath:\$PATH
5092 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5093 # Run the actual program with our arguments.
5096 # Backslashes separate directories on plain windows
5097 *-*-mingw | *-*-os2*)
5099 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5105 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5110 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5114 # The program doesn't exist.
5115 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5116 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5117 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5128 # See if we need to build an old-fashioned archive.
5129 for oldlib in $oldlibs; do
5131 if test "$build_libtool_libs" = convenience; then
5132 oldobjs="$libobjs_save"
5133 addlibs="$convenience"
5134 build_libtool_libs=no
5136 if test "$build_libtool_libs" = module; then
5137 oldobjs="$libobjs_save"
5138 build_libtool_libs=no
5140 oldobjs="$old_deplibs $non_pic_objects"
5142 addlibs="$old_convenience"
5145 if test -n "$addlibs"; then
5146 gentop="$output_objdir/${outputname}x"
5147 generated="$generated $gentop"
5149 func_extract_archives $gentop $addlibs
5150 oldobjs="$oldobjs $func_extract_archives_result"
5153 # Do each command in the archive commands.
5154 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5155 cmds=$old_archive_from_new_cmds
5157 # POSIX demands no paths to be encoded in archives. We have
5158 # to avoid creating archives with duplicate basenames if we
5159 # might have to extract them afterwards, e.g., when creating a
5160 # static archive out of a convenience library, or when linking
5161 # the entirety of a libtool archive into another (currently
5162 # not supported by libtool).
5163 if (for obj in $oldobjs
5165 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5166 done | sort | sort -uc >/dev/null 2>&1); then
5169 $echo "copying selected object files to avoid basename conflicts..."
5171 if test -z "$gentop"; then
5172 gentop="$output_objdir/${outputname}x"
5173 generated="$generated $gentop"
5175 $show "${rm}r $gentop"
5176 $run ${rm}r "$gentop"
5177 $show "$mkdir $gentop"
5178 $run $mkdir "$gentop"
5180 if test "$status" -ne 0 && test ! -d "$gentop"; then
5185 save_oldobjs=$oldobjs
5188 for obj in $save_oldobjs
5190 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5191 case " $oldobjs " in
5192 " ") oldobjs=$obj ;;
5195 # Make sure we don't pick an alternate name that also
5197 newobj=lt$counter-$objbase
5198 counter=`expr $counter + 1`
5199 case " $oldobjs " in
5200 *[\ /]"$newobj "*) ;;
5201 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5204 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5205 $run ln "$obj" "$gentop/$newobj" ||
5206 $run cp "$obj" "$gentop/$newobj"
5207 oldobjs="$oldobjs $gentop/$newobj"
5209 *) oldobjs="$oldobjs $obj" ;;
5214 eval cmds=\"$old_archive_cmds\"
5216 if len=`expr "X$cmds" : ".*"` &&
5217 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5218 cmds=$old_archive_cmds
5220 # the command line is too long to link in one step, link in parts
5221 $echo "using piecewise archive linking..."
5226 save_oldobjs=$oldobjs
5228 # Is there a better way of finding the last object in the list?
5229 for obj in $save_oldobjs
5233 for obj in $save_oldobjs
5235 oldobjs="$objlist $obj"
5236 objlist="$objlist $obj"
5237 eval test_cmds=\"$old_archive_cmds\"
5238 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5239 test "$len" -le "$max_cmd_len"; then
5242 # the above command should be used before it gets too long
5244 if test "$obj" = "$last_oldobj" ; then
5247 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5248 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5254 if test "X$oldobjs" = "X" ; then
5255 eval cmds=\"\$concat_cmds\"
5257 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5261 save_ifs="$IFS"; IFS='~'
5262 for cmd in $cmds; do
5266 $run eval "$cmd" || exit $?
5271 if test -n "$generated"; then
5272 $show "${rm}r$generated"
5273 $run ${rm}r$generated
5276 # Now create the libtool archive.
5280 test "$build_old_libs" = yes && old_library="$libname.$libext"
5281 $show "creating $output"
5283 # Preserve any variables that may affect compiler behavior
5284 for var in $variables_saved_for_relink; do
5285 if eval test -z \"\${$var+set}\"; then
5286 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5287 elif eval var_value=\$$var; test -z "$var_value"; then
5288 relink_command="$var=; export $var; $relink_command"
5290 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5291 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5294 # Quote the link command for shipping.
5295 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5296 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5297 if test "$hardcode_automatic" = yes ; then
5302 # Only create the output if not a dry run.
5303 if test -z "$run"; then
5304 for installed in no yes; do
5305 if test "$installed" = yes; then
5306 if test -z "$install_libdir"; then
5309 output="$output_objdir/$outputname"i
5310 # Replace all uninstalled libtool libraries with the installed ones
5312 for deplib in $dependency_libs; do
5315 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5316 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5317 if test -z "$libdir"; then
5318 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5321 newdependency_libs="$newdependency_libs $libdir/$name"
5323 *) newdependency_libs="$newdependency_libs $deplib" ;;
5326 dependency_libs="$newdependency_libs"
5328 for lib in $dlfiles; do
5329 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5330 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5331 if test -z "$libdir"; then
5332 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5335 newdlfiles="$newdlfiles $libdir/$name"
5337 dlfiles="$newdlfiles"
5339 for lib in $dlprefiles; do
5340 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5341 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5342 if test -z "$libdir"; then
5343 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5346 newdlprefiles="$newdlprefiles $libdir/$name"
5348 dlprefiles="$newdlprefiles"
5351 for lib in $dlfiles; do
5353 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5354 *) abs=`pwd`"/$lib" ;;
5356 newdlfiles="$newdlfiles $abs"
5358 dlfiles="$newdlfiles"
5360 for lib in $dlprefiles; do
5362 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5363 *) abs=`pwd`"/$lib" ;;
5365 newdlprefiles="$newdlprefiles $abs"
5367 dlprefiles="$newdlprefiles"
5370 # place dlname in correct position for cygwin
5372 case $host,$output,$installed,$module,$dlname in
5373 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5376 # $outputname - a libtool library file
5377 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5379 # Please DO NOT delete this file!
5380 # It is necessary for linking the library.
5382 # The name that we can dlopen(3).
5385 # Names of this library.
5386 library_names='$library_names'
5388 # The name of the static archive.
5389 old_library='$old_library'
5391 # Libraries that this one depends upon.
5392 dependency_libs='$dependency_libs'
5394 # Version information for $libname.
5399 # Is this an already installed library?
5400 installed=$installed
5402 # Should we warn about portability when linking against -modules?
5403 shouldnotlink=$module
5405 # Files to dlopen/dlpreopen
5407 dlpreopen='$dlprefiles'
5409 # Directory that this library needs to be installed in:
5410 libdir='$install_libdir'"
5411 if test "$installed" = no && test "$need_relink" = yes; then
5413 relink_command=\"$relink_command\""
5418 # Do a symbolic link so that the libtool archive can be found in
5419 # LD_LIBRARY_PATH before the program is installed.
5420 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5421 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5427 # libtool install mode
5429 modename="$modename: install"
5431 # There may be an optional sh(1) argument at the beginning of
5432 # install_prog (especially on Windows NT).
5433 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5434 # Allow the use of GNU shtool's install command.
5435 $echo "X$nonopt" | grep shtool > /dev/null; then
5436 # Aesthetically quote it.
5437 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5439 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5443 install_prog="$arg "
5451 # The real first argument should be the name of the installation program.
5452 # Aesthetically quote it.
5453 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5455 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5459 install_prog="$install_prog$arg"
5461 # We need to accept at least all the BSD install flags.
5471 if test -n "$dest"; then
5472 files="$files $dest"
5480 case " $install_prog " in
5485 -g | -m | -o) prev=$arg ;;
5493 # If the previous option needed an argument, then skip it.
5494 if test -n "$prev"; then
5503 # Aesthetically quote the argument.
5504 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5506 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5510 install_prog="$install_prog $arg"
5513 if test -z "$install_prog"; then
5514 $echo "$modename: you must specify an install program" 1>&2
5519 if test -n "$prev"; then
5520 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5525 if test -z "$files"; then
5526 if test -z "$dest"; then
5527 $echo "$modename: no file or destination specified" 1>&2
5529 $echo "$modename: you must specify a destination" 1>&2
5535 # Strip any trailing slash from the destination.
5536 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5538 # Check to see that the destination is a directory.
5539 test -d "$dest" && isdir=yes
5540 if test "$isdir" = yes; then
5544 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5545 test "X$destdir" = "X$dest" && destdir=.
5546 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5548 # Not a directory, so check to see that there is only one file specified.
5550 if test "$#" -gt 2; then
5551 $echo "$modename: \`$dest' is not a directory" 1>&2
5557 [\\/]* | [A-Za-z]:[\\/]*) ;;
5559 for file in $files; do
5563 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5572 # This variable tells wrapper scripts just to set variables rather
5573 # than running their programs.
5574 libtool_install_magic="$magic"
5579 for file in $files; do
5581 # Do each installation.
5584 # Do the static libraries later.
5585 staticlibs="$staticlibs $file"
5589 # Check to see that this really is a libtool archive.
5590 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5592 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5600 # If there is no directory component, then add one.
5602 */* | *\\*) . $file ;;
5606 # Add the libdir to current_libdirs if it is the destination.
5607 if test "X$destdir" = "X$libdir"; then
5608 case "$current_libdirs " in
5610 *) current_libdirs="$current_libdirs $libdir" ;;
5613 # Note the libdir as a future libdir.
5614 case "$future_libdirs " in
5616 *) future_libdirs="$future_libdirs $libdir" ;;
5620 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5621 test "X$dir" = "X$file/" && dir=
5624 if test -n "$relink_command"; then
5625 # Determine the prefix the user has applied to our future dir.
5626 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5628 # Don't allow the user to place us outside of our expected
5629 # location b/c this prevents finding dependent libraries that
5630 # are installed to the same prefix.
5631 # At present, this check doesn't affect windows .dll's that
5632 # are installed into $libdir/../bin (currently, that works fine)
5633 # but it's something to keep an eye on.
5634 if test "$inst_prefix_dir" = "$destdir"; then
5635 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5639 if test -n "$inst_prefix_dir"; then
5640 # Stick the inst_prefix_dir data into the link command.
5641 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5643 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5646 $echo "$modename: warning: relinking \`$file'" 1>&2
5647 $show "$relink_command"
5648 if $run eval "$relink_command"; then :
5650 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5655 # See the names of the shared library.
5656 set dummy $library_names
5657 if test -n "$2"; then
5663 test -n "$relink_command" && srcname="$realname"T
5665 # Install the shared library and build the symlinks.
5666 $show "$install_prog $dir/$srcname $destdir/$realname"
5667 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5668 if test -n "$stripme" && test -n "$striplib"; then
5669 $show "$striplib $destdir/$realname"
5670 $run eval "$striplib $destdir/$realname" || exit $?
5673 if test "$#" -gt 0; then
5674 # Delete the old symlinks, and create new ones.
5675 # Try `ln -sf' first, because the `ln' binary might depend on
5676 # the symlink we replace! Solaris /bin/ln does not understand -f,
5677 # so we also need to try rm && ln -s.
5680 if test "$linkname" != "$realname"; then
5681 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5682 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5687 # Do each command in the postinstall commands.
5688 lib="$destdir/$realname"
5689 cmds=$postinstall_cmds
5690 save_ifs="$IFS"; IFS='~'
5691 for cmd in $cmds; do
5695 $run eval "$cmd" || {
5698 # Restore the uninstalled library and exit
5699 if test "$mode" = relink; then
5700 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
5709 # Install the pseudo-library for information purposes.
5712 # Do not install the useless pseudo-library
5715 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5716 instname="$dir/$name"i
5717 $show "$install_prog $instname $destdir/$name"
5718 $run eval "$install_prog $instname $destdir/$name" || exit $?
5722 # Maybe install the static library, too.
5723 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5727 # Install (i.e. copy) a libtool object.
5729 # Figure out destination file name, if it wasn't already specified.
5730 if test -n "$destname"; then
5731 destfile="$destdir/$destname"
5733 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5734 destfile="$destdir/$destfile"
5737 # Deduce the name of the destination old-style object file.
5740 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5743 staticdest="$destfile"
5747 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5753 # Install the libtool object if requested.
5754 if test -n "$destfile"; then
5755 $show "$install_prog $file $destfile"
5756 $run eval "$install_prog $file $destfile" || exit $?
5759 # Install the old object if enabled.
5760 if test "$build_old_libs" = yes; then
5761 # Deduce the name of the old-style object file.
5762 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5764 $show "$install_prog $staticobj $staticdest"
5765 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5771 # Figure out destination file name, if it wasn't already specified.
5772 if test -n "$destname"; then
5773 destfile="$destdir/$destname"
5775 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5776 destfile="$destdir/$destfile"
5779 # If the file is missing, and there is a .exe on the end, strip it
5780 # because it is most likely a libtool script we actually want to
5785 if test ! -f "$file"; then
5786 file=`$echo $file|${SED} 's,.exe$,,'`
5792 # Do a test to see if this is really a libtool program.
5795 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5801 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5805 # Note that it is not necessary on cygwin/mingw to append a dot to
5806 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5807 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5808 # `FILE.' does not work on cygwin managed mounts.
5810 # If there is no directory component, then add one.
5812 */* | *\\*) . ${wrapper} ;;
5813 *) . ./${wrapper} ;;
5816 # Check the variables that should have been set.
5817 if test -z "$notinst_deplibs"; then
5818 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5823 for lib in $notinst_deplibs; do
5824 # Check to see that each library is installed.
5826 if test -f "$lib"; then
5827 # If there is no directory component, then add one.
5829 */* | *\\*) . $lib ;;
5833 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5834 if test -n "$libdir" && test ! -f "$libfile"; then
5835 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5841 # Note that it is not necessary on cygwin/mingw to append a dot to
5842 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5843 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5844 # `FILE.' does not work on cygwin managed mounts.
5846 # If there is no directory component, then add one.
5848 */* | *\\*) . ${wrapper} ;;
5849 *) . ./${wrapper} ;;
5853 if test "$fast_install" = no && test -n "$relink_command"; then
5854 if test "$finalize" = yes && test -z "$run"; then
5856 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5857 tmpdir="$tmpdir/libtool-$$"
5860 if $mkdir "$tmpdir"; then
5864 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5867 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5868 outputname="$tmpdir/$file"
5869 # Replace the output file specification.
5870 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5872 $show "$relink_command"
5873 if $run eval "$relink_command"; then :
5875 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5881 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5884 # Install the binary that we compiled earlier.
5885 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5889 # remove .exe since cygwin /usr/bin/install will append another
5891 case $install_prog,$host in
5892 */usr/bin/install*,*cygwin*)
5893 case $file:$destfile in
5898 destfile=$destfile.exe
5901 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5906 $show "$install_prog$stripme $file $destfile"
5907 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5908 test -n "$outputname" && ${rm}r "$tmpdir"
5913 for file in $staticlibs; do
5914 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5916 # Set up the ranlib parameters.
5917 oldlib="$destdir/$name"
5919 $show "$install_prog $file $oldlib"
5920 $run eval "$install_prog \$file \$oldlib" || exit $?
5922 if test -n "$stripme" && test -n "$old_striplib"; then
5923 $show "$old_striplib $oldlib"
5924 $run eval "$old_striplib $oldlib" || exit $?
5927 # Do each command in the postinstall commands.
5928 cmds=$old_postinstall_cmds
5929 save_ifs="$IFS"; IFS='~'
5930 for cmd in $cmds; do
5934 $run eval "$cmd" || exit $?
5939 if test -n "$future_libdirs"; then
5940 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5943 if test -n "$current_libdirs"; then
5944 # Maybe just do a dry run.
5945 test -n "$run" && current_libdirs=" -n$current_libdirs"
5946 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5952 # libtool finish mode
5954 modename="$modename: finish"
5958 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5961 libdirs="$libdirs $dir"
5964 for libdir in $libdirs; do
5965 if test -n "$finish_cmds"; then
5966 # Do each command in the finish commands.
5968 save_ifs="$IFS"; IFS='~'
5969 for cmd in $cmds; do
5973 $run eval "$cmd" || admincmds="$admincmds
5978 if test -n "$finish_eval"; then
5979 # Do the single finish_eval.
5980 eval cmds=\"$finish_eval\"
5981 $run eval "$cmds" || admincmds="$admincmds
5987 # Exit here if they wanted silent mode.
5988 test "$show" = : && exit $EXIT_SUCCESS
5990 $echo "----------------------------------------------------------------------"
5991 $echo "Libraries have been installed in:"
5992 for libdir in $libdirs; do
5996 $echo "If you ever happen to want to link against installed libraries"
5997 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5998 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5999 $echo "flag during linking and do at least one of the following:"
6000 if test -n "$shlibpath_var"; then
6001 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6002 $echo " during execution"
6004 if test -n "$runpath_var"; then
6005 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6006 $echo " during linking"
6008 if test -n "$hardcode_libdir_flag_spec"; then
6010 eval flag=\"$hardcode_libdir_flag_spec\"
6012 $echo " - use the \`$flag' linker flag"
6014 if test -n "$admincmds"; then
6015 $echo " - have your system administrator run these commands:$admincmds"
6017 if test -f /etc/ld.so.conf; then
6018 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6021 $echo "See any operating system documentation about shared libraries for"
6022 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6023 $echo "----------------------------------------------------------------------"
6027 # libtool execute mode
6029 modename="$modename: execute"
6031 # The first argument is the command name.
6033 if test -z "$cmd"; then
6034 $echo "$modename: you must specify a COMMAND" 1>&2
6039 # Handle -dlopen flags immediately.
6040 for file in $execute_dlfiles; do
6041 if test ! -f "$file"; then
6042 $echo "$modename: \`$file' is not a file" 1>&2
6050 # Check to see that this really is a libtool archive.
6051 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6053 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6058 # Read the libtool library.
6062 # If there is no directory component, then add one.
6064 */* | *\\*) . $file ;;
6068 # Skip this library if it cannot be dlopened.
6069 if test -z "$dlname"; then
6070 # Warn if it was a shared library.
6071 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6075 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6076 test "X$dir" = "X$file" && dir=.
6078 if test -f "$dir/$objdir/$dlname"; then
6081 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6087 # Just add the directory containing the .lo file.
6088 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6089 test "X$dir" = "X$file" && dir=.
6093 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6098 # Get the absolute pathname.
6099 absdir=`cd "$dir" && pwd`
6100 test -n "$absdir" && dir="$absdir"
6102 # Now add the directory to shlibpath_var.
6103 if eval "test -z \"\$$shlibpath_var\""; then
6104 eval "$shlibpath_var=\"\$dir\""
6106 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6110 # This variable tells wrapper scripts just to set shlibpath_var
6111 # rather than running their programs.
6112 libtool_execute_magic="$magic"
6114 # Check if any of the arguments is a wrapper script.
6121 # Do a test to see if this is really a libtool program.
6122 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6123 # If there is no directory component, then add one.
6125 */* | *\\*) . $file ;;
6129 # Transform arg to wrapped name.
6130 file="$progdir/$program"
6134 # Quote arguments (to preserve shell metacharacters).
6135 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6136 args="$args \"$file\""
6139 if test -z "$run"; then
6140 if test -n "$shlibpath_var"; then
6141 # Export the shlibpath_var.
6142 eval "export $shlibpath_var"
6145 # Restore saved environment variables
6146 if test "${save_LC_ALL+set}" = set; then
6147 LC_ALL="$save_LC_ALL"; export LC_ALL
6149 if test "${save_LANG+set}" = set; then
6150 LANG="$save_LANG"; export LANG
6153 # Now prepare to actually exec the command.
6154 exec_cmd="\$cmd$args"
6156 # Display what would be done.
6157 if test -n "$shlibpath_var"; then
6158 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6159 $echo "export $shlibpath_var"
6166 # libtool clean and uninstall mode
6168 modename="$modename: $mode"
6174 # This variable tells wrapper scripts just to set variables rather
6175 # than running their programs.
6176 libtool_install_magic="$magic"
6181 -f) rm="$rm $arg"; rmforce=yes ;;
6182 -*) rm="$rm $arg" ;;
6183 *) files="$files $arg" ;;
6187 if test -z "$rm"; then
6188 $echo "$modename: you must specify an RM program" 1>&2
6195 origobjdir="$objdir"
6196 for file in $files; do
6197 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6198 if test "X$dir" = "X$file"; then
6200 objdir="$origobjdir"
6202 objdir="$dir/$origobjdir"
6204 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6205 test "$mode" = uninstall && objdir="$dir"
6207 # Remember objdir for removal later, being careful to avoid duplicates
6208 if test "$mode" = clean; then
6211 *) rmdirs="$rmdirs $objdir" ;;
6215 # Don't error if the file doesn't exist and rm -f was used.
6216 if (test -L "$file") >/dev/null 2>&1 \
6217 || (test -h "$file") >/dev/null 2>&1 \
6218 || test -f "$file"; then
6220 elif test -d "$file"; then
6223 elif test "$rmforce" = yes; then
6231 # Possibly a libtool archive, so verify it.
6232 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6235 # Delete the libtool libraries and symlinks.
6236 for n in $library_names; do
6237 rmfiles="$rmfiles $objdir/$n"
6239 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6240 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6242 if test "$mode" = uninstall; then
6243 if test -n "$library_names"; then
6244 # Do each command in the postuninstall commands.
6245 cmds=$postuninstall_cmds
6246 save_ifs="$IFS"; IFS='~'
6247 for cmd in $cmds; do
6252 if test "$?" -ne 0 && test "$rmforce" != yes; then
6259 if test -n "$old_library"; then
6260 # Do each command in the old_postuninstall commands.
6261 cmds=$old_postuninstall_cmds
6262 save_ifs="$IFS"; IFS='~'
6263 for cmd in $cmds; do
6268 if test "$?" -ne 0 && test "$rmforce" != yes; then
6274 # FIXME: should reinstall the best remaining shared library.
6280 # Possibly a libtool object, so verify it.
6281 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6286 # Add PIC object to the list of files to remove.
6287 if test -n "$pic_object" \
6288 && test "$pic_object" != none; then
6289 rmfiles="$rmfiles $dir/$pic_object"
6292 # Add non-PIC object to the list of files to remove.
6293 if test -n "$non_pic_object" \
6294 && test "$non_pic_object" != none; then
6295 rmfiles="$rmfiles $dir/$non_pic_object"
6301 if test "$mode" = clean ; then
6305 file=`$echo $file|${SED} 's,.exe$,,'`
6306 noexename=`$echo $name|${SED} 's,.exe$,,'`
6307 # $file with .exe has already been added to rmfiles,
6308 # add $file without .exe
6309 rmfiles="$rmfiles $file"
6312 # Do a test to see if this is a libtool program.
6313 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6317 # note $name still contains .exe if it was in $file originally
6318 # as does the version of $file that was added into $rmfiles
6319 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6320 if test "$fast_install" = yes && test -n "$relink_command"; then
6321 rmfiles="$rmfiles $objdir/lt-$name"
6323 if test "X$noexename" != "X$name" ; then
6324 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6330 $show "$rm $rmfiles"
6331 $run $rm $rmfiles || exit_status=1
6333 objdir="$origobjdir"
6335 # Try to remove the ${objdir}s in the directories where we deleted files
6336 for dir in $rmdirs; do
6337 if test -d "$dir"; then
6339 $run rmdir $dir >/dev/null 2>&1
6347 $echo "$modename: you must specify a MODE" 1>&2
6348 $echo "$generic_help" 1>&2
6353 if test -z "$exec_cmd"; then
6354 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6355 $echo "$generic_help" 1>&2
6358 fi # test -z "$show_help"
6360 if test -n "$exec_cmd"; then
6365 # We need to display help for each of the modes.
6368 "Usage: $modename [OPTION]... [MODE-ARG]...
6370 Provide generalized library-building support services.
6372 --config show all configuration variables
6373 --debug enable verbose shell tracing
6374 -n, --dry-run display commands without modifying any files
6375 --features display basic configuration information and exit
6376 --finish same as \`--mode=finish'
6377 --help display this help message and exit
6378 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6379 --quiet same as \`--silent'
6380 --silent don't print informational messages
6381 --tag=TAG use configuration variables from tag TAG
6382 --version print version information
6384 MODE must be one of the following:
6386 clean remove files from the build directory
6387 compile compile a source file into a libtool object
6388 execute automatically set library path, then run a program
6389 finish complete the installation of libtool libraries
6390 install install libraries or executables
6391 link create a library or an executable
6392 uninstall remove libraries from an installed directory
6394 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6395 a more detailed description of MODE.
6397 Report bugs to <bug-libtool@gnu.org>."
6403 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6405 Remove files from the build directory.
6407 RM is the name of the program to use to delete files associated with each FILE
6408 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6411 If FILE is a libtool library, object or program, all the files associated
6412 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6417 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6419 Compile a source file into a libtool library object.
6421 This mode accepts the following additional options:
6423 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6424 -prefer-pic try to building PIC objects only
6425 -prefer-non-pic try to building non-PIC objects only
6426 -static always build a \`.o' file suitable for static linking
6428 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6429 from the given SOURCEFILE.
6431 The output file name is determined by removing the directory component from
6432 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6433 library object suffix, \`.lo'."
6438 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6440 Automatically set library path, then run a program.
6442 This mode accepts the following additional options:
6444 -dlopen FILE add the directory containing FILE to the library path
6446 This mode sets the library path environment variable according to \`-dlopen'
6449 If any of the ARGS are libtool executable wrappers, then they are translated
6450 into their corresponding uninstalled binary, and any of their required library
6451 directories are added to the library path.
6453 Then, COMMAND is executed, with ARGS as arguments."
6458 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6460 Complete the installation of libtool libraries.
6462 Each LIBDIR is a directory that contains libtool libraries.
6464 The commands that this mode executes may require superuser privileges. Use
6465 the \`--dry-run' option if you just want to see what would be executed."
6470 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6472 Install executables or libraries.
6474 INSTALL-COMMAND is the installation command. The first component should be
6475 either the \`install' or \`cp' program.
6477 The rest of the components are interpreted as arguments to that command (only
6478 BSD-compatible install options are recognized)."
6483 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6485 Link object files or libraries together to form another library, or to
6486 create an executable program.
6488 LINK-COMMAND is a command using the C compiler that you would use to create
6489 a program from several object files.
6491 The following components of LINK-COMMAND are treated specially:
6493 -all-static do not do any dynamic linking at all
6494 -avoid-version do not add a version suffix if possible
6495 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6496 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6497 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6498 -export-symbols SYMFILE
6499 try to export only the symbols listed in SYMFILE
6500 -export-symbols-regex REGEX
6501 try to export only the symbols matching REGEX
6502 -LLIBDIR search LIBDIR for required installed libraries
6503 -lNAME OUTPUT-FILE requires the installed library libNAME
6504 -module build a library that can dlopened
6505 -no-fast-install disable the fast-install mode
6506 -no-install link a not-installable executable
6507 -no-undefined declare that a library does not refer to external symbols
6508 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6509 -objectlist FILE Use a list of object files found in FILE to specify objects
6510 -precious-files-regex REGEX
6511 don't remove output files matching REGEX
6512 -release RELEASE specify package release information
6513 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6514 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6515 -static do not do any dynamic linking of libtool libraries
6516 -version-info CURRENT[:REVISION[:AGE]]
6517 specify library version info [each variable defaults to 0]
6519 All other options (arguments beginning with \`-') are ignored.
6521 Every other argument is treated as a filename. Files ending in \`.la' are
6522 treated as uninstalled libtool libraries, other files are standard or library
6525 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6526 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6527 required, except when creating a convenience library.
6529 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6530 using \`ar' and \`ranlib', or on Windows using \`lib'.
6532 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6533 is created, otherwise an executable program is created."
6538 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6540 Remove libraries from an installation directory.
6542 RM is the name of the program to use to delete files associated with each FILE
6543 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6546 If FILE is a libtool library, all the files associated with it are deleted.
6547 Otherwise, only FILE itself is deleted using RM."
6551 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6558 $echo "Try \`$modename --help' for more information about other modes."
6562 # The TAGs below are defined such that we never get into a situation
6563 # in which we disable both kinds of libraries. Given conflicting
6564 # choices, we go for a static library, that is the most portable,
6565 # since we can't tell whether shared libraries were disabled because
6566 # the user asked for that or because the platform doesn't support
6567 # them. This is particularly important on AIX, because we don't
6568 # support having both static and shared libraries enabled at the same
6569 # time on that platform, so we default to a shared-only configuration.
6570 # If a disable-shared tag is given, we'll fallback to a static-only
6571 # configuration. But we'll never go from static-only to shared-only.
6573 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6574 build_libtool_libs=no
6576 # ### END LIBTOOL TAG CONFIG: disable-shared
6578 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6579 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6580 # ### END LIBTOOL TAG CONFIG: disable-static