Changes to update Tomato RAF.
[tomato.git] / release / src / router / flac / libtool
blob7436d796df0ef3e5d26d9536f2fa8806713304d2
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU flac 1.2.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2 of the License, or
16 # (at your option) any later version.
18 # This program is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 # General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
32 # A sed program that does not truncate output.
33 SED="/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e 1s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
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 vicente-P5K-E:
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=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
65 fast_install=yes
67 # The host system.
68 host_alias=mipsel-linux
69 host=mipsel-unknown-linux-gnu
70 host_os=linux-gnu
72 # The build system.
73 build_alias=x86_64-linux-gnu
74 build=x86_64-pc-linux-gnu
75 build_os=linux-gnu
77 # An echo program that does not interpret backslashes.
78 echo="echo"
80 # The archiver.
81 AR="mipsel-uclibc-ar"
82 AR_FLAGS="cru"
84 # A C compiler.
85 LTCC="mipsel-uclibc-gcc"
87 # A language-specific compiler.
88 CC="mipsel-uclibc-gcc"
90 # Is the compiler the GNU C compiler?
91 with_gcc=yes
93 # An ERE matcher.
94 EGREP="grep -E"
96 # The linker used to build libraries.
97 LD="mipsel-uclibc-ld"
99 # Whether we need hard or soft links.
100 LN_S="ln -s"
102 # A BSD-compatible nm program.
103 NM="mipsel-uclibc-nm"
105 # A symbol stripping program
106 STRIP="mipsel-uclibc-strip -R .note -R .comment"
108 # Used to examine libraries when file_magic_cmd begins "file"
109 MAGIC_CMD=file
111 # Used on cygwin: DLL creation program.
112 DLLTOOL="dlltool"
114 # Used on cygwin: object dumper.
115 OBJDUMP="objdump"
117 # Used on cygwin: assembler.
118 AS="mipsel-uclibc-as"
120 # The name of the directory that contains temporary libtool files.
121 objdir=.libs
123 # How to create reloadable object files.
124 reload_flag=" -r"
125 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
127 # How to pass a linker flag through the compiler.
128 wl="-Wl,"
130 # Object file suffix (normally "o").
131 objext="o"
133 # Old archive suffix (normally "a").
134 libext="a"
136 # Shared library suffix (normally ".so").
137 shrext_cmds='.so'
139 # Executable file suffix (normally "").
140 exeext=""
142 # Additional compiler flags for building library objects.
143 pic_flag=" -fPIC -DPIC"
144 pic_mode=default
146 # What is the maximum length of a command?
147 max_cmd_len=32768
149 # Does compiler simultaneously support -c and -o options?
150 compiler_c_o="yes"
152 # Must we lock files when doing compilation?
153 need_locks="no"
155 # Do we need the lib prefix for modules?
156 need_lib_prefix=no
158 # Do we need a version for libraries?
159 need_version=no
161 # Whether dlopen is supported.
162 dlopen_support=unknown
164 # Whether dlopen of programs is supported.
165 dlopen_self=unknown
167 # Whether dlopen of statically linked programs is supported.
168 dlopen_self_static=unknown
170 # Compiler flag to prevent dynamic linking.
171 link_static_flag="-static"
173 # Compiler flag to turn off builtin functions.
174 no_builtin_flag=" -fno-builtin"
176 # Compiler flag to allow reflexive dlopens.
177 export_dynamic_flag_spec="\${wl}--export-dynamic"
179 # Compiler flag to generate shared objects directly from archives.
180 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
182 # Compiler flag to generate thread-safe objects.
183 thread_safe_flag_spec=""
185 # Library versioning type.
186 version_type=linux
188 # Format of library name prefix.
189 libname_spec="lib\$name"
191 # List of archive names. First name is the real one, the rest are links.
192 # The last name is the one that the linker finds with -lNAME.
193 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
195 # The coded name of the library, if different from the real name.
196 soname_spec="\${libname}\${release}\${shared_ext}\$major"
198 # Commands used to build and install an old-style archive.
199 RANLIB="mipsel-uclibc-ranlib"
200 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
201 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
202 old_postuninstall_cmds=""
204 # Create an old-style archive from a shared archive.
205 old_archive_from_new_cmds=""
207 # Create a temporary old-style archive to link instead of a shared archive.
208 old_archive_from_expsyms_cmds=""
210 # Commands used to build and install a shared archive.
211 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
212 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
213 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
214 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
215 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
216 postinstall_cmds=""
217 postuninstall_cmds=""
219 # Commands used to build a loadable module (assumed same as above if empty)
220 module_cmds=""
221 module_expsym_cmds=""
223 # Commands to strip libraries.
224 old_striplib="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
225 striplib="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
227 # Dependencies to place before the objects being linked to create a
228 # shared library.
229 predep_objects=""
231 # Dependencies to place after the objects being linked to create a
232 # shared library.
233 postdep_objects=""
235 # Dependencies to place before the objects being linked to create a
236 # shared library.
237 predeps=""
239 # Dependencies to place after the objects being linked to create a
240 # shared library.
241 postdeps=""
243 # The library search path used internally by the compiler when linking
244 # a shared library.
245 compiler_lib_search_path=""
247 # Method to check whether dependent libraries are shared objects.
248 deplibs_check_method="pass_all"
250 # Command to use when deplibs_check_method == file_magic.
251 file_magic_cmd="\$MAGIC_CMD"
253 # Flag that allows shared libraries with undefined symbols to be built.
254 allow_undefined_flag=""
256 # Flag that forces no undefined symbols.
257 no_undefined_flag=""
259 # Commands used to finish a libtool library installation in a directory.
260 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
262 # Same as above, but a single script fragment to be evaled but not shown.
263 finish_eval=""
265 # Take the output of nm and produce a listing of raw symbols and C names.
266 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
268 # Transform the output of nm in a proper C declaration
269 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
271 # Transform the output of nm in a C name address pair
272 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
274 # This is the shared library runtime path variable.
275 runpath_var=LD_RUN_PATH
277 # This is the shared library path variable.
278 shlibpath_var=LD_LIBRARY_PATH
280 # Is shlibpath searched before the hard-coded library search path?
281 shlibpath_overrides_runpath=no
283 # How to hardcode a shared library path into an executable.
284 hardcode_action=immediate
286 # Whether we should hardcode library paths into libraries.
287 hardcode_into_libs=yes
289 # Flag to hardcode $libdir into a binary during linking.
290 # This must work even if $libdir does not exist.
291 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
293 # If ld is used when linking, flag to hardcode $libdir into
294 # a binary during linking. This must work even if $libdir does
295 # not exist.
296 hardcode_libdir_flag_spec_ld=""
298 # Whether we need a single -rpath flag with a separated argument.
299 hardcode_libdir_separator=""
301 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
302 # resulting binary.
303 hardcode_direct=no
305 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
306 # resulting binary.
307 hardcode_minus_L=no
309 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
310 # the resulting binary.
311 hardcode_shlibpath_var=unsupported
313 # Set to yes if building a shared library automatically hardcodes DIR into the library
314 # and all subsequent libraries and executables linked against it.
315 hardcode_automatic=no
317 # Variables whose values should be saved in libtool wrapper scripts and
318 # restored at relink time.
319 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
321 # Whether libtool must link a program against all its dependency libraries.
322 link_all_deplibs=unknown
324 # Compile-time system search path for libraries
325 sys_lib_search_path_spec=" /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4/ /usr/lib/gcc/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib/mipsel-linux-uclibc/4.2.4/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib/"
327 # Run-time system search path for libraries
328 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/lib/nvidia-settings /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/nvidia-current /usr/lib32/nvidia-current /lib32 /usr/lib32 "
330 # Fix the shell variable $srcfile for the compiler.
331 fix_srcfile_path=""
333 # Set to yes if exported symbols are required.
334 always_export_symbols=no
336 # The commands to list exported symbols.
337 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
339 # The commands to extract the exported symbol list from a shared archive.
340 extract_expsyms_cmds=""
342 # Symbols that should not be listed in the preloaded symbols.
343 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
345 # Symbols that must always be exported.
346 include_expsyms=""
348 # ### END LIBTOOL CONFIG
350 # ltmain.sh - Provide generalized library-building support services.
351 # NOTE: Changing this file will not affect anything until you rerun configure.
353 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
354 # Free Software Foundation, Inc.
355 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
357 # This program is free software; you can redistribute it and/or modify
358 # it under the terms of the GNU General Public License as published by
359 # the Free Software Foundation; either version 2 of the License, or
360 # (at your option) any later version.
362 # This program is distributed in the hope that it will be useful, but
363 # WITHOUT ANY WARRANTY; without even the implied warranty of
364 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
365 # General Public License for more details.
367 # You should have received a copy of the GNU General Public License
368 # along with this program; if not, write to the Free Software
369 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
371 # As a special exception to the GNU General Public License, if you
372 # distribute this file as part of a program that contains a
373 # configuration script generated by Autoconf, you may include it under
374 # the same distribution terms that you use for the rest of that program.
376 basename="s,^.*/,,g"
378 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
379 # is ksh but when the shell is invoked as "sh" and the current value of
380 # the _XPG environment variable is not equal to 1 (one), the special
381 # positional parameter $0, within a function call, is the name of the
382 # function.
383 progpath="$0"
385 # The name of this program:
386 progname=`echo "$progpath" | $SED $basename`
387 modename="$progname"
389 # Global variables:
390 EXIT_SUCCESS=0
391 EXIT_FAILURE=1
393 PROGRAM=ltmain.sh
394 PACKAGE=libtool
395 VERSION=1.5.16
396 TIMESTAMP=" (1.1220.2.235 2005/04/25 18:13:26)"
398 # See if we are running on zsh, and set the options which allow our
399 # commands through without removal of \ escapes.
400 if test -n "${ZSH_VERSION+set}" ; then
401 setopt NO_GLOB_SUBST
404 # Check that we have a working $echo.
405 if test "X$1" = X--no-reexec; then
406 # Discard the --no-reexec flag, and continue.
407 shift
408 elif test "X$1" = X--fallback-echo; then
409 # Avoid inline document here, it may be left over
411 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
412 # Yippee, $echo works!
414 else
415 # Restart under the correct shell, and then maybe $echo will work.
416 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
419 if test "X$1" = X--fallback-echo; then
420 # used as fallback echo
421 shift
422 cat <<EOF
425 exit $EXIT_SUCCESS
428 default_mode=
429 help="Try \`$progname --help' for more information."
430 magic="%%%MAGIC variable%%%"
431 mkdir="mkdir"
432 mv="mv -f"
433 rm="rm -f"
435 # Sed substitution that helps us do robust quoting. It backslashifies
436 # metacharacters that are still active within double-quoted strings.
437 Xsed="${SED}"' -e 1s/^X//'
438 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
439 # test EBCDIC or ASCII
440 case `echo A|tr A '\301'` in
441 A) # EBCDIC based system
442 SP2NL="tr '\100' '\n'"
443 NL2SP="tr '\r\n' '\100\100'"
445 *) # Assume ASCII based system
446 SP2NL="tr '\040' '\012'"
447 NL2SP="tr '\015\012' '\040\040'"
449 esac
451 # NLS nuisances.
452 # Only set LANG and LC_ALL to C if already set.
453 # These must not be set unconditionally because not all systems understand
454 # e.g. LANG=C (notably SCO).
455 # We save the old values to restore during execute mode.
456 if test "${LC_ALL+set}" = set; then
457 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
459 if test "${LANG+set}" = set; then
460 save_LANG="$LANG"; LANG=C; export LANG
463 # Make sure IFS has a sensible default
464 lt_nl='
466 IFS=" $lt_nl"
468 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
469 $echo "$modename: not configured to build any kind of library" 1>&2
470 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
471 exit $EXIT_FAILURE
474 # Global variables.
475 mode=$default_mode
476 nonopt=
477 prev=
478 prevopt=
479 run=
480 show="$echo"
481 show_help=
482 execute_dlfiles=
483 lo2o="s/\\.lo\$/.${objext}/"
484 o2lo="s/\\.${objext}\$/.lo/"
485 quote_scanset='[[~#^*{};<>?'"'"' ]'
487 #####################################
488 # Shell function definitions:
489 # This seems to be the best place for them
491 # func_win32_libid arg
492 # return the library type of file 'arg'
494 # Need a lot of goo to handle *both* DLLs and import libs
495 # Has to be a shell function in order to 'eat' the argument
496 # that is supplied when $file_magic_command is called.
497 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 ()
540 if test -n "$available_tags" && test -z "$tagname"; then
541 CC_quoted=
542 for arg in $CC; do
543 case $arg in
544 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
545 arg="\"$arg\""
547 esac
548 CC_quoted="$CC_quoted $arg"
549 done
550 case $@ in
551 # Blanks in the command may have been stripped by the calling shell,
552 # but not from the CC environment variable when configure was run.
553 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
554 # Blanks at the start of $base_compile will cause this to fail
555 # if we don't check for them as well.
557 for z in $available_tags; do
558 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
559 # Evaluate the configuration.
560 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
561 CC_quoted=
562 for arg in $CC; do
563 # Double-quote args containing other shell metacharacters.
564 case $arg in
565 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
566 arg="\"$arg\""
568 esac
569 CC_quoted="$CC_quoted $arg"
570 done
571 case "$@ " in
572 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
573 # The compiler in the base compile command matches
574 # the one in the tagged configuration.
575 # Assume this is the tagged configuration we want.
576 tagname=$z
577 break
579 esac
581 done
582 # If $tagname still isn't set, then no tagged configuration
583 # was found and let the user know that the "--tag" command
584 # line option must be used.
585 if test -z "$tagname"; then
586 $echo "$modename: unable to infer tagged configuration"
587 $echo "$modename: specify a tag with \`--tag'" 1>&2
588 exit $EXIT_FAILURE
589 # else
590 # $echo "$modename: using $tagname tagged configuration"
593 esac
598 # func_extract_an_archive dir oldlib
599 func_extract_an_archive ()
601 f_ex_an_ar_dir="$1"; shift
602 f_ex_an_ar_oldlib="$1"
604 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
605 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
606 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
608 else
609 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
610 exit $EXIT_FAILURE
614 # func_extract_archives gentop oldlib ...
615 func_extract_archives ()
617 my_gentop="$1"; shift
618 my_oldlibs=${1+"$@"}
619 my_oldobjs=""
620 my_xlib=""
621 my_xabs=""
622 my_xdir=""
623 my_status=""
625 $show "${rm}r $my_gentop"
626 $run ${rm}r "$my_gentop"
627 $show "$mkdir $my_gentop"
628 $run $mkdir "$my_gentop"
629 my_status=$?
630 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
631 exit $my_status
634 for my_xlib in $my_oldlibs; do
635 # Extract the objects.
636 case $my_xlib in
637 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
638 *) my_xabs=`pwd`"/$my_xlib" ;;
639 esac
640 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
641 my_xdir="$my_gentop/$my_xlib"
643 $show "${rm}r $my_xdir"
644 $run ${rm}r "$my_xdir"
645 $show "$mkdir $my_xdir"
646 $run $mkdir "$my_xdir"
647 status=$?
648 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
649 exit $status
651 case $host in
652 *-darwin*)
653 $show "Extracting $my_xabs"
654 # Do not bother doing anything if just a dry run
655 if test -z "$run"; then
656 darwin_orig_dir=`pwd`
657 cd $my_xdir || exit $?
658 darwin_archive=$my_xabs
659 darwin_curdir=`pwd`
660 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
661 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
662 if test -n "$darwin_arches"; then
663 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
664 darwin_arch=
665 $show "$darwin_base_archive has multiple architectures $darwin_arches"
666 for darwin_arch in $darwin_arches ; do
667 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
668 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
669 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
670 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
671 cd "$darwin_curdir"
672 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
673 done # $darwin_arches
674 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
675 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
676 darwin_file=
677 darwin_files=
678 for darwin_file in $darwin_filelist; do
679 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
680 lipo -create -output "$darwin_file" $darwin_files
681 done # $darwin_filelist
682 ${rm}r unfat-$$
683 cd "$darwin_orig_dir"
684 else
685 cd "$darwin_orig_dir"
686 func_extract_an_archive "$my_xdir" "$my_xabs"
687 fi # $darwin_arches
688 fi # $run
691 func_extract_an_archive "$my_xdir" "$my_xabs"
693 esac
694 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
695 done
696 func_extract_archives_result="$my_oldobjs"
698 # End of Shell function definitions
699 #####################################
701 # Darwin sucks
702 eval std_shrext=\"$shrext_cmds\"
704 # Parse our command line options once, thoroughly.
705 while test "$#" -gt 0
707 arg="$1"
708 shift
710 case $arg in
711 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
712 *) optarg= ;;
713 esac
715 # If the previous option needs an argument, assign it.
716 if test -n "$prev"; then
717 case $prev in
718 execute_dlfiles)
719 execute_dlfiles="$execute_dlfiles $arg"
721 tag)
722 tagname="$arg"
723 preserve_args="${preserve_args}=$arg"
725 # Check whether tagname contains only valid characters
726 case $tagname in
727 *[!-_A-Za-z0-9,/]*)
728 $echo "$progname: invalid tag name: $tagname" 1>&2
729 exit $EXIT_FAILURE
731 esac
733 case $tagname in
735 # Don't test for the "default" C tag, as we know, it's there, but
736 # not specially marked.
739 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
740 taglist="$taglist $tagname"
741 # Evaluate the configuration.
742 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
743 else
744 $echo "$progname: ignoring unknown tag $tagname" 1>&2
747 esac
750 eval "$prev=\$arg"
752 esac
754 prev=
755 prevopt=
756 continue
759 # Have we seen a non-optional argument yet?
760 case $arg in
761 --help)
762 show_help=yes
765 --version)
766 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
767 $echo
768 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
769 $echo "This is free software; see the source for copying conditions. There is NO"
770 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
771 exit $?
774 --config)
775 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
776 # Now print the configurations for the tags.
777 for tagname in $taglist; do
778 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
779 done
780 exit $?
783 --debug)
784 $echo "$progname: enabling shell trace mode"
785 set -x
786 preserve_args="$preserve_args $arg"
789 --dry-run | -n)
790 run=:
793 --features)
794 $echo "host: $host"
795 if test "$build_libtool_libs" = yes; then
796 $echo "enable shared libraries"
797 else
798 $echo "disable shared libraries"
800 if test "$build_old_libs" = yes; then
801 $echo "enable static libraries"
802 else
803 $echo "disable static libraries"
805 exit $?
808 --finish) mode="finish" ;;
810 --mode) prevopt="--mode" prev=mode ;;
811 --mode=*) mode="$optarg" ;;
813 --preserve-dup-deps) duplicate_deps="yes" ;;
815 --quiet | --silent)
816 show=:
817 preserve_args="$preserve_args $arg"
820 --tag) prevopt="--tag" prev=tag ;;
821 --tag=*)
822 set tag "$optarg" ${1+"$@"}
823 shift
824 prev=tag
825 preserve_args="$preserve_args --tag"
828 -dlopen)
829 prevopt="-dlopen"
830 prev=execute_dlfiles
834 $echo "$modename: unrecognized option \`$arg'" 1>&2
835 $echo "$help" 1>&2
836 exit $EXIT_FAILURE
840 nonopt="$arg"
841 break
843 esac
844 done
846 if test -n "$prevopt"; then
847 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
848 $echo "$help" 1>&2
849 exit $EXIT_FAILURE
852 # If this variable is set in any of the actions, the command in it
853 # will be execed at the end. This prevents here-documents from being
854 # left over by shells.
855 exec_cmd=
857 if test -z "$show_help"; then
859 # Infer the operation mode.
860 if test -z "$mode"; then
861 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
862 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
863 case $nonopt in
864 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
865 mode=link
866 for arg
868 case $arg in
870 mode=compile
871 break
873 esac
874 done
876 *db | *dbx | *strace | *truss)
877 mode=execute
879 *install*|cp|mv)
880 mode=install
882 *rm)
883 mode=uninstall
886 # If we have no mode, but dlfiles were specified, then do execute mode.
887 test -n "$execute_dlfiles" && mode=execute
889 # Just use the default operation mode.
890 if test -z "$mode"; then
891 if test -n "$nonopt"; then
892 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
893 else
894 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
898 esac
901 # Only execute mode is allowed to have -dlopen flags.
902 if test -n "$execute_dlfiles" && test "$mode" != execute; then
903 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
904 $echo "$help" 1>&2
905 exit $EXIT_FAILURE
908 # Change the help message to a mode-specific one.
909 generic_help="$help"
910 help="Try \`$modename --help --mode=$mode' for more information."
912 # These modes are in order of execution frequency so that they run quickly.
913 case $mode in
914 # libtool compile mode
915 compile)
916 modename="$modename: compile"
917 # Get the compilation command and the source file.
918 base_compile=
919 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
920 suppress_opt=yes
921 suppress_output=
922 arg_mode=normal
923 libobj=
924 later=
926 for arg
928 case "$arg_mode" in
929 arg )
930 # do not "continue". Instead, add this to base_compile
931 lastarg="$arg"
932 arg_mode=normal
935 target )
936 libobj="$arg"
937 arg_mode=normal
938 continue
941 normal )
942 # Accept any command-line options.
943 case $arg in
945 if test -n "$libobj" ; then
946 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
947 exit $EXIT_FAILURE
949 arg_mode=target
950 continue
953 -static | -prefer-pic | -prefer-non-pic)
954 later="$later $arg"
955 continue
958 -no-suppress)
959 suppress_opt=no
960 continue
963 -Xcompiler)
964 arg_mode=arg # the next one goes into the "base_compile" arg list
965 continue # The current "srcfile" will either be retained or
966 ;; # replaced later. I would guess that would be a bug.
968 -Wc,*)
969 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
970 lastarg=
971 save_ifs="$IFS"; IFS=','
972 for arg in $args; do
973 IFS="$save_ifs"
975 # Double-quote args containing other shell metacharacters.
976 # Many Bourne shells cannot handle close brackets correctly
977 # in scan sets, so we specify it separately.
978 case $arg in
979 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
980 arg="\"$arg\""
982 esac
983 lastarg="$lastarg $arg"
984 done
985 IFS="$save_ifs"
986 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
988 # Add the arguments to base_compile.
989 base_compile="$base_compile $lastarg"
990 continue
994 # Accept the current argument as the source file.
995 # The previous "srcfile" becomes the current argument.
997 lastarg="$srcfile"
998 srcfile="$arg"
1000 esac # case $arg
1002 esac # case $arg_mode
1004 # Aesthetically quote the previous argument.
1005 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1007 case $lastarg in
1008 # Double-quote args containing other shell metacharacters.
1009 # Many Bourne shells cannot handle close brackets correctly
1010 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1011 # in scan sets (worked around with variable expansion),
1012 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1013 # at all, so we specify them separately.
1014 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1015 lastarg="\"$lastarg\""
1017 esac
1019 base_compile="$base_compile $lastarg"
1020 done # for arg
1022 case $arg_mode in
1023 arg)
1024 $echo "$modename: you must specify an argument for -Xcompile"
1025 exit $EXIT_FAILURE
1027 target)
1028 $echo "$modename: you must specify a target with \`-o'" 1>&2
1029 exit $EXIT_FAILURE
1032 # Get the name of the library object.
1033 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1035 esac
1037 # Recognize several different file suffixes.
1038 # If the user specifies -o file.o, it is replaced with file.lo
1039 xform='[cCFSifmso]'
1040 case $libobj in
1041 *.ada) xform=ada ;;
1042 *.adb) xform=adb ;;
1043 *.ads) xform=ads ;;
1044 *.asm) xform=asm ;;
1045 *.c++) xform=c++ ;;
1046 *.cc) xform=cc ;;
1047 *.ii) xform=ii ;;
1048 *.class) xform=class ;;
1049 *.cpp) xform=cpp ;;
1050 *.cxx) xform=cxx ;;
1051 *.f90) xform=f90 ;;
1052 *.for) xform=for ;;
1053 *.java) xform=java ;;
1054 esac
1056 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1058 case $libobj in
1059 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1061 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1062 exit $EXIT_FAILURE
1064 esac
1066 func_infer_tag $base_compile
1068 for arg in $later; do
1069 case $arg in
1070 -static)
1071 build_old_libs=yes
1072 continue
1075 -prefer-pic)
1076 pic_mode=yes
1077 continue
1080 -prefer-non-pic)
1081 pic_mode=no
1082 continue
1084 esac
1085 done
1087 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1088 case $qlibobj in
1089 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1090 qlibobj="\"$qlibobj\"" ;;
1091 esac
1092 if test "X$libobj" != "X$qlibobj"; then
1093 $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1094 exit $EXIT_FAILURE
1096 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1097 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1098 if test "X$xdir" = "X$obj"; then
1099 xdir=
1100 else
1101 xdir=$xdir/
1103 lobj=${xdir}$objdir/$objname
1105 if test -z "$base_compile"; then
1106 $echo "$modename: you must specify a compilation command" 1>&2
1107 $echo "$help" 1>&2
1108 exit $EXIT_FAILURE
1111 # Delete any leftover library objects.
1112 if test "$build_old_libs" = yes; then
1113 removelist="$obj $lobj $libobj ${libobj}T"
1114 else
1115 removelist="$lobj $libobj ${libobj}T"
1118 $run $rm $removelist
1119 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1121 # On Cygwin there's no "real" PIC flag so we must build both object types
1122 case $host_os in
1123 cygwin* | mingw* | pw32* | os2*)
1124 pic_mode=default
1126 esac
1127 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1128 # non-PIC code in shared libraries is not supported
1129 pic_mode=default
1132 # Calculate the filename of the output object if compiler does
1133 # not support -o with -c
1134 if test "$compiler_c_o" = no; then
1135 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1136 lockfile="$output_obj.lock"
1137 removelist="$removelist $output_obj $lockfile"
1138 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1139 else
1140 output_obj=
1141 need_locks=no
1142 lockfile=
1145 # Lock this critical section if it is needed
1146 # We use this script file to make the link, it avoids creating a new file
1147 if test "$need_locks" = yes; then
1148 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1149 $show "Waiting for $lockfile to be removed"
1150 sleep 2
1151 done
1152 elif test "$need_locks" = warn; then
1153 if test -f "$lockfile"; then
1154 $echo "\
1155 *** ERROR, $lockfile exists and contains:
1156 `cat $lockfile 2>/dev/null`
1158 This indicates that another process is trying to use the same
1159 temporary object file, and libtool could not work around it because
1160 your compiler does not support \`-c' and \`-o' together. If you
1161 repeat this compilation, it may succeed, by chance, but you had better
1162 avoid parallel builds (make -j) in this platform, or get a better
1163 compiler."
1165 $run $rm $removelist
1166 exit $EXIT_FAILURE
1168 $echo "$srcfile" > "$lockfile"
1171 if test -n "$fix_srcfile_path"; then
1172 eval srcfile=\"$fix_srcfile_path\"
1174 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1175 case $qsrcfile in
1176 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1177 qsrcfile="\"$qsrcfile\"" ;;
1178 esac
1180 $run $rm "$libobj" "${libobj}T"
1182 # Create a libtool object file (analogous to a ".la" file),
1183 # but don't create it if we're doing a dry run.
1184 test -z "$run" && cat > ${libobj}T <<EOF
1185 # $libobj - a libtool object file
1186 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1188 # Please DO NOT delete this file!
1189 # It is necessary for linking the library.
1191 # Name of the PIC object.
1194 # Only build a PIC object if we are building libtool libraries.
1195 if test "$build_libtool_libs" = yes; then
1196 # Without this assignment, base_compile gets emptied.
1197 fbsd_hideous_sh_bug=$base_compile
1199 if test "$pic_mode" != no; then
1200 command="$base_compile $qsrcfile $pic_flag"
1201 else
1202 # Don't build PIC code
1203 command="$base_compile $qsrcfile"
1206 if test ! -d "${xdir}$objdir"; then
1207 $show "$mkdir ${xdir}$objdir"
1208 $run $mkdir ${xdir}$objdir
1209 status=$?
1210 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1211 exit $status
1215 if test -z "$output_obj"; then
1216 # Place PIC objects in $objdir
1217 command="$command -o $lobj"
1220 $run $rm "$lobj" "$output_obj"
1222 $show "$command"
1223 if $run eval "$command"; then :
1224 else
1225 test -n "$output_obj" && $run $rm $removelist
1226 exit $EXIT_FAILURE
1229 if test "$need_locks" = warn &&
1230 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1231 $echo "\
1232 *** ERROR, $lockfile contains:
1233 `cat $lockfile 2>/dev/null`
1235 but it should contain:
1236 $srcfile
1238 This indicates that another process is trying to use the same
1239 temporary object file, and libtool could not work around it because
1240 your compiler does not support \`-c' and \`-o' together. If you
1241 repeat this compilation, it may succeed, by chance, but you had better
1242 avoid parallel builds (make -j) in this platform, or get a better
1243 compiler."
1245 $run $rm $removelist
1246 exit $EXIT_FAILURE
1249 # Just move the object if needed, then go on to compile the next one
1250 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1251 $show "$mv $output_obj $lobj"
1252 if $run $mv $output_obj $lobj; then :
1253 else
1254 error=$?
1255 $run $rm $removelist
1256 exit $error
1260 # Append the name of the PIC object to the libtool object file.
1261 test -z "$run" && cat >> ${libobj}T <<EOF
1262 pic_object='$objdir/$objname'
1266 # Allow error messages only from the first compilation.
1267 if test "$suppress_opt" = yes; then
1268 suppress_output=' >/dev/null 2>&1'
1270 else
1271 # No PIC object so indicate it doesn't exist in the libtool
1272 # object file.
1273 test -z "$run" && cat >> ${libobj}T <<EOF
1274 pic_object=none
1279 # Only build a position-dependent object if we build old libraries.
1280 if test "$build_old_libs" = yes; then
1281 if test "$pic_mode" != yes; then
1282 # Don't build PIC code
1283 command="$base_compile $qsrcfile"
1284 else
1285 command="$base_compile $qsrcfile $pic_flag"
1287 if test "$compiler_c_o" = yes; then
1288 command="$command -o $obj"
1291 # Suppress compiler output if we already did a PIC compilation.
1292 command="$command$suppress_output"
1293 $run $rm "$obj" "$output_obj"
1294 $show "$command"
1295 if $run eval "$command"; then :
1296 else
1297 $run $rm $removelist
1298 exit $EXIT_FAILURE
1301 if test "$need_locks" = warn &&
1302 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1303 $echo "\
1304 *** ERROR, $lockfile contains:
1305 `cat $lockfile 2>/dev/null`
1307 but it should contain:
1308 $srcfile
1310 This indicates that another process is trying to use the same
1311 temporary object file, and libtool could not work around it because
1312 your compiler does not support \`-c' and \`-o' together. If you
1313 repeat this compilation, it may succeed, by chance, but you had better
1314 avoid parallel builds (make -j) in this platform, or get a better
1315 compiler."
1317 $run $rm $removelist
1318 exit $EXIT_FAILURE
1321 # Just move the object if needed
1322 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1323 $show "$mv $output_obj $obj"
1324 if $run $mv $output_obj $obj; then :
1325 else
1326 error=$?
1327 $run $rm $removelist
1328 exit $error
1332 # Append the name of the non-PIC object the libtool object file.
1333 # Only append if the libtool object file exists.
1334 test -z "$run" && cat >> ${libobj}T <<EOF
1335 # Name of the non-PIC object.
1336 non_pic_object='$objname'
1339 else
1340 # Append the name of the non-PIC object the libtool object file.
1341 # Only append if the libtool object file exists.
1342 test -z "$run" && cat >> ${libobj}T <<EOF
1343 # Name of the non-PIC object.
1344 non_pic_object=none
1349 $run $mv "${libobj}T" "${libobj}"
1351 # Unlock the critical section if it was locked
1352 if test "$need_locks" != no; then
1353 $run $rm "$lockfile"
1356 exit $EXIT_SUCCESS
1359 # libtool link mode
1360 link | relink)
1361 modename="$modename: link"
1362 case $host in
1363 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1364 # It is impossible to link a dll without this setting, and
1365 # we shouldn't force the makefile maintainer to figure out
1366 # which system we are compiling for in order to pass an extra
1367 # flag for every libtool invocation.
1368 # allow_undefined=no
1370 # FIXME: Unfortunately, there are problems with the above when trying
1371 # to make a dll which has undefined symbols, in which case not
1372 # even a static library is built. For now, we need to specify
1373 # -no-undefined on the libtool link line when we can be certain
1374 # that all symbols are satisfied, otherwise we get a static library.
1375 allow_undefined=yes
1378 allow_undefined=yes
1380 esac
1381 libtool_args="$nonopt"
1382 base_compile="$nonopt $@"
1383 compile_command="$nonopt"
1384 finalize_command="$nonopt"
1386 compile_rpath=
1387 finalize_rpath=
1388 compile_shlibpath=
1389 finalize_shlibpath=
1390 convenience=
1391 old_convenience=
1392 deplibs=
1393 old_deplibs=
1394 compiler_flags=
1395 linker_flags=
1396 dllsearchpath=
1397 lib_search_path=`pwd`
1398 inst_prefix_dir=
1400 avoid_version=no
1401 dlfiles=
1402 dlprefiles=
1403 dlself=no
1404 export_dynamic=no
1405 export_symbols=
1406 export_symbols_regex=
1407 generated=
1408 libobjs=
1409 ltlibs=
1410 module=no
1411 no_install=no
1412 objs=
1413 non_pic_objects=
1414 precious_files_regex=
1415 prefer_static_libs=no
1416 preload=no
1417 prev=
1418 prevarg=
1419 release=
1420 rpath=
1421 xrpath=
1422 perm_rpath=
1423 temp_rpath=
1424 thread_safe=no
1425 vinfo=
1426 vinfo_number=no
1428 func_infer_tag $base_compile
1430 # We need to know -static, to get the right output filenames.
1431 for arg
1433 case $arg in
1434 -all-static | -static)
1435 if test "X$arg" = "X-all-static"; then
1436 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1437 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1439 if test -n "$link_static_flag"; then
1440 dlopen_self=$dlopen_self_static
1442 else
1443 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1444 dlopen_self=$dlopen_self_static
1447 build_libtool_libs=no
1448 build_old_libs=yes
1449 prefer_static_libs=yes
1450 break
1452 esac
1453 done
1455 # See if our shared archives depend on static archives.
1456 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1458 # Go through the arguments, transforming them on the way.
1459 while test "$#" -gt 0; do
1460 arg="$1"
1461 shift
1462 case $arg in
1463 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1464 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1466 *) qarg=$arg ;;
1467 esac
1468 libtool_args="$libtool_args $qarg"
1470 # If the previous option needs an argument, assign it.
1471 if test -n "$prev"; then
1472 case $prev in
1473 output)
1474 compile_command="$compile_command @OUTPUT@"
1475 finalize_command="$finalize_command @OUTPUT@"
1477 esac
1479 case $prev in
1480 dlfiles|dlprefiles)
1481 if test "$preload" = no; then
1482 # Add the symbol object into the linking commands.
1483 compile_command="$compile_command @SYMFILE@"
1484 finalize_command="$finalize_command @SYMFILE@"
1485 preload=yes
1487 case $arg in
1488 *.la | *.lo) ;; # We handle these cases below.
1489 force)
1490 if test "$dlself" = no; then
1491 dlself=needless
1492 export_dynamic=yes
1494 prev=
1495 continue
1497 self)
1498 if test "$prev" = dlprefiles; then
1499 dlself=yes
1500 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1501 dlself=yes
1502 else
1503 dlself=needless
1504 export_dynamic=yes
1506 prev=
1507 continue
1510 if test "$prev" = dlfiles; then
1511 dlfiles="$dlfiles $arg"
1512 else
1513 dlprefiles="$dlprefiles $arg"
1515 prev=
1516 continue
1518 esac
1520 expsyms)
1521 export_symbols="$arg"
1522 if test ! -f "$arg"; then
1523 $echo "$modename: symbol file \`$arg' does not exist"
1524 exit $EXIT_FAILURE
1526 prev=
1527 continue
1529 expsyms_regex)
1530 export_symbols_regex="$arg"
1531 prev=
1532 continue
1534 inst_prefix)
1535 inst_prefix_dir="$arg"
1536 prev=
1537 continue
1539 precious_regex)
1540 precious_files_regex="$arg"
1541 prev=
1542 continue
1544 release)
1545 release="-$arg"
1546 prev=
1547 continue
1549 objectlist)
1550 if test -f "$arg"; then
1551 save_arg=$arg
1552 moreargs=
1553 for fil in `cat $save_arg`
1555 # moreargs="$moreargs $fil"
1556 arg=$fil
1557 # A libtool-controlled object.
1559 # Check to see that this really is a libtool object.
1560 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1561 pic_object=
1562 non_pic_object=
1564 # Read the .lo file
1565 # If there is no directory component, then add one.
1566 case $arg in
1567 */* | *\\*) . $arg ;;
1568 *) . ./$arg ;;
1569 esac
1571 if test -z "$pic_object" || \
1572 test -z "$non_pic_object" ||
1573 test "$pic_object" = none && \
1574 test "$non_pic_object" = none; then
1575 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1576 exit $EXIT_FAILURE
1579 # Extract subdirectory from the argument.
1580 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1581 if test "X$xdir" = "X$arg"; then
1582 xdir=
1583 else
1584 xdir="$xdir/"
1587 if test "$pic_object" != none; then
1588 # Prepend the subdirectory the object is found in.
1589 pic_object="$xdir$pic_object"
1591 if test "$prev" = dlfiles; then
1592 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1593 dlfiles="$dlfiles $pic_object"
1594 prev=
1595 continue
1596 else
1597 # If libtool objects are unsupported, then we need to preload.
1598 prev=dlprefiles
1602 # CHECK ME: I think I busted this. -Ossama
1603 if test "$prev" = dlprefiles; then
1604 # Preload the old-style object.
1605 dlprefiles="$dlprefiles $pic_object"
1606 prev=
1609 # A PIC object.
1610 libobjs="$libobjs $pic_object"
1611 arg="$pic_object"
1614 # Non-PIC object.
1615 if test "$non_pic_object" != none; then
1616 # Prepend the subdirectory the object is found in.
1617 non_pic_object="$xdir$non_pic_object"
1619 # A standard non-PIC object
1620 non_pic_objects="$non_pic_objects $non_pic_object"
1621 if test -z "$pic_object" || test "$pic_object" = none ; then
1622 arg="$non_pic_object"
1625 else
1626 # Only an error if not doing a dry-run.
1627 if test -z "$run"; then
1628 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1629 exit $EXIT_FAILURE
1630 else
1631 # Dry-run case.
1633 # Extract subdirectory from the argument.
1634 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1635 if test "X$xdir" = "X$arg"; then
1636 xdir=
1637 else
1638 xdir="$xdir/"
1641 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1642 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1643 libobjs="$libobjs $pic_object"
1644 non_pic_objects="$non_pic_objects $non_pic_object"
1647 done
1648 else
1649 $echo "$modename: link input file \`$save_arg' does not exist"
1650 exit $EXIT_FAILURE
1652 arg=$save_arg
1653 prev=
1654 continue
1656 rpath | xrpath)
1657 # We need an absolute path.
1658 case $arg in
1659 [\\/]* | [A-Za-z]:[\\/]*) ;;
1661 $echo "$modename: only absolute run-paths are allowed" 1>&2
1662 exit $EXIT_FAILURE
1664 esac
1665 if test "$prev" = rpath; then
1666 case "$rpath " in
1667 *" $arg "*) ;;
1668 *) rpath="$rpath $arg" ;;
1669 esac
1670 else
1671 case "$xrpath " in
1672 *" $arg "*) ;;
1673 *) xrpath="$xrpath $arg" ;;
1674 esac
1676 prev=
1677 continue
1679 xcompiler)
1680 compiler_flags="$compiler_flags $qarg"
1681 prev=
1682 compile_command="$compile_command $qarg"
1683 finalize_command="$finalize_command $qarg"
1684 continue
1686 xlinker)
1687 linker_flags="$linker_flags $qarg"
1688 compiler_flags="$compiler_flags $wl$qarg"
1689 prev=
1690 compile_command="$compile_command $wl$qarg"
1691 finalize_command="$finalize_command $wl$qarg"
1692 continue
1694 xcclinker)
1695 linker_flags="$linker_flags $qarg"
1696 compiler_flags="$compiler_flags $qarg"
1697 prev=
1698 compile_command="$compile_command $qarg"
1699 finalize_command="$finalize_command $qarg"
1700 continue
1702 shrext)
1703 shrext_cmds="$arg"
1704 prev=
1705 continue
1707 darwin_framework)
1708 compiler_flags="$compiler_flags $arg"
1709 prev=
1710 continue
1713 eval "$prev=\"\$arg\""
1714 prev=
1715 continue
1717 esac
1718 fi # test -n "$prev"
1720 prevarg="$arg"
1722 case $arg in
1723 -all-static)
1724 if test -n "$link_static_flag"; then
1725 compile_command="$compile_command $link_static_flag"
1726 finalize_command="$finalize_command $link_static_flag"
1728 continue
1731 -allow-undefined)
1732 # FIXME: remove this flag sometime in the future.
1733 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1734 continue
1737 -avoid-version)
1738 avoid_version=yes
1739 continue
1742 -dlopen)
1743 prev=dlfiles
1744 continue
1747 -dlpreopen)
1748 prev=dlprefiles
1749 continue
1752 -export-dynamic)
1753 export_dynamic=yes
1754 continue
1757 -export-symbols | -export-symbols-regex)
1758 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1759 $echo "$modename: more than one -exported-symbols argument is not allowed"
1760 exit $EXIT_FAILURE
1762 if test "X$arg" = "X-export-symbols"; then
1763 prev=expsyms
1764 else
1765 prev=expsyms_regex
1767 continue
1770 -framework)
1771 prev=darwin_framework
1772 compiler_flags="$compiler_flags $arg"
1773 continue
1776 -inst-prefix-dir)
1777 prev=inst_prefix
1778 continue
1781 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1782 # so, if we see these flags be careful not to treat them like -L
1783 -L[A-Z][A-Z]*:*)
1784 case $with_gcc/$host in
1785 no/*-*-irix* | /*-*-irix*)
1786 compile_command="$compile_command $arg"
1787 finalize_command="$finalize_command $arg"
1789 esac
1790 continue
1793 -L*)
1794 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1795 # We need an absolute path.
1796 case $dir in
1797 [\\/]* | [A-Za-z]:[\\/]*) ;;
1799 absdir=`cd "$dir" && pwd`
1800 if test -z "$absdir"; then
1801 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1802 exit $EXIT_FAILURE
1804 dir="$absdir"
1806 esac
1807 case "$deplibs " in
1808 *" -L$dir "*) ;;
1810 deplibs="$deplibs -L$dir"
1811 lib_search_path="$lib_search_path $dir"
1813 esac
1814 case $host in
1815 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1816 case :$dllsearchpath: in
1817 *":$dir:"*) ;;
1818 *) dllsearchpath="$dllsearchpath:$dir";;
1819 esac
1821 esac
1822 continue
1825 -l*)
1826 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1827 case $host in
1828 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1829 # These systems don't actually have a C or math library (as such)
1830 continue
1832 *-*-mingw* | *-*-os2*)
1833 # These systems don't actually have a C library (as such)
1834 test "X$arg" = "X-lc" && continue
1836 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1837 # Do not include libc due to us having libc/libc_r.
1838 test "X$arg" = "X-lc" && continue
1840 *-*-rhapsody* | *-*-darwin1.[012])
1841 # Rhapsody C and math libraries are in the System framework
1842 deplibs="$deplibs -framework System"
1843 continue
1844 esac
1845 elif test "X$arg" = "X-lc_r"; then
1846 case $host in
1847 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1848 # Do not include libc_r directly, use -pthread flag.
1849 continue
1851 esac
1853 deplibs="$deplibs $arg"
1854 continue
1857 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1858 # classes, name mangling, and exception handling.
1859 -model)
1860 compile_command="$compile_command $arg"
1861 compiler_flags="$compiler_flags $arg"
1862 finalize_command="$finalize_command $arg"
1863 prev=xcompiler
1864 continue
1867 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1868 compiler_flags="$compiler_flags $arg"
1869 compile_command="$compile_command $arg"
1870 finalize_command="$finalize_command $arg"
1871 continue
1874 -module)
1875 module=yes
1876 continue
1879 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1880 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1881 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1882 # +DA*, +DD* enable 64-bit mode on the HP compiler
1883 # -q* pass through compiler args for the IBM compiler
1884 # -m* pass through architecture-specific compiler args for GCC
1885 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1887 # Unknown arguments in both finalize_command and compile_command need
1888 # to be aesthetically quoted because they are evaled later.
1889 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1890 case $arg in
1891 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
1892 arg="\"$arg\""
1894 esac
1895 compile_command="$compile_command $arg"
1896 finalize_command="$finalize_command $arg"
1897 if test "$with_gcc" = "yes" ; then
1898 compiler_flags="$compiler_flags $arg"
1900 continue
1903 -shrext)
1904 prev=shrext
1905 continue
1908 -no-fast-install)
1909 fast_install=no
1910 continue
1913 -no-install)
1914 case $host in
1915 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1916 # The PATH hackery in wrapper scripts is required on Windows
1917 # in order for the loader to find any dlls it needs.
1918 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1919 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1920 fast_install=no
1922 *) no_install=yes ;;
1923 esac
1924 continue
1927 -no-undefined)
1928 allow_undefined=no
1929 continue
1932 -objectlist)
1933 prev=objectlist
1934 continue
1937 -o) prev=output ;;
1939 -precious-files-regex)
1940 prev=precious_regex
1941 continue
1944 -release)
1945 prev=release
1946 continue
1949 -rpath)
1950 prev=rpath
1951 continue
1955 prev=xrpath
1956 continue
1959 -R*)
1960 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1961 # We need an absolute path.
1962 case $dir in
1963 [\\/]* | [A-Za-z]:[\\/]*) ;;
1965 $echo "$modename: only absolute run-paths are allowed" 1>&2
1966 exit $EXIT_FAILURE
1968 esac
1969 case "$xrpath " in
1970 *" $dir "*) ;;
1971 *) xrpath="$xrpath $dir" ;;
1972 esac
1973 continue
1976 -static)
1977 # The effects of -static are defined in a previous loop.
1978 # We used to do the same as -all-static on platforms that
1979 # didn't have a PIC flag, but the assumption that the effects
1980 # would be equivalent was wrong. It would break on at least
1981 # Digital Unix and AIX.
1982 continue
1985 -thread-safe)
1986 thread_safe=yes
1987 continue
1990 -version-info)
1991 prev=vinfo
1992 continue
1994 -version-number)
1995 prev=vinfo
1996 vinfo_number=yes
1997 continue
2000 -Wc,*)
2001 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2002 arg=
2003 save_ifs="$IFS"; IFS=','
2004 for flag in $args; do
2005 IFS="$save_ifs"
2006 case $flag in
2007 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2008 flag="\"$flag\""
2010 esac
2011 arg="$arg $wl$flag"
2012 compiler_flags="$compiler_flags $flag"
2013 done
2014 IFS="$save_ifs"
2015 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2018 -Wl,*)
2019 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2020 arg=
2021 save_ifs="$IFS"; IFS=','
2022 for flag in $args; do
2023 IFS="$save_ifs"
2024 case $flag in
2025 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2026 flag="\"$flag\""
2028 esac
2029 arg="$arg $wl$flag"
2030 compiler_flags="$compiler_flags $wl$flag"
2031 linker_flags="$linker_flags $flag"
2032 done
2033 IFS="$save_ifs"
2034 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2037 -Xcompiler)
2038 prev=xcompiler
2039 continue
2042 -Xlinker)
2043 prev=xlinker
2044 continue
2047 -XCClinker)
2048 prev=xcclinker
2049 continue
2052 # Some other compiler flag.
2053 -* | +*)
2054 # Unknown arguments in both finalize_command and compile_command need
2055 # to be aesthetically quoted because they are evaled later.
2056 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2057 case $arg in
2058 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2059 arg="\"$arg\""
2061 esac
2064 *.$objext)
2065 # A standard object.
2066 objs="$objs $arg"
2069 *.lo)
2070 # A libtool-controlled object.
2072 # Check to see that this really is a libtool object.
2073 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2074 pic_object=
2075 non_pic_object=
2077 # Read the .lo file
2078 # If there is no directory component, then add one.
2079 case $arg in
2080 */* | *\\*) . $arg ;;
2081 *) . ./$arg ;;
2082 esac
2084 if test -z "$pic_object" || \
2085 test -z "$non_pic_object" ||
2086 test "$pic_object" = none && \
2087 test "$non_pic_object" = none; then
2088 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2089 exit $EXIT_FAILURE
2092 # Extract subdirectory from the argument.
2093 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2094 if test "X$xdir" = "X$arg"; then
2095 xdir=
2096 else
2097 xdir="$xdir/"
2100 if test "$pic_object" != none; then
2101 # Prepend the subdirectory the object is found in.
2102 pic_object="$xdir$pic_object"
2104 if test "$prev" = dlfiles; then
2105 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2106 dlfiles="$dlfiles $pic_object"
2107 prev=
2108 continue
2109 else
2110 # If libtool objects are unsupported, then we need to preload.
2111 prev=dlprefiles
2115 # CHECK ME: I think I busted this. -Ossama
2116 if test "$prev" = dlprefiles; then
2117 # Preload the old-style object.
2118 dlprefiles="$dlprefiles $pic_object"
2119 prev=
2122 # A PIC object.
2123 libobjs="$libobjs $pic_object"
2124 arg="$pic_object"
2127 # Non-PIC object.
2128 if test "$non_pic_object" != none; then
2129 # Prepend the subdirectory the object is found in.
2130 non_pic_object="$xdir$non_pic_object"
2132 # A standard non-PIC object
2133 non_pic_objects="$non_pic_objects $non_pic_object"
2134 if test -z "$pic_object" || test "$pic_object" = none ; then
2135 arg="$non_pic_object"
2138 else
2139 # Only an error if not doing a dry-run.
2140 if test -z "$run"; then
2141 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2142 exit $EXIT_FAILURE
2143 else
2144 # Dry-run case.
2146 # Extract subdirectory from the argument.
2147 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2148 if test "X$xdir" = "X$arg"; then
2149 xdir=
2150 else
2151 xdir="$xdir/"
2154 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2155 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2156 libobjs="$libobjs $pic_object"
2157 non_pic_objects="$non_pic_objects $non_pic_object"
2162 *.$libext)
2163 # An archive.
2164 deplibs="$deplibs $arg"
2165 old_deplibs="$old_deplibs $arg"
2166 continue
2169 *.la)
2170 # A libtool-controlled library.
2172 if test "$prev" = dlfiles; then
2173 # This library was specified with -dlopen.
2174 dlfiles="$dlfiles $arg"
2175 prev=
2176 elif test "$prev" = dlprefiles; then
2177 # The library was specified with -dlpreopen.
2178 dlprefiles="$dlprefiles $arg"
2179 prev=
2180 else
2181 deplibs="$deplibs $arg"
2183 continue
2186 # Some other compiler argument.
2188 # Unknown arguments in both finalize_command and compile_command need
2189 # to be aesthetically quoted because they are evaled later.
2190 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2191 case $arg in
2192 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
2193 arg="\"$arg\""
2195 esac
2197 esac # arg
2199 # Now actually substitute the argument into the commands.
2200 if test -n "$arg"; then
2201 compile_command="$compile_command $arg"
2202 finalize_command="$finalize_command $arg"
2204 done # argument parsing loop
2206 if test -n "$prev"; then
2207 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2208 $echo "$help" 1>&2
2209 exit $EXIT_FAILURE
2212 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2213 eval arg=\"$export_dynamic_flag_spec\"
2214 compile_command="$compile_command $arg"
2215 finalize_command="$finalize_command $arg"
2218 oldlibs=
2219 # calculate the name of the file, without its directory
2220 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2221 libobjs_save="$libobjs"
2223 if test -n "$shlibpath_var"; then
2224 # get the directories listed in $shlibpath_var
2225 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2226 else
2227 shlib_search_path=
2229 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2230 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2232 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2233 if test "X$output_objdir" = "X$output"; then
2234 output_objdir="$objdir"
2235 else
2236 output_objdir="$output_objdir/$objdir"
2238 # Create the object directory.
2239 if test ! -d "$output_objdir"; then
2240 $show "$mkdir $output_objdir"
2241 $run $mkdir $output_objdir
2242 status=$?
2243 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2244 exit $status
2248 # Determine the type of output
2249 case $output in
2251 $echo "$modename: you must specify an output file" 1>&2
2252 $echo "$help" 1>&2
2253 exit $EXIT_FAILURE
2255 *.$libext) linkmode=oldlib ;;
2256 *.lo | *.$objext) linkmode=obj ;;
2257 *.la) linkmode=lib ;;
2258 *) linkmode=prog ;; # Anything else should be a program.
2259 esac
2261 case $host in
2262 *cygwin* | *mingw* | *pw32*)
2263 # don't eliminate duplications in $postdeps and $predeps
2264 duplicate_compiler_generated_deps=yes
2267 duplicate_compiler_generated_deps=$duplicate_deps
2269 esac
2270 specialdeplibs=
2272 libs=
2273 # Find all interdependent deplibs by searching for libraries
2274 # that are linked more than once (e.g. -la -lb -la)
2275 for deplib in $deplibs; do
2276 if test "X$duplicate_deps" = "Xyes" ; then
2277 case "$libs " in
2278 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2279 esac
2281 libs="$libs $deplib"
2282 done
2284 if test "$linkmode" = lib; then
2285 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2287 # Compute libraries that are listed more than once in $predeps
2288 # $postdeps and mark them as special (i.e., whose duplicates are
2289 # not to be eliminated).
2290 pre_post_deps=
2291 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2292 for pre_post_dep in $predeps $postdeps; do
2293 case "$pre_post_deps " in
2294 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2295 esac
2296 pre_post_deps="$pre_post_deps $pre_post_dep"
2297 done
2299 pre_post_deps=
2302 deplibs=
2303 newdependency_libs=
2304 newlib_search_path=
2305 need_relink=no # whether we're linking any uninstalled libtool libraries
2306 notinst_deplibs= # not-installed libtool libraries
2307 notinst_path= # paths that contain not-installed libtool libraries
2308 case $linkmode in
2309 lib)
2310 passes="conv link"
2311 for file in $dlfiles $dlprefiles; do
2312 case $file in
2313 *.la) ;;
2315 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2316 exit $EXIT_FAILURE
2318 esac
2319 done
2321 prog)
2322 compile_deplibs=
2323 finalize_deplibs=
2324 alldeplibs=no
2325 newdlfiles=
2326 newdlprefiles=
2327 passes="conv scan dlopen dlpreopen link"
2329 *) passes="conv"
2331 esac
2332 for pass in $passes; do
2333 if test "$linkmode,$pass" = "lib,link" ||
2334 test "$linkmode,$pass" = "prog,scan"; then
2335 libs="$deplibs"
2336 deplibs=
2338 if test "$linkmode" = prog; then
2339 case $pass in
2340 dlopen) libs="$dlfiles" ;;
2341 dlpreopen) libs="$dlprefiles" ;;
2342 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2343 esac
2345 if test "$pass" = dlopen; then
2346 # Collect dlpreopened libraries
2347 save_deplibs="$deplibs"
2348 deplibs=
2350 for deplib in $libs; do
2351 lib=
2352 found=no
2353 case $deplib in
2354 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2355 if test "$linkmode,$pass" = "prog,link"; then
2356 compile_deplibs="$deplib $compile_deplibs"
2357 finalize_deplibs="$deplib $finalize_deplibs"
2358 else
2359 compiler_flags="$compiler_flags $deplib"
2361 continue
2363 -l*)
2364 if test "$linkmode" != lib && test "$linkmode" != prog; then
2365 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2366 continue
2368 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2369 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2370 for search_ext in .la $std_shrext .so .a; do
2371 # Search the libtool library
2372 lib="$searchdir/lib${name}${search_ext}"
2373 if test -f "$lib"; then
2374 if test "$search_ext" = ".la"; then
2375 found=yes
2376 else
2377 found=no
2379 break 2
2381 done
2382 done
2383 if test "$found" != yes; then
2384 # deplib doesn't seem to be a libtool library
2385 if test "$linkmode,$pass" = "prog,link"; then
2386 compile_deplibs="$deplib $compile_deplibs"
2387 finalize_deplibs="$deplib $finalize_deplibs"
2388 else
2389 deplibs="$deplib $deplibs"
2390 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2392 continue
2393 else # deplib is a libtool library
2394 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2395 # We need to do some special things here, and not later.
2396 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2397 case " $predeps $postdeps " in
2398 *" $deplib "*)
2399 if (${SED} -e '2q' $lib |
2400 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2401 library_names=
2402 old_library=
2403 case $lib in
2404 */* | *\\*) . $lib ;;
2405 *) . ./$lib ;;
2406 esac
2407 for l in $old_library $library_names; do
2408 ll="$l"
2409 done
2410 if test "X$ll" = "X$old_library" ; then # only static version available
2411 found=no
2412 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2413 test "X$ladir" = "X$lib" && ladir="."
2414 lib=$ladir/$old_library
2415 if test "$linkmode,$pass" = "prog,link"; then
2416 compile_deplibs="$deplib $compile_deplibs"
2417 finalize_deplibs="$deplib $finalize_deplibs"
2418 else
2419 deplibs="$deplib $deplibs"
2420 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2422 continue
2426 *) ;;
2427 esac
2430 ;; # -l
2431 -L*)
2432 case $linkmode in
2433 lib)
2434 deplibs="$deplib $deplibs"
2435 test "$pass" = conv && continue
2436 newdependency_libs="$deplib $newdependency_libs"
2437 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2439 prog)
2440 if test "$pass" = conv; then
2441 deplibs="$deplib $deplibs"
2442 continue
2444 if test "$pass" = scan; then
2445 deplibs="$deplib $deplibs"
2446 else
2447 compile_deplibs="$deplib $compile_deplibs"
2448 finalize_deplibs="$deplib $finalize_deplibs"
2450 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2453 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2455 esac # linkmode
2456 continue
2457 ;; # -L
2458 -R*)
2459 if test "$pass" = link; then
2460 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2461 # Make sure the xrpath contains only unique directories.
2462 case "$xrpath " in
2463 *" $dir "*) ;;
2464 *) xrpath="$xrpath $dir" ;;
2465 esac
2467 deplibs="$deplib $deplibs"
2468 continue
2470 *.la) lib="$deplib" ;;
2471 *.$libext)
2472 if test "$pass" = conv; then
2473 deplibs="$deplib $deplibs"
2474 continue
2476 case $linkmode in
2477 lib)
2478 valid_a_lib=no
2479 case $deplibs_check_method in
2480 match_pattern*)
2481 set dummy $deplibs_check_method
2482 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2483 if eval $echo \"$deplib\" 2>/dev/null \
2484 | $SED 10q \
2485 | $EGREP "$match_pattern_regex" > /dev/null; then
2486 valid_a_lib=yes
2489 pass_all)
2490 valid_a_lib=yes
2492 esac
2493 if test "$valid_a_lib" != yes; then
2494 $echo
2495 $echo "*** Warning: Trying to link with static lib archive $deplib."
2496 $echo "*** I have the capability to make that library automatically link in when"
2497 $echo "*** you link to this library. But I can only do this if you have a"
2498 $echo "*** shared version of the library, which you do not appear to have"
2499 $echo "*** because the file extensions .$libext of this argument makes me believe"
2500 $echo "*** that it is just a static archive that I should not used here."
2501 else
2502 $echo
2503 $echo "*** Warning: Linking the shared library $output against the"
2504 $echo "*** static library $deplib is not portable!"
2505 deplibs="$deplib $deplibs"
2507 continue
2509 prog)
2510 if test "$pass" != link; then
2511 deplibs="$deplib $deplibs"
2512 else
2513 compile_deplibs="$deplib $compile_deplibs"
2514 finalize_deplibs="$deplib $finalize_deplibs"
2516 continue
2518 esac # linkmode
2519 ;; # *.$libext
2520 *.lo | *.$objext)
2521 if test "$pass" = conv; then
2522 deplibs="$deplib $deplibs"
2523 elif test "$linkmode" = prog; then
2524 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2525 # If there is no dlopen support or we're linking statically,
2526 # we need to preload.
2527 newdlprefiles="$newdlprefiles $deplib"
2528 compile_deplibs="$deplib $compile_deplibs"
2529 finalize_deplibs="$deplib $finalize_deplibs"
2530 else
2531 newdlfiles="$newdlfiles $deplib"
2534 continue
2536 %DEPLIBS%)
2537 alldeplibs=yes
2538 continue
2540 esac # case $deplib
2541 if test "$found" = yes || test -f "$lib"; then :
2542 else
2543 $echo "$modename: cannot find the library \`$lib'" 1>&2
2544 exit $EXIT_FAILURE
2547 # Check to see that this really is a libtool archive.
2548 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2549 else
2550 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2551 exit $EXIT_FAILURE
2554 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2555 test "X$ladir" = "X$lib" && ladir="."
2557 dlname=
2558 dlopen=
2559 dlpreopen=
2560 libdir=
2561 library_names=
2562 old_library=
2563 # If the library was installed with an old release of libtool,
2564 # it will not redefine variables installed, or shouldnotlink
2565 installed=yes
2566 shouldnotlink=no
2567 avoidtemprpath=
2570 # Read the .la file
2571 case $lib in
2572 */* | *\\*) . $lib ;;
2573 *) . ./$lib ;;
2574 esac
2576 if test "$linkmode,$pass" = "lib,link" ||
2577 test "$linkmode,$pass" = "prog,scan" ||
2578 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2579 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2580 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2583 if test "$pass" = conv; then
2584 # Only check for convenience libraries
2585 deplibs="$lib $deplibs"
2586 if test -z "$libdir"; then
2587 if test -z "$old_library"; then
2588 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2589 exit $EXIT_FAILURE
2591 # It is a libtool convenience library, so add in its objects.
2592 convenience="$convenience $ladir/$objdir/$old_library"
2593 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2594 tmp_libs=
2595 for deplib in $dependency_libs; do
2596 deplibs="$deplib $deplibs"
2597 if test "X$duplicate_deps" = "Xyes" ; then
2598 case "$tmp_libs " in
2599 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2600 esac
2602 tmp_libs="$tmp_libs $deplib"
2603 done
2604 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2605 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2606 exit $EXIT_FAILURE
2608 continue
2609 fi # $pass = conv
2612 # Get the name of the library we link against.
2613 linklib=
2614 for l in $old_library $library_names; do
2615 linklib="$l"
2616 done
2617 if test -z "$linklib"; then
2618 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2619 exit $EXIT_FAILURE
2622 # This library was specified with -dlopen.
2623 if test "$pass" = dlopen; then
2624 if test -z "$libdir"; then
2625 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2626 exit $EXIT_FAILURE
2628 if test -z "$dlname" ||
2629 test "$dlopen_support" != yes ||
2630 test "$build_libtool_libs" = no; then
2631 # If there is no dlname, no dlopen support or we're linking
2632 # statically, we need to preload. We also need to preload any
2633 # dependent libraries so libltdl's deplib preloader doesn't
2634 # bomb out in the load deplibs phase.
2635 dlprefiles="$dlprefiles $lib $dependency_libs"
2636 else
2637 newdlfiles="$newdlfiles $lib"
2639 continue
2640 fi # $pass = dlopen
2642 # We need an absolute path.
2643 case $ladir in
2644 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2646 abs_ladir=`cd "$ladir" && pwd`
2647 if test -z "$abs_ladir"; then
2648 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2649 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2650 abs_ladir="$ladir"
2653 esac
2654 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2656 # Find the relevant object directory and library name.
2657 if test "X$installed" = Xyes; then
2658 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2659 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2660 dir="$ladir"
2661 absdir="$abs_ladir"
2662 libdir="$abs_ladir"
2663 else
2664 dir="$libdir"
2665 absdir="$libdir"
2667 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2668 else
2669 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2670 dir="$ladir"
2671 absdir="$abs_ladir"
2672 # Remove this search path later
2673 notinst_path="$notinst_path $abs_ladir"
2674 else
2675 dir="$ladir/$objdir"
2676 absdir="$abs_ladir/$objdir"
2677 # Remove this search path later
2678 notinst_path="$notinst_path $abs_ladir"
2680 fi # $installed = yes
2681 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2683 # This library was specified with -dlpreopen.
2684 if test "$pass" = dlpreopen; then
2685 if test -z "$libdir"; then
2686 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2687 exit $EXIT_FAILURE
2689 # Prefer using a static library (so that no silly _DYNAMIC symbols
2690 # are required to link).
2691 if test -n "$old_library"; then
2692 newdlprefiles="$newdlprefiles $dir/$old_library"
2693 # Otherwise, use the dlname, so that lt_dlopen finds it.
2694 elif test -n "$dlname"; then
2695 newdlprefiles="$newdlprefiles $dir/$dlname"
2696 else
2697 newdlprefiles="$newdlprefiles $dir/$linklib"
2699 fi # $pass = dlpreopen
2701 if test -z "$libdir"; then
2702 # Link the convenience library
2703 if test "$linkmode" = lib; then
2704 deplibs="$dir/$old_library $deplibs"
2705 elif test "$linkmode,$pass" = "prog,link"; then
2706 compile_deplibs="$dir/$old_library $compile_deplibs"
2707 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2708 else
2709 deplibs="$lib $deplibs" # used for prog,scan pass
2711 continue
2715 if test "$linkmode" = prog && test "$pass" != link; then
2716 newlib_search_path="$newlib_search_path $ladir"
2717 deplibs="$lib $deplibs"
2719 linkalldeplibs=no
2720 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2721 test "$build_libtool_libs" = no; then
2722 linkalldeplibs=yes
2725 tmp_libs=
2726 for deplib in $dependency_libs; do
2727 case $deplib in
2728 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2729 esac
2730 # Need to link against all dependency_libs?
2731 if test "$linkalldeplibs" = yes; then
2732 deplibs="$deplib $deplibs"
2733 else
2734 # Need to hardcode shared library paths
2735 # or/and link against static libraries
2736 newdependency_libs="$deplib $newdependency_libs"
2738 if test "X$duplicate_deps" = "Xyes" ; then
2739 case "$tmp_libs " in
2740 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2741 esac
2743 tmp_libs="$tmp_libs $deplib"
2744 done # for deplib
2745 continue
2746 fi # $linkmode = prog...
2748 if test "$linkmode,$pass" = "prog,link"; then
2749 if test -n "$library_names" &&
2750 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2751 # We need to hardcode the library path
2752 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2753 # Make sure the rpath contains only unique directories.
2754 case "$temp_rpath " in
2755 *" $dir "*) ;;
2756 *" $absdir "*) ;;
2757 *) temp_rpath="$temp_rpath $dir" ;;
2758 esac
2761 # Hardcode the library path.
2762 # Skip directories that are in the system default run-time
2763 # search path.
2764 case " $sys_lib_dlsearch_path " in
2765 *" $absdir "*) ;;
2767 case "$compile_rpath " in
2768 *" $absdir "*) ;;
2769 *) compile_rpath="$compile_rpath $absdir"
2770 esac
2772 esac
2773 case " $sys_lib_dlsearch_path " in
2774 *" $libdir "*) ;;
2776 case "$finalize_rpath " in
2777 *" $libdir "*) ;;
2778 *) finalize_rpath="$finalize_rpath $libdir"
2779 esac
2781 esac
2782 fi # $linkmode,$pass = prog,link...
2784 if test "$alldeplibs" = yes &&
2785 { test "$deplibs_check_method" = pass_all ||
2786 { test "$build_libtool_libs" = yes &&
2787 test -n "$library_names"; }; }; then
2788 # We only need to search for static libraries
2789 continue
2793 link_static=no # Whether the deplib will be linked statically
2794 if test -n "$library_names" &&
2795 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2796 if test "$installed" = no; then
2797 notinst_deplibs="$notinst_deplibs $lib"
2798 need_relink=yes
2800 # This is a shared library
2802 # Warn about portability, can't link against -module's on
2803 # some systems (darwin)
2804 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2805 $echo
2806 if test "$linkmode" = prog; then
2807 $echo "*** Warning: Linking the executable $output against the loadable module"
2808 else
2809 $echo "*** Warning: Linking the shared library $output against the loadable module"
2811 $echo "*** $linklib is not portable!"
2813 if test "$linkmode" = lib &&
2814 test "$hardcode_into_libs" = yes; then
2815 # Hardcode the library path.
2816 # Skip directories that are in the system default run-time
2817 # search path.
2818 case " $sys_lib_dlsearch_path " in
2819 *" $absdir "*) ;;
2821 case "$compile_rpath " in
2822 *" $absdir "*) ;;
2823 *) compile_rpath="$compile_rpath $absdir"
2824 esac
2826 esac
2827 case " $sys_lib_dlsearch_path " in
2828 *" $libdir "*) ;;
2830 case "$finalize_rpath " in
2831 *" $libdir "*) ;;
2832 *) finalize_rpath="$finalize_rpath $libdir"
2833 esac
2835 esac
2838 if test -n "$old_archive_from_expsyms_cmds"; then
2839 # figure out the soname
2840 set dummy $library_names
2841 realname="$2"
2842 shift; shift
2843 libname=`eval \\$echo \"$libname_spec\"`
2844 # use dlname if we got it. it's perfectly good, no?
2845 if test -n "$dlname"; then
2846 soname="$dlname"
2847 elif test -n "$soname_spec"; then
2848 # bleh windows
2849 case $host in
2850 *cygwin* | mingw*)
2851 major=`expr $current - $age`
2852 versuffix="-$major"
2854 esac
2855 eval soname=\"$soname_spec\"
2856 else
2857 soname="$realname"
2860 # Make a new name for the extract_expsyms_cmds to use
2861 soroot="$soname"
2862 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2863 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2865 # If the library has no export list, then create one now
2866 if test -f "$output_objdir/$soname-def"; then :
2867 else
2868 $show "extracting exported symbol list from \`$soname'"
2869 save_ifs="$IFS"; IFS='~'
2870 cmds=$extract_expsyms_cmds
2871 for cmd in $cmds; do
2872 IFS="$save_ifs"
2873 eval cmd=\"$cmd\"
2874 $show "$cmd"
2875 $run eval "$cmd" || exit $?
2876 done
2877 IFS="$save_ifs"
2880 # Create $newlib
2881 if test -f "$output_objdir/$newlib"; then :; else
2882 $show "generating import library for \`$soname'"
2883 save_ifs="$IFS"; IFS='~'
2884 cmds=$old_archive_from_expsyms_cmds
2885 for cmd in $cmds; do
2886 IFS="$save_ifs"
2887 eval cmd=\"$cmd\"
2888 $show "$cmd"
2889 $run eval "$cmd" || exit $?
2890 done
2891 IFS="$save_ifs"
2893 # make sure the library variables are pointing to the new library
2894 dir=$output_objdir
2895 linklib=$newlib
2896 fi # test -n "$old_archive_from_expsyms_cmds"
2898 if test "$linkmode" = prog || test "$mode" != relink; then
2899 add_shlibpath=
2900 add_dir=
2901 add=
2902 lib_linked=yes
2903 case $hardcode_action in
2904 immediate | unsupported)
2905 if test "$hardcode_direct" = no; then
2906 add="$dir/$linklib"
2907 case $host in
2908 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2909 *-*-darwin* )
2910 # if the lib is a module then we can not link against
2911 # it, someone is ignoring the new warnings I added
2912 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2913 $echo "** Warning, lib $linklib is a module, not a shared library"
2914 if test -z "$old_library" ; then
2915 $echo
2916 $echo "** And there doesn't seem to be a static archive available"
2917 $echo "** The link will probably fail, sorry"
2918 else
2919 add="$dir/$old_library"
2922 esac
2923 elif test "$hardcode_minus_L" = no; then
2924 case $host in
2925 *-*-sunos*) add_shlibpath="$dir" ;;
2926 esac
2927 add_dir="-L$dir"
2928 add="-l$name"
2929 elif test "$hardcode_shlibpath_var" = no; then
2930 add_shlibpath="$dir"
2931 add="-l$name"
2932 else
2933 lib_linked=no
2936 relink)
2937 if test "$hardcode_direct" = yes; then
2938 add="$dir/$linklib"
2939 elif test "$hardcode_minus_L" = yes; then
2940 add_dir="-L$dir"
2941 # Try looking first in the location we're being installed to.
2942 if test -n "$inst_prefix_dir"; then
2943 case "$libdir" in
2944 [\\/]*)
2945 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2947 esac
2949 add="-l$name"
2950 elif test "$hardcode_shlibpath_var" = yes; then
2951 add_shlibpath="$dir"
2952 add="-l$name"
2953 else
2954 lib_linked=no
2957 *) lib_linked=no ;;
2958 esac
2960 if test "$lib_linked" != yes; then
2961 $echo "$modename: configuration error: unsupported hardcode properties"
2962 exit $EXIT_FAILURE
2965 if test -n "$add_shlibpath"; then
2966 case :$compile_shlibpath: in
2967 *":$add_shlibpath:"*) ;;
2968 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2969 esac
2971 if test "$linkmode" = prog; then
2972 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2973 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2974 else
2975 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2976 test -n "$add" && deplibs="$add $deplibs"
2977 if test "$hardcode_direct" != yes && \
2978 test "$hardcode_minus_L" != yes && \
2979 test "$hardcode_shlibpath_var" = yes; then
2980 case :$finalize_shlibpath: in
2981 *":$libdir:"*) ;;
2982 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2983 esac
2988 if test "$linkmode" = prog || test "$mode" = relink; then
2989 add_shlibpath=
2990 add_dir=
2991 add=
2992 # Finalize command for both is simple: just hardcode it.
2993 if test "$hardcode_direct" = yes; then
2994 add="$libdir/$linklib"
2995 elif test "$hardcode_minus_L" = yes; then
2996 add_dir="-L$libdir"
2997 add="-l$name"
2998 elif test "$hardcode_shlibpath_var" = yes; then
2999 case :$finalize_shlibpath: in
3000 *":$libdir:"*) ;;
3001 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3002 esac
3003 add="-l$name"
3004 elif test "$hardcode_automatic" = yes; then
3005 if test -n "$inst_prefix_dir" &&
3006 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3007 add="$inst_prefix_dir$libdir/$linklib"
3008 else
3009 add="$libdir/$linklib"
3011 else
3012 # We cannot seem to hardcode it, guess we'll fake it.
3013 add_dir="-L$libdir"
3014 # Try looking first in the location we're being installed to.
3015 if test -n "$inst_prefix_dir"; then
3016 case "$libdir" in
3017 [\\/]*)
3018 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3020 esac
3022 add="-l$name"
3025 if test "$linkmode" = prog; then
3026 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3027 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3028 else
3029 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3030 test -n "$add" && deplibs="$add $deplibs"
3033 elif test "$linkmode" = prog; then
3034 # Here we assume that one of hardcode_direct or hardcode_minus_L
3035 # is not unsupported. This is valid on all known static and
3036 # shared platforms.
3037 if test "$hardcode_direct" != unsupported; then
3038 test -n "$old_library" && linklib="$old_library"
3039 compile_deplibs="$dir/$linklib $compile_deplibs"
3040 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3041 else
3042 compile_deplibs="-l$name -L$dir $compile_deplibs"
3043 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3045 elif test "$build_libtool_libs" = yes; then
3046 # Not a shared library
3047 if test "$deplibs_check_method" != pass_all; then
3048 # We're trying link a shared library against a static one
3049 # but the system doesn't support it.
3051 # Just print a warning and add the library to dependency_libs so
3052 # that the program can be linked against the static library.
3053 $echo
3054 $echo "*** Warning: This system can not link to static lib archive $lib."
3055 $echo "*** I have the capability to make that library automatically link in when"
3056 $echo "*** you link to this library. But I can only do this if you have a"
3057 $echo "*** shared version of the library, which you do not appear to have."
3058 if test "$module" = yes; then
3059 $echo "*** But as you try to build a module library, libtool will still create "
3060 $echo "*** a static module, that should work as long as the dlopening application"
3061 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3062 if test -z "$global_symbol_pipe"; then
3063 $echo
3064 $echo "*** However, this would only work if libtool was able to extract symbol"
3065 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3066 $echo "*** not find such a program. So, this module is probably useless."
3067 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3069 if test "$build_old_libs" = no; then
3070 build_libtool_libs=module
3071 build_old_libs=yes
3072 else
3073 build_libtool_libs=no
3076 else
3077 convenience="$convenience $dir/$old_library"
3078 old_convenience="$old_convenience $dir/$old_library"
3079 deplibs="$dir/$old_library $deplibs"
3080 link_static=yes
3082 fi # link shared/static library?
3084 if test "$linkmode" = lib; then
3085 if test -n "$dependency_libs" &&
3086 { test "$hardcode_into_libs" != yes ||
3087 test "$build_old_libs" = yes ||
3088 test "$link_static" = yes; }; then
3089 # Extract -R from dependency_libs
3090 temp_deplibs=
3091 for libdir in $dependency_libs; do
3092 case $libdir in
3093 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3094 case " $xrpath " in
3095 *" $temp_xrpath "*) ;;
3096 *) xrpath="$xrpath $temp_xrpath";;
3097 esac;;
3098 *) temp_deplibs="$temp_deplibs $libdir";;
3099 esac
3100 done
3101 dependency_libs="$temp_deplibs"
3104 newlib_search_path="$newlib_search_path $absdir"
3105 # Link against this library
3106 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3107 # ... and its dependency_libs
3108 tmp_libs=
3109 for deplib in $dependency_libs; do
3110 newdependency_libs="$deplib $newdependency_libs"
3111 if test "X$duplicate_deps" = "Xyes" ; then
3112 case "$tmp_libs " in
3113 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3114 esac
3116 tmp_libs="$tmp_libs $deplib"
3117 done
3119 if test "$link_all_deplibs" != no; then
3120 # Add the search paths of all dependency libraries
3121 for deplib in $dependency_libs; do
3122 case $deplib in
3123 -L*) path="$deplib" ;;
3124 *.la)
3125 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3126 test "X$dir" = "X$deplib" && dir="."
3127 # We need an absolute path.
3128 case $dir in
3129 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3131 absdir=`cd "$dir" && pwd`
3132 if test -z "$absdir"; then
3133 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3134 absdir="$dir"
3137 esac
3138 if grep "^installed=no" $deplib > /dev/null; then
3139 path="$absdir/$objdir"
3140 else
3141 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3142 if test -z "$libdir"; then
3143 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3144 exit $EXIT_FAILURE
3146 if test "$absdir" != "$libdir"; then
3147 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3149 path="$absdir"
3151 depdepl=
3152 case $host in
3153 *-*-darwin*)
3154 # we do not want to link against static libs,
3155 # but need to link against shared
3156 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3157 if test -n "$deplibrary_names" ; then
3158 for tmp in $deplibrary_names ; do
3159 depdepl=$tmp
3160 done
3161 if test -f "$path/$depdepl" ; then
3162 depdepl="$path/$depdepl"
3164 # do not add paths which are already there
3165 case " $newlib_search_path " in
3166 *" $path "*) ;;
3167 *) newlib_search_path="$newlib_search_path $path";;
3168 esac
3170 path=""
3173 path="-L$path"
3175 esac
3177 -l*)
3178 case $host in
3179 *-*-darwin*)
3180 # Again, we only want to link against shared libraries
3181 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3182 for tmp in $newlib_search_path ; do
3183 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3184 eval depdepl="$tmp/lib$tmp_libs.dylib"
3185 break
3187 done
3188 path=""
3190 *) continue ;;
3191 esac
3193 *) continue ;;
3194 esac
3195 case " $deplibs " in
3196 *" $path "*) ;;
3197 *) deplibs="$path $deplibs" ;;
3198 esac
3199 case " $deplibs " in
3200 *" $depdepl "*) ;;
3201 *) deplibs="$depdepl $deplibs" ;;
3202 esac
3203 done
3204 fi # link_all_deplibs != no
3205 fi # linkmode = lib
3206 done # for deplib in $libs
3207 dependency_libs="$newdependency_libs"
3208 if test "$pass" = dlpreopen; then
3209 # Link the dlpreopened libraries before other libraries
3210 for deplib in $save_deplibs; do
3211 deplibs="$deplib $deplibs"
3212 done
3214 if test "$pass" != dlopen; then
3215 if test "$pass" != conv; then
3216 # Make sure lib_search_path contains only unique directories.
3217 lib_search_path=
3218 for dir in $newlib_search_path; do
3219 case "$lib_search_path " in
3220 *" $dir "*) ;;
3221 *) lib_search_path="$lib_search_path $dir" ;;
3222 esac
3223 done
3224 newlib_search_path=
3227 if test "$linkmode,$pass" != "prog,link"; then
3228 vars="deplibs"
3229 else
3230 vars="compile_deplibs finalize_deplibs"
3232 for var in $vars dependency_libs; do
3233 # Add libraries to $var in reverse order
3234 eval tmp_libs=\"\$$var\"
3235 new_libs=
3236 for deplib in $tmp_libs; do
3237 # FIXME: Pedantically, this is the right thing to do, so
3238 # that some nasty dependency loop isn't accidentally
3239 # broken:
3240 #new_libs="$deplib $new_libs"
3241 # Pragmatically, this seems to cause very few problems in
3242 # practice:
3243 case $deplib in
3244 -L*) new_libs="$deplib $new_libs" ;;
3245 -R*) ;;
3247 # And here is the reason: when a library appears more
3248 # than once as an explicit dependence of a library, or
3249 # is implicitly linked in more than once by the
3250 # compiler, it is considered special, and multiple
3251 # occurrences thereof are not removed. Compare this
3252 # with having the same library being listed as a
3253 # dependency of multiple other libraries: in this case,
3254 # we know (pedantically, we assume) the library does not
3255 # need to be listed more than once, so we keep only the
3256 # last copy. This is not always right, but it is rare
3257 # enough that we require users that really mean to play
3258 # such unportable linking tricks to link the library
3259 # using -Wl,-lname, so that libtool does not consider it
3260 # for duplicate removal.
3261 case " $specialdeplibs " in
3262 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3264 case " $new_libs " in
3265 *" $deplib "*) ;;
3266 *) new_libs="$deplib $new_libs" ;;
3267 esac
3269 esac
3271 esac
3272 done
3273 tmp_libs=
3274 for deplib in $new_libs; do
3275 case $deplib in
3276 -L*)
3277 case " $tmp_libs " in
3278 *" $deplib "*) ;;
3279 *) tmp_libs="$tmp_libs $deplib" ;;
3280 esac
3282 *) tmp_libs="$tmp_libs $deplib" ;;
3283 esac
3284 done
3285 eval $var=\"$tmp_libs\"
3286 done # for var
3288 # Last step: remove runtime libs from dependency_libs
3289 # (they stay in deplibs)
3290 tmp_libs=
3291 for i in $dependency_libs ; do
3292 case " $predeps $postdeps $compiler_lib_search_path " in
3293 *" $i "*)
3294 i=""
3296 esac
3297 if test -n "$i" ; then
3298 tmp_libs="$tmp_libs $i"
3300 done
3301 dependency_libs=$tmp_libs
3302 done # for pass
3303 if test "$linkmode" = prog; then
3304 dlfiles="$newdlfiles"
3305 dlprefiles="$newdlprefiles"
3308 case $linkmode in
3309 oldlib)
3310 if test -n "$deplibs"; then
3311 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3314 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3315 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3318 if test -n "$rpath"; then
3319 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3322 if test -n "$xrpath"; then
3323 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3326 if test -n "$vinfo"; then
3327 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3330 if test -n "$release"; then
3331 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3334 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3335 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3338 # Now set the variables for building old libraries.
3339 build_libtool_libs=no
3340 oldlibs="$output"
3341 objs="$objs$old_deplibs"
3344 lib)
3345 # Make sure we only generate libraries of the form `libNAME.la'.
3346 case $outputname in
3347 lib*)
3348 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3349 eval shared_ext=\"$shrext_cmds\"
3350 eval libname=\"$libname_spec\"
3353 if test "$module" = no; then
3354 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3355 $echo "$help" 1>&2
3356 exit $EXIT_FAILURE
3358 if test "$need_lib_prefix" != no; then
3359 # Add the "lib" prefix for modules if required
3360 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3361 eval shared_ext=\"$shrext_cmds\"
3362 eval libname=\"$libname_spec\"
3363 else
3364 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3367 esac
3369 if test -n "$objs"; then
3370 if test "$deplibs_check_method" != pass_all; then
3371 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3372 exit $EXIT_FAILURE
3373 else
3374 $echo
3375 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3376 $echo "*** objects $objs is not portable!"
3377 libobjs="$libobjs $objs"
3381 if test "$dlself" != no; then
3382 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3385 set dummy $rpath
3386 if test "$#" -gt 2; then
3387 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3389 install_libdir="$2"
3391 oldlibs=
3392 if test -z "$rpath"; then
3393 if test "$build_libtool_libs" = yes; then
3394 # Building a libtool convenience library.
3395 # Some compilers have problems with a `.al' extension so
3396 # convenience libraries should have the same extension an
3397 # archive normally would.
3398 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3399 build_libtool_libs=convenience
3400 build_old_libs=yes
3403 if test -n "$vinfo"; then
3404 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3407 if test -n "$release"; then
3408 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3410 else
3412 # Parse the version information argument.
3413 save_ifs="$IFS"; IFS=':'
3414 set dummy $vinfo 0 0 0
3415 IFS="$save_ifs"
3417 if test -n "$8"; then
3418 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3419 $echo "$help" 1>&2
3420 exit $EXIT_FAILURE
3423 # convert absolute version numbers to libtool ages
3424 # this retains compatibility with .la files and attempts
3425 # to make the code below a bit more comprehensible
3427 case $vinfo_number in
3428 yes)
3429 number_major="$2"
3430 number_minor="$3"
3431 number_revision="$4"
3433 # There are really only two kinds -- those that
3434 # use the current revision as the major version
3435 # and those that subtract age and use age as
3436 # a minor version. But, then there is irix
3437 # which has an extra 1 added just for fun
3439 case $version_type in
3440 darwin|linux|osf|windows)
3441 current=`expr $number_major + $number_minor`
3442 age="$number_minor"
3443 revision="$number_revision"
3445 freebsd-aout|freebsd-elf|sunos)
3446 current="$number_major"
3447 revision="$number_minor"
3448 age="0"
3450 irix|nonstopux)
3451 current=`expr $number_major + $number_minor - 1`
3452 age="$number_minor"
3453 revision="$number_minor"
3455 esac
3458 current="$2"
3459 revision="$3"
3460 age="$4"
3462 esac
3464 # Check that each of the things are valid numbers.
3465 case $current in
3466 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3468 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3469 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3470 exit $EXIT_FAILURE
3472 esac
3474 case $revision in
3475 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3477 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3478 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3479 exit $EXIT_FAILURE
3481 esac
3483 case $age in
3484 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3486 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3487 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3488 exit $EXIT_FAILURE
3490 esac
3492 if test "$age" -gt "$current"; then
3493 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3494 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3495 exit $EXIT_FAILURE
3498 # Calculate the version variables.
3499 major=
3500 versuffix=
3501 verstring=
3502 case $version_type in
3503 none) ;;
3505 darwin)
3506 # Like Linux, but with the current version available in
3507 # verstring for coding it into the library header
3508 major=.`expr $current - $age`
3509 versuffix="$major.$age.$revision"
3510 # Darwin ld doesn't like 0 for these options...
3511 minor_current=`expr $current + 1`
3512 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3515 freebsd-aout)
3516 major=".$current"
3517 versuffix=".$current.$revision";
3520 freebsd-elf)
3521 major=".$current"
3522 versuffix=".$current";
3525 irix | nonstopux)
3526 major=`expr $current - $age + 1`
3528 case $version_type in
3529 nonstopux) verstring_prefix=nonstopux ;;
3530 *) verstring_prefix=sgi ;;
3531 esac
3532 verstring="$verstring_prefix$major.$revision"
3534 # Add in all the interfaces that we are compatible with.
3535 loop=$revision
3536 while test "$loop" -ne 0; do
3537 iface=`expr $revision - $loop`
3538 loop=`expr $loop - 1`
3539 verstring="$verstring_prefix$major.$iface:$verstring"
3540 done
3542 # Before this point, $major must not contain `.'.
3543 major=.$major
3544 versuffix="$major.$revision"
3547 linux)
3548 major=.`expr $current - $age`
3549 versuffix="$major.$age.$revision"
3552 osf)
3553 major=.`expr $current - $age`
3554 versuffix=".$current.$age.$revision"
3555 verstring="$current.$age.$revision"
3557 # Add in all the interfaces that we are compatible with.
3558 loop=$age
3559 while test "$loop" -ne 0; do
3560 iface=`expr $current - $loop`
3561 loop=`expr $loop - 1`
3562 verstring="$verstring:${iface}.0"
3563 done
3565 # Make executables depend on our current version.
3566 verstring="$verstring:${current}.0"
3569 sunos)
3570 major=".$current"
3571 versuffix=".$current.$revision"
3574 windows)
3575 # Use '-' rather than '.', since we only want one
3576 # extension on DOS 8.3 filesystems.
3577 major=`expr $current - $age`
3578 versuffix="-$major"
3582 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3583 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3584 exit $EXIT_FAILURE
3586 esac
3588 # Clear the version info if we defaulted, and they specified a release.
3589 if test -z "$vinfo" && test -n "$release"; then
3590 major=
3591 case $version_type in
3592 darwin)
3593 # we can't check for "0.0" in archive_cmds due to quoting
3594 # problems, so we reset it completely
3595 verstring=
3598 verstring="0.0"
3600 esac
3601 if test "$need_version" = no; then
3602 versuffix=
3603 else
3604 versuffix=".0.0"
3608 # Remove version info from name if versioning should be avoided
3609 if test "$avoid_version" = yes && test "$need_version" = no; then
3610 major=
3611 versuffix=
3612 verstring=""
3615 # Check to see if the archive will have undefined symbols.
3616 if test "$allow_undefined" = yes; then
3617 if test "$allow_undefined_flag" = unsupported; then
3618 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3619 build_libtool_libs=no
3620 build_old_libs=yes
3622 else
3623 # Don't allow undefined symbols.
3624 allow_undefined_flag="$no_undefined_flag"
3628 if test "$mode" != relink; then
3629 # Remove our outputs, but don't remove object files since they
3630 # may have been created when compiling PIC objects.
3631 removelist=
3632 tempremovelist=`$echo "$output_objdir/*"`
3633 for p in $tempremovelist; do
3634 case $p in
3635 *.$objext)
3637 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3638 if test "X$precious_files_regex" != "X"; then
3639 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3640 then
3641 continue
3644 removelist="$removelist $p"
3646 *) ;;
3647 esac
3648 done
3649 if test -n "$removelist"; then
3650 $show "${rm}r $removelist"
3651 $run ${rm}r $removelist
3655 # Now set the variables for building old libraries.
3656 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3657 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3659 # Transform .lo files to .o files.
3660 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3663 # Eliminate all temporary directories.
3664 for path in $notinst_path; do
3665 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3666 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3667 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3668 done
3670 if test -n "$xrpath"; then
3671 # If the user specified any rpath flags, then add them.
3672 temp_xrpath=
3673 for libdir in $xrpath; do
3674 temp_xrpath="$temp_xrpath -R$libdir"
3675 case "$finalize_rpath " in
3676 *" $libdir "*) ;;
3677 *) finalize_rpath="$finalize_rpath $libdir" ;;
3678 esac
3679 done
3680 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3681 dependency_libs="$temp_xrpath $dependency_libs"
3685 # Make sure dlfiles contains only unique files that won't be dlpreopened
3686 old_dlfiles="$dlfiles"
3687 dlfiles=
3688 for lib in $old_dlfiles; do
3689 case " $dlprefiles $dlfiles " in
3690 *" $lib "*) ;;
3691 *) dlfiles="$dlfiles $lib" ;;
3692 esac
3693 done
3695 # Make sure dlprefiles contains only unique files
3696 old_dlprefiles="$dlprefiles"
3697 dlprefiles=
3698 for lib in $old_dlprefiles; do
3699 case "$dlprefiles " in
3700 *" $lib "*) ;;
3701 *) dlprefiles="$dlprefiles $lib" ;;
3702 esac
3703 done
3705 if test "$build_libtool_libs" = yes; then
3706 if test -n "$rpath"; then
3707 case $host in
3708 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3709 # these systems don't actually have a c library (as such)!
3711 *-*-rhapsody* | *-*-darwin1.[012])
3712 # Rhapsody C library is in the System framework
3713 deplibs="$deplibs -framework System"
3715 *-*-netbsd*)
3716 # Don't link with libc until the a.out ld.so is fixed.
3718 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3719 # Do not include libc due to us having libc/libc_r.
3720 test "X$arg" = "X-lc" && continue
3723 # Add libc to deplibs on all other systems if necessary.
3724 if test "$build_libtool_need_lc" = "yes"; then
3725 deplibs="$deplibs -lc"
3728 esac
3731 # Transform deplibs into only deplibs that can be linked in shared.
3732 name_save=$name
3733 libname_save=$libname
3734 release_save=$release
3735 versuffix_save=$versuffix
3736 major_save=$major
3737 # I'm not sure if I'm treating the release correctly. I think
3738 # release should show up in the -l (ie -lgmp5) so we don't want to
3739 # add it in twice. Is that correct?
3740 release=""
3741 versuffix=""
3742 major=""
3743 newdeplibs=
3744 droppeddeps=no
3745 case $deplibs_check_method in
3746 pass_all)
3747 # Don't check for shared/static. Everything works.
3748 # This might be a little naive. We might want to check
3749 # whether the library exists or not. But this is on
3750 # osf3 & osf4 and I'm not really sure... Just
3751 # implementing what was already the behavior.
3752 newdeplibs=$deplibs
3754 test_compile)
3755 # This code stresses the "libraries are programs" paradigm to its
3756 # limits. Maybe even breaks it. We compile a program, linking it
3757 # against the deplibs as a proxy for the library. Then we can check
3758 # whether they linked in statically or dynamically with ldd.
3759 $rm conftest.c
3760 cat > conftest.c <<EOF
3761 int main() { return 0; }
3763 $rm conftest
3764 $LTCC -o conftest conftest.c $deplibs
3765 if test "$?" -eq 0 ; then
3766 ldd_output=`ldd conftest`
3767 for i in $deplibs; do
3768 name="`expr $i : '-l\(.*\)'`"
3769 # If $name is empty we are operating on a -L argument.
3770 if test "$name" != "" && test "$name" -ne "0"; then
3771 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3772 case " $predeps $postdeps " in
3773 *" $i "*)
3774 newdeplibs="$newdeplibs $i"
3775 i=""
3777 esac
3779 if test -n "$i" ; then
3780 libname=`eval \\$echo \"$libname_spec\"`
3781 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3782 set dummy $deplib_matches
3783 deplib_match=$2
3784 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3785 newdeplibs="$newdeplibs $i"
3786 else
3787 droppeddeps=yes
3788 $echo
3789 $echo "*** Warning: dynamic linker does not accept needed library $i."
3790 $echo "*** I have the capability to make that library automatically link in when"
3791 $echo "*** you link to this library. But I can only do this if you have a"
3792 $echo "*** shared version of the library, which I believe you do not have"
3793 $echo "*** because a test_compile did reveal that the linker did not use it for"
3794 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3797 else
3798 newdeplibs="$newdeplibs $i"
3800 done
3801 else
3802 # Error occurred in the first compile. Let's try to salvage
3803 # the situation: Compile a separate program for each library.
3804 for i in $deplibs; do
3805 name="`expr $i : '-l\(.*\)'`"
3806 # If $name is empty we are operating on a -L argument.
3807 if test "$name" != "" && test "$name" != "0"; then
3808 $rm conftest
3809 $LTCC -o conftest conftest.c $i
3810 # Did it work?
3811 if test "$?" -eq 0 ; then
3812 ldd_output=`ldd conftest`
3813 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3814 case " $predeps $postdeps " in
3815 *" $i "*)
3816 newdeplibs="$newdeplibs $i"
3817 i=""
3819 esac
3821 if test -n "$i" ; then
3822 libname=`eval \\$echo \"$libname_spec\"`
3823 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3824 set dummy $deplib_matches
3825 deplib_match=$2
3826 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3827 newdeplibs="$newdeplibs $i"
3828 else
3829 droppeddeps=yes
3830 $echo
3831 $echo "*** Warning: dynamic linker does not accept needed library $i."
3832 $echo "*** I have the capability to make that library automatically link in when"
3833 $echo "*** you link to this library. But I can only do this if you have a"
3834 $echo "*** shared version of the library, which you do not appear to have"
3835 $echo "*** because a test_compile did reveal that the linker did not use this one"
3836 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3839 else
3840 droppeddeps=yes
3841 $echo
3842 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3843 $echo "*** make it link in! You will probably need to install it or some"
3844 $echo "*** library that it depends on before this library will be fully"
3845 $echo "*** functional. Installing it before continuing would be even better."
3847 else
3848 newdeplibs="$newdeplibs $i"
3850 done
3853 file_magic*)
3854 set dummy $deplibs_check_method
3855 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3856 for a_deplib in $deplibs; do
3857 name="`expr $a_deplib : '-l\(.*\)'`"
3858 # If $name is empty we are operating on a -L argument.
3859 if test "$name" != "" && test "$name" != "0"; then
3860 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3861 case " $predeps $postdeps " in
3862 *" $a_deplib "*)
3863 newdeplibs="$newdeplibs $a_deplib"
3864 a_deplib=""
3866 esac
3868 if test -n "$a_deplib" ; then
3869 libname=`eval \\$echo \"$libname_spec\"`
3870 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3871 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3872 for potent_lib in $potential_libs; do
3873 # Follow soft links.
3874 if ls -lLd "$potent_lib" 2>/dev/null \
3875 | grep " -> " >/dev/null; then
3876 continue
3878 # The statement above tries to avoid entering an
3879 # endless loop below, in case of cyclic links.
3880 # We might still enter an endless loop, since a link
3881 # loop can be closed while we follow links,
3882 # but so what?
3883 potlib="$potent_lib"
3884 while test -h "$potlib" 2>/dev/null; do
3885 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3886 case $potliblink in
3887 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3888 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3889 esac
3890 done
3891 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3892 | ${SED} 10q \
3893 | $EGREP "$file_magic_regex" > /dev/null; then
3894 newdeplibs="$newdeplibs $a_deplib"
3895 a_deplib=""
3896 break 2
3898 done
3899 done
3901 if test -n "$a_deplib" ; then
3902 droppeddeps=yes
3903 $echo
3904 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3905 $echo "*** I have the capability to make that library automatically link in when"
3906 $echo "*** you link to this library. But I can only do this if you have a"
3907 $echo "*** shared version of the library, which you do not appear to have"
3908 $echo "*** because I did check the linker path looking for a file starting"
3909 if test -z "$potlib" ; then
3910 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3911 else
3912 $echo "*** with $libname and none of the candidates passed a file format test"
3913 $echo "*** using a file magic. Last file checked: $potlib"
3916 else
3917 # Add a -L argument.
3918 newdeplibs="$newdeplibs $a_deplib"
3920 done # Gone through all deplibs.
3922 match_pattern*)
3923 set dummy $deplibs_check_method
3924 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3925 for a_deplib in $deplibs; do
3926 name="`expr $a_deplib : '-l\(.*\)'`"
3927 # If $name is empty we are operating on a -L argument.
3928 if test -n "$name" && test "$name" != "0"; then
3929 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3930 case " $predeps $postdeps " in
3931 *" $a_deplib "*)
3932 newdeplibs="$newdeplibs $a_deplib"
3933 a_deplib=""
3935 esac
3937 if test -n "$a_deplib" ; then
3938 libname=`eval \\$echo \"$libname_spec\"`
3939 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3940 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3941 for potent_lib in $potential_libs; do
3942 potlib="$potent_lib" # see symlink-check above in file_magic test
3943 if eval $echo \"$potent_lib\" 2>/dev/null \
3944 | ${SED} 10q \
3945 | $EGREP "$match_pattern_regex" > /dev/null; then
3946 newdeplibs="$newdeplibs $a_deplib"
3947 a_deplib=""
3948 break 2
3950 done
3951 done
3953 if test -n "$a_deplib" ; then
3954 droppeddeps=yes
3955 $echo
3956 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3957 $echo "*** I have the capability to make that library automatically link in when"
3958 $echo "*** you link to this library. But I can only do this if you have a"
3959 $echo "*** shared version of the library, which you do not appear to have"
3960 $echo "*** because I did check the linker path looking for a file starting"
3961 if test -z "$potlib" ; then
3962 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3963 else
3964 $echo "*** with $libname and none of the candidates passed a file format test"
3965 $echo "*** using a regex pattern. Last file checked: $potlib"
3968 else
3969 # Add a -L argument.
3970 newdeplibs="$newdeplibs $a_deplib"
3972 done # Gone through all deplibs.
3974 none | unknown | *)
3975 newdeplibs=""
3976 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3977 -e 's/ -[LR][^ ]*//g'`
3978 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3979 for i in $predeps $postdeps ; do
3980 # can't use Xsed below, because $i might contain '/'
3981 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3982 done
3984 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3985 | grep . >/dev/null; then
3986 $echo
3987 if test "X$deplibs_check_method" = "Xnone"; then
3988 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3989 else
3990 $echo "*** Warning: inter-library dependencies are not known to be supported."
3992 $echo "*** All declared inter-library dependencies are being dropped."
3993 droppeddeps=yes
3996 esac
3997 versuffix=$versuffix_save
3998 major=$major_save
3999 release=$release_save
4000 libname=$libname_save
4001 name=$name_save
4003 case $host in
4004 *-*-rhapsody* | *-*-darwin1.[012])
4005 # On Rhapsody replace the C library is the System framework
4006 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4008 esac
4010 if test "$droppeddeps" = yes; then
4011 if test "$module" = yes; then
4012 $echo
4013 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4014 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4015 $echo "*** a static module, that should work as long as the dlopening"
4016 $echo "*** application is linked with the -dlopen flag."
4017 if test -z "$global_symbol_pipe"; then
4018 $echo
4019 $echo "*** However, this would only work if libtool was able to extract symbol"
4020 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4021 $echo "*** not find such a program. So, this module is probably useless."
4022 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4024 if test "$build_old_libs" = no; then
4025 oldlibs="$output_objdir/$libname.$libext"
4026 build_libtool_libs=module
4027 build_old_libs=yes
4028 else
4029 build_libtool_libs=no
4031 else
4032 $echo "*** The inter-library dependencies that have been dropped here will be"
4033 $echo "*** automatically added whenever a program is linked with this library"
4034 $echo "*** or is declared to -dlopen it."
4036 if test "$allow_undefined" = no; then
4037 $echo
4038 $echo "*** Since this library must not contain undefined symbols,"
4039 $echo "*** because either the platform does not support them or"
4040 $echo "*** it was explicitly requested with -no-undefined,"
4041 $echo "*** libtool will only create a static version of it."
4042 if test "$build_old_libs" = no; then
4043 oldlibs="$output_objdir/$libname.$libext"
4044 build_libtool_libs=module
4045 build_old_libs=yes
4046 else
4047 build_libtool_libs=no
4052 # Done checking deplibs!
4053 deplibs=$newdeplibs
4056 # All the library-specific variables (install_libdir is set above).
4057 library_names=
4058 old_library=
4059 dlname=
4061 # Test again, we may have decided not to build it any more
4062 if test "$build_libtool_libs" = yes; then
4063 if test "$hardcode_into_libs" = yes; then
4064 # Hardcode the library paths
4065 hardcode_libdirs=
4066 dep_rpath=
4067 rpath="$finalize_rpath"
4068 test "$mode" != relink && rpath="$compile_rpath$rpath"
4069 for libdir in $rpath; do
4070 if test -n "$hardcode_libdir_flag_spec"; then
4071 if test -n "$hardcode_libdir_separator"; then
4072 if test -z "$hardcode_libdirs"; then
4073 hardcode_libdirs="$libdir"
4074 else
4075 # Just accumulate the unique libdirs.
4076 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4077 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4080 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4082 esac
4084 else
4085 eval flag=\"$hardcode_libdir_flag_spec\"
4086 dep_rpath="$dep_rpath $flag"
4088 elif test -n "$runpath_var"; then
4089 case "$perm_rpath " in
4090 *" $libdir "*) ;;
4091 *) perm_rpath="$perm_rpath $libdir" ;;
4092 esac
4094 done
4095 # Substitute the hardcoded libdirs into the rpath.
4096 if test -n "$hardcode_libdir_separator" &&
4097 test -n "$hardcode_libdirs"; then
4098 libdir="$hardcode_libdirs"
4099 if test -n "$hardcode_libdir_flag_spec_ld"; then
4100 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
4101 else
4102 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4105 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4106 # We should set the runpath_var.
4107 rpath=
4108 for dir in $perm_rpath; do
4109 rpath="$rpath$dir:"
4110 done
4111 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4113 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4116 shlibpath="$finalize_shlibpath"
4117 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4118 if test -n "$shlibpath"; then
4119 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4122 # Get the real and link names of the library.
4123 eval shared_ext=\"$shrext_cmds\"
4124 eval library_names=\"$library_names_spec\"
4125 set dummy $library_names
4126 realname="$2"
4127 shift; shift
4129 if test -n "$soname_spec"; then
4130 eval soname=\"$soname_spec\"
4131 else
4132 soname="$realname"
4134 if test -z "$dlname"; then
4135 dlname=$soname
4138 lib="$output_objdir/$realname"
4139 for link
4141 linknames="$linknames $link"
4142 done
4144 # Use standard objects if they are pic
4145 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4147 # Prepare the list of exported symbols
4148 if test -z "$export_symbols"; then
4149 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4150 $show "generating symbol list for \`$libname.la'"
4151 export_symbols="$output_objdir/$libname.exp"
4152 $run $rm $export_symbols
4153 cmds=$export_symbols_cmds
4154 save_ifs="$IFS"; IFS='~'
4155 for cmd in $cmds; do
4156 IFS="$save_ifs"
4157 eval cmd=\"$cmd\"
4158 if len=`expr "X$cmd" : ".*"` &&
4159 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4160 $show "$cmd"
4161 $run eval "$cmd" || exit $?
4162 skipped_export=false
4163 else
4164 # The command line is too long to execute in one step.
4165 $show "using reloadable object file for export list..."
4166 skipped_export=:
4168 done
4169 IFS="$save_ifs"
4170 if test -n "$export_symbols_regex"; then
4171 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4172 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4173 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4174 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4179 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4180 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4183 tmp_deplibs=
4184 for test_deplib in $deplibs; do
4185 case " $convenience " in
4186 *" $test_deplib "*) ;;
4188 tmp_deplibs="$tmp_deplibs $test_deplib"
4190 esac
4191 done
4192 deplibs="$tmp_deplibs"
4194 if test -n "$convenience"; then
4195 if test -n "$whole_archive_flag_spec"; then
4196 save_libobjs=$libobjs
4197 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4198 else
4199 gentop="$output_objdir/${outputname}x"
4200 generated="$generated $gentop"
4202 func_extract_archives $gentop $convenience
4203 libobjs="$libobjs $func_extract_archives_result"
4207 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4208 eval flag=\"$thread_safe_flag_spec\"
4209 linker_flags="$linker_flags $flag"
4212 # Make a backup of the uninstalled library when relinking
4213 if test "$mode" = relink; then
4214 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4217 # Do each of the archive commands.
4218 if test "$module" = yes && test -n "$module_cmds" ; then
4219 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4220 eval test_cmds=\"$module_expsym_cmds\"
4221 cmds=$module_expsym_cmds
4222 else
4223 eval test_cmds=\"$module_cmds\"
4224 cmds=$module_cmds
4226 else
4227 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4228 eval test_cmds=\"$archive_expsym_cmds\"
4229 cmds=$archive_expsym_cmds
4230 else
4231 eval test_cmds=\"$archive_cmds\"
4232 cmds=$archive_cmds
4236 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4237 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4239 else
4240 # The command line is too long to link in one step, link piecewise.
4241 $echo "creating reloadable object files..."
4243 # Save the value of $output and $libobjs because we want to
4244 # use them later. If we have whole_archive_flag_spec, we
4245 # want to use save_libobjs as it was before
4246 # whole_archive_flag_spec was expanded, because we can't
4247 # assume the linker understands whole_archive_flag_spec.
4248 # This may have to be revisited, in case too many
4249 # convenience libraries get linked in and end up exceeding
4250 # the spec.
4251 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4252 save_libobjs=$libobjs
4254 save_output=$output
4255 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4257 # Clear the reloadable object creation command queue and
4258 # initialize k to one.
4259 test_cmds=
4260 concat_cmds=
4261 objlist=
4262 delfiles=
4263 last_robj=
4265 output=$output_objdir/$output_la-${k}.$objext
4266 # Loop over the list of objects to be linked.
4267 for obj in $save_libobjs
4269 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4270 if test "X$objlist" = X ||
4271 { len=`expr "X$test_cmds" : ".*"` &&
4272 test "$len" -le "$max_cmd_len"; }; then
4273 objlist="$objlist $obj"
4274 else
4275 # The command $test_cmds is almost too long, add a
4276 # command to the queue.
4277 if test "$k" -eq 1 ; then
4278 # The first file doesn't have a previous command to add.
4279 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4280 else
4281 # All subsequent reloadable object files will link in
4282 # the last one created.
4283 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4285 last_robj=$output_objdir/$output_la-${k}.$objext
4286 k=`expr $k + 1`
4287 output=$output_objdir/$output_la-${k}.$objext
4288 objlist=$obj
4289 len=1
4291 done
4292 # Handle the remaining objects by creating one last
4293 # reloadable object file. All subsequent reloadable object
4294 # files will link in the last one created.
4295 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4296 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4298 if ${skipped_export-false}; then
4299 $show "generating symbol list for \`$libname.la'"
4300 export_symbols="$output_objdir/$libname.exp"
4301 $run $rm $export_symbols
4302 libobjs=$output
4303 # Append the command to create the export file.
4304 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4307 # Set up a command to remove the reloadable object files
4308 # after they are used.
4310 while test "$i" -lt "$k"
4312 i=`expr $i + 1`
4313 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4314 done
4316 $echo "creating a temporary reloadable object file: $output"
4318 # Loop through the commands generated above and execute them.
4319 save_ifs="$IFS"; IFS='~'
4320 for cmd in $concat_cmds; do
4321 IFS="$save_ifs"
4322 $show "$cmd"
4323 $run eval "$cmd" || exit $?
4324 done
4325 IFS="$save_ifs"
4327 libobjs=$output
4328 # Restore the value of output.
4329 output=$save_output
4331 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4332 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4334 # Expand the library linking commands again to reset the
4335 # value of $libobjs for piecewise linking.
4337 # Do each of the archive commands.
4338 if test "$module" = yes && test -n "$module_cmds" ; then
4339 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4340 cmds=$module_expsym_cmds
4341 else
4342 cmds=$module_cmds
4344 else
4345 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4346 cmds=$archive_expsym_cmds
4347 else
4348 cmds=$archive_cmds
4352 # Append the command to remove the reloadable object files
4353 # to the just-reset $cmds.
4354 eval cmds=\"\$cmds~\$rm $delfiles\"
4356 save_ifs="$IFS"; IFS='~'
4357 for cmd in $cmds; do
4358 IFS="$save_ifs"
4359 eval cmd=\"$cmd\"
4360 $show "$cmd"
4361 $run eval "$cmd" || exit $?
4362 done
4363 IFS="$save_ifs"
4365 # Restore the uninstalled library and exit
4366 if test "$mode" = relink; then
4367 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4368 exit $EXIT_SUCCESS
4371 # Create links to the real library.
4372 for linkname in $linknames; do
4373 if test "$realname" != "$linkname"; then
4374 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4375 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4377 done
4379 # If -module or -export-dynamic was specified, set the dlname.
4380 if test "$module" = yes || test "$export_dynamic" = yes; then
4381 # On all known operating systems, these are identical.
4382 dlname="$soname"
4387 obj)
4388 if test -n "$deplibs"; then
4389 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4392 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4393 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4396 if test -n "$rpath"; then
4397 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4400 if test -n "$xrpath"; then
4401 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4404 if test -n "$vinfo"; then
4405 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4408 if test -n "$release"; then
4409 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4412 case $output in
4413 *.lo)
4414 if test -n "$objs$old_deplibs"; then
4415 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4416 exit $EXIT_FAILURE
4418 libobj="$output"
4419 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4422 libobj=
4423 obj="$output"
4425 esac
4427 # Delete the old objects.
4428 $run $rm $obj $libobj
4430 # Objects from convenience libraries. This assumes
4431 # single-version convenience libraries. Whenever we create
4432 # different ones for PIC/non-PIC, this we'll have to duplicate
4433 # the extraction.
4434 reload_conv_objs=
4435 gentop=
4436 # reload_cmds runs $LD directly, so let us get rid of
4437 # -Wl from whole_archive_flag_spec
4440 if test -n "$convenience"; then
4441 if test -n "$whole_archive_flag_spec"; then
4442 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4443 else
4444 gentop="$output_objdir/${obj}x"
4445 generated="$generated $gentop"
4447 func_extract_archives $gentop $convenience
4448 reload_conv_objs="$reload_objs $func_extract_archives_result"
4452 # Create the old-style object.
4453 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
4455 output="$obj"
4456 cmds=$reload_cmds
4457 save_ifs="$IFS"; IFS='~'
4458 for cmd in $cmds; do
4459 IFS="$save_ifs"
4460 eval cmd=\"$cmd\"
4461 $show "$cmd"
4462 $run eval "$cmd" || exit $?
4463 done
4464 IFS="$save_ifs"
4466 # Exit if we aren't doing a library object file.
4467 if test -z "$libobj"; then
4468 if test -n "$gentop"; then
4469 $show "${rm}r $gentop"
4470 $run ${rm}r $gentop
4473 exit $EXIT_SUCCESS
4476 if test "$build_libtool_libs" != yes; then
4477 if test -n "$gentop"; then
4478 $show "${rm}r $gentop"
4479 $run ${rm}r $gentop
4482 # Create an invalid libtool object if no PIC, so that we don't
4483 # accidentally link it into a program.
4484 # $show "echo timestamp > $libobj"
4485 # $run eval "echo timestamp > $libobj" || exit $?
4486 exit $EXIT_SUCCESS
4489 if test -n "$pic_flag" || test "$pic_mode" != default; then
4490 # Only do commands if we really have different PIC objects.
4491 reload_objs="$libobjs $reload_conv_objs"
4492 output="$libobj"
4493 cmds=$reload_cmds
4494 save_ifs="$IFS"; IFS='~'
4495 for cmd in $cmds; do
4496 IFS="$save_ifs"
4497 eval cmd=\"$cmd\"
4498 $show "$cmd"
4499 $run eval "$cmd" || exit $?
4500 done
4501 IFS="$save_ifs"
4504 if test -n "$gentop"; then
4505 $show "${rm}r $gentop"
4506 $run ${rm}r $gentop
4509 exit $EXIT_SUCCESS
4512 prog)
4513 case $host in
4514 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4515 esac
4516 if test -n "$vinfo"; then
4517 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4520 if test -n "$release"; then
4521 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4524 if test "$preload" = yes; then
4525 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4526 test "$dlopen_self_static" = unknown; then
4527 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4531 case $host in
4532 *-*-rhapsody* | *-*-darwin1.[012])
4533 # On Rhapsody replace the C library is the System framework
4534 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4535 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4537 esac
4539 case $host in
4540 *darwin*)
4541 # Don't allow lazy linking, it breaks C++ global constructors
4542 if test "$tagname" = CXX ; then
4543 compile_command="$compile_command ${wl}-bind_at_load"
4544 finalize_command="$finalize_command ${wl}-bind_at_load"
4547 esac
4549 compile_command="$compile_command $compile_deplibs"
4550 finalize_command="$finalize_command $finalize_deplibs"
4552 if test -n "$rpath$xrpath"; then
4553 # If the user specified any rpath flags, then add them.
4554 for libdir in $rpath $xrpath; do
4555 # This is the magic to use -rpath.
4556 case "$finalize_rpath " in
4557 *" $libdir "*) ;;
4558 *) finalize_rpath="$finalize_rpath $libdir" ;;
4559 esac
4560 done
4563 # Now hardcode the library paths
4564 rpath=
4565 hardcode_libdirs=
4566 for libdir in $compile_rpath $finalize_rpath; do
4567 if test -n "$hardcode_libdir_flag_spec"; then
4568 if test -n "$hardcode_libdir_separator"; then
4569 if test -z "$hardcode_libdirs"; then
4570 hardcode_libdirs="$libdir"
4571 else
4572 # Just accumulate the unique libdirs.
4573 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4574 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4577 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4579 esac
4581 else
4582 eval flag=\"$hardcode_libdir_flag_spec\"
4583 rpath="$rpath $flag"
4585 elif test -n "$runpath_var"; then
4586 case "$perm_rpath " in
4587 *" $libdir "*) ;;
4588 *) perm_rpath="$perm_rpath $libdir" ;;
4589 esac
4591 case $host in
4592 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4593 case :$dllsearchpath: in
4594 *":$libdir:"*) ;;
4595 *) dllsearchpath="$dllsearchpath:$libdir";;
4596 esac
4598 esac
4599 done
4600 # Substitute the hardcoded libdirs into the rpath.
4601 if test -n "$hardcode_libdir_separator" &&
4602 test -n "$hardcode_libdirs"; then
4603 libdir="$hardcode_libdirs"
4604 eval rpath=\" $hardcode_libdir_flag_spec\"
4606 compile_rpath="$rpath"
4608 rpath=
4609 hardcode_libdirs=
4610 for libdir in $finalize_rpath; do
4611 if test -n "$hardcode_libdir_flag_spec"; then
4612 if test -n "$hardcode_libdir_separator"; then
4613 if test -z "$hardcode_libdirs"; then
4614 hardcode_libdirs="$libdir"
4615 else
4616 # Just accumulate the unique libdirs.
4617 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4618 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4621 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4623 esac
4625 else
4626 eval flag=\"$hardcode_libdir_flag_spec\"
4627 rpath="$rpath $flag"
4629 elif test -n "$runpath_var"; then
4630 case "$finalize_perm_rpath " in
4631 *" $libdir "*) ;;
4632 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4633 esac
4635 done
4636 # Substitute the hardcoded libdirs into the rpath.
4637 if test -n "$hardcode_libdir_separator" &&
4638 test -n "$hardcode_libdirs"; then
4639 libdir="$hardcode_libdirs"
4640 eval rpath=\" $hardcode_libdir_flag_spec\"
4642 finalize_rpath="$rpath"
4644 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4645 # Transform all the library objects into standard objects.
4646 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4647 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4650 dlsyms=
4651 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4652 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4653 dlsyms="${outputname}S.c"
4654 else
4655 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4659 if test -n "$dlsyms"; then
4660 case $dlsyms in
4661 "") ;;
4662 *.c)
4663 # Discover the nlist of each of the dlfiles.
4664 nlist="$output_objdir/${outputname}.nm"
4666 $show "$rm $nlist ${nlist}S ${nlist}T"
4667 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4669 # Parse the name list into a source file.
4670 $show "creating $output_objdir/$dlsyms"
4672 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4673 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4674 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4676 #ifdef __cplusplus
4677 extern \"C\" {
4678 #endif
4680 /* Prevent the only kind of declaration conflicts we can make. */
4681 #define lt_preloaded_symbols some_other_symbol
4683 /* External symbol declarations for the compiler. */\
4686 if test "$dlself" = yes; then
4687 $show "generating symbol list for \`$output'"
4689 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4691 # Add our own program objects to the symbol list.
4692 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4693 for arg in $progfiles; do
4694 $show "extracting global C symbols from \`$arg'"
4695 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4696 done
4698 if test -n "$exclude_expsyms"; then
4699 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4700 $run eval '$mv "$nlist"T "$nlist"'
4703 if test -n "$export_symbols_regex"; then
4704 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4705 $run eval '$mv "$nlist"T "$nlist"'
4708 # Prepare the list of exported symbols
4709 if test -z "$export_symbols"; then
4710 export_symbols="$output_objdir/$outputname.exp"
4711 $run $rm $export_symbols
4712 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4713 else
4714 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4715 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4716 $run eval 'mv "$nlist"T "$nlist"'
4720 for arg in $dlprefiles; do
4721 $show "extracting global C symbols from \`$arg'"
4722 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4723 $run eval '$echo ": $name " >> "$nlist"'
4724 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4725 done
4727 if test -z "$run"; then
4728 # Make sure we have at least an empty file.
4729 test -f "$nlist" || : > "$nlist"
4731 if test -n "$exclude_expsyms"; then
4732 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4733 $mv "$nlist"T "$nlist"
4736 # Try sorting and uniquifying the output.
4737 if grep -v "^: " < "$nlist" |
4738 if sort -k 3 </dev/null >/dev/null 2>&1; then
4739 sort -k 3
4740 else
4741 sort +2
4742 fi |
4743 uniq > "$nlist"S; then
4745 else
4746 grep -v "^: " < "$nlist" > "$nlist"S
4749 if test -f "$nlist"S; then
4750 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4751 else
4752 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4755 $echo >> "$output_objdir/$dlsyms" "\
4757 #undef lt_preloaded_symbols
4759 #if defined (__STDC__) && __STDC__
4760 # define lt_ptr void *
4761 #else
4762 # define lt_ptr char *
4763 # define const
4764 #endif
4766 /* The mapping between symbol names and symbols. */
4769 case $host in
4770 *cygwin* | *mingw* )
4771 $echo >> "$output_objdir/$dlsyms" "\
4772 /* DATA imports from DLLs on WIN32 can't be const, because
4773 runtime relocations are performed -- see ld's documentation
4774 on pseudo-relocs */
4775 struct {
4779 $echo >> "$output_objdir/$dlsyms" "\
4780 const struct {
4783 esac
4786 $echo >> "$output_objdir/$dlsyms" "\
4787 const char *name;
4788 lt_ptr address;
4790 lt_preloaded_symbols[] =
4794 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4796 $echo >> "$output_objdir/$dlsyms" "\
4797 {0, (lt_ptr) 0}
4800 /* This works around a problem in FreeBSD linker */
4801 #ifdef FREEBSD_WORKAROUND
4802 static const void *lt_preloaded_setup() {
4803 return lt_preloaded_symbols;
4805 #endif
4807 #ifdef __cplusplus
4809 #endif\
4813 pic_flag_for_symtable=
4814 case $host in
4815 # compiling the symbol table file with pic_flag works around
4816 # a FreeBSD bug that causes programs to crash when -lm is
4817 # linked before any other PIC object. But we must not use
4818 # pic_flag when linking with -static. The problem exists in
4819 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4820 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4821 case "$compile_command " in
4822 *" -static "*) ;;
4823 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4824 esac;;
4825 *-*-hpux*)
4826 case "$compile_command " in
4827 *" -static "*) ;;
4828 *) pic_flag_for_symtable=" $pic_flag";;
4829 esac
4830 esac
4832 # Now compile the dynamic symbol file.
4833 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4834 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4836 # Clean up the generated files.
4837 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4838 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4840 # Transform the symbol file into the correct name.
4841 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4842 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4845 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4846 exit $EXIT_FAILURE
4848 esac
4849 else
4850 # We keep going just in case the user didn't refer to
4851 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4852 # really was required.
4854 # Nullify the symbol file.
4855 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4856 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4859 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4860 # Replace the output file specification.
4861 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4862 link_command="$compile_command$compile_rpath"
4864 # We have no uninstalled library dependencies, so finalize right now.
4865 $show "$link_command"
4866 $run eval "$link_command"
4867 status=$?
4869 # Delete the generated files.
4870 if test -n "$dlsyms"; then
4871 $show "$rm $output_objdir/${outputname}S.${objext}"
4872 $run $rm "$output_objdir/${outputname}S.${objext}"
4875 exit $status
4878 if test -n "$shlibpath_var"; then
4879 # We should set the shlibpath_var
4880 rpath=
4881 for dir in $temp_rpath; do
4882 case $dir in
4883 [\\/]* | [A-Za-z]:[\\/]*)
4884 # Absolute path.
4885 rpath="$rpath$dir:"
4888 # Relative path: add a thisdir entry.
4889 rpath="$rpath\$thisdir/$dir:"
4891 esac
4892 done
4893 temp_rpath="$rpath"
4896 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4897 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4899 if test -n "$finalize_shlibpath"; then
4900 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4903 compile_var=
4904 finalize_var=
4905 if test -n "$runpath_var"; then
4906 if test -n "$perm_rpath"; then
4907 # We should set the runpath_var.
4908 rpath=
4909 for dir in $perm_rpath; do
4910 rpath="$rpath$dir:"
4911 done
4912 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4914 if test -n "$finalize_perm_rpath"; then
4915 # We should set the runpath_var.
4916 rpath=
4917 for dir in $finalize_perm_rpath; do
4918 rpath="$rpath$dir:"
4919 done
4920 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4924 if test "$no_install" = yes; then
4925 # We don't need to create a wrapper script.
4926 link_command="$compile_var$compile_command$compile_rpath"
4927 # Replace the output file specification.
4928 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4929 # Delete the old output file.
4930 $run $rm $output
4931 # Link the executable and exit
4932 $show "$link_command"
4933 $run eval "$link_command" || exit $?
4934 exit $EXIT_SUCCESS
4937 if test "$hardcode_action" = relink; then
4938 # Fast installation is not supported
4939 link_command="$compile_var$compile_command$compile_rpath"
4940 relink_command="$finalize_var$finalize_command$finalize_rpath"
4942 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4943 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4944 else
4945 if test "$fast_install" != no; then
4946 link_command="$finalize_var$compile_command$finalize_rpath"
4947 if test "$fast_install" = yes; then
4948 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4949 else
4950 # fast_install is set to needless
4951 relink_command=
4953 else
4954 link_command="$compile_var$compile_command$compile_rpath"
4955 relink_command="$finalize_var$finalize_command$finalize_rpath"
4959 # Replace the output file specification.
4960 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4962 # Delete the old output files.
4963 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4965 $show "$link_command"
4966 $run eval "$link_command" || exit $?
4968 # Now create the wrapper script.
4969 $show "creating $output"
4971 # Quote the relink command for shipping.
4972 if test -n "$relink_command"; then
4973 # Preserve any variables that may affect compiler behavior
4974 for var in $variables_saved_for_relink; do
4975 if eval test -z \"\${$var+set}\"; then
4976 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4977 elif eval var_value=\$$var; test -z "$var_value"; then
4978 relink_command="$var=; export $var; $relink_command"
4979 else
4980 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4981 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4983 done
4984 relink_command="(cd `pwd`; $relink_command)"
4985 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4988 # Quote $echo for shipping.
4989 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4990 case $progpath in
4991 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4992 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4993 esac
4994 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4995 else
4996 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4999 # Only actually do things if our run command is non-null.
5000 if test -z "$run"; then
5001 # win32 will think the script is a binary if it has
5002 # a .exe suffix, so we strip it off here.
5003 case $output in
5004 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5005 esac
5006 # test for cygwin because mv fails w/o .exe extensions
5007 case $host in
5008 *cygwin*)
5009 exeext=.exe
5010 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5011 *) exeext= ;;
5012 esac
5013 case $host in
5014 *cygwin* | *mingw* )
5015 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
5016 cwrapper=`$echo ${output}.exe`
5017 $rm $cwrappersource $cwrapper
5018 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5020 cat > $cwrappersource <<EOF
5022 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5023 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5025 The $output program cannot be directly executed until all the libtool
5026 libraries that it depends on are installed.
5028 This wrapper executable should never be moved out of the build directory.
5029 If it is, it will not operate correctly.
5031 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5032 but could eventually absorb all of the scripts functionality and
5033 exec $objdir/$outputname directly.
5036 cat >> $cwrappersource<<"EOF"
5037 #include <stdio.h>
5038 #include <stdlib.h>
5039 #include <unistd.h>
5040 #include <malloc.h>
5041 #include <stdarg.h>
5042 #include <assert.h>
5044 #if defined(PATH_MAX)
5045 # define LT_PATHMAX PATH_MAX
5046 #elif defined(MAXPATHLEN)
5047 # define LT_PATHMAX MAXPATHLEN
5048 #else
5049 # define LT_PATHMAX 1024
5050 #endif
5052 #ifndef DIR_SEPARATOR
5053 #define DIR_SEPARATOR '/'
5054 #endif
5056 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5057 defined (__OS2__)
5058 #define HAVE_DOS_BASED_FILE_SYSTEM
5059 #ifndef DIR_SEPARATOR_2
5060 #define DIR_SEPARATOR_2 '\\'
5061 #endif
5062 #endif
5064 #ifndef DIR_SEPARATOR_2
5065 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5066 #else /* DIR_SEPARATOR_2 */
5067 # define IS_DIR_SEPARATOR(ch) \
5068 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5069 #endif /* DIR_SEPARATOR_2 */
5071 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5072 #define XFREE(stale) do { \
5073 if (stale) { free ((void *) stale); stale = 0; } \
5074 } while (0)
5076 const char *program_name = NULL;
5078 void * xmalloc (size_t num);
5079 char * xstrdup (const char *string);
5080 char * basename (const char *name);
5081 char * fnqualify(const char *path);
5082 char * strendzap(char *str, const char *pat);
5083 void lt_fatal (const char *message, ...);
5086 main (int argc, char *argv[])
5088 char **newargz;
5089 int i;
5091 program_name = (char *) xstrdup ((char *) basename (argv[0]));
5092 newargz = XMALLOC(char *, argc+2);
5095 cat >> $cwrappersource <<EOF
5096 newargz[0] = "$SHELL";
5099 cat >> $cwrappersource <<"EOF"
5100 newargz[1] = fnqualify(argv[0]);
5101 /* we know the script has the same name, without the .exe */
5102 /* so make sure newargz[1] doesn't end in .exe */
5103 strendzap(newargz[1],".exe");
5104 for (i = 1; i < argc; i++)
5105 newargz[i+1] = xstrdup(argv[i]);
5106 newargz[argc+1] = NULL;
5109 cat >> $cwrappersource <<EOF
5110 execv("$SHELL",newargz);
5113 cat >> $cwrappersource <<"EOF"
5116 void *
5117 xmalloc (size_t num)
5119 void * p = (void *) malloc (num);
5120 if (!p)
5121 lt_fatal ("Memory exhausted");
5123 return p;
5126 char *
5127 xstrdup (const char *string)
5129 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5133 char *
5134 basename (const char *name)
5136 const char *base;
5138 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5139 /* Skip over the disk name in MSDOS pathnames. */
5140 if (isalpha (name[0]) && name[1] == ':')
5141 name += 2;
5142 #endif
5144 for (base = name; *name; name++)
5145 if (IS_DIR_SEPARATOR (*name))
5146 base = name + 1;
5147 return (char *) base;
5150 char *
5151 fnqualify(const char *path)
5153 size_t size;
5154 char *p;
5155 char tmp[LT_PATHMAX + 1];
5157 assert(path != NULL);
5159 /* Is it qualified already? */
5160 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5161 if (isalpha (path[0]) && path[1] == ':')
5162 return xstrdup (path);
5163 #endif
5164 if (IS_DIR_SEPARATOR (path[0]))
5165 return xstrdup (path);
5167 /* prepend the current directory */
5168 /* doesn't handle '~' */
5169 if (getcwd (tmp, LT_PATHMAX) == NULL)
5170 lt_fatal ("getcwd failed");
5171 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5172 p = XMALLOC(char, size);
5173 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5174 return p;
5177 char *
5178 strendzap(char *str, const char *pat)
5180 size_t len, patlen;
5182 assert(str != NULL);
5183 assert(pat != NULL);
5185 len = strlen(str);
5186 patlen = strlen(pat);
5188 if (patlen <= len)
5190 str += len - patlen;
5191 if (strcmp(str, pat) == 0)
5192 *str = '\0';
5194 return str;
5197 static void
5198 lt_error_core (int exit_status, const char * mode,
5199 const char * message, va_list ap)
5201 fprintf (stderr, "%s: %s: ", program_name, mode);
5202 vfprintf (stderr, message, ap);
5203 fprintf (stderr, ".\n");
5205 if (exit_status >= 0)
5206 exit (exit_status);
5209 void
5210 lt_fatal (const char *message, ...)
5212 va_list ap;
5213 va_start (ap, message);
5214 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5215 va_end (ap);
5218 # we should really use a build-platform specific compiler
5219 # here, but OTOH, the wrappers (shell script and this C one)
5220 # are only useful if you want to execute the "real" binary.
5221 # Since the "real" binary is built for $host, then this
5222 # wrapper might as well be built for $host, too.
5223 $run $LTCC -s -o $cwrapper $cwrappersource
5225 esac
5226 $rm $output
5227 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5229 $echo > $output "\
5230 #! $SHELL
5232 # $output - temporary wrapper script for $objdir/$outputname
5233 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5235 # The $output program cannot be directly executed until all the libtool
5236 # libraries that it depends on are installed.
5238 # This wrapper script should never be moved out of the build directory.
5239 # If it is, it will not operate correctly.
5241 # Sed substitution that helps us do robust quoting. It backslashifies
5242 # metacharacters that are still active within double-quoted strings.
5243 Xsed='${SED} -e 1s/^X//'
5244 sed_quote_subst='$sed_quote_subst'
5246 # The HP-UX ksh and POSIX shell print the target directory to stdout
5247 # if CDPATH is set.
5248 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5250 relink_command=\"$relink_command\"
5252 # This environment variable determines our operation mode.
5253 if test \"\$libtool_install_magic\" = \"$magic\"; then
5254 # install mode needs the following variable:
5255 notinst_deplibs='$notinst_deplibs'
5256 else
5257 # When we are sourced in execute mode, \$file and \$echo are already set.
5258 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5259 echo=\"$qecho\"
5260 file=\"\$0\"
5261 # Make sure echo works.
5262 if test \"X\$1\" = X--no-reexec; then
5263 # Discard the --no-reexec flag, and continue.
5264 shift
5265 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5266 # Yippee, \$echo works!
5268 else
5269 # Restart under the correct shell, and then maybe \$echo will work.
5270 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5274 $echo >> $output "\
5276 # Find the directory that this script lives in.
5277 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5278 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5280 # Follow symbolic links until we get to the real thisdir.
5281 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5282 while test -n \"\$file\"; do
5283 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5285 # If there was a directory component, then change thisdir.
5286 if test \"x\$destdir\" != \"x\$file\"; then
5287 case \"\$destdir\" in
5288 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5289 *) thisdir=\"\$thisdir/\$destdir\" ;;
5290 esac
5293 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5294 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5295 done
5297 # Try to get the absolute directory name.
5298 absdir=\`cd \"\$thisdir\" && pwd\`
5299 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5302 if test "$fast_install" = yes; then
5303 $echo >> $output "\
5304 program=lt-'$outputname'$exeext
5305 progdir=\"\$thisdir/$objdir\"
5307 if test ! -f \"\$progdir/\$program\" || \\
5308 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5309 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5311 file=\"\$\$-\$program\"
5313 if test ! -d \"\$progdir\"; then
5314 $mkdir \"\$progdir\"
5315 else
5316 $rm \"\$progdir/\$file\"
5319 $echo >> $output "\
5321 # relink executable if necessary
5322 if test -n \"\$relink_command\"; then
5323 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5324 else
5325 $echo \"\$relink_command_output\" >&2
5326 $rm \"\$progdir/\$file\"
5327 exit $EXIT_FAILURE
5331 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5332 { $rm \"\$progdir/\$program\";
5333 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5334 $rm \"\$progdir/\$file\"
5336 else
5337 $echo >> $output "\
5338 program='$outputname'
5339 progdir=\"\$thisdir/$objdir\"
5343 $echo >> $output "\
5345 if test -f \"\$progdir/\$program\"; then"
5347 # Export our shlibpath_var if we have one.
5348 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5349 $echo >> $output "\
5350 # Add our own library path to $shlibpath_var
5351 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5353 # Some systems cannot cope with colon-terminated $shlibpath_var
5354 # The second colon is a workaround for a bug in BeOS R4 sed
5355 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5357 export $shlibpath_var
5361 # fixup the dll searchpath if we need to.
5362 if test -n "$dllsearchpath"; then
5363 $echo >> $output "\
5364 # Add the dll search path components to the executable PATH
5365 PATH=$dllsearchpath:\$PATH
5369 $echo >> $output "\
5370 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5371 # Run the actual program with our arguments.
5373 case $host in
5374 # Backslashes separate directories on plain windows
5375 *-*-mingw | *-*-os2*)
5376 $echo >> $output "\
5377 exec \$progdir\\\\\$program \${1+\"\$@\"}
5382 $echo >> $output "\
5383 exec \$progdir/\$program \${1+\"\$@\"}
5386 esac
5387 $echo >> $output "\
5388 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5389 exit $EXIT_FAILURE
5391 else
5392 # The program doesn't exist.
5393 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5394 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5395 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5396 exit $EXIT_FAILURE
5400 chmod +x $output
5402 exit $EXIT_SUCCESS
5404 esac
5406 # See if we need to build an old-fashioned archive.
5407 for oldlib in $oldlibs; do
5409 if test "$build_libtool_libs" = convenience; then
5410 oldobjs="$libobjs_save"
5411 addlibs="$convenience"
5412 build_libtool_libs=no
5413 else
5414 if test "$build_libtool_libs" = module; then
5415 oldobjs="$libobjs_save"
5416 build_libtool_libs=no
5417 else
5418 oldobjs="$old_deplibs $non_pic_objects"
5420 addlibs="$old_convenience"
5423 if test -n "$addlibs"; then
5424 gentop="$output_objdir/${outputname}x"
5425 generated="$generated $gentop"
5427 func_extract_archives $gentop $addlibs
5428 oldobjs="$oldobjs $func_extract_archives_result"
5431 # Do each command in the archive commands.
5432 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5433 cmds=$old_archive_from_new_cmds
5434 else
5435 # POSIX demands no paths to be encoded in archives. We have
5436 # to avoid creating archives with duplicate basenames if we
5437 # might have to extract them afterwards, e.g., when creating a
5438 # static archive out of a convenience library, or when linking
5439 # the entirety of a libtool archive into another (currently
5440 # not supported by libtool).
5441 if (for obj in $oldobjs
5443 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5444 done | sort | sort -uc >/dev/null 2>&1); then
5446 else
5447 $echo "copying selected object files to avoid basename conflicts..."
5449 if test -z "$gentop"; then
5450 gentop="$output_objdir/${outputname}x"
5451 generated="$generated $gentop"
5453 $show "${rm}r $gentop"
5454 $run ${rm}r "$gentop"
5455 $show "$mkdir $gentop"
5456 $run $mkdir "$gentop"
5457 status=$?
5458 if test "$status" -ne 0 && test ! -d "$gentop"; then
5459 exit $status
5463 save_oldobjs=$oldobjs
5464 oldobjs=
5465 counter=1
5466 for obj in $save_oldobjs
5468 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5469 case " $oldobjs " in
5470 " ") oldobjs=$obj ;;
5471 *[\ /]"$objbase "*)
5472 while :; do
5473 # Make sure we don't pick an alternate name that also
5474 # overlaps.
5475 newobj=lt$counter-$objbase
5476 counter=`expr $counter + 1`
5477 case " $oldobjs " in
5478 *[\ /]"$newobj "*) ;;
5479 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5480 esac
5481 done
5482 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5483 $run ln "$obj" "$gentop/$newobj" ||
5484 $run cp "$obj" "$gentop/$newobj"
5485 oldobjs="$oldobjs $gentop/$newobj"
5487 *) oldobjs="$oldobjs $obj" ;;
5488 esac
5489 done
5492 eval cmds=\"$old_archive_cmds\"
5494 if len=`expr "X$cmds" : ".*"` &&
5495 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5496 cmds=$old_archive_cmds
5497 else
5498 # the command line is too long to link in one step, link in parts
5499 $echo "using piecewise archive linking..."
5500 save_RANLIB=$RANLIB
5501 RANLIB=:
5502 objlist=
5503 concat_cmds=
5504 save_oldobjs=$oldobjs
5506 # Is there a better way of finding the last object in the list?
5507 for obj in $save_oldobjs
5509 last_oldobj=$obj
5510 done
5511 for obj in $save_oldobjs
5513 oldobjs="$objlist $obj"
5514 objlist="$objlist $obj"
5515 eval test_cmds=\"$old_archive_cmds\"
5516 if len=`expr "X$test_cmds" : ".*"` &&
5517 test "$len" -le "$max_cmd_len"; then
5519 else
5520 # the above command should be used before it gets too long
5521 oldobjs=$objlist
5522 if test "$obj" = "$last_oldobj" ; then
5523 RANLIB=$save_RANLIB
5525 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5526 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5527 objlist=
5529 done
5530 RANLIB=$save_RANLIB
5531 oldobjs=$objlist
5532 if test "X$oldobjs" = "X" ; then
5533 eval cmds=\"\$concat_cmds\"
5534 else
5535 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5539 save_ifs="$IFS"; IFS='~'
5540 for cmd in $cmds; do
5541 eval cmd=\"$cmd\"
5542 IFS="$save_ifs"
5543 $show "$cmd"
5544 $run eval "$cmd" || exit $?
5545 done
5546 IFS="$save_ifs"
5547 done
5549 if test -n "$generated"; then
5550 $show "${rm}r$generated"
5551 $run ${rm}r$generated
5554 # Now create the libtool archive.
5555 case $output in
5556 *.la)
5557 old_library=
5558 test "$build_old_libs" = yes && old_library="$libname.$libext"
5559 $show "creating $output"
5561 # Preserve any variables that may affect compiler behavior
5562 for var in $variables_saved_for_relink; do
5563 if eval test -z \"\${$var+set}\"; then
5564 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5565 elif eval var_value=\$$var; test -z "$var_value"; then
5566 relink_command="$var=; export $var; $relink_command"
5567 else
5568 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5569 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5571 done
5572 # Quote the link command for shipping.
5573 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5574 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5575 if test "$hardcode_automatic" = yes ; then
5576 relink_command=
5580 # Only create the output if not a dry run.
5581 if test -z "$run"; then
5582 for installed in no yes; do
5583 if test "$installed" = yes; then
5584 if test -z "$install_libdir"; then
5585 break
5587 output="$output_objdir/$outputname"i
5588 # Replace all uninstalled libtool libraries with the installed ones
5589 newdependency_libs=
5590 for deplib in $dependency_libs; do
5591 case $deplib in
5592 *.la)
5593 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5594 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5595 if test -z "$libdir"; then
5596 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5597 exit $EXIT_FAILURE
5599 newdependency_libs="$newdependency_libs $libdir/$name"
5601 *) newdependency_libs="$newdependency_libs $deplib" ;;
5602 esac
5603 done
5604 dependency_libs="$newdependency_libs"
5605 newdlfiles=
5606 for lib in $dlfiles; do
5607 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5608 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5609 if test -z "$libdir"; then
5610 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5611 exit $EXIT_FAILURE
5613 newdlfiles="$newdlfiles $libdir/$name"
5614 done
5615 dlfiles="$newdlfiles"
5616 newdlprefiles=
5617 for lib in $dlprefiles; do
5618 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5619 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5620 if test -z "$libdir"; then
5621 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5622 exit $EXIT_FAILURE
5624 newdlprefiles="$newdlprefiles $libdir/$name"
5625 done
5626 dlprefiles="$newdlprefiles"
5627 else
5628 newdlfiles=
5629 for lib in $dlfiles; do
5630 case $lib in
5631 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5632 *) abs=`pwd`"/$lib" ;;
5633 esac
5634 newdlfiles="$newdlfiles $abs"
5635 done
5636 dlfiles="$newdlfiles"
5637 newdlprefiles=
5638 for lib in $dlprefiles; do
5639 case $lib in
5640 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5641 *) abs=`pwd`"/$lib" ;;
5642 esac
5643 newdlprefiles="$newdlprefiles $abs"
5644 done
5645 dlprefiles="$newdlprefiles"
5647 $rm $output
5648 # place dlname in correct position for cygwin
5649 tdlname=$dlname
5650 case $host,$output,$installed,$module,$dlname in
5651 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5652 esac
5653 $echo > $output "\
5654 # $outputname - a libtool library file
5655 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5657 # Please DO NOT delete this file!
5658 # It is necessary for linking the library.
5660 # The name that we can dlopen(3).
5661 dlname='$tdlname'
5663 # Names of this library.
5664 library_names='$library_names'
5666 # The name of the static archive.
5667 old_library='$old_library'
5669 # Libraries that this one depends upon.
5670 dependency_libs='$dependency_libs'
5672 # Version information for $libname.
5673 current=$current
5674 age=$age
5675 revision=$revision
5677 # Is this an already installed library?
5678 installed=$installed
5680 # Should we warn about portability when linking against -modules?
5681 shouldnotlink=$module
5683 # Files to dlopen/dlpreopen
5684 dlopen='$dlfiles'
5685 dlpreopen='$dlprefiles'
5687 # Directory that this library needs to be installed in:
5688 libdir='$install_libdir'"
5689 if test "$installed" = no && test "$need_relink" = yes; then
5690 $echo >> $output "\
5691 relink_command=\"$relink_command\""
5693 done
5696 # Do a symbolic link so that the libtool archive can be found in
5697 # LD_LIBRARY_PATH before the program is installed.
5698 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5699 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5701 esac
5702 exit $EXIT_SUCCESS
5705 # libtool install mode
5706 install)
5707 modename="$modename: install"
5709 # There may be an optional sh(1) argument at the beginning of
5710 # install_prog (especially on Windows NT).
5711 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5712 # Allow the use of GNU shtool's install command.
5713 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5714 # Aesthetically quote it.
5715 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5716 case $arg in
5717 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5718 arg="\"$arg\""
5720 esac
5721 install_prog="$arg "
5722 arg="$1"
5723 shift
5724 else
5725 install_prog=
5726 arg="$nonopt"
5729 # The real first argument should be the name of the installation program.
5730 # Aesthetically quote it.
5731 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5732 case $arg in
5733 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5734 arg="\"$arg\""
5736 esac
5737 install_prog="$install_prog$arg"
5739 # We need to accept at least all the BSD install flags.
5740 dest=
5741 files=
5742 opts=
5743 prev=
5744 install_type=
5745 isdir=no
5746 stripme=
5747 for arg
5749 if test -n "$dest"; then
5750 files="$files $dest"
5751 dest="$arg"
5752 continue
5755 case $arg in
5756 -d) isdir=yes ;;
5757 -f) prev="-f" ;;
5758 -g) prev="-g" ;;
5759 -m) prev="-m" ;;
5760 -o) prev="-o" ;;
5762 stripme=" -s"
5763 continue
5765 -*) ;;
5768 # If the previous option needed an argument, then skip it.
5769 if test -n "$prev"; then
5770 prev=
5771 else
5772 dest="$arg"
5773 continue
5776 esac
5778 # Aesthetically quote the argument.
5779 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5780 case $arg in
5781 *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
5782 arg="\"$arg\""
5784 esac
5785 install_prog="$install_prog $arg"
5786 done
5788 if test -z "$install_prog"; then
5789 $echo "$modename: you must specify an install program" 1>&2
5790 $echo "$help" 1>&2
5791 exit $EXIT_FAILURE
5794 if test -n "$prev"; then
5795 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5796 $echo "$help" 1>&2
5797 exit $EXIT_FAILURE
5800 if test -z "$files"; then
5801 if test -z "$dest"; then
5802 $echo "$modename: no file or destination specified" 1>&2
5803 else
5804 $echo "$modename: you must specify a destination" 1>&2
5806 $echo "$help" 1>&2
5807 exit $EXIT_FAILURE
5810 # Strip any trailing slash from the destination.
5811 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5813 # Check to see that the destination is a directory.
5814 test -d "$dest" && isdir=yes
5815 if test "$isdir" = yes; then
5816 destdir="$dest"
5817 destname=
5818 else
5819 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5820 test "X$destdir" = "X$dest" && destdir=.
5821 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5823 # Not a directory, so check to see that there is only one file specified.
5824 set dummy $files
5825 if test "$#" -gt 2; then
5826 $echo "$modename: \`$dest' is not a directory" 1>&2
5827 $echo "$help" 1>&2
5828 exit $EXIT_FAILURE
5831 case $destdir in
5832 [\\/]* | [A-Za-z]:[\\/]*) ;;
5834 for file in $files; do
5835 case $file in
5836 *.lo) ;;
5838 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5839 $echo "$help" 1>&2
5840 exit $EXIT_FAILURE
5842 esac
5843 done
5845 esac
5847 # This variable tells wrapper scripts just to set variables rather
5848 # than running their programs.
5849 libtool_install_magic="$magic"
5851 staticlibs=
5852 future_libdirs=
5853 current_libdirs=
5854 for file in $files; do
5856 # Do each installation.
5857 case $file in
5858 *.$libext)
5859 # Do the static libraries later.
5860 staticlibs="$staticlibs $file"
5863 *.la)
5864 # Check to see that this really is a libtool archive.
5865 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5866 else
5867 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5868 $echo "$help" 1>&2
5869 exit $EXIT_FAILURE
5872 library_names=
5873 old_library=
5874 relink_command=
5875 # If there is no directory component, then add one.
5876 case $file in
5877 */* | *\\*) . $file ;;
5878 *) . ./$file ;;
5879 esac
5881 # Add the libdir to current_libdirs if it is the destination.
5882 if test "X$destdir" = "X$libdir"; then
5883 case "$current_libdirs " in
5884 *" $libdir "*) ;;
5885 *) current_libdirs="$current_libdirs $libdir" ;;
5886 esac
5887 else
5888 # Note the libdir as a future libdir.
5889 case "$future_libdirs " in
5890 *" $libdir "*) ;;
5891 *) future_libdirs="$future_libdirs $libdir" ;;
5892 esac
5895 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5896 test "X$dir" = "X$file/" && dir=
5897 dir="$dir$objdir"
5899 if test -n "$relink_command"; then
5900 # Determine the prefix the user has applied to our future dir.
5901 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5903 # Don't allow the user to place us outside of our expected
5904 # location b/c this prevents finding dependent libraries that
5905 # are installed to the same prefix.
5906 # At present, this check doesn't affect windows .dll's that
5907 # are installed into $libdir/../bin (currently, that works fine)
5908 # but it's something to keep an eye on.
5909 if test "$inst_prefix_dir" = "$destdir"; then
5910 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5911 exit $EXIT_FAILURE
5914 if test -n "$inst_prefix_dir"; then
5915 # Stick the inst_prefix_dir data into the link command.
5916 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5917 else
5918 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5921 $echo "$modename: warning: relinking \`$file'" 1>&2
5922 $show "$relink_command"
5923 if $run eval "$relink_command"; then :
5924 else
5925 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5926 exit $EXIT_FAILURE
5930 # See the names of the shared library.
5931 set dummy $library_names
5932 if test -n "$2"; then
5933 realname="$2"
5934 shift
5935 shift
5937 srcname="$realname"
5938 test -n "$relink_command" && srcname="$realname"T
5940 # Install the shared library and build the symlinks.
5941 $show "$install_prog $dir/$srcname $destdir/$realname"
5942 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5943 if test -n "$stripme" && test -n "$striplib"; then
5944 $show "$striplib $destdir/$realname"
5945 $run eval "$striplib $destdir/$realname" || exit $?
5948 if test "$#" -gt 0; then
5949 # Delete the old symlinks, and create new ones.
5950 for linkname
5952 if test "$linkname" != "$realname"; then
5953 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5954 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5956 done
5959 # Do each command in the postinstall commands.
5960 lib="$destdir/$realname"
5961 cmds=$postinstall_cmds
5962 save_ifs="$IFS"; IFS='~'
5963 for cmd in $cmds; do
5964 IFS="$save_ifs"
5965 eval cmd=\"$cmd\"
5966 $show "$cmd"
5967 $run eval "$cmd" || exit $?
5968 done
5969 IFS="$save_ifs"
5972 # Install the pseudo-library for information purposes.
5973 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5974 instname="$dir/$name"i
5975 $show "$install_prog $instname $destdir/$name"
5976 $run eval "$install_prog $instname $destdir/$name" || exit $?
5978 # Maybe install the static library, too.
5979 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5982 *.lo)
5983 # Install (i.e. copy) a libtool object.
5985 # Figure out destination file name, if it wasn't already specified.
5986 if test -n "$destname"; then
5987 destfile="$destdir/$destname"
5988 else
5989 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5990 destfile="$destdir/$destfile"
5993 # Deduce the name of the destination old-style object file.
5994 case $destfile in
5995 *.lo)
5996 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5998 *.$objext)
5999 staticdest="$destfile"
6000 destfile=
6003 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6004 $echo "$help" 1>&2
6005 exit $EXIT_FAILURE
6007 esac
6009 # Install the libtool object if requested.
6010 if test -n "$destfile"; then
6011 $show "$install_prog $file $destfile"
6012 $run eval "$install_prog $file $destfile" || exit $?
6015 # Install the old object if enabled.
6016 if test "$build_old_libs" = yes; then
6017 # Deduce the name of the old-style object file.
6018 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6020 $show "$install_prog $staticobj $staticdest"
6021 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6023 exit $EXIT_SUCCESS
6027 # Figure out destination file name, if it wasn't already specified.
6028 if test -n "$destname"; then
6029 destfile="$destdir/$destname"
6030 else
6031 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6032 destfile="$destdir/$destfile"
6035 # If the file is missing, and there is a .exe on the end, strip it
6036 # because it is most likely a libtool script we actually want to
6037 # install
6038 stripped_ext=""
6039 case $file in
6040 *.exe)
6041 if test ! -f "$file"; then
6042 file=`$echo $file|${SED} 's,.exe$,,'`
6043 stripped_ext=".exe"
6046 esac
6048 # Do a test to see if this is really a libtool program.
6049 case $host in
6050 *cygwin*|*mingw*)
6051 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6054 wrapper=$file
6056 esac
6057 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6058 notinst_deplibs=
6059 relink_command=
6061 # To insure that "foo" is sourced, and not "foo.exe",
6062 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6063 # which disallows the automatic-append-.exe behavior.
6064 case $build in
6065 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6066 *) wrapperdot=${wrapper} ;;
6067 esac
6068 # If there is no directory component, then add one.
6069 case $file in
6070 */* | *\\*) . ${wrapperdot} ;;
6071 *) . ./${wrapperdot} ;;
6072 esac
6074 # Check the variables that should have been set.
6075 if test -z "$notinst_deplibs"; then
6076 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6077 exit $EXIT_FAILURE
6080 finalize=yes
6081 for lib in $notinst_deplibs; do
6082 # Check to see that each library is installed.
6083 libdir=
6084 if test -f "$lib"; then
6085 # If there is no directory component, then add one.
6086 case $lib in
6087 */* | *\\*) . $lib ;;
6088 *) . ./$lib ;;
6089 esac
6091 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6092 if test -n "$libdir" && test ! -f "$libfile"; then
6093 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6094 finalize=no
6096 done
6098 relink_command=
6099 # To insure that "foo" is sourced, and not "foo.exe",
6100 # finese the cygwin/MSYS system by explicitly sourcing "foo."
6101 # which disallows the automatic-append-.exe behavior.
6102 case $build in
6103 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
6104 *) wrapperdot=${wrapper} ;;
6105 esac
6106 # If there is no directory component, then add one.
6107 case $file in
6108 */* | *\\*) . ${wrapperdot} ;;
6109 *) . ./${wrapperdot} ;;
6110 esac
6112 outputname=
6113 if test "$fast_install" = no && test -n "$relink_command"; then
6114 if test "$finalize" = yes && test -z "$run"; then
6115 tmpdir="/tmp"
6116 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6117 tmpdir="$tmpdir/libtool-$$"
6118 save_umask=`umask`
6119 umask 0077
6120 if $mkdir "$tmpdir"; then
6121 umask $save_umask
6122 else
6123 umask $save_umask
6124 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6125 continue
6127 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6128 outputname="$tmpdir/$file"
6129 # Replace the output file specification.
6130 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6132 $show "$relink_command"
6133 if $run eval "$relink_command"; then :
6134 else
6135 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6136 ${rm}r "$tmpdir"
6137 continue
6139 file="$outputname"
6140 else
6141 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6143 else
6144 # Install the binary that we compiled earlier.
6145 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6149 # remove .exe since cygwin /usr/bin/install will append another
6150 # one anyways
6151 case $install_prog,$host in
6152 */usr/bin/install*,*cygwin*)
6153 case $file:$destfile in
6154 *.exe:*.exe)
6155 # this is ok
6157 *.exe:*)
6158 destfile=$destfile.exe
6160 *:*.exe)
6161 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6163 esac
6165 esac
6166 $show "$install_prog$stripme $file $destfile"
6167 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6168 test -n "$outputname" && ${rm}r "$tmpdir"
6170 esac
6171 done
6173 for file in $staticlibs; do
6174 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6176 # Set up the ranlib parameters.
6177 oldlib="$destdir/$name"
6179 $show "$install_prog $file $oldlib"
6180 $run eval "$install_prog \$file \$oldlib" || exit $?
6182 if test -n "$stripme" && test -n "$old_striplib"; then
6183 $show "$old_striplib $oldlib"
6184 $run eval "$old_striplib $oldlib" || exit $?
6187 # Do each command in the postinstall commands.
6188 cmds=$old_postinstall_cmds
6189 save_ifs="$IFS"; IFS='~'
6190 for cmd in $cmds; do
6191 IFS="$save_ifs"
6192 eval cmd=\"$cmd\"
6193 $show "$cmd"
6194 $run eval "$cmd" || exit $?
6195 done
6196 IFS="$save_ifs"
6197 done
6199 if test -n "$future_libdirs"; then
6200 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6203 if test -n "$current_libdirs"; then
6204 # Maybe just do a dry run.
6205 test -n "$run" && current_libdirs=" -n$current_libdirs"
6206 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6207 else
6208 exit $EXIT_SUCCESS
6212 # libtool finish mode
6213 finish)
6214 modename="$modename: finish"
6215 libdirs="$nonopt"
6216 admincmds=
6218 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6219 for dir
6221 libdirs="$libdirs $dir"
6222 done
6224 for libdir in $libdirs; do
6225 if test -n "$finish_cmds"; then
6226 # Do each command in the finish commands.
6227 cmds=$finish_cmds
6228 save_ifs="$IFS"; IFS='~'
6229 for cmd in $cmds; do
6230 IFS="$save_ifs"
6231 eval cmd=\"$cmd\"
6232 $show "$cmd"
6233 $run eval "$cmd" || admincmds="$admincmds
6234 $cmd"
6235 done
6236 IFS="$save_ifs"
6238 if test -n "$finish_eval"; then
6239 # Do the single finish_eval.
6240 eval cmds=\"$finish_eval\"
6241 $run eval "$cmds" || admincmds="$admincmds
6242 $cmds"
6244 done
6247 # Exit here if they wanted silent mode.
6248 test "$show" = : && exit $EXIT_SUCCESS
6250 $echo "----------------------------------------------------------------------"
6251 $echo "Libraries have been installed in:"
6252 for libdir in $libdirs; do
6253 $echo " $libdir"
6254 done
6255 $echo
6256 $echo "If you ever happen to want to link against installed libraries"
6257 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6258 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6259 $echo "flag during linking and do at least one of the following:"
6260 if test -n "$shlibpath_var"; then
6261 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6262 $echo " during execution"
6264 if test -n "$runpath_var"; then
6265 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6266 $echo " during linking"
6268 if test -n "$hardcode_libdir_flag_spec"; then
6269 libdir=LIBDIR
6270 eval flag=\"$hardcode_libdir_flag_spec\"
6272 $echo " - use the \`$flag' linker flag"
6274 if test -n "$admincmds"; then
6275 $echo " - have your system administrator run these commands:$admincmds"
6277 if test -f /etc/ld.so.conf; then
6278 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6280 $echo
6281 $echo "See any operating system documentation about shared libraries for"
6282 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6283 $echo "----------------------------------------------------------------------"
6284 exit $EXIT_SUCCESS
6287 # libtool execute mode
6288 execute)
6289 modename="$modename: execute"
6291 # The first argument is the command name.
6292 cmd="$nonopt"
6293 if test -z "$cmd"; then
6294 $echo "$modename: you must specify a COMMAND" 1>&2
6295 $echo "$help"
6296 exit $EXIT_FAILURE
6299 # Handle -dlopen flags immediately.
6300 for file in $execute_dlfiles; do
6301 if test ! -f "$file"; then
6302 $echo "$modename: \`$file' is not a file" 1>&2
6303 $echo "$help" 1>&2
6304 exit $EXIT_FAILURE
6307 dir=
6308 case $file in
6309 *.la)
6310 # Check to see that this really is a libtool archive.
6311 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6312 else
6313 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6314 $echo "$help" 1>&2
6315 exit $EXIT_FAILURE
6318 # Read the libtool library.
6319 dlname=
6320 library_names=
6322 # If there is no directory component, then add one.
6323 case $file in
6324 */* | *\\*) . $file ;;
6325 *) . ./$file ;;
6326 esac
6328 # Skip this library if it cannot be dlopened.
6329 if test -z "$dlname"; then
6330 # Warn if it was a shared library.
6331 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6332 continue
6335 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6336 test "X$dir" = "X$file" && dir=.
6338 if test -f "$dir/$objdir/$dlname"; then
6339 dir="$dir/$objdir"
6340 else
6341 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6342 exit $EXIT_FAILURE
6346 *.lo)
6347 # Just add the directory containing the .lo file.
6348 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6349 test "X$dir" = "X$file" && dir=.
6353 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6354 continue
6356 esac
6358 # Get the absolute pathname.
6359 absdir=`cd "$dir" && pwd`
6360 test -n "$absdir" && dir="$absdir"
6362 # Now add the directory to shlibpath_var.
6363 if eval "test -z \"\$$shlibpath_var\""; then
6364 eval "$shlibpath_var=\"\$dir\""
6365 else
6366 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6368 done
6370 # This variable tells wrapper scripts just to set shlibpath_var
6371 # rather than running their programs.
6372 libtool_execute_magic="$magic"
6374 # Check if any of the arguments is a wrapper script.
6375 args=
6376 for file
6378 case $file in
6379 -*) ;;
6381 # Do a test to see if this is really a libtool program.
6382 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6383 # If there is no directory component, then add one.
6384 case $file in
6385 */* | *\\*) . $file ;;
6386 *) . ./$file ;;
6387 esac
6389 # Transform arg to wrapped name.
6390 file="$progdir/$program"
6393 esac
6394 # Quote arguments (to preserve shell metacharacters).
6395 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6396 args="$args \"$file\""
6397 done
6399 if test -z "$run"; then
6400 if test -n "$shlibpath_var"; then
6401 # Export the shlibpath_var.
6402 eval "export $shlibpath_var"
6405 # Restore saved environment variables
6406 if test "${save_LC_ALL+set}" = set; then
6407 LC_ALL="$save_LC_ALL"; export LC_ALL
6409 if test "${save_LANG+set}" = set; then
6410 LANG="$save_LANG"; export LANG
6413 # Now prepare to actually exec the command.
6414 exec_cmd="\$cmd$args"
6415 else
6416 # Display what would be done.
6417 if test -n "$shlibpath_var"; then
6418 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6419 $echo "export $shlibpath_var"
6421 $echo "$cmd$args"
6422 exit $EXIT_SUCCESS
6426 # libtool clean and uninstall mode
6427 clean | uninstall)
6428 modename="$modename: $mode"
6429 rm="$nonopt"
6430 files=
6431 rmforce=
6432 exit_status=0
6434 # This variable tells wrapper scripts just to set variables rather
6435 # than running their programs.
6436 libtool_install_magic="$magic"
6438 for arg
6440 case $arg in
6441 -f) rm="$rm $arg"; rmforce=yes ;;
6442 -*) rm="$rm $arg" ;;
6443 *) files="$files $arg" ;;
6444 esac
6445 done
6447 if test -z "$rm"; then
6448 $echo "$modename: you must specify an RM program" 1>&2
6449 $echo "$help" 1>&2
6450 exit $EXIT_FAILURE
6453 rmdirs=
6455 origobjdir="$objdir"
6456 for file in $files; do
6457 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6458 if test "X$dir" = "X$file"; then
6459 dir=.
6460 objdir="$origobjdir"
6461 else
6462 objdir="$dir/$origobjdir"
6464 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6465 test "$mode" = uninstall && objdir="$dir"
6467 # Remember objdir for removal later, being careful to avoid duplicates
6468 if test "$mode" = clean; then
6469 case " $rmdirs " in
6470 *" $objdir "*) ;;
6471 *) rmdirs="$rmdirs $objdir" ;;
6472 esac
6475 # Don't error if the file doesn't exist and rm -f was used.
6476 if (test -L "$file") >/dev/null 2>&1 \
6477 || (test -h "$file") >/dev/null 2>&1 \
6478 || test -f "$file"; then
6480 elif test -d "$file"; then
6481 exit_status=1
6482 continue
6483 elif test "$rmforce" = yes; then
6484 continue
6487 rmfiles="$file"
6489 case $name in
6490 *.la)
6491 # Possibly a libtool archive, so verify it.
6492 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6493 . $dir/$name
6495 # Delete the libtool libraries and symlinks.
6496 for n in $library_names; do
6497 rmfiles="$rmfiles $objdir/$n"
6498 done
6499 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6500 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6502 if test "$mode" = uninstall; then
6503 if test -n "$library_names"; then
6504 # Do each command in the postuninstall commands.
6505 cmds=$postuninstall_cmds
6506 save_ifs="$IFS"; IFS='~'
6507 for cmd in $cmds; do
6508 IFS="$save_ifs"
6509 eval cmd=\"$cmd\"
6510 $show "$cmd"
6511 $run eval "$cmd"
6512 if test "$?" -ne 0 && test "$rmforce" != yes; then
6513 exit_status=1
6515 done
6516 IFS="$save_ifs"
6519 if test -n "$old_library"; then
6520 # Do each command in the old_postuninstall commands.
6521 cmds=$old_postuninstall_cmds
6522 save_ifs="$IFS"; IFS='~'
6523 for cmd in $cmds; do
6524 IFS="$save_ifs"
6525 eval cmd=\"$cmd\"
6526 $show "$cmd"
6527 $run eval "$cmd"
6528 if test "$?" -ne 0 && test "$rmforce" != yes; then
6529 exit_status=1
6531 done
6532 IFS="$save_ifs"
6534 # FIXME: should reinstall the best remaining shared library.
6539 *.lo)
6540 # Possibly a libtool object, so verify it.
6541 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6543 # Read the .lo file
6544 . $dir/$name
6546 # Add PIC object to the list of files to remove.
6547 if test -n "$pic_object" \
6548 && test "$pic_object" != none; then
6549 rmfiles="$rmfiles $dir/$pic_object"
6552 # Add non-PIC object to the list of files to remove.
6553 if test -n "$non_pic_object" \
6554 && test "$non_pic_object" != none; then
6555 rmfiles="$rmfiles $dir/$non_pic_object"
6561 if test "$mode" = clean ; then
6562 noexename=$name
6563 case $file in
6564 *.exe)
6565 file=`$echo $file|${SED} 's,.exe$,,'`
6566 noexename=`$echo $name|${SED} 's,.exe$,,'`
6567 # $file with .exe has already been added to rmfiles,
6568 # add $file without .exe
6569 rmfiles="$rmfiles $file"
6571 esac
6572 # Do a test to see if this is a libtool program.
6573 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6574 relink_command=
6575 . $dir/$noexename
6577 # note $name still contains .exe if it was in $file originally
6578 # as does the version of $file that was added into $rmfiles
6579 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6580 if test "$fast_install" = yes && test -n "$relink_command"; then
6581 rmfiles="$rmfiles $objdir/lt-$name"
6583 if test "X$noexename" != "X$name" ; then
6584 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6589 esac
6590 $show "$rm $rmfiles"
6591 $run $rm $rmfiles || exit_status=1
6592 done
6593 objdir="$origobjdir"
6595 # Try to remove the ${objdir}s in the directories where we deleted files
6596 for dir in $rmdirs; do
6597 if test -d "$dir"; then
6598 $show "rmdir $dir"
6599 $run rmdir $dir >/dev/null 2>&1
6601 done
6603 exit $exit_status
6607 $echo "$modename: you must specify a MODE" 1>&2
6608 $echo "$generic_help" 1>&2
6609 exit $EXIT_FAILURE
6611 esac
6613 if test -z "$exec_cmd"; then
6614 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6615 $echo "$generic_help" 1>&2
6616 exit $EXIT_FAILURE
6618 fi # test -z "$show_help"
6620 if test -n "$exec_cmd"; then
6621 eval exec $exec_cmd
6622 exit $EXIT_FAILURE
6625 # We need to display help for each of the modes.
6626 case $mode in
6627 "") $echo \
6628 "Usage: $modename [OPTION]... [MODE-ARG]...
6630 Provide generalized library-building support services.
6632 --config show all configuration variables
6633 --debug enable verbose shell tracing
6634 -n, --dry-run display commands without modifying any files
6635 --features display basic configuration information and exit
6636 --finish same as \`--mode=finish'
6637 --help display this help message and exit
6638 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6639 --quiet same as \`--silent'
6640 --silent don't print informational messages
6641 --tag=TAG use configuration variables from tag TAG
6642 --version print version information
6644 MODE must be one of the following:
6646 clean remove files from the build directory
6647 compile compile a source file into a libtool object
6648 execute automatically set library path, then run a program
6649 finish complete the installation of libtool libraries
6650 install install libraries or executables
6651 link create a library or an executable
6652 uninstall remove libraries from an installed directory
6654 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6655 a more detailed description of MODE.
6657 Report bugs to <bug-libtool@gnu.org>."
6658 exit $EXIT_SUCCESS
6661 clean)
6662 $echo \
6663 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6665 Remove files from the build directory.
6667 RM is the name of the program to use to delete files associated with each FILE
6668 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6669 to RM.
6671 If FILE is a libtool library, object or program, all the files associated
6672 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6675 compile)
6676 $echo \
6677 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6679 Compile a source file into a libtool library object.
6681 This mode accepts the following additional options:
6683 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6684 -prefer-pic try to building PIC objects only
6685 -prefer-non-pic try to building non-PIC objects only
6686 -static always build a \`.o' file suitable for static linking
6688 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6689 from the given SOURCEFILE.
6691 The output file name is determined by removing the directory component from
6692 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6693 library object suffix, \`.lo'."
6696 execute)
6697 $echo \
6698 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6700 Automatically set library path, then run a program.
6702 This mode accepts the following additional options:
6704 -dlopen FILE add the directory containing FILE to the library path
6706 This mode sets the library path environment variable according to \`-dlopen'
6707 flags.
6709 If any of the ARGS are libtool executable wrappers, then they are translated
6710 into their corresponding uninstalled binary, and any of their required library
6711 directories are added to the library path.
6713 Then, COMMAND is executed, with ARGS as arguments."
6716 finish)
6717 $echo \
6718 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6720 Complete the installation of libtool libraries.
6722 Each LIBDIR is a directory that contains libtool libraries.
6724 The commands that this mode executes may require superuser privileges. Use
6725 the \`--dry-run' option if you just want to see what would be executed."
6728 install)
6729 $echo \
6730 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6732 Install executables or libraries.
6734 INSTALL-COMMAND is the installation command. The first component should be
6735 either the \`install' or \`cp' program.
6737 The rest of the components are interpreted as arguments to that command (only
6738 BSD-compatible install options are recognized)."
6741 link)
6742 $echo \
6743 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6745 Link object files or libraries together to form another library, or to
6746 create an executable program.
6748 LINK-COMMAND is a command using the C compiler that you would use to create
6749 a program from several object files.
6751 The following components of LINK-COMMAND are treated specially:
6753 -all-static do not do any dynamic linking at all
6754 -avoid-version do not add a version suffix if possible
6755 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6756 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6757 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6758 -export-symbols SYMFILE
6759 try to export only the symbols listed in SYMFILE
6760 -export-symbols-regex REGEX
6761 try to export only the symbols matching REGEX
6762 -LLIBDIR search LIBDIR for required installed libraries
6763 -lNAME OUTPUT-FILE requires the installed library libNAME
6764 -module build a library that can dlopened
6765 -no-fast-install disable the fast-install mode
6766 -no-install link a not-installable executable
6767 -no-undefined declare that a library does not refer to external symbols
6768 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6769 -objectlist FILE Use a list of object files found in FILE to specify objects
6770 -precious-files-regex REGEX
6771 don't remove output files matching REGEX
6772 -release RELEASE specify package release information
6773 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6774 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6775 -static do not do any dynamic linking of libtool libraries
6776 -version-info CURRENT[:REVISION[:AGE]]
6777 specify library version info [each variable defaults to 0]
6779 All other options (arguments beginning with \`-') are ignored.
6781 Every other argument is treated as a filename. Files ending in \`.la' are
6782 treated as uninstalled libtool libraries, other files are standard or library
6783 object files.
6785 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6786 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6787 required, except when creating a convenience library.
6789 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6790 using \`ar' and \`ranlib', or on Windows using \`lib'.
6792 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6793 is created, otherwise an executable program is created."
6796 uninstall)
6797 $echo \
6798 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6800 Remove libraries from an installation directory.
6802 RM is the name of the program to use to delete files associated with each FILE
6803 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6804 to RM.
6806 If FILE is a libtool library, all the files associated with it are deleted.
6807 Otherwise, only FILE itself is deleted using RM."
6811 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6812 $echo "$help" 1>&2
6813 exit $EXIT_FAILURE
6815 esac
6817 $echo
6818 $echo "Try \`$modename --help' for more information about other modes."
6820 exit $?
6822 # The TAGs below are defined such that we never get into a situation
6823 # in which we disable both kinds of libraries. Given conflicting
6824 # choices, we go for a static library, that is the most portable,
6825 # since we can't tell whether shared libraries were disabled because
6826 # the user asked for that or because the platform doesn't support
6827 # them. This is particularly important on AIX, because we don't
6828 # support having both static and shared libraries enabled at the same
6829 # time on that platform, so we default to a shared-only configuration.
6830 # If a disable-shared tag is given, we'll fallback to a static-only
6831 # configuration. But we'll never go from static-only to shared-only.
6833 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6834 build_libtool_libs=no
6835 build_old_libs=yes
6836 # ### END LIBTOOL TAG CONFIG: disable-shared
6838 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6839 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6840 # ### END LIBTOOL TAG CONFIG: disable-static
6842 # Local Variables:
6843 # mode:shell-script
6844 # sh-indentation:2
6845 # End:
6846 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6848 # Libtool was configured on host vicente-P5K-E:
6850 # Shell to use when invoking shell scripts.
6851 SHELL="/bin/sh"
6853 # Whether or not to build shared libraries.
6854 build_libtool_libs=yes
6856 # Whether or not to build static libraries.
6857 build_old_libs=yes
6859 # Whether or not to add -lc for building shared libraries.
6860 build_libtool_need_lc=no
6862 # Whether or not to disallow shared libs when runtime libs are static
6863 allow_libtool_libs_with_static_runtimes=no
6865 # Whether or not to optimize for fast installation.
6866 fast_install=yes
6868 # The host system.
6869 host_alias=mipsel-linux
6870 host=mipsel-unknown-linux-gnu
6871 host_os=linux-gnu
6873 # The build system.
6874 build_alias=x86_64-linux-gnu
6875 build=x86_64-pc-linux-gnu
6876 build_os=linux-gnu
6878 # An echo program that does not interpret backslashes.
6879 echo="echo"
6881 # The archiver.
6882 AR="mipsel-uclibc-ar"
6883 AR_FLAGS="cru"
6885 # A C compiler.
6886 LTCC="mipsel-uclibc-gcc"
6888 # A language-specific compiler.
6889 CC="mipsel-linux-g++"
6891 # Is the compiler the GNU C compiler?
6892 with_gcc=yes
6894 # An ERE matcher.
6895 EGREP="grep -E"
6897 # The linker used to build libraries.
6898 LD="mipsel-uclibc-ld"
6900 # Whether we need hard or soft links.
6901 LN_S="ln -s"
6903 # A BSD-compatible nm program.
6904 NM="mipsel-uclibc-nm"
6906 # A symbol stripping program
6907 STRIP="mipsel-uclibc-strip -R .note -R .comment"
6909 # Used to examine libraries when file_magic_cmd begins "file"
6910 MAGIC_CMD=file
6912 # Used on cygwin: DLL creation program.
6913 DLLTOOL="dlltool"
6915 # Used on cygwin: object dumper.
6916 OBJDUMP="objdump"
6918 # Used on cygwin: assembler.
6919 AS="mipsel-uclibc-as"
6921 # The name of the directory that contains temporary libtool files.
6922 objdir=.libs
6924 # How to create reloadable object files.
6925 reload_flag=" -r"
6926 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6928 # How to pass a linker flag through the compiler.
6929 wl="-Wl,"
6931 # Object file suffix (normally "o").
6932 objext="o"
6934 # Old archive suffix (normally "a").
6935 libext="a"
6937 # Shared library suffix (normally ".so").
6938 shrext_cmds='.so'
6940 # Executable file suffix (normally "").
6941 exeext=""
6943 # Additional compiler flags for building library objects.
6944 pic_flag=" -fPIC -DPIC"
6945 pic_mode=default
6947 # What is the maximum length of a command?
6948 max_cmd_len=32768
6950 # Does compiler simultaneously support -c and -o options?
6951 compiler_c_o="yes"
6953 # Must we lock files when doing compilation?
6954 need_locks="no"
6956 # Do we need the lib prefix for modules?
6957 need_lib_prefix=no
6959 # Do we need a version for libraries?
6960 need_version=no
6962 # Whether dlopen is supported.
6963 dlopen_support=unknown
6965 # Whether dlopen of programs is supported.
6966 dlopen_self=unknown
6968 # Whether dlopen of statically linked programs is supported.
6969 dlopen_self_static=unknown
6971 # Compiler flag to prevent dynamic linking.
6972 link_static_flag="-static"
6974 # Compiler flag to turn off builtin functions.
6975 no_builtin_flag=" -fno-builtin"
6977 # Compiler flag to allow reflexive dlopens.
6978 export_dynamic_flag_spec="\${wl}--export-dynamic"
6980 # Compiler flag to generate shared objects directly from archives.
6981 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6983 # Compiler flag to generate thread-safe objects.
6984 thread_safe_flag_spec=""
6986 # Library versioning type.
6987 version_type=linux
6989 # Format of library name prefix.
6990 libname_spec="lib\$name"
6992 # List of archive names. First name is the real one, the rest are links.
6993 # The last name is the one that the linker finds with -lNAME.
6994 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
6996 # The coded name of the library, if different from the real name.
6997 soname_spec="\${libname}\${release}\${shared_ext}\$major"
6999 # Commands used to build and install an old-style archive.
7000 RANLIB="mipsel-uclibc-ranlib"
7001 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
7002 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
7003 old_postuninstall_cmds=""
7005 # Create an old-style archive from a shared archive.
7006 old_archive_from_new_cmds=""
7008 # Create a temporary old-style archive to link instead of a shared archive.
7009 old_archive_from_expsyms_cmds=""
7011 # Commands used to build and install a shared archive.
7012 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7013 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
7014 postinstall_cmds=""
7015 postuninstall_cmds=""
7017 # Commands used to build a loadable module (assumed same as above if empty)
7018 module_cmds=""
7019 module_expsym_cmds=""
7021 # Commands to strip libraries.
7022 old_striplib="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
7023 striplib="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
7025 # Dependencies to place before the objects being linked to create a
7026 # shared library.
7027 predep_objects="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/crti.o /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/crtbeginS.o"
7029 # Dependencies to place after the objects being linked to create a
7030 # shared library.
7031 postdep_objects="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/crtendS.o /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/crtn.o"
7033 # Dependencies to place before the objects being linked to create a
7034 # shared library.
7035 predeps=""
7037 # Dependencies to place after the objects being linked to create a
7038 # shared library.
7039 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7041 # The library search path used internally by the compiler when linking
7042 # a shared library.
7043 compiler_lib_search_path="-L/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4 -L/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc -L/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib"
7045 # Method to check whether dependent libraries are shared objects.
7046 deplibs_check_method="pass_all"
7048 # Command to use when deplibs_check_method == file_magic.
7049 file_magic_cmd="\$MAGIC_CMD"
7051 # Flag that allows shared libraries with undefined symbols to be built.
7052 allow_undefined_flag=""
7054 # Flag that forces no undefined symbols.
7055 no_undefined_flag=""
7057 # Commands used to finish a libtool library installation in a directory.
7058 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7060 # Same as above, but a single script fragment to be evaled but not shown.
7061 finish_eval=""
7063 # Take the output of nm and produce a listing of raw symbols and C names.
7064 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7066 # Transform the output of nm in a proper C declaration
7067 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7069 # Transform the output of nm in a C name address pair
7070 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7072 # This is the shared library runtime path variable.
7073 runpath_var=LD_RUN_PATH
7075 # This is the shared library path variable.
7076 shlibpath_var=LD_LIBRARY_PATH
7078 # Is shlibpath searched before the hard-coded library search path?
7079 shlibpath_overrides_runpath=no
7081 # How to hardcode a shared library path into an executable.
7082 hardcode_action=immediate
7084 # Whether we should hardcode library paths into libraries.
7085 hardcode_into_libs=yes
7087 # Flag to hardcode $libdir into a binary during linking.
7088 # This must work even if $libdir does not exist.
7089 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7091 # If ld is used when linking, flag to hardcode $libdir into
7092 # a binary during linking. This must work even if $libdir does
7093 # not exist.
7094 hardcode_libdir_flag_spec_ld=""
7096 # Whether we need a single -rpath flag with a separated argument.
7097 hardcode_libdir_separator=""
7099 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7100 # resulting binary.
7101 hardcode_direct=no
7103 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7104 # resulting binary.
7105 hardcode_minus_L=no
7107 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7108 # the resulting binary.
7109 hardcode_shlibpath_var=
7111 # Set to yes if building a shared library automatically hardcodes DIR into the library
7112 # and all subsequent libraries and executables linked against it.
7113 hardcode_automatic=no
7115 # Variables whose values should be saved in libtool wrapper scripts and
7116 # restored at relink time.
7117 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7119 # Whether libtool must link a program against all its dependency libraries.
7120 link_all_deplibs=unknown
7122 # Compile-time system search path for libraries
7123 sys_lib_search_path_spec=" /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4/ /usr/lib/gcc/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/mipsel-linux-uclibc/4.2.4/ /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/bin/../lib/gcc/mipsel-linux-uclibc/4.2.4/../../../../mipsel-linux-uclibc/lib/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib/mipsel-linux-uclibc/4.2.4/ /opt/brcm/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib/"
7125 # Run-time system search path for libraries
7126 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/lib/nvidia-settings /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/nvidia-current /usr/lib32/nvidia-current /lib32 /usr/lib32 "
7128 # Fix the shell variable $srcfile for the compiler.
7129 fix_srcfile_path=""
7131 # Set to yes if exported symbols are required.
7132 always_export_symbols=no
7134 # The commands to list exported symbols.
7135 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7137 # The commands to extract the exported symbol list from a shared archive.
7138 extract_expsyms_cmds=""
7140 # Symbols that should not be listed in the preloaded symbols.
7141 exclude_expsyms=""
7143 # Symbols that must always be exported.
7144 include_expsyms=""
7146 # ### END LIBTOOL TAG CONFIG: CXX