3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU chasen 2.4.0-preview3)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
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="/usr/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 elm:
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/i686-gentoo-linux-gnu/bin/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\$old_deplibs~\$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.
325 link_all_deplibs=unknown
327 # Compile-time system search path for libraries
328 sys_lib_search_path_spec=" /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../../i686-gentoo-linux-gnu/lib/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../../i686-gentoo-linux-gnu/lib/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../ /lib/i686-gentoo-linux-gnu/4.1.1/ /lib/ /usr/lib/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib //usr//lib/opengl/xorg-x11/lib /usr/i686-gentoo-linux-gnu/lib /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1 /usr/lib/gcc/i686-gentoo-linux-gnu/3.4.6 /usr/lib/gcc-lib/i686-gentoo-linux-gnu/3.3.6 /usr/lib/nspr /usr/lib/nss /usr/lib /usr/lib/seamonkey /usr/lib/openmotif-2.2 /opt/sun-jdk-1.4.2.12/jre/lib/i386/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/native_threads/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/classic/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/server/ /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib /usr/games/lib /usr/lib/R/lib /usr/lib/libstdc++-v3/ /usr/lib/octave-2.1.73 "
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, 2005
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 # define SED for historic ltconfig's generated by Libtool 1.3
389 test -z "$SED" && SED=sed
391 # The name of this program:
392 progname=`echo "$progpath" | $SED $basename`
402 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
404 # See if we are running on zsh, and set the options which allow our
405 # commands through without removal of \ escapes.
406 if test -n "${ZSH_VERSION+set}" ; then
409 # Same for EGREP, and just to be sure, do LTCC as well
410 if test "X$EGREP" = X ; then
413 if test "X$LTCC" = X ; then
417 # Check that we have a working $echo.
418 if test "X$1" = X--no-reexec; then
419 # Discard the --no-reexec flag, and continue.
421 elif test "X$1" = X--fallback-echo; then
422 # Avoid inline document here, it may be left over
424 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
425 # Yippee, $echo works!
428 # Restart under the correct shell, and then maybe $echo will work.
429 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
432 if test "X$1" = X--fallback-echo; then
433 # used as fallback echo
442 help="Try \`$progname --help' for more information."
443 magic="%%%MAGIC variable%%%"
448 # Sed substitution that helps us do robust quoting. It backslashifies
449 # metacharacters that are still active within double-quoted strings.
450 Xsed="${SED}"' -e 1s/^X//'
451 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
452 # test EBCDIC or ASCII
453 case `echo X|tr X '\101'` in
454 A) # ASCII based system
455 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
457 NL2SP='tr \015\012 \040\040'
459 *) # EBCDIC based system
461 NL2SP='tr \r\n \100\100'
466 # Only set LANG and LC_ALL to C if already set.
467 # These must not be set unconditionally because not all systems understand
468 # e.g. LANG=C (notably SCO).
469 # We save the old values to restore during execute mode.
470 if test "${LC_ALL+set}" = set; then
471 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
473 if test "${LANG+set}" = set; then
474 save_LANG="$LANG"; LANG=C; export LANG
477 # Make sure IFS has a sensible default
482 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
483 $echo "$modename: not configured to build any kind of library" 1>&2
484 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
499 lo2o="s/\\.lo\$/.${objext}/"
500 o2lo="s/\\.${objext}\$/.lo/"
502 if test -z "$max_cmd_len"; then
507 # If test is not a shell built-in, we'll probably end up computing a
508 # maximum length that is only half of the actual maximum length, but
510 while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
511 = "XX$testring") >/dev/null 2>&1 &&
512 new_result=`expr "X$testring" : ".*" 2>&1` &&
513 max_cmd_len="$new_result" &&
514 test "$i" != 17 # 1/2 MB should be enough
517 testring="$testring$testring"
520 # Add a significant safety factor because C++ compilers can tack on massive
521 # amounts of additional arguments before passing them to the linker.
522 # It appears as though 1/2 is a usable value.
523 max_cmd_len=`expr $max_cmd_len \/ 2`
526 #####################################
527 # Shell function definitions:
528 # This seems to be the best place for them
530 # func_mktempdir [string]
531 # Make a temporary directory that won't clash with other running
532 # libtool processes, and avoids race conditions if possible. If
533 # given, STRING is the basename for that directory.
536 my_template="${TMPDIR-/tmp}/${1-$progname}"
538 if test "$run" = ":"; then
539 # Return a directory name, but don't create it in dry-run mode
540 my_tmpdir="${my_template}-$$"
543 # If mktemp works, use that first and foremost
544 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
546 if test ! -d "$my_tmpdir"; then
547 # Failing that, at least try and use $RANDOM to avoid a race
548 my_tmpdir="${my_template}-${RANDOM-0}$$"
550 save_mktempdir_umask=`umask`
553 umask $save_mktempdir_umask
556 # If we're not in dry-run mode, bomb out on failure
557 test -d "$my_tmpdir" || {
558 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
563 $echo "X$my_tmpdir" | $Xsed
567 # func_win32_libid arg
568 # return the library type of file 'arg'
570 # Need a lot of goo to handle *both* DLLs and import libs
571 # Has to be a shell function in order to 'eat' the argument
572 # that is supplied when $file_magic_command is called.
575 win32_libid_type="unknown"
576 win32_fileres=`file -L $1 2>/dev/null`
577 case $win32_fileres in
578 *ar\ archive\ import\ library*) # definitely import
579 win32_libid_type="x86 archive import"
581 *ar\ archive*) # could be an import, or static
582 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
583 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
584 win32_nmres=`eval $NM -f posix -A $1 | \
585 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
587 import*) win32_libid_type="x86 archive import";;
588 *) win32_libid_type="x86 archive static";;
593 win32_libid_type="x86 DLL"
595 *executable*) # but shell scripts are "executable" too...
596 case $win32_fileres in
597 *MS\ Windows\ PE\ Intel*)
598 win32_libid_type="x86 DLL"
603 $echo $win32_libid_type
608 # Infer tagged configuration to use if any are available and
609 # if one wasn't chosen via the "--tag" command line option.
610 # Only attempt this if the compiler in the base compile
611 # command doesn't match the default compiler.
612 # arg is usually of the form 'gcc ...'
615 if test -n "$available_tags" && test -z "$tagname"; then
619 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
623 CC_quoted="$CC_quoted $arg"
626 # Blanks in the command may have been stripped by the calling shell,
627 # but not from the CC environment variable when configure was run.
628 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
629 # Blanks at the start of $base_compile will cause this to fail
630 # if we don't check for them as well.
632 for z in $available_tags; do
633 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
634 # Evaluate the configuration.
635 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
638 # Double-quote args containing other shell metacharacters.
640 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
644 CC_quoted="$CC_quoted $arg"
646 # user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc'
647 trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"`
648 # and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc
649 extendcc=${host}-${CC}
650 # and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc
651 # (Gentoo-specific hack because we always export $CHOST)
652 mungedcc=${CHOST-${host}}-${trimedcc}
654 "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\
655 "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*)
658 "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\
659 "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\
660 "$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\
661 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
662 # The compiler in the base compile command matches
663 # the one in the tagged configuration.
664 # Assume this is the tagged configuration we want.
671 # If $tagname still isn't set, then no tagged configuration
672 # was found and let the user know that the "--tag" command
673 # line option must be used.
674 if test -z "$tagname"; then
675 $echo "$modename: unable to infer tagged configuration"
676 $echo "$modename: specify a tag with \`--tag'" 1>&2
679 # $echo "$modename: using $tagname tagged configuration"
687 # func_extract_an_archive dir oldlib
688 func_extract_an_archive ()
690 f_ex_an_ar_dir="$1"; shift
691 f_ex_an_ar_oldlib="$1"
693 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
694 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
695 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
698 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
703 # func_extract_archives gentop oldlib ...
704 func_extract_archives ()
706 my_gentop="$1"; shift
714 $show "${rm}r $my_gentop"
715 $run ${rm}r "$my_gentop"
716 $show "$mkdir $my_gentop"
717 $run $mkdir "$my_gentop"
719 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
723 for my_xlib in $my_oldlibs; do
724 # Extract the objects.
726 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
727 *) my_xabs=`pwd`"/$my_xlib" ;;
729 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
730 my_xdir="$my_gentop/$my_xlib"
732 $show "${rm}r $my_xdir"
733 $run ${rm}r "$my_xdir"
734 $show "$mkdir $my_xdir"
735 $run $mkdir "$my_xdir"
737 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
742 $show "Extracting $my_xabs"
743 # Do not bother doing anything if just a dry run
744 if test -z "$run"; then
745 darwin_orig_dir=`pwd`
746 cd $my_xdir || exit $?
747 darwin_archive=$my_xabs
749 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
750 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
751 if test -n "$darwin_arches"; then
752 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
754 $show "$darwin_base_archive has multiple architectures $darwin_arches"
755 for darwin_arch in $darwin_arches ; do
756 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
757 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
758 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
759 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
761 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
762 done # $darwin_arches
763 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
764 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
767 for darwin_file in $darwin_filelist; do
768 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
769 lipo -create -output "$darwin_file" $darwin_files
770 done # $darwin_filelist
772 cd "$darwin_orig_dir"
774 cd "$darwin_orig_dir"
775 func_extract_an_archive "$my_xdir" "$my_xabs"
780 func_extract_an_archive "$my_xdir" "$my_xabs"
783 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
785 func_extract_archives_result="$my_oldobjs"
787 # End of Shell function definitions
788 #####################################
791 eval std_shrext=\"$shrext_cmds\"
795 # Parse our command line options once, thoroughly.
796 while test "$#" -gt 0
802 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
806 # If the previous option needs an argument, assign it.
807 if test -n "$prev"; then
810 execute_dlfiles="$execute_dlfiles $arg"
814 preserve_args="${preserve_args}=$arg"
816 # Check whether tagname contains only valid characters
819 $echo "$progname: invalid tag name: $tagname" 1>&2
826 # Don't test for the "default" C tag, as we know, it's there, but
827 # not specially marked.
830 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
831 taglist="$taglist $tagname"
832 # Evaluate the configuration.
833 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
835 $echo "$progname: ignoring unknown tag $tagname" 1>&2
850 # Have we seen a non-optional argument yet?
857 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
859 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
860 $echo "This is free software; see the source for copying conditions. There is NO"
861 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
866 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
867 # Now print the configurations for the tags.
868 for tagname in $taglist; do
869 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
875 $echo "$progname: enabling shell trace mode"
877 preserve_args="$preserve_args $arg"
886 if test "$build_libtool_libs" = yes; then
887 $echo "enable shared libraries"
889 $echo "disable shared libraries"
891 if test "$build_old_libs" = yes; then
892 $echo "enable static libraries"
894 $echo "disable static libraries"
899 --finish) mode="finish" ;;
901 --mode) prevopt="--mode" prev=mode ;;
902 --mode=*) mode="$optarg" ;;
904 --preserve-dup-deps) duplicate_deps="yes" ;;
908 preserve_args="$preserve_args $arg"
914 preserve_args="$preserve_args --tag"
917 set tag "$optarg" ${1+"$@"}
920 preserve_args="$preserve_args --tag"
929 $echo "$modename: unrecognized option \`$arg'" 1>&2
941 if test -n "$prevopt"; then
942 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
947 case $disable_libs in
951 build_libtool_libs=no
955 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
959 # If this variable is set in any of the actions, the command in it
960 # will be execed at the end. This prevents here-documents from being
961 # left over by shells.
964 if test -z "$show_help"; then
966 # Infer the operation mode.
967 if test -z "$mode"; then
968 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
969 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
971 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
983 *db | *dbx | *strace | *truss)
993 # If we have no mode, but dlfiles were specified, then do execute mode.
994 test -n "$execute_dlfiles" && mode=execute
996 # Just use the default operation mode.
997 if test -z "$mode"; then
998 if test -n "$nonopt"; then
999 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
1001 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
1008 # Only execute mode is allowed to have -dlopen flags.
1009 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1010 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1015 # Change the help message to a mode-specific one.
1016 generic_help="$help"
1017 help="Try \`$modename --help --mode=$mode' for more information."
1019 # These modes are in order of execution frequency so that they run quickly.
1021 # libtool compile mode
1023 modename="$modename: compile"
1024 # Get the compilation command and the source file.
1026 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1037 # do not "continue". Instead, add this to base_compile
1049 # Accept any command-line options.
1052 if test -n "$libobj" ; then
1053 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1060 -static | -prefer-pic | -prefer-non-pic)
1071 arg_mode=arg # the next one goes into the "base_compile" arg list
1072 continue # The current "srcfile" will either be retained or
1073 ;; # replaced later. I would guess that would be a bug.
1076 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1078 save_ifs="$IFS"; IFS=','
1079 for arg in $args; do
1082 # Double-quote args containing other shell metacharacters.
1083 # Many Bourne shells cannot handle close brackets correctly
1084 # in scan sets, so we specify it separately.
1086 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1090 lastarg="$lastarg $arg"
1093 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1095 # Add the arguments to base_compile.
1096 base_compile="$base_compile $lastarg"
1101 # Accept the current argument as the source file.
1102 # The previous "srcfile" becomes the current argument.
1109 esac # case $arg_mode
1111 # Aesthetically quote the previous argument.
1112 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1115 # Double-quote args containing other shell metacharacters.
1116 # Many Bourne shells cannot handle close brackets correctly
1117 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1118 # in scan sets (worked around with variable expansion),
1119 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1120 # at all, so we specify them separately.
1121 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1122 lastarg="\"$lastarg\""
1126 base_compile="$base_compile $lastarg"
1131 $echo "$modename: you must specify an argument for -Xcompile"
1135 $echo "$modename: you must specify a target with \`-o'" 1>&2
1139 # Get the name of the library object.
1140 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1144 # Recognize several different file suffixes.
1145 # If the user specifies -o file.o, it is replaced with file.lo
1155 *.class) xform=class ;;
1160 *.java) xform=java ;;
1163 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1166 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1168 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1173 func_infer_tag $base_compile
1175 for arg in $later; do
1194 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1196 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1197 qlibobj="\"$qlibobj\"" ;;
1199 test "X$libobj" != "X$qlibobj" \
1200 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1201 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1202 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1203 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1204 if test "X$xdir" = "X$obj"; then
1209 lobj=${xdir}$objdir/$objname
1211 if test -z "$base_compile"; then
1212 $echo "$modename: you must specify a compilation command" 1>&2
1217 # Delete any leftover library objects.
1218 if test "$build_old_libs" = yes; then
1219 removelist="$obj $lobj $libobj ${libobj}T"
1221 removelist="$lobj $libobj ${libobj}T"
1224 $run $rm $removelist
1225 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1227 # On Cygwin there's no "real" PIC flag so we must build both object types
1229 cygwin* | mingw* | pw32* | os2*)
1233 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1234 # non-PIC code in shared libraries is not supported
1238 # Calculate the filename of the output object if compiler does
1239 # not support -o with -c
1240 if test "$compiler_c_o" = no; then
1241 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1242 lockfile="$output_obj.lock"
1243 removelist="$removelist $output_obj $lockfile"
1244 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1251 # Lock this critical section if it is needed
1252 # We use this script file to make the link, it avoids creating a new file
1253 if test "$need_locks" = yes; then
1254 until $run ln "$srcfile" "$lockfile" 2>/dev/null; do
1255 $show "Waiting for $lockfile to be removed"
1258 elif test "$need_locks" = warn; then
1259 if test -f "$lockfile"; then
1261 *** ERROR, $lockfile exists and contains:
1262 `cat $lockfile 2>/dev/null`
1264 This indicates that another process is trying to use the same
1265 temporary object file, and libtool could not work around it because
1266 your compiler does not support \`-c' and \`-o' together. If you
1267 repeat this compilation, it may succeed, by chance, but you had better
1268 avoid parallel builds (make -j) in this platform, or get a better
1271 $run $rm $removelist
1274 $echo "$srcfile" > "$lockfile"
1277 if test -n "$fix_srcfile_path"; then
1278 eval srcfile=\"$fix_srcfile_path\"
1280 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1282 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1283 qsrcfile="\"$qsrcfile\"" ;;
1286 $run $rm "$libobj" "${libobj}T"
1288 # Create a libtool object file (analogous to a ".la" file),
1289 # but don't create it if we're doing a dry run.
1290 test -z "$run" && cat > ${libobj}T <<EOF
1291 # $libobj - a libtool object file
1292 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1294 # Please DO NOT delete this file!
1295 # It is necessary for linking the library.
1297 # Name of the PIC object.
1300 # Only build a PIC object if we are building libtool libraries.
1301 if test "$build_libtool_libs" = yes; then
1302 # Without this assignment, base_compile gets emptied.
1303 fbsd_hideous_sh_bug=$base_compile
1305 if test "$pic_mode" != no; then
1306 command="$base_compile $qsrcfile $pic_flag"
1308 # Don't build PIC code
1309 command="$base_compile $qsrcfile"
1312 if test ! -d "${xdir}$objdir"; then
1313 $show "$mkdir ${xdir}$objdir"
1314 $run $mkdir ${xdir}$objdir
1316 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1321 if test -z "$output_obj"; then
1322 # Place PIC objects in $objdir
1323 command="$command -o $lobj"
1326 $run $rm "$lobj" "$output_obj"
1329 if $run eval "$command"; then :
1331 test -n "$output_obj" && $run $rm $removelist
1335 if test "$need_locks" = warn &&
1336 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1338 *** ERROR, $lockfile contains:
1339 `cat $lockfile 2>/dev/null`
1341 but it should contain:
1344 This indicates that another process is trying to use the same
1345 temporary object file, and libtool could not work around it because
1346 your compiler does not support \`-c' and \`-o' together. If you
1347 repeat this compilation, it may succeed, by chance, but you had better
1348 avoid parallel builds (make -j) in this platform, or get a better
1351 $run $rm $removelist
1355 # Just move the object if needed, then go on to compile the next one
1356 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1357 $show "$mv $output_obj $lobj"
1358 if $run $mv $output_obj $lobj; then :
1361 $run $rm $removelist
1366 # Append the name of the PIC object to the libtool object file.
1367 test -z "$run" && cat >> ${libobj}T <<EOF
1368 pic_object='$objdir/$objname'
1372 # Allow error messages only from the first compilation.
1373 if test "$suppress_opt" = yes; then
1374 suppress_output=' >/dev/null 2>&1'
1377 # No PIC object so indicate it doesn't exist in the libtool
1379 test -z "$run" && cat >> ${libobj}T <<EOF
1385 # Only build a position-dependent object if we build old libraries.
1386 if test "$build_old_libs" = yes; then
1387 if test "$pic_mode" != yes; then
1388 # Don't build PIC code
1389 command="$base_compile $qsrcfile"
1391 command="$base_compile $qsrcfile $pic_flag"
1393 if test "$compiler_c_o" = yes; then
1394 command="$command -o $obj"
1397 # Suppress compiler output if we already did a PIC compilation.
1398 command="$command$suppress_output"
1399 $run $rm "$obj" "$output_obj"
1401 if $run eval "$command"; then :
1403 $run $rm $removelist
1407 if test "$need_locks" = warn &&
1408 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1410 *** ERROR, $lockfile contains:
1411 `cat $lockfile 2>/dev/null`
1413 but it should contain:
1416 This indicates that another process is trying to use the same
1417 temporary object file, and libtool could not work around it because
1418 your compiler does not support \`-c' and \`-o' together. If you
1419 repeat this compilation, it may succeed, by chance, but you had better
1420 avoid parallel builds (make -j) in this platform, or get a better
1423 $run $rm $removelist
1427 # Just move the object if needed
1428 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1429 $show "$mv $output_obj $obj"
1430 if $run $mv $output_obj $obj; then :
1433 $run $rm $removelist
1438 # Append the name of the non-PIC object the libtool object file.
1439 # Only append if the libtool object file exists.
1440 test -z "$run" && cat >> ${libobj}T <<EOF
1441 # Name of the non-PIC object.
1442 non_pic_object='$objname'
1446 # Append the name of the non-PIC object the libtool object file.
1447 # Only append if the libtool object file exists.
1448 test -z "$run" && cat >> ${libobj}T <<EOF
1449 # Name of the non-PIC object.
1455 $run $mv "${libobj}T" "${libobj}"
1457 # Unlock the critical section if it was locked
1458 if test "$need_locks" != no; then
1459 $run $rm "$lockfile"
1467 modename="$modename: link"
1469 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1470 # It is impossible to link a dll without this setting, and
1471 # we shouldn't force the makefile maintainer to figure out
1472 # which system we are compiling for in order to pass an extra
1473 # flag for every libtool invocation.
1474 # allow_undefined=no
1476 # FIXME: Unfortunately, there are problems with the above when trying
1477 # to make a dll which has undefined symbols, in which case not
1478 # even a static library is built. For now, we need to specify
1479 # -no-undefined on the libtool link line when we can be certain
1480 # that all symbols are satisfied, otherwise we get a static library.
1487 libtool_args="$nonopt"
1488 base_compile="$nonopt $@"
1489 compile_command="$nonopt"
1490 finalize_command="$nonopt"
1503 lib_search_path=`pwd`
1512 export_symbols_regex=
1520 notinst_path= # paths that contain not-installed libtool libraries
1521 precious_files_regex=
1522 prefer_static_libs=no
1535 func_infer_tag $base_compile
1537 # We need to know -static, to get the right output filenames.
1541 -all-static | -static)
1542 if test "X$arg" = "X-all-static"; then
1543 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1544 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1546 if test -n "$link_static_flag"; then
1547 dlopen_self=$dlopen_self_static
1549 prefer_static_libs=yes
1551 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1552 dlopen_self=$dlopen_self_static
1554 prefer_static_libs=built
1556 build_libtool_libs=no
1563 # See if our shared archives depend on static archives.
1564 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1566 # Go through the arguments, transforming them on the way.
1567 while test "$#" -gt 0; do
1571 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1572 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1576 libtool_args="$libtool_args $qarg"
1578 # If the previous option needs an argument, assign it.
1579 if test -n "$prev"; then
1582 compile_command="$compile_command @OUTPUT@"
1583 finalize_command="$finalize_command @OUTPUT@"
1589 if test "$preload" = no; then
1590 # Add the symbol object into the linking commands.
1591 compile_command="$compile_command @SYMFILE@"
1592 finalize_command="$finalize_command @SYMFILE@"
1596 *.la | *.lo) ;; # We handle these cases below.
1598 if test "$dlself" = no; then
1606 if test "$prev" = dlprefiles; then
1608 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1618 if test "$prev" = dlfiles; then
1619 dlfiles="$dlfiles $arg"
1621 dlprefiles="$dlprefiles $arg"
1629 export_symbols="$arg"
1630 if test ! -f "$arg"; then
1631 $echo "$modename: symbol file \`$arg' does not exist"
1638 export_symbols_regex="$arg"
1643 inst_prefix_dir="$arg"
1648 precious_files_regex="$arg"
1658 if test -f "$arg"; then
1661 for fil in `cat $save_arg`
1663 # moreargs="$moreargs $fil"
1665 # A libtool-controlled object.
1667 # Check to see that this really is a libtool object.
1668 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1673 # If there is no directory component, then add one.
1675 */* | *\\*) . $arg ;;
1679 if test -z "$pic_object" || \
1680 test -z "$non_pic_object" ||
1681 test "$pic_object" = none && \
1682 test "$non_pic_object" = none; then
1683 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1687 # Extract subdirectory from the argument.
1688 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1689 if test "X$xdir" = "X$arg"; then
1695 if test "$pic_object" != none; then
1696 # Prepend the subdirectory the object is found in.
1697 pic_object="$xdir$pic_object"
1699 if test "$prev" = dlfiles; then
1700 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1701 dlfiles="$dlfiles $pic_object"
1705 # If libtool objects are unsupported, then we need to preload.
1710 # CHECK ME: I think I busted this. -Ossama
1711 if test "$prev" = dlprefiles; then
1712 # Preload the old-style object.
1713 dlprefiles="$dlprefiles $pic_object"
1718 libobjs="$libobjs $pic_object"
1723 if test "$non_pic_object" != none; then
1724 # Prepend the subdirectory the object is found in.
1725 non_pic_object="$xdir$non_pic_object"
1727 # A standard non-PIC object
1728 non_pic_objects="$non_pic_objects $non_pic_object"
1729 if test -z "$pic_object" || test "$pic_object" = none ; then
1730 arg="$non_pic_object"
1733 # If the PIC object exists, use it instead.
1734 # $xdir was prepended to $pic_object above.
1735 non_pic_object="$pic_object"
1736 non_pic_objects="$non_pic_objects $non_pic_object"
1739 # Only an error if not doing a dry-run.
1740 if test -z "$run"; then
1741 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1746 # Extract subdirectory from the argument.
1747 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1748 if test "X$xdir" = "X$arg"; then
1754 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1755 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1756 libobjs="$libobjs $pic_object"
1757 non_pic_objects="$non_pic_objects $non_pic_object"
1762 $echo "$modename: link input file \`$save_arg' does not exist"
1770 # We need an absolute path.
1772 [\\/]* | [A-Za-z]:[\\/]*) ;;
1774 $echo "$modename: only absolute run-paths are allowed" 1>&2
1778 if test "$prev" = rpath; then
1781 *) rpath="$rpath $arg" ;;
1786 *) xrpath="$xrpath $arg" ;;
1793 compiler_flags="$compiler_flags $qarg"
1795 compile_command="$compile_command $qarg"
1796 finalize_command="$finalize_command $qarg"
1800 linker_flags="$linker_flags $qarg"
1801 compiler_flags="$compiler_flags $wl$qarg"
1803 compile_command="$compile_command $wl$qarg"
1804 finalize_command="$finalize_command $wl$qarg"
1808 linker_flags="$linker_flags $qarg"
1809 compiler_flags="$compiler_flags $qarg"
1811 compile_command="$compile_command $qarg"
1812 finalize_command="$finalize_command $qarg"
1820 darwin_framework|darwin_framework_skip)
1821 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1822 compile_command="$compile_command $arg"
1823 finalize_command="$finalize_command $arg"
1828 eval "$prev=\"\$arg\""
1833 fi # test -n "$prev"
1839 if test -n "$link_static_flag"; then
1840 compile_command="$compile_command $link_static_flag"
1841 finalize_command="$finalize_command $link_static_flag"
1847 # FIXME: remove this flag sometime in the future.
1848 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1872 -export-symbols | -export-symbols-regex)
1873 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1874 $echo "$modename: more than one -exported-symbols argument is not allowed"
1877 if test "X$arg" = "X-export-symbols"; then
1885 -framework|-arch|-isysroot)
1887 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1888 prev=darwin_framework_skip ;;
1889 *) compiler_flags="$compiler_flags $arg"
1890 prev=darwin_framework ;;
1892 compile_command="$compile_command $arg"
1893 finalize_command="$finalize_command $arg"
1902 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1903 # so, if we see these flags be careful not to treat them like -L
1905 case $with_gcc/$host in
1906 no/*-*-irix* | /*-*-irix*)
1907 compile_command="$compile_command $arg"
1908 finalize_command="$finalize_command $arg"
1915 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1916 # We need an absolute path.
1918 [\\/]* | [A-Za-z]:[\\/]*) ;;
1920 absdir=`cd "$dir" && pwd`
1921 if test -z "$absdir"; then
1922 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1924 notinst_path="$notinst_path $dir"
1932 deplibs="$deplibs -L$dir"
1933 lib_search_path="$lib_search_path $dir"
1937 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1938 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1939 case :$dllsearchpath: in
1941 *) dllsearchpath="$dllsearchpath:$dir";;
1943 case :$dllsearchpath: in
1944 *":$testbindir:"*) ;;
1945 *) dllsearchpath="$dllsearchpath:$testbindir";;
1953 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1955 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1956 # These systems don't actually have a C or math library (as such)
1960 # These systems don't actually have a C library (as such)
1961 test "X$arg" = "X-lc" && continue
1963 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1964 # Do not include libc due to us having libc/libc_r.
1965 test "X$arg" = "X-lc" && continue
1967 *-*-rhapsody* | *-*-darwin1.[012])
1968 # Rhapsody C and math libraries are in the System framework
1969 deplibs="$deplibs -framework System"
1972 *-*-sco3.2v5* | *-*-sco5v6*)
1973 # Causes problems with __ctype
1974 test "X$arg" = "X-lc" && continue
1976 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1977 # Compiler inserts libc in the correct place for threads to work
1978 test "X$arg" = "X-lc" && continue
1981 elif test "X$arg" = "X-lc_r"; then
1983 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1984 # Do not include libc_r directly, use -pthread flag.
1989 deplibs="$deplibs $arg"
1993 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1994 # classes, name mangling, and exception handling.
1996 compile_command="$compile_command $arg"
1997 compiler_flags="$compiler_flags $arg"
1998 finalize_command="$finalize_command $arg"
2003 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2004 compiler_flags="$compiler_flags $arg"
2005 compile_command="$compile_command $arg"
2006 finalize_command="$finalize_command $arg"
2015 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2016 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2017 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2018 # +DA*, +DD* enable 64-bit mode on the HP compiler
2019 # -q* pass through compiler args for the IBM compiler
2020 # -m* pass through architecture-specific compiler args for GCC
2021 # -m*, -t[45]*, -txscale* pass through architecture-specific
2022 # compiler args for GCC
2023 # -pg pass through profiling flag for GCC
2024 # @file GCC response files
2025 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
2026 -t[45]*|-txscale*|@*)
2028 # Unknown arguments in both finalize_command and compile_command need
2029 # to be aesthetically quoted because they are evaled later.
2030 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2032 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2036 compile_command="$compile_command $arg"
2037 finalize_command="$finalize_command $arg"
2038 compiler_flags="$compiler_flags $arg"
2054 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
2055 # The PATH hackery in wrapper scripts is required on Windows
2056 # in order for the loader to find any dlls it needs.
2057 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2058 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2061 *) no_install=yes ;;
2078 -precious-files-regex)
2099 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2100 # We need an absolute path.
2102 [\\/]* | [A-Za-z]:[\\/]*) ;;
2104 $echo "$modename: only absolute run-paths are allowed" 1>&2
2110 *) xrpath="$xrpath $dir" ;;
2116 # The effects of -static are defined in a previous loop.
2117 # We used to do the same as -all-static on platforms that
2118 # didn't have a PIC flag, but the assumption that the effects
2119 # would be equivalent was wrong. It would break on at least
2120 # Digital Unix and AIX.
2140 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2142 save_ifs="$IFS"; IFS=','
2143 for flag in $args; do
2146 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2151 compiler_flags="$compiler_flags $flag"
2154 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2158 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2160 save_ifs="$IFS"; IFS=','
2161 for flag in $args; do
2164 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2169 compiler_flags="$compiler_flags $wl$flag"
2170 linker_flags="$linker_flags $flag"
2173 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2191 # Some other compiler flag.
2193 # Unknown arguments in both finalize_command and compile_command need
2194 # to be aesthetically quoted because they are evaled later.
2195 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2197 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2204 # A standard object.
2209 # A libtool-controlled object.
2211 # Check to see that this really is a libtool object.
2212 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2217 # If there is no directory component, then add one.
2219 */* | *\\*) . $arg ;;
2223 if test -z "$pic_object" || \
2224 test -z "$non_pic_object" ||
2225 test "$pic_object" = none && \
2226 test "$non_pic_object" = none; then
2227 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2231 # Extract subdirectory from the argument.
2232 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2233 if test "X$xdir" = "X$arg"; then
2239 if test "$pic_object" != none; then
2240 # Prepend the subdirectory the object is found in.
2241 pic_object="$xdir$pic_object"
2243 if test "$prev" = dlfiles; then
2244 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2245 dlfiles="$dlfiles $pic_object"
2249 # If libtool objects are unsupported, then we need to preload.
2254 # CHECK ME: I think I busted this. -Ossama
2255 if test "$prev" = dlprefiles; then
2256 # Preload the old-style object.
2257 dlprefiles="$dlprefiles $pic_object"
2262 libobjs="$libobjs $pic_object"
2267 if test "$non_pic_object" != none; then
2268 # Prepend the subdirectory the object is found in.
2269 non_pic_object="$xdir$non_pic_object"
2271 # A standard non-PIC object
2272 non_pic_objects="$non_pic_objects $non_pic_object"
2273 if test -z "$pic_object" || test "$pic_object" = none ; then
2274 arg="$non_pic_object"
2277 # If the PIC object exists, use it instead.
2278 # $xdir was prepended to $pic_object above.
2279 non_pic_object="$pic_object"
2280 non_pic_objects="$non_pic_objects $non_pic_object"
2283 # Only an error if not doing a dry-run.
2284 if test -z "$run"; then
2285 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2290 # Extract subdirectory from the argument.
2291 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2292 if test "X$xdir" = "X$arg"; then
2298 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2299 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2300 libobjs="$libobjs $pic_object"
2301 non_pic_objects="$non_pic_objects $non_pic_object"
2308 deplibs="$deplibs $arg"
2309 old_deplibs="$old_deplibs $arg"
2314 # A libtool-controlled library.
2316 if test "$prev" = dlfiles; then
2317 # This library was specified with -dlopen.
2318 dlfiles="$dlfiles $arg"
2320 elif test "$prev" = dlprefiles; then
2321 # The library was specified with -dlpreopen.
2322 dlprefiles="$dlprefiles $arg"
2325 deplibs="$deplibs $arg"
2330 # Some other compiler argument.
2332 # Unknown arguments in both finalize_command and compile_command need
2333 # to be aesthetically quoted because they are evaled later.
2334 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2336 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2343 # Now actually substitute the argument into the commands.
2344 if test -n "$arg"; then
2345 compile_command="$compile_command $arg"
2346 finalize_command="$finalize_command $arg"
2348 done # argument parsing loop
2350 if test -n "$prev"; then
2351 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2356 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2357 eval arg=\"$export_dynamic_flag_spec\"
2358 compile_command="$compile_command $arg"
2359 finalize_command="$finalize_command $arg"
2363 # calculate the name of the file, without its directory
2364 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2365 libobjs_save="$libobjs"
2367 if test -n "$shlibpath_var"; then
2368 # get the directories listed in $shlibpath_var
2369 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2373 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2374 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2376 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2377 if test "X$output_objdir" = "X$output"; then
2378 output_objdir="$objdir"
2380 output_objdir="$output_objdir/$objdir"
2382 # Create the object directory.
2383 if test ! -d "$output_objdir"; then
2384 $show "$mkdir $output_objdir"
2385 $run $mkdir $output_objdir
2387 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2392 # Determine the type of output
2395 $echo "$modename: you must specify an output file" 1>&2
2399 *.$libext) linkmode=oldlib ;;
2400 *.lo | *.$objext) linkmode=obj ;;
2401 *.la) linkmode=lib ;;
2402 *) linkmode=prog ;; # Anything else should be a program.
2406 *cygwin* | *mingw* | *pw32*)
2407 # don't eliminate duplications in $postdeps and $predeps
2408 duplicate_compiler_generated_deps=yes
2411 duplicate_compiler_generated_deps=$duplicate_deps
2417 # Find all interdependent deplibs by searching for libraries
2418 # that are linked more than once (e.g. -la -lb -la)
2419 for deplib in $deplibs; do
2420 if test "X$duplicate_deps" = "Xyes" ; then
2422 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2425 libs="$libs $deplib"
2428 if test "$linkmode" = lib; then
2429 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2431 # Compute libraries that are listed more than once in $predeps
2432 # $postdeps and mark them as special (i.e., whose duplicates are
2433 # not to be eliminated).
2435 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2436 for pre_post_dep in $predeps $postdeps; do
2437 case "$pre_post_deps " in
2438 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2440 pre_post_deps="$pre_post_deps $pre_post_dep"
2449 need_relink=no # whether we're linking any uninstalled libtool libraries
2450 notinst_deplibs= # not-installed libtool libraries
2454 for file in $dlfiles $dlprefiles; do
2458 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2470 passes="conv scan dlopen dlpreopen link"
2475 for pass in $passes; do
2476 if test "$linkmode,$pass" = "lib,link" ||
2477 test "$linkmode,$pass" = "prog,scan"; then
2481 if test "$linkmode" = prog; then
2483 dlopen) libs="$dlfiles" ;;
2484 dlpreopen) libs="$dlprefiles" ;;
2485 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2488 if test "$pass" = dlopen; then
2489 # Collect dlpreopened libraries
2490 save_deplibs="$deplibs"
2493 for deplib in $libs; do
2497 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2498 if test "$linkmode,$pass" = "prog,link"; then
2499 compile_deplibs="$deplib $compile_deplibs"
2500 finalize_deplibs="$deplib $finalize_deplibs"
2502 compiler_flags="$compiler_flags $deplib"
2507 if test "$linkmode" != lib && test "$linkmode" != prog; then
2508 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2511 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2512 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2513 for search_ext in .la $std_shrext .so .a; do
2514 # Search the libtool library
2515 lib="$searchdir/lib${name}${search_ext}"
2516 if test -f "$lib"; then
2517 if test "$search_ext" = ".la"; then
2526 if test "$found" != yes; then
2527 # deplib doesn't seem to be a libtool library
2528 if test "$linkmode,$pass" = "prog,link"; then
2529 compile_deplibs="$deplib $compile_deplibs"
2530 finalize_deplibs="$deplib $finalize_deplibs"
2532 deplibs="$deplib $deplibs"
2533 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2536 else # deplib is a libtool library
2537 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2538 # We need to do some special things here, and not later.
2539 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2540 case " $predeps $postdeps " in
2542 if (${SED} -e '2q' $lib |
2543 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2547 */* | *\\*) . $lib ;;
2550 for l in $old_library $library_names; do
2553 if test "X$ll" = "X$old_library" ; then # only static version available
2555 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2556 test "X$ladir" = "X$lib" && ladir="."
2557 lib=$ladir/$old_library
2558 if test "$linkmode,$pass" = "prog,link"; then
2559 compile_deplibs="$deplib $compile_deplibs"
2560 finalize_deplibs="$deplib $finalize_deplibs"
2562 deplibs="$deplib $deplibs"
2563 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2577 deplibs="$deplib $deplibs"
2578 test "$pass" = conv && continue
2579 newdependency_libs="$deplib $newdependency_libs"
2580 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2583 if test "$pass" = conv; then
2584 deplibs="$deplib $deplibs"
2587 if test "$pass" = scan; then
2588 deplibs="$deplib $deplibs"
2590 compile_deplibs="$deplib $compile_deplibs"
2591 finalize_deplibs="$deplib $finalize_deplibs"
2593 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2596 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2602 if test "$pass" = link; then
2603 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2604 # Make sure the xrpath contains only unique directories.
2607 *) xrpath="$xrpath $dir" ;;
2610 deplibs="$deplib $deplibs"
2613 *.la) lib="$deplib" ;;
2615 if test "$pass" = conv; then
2616 deplibs="$deplib $deplibs"
2622 case $deplibs_check_method in
2624 set dummy $deplibs_check_method
2625 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2626 if eval $echo \"$deplib\" 2>/dev/null \
2628 | $EGREP "$match_pattern_regex" > /dev/null; then
2636 if test "$valid_a_lib" != yes; then
2638 $echo "*** Warning: Trying to link with static lib archive $deplib."
2639 $echo "*** I have the capability to make that library automatically link in when"
2640 $echo "*** you link to this library. But I can only do this if you have a"
2641 $echo "*** shared version of the library, which you do not appear to have"
2642 $echo "*** because the file extensions .$libext of this argument makes me believe"
2643 $echo "*** that it is just a static archive that I should not used here."
2646 $echo "*** Warning: Linking the shared library $output against the"
2647 $echo "*** static library $deplib is not portable!"
2648 deplibs="$deplib $deplibs"
2653 if test "$pass" != link; then
2654 deplibs="$deplib $deplibs"
2656 compile_deplibs="$deplib $compile_deplibs"
2657 finalize_deplibs="$deplib $finalize_deplibs"
2664 if test "$pass" = conv; then
2665 deplibs="$deplib $deplibs"
2666 elif test "$linkmode" = prog; then
2667 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2668 # If there is no dlopen support or we're linking statically,
2669 # we need to preload.
2670 newdlprefiles="$newdlprefiles $deplib"
2671 compile_deplibs="$deplib $compile_deplibs"
2672 finalize_deplibs="$deplib $finalize_deplibs"
2674 newdlfiles="$newdlfiles $deplib"
2684 if test "$found" = yes || test -f "$lib"; then :
2686 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2690 # Check to see that this really is a libtool archive.
2691 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2693 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2697 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2698 test "X$ladir" = "X$lib" && ladir="."
2706 # If the library was installed with an old release of libtool,
2707 # it will not redefine variables installed, or shouldnotlink
2715 */* | *\\*) . $lib ;;
2719 if test "$linkmode,$pass" = "lib,link" ||
2720 test "$linkmode,$pass" = "prog,scan" ||
2721 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2722 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2723 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2726 if test "$pass" = conv; then
2727 # Only check for convenience libraries
2728 deplibs="$lib $deplibs"
2729 if test -z "$libdir"; then
2730 if test -z "$old_library"; then
2731 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2734 # It is a libtool convenience library, so add in its objects.
2735 convenience="$convenience $ladir/$objdir/$old_library"
2736 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2738 for deplib in $dependency_libs; do
2739 deplibs="$deplib $deplibs"
2740 if test "X$duplicate_deps" = "Xyes" ; then
2741 case "$tmp_libs " in
2742 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2745 tmp_libs="$tmp_libs $deplib"
2747 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2748 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2755 # Get the name of the library we link against.
2757 for l in $old_library $library_names; do
2760 if test -z "$linklib"; then
2761 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2765 # This library was specified with -dlopen.
2766 if test "$pass" = dlopen; then
2767 if test -z "$libdir"; then
2768 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2771 if test -z "$dlname" ||
2772 test "$dlopen_support" != yes ||
2773 test "$build_libtool_libs" = no; then
2774 # If there is no dlname, no dlopen support or we're linking
2775 # statically, we need to preload. We also need to preload any
2776 # dependent libraries so libltdl's deplib preloader doesn't
2777 # bomb out in the load deplibs phase.
2778 dlprefiles="$dlprefiles $lib $dependency_libs"
2780 newdlfiles="$newdlfiles $lib"
2785 # We need an absolute path.
2787 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2789 abs_ladir=`cd "$ladir" && pwd`
2790 if test -z "$abs_ladir"; then
2791 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2792 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2797 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2799 # Find the relevant object directory and library name.
2800 if test "X$installed" = Xyes; then
2801 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2802 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2810 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2812 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2815 # Remove this search path later
2816 notinst_path="$notinst_path $abs_ladir"
2818 dir="$ladir/$objdir"
2819 absdir="$abs_ladir/$objdir"
2820 # Remove this search path later
2821 notinst_path="$notinst_path $abs_ladir"
2823 fi # $installed = yes
2824 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2826 # This library was specified with -dlpreopen.
2827 if test "$pass" = dlpreopen; then
2828 if test -z "$libdir"; then
2829 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2832 # Prefer using a static library (so that no silly _DYNAMIC symbols
2833 # are required to link).
2834 if test -n "$old_library"; then
2835 newdlprefiles="$newdlprefiles $dir/$old_library"
2836 # Otherwise, use the dlname, so that lt_dlopen finds it.
2837 elif test -n "$dlname"; then
2838 newdlprefiles="$newdlprefiles $dir/$dlname"
2840 newdlprefiles="$newdlprefiles $dir/$linklib"
2842 fi # $pass = dlpreopen
2844 if test -z "$libdir"; then
2845 # Link the convenience library
2846 if test "$linkmode" = lib; then
2847 deplibs="$dir/$old_library $deplibs"
2848 elif test "$linkmode,$pass" = "prog,link"; then
2849 compile_deplibs="$dir/$old_library $compile_deplibs"
2850 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2852 deplibs="$lib $deplibs" # used for prog,scan pass
2858 if test "$linkmode" = prog && test "$pass" != link; then
2859 newlib_search_path="$newlib_search_path $ladir"
2860 deplibs="$lib $deplibs"
2863 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2864 test "$build_libtool_libs" = no; then
2869 for deplib in $dependency_libs; do
2871 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2873 # Need to link against all dependency_libs?
2874 if test "$linkalldeplibs" = yes; then
2875 deplibs="$deplib $deplibs"
2877 # Need to hardcode shared library paths
2878 # or/and link against static libraries
2879 newdependency_libs="$deplib $newdependency_libs"
2881 if test "X$duplicate_deps" = "Xyes" ; then
2882 case "$tmp_libs " in
2883 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2886 tmp_libs="$tmp_libs $deplib"
2889 fi # $linkmode = prog...
2891 if test "$linkmode,$pass" = "prog,link"; then
2892 if test -n "$library_names" &&
2893 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2894 # We need to hardcode the library path
2895 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2896 # Make sure the rpath contains only unique directories.
2897 case "$temp_rpath " in
2900 *) temp_rpath="$temp_rpath $absdir" ;;
2904 # Hardcode the library path.
2905 # Skip directories that are in the system default run-time
2907 case " $sys_lib_dlsearch_path " in
2910 case "$compile_rpath " in
2912 *) compile_rpath="$compile_rpath $absdir"
2916 case " $sys_lib_dlsearch_path " in
2919 case "$finalize_rpath " in
2921 *) finalize_rpath="$finalize_rpath $libdir"
2925 fi # $linkmode,$pass = prog,link...
2927 if test "$alldeplibs" = yes &&
2928 { test "$deplibs_check_method" = pass_all ||
2929 { test "$build_libtool_libs" = yes &&
2930 test -n "$library_names"; }; }; then
2931 # We only need to search for static libraries
2936 link_static=no # Whether the deplib will be linked statically
2937 use_static_libs=$prefer_static_libs
2938 if test "$use_static_libs" = built && test "$installed" = yes ; then
2941 if test -n "$library_names" &&
2942 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2943 if test "$installed" = no; then
2944 notinst_deplibs="$notinst_deplibs $lib"
2947 # This is a shared library
2949 # Warn about portability, can't link against -module's on
2950 # some systems (darwin)
2951 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2953 if test "$linkmode" = prog; then
2954 $echo "*** Warning: Linking the executable $output against the loadable module"
2956 $echo "*** Warning: Linking the shared library $output against the loadable module"
2958 $echo "*** $linklib is not portable!"
2960 if test "$linkmode" = lib &&
2961 test "$hardcode_into_libs" = yes; then
2962 # Hardcode the library path.
2963 # Skip directories that are in the system default run-time
2965 case " $sys_lib_dlsearch_path " in
2968 case "$compile_rpath " in
2970 *) compile_rpath="$compile_rpath $absdir"
2974 case " $sys_lib_dlsearch_path " in
2977 case "$finalize_rpath " in
2979 *) finalize_rpath="$finalize_rpath $libdir"
2985 if test -n "$old_archive_from_expsyms_cmds"; then
2986 # figure out the soname
2987 set dummy $library_names
2990 libname=`eval \\$echo \"$libname_spec\"`
2991 # use dlname if we got it. it's perfectly good, no?
2992 if test -n "$dlname"; then
2994 elif test -n "$soname_spec"; then
2998 major=`expr $current - $age`
3002 eval soname=\"$soname_spec\"
3007 # Make a new name for the extract_expsyms_cmds to use
3009 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3010 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3012 # If the library has no export list, then create one now
3013 if test -f "$output_objdir/$soname-def"; then :
3015 $show "extracting exported symbol list from \`$soname'"
3016 save_ifs="$IFS"; IFS='~'
3017 cmds=$extract_expsyms_cmds
3018 for cmd in $cmds; do
3022 $run eval "$cmd" || exit $?
3028 if test -f "$output_objdir/$newlib"; then :; else
3029 $show "generating import library for \`$soname'"
3030 save_ifs="$IFS"; IFS='~'
3031 cmds=$old_archive_from_expsyms_cmds
3032 for cmd in $cmds; do
3036 $run eval "$cmd" || exit $?
3040 # make sure the library variables are pointing to the new library
3043 fi # test -n "$old_archive_from_expsyms_cmds"
3045 if test "$linkmode" = prog || test "$mode" != relink; then
3050 case $hardcode_action in
3051 immediate | unsupported)
3052 if test "$hardcode_direct" = no; then
3055 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3056 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3057 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3058 *-*-unixware7*) add_dir="-L$dir" ;;
3060 # if the lib is a module then we can not link against
3061 # it, someone is ignoring the new warnings I added
3062 if /usr/bin/file -L $add 2> /dev/null |
3063 $EGREP ": [^:]* bundle" >/dev/null ; then
3064 $echo "** Warning, lib $linklib is a module, not a shared library"
3065 if test -z "$old_library" ; then
3067 $echo "** And there doesn't seem to be a static archive available"
3068 $echo "** The link will probably fail, sorry"
3070 add="$dir/$old_library"
3074 elif test "$hardcode_minus_L" = no; then
3076 *-*-sunos*) add_shlibpath="$dir" ;;
3080 elif test "$hardcode_shlibpath_var" = no; then
3081 add_shlibpath="$dir"
3088 if test "$hardcode_direct" = yes; then
3090 elif test "$hardcode_minus_L" = yes; then
3092 # Try looking first in the location we're being installed to.
3093 if test -n "$inst_prefix_dir"; then
3096 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3101 elif test "$hardcode_shlibpath_var" = yes; then
3102 add_shlibpath="$dir"
3111 if test "$lib_linked" != yes; then
3112 $echo "$modename: configuration error: unsupported hardcode properties"
3116 if test -n "$add_shlibpath"; then
3117 case :$compile_shlibpath: in
3118 *":$add_shlibpath:"*) ;;
3119 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3122 if test "$linkmode" = prog; then
3123 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3124 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3126 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3127 test -n "$add" && deplibs="$add $deplibs"
3128 if test "$hardcode_direct" != yes && \
3129 test "$hardcode_minus_L" != yes && \
3130 test "$hardcode_shlibpath_var" = yes; then
3131 case :$finalize_shlibpath: in
3133 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3139 if test "$linkmode" = prog || test "$mode" = relink; then
3143 # Finalize command for both is simple: just hardcode it.
3144 if test "$hardcode_direct" = yes; then
3145 add="$libdir/$linklib"
3146 elif test "$hardcode_minus_L" = yes; then
3149 elif test "$hardcode_shlibpath_var" = yes; then
3150 case :$finalize_shlibpath: in
3152 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3155 elif test "$hardcode_automatic" = yes; then
3156 if test -n "$inst_prefix_dir" &&
3157 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3158 add="$inst_prefix_dir$libdir/$linklib"
3160 add="$libdir/$linklib"
3163 # We cannot seem to hardcode it, guess we'll fake it.
3165 # Try looking first in the location we're being installed to.
3166 if test -n "$inst_prefix_dir"; then
3169 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3176 if test "$linkmode" = prog; then
3177 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3178 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3180 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3181 test -n "$add" && deplibs="$add $deplibs"
3184 elif test "$linkmode" = prog; then
3185 # Here we assume that one of hardcode_direct or hardcode_minus_L
3186 # is not unsupported. This is valid on all known static and
3188 if test "$hardcode_direct" != unsupported; then
3189 test -n "$old_library" && linklib="$old_library"
3190 compile_deplibs="$dir/$linklib $compile_deplibs"
3191 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3193 compile_deplibs="-l$name -L$dir $compile_deplibs"
3194 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3196 elif test "$build_libtool_libs" = yes; then
3197 # Not a shared library
3198 if test "$deplibs_check_method" != pass_all; then
3199 # We're trying link a shared library against a static one
3200 # but the system doesn't support it.
3202 # Just print a warning and add the library to dependency_libs so
3203 # that the program can be linked against the static library.
3205 $echo "*** Warning: This system can not link to static lib archive $lib."
3206 $echo "*** I have the capability to make that library automatically link in when"
3207 $echo "*** you link to this library. But I can only do this if you have a"
3208 $echo "*** shared version of the library, which you do not appear to have."
3209 if test "$module" = yes; then
3210 $echo "*** But as you try to build a module library, libtool will still create "
3211 $echo "*** a static module, that should work as long as the dlopening application"
3212 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3213 if test -z "$global_symbol_pipe"; then
3215 $echo "*** However, this would only work if libtool was able to extract symbol"
3216 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3217 $echo "*** not find such a program. So, this module is probably useless."
3218 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3220 if test "$build_old_libs" = no; then
3221 build_libtool_libs=module
3224 build_libtool_libs=no
3228 deplibs="$dir/$old_library $deplibs"
3231 fi # link shared/static library?
3233 if test "$linkmode" = lib; then
3234 if test -n "$dependency_libs" &&
3235 { test "$hardcode_into_libs" != yes ||
3236 test "$build_old_libs" = yes ||
3237 test "$link_static" = yes; }; then
3238 # Extract -R from dependency_libs
3240 for libdir in $dependency_libs; do
3242 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3244 *" $temp_xrpath "*) ;;
3245 *) xrpath="$xrpath $temp_xrpath";;
3247 *) temp_deplibs="$temp_deplibs $libdir";;
3250 dependency_libs="$temp_deplibs"
3253 newlib_search_path="$newlib_search_path $absdir"
3254 # Link against this library
3255 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3256 # ... and its dependency_libs
3258 for deplib in $dependency_libs; do
3259 newdependency_libs="$deplib $newdependency_libs"
3260 if test "X$duplicate_deps" = "Xyes" ; then
3261 case "$tmp_libs " in
3262 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3265 tmp_libs="$tmp_libs $deplib"
3268 if test "$link_all_deplibs" != no; then
3269 # Add the search paths of all dependency libraries
3270 for deplib in $dependency_libs; do
3272 -L*) path="$deplib" ;;
3274 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3275 test "X$dir" = "X$deplib" && dir="."
3276 # We need an absolute path.
3278 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3280 absdir=`cd "$dir" && pwd`
3281 if test -z "$absdir"; then
3282 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3287 if grep "^installed=no" $deplib > /dev/null; then
3288 path="$absdir/$objdir"
3290 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3291 if test -z "$libdir"; then
3292 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3295 if test "$absdir" != "$libdir"; then
3296 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3303 # we do not want to link against static libs,
3304 # but need to link against shared
3305 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3306 if test -n "$deplibrary_names" ; then
3307 for tmp in $deplibrary_names ; do
3310 if test -f "$path/$depdepl" ; then
3311 depdepl="$path/$depdepl"
3313 # do not add paths which are already there
3314 case " $newlib_search_path " in
3316 *) newlib_search_path="$newlib_search_path $path";;
3329 # Again, we only want to link against shared libraries
3330 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3331 for tmp in $newlib_search_path ; do
3332 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3333 eval depdepl="$tmp/lib$tmp_libs.dylib"
3344 case " $deplibs " in
3346 *) deplibs="$path $deplibs" ;;
3348 case " $deplibs " in
3350 *) deplibs="$depdepl $deplibs" ;;
3353 fi # link_all_deplibs != no
3355 done # for deplib in $libs
3356 dependency_libs="$newdependency_libs"
3357 if test "$pass" = dlpreopen; then
3358 # Link the dlpreopened libraries before other libraries
3359 for deplib in $save_deplibs; do
3360 deplibs="$deplib $deplibs"
3363 if test "$pass" != dlopen; then
3364 if test "$pass" != conv; then
3365 # Make sure lib_search_path contains only unique directories.
3367 for dir in $newlib_search_path; do
3368 case "$lib_search_path " in
3370 *) lib_search_path="$lib_search_path $dir" ;;
3376 if test "$linkmode,$pass" != "prog,link"; then
3379 vars="compile_deplibs finalize_deplibs"
3381 for var in $vars dependency_libs; do
3382 # Add libraries to $var in reverse order
3383 eval tmp_libs=\"\$$var\"
3385 for deplib in $tmp_libs; do
3386 # FIXME: Pedantically, this is the right thing to do, so
3387 # that some nasty dependency loop isn't accidentally
3389 #new_libs="$deplib $new_libs"
3390 # Pragmatically, this seems to cause very few problems in
3393 -L*) new_libs="$deplib $new_libs" ;;
3396 # And here is the reason: when a library appears more
3397 # than once as an explicit dependence of a library, or
3398 # is implicitly linked in more than once by the
3399 # compiler, it is considered special, and multiple
3400 # occurrences thereof are not removed. Compare this
3401 # with having the same library being listed as a
3402 # dependency of multiple other libraries: in this case,
3403 # we know (pedantically, we assume) the library does not
3404 # need to be listed more than once, so we keep only the
3405 # last copy. This is not always right, but it is rare
3406 # enough that we require users that really mean to play
3407 # such unportable linking tricks to link the library
3408 # using -Wl,-lname, so that libtool does not consider it
3409 # for duplicate removal.
3410 case " $specialdeplibs " in
3411 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3413 case " $new_libs " in
3415 *) new_libs="$deplib $new_libs" ;;
3423 for deplib in $new_libs; do
3426 case " $tmp_libs " in
3428 *) tmp_libs="$tmp_libs $deplib" ;;
3431 *) tmp_libs="$tmp_libs $deplib" ;;
3434 eval $var=\"$tmp_libs\"
3437 # Last step: remove runtime libs from dependency_libs
3438 # (they stay in deplibs)
3440 for i in $dependency_libs ; do
3441 case " $predeps $postdeps $compiler_lib_search_path " in
3446 if test -n "$i" ; then
3447 tmp_libs="$tmp_libs $i"
3450 dependency_libs=$tmp_libs
3452 if test "$linkmode" = prog; then
3453 dlfiles="$newdlfiles"
3454 dlprefiles="$newdlprefiles"
3459 if test -n "$deplibs"; then
3460 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3463 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3464 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3467 if test -n "$rpath"; then
3468 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3471 if test -n "$xrpath"; then
3472 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3475 if test -n "$vinfo"; then
3476 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3479 if test -n "$release"; then
3480 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3483 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3484 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3487 # Now set the variables for building old libraries.
3488 build_libtool_libs=no
3490 objs="$objs$old_deplibs"
3494 # Make sure we only generate libraries of the form `libNAME.la'.
3497 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3498 eval shared_ext=\"$shrext_cmds\"
3499 eval libname=\"$libname_spec\"
3502 if test "$module" = no; then
3503 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3507 if test "$need_lib_prefix" != no; then
3508 # Add the "lib" prefix for modules if required
3509 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3510 eval shared_ext=\"$shrext_cmds\"
3511 eval libname=\"$libname_spec\"
3513 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3518 if test -n "$objs"; then
3519 if test "$deplibs_check_method" != pass_all; then
3520 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3524 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3525 $echo "*** objects $objs is not portable!"
3526 libobjs="$libobjs $objs"
3530 if test "$dlself" != no; then
3531 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3535 if test "$#" -gt 2; then
3536 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3541 if test -z "$rpath"; then
3542 if test "$build_libtool_libs" = yes; then
3543 # Building a libtool convenience library.
3544 # Some compilers have problems with a `.al' extension so
3545 # convenience libraries should have the same extension an
3546 # archive normally would.
3547 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3548 build_libtool_libs=convenience
3552 if test -n "$vinfo"; then
3553 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3556 if test -n "$release"; then
3557 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3561 # Parse the version information argument.
3562 save_ifs="$IFS"; IFS=':'
3563 set dummy $vinfo 0 0 0
3566 if test -n "$8"; then
3567 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3572 # convert absolute version numbers to libtool ages
3573 # this retains compatibility with .la files and attempts
3574 # to make the code below a bit more comprehensible
3576 case $vinfo_number in
3580 number_revision="$4"
3582 # There are really only two kinds -- those that
3583 # use the current revision as the major version
3584 # and those that subtract age and use age as
3585 # a minor version. But, then there is irix
3586 # which has an extra 1 added just for fun
3588 case $version_type in
3589 darwin|linux|osf|windows)
3590 current=`expr $number_major + $number_minor`
3592 revision="$number_revision"
3594 freebsd-aout|freebsd-elf|sunos)
3595 current="$number_major"
3596 revision="$number_minor"
3600 current=`expr $number_major + $number_minor - 1`
3602 revision="$number_minor"
3613 # Check that each of the things are valid numbers.
3615 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3617 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3618 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3624 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3626 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3627 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3633 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3635 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3636 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3641 if test "$age" -gt "$current"; then
3642 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3643 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3647 # Calculate the version variables.
3651 case $version_type in
3655 # Like Linux, but with the current version available in
3656 # verstring for coding it into the library header
3657 major=.`expr $current - $age`
3658 versuffix="$major.$age.$revision"
3659 # Darwin ld doesn't like 0 for these options...
3660 minor_current=`expr $current + 1`
3661 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3666 versuffix=".$current.$revision";
3671 versuffix=".$current";
3675 major=`expr $current - $age + 1`
3677 case $version_type in
3678 nonstopux) verstring_prefix=nonstopux ;;
3679 *) verstring_prefix=sgi ;;
3681 verstring="$verstring_prefix$major.$revision"
3683 # Add in all the interfaces that we are compatible with.
3685 while test "$loop" -ne 0; do
3686 iface=`expr $revision - $loop`
3687 loop=`expr $loop - 1`
3688 verstring="$verstring_prefix$major.$iface:$verstring"
3691 # Before this point, $major must not contain `.'.
3693 versuffix="$major.$revision"
3697 major=.`expr $current - $age`
3698 versuffix="$major.$age.$revision"
3702 major=.`expr $current - $age`
3703 versuffix=".$current.$age.$revision"
3704 verstring="$current.$age.$revision"
3706 # Add in all the interfaces that we are compatible with.
3708 while test "$loop" -ne 0; do
3709 iface=`expr $current - $loop`
3710 loop=`expr $loop - 1`
3711 verstring="$verstring:${iface}.0"
3714 # Make executables depend on our current version.
3715 verstring="$verstring:${current}.0"
3720 versuffix=".$current.$revision"
3724 # Use '-' rather than '.', since we only want one
3725 # extension on DOS 8.3 filesystems.
3726 major=`expr $current - $age`
3731 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3732 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3737 # Clear the version info if we defaulted, and they specified a release.
3738 if test -z "$vinfo" && test -n "$release"; then
3740 case $version_type in
3742 # we can't check for "0.0" in archive_cmds due to quoting
3743 # problems, so we reset it completely
3750 if test "$need_version" = no; then
3757 # Remove version info from name if versioning should be avoided
3758 if test "$avoid_version" = yes && test "$need_version" = no; then
3764 # Check to see if the archive will have undefined symbols.
3765 if test "$allow_undefined" = yes; then
3766 if test "$allow_undefined_flag" = unsupported; then
3767 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3768 build_libtool_libs=no
3772 # Don't allow undefined symbols.
3773 allow_undefined_flag="$no_undefined_flag"
3777 if test "$mode" != relink; then
3778 # Remove our outputs, but don't remove object files since they
3779 # may have been created when compiling PIC objects.
3781 tempremovelist=`$echo "$output_objdir/*"`
3782 for p in $tempremovelist; do
3786 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3787 if test "X$precious_files_regex" != "X"; then
3788 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3793 removelist="$removelist $p"
3798 if test -n "$removelist"; then
3799 $show "${rm}r $removelist"
3800 $run ${rm}r $removelist
3804 # Now set the variables for building old libraries.
3805 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3806 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3808 # Transform .lo files to .o files.
3809 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3812 # Eliminate all temporary directories.
3813 for path in $notinst_path; do
3814 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3815 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3816 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3819 if test -n "$xrpath"; then
3820 # If the user specified any rpath flags, then add them.
3822 for libdir in $xrpath; do
3823 temp_xrpath="$temp_xrpath -R$libdir"
3824 case "$finalize_rpath " in
3826 *) finalize_rpath="$finalize_rpath $libdir" ;;
3829 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3830 dependency_libs="$temp_xrpath $dependency_libs"
3834 # Make sure dlfiles contains only unique files that won't be dlpreopened
3835 old_dlfiles="$dlfiles"
3837 for lib in $old_dlfiles; do
3838 case " $dlprefiles $dlfiles " in
3840 *) dlfiles="$dlfiles $lib" ;;
3844 # Make sure dlprefiles contains only unique files
3845 old_dlprefiles="$dlprefiles"
3847 for lib in $old_dlprefiles; do
3848 case "$dlprefiles " in
3850 *) dlprefiles="$dlprefiles $lib" ;;
3854 if test "$build_libtool_libs" = yes; then
3855 if test -n "$rpath"; then
3857 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3858 # these systems don't actually have a c library (as such)!
3860 *-*-rhapsody* | *-*-darwin1.[012])
3861 # Rhapsody C library is in the System framework
3862 deplibs="$deplibs -framework System"
3865 # Don't link with libc until the a.out ld.so is fixed.
3867 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3868 # Do not include libc due to us having libc/libc_r.
3870 *-*-sco3.2v5* | *-*-sco5v6*)
3871 # Causes problems with __ctype
3873 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3874 # Compiler inserts libc in the correct place for threads to work
3877 # Add libc to deplibs on all other systems if necessary.
3878 if test "$build_libtool_need_lc" = "yes"; then
3879 deplibs="$deplibs -lc"
3885 # Transform deplibs into only deplibs that can be linked in shared.
3887 libname_save=$libname
3888 release_save=$release
3889 versuffix_save=$versuffix
3891 # I'm not sure if I'm treating the release correctly. I think
3892 # release should show up in the -l (ie -lgmp5) so we don't want to
3893 # add it in twice. Is that correct?
3899 case $deplibs_check_method in
3901 # Don't check for shared/static. Everything works.
3902 # This might be a little naive. We might want to check
3903 # whether the library exists or not. But this is on
3904 # osf3 & osf4 and I'm not really sure... Just
3905 # implementing what was already the behavior.
3909 # This code stresses the "libraries are programs" paradigm to its
3910 # limits. Maybe even breaks it. We compile a program, linking it
3911 # against the deplibs as a proxy for the library. Then we can check
3912 # whether they linked in statically or dynamically with ldd.
3914 cat > conftest.c <<EOF
3915 int main() { return 0; }
3918 $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3919 if test "$?" -eq 0 ; then
3920 ldd_output=`ldd conftest`
3921 for i in $deplibs; do
3922 name=`expr $i : '-l\(.*\)'`
3923 # If $name is empty we are operating on a -L argument.
3924 if test "$name" != "" && test "$name" -ne "0"; then
3925 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3926 case " $predeps $postdeps " in
3928 newdeplibs="$newdeplibs $i"
3933 if test -n "$i" ; then
3934 libname=`eval \\$echo \"$libname_spec\"`
3935 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3936 set dummy $deplib_matches
3938 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3939 newdeplibs="$newdeplibs $i"
3943 $echo "*** Warning: dynamic linker does not accept needed library $i."
3944 $echo "*** I have the capability to make that library automatically link in when"
3945 $echo "*** you link to this library. But I can only do this if you have a"
3946 $echo "*** shared version of the library, which I believe you do not have"
3947 $echo "*** because a test_compile did reveal that the linker did not use it for"
3948 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3952 newdeplibs="$newdeplibs $i"
3956 # Error occurred in the first compile. Let's try to salvage
3957 # the situation: Compile a separate program for each library.
3958 for i in $deplibs; do
3959 name=`expr $i : '-l\(.*\)'`
3960 # If $name is empty we are operating on a -L argument.
3961 if test "$name" != "" && test "$name" != "0"; then
3963 $LTCC $LTCFLAGS -o conftest conftest.c $i
3965 if test "$?" -eq 0 ; then
3966 ldd_output=`ldd conftest`
3967 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3968 case " $predeps $postdeps " in
3970 newdeplibs="$newdeplibs $i"
3975 if test -n "$i" ; then
3976 libname=`eval \\$echo \"$libname_spec\"`
3977 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3978 set dummy $deplib_matches
3980 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3981 newdeplibs="$newdeplibs $i"
3985 $echo "*** Warning: dynamic linker does not accept needed library $i."
3986 $echo "*** I have the capability to make that library automatically link in when"
3987 $echo "*** you link to this library. But I can only do this if you have a"
3988 $echo "*** shared version of the library, which you do not appear to have"
3989 $echo "*** because a test_compile did reveal that the linker did not use this one"
3990 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3996 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3997 $echo "*** make it link in! You will probably need to install it or some"
3998 $echo "*** library that it depends on before this library will be fully"
3999 $echo "*** functional. Installing it before continuing would be even better."
4002 newdeplibs="$newdeplibs $i"
4008 set dummy $deplibs_check_method
4009 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4010 for a_deplib in $deplibs; do
4011 name=`expr $a_deplib : '-l\(.*\)'`
4012 # If $name is empty we are operating on a -L argument.
4013 if test "$name" != "" && test "$name" != "0"; then
4014 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4015 case " $predeps $postdeps " in
4017 newdeplibs="$newdeplibs $a_deplib"
4022 if test -n "$a_deplib" ; then
4023 libname=`eval \\$echo \"$libname_spec\"`
4024 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4025 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4026 for potent_lib in $potential_libs; do
4027 # Follow soft links.
4028 if ls -lLd "$potent_lib" 2>/dev/null \
4029 | grep " -> " >/dev/null; then
4032 # The statement above tries to avoid entering an
4033 # endless loop below, in case of cyclic links.
4034 # We might still enter an endless loop, since a link
4035 # loop can be closed while we follow links,
4037 potlib="$potent_lib"
4038 while test -h "$potlib" 2>/dev/null; do
4039 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4041 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4042 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4045 # It is ok to link against an archive when
4046 # building a shared library.
4047 if $AR -t $potlib > /dev/null 2>&1; then
4048 newdeplibs="$newdeplibs $a_deplib"
4052 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4054 | $EGREP "$file_magic_regex" > /dev/null; then
4055 newdeplibs="$newdeplibs $a_deplib"
4062 if test -n "$a_deplib" ; then
4065 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4066 $echo "*** I have the capability to make that library automatically link in when"
4067 $echo "*** you link to this library. But I can only do this if you have a"
4068 $echo "*** shared version of the library, which you do not appear to have"
4069 $echo "*** because I did check the linker path looking for a file starting"
4070 if test -z "$potlib" ; then
4071 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4073 $echo "*** with $libname and none of the candidates passed a file format test"
4074 $echo "*** using a file magic. Last file checked: $potlib"
4078 # Add a -L argument.
4079 newdeplibs="$newdeplibs $a_deplib"
4081 done # Gone through all deplibs.
4084 set dummy $deplibs_check_method
4085 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4086 for a_deplib in $deplibs; do
4087 name=`expr $a_deplib : '-l\(.*\)'`
4088 # If $name is empty we are operating on a -L argument.
4089 if test -n "$name" && test "$name" != "0"; then
4090 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4091 case " $predeps $postdeps " in
4093 newdeplibs="$newdeplibs $a_deplib"
4098 if test -n "$a_deplib" ; then
4099 libname=`eval \\$echo \"$libname_spec\"`
4100 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4101 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4102 for potent_lib in $potential_libs; do
4103 potlib="$potent_lib" # see symlink-check above in file_magic test
4104 if eval $echo \"$potent_lib\" 2>/dev/null \
4106 | $EGREP "$match_pattern_regex" > /dev/null; then
4107 newdeplibs="$newdeplibs $a_deplib"
4114 if test -n "$a_deplib" ; then
4117 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4118 $echo "*** I have the capability to make that library automatically link in when"
4119 $echo "*** you link to this library. But I can only do this if you have a"
4120 $echo "*** shared version of the library, which you do not appear to have"
4121 $echo "*** because I did check the linker path looking for a file starting"
4122 if test -z "$potlib" ; then
4123 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4125 $echo "*** with $libname and none of the candidates passed a file format test"
4126 $echo "*** using a regex pattern. Last file checked: $potlib"
4130 # Add a -L argument.
4131 newdeplibs="$newdeplibs $a_deplib"
4133 done # Gone through all deplibs.
4137 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4138 -e 's/ -[LR][^ ]*//g'`
4139 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4140 for i in $predeps $postdeps ; do
4141 # can't use Xsed below, because $i might contain '/'
4142 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4145 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4146 | grep . >/dev/null; then
4148 if test "X$deplibs_check_method" = "Xnone"; then
4149 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4151 $echo "*** Warning: inter-library dependencies are not known to be supported."
4153 $echo "*** All declared inter-library dependencies are being dropped."
4158 versuffix=$versuffix_save
4160 release=$release_save
4161 libname=$libname_save
4165 *-*-rhapsody* | *-*-darwin1.[012])
4166 # On Rhapsody replace the C library is the System framework
4167 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4171 if test "$droppeddeps" = yes; then
4172 if test "$module" = yes; then
4174 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4175 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4176 $echo "*** a static module, that should work as long as the dlopening"
4177 $echo "*** application is linked with the -dlopen flag."
4178 if test -z "$global_symbol_pipe"; then
4180 $echo "*** However, this would only work if libtool was able to extract symbol"
4181 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4182 $echo "*** not find such a program. So, this module is probably useless."
4183 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4185 if test "$build_old_libs" = no; then
4186 oldlibs="$output_objdir/$libname.$libext"
4187 build_libtool_libs=module
4190 build_libtool_libs=no
4193 $echo "*** The inter-library dependencies that have been dropped here will be"
4194 $echo "*** automatically added whenever a program is linked with this library"
4195 $echo "*** or is declared to -dlopen it."
4197 if test "$allow_undefined" = no; then
4199 $echo "*** Since this library must not contain undefined symbols,"
4200 $echo "*** because either the platform does not support them or"
4201 $echo "*** it was explicitly requested with -no-undefined,"
4202 $echo "*** libtool will only create a static version of it."
4203 if test "$build_old_libs" = no; then
4204 oldlibs="$output_objdir/$libname.$libext"
4205 build_libtool_libs=module
4208 build_libtool_libs=no
4213 # Done checking deplibs!
4218 # move library search paths that coincide with paths to not yet
4219 # installed libraries to the beginning of the library search list
4221 for path in $notinst_path; do
4222 case " $new_libs " in
4223 *" -L$path/$objdir "*) ;;
4225 case " $deplibs " in
4226 *" -L$path/$objdir "*)
4227 new_libs="$new_libs -L$path/$objdir" ;;
4232 for deplib in $deplibs; do
4235 case " $new_libs " in
4237 *) new_libs="$new_libs $deplib" ;;
4240 *) new_libs="$new_libs $deplib" ;;
4246 # All the library-specific variables (install_libdir is set above).
4251 # Test again, we may have decided not to build it any more
4252 if test "$build_libtool_libs" = yes; then
4253 if test "$hardcode_into_libs" = yes; then
4254 # Hardcode the library paths
4257 rpath="$finalize_rpath"
4258 test "$mode" != relink && rpath="$compile_rpath$rpath"
4259 for libdir in $rpath; do
4260 if test -n "$hardcode_libdir_flag_spec"; then
4261 if test -n "$hardcode_libdir_separator"; then
4262 if test -z "$hardcode_libdirs"; then
4263 hardcode_libdirs="$libdir"
4265 # Just accumulate the unique libdirs.
4266 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4267 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4270 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4275 eval flag=\"$hardcode_libdir_flag_spec\"
4276 dep_rpath="$dep_rpath $flag"
4278 elif test -n "$runpath_var"; then
4279 case "$perm_rpath " in
4281 *) perm_rpath="$perm_rpath $libdir" ;;
4285 # Substitute the hardcoded libdirs into the rpath.
4286 if test -n "$hardcode_libdir_separator" &&
4287 test -n "$hardcode_libdirs"; then
4288 libdir="$hardcode_libdirs"
4289 if test -n "$hardcode_libdir_flag_spec_ld"; then
4290 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4292 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4295 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4296 # We should set the runpath_var.
4298 for dir in $perm_rpath; do
4301 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4303 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4306 shlibpath="$finalize_shlibpath"
4307 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4308 if test -n "$shlibpath"; then
4309 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4312 # Get the real and link names of the library.
4313 eval shared_ext=\"$shrext_cmds\"
4314 eval library_names=\"$library_names_spec\"
4315 set dummy $library_names
4319 if test -n "$soname_spec"; then
4320 eval soname=\"$soname_spec\"
4324 if test -z "$dlname"; then
4328 lib="$output_objdir/$realname"
4332 linknames="$linknames $link"
4335 # Use standard objects if they are pic
4336 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4338 # Prepare the list of exported symbols
4339 if test -z "$export_symbols"; then
4340 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4341 $show "generating symbol list for \`$libname.la'"
4342 export_symbols="$output_objdir/$libname.exp"
4343 $run $rm $export_symbols
4344 cmds=$export_symbols_cmds
4345 save_ifs="$IFS"; IFS='~'
4346 for cmd in $cmds; do
4349 if len=`expr "X$cmd" : ".*"` &&
4350 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4352 $run eval "$cmd" || exit $?
4353 skipped_export=false
4355 # The command line is too long to execute in one step.
4356 $show "using reloadable object file for export list..."
4358 # Break out early, otherwise skipped_export may be
4359 # set to false by a later but shorter cmd.
4364 if test -n "$export_symbols_regex"; then
4365 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4366 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4367 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4368 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4373 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4374 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4378 for test_deplib in $deplibs; do
4379 case " $convenience " in
4380 *" $test_deplib "*) ;;
4382 tmp_deplibs="$tmp_deplibs $test_deplib"
4386 deplibs="$tmp_deplibs"
4388 if test -n "$convenience"; then
4389 if test -n "$whole_archive_flag_spec"; then
4390 save_libobjs=$libobjs
4391 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4393 gentop="$output_objdir/${outputname}x"
4394 generated="$generated $gentop"
4396 func_extract_archives $gentop $convenience
4397 libobjs="$libobjs $func_extract_archives_result"
4401 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4402 eval flag=\"$thread_safe_flag_spec\"
4403 linker_flags="$linker_flags $flag"
4406 # Make a backup of the uninstalled library when relinking
4407 if test "$mode" = relink; then
4408 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4411 # Do each of the archive commands.
4412 if test "$module" = yes && test -n "$module_cmds" ; then
4413 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4414 eval test_cmds=\"$module_expsym_cmds\"
4415 cmds=$module_expsym_cmds
4417 eval test_cmds=\"$module_cmds\"
4421 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4422 eval test_cmds=\"$archive_expsym_cmds\"
4423 cmds=$archive_expsym_cmds
4425 eval test_cmds=\"$archive_cmds\"
4430 if test "X$skipped_export" != "X:" &&
4431 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4432 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4435 # The command line is too long to link in one step, link piecewise.
4436 $echo "creating reloadable object files..."
4438 # Save the value of $output and $libobjs because we want to
4439 # use them later. If we have whole_archive_flag_spec, we
4440 # want to use save_libobjs as it was before
4441 # whole_archive_flag_spec was expanded, because we can't
4442 # assume the linker understands whole_archive_flag_spec.
4443 # This may have to be revisited, in case too many
4444 # convenience libraries get linked in and end up exceeding
4446 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4447 save_libobjs=$libobjs
4450 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4452 # Clear the reloadable object creation command queue and
4453 # initialize k to one.
4460 output=$output_objdir/$output_la-${k}.$objext
4461 # Loop over the list of objects to be linked.
4462 for obj in $save_libobjs
4464 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4465 if test "X$objlist" = X ||
4466 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4467 test "$len" -le "$max_cmd_len"; }; then
4468 objlist="$objlist $obj"
4470 # The command $test_cmds is almost too long, add a
4471 # command to the queue.
4472 if test "$k" -eq 1 ; then
4473 # The first file doesn't have a previous command to add.
4474 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4476 # All subsequent reloadable object files will link in
4477 # the last one created.
4478 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4480 last_robj=$output_objdir/$output_la-${k}.$objext
4482 output=$output_objdir/$output_la-${k}.$objext
4487 # Handle the remaining objects by creating one last
4488 # reloadable object file. All subsequent reloadable object
4489 # files will link in the last one created.
4490 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4491 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4493 if ${skipped_export-false}; then
4494 $show "generating symbol list for \`$libname.la'"
4495 export_symbols="$output_objdir/$libname.exp"
4496 $run $rm $export_symbols
4498 # Append the command to create the export file.
4499 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4502 # Set up a command to remove the reloadable object files
4503 # after they are used.
4505 while test "$i" -lt "$k"
4508 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4511 $echo "creating a temporary reloadable object file: $output"
4513 # Loop through the commands generated above and execute them.
4514 save_ifs="$IFS"; IFS='~'
4515 for cmd in $concat_cmds; do
4518 $run eval "$cmd" || exit $?
4523 # Restore the value of output.
4526 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4527 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4529 # Expand the library linking commands again to reset the
4530 # value of $libobjs for piecewise linking.
4532 # Do each of the archive commands.
4533 if test "$module" = yes && test -n "$module_cmds" ; then
4534 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4535 cmds=$module_expsym_cmds
4540 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4541 cmds=$archive_expsym_cmds
4547 # Append the command to remove the reloadable object files
4548 # to the just-reset $cmds.
4549 eval cmds=\"\$cmds~\$rm $delfiles\"
4551 save_ifs="$IFS"; IFS='~'
4552 for cmd in $cmds; do
4556 $run eval "$cmd" || {
4559 # Restore the uninstalled library and exit
4560 if test "$mode" = relink; then
4561 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4569 # Restore the uninstalled library and exit
4570 if test "$mode" = relink; then
4571 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4573 if test -n "$convenience"; then
4574 if test -z "$whole_archive_flag_spec"; then
4575 $show "${rm}r $gentop"
4576 $run ${rm}r "$gentop"
4583 # Create links to the real library.
4584 for linkname in $linknames; do
4585 if test "$realname" != "$linkname"; then
4586 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4587 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4591 # If -module or -export-dynamic was specified, set the dlname.
4592 if test "$module" = yes || test "$export_dynamic" = yes; then
4593 # On all known operating systems, these are identical.
4600 if test -n "$deplibs"; then
4601 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4604 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4605 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4608 if test -n "$rpath"; then
4609 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4612 if test -n "$xrpath"; then
4613 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4616 if test -n "$vinfo"; then
4617 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4620 if test -n "$release"; then
4621 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4626 if test -n "$objs$old_deplibs"; then
4627 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4631 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4639 # Delete the old objects.
4640 $run $rm $obj $libobj
4642 # Objects from convenience libraries. This assumes
4643 # single-version convenience libraries. Whenever we create
4644 # different ones for PIC/non-PIC, this we'll have to duplicate
4648 # reload_cmds runs $LD directly, so let us get rid of
4649 # -Wl from whole_archive_flag_spec
4652 if test -n "$convenience"; then
4653 if test -n "$whole_archive_flag_spec"; then
4654 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4656 gentop="$output_objdir/${obj}x"
4657 generated="$generated $gentop"
4659 func_extract_archives $gentop $convenience
4660 reload_conv_objs="$reload_objs $func_extract_archives_result"
4664 # Create the old-style object.
4665 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
4669 save_ifs="$IFS"; IFS='~'
4670 for cmd in $cmds; do
4674 $run eval "$cmd" || exit $?
4678 # Exit if we aren't doing a library object file.
4679 if test -z "$libobj"; then
4680 if test -n "$gentop"; then
4681 $show "${rm}r $gentop"
4688 if test "$build_libtool_libs" != yes; then
4689 if test -n "$gentop"; then
4690 $show "${rm}r $gentop"
4694 # Create an invalid libtool object if no PIC, so that we don't
4695 # accidentally link it into a program.
4696 # $show "echo timestamp > $libobj"
4697 # $run eval "echo timestamp > $libobj" || exit $?
4701 if test -n "$pic_flag" || test "$pic_mode" != default; then
4702 # Only do commands if we really have different PIC objects.
4703 reload_objs="$libobjs $reload_conv_objs"
4706 save_ifs="$IFS"; IFS='~'
4707 for cmd in $cmds; do
4711 $run eval "$cmd" || exit $?
4716 if test -n "$gentop"; then
4717 $show "${rm}r $gentop"
4726 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4728 if test -n "$vinfo"; then
4729 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4732 if test -n "$release"; then
4733 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4736 if test "$preload" = yes; then
4737 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4738 test "$dlopen_self_static" = unknown; then
4739 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4744 *-*-rhapsody* | *-*-darwin1.[012])
4745 # On Rhapsody replace the C library is the System framework
4746 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4747 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4753 # Don't allow lazy linking, it breaks C++ global constructors
4754 if test "$tagname" = CXX ; then
4755 compile_command="$compile_command ${wl}-bind_at_load"
4756 finalize_command="$finalize_command ${wl}-bind_at_load"
4762 # move library search paths that coincide with paths to not yet
4763 # installed libraries to the beginning of the library search list
4765 for path in $notinst_path; do
4766 case " $new_libs " in
4767 *" -L$path/$objdir "*) ;;
4769 case " $compile_deplibs " in
4770 *" -L$path/$objdir "*)
4771 new_libs="$new_libs -L$path/$objdir" ;;
4776 for deplib in $compile_deplibs; do
4779 case " $new_libs " in
4781 *) new_libs="$new_libs $deplib" ;;
4784 *) new_libs="$new_libs $deplib" ;;
4787 compile_deplibs="$new_libs"
4790 compile_command="$compile_command $compile_deplibs"
4791 finalize_command="$finalize_command $finalize_deplibs"
4793 if test -n "$rpath$xrpath"; then
4794 # If the user specified any rpath flags, then add them.
4795 for libdir in $rpath $xrpath; do
4796 # This is the magic to use -rpath.
4797 case "$finalize_rpath " in
4799 *) finalize_rpath="$finalize_rpath $libdir" ;;
4804 # Now hardcode the library paths
4807 for libdir in $compile_rpath $finalize_rpath; do
4808 if test -n "$hardcode_libdir_flag_spec"; then
4809 if test -n "$hardcode_libdir_separator"; then
4810 if test -z "$hardcode_libdirs"; then
4811 hardcode_libdirs="$libdir"
4813 # Just accumulate the unique libdirs.
4814 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4815 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4818 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4823 eval flag=\"$hardcode_libdir_flag_spec\"
4824 rpath="$rpath $flag"
4826 elif test -n "$runpath_var"; then
4827 case "$perm_rpath " in
4829 *) perm_rpath="$perm_rpath $libdir" ;;
4833 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4834 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4835 case :$dllsearchpath: in
4837 *) dllsearchpath="$dllsearchpath:$libdir";;
4839 case :$dllsearchpath: in
4840 *":$testbindir:"*) ;;
4841 *) dllsearchpath="$dllsearchpath:$testbindir";;
4846 # Substitute the hardcoded libdirs into the rpath.
4847 if test -n "$hardcode_libdir_separator" &&
4848 test -n "$hardcode_libdirs"; then
4849 libdir="$hardcode_libdirs"
4850 eval rpath=\" $hardcode_libdir_flag_spec\"
4852 compile_rpath="$rpath"
4856 for libdir in $finalize_rpath; do
4857 if test -n "$hardcode_libdir_flag_spec"; then
4858 if test -n "$hardcode_libdir_separator"; then
4859 if test -z "$hardcode_libdirs"; then
4860 hardcode_libdirs="$libdir"
4862 # Just accumulate the unique libdirs.
4863 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4864 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4867 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4872 eval flag=\"$hardcode_libdir_flag_spec\"
4873 rpath="$rpath $flag"
4875 elif test -n "$runpath_var"; then
4876 case "$finalize_perm_rpath " in
4878 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4882 # Substitute the hardcoded libdirs into the rpath.
4883 if test -n "$hardcode_libdir_separator" &&
4884 test -n "$hardcode_libdirs"; then
4885 libdir="$hardcode_libdirs"
4886 eval rpath=\" $hardcode_libdir_flag_spec\"
4888 finalize_rpath="$rpath"
4890 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4891 # Transform all the library objects into standard objects.
4892 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4893 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4897 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4898 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4899 dlsyms="${outputname}S.c"
4901 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4905 if test -n "$dlsyms"; then
4909 # Discover the nlist of each of the dlfiles.
4910 nlist="$output_objdir/${outputname}.nm"
4912 $show "$rm $nlist ${nlist}S ${nlist}T"
4913 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4915 # Parse the name list into a source file.
4916 $show "creating $output_objdir/$dlsyms"
4918 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4919 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4920 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4926 /* Prevent the only kind of declaration conflicts we can make. */
4927 #define lt_preloaded_symbols some_other_symbol
4929 /* External symbol declarations for the compiler. */\
4932 if test "$dlself" = yes; then
4933 $show "generating symbol list for \`$output'"
4935 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4937 # Add our own program objects to the symbol list.
4938 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4939 for arg in $progfiles; do
4940 $show "extracting global C symbols from \`$arg'"
4941 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4944 if test -n "$exclude_expsyms"; then
4945 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4946 $run eval '$mv "$nlist"T "$nlist"'
4949 if test -n "$export_symbols_regex"; then
4950 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4951 $run eval '$mv "$nlist"T "$nlist"'
4954 # Prepare the list of exported symbols
4955 if test -z "$export_symbols"; then
4956 export_symbols="$output_objdir/$outputname.exp"
4957 $run $rm $export_symbols
4958 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4960 *cygwin* | *mingw* )
4961 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4962 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4966 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4967 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4968 $run eval 'mv "$nlist"T "$nlist"'
4970 *cygwin* | *mingw* )
4971 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4972 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4978 for arg in $dlprefiles; do
4979 $show "extracting global C symbols from \`$arg'"
4980 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4981 $run eval '$echo ": $name " >> "$nlist"'
4982 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4985 if test -z "$run"; then
4986 # Make sure we have at least an empty file.
4987 test -f "$nlist" || : > "$nlist"
4989 if test -n "$exclude_expsyms"; then
4990 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4991 $mv "$nlist"T "$nlist"
4994 # Try sorting and uniquifying the output.
4995 if grep -v "^: " < "$nlist" |
4996 if sort -k 3 </dev/null >/dev/null 2>&1; then
5001 uniq > "$nlist"S; then
5004 grep -v "^: " < "$nlist" > "$nlist"S
5007 if test -f "$nlist"S; then
5008 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5010 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5013 $echo >> "$output_objdir/$dlsyms" "\
5015 #undef lt_preloaded_symbols
5017 #if defined (__STDC__) && __STDC__
5018 # define lt_ptr void *
5020 # define lt_ptr char *
5024 /* The mapping between symbol names and symbols. */
5028 *cygwin* | *mingw* )
5029 $echo >> "$output_objdir/$dlsyms" "\
5030 /* DATA imports from DLLs on WIN32 can't be const, because
5031 runtime relocations are performed -- see ld's documentation
5037 $echo >> "$output_objdir/$dlsyms" "\
5044 $echo >> "$output_objdir/$dlsyms" "\
5048 lt_preloaded_symbols[] =
5052 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5054 $echo >> "$output_objdir/$dlsyms" "\
5058 /* This works around a problem in FreeBSD linker */
5059 #ifdef FREEBSD_WORKAROUND
5060 static const void *lt_preloaded_setup() {
5061 return lt_preloaded_symbols;
5071 pic_flag_for_symtable=
5073 # compiling the symbol table file with pic_flag works around
5074 # a FreeBSD bug that causes programs to crash when -lm is
5075 # linked before any other PIC object. But we must not use
5076 # pic_flag when linking with -static. The problem exists in
5077 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5078 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5079 case "$compile_command " in
5081 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5084 case "$compile_command " in
5086 *) pic_flag_for_symtable=" $pic_flag";;
5090 # Now compile the dynamic symbol file.
5091 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5092 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5094 # Clean up the generated files.
5095 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5096 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5098 # Transform the symbol file into the correct name.
5100 *cygwin* | *mingw* )
5101 if test -f "$output_objdir/${outputname}.def" ; then
5102 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5103 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
5105 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5106 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5110 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5111 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
5116 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5121 # We keep going just in case the user didn't refer to
5122 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5123 # really was required.
5125 # Nullify the symbol file.
5126 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
5127 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
5130 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5131 # Replace the output file specification.
5132 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5133 link_command="$compile_command$compile_rpath"
5135 # We have no uninstalled library dependencies, so finalize right now.
5136 $show "$link_command"
5137 $run eval "$link_command"
5140 # Delete the generated files.
5141 if test -n "$dlsyms"; then
5142 $show "$rm $output_objdir/${outputname}S.${objext}"
5143 $run $rm "$output_objdir/${outputname}S.${objext}"
5149 if test -n "$shlibpath_var"; then
5150 # We should set the shlibpath_var
5152 for dir in $temp_rpath; do
5154 [\\/]* | [A-Za-z]:[\\/]*)
5159 # Relative path: add a thisdir entry.
5160 rpath="$rpath\$thisdir/$dir:"
5167 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5168 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5170 if test -n "$finalize_shlibpath"; then
5171 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5176 if test -n "$runpath_var"; then
5177 if test -n "$perm_rpath"; then
5178 # We should set the runpath_var.
5180 for dir in $perm_rpath; do
5183 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5185 if test -n "$finalize_perm_rpath"; then
5186 # We should set the runpath_var.
5188 for dir in $finalize_perm_rpath; do
5191 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5195 if test "$no_install" = yes; then
5196 # We don't need to create a wrapper script.
5197 link_command="$compile_var$compile_command$compile_rpath"
5198 # Replace the output file specification.
5199 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5200 # Delete the old output file.
5202 # Link the executable and exit
5203 $show "$link_command"
5204 $run eval "$link_command" || exit $?
5208 if test "$hardcode_action" = relink; then
5209 # Fast installation is not supported
5210 link_command="$compile_var$compile_command$compile_rpath"
5211 relink_command="$finalize_var$finalize_command$finalize_rpath"
5213 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5214 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5216 if test "$fast_install" != no; then
5217 link_command="$finalize_var$compile_command$finalize_rpath"
5218 if test "$fast_install" = yes; then
5219 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
5221 # fast_install is set to needless
5225 link_command="$compile_var$compile_command$compile_rpath"
5226 relink_command="$finalize_var$finalize_command$finalize_rpath"
5230 # Replace the output file specification.
5231 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5233 # Delete the old output files.
5234 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5236 $show "$link_command"
5237 $run eval "$link_command" || exit $?
5239 # Now create the wrapper script.
5240 $show "creating $output"
5242 # Quote the relink command for shipping.
5243 if test -n "$relink_command"; then
5244 # Preserve any variables that may affect compiler behavior
5245 for var in $variables_saved_for_relink; do
5246 if eval test -z \"\${$var+set}\"; then
5247 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5248 elif eval var_value=\$$var; test -z "$var_value"; then
5249 relink_command="$var=; export $var; $relink_command"
5251 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5252 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5255 relink_command="(cd `pwd`; $relink_command)"
5256 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5259 # Quote $echo for shipping.
5260 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5262 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5263 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5265 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5267 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5270 # Only actually do things if our run command is non-null.
5271 if test -z "$run"; then
5272 # win32 will think the script is a binary if it has
5273 # a .exe suffix, so we strip it off here.
5275 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5277 # test for cygwin because mv fails w/o .exe extensions
5281 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5285 *cygwin* | *mingw* )
5286 output_name=`basename $output`
5287 output_path=`dirname $output`
5288 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5289 cwrapper="$output_path/$output_name.exe"
5290 $rm $cwrappersource $cwrapper
5291 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5293 cat > $cwrappersource <<EOF
5295 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5296 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5298 The $output program cannot be directly executed until all the libtool
5299 libraries that it depends on are installed.
5301 This wrapper executable should never be moved out of the build directory.
5302 If it is, it will not operate correctly.
5304 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5305 but could eventually absorb all of the scripts functionality and
5306 exec $objdir/$outputname directly.
5309 cat >> $cwrappersource<<"EOF"
5318 #include <sys/stat.h>
5320 #if defined(PATH_MAX)
5321 # define LT_PATHMAX PATH_MAX
5322 #elif defined(MAXPATHLEN)
5323 # define LT_PATHMAX MAXPATHLEN
5325 # define LT_PATHMAX 1024
5328 #ifndef DIR_SEPARATOR
5329 # define DIR_SEPARATOR '/'
5330 # define PATH_SEPARATOR ':'
5333 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5335 # define HAVE_DOS_BASED_FILE_SYSTEM
5336 # ifndef DIR_SEPARATOR_2
5337 # define DIR_SEPARATOR_2 '\\'
5339 # ifndef PATH_SEPARATOR_2
5340 # define PATH_SEPARATOR_2 ';'
5344 #ifndef DIR_SEPARATOR_2
5345 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5346 #else /* DIR_SEPARATOR_2 */
5347 # define IS_DIR_SEPARATOR(ch) \
5348 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5349 #endif /* DIR_SEPARATOR_2 */
5351 #ifndef PATH_SEPARATOR_2
5352 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5353 #else /* PATH_SEPARATOR_2 */
5354 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5355 #endif /* PATH_SEPARATOR_2 */
5357 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5358 #define XFREE(stale) do { \
5359 if (stale) { free ((void *) stale); stale = 0; } \
5362 /* -DDEBUG is fairly common in CFLAGS. */
5364 #if defined DEBUGWRAPPER
5365 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5367 # define DEBUG(format, ...)
5370 const char *program_name = NULL;
5372 void * xmalloc (size_t num);
5373 char * xstrdup (const char *string);
5374 const char * base_name (const char *name);
5375 char * find_executable(const char *wrapper);
5376 int check_executable(const char *path);
5377 char * strendzap(char *str, const char *pat);
5378 void lt_fatal (const char *message, ...);
5381 main (int argc, char *argv[])
5386 program_name = (char *) xstrdup (base_name (argv[0]));
5387 DEBUG("(main) argv[0] : %s\n",argv[0]);
5388 DEBUG("(main) program_name : %s\n",program_name);
5389 newargz = XMALLOC(char *, argc+2);
5392 cat >> $cwrappersource <<EOF
5393 newargz[0] = (char *) xstrdup("$SHELL");
5396 cat >> $cwrappersource <<"EOF"
5397 newargz[1] = find_executable(argv[0]);
5398 if (newargz[1] == NULL)
5399 lt_fatal("Couldn't find %s", argv[0]);
5400 DEBUG("(main) found exe at : %s\n",newargz[1]);
5401 /* we know the script has the same name, without the .exe */
5402 /* so make sure newargz[1] doesn't end in .exe */
5403 strendzap(newargz[1],".exe");
5404 for (i = 1; i < argc; i++)
5405 newargz[i+1] = xstrdup(argv[i]);
5406 newargz[argc+1] = NULL;
5408 for (i=0; i<argc+1; i++)
5410 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5418 cat >> $cwrappersource <<EOF
5419 execv("$SHELL",(char const **)newargz);
5423 cat >> $cwrappersource <<EOF
5424 execv("$SHELL",newargz);
5429 cat >> $cwrappersource <<"EOF"
5434 xmalloc (size_t num)
5436 void * p = (void *) malloc (num);
5438 lt_fatal ("Memory exhausted");
5444 xstrdup (const char *string)
5446 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5451 base_name (const char *name)
5455 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5456 /* Skip over the disk name in MSDOS pathnames. */
5457 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5461 for (base = name; *name; name++)
5462 if (IS_DIR_SEPARATOR (*name))
5468 check_executable(const char * path)
5472 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5473 if ((!path) || (!*path))
5476 if ((stat (path, &st) >= 0) &&
5478 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5479 #if defined (S_IXOTH)
5480 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5482 #if defined (S_IXGRP)
5483 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5485 ((st.st_mode & S_IXUSR) == S_IXUSR))
5492 /* Searches for the full path of the wrapper. Returns
5493 newly allocated full path name if found, NULL otherwise */
5495 find_executable (const char* wrapper)
5500 /* static buffer for getcwd */
5501 char tmp[LT_PATHMAX + 1];
5505 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5507 if ((wrapper == NULL) || (*wrapper == '\0'))
5510 /* Absolute path? */
5511 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5512 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5514 concat_name = xstrdup (wrapper);
5515 if (check_executable(concat_name))
5522 if (IS_DIR_SEPARATOR (wrapper[0]))
5524 concat_name = xstrdup (wrapper);
5525 if (check_executable(concat_name))
5529 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5533 for (p = wrapper; *p; p++)
5541 /* no slashes; search PATH */
5542 const char* path = getenv ("PATH");
5545 for (p = path; *p; p = p_next)
5549 for (q = p; *q; q++)
5550 if (IS_PATH_SEPARATOR(*q))
5553 p_next = (*q == '\0' ? q : q + 1);
5556 /* empty path: current directory */
5557 if (getcwd (tmp, LT_PATHMAX) == NULL)
5558 lt_fatal ("getcwd failed");
5559 tmp_len = strlen(tmp);
5560 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5561 memcpy (concat_name, tmp, tmp_len);
5562 concat_name[tmp_len] = '/';
5563 strcpy (concat_name + tmp_len + 1, wrapper);
5567 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5568 memcpy (concat_name, p, p_len);
5569 concat_name[p_len] = '/';
5570 strcpy (concat_name + p_len + 1, wrapper);
5572 if (check_executable(concat_name))
5577 /* not found in PATH; assume curdir */
5579 /* Relative path | not found in path: prepend cwd */
5580 if (getcwd (tmp, LT_PATHMAX) == NULL)
5581 lt_fatal ("getcwd failed");
5582 tmp_len = strlen(tmp);
5583 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5584 memcpy (concat_name, tmp, tmp_len);
5585 concat_name[tmp_len] = '/';
5586 strcpy (concat_name + tmp_len + 1, wrapper);
5588 if (check_executable(concat_name))
5595 strendzap(char *str, const char *pat)
5599 assert(str != NULL);
5600 assert(pat != NULL);
5603 patlen = strlen(pat);
5607 str += len - patlen;
5608 if (strcmp(str, pat) == 0)
5615 lt_error_core (int exit_status, const char * mode,
5616 const char * message, va_list ap)
5618 fprintf (stderr, "%s: %s: ", program_name, mode);
5619 vfprintf (stderr, message, ap);
5620 fprintf (stderr, ".\n");
5622 if (exit_status >= 0)
5627 lt_fatal (const char *message, ...)
5630 va_start (ap, message);
5631 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5635 # we should really use a build-platform specific compiler
5636 # here, but OTOH, the wrappers (shell script and this C one)
5637 # are only useful if you want to execute the "real" binary.
5638 # Since the "real" binary is built for $host, then this
5639 # wrapper might as well be built for $host, too.
5640 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5644 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5649 # $output - temporary wrapper script for $objdir/$outputname
5650 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5652 # The $output program cannot be directly executed until all the libtool
5653 # libraries that it depends on are installed.
5655 # This wrapper script should never be moved out of the build directory.
5656 # If it is, it will not operate correctly.
5658 # Sed substitution that helps us do robust quoting. It backslashifies
5659 # metacharacters that are still active within double-quoted strings.
5660 Xsed='${SED} -e 1s/^X//'
5661 sed_quote_subst='$sed_quote_subst'
5663 # The HP-UX ksh and POSIX shell print the target directory to stdout
5665 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5667 relink_command=\"$relink_command\"
5669 # This environment variable determines our operation mode.
5670 if test \"\$libtool_install_magic\" = \"$magic\"; then
5671 # install mode needs the following variable:
5672 notinst_deplibs='$notinst_deplibs'
5674 # When we are sourced in execute mode, \$file and \$echo are already set.
5675 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5678 # Make sure echo works.
5679 if test \"X\$1\" = X--no-reexec; then
5680 # Discard the --no-reexec flag, and continue.
5682 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5683 # Yippee, \$echo works!
5686 # Restart under the correct shell, and then maybe \$echo will work.
5687 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5693 # Find the directory that this script lives in.
5694 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5695 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5697 # Follow symbolic links until we get to the real thisdir.
5698 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5699 while test -n \"\$file\"; do
5700 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5702 # If there was a directory component, then change thisdir.
5703 if test \"x\$destdir\" != \"x\$file\"; then
5704 case \"\$destdir\" in
5705 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5706 *) thisdir=\"\$thisdir/\$destdir\" ;;
5710 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5711 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5714 # Try to get the absolute directory name.
5715 absdir=\`cd \"\$thisdir\" && pwd\`
5716 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5719 if test "$fast_install" = yes; then
5721 program=lt-'$outputname'$exeext
5722 progdir=\"\$thisdir/$objdir\"
5724 if test ! -f \"\$progdir/\$program\" || \\
5725 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5726 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5728 file=\"\$\$-\$program\"
5730 if test ! -d \"\$progdir\"; then
5731 $mkdir \"\$progdir\"
5733 $rm \"\$progdir/\$file\"
5738 # relink executable if necessary
5739 if test -n \"\$relink_command\"; then
5740 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5742 $echo \"\$relink_command_output\" >&2
5743 $rm \"\$progdir/\$file\"
5748 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5749 { $rm \"\$progdir/\$program\";
5750 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5751 $rm \"\$progdir/\$file\"
5755 program='$outputname'
5756 progdir=\"\$thisdir/$objdir\"
5762 if test -f \"\$progdir/\$program\"; then"
5764 # Export our shlibpath_var if we have one.
5765 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5767 # Add our own library path to $shlibpath_var
5768 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5770 # Some systems cannot cope with colon-terminated $shlibpath_var
5771 # The second colon is a workaround for a bug in BeOS R4 sed
5772 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5774 export $shlibpath_var
5778 # fixup the dll searchpath if we need to.
5779 if test -n "$dllsearchpath"; then
5781 # Add the dll search path components to the executable PATH
5782 PATH=$dllsearchpath:\$PATH
5787 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5788 # Run the actual program with our arguments.
5790 # Make sure env LD_LIBRARY_PATH does not mess us up
5791 if test -n \"\${LD_LIBRARY_PATH+set}\"; then
5792 export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH
5796 # Backslashes separate directories on plain windows
5797 *-*-mingw | *-*-os2*)
5799 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5805 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5810 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5814 # The program doesn't exist.
5815 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5816 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5817 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5828 # See if we need to build an old-fashioned archive.
5829 for oldlib in $oldlibs; do
5831 if test "$build_libtool_libs" = convenience; then
5832 oldobjs="$libobjs_save"
5833 addlibs="$convenience"
5834 build_libtool_libs=no
5836 if test "$build_libtool_libs" = module; then
5837 oldobjs="$libobjs_save"
5838 build_libtool_libs=no
5840 oldobjs="$old_deplibs $non_pic_objects"
5842 addlibs="$old_convenience"
5845 if test -n "$addlibs"; then
5846 gentop="$output_objdir/${outputname}x"
5847 generated="$generated $gentop"
5849 func_extract_archives $gentop $addlibs
5850 oldobjs="$oldobjs $func_extract_archives_result"
5853 # Do each command in the archive commands.
5854 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5855 cmds=$old_archive_from_new_cmds
5857 # POSIX demands no paths to be encoded in archives. We have
5858 # to avoid creating archives with duplicate basenames if we
5859 # might have to extract them afterwards, e.g., when creating a
5860 # static archive out of a convenience library, or when linking
5861 # the entirety of a libtool archive into another (currently
5862 # not supported by libtool).
5863 if (for obj in $oldobjs
5865 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5866 done | sort | sort -uc >/dev/null 2>&1); then
5869 $echo "copying selected object files to avoid basename conflicts..."
5871 if test -z "$gentop"; then
5872 gentop="$output_objdir/${outputname}x"
5873 generated="$generated $gentop"
5875 $show "${rm}r $gentop"
5876 $run ${rm}r "$gentop"
5877 $show "$mkdir $gentop"
5878 $run $mkdir "$gentop"
5880 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5885 save_oldobjs=$oldobjs
5888 for obj in $save_oldobjs
5890 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5891 case " $oldobjs " in
5892 " ") oldobjs=$obj ;;
5895 # Make sure we don't pick an alternate name that also
5897 newobj=lt$counter-$objbase
5898 counter=`expr $counter + 1`
5899 case " $oldobjs " in
5900 *[\ /]"$newobj "*) ;;
5901 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5904 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5905 $run ln "$obj" "$gentop/$newobj" ||
5906 $run cp "$obj" "$gentop/$newobj"
5907 oldobjs="$oldobjs $gentop/$newobj"
5909 *) oldobjs="$oldobjs $obj" ;;
5914 eval cmds=\"$old_archive_cmds\"
5916 if len=`expr "X$cmds" : ".*"` &&
5917 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5918 cmds=$old_archive_cmds
5920 # the command line is too long to link in one step, link in parts
5921 $echo "using piecewise archive linking..."
5926 save_oldobjs=$oldobjs
5928 # Is there a better way of finding the last object in the list?
5929 for obj in $save_oldobjs
5933 for obj in $save_oldobjs
5935 oldobjs="$objlist $obj"
5936 objlist="$objlist $obj"
5937 eval test_cmds=\"$old_archive_cmds\"
5938 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5939 test "$len" -le "$max_cmd_len"; then
5942 # the above command should be used before it gets too long
5944 if test "$obj" = "$last_oldobj" ; then
5947 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5948 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5954 if test "X$oldobjs" = "X" ; then
5955 eval cmds=\"\$concat_cmds\"
5957 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5961 save_ifs="$IFS"; IFS='~'
5962 for cmd in $cmds; do
5966 $run eval "$cmd" || exit $?
5971 if test -n "$generated"; then
5972 $show "${rm}r$generated"
5973 $run ${rm}r$generated
5976 # Now create the libtool archive.
5980 test "$build_old_libs" = yes && old_library="$libname.$libext"
5981 $show "creating $output"
5983 # Preserve any variables that may affect compiler behavior
5984 for var in $variables_saved_for_relink; do
5985 if eval test -z \"\${$var+set}\"; then
5986 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5987 elif eval var_value=\$$var; test -z "$var_value"; then
5988 relink_command="$var=; export $var; $relink_command"
5990 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5991 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5994 # Quote the link command for shipping.
5995 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5996 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5997 if test "$hardcode_automatic" = yes ; then
6002 # Only create the output if not a dry run.
6003 if test -z "$run"; then
6004 for installed in no yes; do
6005 if test "$installed" = yes; then
6006 if test -z "$install_libdir"; then
6009 output="$output_objdir/$outputname"i
6010 # Replace all uninstalled libtool libraries with the installed ones
6012 for deplib in $dependency_libs; do
6015 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6016 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6017 if test -z "$libdir"; then
6018 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6021 if test "X$EGREP" = X ; then
6024 # We do not want portage's install root ($D) present. Check only for
6025 # this if the .la is being installed.
6026 if test "$installed" = yes && test "$D"; then
6027 eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6029 mynewdependency_lib="$libdir/$name"
6031 # Do not add duplicates
6032 if test "$mynewdependency_lib"; then
6033 my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6034 if test -z "$my_little_ninja_foo_1"; then
6035 newdependency_libs="$newdependency_libs $mynewdependency_lib"
6040 if test "$installed" = yes; then
6041 # Rather use S=WORKDIR if our version of portage supports it.
6042 # This is because some ebuild (gcc) do not use $S as buildroot.
6043 if test "$PWORKDIR"; then
6046 # We do not want portage's build root ($S) present.
6047 my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
6048 # We do not want portage's install root ($D) present.
6049 my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
6050 if test -n "$my_little_ninja_foo_2" && test "$S"; then
6051 mynewdependency_lib=""
6052 elif test -n "$my_little_ninja_foo_3" && test "$D"; then
6053 eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6055 mynewdependency_lib="$deplib"
6058 mynewdependency_lib="$deplib"
6060 # Do not add duplicates
6061 if test "$mynewdependency_lib"; then
6062 my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
6063 if test -z "$my_little_ninja_foo_4"; then
6064 newdependency_libs="$newdependency_libs $mynewdependency_lib"
6070 dependency_libs="$newdependency_libs"
6072 for lib in $dlfiles; do
6073 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6074 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6075 if test -z "$libdir"; then
6076 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6079 newdlfiles="$newdlfiles $libdir/$name"
6081 dlfiles="$newdlfiles"
6083 for lib in $dlprefiles; do
6084 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6085 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6086 if test -z "$libdir"; then
6087 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6090 newdlprefiles="$newdlprefiles $libdir/$name"
6092 dlprefiles="$newdlprefiles"
6095 for lib in $dlfiles; do
6097 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6098 *) abs=`pwd`"/$lib" ;;
6100 newdlfiles="$newdlfiles $abs"
6102 dlfiles="$newdlfiles"
6104 for lib in $dlprefiles; do
6106 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6107 *) abs=`pwd`"/$lib" ;;
6109 newdlprefiles="$newdlprefiles $abs"
6111 dlprefiles="$newdlprefiles"
6114 # place dlname in correct position for cygwin
6116 case $host,$output,$installed,$module,$dlname in
6117 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6119 # Do not add duplicates
6120 if test "$installed" = yes && test "$D"; then
6121 install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
6124 # $outputname - a libtool library file
6125 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6127 # Please DO NOT delete this file!
6128 # It is necessary for linking the library.
6130 # The name that we can dlopen(3).
6133 # Names of this library.
6134 library_names='$library_names'
6136 # The name of the static archive.
6137 old_library='$old_library'
6139 # Libraries that this one depends upon.
6140 dependency_libs='$dependency_libs'
6142 # Version information for $libname.
6147 # Is this an already installed library?
6148 installed=$installed
6150 # Should we warn about portability when linking against -modules?
6151 shouldnotlink=$module
6153 # Files to dlopen/dlpreopen
6155 dlpreopen='$dlprefiles'
6157 # Directory that this library needs to be installed in:
6158 libdir='$install_libdir'"
6159 if test "$installed" = no && test "$need_relink" = yes; then
6161 relink_command=\"$relink_command\""
6166 # Do a symbolic link so that the libtool archive can be found in
6167 # LD_LIBRARY_PATH before the program is installed.
6168 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6169 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6175 # libtool install mode
6177 modename="$modename: install"
6179 # There may be an optional sh(1) argument at the beginning of
6180 # install_prog (especially on Windows NT).
6181 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6182 # Allow the use of GNU shtool's install command.
6183 $echo "X$nonopt" | grep shtool > /dev/null; then
6184 # Aesthetically quote it.
6185 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6187 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6191 install_prog="$arg "
6199 # The real first argument should be the name of the installation program.
6200 # Aesthetically quote it.
6201 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6203 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6207 install_prog="$install_prog$arg"
6209 # We need to accept at least all the BSD install flags.
6219 if test -n "$dest"; then
6220 files="$files $dest"
6228 case " $install_prog " in
6233 -g | -m | -o) prev=$arg ;;
6241 # If the previous option needed an argument, then skip it.
6242 if test -n "$prev"; then
6251 # Aesthetically quote the argument.
6252 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6254 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6258 install_prog="$install_prog $arg"
6261 if test -z "$install_prog"; then
6262 $echo "$modename: you must specify an install program" 1>&2
6267 if test -n "$prev"; then
6268 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6273 if test -z "$files"; then
6274 if test -z "$dest"; then
6275 $echo "$modename: no file or destination specified" 1>&2
6277 $echo "$modename: you must specify a destination" 1>&2
6283 # Strip any trailing slash from the destination.
6284 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6286 # Check to see that the destination is a directory.
6287 test -d "$dest" && isdir=yes
6288 if test "$isdir" = yes; then
6292 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6293 test "X$destdir" = "X$dest" && destdir=.
6294 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6296 # Not a directory, so check to see that there is only one file specified.
6298 if test "$#" -gt 2; then
6299 $echo "$modename: \`$dest' is not a directory" 1>&2
6305 [\\/]* | [A-Za-z]:[\\/]*) ;;
6307 for file in $files; do
6311 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6320 # This variable tells wrapper scripts just to set variables rather
6321 # than running their programs.
6322 libtool_install_magic="$magic"
6327 for file in $files; do
6329 # Do each installation.
6332 # Do the static libraries later.
6333 staticlibs="$staticlibs $file"
6337 # Check to see that this really is a libtool archive.
6338 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6340 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6348 # If there is no directory component, then add one.
6350 */* | *\\*) . $file ;;
6354 # Add the libdir to current_libdirs if it is the destination.
6355 if test "X$destdir" = "X$libdir"; then
6356 case "$current_libdirs " in
6358 *) current_libdirs="$current_libdirs $libdir" ;;
6361 # Note the libdir as a future libdir.
6362 case "$future_libdirs " in
6364 *) future_libdirs="$future_libdirs $libdir" ;;
6368 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6369 test "X$dir" = "X$file/" && dir=
6372 if test -n "$relink_command"; then
6373 # Determine the prefix the user has applied to our future dir.
6374 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6376 # Don't allow the user to place us outside of our expected
6377 # location b/c this prevents finding dependent libraries that
6378 # are installed to the same prefix.
6379 # At present, this check doesn't affect windows .dll's that
6380 # are installed into $libdir/../bin (currently, that works fine)
6381 # but it's something to keep an eye on.
6382 if test "$inst_prefix_dir" = "$destdir"; then
6383 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6387 if test -n "$inst_prefix_dir"; then
6388 # Stick the inst_prefix_dir data into the link command.
6389 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
6391 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
6394 $echo "$modename: warning: relinking \`$file'" 1>&2
6395 $show "$relink_command"
6396 if $run eval "$relink_command"; then :
6398 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6403 # See the names of the shared library.
6404 set dummy $library_names
6405 if test -n "$2"; then
6411 test -n "$relink_command" && srcname="$realname"T
6413 # Install the shared library and build the symlinks.
6414 $show "$install_prog $dir/$srcname $destdir/$realname"
6415 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6416 if test -n "$stripme" && test -n "$striplib"; then
6417 $show "$striplib $destdir/$realname"
6418 $run eval "$striplib $destdir/$realname" || exit $?
6421 if test "$#" -gt 0; then
6422 # Delete the old symlinks, and create new ones.
6423 # Try `ln -sf' first, because the `ln' binary might depend on
6424 # the symlink we replace! Solaris /bin/ln does not understand -f,
6425 # so we also need to try rm && ln -s.
6428 if test "$linkname" != "$realname"; then
6429 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6430 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6435 # Do each command in the postinstall commands.
6436 lib="$destdir/$realname"
6437 cmds=$postinstall_cmds
6438 save_ifs="$IFS"; IFS='~'
6439 for cmd in $cmds; do
6443 $run eval "$cmd" || {
6446 # Restore the uninstalled library and exit
6447 if test "$mode" = relink; then
6448 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6457 # Install the pseudo-library for information purposes.
6458 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6459 instname="$dir/$name"i
6460 $show "$install_prog $instname $destdir/$name"
6461 $run eval "$install_prog $instname $destdir/$name" || exit $?
6463 # Maybe install the static library, too.
6464 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6468 # Install (i.e. copy) a libtool object.
6470 # Figure out destination file name, if it wasn't already specified.
6471 if test -n "$destname"; then
6472 destfile="$destdir/$destname"
6474 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6475 destfile="$destdir/$destfile"
6478 # Deduce the name of the destination old-style object file.
6481 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6484 staticdest="$destfile"
6488 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6494 # Install the libtool object if requested.
6495 if test -n "$destfile"; then
6496 $show "$install_prog $file $destfile"
6497 $run eval "$install_prog $file $destfile" || exit $?
6500 # Install the old object if enabled.
6501 if test "$build_old_libs" = yes; then
6502 # Deduce the name of the old-style object file.
6503 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6505 $show "$install_prog $staticobj $staticdest"
6506 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6512 # Figure out destination file name, if it wasn't already specified.
6513 if test -n "$destname"; then
6514 destfile="$destdir/$destname"
6516 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6517 destfile="$destdir/$destfile"
6520 # If the file is missing, and there is a .exe on the end, strip it
6521 # because it is most likely a libtool script we actually want to
6526 if test ! -f "$file"; then
6527 file=`$echo $file|${SED} 's,.exe$,,'`
6533 # Do a test to see if this is really a libtool program.
6536 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6542 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6546 # Note that it is not necessary on cygwin/mingw to append a dot to
6547 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6548 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6549 # `FILE.' does not work on cygwin managed mounts.
6551 # If there is no directory component, then add one.
6553 */* | *\\*) . ${wrapper} ;;
6554 *) . ./${wrapper} ;;
6557 # Check the variables that should have been set.
6558 if test -z "$notinst_deplibs"; then
6559 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6564 for lib in $notinst_deplibs; do
6565 # Check to see that each library is installed.
6567 if test -f "$lib"; then
6568 # If there is no directory component, then add one.
6570 */* | *\\*) . $lib ;;
6574 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6575 if test -n "$libdir" && test ! -f "$libfile"; then
6576 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6582 # Note that it is not necessary on cygwin/mingw to append a dot to
6583 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6584 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6585 # `FILE.' does not work on cygwin managed mounts.
6587 # If there is no directory component, then add one.
6589 */* | *\\*) . ${wrapper} ;;
6590 *) . ./${wrapper} ;;
6594 if test "$fast_install" = no && test -n "$relink_command"; then
6595 if test "$finalize" = yes && test -z "$run"; then
6596 tmpdir=`func_mktempdir`
6597 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6598 outputname="$tmpdir/$file"
6599 # Replace the output file specification.
6600 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6602 $show "$relink_command"
6603 if $run eval "$relink_command"; then :
6605 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6611 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6614 # Install the binary that we compiled earlier.
6615 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6619 # remove .exe since cygwin /usr/bin/install will append another
6621 case $install_prog,$host in
6622 */usr/bin/install*,*cygwin*)
6623 case $file:$destfile in
6628 destfile=$destfile.exe
6631 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6636 $show "$install_prog$stripme $file $destfile"
6637 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6638 test -n "$outputname" && ${rm}r "$tmpdir"
6643 for file in $staticlibs; do
6644 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6646 # Set up the ranlib parameters.
6647 oldlib="$destdir/$name"
6649 $show "$install_prog $file $oldlib"
6650 $run eval "$install_prog \$file \$oldlib" || exit $?
6652 if test -n "$stripme" && test -n "$old_striplib"; then
6653 $show "$old_striplib $oldlib"
6654 $run eval "$old_striplib $oldlib" || exit $?
6657 # Do each command in the postinstall commands.
6658 cmds=$old_postinstall_cmds
6659 save_ifs="$IFS"; IFS='~'
6660 for cmd in $cmds; do
6664 $run eval "$cmd" || exit $?
6669 if test -n "$future_libdirs"; then
6670 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6673 if test -n "$current_libdirs"; then
6674 # Maybe just do a dry run.
6675 test -n "$run" && current_libdirs=" -n$current_libdirs"
6676 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6682 # libtool finish mode
6684 modename="$modename: finish"
6688 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6691 libdirs="$libdirs $dir"
6694 for libdir in $libdirs; do
6695 if test -n "$finish_cmds"; then
6696 # Do each command in the finish commands.
6698 save_ifs="$IFS"; IFS='~'
6699 for cmd in $cmds; do
6703 $run eval "$cmd" || admincmds="$admincmds
6708 if test -n "$finish_eval"; then
6709 # Do the single finish_eval.
6710 eval cmds=\"$finish_eval\"
6711 $run eval "$cmds" || admincmds="$admincmds
6717 # Exit here if they wanted silent mode.
6718 test "$show" = : && exit $EXIT_SUCCESS
6720 $echo "X----------------------------------------------------------------------" | $Xsed
6721 $echo "Libraries have been installed in:"
6722 for libdir in $libdirs; do
6726 $echo "If you ever happen to want to link against installed libraries"
6727 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6728 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6729 $echo "flag during linking and do at least one of the following:"
6730 if test -n "$shlibpath_var"; then
6731 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6732 $echo " during execution"
6734 if test -n "$runpath_var"; then
6735 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6736 $echo " during linking"
6738 if test -n "$hardcode_libdir_flag_spec"; then
6740 eval flag=\"$hardcode_libdir_flag_spec\"
6742 $echo " - use the \`$flag' linker flag"
6744 if test -n "$admincmds"; then
6745 $echo " - have your system administrator run these commands:$admincmds"
6747 if test -f /etc/ld.so.conf; then
6748 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6751 $echo "See any operating system documentation about shared libraries for"
6752 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6753 $echo "X----------------------------------------------------------------------" | $Xsed
6757 # libtool execute mode
6759 modename="$modename: execute"
6761 # The first argument is the command name.
6763 if test -z "$cmd"; then
6764 $echo "$modename: you must specify a COMMAND" 1>&2
6769 # Handle -dlopen flags immediately.
6770 for file in $execute_dlfiles; do
6771 if test ! -f "$file"; then
6772 $echo "$modename: \`$file' is not a file" 1>&2
6780 # Check to see that this really is a libtool archive.
6781 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6783 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6788 # Read the libtool library.
6792 # If there is no directory component, then add one.
6794 */* | *\\*) . $file ;;
6798 # Skip this library if it cannot be dlopened.
6799 if test -z "$dlname"; then
6800 # Warn if it was a shared library.
6801 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6805 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6806 test "X$dir" = "X$file" && dir=.
6808 if test -f "$dir/$objdir/$dlname"; then
6811 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6817 # Just add the directory containing the .lo file.
6818 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6819 test "X$dir" = "X$file" && dir=.
6823 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6828 # Get the absolute pathname.
6829 absdir=`cd "$dir" && pwd`
6830 test -n "$absdir" && dir="$absdir"
6832 # Now add the directory to shlibpath_var.
6833 if eval "test -z \"\$$shlibpath_var\""; then
6834 eval "$shlibpath_var=\"\$dir\""
6836 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6840 # This variable tells wrapper scripts just to set shlibpath_var
6841 # rather than running their programs.
6842 libtool_execute_magic="$magic"
6844 # Check if any of the arguments is a wrapper script.
6851 # Do a test to see if this is really a libtool program.
6852 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6853 # If there is no directory component, then add one.
6855 */* | *\\*) . $file ;;
6859 # Transform arg to wrapped name.
6860 file="$progdir/$program"
6864 # Quote arguments (to preserve shell metacharacters).
6865 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6866 args="$args \"$file\""
6869 if test -z "$run"; then
6870 if test -n "$shlibpath_var"; then
6871 # Export the shlibpath_var.
6872 eval "export $shlibpath_var"
6875 # Restore saved environment variables
6876 if test "${save_LC_ALL+set}" = set; then
6877 LC_ALL="$save_LC_ALL"; export LC_ALL
6879 if test "${save_LANG+set}" = set; then
6880 LANG="$save_LANG"; export LANG
6883 # Now prepare to actually exec the command.
6884 exec_cmd="\$cmd$args"
6886 # Display what would be done.
6887 if test -n "$shlibpath_var"; then
6888 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6889 $echo "export $shlibpath_var"
6896 # libtool clean and uninstall mode
6898 modename="$modename: $mode"
6904 # This variable tells wrapper scripts just to set variables rather
6905 # than running their programs.
6906 libtool_install_magic="$magic"
6911 -f) rm="$rm $arg"; rmforce=yes ;;
6912 -*) rm="$rm $arg" ;;
6913 *) files="$files $arg" ;;
6917 if test -z "$rm"; then
6918 $echo "$modename: you must specify an RM program" 1>&2
6925 origobjdir="$objdir"
6926 for file in $files; do
6927 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6928 if test "X$dir" = "X$file"; then
6930 objdir="$origobjdir"
6932 objdir="$dir/$origobjdir"
6934 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6935 test "$mode" = uninstall && objdir="$dir"
6937 # Remember objdir for removal later, being careful to avoid duplicates
6938 if test "$mode" = clean; then
6941 *) rmdirs="$rmdirs $objdir" ;;
6945 # Don't error if the file doesn't exist and rm -f was used.
6946 if (test -L "$file") >/dev/null 2>&1 \
6947 || (test -h "$file") >/dev/null 2>&1 \
6948 || test -f "$file"; then
6950 elif test -d "$file"; then
6953 elif test "$rmforce" = yes; then
6961 # Possibly a libtool archive, so verify it.
6962 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6965 # Delete the libtool libraries and symlinks.
6966 for n in $library_names; do
6967 rmfiles="$rmfiles $objdir/$n"
6969 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6973 case " $library_names " in
6974 # " " in the beginning catches empty $dlname
6976 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6978 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6981 if test -n "$library_names"; then
6982 # Do each command in the postuninstall commands.
6983 cmds=$postuninstall_cmds
6984 save_ifs="$IFS"; IFS='~'
6985 for cmd in $cmds; do
6990 if test "$?" -ne 0 && test "$rmforce" != yes; then
6997 if test -n "$old_library"; then
6998 # Do each command in the old_postuninstall commands.
6999 cmds=$old_postuninstall_cmds
7000 save_ifs="$IFS"; IFS='~'
7001 for cmd in $cmds; do
7006 if test "$?" -ne 0 && test "$rmforce" != yes; then
7012 # FIXME: should reinstall the best remaining shared library.
7019 # Possibly a libtool object, so verify it.
7020 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7025 # Add PIC object to the list of files to remove.
7026 if test -n "$pic_object" \
7027 && test "$pic_object" != none; then
7028 rmfiles="$rmfiles $dir/$pic_object"
7031 # Add non-PIC object to the list of files to remove.
7032 if test -n "$non_pic_object" \
7033 && test "$non_pic_object" != none; then
7034 rmfiles="$rmfiles $dir/$non_pic_object"
7040 if test "$mode" = clean ; then
7044 file=`$echo $file|${SED} 's,.exe$,,'`
7045 noexename=`$echo $name|${SED} 's,.exe$,,'`
7046 # $file with .exe has already been added to rmfiles,
7047 # add $file without .exe
7048 rmfiles="$rmfiles $file"
7051 # Do a test to see if this is a libtool program.
7052 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7056 # note $name still contains .exe if it was in $file originally
7057 # as does the version of $file that was added into $rmfiles
7058 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7059 if test "$fast_install" = yes && test -n "$relink_command"; then
7060 rmfiles="$rmfiles $objdir/lt-$name"
7062 if test "X$noexename" != "X$name" ; then
7063 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7069 $show "$rm $rmfiles"
7070 $run $rm $rmfiles || exit_status=1
7072 objdir="$origobjdir"
7074 # Try to remove the ${objdir}s in the directories where we deleted files
7075 for dir in $rmdirs; do
7076 if test -d "$dir"; then
7078 $run rmdir $dir >/dev/null 2>&1
7086 $echo "$modename: you must specify a MODE" 1>&2
7087 $echo "$generic_help" 1>&2
7092 if test -z "$exec_cmd"; then
7093 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7094 $echo "$generic_help" 1>&2
7097 fi # test -z "$show_help"
7099 if test -n "$exec_cmd"; then
7104 # We need to display help for each of the modes.
7107 "Usage: $modename [OPTION]... [MODE-ARG]...
7109 Provide generalized library-building support services.
7111 --config show all configuration variables
7112 --debug enable verbose shell tracing
7113 -n, --dry-run display commands without modifying any files
7114 --features display basic configuration information and exit
7115 --finish same as \`--mode=finish'
7116 --help display this help message and exit
7117 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7118 --quiet same as \`--silent'
7119 --silent don't print informational messages
7120 --tag=TAG use configuration variables from tag TAG
7121 --version print version information
7123 MODE must be one of the following:
7125 clean remove files from the build directory
7126 compile compile a source file into a libtool object
7127 execute automatically set library path, then run a program
7128 finish complete the installation of libtool libraries
7129 install install libraries or executables
7130 link create a library or an executable
7131 uninstall remove libraries from an installed directory
7133 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7134 a more detailed description of MODE.
7136 Report bugs to <bug-libtool@gnu.org>."
7142 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7144 Remove files from the build directory.
7146 RM is the name of the program to use to delete files associated with each FILE
7147 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7150 If FILE is a libtool library, object or program, all the files associated
7151 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7156 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7158 Compile a source file into a libtool library object.
7160 This mode accepts the following additional options:
7162 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7163 -prefer-pic try to building PIC objects only
7164 -prefer-non-pic try to building non-PIC objects only
7165 -static always build a \`.o' file suitable for static linking
7167 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7168 from the given SOURCEFILE.
7170 The output file name is determined by removing the directory component from
7171 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7172 library object suffix, \`.lo'."
7177 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7179 Automatically set library path, then run a program.
7181 This mode accepts the following additional options:
7183 -dlopen FILE add the directory containing FILE to the library path
7185 This mode sets the library path environment variable according to \`-dlopen'
7188 If any of the ARGS are libtool executable wrappers, then they are translated
7189 into their corresponding uninstalled binary, and any of their required library
7190 directories are added to the library path.
7192 Then, COMMAND is executed, with ARGS as arguments."
7197 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7199 Complete the installation of libtool libraries.
7201 Each LIBDIR is a directory that contains libtool libraries.
7203 The commands that this mode executes may require superuser privileges. Use
7204 the \`--dry-run' option if you just want to see what would be executed."
7209 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7211 Install executables or libraries.
7213 INSTALL-COMMAND is the installation command. The first component should be
7214 either the \`install' or \`cp' program.
7216 The rest of the components are interpreted as arguments to that command (only
7217 BSD-compatible install options are recognized)."
7222 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7224 Link object files or libraries together to form another library, or to
7225 create an executable program.
7227 LINK-COMMAND is a command using the C compiler that you would use to create
7228 a program from several object files.
7230 The following components of LINK-COMMAND are treated specially:
7232 -all-static do not do any dynamic linking at all
7233 -avoid-version do not add a version suffix if possible
7234 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7235 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7236 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7237 -export-symbols SYMFILE
7238 try to export only the symbols listed in SYMFILE
7239 -export-symbols-regex REGEX
7240 try to export only the symbols matching REGEX
7241 -LLIBDIR search LIBDIR for required installed libraries
7242 -lNAME OUTPUT-FILE requires the installed library libNAME
7243 -module build a library that can dlopened
7244 -no-fast-install disable the fast-install mode
7245 -no-install link a not-installable executable
7246 -no-undefined declare that a library does not refer to external symbols
7247 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7248 -objectlist FILE Use a list of object files found in FILE to specify objects
7249 -precious-files-regex REGEX
7250 don't remove output files matching REGEX
7251 -release RELEASE specify package release information
7252 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7253 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7254 -static do not do any dynamic linking of libtool libraries
7255 -version-info CURRENT[:REVISION[:AGE]]
7256 specify library version info [each variable defaults to 0]
7258 All other options (arguments beginning with \`-') are ignored.
7260 Every other argument is treated as a filename. Files ending in \`.la' are
7261 treated as uninstalled libtool libraries, other files are standard or library
7264 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7265 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7266 required, except when creating a convenience library.
7268 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7269 using \`ar' and \`ranlib', or on Windows using \`lib'.
7271 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7272 is created, otherwise an executable program is created."
7277 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7279 Remove libraries from an installation directory.
7281 RM is the name of the program to use to delete files associated with each FILE
7282 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7285 If FILE is a libtool library, all the files associated with it are deleted.
7286 Otherwise, only FILE itself is deleted using RM."
7290 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7297 $echo "Try \`$modename --help' for more information about other modes."
7301 # The TAGs below are defined such that we never get into a situation
7302 # in which we disable both kinds of libraries. Given conflicting
7303 # choices, we go for a static library, that is the most portable,
7304 # since we can't tell whether shared libraries were disabled because
7305 # the user asked for that or because the platform doesn't support
7306 # them. This is particularly important on AIX, because we don't
7307 # support having both static and shared libraries enabled at the same
7308 # time on that platform, so we default to a shared-only configuration.
7309 # If a disable-shared tag is given, we'll fallback to a static-only
7310 # configuration. But we'll never go from static-only to shared-only.
7312 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7314 # ### END LIBTOOL TAG CONFIG: disable-shared
7316 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7318 # ### END LIBTOOL TAG CONFIG: disable-static
7324 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7326 # Libtool was configured on host elm:
7328 # Shell to use when invoking shell scripts.
7331 # Whether or not to build shared libraries.
7332 build_libtool_libs=yes
7334 # Whether or not to build static libraries.
7337 # Whether or not to add -lc for building shared libraries.
7338 build_libtool_need_lc=no
7340 # Whether or not to disallow shared libs when runtime libs are static
7341 allow_libtool_libs_with_static_runtimes=no
7343 # Whether or not to optimize for fast installation.
7348 host=i686-pc-linux-gnu
7353 build=i686-pc-linux-gnu
7356 # An echo program that does not interpret backslashes.
7366 # LTCC compiler flags.
7369 # A language-specific compiler.
7372 # Is the compiler the GNU C compiler?
7376 EGREP="/bin/grep -E"
7378 # The linker used to build libraries.
7379 LD="/usr/i686-gentoo-linux-gnu/bin/ld"
7381 # Whether we need hard or soft links.
7384 # A BSD-compatible nm program.
7387 # A symbol stripping program
7390 # Used to examine libraries when file_magic_cmd begins "file"
7393 # Used on cygwin: DLL creation program.
7396 # Used on cygwin: object dumper.
7399 # Used on cygwin: assembler.
7402 # The name of the directory that contains temporary libtool files.
7405 # How to create reloadable object files.
7407 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7409 # How to pass a linker flag through the compiler.
7412 # Object file suffix (normally "o").
7415 # Old archive suffix (normally "a").
7418 # Shared library suffix (normally ".so").
7421 # Executable file suffix (normally "").
7424 # Additional compiler flags for building library objects.
7425 pic_flag=" -fPIC -DPIC"
7428 # What is the maximum length of a command?
7431 # Does compiler simultaneously support -c and -o options?
7434 # Must we lock files when doing compilation?
7437 # Do we need the lib prefix for modules?
7440 # Do we need a version for libraries?
7443 # Whether dlopen is supported.
7444 dlopen_support=unknown
7446 # Whether dlopen of programs is supported.
7449 # Whether dlopen of statically linked programs is supported.
7450 dlopen_self_static=unknown
7452 # Compiler flag to prevent dynamic linking.
7453 link_static_flag="-static"
7455 # Compiler flag to turn off builtin functions.
7456 no_builtin_flag=" -fno-builtin"
7458 # Compiler flag to allow reflexive dlopens.
7459 export_dynamic_flag_spec="\${wl}--export-dynamic"
7461 # Compiler flag to generate shared objects directly from archives.
7462 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7464 # Compiler flag to generate thread-safe objects.
7465 thread_safe_flag_spec=""
7467 # Library versioning type.
7470 # Format of library name prefix.
7471 libname_spec="lib\$name"
7473 # List of archive names. First name is the real one, the rest are links.
7474 # The last name is the one that the linker finds with -lNAME.
7475 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7477 # The coded name of the library, if different from the real name.
7478 soname_spec="\${libname}\${release}\${shared_ext}\$major"
7480 # Commands used to build and install an old-style archive.
7482 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7483 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7484 old_postuninstall_cmds=""
7486 # Create an old-style archive from a shared archive.
7487 old_archive_from_new_cmds=""
7489 # Create a temporary old-style archive to link instead of a shared archive.
7490 old_archive_from_expsyms_cmds=""
7492 # Commands used to build and install a shared archive.
7493 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7494 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"
7496 postuninstall_cmds=""
7498 # Commands used to build a loadable module (assumed same as above if empty)
7500 module_expsym_cmds=""
7502 # Commands to strip libraries.
7503 old_striplib="strip --strip-debug"
7504 striplib="strip --strip-unneeded"
7506 # Dependencies to place before the objects being linked to create a
7508 predep_objects="/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../crti.o /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/crtbeginS.o"
7510 # Dependencies to place after the objects being linked to create a
7512 postdep_objects="/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/crtendS.o /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../crtn.o"
7514 # Dependencies to place before the objects being linked to create a
7518 # Dependencies to place after the objects being linked to create a
7520 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7522 # The library search path used internally by the compiler when linking
7524 compiler_lib_search_path="-L/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1 -L/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1 -L/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../../i686-gentoo-linux-gnu/lib -L/usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../.."
7526 # Method to check whether dependent libraries are shared objects.
7527 deplibs_check_method="pass_all"
7529 # Command to use when deplibs_check_method == file_magic.
7530 file_magic_cmd="\$MAGIC_CMD"
7532 # Flag that allows shared libraries with undefined symbols to be built.
7533 allow_undefined_flag=""
7535 # Flag that forces no undefined symbols.
7536 no_undefined_flag=""
7538 # Commands used to finish a libtool library installation in a directory.
7539 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7541 # Same as above, but a single script fragment to be evaled but not shown.
7544 # Take the output of nm and produce a listing of raw symbols and C names.
7545 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7547 # Transform the output of nm in a proper C declaration
7548 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7550 # Transform the output of nm in a C name address pair
7551 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7553 # This is the shared library runtime path variable.
7554 runpath_var=LD_RUN_PATH
7556 # This is the shared library path variable.
7557 shlibpath_var=LD_LIBRARY_PATH
7559 # Is shlibpath searched before the hard-coded library search path?
7560 shlibpath_overrides_runpath=no
7562 # How to hardcode a shared library path into an executable.
7563 hardcode_action=immediate
7565 # Whether we should hardcode library paths into libraries.
7566 hardcode_into_libs=yes
7568 # Flag to hardcode $libdir into a binary during linking.
7569 # This must work even if $libdir does not exist.
7570 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7572 # If ld is used when linking, flag to hardcode $libdir into
7573 # a binary during linking. This must work even if $libdir does
7575 hardcode_libdir_flag_spec_ld=""
7577 # Whether we need a single -rpath flag with a separated argument.
7578 hardcode_libdir_separator=""
7580 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7584 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7588 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7589 # the resulting binary.
7590 hardcode_shlibpath_var=unsupported
7592 # Set to yes if building a shared library automatically hardcodes DIR into the library
7593 # and all subsequent libraries and executables linked against it.
7594 hardcode_automatic=no
7596 # Variables whose values should be saved in libtool wrapper scripts and
7597 # restored at relink time.
7598 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7600 # Whether libtool must link a program against all its dependency libraries.
7601 link_all_deplibs=unknown
7603 # Compile-time system search path for libraries
7604 sys_lib_search_path_spec=" /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../../i686-gentoo-linux-gnu/lib/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../../i686-gentoo-linux-gnu/lib/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../i686-gentoo-linux-gnu/4.1.1/ /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1/../../../ /lib/i686-gentoo-linux-gnu/4.1.1/ /lib/ /usr/lib/i686-gentoo-linux-gnu/4.1.1/ /usr/lib/"
7606 # Run-time system search path for libraries
7607 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib //usr//lib/opengl/xorg-x11/lib /usr/i686-gentoo-linux-gnu/lib /usr/lib/gcc/i686-gentoo-linux-gnu/4.1.1 /usr/lib/gcc/i686-gentoo-linux-gnu/3.4.6 /usr/lib/gcc-lib/i686-gentoo-linux-gnu/3.3.6 /usr/lib/nspr /usr/lib/nss /usr/lib /usr/lib/seamonkey /usr/lib/openmotif-2.2 /opt/sun-jdk-1.4.2.12/jre/lib/i386/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/native_threads/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/classic/ /opt/sun-jdk-1.4.2.12/jre/lib/i386/server/ /usr/lib/qt4 /usr/kde/3.5/lib /usr/qt/3/lib /usr/games/lib /usr/lib/R/lib /usr/lib/libstdc++-v3/ /usr/lib/octave-2.1.73 "
7609 # Fix the shell variable $srcfile for the compiler.
7612 # Set to yes if exported symbols are required.
7613 always_export_symbols=no
7615 # The commands to list exported symbols.
7616 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7618 # The commands to extract the exported symbol list from a shared archive.
7619 extract_expsyms_cmds=""
7621 # Symbols that should not be listed in the preloaded symbols.
7624 # Symbols that must always be exported.
7627 # ### END LIBTOOL TAG CONFIG: CXX