3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU tap 1.01)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
40 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host vivaldi:
49 # Shell to use when invoking shell scripts.
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
69 host=i686-pc-linux-gnu
74 build=i686-pc-linux-gnu
77 # An echo program that does not interpret backslashes.
87 # LTCC compiler flags.
90 # A language-specific compiler.
93 # Is the compiler the GNU C compiler?
99 # The linker used to build libraries.
100 LD="/usr/lib/ccontrol/ld"
102 # Whether we need hard or soft links.
105 # A BSD-compatible nm program.
108 # A symbol stripping program
111 # Used to examine libraries when file_magic_cmd begins "file"
114 # Used on cygwin: DLL creation program.
117 # Used on cygwin: object dumper.
120 # Used on cygwin: assembler.
123 # The name of the directory that contains temporary libtool files.
126 # How to create reloadable object files.
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
133 # Object file suffix (normally "o").
136 # Old archive suffix (normally "a").
139 # Shared library suffix (normally ".so").
142 # Executable file suffix (normally "").
145 # Additional compiler flags for building library objects.
146 pic_flag=" -fPIC -DPIC"
149 # What is the maximum length of a command?
152 # Does compiler simultaneously support -c and -o options?
155 # Must we lock files when doing compilation?
158 # Do we need the lib prefix for modules?
161 # Do we need a version for libraries?
164 # Whether dlopen is supported.
165 dlopen_support=unknown
167 # Whether dlopen of programs is supported.
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec=""
188 # Library versioning type.
191 # Format of library name prefix.
192 libname_spec="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
220 postuninstall_cmds=""
222 # Commands used to build a loadable module (assumed same as above if empty)
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="strip --strip-debug"
228 striplib="strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
234 # Dependencies to place after the objects being linked to create a
238 # Dependencies to place before the objects being linked to create a
242 # Dependencies to place after the objects being linked to create a
246 # The library search path used internally by the compiler when linking
248 compiler_lib_search_path=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method="pass_all"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd="\$MAGIC_CMD"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag=""
259 # Flag that forces no undefined symbols.
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
265 # Same as above, but a single script fragment to be evaled but not shown.
268 # Take the output of nm and produce a listing of raw symbols and C names.
269 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
271 # Transform the output of nm in a proper C declaration
272 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
274 # Transform the output of nm in a C name address pair
275 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
277 # This is the shared library runtime path variable.
278 runpath_var=LD_RUN_PATH
280 # This is the shared library path variable.
281 shlibpath_var=LD_LIBRARY_PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath=no
286 # How to hardcode a shared library path into an executable.
287 hardcode_action=immediate
289 # Whether we should hardcode library paths into libraries.
290 hardcode_into_libs=yes
292 # Flag to hardcode $libdir into a binary during linking.
293 # This must work even if $libdir does not exist.
294 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
296 # If ld is used when linking, flag to hardcode $libdir into
297 # a binary during linking. This must work even if $libdir does
299 hardcode_libdir_flag_spec_ld=""
301 # Whether we need a single -rpath flag with a separated argument.
302 hardcode_libdir_separator=""
304 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
312 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
313 # the resulting binary.
314 hardcode_shlibpath_var=unsupported
316 # Set to yes if building a shared library automatically hardcodes DIR into the library
317 # and all subsequent libraries and executables linked against it.
318 hardcode_automatic=no
320 # Variables whose values should be saved in libtool wrapper scripts and
321 # restored at relink time.
322 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
324 # Whether libtool must link a program against all its dependency libraries.
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.1.3 /usr/lib /lib"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib "
333 # Fix the shell variable $srcfile for the compiler.
336 # Set to yes if exported symbols are required.
337 always_export_symbols=no
339 # The commands to list exported symbols.
340 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
342 # The commands to extract the exported symbol list from a shared archive.
343 extract_expsyms_cmds=""
345 # Symbols that should not be listed in the preloaded symbols.
346 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
348 # Symbols that must always be exported.
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
357 # Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
381 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
382 # is ksh but when the shell is invoked as "sh" and the current value of
383 # the _XPG environment variable is not equal to 1 (one), the special
384 # positional parameter $0, within a function call, is the name of the
388 # The name of this program:
389 progname=`echo "$progpath" | $SED $basename`
399 TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)"
401 # See if we are running on zsh, and set the options which allow our
402 # commands through without removal of \ escapes.
403 if test -n "${ZSH_VERSION+set}" ; then
407 # Check that we have a working $echo.
408 if test "X$1" = X--no-reexec; then
409 # Discard the --no-reexec flag, and continue.
411 elif test "X$1" = X--fallback-echo; then
412 # Avoid inline document here, it may be left over
414 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
415 # Yippee, $echo works!
418 # Restart under the correct shell, and then maybe $echo will work.
419 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
422 if test "X$1" = X--fallback-echo; then
423 # used as fallback echo
432 help="Try \`$progname --help' for more information."
433 magic="%%%MAGIC variable%%%"
438 # Sed substitution that helps us do robust quoting. It backslashifies
439 # metacharacters that are still active within double-quoted strings.
440 Xsed="${SED}"' -e 1s/^X//'
441 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
442 # test EBCDIC or ASCII
443 case `echo A|tr A '\301'` in
444 A) # EBCDIC based system
445 SP2NL="tr '\100' '\n'"
446 NL2SP="tr '\r\n' '\100\100'"
448 *) # Assume ASCII based system
449 SP2NL="tr '\040' '\012'"
450 NL2SP="tr '\015\012' '\040\040'"
455 # Only set LANG and LC_ALL to C if already set.
456 # These must not be set unconditionally because not all systems understand
457 # e.g. LANG=C (notably SCO).
458 # We save the old values to restore during execute mode.
459 if test "${LC_ALL+set}" = set; then
460 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
462 if test "${LANG+set}" = set; then
463 save_LANG="$LANG"; LANG=C; export LANG
466 # Make sure IFS has a sensible default
470 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
471 $echo "$modename: not configured to build any kind of library" 1>&2
472 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
485 lo2o="s/\\.lo\$/.${objext}/"
486 o2lo="s/\\.${objext}\$/.lo/"
488 #####################################
489 # Shell function definitions:
490 # This seems to be the best place for them
492 # func_win32_libid arg
493 # return the library type of file 'arg'
495 # Need a lot of goo to handle *both* DLLs and import libs
496 # Has to be a shell function in order to 'eat' the argument
497 # that is supplied when $file_magic_command is called.
498 func_win32_libid () {
499 win32_libid_type="unknown"
500 win32_fileres=`file -L $1 2>/dev/null`
501 case $win32_fileres in
502 *ar\ archive\ import\ library*) # definitely import
503 win32_libid_type="x86 archive import"
505 *ar\ archive*) # could be an import, or static
506 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
507 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
508 win32_nmres=`eval $NM -f posix -A $1 | \
509 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
510 if test "X$win32_nmres" = "Ximport" ; then
511 win32_libid_type="x86 archive import"
513 win32_libid_type="x86 archive static"
518 win32_libid_type="x86 DLL"
520 *executable*) # but shell scripts are "executable" too...
521 case $win32_fileres in
522 *MS\ Windows\ PE\ Intel*)
523 win32_libid_type="x86 DLL"
528 $echo $win32_libid_type
533 # Infer tagged configuration to use if any are available and
534 # if one wasn't chosen via the "--tag" command line option.
535 # Only attempt this if the compiler in the base compile
536 # command doesn't match the default compiler.
537 # arg is usually of the form 'gcc ...'
539 if test -n "$available_tags" && test -z "$tagname"; then
543 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
547 CC_quoted="$CC_quoted $arg"
550 # Blanks in the command may have been stripped by the calling shell,
551 # but not from the CC environment variable when configure was run.
552 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
553 # Blanks at the start of $base_compile will cause this to fail
554 # if we don't check for them as well.
556 for z in $available_tags; do
557 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
558 # Evaluate the configuration.
559 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
562 # Double-quote args containing other shell metacharacters.
564 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
568 CC_quoted="$CC_quoted $arg"
571 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
572 # The compiler in the base compile command matches
573 # the one in the tagged configuration.
574 # Assume this is the tagged configuration we want.
581 # If $tagname still isn't set, then no tagged configuration
582 # was found and let the user know that the "--tag" command
583 # line option must be used.
584 if test -z "$tagname"; then
585 $echo "$modename: unable to infer tagged configuration"
586 $echo "$modename: specify a tag with \`--tag'" 1>&2
589 # $echo "$modename: using $tagname tagged configuration"
597 # func_extract_archives gentop oldlib ...
598 func_extract_archives () {
599 my_gentop="$1"; shift
607 $show "${rm}r $my_gentop"
608 $run ${rm}r "$my_gentop"
609 $show "$mkdir $my_gentop"
610 $run $mkdir "$my_gentop"
612 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
616 for my_xlib in $my_oldlibs; do
617 # Extract the objects.
619 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
620 *) my_xabs=`pwd`"/$my_xlib" ;;
622 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
623 my_xdir="$my_gentop/$my_xlib"
625 $show "${rm}r $my_xdir"
626 $run ${rm}r "$my_xdir"
627 $show "$mkdir $my_xdir"
628 $run $mkdir "$my_xdir"
630 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
635 $show "Extracting $my_xabs"
636 # Do not bother doing anything if just a dry run
637 if test -z "$run"; then
638 darwin_orig_dir=`pwd`
639 cd $my_xdir || exit $?
640 darwin_archive=$my_xabs
642 darwin_base_archive=`basename $darwin_archive`
643 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
644 if test -n "$darwin_arches"; then
645 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
647 $show "$darwin_base_archive has multiple architectures $darwin_arches"
648 for darwin_arch in $darwin_arches ; do
649 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
650 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
651 # Remove the table of contents from the thin files.
652 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
653 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
654 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
655 $AR -xo "${darwin_base_archive}"
656 rm "${darwin_base_archive}"
658 done # $darwin_arches
659 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
660 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
663 for darwin_file in $darwin_filelist; do
664 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
665 lipo -create -output "$darwin_file" $darwin_files
666 done # $darwin_filelist
668 cd "$darwin_orig_dir"
671 (cd $my_xdir && $AR x $my_xabs) || exit $?
676 # We will extract separately just the conflicting names and we will
677 # no longer touch any unique names. It is faster to leave these
678 # extract automatically by $AR in one run.
679 $show "(cd $my_xdir && $AR x $my_xabs)"
680 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
681 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
684 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
685 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
686 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
689 while test "$i" -le "$count"
691 # Put our $i before any first dot (extension)
692 # Never overwrite any file
694 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
696 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
698 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
699 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
706 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
709 func_extract_archives_result="$my_oldobjs"
711 # End of Shell function definitions
712 #####################################
715 eval std_shrext=\"$shrext_cmds\"
717 # Parse our command line options once, thoroughly.
718 while test "$#" -gt 0
724 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
728 # If the previous option needs an argument, assign it.
729 if test -n "$prev"; then
732 execute_dlfiles="$execute_dlfiles $arg"
736 preserve_args="${preserve_args}=$arg"
738 # Check whether tagname contains only valid characters
741 $echo "$progname: invalid tag name: $tagname" 1>&2
748 # Don't test for the "default" C tag, as we know, it's there, but
749 # not specially marked.
752 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
753 taglist="$taglist $tagname"
754 # Evaluate the configuration.
755 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
757 $echo "$progname: ignoring unknown tag $tagname" 1>&2
772 # Have we seen a non-optional argument yet?
779 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
781 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
782 $echo "This is free software; see the source for copying conditions. There is NO"
783 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
788 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
789 # Now print the configurations for the tags.
790 for tagname in $taglist; do
791 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
797 $echo "$progname: enabling shell trace mode"
799 preserve_args="$preserve_args $arg"
808 if test "$build_libtool_libs" = yes; then
809 $echo "enable shared libraries"
811 $echo "disable shared libraries"
813 if test "$build_old_libs" = yes; then
814 $echo "enable static libraries"
816 $echo "disable static libraries"
821 --finish) mode="finish" ;;
823 --mode) prevopt="--mode" prev=mode ;;
824 --mode=*) mode="$optarg" ;;
826 --preserve-dup-deps) duplicate_deps="yes" ;;
830 preserve_args="$preserve_args $arg"
833 --tag) prevopt="--tag" prev=tag ;;
835 set tag "$optarg" ${1+"$@"}
838 preserve_args="$preserve_args --tag"
847 $echo "$modename: unrecognized option \`$arg'" 1>&2
859 if test -n "$prevopt"; then
860 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
865 # If this variable is set in any of the actions, the command in it
866 # will be execed at the end. This prevents here-documents from being
867 # left over by shells.
870 if test -z "$show_help"; then
872 # Infer the operation mode.
873 if test -z "$mode"; then
874 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
875 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
877 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
889 *db | *dbx | *strace | *truss)
899 # If we have no mode, but dlfiles were specified, then do execute mode.
900 test -n "$execute_dlfiles" && mode=execute
902 # Just use the default operation mode.
903 if test -z "$mode"; then
904 if test -n "$nonopt"; then
905 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
907 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
914 # Only execute mode is allowed to have -dlopen flags.
915 if test -n "$execute_dlfiles" && test "$mode" != execute; then
916 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
921 # Change the help message to a mode-specific one.
923 help="Try \`$modename --help --mode=$mode' for more information."
925 # These modes are in order of execution frequency so that they run quickly.
927 # libtool compile mode
929 modename="$modename: compile"
930 # Get the compilation command and the source file.
932 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
943 # do not "continue". Instead, add this to base_compile
955 # Accept any command-line options.
958 if test -n "$libobj" ; then
959 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
966 -static | -prefer-pic | -prefer-non-pic)
977 arg_mode=arg # the next one goes into the "base_compile" arg list
978 continue # The current "srcfile" will either be retained or
979 ;; # replaced later. I would guess that would be a bug.
982 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
984 save_ifs="$IFS"; IFS=','
988 # Double-quote args containing other shell metacharacters.
989 # Many Bourne shells cannot handle close brackets correctly
990 # in scan sets, so we specify it separately.
992 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
996 lastarg="$lastarg $arg"
999 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1001 # Add the arguments to base_compile.
1002 base_compile="$base_compile $lastarg"
1007 # Accept the current argument as the source file.
1008 # The previous "srcfile" becomes the current argument.
1015 esac # case $arg_mode
1017 # Aesthetically quote the previous argument.
1018 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1021 # Double-quote args containing other shell metacharacters.
1022 # Many Bourne shells cannot handle close brackets correctly
1023 # in scan sets, so we specify it separately.
1024 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1025 lastarg="\"$lastarg\""
1029 base_compile="$base_compile $lastarg"
1034 $echo "$modename: you must specify an argument for -Xcompile"
1038 $echo "$modename: you must specify a target with \`-o'" 1>&2
1042 # Get the name of the library object.
1043 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1047 # Recognize several different file suffixes.
1048 # If the user specifies -o file.o, it is replaced with file.lo
1058 *.class) xform=class ;;
1063 *.java) xform=java ;;
1066 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1069 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1071 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1076 func_infer_tag $base_compile
1078 for arg in $later; do
1097 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1098 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1099 if test "X$xdir" = "X$obj"; then
1104 lobj=${xdir}$objdir/$objname
1106 if test -z "$base_compile"; then
1107 $echo "$modename: you must specify a compilation command" 1>&2
1112 # Delete any leftover library objects.
1113 if test "$build_old_libs" = yes; then
1114 removelist="$obj $lobj $libobj ${libobj}T"
1116 removelist="$lobj $libobj ${libobj}T"
1119 $run $rm $removelist
1120 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1122 # On Cygwin there's no "real" PIC flag so we must build both object types
1124 cygwin* | mingw* | pw32* | os2*)
1128 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1129 # non-PIC code in shared libraries is not supported
1133 # Calculate the filename of the output object if compiler does
1134 # not support -o with -c
1135 if test "$compiler_c_o" = no; then
1136 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1137 lockfile="$output_obj.lock"
1138 removelist="$removelist $output_obj $lockfile"
1139 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1146 # Lock this critical section if it is needed
1147 # We use this script file to make the link, it avoids creating a new file
1148 if test "$need_locks" = yes; then
1149 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1150 $show "Waiting for $lockfile to be removed"
1153 elif test "$need_locks" = warn; then
1154 if test -f "$lockfile"; then
1156 *** ERROR, $lockfile exists and contains:
1157 `cat $lockfile 2>/dev/null`
1159 This indicates that another process is trying to use the same
1160 temporary object file, and libtool could not work around it because
1161 your compiler does not support \`-c' and \`-o' together. If you
1162 repeat this compilation, it may succeed, by chance, but you had better
1163 avoid parallel builds (make -j) in this platform, or get a better
1166 $run $rm $removelist
1169 $echo $srcfile > "$lockfile"
1172 if test -n "$fix_srcfile_path"; then
1173 eval srcfile=\"$fix_srcfile_path\"
1176 $run $rm "$libobj" "${libobj}T"
1178 # Create a libtool object file (analogous to a ".la" file),
1179 # but don't create it if we're doing a dry run.
1180 test -z "$run" && cat > ${libobj}T <<EOF
1181 # $libobj - a libtool object file
1182 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1184 # Please DO NOT delete this file!
1185 # It is necessary for linking the library.
1187 # Name of the PIC object.
1190 # Only build a PIC object if we are building libtool libraries.
1191 if test "$build_libtool_libs" = yes; then
1192 # Without this assignment, base_compile gets emptied.
1193 fbsd_hideous_sh_bug=$base_compile
1195 if test "$pic_mode" != no; then
1196 command="$base_compile $srcfile $pic_flag"
1198 # Don't build PIC code
1199 command="$base_compile $srcfile"
1202 if test ! -d "${xdir}$objdir"; then
1203 $show "$mkdir ${xdir}$objdir"
1204 $run $mkdir ${xdir}$objdir
1206 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1211 if test -z "$output_obj"; then
1212 # Place PIC objects in $objdir
1213 command="$command -o $lobj"
1216 $run $rm "$lobj" "$output_obj"
1219 if $run eval "$command"; then :
1221 test -n "$output_obj" && $run $rm $removelist
1225 if test "$need_locks" = warn &&
1226 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1228 *** ERROR, $lockfile contains:
1229 `cat $lockfile 2>/dev/null`
1231 but it should contain:
1234 This indicates that another process is trying to use the same
1235 temporary object file, and libtool could not work around it because
1236 your compiler does not support \`-c' and \`-o' together. If you
1237 repeat this compilation, it may succeed, by chance, but you had better
1238 avoid parallel builds (make -j) in this platform, or get a better
1241 $run $rm $removelist
1245 # Just move the object if needed, then go on to compile the next one
1246 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1247 $show "$mv $output_obj $lobj"
1248 if $run $mv $output_obj $lobj; then :
1251 $run $rm $removelist
1256 # Append the name of the PIC object to the libtool object file.
1257 test -z "$run" && cat >> ${libobj}T <<EOF
1258 pic_object='$objdir/$objname'
1262 # Allow error messages only from the first compilation.
1263 if test "$suppress_opt" = yes; then
1264 suppress_output=' >/dev/null 2>&1'
1267 # No PIC object so indicate it doesn't exist in the libtool
1269 test -z "$run" && cat >> ${libobj}T <<EOF
1275 # Only build a position-dependent object if we build old libraries.
1276 if test "$build_old_libs" = yes; then
1277 if test "$pic_mode" != yes; then
1278 # Don't build PIC code
1279 command="$base_compile $srcfile"
1281 command="$base_compile $srcfile $pic_flag"
1283 if test "$compiler_c_o" = yes; then
1284 command="$command -o $obj"
1287 # Suppress compiler output if we already did a PIC compilation.
1288 command="$command$suppress_output"
1289 $run $rm "$obj" "$output_obj"
1291 if $run eval "$command"; then :
1293 $run $rm $removelist
1297 if test "$need_locks" = warn &&
1298 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1300 *** ERROR, $lockfile contains:
1301 `cat $lockfile 2>/dev/null`
1303 but it should contain:
1306 This indicates that another process is trying to use the same
1307 temporary object file, and libtool could not work around it because
1308 your compiler does not support \`-c' and \`-o' together. If you
1309 repeat this compilation, it may succeed, by chance, but you had better
1310 avoid parallel builds (make -j) in this platform, or get a better
1313 $run $rm $removelist
1317 # Just move the object if needed
1318 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1319 $show "$mv $output_obj $obj"
1320 if $run $mv $output_obj $obj; then :
1323 $run $rm $removelist
1328 # Append the name of the non-PIC object the libtool object file.
1329 # Only append if the libtool object file exists.
1330 test -z "$run" && cat >> ${libobj}T <<EOF
1331 # Name of the non-PIC object.
1332 non_pic_object='$objname'
1336 # Append the name of the non-PIC object the libtool object file.
1337 # Only append if the libtool object file exists.
1338 test -z "$run" && cat >> ${libobj}T <<EOF
1339 # Name of the non-PIC object.
1345 $run $mv "${libobj}T" "${libobj}"
1347 # Unlock the critical section if it was locked
1348 if test "$need_locks" != no; then
1349 $run $rm "$lockfile"
1357 modename="$modename: link"
1359 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1360 # It is impossible to link a dll without this setting, and
1361 # we shouldn't force the makefile maintainer to figure out
1362 # which system we are compiling for in order to pass an extra
1363 # flag for every libtool invocation.
1364 # allow_undefined=no
1366 # FIXME: Unfortunately, there are problems with the above when trying
1367 # to make a dll which has undefined symbols, in which case not
1368 # even a static library is built. For now, we need to specify
1369 # -no-undefined on the libtool link line when we can be certain
1370 # that all symbols are satisfied, otherwise we get a static library.
1377 libtool_args="$nonopt"
1378 base_compile="$nonopt $@"
1379 compile_command="$nonopt"
1380 finalize_command="$nonopt"
1393 lib_search_path=`pwd`
1402 export_symbols_regex=
1410 precious_files_regex=
1411 prefer_static_libs=no
1424 func_infer_tag $base_compile
1426 # We need to know -static, to get the right output filenames.
1430 -all-static | -static)
1431 if test "X$arg" = "X-all-static"; then
1432 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1433 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1435 if test -n "$link_static_flag"; then
1436 dlopen_self=$dlopen_self_static
1439 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1440 dlopen_self=$dlopen_self_static
1443 build_libtool_libs=no
1445 prefer_static_libs=yes
1451 # See if our shared archives depend on static archives.
1452 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1454 # Go through the arguments, transforming them on the way.
1455 while test "$#" -gt 0; do
1459 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1460 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1464 libtool_args="$libtool_args $qarg"
1466 # If the previous option needs an argument, assign it.
1467 if test -n "$prev"; then
1470 compile_command="$compile_command @OUTPUT@"
1471 finalize_command="$finalize_command @OUTPUT@"
1477 if test "$preload" = no; then
1478 # Add the symbol object into the linking commands.
1479 compile_command="$compile_command @SYMFILE@"
1480 finalize_command="$finalize_command @SYMFILE@"
1484 *.la | *.lo) ;; # We handle these cases below.
1486 if test "$dlself" = no; then
1494 if test "$prev" = dlprefiles; then
1496 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1506 if test "$prev" = dlfiles; then
1507 dlfiles="$dlfiles $arg"
1509 dlprefiles="$dlprefiles $arg"
1517 export_symbols="$arg"
1518 if test ! -f "$arg"; then
1519 $echo "$modename: symbol file \`$arg' does not exist"
1526 export_symbols_regex="$arg"
1531 inst_prefix_dir="$arg"
1536 precious_files_regex="$arg"
1546 if test -f "$arg"; then
1549 for fil in `cat $save_arg`
1551 # moreargs="$moreargs $fil"
1553 # A libtool-controlled object.
1555 # Check to see that this really is a libtool object.
1556 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1561 # If there is no directory component, then add one.
1563 */* | *\\*) . $arg ;;
1567 if test -z "$pic_object" || \
1568 test -z "$non_pic_object" ||
1569 test "$pic_object" = none && \
1570 test "$non_pic_object" = none; then
1571 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1575 # Extract subdirectory from the argument.
1576 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1577 if test "X$xdir" = "X$arg"; then
1583 if test "$pic_object" != none; then
1584 # Prepend the subdirectory the object is found in.
1585 pic_object="$xdir$pic_object"
1587 if test "$prev" = dlfiles; then
1588 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1589 dlfiles="$dlfiles $pic_object"
1593 # If libtool objects are unsupported, then we need to preload.
1598 # CHECK ME: I think I busted this. -Ossama
1599 if test "$prev" = dlprefiles; then
1600 # Preload the old-style object.
1601 dlprefiles="$dlprefiles $pic_object"
1606 libobjs="$libobjs $pic_object"
1611 if test "$non_pic_object" != none; then
1612 # Prepend the subdirectory the object is found in.
1613 non_pic_object="$xdir$non_pic_object"
1615 # A standard non-PIC object
1616 non_pic_objects="$non_pic_objects $non_pic_object"
1617 if test -z "$pic_object" || test "$pic_object" = none ; then
1618 arg="$non_pic_object"
1622 # Only an error if not doing a dry-run.
1623 if test -z "$run"; then
1624 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1629 # Extract subdirectory from the argument.
1630 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1631 if test "X$xdir" = "X$arg"; then
1637 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1638 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1639 libobjs="$libobjs $pic_object"
1640 non_pic_objects="$non_pic_objects $non_pic_object"
1645 $echo "$modename: link input file \`$save_arg' does not exist"
1653 # We need an absolute path.
1655 [\\/]* | [A-Za-z]:[\\/]*) ;;
1657 $echo "$modename: only absolute run-paths are allowed" 1>&2
1661 if test "$prev" = rpath; then
1664 *) rpath="$rpath $arg" ;;
1669 *) xrpath="$xrpath $arg" ;;
1676 compiler_flags="$compiler_flags $qarg"
1678 compile_command="$compile_command $qarg"
1679 finalize_command="$finalize_command $qarg"
1683 linker_flags="$linker_flags $qarg"
1684 compiler_flags="$compiler_flags $wl$qarg"
1686 compile_command="$compile_command $wl$qarg"
1687 finalize_command="$finalize_command $wl$qarg"
1691 linker_flags="$linker_flags $qarg"
1692 compiler_flags="$compiler_flags $qarg"
1694 compile_command="$compile_command $qarg"
1695 finalize_command="$finalize_command $qarg"
1704 eval "$prev=\"\$arg\""
1709 fi # test -n "$prev"
1715 if test -n "$link_static_flag"; then
1716 compile_command="$compile_command $link_static_flag"
1717 finalize_command="$finalize_command $link_static_flag"
1723 # FIXME: remove this flag sometime in the future.
1724 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1748 -export-symbols | -export-symbols-regex)
1749 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1750 $echo "$modename: more than one -exported-symbols argument is not allowed"
1753 if test "X$arg" = "X-export-symbols"; then
1766 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1767 # so, if we see these flags be careful not to treat them like -L
1769 case $with_gcc/$host in
1770 no/*-*-irix* | /*-*-irix*)
1771 compile_command="$compile_command $arg"
1772 finalize_command="$finalize_command $arg"
1779 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1780 # We need an absolute path.
1782 [\\/]* | [A-Za-z]:[\\/]*) ;;
1784 absdir=`cd "$dir" && pwd`
1785 if test -z "$absdir"; then
1786 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1795 deplibs="$deplibs -L$dir"
1796 lib_search_path="$lib_search_path $dir"
1800 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1801 case :$dllsearchpath: in
1803 *) dllsearchpath="$dllsearchpath:$dir";;
1811 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1813 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1814 # These systems don't actually have a C or math library (as such)
1817 *-*-mingw* | *-*-os2*)
1818 # These systems don't actually have a C library (as such)
1819 test "X$arg" = "X-lc" && continue
1821 *-*-openbsd* | *-*-freebsd*)
1822 # Do not include libc due to us having libc/libc_r.
1823 test "X$arg" = "X-lc" && continue
1825 *-*-rhapsody* | *-*-darwin1.[012])
1826 # Rhapsody C and math libraries are in the System framework
1827 deplibs="$deplibs -framework System"
1830 elif test "X$arg" = "X-lc_r"; then
1832 *-*-openbsd* | *-*-freebsd4*)
1833 # Do not include libc_r directly, use -pthread flag.
1838 deplibs="$deplibs $arg"
1842 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1843 deplibs="$deplibs $arg"
1851 # Do not build the useless static library
1858 # gcc -m* arguments should be passed to the linker via $compiler_flags
1859 # in order to pass architecture information to the linker
1860 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1861 # but this is not reliable with gcc because gcc may use -mfoo to
1862 # select a different linker, different libraries, etc, while
1863 # -Wl,-mfoo simply passes -mfoo to the linker.
1865 # Unknown arguments in both finalize_command and compile_command need
1866 # to be aesthetically quoted because they are evaled later.
1867 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1869 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1873 compile_command="$compile_command $arg"
1874 finalize_command="$finalize_command $arg"
1875 if test "$with_gcc" = "yes" ; then
1876 compiler_flags="$compiler_flags $arg"
1893 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1894 # The PATH hackery in wrapper scripts is required on Windows
1895 # in order for the loader to find any dlls it needs.
1896 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1897 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1900 *) no_install=yes ;;
1917 -precious-files-regex)
1938 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1939 # We need an absolute path.
1941 [\\/]* | [A-Za-z]:[\\/]*) ;;
1943 $echo "$modename: only absolute run-paths are allowed" 1>&2
1949 *) xrpath="$xrpath $dir" ;;
1955 # The effects of -static are defined in a previous loop.
1956 # We used to do the same as -all-static on platforms that
1957 # didn't have a PIC flag, but the assumption that the effects
1958 # would be equivalent was wrong. It would break on at least
1959 # Digital Unix and AIX.
1979 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1981 save_ifs="$IFS"; IFS=','
1982 for flag in $args; do
1985 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1990 compiler_flags="$compiler_flags $flag"
1993 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1997 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1999 save_ifs="$IFS"; IFS=','
2000 for flag in $args; do
2003 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2008 compiler_flags="$compiler_flags $wl$flag"
2009 linker_flags="$linker_flags $flag"
2012 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2030 # Some other compiler flag.
2032 # Unknown arguments in both finalize_command and compile_command need
2033 # to be aesthetically quoted because they are evaled later.
2034 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2036 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2043 # A standard object.
2048 # A libtool-controlled object.
2050 # Check to see that this really is a libtool object.
2051 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2056 # If there is no directory component, then add one.
2058 */* | *\\*) . $arg ;;
2062 if test -z "$pic_object" || \
2063 test -z "$non_pic_object" ||
2064 test "$pic_object" = none && \
2065 test "$non_pic_object" = none; then
2066 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2070 # Extract subdirectory from the argument.
2071 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2072 if test "X$xdir" = "X$arg"; then
2078 if test "$pic_object" != none; then
2079 # Prepend the subdirectory the object is found in.
2080 pic_object="$xdir$pic_object"
2082 if test "$prev" = dlfiles; then
2083 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2084 dlfiles="$dlfiles $pic_object"
2088 # If libtool objects are unsupported, then we need to preload.
2093 # CHECK ME: I think I busted this. -Ossama
2094 if test "$prev" = dlprefiles; then
2095 # Preload the old-style object.
2096 dlprefiles="$dlprefiles $pic_object"
2101 libobjs="$libobjs $pic_object"
2106 if test "$non_pic_object" != none; then
2107 # Prepend the subdirectory the object is found in.
2108 non_pic_object="$xdir$non_pic_object"
2110 # A standard non-PIC object
2111 non_pic_objects="$non_pic_objects $non_pic_object"
2112 if test -z "$pic_object" || test "$pic_object" = none ; then
2113 arg="$non_pic_object"
2117 # Only an error if not doing a dry-run.
2118 if test -z "$run"; then
2119 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2124 # Extract subdirectory from the argument.
2125 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2126 if test "X$xdir" = "X$arg"; then
2132 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2133 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2134 libobjs="$libobjs $pic_object"
2135 non_pic_objects="$non_pic_objects $non_pic_object"
2142 deplibs="$deplibs $arg"
2143 old_deplibs="$old_deplibs $arg"
2148 # A libtool-controlled library.
2150 if test "$prev" = dlfiles; then
2151 # This library was specified with -dlopen.
2152 dlfiles="$dlfiles $arg"
2154 elif test "$prev" = dlprefiles; then
2155 # The library was specified with -dlpreopen.
2156 dlprefiles="$dlprefiles $arg"
2159 deplibs="$deplibs $arg"
2164 # Some other compiler argument.
2166 # Unknown arguments in both finalize_command and compile_command need
2167 # to be aesthetically quoted because they are evaled later.
2168 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2170 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2177 # Now actually substitute the argument into the commands.
2178 if test -n "$arg"; then
2179 compile_command="$compile_command $arg"
2180 finalize_command="$finalize_command $arg"
2182 done # argument parsing loop
2184 if test -n "$prev"; then
2185 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2190 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2191 eval arg=\"$export_dynamic_flag_spec\"
2192 compile_command="$compile_command $arg"
2193 finalize_command="$finalize_command $arg"
2197 # calculate the name of the file, without its directory
2198 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2199 libobjs_save="$libobjs"
2201 if test -n "$shlibpath_var"; then
2202 # get the directories listed in $shlibpath_var
2203 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2207 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2208 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2210 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2211 if test "X$output_objdir" = "X$output"; then
2212 output_objdir="$objdir"
2214 output_objdir="$output_objdir/$objdir"
2216 # Create the object directory.
2217 if test ! -d "$output_objdir"; then
2218 $show "$mkdir $output_objdir"
2219 $run $mkdir $output_objdir
2221 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2226 # Determine the type of output
2229 $echo "$modename: you must specify an output file" 1>&2
2233 *.$libext) linkmode=oldlib ;;
2234 *.lo | *.$objext) linkmode=obj ;;
2235 *.la) linkmode=lib ;;
2236 *) linkmode=prog ;; # Anything else should be a program.
2240 *cygwin* | *mingw* | *pw32*)
2241 # don't eliminate duplications in $postdeps and $predeps
2242 duplicate_compiler_generated_deps=yes
2245 duplicate_compiler_generated_deps=$duplicate_deps
2251 # Find all interdependent deplibs by searching for libraries
2252 # that are linked more than once (e.g. -la -lb -la)
2253 for deplib in $deplibs; do
2254 if test "X$duplicate_deps" = "Xyes" ; then
2256 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2259 libs="$libs $deplib"
2262 if test "$linkmode" = lib; then
2263 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2265 # Compute libraries that are listed more than once in $predeps
2266 # $postdeps and mark them as special (i.e., whose duplicates are
2267 # not to be eliminated).
2269 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2270 for pre_post_dep in $predeps $postdeps; do
2271 case "$pre_post_deps " in
2272 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2274 pre_post_deps="$pre_post_deps $pre_post_dep"
2283 need_relink=no # whether we're linking any uninstalled libtool libraries
2284 notinst_deplibs= # not-installed libtool libraries
2285 notinst_path= # paths that contain not-installed libtool libraries
2289 for file in $dlfiles $dlprefiles; do
2293 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2305 passes="conv scan dlopen dlpreopen link"
2310 for pass in $passes; do
2311 if test "$linkmode,$pass" = "lib,link" ||
2312 test "$linkmode,$pass" = "prog,scan"; then
2316 if test "$linkmode" = prog; then
2318 dlopen) libs="$dlfiles" ;;
2319 dlpreopen) libs="$dlprefiles" ;;
2320 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2323 if test "$pass" = dlopen; then
2324 # Collect dlpreopened libraries
2325 save_deplibs="$deplibs"
2328 for deplib in $libs; do
2332 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2333 if test "$linkmode,$pass" = "prog,link"; then
2334 compile_deplibs="$deplib $compile_deplibs"
2335 finalize_deplibs="$deplib $finalize_deplibs"
2337 deplibs="$deplib $deplibs"
2338 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2343 if test "$linkmode" != lib && test "$linkmode" != prog; then
2344 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2347 if test "$pass" = conv; then
2348 deplibs="$deplib $deplibs"
2351 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2352 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2353 for search_ext in .la $std_shrext .so .a; do
2354 # Search the libtool library
2355 lib="$searchdir/lib${name}${search_ext}"
2356 if test -f "$lib"; then
2357 if test "$search_ext" = ".la"; then
2366 if test "$found" != yes; then
2367 # deplib doesn't seem to be a libtool library
2368 if test "$linkmode,$pass" = "prog,link"; then
2369 compile_deplibs="$deplib $compile_deplibs"
2370 finalize_deplibs="$deplib $finalize_deplibs"
2372 deplibs="$deplib $deplibs"
2373 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2376 else # deplib is a libtool library
2377 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2378 # We need to do some special things here, and not later.
2379 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2380 case " $predeps $postdeps " in
2382 if (${SED} -e '2q' $lib |
2383 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2387 */* | *\\*) . $lib ;;
2390 for l in $old_library $library_names; do
2393 if test "X$ll" = "X$old_library" ; then # only static version available
2395 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2396 test "X$ladir" = "X$lib" && ladir="."
2397 lib=$ladir/$old_library
2398 if test "$linkmode,$pass" = "prog,link"; then
2399 compile_deplibs="$deplib $compile_deplibs"
2400 finalize_deplibs="$deplib $finalize_deplibs"
2402 deplibs="$deplib $deplibs"
2403 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2417 deplibs="$deplib $deplibs"
2418 test "$pass" = conv && continue
2419 newdependency_libs="$deplib $newdependency_libs"
2420 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2423 if test "$pass" = conv; then
2424 deplibs="$deplib $deplibs"
2427 if test "$pass" = scan; then
2428 deplibs="$deplib $deplibs"
2430 compile_deplibs="$deplib $compile_deplibs"
2431 finalize_deplibs="$deplib $finalize_deplibs"
2433 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2436 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2442 if test "$pass" = link; then
2443 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2444 # Make sure the xrpath contains only unique directories.
2447 *) xrpath="$xrpath $dir" ;;
2450 deplibs="$deplib $deplibs"
2453 *.la) lib="$deplib" ;;
2455 if test "$pass" = conv; then
2456 deplibs="$deplib $deplibs"
2462 case $deplibs_check_method in
2464 set dummy $deplibs_check_method
2465 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2466 if eval $echo \"$deplib\" 2>/dev/null \
2468 | $EGREP "$match_pattern_regex" > /dev/null; then
2476 if test "$valid_a_lib" != yes; then
2478 $echo "*** Warning: Trying to link with static lib archive $deplib."
2479 $echo "*** I have the capability to make that library automatically link in when"
2480 $echo "*** you link to this library. But I can only do this if you have a"
2481 $echo "*** shared version of the library, which you do not appear to have"
2482 $echo "*** because the file extensions .$libext of this argument makes me believe"
2483 $echo "*** that it is just a static archive that I should not used here."
2486 $echo "*** Warning: Linking the shared library $output against the"
2487 $echo "*** static library $deplib is not portable!"
2488 deplibs="$deplib $deplibs"
2493 if test "$pass" != link; then
2494 deplibs="$deplib $deplibs"
2496 compile_deplibs="$deplib $compile_deplibs"
2497 finalize_deplibs="$deplib $finalize_deplibs"
2504 if test "$pass" = conv; then
2505 deplibs="$deplib $deplibs"
2506 elif test "$linkmode" = prog; then
2507 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2508 # If there is no dlopen support or we're linking statically,
2509 # we need to preload.
2510 newdlprefiles="$newdlprefiles $deplib"
2511 compile_deplibs="$deplib $compile_deplibs"
2512 finalize_deplibs="$deplib $finalize_deplibs"
2514 newdlfiles="$newdlfiles $deplib"
2524 if test "$found" = yes || test -f "$lib"; then :
2526 $echo "$modename: cannot find the library \`$lib'" 1>&2
2530 # Check to see that this really is a libtool archive.
2531 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2533 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2537 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2538 test "X$ladir" = "X$lib" && ladir="."
2546 # If the library was installed with an old release of libtool,
2547 # it will not redefine variables installed, or shouldnotlink
2553 */* | *\\*) . $lib ;;
2557 if test "$linkmode,$pass" = "lib,link" ||
2558 test "$linkmode,$pass" = "prog,scan" ||
2559 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2560 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2561 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2564 if test "$pass" = conv; then
2565 # Only check for convenience libraries
2566 deplibs="$lib $deplibs"
2567 if test -z "$libdir"; then
2568 if test -z "$old_library"; then
2569 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2572 # It is a libtool convenience library, so add in its objects.
2573 convenience="$convenience $ladir/$objdir/$old_library"
2574 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2576 for deplib in $dependency_libs; do
2577 deplibs="$deplib $deplibs"
2578 if test "X$duplicate_deps" = "Xyes" ; then
2579 case "$tmp_libs " in
2580 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2583 tmp_libs="$tmp_libs $deplib"
2585 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2586 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2593 # Get the name of the library we link against.
2595 for l in $old_library $library_names; do
2598 if test -z "$linklib"; then
2599 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2603 # This library was specified with -dlopen.
2604 if test "$pass" = dlopen; then
2605 if test -z "$libdir"; then
2606 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2609 if test -z "$dlname" ||
2610 test "$dlopen_support" != yes ||
2611 test "$build_libtool_libs" = no; then
2612 # If there is no dlname, no dlopen support or we're linking
2613 # statically, we need to preload. We also need to preload any
2614 # dependent libraries so libltdl's deplib preloader doesn't
2615 # bomb out in the load deplibs phase.
2616 dlprefiles="$dlprefiles $lib $dependency_libs"
2618 newdlfiles="$newdlfiles $lib"
2623 # We need an absolute path.
2625 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2627 abs_ladir=`cd "$ladir" && pwd`
2628 if test -z "$abs_ladir"; then
2629 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2630 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2635 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2637 # Find the relevant object directory and library name.
2638 if test "X$installed" = Xyes; then
2639 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2640 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2649 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2652 # Remove this search path later
2653 notinst_path="$notinst_path $abs_ladir"
2655 dir="$ladir/$objdir"
2656 absdir="$abs_ladir/$objdir"
2657 # Remove this search path later
2658 notinst_path="$notinst_path $abs_ladir"
2660 fi # $installed = yes
2661 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2663 # This library was specified with -dlpreopen.
2664 if test "$pass" = dlpreopen; then
2665 if test -z "$libdir"; then
2666 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2669 # Prefer using a static library (so that no silly _DYNAMIC symbols
2670 # are required to link).
2671 if test -n "$old_library"; then
2672 newdlprefiles="$newdlprefiles $dir/$old_library"
2673 # Otherwise, use the dlname, so that lt_dlopen finds it.
2674 elif test -n "$dlname"; then
2675 newdlprefiles="$newdlprefiles $dir/$dlname"
2677 newdlprefiles="$newdlprefiles $dir/$linklib"
2679 fi # $pass = dlpreopen
2681 if test -z "$libdir"; then
2682 # Link the convenience library
2683 if test "$linkmode" = lib; then
2684 deplibs="$dir/$old_library $deplibs"
2685 elif test "$linkmode,$pass" = "prog,link"; then
2686 compile_deplibs="$dir/$old_library $compile_deplibs"
2687 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2689 deplibs="$lib $deplibs" # used for prog,scan pass
2695 if test "$linkmode" = prog && test "$pass" != link; then
2696 newlib_search_path="$newlib_search_path $ladir"
2697 deplibs="$lib $deplibs"
2700 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2701 test "$build_libtool_libs" = no; then
2706 for deplib in $dependency_libs; do
2708 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2710 # Need to link against all dependency_libs?
2711 if test "$linkalldeplibs" = yes; then
2712 deplibs="$deplib $deplibs"
2714 # Need to hardcode shared library paths
2715 # or/and link against static libraries
2716 newdependency_libs="$deplib $newdependency_libs"
2718 if test "X$duplicate_deps" = "Xyes" ; then
2719 case "$tmp_libs " in
2720 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2723 tmp_libs="$tmp_libs $deplib"
2726 fi # $linkmode = prog...
2728 if test "$linkmode,$pass" = "prog,link"; then
2729 if test -n "$library_names" &&
2730 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2731 # We need to hardcode the library path
2732 if test -n "$shlibpath_var"; then
2733 # Make sure the rpath contains only unique directories.
2734 case "$temp_rpath " in
2737 *) temp_rpath="$temp_rpath $dir" ;;
2741 # Hardcode the library path.
2742 # Skip directories that are in the system default run-time
2744 case " $sys_lib_dlsearch_path " in
2747 case "$compile_rpath " in
2749 *) compile_rpath="$compile_rpath $absdir"
2753 case " $sys_lib_dlsearch_path " in
2756 case "$finalize_rpath " in
2758 *) finalize_rpath="$finalize_rpath $libdir"
2762 fi # $linkmode,$pass = prog,link...
2764 if test "$alldeplibs" = yes &&
2765 { test "$deplibs_check_method" = pass_all ||
2766 { test "$build_libtool_libs" = yes &&
2767 test -n "$library_names"; }; }; then
2768 # We only need to search for static libraries
2773 link_static=no # Whether the deplib will be linked statically
2774 if test -n "$library_names" &&
2775 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2776 if test "$installed" = no; then
2777 notinst_deplibs="$notinst_deplibs $lib"
2780 # This is a shared library
2782 # Warn about portability, can't link against -module's on
2783 # some systems (darwin)
2784 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2786 if test "$linkmode" = prog; then
2787 $echo "*** Warning: Linking the executable $output against the loadable module"
2789 $echo "*** Warning: Linking the shared library $output against the loadable module"
2791 $echo "*** $linklib is not portable!"
2793 if test "$linkmode" = lib &&
2794 test "$hardcode_into_libs" = yes; then
2795 # Hardcode the library path.
2796 # Skip directories that are in the system default run-time
2798 case " $sys_lib_dlsearch_path " in
2801 case "$compile_rpath " in
2803 *) compile_rpath="$compile_rpath $absdir"
2807 case " $sys_lib_dlsearch_path " in
2810 case "$finalize_rpath " in
2812 *) finalize_rpath="$finalize_rpath $libdir"
2818 if test -n "$old_archive_from_expsyms_cmds"; then
2819 # figure out the soname
2820 set dummy $library_names
2823 libname=`eval \\$echo \"$libname_spec\"`
2824 # use dlname if we got it. it's perfectly good, no?
2825 if test -n "$dlname"; then
2827 elif test -n "$soname_spec"; then
2831 major=`expr $current - $age`
2835 eval soname=\"$soname_spec\"
2840 # Make a new name for the extract_expsyms_cmds to use
2842 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2843 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2845 # If the library has no export list, then create one now
2846 if test -f "$output_objdir/$soname-def"; then :
2848 $show "extracting exported symbol list from \`$soname'"
2849 save_ifs="$IFS"; IFS='~'
2850 cmds=$extract_expsyms_cmds
2851 for cmd in $cmds; do
2855 $run eval "$cmd" || exit $?
2861 if test -f "$output_objdir/$newlib"; then :; else
2862 $show "generating import library for \`$soname'"
2863 save_ifs="$IFS"; IFS='~'
2864 cmds=$old_archive_from_expsyms_cmds
2865 for cmd in $cmds; do
2869 $run eval "$cmd" || exit $?
2873 # make sure the library variables are pointing to the new library
2876 fi # test -n "$old_archive_from_expsyms_cmds"
2878 if test "$linkmode" = prog || test "$mode" != relink; then
2883 case $hardcode_action in
2884 immediate | unsupported)
2885 if test "$hardcode_direct" = no; then
2888 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2890 # if the lib is a module then we can not link against
2891 # it, someone is ignoring the new warnings I added
2892 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2893 $echo "** Warning, lib $linklib is a module, not a shared library"
2894 if test -z "$old_library" ; then
2896 $echo "** And there doesn't seem to be a static archive available"
2897 $echo "** The link will probably fail, sorry"
2899 add="$dir/$old_library"
2903 elif test "$hardcode_minus_L" = no; then
2905 *-*-sunos*) add_shlibpath="$dir" ;;
2909 elif test "$hardcode_shlibpath_var" = no; then
2910 add_shlibpath="$dir"
2917 if test "$hardcode_direct" = yes; then
2919 elif test "$hardcode_minus_L" = yes; then
2921 # Try looking first in the location we're being installed to.
2922 if test -n "$inst_prefix_dir"; then
2925 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2930 elif test "$hardcode_shlibpath_var" = yes; then
2931 add_shlibpath="$dir"
2940 if test "$lib_linked" != yes; then
2941 $echo "$modename: configuration error: unsupported hardcode properties"
2945 if test -n "$add_shlibpath"; then
2946 case :$compile_shlibpath: in
2947 *":$add_shlibpath:"*) ;;
2948 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2951 if test "$linkmode" = prog; then
2952 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2953 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2955 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2956 test -n "$add" && deplibs="$add $deplibs"
2957 if test "$hardcode_direct" != yes && \
2958 test "$hardcode_minus_L" != yes && \
2959 test "$hardcode_shlibpath_var" = yes; then
2960 case :$finalize_shlibpath: in
2962 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2968 if test "$linkmode" = prog || test "$mode" = relink; then
2972 # Finalize command for both is simple: just hardcode it.
2973 if test "$hardcode_direct" = yes; then
2974 add="$libdir/$linklib"
2975 elif test "$hardcode_minus_L" = yes; then
2978 elif test "$hardcode_shlibpath_var" = yes; then
2979 case :$finalize_shlibpath: in
2981 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2984 elif test "$hardcode_automatic" = yes; then
2985 if test -n "$inst_prefix_dir" &&
2986 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2987 add="$inst_prefix_dir$libdir/$linklib"
2989 add="$libdir/$linklib"
2992 # We cannot seem to hardcode it, guess we'll fake it.
2994 # Try looking first in the location we're being installed to.
2995 if test -n "$inst_prefix_dir"; then
2998 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3005 if test "$linkmode" = prog; then
3006 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3007 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3009 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3010 test -n "$add" && deplibs="$add $deplibs"
3013 elif test "$linkmode" = prog; then
3014 # Here we assume that one of hardcode_direct or hardcode_minus_L
3015 # is not unsupported. This is valid on all known static and
3017 if test "$hardcode_direct" != unsupported; then
3018 test -n "$old_library" && linklib="$old_library"
3019 compile_deplibs="$dir/$linklib $compile_deplibs"
3020 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3022 compile_deplibs="-l$name -L$dir $compile_deplibs"
3023 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3025 elif test "$build_libtool_libs" = yes; then
3026 # Not a shared library
3027 if test "$deplibs_check_method" != pass_all; then
3028 # We're trying link a shared library against a static one
3029 # but the system doesn't support it.
3031 # Just print a warning and add the library to dependency_libs so
3032 # that the program can be linked against the static library.
3034 $echo "*** Warning: This system can not link to static lib archive $lib."
3035 $echo "*** I have the capability to make that library automatically link in when"
3036 $echo "*** you link to this library. But I can only do this if you have a"
3037 $echo "*** shared version of the library, which you do not appear to have."
3038 if test "$module" = yes; then
3039 $echo "*** But as you try to build a module library, libtool will still create "
3040 $echo "*** a static module, that should work as long as the dlopening application"
3041 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3042 if test -z "$global_symbol_pipe"; then
3044 $echo "*** However, this would only work if libtool was able to extract symbol"
3045 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3046 $echo "*** not find such a program. So, this module is probably useless."
3047 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3049 if test "$build_old_libs" = no; then
3050 build_libtool_libs=module
3053 build_libtool_libs=no
3057 convenience="$convenience $dir/$old_library"
3058 old_convenience="$old_convenience $dir/$old_library"
3059 deplibs="$dir/$old_library $deplibs"
3062 fi # link shared/static library?
3064 if test "$linkmode" = lib; then
3065 if test -n "$dependency_libs" &&
3066 { test "$hardcode_into_libs" != yes ||
3067 test "$build_old_libs" = yes ||
3068 test "$link_static" = yes; }; then
3069 # Extract -R from dependency_libs
3071 for libdir in $dependency_libs; do
3073 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3075 *" $temp_xrpath "*) ;;
3076 *) xrpath="$xrpath $temp_xrpath";;
3078 *) temp_deplibs="$temp_deplibs $libdir";;
3081 dependency_libs="$temp_deplibs"
3084 newlib_search_path="$newlib_search_path $absdir"
3085 # Link against this library
3086 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3087 # ... and its dependency_libs
3089 for deplib in $dependency_libs; do
3090 newdependency_libs="$deplib $newdependency_libs"
3091 if test "X$duplicate_deps" = "Xyes" ; then
3092 case "$tmp_libs " in
3093 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3096 tmp_libs="$tmp_libs $deplib"
3099 if test "$link_all_deplibs" != no; then
3100 # Add the search paths of all dependency libraries
3101 for deplib in $dependency_libs; do
3103 -L*) path="$deplib" ;;
3105 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3106 test "X$dir" = "X$deplib" && dir="."
3107 # We need an absolute path.
3109 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3111 absdir=`cd "$dir" && pwd`
3112 if test -z "$absdir"; then
3113 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3118 if grep "^installed=no" $deplib > /dev/null; then
3119 path="$absdir/$objdir"
3121 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3122 if test -z "$libdir"; then
3123 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3126 if test "$absdir" != "$libdir"; then
3127 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3134 # we do not want to link against static libs,
3135 # but need to link against shared
3136 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3137 if test -n "$deplibrary_names" ; then
3138 for tmp in $deplibrary_names ; do
3141 if test -f "$path/$depdepl" ; then
3142 depdepl="$path/$depdepl"
3144 # do not add paths which are already there
3145 case " $newlib_search_path " in
3147 *) newlib_search_path="$newlib_search_path $path";;
3160 # Again, we only want to link against shared libraries
3161 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3162 for tmp in $newlib_search_path ; do
3163 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3164 eval depdepl="$tmp/lib$tmp_libs.dylib"
3175 case " $deplibs " in
3177 *) deplibs="$depdepl $deplibs" ;;
3179 case " $deplibs " in
3181 *) deplibs="$deplibs $path" ;;
3184 fi # link_all_deplibs != no
3186 done # for deplib in $libs
3187 dependency_libs="$newdependency_libs"
3188 if test "$pass" = dlpreopen; then
3189 # Link the dlpreopened libraries before other libraries
3190 for deplib in $save_deplibs; do
3191 deplibs="$deplib $deplibs"
3194 if test "$pass" != dlopen; then
3195 if test "$pass" != conv; then
3196 # Make sure lib_search_path contains only unique directories.
3198 for dir in $newlib_search_path; do
3199 case "$lib_search_path " in
3201 *) lib_search_path="$lib_search_path $dir" ;;
3207 if test "$linkmode,$pass" != "prog,link"; then
3210 vars="compile_deplibs finalize_deplibs"
3212 for var in $vars dependency_libs; do
3213 # Add libraries to $var in reverse order
3214 eval tmp_libs=\"\$$var\"
3216 for deplib in $tmp_libs; do
3217 # FIXME: Pedantically, this is the right thing to do, so
3218 # that some nasty dependency loop isn't accidentally
3220 #new_libs="$deplib $new_libs"
3221 # Pragmatically, this seems to cause very few problems in
3224 -L*) new_libs="$deplib $new_libs" ;;
3227 # And here is the reason: when a library appears more
3228 # than once as an explicit dependence of a library, or
3229 # is implicitly linked in more than once by the
3230 # compiler, it is considered special, and multiple
3231 # occurrences thereof are not removed. Compare this
3232 # with having the same library being listed as a
3233 # dependency of multiple other libraries: in this case,
3234 # we know (pedantically, we assume) the library does not
3235 # need to be listed more than once, so we keep only the
3236 # last copy. This is not always right, but it is rare
3237 # enough that we require users that really mean to play
3238 # such unportable linking tricks to link the library
3239 # using -Wl,-lname, so that libtool does not consider it
3240 # for duplicate removal.
3241 case " $specialdeplibs " in
3242 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3244 case " $new_libs " in
3246 *) new_libs="$deplib $new_libs" ;;
3254 for deplib in $new_libs; do
3257 case " $tmp_libs " in
3259 *) tmp_libs="$tmp_libs $deplib" ;;
3262 *) tmp_libs="$tmp_libs $deplib" ;;
3265 eval $var=\"$tmp_libs\"
3268 # Last step: remove runtime libs from dependency_libs
3269 # (they stay in deplibs)
3271 for i in $dependency_libs ; do
3272 case " $predeps $postdeps $compiler_lib_search_path " in
3277 if test -n "$i" ; then
3278 tmp_libs="$tmp_libs $i"
3281 dependency_libs=$tmp_libs
3283 if test "$linkmode" = prog; then
3284 dlfiles="$newdlfiles"
3285 dlprefiles="$newdlprefiles"
3290 if test -n "$deplibs"; then
3291 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3294 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3295 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3298 if test -n "$rpath"; then
3299 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3302 if test -n "$xrpath"; then
3303 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3306 if test -n "$vinfo"; then
3307 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3310 if test -n "$release"; then
3311 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3314 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3315 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3318 # Now set the variables for building old libraries.
3319 build_libtool_libs=no
3321 objs="$objs$old_deplibs"
3325 # Make sure we only generate libraries of the form `libNAME.la'.
3328 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3329 eval shared_ext=\"$shrext_cmds\"
3330 eval libname=\"$libname_spec\"
3333 if test "$module" = no; then
3334 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3338 if test "$need_lib_prefix" != no; then
3339 # Add the "lib" prefix for modules if required
3340 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3341 eval shared_ext=\"$shrext_cmds\"
3342 eval libname=\"$libname_spec\"
3344 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3349 if test -n "$objs"; then
3350 if test "$deplibs_check_method" != pass_all; then
3351 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3355 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3356 $echo "*** objects $objs is not portable!"
3357 libobjs="$libobjs $objs"
3361 if test "$dlself" != no; then
3362 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3366 if test "$#" -gt 2; then
3367 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3372 if test -z "$rpath"; then
3373 if test "$build_libtool_libs" = yes; then
3374 # Building a libtool convenience library.
3375 # Some compilers have problems with a `.al' extension so
3376 # convenience libraries should have the same extension an
3377 # archive normally would.
3378 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3379 build_libtool_libs=convenience
3383 if test -n "$vinfo"; then
3384 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3387 if test -n "$release"; then
3388 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3392 # Parse the version information argument.
3393 save_ifs="$IFS"; IFS=':'
3394 set dummy $vinfo 0 0 0
3397 if test -n "$8"; then
3398 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3403 # convert absolute version numbers to libtool ages
3404 # this retains compatibility with .la files and attempts
3405 # to make the code below a bit more comprehensible
3407 case $vinfo_number in
3411 number_revision="$4"
3413 # There are really only two kinds -- those that
3414 # use the current revision as the major version
3415 # and those that subtract age and use age as
3416 # a minor version. But, then there is irix
3417 # which has an extra 1 added just for fun
3419 case $version_type in
3420 darwin|linux|osf|windows)
3421 current=`expr $number_major + $number_minor`
3423 revision="$number_revision"
3425 freebsd-aout|freebsd-elf|sunos)
3426 current="$number_major"
3427 revision="$number_minor"
3431 current=`expr $number_major + $number_minor - 1`
3433 revision="$number_minor"
3444 # Check that each of the things are valid numbers.
3446 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3448 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3449 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3455 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3457 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3458 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3464 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3466 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3467 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3472 if test "$age" -gt "$current"; then
3473 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3474 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3478 # Calculate the version variables.
3482 case $version_type in
3486 # Like Linux, but with the current version available in
3487 # verstring for coding it into the library header
3488 major=.`expr $current - $age`
3489 versuffix="$major.$age.$revision"
3490 # Darwin ld doesn't like 0 for these options...
3491 minor_current=`expr $current + 1`
3492 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3497 versuffix=".$current.$revision";
3502 versuffix=".$current";
3506 major=`expr $current - $age + 1`
3508 case $version_type in
3509 nonstopux) verstring_prefix=nonstopux ;;
3510 *) verstring_prefix=sgi ;;
3512 verstring="$verstring_prefix$major.$revision"
3514 # Add in all the interfaces that we are compatible with.
3516 while test "$loop" -ne 0; do
3517 iface=`expr $revision - $loop`
3518 loop=`expr $loop - 1`
3519 verstring="$verstring_prefix$major.$iface:$verstring"
3522 # Before this point, $major must not contain `.'.
3524 versuffix="$major.$revision"
3528 major=.`expr $current - $age`
3529 versuffix="$major.$age.$revision"
3533 major=.`expr $current - $age`
3534 versuffix=".$current.$age.$revision"
3535 verstring="$current.$age.$revision"
3537 # Add in all the interfaces that we are compatible with.
3539 while test "$loop" -ne 0; do
3540 iface=`expr $current - $loop`
3541 loop=`expr $loop - 1`
3542 verstring="$verstring:${iface}.0"
3545 # Make executables depend on our current version.
3546 verstring="$verstring:${current}.0"
3551 versuffix=".$current.$revision"
3555 # Use '-' rather than '.', since we only want one
3556 # extension on DOS 8.3 filesystems.
3557 major=`expr $current - $age`
3562 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3563 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3568 # Clear the version info if we defaulted, and they specified a release.
3569 if test -z "$vinfo" && test -n "$release"; then
3571 case $version_type in
3573 # we can't check for "0.0" in archive_cmds due to quoting
3574 # problems, so we reset it completely
3581 if test "$need_version" = no; then
3588 # Remove version info from name if versioning should be avoided
3589 if test "$avoid_version" = yes && test "$need_version" = no; then
3595 # Check to see if the archive will have undefined symbols.
3596 if test "$allow_undefined" = yes; then
3597 if test "$allow_undefined_flag" = unsupported; then
3598 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3599 build_libtool_libs=no
3603 # Don't allow undefined symbols.
3604 allow_undefined_flag="$no_undefined_flag"
3608 if test "$mode" != relink; then
3609 # Remove our outputs, but don't remove object files since they
3610 # may have been created when compiling PIC objects.
3612 tempremovelist=`$echo "$output_objdir/*"`
3613 for p in $tempremovelist; do
3617 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3618 if test "X$precious_files_regex" != "X"; then
3619 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3624 removelist="$removelist $p"
3629 if test -n "$removelist"; then
3630 $show "${rm}r $removelist"
3631 $run ${rm}r $removelist
3635 # Now set the variables for building old libraries.
3636 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3637 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3639 # Transform .lo files to .o files.
3640 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3643 # Eliminate all temporary directories.
3644 for path in $notinst_path; do
3645 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3646 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3647 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3650 if test -n "$xrpath"; then
3651 # If the user specified any rpath flags, then add them.
3653 for libdir in $xrpath; do
3654 temp_xrpath="$temp_xrpath -R$libdir"
3655 case "$finalize_rpath " in
3657 *) finalize_rpath="$finalize_rpath $libdir" ;;
3660 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3661 dependency_libs="$temp_xrpath $dependency_libs"
3665 # Make sure dlfiles contains only unique files that won't be dlpreopened
3666 old_dlfiles="$dlfiles"
3668 for lib in $old_dlfiles; do
3669 case " $dlprefiles $dlfiles " in
3671 *) dlfiles="$dlfiles $lib" ;;
3675 # Make sure dlprefiles contains only unique files
3676 old_dlprefiles="$dlprefiles"
3678 for lib in $old_dlprefiles; do
3679 case "$dlprefiles " in
3681 *) dlprefiles="$dlprefiles $lib" ;;
3685 if test "$build_libtool_libs" = yes; then
3686 if test -n "$rpath"; then
3688 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3689 # these systems don't actually have a c library (as such)!
3691 *-*-rhapsody* | *-*-darwin1.[012])
3692 # Rhapsody C library is in the System framework
3693 deplibs="$deplibs -framework System"
3696 # Don't link with libc until the a.out ld.so is fixed.
3698 *-*-openbsd* | *-*-freebsd*)
3699 # Do not include libc due to us having libc/libc_r.
3700 test "X$arg" = "X-lc" && continue
3703 # Add libc to deplibs on all other systems if necessary.
3704 if test "$build_libtool_need_lc" = "yes"; then
3705 deplibs="$deplibs -lc"
3711 # Transform deplibs into only deplibs that can be linked in shared.
3713 libname_save=$libname
3714 release_save=$release
3715 versuffix_save=$versuffix
3717 # I'm not sure if I'm treating the release correctly. I think
3718 # release should show up in the -l (ie -lgmp5) so we don't want to
3719 # add it in twice. Is that correct?
3725 case $deplibs_check_method in
3727 # Don't check for shared/static. Everything works.
3728 # This might be a little naive. We might want to check
3729 # whether the library exists or not. But this is on
3730 # osf3 & osf4 and I'm not really sure... Just
3731 # implementing what was already the behavior.
3735 # This code stresses the "libraries are programs" paradigm to its
3736 # limits. Maybe even breaks it. We compile a program, linking it
3737 # against the deplibs as a proxy for the library. Then we can check
3738 # whether they linked in statically or dynamically with ldd.
3740 cat > conftest.c <<EOF
3741 int main() { return 0; }
3744 $LTCC -o conftest conftest.c $deplibs
3745 if test "$?" -eq 0 ; then
3746 ldd_output=`ldd conftest`
3747 for i in $deplibs; do
3748 name="`expr $i : '-l\(.*\)'`"
3749 # If $name is empty we are operating on a -L argument.
3750 if test "$name" != "" && test "$name" -ne "0"; then
3751 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3752 case " $predeps $postdeps " in
3754 newdeplibs="$newdeplibs $i"
3759 if test -n "$i" ; then
3760 libname=`eval \\$echo \"$libname_spec\"`
3761 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3762 set dummy $deplib_matches
3764 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3765 newdeplibs="$newdeplibs $i"
3769 $echo "*** Warning: dynamic linker does not accept needed library $i."
3770 $echo "*** I have the capability to make that library automatically link in when"
3771 $echo "*** you link to this library. But I can only do this if you have a"
3772 $echo "*** shared version of the library, which I believe you do not have"
3773 $echo "*** because a test_compile did reveal that the linker did not use it for"
3774 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3778 newdeplibs="$newdeplibs $i"
3782 # Error occurred in the first compile. Let's try to salvage
3783 # the situation: Compile a separate program for each library.
3784 for i in $deplibs; do
3785 name="`expr $i : '-l\(.*\)'`"
3786 # If $name is empty we are operating on a -L argument.
3787 if test "$name" != "" && test "$name" != "0"; then
3789 $LTCC -o conftest conftest.c $i
3791 if test "$?" -eq 0 ; then
3792 ldd_output=`ldd conftest`
3793 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3794 case " $predeps $postdeps " in
3796 newdeplibs="$newdeplibs $i"
3801 if test -n "$i" ; then
3802 libname=`eval \\$echo \"$libname_spec\"`
3803 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3804 set dummy $deplib_matches
3806 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3807 newdeplibs="$newdeplibs $i"
3811 $echo "*** Warning: dynamic linker does not accept needed library $i."
3812 $echo "*** I have the capability to make that library automatically link in when"
3813 $echo "*** you link to this library. But I can only do this if you have a"
3814 $echo "*** shared version of the library, which you do not appear to have"
3815 $echo "*** because a test_compile did reveal that the linker did not use this one"
3816 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3822 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3823 $echo "*** make it link in! You will probably need to install it or some"
3824 $echo "*** library that it depends on before this library will be fully"
3825 $echo "*** functional. Installing it before continuing would be even better."
3828 newdeplibs="$newdeplibs $i"
3834 set dummy $deplibs_check_method
3835 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3836 for a_deplib in $deplibs; do
3837 name="`expr $a_deplib : '-l\(.*\)'`"
3838 # If $name is empty we are operating on a -L argument.
3839 if test "$name" != "" && test "$name" != "0"; then
3840 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3841 case " $predeps $postdeps " in
3843 newdeplibs="$newdeplibs $a_deplib"
3848 if test -n "$a_deplib" ; then
3849 libname=`eval \\$echo \"$libname_spec\"`
3850 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3851 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3852 for potent_lib in $potential_libs; do
3853 # Follow soft links.
3854 if ls -lLd "$potent_lib" 2>/dev/null \
3855 | grep " -> " >/dev/null; then
3858 # The statement above tries to avoid entering an
3859 # endless loop below, in case of cyclic links.
3860 # We might still enter an endless loop, since a link
3861 # loop can be closed while we follow links,
3863 potlib="$potent_lib"
3864 while test -h "$potlib" 2>/dev/null; do
3865 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3867 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3868 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3871 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3873 | $EGREP "$file_magic_regex" > /dev/null; then
3874 newdeplibs="$newdeplibs $a_deplib"
3881 if test -n "$a_deplib" ; then
3884 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3885 $echo "*** I have the capability to make that library automatically link in when"
3886 $echo "*** you link to this library. But I can only do this if you have a"
3887 $echo "*** shared version of the library, which you do not appear to have"
3888 $echo "*** because I did check the linker path looking for a file starting"
3889 if test -z "$potlib" ; then
3890 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3892 $echo "*** with $libname and none of the candidates passed a file format test"
3893 $echo "*** using a file magic. Last file checked: $potlib"
3897 # Add a -L argument.
3898 newdeplibs="$newdeplibs $a_deplib"
3900 done # Gone through all deplibs.
3903 set dummy $deplibs_check_method
3904 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3905 for a_deplib in $deplibs; do
3906 name="`expr $a_deplib : '-l\(.*\)'`"
3907 # If $name is empty we are operating on a -L argument.
3908 if test -n "$name" && test "$name" != "0"; then
3909 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3910 case " $predeps $postdeps " in
3912 newdeplibs="$newdeplibs $a_deplib"
3917 if test -n "$a_deplib" ; then
3918 libname=`eval \\$echo \"$libname_spec\"`
3919 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3920 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3921 for potent_lib in $potential_libs; do
3922 potlib="$potent_lib" # see symlink-check above in file_magic test
3923 if eval $echo \"$potent_lib\" 2>/dev/null \
3925 | $EGREP "$match_pattern_regex" > /dev/null; then
3926 newdeplibs="$newdeplibs $a_deplib"
3933 if test -n "$a_deplib" ; then
3936 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3937 $echo "*** I have the capability to make that library automatically link in when"
3938 $echo "*** you link to this library. But I can only do this if you have a"
3939 $echo "*** shared version of the library, which you do not appear to have"
3940 $echo "*** because I did check the linker path looking for a file starting"
3941 if test -z "$potlib" ; then
3942 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3944 $echo "*** with $libname and none of the candidates passed a file format test"
3945 $echo "*** using a regex pattern. Last file checked: $potlib"
3949 # Add a -L argument.
3950 newdeplibs="$newdeplibs $a_deplib"
3952 done # Gone through all deplibs.
3956 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3957 -e 's/ -[LR][^ ]*//g'`
3958 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3959 for i in $predeps $postdeps ; do
3960 # can't use Xsed below, because $i might contain '/'
3961 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3964 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3965 | grep . >/dev/null; then
3967 if test "X$deplibs_check_method" = "Xnone"; then
3968 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3970 $echo "*** Warning: inter-library dependencies are not known to be supported."
3972 $echo "*** All declared inter-library dependencies are being dropped."
3977 versuffix=$versuffix_save
3979 release=$release_save
3980 libname=$libname_save
3984 *-*-rhapsody* | *-*-darwin1.[012])
3985 # On Rhapsody replace the C library is the System framework
3986 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3990 if test "$droppeddeps" = yes; then
3991 if test "$module" = yes; then
3993 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3994 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3995 $echo "*** a static module, that should work as long as the dlopening"
3996 $echo "*** application is linked with the -dlopen flag."
3997 if test -z "$global_symbol_pipe"; then
3999 $echo "*** However, this would only work if libtool was able to extract symbol"
4000 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4001 $echo "*** not find such a program. So, this module is probably useless."
4002 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4004 if test "$build_old_libs" = no; then
4005 oldlibs="$output_objdir/$libname.$libext"
4006 build_libtool_libs=module
4009 build_libtool_libs=no
4012 $echo "*** The inter-library dependencies that have been dropped here will be"
4013 $echo "*** automatically added whenever a program is linked with this library"
4014 $echo "*** or is declared to -dlopen it."
4016 if test "$allow_undefined" = no; then
4018 $echo "*** Since this library must not contain undefined symbols,"
4019 $echo "*** because either the platform does not support them or"
4020 $echo "*** it was explicitly requested with -no-undefined,"
4021 $echo "*** libtool will only create a static version of it."
4022 if test "$build_old_libs" = no; then
4023 oldlibs="$output_objdir/$libname.$libext"
4024 build_libtool_libs=module
4027 build_libtool_libs=no
4032 # Done checking deplibs!
4036 # All the library-specific variables (install_libdir is set above).
4041 # Test again, we may have decided not to build it any more
4042 if test "$build_libtool_libs" = yes; then
4043 if test "$hardcode_into_libs" = yes; then
4044 # Hardcode the library paths
4047 rpath="$finalize_rpath"
4048 test "$mode" != relink && rpath="$compile_rpath$rpath"
4049 for libdir in $rpath; do
4050 if test -n "$hardcode_libdir_flag_spec"; then
4051 if test -n "$hardcode_libdir_separator"; then
4052 if test -z "$hardcode_libdirs"; then
4053 hardcode_libdirs="$libdir"
4055 # Just accumulate the unique libdirs.
4056 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4057 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4060 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4065 eval flag=\"$hardcode_libdir_flag_spec\"
4066 dep_rpath="$dep_rpath $flag"
4068 elif test -n "$runpath_var"; then
4069 case "$perm_rpath " in
4071 *) perm_rpath="$perm_rpath $libdir" ;;
4075 # Substitute the hardcoded libdirs into the rpath.
4076 if test -n "$hardcode_libdir_separator" &&
4077 test -n "$hardcode_libdirs"; then
4078 libdir="$hardcode_libdirs"
4079 if test -n "$hardcode_libdir_flag_spec_ld"; then
4080 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4082 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4085 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4086 # We should set the runpath_var.
4088 for dir in $perm_rpath; do
4091 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4093 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4096 shlibpath="$finalize_shlibpath"
4097 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4098 if test -n "$shlibpath"; then
4099 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4102 # Get the real and link names of the library.
4103 eval shared_ext=\"$shrext_cmds\"
4104 eval library_names=\"$library_names_spec\"
4105 set dummy $library_names
4109 if test -n "$soname_spec"; then
4110 eval soname=\"$soname_spec\"
4114 if test -z "$dlname"; then
4118 lib="$output_objdir/$realname"
4121 linknames="$linknames $link"
4124 # Use standard objects if they are pic
4125 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4127 # Prepare the list of exported symbols
4128 if test -z "$export_symbols"; then
4129 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4130 $show "generating symbol list for \`$libname.la'"
4131 export_symbols="$output_objdir/$libname.exp"
4132 $run $rm $export_symbols
4133 cmds=$export_symbols_cmds
4134 save_ifs="$IFS"; IFS='~'
4135 for cmd in $cmds; do
4138 if len=`expr "X$cmd" : ".*"` &&
4139 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4141 $run eval "$cmd" || exit $?
4142 skipped_export=false
4144 # The command line is too long to execute in one step.
4145 $show "using reloadable object file for export list..."
4150 if test -n "$export_symbols_regex"; then
4151 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4152 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4153 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4154 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4159 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4160 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4164 for test_deplib in $deplibs; do
4165 case " $convenience " in
4166 *" $test_deplib "*) ;;
4168 tmp_deplibs="$tmp_deplibs $test_deplib"
4172 deplibs="$tmp_deplibs"
4174 if test -n "$convenience"; then
4175 if test -n "$whole_archive_flag_spec"; then
4176 save_libobjs=$libobjs
4177 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4179 gentop="$output_objdir/${outputname}x"
4180 generated="$generated $gentop"
4182 func_extract_archives $gentop $convenience
4183 libobjs="$libobjs $func_extract_archives_result"
4187 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4188 eval flag=\"$thread_safe_flag_spec\"
4189 linker_flags="$linker_flags $flag"
4192 # Make a backup of the uninstalled library when relinking
4193 if test "$mode" = relink; then
4194 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4197 # Do each of the archive commands.
4198 if test "$module" = yes && test -n "$module_cmds" ; then
4199 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4200 eval test_cmds=\"$module_expsym_cmds\"
4201 cmds=$module_expsym_cmds
4203 eval test_cmds=\"$module_cmds\"
4207 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4208 eval test_cmds=\"$archive_expsym_cmds\"
4209 cmds=$archive_expsym_cmds
4211 eval test_cmds=\"$archive_cmds\"
4216 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4217 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4220 # The command line is too long to link in one step, link piecewise.
4221 $echo "creating reloadable object files..."
4223 # Save the value of $output and $libobjs because we want to
4224 # use them later. If we have whole_archive_flag_spec, we
4225 # want to use save_libobjs as it was before
4226 # whole_archive_flag_spec was expanded, because we can't
4227 # assume the linker understands whole_archive_flag_spec.
4228 # This may have to be revisited, in case too many
4229 # convenience libraries get linked in and end up exceeding
4231 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4232 save_libobjs=$libobjs
4236 # Clear the reloadable object creation command queue and
4237 # initialize k to one.
4244 output=$output_objdir/$save_output-${k}.$objext
4245 # Loop over the list of objects to be linked.
4246 for obj in $save_libobjs
4248 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4249 if test "X$objlist" = X ||
4250 { len=`expr "X$test_cmds" : ".*"` &&
4251 test "$len" -le "$max_cmd_len"; }; then
4252 objlist="$objlist $obj"
4254 # The command $test_cmds is almost too long, add a
4255 # command to the queue.
4256 if test "$k" -eq 1 ; then
4257 # The first file doesn't have a previous command to add.
4258 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4260 # All subsequent reloadable object files will link in
4261 # the last one created.
4262 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4264 last_robj=$output_objdir/$save_output-${k}.$objext
4266 output=$output_objdir/$save_output-${k}.$objext
4271 # Handle the remaining objects by creating one last
4272 # reloadable object file. All subsequent reloadable object
4273 # files will link in the last one created.
4274 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4275 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4277 if ${skipped_export-false}; then
4278 $show "generating symbol list for \`$libname.la'"
4279 export_symbols="$output_objdir/$libname.exp"
4280 $run $rm $export_symbols
4282 # Append the command to create the export file.
4283 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4286 # Set up a command to remove the reloadale object files
4287 # after they are used.
4289 while test "$i" -lt "$k"
4292 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4295 $echo "creating a temporary reloadable object file: $output"
4297 # Loop through the commands generated above and execute them.
4298 save_ifs="$IFS"; IFS='~'
4299 for cmd in $concat_cmds; do
4302 $run eval "$cmd" || exit $?
4307 # Restore the value of output.
4310 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4311 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4313 # Expand the library linking commands again to reset the
4314 # value of $libobjs for piecewise linking.
4316 # Do each of the archive commands.
4317 if test "$module" = yes && test -n "$module_cmds" ; then
4318 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4319 cmds=$module_expsym_cmds
4324 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4325 cmds=$archive_expsym_cmds
4331 # Append the command to remove the reloadable object files
4332 # to the just-reset $cmds.
4333 eval cmds=\"\$cmds~\$rm $delfiles\"
4335 save_ifs="$IFS"; IFS='~'
4336 for cmd in $cmds; do
4340 $run eval "$cmd" || exit $?
4344 # Restore the uninstalled library and exit
4345 if test "$mode" = relink; then
4346 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4350 # Create links to the real library.
4351 for linkname in $linknames; do
4352 if test "$realname" != "$linkname"; then
4353 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4354 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4358 # If -module or -export-dynamic was specified, set the dlname.
4359 if test "$module" = yes || test "$export_dynamic" = yes; then
4360 # On all known operating systems, these are identical.
4367 if test -n "$deplibs"; then
4368 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4371 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4372 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4375 if test -n "$rpath"; then
4376 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4379 if test -n "$xrpath"; then
4380 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4383 if test -n "$vinfo"; then
4384 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4387 if test -n "$release"; then
4388 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4393 if test -n "$objs$old_deplibs"; then
4394 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4398 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4406 # Delete the old objects.
4407 $run $rm $obj $libobj
4409 # Objects from convenience libraries. This assumes
4410 # single-version convenience libraries. Whenever we create
4411 # different ones for PIC/non-PIC, this we'll have to duplicate
4415 # reload_cmds runs $LD directly, so let us get rid of
4416 # -Wl from whole_archive_flag_spec
4419 if test -n "$convenience"; then
4420 if test -n "$whole_archive_flag_spec"; then
4421 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4423 gentop="$output_objdir/${obj}x"
4424 generated="$generated $gentop"
4426 func_extract_archives $gentop $convenience
4427 reload_conv_objs="$reload_objs $func_extract_archives_result"
4431 # Create the old-style object.
4432 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
4436 save_ifs="$IFS"; IFS='~'
4437 for cmd in $cmds; do
4441 $run eval "$cmd" || exit $?
4445 # Exit if we aren't doing a library object file.
4446 if test -z "$libobj"; then
4447 if test -n "$gentop"; then
4448 $show "${rm}r $gentop"
4455 if test "$build_libtool_libs" != yes; then
4456 if test -n "$gentop"; then
4457 $show "${rm}r $gentop"
4461 # Create an invalid libtool object if no PIC, so that we don't
4462 # accidentally link it into a program.
4463 # $show "echo timestamp > $libobj"
4464 # $run eval "echo timestamp > $libobj" || exit $?
4468 if test -n "$pic_flag" || test "$pic_mode" != default; then
4469 # Only do commands if we really have different PIC objects.
4470 reload_objs="$libobjs $reload_conv_objs"
4473 save_ifs="$IFS"; IFS='~'
4474 for cmd in $cmds; do
4478 $run eval "$cmd" || exit $?
4483 if test -n "$gentop"; then
4484 $show "${rm}r $gentop"
4493 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4495 if test -n "$vinfo"; then
4496 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4499 if test -n "$release"; then
4500 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4503 if test "$preload" = yes; then
4504 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4505 test "$dlopen_self_static" = unknown; then
4506 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4511 *-*-rhapsody* | *-*-darwin1.[012])
4512 # On Rhapsody replace the C library is the System framework
4513 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4514 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4520 # Don't allow lazy linking, it breaks C++ global constructors
4521 if test "$tagname" = CXX ; then
4522 compile_command="$compile_command ${wl}-bind_at_load"
4523 finalize_command="$finalize_command ${wl}-bind_at_load"
4528 compile_command="$compile_command $compile_deplibs"
4529 finalize_command="$finalize_command $finalize_deplibs"
4531 if test -n "$rpath$xrpath"; then
4532 # If the user specified any rpath flags, then add them.
4533 for libdir in $rpath $xrpath; do
4534 # This is the magic to use -rpath.
4535 case "$finalize_rpath " in
4537 *) finalize_rpath="$finalize_rpath $libdir" ;;
4542 # Now hardcode the library paths
4545 for libdir in $compile_rpath $finalize_rpath; do
4546 if test -n "$hardcode_libdir_flag_spec"; then
4547 if test -n "$hardcode_libdir_separator"; then
4548 if test -z "$hardcode_libdirs"; then
4549 hardcode_libdirs="$libdir"
4551 # Just accumulate the unique libdirs.
4552 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4553 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4556 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4561 eval flag=\"$hardcode_libdir_flag_spec\"
4562 rpath="$rpath $flag"
4564 elif test -n "$runpath_var"; then
4565 case "$perm_rpath " in
4567 *) perm_rpath="$perm_rpath $libdir" ;;
4571 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4572 case :$dllsearchpath: in
4574 *) dllsearchpath="$dllsearchpath:$libdir";;
4579 # Substitute the hardcoded libdirs into the rpath.
4580 if test -n "$hardcode_libdir_separator" &&
4581 test -n "$hardcode_libdirs"; then
4582 libdir="$hardcode_libdirs"
4583 eval rpath=\" $hardcode_libdir_flag_spec\"
4585 compile_rpath="$rpath"
4589 for libdir in $finalize_rpath; do
4590 if test -n "$hardcode_libdir_flag_spec"; then
4591 if test -n "$hardcode_libdir_separator"; then
4592 if test -z "$hardcode_libdirs"; then
4593 hardcode_libdirs="$libdir"
4595 # Just accumulate the unique libdirs.
4596 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4597 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4600 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4605 eval flag=\"$hardcode_libdir_flag_spec\"
4606 rpath="$rpath $flag"
4608 elif test -n "$runpath_var"; then
4609 case "$finalize_perm_rpath " in
4611 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4615 # Substitute the hardcoded libdirs into the rpath.
4616 if test -n "$hardcode_libdir_separator" &&
4617 test -n "$hardcode_libdirs"; then
4618 libdir="$hardcode_libdirs"
4619 eval rpath=\" $hardcode_libdir_flag_spec\"
4621 finalize_rpath="$rpath"
4623 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4624 # Transform all the library objects into standard objects.
4625 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4626 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4630 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4631 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4632 dlsyms="${outputname}S.c"
4634 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4638 if test -n "$dlsyms"; then
4642 # Discover the nlist of each of the dlfiles.
4643 nlist="$output_objdir/${outputname}.nm"
4645 $show "$rm $nlist ${nlist}S ${nlist}T"
4646 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4648 # Parse the name list into a source file.
4649 $show "creating $output_objdir/$dlsyms"
4651 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4652 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4653 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4659 /* Prevent the only kind of declaration conflicts we can make. */
4660 #define lt_preloaded_symbols some_other_symbol
4662 /* External symbol declarations for the compiler. */\
4665 if test "$dlself" = yes; then
4666 $show "generating symbol list for \`$output'"
4668 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4670 # Add our own program objects to the symbol list.
4671 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4672 for arg in $progfiles; do
4673 $show "extracting global C symbols from \`$arg'"
4674 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4677 if test -n "$exclude_expsyms"; then
4678 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4679 $run eval '$mv "$nlist"T "$nlist"'
4682 if test -n "$export_symbols_regex"; then
4683 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4684 $run eval '$mv "$nlist"T "$nlist"'
4687 # Prepare the list of exported symbols
4688 if test -z "$export_symbols"; then
4689 export_symbols="$output_objdir/$output.exp"
4690 $run $rm $export_symbols
4691 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4693 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4694 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4695 $run eval 'mv "$nlist"T "$nlist"'
4699 for arg in $dlprefiles; do
4700 $show "extracting global C symbols from \`$arg'"
4701 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4702 $run eval '$echo ": $name " >> "$nlist"'
4703 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4706 if test -z "$run"; then
4707 # Make sure we have at least an empty file.
4708 test -f "$nlist" || : > "$nlist"
4710 if test -n "$exclude_expsyms"; then
4711 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4712 $mv "$nlist"T "$nlist"
4715 # Try sorting and uniquifying the output.
4716 if grep -v "^: " < "$nlist" |
4717 if sort -k 3 </dev/null >/dev/null 2>&1; then
4722 uniq > "$nlist"S; then
4725 grep -v "^: " < "$nlist" > "$nlist"S
4728 if test -f "$nlist"S; then
4729 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4731 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4734 $echo >> "$output_objdir/$dlsyms" "\
4736 #undef lt_preloaded_symbols
4738 #if defined (__STDC__) && __STDC__
4739 # define lt_ptr void *
4741 # define lt_ptr char *
4745 /* The mapping between symbol names and symbols. */
4750 lt_preloaded_symbols[] =
4754 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4756 $echo >> "$output_objdir/$dlsyms" "\
4760 /* This works around a problem in FreeBSD linker */
4761 #ifdef FREEBSD_WORKAROUND
4762 static const void *lt_preloaded_setup() {
4763 return lt_preloaded_symbols;
4773 pic_flag_for_symtable=
4775 # compiling the symbol table file with pic_flag works around
4776 # a FreeBSD bug that causes programs to crash when -lm is
4777 # linked before any other PIC object. But we must not use
4778 # pic_flag when linking with -static. The problem exists in
4779 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4780 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4781 case "$compile_command " in
4783 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4786 case "$compile_command " in
4788 *) pic_flag_for_symtable=" $pic_flag";;
4792 # Now compile the dynamic symbol file.
4793 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4794 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4796 # Clean up the generated files.
4797 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4798 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4800 # Transform the symbol file into the correct name.
4801 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4802 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4805 # FreeBSD doesn't need this...
4808 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4813 # We keep going just in case the user didn't refer to
4814 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4815 # really was required.
4817 # Nullify the symbol file.
4818 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4819 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4822 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4823 # Replace the output file specification.
4824 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4825 link_command="$compile_command$compile_rpath"
4827 # We have no uninstalled library dependencies, so finalize right now.
4828 $show "$link_command"
4829 $run eval "$link_command"
4832 # Delete the generated files.
4833 if test -n "$dlsyms"; then
4834 $show "$rm $output_objdir/${outputname}S.${objext}"
4835 $run $rm "$output_objdir/${outputname}S.${objext}"
4841 if test -n "$shlibpath_var"; then
4842 # We should set the shlibpath_var
4844 for dir in $temp_rpath; do
4846 [\\/]* | [A-Za-z]:[\\/]*)
4851 # Relative path: add a thisdir entry.
4852 rpath="$rpath\$thisdir/$dir:"
4859 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4860 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4862 if test -n "$finalize_shlibpath"; then
4863 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4868 if test -n "$runpath_var"; then
4869 if test -n "$perm_rpath"; then
4870 # We should set the runpath_var.
4872 for dir in $perm_rpath; do
4875 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4877 if test -n "$finalize_perm_rpath"; then
4878 # We should set the runpath_var.
4880 for dir in $finalize_perm_rpath; do
4883 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4887 if test "$no_install" = yes; then
4888 # We don't need to create a wrapper script.
4889 link_command="$compile_var$compile_command$compile_rpath"
4890 # Replace the output file specification.
4891 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4892 # Delete the old output file.
4894 # Link the executable and exit
4895 $show "$link_command"
4896 $run eval "$link_command" || exit $?
4900 if test "$hardcode_action" = relink; then
4901 # Fast installation is not supported
4902 link_command="$compile_var$compile_command$compile_rpath"
4903 relink_command="$finalize_var$finalize_command$finalize_rpath"
4905 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4906 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4908 if test "$fast_install" != no; then
4909 link_command="$finalize_var$compile_command$finalize_rpath"
4910 if test "$fast_install" = yes; then
4911 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4913 # fast_install is set to needless
4917 link_command="$compile_var$compile_command$compile_rpath"
4918 relink_command="$finalize_var$finalize_command$finalize_rpath"
4922 # Replace the output file specification.
4923 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4925 # Delete the old output files.
4926 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4928 $show "$link_command"
4929 $run eval "$link_command" || exit $?
4931 # Now create the wrapper script.
4932 $show "creating $output"
4934 # Quote the relink command for shipping.
4935 if test -n "$relink_command"; then
4936 # Preserve any variables that may affect compiler behavior
4937 for var in $variables_saved_for_relink; do
4938 if eval test -z \"\${$var+set}\"; then
4939 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4940 elif eval var_value=\$$var; test -z "$var_value"; then
4941 relink_command="$var=; export $var; $relink_command"
4943 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4944 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4947 relink_command="(cd `pwd`; $relink_command)"
4948 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4951 # Quote $echo for shipping.
4952 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4954 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4955 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4957 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4959 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4962 # Only actually do things if our run command is non-null.
4963 if test -z "$run"; then
4964 # win32 will think the script is a binary if it has
4965 # a .exe suffix, so we strip it off here.
4967 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4969 # test for cygwin because mv fails w/o .exe extensions
4973 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4977 *cygwin* | *mingw* )
4978 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4979 cwrapper=`$echo ${output}.exe`
4980 $rm $cwrappersource $cwrapper
4981 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4983 cat > $cwrappersource <<EOF
4985 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4986 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4988 The $output program cannot be directly executed until all the libtool
4989 libraries that it depends on are installed.
4991 This wrapper executable should never be moved out of the build directory.
4992 If it is, it will not operate correctly.
4994 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4995 but could eventually absorb all of the scripts functionality and
4996 exec $objdir/$outputname directly.
4999 cat >> $cwrappersource<<"EOF"
5007 #if defined(PATH_MAX)
5008 # define LT_PATHMAX PATH_MAX
5009 #elif defined(MAXPATHLEN)
5010 # define LT_PATHMAX MAXPATHLEN
5012 # define LT_PATHMAX 1024
5015 #ifndef DIR_SEPARATOR
5016 #define DIR_SEPARATOR '/'
5019 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5021 #define HAVE_DOS_BASED_FILE_SYSTEM
5022 #ifndef DIR_SEPARATOR_2
5023 #define DIR_SEPARATOR_2 '\\'
5027 #ifndef DIR_SEPARATOR_2
5028 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5029 #else /* DIR_SEPARATOR_2 */
5030 # define IS_DIR_SEPARATOR(ch) \
5031 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5032 #endif /* DIR_SEPARATOR_2 */
5034 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5035 #define XFREE(stale) do { \
5036 if (stale) { free ((void *) stale); stale = 0; } \
5039 const char *program_name = NULL;
5041 void * xmalloc (size_t num);
5042 char * xstrdup (const char *string);
5043 char * basename (const char *name);
5044 char * fnqualify(const char *path);
5045 char * strendzap(char *str, const char *pat);
5046 void lt_fatal (const char *message, ...);
5049 main (int argc, char *argv[])
5054 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5055 newargz = XMALLOC(char *, argc+2);
5058 cat >> $cwrappersource <<EOF
5059 newargz[0] = "$SHELL";
5062 cat >> $cwrappersource <<"EOF"
5063 newargz[1] = fnqualify(argv[0]);
5064 /* we know the script has the same name, without the .exe */
5065 /* so make sure newargz[1] doesn't end in .exe */
5066 strendzap(newargz[1],".exe");
5067 for (i = 1; i < argc; i++)
5068 newargz[i+1] = xstrdup(argv[i]);
5069 newargz[argc+1] = NULL;
5072 cat >> $cwrappersource <<EOF
5073 execv("$SHELL",newargz);
5076 cat >> $cwrappersource <<"EOF"
5080 xmalloc (size_t num)
5082 void * p = (void *) malloc (num);
5084 lt_fatal ("Memory exhausted");
5090 xstrdup (const char *string)
5092 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5097 basename (const char *name)
5101 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5102 /* Skip over the disk name in MSDOS pathnames. */
5103 if (isalpha (name[0]) && name[1] == ':')
5107 for (base = name; *name; name++)
5108 if (IS_DIR_SEPARATOR (*name))
5110 return (char *) base;
5114 fnqualify(const char *path)
5118 char tmp[LT_PATHMAX + 1];
5120 assert(path != NULL);
5122 /* Is it qualified already? */
5123 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5124 if (isalpha (path[0]) && path[1] == ':')
5125 return xstrdup (path);
5127 if (IS_DIR_SEPARATOR (path[0]))
5128 return xstrdup (path);
5130 /* prepend the current directory */
5131 /* doesn't handle '~' */
5132 if (getcwd (tmp, LT_PATHMAX) == NULL)
5133 lt_fatal ("getcwd failed");
5134 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5135 p = XMALLOC(char, size);
5136 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5141 strendzap(char *str, const char *pat)
5145 assert(str != NULL);
5146 assert(pat != NULL);
5149 patlen = strlen(pat);
5153 str += len - patlen;
5154 if (strcmp(str, pat) == 0)
5161 lt_error_core (int exit_status, const char * mode,
5162 const char * message, va_list ap)
5164 fprintf (stderr, "%s: %s: ", program_name, mode);
5165 vfprintf (stderr, message, ap);
5166 fprintf (stderr, ".\n");
5168 if (exit_status >= 0)
5173 lt_fatal (const char *message, ...)
5176 va_start (ap, message);
5177 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5181 # we should really use a build-platform specific compiler
5182 # here, but OTOH, the wrappers (shell script and this C one)
5183 # are only useful if you want to execute the "real" binary.
5184 # Since the "real" binary is built for $host, then this
5185 # wrapper might as well be built for $host, too.
5186 $run $LTCC -s -o $cwrapper $cwrappersource
5190 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5195 # $output - temporary wrapper script for $objdir/$outputname
5196 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5198 # The $output program cannot be directly executed until all the libtool
5199 # libraries that it depends on are installed.
5201 # This wrapper script should never be moved out of the build directory.
5202 # If it is, it will not operate correctly.
5204 # Sed substitution that helps us do robust quoting. It backslashifies
5205 # metacharacters that are still active within double-quoted strings.
5206 Xsed='${SED} -e 1s/^X//'
5207 sed_quote_subst='$sed_quote_subst'
5209 # The HP-UX ksh and POSIX shell print the target directory to stdout
5211 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5213 relink_command=\"$relink_command\"
5215 # This environment variable determines our operation mode.
5216 if test \"\$libtool_install_magic\" = \"$magic\"; then
5217 # install mode needs the following variable:
5218 notinst_deplibs='$notinst_deplibs'
5220 # When we are sourced in execute mode, \$file and \$echo are already set.
5221 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5224 # Make sure echo works.
5225 if test \"X\$1\" = X--no-reexec; then
5226 # Discard the --no-reexec flag, and continue.
5228 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5229 # Yippee, \$echo works!
5232 # Restart under the correct shell, and then maybe \$echo will work.
5233 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5239 # Find the directory that this script lives in.
5240 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5241 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5243 # Follow symbolic links until we get to the real thisdir.
5244 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5245 while test -n \"\$file\"; do
5246 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5248 # If there was a directory component, then change thisdir.
5249 if test \"x\$destdir\" != \"x\$file\"; then
5250 case \"\$destdir\" in
5251 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5252 *) thisdir=\"\$thisdir/\$destdir\" ;;
5256 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5257 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5260 # Try to get the absolute directory name.
5261 absdir=\`cd \"\$thisdir\" && pwd\`
5262 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5265 if test "$fast_install" = yes; then
5267 program=lt-'$outputname'$exeext
5268 progdir=\"\$thisdir/$objdir\"
5270 if test ! -f \"\$progdir/\$program\" || \\
5271 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5272 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5274 file=\"\$\$-\$program\"
5276 if test ! -d \"\$progdir\"; then
5277 $mkdir \"\$progdir\"
5279 $rm \"\$progdir/\$file\"
5284 # relink executable if necessary
5285 if test -n \"\$relink_command\"; then
5286 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5288 $echo \"\$relink_command_output\" >&2
5289 $rm \"\$progdir/\$file\"
5294 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5295 { $rm \"\$progdir/\$program\";
5296 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5297 $rm \"\$progdir/\$file\"
5301 program='$outputname'
5302 progdir=\"\$thisdir/$objdir\"
5308 if test -f \"\$progdir/\$program\"; then"
5310 # Export our shlibpath_var if we have one.
5311 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5313 # Add our own library path to $shlibpath_var
5314 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5316 # Some systems cannot cope with colon-terminated $shlibpath_var
5317 # The second colon is a workaround for a bug in BeOS R4 sed
5318 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5320 export $shlibpath_var
5324 # fixup the dll searchpath if we need to.
5325 if test -n "$dllsearchpath"; then
5327 # Add the dll search path components to the executable PATH
5328 PATH=$dllsearchpath:\$PATH
5333 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5334 # Run the actual program with our arguments.
5337 # Backslashes separate directories on plain windows
5338 *-*-mingw | *-*-os2*)
5340 exec \$progdir\\\\\$program \${1+\"\$@\"}
5346 exec \$progdir/\$program \${1+\"\$@\"}
5351 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5355 # The program doesn't exist.
5356 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5357 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5358 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5369 # See if we need to build an old-fashioned archive.
5370 for oldlib in $oldlibs; do
5372 if test "$build_libtool_libs" = convenience; then
5373 oldobjs="$libobjs_save"
5374 addlibs="$convenience"
5375 build_libtool_libs=no
5377 if test "$build_libtool_libs" = module; then
5378 oldobjs="$libobjs_save"
5379 build_libtool_libs=no
5381 oldobjs="$old_deplibs $non_pic_objects"
5383 addlibs="$old_convenience"
5386 if test -n "$addlibs"; then
5387 gentop="$output_objdir/${outputname}x"
5388 generated="$generated $gentop"
5390 func_extract_archives $gentop $addlibs
5391 oldobjs="$oldobjs $func_extract_archives_result"
5394 # Do each command in the archive commands.
5395 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5396 cmds=$old_archive_from_new_cmds
5398 eval cmds=\"$old_archive_cmds\"
5400 if len=`expr "X$cmds" : ".*"` &&
5401 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5402 cmds=$old_archive_cmds
5404 # the command line is too long to link in one step, link in parts
5405 $echo "using piecewise archive linking..."
5410 save_oldobjs=$oldobjs
5411 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5412 # encoded into archives. This makes 'ar r' malfunction in
5413 # this piecewise linking case whenever conflicting object
5414 # names appear in distinct ar calls; check, warn and compensate.
5415 if (for obj in $save_oldobjs
5417 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5418 done | sort | sort -uc >/dev/null 2>&1); then
5421 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5422 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5425 # Is there a better way of finding the last object in the list?
5426 for obj in $save_oldobjs
5430 for obj in $save_oldobjs
5432 oldobjs="$objlist $obj"
5433 objlist="$objlist $obj"
5434 eval test_cmds=\"$old_archive_cmds\"
5435 if len=`expr "X$test_cmds" : ".*"` &&
5436 test "$len" -le "$max_cmd_len"; then
5439 # the above command should be used before it gets too long
5441 if test "$obj" = "$last_oldobj" ; then
5444 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5445 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5451 if test "X$oldobjs" = "X" ; then
5452 eval cmds=\"\$concat_cmds\"
5454 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5458 save_ifs="$IFS"; IFS='~'
5459 for cmd in $cmds; do
5463 $run eval "$cmd" || exit $?
5468 if test -n "$generated"; then
5469 $show "${rm}r$generated"
5470 $run ${rm}r$generated
5473 # Now create the libtool archive.
5477 test "$build_old_libs" = yes && old_library="$libname.$libext"
5478 $show "creating $output"
5480 # Preserve any variables that may affect compiler behavior
5481 for var in $variables_saved_for_relink; do
5482 if eval test -z \"\${$var+set}\"; then
5483 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5484 elif eval var_value=\$$var; test -z "$var_value"; then
5485 relink_command="$var=; export $var; $relink_command"
5487 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5488 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5491 # Quote the link command for shipping.
5492 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5493 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5494 if test "$hardcode_automatic" = yes ; then
5499 # Only create the output if not a dry run.
5500 if test -z "$run"; then
5501 for installed in no yes; do
5502 if test "$installed" = yes; then
5503 if test -z "$install_libdir"; then
5506 output="$output_objdir/$outputname"i
5507 # Replace all uninstalled libtool libraries with the installed ones
5509 for deplib in $dependency_libs; do
5512 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5513 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5514 if test -z "$libdir"; then
5515 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5518 newdependency_libs="$newdependency_libs $libdir/$name"
5520 *) newdependency_libs="$newdependency_libs $deplib" ;;
5523 dependency_libs="$newdependency_libs"
5525 for lib in $dlfiles; do
5526 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5527 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5528 if test -z "$libdir"; then
5529 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5532 newdlfiles="$newdlfiles $libdir/$name"
5534 dlfiles="$newdlfiles"
5536 for lib in $dlprefiles; do
5537 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5538 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5539 if test -z "$libdir"; then
5540 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5543 newdlprefiles="$newdlprefiles $libdir/$name"
5545 dlprefiles="$newdlprefiles"
5548 for lib in $dlfiles; do
5550 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5551 *) abs=`pwd`"/$lib" ;;
5553 newdlfiles="$newdlfiles $abs"
5555 dlfiles="$newdlfiles"
5557 for lib in $dlprefiles; do
5559 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5560 *) abs=`pwd`"/$lib" ;;
5562 newdlprefiles="$newdlprefiles $abs"
5564 dlprefiles="$newdlprefiles"
5567 # place dlname in correct position for cygwin
5569 case $host,$output,$installed,$module,$dlname in
5570 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5573 # $outputname - a libtool library file
5574 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5576 # Please DO NOT delete this file!
5577 # It is necessary for linking the library.
5579 # The name that we can dlopen(3).
5582 # Names of this library.
5583 library_names='$library_names'
5585 # The name of the static archive.
5586 old_library='$old_library'
5588 # Libraries that this one depends upon.
5589 dependency_libs='$dependency_libs'
5591 # Version information for $libname.
5596 # Is this an already installed library?
5597 installed=$installed
5599 # Should we warn about portability when linking against -modules?
5600 shouldnotlink=$module
5602 # Files to dlopen/dlpreopen
5604 dlpreopen='$dlprefiles'
5606 # Directory that this library needs to be installed in:
5607 libdir='$install_libdir'"
5608 if test "$installed" = no && test "$need_relink" = yes; then
5610 relink_command=\"$relink_command\""
5615 # Do a symbolic link so that the libtool archive can be found in
5616 # LD_LIBRARY_PATH before the program is installed.
5617 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5618 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5624 # libtool install mode
5626 modename="$modename: install"
5628 # There may be an optional sh(1) argument at the beginning of
5629 # install_prog (especially on Windows NT).
5630 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5631 # Allow the use of GNU shtool's install command.
5632 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5633 # Aesthetically quote it.
5634 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5636 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5640 install_prog="$arg "
5648 # The real first argument should be the name of the installation program.
5649 # Aesthetically quote it.
5650 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5652 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5656 install_prog="$install_prog$arg"
5658 # We need to accept at least all the BSD install flags.
5668 if test -n "$dest"; then
5669 files="$files $dest"
5687 # If the previous option needed an argument, then skip it.
5688 if test -n "$prev"; then
5697 # Aesthetically quote the argument.
5698 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5700 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5704 install_prog="$install_prog $arg"
5707 if test -z "$install_prog"; then
5708 $echo "$modename: you must specify an install program" 1>&2
5713 if test -n "$prev"; then
5714 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5719 if test -z "$files"; then
5720 if test -z "$dest"; then
5721 $echo "$modename: no file or destination specified" 1>&2
5723 $echo "$modename: you must specify a destination" 1>&2
5729 # Strip any trailing slash from the destination.
5730 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5732 # Check to see that the destination is a directory.
5733 test -d "$dest" && isdir=yes
5734 if test "$isdir" = yes; then
5738 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5739 test "X$destdir" = "X$dest" && destdir=.
5740 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5742 # Not a directory, so check to see that there is only one file specified.
5744 if test "$#" -gt 2; then
5745 $echo "$modename: \`$dest' is not a directory" 1>&2
5751 [\\/]* | [A-Za-z]:[\\/]*) ;;
5753 for file in $files; do
5757 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5766 # This variable tells wrapper scripts just to set variables rather
5767 # than running their programs.
5768 libtool_install_magic="$magic"
5773 for file in $files; do
5775 # Do each installation.
5778 # Do the static libraries later.
5779 staticlibs="$staticlibs $file"
5783 # Check to see that this really is a libtool archive.
5784 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5786 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5794 # If there is no directory component, then add one.
5796 */* | *\\*) . $file ;;
5800 # Add the libdir to current_libdirs if it is the destination.
5801 if test "X$destdir" = "X$libdir"; then
5802 case "$current_libdirs " in
5804 *) current_libdirs="$current_libdirs $libdir" ;;
5807 # Note the libdir as a future libdir.
5808 case "$future_libdirs " in
5810 *) future_libdirs="$future_libdirs $libdir" ;;
5814 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5815 test "X$dir" = "X$file/" && dir=
5818 if test -n "$relink_command"; then
5819 # Determine the prefix the user has applied to our future dir.
5820 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5822 # Don't allow the user to place us outside of our expected
5823 # location b/c this prevents finding dependent libraries that
5824 # are installed to the same prefix.
5825 # At present, this check doesn't affect windows .dll's that
5826 # are installed into $libdir/../bin (currently, that works fine)
5827 # but it's something to keep an eye on.
5828 if test "$inst_prefix_dir" = "$destdir"; then
5829 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5833 if test -n "$inst_prefix_dir"; then
5834 # Stick the inst_prefix_dir data into the link command.
5835 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5837 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5840 $echo "$modename: warning: relinking \`$file'" 1>&2
5841 $show "$relink_command"
5842 if $run eval "$relink_command"; then :
5844 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5849 # See the names of the shared library.
5850 set dummy $library_names
5851 if test -n "$2"; then
5857 test -n "$relink_command" && srcname="$realname"T
5859 # Install the shared library and build the symlinks.
5860 $show "$install_prog $dir/$srcname $destdir/$realname"
5861 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5862 if test -n "$stripme" && test -n "$striplib"; then
5863 $show "$striplib $destdir/$realname"
5864 $run eval "$striplib $destdir/$realname" || exit $?
5867 if test "$#" -gt 0; then
5868 # Delete the old symlinks, and create new ones.
5871 if test "$linkname" != "$realname"; then
5872 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5873 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5878 # Do each command in the postinstall commands.
5879 lib="$destdir/$realname"
5880 cmds=$postinstall_cmds
5881 save_ifs="$IFS"; IFS='~'
5882 for cmd in $cmds; do
5886 $run eval "$cmd" || exit $?
5891 # Install the pseudo-library for information purposes.
5894 # Do not install the useless pseudo-library
5897 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5898 instname="$dir/$name"i
5899 $show "$install_prog $instname $destdir/$name"
5900 $run eval "$install_prog $instname $destdir/$name" || exit $?
5904 # Maybe install the static library, too.
5905 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5909 # Install (i.e. copy) a libtool object.
5911 # Figure out destination file name, if it wasn't already specified.
5912 if test -n "$destname"; then
5913 destfile="$destdir/$destname"
5915 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5916 destfile="$destdir/$destfile"
5919 # Deduce the name of the destination old-style object file.
5922 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5925 staticdest="$destfile"
5929 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5935 # Install the libtool object if requested.
5936 if test -n "$destfile"; then
5937 $show "$install_prog $file $destfile"
5938 $run eval "$install_prog $file $destfile" || exit $?
5941 # Install the old object if enabled.
5942 if test "$build_old_libs" = yes; then
5943 # Deduce the name of the old-style object file.
5944 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5946 $show "$install_prog $staticobj $staticdest"
5947 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5953 # Figure out destination file name, if it wasn't already specified.
5954 if test -n "$destname"; then
5955 destfile="$destdir/$destname"
5957 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5958 destfile="$destdir/$destfile"
5961 # If the file is missing, and there is a .exe on the end, strip it
5962 # because it is most likely a libtool script we actually want to
5967 if test ! -f "$file"; then
5968 file=`$echo $file|${SED} 's,.exe$,,'`
5974 # Do a test to see if this is really a libtool program.
5977 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5983 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5987 # To insure that "foo" is sourced, and not "foo.exe",
5988 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5989 # which disallows the automatic-append-.exe behavior.
5991 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5992 *) wrapperdot=${wrapper} ;;
5994 # If there is no directory component, then add one.
5996 */* | *\\*) . ${wrapperdot} ;;
5997 *) . ./${wrapperdot} ;;
6000 # Check the variables that should have been set.
6001 if test -z "$notinst_deplibs"; then
6002 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6007 for lib in $notinst_deplibs; do
6008 # Check to see that each library is installed.
6010 if test -f "$lib"; then
6011 # If there is no directory component, then add one.
6013 */* | *\\*) . $lib ;;
6017 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6018 if test -n "$libdir" && test ! -f "$libfile"; then
6019 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6025 # To insure that "foo" is sourced, and not "foo.exe",
6026 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6027 # which disallows the automatic-append-.exe behavior.
6029 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6030 *) wrapperdot=${wrapper} ;;
6032 # If there is no directory component, then add one.
6034 */* | *\\*) . ${wrapperdot} ;;
6035 *) . ./${wrapperdot} ;;
6039 if test "$fast_install" = no && test -n "$relink_command"; then
6040 if test "$finalize" = yes && test -z "$run"; then
6042 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6043 tmpdir="$tmpdir/libtool-$$"
6046 if $mkdir "$tmpdir"; then
6050 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6053 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6054 outputname="$tmpdir/$file"
6055 # Replace the output file specification.
6056 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6058 $show "$relink_command"
6059 if $run eval "$relink_command"; then :
6061 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6067 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6070 # Install the binary that we compiled earlier.
6071 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6075 # remove .exe since cygwin /usr/bin/install will append another
6077 case $install_prog,$host in
6078 */usr/bin/install*,*cygwin*)
6079 case $file:$destfile in
6084 destfile=$destfile.exe
6087 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6092 $show "$install_prog$stripme $file $destfile"
6093 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6094 test -n "$outputname" && ${rm}r "$tmpdir"
6099 for file in $staticlibs; do
6100 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6102 # Set up the ranlib parameters.
6103 oldlib="$destdir/$name"
6105 $show "$install_prog $file $oldlib"
6106 $run eval "$install_prog \$file \$oldlib" || exit $?
6108 if test -n "$stripme" && test -n "$old_striplib"; then
6109 $show "$old_striplib $oldlib"
6110 $run eval "$old_striplib $oldlib" || exit $?
6113 # Do each command in the postinstall commands.
6114 cmds=$old_postinstall_cmds
6115 save_ifs="$IFS"; IFS='~'
6116 for cmd in $cmds; do
6120 $run eval "$cmd" || exit $?
6125 if test -n "$future_libdirs"; then
6126 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6129 if test -n "$current_libdirs"; then
6130 # Maybe just do a dry run.
6131 test -n "$run" && current_libdirs=" -n$current_libdirs"
6132 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6138 # libtool finish mode
6140 modename="$modename: finish"
6144 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6147 libdirs="$libdirs $dir"
6150 for libdir in $libdirs; do
6151 if test -n "$finish_cmds"; then
6152 # Do each command in the finish commands.
6154 save_ifs="$IFS"; IFS='~'
6155 for cmd in $cmds; do
6159 $run eval "$cmd" || admincmds="$admincmds
6164 if test -n "$finish_eval"; then
6165 # Do the single finish_eval.
6166 eval cmds=\"$finish_eval\"
6167 $run eval "$cmds" || admincmds="$admincmds
6173 # Exit here if they wanted silent mode.
6174 test "$show" = : && exit $EXIT_SUCCESS
6176 $echo "----------------------------------------------------------------------"
6177 $echo "Libraries have been installed in:"
6178 for libdir in $libdirs; do
6182 $echo "If you ever happen to want to link against installed libraries"
6183 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6184 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6185 $echo "flag during linking and do at least one of the following:"
6186 if test -n "$shlibpath_var"; then
6187 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6188 $echo " during execution"
6190 if test -n "$runpath_var"; then
6191 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6192 $echo " during linking"
6194 if test -n "$hardcode_libdir_flag_spec"; then
6196 eval flag=\"$hardcode_libdir_flag_spec\"
6198 $echo " - use the \`$flag' linker flag"
6200 if test -n "$admincmds"; then
6201 $echo " - have your system administrator run these commands:$admincmds"
6203 if test -f /etc/ld.so.conf; then
6204 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6207 $echo "See any operating system documentation about shared libraries for"
6208 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6209 $echo "----------------------------------------------------------------------"
6213 # libtool execute mode
6215 modename="$modename: execute"
6217 # The first argument is the command name.
6219 if test -z "$cmd"; then
6220 $echo "$modename: you must specify a COMMAND" 1>&2
6225 # Handle -dlopen flags immediately.
6226 for file in $execute_dlfiles; do
6227 if test ! -f "$file"; then
6228 $echo "$modename: \`$file' is not a file" 1>&2
6236 # Check to see that this really is a libtool archive.
6237 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6239 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6244 # Read the libtool library.
6248 # If there is no directory component, then add one.
6250 */* | *\\*) . $file ;;
6254 # Skip this library if it cannot be dlopened.
6255 if test -z "$dlname"; then
6256 # Warn if it was a shared library.
6257 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6261 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6262 test "X$dir" = "X$file" && dir=.
6264 if test -f "$dir/$objdir/$dlname"; then
6267 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6273 # Just add the directory containing the .lo file.
6274 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6275 test "X$dir" = "X$file" && dir=.
6279 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6284 # Get the absolute pathname.
6285 absdir=`cd "$dir" && pwd`
6286 test -n "$absdir" && dir="$absdir"
6288 # Now add the directory to shlibpath_var.
6289 if eval "test -z \"\$$shlibpath_var\""; then
6290 eval "$shlibpath_var=\"\$dir\""
6292 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6296 # This variable tells wrapper scripts just to set shlibpath_var
6297 # rather than running their programs.
6298 libtool_execute_magic="$magic"
6300 # Check if any of the arguments is a wrapper script.
6307 # Do a test to see if this is really a libtool program.
6308 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6309 # If there is no directory component, then add one.
6311 */* | *\\*) . $file ;;
6315 # Transform arg to wrapped name.
6316 file="$progdir/$program"
6320 # Quote arguments (to preserve shell metacharacters).
6321 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6322 args="$args \"$file\""
6325 if test -z "$run"; then
6326 if test -n "$shlibpath_var"; then
6327 # Export the shlibpath_var.
6328 eval "export $shlibpath_var"
6331 # Restore saved environment variables
6332 if test "${save_LC_ALL+set}" = set; then
6333 LC_ALL="$save_LC_ALL"; export LC_ALL
6335 if test "${save_LANG+set}" = set; then
6336 LANG="$save_LANG"; export LANG
6339 # Now prepare to actually exec the command.
6340 exec_cmd="\$cmd$args"
6342 # Display what would be done.
6343 if test -n "$shlibpath_var"; then
6344 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6345 $echo "export $shlibpath_var"
6352 # libtool clean and uninstall mode
6354 modename="$modename: $mode"
6360 # This variable tells wrapper scripts just to set variables rather
6361 # than running their programs.
6362 libtool_install_magic="$magic"
6367 -f) rm="$rm $arg"; rmforce=yes ;;
6368 -*) rm="$rm $arg" ;;
6369 *) files="$files $arg" ;;
6373 if test -z "$rm"; then
6374 $echo "$modename: you must specify an RM program" 1>&2
6381 origobjdir="$objdir"
6382 for file in $files; do
6383 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6384 if test "X$dir" = "X$file"; then
6386 objdir="$origobjdir"
6388 objdir="$dir/$origobjdir"
6390 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6391 test "$mode" = uninstall && objdir="$dir"
6393 # Remember objdir for removal later, being careful to avoid duplicates
6394 if test "$mode" = clean; then
6397 *) rmdirs="$rmdirs $objdir" ;;
6401 # Don't error if the file doesn't exist and rm -f was used.
6402 if (test -L "$file") >/dev/null 2>&1 \
6403 || (test -h "$file") >/dev/null 2>&1 \
6404 || test -f "$file"; then
6406 elif test -d "$file"; then
6409 elif test "$rmforce" = yes; then
6417 # Possibly a libtool archive, so verify it.
6418 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6421 # Delete the libtool libraries and symlinks.
6422 for n in $library_names; do
6423 rmfiles="$rmfiles $objdir/$n"
6425 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6426 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6428 if test "$mode" = uninstall; then
6429 if test -n "$library_names"; then
6430 # Do each command in the postuninstall commands.
6431 cmds=$postuninstall_cmds
6432 save_ifs="$IFS"; IFS='~'
6433 for cmd in $cmds; do
6438 if test "$?" -ne 0 && test "$rmforce" != yes; then
6445 if test -n "$old_library"; then
6446 # Do each command in the old_postuninstall commands.
6447 cmds=$old_postuninstall_cmds
6448 save_ifs="$IFS"; IFS='~'
6449 for cmd in $cmds; do
6454 if test "$?" -ne 0 && test "$rmforce" != yes; then
6460 # FIXME: should reinstall the best remaining shared library.
6466 # Possibly a libtool object, so verify it.
6467 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6472 # Add PIC object to the list of files to remove.
6473 if test -n "$pic_object" \
6474 && test "$pic_object" != none; then
6475 rmfiles="$rmfiles $dir/$pic_object"
6478 # Add non-PIC object to the list of files to remove.
6479 if test -n "$non_pic_object" \
6480 && test "$non_pic_object" != none; then
6481 rmfiles="$rmfiles $dir/$non_pic_object"
6487 if test "$mode" = clean ; then
6491 file=`$echo $file|${SED} 's,.exe$,,'`
6492 noexename=`$echo $name|${SED} 's,.exe$,,'`
6493 # $file with .exe has already been added to rmfiles,
6494 # add $file without .exe
6495 rmfiles="$rmfiles $file"
6498 # Do a test to see if this is a libtool program.
6499 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6503 # note $name still contains .exe if it was in $file originally
6504 # as does the version of $file that was added into $rmfiles
6505 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6506 if test "$fast_install" = yes && test -n "$relink_command"; then
6507 rmfiles="$rmfiles $objdir/lt-$name"
6509 if test "X$noexename" != "X$name" ; then
6510 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6516 $show "$rm $rmfiles"
6517 $run $rm $rmfiles || exit_status=1
6519 objdir="$origobjdir"
6521 # Try to remove the ${objdir}s in the directories where we deleted files
6522 for dir in $rmdirs; do
6523 if test -d "$dir"; then
6525 $run rmdir $dir >/dev/null 2>&1
6533 $echo "$modename: you must specify a MODE" 1>&2
6534 $echo "$generic_help" 1>&2
6539 if test -z "$exec_cmd"; then
6540 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6541 $echo "$generic_help" 1>&2
6544 fi # test -z "$show_help"
6546 if test -n "$exec_cmd"; then
6551 # We need to display help for each of the modes.
6554 "Usage: $modename [OPTION]... [MODE-ARG]...
6556 Provide generalized library-building support services.
6558 --config show all configuration variables
6559 --debug enable verbose shell tracing
6560 -n, --dry-run display commands without modifying any files
6561 --features display basic configuration information and exit
6562 --finish same as \`--mode=finish'
6563 --help display this help message and exit
6564 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6565 --quiet same as \`--silent'
6566 --silent don't print informational messages
6567 --tag=TAG use configuration variables from tag TAG
6568 --version print version information
6570 MODE must be one of the following:
6572 clean remove files from the build directory
6573 compile compile a source file into a libtool object
6574 execute automatically set library path, then run a program
6575 finish complete the installation of libtool libraries
6576 install install libraries or executables
6577 link create a library or an executable
6578 uninstall remove libraries from an installed directory
6580 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6581 a more detailed description of MODE.
6583 Report bugs to <bug-libtool@gnu.org>."
6589 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6591 Remove files from the build directory.
6593 RM is the name of the program to use to delete files associated with each FILE
6594 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6597 If FILE is a libtool library, object or program, all the files associated
6598 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6603 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6605 Compile a source file into a libtool library object.
6607 This mode accepts the following additional options:
6609 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6610 -prefer-pic try to building PIC objects only
6611 -prefer-non-pic try to building non-PIC objects only
6612 -static always build a \`.o' file suitable for static linking
6614 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6615 from the given SOURCEFILE.
6617 The output file name is determined by removing the directory component from
6618 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6619 library object suffix, \`.lo'."
6624 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6626 Automatically set library path, then run a program.
6628 This mode accepts the following additional options:
6630 -dlopen FILE add the directory containing FILE to the library path
6632 This mode sets the library path environment variable according to \`-dlopen'
6635 If any of the ARGS are libtool executable wrappers, then they are translated
6636 into their corresponding uninstalled binary, and any of their required library
6637 directories are added to the library path.
6639 Then, COMMAND is executed, with ARGS as arguments."
6644 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6646 Complete the installation of libtool libraries.
6648 Each LIBDIR is a directory that contains libtool libraries.
6650 The commands that this mode executes may require superuser privileges. Use
6651 the \`--dry-run' option if you just want to see what would be executed."
6656 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6658 Install executables or libraries.
6660 INSTALL-COMMAND is the installation command. The first component should be
6661 either the \`install' or \`cp' program.
6663 The rest of the components are interpreted as arguments to that command (only
6664 BSD-compatible install options are recognized)."
6669 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6671 Link object files or libraries together to form another library, or to
6672 create an executable program.
6674 LINK-COMMAND is a command using the C compiler that you would use to create
6675 a program from several object files.
6677 The following components of LINK-COMMAND are treated specially:
6679 -all-static do not do any dynamic linking at all
6680 -avoid-version do not add a version suffix if possible
6681 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6682 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6683 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6684 -export-symbols SYMFILE
6685 try to export only the symbols listed in SYMFILE
6686 -export-symbols-regex REGEX
6687 try to export only the symbols matching REGEX
6688 -LLIBDIR search LIBDIR for required installed libraries
6689 -lNAME OUTPUT-FILE requires the installed library libNAME
6690 -module build a library that can dlopened
6691 -no-fast-install disable the fast-install mode
6692 -no-install link a not-installable executable
6693 -no-undefined declare that a library does not refer to external symbols
6694 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6695 -objectlist FILE Use a list of object files found in FILE to specify objects
6696 -precious-files-regex REGEX
6697 don't remove output files matching REGEX
6698 -release RELEASE specify package release information
6699 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6700 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6701 -static do not do any dynamic linking of libtool libraries
6702 -version-info CURRENT[:REVISION[:AGE]]
6703 specify library version info [each variable defaults to 0]
6705 All other options (arguments beginning with \`-') are ignored.
6707 Every other argument is treated as a filename. Files ending in \`.la' are
6708 treated as uninstalled libtool libraries, other files are standard or library
6711 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6712 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6713 required, except when creating a convenience library.
6715 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6716 using \`ar' and \`ranlib', or on Windows using \`lib'.
6718 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6719 is created, otherwise an executable program is created."
6724 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6726 Remove libraries from an installation directory.
6728 RM is the name of the program to use to delete files associated with each FILE
6729 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6732 If FILE is a libtool library, all the files associated with it are deleted.
6733 Otherwise, only FILE itself is deleted using RM."
6737 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6744 $echo "Try \`$modename --help' for more information about other modes."
6748 # The TAGs below are defined such that we never get into a situation
6749 # in which we disable both kinds of libraries. Given conflicting
6750 # choices, we go for a static library, that is the most portable,
6751 # since we can't tell whether shared libraries were disabled because
6752 # the user asked for that or because the platform doesn't support
6753 # them. This is particularly important on AIX, because we don't
6754 # support having both static and shared libraries enabled at the same
6755 # time on that platform, so we default to a shared-only configuration.
6756 # If a disable-shared tag is given, we'll fallback to a static-only
6757 # configuration. But we'll never go from static-only to shared-only.
6759 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6760 build_libtool_libs=no
6762 # ### END LIBTOOL TAG CONFIG: disable-shared
6764 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6765 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6766 # ### END LIBTOOL TAG CONFIG: disable-static
6772 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6774 # Libtool was configured on host vivaldi:
6776 # Shell to use when invoking shell scripts.
6779 # Whether or not to build shared libraries.
6780 build_libtool_libs=yes
6782 # Whether or not to build static libraries.
6785 # Whether or not to add -lc for building shared libraries.
6786 build_libtool_need_lc=no
6788 # Whether or not to disallow shared libs when runtime libs are static
6789 allow_libtool_libs_with_static_runtimes=no
6791 # Whether or not to optimize for fast installation.
6796 host=i686-pc-linux-gnu
6801 build=i686-pc-linux-gnu
6804 # An echo program that does not interpret backslashes.
6814 # LTCC compiler flags.
6817 # A language-specific compiler.
6820 # Is the compiler the GNU C compiler?
6824 EGREP="/bin/grep -E"
6826 # The linker used to build libraries.
6827 LD="/usr/lib/ccontrol/ld"
6829 # Whether we need hard or soft links.
6832 # A BSD-compatible nm program.
6835 # A symbol stripping program
6838 # Used to examine libraries when file_magic_cmd begins "file"
6841 # Used on cygwin: DLL creation program.
6844 # Used on cygwin: object dumper.
6847 # Used on cygwin: assembler.
6850 # The name of the directory that contains temporary libtool files.
6853 # How to create reloadable object files.
6855 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6857 # How to pass a linker flag through the compiler.
6860 # Object file suffix (normally "o").
6863 # Old archive suffix (normally "a").
6866 # Shared library suffix (normally ".so").
6869 # Executable file suffix (normally "").
6872 # Additional compiler flags for building library objects.
6873 pic_flag=" -fPIC -DPIC"
6876 # What is the maximum length of a command?
6879 # Does compiler simultaneously support -c and -o options?
6882 # Must we lock files when doing compilation?
6885 # Do we need the lib prefix for modules?
6888 # Do we need a version for libraries?
6891 # Whether dlopen is supported.
6892 dlopen_support=unknown
6894 # Whether dlopen of programs is supported.
6897 # Whether dlopen of statically linked programs is supported.
6898 dlopen_self_static=unknown
6900 # Compiler flag to prevent dynamic linking.
6901 link_static_flag="-static"
6903 # Compiler flag to turn off builtin functions.
6904 no_builtin_flag=" -fno-builtin"
6906 # Compiler flag to allow reflexive dlopens.
6907 export_dynamic_flag_spec="\${wl}--export-dynamic"
6909 # Compiler flag to generate shared objects directly from archives.
6910 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6912 # Compiler flag to generate thread-safe objects.
6913 thread_safe_flag_spec=""
6915 # Library versioning type.
6918 # Format of library name prefix.
6919 libname_spec="lib\$name"
6921 # List of archive names. First name is the real one, the rest are links.
6922 # The last name is the one that the linker finds with -lNAME.
6923 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
6925 # The coded name of the library, if different from the real name.
6926 soname_spec="\${libname}\${release}\${shared_ext}\$major"
6928 # Commands used to build and install an old-style archive.
6930 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
6931 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
6932 old_postuninstall_cmds=""
6934 # Create an old-style archive from a shared archive.
6935 old_archive_from_new_cmds=""
6937 # Create a temporary old-style archive to link instead of a shared archive.
6938 old_archive_from_expsyms_cmds=""
6940 # Commands used to build and install a shared archive.
6941 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6942 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6944 postuninstall_cmds=""
6946 # Commands used to build a loadable module (assumed same as above if empty)
6948 module_expsym_cmds=""
6950 # Commands to strip libraries.
6951 old_striplib="strip --strip-debug"
6952 striplib="strip --strip-unneeded"
6954 # Dependencies to place before the objects being linked to create a
6956 predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.3/crtbeginS.o"
6958 # Dependencies to place after the objects being linked to create a
6960 postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crtn.o"
6962 # Dependencies to place before the objects being linked to create a
6966 # Dependencies to place after the objects being linked to create a
6968 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
6970 # The library search path used internally by the compiler when linking
6972 compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
6974 # Method to check whether dependent libraries are shared objects.
6975 deplibs_check_method="pass_all"
6977 # Command to use when deplibs_check_method == file_magic.
6978 file_magic_cmd="\$MAGIC_CMD"
6980 # Flag that allows shared libraries with undefined symbols to be built.
6981 allow_undefined_flag=""
6983 # Flag that forces no undefined symbols.
6984 no_undefined_flag=""
6986 # Commands used to finish a libtool library installation in a directory.
6987 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
6989 # Same as above, but a single script fragment to be evaled but not shown.
6992 # Take the output of nm and produce a listing of raw symbols and C names.
6993 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
6995 # Transform the output of nm in a proper C declaration
6996 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6998 # Transform the output of nm in a C name address pair
6999 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7001 # This is the shared library runtime path variable.
7002 runpath_var=LD_RUN_PATH
7004 # This is the shared library path variable.
7005 shlibpath_var=LD_LIBRARY_PATH
7007 # Is shlibpath searched before the hard-coded library search path?
7008 shlibpath_overrides_runpath=no
7010 # How to hardcode a shared library path into an executable.
7011 hardcode_action=immediate
7013 # Whether we should hardcode library paths into libraries.
7014 hardcode_into_libs=yes
7016 # Flag to hardcode $libdir into a binary during linking.
7017 # This must work even if $libdir does not exist.
7018 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7020 # If ld is used when linking, flag to hardcode $libdir into
7021 # a binary during linking. This must work even if $libdir does
7023 hardcode_libdir_flag_spec_ld=""
7025 # Whether we need a single -rpath flag with a separated argument.
7026 hardcode_libdir_separator=""
7028 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7032 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7036 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7037 # the resulting binary.
7038 hardcode_shlibpath_var=unsupported
7040 # Set to yes if building a shared library automatically hardcodes DIR into the library
7041 # and all subsequent libraries and executables linked against it.
7042 hardcode_automatic=no
7044 # Variables whose values should be saved in libtool wrapper scripts and
7045 # restored at relink time.
7046 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7048 # Whether libtool must link a program against all its dependency libraries.
7051 # Compile-time system search path for libraries
7052 sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.1.3 /usr/lib /lib"
7054 # Run-time system search path for libraries
7055 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib "
7057 # Fix the shell variable $srcfile for the compiler.
7060 # Set to yes if exported symbols are required.
7061 always_export_symbols=no
7063 # The commands to list exported symbols.
7064 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7066 # The commands to extract the exported symbol list from a shared archive.
7067 extract_expsyms_cmds=""
7069 # Symbols that should not be listed in the preloaded symbols.
7072 # Symbols that must always be exported.
7075 # ### END LIBTOOL TAG CONFIG: CXX