added a bug to the TODO list.
[neuro.git] / libtool
blobc196f7c9c518bf61bce8e51cd09f89e952bd392a
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU neuro 0.49.21)
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
33 SED="/usr/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/usr/bin/sed -e s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
39 # if CDPATH is set.
40 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host nik.neuroponic.com:
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/sh"
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
56 build_old_libs=yes
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=yes
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=yes
64 # Whether or not to optimize for fast installation.
65 fast_install=needless
67 # The host system.
68 host_alias=i386-mingw32msvc
69 host=i386-pc-mingw32msvc
71 # An echo program that does not interpret backslashes.
72 echo="echo"
74 # The archiver.
75 AR="i386-mingw32msvc-ar"
76 AR_FLAGS="cru"
78 # A C compiler.
79 LTCC="i386-mingw32msvc-gcc"
81 # A language-specific compiler.
82 CC="i386-mingw32msvc-gcc"
84 # Is the compiler the GNU C compiler?
85 with_gcc=yes
87 # An ERE matcher.
88 EGREP="grep -E"
90 # The linker used to build libraries.
91 LD="/usr/misc/torrents/mingw/cross-tools/i386-mingw32msvc/bin/ld"
93 # Whether we need hard or soft links.
94 LN_S="ln -s"
96 # A BSD-compatible nm program.
97 NM="/usr/misc/torrents/mingw/cross-tools/bin/i386-mingw32msvc-nm -B"
99 # A symbol stripping program
100 STRIP="i386-mingw32msvc-strip"
102 # Used to examine libraries when file_magic_cmd begins "file"
103 MAGIC_CMD=file
105 # Used on cygwin: DLL creation program.
106 DLLTOOL="i386-mingw32msvc-dlltool"
108 # Used on cygwin: object dumper.
109 OBJDUMP="i386-mingw32msvc-objdump"
111 # Used on cygwin: assembler.
112 AS="i386-mingw32msvc-as"
114 # The name of the directory that contains temporary libtool files.
115 objdir=.libs
117 # How to create reloadable object files.
118 reload_flag=" -r"
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
121 # How to pass a linker flag through the compiler.
122 wl="-Wl,"
124 # Object file suffix (normally "o").
125 objext="o"
127 # Old archive suffix (normally "a").
128 libext="a"
130 # Shared library suffix (normally ".so").
131 shrext_cmds='.dll'
133 # Executable file suffix (normally "").
134 exeext=""
136 # Additional compiler flags for building library objects.
137 pic_flag=" -DDLL_EXPORT -DPIC"
138 pic_mode=default
140 # What is the maximum length of a command?
141 max_cmd_len=32768
143 # Does compiler simultaneously support -c and -o options?
144 compiler_c_o="yes"
146 # Must we lock files when doing compilation ?
147 need_locks="no"
149 # Do we need the lib prefix for modules?
150 need_lib_prefix=no
152 # Do we need a version for libraries?
153 need_version=no
155 # Whether dlopen is supported.
156 dlopen_support=unknown
158 # Whether dlopen of programs is supported.
159 dlopen_self=unknown
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=unknown
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
179 # Library versioning type.
180 version_type=windows
182 # Format of library name prefix.
183 libname_spec="lib\$name"
185 # List of archive names. First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\$libname.dll.a"
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
192 # Commands used to build and install an old-style archive.
193 RANLIB="i386-mingw32msvc-ranlib"
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--image-base=0x10000000 \${wl}--out-implib,\$lib"
206 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
207 cp \$export_symbols \$output_objdir/\$soname.def;
208 else
209 echo EXPORTS > \$output_objdir/\$soname.def;
210 cat \$export_symbols >> \$output_objdir/\$soname.def;
212 \$CC -shared \$output_objdir/\$soname.def \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}--image-base=0x10000000 \${wl}--out-implib,\$lib"
213 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
214 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
215 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
216 test -d \\\$dldir || mkdir -p \\\$dldir~
217 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname"
218 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
219 dlpath=\$dir/\\\$dldll~
220 \$rm \\\$dlpath"
222 # Commands used to build a loadable module (assumed same as above if empty)
223 module_cmds=""
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="i386-mingw32msvc-strip --strip-debug"
228 striplib="i386-mingw32msvc-strip --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
231 # shared library.
232 predep_objects=""
234 # Dependencies to place after the objects being linked to create a
235 # shared library.
236 postdep_objects=""
238 # Dependencies to place before the objects being linked to create a
239 # shared library.
240 predeps=""
242 # Dependencies to place after the objects being linked to create a
243 # shared library.
244 postdeps=""
246 # The library search path used internally by the compiler when linking
247 # a shared library.
248 compiler_lib_search_path=""
250 # Method to check whether dependent libraries are shared objects.
251 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
253 # Command to use when deplibs_check_method == file_magic.
254 file_magic_cmd="\$OBJDUMP -f"
256 # Flag that allows shared libraries with undefined symbols to be built.
257 allow_undefined_flag="unsupported"
259 # Flag that forces no undefined symbols.
260 no_undefined_flag=""
262 # Commands used to finish a libtool library installation in a directory.
263 finish_cmds=""
265 # Same as above, but a single script fragment to be evaled but not shown.
266 finish_eval=""
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\\3 \\3/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=PATH
283 # Is shlibpath searched before the hard-coded library search path?
284 shlibpath_overrides_runpath=yes
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=no
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
298 # not exist.
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
305 # resulting binary.
306 hardcode_direct=no
308 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
309 # resulting binary.
310 hardcode_minus_L=no
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_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/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/ /usr/lib/gcc/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/i386-mingw32msvc/3.2.3/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../"
330 # Run-time system search path for libraries
331 sys_lib_dlsearch_path_spec="/lib /usr/lib"
333 # Fix the shell variable $srcfile for the compiler.
334 fix_srcfile_path=""
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 -e '/^[BCDGS] /s/.* \\\\([^ ]*\\\\)/\\\\1 DATA/' | \$SED -e '/^[AITW] /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.
349 include_expsyms=""
351 # ### END LIBTOOL CONFIG
353 # ltmain.sh - Provide generalized library-building support services.
354 # NOTE: Changing this file will not affect anything until you rerun configure.
356 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
357 # Free Software Foundation, Inc.
358 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
360 # This program is free software; you can redistribute it and/or modify
361 # it under the terms of the GNU General Public License as published by
362 # the Free Software Foundation; either version 2 of the License, or
363 # (at your option) any later version.
365 # This program is distributed in the hope that it will be useful, but
366 # WITHOUT ANY WARRANTY; without even the implied warranty of
367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
368 # General Public License for more details.
370 # You should have received a copy of the GNU General Public License
371 # along with this program; if not, write to the Free Software
372 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
374 # As a special exception to the GNU General Public License, if you
375 # distribute this file as part of a program that contains a
376 # configuration script generated by Autoconf, you may include it under
377 # the same distribution terms that you use for the rest of that program.
379 basename="s,^.*/,,g"
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
385 # function.
386 progpath="$0"
388 # The name of this program:
389 progname=`echo "$progpath" | $SED $basename`
390 modename="$progname"
392 # Global variables:
393 EXIT_SUCCESS=0
394 EXIT_FAILURE=1
396 PROGRAM=ltmain.sh
397 PACKAGE=libtool
398 VERSION=1.5.10
399 TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)"
401 # See if we are running on zsh, and set the options which allow our
402 # commands through without removal of \ escapes.
403 if test -n "${ZSH_VERSION+set}" ; then
404 setopt NO_GLOB_SUBST
407 # Check that we have a working $echo.
408 if test "X$1" = X--no-reexec; then
409 # Discard the --no-reexec flag, and continue.
410 shift
411 elif test "X$1" = X--fallback-echo; then
412 # Avoid inline document here, it may be left over
414 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
415 # Yippee, $echo works!
417 else
418 # Restart under the correct shell, and then maybe $echo will work.
419 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
422 if test "X$1" = X--fallback-echo; then
423 # used as fallback echo
424 shift
425 cat <<EOF
428 exit $EXIT_SUCCESS
431 default_mode=
432 help="Try \`$progname --help' for more information."
433 magic="%%%MAGIC variable%%%"
434 mkdir="mkdir"
435 mv="mv -f"
436 rm="rm -f"
438 # Sed substitution that helps us do robust quoting. It backslashifies
439 # metacharacters that are still active within double-quoted strings.
440 Xsed="${SED}"' -e 1s/^X//'
441 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
442 # test EBCDIC or ASCII
443 case `echo A|tr A '\301'` in
444 A) # EBCDIC based system
445 SP2NL="tr '\100' '\n'"
446 NL2SP="tr '\r\n' '\100\100'"
448 *) # Assume ASCII based system
449 SP2NL="tr '\040' '\012'"
450 NL2SP="tr '\015\012' '\040\040'"
452 esac
454 # NLS nuisances.
455 # Only set LANG and LC_ALL to C if already set.
456 # These must not be set unconditionally because not all systems understand
457 # e.g. LANG=C (notably SCO).
458 # We save the old values to restore during execute mode.
459 if test "${LC_ALL+set}" = set; then
460 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
462 if test "${LANG+set}" = set; then
463 save_LANG="$LANG"; LANG=C; export LANG
466 # Make sure IFS has a sensible default
467 : ${IFS="
470 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
471 $echo "$modename: not configured to build any kind of library" 1>&2
472 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
473 exit $EXIT_FAILURE
476 # Global variables.
477 mode=$default_mode
478 nonopt=
479 prev=
480 prevopt=
481 run=
482 show="$echo"
483 show_help=
484 execute_dlfiles=
485 lo2o="s/\\.lo\$/.${objext}/"
486 o2lo="s/\\.${objext}\$/.lo/"
488 #####################################
489 # Shell function definitions:
490 # This seems to be the best place for them
492 # func_win32_libid arg
493 # return the library type of file 'arg'
495 # Need a lot of goo to handle *both* DLLs and import libs
496 # Has to be a shell function in order to 'eat' the argument
497 # that is supplied when $file_magic_command is called.
498 func_win32_libid () {
499 win32_libid_type="unknown"
500 win32_fileres=`file -L $1 2>/dev/null`
501 case $win32_fileres in
502 *ar\ archive\ import\ library*) # definitely import
503 win32_libid_type="x86 archive import"
505 *ar\ archive*) # could be an import, or static
506 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
507 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
508 win32_nmres=`eval $NM -f posix -A $1 | \
509 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
510 if test "X$win32_nmres" = "Ximport" ; then
511 win32_libid_type="x86 archive import"
512 else
513 win32_libid_type="x86 archive static"
517 *DLL*)
518 win32_libid_type="x86 DLL"
520 *executable*) # but shell scripts are "executable" too...
521 case $win32_fileres in
522 *MS\ Windows\ PE\ Intel*)
523 win32_libid_type="x86 DLL"
525 esac
527 esac
528 $echo $win32_libid_type
532 # func_infer_tag arg
533 # Infer tagged configuration to use if any are available and
534 # if one wasn't chosen via the "--tag" command line option.
535 # Only attempt this if the compiler in the base compile
536 # command doesn't match the default compiler.
537 # arg is usually of the form 'gcc ...'
538 func_infer_tag () {
539 if test -n "$available_tags" && test -z "$tagname"; then
540 CC_quoted=
541 for arg in $CC; do
542 case $arg in
543 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
544 arg="\"$arg\""
546 esac
547 CC_quoted="$CC_quoted $arg"
548 done
549 case $@ in
550 # Blanks in the command may have been stripped by the calling shell,
551 # but not from the CC environment variable when configure was run.
552 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
553 # Blanks at the start of $base_compile will cause this to fail
554 # if we don't check for them as well.
556 for z in $available_tags; do
557 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
558 # Evaluate the configuration.
559 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
560 CC_quoted=
561 for arg in $CC; do
562 # Double-quote args containing other shell metacharacters.
563 case $arg in
564 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
565 arg="\"$arg\""
567 esac
568 CC_quoted="$CC_quoted $arg"
569 done
570 case "$@ " in
571 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
572 # The compiler in the base compile command matches
573 # the one in the tagged configuration.
574 # Assume this is the tagged configuration we want.
575 tagname=$z
576 break
578 esac
580 done
581 # If $tagname still isn't set, then no tagged configuration
582 # was found and let the user know that the "--tag" command
583 # line option must be used.
584 if test -z "$tagname"; then
585 $echo "$modename: unable to infer tagged configuration"
586 $echo "$modename: specify a tag with \`--tag'" 1>&2
587 exit $EXIT_FAILURE
588 # else
589 # $echo "$modename: using $tagname tagged configuration"
592 esac
597 # func_extract_archives gentop oldlib ...
598 func_extract_archives () {
599 my_gentop="$1"; shift
600 my_oldlibs=${1+"$@"}
601 my_oldobjs=""
602 my_xlib=""
603 my_xabs=""
604 my_xdir=""
605 my_status=""
607 $show "${rm}r $my_gentop"
608 $run ${rm}r "$my_gentop"
609 $show "$mkdir $my_gentop"
610 $run $mkdir "$my_gentop"
611 my_status=$?
612 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
613 exit $my_status
616 for my_xlib in $my_oldlibs; do
617 # Extract the objects.
618 case $my_xlib in
619 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
620 *) my_xabs=`pwd`"/$my_xlib" ;;
621 esac
622 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
623 my_xdir="$my_gentop/$my_xlib"
625 $show "${rm}r $my_xdir"
626 $run ${rm}r "$my_xdir"
627 $show "$mkdir $my_xdir"
628 $run $mkdir "$my_xdir"
629 status=$?
630 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
631 exit $status
633 case $host in
634 *-darwin*)
635 $show "Extracting $my_xabs"
636 # Do not bother doing anything if just a dry run
637 if test -z "$run"; then
638 darwin_orig_dir=`pwd`
639 cd $my_xdir || exit $?
640 darwin_archive=$my_xabs
641 darwin_curdir=`pwd`
642 darwin_base_archive=`basename $darwin_archive`
643 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
644 if test -n "$darwin_arches"; then
645 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
646 darwin_arch=
647 $show "$darwin_base_archive has multiple architectures $darwin_arches"
648 for darwin_arch in $darwin_arches ; do
649 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
650 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
651 # Remove the table of contents from the thin files.
652 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
653 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
654 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
655 $AR -xo "${darwin_base_archive}"
656 rm "${darwin_base_archive}"
657 cd "$darwin_curdir"
658 done # $darwin_arches
659 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
660 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
661 darwin_file=
662 darwin_files=
663 for darwin_file in $darwin_filelist; do
664 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
665 lipo -create -output "$darwin_file" $darwin_files
666 done # $darwin_filelist
667 rm -rf unfat-$$
668 cd "$darwin_orig_dir"
669 else
670 cd $darwin_orig_dir
671 (cd $my_xdir && $AR x $my_xabs) || exit $?
672 fi # $darwin_arches
673 fi # $run
676 # We will extract separately just the conflicting names and we will
677 # no longer touch any unique names. It is faster to leave these
678 # extract automatically by $AR in one run.
679 $show "(cd $my_xdir && $AR x $my_xabs)"
680 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
681 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
683 else
684 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
685 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
686 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
689 while test "$i" -le "$count"
691 # Put our $i before any first dot (extension)
692 # Never overwrite any file
693 name_to="$name"
694 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
696 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
697 done
698 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
699 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
700 i=`expr $i + 1`
701 done
702 done
705 esac
706 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
707 done
709 func_extract_archives_result="$my_oldobjs"
711 # End of Shell function definitions
712 #####################################
714 # Darwin sucks
715 eval std_shrext=\"$shrext_cmds\"
717 # Parse our command line options once, thoroughly.
718 while test "$#" -gt 0
720 arg="$1"
721 shift
723 case $arg in
724 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
725 *) optarg= ;;
726 esac
728 # If the previous option needs an argument, assign it.
729 if test -n "$prev"; then
730 case $prev in
731 execute_dlfiles)
732 execute_dlfiles="$execute_dlfiles $arg"
734 tag)
735 tagname="$arg"
736 preserve_args="${preserve_args}=$arg"
738 # Check whether tagname contains only valid characters
739 case $tagname in
740 *[!-_A-Za-z0-9,/]*)
741 $echo "$progname: invalid tag name: $tagname" 1>&2
742 exit $EXIT_FAILURE
744 esac
746 case $tagname in
748 # Don't test for the "default" C tag, as we know, it's there, but
749 # not specially marked.
752 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
753 taglist="$taglist $tagname"
754 # Evaluate the configuration.
755 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
756 else
757 $echo "$progname: ignoring unknown tag $tagname" 1>&2
760 esac
763 eval "$prev=\$arg"
765 esac
767 prev=
768 prevopt=
769 continue
772 # Have we seen a non-optional argument yet?
773 case $arg in
774 --help)
775 show_help=yes
778 --version)
779 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
780 $echo
781 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
782 $echo "This is free software; see the source for copying conditions. There is NO"
783 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
784 exit $EXIT_SUCCESS
787 --config)
788 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
789 # Now print the configurations for the tags.
790 for tagname in $taglist; do
791 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
792 done
793 exit $EXIT_SUCCESS
796 --debug)
797 $echo "$progname: enabling shell trace mode"
798 set -x
799 preserve_args="$preserve_args $arg"
802 --dry-run | -n)
803 run=:
806 --features)
807 $echo "host: $host"
808 if test "$build_libtool_libs" = yes; then
809 $echo "enable shared libraries"
810 else
811 $echo "disable shared libraries"
813 if test "$build_old_libs" = yes; then
814 $echo "enable static libraries"
815 else
816 $echo "disable static libraries"
818 exit $EXIT_SUCCESS
821 --finish) mode="finish" ;;
823 --mode) prevopt="--mode" prev=mode ;;
824 --mode=*) mode="$optarg" ;;
826 --preserve-dup-deps) duplicate_deps="yes" ;;
828 --quiet | --silent)
829 show=:
830 preserve_args="$preserve_args $arg"
833 --tag) prevopt="--tag" prev=tag ;;
834 --tag=*)
835 set tag "$optarg" ${1+"$@"}
836 shift
837 prev=tag
838 preserve_args="$preserve_args --tag"
841 -dlopen)
842 prevopt="-dlopen"
843 prev=execute_dlfiles
847 $echo "$modename: unrecognized option \`$arg'" 1>&2
848 $echo "$help" 1>&2
849 exit $EXIT_FAILURE
853 nonopt="$arg"
854 break
856 esac
857 done
859 if test -n "$prevopt"; then
860 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
861 $echo "$help" 1>&2
862 exit $EXIT_FAILURE
865 # If this variable is set in any of the actions, the command in it
866 # will be execed at the end. This prevents here-documents from being
867 # left over by shells.
868 exec_cmd=
870 if test -z "$show_help"; then
872 # Infer the operation mode.
873 if test -z "$mode"; then
874 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
875 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
876 case $nonopt in
877 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
878 mode=link
879 for arg
881 case $arg in
883 mode=compile
884 break
886 esac
887 done
889 *db | *dbx | *strace | *truss)
890 mode=execute
892 *install*|cp|mv)
893 mode=install
895 *rm)
896 mode=uninstall
899 # If we have no mode, but dlfiles were specified, then do execute mode.
900 test -n "$execute_dlfiles" && mode=execute
902 # Just use the default operation mode.
903 if test -z "$mode"; then
904 if test -n "$nonopt"; then
905 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
906 else
907 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
911 esac
914 # Only execute mode is allowed to have -dlopen flags.
915 if test -n "$execute_dlfiles" && test "$mode" != execute; then
916 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
917 $echo "$help" 1>&2
918 exit $EXIT_FAILURE
921 # Change the help message to a mode-specific one.
922 generic_help="$help"
923 help="Try \`$modename --help --mode=$mode' for more information."
925 # These modes are in order of execution frequency so that they run quickly.
926 case $mode in
927 # libtool compile mode
928 compile)
929 modename="$modename: compile"
930 # Get the compilation command and the source file.
931 base_compile=
932 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
933 suppress_opt=yes
934 suppress_output=
935 arg_mode=normal
936 libobj=
937 later=
939 for arg
941 case "$arg_mode" in
942 arg )
943 # do not "continue". Instead, add this to base_compile
944 lastarg="$arg"
945 arg_mode=normal
948 target )
949 libobj="$arg"
950 arg_mode=normal
951 continue
954 normal )
955 # Accept any command-line options.
956 case $arg in
958 if test -n "$libobj" ; then
959 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
960 exit $EXIT_FAILURE
962 arg_mode=target
963 continue
966 -static | -prefer-pic | -prefer-non-pic)
967 later="$later $arg"
968 continue
971 -no-suppress)
972 suppress_opt=no
973 continue
976 -Xcompiler)
977 arg_mode=arg # the next one goes into the "base_compile" arg list
978 continue # The current "srcfile" will either be retained or
979 ;; # replaced later. I would guess that would be a bug.
981 -Wc,*)
982 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
983 lastarg=
984 save_ifs="$IFS"; IFS=','
985 for arg in $args; do
986 IFS="$save_ifs"
988 # Double-quote args containing other shell metacharacters.
989 # Many Bourne shells cannot handle close brackets correctly
990 # in scan sets, so we specify it separately.
991 case $arg in
992 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
993 arg="\"$arg\""
995 esac
996 lastarg="$lastarg $arg"
997 done
998 IFS="$save_ifs"
999 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1001 # Add the arguments to base_compile.
1002 base_compile="$base_compile $lastarg"
1003 continue
1007 # Accept the current argument as the source file.
1008 # The previous "srcfile" becomes the current argument.
1010 lastarg="$srcfile"
1011 srcfile="$arg"
1013 esac # case $arg
1015 esac # case $arg_mode
1017 # Aesthetically quote the previous argument.
1018 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1020 case $lastarg in
1021 # Double-quote args containing other shell metacharacters.
1022 # Many Bourne shells cannot handle close brackets correctly
1023 # in scan sets, so we specify it separately.
1024 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1025 lastarg="\"$lastarg\""
1027 esac
1029 base_compile="$base_compile $lastarg"
1030 done # for arg
1032 case $arg_mode in
1033 arg)
1034 $echo "$modename: you must specify an argument for -Xcompile"
1035 exit $EXIT_FAILURE
1037 target)
1038 $echo "$modename: you must specify a target with \`-o'" 1>&2
1039 exit $EXIT_FAILURE
1042 # Get the name of the library object.
1043 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1045 esac
1047 # Recognize several different file suffixes.
1048 # If the user specifies -o file.o, it is replaced with file.lo
1049 xform='[cCFSifmso]'
1050 case $libobj in
1051 *.ada) xform=ada ;;
1052 *.adb) xform=adb ;;
1053 *.ads) xform=ads ;;
1054 *.asm) xform=asm ;;
1055 *.c++) xform=c++ ;;
1056 *.cc) xform=cc ;;
1057 *.ii) xform=ii ;;
1058 *.class) xform=class ;;
1059 *.cpp) xform=cpp ;;
1060 *.cxx) xform=cxx ;;
1061 *.f90) xform=f90 ;;
1062 *.for) xform=for ;;
1063 *.java) xform=java ;;
1064 esac
1066 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1068 case $libobj in
1069 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1071 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1072 exit $EXIT_FAILURE
1074 esac
1076 func_infer_tag $base_compile
1078 for arg in $later; do
1079 case $arg in
1080 -static)
1081 build_old_libs=yes
1082 continue
1085 -prefer-pic)
1086 pic_mode=yes
1087 continue
1090 -prefer-non-pic)
1091 pic_mode=no
1092 continue
1094 esac
1095 done
1097 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1098 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1099 if test "X$xdir" = "X$obj"; then
1100 xdir=
1101 else
1102 xdir=$xdir/
1104 lobj=${xdir}$objdir/$objname
1106 if test -z "$base_compile"; then
1107 $echo "$modename: you must specify a compilation command" 1>&2
1108 $echo "$help" 1>&2
1109 exit $EXIT_FAILURE
1112 # Delete any leftover library objects.
1113 if test "$build_old_libs" = yes; then
1114 removelist="$obj $lobj $libobj ${libobj}T"
1115 else
1116 removelist="$lobj $libobj ${libobj}T"
1119 $run $rm $removelist
1120 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1122 # On Cygwin there's no "real" PIC flag so we must build both object types
1123 case $host_os in
1124 cygwin* | mingw* | pw32* | os2*)
1125 pic_mode=default
1127 esac
1128 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1129 # non-PIC code in shared libraries is not supported
1130 pic_mode=default
1133 # Calculate the filename of the output object if compiler does
1134 # not support -o with -c
1135 if test "$compiler_c_o" = no; then
1136 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1137 lockfile="$output_obj.lock"
1138 removelist="$removelist $output_obj $lockfile"
1139 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1140 else
1141 output_obj=
1142 need_locks=no
1143 lockfile=
1146 # Lock this critical section if it is needed
1147 # We use this script file to make the link, it avoids creating a new file
1148 if test "$need_locks" = yes; then
1149 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1150 $show "Waiting for $lockfile to be removed"
1151 sleep 2
1152 done
1153 elif test "$need_locks" = warn; then
1154 if test -f "$lockfile"; then
1155 $echo "\
1156 *** ERROR, $lockfile exists and contains:
1157 `cat $lockfile 2>/dev/null`
1159 This indicates that another process is trying to use the same
1160 temporary object file, and libtool could not work around it because
1161 your compiler does not support \`-c' and \`-o' together. If you
1162 repeat this compilation, it may succeed, by chance, but you had better
1163 avoid parallel builds (make -j) in this platform, or get a better
1164 compiler."
1166 $run $rm $removelist
1167 exit $EXIT_FAILURE
1169 $echo $srcfile > "$lockfile"
1172 if test -n "$fix_srcfile_path"; then
1173 eval srcfile=\"$fix_srcfile_path\"
1176 $run $rm "$libobj" "${libobj}T"
1178 # Create a libtool object file (analogous to a ".la" file),
1179 # but don't create it if we're doing a dry run.
1180 test -z "$run" && cat > ${libobj}T <<EOF
1181 # $libobj - a libtool object file
1182 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1184 # Please DO NOT delete this file!
1185 # It is necessary for linking the library.
1187 # Name of the PIC object.
1190 # Only build a PIC object if we are building libtool libraries.
1191 if test "$build_libtool_libs" = yes; then
1192 # Without this assignment, base_compile gets emptied.
1193 fbsd_hideous_sh_bug=$base_compile
1195 if test "$pic_mode" != no; then
1196 command="$base_compile $srcfile $pic_flag"
1197 else
1198 # Don't build PIC code
1199 command="$base_compile $srcfile"
1202 if test ! -d "${xdir}$objdir"; then
1203 $show "$mkdir ${xdir}$objdir"
1204 $run $mkdir ${xdir}$objdir
1205 status=$?
1206 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1207 exit $status
1211 if test -z "$output_obj"; then
1212 # Place PIC objects in $objdir
1213 command="$command -o $lobj"
1216 $run $rm "$lobj" "$output_obj"
1218 $show "$command"
1219 if $run eval "$command"; then :
1220 else
1221 test -n "$output_obj" && $run $rm $removelist
1222 exit $EXIT_FAILURE
1225 if test "$need_locks" = warn &&
1226 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1227 $echo "\
1228 *** ERROR, $lockfile contains:
1229 `cat $lockfile 2>/dev/null`
1231 but it should contain:
1232 $srcfile
1234 This indicates that another process is trying to use the same
1235 temporary object file, and libtool could not work around it because
1236 your compiler does not support \`-c' and \`-o' together. If you
1237 repeat this compilation, it may succeed, by chance, but you had better
1238 avoid parallel builds (make -j) in this platform, or get a better
1239 compiler."
1241 $run $rm $removelist
1242 exit $EXIT_FAILURE
1245 # Just move the object if needed, then go on to compile the next one
1246 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1247 $show "$mv $output_obj $lobj"
1248 if $run $mv $output_obj $lobj; then :
1249 else
1250 error=$?
1251 $run $rm $removelist
1252 exit $error
1256 # Append the name of the PIC object to the libtool object file.
1257 test -z "$run" && cat >> ${libobj}T <<EOF
1258 pic_object='$objdir/$objname'
1262 # Allow error messages only from the first compilation.
1263 if test "$suppress_opt" = yes; then
1264 suppress_output=' >/dev/null 2>&1'
1266 else
1267 # No PIC object so indicate it doesn't exist in the libtool
1268 # object file.
1269 test -z "$run" && cat >> ${libobj}T <<EOF
1270 pic_object=none
1275 # Only build a position-dependent object if we build old libraries.
1276 if test "$build_old_libs" = yes; then
1277 if test "$pic_mode" != yes; then
1278 # Don't build PIC code
1279 command="$base_compile $srcfile"
1280 else
1281 command="$base_compile $srcfile $pic_flag"
1283 if test "$compiler_c_o" = yes; then
1284 command="$command -o $obj"
1287 # Suppress compiler output if we already did a PIC compilation.
1288 command="$command$suppress_output"
1289 $run $rm "$obj" "$output_obj"
1290 $show "$command"
1291 if $run eval "$command"; then :
1292 else
1293 $run $rm $removelist
1294 exit $EXIT_FAILURE
1297 if test "$need_locks" = warn &&
1298 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1299 $echo "\
1300 *** ERROR, $lockfile contains:
1301 `cat $lockfile 2>/dev/null`
1303 but it should contain:
1304 $srcfile
1306 This indicates that another process is trying to use the same
1307 temporary object file, and libtool could not work around it because
1308 your compiler does not support \`-c' and \`-o' together. If you
1309 repeat this compilation, it may succeed, by chance, but you had better
1310 avoid parallel builds (make -j) in this platform, or get a better
1311 compiler."
1313 $run $rm $removelist
1314 exit $EXIT_FAILURE
1317 # Just move the object if needed
1318 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1319 $show "$mv $output_obj $obj"
1320 if $run $mv $output_obj $obj; then :
1321 else
1322 error=$?
1323 $run $rm $removelist
1324 exit $error
1328 # Append the name of the non-PIC object the libtool object file.
1329 # Only append if the libtool object file exists.
1330 test -z "$run" && cat >> ${libobj}T <<EOF
1331 # Name of the non-PIC object.
1332 non_pic_object='$objname'
1335 else
1336 # Append the name of the non-PIC object the libtool object file.
1337 # Only append if the libtool object file exists.
1338 test -z "$run" && cat >> ${libobj}T <<EOF
1339 # Name of the non-PIC object.
1340 non_pic_object=none
1345 $run $mv "${libobj}T" "${libobj}"
1347 # Unlock the critical section if it was locked
1348 if test "$need_locks" != no; then
1349 $run $rm "$lockfile"
1352 exit $EXIT_SUCCESS
1355 # libtool link mode
1356 link | relink)
1357 modename="$modename: link"
1358 case $host in
1359 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1360 # It is impossible to link a dll without this setting, and
1361 # we shouldn't force the makefile maintainer to figure out
1362 # which system we are compiling for in order to pass an extra
1363 # flag for every libtool invocation.
1364 # allow_undefined=no
1366 # FIXME: Unfortunately, there are problems with the above when trying
1367 # to make a dll which has undefined symbols, in which case not
1368 # even a static library is built. For now, we need to specify
1369 # -no-undefined on the libtool link line when we can be certain
1370 # that all symbols are satisfied, otherwise we get a static library.
1371 allow_undefined=yes
1374 allow_undefined=yes
1376 esac
1377 libtool_args="$nonopt"
1378 base_compile="$nonopt $@"
1379 compile_command="$nonopt"
1380 finalize_command="$nonopt"
1382 compile_rpath=
1383 finalize_rpath=
1384 compile_shlibpath=
1385 finalize_shlibpath=
1386 convenience=
1387 old_convenience=
1388 deplibs=
1389 old_deplibs=
1390 compiler_flags=
1391 linker_flags=
1392 dllsearchpath=
1393 lib_search_path=`pwd`
1394 inst_prefix_dir=
1396 avoid_version=no
1397 dlfiles=
1398 dlprefiles=
1399 dlself=no
1400 export_dynamic=no
1401 export_symbols=
1402 export_symbols_regex=
1403 generated=
1404 libobjs=
1405 ltlibs=
1406 module=no
1407 no_install=no
1408 objs=
1409 non_pic_objects=
1410 precious_files_regex=
1411 prefer_static_libs=no
1412 preload=no
1413 prev=
1414 prevarg=
1415 release=
1416 rpath=
1417 xrpath=
1418 perm_rpath=
1419 temp_rpath=
1420 thread_safe=no
1421 vinfo=
1422 vinfo_number=no
1424 func_infer_tag $base_compile
1426 # We need to know -static, to get the right output filenames.
1427 for arg
1429 case $arg in
1430 -all-static | -static)
1431 if test "X$arg" = "X-all-static"; then
1432 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1433 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1435 if test -n "$link_static_flag"; then
1436 dlopen_self=$dlopen_self_static
1438 else
1439 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1440 dlopen_self=$dlopen_self_static
1443 build_libtool_libs=no
1444 build_old_libs=yes
1445 prefer_static_libs=yes
1446 break
1448 esac
1449 done
1451 # See if our shared archives depend on static archives.
1452 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1454 # Go through the arguments, transforming them on the way.
1455 while test "$#" -gt 0; do
1456 arg="$1"
1457 shift
1458 case $arg in
1459 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1460 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1462 *) qarg=$arg ;;
1463 esac
1464 libtool_args="$libtool_args $qarg"
1466 # If the previous option needs an argument, assign it.
1467 if test -n "$prev"; then
1468 case $prev in
1469 output)
1470 compile_command="$compile_command @OUTPUT@"
1471 finalize_command="$finalize_command @OUTPUT@"
1473 esac
1475 case $prev in
1476 dlfiles|dlprefiles)
1477 if test "$preload" = no; then
1478 # Add the symbol object into the linking commands.
1479 compile_command="$compile_command @SYMFILE@"
1480 finalize_command="$finalize_command @SYMFILE@"
1481 preload=yes
1483 case $arg in
1484 *.la | *.lo) ;; # We handle these cases below.
1485 force)
1486 if test "$dlself" = no; then
1487 dlself=needless
1488 export_dynamic=yes
1490 prev=
1491 continue
1493 self)
1494 if test "$prev" = dlprefiles; then
1495 dlself=yes
1496 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1497 dlself=yes
1498 else
1499 dlself=needless
1500 export_dynamic=yes
1502 prev=
1503 continue
1506 if test "$prev" = dlfiles; then
1507 dlfiles="$dlfiles $arg"
1508 else
1509 dlprefiles="$dlprefiles $arg"
1511 prev=
1512 continue
1514 esac
1516 expsyms)
1517 export_symbols="$arg"
1518 if test ! -f "$arg"; then
1519 $echo "$modename: symbol file \`$arg' does not exist"
1520 exit $EXIT_FAILURE
1522 prev=
1523 continue
1525 expsyms_regex)
1526 export_symbols_regex="$arg"
1527 prev=
1528 continue
1530 inst_prefix)
1531 inst_prefix_dir="$arg"
1532 prev=
1533 continue
1535 precious_regex)
1536 precious_files_regex="$arg"
1537 prev=
1538 continue
1540 release)
1541 release="-$arg"
1542 prev=
1543 continue
1545 objectlist)
1546 if test -f "$arg"; then
1547 save_arg=$arg
1548 moreargs=
1549 for fil in `cat $save_arg`
1551 # moreargs="$moreargs $fil"
1552 arg=$fil
1553 # A libtool-controlled object.
1555 # Check to see that this really is a libtool object.
1556 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1557 pic_object=
1558 non_pic_object=
1560 # Read the .lo file
1561 # If there is no directory component, then add one.
1562 case $arg in
1563 */* | *\\*) . $arg ;;
1564 *) . ./$arg ;;
1565 esac
1567 if test -z "$pic_object" || \
1568 test -z "$non_pic_object" ||
1569 test "$pic_object" = none && \
1570 test "$non_pic_object" = none; then
1571 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1572 exit $EXIT_FAILURE
1575 # Extract subdirectory from the argument.
1576 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1577 if test "X$xdir" = "X$arg"; then
1578 xdir=
1579 else
1580 xdir="$xdir/"
1583 if test "$pic_object" != none; then
1584 # Prepend the subdirectory the object is found in.
1585 pic_object="$xdir$pic_object"
1587 if test "$prev" = dlfiles; then
1588 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1589 dlfiles="$dlfiles $pic_object"
1590 prev=
1591 continue
1592 else
1593 # If libtool objects are unsupported, then we need to preload.
1594 prev=dlprefiles
1598 # CHECK ME: I think I busted this. -Ossama
1599 if test "$prev" = dlprefiles; then
1600 # Preload the old-style object.
1601 dlprefiles="$dlprefiles $pic_object"
1602 prev=
1605 # A PIC object.
1606 libobjs="$libobjs $pic_object"
1607 arg="$pic_object"
1610 # Non-PIC object.
1611 if test "$non_pic_object" != none; then
1612 # Prepend the subdirectory the object is found in.
1613 non_pic_object="$xdir$non_pic_object"
1615 # A standard non-PIC object
1616 non_pic_objects="$non_pic_objects $non_pic_object"
1617 if test -z "$pic_object" || test "$pic_object" = none ; then
1618 arg="$non_pic_object"
1621 else
1622 # Only an error if not doing a dry-run.
1623 if test -z "$run"; then
1624 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1625 exit $EXIT_FAILURE
1626 else
1627 # Dry-run case.
1629 # Extract subdirectory from the argument.
1630 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1631 if test "X$xdir" = "X$arg"; then
1632 xdir=
1633 else
1634 xdir="$xdir/"
1637 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1638 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1639 libobjs="$libobjs $pic_object"
1640 non_pic_objects="$non_pic_objects $non_pic_object"
1643 done
1644 else
1645 $echo "$modename: link input file \`$save_arg' does not exist"
1646 exit $EXIT_FAILURE
1648 arg=$save_arg
1649 prev=
1650 continue
1652 rpath | xrpath)
1653 # We need an absolute path.
1654 case $arg in
1655 [\\/]* | [A-Za-z]:[\\/]*) ;;
1657 $echo "$modename: only absolute run-paths are allowed" 1>&2
1658 exit $EXIT_FAILURE
1660 esac
1661 if test "$prev" = rpath; then
1662 case "$rpath " in
1663 *" $arg "*) ;;
1664 *) rpath="$rpath $arg" ;;
1665 esac
1666 else
1667 case "$xrpath " in
1668 *" $arg "*) ;;
1669 *) xrpath="$xrpath $arg" ;;
1670 esac
1672 prev=
1673 continue
1675 xcompiler)
1676 compiler_flags="$compiler_flags $qarg"
1677 prev=
1678 compile_command="$compile_command $qarg"
1679 finalize_command="$finalize_command $qarg"
1680 continue
1682 xlinker)
1683 linker_flags="$linker_flags $qarg"
1684 compiler_flags="$compiler_flags $wl$qarg"
1685 prev=
1686 compile_command="$compile_command $wl$qarg"
1687 finalize_command="$finalize_command $wl$qarg"
1688 continue
1690 xcclinker)
1691 linker_flags="$linker_flags $qarg"
1692 compiler_flags="$compiler_flags $qarg"
1693 prev=
1694 compile_command="$compile_command $qarg"
1695 finalize_command="$finalize_command $qarg"
1696 continue
1698 shrext)
1699 shrext_cmds="$arg"
1700 prev=
1701 continue
1704 eval "$prev=\"\$arg\""
1705 prev=
1706 continue
1708 esac
1709 fi # test -n "$prev"
1711 prevarg="$arg"
1713 case $arg in
1714 -all-static)
1715 if test -n "$link_static_flag"; then
1716 compile_command="$compile_command $link_static_flag"
1717 finalize_command="$finalize_command $link_static_flag"
1719 continue
1722 -allow-undefined)
1723 # FIXME: remove this flag sometime in the future.
1724 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1725 continue
1728 -avoid-version)
1729 avoid_version=yes
1730 continue
1733 -dlopen)
1734 prev=dlfiles
1735 continue
1738 -dlpreopen)
1739 prev=dlprefiles
1740 continue
1743 -export-dynamic)
1744 export_dynamic=yes
1745 continue
1748 -export-symbols | -export-symbols-regex)
1749 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1750 $echo "$modename: more than one -exported-symbols argument is not allowed"
1751 exit $EXIT_FAILURE
1753 if test "X$arg" = "X-export-symbols"; then
1754 prev=expsyms
1755 else
1756 prev=expsyms_regex
1758 continue
1761 -inst-prefix-dir)
1762 prev=inst_prefix
1763 continue
1766 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1767 # so, if we see these flags be careful not to treat them like -L
1768 -L[A-Z][A-Z]*:*)
1769 case $with_gcc/$host in
1770 no/*-*-irix* | /*-*-irix*)
1771 compile_command="$compile_command $arg"
1772 finalize_command="$finalize_command $arg"
1774 esac
1775 continue
1778 -L*)
1779 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1780 # We need an absolute path.
1781 case $dir in
1782 [\\/]* | [A-Za-z]:[\\/]*) ;;
1784 absdir=`cd "$dir" && pwd`
1785 if test -z "$absdir"; then
1786 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1787 exit $EXIT_FAILURE
1789 dir="$absdir"
1791 esac
1792 case "$deplibs " in
1793 *" -L$dir "*) ;;
1795 deplibs="$deplibs -L$dir"
1796 lib_search_path="$lib_search_path $dir"
1798 esac
1799 case $host in
1800 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1801 case :$dllsearchpath: in
1802 *":$dir:"*) ;;
1803 *) dllsearchpath="$dllsearchpath:$dir";;
1804 esac
1806 esac
1807 continue
1810 -l*)
1811 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1812 case $host in
1813 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1814 # These systems don't actually have a C or math library (as such)
1815 continue
1817 *-*-mingw* | *-*-os2*)
1818 # These systems don't actually have a C library (as such)
1819 test "X$arg" = "X-lc" && continue
1821 *-*-openbsd* | *-*-freebsd*)
1822 # Do not include libc due to us having libc/libc_r.
1823 test "X$arg" = "X-lc" && continue
1825 *-*-rhapsody* | *-*-darwin1.[012])
1826 # Rhapsody C and math libraries are in the System framework
1827 deplibs="$deplibs -framework System"
1828 continue
1829 esac
1830 elif test "X$arg" = "X-lc_r"; then
1831 case $host in
1832 *-*-openbsd* | *-*-freebsd*)
1833 # Do not include libc_r directly, use -pthread flag.
1834 continue
1836 esac
1838 deplibs="$deplibs $arg"
1839 continue
1842 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1843 deplibs="$deplibs $arg"
1844 continue
1847 -module)
1848 module=yes
1849 continue
1852 # gcc -m* arguments should be passed to the linker via $compiler_flags
1853 # in order to pass architecture information to the linker
1854 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1855 # but this is not reliable with gcc because gcc may use -mfoo to
1856 # select a different linker, different libraries, etc, while
1857 # -Wl,-mfoo simply passes -mfoo to the linker.
1858 -m*)
1859 # Unknown arguments in both finalize_command and compile_command need
1860 # to be aesthetically quoted because they are evaled later.
1861 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1862 case $arg in
1863 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1864 arg="\"$arg\""
1866 esac
1867 compile_command="$compile_command $arg"
1868 finalize_command="$finalize_command $arg"
1869 if test "$with_gcc" = "yes" ; then
1870 compiler_flags="$compiler_flags $arg"
1872 continue
1875 -shrext)
1876 prev=shrext
1877 continue
1880 -no-fast-install)
1881 fast_install=no
1882 continue
1885 -no-install)
1886 case $host in
1887 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1888 # The PATH hackery in wrapper scripts is required on Windows
1889 # in order for the loader to find any dlls it needs.
1890 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1891 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1892 fast_install=no
1894 *) no_install=yes ;;
1895 esac
1896 continue
1899 -no-undefined)
1900 allow_undefined=no
1901 continue
1904 -objectlist)
1905 prev=objectlist
1906 continue
1909 -o) prev=output ;;
1911 -precious-files-regex)
1912 prev=precious_regex
1913 continue
1916 -release)
1917 prev=release
1918 continue
1921 -rpath)
1922 prev=rpath
1923 continue
1927 prev=xrpath
1928 continue
1931 -R*)
1932 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1933 # We need an absolute path.
1934 case $dir in
1935 [\\/]* | [A-Za-z]:[\\/]*) ;;
1937 $echo "$modename: only absolute run-paths are allowed" 1>&2
1938 exit $EXIT_FAILURE
1940 esac
1941 case "$xrpath " in
1942 *" $dir "*) ;;
1943 *) xrpath="$xrpath $dir" ;;
1944 esac
1945 continue
1948 -static)
1949 # The effects of -static are defined in a previous loop.
1950 # We used to do the same as -all-static on platforms that
1951 # didn't have a PIC flag, but the assumption that the effects
1952 # would be equivalent was wrong. It would break on at least
1953 # Digital Unix and AIX.
1954 continue
1957 -thread-safe)
1958 thread_safe=yes
1959 continue
1962 -version-info)
1963 prev=vinfo
1964 continue
1966 -version-number)
1967 prev=vinfo
1968 vinfo_number=yes
1969 continue
1972 -Wc,*)
1973 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1974 arg=
1975 save_ifs="$IFS"; IFS=','
1976 for flag in $args; do
1977 IFS="$save_ifs"
1978 case $flag in
1979 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1980 flag="\"$flag\""
1982 esac
1983 arg="$arg $wl$flag"
1984 compiler_flags="$compiler_flags $flag"
1985 done
1986 IFS="$save_ifs"
1987 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1990 -Wl,*)
1991 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1992 arg=
1993 save_ifs="$IFS"; IFS=','
1994 for flag in $args; do
1995 IFS="$save_ifs"
1996 case $flag in
1997 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1998 flag="\"$flag\""
2000 esac
2001 arg="$arg $wl$flag"
2002 compiler_flags="$compiler_flags $wl$flag"
2003 linker_flags="$linker_flags $flag"
2004 done
2005 IFS="$save_ifs"
2006 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2009 -Xcompiler)
2010 prev=xcompiler
2011 continue
2014 -Xlinker)
2015 prev=xlinker
2016 continue
2019 -XCClinker)
2020 prev=xcclinker
2021 continue
2024 # Some other compiler flag.
2025 -* | +*)
2026 # Unknown arguments in both finalize_command and compile_command need
2027 # to be aesthetically quoted because they are evaled later.
2028 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2029 case $arg in
2030 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2031 arg="\"$arg\""
2033 esac
2036 *.$objext)
2037 # A standard object.
2038 objs="$objs $arg"
2041 *.lo)
2042 # A libtool-controlled object.
2044 # Check to see that this really is a libtool object.
2045 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2046 pic_object=
2047 non_pic_object=
2049 # Read the .lo file
2050 # If there is no directory component, then add one.
2051 case $arg in
2052 */* | *\\*) . $arg ;;
2053 *) . ./$arg ;;
2054 esac
2056 if test -z "$pic_object" || \
2057 test -z "$non_pic_object" ||
2058 test "$pic_object" = none && \
2059 test "$non_pic_object" = none; then
2060 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2061 exit $EXIT_FAILURE
2064 # Extract subdirectory from the argument.
2065 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2066 if test "X$xdir" = "X$arg"; then
2067 xdir=
2068 else
2069 xdir="$xdir/"
2072 if test "$pic_object" != none; then
2073 # Prepend the subdirectory the object is found in.
2074 pic_object="$xdir$pic_object"
2076 if test "$prev" = dlfiles; then
2077 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2078 dlfiles="$dlfiles $pic_object"
2079 prev=
2080 continue
2081 else
2082 # If libtool objects are unsupported, then we need to preload.
2083 prev=dlprefiles
2087 # CHECK ME: I think I busted this. -Ossama
2088 if test "$prev" = dlprefiles; then
2089 # Preload the old-style object.
2090 dlprefiles="$dlprefiles $pic_object"
2091 prev=
2094 # A PIC object.
2095 libobjs="$libobjs $pic_object"
2096 arg="$pic_object"
2099 # Non-PIC object.
2100 if test "$non_pic_object" != none; then
2101 # Prepend the subdirectory the object is found in.
2102 non_pic_object="$xdir$non_pic_object"
2104 # A standard non-PIC object
2105 non_pic_objects="$non_pic_objects $non_pic_object"
2106 if test -z "$pic_object" || test "$pic_object" = none ; then
2107 arg="$non_pic_object"
2110 else
2111 # Only an error if not doing a dry-run.
2112 if test -z "$run"; then
2113 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2114 exit $EXIT_FAILURE
2115 else
2116 # Dry-run case.
2118 # Extract subdirectory from the argument.
2119 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2120 if test "X$xdir" = "X$arg"; then
2121 xdir=
2122 else
2123 xdir="$xdir/"
2126 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2127 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2128 libobjs="$libobjs $pic_object"
2129 non_pic_objects="$non_pic_objects $non_pic_object"
2134 *.$libext)
2135 # An archive.
2136 deplibs="$deplibs $arg"
2137 old_deplibs="$old_deplibs $arg"
2138 continue
2141 *.la)
2142 # A libtool-controlled library.
2144 if test "$prev" = dlfiles; then
2145 # This library was specified with -dlopen.
2146 dlfiles="$dlfiles $arg"
2147 prev=
2148 elif test "$prev" = dlprefiles; then
2149 # The library was specified with -dlpreopen.
2150 dlprefiles="$dlprefiles $arg"
2151 prev=
2152 else
2153 deplibs="$deplibs $arg"
2155 continue
2158 # Some other compiler argument.
2160 # Unknown arguments in both finalize_command and compile_command need
2161 # to be aesthetically quoted because they are evaled later.
2162 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2163 case $arg in
2164 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2165 arg="\"$arg\""
2167 esac
2169 esac # arg
2171 # Now actually substitute the argument into the commands.
2172 if test -n "$arg"; then
2173 compile_command="$compile_command $arg"
2174 finalize_command="$finalize_command $arg"
2176 done # argument parsing loop
2178 if test -n "$prev"; then
2179 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2180 $echo "$help" 1>&2
2181 exit $EXIT_FAILURE
2184 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2185 eval arg=\"$export_dynamic_flag_spec\"
2186 compile_command="$compile_command $arg"
2187 finalize_command="$finalize_command $arg"
2190 oldlibs=
2191 # calculate the name of the file, without its directory
2192 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2193 libobjs_save="$libobjs"
2195 if test -n "$shlibpath_var"; then
2196 # get the directories listed in $shlibpath_var
2197 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2198 else
2199 shlib_search_path=
2201 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2202 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2204 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2205 if test "X$output_objdir" = "X$output"; then
2206 output_objdir="$objdir"
2207 else
2208 output_objdir="$output_objdir/$objdir"
2210 # Create the object directory.
2211 if test ! -d "$output_objdir"; then
2212 $show "$mkdir $output_objdir"
2213 $run $mkdir $output_objdir
2214 status=$?
2215 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2216 exit $status
2220 # Determine the type of output
2221 case $output in
2223 $echo "$modename: you must specify an output file" 1>&2
2224 $echo "$help" 1>&2
2225 exit $EXIT_FAILURE
2227 *.$libext) linkmode=oldlib ;;
2228 *.lo | *.$objext) linkmode=obj ;;
2229 *.la) linkmode=lib ;;
2230 *) linkmode=prog ;; # Anything else should be a program.
2231 esac
2233 case $host in
2234 *cygwin* | *mingw* | *pw32*)
2235 # don't eliminate duplications in $postdeps and $predeps
2236 duplicate_compiler_generated_deps=yes
2239 duplicate_compiler_generated_deps=$duplicate_deps
2241 esac
2242 specialdeplibs=
2244 libs=
2245 # Find all interdependent deplibs by searching for libraries
2246 # that are linked more than once (e.g. -la -lb -la)
2247 for deplib in $deplibs; do
2248 if test "X$duplicate_deps" = "Xyes" ; then
2249 case "$libs " in
2250 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2251 esac
2253 libs="$libs $deplib"
2254 done
2256 if test "$linkmode" = lib; then
2257 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2259 # Compute libraries that are listed more than once in $predeps
2260 # $postdeps and mark them as special (i.e., whose duplicates are
2261 # not to be eliminated).
2262 pre_post_deps=
2263 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2264 for pre_post_dep in $predeps $postdeps; do
2265 case "$pre_post_deps " in
2266 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2267 esac
2268 pre_post_deps="$pre_post_deps $pre_post_dep"
2269 done
2271 pre_post_deps=
2274 deplibs=
2275 newdependency_libs=
2276 newlib_search_path=
2277 need_relink=no # whether we're linking any uninstalled libtool libraries
2278 notinst_deplibs= # not-installed libtool libraries
2279 notinst_path= # paths that contain not-installed libtool libraries
2280 case $linkmode in
2281 lib)
2282 passes="conv link"
2283 for file in $dlfiles $dlprefiles; do
2284 case $file in
2285 *.la) ;;
2287 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2288 exit $EXIT_FAILURE
2290 esac
2291 done
2293 prog)
2294 compile_deplibs=
2295 finalize_deplibs=
2296 alldeplibs=no
2297 newdlfiles=
2298 newdlprefiles=
2299 passes="conv scan dlopen dlpreopen link"
2301 *) passes="conv"
2303 esac
2304 for pass in $passes; do
2305 if test "$linkmode,$pass" = "lib,link" ||
2306 test "$linkmode,$pass" = "prog,scan"; then
2307 libs="$deplibs"
2308 deplibs=
2310 if test "$linkmode" = prog; then
2311 case $pass in
2312 dlopen) libs="$dlfiles" ;;
2313 dlpreopen) libs="$dlprefiles" ;;
2314 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2315 esac
2317 if test "$pass" = dlopen; then
2318 # Collect dlpreopened libraries
2319 save_deplibs="$deplibs"
2320 deplibs=
2322 for deplib in $libs; do
2323 lib=
2324 found=no
2325 case $deplib in
2326 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2327 if test "$linkmode,$pass" = "prog,link"; then
2328 compile_deplibs="$deplib $compile_deplibs"
2329 finalize_deplibs="$deplib $finalize_deplibs"
2330 else
2331 deplibs="$deplib $deplibs"
2333 continue
2335 -l*)
2336 if test "$linkmode" != lib && test "$linkmode" != prog; then
2337 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2338 continue
2340 if test "$pass" = conv; then
2341 deplibs="$deplib $deplibs"
2342 continue
2344 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2345 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2346 for search_ext in .la $std_shrext .so .a; do
2347 # Search the libtool library
2348 lib="$searchdir/lib${name}${search_ext}"
2349 if test -f "$lib"; then
2350 if test "$search_ext" = ".la"; then
2351 found=yes
2352 else
2353 found=no
2355 break 2
2357 done
2358 done
2359 if test "$found" != yes; then
2360 # deplib doesn't seem to be a libtool library
2361 if test "$linkmode,$pass" = "prog,link"; then
2362 compile_deplibs="$deplib $compile_deplibs"
2363 finalize_deplibs="$deplib $finalize_deplibs"
2364 else
2365 deplibs="$deplib $deplibs"
2366 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2368 continue
2369 else # deplib is a libtool library
2370 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2371 # We need to do some special things here, and not later.
2372 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2373 case " $predeps $postdeps " in
2374 *" $deplib "*)
2375 if (${SED} -e '2q' $lib |
2376 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2377 library_names=
2378 old_library=
2379 case $lib in
2380 */* | *\\*) . $lib ;;
2381 *) . ./$lib ;;
2382 esac
2383 for l in $old_library $library_names; do
2384 ll="$l"
2385 done
2386 if test "X$ll" = "X$old_library" ; then # only static version available
2387 found=no
2388 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2389 test "X$ladir" = "X$lib" && ladir="."
2390 lib=$ladir/$old_library
2391 if test "$linkmode,$pass" = "prog,link"; then
2392 compile_deplibs="$deplib $compile_deplibs"
2393 finalize_deplibs="$deplib $finalize_deplibs"
2394 else
2395 deplibs="$deplib $deplibs"
2396 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2398 continue
2402 *) ;;
2403 esac
2406 ;; # -l
2407 -L*)
2408 case $linkmode in
2409 lib)
2410 deplibs="$deplib $deplibs"
2411 test "$pass" = conv && continue
2412 newdependency_libs="$deplib $newdependency_libs"
2413 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2415 prog)
2416 if test "$pass" = conv; then
2417 deplibs="$deplib $deplibs"
2418 continue
2420 if test "$pass" = scan; then
2421 deplibs="$deplib $deplibs"
2422 else
2423 compile_deplibs="$deplib $compile_deplibs"
2424 finalize_deplibs="$deplib $finalize_deplibs"
2426 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2429 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2431 esac # linkmode
2432 continue
2433 ;; # -L
2434 -R*)
2435 if test "$pass" = link; then
2436 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2437 # Make sure the xrpath contains only unique directories.
2438 case "$xrpath " in
2439 *" $dir "*) ;;
2440 *) xrpath="$xrpath $dir" ;;
2441 esac
2443 deplibs="$deplib $deplibs"
2444 continue
2446 *.la) lib="$deplib" ;;
2447 *.$libext)
2448 if test "$pass" = conv; then
2449 deplibs="$deplib $deplibs"
2450 continue
2452 case $linkmode in
2453 lib)
2454 valid_a_lib=no
2455 case $deplibs_check_method in
2456 match_pattern*)
2457 set dummy $deplibs_check_method
2458 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2459 if eval $echo \"$deplib\" 2>/dev/null \
2460 | $SED 10q \
2461 | $EGREP "$match_pattern_regex" > /dev/null; then
2462 valid_a_lib=yes
2465 pass_all)
2466 valid_a_lib=yes
2468 esac
2469 if test "$valid_a_lib" != yes; then
2470 $echo
2471 $echo "*** Warning: Trying to link with static lib archive $deplib."
2472 $echo "*** I have the capability to make that library automatically link in when"
2473 $echo "*** you link to this library. But I can only do this if you have a"
2474 $echo "*** shared version of the library, which you do not appear to have"
2475 $echo "*** because the file extensions .$libext of this argument makes me believe"
2476 $echo "*** that it is just a static archive that I should not used here."
2477 else
2478 $echo
2479 $echo "*** Warning: Linking the shared library $output against the"
2480 $echo "*** static library $deplib is not portable!"
2481 deplibs="$deplib $deplibs"
2483 continue
2485 prog)
2486 if test "$pass" != link; then
2487 deplibs="$deplib $deplibs"
2488 else
2489 compile_deplibs="$deplib $compile_deplibs"
2490 finalize_deplibs="$deplib $finalize_deplibs"
2492 continue
2494 esac # linkmode
2495 ;; # *.$libext
2496 *.lo | *.$objext)
2497 if test "$pass" = conv; then
2498 deplibs="$deplib $deplibs"
2499 elif test "$linkmode" = prog; then
2500 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2501 # If there is no dlopen support or we're linking statically,
2502 # we need to preload.
2503 newdlprefiles="$newdlprefiles $deplib"
2504 compile_deplibs="$deplib $compile_deplibs"
2505 finalize_deplibs="$deplib $finalize_deplibs"
2506 else
2507 newdlfiles="$newdlfiles $deplib"
2510 continue
2512 %DEPLIBS%)
2513 alldeplibs=yes
2514 continue
2516 esac # case $deplib
2517 if test "$found" = yes || test -f "$lib"; then :
2518 else
2519 $echo "$modename: cannot find the library \`$lib'" 1>&2
2520 exit $EXIT_FAILURE
2523 # Check to see that this really is a libtool archive.
2524 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2525 else
2526 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2527 exit $EXIT_FAILURE
2530 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2531 test "X$ladir" = "X$lib" && ladir="."
2533 dlname=
2534 dlopen=
2535 dlpreopen=
2536 libdir=
2537 library_names=
2538 old_library=
2539 # If the library was installed with an old release of libtool,
2540 # it will not redefine variables installed, or shouldnotlink
2541 installed=yes
2542 shouldnotlink=no
2544 # Read the .la file
2545 case $lib in
2546 */* | *\\*) . $lib ;;
2547 *) . ./$lib ;;
2548 esac
2550 if test "$linkmode,$pass" = "lib,link" ||
2551 test "$linkmode,$pass" = "prog,scan" ||
2552 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2553 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2554 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2557 if test "$pass" = conv; then
2558 # Only check for convenience libraries
2559 deplibs="$lib $deplibs"
2560 if test -z "$libdir"; then
2561 if test -z "$old_library"; then
2562 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2563 exit $EXIT_FAILURE
2565 # It is a libtool convenience library, so add in its objects.
2566 convenience="$convenience $ladir/$objdir/$old_library"
2567 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2568 tmp_libs=
2569 for deplib in $dependency_libs; do
2570 deplibs="$deplib $deplibs"
2571 if test "X$duplicate_deps" = "Xyes" ; then
2572 case "$tmp_libs " in
2573 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2574 esac
2576 tmp_libs="$tmp_libs $deplib"
2577 done
2578 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2579 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2580 exit $EXIT_FAILURE
2582 continue
2583 fi # $pass = conv
2586 # Get the name of the library we link against.
2587 linklib=
2588 for l in $old_library $library_names; do
2589 linklib="$l"
2590 done
2591 if test -z "$linklib"; then
2592 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2593 exit $EXIT_FAILURE
2596 # This library was specified with -dlopen.
2597 if test "$pass" = dlopen; then
2598 if test -z "$libdir"; then
2599 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2600 exit $EXIT_FAILURE
2602 if test -z "$dlname" ||
2603 test "$dlopen_support" != yes ||
2604 test "$build_libtool_libs" = no; then
2605 # If there is no dlname, no dlopen support or we're linking
2606 # statically, we need to preload. We also need to preload any
2607 # dependent libraries so libltdl's deplib preloader doesn't
2608 # bomb out in the load deplibs phase.
2609 dlprefiles="$dlprefiles $lib $dependency_libs"
2610 else
2611 newdlfiles="$newdlfiles $lib"
2613 continue
2614 fi # $pass = dlopen
2616 # We need an absolute path.
2617 case $ladir in
2618 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2620 abs_ladir=`cd "$ladir" && pwd`
2621 if test -z "$abs_ladir"; then
2622 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2623 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2624 abs_ladir="$ladir"
2627 esac
2628 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2630 # Find the relevant object directory and library name.
2631 if test "X$installed" = Xyes; then
2632 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2633 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2634 dir="$ladir"
2635 absdir="$abs_ladir"
2636 libdir="$abs_ladir"
2637 else
2638 dir="$libdir"
2639 absdir="$libdir"
2641 else
2642 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2643 dir="$ladir"
2644 absdir="$abs_ladir"
2645 # Remove this search path later
2646 notinst_path="$notinst_path $abs_ladir"
2647 else
2648 dir="$ladir/$objdir"
2649 absdir="$abs_ladir/$objdir"
2650 # Remove this search path later
2651 notinst_path="$notinst_path $abs_ladir"
2653 fi # $installed = yes
2654 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2656 # This library was specified with -dlpreopen.
2657 if test "$pass" = dlpreopen; then
2658 if test -z "$libdir"; then
2659 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2660 exit $EXIT_FAILURE
2662 # Prefer using a static library (so that no silly _DYNAMIC symbols
2663 # are required to link).
2664 if test -n "$old_library"; then
2665 newdlprefiles="$newdlprefiles $dir/$old_library"
2666 # Otherwise, use the dlname, so that lt_dlopen finds it.
2667 elif test -n "$dlname"; then
2668 newdlprefiles="$newdlprefiles $dir/$dlname"
2669 else
2670 newdlprefiles="$newdlprefiles $dir/$linklib"
2672 fi # $pass = dlpreopen
2674 if test -z "$libdir"; then
2675 # Link the convenience library
2676 if test "$linkmode" = lib; then
2677 deplibs="$dir/$old_library $deplibs"
2678 elif test "$linkmode,$pass" = "prog,link"; then
2679 compile_deplibs="$dir/$old_library $compile_deplibs"
2680 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2681 else
2682 deplibs="$lib $deplibs" # used for prog,scan pass
2684 continue
2688 if test "$linkmode" = prog && test "$pass" != link; then
2689 newlib_search_path="$newlib_search_path $ladir"
2690 deplibs="$lib $deplibs"
2692 linkalldeplibs=no
2693 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2694 test "$build_libtool_libs" = no; then
2695 linkalldeplibs=yes
2698 tmp_libs=
2699 for deplib in $dependency_libs; do
2700 case $deplib in
2701 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2702 esac
2703 # Need to link against all dependency_libs?
2704 if test "$linkalldeplibs" = yes; then
2705 deplibs="$deplib $deplibs"
2706 else
2707 # Need to hardcode shared library paths
2708 # or/and link against static libraries
2709 newdependency_libs="$deplib $newdependency_libs"
2711 if test "X$duplicate_deps" = "Xyes" ; then
2712 case "$tmp_libs " in
2713 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2714 esac
2716 tmp_libs="$tmp_libs $deplib"
2717 done # for deplib
2718 continue
2719 fi # $linkmode = prog...
2721 if test "$linkmode,$pass" = "prog,link"; then
2722 if test -n "$library_names" &&
2723 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2724 # We need to hardcode the library path
2725 if test -n "$shlibpath_var"; then
2726 # Make sure the rpath contains only unique directories.
2727 case "$temp_rpath " in
2728 *" $dir "*) ;;
2729 *" $absdir "*) ;;
2730 *) temp_rpath="$temp_rpath $dir" ;;
2731 esac
2734 # Hardcode the library path.
2735 # Skip directories that are in the system default run-time
2736 # search path.
2737 case " $sys_lib_dlsearch_path " in
2738 *" $absdir "*) ;;
2740 case "$compile_rpath " in
2741 *" $absdir "*) ;;
2742 *) compile_rpath="$compile_rpath $absdir"
2743 esac
2745 esac
2746 case " $sys_lib_dlsearch_path " in
2747 *" $libdir "*) ;;
2749 case "$finalize_rpath " in
2750 *" $libdir "*) ;;
2751 *) finalize_rpath="$finalize_rpath $libdir"
2752 esac
2754 esac
2755 fi # $linkmode,$pass = prog,link...
2757 if test "$alldeplibs" = yes &&
2758 { test "$deplibs_check_method" = pass_all ||
2759 { test "$build_libtool_libs" = yes &&
2760 test -n "$library_names"; }; }; then
2761 # We only need to search for static libraries
2762 continue
2766 link_static=no # Whether the deplib will be linked statically
2767 if test -n "$library_names" &&
2768 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2769 if test "$installed" = no; then
2770 notinst_deplibs="$notinst_deplibs $lib"
2771 need_relink=yes
2773 # This is a shared library
2775 # Warn about portability, can't link against -module's on
2776 # some systems (darwin)
2777 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2778 $echo
2779 if test "$linkmode" = prog; then
2780 $echo "*** Warning: Linking the executable $output against the loadable module"
2781 else
2782 $echo "*** Warning: Linking the shared library $output against the loadable module"
2784 $echo "*** $linklib is not portable!"
2786 if test "$linkmode" = lib &&
2787 test "$hardcode_into_libs" = yes; then
2788 # Hardcode the library path.
2789 # Skip directories that are in the system default run-time
2790 # search path.
2791 case " $sys_lib_dlsearch_path " in
2792 *" $absdir "*) ;;
2794 case "$compile_rpath " in
2795 *" $absdir "*) ;;
2796 *) compile_rpath="$compile_rpath $absdir"
2797 esac
2799 esac
2800 case " $sys_lib_dlsearch_path " in
2801 *" $libdir "*) ;;
2803 case "$finalize_rpath " in
2804 *" $libdir "*) ;;
2805 *) finalize_rpath="$finalize_rpath $libdir"
2806 esac
2808 esac
2811 if test -n "$old_archive_from_expsyms_cmds"; then
2812 # figure out the soname
2813 set dummy $library_names
2814 realname="$2"
2815 shift; shift
2816 libname=`eval \\$echo \"$libname_spec\"`
2817 # use dlname if we got it. it's perfectly good, no?
2818 if test -n "$dlname"; then
2819 soname="$dlname"
2820 elif test -n "$soname_spec"; then
2821 # bleh windows
2822 case $host in
2823 *cygwin* | mingw*)
2824 major=`expr $current - $age`
2825 versuffix="-$major"
2827 esac
2828 eval soname=\"$soname_spec\"
2829 else
2830 soname="$realname"
2833 # Make a new name for the extract_expsyms_cmds to use
2834 soroot="$soname"
2835 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2836 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2838 # If the library has no export list, then create one now
2839 if test -f "$output_objdir/$soname-def"; then :
2840 else
2841 $show "extracting exported symbol list from \`$soname'"
2842 save_ifs="$IFS"; IFS='~'
2843 cmds=$extract_expsyms_cmds
2844 for cmd in $cmds; do
2845 IFS="$save_ifs"
2846 eval cmd=\"$cmd\"
2847 $show "$cmd"
2848 $run eval "$cmd" || exit $?
2849 done
2850 IFS="$save_ifs"
2853 # Create $newlib
2854 if test -f "$output_objdir/$newlib"; then :; else
2855 $show "generating import library for \`$soname'"
2856 save_ifs="$IFS"; IFS='~'
2857 cmds=$old_archive_from_expsyms_cmds
2858 for cmd in $cmds; do
2859 IFS="$save_ifs"
2860 eval cmd=\"$cmd\"
2861 $show "$cmd"
2862 $run eval "$cmd" || exit $?
2863 done
2864 IFS="$save_ifs"
2866 # make sure the library variables are pointing to the new library
2867 dir=$output_objdir
2868 linklib=$newlib
2869 fi # test -n "$old_archive_from_expsyms_cmds"
2871 if test "$linkmode" = prog || test "$mode" != relink; then
2872 add_shlibpath=
2873 add_dir=
2874 add=
2875 lib_linked=yes
2876 case $hardcode_action in
2877 immediate | unsupported)
2878 if test "$hardcode_direct" = no; then
2879 add="$dir/$linklib"
2880 case $host in
2881 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2882 *-*-darwin* )
2883 # if the lib is a module then we can not link against
2884 # it, someone is ignoring the new warnings I added
2885 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2886 $echo "** Warning, lib $linklib is a module, not a shared library"
2887 if test -z "$old_library" ; then
2888 $echo
2889 $echo "** And there doesn't seem to be a static archive available"
2890 $echo "** The link will probably fail, sorry"
2891 else
2892 add="$dir/$old_library"
2895 esac
2896 elif test "$hardcode_minus_L" = no; then
2897 case $host in
2898 *-*-sunos*) add_shlibpath="$dir" ;;
2899 esac
2900 add_dir="-L$dir"
2901 add="-l$name"
2902 elif test "$hardcode_shlibpath_var" = no; then
2903 add_shlibpath="$dir"
2904 add="-l$name"
2905 else
2906 lib_linked=no
2909 relink)
2910 if test "$hardcode_direct" = yes; then
2911 add="$dir/$linklib"
2912 elif test "$hardcode_minus_L" = yes; then
2913 add_dir="-L$dir"
2914 # Try looking first in the location we're being installed to.
2915 if test -n "$inst_prefix_dir"; then
2916 case "$libdir" in
2917 [\\/]*)
2918 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2920 esac
2922 add="-l$name"
2923 elif test "$hardcode_shlibpath_var" = yes; then
2924 add_shlibpath="$dir"
2925 add="-l$name"
2926 else
2927 lib_linked=no
2930 *) lib_linked=no ;;
2931 esac
2933 if test "$lib_linked" != yes; then
2934 $echo "$modename: configuration error: unsupported hardcode properties"
2935 exit $EXIT_FAILURE
2938 if test -n "$add_shlibpath"; then
2939 case :$compile_shlibpath: in
2940 *":$add_shlibpath:"*) ;;
2941 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2942 esac
2944 if test "$linkmode" = prog; then
2945 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2946 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2947 else
2948 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2949 test -n "$add" && deplibs="$add $deplibs"
2950 if test "$hardcode_direct" != yes && \
2951 test "$hardcode_minus_L" != yes && \
2952 test "$hardcode_shlibpath_var" = yes; then
2953 case :$finalize_shlibpath: in
2954 *":$libdir:"*) ;;
2955 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2956 esac
2961 if test "$linkmode" = prog || test "$mode" = relink; then
2962 add_shlibpath=
2963 add_dir=
2964 add=
2965 # Finalize command for both is simple: just hardcode it.
2966 if test "$hardcode_direct" = yes; then
2967 add="$libdir/$linklib"
2968 elif test "$hardcode_minus_L" = yes; then
2969 add_dir="-L$libdir"
2970 add="-l$name"
2971 elif test "$hardcode_shlibpath_var" = yes; then
2972 case :$finalize_shlibpath: in
2973 *":$libdir:"*) ;;
2974 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2975 esac
2976 add="-l$name"
2977 elif test "$hardcode_automatic" = yes; then
2978 if test -n "$inst_prefix_dir" &&
2979 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2980 add="$inst_prefix_dir$libdir/$linklib"
2981 else
2982 add="$libdir/$linklib"
2984 else
2985 # We cannot seem to hardcode it, guess we'll fake it.
2986 add_dir="-L$libdir"
2987 # Try looking first in the location we're being installed to.
2988 if test -n "$inst_prefix_dir"; then
2989 case "$libdir" in
2990 [\\/]*)
2991 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2993 esac
2995 add="-l$name"
2998 if test "$linkmode" = prog; then
2999 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3000 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3001 else
3002 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3003 test -n "$add" && deplibs="$add $deplibs"
3006 elif test "$linkmode" = prog; then
3007 # Here we assume that one of hardcode_direct or hardcode_minus_L
3008 # is not unsupported. This is valid on all known static and
3009 # shared platforms.
3010 if test "$hardcode_direct" != unsupported; then
3011 test -n "$old_library" && linklib="$old_library"
3012 compile_deplibs="$dir/$linklib $compile_deplibs"
3013 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3014 else
3015 compile_deplibs="-l$name -L$dir $compile_deplibs"
3016 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3018 elif test "$build_libtool_libs" = yes; then
3019 # Not a shared library
3020 if test "$deplibs_check_method" != pass_all; then
3021 # We're trying link a shared library against a static one
3022 # but the system doesn't support it.
3024 # Just print a warning and add the library to dependency_libs so
3025 # that the program can be linked against the static library.
3026 $echo
3027 $echo "*** Warning: This system can not link to static lib archive $lib."
3028 $echo "*** I have the capability to make that library automatically link in when"
3029 $echo "*** you link to this library. But I can only do this if you have a"
3030 $echo "*** shared version of the library, which you do not appear to have."
3031 if test "$module" = yes; then
3032 $echo "*** But as you try to build a module library, libtool will still create "
3033 $echo "*** a static module, that should work as long as the dlopening application"
3034 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3035 if test -z "$global_symbol_pipe"; then
3036 $echo
3037 $echo "*** However, this would only work if libtool was able to extract symbol"
3038 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3039 $echo "*** not find such a program. So, this module is probably useless."
3040 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3042 if test "$build_old_libs" = no; then
3043 build_libtool_libs=module
3044 build_old_libs=yes
3045 else
3046 build_libtool_libs=no
3049 else
3050 convenience="$convenience $dir/$old_library"
3051 old_convenience="$old_convenience $dir/$old_library"
3052 deplibs="$dir/$old_library $deplibs"
3053 link_static=yes
3055 fi # link shared/static library?
3057 if test "$linkmode" = lib; then
3058 if test -n "$dependency_libs" &&
3059 { test "$hardcode_into_libs" != yes ||
3060 test "$build_old_libs" = yes ||
3061 test "$link_static" = yes; }; then
3062 # Extract -R from dependency_libs
3063 temp_deplibs=
3064 for libdir in $dependency_libs; do
3065 case $libdir in
3066 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3067 case " $xrpath " in
3068 *" $temp_xrpath "*) ;;
3069 *) xrpath="$xrpath $temp_xrpath";;
3070 esac;;
3071 *) temp_deplibs="$temp_deplibs $libdir";;
3072 esac
3073 done
3074 dependency_libs="$temp_deplibs"
3077 newlib_search_path="$newlib_search_path $absdir"
3078 # Link against this library
3079 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3080 # ... and its dependency_libs
3081 tmp_libs=
3082 for deplib in $dependency_libs; do
3083 newdependency_libs="$deplib $newdependency_libs"
3084 if test "X$duplicate_deps" = "Xyes" ; then
3085 case "$tmp_libs " in
3086 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3087 esac
3089 tmp_libs="$tmp_libs $deplib"
3090 done
3092 if test "$link_all_deplibs" != no; then
3093 # Add the search paths of all dependency libraries
3094 for deplib in $dependency_libs; do
3095 case $deplib in
3096 -L*) path="$deplib" ;;
3097 *.la)
3098 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3099 test "X$dir" = "X$deplib" && dir="."
3100 # We need an absolute path.
3101 case $dir in
3102 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3104 absdir=`cd "$dir" && pwd`
3105 if test -z "$absdir"; then
3106 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3107 absdir="$dir"
3110 esac
3111 if grep "^installed=no" $deplib > /dev/null; then
3112 path="$absdir/$objdir"
3113 else
3114 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3115 if test -z "$libdir"; then
3116 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3117 exit $EXIT_FAILURE
3119 if test "$absdir" != "$libdir"; then
3120 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3122 path="$absdir"
3124 depdepl=
3125 case $host in
3126 *-*-darwin*)
3127 # we do not want to link against static libs,
3128 # but need to link against shared
3129 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3130 if test -n "$deplibrary_names" ; then
3131 for tmp in $deplibrary_names ; do
3132 depdepl=$tmp
3133 done
3134 if test -f "$path/$depdepl" ; then
3135 depdepl="$path/$depdepl"
3137 # do not add paths which are already there
3138 case " $newlib_search_path " in
3139 *" $path "*) ;;
3140 *) newlib_search_path="$newlib_search_path $path";;
3141 esac
3143 path=""
3146 path="-L$path"
3148 esac
3150 -l*)
3151 case $host in
3152 *-*-darwin*)
3153 # Again, we only want to link against shared libraries
3154 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3155 for tmp in $newlib_search_path ; do
3156 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3157 eval depdepl="$tmp/lib$tmp_libs.dylib"
3158 break
3160 done
3161 path=""
3163 *) continue ;;
3164 esac
3166 *) continue ;;
3167 esac
3168 case " $deplibs " in
3169 *" $depdepl "*) ;;
3170 *) deplibs="$depdepl $deplibs" ;;
3171 esac
3172 case " $deplibs " in
3173 *" $path "*) ;;
3174 *) deplibs="$deplibs $path" ;;
3175 esac
3176 done
3177 fi # link_all_deplibs != no
3178 fi # linkmode = lib
3179 done # for deplib in $libs
3180 dependency_libs="$newdependency_libs"
3181 if test "$pass" = dlpreopen; then
3182 # Link the dlpreopened libraries before other libraries
3183 for deplib in $save_deplibs; do
3184 deplibs="$deplib $deplibs"
3185 done
3187 if test "$pass" != dlopen; then
3188 if test "$pass" != conv; then
3189 # Make sure lib_search_path contains only unique directories.
3190 lib_search_path=
3191 for dir in $newlib_search_path; do
3192 case "$lib_search_path " in
3193 *" $dir "*) ;;
3194 *) lib_search_path="$lib_search_path $dir" ;;
3195 esac
3196 done
3197 newlib_search_path=
3200 if test "$linkmode,$pass" != "prog,link"; then
3201 vars="deplibs"
3202 else
3203 vars="compile_deplibs finalize_deplibs"
3205 for var in $vars dependency_libs; do
3206 # Add libraries to $var in reverse order
3207 eval tmp_libs=\"\$$var\"
3208 new_libs=
3209 for deplib in $tmp_libs; do
3210 # FIXME: Pedantically, this is the right thing to do, so
3211 # that some nasty dependency loop isn't accidentally
3212 # broken:
3213 #new_libs="$deplib $new_libs"
3214 # Pragmatically, this seems to cause very few problems in
3215 # practice:
3216 case $deplib in
3217 -L*) new_libs="$deplib $new_libs" ;;
3218 -R*) ;;
3220 # And here is the reason: when a library appears more
3221 # than once as an explicit dependence of a library, or
3222 # is implicitly linked in more than once by the
3223 # compiler, it is considered special, and multiple
3224 # occurrences thereof are not removed. Compare this
3225 # with having the same library being listed as a
3226 # dependency of multiple other libraries: in this case,
3227 # we know (pedantically, we assume) the library does not
3228 # need to be listed more than once, so we keep only the
3229 # last copy. This is not always right, but it is rare
3230 # enough that we require users that really mean to play
3231 # such unportable linking tricks to link the library
3232 # using -Wl,-lname, so that libtool does not consider it
3233 # for duplicate removal.
3234 case " $specialdeplibs " in
3235 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3237 case " $new_libs " in
3238 *" $deplib "*) ;;
3239 *) new_libs="$deplib $new_libs" ;;
3240 esac
3242 esac
3244 esac
3245 done
3246 tmp_libs=
3247 for deplib in $new_libs; do
3248 case $deplib in
3249 -L*)
3250 case " $tmp_libs " in
3251 *" $deplib "*) ;;
3252 *) tmp_libs="$tmp_libs $deplib" ;;
3253 esac
3255 *) tmp_libs="$tmp_libs $deplib" ;;
3256 esac
3257 done
3258 eval $var=\"$tmp_libs\"
3259 done # for var
3261 # Last step: remove runtime libs from dependency_libs
3262 # (they stay in deplibs)
3263 tmp_libs=
3264 for i in $dependency_libs ; do
3265 case " $predeps $postdeps $compiler_lib_search_path " in
3266 *" $i "*)
3267 i=""
3269 esac
3270 if test -n "$i" ; then
3271 tmp_libs="$tmp_libs $i"
3273 done
3274 dependency_libs=$tmp_libs
3275 done # for pass
3276 if test "$linkmode" = prog; then
3277 dlfiles="$newdlfiles"
3278 dlprefiles="$newdlprefiles"
3281 case $linkmode in
3282 oldlib)
3283 if test -n "$deplibs"; then
3284 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3287 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3288 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3291 if test -n "$rpath"; then
3292 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3295 if test -n "$xrpath"; then
3296 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3299 if test -n "$vinfo"; then
3300 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3303 if test -n "$release"; then
3304 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3307 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3308 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3311 # Now set the variables for building old libraries.
3312 build_libtool_libs=no
3313 oldlibs="$output"
3314 objs="$objs$old_deplibs"
3317 lib)
3318 # Make sure we only generate libraries of the form `libNAME.la'.
3319 case $outputname in
3320 lib*)
3321 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3322 eval shared_ext=\"$shrext_cmds\"
3323 eval libname=\"$libname_spec\"
3326 if test "$module" = no; then
3327 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3328 $echo "$help" 1>&2
3329 exit $EXIT_FAILURE
3331 if test "$need_lib_prefix" != no; then
3332 # Add the "lib" prefix for modules if required
3333 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3334 eval shared_ext=\"$shrext_cmds\"
3335 eval libname=\"$libname_spec\"
3336 else
3337 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3340 esac
3342 if test -n "$objs"; then
3343 if test "$deplibs_check_method" != pass_all; then
3344 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3345 exit $EXIT_FAILURE
3346 else
3347 $echo
3348 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3349 $echo "*** objects $objs is not portable!"
3350 libobjs="$libobjs $objs"
3354 if test "$dlself" != no; then
3355 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3358 set dummy $rpath
3359 if test "$#" -gt 2; then
3360 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3362 install_libdir="$2"
3364 oldlibs=
3365 if test -z "$rpath"; then
3366 if test "$build_libtool_libs" = yes; then
3367 # Building a libtool convenience library.
3368 # Some compilers have problems with a `.al' extension so
3369 # convenience libraries should have the same extension an
3370 # archive normally would.
3371 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3372 build_libtool_libs=convenience
3373 build_old_libs=yes
3376 if test -n "$vinfo"; then
3377 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3380 if test -n "$release"; then
3381 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3383 else
3385 # Parse the version information argument.
3386 save_ifs="$IFS"; IFS=':'
3387 set dummy $vinfo 0 0 0
3388 IFS="$save_ifs"
3390 if test -n "$8"; then
3391 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3392 $echo "$help" 1>&2
3393 exit $EXIT_FAILURE
3396 # convert absolute version numbers to libtool ages
3397 # this retains compatibility with .la files and attempts
3398 # to make the code below a bit more comprehensible
3400 case $vinfo_number in
3401 yes)
3402 number_major="$2"
3403 number_minor="$3"
3404 number_revision="$4"
3406 # There are really only two kinds -- those that
3407 # use the current revision as the major version
3408 # and those that subtract age and use age as
3409 # a minor version. But, then there is irix
3410 # which has an extra 1 added just for fun
3412 case $version_type in
3413 darwin|linux|osf|windows)
3414 current=`expr $number_major + $number_minor`
3415 age="$number_minor"
3416 revision="$number_revision"
3418 freebsd-aout|freebsd-elf|sunos)
3419 current="$number_major"
3420 revision="$number_minor"
3421 age="0"
3423 irix|nonstopux)
3424 current=`expr $number_major + $number_minor - 1`
3425 age="$number_minor"
3426 revision="$number_minor"
3428 esac
3431 current="$2"
3432 revision="$3"
3433 age="$4"
3435 esac
3437 # Check that each of the things are valid numbers.
3438 case $current in
3439 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3441 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3442 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3443 exit $EXIT_FAILURE
3445 esac
3447 case $revision in
3448 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3450 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3451 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3452 exit $EXIT_FAILURE
3454 esac
3456 case $age in
3457 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3459 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3460 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3461 exit $EXIT_FAILURE
3463 esac
3465 if test "$age" -gt "$current"; then
3466 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3467 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3468 exit $EXIT_FAILURE
3471 # Calculate the version variables.
3472 major=
3473 versuffix=
3474 verstring=
3475 case $version_type in
3476 none) ;;
3478 darwin)
3479 # Like Linux, but with the current version available in
3480 # verstring for coding it into the library header
3481 major=.`expr $current - $age`
3482 versuffix="$major.$age.$revision"
3483 # Darwin ld doesn't like 0 for these options...
3484 minor_current=`expr $current + 1`
3485 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3488 freebsd-aout)
3489 major=".$current"
3490 versuffix=".$current.$revision";
3493 freebsd-elf)
3494 major=".$current"
3495 versuffix=".$current";
3498 irix | nonstopux)
3499 major=`expr $current - $age + 1`
3501 case $version_type in
3502 nonstopux) verstring_prefix=nonstopux ;;
3503 *) verstring_prefix=sgi ;;
3504 esac
3505 verstring="$verstring_prefix$major.$revision"
3507 # Add in all the interfaces that we are compatible with.
3508 loop=$revision
3509 while test "$loop" -ne 0; do
3510 iface=`expr $revision - $loop`
3511 loop=`expr $loop - 1`
3512 verstring="$verstring_prefix$major.$iface:$verstring"
3513 done
3515 # Before this point, $major must not contain `.'.
3516 major=.$major
3517 versuffix="$major.$revision"
3520 linux)
3521 major=.`expr $current - $age`
3522 versuffix="$major.$age.$revision"
3525 osf)
3526 major=.`expr $current - $age`
3527 versuffix=".$current.$age.$revision"
3528 verstring="$current.$age.$revision"
3530 # Add in all the interfaces that we are compatible with.
3531 loop=$age
3532 while test "$loop" -ne 0; do
3533 iface=`expr $current - $loop`
3534 loop=`expr $loop - 1`
3535 verstring="$verstring:${iface}.0"
3536 done
3538 # Make executables depend on our current version.
3539 verstring="$verstring:${current}.0"
3542 sunos)
3543 major=".$current"
3544 versuffix=".$current.$revision"
3547 windows)
3548 # Use '-' rather than '.', since we only want one
3549 # extension on DOS 8.3 filesystems.
3550 major=`expr $current - $age`
3551 versuffix="-$major"
3555 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3556 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3557 exit $EXIT_FAILURE
3559 esac
3561 # Clear the version info if we defaulted, and they specified a release.
3562 if test -z "$vinfo" && test -n "$release"; then
3563 major=
3564 case $version_type in
3565 darwin)
3566 # we can't check for "0.0" in archive_cmds due to quoting
3567 # problems, so we reset it completely
3568 verstring=
3571 verstring="0.0"
3573 esac
3574 if test "$need_version" = no; then
3575 versuffix=
3576 else
3577 versuffix=".0.0"
3581 # Remove version info from name if versioning should be avoided
3582 if test "$avoid_version" = yes && test "$need_version" = no; then
3583 major=
3584 versuffix=
3585 verstring=""
3588 # Check to see if the archive will have undefined symbols.
3589 if test "$allow_undefined" = yes; then
3590 if test "$allow_undefined_flag" = unsupported; then
3591 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3592 build_libtool_libs=no
3593 build_old_libs=yes
3595 else
3596 # Don't allow undefined symbols.
3597 allow_undefined_flag="$no_undefined_flag"
3601 if test "$mode" != relink; then
3602 # Remove our outputs, but don't remove object files since they
3603 # may have been created when compiling PIC objects.
3604 removelist=
3605 tempremovelist=`$echo "$output_objdir/*"`
3606 for p in $tempremovelist; do
3607 case $p in
3608 *.$objext)
3610 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3611 if test "X$precious_files_regex" != "X"; then
3612 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3613 then
3614 continue
3617 removelist="$removelist $p"
3619 *) ;;
3620 esac
3621 done
3622 if test -n "$removelist"; then
3623 $show "${rm}r $removelist"
3624 $run ${rm}r $removelist
3628 # Now set the variables for building old libraries.
3629 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3630 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3632 # Transform .lo files to .o files.
3633 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3636 # Eliminate all temporary directories.
3637 for path in $notinst_path; do
3638 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3639 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3640 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3641 done
3643 if test -n "$xrpath"; then
3644 # If the user specified any rpath flags, then add them.
3645 temp_xrpath=
3646 for libdir in $xrpath; do
3647 temp_xrpath="$temp_xrpath -R$libdir"
3648 case "$finalize_rpath " in
3649 *" $libdir "*) ;;
3650 *) finalize_rpath="$finalize_rpath $libdir" ;;
3651 esac
3652 done
3653 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3654 dependency_libs="$temp_xrpath $dependency_libs"
3658 # Make sure dlfiles contains only unique files that won't be dlpreopened
3659 old_dlfiles="$dlfiles"
3660 dlfiles=
3661 for lib in $old_dlfiles; do
3662 case " $dlprefiles $dlfiles " in
3663 *" $lib "*) ;;
3664 *) dlfiles="$dlfiles $lib" ;;
3665 esac
3666 done
3668 # Make sure dlprefiles contains only unique files
3669 old_dlprefiles="$dlprefiles"
3670 dlprefiles=
3671 for lib in $old_dlprefiles; do
3672 case "$dlprefiles " in
3673 *" $lib "*) ;;
3674 *) dlprefiles="$dlprefiles $lib" ;;
3675 esac
3676 done
3678 if test "$build_libtool_libs" = yes; then
3679 if test -n "$rpath"; then
3680 case $host in
3681 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3682 # these systems don't actually have a c library (as such)!
3684 *-*-rhapsody* | *-*-darwin1.[012])
3685 # Rhapsody C library is in the System framework
3686 deplibs="$deplibs -framework System"
3688 *-*-netbsd*)
3689 # Don't link with libc until the a.out ld.so is fixed.
3691 *-*-openbsd* | *-*-freebsd*)
3692 # Do not include libc due to us having libc/libc_r.
3693 test "X$arg" = "X-lc" && continue
3696 # Add libc to deplibs on all other systems if necessary.
3697 if test "$build_libtool_need_lc" = "yes"; then
3698 deplibs="$deplibs -lc"
3701 esac
3704 # Transform deplibs into only deplibs that can be linked in shared.
3705 name_save=$name
3706 libname_save=$libname
3707 release_save=$release
3708 versuffix_save=$versuffix
3709 major_save=$major
3710 # I'm not sure if I'm treating the release correctly. I think
3711 # release should show up in the -l (ie -lgmp5) so we don't want to
3712 # add it in twice. Is that correct?
3713 release=""
3714 versuffix=""
3715 major=""
3716 newdeplibs=
3717 droppeddeps=no
3718 case $deplibs_check_method in
3719 pass_all)
3720 # Don't check for shared/static. Everything works.
3721 # This might be a little naive. We might want to check
3722 # whether the library exists or not. But this is on
3723 # osf3 & osf4 and I'm not really sure... Just
3724 # implementing what was already the behavior.
3725 newdeplibs=$deplibs
3727 test_compile)
3728 # This code stresses the "libraries are programs" paradigm to its
3729 # limits. Maybe even breaks it. We compile a program, linking it
3730 # against the deplibs as a proxy for the library. Then we can check
3731 # whether they linked in statically or dynamically with ldd.
3732 $rm conftest.c
3733 cat > conftest.c <<EOF
3734 int main() { return 0; }
3736 $rm conftest
3737 $LTCC -o conftest conftest.c $deplibs
3738 if test "$?" -eq 0 ; then
3739 ldd_output=`ldd conftest`
3740 for i in $deplibs; do
3741 name="`expr $i : '-l\(.*\)'`"
3742 # If $name is empty we are operating on a -L argument.
3743 if test "$name" != "" && test "$name" -ne "0"; then
3744 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3745 case " $predeps $postdeps " in
3746 *" $i "*)
3747 newdeplibs="$newdeplibs $i"
3748 i=""
3750 esac
3752 if test -n "$i" ; then
3753 libname=`eval \\$echo \"$libname_spec\"`
3754 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3755 set dummy $deplib_matches
3756 deplib_match=$2
3757 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3758 newdeplibs="$newdeplibs $i"
3759 else
3760 droppeddeps=yes
3761 $echo
3762 $echo "*** Warning: dynamic linker does not accept needed library $i."
3763 $echo "*** I have the capability to make that library automatically link in when"
3764 $echo "*** you link to this library. But I can only do this if you have a"
3765 $echo "*** shared version of the library, which I believe you do not have"
3766 $echo "*** because a test_compile did reveal that the linker did not use it for"
3767 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3770 else
3771 newdeplibs="$newdeplibs $i"
3773 done
3774 else
3775 # Error occurred in the first compile. Let's try to salvage
3776 # the situation: Compile a separate program for each library.
3777 for i in $deplibs; do
3778 name="`expr $i : '-l\(.*\)'`"
3779 # If $name is empty we are operating on a -L argument.
3780 if test "$name" != "" && test "$name" != "0"; then
3781 $rm conftest
3782 $LTCC -o conftest conftest.c $i
3783 # Did it work?
3784 if test "$?" -eq 0 ; then
3785 ldd_output=`ldd conftest`
3786 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3787 case " $predeps $postdeps " in
3788 *" $i "*)
3789 newdeplibs="$newdeplibs $i"
3790 i=""
3792 esac
3794 if test -n "$i" ; then
3795 libname=`eval \\$echo \"$libname_spec\"`
3796 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3797 set dummy $deplib_matches
3798 deplib_match=$2
3799 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3800 newdeplibs="$newdeplibs $i"
3801 else
3802 droppeddeps=yes
3803 $echo
3804 $echo "*** Warning: dynamic linker does not accept needed library $i."
3805 $echo "*** I have the capability to make that library automatically link in when"
3806 $echo "*** you link to this library. But I can only do this if you have a"
3807 $echo "*** shared version of the library, which you do not appear to have"
3808 $echo "*** because a test_compile did reveal that the linker did not use this one"
3809 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3812 else
3813 droppeddeps=yes
3814 $echo
3815 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3816 $echo "*** make it link in! You will probably need to install it or some"
3817 $echo "*** library that it depends on before this library will be fully"
3818 $echo "*** functional. Installing it before continuing would be even better."
3820 else
3821 newdeplibs="$newdeplibs $i"
3823 done
3826 file_magic*)
3827 set dummy $deplibs_check_method
3828 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3829 for a_deplib in $deplibs; do
3830 name="`expr $a_deplib : '-l\(.*\)'`"
3831 # If $name is empty we are operating on a -L argument.
3832 if test "$name" != "" && test "$name" != "0"; then
3833 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3834 case " $predeps $postdeps " in
3835 *" $a_deplib "*)
3836 newdeplibs="$newdeplibs $a_deplib"
3837 a_deplib=""
3839 esac
3841 if test -n "$a_deplib" ; then
3842 libname=`eval \\$echo \"$libname_spec\"`
3843 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3844 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3845 for potent_lib in $potential_libs; do
3846 # Follow soft links.
3847 if ls -lLd "$potent_lib" 2>/dev/null \
3848 | grep " -> " >/dev/null; then
3849 continue
3851 # The statement above tries to avoid entering an
3852 # endless loop below, in case of cyclic links.
3853 # We might still enter an endless loop, since a link
3854 # loop can be closed while we follow links,
3855 # but so what?
3856 potlib="$potent_lib"
3857 while test -h "$potlib" 2>/dev/null; do
3858 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3859 case $potliblink in
3860 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3861 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3862 esac
3863 done
3864 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3865 | ${SED} 10q \
3866 | $EGREP "$file_magic_regex" > /dev/null; then
3867 newdeplibs="$newdeplibs $a_deplib"
3868 a_deplib=""
3869 break 2
3871 done
3872 done
3874 if test -n "$a_deplib" ; then
3875 droppeddeps=yes
3876 $echo
3877 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3878 $echo "*** I have the capability to make that library automatically link in when"
3879 $echo "*** you link to this library. But I can only do this if you have a"
3880 $echo "*** shared version of the library, which you do not appear to have"
3881 $echo "*** because I did check the linker path looking for a file starting"
3882 if test -z "$potlib" ; then
3883 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3884 else
3885 $echo "*** with $libname and none of the candidates passed a file format test"
3886 $echo "*** using a file magic. Last file checked: $potlib"
3889 else
3890 # Add a -L argument.
3891 newdeplibs="$newdeplibs $a_deplib"
3893 done # Gone through all deplibs.
3895 match_pattern*)
3896 set dummy $deplibs_check_method
3897 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3898 for a_deplib in $deplibs; do
3899 name="`expr $a_deplib : '-l\(.*\)'`"
3900 # If $name is empty we are operating on a -L argument.
3901 if test -n "$name" && test "$name" != "0"; then
3902 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3903 case " $predeps $postdeps " in
3904 *" $a_deplib "*)
3905 newdeplibs="$newdeplibs $a_deplib"
3906 a_deplib=""
3908 esac
3910 if test -n "$a_deplib" ; then
3911 libname=`eval \\$echo \"$libname_spec\"`
3912 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3913 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3914 for potent_lib in $potential_libs; do
3915 potlib="$potent_lib" # see symlink-check above in file_magic test
3916 if eval $echo \"$potent_lib\" 2>/dev/null \
3917 | ${SED} 10q \
3918 | $EGREP "$match_pattern_regex" > /dev/null; then
3919 newdeplibs="$newdeplibs $a_deplib"
3920 a_deplib=""
3921 break 2
3923 done
3924 done
3926 if test -n "$a_deplib" ; then
3927 droppeddeps=yes
3928 $echo
3929 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3930 $echo "*** I have the capability to make that library automatically link in when"
3931 $echo "*** you link to this library. But I can only do this if you have a"
3932 $echo "*** shared version of the library, which you do not appear to have"
3933 $echo "*** because I did check the linker path looking for a file starting"
3934 if test -z "$potlib" ; then
3935 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3936 else
3937 $echo "*** with $libname and none of the candidates passed a file format test"
3938 $echo "*** using a regex pattern. Last file checked: $potlib"
3941 else
3942 # Add a -L argument.
3943 newdeplibs="$newdeplibs $a_deplib"
3945 done # Gone through all deplibs.
3947 none | unknown | *)
3948 newdeplibs=""
3949 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3950 -e 's/ -[LR][^ ]*//g'`
3951 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3952 for i in $predeps $postdeps ; do
3953 # can't use Xsed below, because $i might contain '/'
3954 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3955 done
3957 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3958 | grep . >/dev/null; then
3959 $echo
3960 if test "X$deplibs_check_method" = "Xnone"; then
3961 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3962 else
3963 $echo "*** Warning: inter-library dependencies are not known to be supported."
3965 $echo "*** All declared inter-library dependencies are being dropped."
3966 droppeddeps=yes
3969 esac
3970 versuffix=$versuffix_save
3971 major=$major_save
3972 release=$release_save
3973 libname=$libname_save
3974 name=$name_save
3976 case $host in
3977 *-*-rhapsody* | *-*-darwin1.[012])
3978 # On Rhapsody replace the C library is the System framework
3979 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3981 esac
3983 if test "$droppeddeps" = yes; then
3984 if test "$module" = yes; then
3985 $echo
3986 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3987 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3988 $echo "*** a static module, that should work as long as the dlopening"
3989 $echo "*** application is linked with the -dlopen flag."
3990 if test -z "$global_symbol_pipe"; then
3991 $echo
3992 $echo "*** However, this would only work if libtool was able to extract symbol"
3993 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3994 $echo "*** not find such a program. So, this module is probably useless."
3995 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3997 if test "$build_old_libs" = no; then
3998 oldlibs="$output_objdir/$libname.$libext"
3999 build_libtool_libs=module
4000 build_old_libs=yes
4001 else
4002 build_libtool_libs=no
4004 else
4005 $echo "*** The inter-library dependencies that have been dropped here will be"
4006 $echo "*** automatically added whenever a program is linked with this library"
4007 $echo "*** or is declared to -dlopen it."
4009 if test "$allow_undefined" = no; then
4010 $echo
4011 $echo "*** Since this library must not contain undefined symbols,"
4012 $echo "*** because either the platform does not support them or"
4013 $echo "*** it was explicitly requested with -no-undefined,"
4014 $echo "*** libtool will only create a static version of it."
4015 if test "$build_old_libs" = no; then
4016 oldlibs="$output_objdir/$libname.$libext"
4017 build_libtool_libs=module
4018 build_old_libs=yes
4019 else
4020 build_libtool_libs=no
4025 # Done checking deplibs!
4026 deplibs=$newdeplibs
4029 # All the library-specific variables (install_libdir is set above).
4030 library_names=
4031 old_library=
4032 dlname=
4034 # Test again, we may have decided not to build it any more
4035 if test "$build_libtool_libs" = yes; then
4036 if test "$hardcode_into_libs" = yes; then
4037 # Hardcode the library paths
4038 hardcode_libdirs=
4039 dep_rpath=
4040 rpath="$finalize_rpath"
4041 test "$mode" != relink && rpath="$compile_rpath$rpath"
4042 for libdir in $rpath; do
4043 if test -n "$hardcode_libdir_flag_spec"; then
4044 if test -n "$hardcode_libdir_separator"; then
4045 if test -z "$hardcode_libdirs"; then
4046 hardcode_libdirs="$libdir"
4047 else
4048 # Just accumulate the unique libdirs.
4049 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4050 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4053 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4055 esac
4057 else
4058 eval flag=\"$hardcode_libdir_flag_spec\"
4059 dep_rpath="$dep_rpath $flag"
4061 elif test -n "$runpath_var"; then
4062 case "$perm_rpath " in
4063 *" $libdir "*) ;;
4064 *) perm_rpath="$perm_rpath $libdir" ;;
4065 esac
4067 done
4068 # Substitute the hardcoded libdirs into the rpath.
4069 if test -n "$hardcode_libdir_separator" &&
4070 test -n "$hardcode_libdirs"; then
4071 libdir="$hardcode_libdirs"
4072 if test -n "$hardcode_libdir_flag_spec_ld"; then
4073 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4074 else
4075 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4078 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4079 # We should set the runpath_var.
4080 rpath=
4081 for dir in $perm_rpath; do
4082 rpath="$rpath$dir:"
4083 done
4084 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4086 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4089 shlibpath="$finalize_shlibpath"
4090 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4091 if test -n "$shlibpath"; then
4092 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4095 # Get the real and link names of the library.
4096 eval shared_ext=\"$shrext_cmds\"
4097 eval library_names=\"$library_names_spec\"
4098 set dummy $library_names
4099 realname="$2"
4100 shift; shift
4102 if test -n "$soname_spec"; then
4103 eval soname=\"$soname_spec\"
4104 else
4105 soname="$realname"
4107 if test -z "$dlname"; then
4108 dlname=$soname
4111 lib="$output_objdir/$realname"
4112 for link
4114 linknames="$linknames $link"
4115 done
4117 # Use standard objects if they are pic
4118 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4120 # Prepare the list of exported symbols
4121 if test -z "$export_symbols"; then
4122 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4123 $show "generating symbol list for \`$libname.la'"
4124 export_symbols="$output_objdir/$libname.exp"
4125 $run $rm $export_symbols
4126 cmds=$export_symbols_cmds
4127 save_ifs="$IFS"; IFS='~'
4128 for cmd in $cmds; do
4129 IFS="$save_ifs"
4130 eval cmd=\"$cmd\"
4131 if len=`expr "X$cmd" : ".*"` &&
4132 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4133 $show "$cmd"
4134 $run eval "$cmd" || exit $?
4135 skipped_export=false
4136 else
4137 # The command line is too long to execute in one step.
4138 $show "using reloadable object file for export list..."
4139 skipped_export=:
4141 done
4142 IFS="$save_ifs"
4143 if test -n "$export_symbols_regex"; then
4144 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4145 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4146 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4147 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4152 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4153 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4156 tmp_deplibs=
4157 for test_deplib in $deplibs; do
4158 case " $convenience " in
4159 *" $test_deplib "*) ;;
4161 tmp_deplibs="$tmp_deplibs $test_deplib"
4163 esac
4164 done
4165 deplibs="$tmp_deplibs"
4167 if test -n "$convenience"; then
4168 if test -n "$whole_archive_flag_spec"; then
4169 save_libobjs=$libobjs
4170 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4171 else
4172 gentop="$output_objdir/${outputname}x"
4173 generated="$generated $gentop"
4175 func_extract_archives $gentop $convenience
4176 libobjs="$libobjs $func_extract_archives_result"
4180 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4181 eval flag=\"$thread_safe_flag_spec\"
4182 linker_flags="$linker_flags $flag"
4185 # Make a backup of the uninstalled library when relinking
4186 if test "$mode" = relink; then
4187 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4190 # Do each of the archive commands.
4191 if test "$module" = yes && test -n "$module_cmds" ; then
4192 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4193 eval test_cmds=\"$module_expsym_cmds\"
4194 cmds=$module_expsym_cmds
4195 else
4196 eval test_cmds=\"$module_cmds\"
4197 cmds=$module_cmds
4199 else
4200 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4201 eval test_cmds=\"$archive_expsym_cmds\"
4202 cmds=$archive_expsym_cmds
4203 else
4204 eval test_cmds=\"$archive_cmds\"
4205 cmds=$archive_cmds
4209 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4210 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4212 else
4213 # The command line is too long to link in one step, link piecewise.
4214 $echo "creating reloadable object files..."
4216 # Save the value of $output and $libobjs because we want to
4217 # use them later. If we have whole_archive_flag_spec, we
4218 # want to use save_libobjs as it was before
4219 # whole_archive_flag_spec was expanded, because we can't
4220 # assume the linker understands whole_archive_flag_spec.
4221 # This may have to be revisited, in case too many
4222 # convenience libraries get linked in and end up exceeding
4223 # the spec.
4224 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4225 save_libobjs=$libobjs
4227 save_output=$output
4229 # Clear the reloadable object creation command queue and
4230 # initialize k to one.
4231 test_cmds=
4232 concat_cmds=
4233 objlist=
4234 delfiles=
4235 last_robj=
4237 output=$output_objdir/$save_output-${k}.$objext
4238 # Loop over the list of objects to be linked.
4239 for obj in $save_libobjs
4241 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4242 if test "X$objlist" = X ||
4243 { len=`expr "X$test_cmds" : ".*"` &&
4244 test "$len" -le "$max_cmd_len"; }; then
4245 objlist="$objlist $obj"
4246 else
4247 # The command $test_cmds is almost too long, add a
4248 # command to the queue.
4249 if test "$k" -eq 1 ; then
4250 # The first file doesn't have a previous command to add.
4251 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4252 else
4253 # All subsequent reloadable object files will link in
4254 # the last one created.
4255 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4257 last_robj=$output_objdir/$save_output-${k}.$objext
4258 k=`expr $k + 1`
4259 output=$output_objdir/$save_output-${k}.$objext
4260 objlist=$obj
4261 len=1
4263 done
4264 # Handle the remaining objects by creating one last
4265 # reloadable object file. All subsequent reloadable object
4266 # files will link in the last one created.
4267 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4268 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4270 if ${skipped_export-false}; then
4271 $show "generating symbol list for \`$libname.la'"
4272 export_symbols="$output_objdir/$libname.exp"
4273 $run $rm $export_symbols
4274 libobjs=$output
4275 # Append the command to create the export file.
4276 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4279 # Set up a command to remove the reloadale object files
4280 # after they are used.
4282 while test "$i" -lt "$k"
4284 i=`expr $i + 1`
4285 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4286 done
4288 $echo "creating a temporary reloadable object file: $output"
4290 # Loop through the commands generated above and execute them.
4291 save_ifs="$IFS"; IFS='~'
4292 for cmd in $concat_cmds; do
4293 IFS="$save_ifs"
4294 $show "$cmd"
4295 $run eval "$cmd" || exit $?
4296 done
4297 IFS="$save_ifs"
4299 libobjs=$output
4300 # Restore the value of output.
4301 output=$save_output
4303 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4304 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4306 # Expand the library linking commands again to reset the
4307 # value of $libobjs for piecewise linking.
4309 # Do each of the archive commands.
4310 if test "$module" = yes && test -n "$module_cmds" ; then
4311 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4312 cmds=$module_expsym_cmds
4313 else
4314 cmds=$module_cmds
4316 else
4317 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4318 cmds=$archive_expsym_cmds
4319 else
4320 cmds=$archive_cmds
4324 # Append the command to remove the reloadable object files
4325 # to the just-reset $cmds.
4326 eval cmds=\"\$cmds~\$rm $delfiles\"
4328 save_ifs="$IFS"; IFS='~'
4329 for cmd in $cmds; do
4330 IFS="$save_ifs"
4331 eval cmd=\"$cmd\"
4332 $show "$cmd"
4333 $run eval "$cmd" || exit $?
4334 done
4335 IFS="$save_ifs"
4337 # Restore the uninstalled library and exit
4338 if test "$mode" = relink; then
4339 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4340 exit $EXIT_SUCCESS
4343 # Create links to the real library.
4344 for linkname in $linknames; do
4345 if test "$realname" != "$linkname"; then
4346 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4347 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4349 done
4351 # If -module or -export-dynamic was specified, set the dlname.
4352 if test "$module" = yes || test "$export_dynamic" = yes; then
4353 # On all known operating systems, these are identical.
4354 dlname="$soname"
4359 obj)
4360 if test -n "$deplibs"; then
4361 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4364 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4365 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4368 if test -n "$rpath"; then
4369 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4372 if test -n "$xrpath"; then
4373 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4376 if test -n "$vinfo"; then
4377 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4380 if test -n "$release"; then
4381 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4384 case $output in
4385 *.lo)
4386 if test -n "$objs$old_deplibs"; then
4387 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4388 exit $EXIT_FAILURE
4390 libobj="$output"
4391 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4394 libobj=
4395 obj="$output"
4397 esac
4399 # Delete the old objects.
4400 $run $rm $obj $libobj
4402 # Objects from convenience libraries. This assumes
4403 # single-version convenience libraries. Whenever we create
4404 # different ones for PIC/non-PIC, this we'll have to duplicate
4405 # the extraction.
4406 reload_conv_objs=
4407 gentop=
4408 # reload_cmds runs $LD directly, so let us get rid of
4409 # -Wl from whole_archive_flag_spec
4412 if test -n "$convenience"; then
4413 if test -n "$whole_archive_flag_spec"; then
4414 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4415 else
4416 gentop="$output_objdir/${obj}x"
4417 generated="$generated $gentop"
4419 func_extract_archives $gentop $convenience
4420 reload_conv_objs="$reload_objs $func_extract_archives_result"
4424 # Create the old-style object.
4425 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
4427 output="$obj"
4428 cmds=$reload_cmds
4429 save_ifs="$IFS"; IFS='~'
4430 for cmd in $cmds; do
4431 IFS="$save_ifs"
4432 eval cmd=\"$cmd\"
4433 $show "$cmd"
4434 $run eval "$cmd" || exit $?
4435 done
4436 IFS="$save_ifs"
4438 # Exit if we aren't doing a library object file.
4439 if test -z "$libobj"; then
4440 if test -n "$gentop"; then
4441 $show "${rm}r $gentop"
4442 $run ${rm}r $gentop
4445 exit $EXIT_SUCCESS
4448 if test "$build_libtool_libs" != yes; then
4449 if test -n "$gentop"; then
4450 $show "${rm}r $gentop"
4451 $run ${rm}r $gentop
4454 # Create an invalid libtool object if no PIC, so that we don't
4455 # accidentally link it into a program.
4456 # $show "echo timestamp > $libobj"
4457 # $run eval "echo timestamp > $libobj" || exit $?
4458 exit $EXIT_SUCCESS
4461 if test -n "$pic_flag" || test "$pic_mode" != default; then
4462 # Only do commands if we really have different PIC objects.
4463 reload_objs="$libobjs $reload_conv_objs"
4464 output="$libobj"
4465 cmds=$reload_cmds
4466 save_ifs="$IFS"; IFS='~'
4467 for cmd in $cmds; do
4468 IFS="$save_ifs"
4469 eval cmd=\"$cmd\"
4470 $show "$cmd"
4471 $run eval "$cmd" || exit $?
4472 done
4473 IFS="$save_ifs"
4476 if test -n "$gentop"; then
4477 $show "${rm}r $gentop"
4478 $run ${rm}r $gentop
4481 exit $EXIT_SUCCESS
4484 prog)
4485 case $host in
4486 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4487 esac
4488 if test -n "$vinfo"; then
4489 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4492 if test -n "$release"; then
4493 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4496 if test "$preload" = yes; then
4497 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4498 test "$dlopen_self_static" = unknown; then
4499 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4503 case $host in
4504 *-*-rhapsody* | *-*-darwin1.[012])
4505 # On Rhapsody replace the C library is the System framework
4506 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4507 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4509 esac
4511 case $host in
4512 *darwin*)
4513 # Don't allow lazy linking, it breaks C++ global constructors
4514 if test "$tagname" = CXX ; then
4515 compile_command="$compile_command ${wl}-bind_at_load"
4516 finalize_command="$finalize_command ${wl}-bind_at_load"
4519 esac
4521 compile_command="$compile_command $compile_deplibs"
4522 finalize_command="$finalize_command $finalize_deplibs"
4524 if test -n "$rpath$xrpath"; then
4525 # If the user specified any rpath flags, then add them.
4526 for libdir in $rpath $xrpath; do
4527 # This is the magic to use -rpath.
4528 case "$finalize_rpath " in
4529 *" $libdir "*) ;;
4530 *) finalize_rpath="$finalize_rpath $libdir" ;;
4531 esac
4532 done
4535 # Now hardcode the library paths
4536 rpath=
4537 hardcode_libdirs=
4538 for libdir in $compile_rpath $finalize_rpath; do
4539 if test -n "$hardcode_libdir_flag_spec"; then
4540 if test -n "$hardcode_libdir_separator"; then
4541 if test -z "$hardcode_libdirs"; then
4542 hardcode_libdirs="$libdir"
4543 else
4544 # Just accumulate the unique libdirs.
4545 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4546 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4549 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4551 esac
4553 else
4554 eval flag=\"$hardcode_libdir_flag_spec\"
4555 rpath="$rpath $flag"
4557 elif test -n "$runpath_var"; then
4558 case "$perm_rpath " in
4559 *" $libdir "*) ;;
4560 *) perm_rpath="$perm_rpath $libdir" ;;
4561 esac
4563 case $host in
4564 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4565 case :$dllsearchpath: in
4566 *":$libdir:"*) ;;
4567 *) dllsearchpath="$dllsearchpath:$libdir";;
4568 esac
4570 esac
4571 done
4572 # Substitute the hardcoded libdirs into the rpath.
4573 if test -n "$hardcode_libdir_separator" &&
4574 test -n "$hardcode_libdirs"; then
4575 libdir="$hardcode_libdirs"
4576 eval rpath=\" $hardcode_libdir_flag_spec\"
4578 compile_rpath="$rpath"
4580 rpath=
4581 hardcode_libdirs=
4582 for libdir in $finalize_rpath; do
4583 if test -n "$hardcode_libdir_flag_spec"; then
4584 if test -n "$hardcode_libdir_separator"; then
4585 if test -z "$hardcode_libdirs"; then
4586 hardcode_libdirs="$libdir"
4587 else
4588 # Just accumulate the unique libdirs.
4589 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4590 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4593 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4595 esac
4597 else
4598 eval flag=\"$hardcode_libdir_flag_spec\"
4599 rpath="$rpath $flag"
4601 elif test -n "$runpath_var"; then
4602 case "$finalize_perm_rpath " in
4603 *" $libdir "*) ;;
4604 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4605 esac
4607 done
4608 # Substitute the hardcoded libdirs into the rpath.
4609 if test -n "$hardcode_libdir_separator" &&
4610 test -n "$hardcode_libdirs"; then
4611 libdir="$hardcode_libdirs"
4612 eval rpath=\" $hardcode_libdir_flag_spec\"
4614 finalize_rpath="$rpath"
4616 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4617 # Transform all the library objects into standard objects.
4618 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4619 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4622 dlsyms=
4623 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4624 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4625 dlsyms="${outputname}S.c"
4626 else
4627 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4631 if test -n "$dlsyms"; then
4632 case $dlsyms in
4633 "") ;;
4634 *.c)
4635 # Discover the nlist of each of the dlfiles.
4636 nlist="$output_objdir/${outputname}.nm"
4638 $show "$rm $nlist ${nlist}S ${nlist}T"
4639 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4641 # Parse the name list into a source file.
4642 $show "creating $output_objdir/$dlsyms"
4644 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4645 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4646 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4648 #ifdef __cplusplus
4649 extern \"C\" {
4650 #endif
4652 /* Prevent the only kind of declaration conflicts we can make. */
4653 #define lt_preloaded_symbols some_other_symbol
4655 /* External symbol declarations for the compiler. */\
4658 if test "$dlself" = yes; then
4659 $show "generating symbol list for \`$output'"
4661 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4663 # Add our own program objects to the symbol list.
4664 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4665 for arg in $progfiles; do
4666 $show "extracting global C symbols from \`$arg'"
4667 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4668 done
4670 if test -n "$exclude_expsyms"; then
4671 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4672 $run eval '$mv "$nlist"T "$nlist"'
4675 if test -n "$export_symbols_regex"; then
4676 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4677 $run eval '$mv "$nlist"T "$nlist"'
4680 # Prepare the list of exported symbols
4681 if test -z "$export_symbols"; then
4682 export_symbols="$output_objdir/$output.exp"
4683 $run $rm $export_symbols
4684 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4685 else
4686 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4687 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4688 $run eval 'mv "$nlist"T "$nlist"'
4692 for arg in $dlprefiles; do
4693 $show "extracting global C symbols from \`$arg'"
4694 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4695 $run eval '$echo ": $name " >> "$nlist"'
4696 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4697 done
4699 if test -z "$run"; then
4700 # Make sure we have at least an empty file.
4701 test -f "$nlist" || : > "$nlist"
4703 if test -n "$exclude_expsyms"; then
4704 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4705 $mv "$nlist"T "$nlist"
4708 # Try sorting and uniquifying the output.
4709 if grep -v "^: " < "$nlist" |
4710 if sort -k 3 </dev/null >/dev/null 2>&1; then
4711 sort -k 3
4712 else
4713 sort +2
4714 fi |
4715 uniq > "$nlist"S; then
4717 else
4718 grep -v "^: " < "$nlist" > "$nlist"S
4721 if test -f "$nlist"S; then
4722 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4723 else
4724 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4727 $echo >> "$output_objdir/$dlsyms" "\
4729 #undef lt_preloaded_symbols
4731 #if defined (__STDC__) && __STDC__
4732 # define lt_ptr void *
4733 #else
4734 # define lt_ptr char *
4735 # define const
4736 #endif
4738 /* The mapping between symbol names and symbols. */
4739 const struct {
4740 const char *name;
4741 lt_ptr address;
4743 lt_preloaded_symbols[] =
4747 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4749 $echo >> "$output_objdir/$dlsyms" "\
4750 {0, (lt_ptr) 0}
4753 /* This works around a problem in FreeBSD linker */
4754 #ifdef FREEBSD_WORKAROUND
4755 static const void *lt_preloaded_setup() {
4756 return lt_preloaded_symbols;
4758 #endif
4760 #ifdef __cplusplus
4762 #endif\
4766 pic_flag_for_symtable=
4767 case $host in
4768 # compiling the symbol table file with pic_flag works around
4769 # a FreeBSD bug that causes programs to crash when -lm is
4770 # linked before any other PIC object. But we must not use
4771 # pic_flag when linking with -static. The problem exists in
4772 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4773 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4774 case "$compile_command " in
4775 *" -static "*) ;;
4776 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4777 esac;;
4778 *-*-hpux*)
4779 case "$compile_command " in
4780 *" -static "*) ;;
4781 *) pic_flag_for_symtable=" $pic_flag";;
4782 esac
4783 esac
4785 # Now compile the dynamic symbol file.
4786 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4787 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4789 # Clean up the generated files.
4790 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4791 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4793 # Transform the symbol file into the correct name.
4794 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4795 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4798 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4799 exit $EXIT_FAILURE
4801 esac
4802 else
4803 # We keep going just in case the user didn't refer to
4804 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4805 # really was required.
4807 # Nullify the symbol file.
4808 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4809 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4812 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4813 # Replace the output file specification.
4814 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4815 link_command="$compile_command$compile_rpath"
4817 # We have no uninstalled library dependencies, so finalize right now.
4818 $show "$link_command"
4819 $run eval "$link_command"
4820 status=$?
4822 # Delete the generated files.
4823 if test -n "$dlsyms"; then
4824 $show "$rm $output_objdir/${outputname}S.${objext}"
4825 $run $rm "$output_objdir/${outputname}S.${objext}"
4828 exit $status
4831 if test -n "$shlibpath_var"; then
4832 # We should set the shlibpath_var
4833 rpath=
4834 for dir in $temp_rpath; do
4835 case $dir in
4836 [\\/]* | [A-Za-z]:[\\/]*)
4837 # Absolute path.
4838 rpath="$rpath$dir:"
4841 # Relative path: add a thisdir entry.
4842 rpath="$rpath\$thisdir/$dir:"
4844 esac
4845 done
4846 temp_rpath="$rpath"
4849 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4850 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4852 if test -n "$finalize_shlibpath"; then
4853 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4856 compile_var=
4857 finalize_var=
4858 if test -n "$runpath_var"; then
4859 if test -n "$perm_rpath"; then
4860 # We should set the runpath_var.
4861 rpath=
4862 for dir in $perm_rpath; do
4863 rpath="$rpath$dir:"
4864 done
4865 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4867 if test -n "$finalize_perm_rpath"; then
4868 # We should set the runpath_var.
4869 rpath=
4870 for dir in $finalize_perm_rpath; do
4871 rpath="$rpath$dir:"
4872 done
4873 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4877 if test "$no_install" = yes; then
4878 # We don't need to create a wrapper script.
4879 link_command="$compile_var$compile_command$compile_rpath"
4880 # Replace the output file specification.
4881 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4882 # Delete the old output file.
4883 $run $rm $output
4884 # Link the executable and exit
4885 $show "$link_command"
4886 $run eval "$link_command" || exit $?
4887 exit $EXIT_SUCCESS
4890 if test "$hardcode_action" = relink; then
4891 # Fast installation is not supported
4892 link_command="$compile_var$compile_command$compile_rpath"
4893 relink_command="$finalize_var$finalize_command$finalize_rpath"
4895 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4896 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4897 else
4898 if test "$fast_install" != no; then
4899 link_command="$finalize_var$compile_command$finalize_rpath"
4900 if test "$fast_install" = yes; then
4901 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4902 else
4903 # fast_install is set to needless
4904 relink_command=
4906 else
4907 link_command="$compile_var$compile_command$compile_rpath"
4908 relink_command="$finalize_var$finalize_command$finalize_rpath"
4912 # Replace the output file specification.
4913 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4915 # Delete the old output files.
4916 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4918 $show "$link_command"
4919 $run eval "$link_command" || exit $?
4921 # Now create the wrapper script.
4922 $show "creating $output"
4924 # Quote the relink command for shipping.
4925 if test -n "$relink_command"; then
4926 # Preserve any variables that may affect compiler behavior
4927 for var in $variables_saved_for_relink; do
4928 if eval test -z \"\${$var+set}\"; then
4929 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4930 elif eval var_value=\$$var; test -z "$var_value"; then
4931 relink_command="$var=; export $var; $relink_command"
4932 else
4933 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4934 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4936 done
4937 relink_command="(cd `pwd`; $relink_command)"
4938 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4941 # Quote $echo for shipping.
4942 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4943 case $progpath in
4944 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4945 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4946 esac
4947 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4948 else
4949 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4952 # Only actually do things if our run command is non-null.
4953 if test -z "$run"; then
4954 # win32 will think the script is a binary if it has
4955 # a .exe suffix, so we strip it off here.
4956 case $output in
4957 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4958 esac
4959 # test for cygwin because mv fails w/o .exe extensions
4960 case $host in
4961 *cygwin*)
4962 exeext=.exe
4963 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4964 *) exeext= ;;
4965 esac
4966 case $host in
4967 *cygwin* | *mingw* )
4968 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4969 cwrapper=`$echo ${output}.exe`
4970 $rm $cwrappersource $cwrapper
4971 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4973 cat > $cwrappersource <<EOF
4975 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4976 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4978 The $output program cannot be directly executed until all the libtool
4979 libraries that it depends on are installed.
4981 This wrapper executable should never be moved out of the build directory.
4982 If it is, it will not operate correctly.
4984 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4985 but could eventually absorb all of the scripts functionality and
4986 exec $objdir/$outputname directly.
4989 cat >> $cwrappersource<<"EOF"
4990 #include <stdio.h>
4991 #include <stdlib.h>
4992 #include <unistd.h>
4993 #include <malloc.h>
4994 #include <stdarg.h>
4995 #include <assert.h>
4997 #if defined(PATH_MAX)
4998 # define LT_PATHMAX PATH_MAX
4999 #elif defined(MAXPATHLEN)
5000 # define LT_PATHMAX MAXPATHLEN
5001 #else
5002 # define LT_PATHMAX 1024
5003 #endif
5005 #ifndef DIR_SEPARATOR
5006 #define DIR_SEPARATOR '/'
5007 #endif
5009 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5010 defined (__OS2__)
5011 #define HAVE_DOS_BASED_FILE_SYSTEM
5012 #ifndef DIR_SEPARATOR_2
5013 #define DIR_SEPARATOR_2 '\\'
5014 #endif
5015 #endif
5017 #ifndef DIR_SEPARATOR_2
5018 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5019 #else /* DIR_SEPARATOR_2 */
5020 # define IS_DIR_SEPARATOR(ch) \
5021 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5022 #endif /* DIR_SEPARATOR_2 */
5024 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5025 #define XFREE(stale) do { \
5026 if (stale) { free ((void *) stale); stale = 0; } \
5027 } while (0)
5029 const char *program_name = NULL;
5031 void * xmalloc (size_t num);
5032 char * xstrdup (const char *string);
5033 char * basename (const char *name);
5034 char * fnqualify(const char *path);
5035 char * strendzap(char *str, const char *pat);
5036 void lt_fatal (const char *message, ...);
5039 main (int argc, char *argv[])
5041 char **newargz;
5042 int i;
5044 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5045 newargz = XMALLOC(char *, argc+2);
5048 cat >> $cwrappersource <<EOF
5049 newargz[0] = "$SHELL";
5052 cat >> $cwrappersource <<"EOF"
5053 newargz[1] = fnqualify(argv[0]);
5054 /* we know the script has the same name, without the .exe */
5055 /* so make sure newargz[1] doesn't end in .exe */
5056 strendzap(newargz[1],".exe");
5057 for (i = 1; i < argc; i++)
5058 newargz[i+1] = xstrdup(argv[i]);
5059 newargz[argc+1] = NULL;
5062 cat >> $cwrappersource <<EOF
5063 execv("$SHELL",newargz);
5066 cat >> $cwrappersource <<"EOF"
5069 void *
5070 xmalloc (size_t num)
5072 void * p = (void *) malloc (num);
5073 if (!p)
5074 lt_fatal ("Memory exhausted");
5076 return p;
5079 char *
5080 xstrdup (const char *string)
5082 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5086 char *
5087 basename (const char *name)
5089 const char *base;
5091 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5092 /* Skip over the disk name in MSDOS pathnames. */
5093 if (isalpha (name[0]) && name[1] == ':')
5094 name += 2;
5095 #endif
5097 for (base = name; *name; name++)
5098 if (IS_DIR_SEPARATOR (*name))
5099 base = name + 1;
5100 return (char *) base;
5103 char *
5104 fnqualify(const char *path)
5106 size_t size;
5107 char *p;
5108 char tmp[LT_PATHMAX + 1];
5110 assert(path != NULL);
5112 /* Is it qualified already? */
5113 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5114 if (isalpha (path[0]) && path[1] == ':')
5115 return xstrdup (path);
5116 #endif
5117 if (IS_DIR_SEPARATOR (path[0]))
5118 return xstrdup (path);
5120 /* prepend the current directory */
5121 /* doesn't handle '~' */
5122 if (getcwd (tmp, LT_PATHMAX) == NULL)
5123 lt_fatal ("getcwd failed");
5124 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5125 p = XMALLOC(char, size);
5126 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5127 return p;
5130 char *
5131 strendzap(char *str, const char *pat)
5133 size_t len, patlen;
5135 assert(str != NULL);
5136 assert(pat != NULL);
5138 len = strlen(str);
5139 patlen = strlen(pat);
5141 if (patlen <= len)
5143 str += len - patlen;
5144 if (strcmp(str, pat) == 0)
5145 *str = '\0';
5147 return str;
5150 static void
5151 lt_error_core (int exit_status, const char * mode,
5152 const char * message, va_list ap)
5154 fprintf (stderr, "%s: %s: ", program_name, mode);
5155 vfprintf (stderr, message, ap);
5156 fprintf (stderr, ".\n");
5158 if (exit_status >= 0)
5159 exit (exit_status);
5162 void
5163 lt_fatal (const char *message, ...)
5165 va_list ap;
5166 va_start (ap, message);
5167 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5168 va_end (ap);
5171 # we should really use a build-platform specific compiler
5172 # here, but OTOH, the wrappers (shell script and this C one)
5173 # are only useful if you want to execute the "real" binary.
5174 # Since the "real" binary is built for $host, then this
5175 # wrapper might as well be built for $host, too.
5176 $run $LTCC -s -o $cwrapper $cwrappersource
5178 esac
5179 $rm $output
5180 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5182 $echo > $output "\
5183 #! $SHELL
5185 # $output - temporary wrapper script for $objdir/$outputname
5186 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5188 # The $output program cannot be directly executed until all the libtool
5189 # libraries that it depends on are installed.
5191 # This wrapper script should never be moved out of the build directory.
5192 # If it is, it will not operate correctly.
5194 # Sed substitution that helps us do robust quoting. It backslashifies
5195 # metacharacters that are still active within double-quoted strings.
5196 Xsed='${SED} -e 1s/^X//'
5197 sed_quote_subst='$sed_quote_subst'
5199 # The HP-UX ksh and POSIX shell print the target directory to stdout
5200 # if CDPATH is set.
5201 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5203 relink_command=\"$relink_command\"
5205 # This environment variable determines our operation mode.
5206 if test \"\$libtool_install_magic\" = \"$magic\"; then
5207 # install mode needs the following variable:
5208 notinst_deplibs='$notinst_deplibs'
5209 else
5210 # When we are sourced in execute mode, \$file and \$echo are already set.
5211 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5212 echo=\"$qecho\"
5213 file=\"\$0\"
5214 # Make sure echo works.
5215 if test \"X\$1\" = X--no-reexec; then
5216 # Discard the --no-reexec flag, and continue.
5217 shift
5218 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5219 # Yippee, \$echo works!
5221 else
5222 # Restart under the correct shell, and then maybe \$echo will work.
5223 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5227 $echo >> $output "\
5229 # Find the directory that this script lives in.
5230 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5231 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5233 # Follow symbolic links until we get to the real thisdir.
5234 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5235 while test -n \"\$file\"; do
5236 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5238 # If there was a directory component, then change thisdir.
5239 if test \"x\$destdir\" != \"x\$file\"; then
5240 case \"\$destdir\" in
5241 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5242 *) thisdir=\"\$thisdir/\$destdir\" ;;
5243 esac
5246 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5247 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5248 done
5250 # Try to get the absolute directory name.
5251 absdir=\`cd \"\$thisdir\" && pwd\`
5252 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5255 if test "$fast_install" = yes; then
5256 $echo >> $output "\
5257 program=lt-'$outputname'$exeext
5258 progdir=\"\$thisdir/$objdir\"
5260 if test ! -f \"\$progdir/\$program\" || \\
5261 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5262 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5264 file=\"\$\$-\$program\"
5266 if test ! -d \"\$progdir\"; then
5267 $mkdir \"\$progdir\"
5268 else
5269 $rm \"\$progdir/\$file\"
5272 $echo >> $output "\
5274 # relink executable if necessary
5275 if test -n \"\$relink_command\"; then
5276 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5277 else
5278 $echo \"\$relink_command_output\" >&2
5279 $rm \"\$progdir/\$file\"
5280 exit $EXIT_FAILURE
5284 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5285 { $rm \"\$progdir/\$program\";
5286 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5287 $rm \"\$progdir/\$file\"
5289 else
5290 $echo >> $output "\
5291 program='$outputname'
5292 progdir=\"\$thisdir/$objdir\"
5296 $echo >> $output "\
5298 if test -f \"\$progdir/\$program\"; then"
5300 # Export our shlibpath_var if we have one.
5301 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5302 $echo >> $output "\
5303 # Add our own library path to $shlibpath_var
5304 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5306 # Some systems cannot cope with colon-terminated $shlibpath_var
5307 # The second colon is a workaround for a bug in BeOS R4 sed
5308 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5310 export $shlibpath_var
5314 # fixup the dll searchpath if we need to.
5315 if test -n "$dllsearchpath"; then
5316 $echo >> $output "\
5317 # Add the dll search path components to the executable PATH
5318 PATH=$dllsearchpath:\$PATH
5322 $echo >> $output "\
5323 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5324 # Run the actual program with our arguments.
5326 case $host in
5327 # Backslashes separate directories on plain windows
5328 *-*-mingw | *-*-os2*)
5329 $echo >> $output "\
5330 exec \$progdir\\\\\$program \${1+\"\$@\"}
5335 $echo >> $output "\
5336 exec \$progdir/\$program \${1+\"\$@\"}
5339 esac
5340 $echo >> $output "\
5341 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5342 exit $EXIT_FAILURE
5344 else
5345 # The program doesn't exist.
5346 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5347 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5348 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5349 exit $EXIT_FAILURE
5353 chmod +x $output
5355 exit $EXIT_SUCCESS
5357 esac
5359 # See if we need to build an old-fashioned archive.
5360 for oldlib in $oldlibs; do
5362 if test "$build_libtool_libs" = convenience; then
5363 oldobjs="$libobjs_save"
5364 addlibs="$convenience"
5365 build_libtool_libs=no
5366 else
5367 if test "$build_libtool_libs" = module; then
5368 oldobjs="$libobjs_save"
5369 build_libtool_libs=no
5370 else
5371 oldobjs="$old_deplibs $non_pic_objects"
5373 addlibs="$old_convenience"
5376 if test -n "$addlibs"; then
5377 gentop="$output_objdir/${outputname}x"
5378 generated="$generated $gentop"
5380 func_extract_archives $gentop $addlibs
5381 oldobjs="$oldobjs $func_extract_archives_result"
5384 # Do each command in the archive commands.
5385 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5386 cmds=$old_archive_from_new_cmds
5387 else
5388 eval cmds=\"$old_archive_cmds\"
5390 if len=`expr "X$cmds" : ".*"` &&
5391 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5392 cmds=$old_archive_cmds
5393 else
5394 # the command line is too long to link in one step, link in parts
5395 $echo "using piecewise archive linking..."
5396 save_RANLIB=$RANLIB
5397 RANLIB=:
5398 objlist=
5399 concat_cmds=
5400 save_oldobjs=$oldobjs
5401 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5402 # encoded into archives. This makes 'ar r' malfunction in
5403 # this piecewise linking case whenever conflicting object
5404 # names appear in distinct ar calls; check, warn and compensate.
5405 if (for obj in $save_oldobjs
5407 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5408 done | sort | sort -uc >/dev/null 2>&1); then
5410 else
5411 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5412 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5413 AR_FLAGS=cq
5415 # Is there a better way of finding the last object in the list?
5416 for obj in $save_oldobjs
5418 last_oldobj=$obj
5419 done
5420 for obj in $save_oldobjs
5422 oldobjs="$objlist $obj"
5423 objlist="$objlist $obj"
5424 eval test_cmds=\"$old_archive_cmds\"
5425 if len=`expr "X$test_cmds" : ".*"` &&
5426 test "$len" -le "$max_cmd_len"; then
5428 else
5429 # the above command should be used before it gets too long
5430 oldobjs=$objlist
5431 if test "$obj" = "$last_oldobj" ; then
5432 RANLIB=$save_RANLIB
5434 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5435 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5436 objlist=
5438 done
5439 RANLIB=$save_RANLIB
5440 oldobjs=$objlist
5441 if test "X$oldobjs" = "X" ; then
5442 eval cmds=\"\$concat_cmds\"
5443 else
5444 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5448 save_ifs="$IFS"; IFS='~'
5449 for cmd in $cmds; do
5450 eval cmd=\"$cmd\"
5451 IFS="$save_ifs"
5452 $show "$cmd"
5453 $run eval "$cmd" || exit $?
5454 done
5455 IFS="$save_ifs"
5456 done
5458 if test -n "$generated"; then
5459 $show "${rm}r$generated"
5460 $run ${rm}r$generated
5463 # Now create the libtool archive.
5464 case $output in
5465 *.la)
5466 old_library=
5467 test "$build_old_libs" = yes && old_library="$libname.$libext"
5468 $show "creating $output"
5470 # Preserve any variables that may affect compiler behavior
5471 for var in $variables_saved_for_relink; do
5472 if eval test -z \"\${$var+set}\"; then
5473 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5474 elif eval var_value=\$$var; test -z "$var_value"; then
5475 relink_command="$var=; export $var; $relink_command"
5476 else
5477 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5478 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5480 done
5481 # Quote the link command for shipping.
5482 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5483 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5484 if test "$hardcode_automatic" = yes ; then
5485 relink_command=
5489 # Only create the output if not a dry run.
5490 if test -z "$run"; then
5491 for installed in no yes; do
5492 if test "$installed" = yes; then
5493 if test -z "$install_libdir"; then
5494 break
5496 output="$output_objdir/$outputname"i
5497 # Replace all uninstalled libtool libraries with the installed ones
5498 newdependency_libs=
5499 for deplib in $dependency_libs; do
5500 case $deplib in
5501 *.la)
5502 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5503 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5504 if test -z "$libdir"; then
5505 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5506 exit $EXIT_FAILURE
5508 newdependency_libs="$newdependency_libs $libdir/$name"
5510 *) newdependency_libs="$newdependency_libs $deplib" ;;
5511 esac
5512 done
5513 dependency_libs="$newdependency_libs"
5514 newdlfiles=
5515 for lib in $dlfiles; do
5516 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5517 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5518 if test -z "$libdir"; then
5519 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5520 exit $EXIT_FAILURE
5522 newdlfiles="$newdlfiles $libdir/$name"
5523 done
5524 dlfiles="$newdlfiles"
5525 newdlprefiles=
5526 for lib in $dlprefiles; do
5527 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5528 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5529 if test -z "$libdir"; then
5530 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5531 exit $EXIT_FAILURE
5533 newdlprefiles="$newdlprefiles $libdir/$name"
5534 done
5535 dlprefiles="$newdlprefiles"
5536 else
5537 newdlfiles=
5538 for lib in $dlfiles; do
5539 case $lib in
5540 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5541 *) abs=`pwd`"/$lib" ;;
5542 esac
5543 newdlfiles="$newdlfiles $abs"
5544 done
5545 dlfiles="$newdlfiles"
5546 newdlprefiles=
5547 for lib in $dlprefiles; do
5548 case $lib in
5549 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5550 *) abs=`pwd`"/$lib" ;;
5551 esac
5552 newdlprefiles="$newdlprefiles $abs"
5553 done
5554 dlprefiles="$newdlprefiles"
5556 $rm $output
5557 # place dlname in correct position for cygwin
5558 tdlname=$dlname
5559 case $host,$output,$installed,$module,$dlname in
5560 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5561 esac
5562 $echo > $output "\
5563 # $outputname - a libtool library file
5564 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5566 # Please DO NOT delete this file!
5567 # It is necessary for linking the library.
5569 # The name that we can dlopen(3).
5570 dlname='$tdlname'
5572 # Names of this library.
5573 library_names='$library_names'
5575 # The name of the static archive.
5576 old_library='$old_library'
5578 # Libraries that this one depends upon.
5579 dependency_libs='$dependency_libs'
5581 # Version information for $libname.
5582 current=$current
5583 age=$age
5584 revision=$revision
5586 # Is this an already installed library?
5587 installed=$installed
5589 # Should we warn about portability when linking against -modules?
5590 shouldnotlink=$module
5592 # Files to dlopen/dlpreopen
5593 dlopen='$dlfiles'
5594 dlpreopen='$dlprefiles'
5596 # Directory that this library needs to be installed in:
5597 libdir='$install_libdir'"
5598 if test "$installed" = no && test "$need_relink" = yes; then
5599 $echo >> $output "\
5600 relink_command=\"$relink_command\""
5602 done
5605 # Do a symbolic link so that the libtool archive can be found in
5606 # LD_LIBRARY_PATH before the program is installed.
5607 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5608 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5610 esac
5611 exit $EXIT_SUCCESS
5614 # libtool install mode
5615 install)
5616 modename="$modename: install"
5618 # There may be an optional sh(1) argument at the beginning of
5619 # install_prog (especially on Windows NT).
5620 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5621 # Allow the use of GNU shtool's install command.
5622 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5623 # Aesthetically quote it.
5624 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5625 case $arg in
5626 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5627 arg="\"$arg\""
5629 esac
5630 install_prog="$arg "
5631 arg="$1"
5632 shift
5633 else
5634 install_prog=
5635 arg="$nonopt"
5638 # The real first argument should be the name of the installation program.
5639 # Aesthetically quote it.
5640 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5641 case $arg in
5642 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5643 arg="\"$arg\""
5645 esac
5646 install_prog="$install_prog$arg"
5648 # We need to accept at least all the BSD install flags.
5649 dest=
5650 files=
5651 opts=
5652 prev=
5653 install_type=
5654 isdir=no
5655 stripme=
5656 for arg
5658 if test -n "$dest"; then
5659 files="$files $dest"
5660 dest="$arg"
5661 continue
5664 case $arg in
5665 -d) isdir=yes ;;
5666 -f) prev="-f" ;;
5667 -g) prev="-g" ;;
5668 -m) prev="-m" ;;
5669 -o) prev="-o" ;;
5671 stripme=" -s"
5672 continue
5674 -*) ;;
5677 # If the previous option needed an argument, then skip it.
5678 if test -n "$prev"; then
5679 prev=
5680 else
5681 dest="$arg"
5682 continue
5685 esac
5687 # Aesthetically quote the argument.
5688 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5689 case $arg in
5690 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5691 arg="\"$arg\""
5693 esac
5694 install_prog="$install_prog $arg"
5695 done
5697 if test -z "$install_prog"; then
5698 $echo "$modename: you must specify an install program" 1>&2
5699 $echo "$help" 1>&2
5700 exit $EXIT_FAILURE
5703 if test -n "$prev"; then
5704 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5705 $echo "$help" 1>&2
5706 exit $EXIT_FAILURE
5709 if test -z "$files"; then
5710 if test -z "$dest"; then
5711 $echo "$modename: no file or destination specified" 1>&2
5712 else
5713 $echo "$modename: you must specify a destination" 1>&2
5715 $echo "$help" 1>&2
5716 exit $EXIT_FAILURE
5719 # Strip any trailing slash from the destination.
5720 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5722 # Check to see that the destination is a directory.
5723 test -d "$dest" && isdir=yes
5724 if test "$isdir" = yes; then
5725 destdir="$dest"
5726 destname=
5727 else
5728 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5729 test "X$destdir" = "X$dest" && destdir=.
5730 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5732 # Not a directory, so check to see that there is only one file specified.
5733 set dummy $files
5734 if test "$#" -gt 2; then
5735 $echo "$modename: \`$dest' is not a directory" 1>&2
5736 $echo "$help" 1>&2
5737 exit $EXIT_FAILURE
5740 case $destdir in
5741 [\\/]* | [A-Za-z]:[\\/]*) ;;
5743 for file in $files; do
5744 case $file in
5745 *.lo) ;;
5747 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5748 $echo "$help" 1>&2
5749 exit $EXIT_FAILURE
5751 esac
5752 done
5754 esac
5756 # This variable tells wrapper scripts just to set variables rather
5757 # than running their programs.
5758 libtool_install_magic="$magic"
5760 staticlibs=
5761 future_libdirs=
5762 current_libdirs=
5763 for file in $files; do
5765 # Do each installation.
5766 case $file in
5767 *.$libext)
5768 # Do the static libraries later.
5769 staticlibs="$staticlibs $file"
5772 *.la)
5773 # Check to see that this really is a libtool archive.
5774 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5775 else
5776 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5777 $echo "$help" 1>&2
5778 exit $EXIT_FAILURE
5781 library_names=
5782 old_library=
5783 relink_command=
5784 # If there is no directory component, then add one.
5785 case $file in
5786 */* | *\\*) . $file ;;
5787 *) . ./$file ;;
5788 esac
5790 # Add the libdir to current_libdirs if it is the destination.
5791 if test "X$destdir" = "X$libdir"; then
5792 case "$current_libdirs " in
5793 *" $libdir "*) ;;
5794 *) current_libdirs="$current_libdirs $libdir" ;;
5795 esac
5796 else
5797 # Note the libdir as a future libdir.
5798 case "$future_libdirs " in
5799 *" $libdir "*) ;;
5800 *) future_libdirs="$future_libdirs $libdir" ;;
5801 esac
5804 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5805 test "X$dir" = "X$file/" && dir=
5806 dir="$dir$objdir"
5808 if test -n "$relink_command"; then
5809 # Determine the prefix the user has applied to our future dir.
5810 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5812 # Don't allow the user to place us outside of our expected
5813 # location b/c this prevents finding dependent libraries that
5814 # are installed to the same prefix.
5815 # At present, this check doesn't affect windows .dll's that
5816 # are installed into $libdir/../bin (currently, that works fine)
5817 # but it's something to keep an eye on.
5818 if test "$inst_prefix_dir" = "$destdir"; then
5819 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5820 exit $EXIT_FAILURE
5823 if test -n "$inst_prefix_dir"; then
5824 # Stick the inst_prefix_dir data into the link command.
5825 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5826 else
5827 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5830 $echo "$modename: warning: relinking \`$file'" 1>&2
5831 $show "$relink_command"
5832 if $run eval "$relink_command"; then :
5833 else
5834 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5835 exit $EXIT_FAILURE
5839 # See the names of the shared library.
5840 set dummy $library_names
5841 if test -n "$2"; then
5842 realname="$2"
5843 shift
5844 shift
5846 srcname="$realname"
5847 test -n "$relink_command" && srcname="$realname"T
5849 # Install the shared library and build the symlinks.
5850 $show "$install_prog $dir/$srcname $destdir/$realname"
5851 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5852 if test -n "$stripme" && test -n "$striplib"; then
5853 $show "$striplib $destdir/$realname"
5854 $run eval "$striplib $destdir/$realname" || exit $?
5857 if test "$#" -gt 0; then
5858 # Delete the old symlinks, and create new ones.
5859 for linkname
5861 if test "$linkname" != "$realname"; then
5862 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5863 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5865 done
5868 # Do each command in the postinstall commands.
5869 lib="$destdir/$realname"
5870 cmds=$postinstall_cmds
5871 save_ifs="$IFS"; IFS='~'
5872 for cmd in $cmds; do
5873 IFS="$save_ifs"
5874 eval cmd=\"$cmd\"
5875 $show "$cmd"
5876 $run eval "$cmd" || exit $?
5877 done
5878 IFS="$save_ifs"
5881 # Install the pseudo-library for information purposes.
5882 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5883 instname="$dir/$name"i
5884 $show "$install_prog $instname $destdir/$name"
5885 $run eval "$install_prog $instname $destdir/$name" || exit $?
5887 # Maybe install the static library, too.
5888 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5891 *.lo)
5892 # Install (i.e. copy) a libtool object.
5894 # Figure out destination file name, if it wasn't already specified.
5895 if test -n "$destname"; then
5896 destfile="$destdir/$destname"
5897 else
5898 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5899 destfile="$destdir/$destfile"
5902 # Deduce the name of the destination old-style object file.
5903 case $destfile in
5904 *.lo)
5905 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5907 *.$objext)
5908 staticdest="$destfile"
5909 destfile=
5912 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5913 $echo "$help" 1>&2
5914 exit $EXIT_FAILURE
5916 esac
5918 # Install the libtool object if requested.
5919 if test -n "$destfile"; then
5920 $show "$install_prog $file $destfile"
5921 $run eval "$install_prog $file $destfile" || exit $?
5924 # Install the old object if enabled.
5925 if test "$build_old_libs" = yes; then
5926 # Deduce the name of the old-style object file.
5927 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5929 $show "$install_prog $staticobj $staticdest"
5930 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5932 exit $EXIT_SUCCESS
5936 # Figure out destination file name, if it wasn't already specified.
5937 if test -n "$destname"; then
5938 destfile="$destdir/$destname"
5939 else
5940 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5941 destfile="$destdir/$destfile"
5944 # If the file is missing, and there is a .exe on the end, strip it
5945 # because it is most likely a libtool script we actually want to
5946 # install
5947 stripped_ext=""
5948 case $file in
5949 *.exe)
5950 if test ! -f "$file"; then
5951 file=`$echo $file|${SED} 's,.exe$,,'`
5952 stripped_ext=".exe"
5955 esac
5957 # Do a test to see if this is really a libtool program.
5958 case $host in
5959 *cygwin*|*mingw*)
5960 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5963 wrapper=$file
5965 esac
5966 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5967 notinst_deplibs=
5968 relink_command=
5970 # To insure that "foo" is sourced, and not "foo.exe",
5971 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5972 # which disallows the automatic-append-.exe behavior.
5973 case $build in
5974 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5975 *) wrapperdot=${wrapper} ;;
5976 esac
5977 # If there is no directory component, then add one.
5978 case $file in
5979 */* | *\\*) . ${wrapperdot} ;;
5980 *) . ./${wrapperdot} ;;
5981 esac
5983 # Check the variables that should have been set.
5984 if test -z "$notinst_deplibs"; then
5985 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5986 exit $EXIT_FAILURE
5989 finalize=yes
5990 for lib in $notinst_deplibs; do
5991 # Check to see that each library is installed.
5992 libdir=
5993 if test -f "$lib"; then
5994 # If there is no directory component, then add one.
5995 case $lib in
5996 */* | *\\*) . $lib ;;
5997 *) . ./$lib ;;
5998 esac
6000 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6001 if test -n "$libdir" && test ! -f "$libfile"; then
6002 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6003 finalize=no
6005 done
6007 relink_command=
6008 # To insure that "foo" is sourced, and not "foo.exe",
6009 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6010 # which disallows the automatic-append-.exe behavior.
6011 case $build in
6012 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6013 *) wrapperdot=${wrapper} ;;
6014 esac
6015 # If there is no directory component, then add one.
6016 case $file in
6017 */* | *\\*) . ${wrapperdot} ;;
6018 *) . ./${wrapperdot} ;;
6019 esac
6021 outputname=
6022 if test "$fast_install" = no && test -n "$relink_command"; then
6023 if test "$finalize" = yes && test -z "$run"; then
6024 tmpdir="/tmp"
6025 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6026 tmpdir="$tmpdir/libtool-$$"
6027 save_umask=`umask`
6028 umask 0077
6029 if $mkdir "$tmpdir"; then
6030 umask $save_umask
6031 else
6032 umask $save_umask
6033 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6034 continue
6036 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6037 outputname="$tmpdir/$file"
6038 # Replace the output file specification.
6039 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6041 $show "$relink_command"
6042 if $run eval "$relink_command"; then :
6043 else
6044 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6045 ${rm}r "$tmpdir"
6046 continue
6048 file="$outputname"
6049 else
6050 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6052 else
6053 # Install the binary that we compiled earlier.
6054 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6058 # remove .exe since cygwin /usr/bin/install will append another
6059 # one anyways
6060 case $install_prog,$host in
6061 */usr/bin/install*,*cygwin*)
6062 case $file:$destfile in
6063 *.exe:*.exe)
6064 # this is ok
6066 *.exe:*)
6067 destfile=$destfile.exe
6069 *:*.exe)
6070 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6072 esac
6074 esac
6075 $show "$install_prog$stripme $file $destfile"
6076 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6077 test -n "$outputname" && ${rm}r "$tmpdir"
6079 esac
6080 done
6082 for file in $staticlibs; do
6083 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6085 # Set up the ranlib parameters.
6086 oldlib="$destdir/$name"
6088 $show "$install_prog $file $oldlib"
6089 $run eval "$install_prog \$file \$oldlib" || exit $?
6091 if test -n "$stripme" && test -n "$old_striplib"; then
6092 $show "$old_striplib $oldlib"
6093 $run eval "$old_striplib $oldlib" || exit $?
6096 # Do each command in the postinstall commands.
6097 cmds=$old_postinstall_cmds
6098 save_ifs="$IFS"; IFS='~'
6099 for cmd in $cmds; do
6100 IFS="$save_ifs"
6101 eval cmd=\"$cmd\"
6102 $show "$cmd"
6103 $run eval "$cmd" || exit $?
6104 done
6105 IFS="$save_ifs"
6106 done
6108 if test -n "$future_libdirs"; then
6109 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6112 if test -n "$current_libdirs"; then
6113 # Maybe just do a dry run.
6114 test -n "$run" && current_libdirs=" -n$current_libdirs"
6115 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6116 else
6117 exit $EXIT_SUCCESS
6121 # libtool finish mode
6122 finish)
6123 modename="$modename: finish"
6124 libdirs="$nonopt"
6125 admincmds=
6127 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6128 for dir
6130 libdirs="$libdirs $dir"
6131 done
6133 for libdir in $libdirs; do
6134 if test -n "$finish_cmds"; then
6135 # Do each command in the finish commands.
6136 cmds=$finish_cmds
6137 save_ifs="$IFS"; IFS='~'
6138 for cmd in $cmds; do
6139 IFS="$save_ifs"
6140 eval cmd=\"$cmd\"
6141 $show "$cmd"
6142 $run eval "$cmd" || admincmds="$admincmds
6143 $cmd"
6144 done
6145 IFS="$save_ifs"
6147 if test -n "$finish_eval"; then
6148 # Do the single finish_eval.
6149 eval cmds=\"$finish_eval\"
6150 $run eval "$cmds" || admincmds="$admincmds
6151 $cmds"
6153 done
6156 # Exit here if they wanted silent mode.
6157 test "$show" = : && exit $EXIT_SUCCESS
6159 $echo "----------------------------------------------------------------------"
6160 $echo "Libraries have been installed in:"
6161 for libdir in $libdirs; do
6162 $echo " $libdir"
6163 done
6164 $echo
6165 $echo "If you ever happen to want to link against installed libraries"
6166 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6167 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6168 $echo "flag during linking and do at least one of the following:"
6169 if test -n "$shlibpath_var"; then
6170 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6171 $echo " during execution"
6173 if test -n "$runpath_var"; then
6174 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6175 $echo " during linking"
6177 if test -n "$hardcode_libdir_flag_spec"; then
6178 libdir=LIBDIR
6179 eval flag=\"$hardcode_libdir_flag_spec\"
6181 $echo " - use the \`$flag' linker flag"
6183 if test -n "$admincmds"; then
6184 $echo " - have your system administrator run these commands:$admincmds"
6186 if test -f /etc/ld.so.conf; then
6187 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6189 $echo
6190 $echo "See any operating system documentation about shared libraries for"
6191 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6192 $echo "----------------------------------------------------------------------"
6193 exit $EXIT_SUCCESS
6196 # libtool execute mode
6197 execute)
6198 modename="$modename: execute"
6200 # The first argument is the command name.
6201 cmd="$nonopt"
6202 if test -z "$cmd"; then
6203 $echo "$modename: you must specify a COMMAND" 1>&2
6204 $echo "$help"
6205 exit $EXIT_FAILURE
6208 # Handle -dlopen flags immediately.
6209 for file in $execute_dlfiles; do
6210 if test ! -f "$file"; then
6211 $echo "$modename: \`$file' is not a file" 1>&2
6212 $echo "$help" 1>&2
6213 exit $EXIT_FAILURE
6216 dir=
6217 case $file in
6218 *.la)
6219 # Check to see that this really is a libtool archive.
6220 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6221 else
6222 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6223 $echo "$help" 1>&2
6224 exit $EXIT_FAILURE
6227 # Read the libtool library.
6228 dlname=
6229 library_names=
6231 # If there is no directory component, then add one.
6232 case $file in
6233 */* | *\\*) . $file ;;
6234 *) . ./$file ;;
6235 esac
6237 # Skip this library if it cannot be dlopened.
6238 if test -z "$dlname"; then
6239 # Warn if it was a shared library.
6240 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6241 continue
6244 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6245 test "X$dir" = "X$file" && dir=.
6247 if test -f "$dir/$objdir/$dlname"; then
6248 dir="$dir/$objdir"
6249 else
6250 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6251 exit $EXIT_FAILURE
6255 *.lo)
6256 # Just add the directory containing the .lo file.
6257 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6258 test "X$dir" = "X$file" && dir=.
6262 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6263 continue
6265 esac
6267 # Get the absolute pathname.
6268 absdir=`cd "$dir" && pwd`
6269 test -n "$absdir" && dir="$absdir"
6271 # Now add the directory to shlibpath_var.
6272 if eval "test -z \"\$$shlibpath_var\""; then
6273 eval "$shlibpath_var=\"\$dir\""
6274 else
6275 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6277 done
6279 # This variable tells wrapper scripts just to set shlibpath_var
6280 # rather than running their programs.
6281 libtool_execute_magic="$magic"
6283 # Check if any of the arguments is a wrapper script.
6284 args=
6285 for file
6287 case $file in
6288 -*) ;;
6290 # Do a test to see if this is really a libtool program.
6291 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6292 # If there is no directory component, then add one.
6293 case $file in
6294 */* | *\\*) . $file ;;
6295 *) . ./$file ;;
6296 esac
6298 # Transform arg to wrapped name.
6299 file="$progdir/$program"
6302 esac
6303 # Quote arguments (to preserve shell metacharacters).
6304 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6305 args="$args \"$file\""
6306 done
6308 if test -z "$run"; then
6309 if test -n "$shlibpath_var"; then
6310 # Export the shlibpath_var.
6311 eval "export $shlibpath_var"
6314 # Restore saved environment variables
6315 if test "${save_LC_ALL+set}" = set; then
6316 LC_ALL="$save_LC_ALL"; export LC_ALL
6318 if test "${save_LANG+set}" = set; then
6319 LANG="$save_LANG"; export LANG
6322 # Now prepare to actually exec the command.
6323 exec_cmd="\$cmd$args"
6324 else
6325 # Display what would be done.
6326 if test -n "$shlibpath_var"; then
6327 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6328 $echo "export $shlibpath_var"
6330 $echo "$cmd$args"
6331 exit $EXIT_SUCCESS
6335 # libtool clean and uninstall mode
6336 clean | uninstall)
6337 modename="$modename: $mode"
6338 rm="$nonopt"
6339 files=
6340 rmforce=
6341 exit_status=0
6343 # This variable tells wrapper scripts just to set variables rather
6344 # than running their programs.
6345 libtool_install_magic="$magic"
6347 for arg
6349 case $arg in
6350 -f) rm="$rm $arg"; rmforce=yes ;;
6351 -*) rm="$rm $arg" ;;
6352 *) files="$files $arg" ;;
6353 esac
6354 done
6356 if test -z "$rm"; then
6357 $echo "$modename: you must specify an RM program" 1>&2
6358 $echo "$help" 1>&2
6359 exit $EXIT_FAILURE
6362 rmdirs=
6364 origobjdir="$objdir"
6365 for file in $files; do
6366 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6367 if test "X$dir" = "X$file"; then
6368 dir=.
6369 objdir="$origobjdir"
6370 else
6371 objdir="$dir/$origobjdir"
6373 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6374 test "$mode" = uninstall && objdir="$dir"
6376 # Remember objdir for removal later, being careful to avoid duplicates
6377 if test "$mode" = clean; then
6378 case " $rmdirs " in
6379 *" $objdir "*) ;;
6380 *) rmdirs="$rmdirs $objdir" ;;
6381 esac
6384 # Don't error if the file doesn't exist and rm -f was used.
6385 if (test -L "$file") >/dev/null 2>&1 \
6386 || (test -h "$file") >/dev/null 2>&1 \
6387 || test -f "$file"; then
6389 elif test -d "$file"; then
6390 exit_status=1
6391 continue
6392 elif test "$rmforce" = yes; then
6393 continue
6396 rmfiles="$file"
6398 case $name in
6399 *.la)
6400 # Possibly a libtool archive, so verify it.
6401 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6402 . $dir/$name
6404 # Delete the libtool libraries and symlinks.
6405 for n in $library_names; do
6406 rmfiles="$rmfiles $objdir/$n"
6407 done
6408 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6409 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6411 if test "$mode" = uninstall; then
6412 if test -n "$library_names"; then
6413 # Do each command in the postuninstall commands.
6414 cmds=$postuninstall_cmds
6415 save_ifs="$IFS"; IFS='~'
6416 for cmd in $cmds; do
6417 IFS="$save_ifs"
6418 eval cmd=\"$cmd\"
6419 $show "$cmd"
6420 $run eval "$cmd"
6421 if test "$?" -ne 0 && test "$rmforce" != yes; then
6422 exit_status=1
6424 done
6425 IFS="$save_ifs"
6428 if test -n "$old_library"; then
6429 # Do each command in the old_postuninstall commands.
6430 cmds=$old_postuninstall_cmds
6431 save_ifs="$IFS"; IFS='~'
6432 for cmd in $cmds; do
6433 IFS="$save_ifs"
6434 eval cmd=\"$cmd\"
6435 $show "$cmd"
6436 $run eval "$cmd"
6437 if test "$?" -ne 0 && test "$rmforce" != yes; then
6438 exit_status=1
6440 done
6441 IFS="$save_ifs"
6443 # FIXME: should reinstall the best remaining shared library.
6448 *.lo)
6449 # Possibly a libtool object, so verify it.
6450 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6452 # Read the .lo file
6453 . $dir/$name
6455 # Add PIC object to the list of files to remove.
6456 if test -n "$pic_object" \
6457 && test "$pic_object" != none; then
6458 rmfiles="$rmfiles $dir/$pic_object"
6461 # Add non-PIC object to the list of files to remove.
6462 if test -n "$non_pic_object" \
6463 && test "$non_pic_object" != none; then
6464 rmfiles="$rmfiles $dir/$non_pic_object"
6470 if test "$mode" = clean ; then
6471 noexename=$name
6472 case $file in
6473 *.exe)
6474 file=`$echo $file|${SED} 's,.exe$,,'`
6475 noexename=`$echo $name|${SED} 's,.exe$,,'`
6476 # $file with .exe has already been added to rmfiles,
6477 # add $file without .exe
6478 rmfiles="$rmfiles $file"
6480 esac
6481 # Do a test to see if this is a libtool program.
6482 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6483 relink_command=
6484 . $dir/$noexename
6486 # note $name still contains .exe if it was in $file originally
6487 # as does the version of $file that was added into $rmfiles
6488 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6489 if test "$fast_install" = yes && test -n "$relink_command"; then
6490 rmfiles="$rmfiles $objdir/lt-$name"
6492 if test "X$noexename" != "X$name" ; then
6493 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6498 esac
6499 $show "$rm $rmfiles"
6500 $run $rm $rmfiles || exit_status=1
6501 done
6502 objdir="$origobjdir"
6504 # Try to remove the ${objdir}s in the directories where we deleted files
6505 for dir in $rmdirs; do
6506 if test -d "$dir"; then
6507 $show "rmdir $dir"
6508 $run rmdir $dir >/dev/null 2>&1
6510 done
6512 exit $exit_status
6516 $echo "$modename: you must specify a MODE" 1>&2
6517 $echo "$generic_help" 1>&2
6518 exit $EXIT_FAILURE
6520 esac
6522 if test -z "$exec_cmd"; then
6523 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6524 $echo "$generic_help" 1>&2
6525 exit $EXIT_FAILURE
6527 fi # test -z "$show_help"
6529 if test -n "$exec_cmd"; then
6530 eval exec $exec_cmd
6531 exit $EXIT_FAILURE
6534 # We need to display help for each of the modes.
6535 case $mode in
6536 "") $echo \
6537 "Usage: $modename [OPTION]... [MODE-ARG]...
6539 Provide generalized library-building support services.
6541 --config show all configuration variables
6542 --debug enable verbose shell tracing
6543 -n, --dry-run display commands without modifying any files
6544 --features display basic configuration information and exit
6545 --finish same as \`--mode=finish'
6546 --help display this help message and exit
6547 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6548 --quiet same as \`--silent'
6549 --silent don't print informational messages
6550 --tag=TAG use configuration variables from tag TAG
6551 --version print version information
6553 MODE must be one of the following:
6555 clean remove files from the build directory
6556 compile compile a source file into a libtool object
6557 execute automatically set library path, then run a program
6558 finish complete the installation of libtool libraries
6559 install install libraries or executables
6560 link create a library or an executable
6561 uninstall remove libraries from an installed directory
6563 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6564 a more detailed description of MODE.
6566 Report bugs to <bug-libtool@gnu.org>."
6567 exit $EXIT_SUCCESS
6570 clean)
6571 $echo \
6572 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6574 Remove files from the build directory.
6576 RM is the name of the program to use to delete files associated with each FILE
6577 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6578 to RM.
6580 If FILE is a libtool library, object or program, all the files associated
6581 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6584 compile)
6585 $echo \
6586 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6588 Compile a source file into a libtool library object.
6590 This mode accepts the following additional options:
6592 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6593 -prefer-pic try to building PIC objects only
6594 -prefer-non-pic try to building non-PIC objects only
6595 -static always build a \`.o' file suitable for static linking
6597 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6598 from the given SOURCEFILE.
6600 The output file name is determined by removing the directory component from
6601 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6602 library object suffix, \`.lo'."
6605 execute)
6606 $echo \
6607 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6609 Automatically set library path, then run a program.
6611 This mode accepts the following additional options:
6613 -dlopen FILE add the directory containing FILE to the library path
6615 This mode sets the library path environment variable according to \`-dlopen'
6616 flags.
6618 If any of the ARGS are libtool executable wrappers, then they are translated
6619 into their corresponding uninstalled binary, and any of their required library
6620 directories are added to the library path.
6622 Then, COMMAND is executed, with ARGS as arguments."
6625 finish)
6626 $echo \
6627 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6629 Complete the installation of libtool libraries.
6631 Each LIBDIR is a directory that contains libtool libraries.
6633 The commands that this mode executes may require superuser privileges. Use
6634 the \`--dry-run' option if you just want to see what would be executed."
6637 install)
6638 $echo \
6639 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6641 Install executables or libraries.
6643 INSTALL-COMMAND is the installation command. The first component should be
6644 either the \`install' or \`cp' program.
6646 The rest of the components are interpreted as arguments to that command (only
6647 BSD-compatible install options are recognized)."
6650 link)
6651 $echo \
6652 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6654 Link object files or libraries together to form another library, or to
6655 create an executable program.
6657 LINK-COMMAND is a command using the C compiler that you would use to create
6658 a program from several object files.
6660 The following components of LINK-COMMAND are treated specially:
6662 -all-static do not do any dynamic linking at all
6663 -avoid-version do not add a version suffix if possible
6664 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6665 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6666 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6667 -export-symbols SYMFILE
6668 try to export only the symbols listed in SYMFILE
6669 -export-symbols-regex REGEX
6670 try to export only the symbols matching REGEX
6671 -LLIBDIR search LIBDIR for required installed libraries
6672 -lNAME OUTPUT-FILE requires the installed library libNAME
6673 -module build a library that can dlopened
6674 -no-fast-install disable the fast-install mode
6675 -no-install link a not-installable executable
6676 -no-undefined declare that a library does not refer to external symbols
6677 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6678 -objectlist FILE Use a list of object files found in FILE to specify objects
6679 -precious-files-regex REGEX
6680 don't remove output files matching REGEX
6681 -release RELEASE specify package release information
6682 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6683 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6684 -static do not do any dynamic linking of libtool libraries
6685 -version-info CURRENT[:REVISION[:AGE]]
6686 specify library version info [each variable defaults to 0]
6688 All other options (arguments beginning with \`-') are ignored.
6690 Every other argument is treated as a filename. Files ending in \`.la' are
6691 treated as uninstalled libtool libraries, other files are standard or library
6692 object files.
6694 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6695 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6696 required, except when creating a convenience library.
6698 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6699 using \`ar' and \`ranlib', or on Windows using \`lib'.
6701 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6702 is created, otherwise an executable program is created."
6705 uninstall)
6706 $echo \
6707 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6709 Remove libraries from an installation directory.
6711 RM is the name of the program to use to delete files associated with each FILE
6712 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6713 to RM.
6715 If FILE is a libtool library, all the files associated with it are deleted.
6716 Otherwise, only FILE itself is deleted using RM."
6720 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6721 $echo "$help" 1>&2
6722 exit $EXIT_FAILURE
6724 esac
6726 $echo
6727 $echo "Try \`$modename --help' for more information about other modes."
6729 exit $EXIT_SUCCESS
6731 # The TAGs below are defined such that we never get into a situation
6732 # in which we disable both kinds of libraries. Given conflicting
6733 # choices, we go for a static library, that is the most portable,
6734 # since we can't tell whether shared libraries were disabled because
6735 # the user asked for that or because the platform doesn't support
6736 # them. This is particularly important on AIX, because we don't
6737 # support having both static and shared libraries enabled at the same
6738 # time on that platform, so we default to a shared-only configuration.
6739 # If a disable-shared tag is given, we'll fallback to a static-only
6740 # configuration. But we'll never go from static-only to shared-only.
6742 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6743 build_libtool_libs=no
6744 build_old_libs=yes
6745 # ### END LIBTOOL TAG CONFIG: disable-shared
6747 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6748 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6749 # ### END LIBTOOL TAG CONFIG: disable-static
6751 # Local Variables:
6752 # mode:shell-script
6753 # sh-indentation:2
6754 # End:
6755 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6757 # Libtool was configured on host nik.neuroponic.com:
6759 # Shell to use when invoking shell scripts.
6760 SHELL="/bin/sh"
6762 # Whether or not to build shared libraries.
6763 build_libtool_libs=yes
6765 # Whether or not to build static libraries.
6766 build_old_libs=yes
6768 # Whether or not to add -lc for building shared libraries.
6769 build_libtool_need_lc=no
6771 # Whether or not to disallow shared libs when runtime libs are static
6772 allow_libtool_libs_with_static_runtimes=yes
6774 # Whether or not to optimize for fast installation.
6775 fast_install=needless
6777 # The host system.
6778 host_alias=i386-mingw32msvc
6779 host=i386-pc-mingw32msvc
6781 # An echo program that does not interpret backslashes.
6782 echo="echo"
6784 # The archiver.
6785 AR="i386-mingw32msvc-ar"
6786 AR_FLAGS="cru"
6788 # A C compiler.
6789 LTCC="i386-mingw32msvc-gcc"
6791 # A language-specific compiler.
6792 CC="i386-mingw32msvc-g++"
6794 # Is the compiler the GNU C compiler?
6795 with_gcc=yes
6797 # An ERE matcher.
6798 EGREP="grep -E"
6800 # The linker used to build libraries.
6801 LD="/usr/misc/torrents/mingw/cross-tools/i386-mingw32msvc/bin/ld"
6803 # Whether we need hard or soft links.
6804 LN_S="ln -s"
6806 # A BSD-compatible nm program.
6807 NM="/usr/misc/torrents/mingw/cross-tools/bin/i386-mingw32msvc-nm -B"
6809 # A symbol stripping program
6810 STRIP="i386-mingw32msvc-strip"
6812 # Used to examine libraries when file_magic_cmd begins "file"
6813 MAGIC_CMD=file
6815 # Used on cygwin: DLL creation program.
6816 DLLTOOL="i386-mingw32msvc-dlltool"
6818 # Used on cygwin: object dumper.
6819 OBJDUMP="i386-mingw32msvc-objdump"
6821 # Used on cygwin: assembler.
6822 AS="i386-mingw32msvc-as"
6824 # The name of the directory that contains temporary libtool files.
6825 objdir=.libs
6827 # How to create reloadable object files.
6828 reload_flag=" -r"
6829 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6831 # How to pass a linker flag through the compiler.
6832 wl="-Wl,"
6834 # Object file suffix (normally "o").
6835 objext="o"
6837 # Old archive suffix (normally "a").
6838 libext="a"
6840 # Shared library suffix (normally ".so").
6841 shrext_cmds='.dll'
6843 # Executable file suffix (normally "").
6844 exeext=""
6846 # Additional compiler flags for building library objects.
6847 pic_flag=" -DDLL_EXPORT -DPIC"
6848 pic_mode=default
6850 # What is the maximum length of a command?
6851 max_cmd_len=32768
6853 # Does compiler simultaneously support -c and -o options?
6854 compiler_c_o="yes"
6856 # Must we lock files when doing compilation ?
6857 need_locks="no"
6859 # Do we need the lib prefix for modules?
6860 need_lib_prefix=no
6862 # Do we need a version for libraries?
6863 need_version=no
6865 # Whether dlopen is supported.
6866 dlopen_support=unknown
6868 # Whether dlopen of programs is supported.
6869 dlopen_self=unknown
6871 # Whether dlopen of statically linked programs is supported.
6872 dlopen_self_static=unknown
6874 # Compiler flag to prevent dynamic linking.
6875 link_static_flag="-static"
6877 # Compiler flag to turn off builtin functions.
6878 no_builtin_flag=" -fno-builtin"
6880 # Compiler flag to allow reflexive dlopens.
6881 export_dynamic_flag_spec="\${wl}--export-dynamic"
6883 # Compiler flag to generate shared objects directly from archives.
6884 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6886 # Compiler flag to generate thread-safe objects.
6887 thread_safe_flag_spec=""
6889 # Library versioning type.
6890 version_type=windows
6892 # Format of library name prefix.
6893 libname_spec="lib\$name"
6895 # List of archive names. First name is the real one, the rest are links.
6896 # The last name is the one that the linker finds with -lNAME.
6897 library_names_spec="\$libname.dll.a"
6899 # The coded name of the library, if different from the real name.
6900 soname_spec="\${libname}\`echo \${release} | \$SED -e s/[.]/-/g\`\${versuffix}\${shared_ext}"
6902 # Commands used to build and install an old-style archive.
6903 RANLIB="i386-mingw32msvc-ranlib"
6904 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6905 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6906 old_postuninstall_cmds=""
6908 # Create an old-style archive from a shared archive.
6909 old_archive_from_new_cmds=""
6911 # Create a temporary old-style archive to link instead of a shared archive.
6912 old_archive_from_expsyms_cmds=""
6914 # Commands used to build and install a shared archive.
6915 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--image-base=0x10000000 \${wl}--out-implib,\$lib"
6916 archive_expsym_cmds="if test \\\"x\\\`\$SED 1q \$export_symbols\\\`\\\" = xEXPORTS; then
6917 cp \$export_symbols \$output_objdir/\$soname.def;
6918 else
6919 echo EXPORTS > \$output_objdir/\$soname.def;
6920 cat \$export_symbols >> \$output_objdir/\$soname.def;
6922 \$CC -shared -nostdlib \$output_objdir/\$soname.def \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags -o \$output_objdir/\$soname \${wl}--image-base=0x10000000 \${wl}--out-implib,\$lib"
6923 postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
6924 dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i;echo \\\$dlname'\\\`~
6925 dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
6926 test -d \\\$dldir || mkdir -p \\\$dldir~
6927 \$install_prog \$dir/\$dlname \\\$dldir/\$dlname"
6928 postuninstall_cmds="dldll=\\\`\$SHELL 2>&1 -c '. \$file; echo \\\$dlname'\\\`~
6929 dlpath=\$dir/\\\$dldll~
6930 \$rm \\\$dlpath"
6932 # Commands used to build a loadable module (assumed same as above if empty)
6933 module_cmds=""
6934 module_expsym_cmds=""
6936 # Commands to strip libraries.
6937 old_striplib="i386-mingw32msvc-strip --strip-debug"
6938 striplib="i386-mingw32msvc-strip --strip-unneeded"
6940 # Dependencies to place before the objects being linked to create a
6941 # shared library.
6942 predep_objects="/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/dllcrt2.o /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/crtbegin.o"
6944 # Dependencies to place after the objects being linked to create a
6945 # shared library.
6946 postdep_objects="/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/crtend.o"
6948 # Dependencies to place before the objects being linked to create a
6949 # shared library.
6950 predeps=""
6952 # Dependencies to place after the objects being linked to create a
6953 # shared library.
6954 postdeps="-lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
6956 # The library search path used internally by the compiler when linking
6957 # a shared library.
6958 compiler_lib_search_path="-L/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3 -L/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib -L/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib -L/usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../.."
6960 # Method to check whether dependent libraries are shared objects.
6961 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
6963 # Command to use when deplibs_check_method == file_magic.
6964 file_magic_cmd="\$OBJDUMP -f"
6966 # Flag that allows shared libraries with undefined symbols to be built.
6967 allow_undefined_flag="unsupported"
6969 # Flag that forces no undefined symbols.
6970 no_undefined_flag=""
6972 # Commands used to finish a libtool library installation in a directory.
6973 finish_cmds=""
6975 # Same as above, but a single script fragment to be evaled but not shown.
6976 finish_eval=""
6978 # Take the output of nm and produce a listing of raw symbols and C names.
6979 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6981 # Transform the output of nm in a proper C declaration
6982 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6984 # Transform the output of nm in a C name address pair
6985 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6987 # This is the shared library runtime path variable.
6988 runpath_var=LD_RUN_PATH
6990 # This is the shared library path variable.
6991 shlibpath_var=PATH
6993 # Is shlibpath searched before the hard-coded library search path?
6994 shlibpath_overrides_runpath=yes
6996 # How to hardcode a shared library path into an executable.
6997 hardcode_action=immediate
6999 # Whether we should hardcode library paths into libraries.
7000 hardcode_into_libs=no
7002 # Flag to hardcode $libdir into a binary during linking.
7003 # This must work even if $libdir does not exist.
7004 hardcode_libdir_flag_spec="-L\$libdir"
7006 # If ld is used when linking, flag to hardcode $libdir into
7007 # a binary during linking. This must work even if $libdir does
7008 # not exist.
7009 hardcode_libdir_flag_spec_ld=""
7011 # Whether we need a single -rpath flag with a separated argument.
7012 hardcode_libdir_separator=""
7014 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7015 # resulting binary.
7016 hardcode_direct=no
7018 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7019 # resulting binary.
7020 hardcode_minus_L=no
7022 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7023 # the resulting binary.
7024 hardcode_shlibpath_var=
7026 # Set to yes if building a shared library automatically hardcodes DIR into the library
7027 # and all subsequent libraries and executables linked against it.
7028 hardcode_automatic=no
7030 # Variables whose values should be saved in libtool wrapper scripts and
7031 # restored at relink time.
7032 variables_saved_for_relink="PATH PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7034 # Whether libtool must link a program against all its dependency libraries.
7035 link_all_deplibs=unknown
7037 # Compile-time system search path for libraries
7038 sys_lib_search_path_spec=" /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/ /usr/lib/gcc/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/i386-mingw32msvc/3.2.3/ /usr/local/cross-tools/lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../../i386-mingw32msvc/lib/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../i386-mingw32msvc/3.2.3/ /usr/misc/torrents/mingw/cross-tools/bin/../lib/gcc-lib/i386-mingw32msvc/3.2.3/../../../"
7040 # Run-time system search path for libraries
7041 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7043 # Fix the shell variable $srcfile for the compiler.
7044 fix_srcfile_path=""
7046 # Set to yes if exported symbols are required.
7047 always_export_symbols=no
7049 # The commands to list exported symbols.
7050 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGS] /s/.* \\\\([^ ]*\\\\)/\\\\1 DATA/' | \$SED -e '/^[AITW] /s/.* //' | sort | uniq > \$export_symbols"
7052 # The commands to extract the exported symbol list from a shared archive.
7053 extract_expsyms_cmds=""
7055 # Symbols that should not be listed in the preloaded symbols.
7056 exclude_expsyms=""
7058 # Symbols that must always be exported.
7059 include_expsyms=""
7061 # ### END LIBTOOL TAG CONFIG: CXX