usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / ntfs-3g / libtool
blobcdf26bc10999670de1725ce3da51de448448cd7f
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU ntfs-3g 2013.1.13)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
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=no
55 # Whether or not to build static libraries.
56 build_old_libs=yes
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=yes
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
65 fast_install=needless
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 # LTCC compiler flags.
88 LTCFLAGS="-Os -Wall -DLINUX26 -DCONFIG_BCMWL5 -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 -ffunction-sections -fdata-sections"
90 # A language-specific compiler.
91 CC="mipsel-uclibc-gcc"
93 # Is the compiler the GNU C compiler?
94 with_gcc=yes
96 # An ERE matcher.
97 EGREP="/bin/grep -E"
99 # The linker used to build libraries.
100 LD="mipsel-uclibc-ld"
102 # Whether we need hard or soft links.
103 LN_S="ln -s"
105 # A BSD-compatible nm program.
106 NM="mipsel-uclibc-nm"
108 # A symbol stripping program
109 STRIP="mipsel-uclibc-strip -R .note -R .comment"
111 # Used to examine libraries when file_magic_cmd begins "file"
112 MAGIC_CMD=file
114 # Used on cygwin: DLL creation program.
115 DLLTOOL="dlltool"
117 # Used on cygwin: object dumper.
118 OBJDUMP="objdump"
120 # Used on cygwin: assembler.
121 AS="mipsel-uclibc-as"
123 # The name of the directory that contains temporary libtool files.
124 objdir=.libs
126 # How to create reloadable object files.
127 reload_flag=" -r"
128 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
130 # How to pass a linker flag through the compiler.
131 wl="-Wl,"
133 # Object file suffix (normally "o").
134 objext="o"
136 # Old archive suffix (normally "a").
137 libext="a"
139 # Shared library suffix (normally ".so").
140 shrext_cmds='.so'
142 # Executable file suffix (normally "").
143 exeext=""
145 # Additional compiler flags for building library objects.
146 pic_flag=" -fPIC -DPIC"
147 pic_mode=default
149 # What is the maximum length of a command?
150 max_cmd_len=3458764513820540925
152 # Does compiler simultaneously support -c and -o options?
153 compiler_c_o="yes"
155 # Must we lock files when doing compilation?
156 need_locks="no"
158 # Do we need the lib prefix for modules?
159 need_lib_prefix=no
161 # Do we need a version for libraries?
162 need_version=no
164 # Whether dlopen is supported.
165 dlopen_support=unknown
167 # Whether dlopen of programs is supported.
168 dlopen_self=unknown
170 # Whether dlopen of statically linked programs is supported.
171 dlopen_self_static=unknown
173 # Compiler flag to prevent dynamic linking.
174 link_static_flag="-static"
176 # Compiler flag to turn off builtin functions.
177 no_builtin_flag=" -fno-builtin"
179 # Compiler flag to allow reflexive dlopens.
180 export_dynamic_flag_spec="\${wl}--export-dynamic"
182 # Compiler flag to generate shared objects directly from archives.
183 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
185 # Compiler flag to generate thread-safe objects.
186 thread_safe_flag_spec=""
188 # Library versioning type.
189 version_type=linux
191 # Format of library name prefix.
192 libname_spec="lib\$name"
194 # List of archive names. First name is the real one, the rest are links.
195 # The last name is the one that the linker finds with -lNAME.
196 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
198 # The coded name of the library, if different from the real name.
199 soname_spec="\${libname}\${release}\${shared_ext}\$major"
201 # Commands used to build and install an old-style archive.
202 RANLIB="mipsel-uclibc-ranlib"
203 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
204 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
205 old_postuninstall_cmds=""
207 # Create an old-style archive from a shared archive.
208 old_archive_from_new_cmds=""
210 # Create a temporary old-style archive to link instead of a shared archive.
211 old_archive_from_expsyms_cmds=""
213 # Commands used to build and install a shared archive.
214 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
215 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
216 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
217 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
218 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
219 postinstall_cmds=""
220 postuninstall_cmds=""
222 # Commands used to build a loadable module (assumed same as above if empty)
223 module_cmds=""
224 module_expsym_cmds=""
226 # Commands to strip libraries.
227 old_striplib="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
228 striplib="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
230 # Dependencies to place before the objects being linked to create a
231 # shared library.
232 predep_objects=""
234 # Dependencies to place after the objects being linked to create a
235 # shared library.
236 postdep_objects=""
238 # Dependencies to place before the objects being linked to create a
239 # shared library.
240 predeps=""
242 # Dependencies to place after the objects being linked to create a
243 # shared library.
244 postdeps=""
246 # The directories searched by this compiler when creating a shared
247 # library
248 compiler_lib_search_dirs=""
250 # The library search path used internally by the compiler when linking
251 # a shared library.
252 compiler_lib_search_path=""
254 # Method to check whether dependent libraries are shared objects.
255 deplibs_check_method="pass_all"
257 # Command to use when deplibs_check_method == file_magic.
258 file_magic_cmd="\$MAGIC_CMD"
260 # Flag that allows shared libraries with undefined symbols to be built.
261 allow_undefined_flag=""
263 # Flag that forces no undefined symbols.
264 no_undefined_flag=""
266 # Commands used to finish a libtool library installation in a directory.
267 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
269 # Same as above, but a single script fragment to be evaled but not shown.
270 finish_eval=""
272 # Take the output of nm and produce a listing of raw symbols and C names.
273 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
275 # Transform the output of nm in a proper C declaration
276 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
278 # Transform the output of nm in a C name address pair
279 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
281 # This is the shared library runtime path variable.
282 runpath_var=LD_RUN_PATH
284 # This is the shared library path variable.
285 shlibpath_var=LD_LIBRARY_PATH
287 # Is shlibpath searched before the hard-coded library search path?
288 shlibpath_overrides_runpath=no
290 # How to hardcode a shared library path into an executable.
291 hardcode_action=immediate
293 # Whether we should hardcode library paths into libraries.
294 hardcode_into_libs=yes
296 # Flag to hardcode $libdir into a binary during linking.
297 # This must work even if $libdir does not exist.
298 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
300 # If ld is used when linking, flag to hardcode $libdir into
301 # a binary during linking. This must work even if $libdir does
302 # not exist.
303 hardcode_libdir_flag_spec_ld=""
305 # Whether we need a single -rpath flag with a separated argument.
306 hardcode_libdir_separator=""
308 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
309 # resulting binary.
310 hardcode_direct=no
312 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
313 # resulting binary.
314 hardcode_minus_L=no
316 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
317 # the resulting binary.
318 hardcode_shlibpath_var=unsupported
320 # Set to yes if building a shared library automatically hardcodes DIR into the library
321 # and all subsequent libraries and executables linked against it.
322 hardcode_automatic=no
324 # Variables whose values should be saved in libtool wrapper scripts and
325 # restored at relink time.
326 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
328 # Whether libtool must link a program against all its dependency libraries.
329 link_all_deplibs=unknown
331 # Compile-time system search path for libraries
332 sys_lib_search_path_spec="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4 /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib"
334 # Run-time system search path for libraries
335 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 "
337 # Fix the shell variable $srcfile for the compiler.
338 fix_srcfile_path=""
340 # Set to yes if exported symbols are required.
341 always_export_symbols=no
343 # The commands to list exported symbols.
344 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
346 # The commands to extract the exported symbol list from a shared archive.
347 extract_expsyms_cmds=""
349 # Symbols that should not be listed in the preloaded symbols.
350 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
352 # Symbols that must always be exported.
353 include_expsyms=""
355 # ### END LIBTOOL CONFIG
357 # ltmain.sh - Provide generalized library-building support services.
358 # NOTE: Changing this file will not affect anything until you rerun configure.
360 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
361 # 2007, 2008 Free Software Foundation, Inc.
362 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
364 # This program is free software; you can redistribute it and/or modify
365 # it under the terms of the GNU General Public License as published by
366 # the Free Software Foundation; either version 2 of the License, or
367 # (at your option) any later version.
369 # This program is distributed in the hope that it will be useful, but
370 # WITHOUT ANY WARRANTY; without even the implied warranty of
371 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
372 # General Public License for more details.
374 # You should have received a copy of the GNU General Public License
375 # along with this program; if not, write to the Free Software
376 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
378 # As a special exception to the GNU General Public License, if you
379 # distribute this file as part of a program that contains a
380 # configuration script generated by Autoconf, you may include it under
381 # the same distribution terms that you use for the rest of that program.
383 basename="s,^.*/,,g"
385 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
386 # is ksh but when the shell is invoked as "sh" and the current value of
387 # the _XPG environment variable is not equal to 1 (one), the special
388 # positional parameter $0, within a function call, is the name of the
389 # function.
390 progpath="$0"
392 # The name of this program:
393 progname=`echo "$progpath" | $SED $basename`
394 modename="$progname"
396 # Global variables:
397 EXIT_SUCCESS=0
398 EXIT_FAILURE=1
400 PROGRAM=ltmain.sh
401 PACKAGE=libtool
402 VERSION=1.5.26
403 TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
405 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
406 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
407 emulate sh
408 NULLCMD=:
409 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
410 # is contrary to our usage. Disable this feature.
411 alias -g '${1+"$@"}'='"$@"'
412 setopt NO_GLOB_SUBST
413 else
414 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
416 BIN_SH=xpg4; export BIN_SH # for Tru64
417 DUALCASE=1; export DUALCASE # for MKS sh
419 # Check that we have a working $echo.
420 if test "X$1" = X--no-reexec; then
421 # Discard the --no-reexec flag, and continue.
422 shift
423 elif test "X$1" = X--fallback-echo; then
424 # Avoid inline document here, it may be left over
426 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
427 # Yippee, $echo works!
429 else
430 # Restart under the correct shell, and then maybe $echo will work.
431 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
434 if test "X$1" = X--fallback-echo; then
435 # used as fallback echo
436 shift
437 cat <<EOF
440 exit $EXIT_SUCCESS
443 default_mode=
444 help="Try \`$progname --help' for more information."
445 magic="%%%MAGIC variable%%%"
446 mkdir="mkdir"
447 mv="mv -f"
448 rm="rm -f"
450 # Sed substitution that helps us do robust quoting. It backslashifies
451 # metacharacters that are still active within double-quoted strings.
452 Xsed="${SED}"' -e 1s/^X//'
453 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
454 # test EBCDIC or ASCII
455 case `echo X|tr X '\101'` in
456 A) # ASCII based system
457 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
458 SP2NL='tr \040 \012'
459 NL2SP='tr \015\012 \040\040'
461 *) # EBCDIC based system
462 SP2NL='tr \100 \n'
463 NL2SP='tr \r\n \100\100'
465 esac
467 # NLS nuisances.
468 # Only set LANG and LC_ALL to C if already set.
469 # These must not be set unconditionally because not all systems understand
470 # e.g. LANG=C (notably SCO).
471 # We save the old values to restore during execute mode.
472 lt_env=
473 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
475 eval "if test \"\${$lt_var+set}\" = set; then
476 save_$lt_var=\$$lt_var
477 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
478 $lt_var=C
479 export $lt_var
481 done
483 if test -n "$lt_env"; then
484 lt_env="env $lt_env"
487 # Make sure IFS has a sensible default
488 lt_nl='
490 IFS=" $lt_nl"
492 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
493 $echo "$modename: not configured to build any kind of library" 1>&2
494 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
495 exit $EXIT_FAILURE
498 # Global variables.
499 mode=$default_mode
500 nonopt=
501 prev=
502 prevopt=
503 run=
504 show="$echo"
505 show_help=
506 execute_dlfiles=
507 duplicate_deps=no
508 preserve_args=
509 lo2o="s/\\.lo\$/.${objext}/"
510 o2lo="s/\\.${objext}\$/.lo/"
511 extracted_archives=
512 extracted_serial=0
514 #####################################
515 # Shell function definitions:
516 # This seems to be the best place for them
518 # func_mktempdir [string]
519 # Make a temporary directory that won't clash with other running
520 # libtool processes, and avoids race conditions if possible. If
521 # given, STRING is the basename for that directory.
522 func_mktempdir ()
524 my_template="${TMPDIR-/tmp}/${1-$progname}"
526 if test "$run" = ":"; then
527 # Return a directory name, but don't create it in dry-run mode
528 my_tmpdir="${my_template}-$$"
529 else
531 # If mktemp works, use that first and foremost
532 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
534 if test ! -d "$my_tmpdir"; then
535 # Failing that, at least try and use $RANDOM to avoid a race
536 my_tmpdir="${my_template}-${RANDOM-0}$$"
538 save_mktempdir_umask=`umask`
539 umask 0077
540 $mkdir "$my_tmpdir"
541 umask $save_mktempdir_umask
544 # If we're not in dry-run mode, bomb out on failure
545 test -d "$my_tmpdir" || {
546 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
547 exit $EXIT_FAILURE
551 $echo "X$my_tmpdir" | $Xsed
555 # func_win32_libid arg
556 # return the library type of file 'arg'
558 # Need a lot of goo to handle *both* DLLs and import libs
559 # Has to be a shell function in order to 'eat' the argument
560 # that is supplied when $file_magic_command is called.
561 func_win32_libid ()
563 win32_libid_type="unknown"
564 win32_fileres=`file -L $1 2>/dev/null`
565 case $win32_fileres in
566 *ar\ archive\ import\ library*) # definitely import
567 win32_libid_type="x86 archive import"
569 *ar\ archive*) # could be an import, or static
570 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
571 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
572 win32_nmres=`eval $NM -f posix -A $1 | \
573 $SED -n -e '1,100{
574 / I /{
575 s,.*,import,
580 case $win32_nmres in
581 import*) win32_libid_type="x86 archive import";;
582 *) win32_libid_type="x86 archive static";;
583 esac
586 *DLL*)
587 win32_libid_type="x86 DLL"
589 *executable*) # but shell scripts are "executable" too...
590 case $win32_fileres in
591 *MS\ Windows\ PE\ Intel*)
592 win32_libid_type="x86 DLL"
594 esac
596 esac
597 $echo $win32_libid_type
601 # func_infer_tag arg
602 # Infer tagged configuration to use if any are available and
603 # if one wasn't chosen via the "--tag" command line option.
604 # Only attempt this if the compiler in the base compile
605 # command doesn't match the default compiler.
606 # arg is usually of the form 'gcc ...'
607 func_infer_tag ()
609 if test -n "$available_tags" && test -z "$tagname"; then
610 CC_quoted=
611 for arg in $CC; do
612 case $arg in
613 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
614 arg="\"$arg\""
616 esac
617 CC_quoted="$CC_quoted $arg"
618 done
619 case $@ in
620 # Blanks in the command may have been stripped by the calling shell,
621 # but not from the CC environment variable when configure was run.
622 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
623 # Blanks at the start of $base_compile will cause this to fail
624 # if we don't check for them as well.
626 for z in $available_tags; do
627 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
628 # Evaluate the configuration.
629 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
630 CC_quoted=
631 for arg in $CC; do
632 # Double-quote args containing other shell metacharacters.
633 case $arg in
634 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
635 arg="\"$arg\""
637 esac
638 CC_quoted="$CC_quoted $arg"
639 done
640 case "$@ " in
641 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
642 # The compiler in the base compile command matches
643 # the one in the tagged configuration.
644 # Assume this is the tagged configuration we want.
645 tagname=$z
646 break
648 esac
650 done
651 # If $tagname still isn't set, then no tagged configuration
652 # was found and let the user know that the "--tag" command
653 # line option must be used.
654 if test -z "$tagname"; then
655 $echo "$modename: unable to infer tagged configuration"
656 $echo "$modename: specify a tag with \`--tag'" 1>&2
657 exit $EXIT_FAILURE
658 # else
659 # $echo "$modename: using $tagname tagged configuration"
662 esac
667 # func_extract_an_archive dir oldlib
668 func_extract_an_archive ()
670 f_ex_an_ar_dir="$1"; shift
671 f_ex_an_ar_oldlib="$1"
673 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
674 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
675 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
677 else
678 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
679 exit $EXIT_FAILURE
683 # func_extract_archives gentop oldlib ...
684 func_extract_archives ()
686 my_gentop="$1"; shift
687 my_oldlibs=${1+"$@"}
688 my_oldobjs=""
689 my_xlib=""
690 my_xabs=""
691 my_xdir=""
692 my_status=""
694 $show "${rm}r $my_gentop"
695 $run ${rm}r "$my_gentop"
696 $show "$mkdir $my_gentop"
697 $run $mkdir "$my_gentop"
698 my_status=$?
699 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
700 exit $my_status
703 for my_xlib in $my_oldlibs; do
704 # Extract the objects.
705 case $my_xlib in
706 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
707 *) my_xabs=`pwd`"/$my_xlib" ;;
708 esac
709 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
710 my_xlib_u=$my_xlib
711 while :; do
712 case " $extracted_archives " in
713 *" $my_xlib_u "*)
714 extracted_serial=`expr $extracted_serial + 1`
715 my_xlib_u=lt$extracted_serial-$my_xlib ;;
716 *) break ;;
717 esac
718 done
719 extracted_archives="$extracted_archives $my_xlib_u"
720 my_xdir="$my_gentop/$my_xlib_u"
722 $show "${rm}r $my_xdir"
723 $run ${rm}r "$my_xdir"
724 $show "$mkdir $my_xdir"
725 $run $mkdir "$my_xdir"
726 exit_status=$?
727 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
728 exit $exit_status
730 case $host in
731 *-darwin*)
732 $show "Extracting $my_xabs"
733 # Do not bother doing anything if just a dry run
734 if test -z "$run"; then
735 darwin_orig_dir=`pwd`
736 cd $my_xdir || exit $?
737 darwin_archive=$my_xabs
738 darwin_curdir=`pwd`
739 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
740 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
741 if test -n "$darwin_arches"; then
742 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
743 darwin_arch=
744 $show "$darwin_base_archive has multiple architectures $darwin_arches"
745 for darwin_arch in $darwin_arches ; do
746 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
747 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
748 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
749 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
750 cd "$darwin_curdir"
751 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
752 done # $darwin_arches
753 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
754 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
755 darwin_file=
756 darwin_files=
757 for darwin_file in $darwin_filelist; do
758 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
759 lipo -create -output "$darwin_file" $darwin_files
760 done # $darwin_filelist
761 ${rm}r unfat-$$
762 cd "$darwin_orig_dir"
763 else
764 cd "$darwin_orig_dir"
765 func_extract_an_archive "$my_xdir" "$my_xabs"
766 fi # $darwin_arches
767 fi # $run
770 func_extract_an_archive "$my_xdir" "$my_xabs"
772 esac
773 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
774 done
775 func_extract_archives_result="$my_oldobjs"
777 # End of Shell function definitions
778 #####################################
780 # Darwin sucks
781 eval std_shrext=\"$shrext_cmds\"
783 disable_libs=no
785 # Parse our command line options once, thoroughly.
786 while test "$#" -gt 0
788 arg="$1"
789 shift
791 case $arg in
792 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
793 *) optarg= ;;
794 esac
796 # If the previous option needs an argument, assign it.
797 if test -n "$prev"; then
798 case $prev in
799 execute_dlfiles)
800 execute_dlfiles="$execute_dlfiles $arg"
802 tag)
803 tagname="$arg"
804 preserve_args="${preserve_args}=$arg"
806 # Check whether tagname contains only valid characters
807 case $tagname in
808 *[!-_A-Za-z0-9,/]*)
809 $echo "$progname: invalid tag name: $tagname" 1>&2
810 exit $EXIT_FAILURE
812 esac
814 case $tagname in
816 # Don't test for the "default" C tag, as we know, it's there, but
817 # not specially marked.
820 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
821 taglist="$taglist $tagname"
822 # Evaluate the configuration.
823 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
824 else
825 $echo "$progname: ignoring unknown tag $tagname" 1>&2
828 esac
831 eval "$prev=\$arg"
833 esac
835 prev=
836 prevopt=
837 continue
840 # Have we seen a non-optional argument yet?
841 case $arg in
842 --help)
843 show_help=yes
846 --version)
847 echo "\
848 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
850 Copyright (C) 2008 Free Software Foundation, Inc.
851 This is free software; see the source for copying conditions. There is NO
852 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
853 exit $?
856 --config)
857 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
858 # Now print the configurations for the tags.
859 for tagname in $taglist; do
860 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
861 done
862 exit $?
865 --debug)
866 $echo "$progname: enabling shell trace mode"
867 set -x
868 preserve_args="$preserve_args $arg"
871 --dry-run | -n)
872 run=:
875 --features)
876 $echo "host: $host"
877 if test "$build_libtool_libs" = yes; then
878 $echo "enable shared libraries"
879 else
880 $echo "disable shared libraries"
882 if test "$build_old_libs" = yes; then
883 $echo "enable static libraries"
884 else
885 $echo "disable static libraries"
887 exit $?
890 --finish) mode="finish" ;;
892 --mode) prevopt="--mode" prev=mode ;;
893 --mode=*) mode="$optarg" ;;
895 --preserve-dup-deps) duplicate_deps="yes" ;;
897 --quiet | --silent)
898 show=:
899 preserve_args="$preserve_args $arg"
902 --tag)
903 prevopt="--tag"
904 prev=tag
905 preserve_args="$preserve_args --tag"
907 --tag=*)
908 set tag "$optarg" ${1+"$@"}
909 shift
910 prev=tag
911 preserve_args="$preserve_args --tag"
914 -dlopen)
915 prevopt="-dlopen"
916 prev=execute_dlfiles
920 $echo "$modename: unrecognized option \`$arg'" 1>&2
921 $echo "$help" 1>&2
922 exit $EXIT_FAILURE
926 nonopt="$arg"
927 break
929 esac
930 done
932 if test -n "$prevopt"; then
933 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
934 $echo "$help" 1>&2
935 exit $EXIT_FAILURE
938 case $disable_libs in
939 no)
941 shared)
942 build_libtool_libs=no
943 build_old_libs=yes
945 static)
946 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
948 esac
950 # If this variable is set in any of the actions, the command in it
951 # will be execed at the end. This prevents here-documents from being
952 # left over by shells.
953 exec_cmd=
955 if test -z "$show_help"; then
957 # Infer the operation mode.
958 if test -z "$mode"; then
959 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
960 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
961 case $nonopt in
962 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
963 mode=link
964 for arg
966 case $arg in
968 mode=compile
969 break
971 esac
972 done
974 *db | *dbx | *strace | *truss)
975 mode=execute
977 *install*|cp|mv)
978 mode=install
980 *rm)
981 mode=uninstall
984 # If we have no mode, but dlfiles were specified, then do execute mode.
985 test -n "$execute_dlfiles" && mode=execute
987 # Just use the default operation mode.
988 if test -z "$mode"; then
989 if test -n "$nonopt"; then
990 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
991 else
992 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
996 esac
999 # Only execute mode is allowed to have -dlopen flags.
1000 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1001 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
1002 $echo "$help" 1>&2
1003 exit $EXIT_FAILURE
1006 # Change the help message to a mode-specific one.
1007 generic_help="$help"
1008 help="Try \`$modename --help --mode=$mode' for more information."
1010 # These modes are in order of execution frequency so that they run quickly.
1011 case $mode in
1012 # libtool compile mode
1013 compile)
1014 modename="$modename: compile"
1015 # Get the compilation command and the source file.
1016 base_compile=
1017 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1018 suppress_opt=yes
1019 suppress_output=
1020 arg_mode=normal
1021 libobj=
1022 later=
1024 for arg
1026 case $arg_mode in
1027 arg )
1028 # do not "continue". Instead, add this to base_compile
1029 lastarg="$arg"
1030 arg_mode=normal
1033 target )
1034 libobj="$arg"
1035 arg_mode=normal
1036 continue
1039 normal )
1040 # Accept any command-line options.
1041 case $arg in
1043 if test -n "$libobj" ; then
1044 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
1045 exit $EXIT_FAILURE
1047 arg_mode=target
1048 continue
1051 -static | -prefer-pic | -prefer-non-pic)
1052 later="$later $arg"
1053 continue
1056 -no-suppress)
1057 suppress_opt=no
1058 continue
1061 -Xcompiler)
1062 arg_mode=arg # the next one goes into the "base_compile" arg list
1063 continue # The current "srcfile" will either be retained or
1064 ;; # replaced later. I would guess that would be a bug.
1066 -Wc,*)
1067 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
1068 lastarg=
1069 save_ifs="$IFS"; IFS=','
1070 for arg in $args; do
1071 IFS="$save_ifs"
1073 # Double-quote args containing other shell metacharacters.
1074 # Many Bourne shells cannot handle close brackets correctly
1075 # in scan sets, so we specify it separately.
1076 case $arg in
1077 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1078 arg="\"$arg\""
1080 esac
1081 lastarg="$lastarg $arg"
1082 done
1083 IFS="$save_ifs"
1084 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
1086 # Add the arguments to base_compile.
1087 base_compile="$base_compile $lastarg"
1088 continue
1092 # Accept the current argument as the source file.
1093 # The previous "srcfile" becomes the current argument.
1095 lastarg="$srcfile"
1096 srcfile="$arg"
1098 esac # case $arg
1100 esac # case $arg_mode
1102 # Aesthetically quote the previous argument.
1103 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
1105 case $lastarg in
1106 # Double-quote args containing other shell metacharacters.
1107 # Many Bourne shells cannot handle close brackets correctly
1108 # in scan sets, and some SunOS ksh mistreat backslash-escaping
1109 # in scan sets (worked around with variable expansion),
1110 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
1111 # at all, so we specify them separately.
1112 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1113 lastarg="\"$lastarg\""
1115 esac
1117 base_compile="$base_compile $lastarg"
1118 done # for arg
1120 case $arg_mode in
1121 arg)
1122 $echo "$modename: you must specify an argument for -Xcompile"
1123 exit $EXIT_FAILURE
1125 target)
1126 $echo "$modename: you must specify a target with \`-o'" 1>&2
1127 exit $EXIT_FAILURE
1130 # Get the name of the library object.
1131 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
1133 esac
1135 # Recognize several different file suffixes.
1136 # If the user specifies -o file.o, it is replaced with file.lo
1137 xform='[cCFSifmso]'
1138 case $libobj in
1139 *.ada) xform=ada ;;
1140 *.adb) xform=adb ;;
1141 *.ads) xform=ads ;;
1142 *.asm) xform=asm ;;
1143 *.c++) xform=c++ ;;
1144 *.cc) xform=cc ;;
1145 *.ii) xform=ii ;;
1146 *.class) xform=class ;;
1147 *.cpp) xform=cpp ;;
1148 *.cxx) xform=cxx ;;
1149 *.[fF][09]?) xform=[fF][09]. ;;
1150 *.for) xform=for ;;
1151 *.java) xform=java ;;
1152 *.obj) xform=obj ;;
1153 *.sx) xform=sx ;;
1154 esac
1156 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
1158 case $libobj in
1159 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
1161 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
1162 exit $EXIT_FAILURE
1164 esac
1166 func_infer_tag $base_compile
1168 for arg in $later; do
1169 case $arg in
1170 -static)
1171 build_old_libs=yes
1172 continue
1175 -prefer-pic)
1176 pic_mode=yes
1177 continue
1180 -prefer-non-pic)
1181 pic_mode=no
1182 continue
1184 esac
1185 done
1187 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
1188 case $qlibobj in
1189 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1190 qlibobj="\"$qlibobj\"" ;;
1191 esac
1192 test "X$libobj" != "X$qlibobj" \
1193 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
1194 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
1195 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
1196 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1197 if test "X$xdir" = "X$obj"; then
1198 xdir=
1199 else
1200 xdir=$xdir/
1202 lobj=${xdir}$objdir/$objname
1204 if test -z "$base_compile"; then
1205 $echo "$modename: you must specify a compilation command" 1>&2
1206 $echo "$help" 1>&2
1207 exit $EXIT_FAILURE
1210 # Delete any leftover library objects.
1211 if test "$build_old_libs" = yes; then
1212 removelist="$obj $lobj $libobj ${libobj}T"
1213 else
1214 removelist="$lobj $libobj ${libobj}T"
1217 $run $rm $removelist
1218 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1220 # On Cygwin there's no "real" PIC flag so we must build both object types
1221 case $host_os in
1222 cygwin* | mingw* | pw32* | os2*)
1223 pic_mode=default
1225 esac
1226 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1227 # non-PIC code in shared libraries is not supported
1228 pic_mode=default
1231 # Calculate the filename of the output object if compiler does
1232 # not support -o with -c
1233 if test "$compiler_c_o" = no; then
1234 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1235 lockfile="$output_obj.lock"
1236 removelist="$removelist $output_obj $lockfile"
1237 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
1238 else
1239 output_obj=
1240 need_locks=no
1241 lockfile=
1244 # Lock this critical section if it is needed
1245 # We use this script file to make the link, it avoids creating a new file
1246 if test "$need_locks" = yes; then
1247 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
1248 $show "Waiting for $lockfile to be removed"
1249 sleep 2
1250 done
1251 elif test "$need_locks" = warn; then
1252 if test -f "$lockfile"; then
1253 $echo "\
1254 *** ERROR, $lockfile exists and contains:
1255 `cat $lockfile 2>/dev/null`
1257 This indicates that another process is trying to use the same
1258 temporary object file, and libtool could not work around it because
1259 your compiler does not support \`-c' and \`-o' together. If you
1260 repeat this compilation, it may succeed, by chance, but you had better
1261 avoid parallel builds (make -j) in this platform, or get a better
1262 compiler."
1264 $run $rm $removelist
1265 exit $EXIT_FAILURE
1267 $echo "$srcfile" > "$lockfile"
1270 if test -n "$fix_srcfile_path"; then
1271 eval srcfile=\"$fix_srcfile_path\"
1273 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
1274 case $qsrcfile in
1275 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1276 qsrcfile="\"$qsrcfile\"" ;;
1277 esac
1279 $run $rm "$libobj" "${libobj}T"
1281 # Create a libtool object file (analogous to a ".la" file),
1282 # but don't create it if we're doing a dry run.
1283 test -z "$run" && cat > ${libobj}T <<EOF
1284 # $libobj - a libtool object file
1285 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
1287 # Please DO NOT delete this file!
1288 # It is necessary for linking the library.
1290 # Name of the PIC object.
1293 # Only build a PIC object if we are building libtool libraries.
1294 if test "$build_libtool_libs" = yes; then
1295 # Without this assignment, base_compile gets emptied.
1296 fbsd_hideous_sh_bug=$base_compile
1298 if test "$pic_mode" != no; then
1299 command="$base_compile $qsrcfile $pic_flag"
1300 else
1301 # Don't build PIC code
1302 command="$base_compile $qsrcfile"
1305 if test ! -d "${xdir}$objdir"; then
1306 $show "$mkdir ${xdir}$objdir"
1307 $run $mkdir ${xdir}$objdir
1308 exit_status=$?
1309 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1310 exit $exit_status
1314 if test -z "$output_obj"; then
1315 # Place PIC objects in $objdir
1316 command="$command -o $lobj"
1319 $run $rm "$lobj" "$output_obj"
1321 $show "$command"
1322 if $run eval $lt_env "$command"; then :
1323 else
1324 test -n "$output_obj" && $run $rm $removelist
1325 exit $EXIT_FAILURE
1328 if test "$need_locks" = warn &&
1329 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1330 $echo "\
1331 *** ERROR, $lockfile contains:
1332 `cat $lockfile 2>/dev/null`
1334 but it should contain:
1335 $srcfile
1337 This indicates that another process is trying to use the same
1338 temporary object file, and libtool could not work around it because
1339 your compiler does not support \`-c' and \`-o' together. If you
1340 repeat this compilation, it may succeed, by chance, but you had better
1341 avoid parallel builds (make -j) in this platform, or get a better
1342 compiler."
1344 $run $rm $removelist
1345 exit $EXIT_FAILURE
1348 # Just move the object if needed, then go on to compile the next one
1349 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1350 $show "$mv $output_obj $lobj"
1351 if $run $mv $output_obj $lobj; then :
1352 else
1353 error=$?
1354 $run $rm $removelist
1355 exit $error
1359 # Append the name of the PIC object to the libtool object file.
1360 test -z "$run" && cat >> ${libobj}T <<EOF
1361 pic_object='$objdir/$objname'
1365 # Allow error messages only from the first compilation.
1366 if test "$suppress_opt" = yes; then
1367 suppress_output=' >/dev/null 2>&1'
1369 else
1370 # No PIC object so indicate it doesn't exist in the libtool
1371 # object file.
1372 test -z "$run" && cat >> ${libobj}T <<EOF
1373 pic_object=none
1378 # Only build a position-dependent object if we build old libraries.
1379 if test "$build_old_libs" = yes; then
1380 if test "$pic_mode" != yes; then
1381 # Don't build PIC code
1382 command="$base_compile $qsrcfile"
1383 else
1384 command="$base_compile $qsrcfile $pic_flag"
1386 if test "$compiler_c_o" = yes; then
1387 command="$command -o $obj"
1390 # Suppress compiler output if we already did a PIC compilation.
1391 command="$command$suppress_output"
1392 $run $rm "$obj" "$output_obj"
1393 $show "$command"
1394 if $run eval $lt_env "$command"; then :
1395 else
1396 $run $rm $removelist
1397 exit $EXIT_FAILURE
1400 if test "$need_locks" = warn &&
1401 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1402 $echo "\
1403 *** ERROR, $lockfile contains:
1404 `cat $lockfile 2>/dev/null`
1406 but it should contain:
1407 $srcfile
1409 This indicates that another process is trying to use the same
1410 temporary object file, and libtool could not work around it because
1411 your compiler does not support \`-c' and \`-o' together. If you
1412 repeat this compilation, it may succeed, by chance, but you had better
1413 avoid parallel builds (make -j) in this platform, or get a better
1414 compiler."
1416 $run $rm $removelist
1417 exit $EXIT_FAILURE
1420 # Just move the object if needed
1421 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1422 $show "$mv $output_obj $obj"
1423 if $run $mv $output_obj $obj; then :
1424 else
1425 error=$?
1426 $run $rm $removelist
1427 exit $error
1431 # Append the name of the non-PIC object the libtool object file.
1432 # Only append if the libtool object file exists.
1433 test -z "$run" && cat >> ${libobj}T <<EOF
1434 # Name of the non-PIC object.
1435 non_pic_object='$objname'
1438 else
1439 # Append the name of the non-PIC object the libtool object file.
1440 # Only append if the libtool object file exists.
1441 test -z "$run" && cat >> ${libobj}T <<EOF
1442 # Name of the non-PIC object.
1443 non_pic_object=none
1448 $run $mv "${libobj}T" "${libobj}"
1450 # Unlock the critical section if it was locked
1451 if test "$need_locks" != no; then
1452 $run $rm "$lockfile"
1455 exit $EXIT_SUCCESS
1458 # libtool link mode
1459 link | relink)
1460 modename="$modename: link"
1461 case $host in
1462 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1463 # It is impossible to link a dll without this setting, and
1464 # we shouldn't force the makefile maintainer to figure out
1465 # which system we are compiling for in order to pass an extra
1466 # flag for every libtool invocation.
1467 # allow_undefined=no
1469 # FIXME: Unfortunately, there are problems with the above when trying
1470 # to make a dll which has undefined symbols, in which case not
1471 # even a static library is built. For now, we need to specify
1472 # -no-undefined on the libtool link line when we can be certain
1473 # that all symbols are satisfied, otherwise we get a static library.
1474 allow_undefined=yes
1477 allow_undefined=yes
1479 esac
1480 libtool_args="$nonopt"
1481 base_compile="$nonopt $@"
1482 compile_command="$nonopt"
1483 finalize_command="$nonopt"
1485 compile_rpath=
1486 finalize_rpath=
1487 compile_shlibpath=
1488 finalize_shlibpath=
1489 convenience=
1490 old_convenience=
1491 deplibs=
1492 old_deplibs=
1493 compiler_flags=
1494 linker_flags=
1495 dllsearchpath=
1496 lib_search_path=`pwd`
1497 inst_prefix_dir=
1499 avoid_version=no
1500 dlfiles=
1501 dlprefiles=
1502 dlself=no
1503 export_dynamic=no
1504 export_symbols=
1505 export_symbols_regex=
1506 generated=
1507 libobjs=
1508 ltlibs=
1509 module=no
1510 no_install=no
1511 objs=
1512 non_pic_objects=
1513 notinst_path= # paths that contain not-installed libtool libraries
1514 precious_files_regex=
1515 prefer_static_libs=no
1516 preload=no
1517 prev=
1518 prevarg=
1519 release=
1520 rpath=
1521 xrpath=
1522 perm_rpath=
1523 temp_rpath=
1524 thread_safe=no
1525 vinfo=
1526 vinfo_number=no
1527 single_module="${wl}-single_module"
1529 func_infer_tag $base_compile
1531 # We need to know -static, to get the right output filenames.
1532 for arg
1534 case $arg in
1535 -all-static | -static | -static-libtool-libs)
1536 case $arg in
1537 -all-static)
1538 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1539 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1541 if test -n "$link_static_flag"; then
1542 dlopen_self=$dlopen_self_static
1544 prefer_static_libs=yes
1546 -static)
1547 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1548 dlopen_self=$dlopen_self_static
1550 prefer_static_libs=built
1552 -static-libtool-libs)
1553 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1554 dlopen_self=$dlopen_self_static
1556 prefer_static_libs=yes
1558 esac
1559 build_libtool_libs=no
1560 build_old_libs=yes
1561 break
1563 esac
1564 done
1566 # See if our shared archives depend on static archives.
1567 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1569 # Go through the arguments, transforming them on the way.
1570 while test "$#" -gt 0; do
1571 arg="$1"
1572 shift
1573 case $arg in
1574 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1575 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1577 *) qarg=$arg ;;
1578 esac
1579 libtool_args="$libtool_args $qarg"
1581 # If the previous option needs an argument, assign it.
1582 if test -n "$prev"; then
1583 case $prev in
1584 output)
1585 compile_command="$compile_command @OUTPUT@"
1586 finalize_command="$finalize_command @OUTPUT@"
1588 esac
1590 case $prev in
1591 dlfiles|dlprefiles)
1592 if test "$preload" = no; then
1593 # Add the symbol object into the linking commands.
1594 compile_command="$compile_command @SYMFILE@"
1595 finalize_command="$finalize_command @SYMFILE@"
1596 preload=yes
1598 case $arg in
1599 *.la | *.lo) ;; # We handle these cases below.
1600 force)
1601 if test "$dlself" = no; then
1602 dlself=needless
1603 export_dynamic=yes
1605 prev=
1606 continue
1608 self)
1609 if test "$prev" = dlprefiles; then
1610 dlself=yes
1611 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1612 dlself=yes
1613 else
1614 dlself=needless
1615 export_dynamic=yes
1617 prev=
1618 continue
1621 if test "$prev" = dlfiles; then
1622 dlfiles="$dlfiles $arg"
1623 else
1624 dlprefiles="$dlprefiles $arg"
1626 prev=
1627 continue
1629 esac
1631 expsyms)
1632 export_symbols="$arg"
1633 if test ! -f "$arg"; then
1634 $echo "$modename: symbol file \`$arg' does not exist"
1635 exit $EXIT_FAILURE
1637 prev=
1638 continue
1640 expsyms_regex)
1641 export_symbols_regex="$arg"
1642 prev=
1643 continue
1645 inst_prefix)
1646 inst_prefix_dir="$arg"
1647 prev=
1648 continue
1650 precious_regex)
1651 precious_files_regex="$arg"
1652 prev=
1653 continue
1655 release)
1656 release="-$arg"
1657 prev=
1658 continue
1660 objectlist)
1661 if test -f "$arg"; then
1662 save_arg=$arg
1663 moreargs=
1664 for fil in `cat $save_arg`
1666 # moreargs="$moreargs $fil"
1667 arg=$fil
1668 # A libtool-controlled object.
1670 # Check to see that this really is a libtool object.
1671 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1672 pic_object=
1673 non_pic_object=
1675 # Read the .lo file
1676 # If there is no directory component, then add one.
1677 case $arg in
1678 */* | *\\*) . $arg ;;
1679 *) . ./$arg ;;
1680 esac
1682 if test -z "$pic_object" || \
1683 test -z "$non_pic_object" ||
1684 test "$pic_object" = none && \
1685 test "$non_pic_object" = none; then
1686 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1687 exit $EXIT_FAILURE
1690 # Extract subdirectory from the argument.
1691 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1692 if test "X$xdir" = "X$arg"; then
1693 xdir=
1694 else
1695 xdir="$xdir/"
1698 if test "$pic_object" != none; then
1699 # Prepend the subdirectory the object is found in.
1700 pic_object="$xdir$pic_object"
1702 if test "$prev" = dlfiles; then
1703 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1704 dlfiles="$dlfiles $pic_object"
1705 prev=
1706 continue
1707 else
1708 # If libtool objects are unsupported, then we need to preload.
1709 prev=dlprefiles
1713 # CHECK ME: I think I busted this. -Ossama
1714 if test "$prev" = dlprefiles; then
1715 # Preload the old-style object.
1716 dlprefiles="$dlprefiles $pic_object"
1717 prev=
1720 # A PIC object.
1721 libobjs="$libobjs $pic_object"
1722 arg="$pic_object"
1725 # Non-PIC object.
1726 if test "$non_pic_object" != none; then
1727 # Prepend the subdirectory the object is found in.
1728 non_pic_object="$xdir$non_pic_object"
1730 # A standard non-PIC object
1731 non_pic_objects="$non_pic_objects $non_pic_object"
1732 if test -z "$pic_object" || test "$pic_object" = none ; then
1733 arg="$non_pic_object"
1735 else
1736 # If the PIC object exists, use it instead.
1737 # $xdir was prepended to $pic_object above.
1738 non_pic_object="$pic_object"
1739 non_pic_objects="$non_pic_objects $non_pic_object"
1741 else
1742 # Only an error if not doing a dry-run.
1743 if test -z "$run"; then
1744 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1745 exit $EXIT_FAILURE
1746 else
1747 # Dry-run case.
1749 # Extract subdirectory from the argument.
1750 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1751 if test "X$xdir" = "X$arg"; then
1752 xdir=
1753 else
1754 xdir="$xdir/"
1757 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1758 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1759 libobjs="$libobjs $pic_object"
1760 non_pic_objects="$non_pic_objects $non_pic_object"
1763 done
1764 else
1765 $echo "$modename: link input file \`$save_arg' does not exist"
1766 exit $EXIT_FAILURE
1768 arg=$save_arg
1769 prev=
1770 continue
1772 rpath | xrpath)
1773 # We need an absolute path.
1774 case $arg in
1775 [\\/]* | [A-Za-z]:[\\/]*) ;;
1777 $echo "$modename: only absolute run-paths are allowed" 1>&2
1778 exit $EXIT_FAILURE
1780 esac
1781 if test "$prev" = rpath; then
1782 case "$rpath " in
1783 *" $arg "*) ;;
1784 *) rpath="$rpath $arg" ;;
1785 esac
1786 else
1787 case "$xrpath " in
1788 *" $arg "*) ;;
1789 *) xrpath="$xrpath $arg" ;;
1790 esac
1792 prev=
1793 continue
1795 xcompiler)
1796 compiler_flags="$compiler_flags $qarg"
1797 prev=
1798 compile_command="$compile_command $qarg"
1799 finalize_command="$finalize_command $qarg"
1800 continue
1802 xlinker)
1803 linker_flags="$linker_flags $qarg"
1804 compiler_flags="$compiler_flags $wl$qarg"
1805 prev=
1806 compile_command="$compile_command $wl$qarg"
1807 finalize_command="$finalize_command $wl$qarg"
1808 continue
1810 xcclinker)
1811 linker_flags="$linker_flags $qarg"
1812 compiler_flags="$compiler_flags $qarg"
1813 prev=
1814 compile_command="$compile_command $qarg"
1815 finalize_command="$finalize_command $qarg"
1816 continue
1818 shrext)
1819 shrext_cmds="$arg"
1820 prev=
1821 continue
1823 darwin_framework|darwin_framework_skip)
1824 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
1825 compile_command="$compile_command $arg"
1826 finalize_command="$finalize_command $arg"
1827 prev=
1828 continue
1831 eval "$prev=\"\$arg\""
1832 prev=
1833 continue
1835 esac
1836 fi # test -n "$prev"
1838 prevarg="$arg"
1840 case $arg in
1841 -all-static)
1842 if test -n "$link_static_flag"; then
1843 compile_command="$compile_command $link_static_flag"
1844 finalize_command="$finalize_command $link_static_flag"
1846 continue
1849 -allow-undefined)
1850 # FIXME: remove this flag sometime in the future.
1851 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1852 continue
1855 -avoid-version)
1856 avoid_version=yes
1857 continue
1860 -dlopen)
1861 prev=dlfiles
1862 continue
1865 -dlpreopen)
1866 prev=dlprefiles
1867 continue
1870 -export-dynamic)
1871 export_dynamic=yes
1872 continue
1875 -export-symbols | -export-symbols-regex)
1876 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1877 $echo "$modename: more than one -exported-symbols argument is not allowed"
1878 exit $EXIT_FAILURE
1880 if test "X$arg" = "X-export-symbols"; then
1881 prev=expsyms
1882 else
1883 prev=expsyms_regex
1885 continue
1888 -framework|-arch|-isysroot)
1889 case " $CC " in
1890 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1891 prev=darwin_framework_skip ;;
1892 *) compiler_flags="$compiler_flags $arg"
1893 prev=darwin_framework ;;
1894 esac
1895 compile_command="$compile_command $arg"
1896 finalize_command="$finalize_command $arg"
1897 continue
1900 -inst-prefix-dir)
1901 prev=inst_prefix
1902 continue
1905 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1906 # so, if we see these flags be careful not to treat them like -L
1907 -L[A-Z][A-Z]*:*)
1908 case $with_gcc/$host in
1909 no/*-*-irix* | /*-*-irix*)
1910 compile_command="$compile_command $arg"
1911 finalize_command="$finalize_command $arg"
1913 esac
1914 continue
1917 -L*)
1918 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1919 # We need an absolute path.
1920 case $dir in
1921 [\\/]* | [A-Za-z]:[\\/]*) ;;
1923 absdir=`cd "$dir" && pwd`
1924 if test -z "$absdir"; then
1925 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1926 absdir="$dir"
1927 notinst_path="$notinst_path $dir"
1929 dir="$absdir"
1931 esac
1932 case "$deplibs " in
1933 *" -L$dir "*) ;;
1935 deplibs="$deplibs -L$dir"
1936 lib_search_path="$lib_search_path $dir"
1938 esac
1939 case $host in
1940 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1941 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1942 case :$dllsearchpath: in
1943 *":$dir:"*) ;;
1944 *) dllsearchpath="$dllsearchpath:$dir";;
1945 esac
1946 case :$dllsearchpath: in
1947 *":$testbindir:"*) ;;
1948 *) dllsearchpath="$dllsearchpath:$testbindir";;
1949 esac
1951 esac
1952 continue
1955 -l*)
1956 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1957 case $host in
1958 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1959 # These systems don't actually have a C or math library (as such)
1960 continue
1962 *-*-os2*)
1963 # These systems don't actually have a C library (as such)
1964 test "X$arg" = "X-lc" && continue
1966 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1967 # Do not include libc due to us having libc/libc_r.
1968 test "X$arg" = "X-lc" && continue
1970 *-*-rhapsody* | *-*-darwin1.[012])
1971 # Rhapsody C and math libraries are in the System framework
1972 deplibs="$deplibs -framework System"
1973 continue
1975 *-*-sco3.2v5* | *-*-sco5v6*)
1976 # Causes problems with __ctype
1977 test "X$arg" = "X-lc" && continue
1979 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
1980 # Compiler inserts libc in the correct place for threads to work
1981 test "X$arg" = "X-lc" && continue
1983 esac
1984 elif test "X$arg" = "X-lc_r"; then
1985 case $host in
1986 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1987 # Do not include libc_r directly, use -pthread flag.
1988 continue
1990 esac
1992 deplibs="$deplibs $arg"
1993 continue
1996 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1997 # classes, name mangling, and exception handling.
1998 -model)
1999 compile_command="$compile_command $arg"
2000 compiler_flags="$compiler_flags $arg"
2001 finalize_command="$finalize_command $arg"
2002 prev=xcompiler
2003 continue
2006 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2007 compiler_flags="$compiler_flags $arg"
2008 compile_command="$compile_command $arg"
2009 finalize_command="$finalize_command $arg"
2010 continue
2013 -multi_module)
2014 single_module="${wl}-multi_module"
2015 continue
2018 -module)
2019 module=yes
2020 continue
2023 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
2024 # -r[0-9][0-9]* specifies the processor on the SGI compiler
2025 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
2026 # +DA*, +DD* enable 64-bit mode on the HP compiler
2027 # -q* pass through compiler args for the IBM compiler
2028 # -m* pass through architecture-specific compiler args for GCC
2029 # -m*, -t[45]*, -txscale* pass through architecture-specific
2030 # compiler args for GCC
2031 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
2032 # -F/path gives path to uninstalled frameworks, gcc on darwin
2033 # @file GCC response files
2034 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
2035 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
2037 # Unknown arguments in both finalize_command and compile_command need
2038 # to be aesthetically quoted because they are evaled later.
2039 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2040 case $arg in
2041 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2042 arg="\"$arg\""
2044 esac
2045 compile_command="$compile_command $arg"
2046 finalize_command="$finalize_command $arg"
2047 compiler_flags="$compiler_flags $arg"
2048 continue
2051 -shrext)
2052 prev=shrext
2053 continue
2056 -no-fast-install)
2057 fast_install=no
2058 continue
2061 -no-install)
2062 case $host in
2063 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
2064 # The PATH hackery in wrapper scripts is required on Windows
2065 # and Darwin in order for the loader to find any dlls it needs.
2066 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
2067 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
2068 fast_install=no
2070 *) no_install=yes ;;
2071 esac
2072 continue
2075 -no-undefined)
2076 allow_undefined=no
2077 continue
2080 -objectlist)
2081 prev=objectlist
2082 continue
2085 -o) prev=output ;;
2087 -precious-files-regex)
2088 prev=precious_regex
2089 continue
2092 -release)
2093 prev=release
2094 continue
2097 -rpath)
2098 prev=rpath
2099 continue
2103 prev=xrpath
2104 continue
2107 -R*)
2108 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
2109 # We need an absolute path.
2110 case $dir in
2111 [\\/]* | [A-Za-z]:[\\/]*) ;;
2113 $echo "$modename: only absolute run-paths are allowed" 1>&2
2114 exit $EXIT_FAILURE
2116 esac
2117 case "$xrpath " in
2118 *" $dir "*) ;;
2119 *) xrpath="$xrpath $dir" ;;
2120 esac
2121 continue
2124 -static | -static-libtool-libs)
2125 # The effects of -static are defined in a previous loop.
2126 # We used to do the same as -all-static on platforms that
2127 # didn't have a PIC flag, but the assumption that the effects
2128 # would be equivalent was wrong. It would break on at least
2129 # Digital Unix and AIX.
2130 continue
2133 -thread-safe)
2134 thread_safe=yes
2135 continue
2138 -version-info)
2139 prev=vinfo
2140 continue
2142 -version-number)
2143 prev=vinfo
2144 vinfo_number=yes
2145 continue
2148 -Wc,*)
2149 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
2150 arg=
2151 save_ifs="$IFS"; IFS=','
2152 for flag in $args; do
2153 IFS="$save_ifs"
2154 case $flag in
2155 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2156 flag="\"$flag\""
2158 esac
2159 arg="$arg $wl$flag"
2160 compiler_flags="$compiler_flags $flag"
2161 done
2162 IFS="$save_ifs"
2163 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2166 -Wl,*)
2167 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
2168 arg=
2169 save_ifs="$IFS"; IFS=','
2170 for flag in $args; do
2171 IFS="$save_ifs"
2172 case $flag in
2173 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2174 flag="\"$flag\""
2176 esac
2177 arg="$arg $wl$flag"
2178 compiler_flags="$compiler_flags $wl$flag"
2179 linker_flags="$linker_flags $flag"
2180 done
2181 IFS="$save_ifs"
2182 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
2185 -Xcompiler)
2186 prev=xcompiler
2187 continue
2190 -Xlinker)
2191 prev=xlinker
2192 continue
2195 -XCClinker)
2196 prev=xcclinker
2197 continue
2200 # Some other compiler flag.
2201 -* | +*)
2202 # Unknown arguments in both finalize_command and compile_command need
2203 # to be aesthetically quoted because they are evaled later.
2204 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2205 case $arg in
2206 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2207 arg="\"$arg\""
2209 esac
2212 *.$objext)
2213 # A standard object.
2214 objs="$objs $arg"
2217 *.lo)
2218 # A libtool-controlled object.
2220 # Check to see that this really is a libtool object.
2221 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2222 pic_object=
2223 non_pic_object=
2225 # Read the .lo file
2226 # If there is no directory component, then add one.
2227 case $arg in
2228 */* | *\\*) . $arg ;;
2229 *) . ./$arg ;;
2230 esac
2232 if test -z "$pic_object" || \
2233 test -z "$non_pic_object" ||
2234 test "$pic_object" = none && \
2235 test "$non_pic_object" = none; then
2236 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
2237 exit $EXIT_FAILURE
2240 # Extract subdirectory from the argument.
2241 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2242 if test "X$xdir" = "X$arg"; then
2243 xdir=
2244 else
2245 xdir="$xdir/"
2248 if test "$pic_object" != none; then
2249 # Prepend the subdirectory the object is found in.
2250 pic_object="$xdir$pic_object"
2252 if test "$prev" = dlfiles; then
2253 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
2254 dlfiles="$dlfiles $pic_object"
2255 prev=
2256 continue
2257 else
2258 # If libtool objects are unsupported, then we need to preload.
2259 prev=dlprefiles
2263 # CHECK ME: I think I busted this. -Ossama
2264 if test "$prev" = dlprefiles; then
2265 # Preload the old-style object.
2266 dlprefiles="$dlprefiles $pic_object"
2267 prev=
2270 # A PIC object.
2271 libobjs="$libobjs $pic_object"
2272 arg="$pic_object"
2275 # Non-PIC object.
2276 if test "$non_pic_object" != none; then
2277 # Prepend the subdirectory the object is found in.
2278 non_pic_object="$xdir$non_pic_object"
2280 # A standard non-PIC object
2281 non_pic_objects="$non_pic_objects $non_pic_object"
2282 if test -z "$pic_object" || test "$pic_object" = none ; then
2283 arg="$non_pic_object"
2285 else
2286 # If the PIC object exists, use it instead.
2287 # $xdir was prepended to $pic_object above.
2288 non_pic_object="$pic_object"
2289 non_pic_objects="$non_pic_objects $non_pic_object"
2291 else
2292 # Only an error if not doing a dry-run.
2293 if test -z "$run"; then
2294 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2295 exit $EXIT_FAILURE
2296 else
2297 # Dry-run case.
2299 # Extract subdirectory from the argument.
2300 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2301 if test "X$xdir" = "X$arg"; then
2302 xdir=
2303 else
2304 xdir="$xdir/"
2307 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2308 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2309 libobjs="$libobjs $pic_object"
2310 non_pic_objects="$non_pic_objects $non_pic_object"
2315 *.$libext)
2316 # An archive.
2317 deplibs="$deplibs $arg"
2318 old_deplibs="$old_deplibs $arg"
2319 continue
2322 *.la)
2323 # A libtool-controlled library.
2325 if test "$prev" = dlfiles; then
2326 # This library was specified with -dlopen.
2327 dlfiles="$dlfiles $arg"
2328 prev=
2329 elif test "$prev" = dlprefiles; then
2330 # The library was specified with -dlpreopen.
2331 dlprefiles="$dlprefiles $arg"
2332 prev=
2333 else
2334 deplibs="$deplibs $arg"
2336 continue
2339 # Some other compiler argument.
2341 # Unknown arguments in both finalize_command and compile_command need
2342 # to be aesthetically quoted because they are evaled later.
2343 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2344 case $arg in
2345 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2346 arg="\"$arg\""
2348 esac
2350 esac # arg
2352 # Now actually substitute the argument into the commands.
2353 if test -n "$arg"; then
2354 compile_command="$compile_command $arg"
2355 finalize_command="$finalize_command $arg"
2357 done # argument parsing loop
2359 if test -n "$prev"; then
2360 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2361 $echo "$help" 1>&2
2362 exit $EXIT_FAILURE
2365 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2366 eval arg=\"$export_dynamic_flag_spec\"
2367 compile_command="$compile_command $arg"
2368 finalize_command="$finalize_command $arg"
2371 oldlibs=
2372 # calculate the name of the file, without its directory
2373 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2374 libobjs_save="$libobjs"
2376 if test -n "$shlibpath_var"; then
2377 # get the directories listed in $shlibpath_var
2378 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2379 else
2380 shlib_search_path=
2382 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2383 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2385 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2386 if test "X$output_objdir" = "X$output"; then
2387 output_objdir="$objdir"
2388 else
2389 output_objdir="$output_objdir/$objdir"
2391 # Create the object directory.
2392 if test ! -d "$output_objdir"; then
2393 $show "$mkdir $output_objdir"
2394 $run $mkdir $output_objdir
2395 exit_status=$?
2396 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2397 exit $exit_status
2401 # Determine the type of output
2402 case $output in
2404 $echo "$modename: you must specify an output file" 1>&2
2405 $echo "$help" 1>&2
2406 exit $EXIT_FAILURE
2408 *.$libext) linkmode=oldlib ;;
2409 *.lo | *.$objext) linkmode=obj ;;
2410 *.la) linkmode=lib ;;
2411 *) linkmode=prog ;; # Anything else should be a program.
2412 esac
2414 case $host in
2415 *cygwin* | *mingw* | *pw32*)
2416 # don't eliminate duplications in $postdeps and $predeps
2417 duplicate_compiler_generated_deps=yes
2420 duplicate_compiler_generated_deps=$duplicate_deps
2422 esac
2423 specialdeplibs=
2425 libs=
2426 # Find all interdependent deplibs by searching for libraries
2427 # that are linked more than once (e.g. -la -lb -la)
2428 for deplib in $deplibs; do
2429 if test "X$duplicate_deps" = "Xyes" ; then
2430 case "$libs " in
2431 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2432 esac
2434 libs="$libs $deplib"
2435 done
2437 if test "$linkmode" = lib; then
2438 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2440 # Compute libraries that are listed more than once in $predeps
2441 # $postdeps and mark them as special (i.e., whose duplicates are
2442 # not to be eliminated).
2443 pre_post_deps=
2444 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2445 for pre_post_dep in $predeps $postdeps; do
2446 case "$pre_post_deps " in
2447 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2448 esac
2449 pre_post_deps="$pre_post_deps $pre_post_dep"
2450 done
2452 pre_post_deps=
2455 deplibs=
2456 newdependency_libs=
2457 newlib_search_path=
2458 need_relink=no # whether we're linking any uninstalled libtool libraries
2459 notinst_deplibs= # not-installed libtool libraries
2460 case $linkmode in
2461 lib)
2462 passes="conv link"
2463 for file in $dlfiles $dlprefiles; do
2464 case $file in
2465 *.la) ;;
2467 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2468 exit $EXIT_FAILURE
2470 esac
2471 done
2473 prog)
2474 compile_deplibs=
2475 finalize_deplibs=
2476 alldeplibs=no
2477 newdlfiles=
2478 newdlprefiles=
2479 passes="conv scan dlopen dlpreopen link"
2481 *) passes="conv"
2483 esac
2484 for pass in $passes; do
2485 if test "$linkmode,$pass" = "lib,link" ||
2486 test "$linkmode,$pass" = "prog,scan"; then
2487 libs="$deplibs"
2488 deplibs=
2490 if test "$linkmode" = prog; then
2491 case $pass in
2492 dlopen) libs="$dlfiles" ;;
2493 dlpreopen) libs="$dlprefiles" ;;
2494 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2495 esac
2497 if test "$pass" = dlopen; then
2498 # Collect dlpreopened libraries
2499 save_deplibs="$deplibs"
2500 deplibs=
2502 for deplib in $libs; do
2503 lib=
2504 found=no
2505 case $deplib in
2506 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
2507 if test "$linkmode,$pass" = "prog,link"; then
2508 compile_deplibs="$deplib $compile_deplibs"
2509 finalize_deplibs="$deplib $finalize_deplibs"
2510 else
2511 compiler_flags="$compiler_flags $deplib"
2513 continue
2515 -l*)
2516 if test "$linkmode" != lib && test "$linkmode" != prog; then
2517 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2518 continue
2520 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2521 if test "$linkmode" = lib; then
2522 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2523 else
2524 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2526 for searchdir in $searchdirs; do
2527 for search_ext in .la $std_shrext .so .a; do
2528 # Search the libtool library
2529 lib="$searchdir/lib${name}${search_ext}"
2530 if test -f "$lib"; then
2531 if test "$search_ext" = ".la"; then
2532 found=yes
2533 else
2534 found=no
2536 break 2
2538 done
2539 done
2540 if test "$found" != yes; then
2541 # deplib doesn't seem to be a libtool library
2542 if test "$linkmode,$pass" = "prog,link"; then
2543 compile_deplibs="$deplib $compile_deplibs"
2544 finalize_deplibs="$deplib $finalize_deplibs"
2545 else
2546 deplibs="$deplib $deplibs"
2547 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2549 continue
2550 else # deplib is a libtool library
2551 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2552 # We need to do some special things here, and not later.
2553 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2554 case " $predeps $postdeps " in
2555 *" $deplib "*)
2556 if (${SED} -e '2q' $lib |
2557 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2558 library_names=
2559 old_library=
2560 case $lib in
2561 */* | *\\*) . $lib ;;
2562 *) . ./$lib ;;
2563 esac
2564 for l in $old_library $library_names; do
2565 ll="$l"
2566 done
2567 if test "X$ll" = "X$old_library" ; then # only static version available
2568 found=no
2569 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2570 test "X$ladir" = "X$lib" && ladir="."
2571 lib=$ladir/$old_library
2572 if test "$linkmode,$pass" = "prog,link"; then
2573 compile_deplibs="$deplib $compile_deplibs"
2574 finalize_deplibs="$deplib $finalize_deplibs"
2575 else
2576 deplibs="$deplib $deplibs"
2577 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2579 continue
2583 *) ;;
2584 esac
2587 ;; # -l
2588 -L*)
2589 case $linkmode in
2590 lib)
2591 deplibs="$deplib $deplibs"
2592 test "$pass" = conv && continue
2593 newdependency_libs="$deplib $newdependency_libs"
2594 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2596 prog)
2597 if test "$pass" = conv; then
2598 deplibs="$deplib $deplibs"
2599 continue
2601 if test "$pass" = scan; then
2602 deplibs="$deplib $deplibs"
2603 else
2604 compile_deplibs="$deplib $compile_deplibs"
2605 finalize_deplibs="$deplib $finalize_deplibs"
2607 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2610 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2612 esac # linkmode
2613 continue
2614 ;; # -L
2615 -R*)
2616 if test "$pass" = link; then
2617 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2618 # Make sure the xrpath contains only unique directories.
2619 case "$xrpath " in
2620 *" $dir "*) ;;
2621 *) xrpath="$xrpath $dir" ;;
2622 esac
2624 deplibs="$deplib $deplibs"
2625 continue
2627 *.la) lib="$deplib" ;;
2628 *.$libext)
2629 if test "$pass" = conv; then
2630 deplibs="$deplib $deplibs"
2631 continue
2633 case $linkmode in
2634 lib)
2635 valid_a_lib=no
2636 case $deplibs_check_method in
2637 match_pattern*)
2638 set dummy $deplibs_check_method
2639 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2640 if eval $echo \"$deplib\" 2>/dev/null \
2641 | $SED 10q \
2642 | $EGREP "$match_pattern_regex" > /dev/null; then
2643 valid_a_lib=yes
2646 pass_all)
2647 valid_a_lib=yes
2649 esac
2650 if test "$valid_a_lib" != yes; then
2651 $echo
2652 $echo "*** Warning: Trying to link with static lib archive $deplib."
2653 $echo "*** I have the capability to make that library automatically link in when"
2654 $echo "*** you link to this library. But I can only do this if you have a"
2655 $echo "*** shared version of the library, which you do not appear to have"
2656 $echo "*** because the file extensions .$libext of this argument makes me believe"
2657 $echo "*** that it is just a static archive that I should not used here."
2658 else
2659 $echo
2660 $echo "*** Warning: Linking the shared library $output against the"
2661 $echo "*** static library $deplib is not portable!"
2662 deplibs="$deplib $deplibs"
2664 continue
2666 prog)
2667 if test "$pass" != link; then
2668 deplibs="$deplib $deplibs"
2669 else
2670 compile_deplibs="$deplib $compile_deplibs"
2671 finalize_deplibs="$deplib $finalize_deplibs"
2673 continue
2675 esac # linkmode
2676 ;; # *.$libext
2677 *.lo | *.$objext)
2678 if test "$pass" = conv; then
2679 deplibs="$deplib $deplibs"
2680 elif test "$linkmode" = prog; then
2681 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2682 # If there is no dlopen support or we're linking statically,
2683 # we need to preload.
2684 newdlprefiles="$newdlprefiles $deplib"
2685 compile_deplibs="$deplib $compile_deplibs"
2686 finalize_deplibs="$deplib $finalize_deplibs"
2687 else
2688 newdlfiles="$newdlfiles $deplib"
2691 continue
2693 %DEPLIBS%)
2694 alldeplibs=yes
2695 continue
2697 esac # case $deplib
2698 if test "$found" = yes || test -f "$lib"; then :
2699 else
2700 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2701 exit $EXIT_FAILURE
2704 # Check to see that this really is a libtool archive.
2705 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2706 else
2707 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2708 exit $EXIT_FAILURE
2711 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2712 test "X$ladir" = "X$lib" && ladir="."
2714 dlname=
2715 dlopen=
2716 dlpreopen=
2717 libdir=
2718 library_names=
2719 old_library=
2720 # If the library was installed with an old release of libtool,
2721 # it will not redefine variables installed, or shouldnotlink
2722 installed=yes
2723 shouldnotlink=no
2724 avoidtemprpath=
2727 # Read the .la file
2728 case $lib in
2729 */* | *\\*) . $lib ;;
2730 *) . ./$lib ;;
2731 esac
2733 if test "$linkmode,$pass" = "lib,link" ||
2734 test "$linkmode,$pass" = "prog,scan" ||
2735 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2736 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2737 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2740 if test "$pass" = conv; then
2741 # Only check for convenience libraries
2742 deplibs="$lib $deplibs"
2743 if test -z "$libdir"; then
2744 if test -z "$old_library"; then
2745 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2746 exit $EXIT_FAILURE
2748 # It is a libtool convenience library, so add in its objects.
2749 convenience="$convenience $ladir/$objdir/$old_library"
2750 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2751 tmp_libs=
2752 for deplib in $dependency_libs; do
2753 deplibs="$deplib $deplibs"
2754 if test "X$duplicate_deps" = "Xyes" ; then
2755 case "$tmp_libs " in
2756 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2757 esac
2759 tmp_libs="$tmp_libs $deplib"
2760 done
2761 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2762 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2763 exit $EXIT_FAILURE
2765 continue
2766 fi # $pass = conv
2769 # Get the name of the library we link against.
2770 linklib=
2771 for l in $old_library $library_names; do
2772 linklib="$l"
2773 done
2774 if test -z "$linklib"; then
2775 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2776 exit $EXIT_FAILURE
2779 # This library was specified with -dlopen.
2780 if test "$pass" = dlopen; then
2781 if test -z "$libdir"; then
2782 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2783 exit $EXIT_FAILURE
2785 if test -z "$dlname" ||
2786 test "$dlopen_support" != yes ||
2787 test "$build_libtool_libs" = no; then
2788 # If there is no dlname, no dlopen support or we're linking
2789 # statically, we need to preload. We also need to preload any
2790 # dependent libraries so libltdl's deplib preloader doesn't
2791 # bomb out in the load deplibs phase.
2792 dlprefiles="$dlprefiles $lib $dependency_libs"
2793 else
2794 newdlfiles="$newdlfiles $lib"
2796 continue
2797 fi # $pass = dlopen
2799 # We need an absolute path.
2800 case $ladir in
2801 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2803 abs_ladir=`cd "$ladir" && pwd`
2804 if test -z "$abs_ladir"; then
2805 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2806 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2807 abs_ladir="$ladir"
2810 esac
2811 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2813 # Find the relevant object directory and library name.
2814 if test "X$installed" = Xyes; then
2815 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2816 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2817 dir="$ladir"
2818 absdir="$abs_ladir"
2819 libdir="$abs_ladir"
2820 else
2821 dir="$libdir"
2822 absdir="$libdir"
2824 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2825 else
2826 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2827 dir="$ladir"
2828 absdir="$abs_ladir"
2829 # Remove this search path later
2830 notinst_path="$notinst_path $abs_ladir"
2831 else
2832 dir="$ladir/$objdir"
2833 absdir="$abs_ladir/$objdir"
2834 # Remove this search path later
2835 notinst_path="$notinst_path $abs_ladir"
2837 fi # $installed = yes
2838 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2840 # This library was specified with -dlpreopen.
2841 if test "$pass" = dlpreopen; then
2842 if test -z "$libdir"; then
2843 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2844 exit $EXIT_FAILURE
2846 # Prefer using a static library (so that no silly _DYNAMIC symbols
2847 # are required to link).
2848 if test -n "$old_library"; then
2849 newdlprefiles="$newdlprefiles $dir/$old_library"
2850 # Otherwise, use the dlname, so that lt_dlopen finds it.
2851 elif test -n "$dlname"; then
2852 newdlprefiles="$newdlprefiles $dir/$dlname"
2853 else
2854 newdlprefiles="$newdlprefiles $dir/$linklib"
2856 fi # $pass = dlpreopen
2858 if test -z "$libdir"; then
2859 # Link the convenience library
2860 if test "$linkmode" = lib; then
2861 deplibs="$dir/$old_library $deplibs"
2862 elif test "$linkmode,$pass" = "prog,link"; then
2863 compile_deplibs="$dir/$old_library $compile_deplibs"
2864 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2865 else
2866 deplibs="$lib $deplibs" # used for prog,scan pass
2868 continue
2872 if test "$linkmode" = prog && test "$pass" != link; then
2873 newlib_search_path="$newlib_search_path $ladir"
2874 deplibs="$lib $deplibs"
2876 linkalldeplibs=no
2877 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2878 test "$build_libtool_libs" = no; then
2879 linkalldeplibs=yes
2882 tmp_libs=
2883 for deplib in $dependency_libs; do
2884 case $deplib in
2885 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2886 esac
2887 # Need to link against all dependency_libs?
2888 if test "$linkalldeplibs" = yes; then
2889 deplibs="$deplib $deplibs"
2890 else
2891 # Need to hardcode shared library paths
2892 # or/and link against static libraries
2893 newdependency_libs="$deplib $newdependency_libs"
2895 if test "X$duplicate_deps" = "Xyes" ; then
2896 case "$tmp_libs " in
2897 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2898 esac
2900 tmp_libs="$tmp_libs $deplib"
2901 done # for deplib
2902 continue
2903 fi # $linkmode = prog...
2905 if test "$linkmode,$pass" = "prog,link"; then
2906 if test -n "$library_names" &&
2907 { { test "$prefer_static_libs" = no ||
2908 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2909 test -z "$old_library"; }; then
2910 # We need to hardcode the library path
2911 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2912 # Make sure the rpath contains only unique directories.
2913 case "$temp_rpath " in
2914 *" $dir "*) ;;
2915 *" $absdir "*) ;;
2916 *) temp_rpath="$temp_rpath $absdir" ;;
2917 esac
2920 # Hardcode the library path.
2921 # Skip directories that are in the system default run-time
2922 # search path.
2923 case " $sys_lib_dlsearch_path " in
2924 *" $absdir "*) ;;
2926 case "$compile_rpath " in
2927 *" $absdir "*) ;;
2928 *) compile_rpath="$compile_rpath $absdir"
2929 esac
2931 esac
2932 case " $sys_lib_dlsearch_path " in
2933 *" $libdir "*) ;;
2935 case "$finalize_rpath " in
2936 *" $libdir "*) ;;
2937 *) finalize_rpath="$finalize_rpath $libdir"
2938 esac
2940 esac
2941 fi # $linkmode,$pass = prog,link...
2943 if test "$alldeplibs" = yes &&
2944 { test "$deplibs_check_method" = pass_all ||
2945 { test "$build_libtool_libs" = yes &&
2946 test -n "$library_names"; }; }; then
2947 # We only need to search for static libraries
2948 continue
2952 link_static=no # Whether the deplib will be linked statically
2953 use_static_libs=$prefer_static_libs
2954 if test "$use_static_libs" = built && test "$installed" = yes ; then
2955 use_static_libs=no
2957 if test -n "$library_names" &&
2958 { test "$use_static_libs" = no || test -z "$old_library"; }; then
2959 if test "$installed" = no; then
2960 notinst_deplibs="$notinst_deplibs $lib"
2961 need_relink=yes
2963 # This is a shared library
2965 # Warn about portability, can't link against -module's on
2966 # some systems (darwin)
2967 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2968 $echo
2969 if test "$linkmode" = prog; then
2970 $echo "*** Warning: Linking the executable $output against the loadable module"
2971 else
2972 $echo "*** Warning: Linking the shared library $output against the loadable module"
2974 $echo "*** $linklib is not portable!"
2976 if test "$linkmode" = lib &&
2977 test "$hardcode_into_libs" = yes; then
2978 # Hardcode the library path.
2979 # Skip directories that are in the system default run-time
2980 # search path.
2981 case " $sys_lib_dlsearch_path " in
2982 *" $absdir "*) ;;
2984 case "$compile_rpath " in
2985 *" $absdir "*) ;;
2986 *) compile_rpath="$compile_rpath $absdir"
2987 esac
2989 esac
2990 case " $sys_lib_dlsearch_path " in
2991 *" $libdir "*) ;;
2993 case "$finalize_rpath " in
2994 *" $libdir "*) ;;
2995 *) finalize_rpath="$finalize_rpath $libdir"
2996 esac
2998 esac
3001 if test -n "$old_archive_from_expsyms_cmds"; then
3002 # figure out the soname
3003 set dummy $library_names
3004 realname="$2"
3005 shift; shift
3006 libname=`eval \\$echo \"$libname_spec\"`
3007 # use dlname if we got it. it's perfectly good, no?
3008 if test -n "$dlname"; then
3009 soname="$dlname"
3010 elif test -n "$soname_spec"; then
3011 # bleh windows
3012 case $host in
3013 *cygwin* | mingw*)
3014 major=`expr $current - $age`
3015 versuffix="-$major"
3017 esac
3018 eval soname=\"$soname_spec\"
3019 else
3020 soname="$realname"
3023 # Make a new name for the extract_expsyms_cmds to use
3024 soroot="$soname"
3025 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
3026 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
3028 # If the library has no export list, then create one now
3029 if test -f "$output_objdir/$soname-def"; then :
3030 else
3031 $show "extracting exported symbol list from \`$soname'"
3032 save_ifs="$IFS"; IFS='~'
3033 cmds=$extract_expsyms_cmds
3034 for cmd in $cmds; do
3035 IFS="$save_ifs"
3036 eval cmd=\"$cmd\"
3037 $show "$cmd"
3038 $run eval "$cmd" || exit $?
3039 done
3040 IFS="$save_ifs"
3043 # Create $newlib
3044 if test -f "$output_objdir/$newlib"; then :; else
3045 $show "generating import library for \`$soname'"
3046 save_ifs="$IFS"; IFS='~'
3047 cmds=$old_archive_from_expsyms_cmds
3048 for cmd in $cmds; do
3049 IFS="$save_ifs"
3050 eval cmd=\"$cmd\"
3051 $show "$cmd"
3052 $run eval "$cmd" || exit $?
3053 done
3054 IFS="$save_ifs"
3056 # make sure the library variables are pointing to the new library
3057 dir=$output_objdir
3058 linklib=$newlib
3059 fi # test -n "$old_archive_from_expsyms_cmds"
3061 if test "$linkmode" = prog || test "$mode" != relink; then
3062 add_shlibpath=
3063 add_dir=
3064 add=
3065 lib_linked=yes
3066 case $hardcode_action in
3067 immediate | unsupported)
3068 if test "$hardcode_direct" = no; then
3069 add="$dir/$linklib"
3070 case $host in
3071 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
3072 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
3073 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
3074 *-*-unixware7*) add_dir="-L$dir" ;;
3075 *-*-darwin* )
3076 # if the lib is a module then we can not link against
3077 # it, someone is ignoring the new warnings I added
3078 if /usr/bin/file -L $add 2> /dev/null |
3079 $EGREP ": [^:]* bundle" >/dev/null ; then
3080 $echo "** Warning, lib $linklib is a module, not a shared library"
3081 if test -z "$old_library" ; then
3082 $echo
3083 $echo "** And there doesn't seem to be a static archive available"
3084 $echo "** The link will probably fail, sorry"
3085 else
3086 add="$dir/$old_library"
3089 esac
3090 elif test "$hardcode_minus_L" = no; then
3091 case $host in
3092 *-*-sunos*) add_shlibpath="$dir" ;;
3093 esac
3094 add_dir="-L$dir"
3095 add="-l$name"
3096 elif test "$hardcode_shlibpath_var" = no; then
3097 add_shlibpath="$dir"
3098 add="-l$name"
3099 else
3100 lib_linked=no
3103 relink)
3104 if test "$hardcode_direct" = yes; then
3105 add="$dir/$linklib"
3106 elif test "$hardcode_minus_L" = yes; then
3107 add_dir="-L$dir"
3108 # Try looking first in the location we're being installed to.
3109 if test -n "$inst_prefix_dir"; then
3110 case $libdir in
3111 [\\/]*)
3112 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3114 esac
3116 add="-l$name"
3117 elif test "$hardcode_shlibpath_var" = yes; then
3118 add_shlibpath="$dir"
3119 add="-l$name"
3120 else
3121 lib_linked=no
3124 *) lib_linked=no ;;
3125 esac
3127 if test "$lib_linked" != yes; then
3128 $echo "$modename: configuration error: unsupported hardcode properties"
3129 exit $EXIT_FAILURE
3132 if test -n "$add_shlibpath"; then
3133 case :$compile_shlibpath: in
3134 *":$add_shlibpath:"*) ;;
3135 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
3136 esac
3138 if test "$linkmode" = prog; then
3139 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
3140 test -n "$add" && compile_deplibs="$add $compile_deplibs"
3141 else
3142 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3143 test -n "$add" && deplibs="$add $deplibs"
3144 if test "$hardcode_direct" != yes && \
3145 test "$hardcode_minus_L" != yes && \
3146 test "$hardcode_shlibpath_var" = yes; then
3147 case :$finalize_shlibpath: in
3148 *":$libdir:"*) ;;
3149 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3150 esac
3155 if test "$linkmode" = prog || test "$mode" = relink; then
3156 add_shlibpath=
3157 add_dir=
3158 add=
3159 # Finalize command for both is simple: just hardcode it.
3160 if test "$hardcode_direct" = yes; then
3161 add="$libdir/$linklib"
3162 elif test "$hardcode_minus_L" = yes; then
3163 add_dir="-L$libdir"
3164 add="-l$name"
3165 elif test "$hardcode_shlibpath_var" = yes; then
3166 case :$finalize_shlibpath: in
3167 *":$libdir:"*) ;;
3168 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
3169 esac
3170 add="-l$name"
3171 elif test "$hardcode_automatic" = yes; then
3172 if test -n "$inst_prefix_dir" &&
3173 test -f "$inst_prefix_dir$libdir/$linklib" ; then
3174 add="$inst_prefix_dir$libdir/$linklib"
3175 else
3176 add="$libdir/$linklib"
3178 else
3179 # We cannot seem to hardcode it, guess we'll fake it.
3180 add_dir="-L$libdir"
3181 # Try looking first in the location we're being installed to.
3182 if test -n "$inst_prefix_dir"; then
3183 case $libdir in
3184 [\\/]*)
3185 add_dir="$add_dir -L$inst_prefix_dir$libdir"
3187 esac
3189 add="-l$name"
3192 if test "$linkmode" = prog; then
3193 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
3194 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
3195 else
3196 test -n "$add_dir" && deplibs="$add_dir $deplibs"
3197 test -n "$add" && deplibs="$add $deplibs"
3200 elif test "$linkmode" = prog; then
3201 # Here we assume that one of hardcode_direct or hardcode_minus_L
3202 # is not unsupported. This is valid on all known static and
3203 # shared platforms.
3204 if test "$hardcode_direct" != unsupported; then
3205 test -n "$old_library" && linklib="$old_library"
3206 compile_deplibs="$dir/$linklib $compile_deplibs"
3207 finalize_deplibs="$dir/$linklib $finalize_deplibs"
3208 else
3209 compile_deplibs="-l$name -L$dir $compile_deplibs"
3210 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
3212 elif test "$build_libtool_libs" = yes; then
3213 # Not a shared library
3214 if test "$deplibs_check_method" != pass_all; then
3215 # We're trying link a shared library against a static one
3216 # but the system doesn't support it.
3218 # Just print a warning and add the library to dependency_libs so
3219 # that the program can be linked against the static library.
3220 $echo
3221 $echo "*** Warning: This system can not link to static lib archive $lib."
3222 $echo "*** I have the capability to make that library automatically link in when"
3223 $echo "*** you link to this library. But I can only do this if you have a"
3224 $echo "*** shared version of the library, which you do not appear to have."
3225 if test "$module" = yes; then
3226 $echo "*** But as you try to build a module library, libtool will still create "
3227 $echo "*** a static module, that should work as long as the dlopening application"
3228 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
3229 if test -z "$global_symbol_pipe"; then
3230 $echo
3231 $echo "*** However, this would only work if libtool was able to extract symbol"
3232 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3233 $echo "*** not find such a program. So, this module is probably useless."
3234 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3236 if test "$build_old_libs" = no; then
3237 build_libtool_libs=module
3238 build_old_libs=yes
3239 else
3240 build_libtool_libs=no
3243 else
3244 deplibs="$dir/$old_library $deplibs"
3245 link_static=yes
3247 fi # link shared/static library?
3249 if test "$linkmode" = lib; then
3250 if test -n "$dependency_libs" &&
3251 { test "$hardcode_into_libs" != yes ||
3252 test "$build_old_libs" = yes ||
3253 test "$link_static" = yes; }; then
3254 # Extract -R from dependency_libs
3255 temp_deplibs=
3256 for libdir in $dependency_libs; do
3257 case $libdir in
3258 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
3259 case " $xrpath " in
3260 *" $temp_xrpath "*) ;;
3261 *) xrpath="$xrpath $temp_xrpath";;
3262 esac;;
3263 *) temp_deplibs="$temp_deplibs $libdir";;
3264 esac
3265 done
3266 dependency_libs="$temp_deplibs"
3269 newlib_search_path="$newlib_search_path $absdir"
3270 # Link against this library
3271 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
3272 # ... and its dependency_libs
3273 tmp_libs=
3274 for deplib in $dependency_libs; do
3275 newdependency_libs="$deplib $newdependency_libs"
3276 if test "X$duplicate_deps" = "Xyes" ; then
3277 case "$tmp_libs " in
3278 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
3279 esac
3281 tmp_libs="$tmp_libs $deplib"
3282 done
3284 if test "$link_all_deplibs" != no; then
3285 # Add the search paths of all dependency libraries
3286 for deplib in $dependency_libs; do
3287 case $deplib in
3288 -L*) path="$deplib" ;;
3289 *.la)
3290 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3291 test "X$dir" = "X$deplib" && dir="."
3292 # We need an absolute path.
3293 case $dir in
3294 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
3296 absdir=`cd "$dir" && pwd`
3297 if test -z "$absdir"; then
3298 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3299 absdir="$dir"
3302 esac
3303 if grep "^installed=no" $deplib > /dev/null; then
3304 path="$absdir/$objdir"
3305 else
3306 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3307 if test -z "$libdir"; then
3308 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3309 exit $EXIT_FAILURE
3311 if test "$absdir" != "$libdir"; then
3312 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3314 path="$absdir"
3316 depdepl=
3317 case $host in
3318 *-*-darwin*)
3319 # we do not want to link against static libs,
3320 # but need to link against shared
3321 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3322 eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3323 if test -n "$deplibrary_names" ; then
3324 for tmp in $deplibrary_names ; do
3325 depdepl=$tmp
3326 done
3327 if test -f "$deplibdir/$depdepl" ; then
3328 depdepl="$deplibdir/$depdepl"
3329 elif test -f "$path/$depdepl" ; then
3330 depdepl="$path/$depdepl"
3331 else
3332 # Can't find it, oh well...
3333 depdepl=
3335 # do not add paths which are already there
3336 case " $newlib_search_path " in
3337 *" $path "*) ;;
3338 *) newlib_search_path="$newlib_search_path $path";;
3339 esac
3341 path=""
3344 path="-L$path"
3346 esac
3348 -l*)
3349 case $host in
3350 *-*-darwin*)
3351 # Again, we only want to link against shared libraries
3352 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3353 for tmp in $newlib_search_path ; do
3354 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3355 eval depdepl="$tmp/lib$tmp_libs.dylib"
3356 break
3358 done
3359 path=""
3361 *) continue ;;
3362 esac
3364 *) continue ;;
3365 esac
3366 case " $deplibs " in
3367 *" $path "*) ;;
3368 *) deplibs="$path $deplibs" ;;
3369 esac
3370 case " $deplibs " in
3371 *" $depdepl "*) ;;
3372 *) deplibs="$depdepl $deplibs" ;;
3373 esac
3374 done
3375 fi # link_all_deplibs != no
3376 fi # linkmode = lib
3377 done # for deplib in $libs
3378 dependency_libs="$newdependency_libs"
3379 if test "$pass" = dlpreopen; then
3380 # Link the dlpreopened libraries before other libraries
3381 for deplib in $save_deplibs; do
3382 deplibs="$deplib $deplibs"
3383 done
3385 if test "$pass" != dlopen; then
3386 if test "$pass" != conv; then
3387 # Make sure lib_search_path contains only unique directories.
3388 lib_search_path=
3389 for dir in $newlib_search_path; do
3390 case "$lib_search_path " in
3391 *" $dir "*) ;;
3392 *) lib_search_path="$lib_search_path $dir" ;;
3393 esac
3394 done
3395 newlib_search_path=
3398 if test "$linkmode,$pass" != "prog,link"; then
3399 vars="deplibs"
3400 else
3401 vars="compile_deplibs finalize_deplibs"
3403 for var in $vars dependency_libs; do
3404 # Add libraries to $var in reverse order
3405 eval tmp_libs=\"\$$var\"
3406 new_libs=
3407 for deplib in $tmp_libs; do
3408 # FIXME: Pedantically, this is the right thing to do, so
3409 # that some nasty dependency loop isn't accidentally
3410 # broken:
3411 #new_libs="$deplib $new_libs"
3412 # Pragmatically, this seems to cause very few problems in
3413 # practice:
3414 case $deplib in
3415 -L*) new_libs="$deplib $new_libs" ;;
3416 -R*) ;;
3418 # And here is the reason: when a library appears more
3419 # than once as an explicit dependence of a library, or
3420 # is implicitly linked in more than once by the
3421 # compiler, it is considered special, and multiple
3422 # occurrences thereof are not removed. Compare this
3423 # with having the same library being listed as a
3424 # dependency of multiple other libraries: in this case,
3425 # we know (pedantically, we assume) the library does not
3426 # need to be listed more than once, so we keep only the
3427 # last copy. This is not always right, but it is rare
3428 # enough that we require users that really mean to play
3429 # such unportable linking tricks to link the library
3430 # using -Wl,-lname, so that libtool does not consider it
3431 # for duplicate removal.
3432 case " $specialdeplibs " in
3433 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3435 case " $new_libs " in
3436 *" $deplib "*) ;;
3437 *) new_libs="$deplib $new_libs" ;;
3438 esac
3440 esac
3442 esac
3443 done
3444 tmp_libs=
3445 for deplib in $new_libs; do
3446 case $deplib in
3447 -L*)
3448 case " $tmp_libs " in
3449 *" $deplib "*) ;;
3450 *) tmp_libs="$tmp_libs $deplib" ;;
3451 esac
3453 *) tmp_libs="$tmp_libs $deplib" ;;
3454 esac
3455 done
3456 eval $var=\"$tmp_libs\"
3457 done # for var
3459 # Last step: remove runtime libs from dependency_libs
3460 # (they stay in deplibs)
3461 tmp_libs=
3462 for i in $dependency_libs ; do
3463 case " $predeps $postdeps $compiler_lib_search_path " in
3464 *" $i "*)
3465 i=""
3467 esac
3468 if test -n "$i" ; then
3469 tmp_libs="$tmp_libs $i"
3471 done
3472 dependency_libs=$tmp_libs
3473 done # for pass
3474 if test "$linkmode" = prog; then
3475 dlfiles="$newdlfiles"
3476 dlprefiles="$newdlprefiles"
3479 case $linkmode in
3480 oldlib)
3481 case " $deplibs" in
3482 *\ -l* | *\ -L*)
3483 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3484 esac
3486 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3487 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3490 if test -n "$rpath"; then
3491 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3494 if test -n "$xrpath"; then
3495 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3498 if test -n "$vinfo"; then
3499 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3502 if test -n "$release"; then
3503 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3506 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3507 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3510 # Now set the variables for building old libraries.
3511 build_libtool_libs=no
3512 oldlibs="$output"
3513 objs="$objs$old_deplibs"
3516 lib)
3517 # Make sure we only generate libraries of the form `libNAME.la'.
3518 case $outputname in
3519 lib*)
3520 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3521 eval shared_ext=\"$shrext_cmds\"
3522 eval libname=\"$libname_spec\"
3525 if test "$module" = no; then
3526 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3527 $echo "$help" 1>&2
3528 exit $EXIT_FAILURE
3530 if test "$need_lib_prefix" != no; then
3531 # Add the "lib" prefix for modules if required
3532 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3533 eval shared_ext=\"$shrext_cmds\"
3534 eval libname=\"$libname_spec\"
3535 else
3536 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3539 esac
3541 if test -n "$objs"; then
3542 if test "$deplibs_check_method" != pass_all; then
3543 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3544 exit $EXIT_FAILURE
3545 else
3546 $echo
3547 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3548 $echo "*** objects $objs is not portable!"
3549 libobjs="$libobjs $objs"
3553 if test "$dlself" != no; then
3554 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3557 set dummy $rpath
3558 if test "$#" -gt 2; then
3559 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3561 install_libdir="$2"
3563 oldlibs=
3564 if test -z "$rpath"; then
3565 if test "$build_libtool_libs" = yes; then
3566 # Building a libtool convenience library.
3567 # Some compilers have problems with a `.al' extension so
3568 # convenience libraries should have the same extension an
3569 # archive normally would.
3570 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3571 build_libtool_libs=convenience
3572 build_old_libs=yes
3575 if test -n "$vinfo"; then
3576 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3579 if test -n "$release"; then
3580 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3582 else
3584 # Parse the version information argument.
3585 save_ifs="$IFS"; IFS=':'
3586 set dummy $vinfo 0 0 0
3587 IFS="$save_ifs"
3589 if test -n "$8"; then
3590 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3591 $echo "$help" 1>&2
3592 exit $EXIT_FAILURE
3595 # convert absolute version numbers to libtool ages
3596 # this retains compatibility with .la files and attempts
3597 # to make the code below a bit more comprehensible
3599 case $vinfo_number in
3600 yes)
3601 number_major="$2"
3602 number_minor="$3"
3603 number_revision="$4"
3605 # There are really only two kinds -- those that
3606 # use the current revision as the major version
3607 # and those that subtract age and use age as
3608 # a minor version. But, then there is irix
3609 # which has an extra 1 added just for fun
3611 case $version_type in
3612 darwin|linux|osf|windows|none)
3613 current=`expr $number_major + $number_minor`
3614 age="$number_minor"
3615 revision="$number_revision"
3617 freebsd-aout|freebsd-elf|sunos)
3618 current="$number_major"
3619 revision="$number_minor"
3620 age="0"
3622 irix|nonstopux)
3623 current=`expr $number_major + $number_minor`
3624 age="$number_minor"
3625 revision="$number_minor"
3626 lt_irix_increment=no
3628 esac
3631 current="$2"
3632 revision="$3"
3633 age="$4"
3635 esac
3637 # Check that each of the things are valid numbers.
3638 case $current in
3639 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]) ;;
3641 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3642 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3643 exit $EXIT_FAILURE
3645 esac
3647 case $revision in
3648 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]) ;;
3650 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3651 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3652 exit $EXIT_FAILURE
3654 esac
3656 case $age in
3657 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]) ;;
3659 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3660 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3661 exit $EXIT_FAILURE
3663 esac
3665 if test "$age" -gt "$current"; then
3666 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3667 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3668 exit $EXIT_FAILURE
3671 # Calculate the version variables.
3672 major=
3673 versuffix=
3674 verstring=
3675 case $version_type in
3676 none) ;;
3678 darwin)
3679 # Like Linux, but with the current version available in
3680 # verstring for coding it into the library header
3681 major=.`expr $current - $age`
3682 versuffix="$major.$age.$revision"
3683 # Darwin ld doesn't like 0 for these options...
3684 minor_current=`expr $current + 1`
3685 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3686 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3689 freebsd-aout)
3690 major=".$current"
3691 versuffix=".$current.$revision";
3694 freebsd-elf)
3695 major=".$current"
3696 versuffix=".$current";
3699 irix | nonstopux)
3700 if test "X$lt_irix_increment" = "Xno"; then
3701 major=`expr $current - $age`
3702 else
3703 major=`expr $current - $age + 1`
3705 case $version_type in
3706 nonstopux) verstring_prefix=nonstopux ;;
3707 *) verstring_prefix=sgi ;;
3708 esac
3709 verstring="$verstring_prefix$major.$revision"
3711 # Add in all the interfaces that we are compatible with.
3712 loop=$revision
3713 while test "$loop" -ne 0; do
3714 iface=`expr $revision - $loop`
3715 loop=`expr $loop - 1`
3716 verstring="$verstring_prefix$major.$iface:$verstring"
3717 done
3719 # Before this point, $major must not contain `.'.
3720 major=.$major
3721 versuffix="$major.$revision"
3724 linux)
3725 major=.`expr $current - $age`
3726 versuffix="$major.$age.$revision"
3729 osf)
3730 major=.`expr $current - $age`
3731 versuffix=".$current.$age.$revision"
3732 verstring="$current.$age.$revision"
3734 # Add in all the interfaces that we are compatible with.
3735 loop=$age
3736 while test "$loop" -ne 0; do
3737 iface=`expr $current - $loop`
3738 loop=`expr $loop - 1`
3739 verstring="$verstring:${iface}.0"
3740 done
3742 # Make executables depend on our current version.
3743 verstring="$verstring:${current}.0"
3746 sunos)
3747 major=".$current"
3748 versuffix=".$current.$revision"
3751 windows)
3752 # Use '-' rather than '.', since we only want one
3753 # extension on DOS 8.3 filesystems.
3754 major=`expr $current - $age`
3755 versuffix="-$major"
3759 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3760 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3761 exit $EXIT_FAILURE
3763 esac
3765 # Clear the version info if we defaulted, and they specified a release.
3766 if test -z "$vinfo" && test -n "$release"; then
3767 major=
3768 case $version_type in
3769 darwin)
3770 # we can't check for "0.0" in archive_cmds due to quoting
3771 # problems, so we reset it completely
3772 verstring=
3775 verstring="0.0"
3777 esac
3778 if test "$need_version" = no; then
3779 versuffix=
3780 else
3781 versuffix=".0.0"
3785 # Remove version info from name if versioning should be avoided
3786 if test "$avoid_version" = yes && test "$need_version" = no; then
3787 major=
3788 versuffix=
3789 verstring=""
3792 # Check to see if the archive will have undefined symbols.
3793 if test "$allow_undefined" = yes; then
3794 if test "$allow_undefined_flag" = unsupported; then
3795 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3796 build_libtool_libs=no
3797 build_old_libs=yes
3799 else
3800 # Don't allow undefined symbols.
3801 allow_undefined_flag="$no_undefined_flag"
3805 if test "$mode" != relink; then
3806 # Remove our outputs, but don't remove object files since they
3807 # may have been created when compiling PIC objects.
3808 removelist=
3809 tempremovelist=`$echo "$output_objdir/*"`
3810 for p in $tempremovelist; do
3811 case $p in
3812 *.$objext)
3814 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3815 if test "X$precious_files_regex" != "X"; then
3816 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3817 then
3818 continue
3821 removelist="$removelist $p"
3823 *) ;;
3824 esac
3825 done
3826 if test -n "$removelist"; then
3827 $show "${rm}r $removelist"
3828 $run ${rm}r $removelist
3832 # Now set the variables for building old libraries.
3833 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3834 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3836 # Transform .lo files to .o files.
3837 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3840 # Eliminate all temporary directories.
3841 #for path in $notinst_path; do
3842 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3843 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3844 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3845 #done
3847 if test -n "$xrpath"; then
3848 # If the user specified any rpath flags, then add them.
3849 temp_xrpath=
3850 for libdir in $xrpath; do
3851 temp_xrpath="$temp_xrpath -R$libdir"
3852 case "$finalize_rpath " in
3853 *" $libdir "*) ;;
3854 *) finalize_rpath="$finalize_rpath $libdir" ;;
3855 esac
3856 done
3857 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3858 dependency_libs="$temp_xrpath $dependency_libs"
3862 # Make sure dlfiles contains only unique files that won't be dlpreopened
3863 old_dlfiles="$dlfiles"
3864 dlfiles=
3865 for lib in $old_dlfiles; do
3866 case " $dlprefiles $dlfiles " in
3867 *" $lib "*) ;;
3868 *) dlfiles="$dlfiles $lib" ;;
3869 esac
3870 done
3872 # Make sure dlprefiles contains only unique files
3873 old_dlprefiles="$dlprefiles"
3874 dlprefiles=
3875 for lib in $old_dlprefiles; do
3876 case "$dlprefiles " in
3877 *" $lib "*) ;;
3878 *) dlprefiles="$dlprefiles $lib" ;;
3879 esac
3880 done
3882 if test "$build_libtool_libs" = yes; then
3883 if test -n "$rpath"; then
3884 case $host in
3885 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3886 # these systems don't actually have a c library (as such)!
3888 *-*-rhapsody* | *-*-darwin1.[012])
3889 # Rhapsody C library is in the System framework
3890 deplibs="$deplibs -framework System"
3892 *-*-netbsd*)
3893 # Don't link with libc until the a.out ld.so is fixed.
3895 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3896 # Do not include libc due to us having libc/libc_r.
3898 *-*-sco3.2v5* | *-*-sco5v6*)
3899 # Causes problems with __ctype
3901 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
3902 # Compiler inserts libc in the correct place for threads to work
3905 # Add libc to deplibs on all other systems if necessary.
3906 if test "$build_libtool_need_lc" = "yes"; then
3907 deplibs="$deplibs -lc"
3910 esac
3913 # Transform deplibs into only deplibs that can be linked in shared.
3914 name_save=$name
3915 libname_save=$libname
3916 release_save=$release
3917 versuffix_save=$versuffix
3918 major_save=$major
3919 # I'm not sure if I'm treating the release correctly. I think
3920 # release should show up in the -l (ie -lgmp5) so we don't want to
3921 # add it in twice. Is that correct?
3922 release=""
3923 versuffix=""
3924 major=""
3925 newdeplibs=
3926 droppeddeps=no
3927 case $deplibs_check_method in
3928 pass_all)
3929 # Don't check for shared/static. Everything works.
3930 # This might be a little naive. We might want to check
3931 # whether the library exists or not. But this is on
3932 # osf3 & osf4 and I'm not really sure... Just
3933 # implementing what was already the behavior.
3934 newdeplibs=$deplibs
3936 test_compile)
3937 # This code stresses the "libraries are programs" paradigm to its
3938 # limits. Maybe even breaks it. We compile a program, linking it
3939 # against the deplibs as a proxy for the library. Then we can check
3940 # whether they linked in statically or dynamically with ldd.
3941 $rm conftest.c
3942 cat > conftest.c <<EOF
3943 int main() { return 0; }
3945 $rm conftest
3946 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3947 ldd_output=`ldd conftest`
3948 for i in $deplibs; do
3949 name=`expr $i : '-l\(.*\)'`
3950 # If $name is empty we are operating on a -L argument.
3951 if test "$name" != "" && test "$name" != "0"; then
3952 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3953 case " $predeps $postdeps " in
3954 *" $i "*)
3955 newdeplibs="$newdeplibs $i"
3956 i=""
3958 esac
3960 if test -n "$i" ; then
3961 libname=`eval \\$echo \"$libname_spec\"`
3962 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3963 set dummy $deplib_matches
3964 deplib_match=$2
3965 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3966 newdeplibs="$newdeplibs $i"
3967 else
3968 droppeddeps=yes
3969 $echo
3970 $echo "*** Warning: dynamic linker does not accept needed library $i."
3971 $echo "*** I have the capability to make that library automatically link in when"
3972 $echo "*** you link to this library. But I can only do this if you have a"
3973 $echo "*** shared version of the library, which I believe you do not have"
3974 $echo "*** because a test_compile did reveal that the linker did not use it for"
3975 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3978 else
3979 newdeplibs="$newdeplibs $i"
3981 done
3982 else
3983 # Error occurred in the first compile. Let's try to salvage
3984 # the situation: Compile a separate program for each library.
3985 for i in $deplibs; do
3986 name=`expr $i : '-l\(.*\)'`
3987 # If $name is empty we are operating on a -L argument.
3988 if test "$name" != "" && test "$name" != "0"; then
3989 $rm conftest
3990 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3991 ldd_output=`ldd conftest`
3992 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3993 case " $predeps $postdeps " in
3994 *" $i "*)
3995 newdeplibs="$newdeplibs $i"
3996 i=""
3998 esac
4000 if test -n "$i" ; then
4001 libname=`eval \\$echo \"$libname_spec\"`
4002 deplib_matches=`eval \\$echo \"$library_names_spec\"`
4003 set dummy $deplib_matches
4004 deplib_match=$2
4005 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
4006 newdeplibs="$newdeplibs $i"
4007 else
4008 droppeddeps=yes
4009 $echo
4010 $echo "*** Warning: dynamic linker does not accept needed library $i."
4011 $echo "*** I have the capability to make that library automatically link in when"
4012 $echo "*** you link to this library. But I can only do this if you have a"
4013 $echo "*** shared version of the library, which you do not appear to have"
4014 $echo "*** because a test_compile did reveal that the linker did not use this one"
4015 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
4018 else
4019 droppeddeps=yes
4020 $echo
4021 $echo "*** Warning! Library $i is needed by this library but I was not able to"
4022 $echo "*** make it link in! You will probably need to install it or some"
4023 $echo "*** library that it depends on before this library will be fully"
4024 $echo "*** functional. Installing it before continuing would be even better."
4026 else
4027 newdeplibs="$newdeplibs $i"
4029 done
4032 file_magic*)
4033 set dummy $deplibs_check_method
4034 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4035 for a_deplib in $deplibs; do
4036 name=`expr $a_deplib : '-l\(.*\)'`
4037 # If $name is empty we are operating on a -L argument.
4038 if test "$name" != "" && test "$name" != "0"; then
4039 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4040 case " $predeps $postdeps " in
4041 *" $a_deplib "*)
4042 newdeplibs="$newdeplibs $a_deplib"
4043 a_deplib=""
4045 esac
4047 if test -n "$a_deplib" ; then
4048 libname=`eval \\$echo \"$libname_spec\"`
4049 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4050 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4051 for potent_lib in $potential_libs; do
4052 # Follow soft links.
4053 if ls -lLd "$potent_lib" 2>/dev/null \
4054 | grep " -> " >/dev/null; then
4055 continue
4057 # The statement above tries to avoid entering an
4058 # endless loop below, in case of cyclic links.
4059 # We might still enter an endless loop, since a link
4060 # loop can be closed while we follow links,
4061 # but so what?
4062 potlib="$potent_lib"
4063 while test -h "$potlib" 2>/dev/null; do
4064 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
4065 case $potliblink in
4066 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
4067 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
4068 esac
4069 done
4070 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
4071 | ${SED} 10q \
4072 | $EGREP "$file_magic_regex" > /dev/null; then
4073 newdeplibs="$newdeplibs $a_deplib"
4074 a_deplib=""
4075 break 2
4077 done
4078 done
4080 if test -n "$a_deplib" ; then
4081 droppeddeps=yes
4082 $echo
4083 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4084 $echo "*** I have the capability to make that library automatically link in when"
4085 $echo "*** you link to this library. But I can only do this if you have a"
4086 $echo "*** shared version of the library, which you do not appear to have"
4087 $echo "*** because I did check the linker path looking for a file starting"
4088 if test -z "$potlib" ; then
4089 $echo "*** with $libname but no candidates were found. (...for file magic test)"
4090 else
4091 $echo "*** with $libname and none of the candidates passed a file format test"
4092 $echo "*** using a file magic. Last file checked: $potlib"
4095 else
4096 # Add a -L argument.
4097 newdeplibs="$newdeplibs $a_deplib"
4099 done # Gone through all deplibs.
4101 match_pattern*)
4102 set dummy $deplibs_check_method
4103 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
4104 for a_deplib in $deplibs; do
4105 name=`expr $a_deplib : '-l\(.*\)'`
4106 # If $name is empty we are operating on a -L argument.
4107 if test -n "$name" && test "$name" != "0"; then
4108 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4109 case " $predeps $postdeps " in
4110 *" $a_deplib "*)
4111 newdeplibs="$newdeplibs $a_deplib"
4112 a_deplib=""
4114 esac
4116 if test -n "$a_deplib" ; then
4117 libname=`eval \\$echo \"$libname_spec\"`
4118 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
4119 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
4120 for potent_lib in $potential_libs; do
4121 potlib="$potent_lib" # see symlink-check above in file_magic test
4122 if eval $echo \"$potent_lib\" 2>/dev/null \
4123 | ${SED} 10q \
4124 | $EGREP "$match_pattern_regex" > /dev/null; then
4125 newdeplibs="$newdeplibs $a_deplib"
4126 a_deplib=""
4127 break 2
4129 done
4130 done
4132 if test -n "$a_deplib" ; then
4133 droppeddeps=yes
4134 $echo
4135 $echo "*** Warning: linker path does not have real file for library $a_deplib."
4136 $echo "*** I have the capability to make that library automatically link in when"
4137 $echo "*** you link to this library. But I can only do this if you have a"
4138 $echo "*** shared version of the library, which you do not appear to have"
4139 $echo "*** because I did check the linker path looking for a file starting"
4140 if test -z "$potlib" ; then
4141 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
4142 else
4143 $echo "*** with $libname and none of the candidates passed a file format test"
4144 $echo "*** using a regex pattern. Last file checked: $potlib"
4147 else
4148 # Add a -L argument.
4149 newdeplibs="$newdeplibs $a_deplib"
4151 done # Gone through all deplibs.
4153 none | unknown | *)
4154 newdeplibs=""
4155 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
4156 -e 's/ -[LR][^ ]*//g'`
4157 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
4158 for i in $predeps $postdeps ; do
4159 # can't use Xsed below, because $i might contain '/'
4160 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
4161 done
4163 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
4164 | grep . >/dev/null; then
4165 $echo
4166 if test "X$deplibs_check_method" = "Xnone"; then
4167 $echo "*** Warning: inter-library dependencies are not supported in this platform."
4168 else
4169 $echo "*** Warning: inter-library dependencies are not known to be supported."
4171 $echo "*** All declared inter-library dependencies are being dropped."
4172 droppeddeps=yes
4175 esac
4176 versuffix=$versuffix_save
4177 major=$major_save
4178 release=$release_save
4179 libname=$libname_save
4180 name=$name_save
4182 case $host in
4183 *-*-rhapsody* | *-*-darwin1.[012])
4184 # On Rhapsody replace the C library is the System framework
4185 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
4187 esac
4189 if test "$droppeddeps" = yes; then
4190 if test "$module" = yes; then
4191 $echo
4192 $echo "*** Warning: libtool could not satisfy all declared inter-library"
4193 $echo "*** dependencies of module $libname. Therefore, libtool will create"
4194 $echo "*** a static module, that should work as long as the dlopening"
4195 $echo "*** application is linked with the -dlopen flag."
4196 if test -z "$global_symbol_pipe"; then
4197 $echo
4198 $echo "*** However, this would only work if libtool was able to extract symbol"
4199 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
4200 $echo "*** not find such a program. So, this module is probably useless."
4201 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
4203 if test "$build_old_libs" = no; then
4204 oldlibs="$output_objdir/$libname.$libext"
4205 build_libtool_libs=module
4206 build_old_libs=yes
4207 else
4208 build_libtool_libs=no
4210 else
4211 $echo "*** The inter-library dependencies that have been dropped here will be"
4212 $echo "*** automatically added whenever a program is linked with this library"
4213 $echo "*** or is declared to -dlopen it."
4215 if test "$allow_undefined" = no; then
4216 $echo
4217 $echo "*** Since this library must not contain undefined symbols,"
4218 $echo "*** because either the platform does not support them or"
4219 $echo "*** it was explicitly requested with -no-undefined,"
4220 $echo "*** libtool will only create a static version of it."
4221 if test "$build_old_libs" = no; then
4222 oldlibs="$output_objdir/$libname.$libext"
4223 build_libtool_libs=module
4224 build_old_libs=yes
4225 else
4226 build_libtool_libs=no
4231 # Done checking deplibs!
4232 deplibs=$newdeplibs
4236 # move library search paths that coincide with paths to not yet
4237 # installed libraries to the beginning of the library search list
4238 new_libs=
4239 for path in $notinst_path; do
4240 case " $new_libs " in
4241 *" -L$path/$objdir "*) ;;
4243 case " $deplibs " in
4244 *" -L$path/$objdir "*)
4245 new_libs="$new_libs -L$path/$objdir" ;;
4246 esac
4248 esac
4249 done
4250 for deplib in $deplibs; do
4251 case $deplib in
4252 -L*)
4253 case " $new_libs " in
4254 *" $deplib "*) ;;
4255 *) new_libs="$new_libs $deplib" ;;
4256 esac
4258 *) new_libs="$new_libs $deplib" ;;
4259 esac
4260 done
4261 deplibs="$new_libs"
4264 # All the library-specific variables (install_libdir is set above).
4265 library_names=
4266 old_library=
4267 dlname=
4269 # Test again, we may have decided not to build it any more
4270 if test "$build_libtool_libs" = yes; then
4271 if test "$hardcode_into_libs" = yes; then
4272 # Hardcode the library paths
4273 hardcode_libdirs=
4274 dep_rpath=
4275 rpath="$finalize_rpath"
4276 test "$mode" != relink && rpath="$compile_rpath$rpath"
4277 for libdir in $rpath; do
4278 if test -n "$hardcode_libdir_flag_spec"; then
4279 if test -n "$hardcode_libdir_separator"; then
4280 if test -z "$hardcode_libdirs"; then
4281 hardcode_libdirs="$libdir"
4282 else
4283 # Just accumulate the unique libdirs.
4284 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4285 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4288 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4290 esac
4292 else
4293 eval flag=\"$hardcode_libdir_flag_spec\"
4294 dep_rpath="$dep_rpath $flag"
4296 elif test -n "$runpath_var"; then
4297 case "$perm_rpath " in
4298 *" $libdir "*) ;;
4299 *) perm_rpath="$perm_rpath $libdir" ;;
4300 esac
4302 done
4303 # Substitute the hardcoded libdirs into the rpath.
4304 if test -n "$hardcode_libdir_separator" &&
4305 test -n "$hardcode_libdirs"; then
4306 libdir="$hardcode_libdirs"
4307 if test -n "$hardcode_libdir_flag_spec_ld"; then
4308 case $archive_cmds in
4309 *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
4310 *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
4311 esac
4312 else
4313 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
4316 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4317 # We should set the runpath_var.
4318 rpath=
4319 for dir in $perm_rpath; do
4320 rpath="$rpath$dir:"
4321 done
4322 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4324 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
4327 shlibpath="$finalize_shlibpath"
4328 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
4329 if test -n "$shlibpath"; then
4330 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4333 # Get the real and link names of the library.
4334 eval shared_ext=\"$shrext_cmds\"
4335 eval library_names=\"$library_names_spec\"
4336 set dummy $library_names
4337 realname="$2"
4338 shift; shift
4340 if test -n "$soname_spec"; then
4341 eval soname=\"$soname_spec\"
4342 else
4343 soname="$realname"
4345 if test -z "$dlname"; then
4346 dlname=$soname
4349 lib="$output_objdir/$realname"
4350 linknames=
4351 for link
4353 linknames="$linknames $link"
4354 done
4356 # Use standard objects if they are pic
4357 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4359 # Prepare the list of exported symbols
4360 if test -z "$export_symbols"; then
4361 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
4362 $show "generating symbol list for \`$libname.la'"
4363 export_symbols="$output_objdir/$libname.exp"
4364 $run $rm $export_symbols
4365 cmds=$export_symbols_cmds
4366 save_ifs="$IFS"; IFS='~'
4367 for cmd in $cmds; do
4368 IFS="$save_ifs"
4369 eval cmd=\"$cmd\"
4370 if len=`expr "X$cmd" : ".*"` &&
4371 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4372 $show "$cmd"
4373 $run eval "$cmd" || exit $?
4374 skipped_export=false
4375 else
4376 # The command line is too long to execute in one step.
4377 $show "using reloadable object file for export list..."
4378 skipped_export=:
4379 # Break out early, otherwise skipped_export may be
4380 # set to false by a later but shorter cmd.
4381 break
4383 done
4384 IFS="$save_ifs"
4385 if test -n "$export_symbols_regex"; then
4386 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4387 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4388 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4389 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4394 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4395 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4398 tmp_deplibs=
4399 for test_deplib in $deplibs; do
4400 case " $convenience " in
4401 *" $test_deplib "*) ;;
4403 tmp_deplibs="$tmp_deplibs $test_deplib"
4405 esac
4406 done
4407 deplibs="$tmp_deplibs"
4409 if test -n "$convenience"; then
4410 if test -n "$whole_archive_flag_spec"; then
4411 save_libobjs=$libobjs
4412 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4413 else
4414 gentop="$output_objdir/${outputname}x"
4415 generated="$generated $gentop"
4417 func_extract_archives $gentop $convenience
4418 libobjs="$libobjs $func_extract_archives_result"
4422 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4423 eval flag=\"$thread_safe_flag_spec\"
4424 linker_flags="$linker_flags $flag"
4427 # Make a backup of the uninstalled library when relinking
4428 if test "$mode" = relink; then
4429 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4432 # Do each of the archive commands.
4433 if test "$module" = yes && test -n "$module_cmds" ; then
4434 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4435 eval test_cmds=\"$module_expsym_cmds\"
4436 cmds=$module_expsym_cmds
4437 else
4438 eval test_cmds=\"$module_cmds\"
4439 cmds=$module_cmds
4441 else
4442 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4443 eval test_cmds=\"$archive_expsym_cmds\"
4444 cmds=$archive_expsym_cmds
4445 else
4446 eval test_cmds=\"$archive_cmds\"
4447 cmds=$archive_cmds
4451 if test "X$skipped_export" != "X:" &&
4452 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4453 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4455 else
4456 # The command line is too long to link in one step, link piecewise.
4457 $echo "creating reloadable object files..."
4459 # Save the value of $output and $libobjs because we want to
4460 # use them later. If we have whole_archive_flag_spec, we
4461 # want to use save_libobjs as it was before
4462 # whole_archive_flag_spec was expanded, because we can't
4463 # assume the linker understands whole_archive_flag_spec.
4464 # This may have to be revisited, in case too many
4465 # convenience libraries get linked in and end up exceeding
4466 # the spec.
4467 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4468 save_libobjs=$libobjs
4470 save_output=$output
4471 output_la=`$echo "X$output" | $Xsed -e "$basename"`
4473 # Clear the reloadable object creation command queue and
4474 # initialize k to one.
4475 test_cmds=
4476 concat_cmds=
4477 objlist=
4478 delfiles=
4479 last_robj=
4481 output=$output_objdir/$output_la-${k}.$objext
4482 # Loop over the list of objects to be linked.
4483 for obj in $save_libobjs
4485 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4486 if test "X$objlist" = X ||
4487 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4488 test "$len" -le "$max_cmd_len"; }; then
4489 objlist="$objlist $obj"
4490 else
4491 # The command $test_cmds is almost too long, add a
4492 # command to the queue.
4493 if test "$k" -eq 1 ; then
4494 # The first file doesn't have a previous command to add.
4495 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4496 else
4497 # All subsequent reloadable object files will link in
4498 # the last one created.
4499 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4501 last_robj=$output_objdir/$output_la-${k}.$objext
4502 k=`expr $k + 1`
4503 output=$output_objdir/$output_la-${k}.$objext
4504 objlist=$obj
4505 len=1
4507 done
4508 # Handle the remaining objects by creating one last
4509 # reloadable object file. All subsequent reloadable object
4510 # files will link in the last one created.
4511 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4512 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4514 if ${skipped_export-false}; then
4515 $show "generating symbol list for \`$libname.la'"
4516 export_symbols="$output_objdir/$libname.exp"
4517 $run $rm $export_symbols
4518 libobjs=$output
4519 # Append the command to create the export file.
4520 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4523 # Set up a command to remove the reloadable object files
4524 # after they are used.
4526 while test "$i" -lt "$k"
4528 i=`expr $i + 1`
4529 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
4530 done
4532 $echo "creating a temporary reloadable object file: $output"
4534 # Loop through the commands generated above and execute them.
4535 save_ifs="$IFS"; IFS='~'
4536 for cmd in $concat_cmds; do
4537 IFS="$save_ifs"
4538 $show "$cmd"
4539 $run eval "$cmd" || exit $?
4540 done
4541 IFS="$save_ifs"
4543 libobjs=$output
4544 # Restore the value of output.
4545 output=$save_output
4547 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4548 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4550 # Expand the library linking commands again to reset the
4551 # value of $libobjs for piecewise linking.
4553 # Do each of the archive commands.
4554 if test "$module" = yes && test -n "$module_cmds" ; then
4555 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4556 cmds=$module_expsym_cmds
4557 else
4558 cmds=$module_cmds
4560 else
4561 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4562 cmds=$archive_expsym_cmds
4563 else
4564 cmds=$archive_cmds
4568 # Append the command to remove the reloadable object files
4569 # to the just-reset $cmds.
4570 eval cmds=\"\$cmds~\$rm $delfiles\"
4572 save_ifs="$IFS"; IFS='~'
4573 for cmd in $cmds; do
4574 IFS="$save_ifs"
4575 eval cmd=\"$cmd\"
4576 $show "$cmd"
4577 $run eval "$cmd" || {
4578 lt_exit=$?
4580 # Restore the uninstalled library and exit
4581 if test "$mode" = relink; then
4582 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4585 exit $lt_exit
4587 done
4588 IFS="$save_ifs"
4590 # Restore the uninstalled library and exit
4591 if test "$mode" = relink; then
4592 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4594 if test -n "$convenience"; then
4595 if test -z "$whole_archive_flag_spec"; then
4596 $show "${rm}r $gentop"
4597 $run ${rm}r "$gentop"
4601 exit $EXIT_SUCCESS
4604 # Create links to the real library.
4605 for linkname in $linknames; do
4606 if test "$realname" != "$linkname"; then
4607 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4608 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4610 done
4612 # If -module or -export-dynamic was specified, set the dlname.
4613 if test "$module" = yes || test "$export_dynamic" = yes; then
4614 # On all known operating systems, these are identical.
4615 dlname="$soname"
4620 obj)
4621 case " $deplibs" in
4622 *\ -l* | *\ -L*)
4623 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4624 esac
4626 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4627 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4630 if test -n "$rpath"; then
4631 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4634 if test -n "$xrpath"; then
4635 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4638 if test -n "$vinfo"; then
4639 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4642 if test -n "$release"; then
4643 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4646 case $output in
4647 *.lo)
4648 if test -n "$objs$old_deplibs"; then
4649 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4650 exit $EXIT_FAILURE
4652 libobj="$output"
4653 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4656 libobj=
4657 obj="$output"
4659 esac
4661 # Delete the old objects.
4662 $run $rm $obj $libobj
4664 # Objects from convenience libraries. This assumes
4665 # single-version convenience libraries. Whenever we create
4666 # different ones for PIC/non-PIC, this we'll have to duplicate
4667 # the extraction.
4668 reload_conv_objs=
4669 gentop=
4670 # reload_cmds runs $LD directly, so let us get rid of
4671 # -Wl from whole_archive_flag_spec and hope we can get by with
4672 # turning comma into space..
4675 if test -n "$convenience"; then
4676 if test -n "$whole_archive_flag_spec"; then
4677 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
4678 reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4679 else
4680 gentop="$output_objdir/${obj}x"
4681 generated="$generated $gentop"
4683 func_extract_archives $gentop $convenience
4684 reload_conv_objs="$reload_objs $func_extract_archives_result"
4688 # Create the old-style object.
4689 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
4691 output="$obj"
4692 cmds=$reload_cmds
4693 save_ifs="$IFS"; IFS='~'
4694 for cmd in $cmds; do
4695 IFS="$save_ifs"
4696 eval cmd=\"$cmd\"
4697 $show "$cmd"
4698 $run eval "$cmd" || exit $?
4699 done
4700 IFS="$save_ifs"
4702 # Exit if we aren't doing a library object file.
4703 if test -z "$libobj"; then
4704 if test -n "$gentop"; then
4705 $show "${rm}r $gentop"
4706 $run ${rm}r $gentop
4709 exit $EXIT_SUCCESS
4712 if test "$build_libtool_libs" != yes; then
4713 if test -n "$gentop"; then
4714 $show "${rm}r $gentop"
4715 $run ${rm}r $gentop
4718 # Create an invalid libtool object if no PIC, so that we don't
4719 # accidentally link it into a program.
4720 # $show "echo timestamp > $libobj"
4721 # $run eval "echo timestamp > $libobj" || exit $?
4722 exit $EXIT_SUCCESS
4725 if test -n "$pic_flag" || test "$pic_mode" != default; then
4726 # Only do commands if we really have different PIC objects.
4727 reload_objs="$libobjs $reload_conv_objs"
4728 output="$libobj"
4729 cmds=$reload_cmds
4730 save_ifs="$IFS"; IFS='~'
4731 for cmd in $cmds; do
4732 IFS="$save_ifs"
4733 eval cmd=\"$cmd\"
4734 $show "$cmd"
4735 $run eval "$cmd" || exit $?
4736 done
4737 IFS="$save_ifs"
4740 if test -n "$gentop"; then
4741 $show "${rm}r $gentop"
4742 $run ${rm}r $gentop
4745 exit $EXIT_SUCCESS
4748 prog)
4749 case $host in
4750 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4751 esac
4752 if test -n "$vinfo"; then
4753 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4756 if test -n "$release"; then
4757 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4760 if test "$preload" = yes; then
4761 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4762 test "$dlopen_self_static" = unknown; then
4763 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4767 case $host in
4768 *-*-rhapsody* | *-*-darwin1.[012])
4769 # On Rhapsody replace the C library is the System framework
4770 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4771 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4773 esac
4775 case $host in
4776 *darwin*)
4777 # Don't allow lazy linking, it breaks C++ global constructors
4778 if test "$tagname" = CXX ; then
4779 compile_command="$compile_command ${wl}-bind_at_load"
4780 finalize_command="$finalize_command ${wl}-bind_at_load"
4783 esac
4786 # move library search paths that coincide with paths to not yet
4787 # installed libraries to the beginning of the library search list
4788 new_libs=
4789 for path in $notinst_path; do
4790 case " $new_libs " in
4791 *" -L$path/$objdir "*) ;;
4793 case " $compile_deplibs " in
4794 *" -L$path/$objdir "*)
4795 new_libs="$new_libs -L$path/$objdir" ;;
4796 esac
4798 esac
4799 done
4800 for deplib in $compile_deplibs; do
4801 case $deplib in
4802 -L*)
4803 case " $new_libs " in
4804 *" $deplib "*) ;;
4805 *) new_libs="$new_libs $deplib" ;;
4806 esac
4808 *) new_libs="$new_libs $deplib" ;;
4809 esac
4810 done
4811 compile_deplibs="$new_libs"
4814 compile_command="$compile_command $compile_deplibs"
4815 finalize_command="$finalize_command $finalize_deplibs"
4817 if test -n "$rpath$xrpath"; then
4818 # If the user specified any rpath flags, then add them.
4819 for libdir in $rpath $xrpath; do
4820 # This is the magic to use -rpath.
4821 case "$finalize_rpath " in
4822 *" $libdir "*) ;;
4823 *) finalize_rpath="$finalize_rpath $libdir" ;;
4824 esac
4825 done
4828 # Now hardcode the library paths
4829 rpath=
4830 hardcode_libdirs=
4831 for libdir in $compile_rpath $finalize_rpath; do
4832 if test -n "$hardcode_libdir_flag_spec"; then
4833 if test -n "$hardcode_libdir_separator"; then
4834 if test -z "$hardcode_libdirs"; then
4835 hardcode_libdirs="$libdir"
4836 else
4837 # Just accumulate the unique libdirs.
4838 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4839 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4842 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4844 esac
4846 else
4847 eval flag=\"$hardcode_libdir_flag_spec\"
4848 rpath="$rpath $flag"
4850 elif test -n "$runpath_var"; then
4851 case "$perm_rpath " in
4852 *" $libdir "*) ;;
4853 *) perm_rpath="$perm_rpath $libdir" ;;
4854 esac
4856 case $host in
4857 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4858 testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4859 case :$dllsearchpath: in
4860 *":$libdir:"*) ;;
4861 *) dllsearchpath="$dllsearchpath:$libdir";;
4862 esac
4863 case :$dllsearchpath: in
4864 *":$testbindir:"*) ;;
4865 *) dllsearchpath="$dllsearchpath:$testbindir";;
4866 esac
4868 esac
4869 done
4870 # Substitute the hardcoded libdirs into the rpath.
4871 if test -n "$hardcode_libdir_separator" &&
4872 test -n "$hardcode_libdirs"; then
4873 libdir="$hardcode_libdirs"
4874 eval rpath=\" $hardcode_libdir_flag_spec\"
4876 compile_rpath="$rpath"
4878 rpath=
4879 hardcode_libdirs=
4880 for libdir in $finalize_rpath; do
4881 if test -n "$hardcode_libdir_flag_spec"; then
4882 if test -n "$hardcode_libdir_separator"; then
4883 if test -z "$hardcode_libdirs"; then
4884 hardcode_libdirs="$libdir"
4885 else
4886 # Just accumulate the unique libdirs.
4887 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4888 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4891 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4893 esac
4895 else
4896 eval flag=\"$hardcode_libdir_flag_spec\"
4897 rpath="$rpath $flag"
4899 elif test -n "$runpath_var"; then
4900 case "$finalize_perm_rpath " in
4901 *" $libdir "*) ;;
4902 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4903 esac
4905 done
4906 # Substitute the hardcoded libdirs into the rpath.
4907 if test -n "$hardcode_libdir_separator" &&
4908 test -n "$hardcode_libdirs"; then
4909 libdir="$hardcode_libdirs"
4910 eval rpath=\" $hardcode_libdir_flag_spec\"
4912 finalize_rpath="$rpath"
4914 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4915 # Transform all the library objects into standard objects.
4916 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4917 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4920 dlsyms=
4921 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4922 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4923 dlsyms="${outputname}S.c"
4924 else
4925 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4929 if test -n "$dlsyms"; then
4930 case $dlsyms in
4931 "") ;;
4932 *.c)
4933 # Discover the nlist of each of the dlfiles.
4934 nlist="$output_objdir/${outputname}.nm"
4936 $show "$rm $nlist ${nlist}S ${nlist}T"
4937 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4939 # Parse the name list into a source file.
4940 $show "creating $output_objdir/$dlsyms"
4942 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4943 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4944 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4946 #ifdef __cplusplus
4947 extern \"C\" {
4948 #endif
4950 /* Prevent the only kind of declaration conflicts we can make. */
4951 #define lt_preloaded_symbols some_other_symbol
4953 /* External symbol declarations for the compiler. */\
4956 if test "$dlself" = yes; then
4957 $show "generating symbol list for \`$output'"
4959 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4961 # Add our own program objects to the symbol list.
4962 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4963 for arg in $progfiles; do
4964 $show "extracting global C symbols from \`$arg'"
4965 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4966 done
4968 if test -n "$exclude_expsyms"; then
4969 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4970 $run eval '$mv "$nlist"T "$nlist"'
4973 if test -n "$export_symbols_regex"; then
4974 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4975 $run eval '$mv "$nlist"T "$nlist"'
4978 # Prepare the list of exported symbols
4979 if test -z "$export_symbols"; then
4980 export_symbols="$output_objdir/$outputname.exp"
4981 $run $rm $export_symbols
4982 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4983 case $host in
4984 *cygwin* | *mingw* )
4985 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4986 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4988 esac
4989 else
4990 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4991 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4992 $run eval 'mv "$nlist"T "$nlist"'
4993 case $host in
4994 *cygwin* | *mingw* )
4995 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4996 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4998 esac
5002 for arg in $dlprefiles; do
5003 $show "extracting global C symbols from \`$arg'"
5004 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
5005 $run eval '$echo ": $name " >> "$nlist"'
5006 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
5007 done
5009 if test -z "$run"; then
5010 # Make sure we have at least an empty file.
5011 test -f "$nlist" || : > "$nlist"
5013 if test -n "$exclude_expsyms"; then
5014 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5015 $mv "$nlist"T "$nlist"
5018 # Try sorting and uniquifying the output.
5019 if grep -v "^: " < "$nlist" |
5020 if sort -k 3 </dev/null >/dev/null 2>&1; then
5021 sort -k 3
5022 else
5023 sort +2
5024 fi |
5025 uniq > "$nlist"S; then
5027 else
5028 grep -v "^: " < "$nlist" > "$nlist"S
5031 if test -f "$nlist"S; then
5032 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
5033 else
5034 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
5037 $echo >> "$output_objdir/$dlsyms" "\
5039 #undef lt_preloaded_symbols
5041 #if defined (__STDC__) && __STDC__
5042 # define lt_ptr void *
5043 #else
5044 # define lt_ptr char *
5045 # define const
5046 #endif
5048 /* The mapping between symbol names and symbols. */
5051 case $host in
5052 *cygwin* | *mingw* )
5053 $echo >> "$output_objdir/$dlsyms" "\
5054 /* DATA imports from DLLs on WIN32 can't be const, because
5055 runtime relocations are performed -- see ld's documentation
5056 on pseudo-relocs */
5057 struct {
5061 $echo >> "$output_objdir/$dlsyms" "\
5062 const struct {
5065 esac
5068 $echo >> "$output_objdir/$dlsyms" "\
5069 const char *name;
5070 lt_ptr address;
5072 lt_preloaded_symbols[] =
5076 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
5078 $echo >> "$output_objdir/$dlsyms" "\
5079 {0, (lt_ptr) 0}
5082 /* This works around a problem in FreeBSD linker */
5083 #ifdef FREEBSD_WORKAROUND
5084 static const void *lt_preloaded_setup() {
5085 return lt_preloaded_symbols;
5087 #endif
5089 #ifdef __cplusplus
5091 #endif\
5095 pic_flag_for_symtable=
5096 case $host in
5097 # compiling the symbol table file with pic_flag works around
5098 # a FreeBSD bug that causes programs to crash when -lm is
5099 # linked before any other PIC object. But we must not use
5100 # pic_flag when linking with -static. The problem exists in
5101 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5102 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5103 case "$compile_command " in
5104 *" -static "*) ;;
5105 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
5106 esac;;
5107 *-*-hpux*)
5108 case "$compile_command " in
5109 *" -static "*) ;;
5110 *) pic_flag_for_symtable=" $pic_flag";;
5111 esac
5112 esac
5114 # Now compile the dynamic symbol file.
5115 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
5116 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
5118 # Clean up the generated files.
5119 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
5120 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
5122 # Transform the symbol file into the correct name.
5123 case $host in
5124 *cygwin* | *mingw* )
5125 if test -f "$output_objdir/${outputname}.def" ; then
5126 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5127 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
5128 else
5129 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5130 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5134 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5135 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
5137 esac
5140 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
5141 exit $EXIT_FAILURE
5143 esac
5144 else
5145 # We keep going just in case the user didn't refer to
5146 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
5147 # really was required.
5149 # Nullify the symbol file.
5150 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5151 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
5154 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
5155 # Replace the output file specification.
5156 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
5157 link_command="$compile_command$compile_rpath"
5159 # We have no uninstalled library dependencies, so finalize right now.
5160 $show "$link_command"
5161 $run eval "$link_command"
5162 exit_status=$?
5164 # Delete the generated files.
5165 if test -n "$dlsyms"; then
5166 $show "$rm $output_objdir/${outputname}S.${objext}"
5167 $run $rm "$output_objdir/${outputname}S.${objext}"
5170 exit $exit_status
5173 if test -n "$shlibpath_var"; then
5174 # We should set the shlibpath_var
5175 rpath=
5176 for dir in $temp_rpath; do
5177 case $dir in
5178 [\\/]* | [A-Za-z]:[\\/]*)
5179 # Absolute path.
5180 rpath="$rpath$dir:"
5183 # Relative path: add a thisdir entry.
5184 rpath="$rpath\$thisdir/$dir:"
5186 esac
5187 done
5188 temp_rpath="$rpath"
5191 if test -n "$compile_shlibpath$finalize_shlibpath"; then
5192 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
5194 if test -n "$finalize_shlibpath"; then
5195 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
5198 compile_var=
5199 finalize_var=
5200 if test -n "$runpath_var"; then
5201 if test -n "$perm_rpath"; then
5202 # We should set the runpath_var.
5203 rpath=
5204 for dir in $perm_rpath; do
5205 rpath="$rpath$dir:"
5206 done
5207 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
5209 if test -n "$finalize_perm_rpath"; then
5210 # We should set the runpath_var.
5211 rpath=
5212 for dir in $finalize_perm_rpath; do
5213 rpath="$rpath$dir:"
5214 done
5215 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
5219 if test "$no_install" = yes; then
5220 # We don't need to create a wrapper script.
5221 link_command="$compile_var$compile_command$compile_rpath"
5222 # Replace the output file specification.
5223 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
5224 # Delete the old output file.
5225 $run $rm $output
5226 # Link the executable and exit
5227 $show "$link_command"
5228 $run eval "$link_command" || exit $?
5229 exit $EXIT_SUCCESS
5232 if test "$hardcode_action" = relink; then
5233 # Fast installation is not supported
5234 link_command="$compile_var$compile_command$compile_rpath"
5235 relink_command="$finalize_var$finalize_command$finalize_rpath"
5237 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
5238 $echo "$modename: \`$output' will be relinked during installation" 1>&2
5239 else
5240 if test "$fast_install" != no; then
5241 link_command="$finalize_var$compile_command$finalize_rpath"
5242 if test "$fast_install" = yes; then
5243 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
5244 else
5245 # fast_install is set to needless
5246 relink_command=
5248 else
5249 link_command="$compile_var$compile_command$compile_rpath"
5250 relink_command="$finalize_var$finalize_command$finalize_rpath"
5254 # Replace the output file specification.
5255 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
5257 # Delete the old output files.
5258 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
5260 $show "$link_command"
5261 $run eval "$link_command" || exit $?
5263 # Now create the wrapper script.
5264 $show "creating $output"
5266 # Quote the relink command for shipping.
5267 if test -n "$relink_command"; then
5268 # Preserve any variables that may affect compiler behavior
5269 for var in $variables_saved_for_relink; do
5270 if eval test -z \"\${$var+set}\"; then
5271 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5272 elif eval var_value=\$$var; test -z "$var_value"; then
5273 relink_command="$var=; export $var; $relink_command"
5274 else
5275 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5276 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5278 done
5279 relink_command="(cd `pwd`; $relink_command)"
5280 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5283 # Quote $echo for shipping.
5284 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5285 case $progpath in
5286 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
5287 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
5288 esac
5289 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5290 else
5291 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5294 # Only actually do things if our run command is non-null.
5295 if test -z "$run"; then
5296 # win32 will think the script is a binary if it has
5297 # a .exe suffix, so we strip it off here.
5298 case $output in
5299 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
5300 esac
5301 # test for cygwin because mv fails w/o .exe extensions
5302 case $host in
5303 *cygwin*)
5304 exeext=.exe
5305 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5306 *) exeext= ;;
5307 esac
5308 case $host in
5309 *cygwin* | *mingw* )
5310 output_name=`basename $output`
5311 output_path=`dirname $output`
5312 cwrappersource="$output_path/$objdir/lt-$output_name.c"
5313 cwrapper="$output_path/$output_name.exe"
5314 $rm $cwrappersource $cwrapper
5315 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5317 cat > $cwrappersource <<EOF
5319 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5320 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5322 The $output program cannot be directly executed until all the libtool
5323 libraries that it depends on are installed.
5325 This wrapper executable should never be moved out of the build directory.
5326 If it is, it will not operate correctly.
5328 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5329 but could eventually absorb all of the scripts functionality and
5330 exec $objdir/$outputname directly.
5333 cat >> $cwrappersource<<"EOF"
5334 #include <stdio.h>
5335 #include <stdlib.h>
5336 #include <unistd.h>
5337 #include <malloc.h>
5338 #include <stdarg.h>
5339 #include <assert.h>
5340 #include <string.h>
5341 #include <ctype.h>
5342 #include <sys/stat.h>
5344 #if defined(PATH_MAX)
5345 # define LT_PATHMAX PATH_MAX
5346 #elif defined(MAXPATHLEN)
5347 # define LT_PATHMAX MAXPATHLEN
5348 #else
5349 # define LT_PATHMAX 1024
5350 #endif
5352 #ifndef DIR_SEPARATOR
5353 # define DIR_SEPARATOR '/'
5354 # define PATH_SEPARATOR ':'
5355 #endif
5357 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5358 defined (__OS2__)
5359 # define HAVE_DOS_BASED_FILE_SYSTEM
5360 # ifndef DIR_SEPARATOR_2
5361 # define DIR_SEPARATOR_2 '\\'
5362 # endif
5363 # ifndef PATH_SEPARATOR_2
5364 # define PATH_SEPARATOR_2 ';'
5365 # endif
5366 #endif
5368 #ifndef DIR_SEPARATOR_2
5369 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5370 #else /* DIR_SEPARATOR_2 */
5371 # define IS_DIR_SEPARATOR(ch) \
5372 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5373 #endif /* DIR_SEPARATOR_2 */
5375 #ifndef PATH_SEPARATOR_2
5376 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5377 #else /* PATH_SEPARATOR_2 */
5378 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5379 #endif /* PATH_SEPARATOR_2 */
5381 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5382 #define XFREE(stale) do { \
5383 if (stale) { free ((void *) stale); stale = 0; } \
5384 } while (0)
5386 /* -DDEBUG is fairly common in CFLAGS. */
5387 #undef DEBUG
5388 #if defined DEBUGWRAPPER
5389 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5390 #else
5391 # define DEBUG(format, ...)
5392 #endif
5394 const char *program_name = NULL;
5396 void * xmalloc (size_t num);
5397 char * xstrdup (const char *string);
5398 const char * base_name (const char *name);
5399 char * find_executable(const char *wrapper);
5400 int check_executable(const char *path);
5401 char * strendzap(char *str, const char *pat);
5402 void lt_fatal (const char *message, ...);
5405 main (int argc, char *argv[])
5407 char **newargz;
5408 int i;
5410 program_name = (char *) xstrdup (base_name (argv[0]));
5411 DEBUG("(main) argv[0] : %s\n",argv[0]);
5412 DEBUG("(main) program_name : %s\n",program_name);
5413 newargz = XMALLOC(char *, argc+2);
5416 cat >> $cwrappersource <<EOF
5417 newargz[0] = (char *) xstrdup("$SHELL");
5420 cat >> $cwrappersource <<"EOF"
5421 newargz[1] = find_executable(argv[0]);
5422 if (newargz[1] == NULL)
5423 lt_fatal("Couldn't find %s", argv[0]);
5424 DEBUG("(main) found exe at : %s\n",newargz[1]);
5425 /* we know the script has the same name, without the .exe */
5426 /* so make sure newargz[1] doesn't end in .exe */
5427 strendzap(newargz[1],".exe");
5428 for (i = 1; i < argc; i++)
5429 newargz[i+1] = xstrdup(argv[i]);
5430 newargz[argc+1] = NULL;
5432 for (i=0; i<argc+1; i++)
5434 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5440 case $host_os in
5441 mingw*)
5442 cat >> $cwrappersource <<EOF
5443 execv("$SHELL",(char const **)newargz);
5447 cat >> $cwrappersource <<EOF
5448 execv("$SHELL",newargz);
5451 esac
5453 cat >> $cwrappersource <<"EOF"
5454 return 127;
5457 void *
5458 xmalloc (size_t num)
5460 void * p = (void *) malloc (num);
5461 if (!p)
5462 lt_fatal ("Memory exhausted");
5464 return p;
5467 char *
5468 xstrdup (const char *string)
5470 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5474 const char *
5475 base_name (const char *name)
5477 const char *base;
5479 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5480 /* Skip over the disk name in MSDOS pathnames. */
5481 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5482 name += 2;
5483 #endif
5485 for (base = name; *name; name++)
5486 if (IS_DIR_SEPARATOR (*name))
5487 base = name + 1;
5488 return base;
5492 check_executable(const char * path)
5494 struct stat st;
5496 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5497 if ((!path) || (!*path))
5498 return 0;
5500 if ((stat (path, &st) >= 0) &&
5502 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5503 #if defined (S_IXOTH)
5504 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5505 #endif
5506 #if defined (S_IXGRP)
5507 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5508 #endif
5509 ((st.st_mode & S_IXUSR) == S_IXUSR))
5511 return 1;
5512 else
5513 return 0;
5516 /* Searches for the full path of the wrapper. Returns
5517 newly allocated full path name if found, NULL otherwise */
5518 char *
5519 find_executable (const char* wrapper)
5521 int has_slash = 0;
5522 const char* p;
5523 const char* p_next;
5524 /* static buffer for getcwd */
5525 char tmp[LT_PATHMAX + 1];
5526 int tmp_len;
5527 char* concat_name;
5529 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5531 if ((wrapper == NULL) || (*wrapper == '\0'))
5532 return NULL;
5534 /* Absolute path? */
5535 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5536 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5538 concat_name = xstrdup (wrapper);
5539 if (check_executable(concat_name))
5540 return concat_name;
5541 XFREE(concat_name);
5543 else
5545 #endif
5546 if (IS_DIR_SEPARATOR (wrapper[0]))
5548 concat_name = xstrdup (wrapper);
5549 if (check_executable(concat_name))
5550 return concat_name;
5551 XFREE(concat_name);
5553 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5555 #endif
5557 for (p = wrapper; *p; p++)
5558 if (*p == '/')
5560 has_slash = 1;
5561 break;
5563 if (!has_slash)
5565 /* no slashes; search PATH */
5566 const char* path = getenv ("PATH");
5567 if (path != NULL)
5569 for (p = path; *p; p = p_next)
5571 const char* q;
5572 size_t p_len;
5573 for (q = p; *q; q++)
5574 if (IS_PATH_SEPARATOR(*q))
5575 break;
5576 p_len = q - p;
5577 p_next = (*q == '\0' ? q : q + 1);
5578 if (p_len == 0)
5580 /* empty path: current directory */
5581 if (getcwd (tmp, LT_PATHMAX) == NULL)
5582 lt_fatal ("getcwd failed");
5583 tmp_len = strlen(tmp);
5584 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5585 memcpy (concat_name, tmp, tmp_len);
5586 concat_name[tmp_len] = '/';
5587 strcpy (concat_name + tmp_len + 1, wrapper);
5589 else
5591 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5592 memcpy (concat_name, p, p_len);
5593 concat_name[p_len] = '/';
5594 strcpy (concat_name + p_len + 1, wrapper);
5596 if (check_executable(concat_name))
5597 return concat_name;
5598 XFREE(concat_name);
5601 /* not found in PATH; assume curdir */
5603 /* Relative path | not found in path: prepend cwd */
5604 if (getcwd (tmp, LT_PATHMAX) == NULL)
5605 lt_fatal ("getcwd failed");
5606 tmp_len = strlen(tmp);
5607 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5608 memcpy (concat_name, tmp, tmp_len);
5609 concat_name[tmp_len] = '/';
5610 strcpy (concat_name + tmp_len + 1, wrapper);
5612 if (check_executable(concat_name))
5613 return concat_name;
5614 XFREE(concat_name);
5615 return NULL;
5618 char *
5619 strendzap(char *str, const char *pat)
5621 size_t len, patlen;
5623 assert(str != NULL);
5624 assert(pat != NULL);
5626 len = strlen(str);
5627 patlen = strlen(pat);
5629 if (patlen <= len)
5631 str += len - patlen;
5632 if (strcmp(str, pat) == 0)
5633 *str = '\0';
5635 return str;
5638 static void
5639 lt_error_core (int exit_status, const char * mode,
5640 const char * message, va_list ap)
5642 fprintf (stderr, "%s: %s: ", program_name, mode);
5643 vfprintf (stderr, message, ap);
5644 fprintf (stderr, ".\n");
5646 if (exit_status >= 0)
5647 exit (exit_status);
5650 void
5651 lt_fatal (const char *message, ...)
5653 va_list ap;
5654 va_start (ap, message);
5655 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5656 va_end (ap);
5659 # we should really use a build-platform specific compiler
5660 # here, but OTOH, the wrappers (shell script and this C one)
5661 # are only useful if you want to execute the "real" binary.
5662 # Since the "real" binary is built for $host, then this
5663 # wrapper might as well be built for $host, too.
5664 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5666 esac
5667 $rm $output
5668 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5670 $echo > $output "\
5671 #! $SHELL
5673 # $output - temporary wrapper script for $objdir/$outputname
5674 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5676 # The $output program cannot be directly executed until all the libtool
5677 # libraries that it depends on are installed.
5679 # This wrapper script should never be moved out of the build directory.
5680 # If it is, it will not operate correctly.
5682 # Sed substitution that helps us do robust quoting. It backslashifies
5683 # metacharacters that are still active within double-quoted strings.
5684 Xsed='${SED} -e 1s/^X//'
5685 sed_quote_subst='$sed_quote_subst'
5687 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5688 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5689 emulate sh
5690 NULLCMD=:
5691 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5692 # is contrary to our usage. Disable this feature.
5693 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5694 setopt NO_GLOB_SUBST
5695 else
5696 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5698 BIN_SH=xpg4; export BIN_SH # for Tru64
5699 DUALCASE=1; export DUALCASE # for MKS sh
5701 # The HP-UX ksh and POSIX shell print the target directory to stdout
5702 # if CDPATH is set.
5703 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5705 relink_command=\"$relink_command\"
5707 # This environment variable determines our operation mode.
5708 if test \"\$libtool_install_magic\" = \"$magic\"; then
5709 # install mode needs the following variable:
5710 notinst_deplibs='$notinst_deplibs'
5711 else
5712 # When we are sourced in execute mode, \$file and \$echo are already set.
5713 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5714 echo=\"$qecho\"
5715 file=\"\$0\"
5716 # Make sure echo works.
5717 if test \"X\$1\" = X--no-reexec; then
5718 # Discard the --no-reexec flag, and continue.
5719 shift
5720 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5721 # Yippee, \$echo works!
5723 else
5724 # Restart under the correct shell, and then maybe \$echo will work.
5725 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5729 $echo >> $output "\
5731 # Find the directory that this script lives in.
5732 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5733 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5735 # Follow symbolic links until we get to the real thisdir.
5736 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5737 while test -n \"\$file\"; do
5738 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5740 # If there was a directory component, then change thisdir.
5741 if test \"x\$destdir\" != \"x\$file\"; then
5742 case \"\$destdir\" in
5743 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5744 *) thisdir=\"\$thisdir/\$destdir\" ;;
5745 esac
5748 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5749 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5750 done
5752 # Try to get the absolute directory name.
5753 absdir=\`cd \"\$thisdir\" && pwd\`
5754 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5757 if test "$fast_install" = yes; then
5758 $echo >> $output "\
5759 program=lt-'$outputname'$exeext
5760 progdir=\"\$thisdir/$objdir\"
5762 if test ! -f \"\$progdir/\$program\" || \\
5763 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5764 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5766 file=\"\$\$-\$program\"
5768 if test ! -d \"\$progdir\"; then
5769 $mkdir \"\$progdir\"
5770 else
5771 $rm \"\$progdir/\$file\"
5774 $echo >> $output "\
5776 # relink executable if necessary
5777 if test -n \"\$relink_command\"; then
5778 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5779 else
5780 $echo \"\$relink_command_output\" >&2
5781 $rm \"\$progdir/\$file\"
5782 exit $EXIT_FAILURE
5786 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5787 { $rm \"\$progdir/\$program\";
5788 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5789 $rm \"\$progdir/\$file\"
5791 else
5792 $echo >> $output "\
5793 program='$outputname'
5794 progdir=\"\$thisdir/$objdir\"
5798 $echo >> $output "\
5800 if test -f \"\$progdir/\$program\"; then"
5802 # Export our shlibpath_var if we have one.
5803 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5804 $echo >> $output "\
5805 # Add our own library path to $shlibpath_var
5806 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5808 # Some systems cannot cope with colon-terminated $shlibpath_var
5809 # The second colon is a workaround for a bug in BeOS R4 sed
5810 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5812 export $shlibpath_var
5816 # fixup the dll searchpath if we need to.
5817 if test -n "$dllsearchpath"; then
5818 $echo >> $output "\
5819 # Add the dll search path components to the executable PATH
5820 PATH=$dllsearchpath:\$PATH
5824 $echo >> $output "\
5825 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5826 # Run the actual program with our arguments.
5828 case $host in
5829 # Backslashes separate directories on plain windows
5830 *-*-mingw | *-*-os2*)
5831 $echo >> $output "\
5832 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5837 $echo >> $output "\
5838 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5841 esac
5842 $echo >> $output "\
5843 \$echo \"\$0: cannot exec \$program \$*\"
5844 exit $EXIT_FAILURE
5846 else
5847 # The program doesn't exist.
5848 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5849 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5850 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5851 exit $EXIT_FAILURE
5855 chmod +x $output
5857 exit $EXIT_SUCCESS
5859 esac
5861 # See if we need to build an old-fashioned archive.
5862 for oldlib in $oldlibs; do
5864 if test "$build_libtool_libs" = convenience; then
5865 oldobjs="$libobjs_save"
5866 addlibs="$convenience"
5867 build_libtool_libs=no
5868 else
5869 if test "$build_libtool_libs" = module; then
5870 oldobjs="$libobjs_save"
5871 build_libtool_libs=no
5872 else
5873 oldobjs="$old_deplibs $non_pic_objects"
5875 addlibs="$old_convenience"
5878 if test -n "$addlibs"; then
5879 gentop="$output_objdir/${outputname}x"
5880 generated="$generated $gentop"
5882 func_extract_archives $gentop $addlibs
5883 oldobjs="$oldobjs $func_extract_archives_result"
5886 # Do each command in the archive commands.
5887 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5888 cmds=$old_archive_from_new_cmds
5889 else
5890 # POSIX demands no paths to be encoded in archives. We have
5891 # to avoid creating archives with duplicate basenames if we
5892 # might have to extract them afterwards, e.g., when creating a
5893 # static archive out of a convenience library, or when linking
5894 # the entirety of a libtool archive into another (currently
5895 # not supported by libtool).
5896 if (for obj in $oldobjs
5898 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5899 done | sort | sort -uc >/dev/null 2>&1); then
5901 else
5902 $echo "copying selected object files to avoid basename conflicts..."
5904 if test -z "$gentop"; then
5905 gentop="$output_objdir/${outputname}x"
5906 generated="$generated $gentop"
5908 $show "${rm}r $gentop"
5909 $run ${rm}r "$gentop"
5910 $show "$mkdir $gentop"
5911 $run $mkdir "$gentop"
5912 exit_status=$?
5913 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5914 exit $exit_status
5918 save_oldobjs=$oldobjs
5919 oldobjs=
5920 counter=1
5921 for obj in $save_oldobjs
5923 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5924 case " $oldobjs " in
5925 " ") oldobjs=$obj ;;
5926 *[\ /]"$objbase "*)
5927 while :; do
5928 # Make sure we don't pick an alternate name that also
5929 # overlaps.
5930 newobj=lt$counter-$objbase
5931 counter=`expr $counter + 1`
5932 case " $oldobjs " in
5933 *[\ /]"$newobj "*) ;;
5934 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5935 esac
5936 done
5937 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5938 $run ln "$obj" "$gentop/$newobj" ||
5939 $run cp "$obj" "$gentop/$newobj"
5940 oldobjs="$oldobjs $gentop/$newobj"
5942 *) oldobjs="$oldobjs $obj" ;;
5943 esac
5944 done
5947 eval cmds=\"$old_archive_cmds\"
5949 if len=`expr "X$cmds" : ".*"` &&
5950 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5951 cmds=$old_archive_cmds
5952 else
5953 # the command line is too long to link in one step, link in parts
5954 $echo "using piecewise archive linking..."
5955 save_RANLIB=$RANLIB
5956 RANLIB=:
5957 objlist=
5958 concat_cmds=
5959 save_oldobjs=$oldobjs
5961 # Is there a better way of finding the last object in the list?
5962 for obj in $save_oldobjs
5964 last_oldobj=$obj
5965 done
5966 for obj in $save_oldobjs
5968 oldobjs="$objlist $obj"
5969 objlist="$objlist $obj"
5970 eval test_cmds=\"$old_archive_cmds\"
5971 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5972 test "$len" -le "$max_cmd_len"; then
5974 else
5975 # the above command should be used before it gets too long
5976 oldobjs=$objlist
5977 if test "$obj" = "$last_oldobj" ; then
5978 RANLIB=$save_RANLIB
5980 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5981 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5982 objlist=
5984 done
5985 RANLIB=$save_RANLIB
5986 oldobjs=$objlist
5987 if test "X$oldobjs" = "X" ; then
5988 eval cmds=\"\$concat_cmds\"
5989 else
5990 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5994 save_ifs="$IFS"; IFS='~'
5995 for cmd in $cmds; do
5996 eval cmd=\"$cmd\"
5997 IFS="$save_ifs"
5998 $show "$cmd"
5999 $run eval "$cmd" || exit $?
6000 done
6001 IFS="$save_ifs"
6002 done
6004 if test -n "$generated"; then
6005 $show "${rm}r$generated"
6006 $run ${rm}r$generated
6009 # Now create the libtool archive.
6010 case $output in
6011 *.la)
6012 old_library=
6013 test "$build_old_libs" = yes && old_library="$libname.$libext"
6014 $show "creating $output"
6016 # Preserve any variables that may affect compiler behavior
6017 for var in $variables_saved_for_relink; do
6018 if eval test -z \"\${$var+set}\"; then
6019 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
6020 elif eval var_value=\$$var; test -z "$var_value"; then
6021 relink_command="$var=; export $var; $relink_command"
6022 else
6023 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
6024 relink_command="$var=\"$var_value\"; export $var; $relink_command"
6026 done
6027 # Quote the link command for shipping.
6028 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
6029 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
6030 if test "$hardcode_automatic" = yes ; then
6031 relink_command=
6035 # Only create the output if not a dry run.
6036 if test -z "$run"; then
6037 for installed in no yes; do
6038 if test "$installed" = yes; then
6039 if test -z "$install_libdir"; then
6040 break
6042 output="$output_objdir/$outputname"i
6043 # Replace all uninstalled libtool libraries with the installed ones
6044 newdependency_libs=
6045 for deplib in $dependency_libs; do
6046 case $deplib in
6047 *.la)
6048 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
6049 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6050 if test -z "$libdir"; then
6051 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
6052 exit $EXIT_FAILURE
6054 newdependency_libs="$newdependency_libs $libdir/$name"
6056 *) newdependency_libs="$newdependency_libs $deplib" ;;
6057 esac
6058 done
6059 dependency_libs="$newdependency_libs"
6060 newdlfiles=
6061 for lib in $dlfiles; do
6062 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6063 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6064 if test -z "$libdir"; then
6065 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6066 exit $EXIT_FAILURE
6068 newdlfiles="$newdlfiles $libdir/$name"
6069 done
6070 dlfiles="$newdlfiles"
6071 newdlprefiles=
6072 for lib in $dlprefiles; do
6073 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
6074 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
6075 if test -z "$libdir"; then
6076 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6077 exit $EXIT_FAILURE
6079 newdlprefiles="$newdlprefiles $libdir/$name"
6080 done
6081 dlprefiles="$newdlprefiles"
6082 else
6083 newdlfiles=
6084 for lib in $dlfiles; do
6085 case $lib in
6086 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6087 *) abs=`pwd`"/$lib" ;;
6088 esac
6089 newdlfiles="$newdlfiles $abs"
6090 done
6091 dlfiles="$newdlfiles"
6092 newdlprefiles=
6093 for lib in $dlprefiles; do
6094 case $lib in
6095 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
6096 *) abs=`pwd`"/$lib" ;;
6097 esac
6098 newdlprefiles="$newdlprefiles $abs"
6099 done
6100 dlprefiles="$newdlprefiles"
6102 $rm $output
6103 # place dlname in correct position for cygwin
6104 tdlname=$dlname
6105 case $host,$output,$installed,$module,$dlname in
6106 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
6107 esac
6108 $echo > $output "\
6109 # $outputname - a libtool library file
6110 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
6112 # Please DO NOT delete this file!
6113 # It is necessary for linking the library.
6115 # The name that we can dlopen(3).
6116 dlname='$tdlname'
6118 # Names of this library.
6119 library_names='$library_names'
6121 # The name of the static archive.
6122 old_library='$old_library'
6124 # Libraries that this one depends upon.
6125 dependency_libs='$dependency_libs'
6127 # Version information for $libname.
6128 current=$current
6129 age=$age
6130 revision=$revision
6132 # Is this an already installed library?
6133 installed=$installed
6135 # Should we warn about portability when linking against -modules?
6136 shouldnotlink=$module
6138 # Files to dlopen/dlpreopen
6139 dlopen='$dlfiles'
6140 dlpreopen='$dlprefiles'
6142 # Directory that this library needs to be installed in:
6143 libdir='$install_libdir'"
6144 if test "$installed" = no && test "$need_relink" = yes; then
6145 $echo >> $output "\
6146 relink_command=\"$relink_command\""
6148 done
6151 # Do a symbolic link so that the libtool archive can be found in
6152 # LD_LIBRARY_PATH before the program is installed.
6153 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
6154 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
6156 esac
6157 exit $EXIT_SUCCESS
6160 # libtool install mode
6161 install)
6162 modename="$modename: install"
6164 # There may be an optional sh(1) argument at the beginning of
6165 # install_prog (especially on Windows NT).
6166 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
6167 # Allow the use of GNU shtool's install command.
6168 $echo "X$nonopt" | grep shtool > /dev/null; then
6169 # Aesthetically quote it.
6170 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
6171 case $arg in
6172 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6173 arg="\"$arg\""
6175 esac
6176 install_prog="$arg "
6177 arg="$1"
6178 shift
6179 else
6180 install_prog=
6181 arg=$nonopt
6184 # The real first argument should be the name of the installation program.
6185 # Aesthetically quote it.
6186 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6187 case $arg in
6188 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6189 arg="\"$arg\""
6191 esac
6192 install_prog="$install_prog$arg"
6194 # We need to accept at least all the BSD install flags.
6195 dest=
6196 files=
6197 opts=
6198 prev=
6199 install_type=
6200 isdir=no
6201 stripme=
6202 for arg
6204 if test -n "$dest"; then
6205 files="$files $dest"
6206 dest=$arg
6207 continue
6210 case $arg in
6211 -d) isdir=yes ;;
6212 -f)
6213 case " $install_prog " in
6214 *[\\\ /]cp\ *) ;;
6215 *) prev=$arg ;;
6216 esac
6218 -g | -m | -o) prev=$arg ;;
6220 stripme=" -s"
6221 continue
6226 # If the previous option needed an argument, then skip it.
6227 if test -n "$prev"; then
6228 prev=
6229 else
6230 dest=$arg
6231 continue
6234 esac
6236 # Aesthetically quote the argument.
6237 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
6238 case $arg in
6239 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
6240 arg="\"$arg\""
6242 esac
6243 install_prog="$install_prog $arg"
6244 done
6246 if test -z "$install_prog"; then
6247 $echo "$modename: you must specify an install program" 1>&2
6248 $echo "$help" 1>&2
6249 exit $EXIT_FAILURE
6252 if test -n "$prev"; then
6253 $echo "$modename: the \`$prev' option requires an argument" 1>&2
6254 $echo "$help" 1>&2
6255 exit $EXIT_FAILURE
6258 if test -z "$files"; then
6259 if test -z "$dest"; then
6260 $echo "$modename: no file or destination specified" 1>&2
6261 else
6262 $echo "$modename: you must specify a destination" 1>&2
6264 $echo "$help" 1>&2
6265 exit $EXIT_FAILURE
6268 # Strip any trailing slash from the destination.
6269 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
6271 # Check to see that the destination is a directory.
6272 test -d "$dest" && isdir=yes
6273 if test "$isdir" = yes; then
6274 destdir="$dest"
6275 destname=
6276 else
6277 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
6278 test "X$destdir" = "X$dest" && destdir=.
6279 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
6281 # Not a directory, so check to see that there is only one file specified.
6282 set dummy $files
6283 if test "$#" -gt 2; then
6284 $echo "$modename: \`$dest' is not a directory" 1>&2
6285 $echo "$help" 1>&2
6286 exit $EXIT_FAILURE
6289 case $destdir in
6290 [\\/]* | [A-Za-z]:[\\/]*) ;;
6292 for file in $files; do
6293 case $file in
6294 *.lo) ;;
6296 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
6297 $echo "$help" 1>&2
6298 exit $EXIT_FAILURE
6300 esac
6301 done
6303 esac
6305 # This variable tells wrapper scripts just to set variables rather
6306 # than running their programs.
6307 libtool_install_magic="$magic"
6309 staticlibs=
6310 future_libdirs=
6311 current_libdirs=
6312 for file in $files; do
6314 # Do each installation.
6315 case $file in
6316 *.$libext)
6317 # Do the static libraries later.
6318 staticlibs="$staticlibs $file"
6321 *.la)
6322 # Check to see that this really is a libtool archive.
6323 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6324 else
6325 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6326 $echo "$help" 1>&2
6327 exit $EXIT_FAILURE
6330 library_names=
6331 old_library=
6332 relink_command=
6333 # If there is no directory component, then add one.
6334 case $file in
6335 */* | *\\*) . $file ;;
6336 *) . ./$file ;;
6337 esac
6339 # Add the libdir to current_libdirs if it is the destination.
6340 if test "X$destdir" = "X$libdir"; then
6341 case "$current_libdirs " in
6342 *" $libdir "*) ;;
6343 *) current_libdirs="$current_libdirs $libdir" ;;
6344 esac
6345 else
6346 # Note the libdir as a future libdir.
6347 case "$future_libdirs " in
6348 *" $libdir "*) ;;
6349 *) future_libdirs="$future_libdirs $libdir" ;;
6350 esac
6353 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
6354 test "X$dir" = "X$file/" && dir=
6355 dir="$dir$objdir"
6357 if test -n "$relink_command"; then
6358 # Determine the prefix the user has applied to our future dir.
6359 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6361 # Don't allow the user to place us outside of our expected
6362 # location b/c this prevents finding dependent libraries that
6363 # are installed to the same prefix.
6364 # At present, this check doesn't affect windows .dll's that
6365 # are installed into $libdir/../bin (currently, that works fine)
6366 # but it's something to keep an eye on.
6367 if test "$inst_prefix_dir" = "$destdir"; then
6368 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6369 exit $EXIT_FAILURE
6372 if test -n "$inst_prefix_dir"; then
6373 # Stick the inst_prefix_dir data into the link command.
6374 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6375 else
6376 relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6379 $echo "$modename: warning: relinking \`$file'" 1>&2
6380 $show "$relink_command"
6381 if $run eval "$relink_command"; then :
6382 else
6383 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6384 exit $EXIT_FAILURE
6388 # See the names of the shared library.
6389 set dummy $library_names
6390 if test -n "$2"; then
6391 realname="$2"
6392 shift
6393 shift
6395 srcname="$realname"
6396 test -n "$relink_command" && srcname="$realname"T
6398 # Install the shared library and build the symlinks.
6399 $show "$install_prog $dir/$srcname $destdir/$realname"
6400 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
6401 if test -n "$stripme" && test -n "$striplib"; then
6402 $show "$striplib $destdir/$realname"
6403 $run eval "$striplib $destdir/$realname" || exit $?
6406 if test "$#" -gt 0; then
6407 # Delete the old symlinks, and create new ones.
6408 # Try `ln -sf' first, because the `ln' binary might depend on
6409 # the symlink we replace! Solaris /bin/ln does not understand -f,
6410 # so we also need to try rm && ln -s.
6411 for linkname
6413 if test "$linkname" != "$realname"; then
6414 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6415 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6417 done
6420 # Do each command in the postinstall commands.
6421 lib="$destdir/$realname"
6422 cmds=$postinstall_cmds
6423 save_ifs="$IFS"; IFS='~'
6424 for cmd in $cmds; do
6425 IFS="$save_ifs"
6426 eval cmd=\"$cmd\"
6427 $show "$cmd"
6428 $run eval "$cmd" || {
6429 lt_exit=$?
6431 # Restore the uninstalled library and exit
6432 if test "$mode" = relink; then
6433 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6436 exit $lt_exit
6438 done
6439 IFS="$save_ifs"
6442 # Install the pseudo-library for information purposes.
6443 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6444 instname="$dir/$name"i
6445 $show "$install_prog $instname $destdir/$name"
6446 $run eval "$install_prog $instname $destdir/$name" || exit $?
6448 # Maybe install the static library, too.
6449 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
6452 *.lo)
6453 # Install (i.e. copy) a libtool object.
6455 # Figure out destination file name, if it wasn't already specified.
6456 if test -n "$destname"; then
6457 destfile="$destdir/$destname"
6458 else
6459 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6460 destfile="$destdir/$destfile"
6463 # Deduce the name of the destination old-style object file.
6464 case $destfile in
6465 *.lo)
6466 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6468 *.$objext)
6469 staticdest="$destfile"
6470 destfile=
6473 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6474 $echo "$help" 1>&2
6475 exit $EXIT_FAILURE
6477 esac
6479 # Install the libtool object if requested.
6480 if test -n "$destfile"; then
6481 $show "$install_prog $file $destfile"
6482 $run eval "$install_prog $file $destfile" || exit $?
6485 # Install the old object if enabled.
6486 if test "$build_old_libs" = yes; then
6487 # Deduce the name of the old-style object file.
6488 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
6490 $show "$install_prog $staticobj $staticdest"
6491 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
6493 exit $EXIT_SUCCESS
6497 # Figure out destination file name, if it wasn't already specified.
6498 if test -n "$destname"; then
6499 destfile="$destdir/$destname"
6500 else
6501 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6502 destfile="$destdir/$destfile"
6505 # If the file is missing, and there is a .exe on the end, strip it
6506 # because it is most likely a libtool script we actually want to
6507 # install
6508 stripped_ext=""
6509 case $file in
6510 *.exe)
6511 if test ! -f "$file"; then
6512 file=`$echo $file|${SED} 's,.exe$,,'`
6513 stripped_ext=".exe"
6516 esac
6518 # Do a test to see if this is really a libtool program.
6519 case $host in
6520 *cygwin*|*mingw*)
6521 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
6524 wrapper=$file
6526 esac
6527 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
6528 notinst_deplibs=
6529 relink_command=
6531 # Note that it is not necessary on cygwin/mingw to append a dot to
6532 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6533 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6534 # `FILE.' does not work on cygwin managed mounts.
6536 # If there is no directory component, then add one.
6537 case $wrapper in
6538 */* | *\\*) . ${wrapper} ;;
6539 *) . ./${wrapper} ;;
6540 esac
6542 # Check the variables that should have been set.
6543 if test -z "$notinst_deplibs"; then
6544 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6545 exit $EXIT_FAILURE
6548 finalize=yes
6549 for lib in $notinst_deplibs; do
6550 # Check to see that each library is installed.
6551 libdir=
6552 if test -f "$lib"; then
6553 # If there is no directory component, then add one.
6554 case $lib in
6555 */* | *\\*) . $lib ;;
6556 *) . ./$lib ;;
6557 esac
6559 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6560 if test -n "$libdir" && test ! -f "$libfile"; then
6561 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6562 finalize=no
6564 done
6566 relink_command=
6567 # Note that it is not necessary on cygwin/mingw to append a dot to
6568 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6569 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6570 # `FILE.' does not work on cygwin managed mounts.
6572 # If there is no directory component, then add one.
6573 case $wrapper in
6574 */* | *\\*) . ${wrapper} ;;
6575 *) . ./${wrapper} ;;
6576 esac
6578 outputname=
6579 if test "$fast_install" = no && test -n "$relink_command"; then
6580 if test "$finalize" = yes && test -z "$run"; then
6581 tmpdir=`func_mktempdir`
6582 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6583 outputname="$tmpdir/$file"
6584 # Replace the output file specification.
6585 relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6587 $show "$relink_command"
6588 if $run eval "$relink_command"; then :
6589 else
6590 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6591 ${rm}r "$tmpdir"
6592 continue
6594 file="$outputname"
6595 else
6596 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6598 else
6599 # Install the binary that we compiled earlier.
6600 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6604 # remove .exe since cygwin /usr/bin/install will append another
6605 # one anyway
6606 case $install_prog,$host in
6607 */usr/bin/install*,*cygwin*)
6608 case $file:$destfile in
6609 *.exe:*.exe)
6610 # this is ok
6612 *.exe:*)
6613 destfile=$destfile.exe
6615 *:*.exe)
6616 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6618 esac
6620 esac
6621 $show "$install_prog$stripme $file $destfile"
6622 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6623 test -n "$outputname" && ${rm}r "$tmpdir"
6625 esac
6626 done
6628 for file in $staticlibs; do
6629 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6631 # Set up the ranlib parameters.
6632 oldlib="$destdir/$name"
6634 $show "$install_prog $file $oldlib"
6635 $run eval "$install_prog \$file \$oldlib" || exit $?
6637 if test -n "$stripme" && test -n "$old_striplib"; then
6638 $show "$old_striplib $oldlib"
6639 $run eval "$old_striplib $oldlib" || exit $?
6642 # Do each command in the postinstall commands.
6643 cmds=$old_postinstall_cmds
6644 save_ifs="$IFS"; IFS='~'
6645 for cmd in $cmds; do
6646 IFS="$save_ifs"
6647 eval cmd=\"$cmd\"
6648 $show "$cmd"
6649 $run eval "$cmd" || exit $?
6650 done
6651 IFS="$save_ifs"
6652 done
6654 if test -n "$future_libdirs"; then
6655 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6658 if test -n "$current_libdirs"; then
6659 # Maybe just do a dry run.
6660 test -n "$run" && current_libdirs=" -n$current_libdirs"
6661 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
6662 else
6663 exit $EXIT_SUCCESS
6667 # libtool finish mode
6668 finish)
6669 modename="$modename: finish"
6670 libdirs="$nonopt"
6671 admincmds=
6673 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6674 for dir
6676 libdirs="$libdirs $dir"
6677 done
6679 for libdir in $libdirs; do
6680 if test -n "$finish_cmds"; then
6681 # Do each command in the finish commands.
6682 cmds=$finish_cmds
6683 save_ifs="$IFS"; IFS='~'
6684 for cmd in $cmds; do
6685 IFS="$save_ifs"
6686 eval cmd=\"$cmd\"
6687 $show "$cmd"
6688 $run eval "$cmd" || admincmds="$admincmds
6689 $cmd"
6690 done
6691 IFS="$save_ifs"
6693 if test -n "$finish_eval"; then
6694 # Do the single finish_eval.
6695 eval cmds=\"$finish_eval\"
6696 $run eval "$cmds" || admincmds="$admincmds
6697 $cmds"
6699 done
6702 # Exit here if they wanted silent mode.
6703 test "$show" = : && exit $EXIT_SUCCESS
6705 $echo "X----------------------------------------------------------------------" | $Xsed
6706 $echo "Libraries have been installed in:"
6707 for libdir in $libdirs; do
6708 $echo " $libdir"
6709 done
6710 $echo
6711 $echo "If you ever happen to want to link against installed libraries"
6712 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6713 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6714 $echo "flag during linking and do at least one of the following:"
6715 if test -n "$shlibpath_var"; then
6716 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6717 $echo " during execution"
6719 if test -n "$runpath_var"; then
6720 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6721 $echo " during linking"
6723 if test -n "$hardcode_libdir_flag_spec"; then
6724 libdir=LIBDIR
6725 eval flag=\"$hardcode_libdir_flag_spec\"
6727 $echo " - use the \`$flag' linker flag"
6729 if test -n "$admincmds"; then
6730 $echo " - have your system administrator run these commands:$admincmds"
6732 if test -f /etc/ld.so.conf; then
6733 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6735 $echo
6736 $echo "See any operating system documentation about shared libraries for"
6737 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6738 $echo "X----------------------------------------------------------------------" | $Xsed
6739 exit $EXIT_SUCCESS
6742 # libtool execute mode
6743 execute)
6744 modename="$modename: execute"
6746 # The first argument is the command name.
6747 cmd="$nonopt"
6748 if test -z "$cmd"; then
6749 $echo "$modename: you must specify a COMMAND" 1>&2
6750 $echo "$help"
6751 exit $EXIT_FAILURE
6754 # Handle -dlopen flags immediately.
6755 for file in $execute_dlfiles; do
6756 if test ! -f "$file"; then
6757 $echo "$modename: \`$file' is not a file" 1>&2
6758 $echo "$help" 1>&2
6759 exit $EXIT_FAILURE
6762 dir=
6763 case $file in
6764 *.la)
6765 # Check to see that this really is a libtool archive.
6766 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6767 else
6768 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6769 $echo "$help" 1>&2
6770 exit $EXIT_FAILURE
6773 # Read the libtool library.
6774 dlname=
6775 library_names=
6777 # If there is no directory component, then add one.
6778 case $file in
6779 */* | *\\*) . $file ;;
6780 *) . ./$file ;;
6781 esac
6783 # Skip this library if it cannot be dlopened.
6784 if test -z "$dlname"; then
6785 # Warn if it was a shared library.
6786 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6787 continue
6790 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6791 test "X$dir" = "X$file" && dir=.
6793 if test -f "$dir/$objdir/$dlname"; then
6794 dir="$dir/$objdir"
6795 else
6796 if test ! -f "$dir/$dlname"; then
6797 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6798 exit $EXIT_FAILURE
6803 *.lo)
6804 # Just add the directory containing the .lo file.
6805 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6806 test "X$dir" = "X$file" && dir=.
6810 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6811 continue
6813 esac
6815 # Get the absolute pathname.
6816 absdir=`cd "$dir" && pwd`
6817 test -n "$absdir" && dir="$absdir"
6819 # Now add the directory to shlibpath_var.
6820 if eval "test -z \"\$$shlibpath_var\""; then
6821 eval "$shlibpath_var=\"\$dir\""
6822 else
6823 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6825 done
6827 # This variable tells wrapper scripts just to set shlibpath_var
6828 # rather than running their programs.
6829 libtool_execute_magic="$magic"
6831 # Check if any of the arguments is a wrapper script.
6832 args=
6833 for file
6835 case $file in
6836 -*) ;;
6838 # Do a test to see if this is really a libtool program.
6839 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6840 # If there is no directory component, then add one.
6841 case $file in
6842 */* | *\\*) . $file ;;
6843 *) . ./$file ;;
6844 esac
6846 # Transform arg to wrapped name.
6847 file="$progdir/$program"
6850 esac
6851 # Quote arguments (to preserve shell metacharacters).
6852 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6853 args="$args \"$file\""
6854 done
6856 if test -z "$run"; then
6857 if test -n "$shlibpath_var"; then
6858 # Export the shlibpath_var.
6859 eval "export $shlibpath_var"
6862 # Restore saved environment variables
6863 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6865 eval "if test \"\${save_$lt_var+set}\" = set; then
6866 $lt_var=\$save_$lt_var; export $lt_var
6868 done
6870 # Now prepare to actually exec the command.
6871 exec_cmd="\$cmd$args"
6872 else
6873 # Display what would be done.
6874 if test -n "$shlibpath_var"; then
6875 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6876 $echo "export $shlibpath_var"
6878 $echo "$cmd$args"
6879 exit $EXIT_SUCCESS
6883 # libtool clean and uninstall mode
6884 clean | uninstall)
6885 modename="$modename: $mode"
6886 rm="$nonopt"
6887 files=
6888 rmforce=
6889 exit_status=0
6891 # This variable tells wrapper scripts just to set variables rather
6892 # than running their programs.
6893 libtool_install_magic="$magic"
6895 for arg
6897 case $arg in
6898 -f) rm="$rm $arg"; rmforce=yes ;;
6899 -*) rm="$rm $arg" ;;
6900 *) files="$files $arg" ;;
6901 esac
6902 done
6904 if test -z "$rm"; then
6905 $echo "$modename: you must specify an RM program" 1>&2
6906 $echo "$help" 1>&2
6907 exit $EXIT_FAILURE
6910 rmdirs=
6912 origobjdir="$objdir"
6913 for file in $files; do
6914 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6915 if test "X$dir" = "X$file"; then
6916 dir=.
6917 objdir="$origobjdir"
6918 else
6919 objdir="$dir/$origobjdir"
6921 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6922 test "$mode" = uninstall && objdir="$dir"
6924 # Remember objdir for removal later, being careful to avoid duplicates
6925 if test "$mode" = clean; then
6926 case " $rmdirs " in
6927 *" $objdir "*) ;;
6928 *) rmdirs="$rmdirs $objdir" ;;
6929 esac
6932 # Don't error if the file doesn't exist and rm -f was used.
6933 if (test -L "$file") >/dev/null 2>&1 \
6934 || (test -h "$file") >/dev/null 2>&1 \
6935 || test -f "$file"; then
6937 elif test -d "$file"; then
6938 exit_status=1
6939 continue
6940 elif test "$rmforce" = yes; then
6941 continue
6944 rmfiles="$file"
6946 case $name in
6947 *.la)
6948 # Possibly a libtool archive, so verify it.
6949 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6950 . $dir/$name
6952 # Delete the libtool libraries and symlinks.
6953 for n in $library_names; do
6954 rmfiles="$rmfiles $objdir/$n"
6955 done
6956 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6958 case "$mode" in
6959 clean)
6960 case " $library_names " in
6961 # " " in the beginning catches empty $dlname
6962 *" $dlname "*) ;;
6963 *) rmfiles="$rmfiles $objdir/$dlname" ;;
6964 esac
6965 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6967 uninstall)
6968 if test -n "$library_names"; then
6969 # Do each command in the postuninstall commands.
6970 cmds=$postuninstall_cmds
6971 save_ifs="$IFS"; IFS='~'
6972 for cmd in $cmds; do
6973 IFS="$save_ifs"
6974 eval cmd=\"$cmd\"
6975 $show "$cmd"
6976 $run eval "$cmd"
6977 if test "$?" -ne 0 && test "$rmforce" != yes; then
6978 exit_status=1
6980 done
6981 IFS="$save_ifs"
6984 if test -n "$old_library"; then
6985 # Do each command in the old_postuninstall commands.
6986 cmds=$old_postuninstall_cmds
6987 save_ifs="$IFS"; IFS='~'
6988 for cmd in $cmds; do
6989 IFS="$save_ifs"
6990 eval cmd=\"$cmd\"
6991 $show "$cmd"
6992 $run eval "$cmd"
6993 if test "$?" -ne 0 && test "$rmforce" != yes; then
6994 exit_status=1
6996 done
6997 IFS="$save_ifs"
6999 # FIXME: should reinstall the best remaining shared library.
7001 esac
7005 *.lo)
7006 # Possibly a libtool object, so verify it.
7007 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7009 # Read the .lo file
7010 . $dir/$name
7012 # Add PIC object to the list of files to remove.
7013 if test -n "$pic_object" \
7014 && test "$pic_object" != none; then
7015 rmfiles="$rmfiles $dir/$pic_object"
7018 # Add non-PIC object to the list of files to remove.
7019 if test -n "$non_pic_object" \
7020 && test "$non_pic_object" != none; then
7021 rmfiles="$rmfiles $dir/$non_pic_object"
7027 if test "$mode" = clean ; then
7028 noexename=$name
7029 case $file in
7030 *.exe)
7031 file=`$echo $file|${SED} 's,.exe$,,'`
7032 noexename=`$echo $name|${SED} 's,.exe$,,'`
7033 # $file with .exe has already been added to rmfiles,
7034 # add $file without .exe
7035 rmfiles="$rmfiles $file"
7037 esac
7038 # Do a test to see if this is a libtool program.
7039 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
7040 relink_command=
7041 . $dir/$noexename
7043 # note $name still contains .exe if it was in $file originally
7044 # as does the version of $file that was added into $rmfiles
7045 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
7046 if test "$fast_install" = yes && test -n "$relink_command"; then
7047 rmfiles="$rmfiles $objdir/lt-$name"
7049 if test "X$noexename" != "X$name" ; then
7050 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
7055 esac
7056 $show "$rm $rmfiles"
7057 $run $rm $rmfiles || exit_status=1
7058 done
7059 objdir="$origobjdir"
7061 # Try to remove the ${objdir}s in the directories where we deleted files
7062 for dir in $rmdirs; do
7063 if test -d "$dir"; then
7064 $show "rmdir $dir"
7065 $run rmdir $dir >/dev/null 2>&1
7067 done
7069 exit $exit_status
7073 $echo "$modename: you must specify a MODE" 1>&2
7074 $echo "$generic_help" 1>&2
7075 exit $EXIT_FAILURE
7077 esac
7079 if test -z "$exec_cmd"; then
7080 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7081 $echo "$generic_help" 1>&2
7082 exit $EXIT_FAILURE
7084 fi # test -z "$show_help"
7086 if test -n "$exec_cmd"; then
7087 eval exec $exec_cmd
7088 exit $EXIT_FAILURE
7091 # We need to display help for each of the modes.
7092 case $mode in
7093 "") $echo \
7094 "Usage: $modename [OPTION]... [MODE-ARG]...
7096 Provide generalized library-building support services.
7098 --config show all configuration variables
7099 --debug enable verbose shell tracing
7100 -n, --dry-run display commands without modifying any files
7101 --features display basic configuration information and exit
7102 --finish same as \`--mode=finish'
7103 --help display this help message and exit
7104 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
7105 --quiet same as \`--silent'
7106 --silent don't print informational messages
7107 --tag=TAG use configuration variables from tag TAG
7108 --version print version information
7110 MODE must be one of the following:
7112 clean remove files from the build directory
7113 compile compile a source file into a libtool object
7114 execute automatically set library path, then run a program
7115 finish complete the installation of libtool libraries
7116 install install libraries or executables
7117 link create a library or an executable
7118 uninstall remove libraries from an installed directory
7120 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
7121 a more detailed description of MODE.
7123 Report bugs to <bug-libtool@gnu.org>."
7124 exit $EXIT_SUCCESS
7127 clean)
7128 $echo \
7129 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
7131 Remove files from the build directory.
7133 RM is the name of the program to use to delete files associated with each FILE
7134 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7135 to RM.
7137 If FILE is a libtool library, object or program, all the files associated
7138 with it are deleted. Otherwise, only FILE itself is deleted using RM."
7141 compile)
7142 $echo \
7143 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
7145 Compile a source file into a libtool library object.
7147 This mode accepts the following additional options:
7149 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
7150 -prefer-pic try to building PIC objects only
7151 -prefer-non-pic try to building non-PIC objects only
7152 -static always build a \`.o' file suitable for static linking
7154 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
7155 from the given SOURCEFILE.
7157 The output file name is determined by removing the directory component from
7158 SOURCEFILE, then substituting the C source code suffix \`.c' with the
7159 library object suffix, \`.lo'."
7162 execute)
7163 $echo \
7164 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
7166 Automatically set library path, then run a program.
7168 This mode accepts the following additional options:
7170 -dlopen FILE add the directory containing FILE to the library path
7172 This mode sets the library path environment variable according to \`-dlopen'
7173 flags.
7175 If any of the ARGS are libtool executable wrappers, then they are translated
7176 into their corresponding uninstalled binary, and any of their required library
7177 directories are added to the library path.
7179 Then, COMMAND is executed, with ARGS as arguments."
7182 finish)
7183 $echo \
7184 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
7186 Complete the installation of libtool libraries.
7188 Each LIBDIR is a directory that contains libtool libraries.
7190 The commands that this mode executes may require superuser privileges. Use
7191 the \`--dry-run' option if you just want to see what would be executed."
7194 install)
7195 $echo \
7196 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
7198 Install executables or libraries.
7200 INSTALL-COMMAND is the installation command. The first component should be
7201 either the \`install' or \`cp' program.
7203 The rest of the components are interpreted as arguments to that command (only
7204 BSD-compatible install options are recognized)."
7207 link)
7208 $echo \
7209 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
7211 Link object files or libraries together to form another library, or to
7212 create an executable program.
7214 LINK-COMMAND is a command using the C compiler that you would use to create
7215 a program from several object files.
7217 The following components of LINK-COMMAND are treated specially:
7219 -all-static do not do any dynamic linking at all
7220 -avoid-version do not add a version suffix if possible
7221 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
7222 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
7223 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
7224 -export-symbols SYMFILE
7225 try to export only the symbols listed in SYMFILE
7226 -export-symbols-regex REGEX
7227 try to export only the symbols matching REGEX
7228 -LLIBDIR search LIBDIR for required installed libraries
7229 -lNAME OUTPUT-FILE requires the installed library libNAME
7230 -module build a library that can dlopened
7231 -no-fast-install disable the fast-install mode
7232 -no-install link a not-installable executable
7233 -no-undefined declare that a library does not refer to external symbols
7234 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
7235 -objectlist FILE Use a list of object files found in FILE to specify objects
7236 -precious-files-regex REGEX
7237 don't remove output files matching REGEX
7238 -release RELEASE specify package release information
7239 -rpath LIBDIR the created library will eventually be installed in LIBDIR
7240 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
7241 -static do not do any dynamic linking of uninstalled libtool libraries
7242 -static-libtool-libs
7243 do not do any dynamic linking of libtool libraries
7244 -version-info CURRENT[:REVISION[:AGE]]
7245 specify library version info [each variable defaults to 0]
7247 All other options (arguments beginning with \`-') are ignored.
7249 Every other argument is treated as a filename. Files ending in \`.la' are
7250 treated as uninstalled libtool libraries, other files are standard or library
7251 object files.
7253 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
7254 only library objects (\`.lo' files) may be specified, and \`-rpath' is
7255 required, except when creating a convenience library.
7257 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
7258 using \`ar' and \`ranlib', or on Windows using \`lib'.
7260 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
7261 is created, otherwise an executable program is created."
7264 uninstall)
7265 $echo \
7266 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7268 Remove libraries from an installation directory.
7270 RM is the name of the program to use to delete files associated with each FILE
7271 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7272 to RM.
7274 If FILE is a libtool library, all the files associated with it are deleted.
7275 Otherwise, only FILE itself is deleted using RM."
7279 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7280 $echo "$help" 1>&2
7281 exit $EXIT_FAILURE
7283 esac
7285 $echo
7286 $echo "Try \`$modename --help' for more information about other modes."
7288 exit $?
7290 # The TAGs below are defined such that we never get into a situation
7291 # in which we disable both kinds of libraries. Given conflicting
7292 # choices, we go for a static library, that is the most portable,
7293 # since we can't tell whether shared libraries were disabled because
7294 # the user asked for that or because the platform doesn't support
7295 # them. This is particularly important on AIX, because we don't
7296 # support having both static and shared libraries enabled at the same
7297 # time on that platform, so we default to a shared-only configuration.
7298 # If a disable-shared tag is given, we'll fallback to a static-only
7299 # configuration. But we'll never go from static-only to shared-only.
7301 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7302 disable_libs=shared
7303 # ### END LIBTOOL TAG CONFIG: disable-shared
7305 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7306 disable_libs=static
7307 # ### END LIBTOOL TAG CONFIG: disable-static
7309 # Local Variables:
7310 # mode:shell-script
7311 # sh-indentation:2
7312 # End:
7313 # ### BEGIN LIBTOOL TAG CONFIG: CXX
7315 # Libtool was configured on host vicente-P5K-E:
7317 # Shell to use when invoking shell scripts.
7318 SHELL="/bin/sh"
7320 # Whether or not to build shared libraries.
7321 build_libtool_libs=no
7323 # Whether or not to build static libraries.
7324 build_old_libs=yes
7326 # Whether or not to add -lc for building shared libraries.
7327 build_libtool_need_lc=no
7329 # Whether or not to disallow shared libs when runtime libs are static
7330 allow_libtool_libs_with_static_runtimes=no
7332 # Whether or not to optimize for fast installation.
7333 fast_install=needless
7335 # The host system.
7336 host_alias=mipsel-linux
7337 host=mipsel-unknown-linux-gnu
7338 host_os=linux-gnu
7340 # The build system.
7341 build_alias=x86_64-linux-gnu
7342 build=x86_64-pc-linux-gnu
7343 build_os=linux-gnu
7345 # An echo program that does not interpret backslashes.
7346 echo="echo"
7348 # The archiver.
7349 AR="mipsel-uclibc-ar"
7350 AR_FLAGS="cru"
7352 # A C compiler.
7353 LTCC="mipsel-uclibc-gcc"
7355 # LTCC compiler flags.
7356 LTCFLAGS="-Os -Wall -DLINUX26 -DCONFIG_BCMWL5 -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 -ffunction-sections -fdata-sections"
7358 # A language-specific compiler.
7359 CC="mipsel-linux-g++"
7361 # Is the compiler the GNU C compiler?
7362 with_gcc=yes
7364 # An ERE matcher.
7365 EGREP="/bin/grep -E"
7367 # The linker used to build libraries.
7368 LD="mipsel-uclibc-ld"
7370 # Whether we need hard or soft links.
7371 LN_S="ln -s"
7373 # A BSD-compatible nm program.
7374 NM="mipsel-uclibc-nm"
7376 # A symbol stripping program
7377 STRIP="mipsel-uclibc-strip -R .note -R .comment"
7379 # Used to examine libraries when file_magic_cmd begins "file"
7380 MAGIC_CMD=file
7382 # Used on cygwin: DLL creation program.
7383 DLLTOOL="dlltool"
7385 # Used on cygwin: object dumper.
7386 OBJDUMP="objdump"
7388 # Used on cygwin: assembler.
7389 AS="mipsel-uclibc-as"
7391 # The name of the directory that contains temporary libtool files.
7392 objdir=.libs
7394 # How to create reloadable object files.
7395 reload_flag=" -r"
7396 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
7398 # How to pass a linker flag through the compiler.
7399 wl="-Wl,"
7401 # Object file suffix (normally "o").
7402 objext="o"
7404 # Old archive suffix (normally "a").
7405 libext="a"
7407 # Shared library suffix (normally ".so").
7408 shrext_cmds='.so'
7410 # Executable file suffix (normally "").
7411 exeext=""
7413 # Additional compiler flags for building library objects.
7414 pic_flag=" -fPIC -DPIC"
7415 pic_mode=default
7417 # What is the maximum length of a command?
7418 max_cmd_len=3458764513820540925
7420 # Does compiler simultaneously support -c and -o options?
7421 compiler_c_o="yes"
7423 # Must we lock files when doing compilation?
7424 need_locks="no"
7426 # Do we need the lib prefix for modules?
7427 need_lib_prefix=no
7429 # Do we need a version for libraries?
7430 need_version=no
7432 # Whether dlopen is supported.
7433 dlopen_support=unknown
7435 # Whether dlopen of programs is supported.
7436 dlopen_self=unknown
7438 # Whether dlopen of statically linked programs is supported.
7439 dlopen_self_static=unknown
7441 # Compiler flag to prevent dynamic linking.
7442 link_static_flag="-static"
7444 # Compiler flag to turn off builtin functions.
7445 no_builtin_flag=" -fno-builtin"
7447 # Compiler flag to allow reflexive dlopens.
7448 export_dynamic_flag_spec="\${wl}--export-dynamic"
7450 # Compiler flag to generate shared objects directly from archives.
7451 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
7453 # Compiler flag to generate thread-safe objects.
7454 thread_safe_flag_spec=""
7456 # Library versioning type.
7457 version_type=linux
7459 # Format of library name prefix.
7460 libname_spec="lib\$name"
7462 # List of archive names. First name is the real one, the rest are links.
7463 # The last name is the one that the linker finds with -lNAME.
7464 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
7466 # The coded name of the library, if different from the real name.
7467 soname_spec="\${libname}\${release}\${shared_ext}\$major"
7469 # Commands used to build and install an old-style archive.
7470 RANLIB="mipsel-uclibc-ranlib"
7471 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
7472 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
7473 old_postuninstall_cmds=""
7475 # Create an old-style archive from a shared archive.
7476 old_archive_from_new_cmds=""
7478 # Create a temporary old-style archive to link instead of a shared archive.
7479 old_archive_from_expsyms_cmds=""
7481 # Commands used to build and install a shared archive.
7482 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
7483 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"
7484 postinstall_cmds=""
7485 postuninstall_cmds=""
7487 # Commands used to build a loadable module (assumed same as above if empty)
7488 module_cmds=""
7489 module_expsym_cmds=""
7491 # Commands to strip libraries.
7492 old_striplib="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
7493 striplib="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
7495 # Dependencies to place before the objects being linked to create a
7496 # shared library.
7497 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"
7499 # Dependencies to place after the objects being linked to create a
7500 # shared library.
7501 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"
7503 # Dependencies to place before the objects being linked to create a
7504 # shared library.
7505 predeps=""
7507 # Dependencies to place after the objects being linked to create a
7508 # shared library.
7509 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
7511 # The directories searched by this compiler when creating a shared
7512 # library
7513 compiler_lib_search_dirs="/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 /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"
7515 # The library search path used internally by the compiler when linking
7516 # a shared library.
7517 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"
7519 # Method to check whether dependent libraries are shared objects.
7520 deplibs_check_method="pass_all"
7522 # Command to use when deplibs_check_method == file_magic.
7523 file_magic_cmd="\$MAGIC_CMD"
7525 # Flag that allows shared libraries with undefined symbols to be built.
7526 allow_undefined_flag=""
7528 # Flag that forces no undefined symbols.
7529 no_undefined_flag=""
7531 # Commands used to finish a libtool library installation in a directory.
7532 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
7534 # Same as above, but a single script fragment to be evaled but not shown.
7535 finish_eval=""
7537 # Take the output of nm and produce a listing of raw symbols and C names.
7538 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
7540 # Transform the output of nm in a proper C declaration
7541 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
7543 # Transform the output of nm in a C name address pair
7544 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
7546 # This is the shared library runtime path variable.
7547 runpath_var=LD_RUN_PATH
7549 # This is the shared library path variable.
7550 shlibpath_var=LD_LIBRARY_PATH
7552 # Is shlibpath searched before the hard-coded library search path?
7553 shlibpath_overrides_runpath=no
7555 # How to hardcode a shared library path into an executable.
7556 hardcode_action=immediate
7558 # Whether we should hardcode library paths into libraries.
7559 hardcode_into_libs=yes
7561 # Flag to hardcode $libdir into a binary during linking.
7562 # This must work even if $libdir does not exist.
7563 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
7565 # If ld is used when linking, flag to hardcode $libdir into
7566 # a binary during linking. This must work even if $libdir does
7567 # not exist.
7568 hardcode_libdir_flag_spec_ld=""
7570 # Whether we need a single -rpath flag with a separated argument.
7571 hardcode_libdir_separator=""
7573 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
7574 # resulting binary.
7575 hardcode_direct=no
7577 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
7578 # resulting binary.
7579 hardcode_minus_L=no
7581 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
7582 # the resulting binary.
7583 hardcode_shlibpath_var=unsupported
7585 # Set to yes if building a shared library automatically hardcodes DIR into the library
7586 # and all subsequent libraries and executables linked against it.
7587 hardcode_automatic=no
7589 # Variables whose values should be saved in libtool wrapper scripts and
7590 # restored at relink time.
7591 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
7593 # Whether libtool must link a program against all its dependency libraries.
7594 link_all_deplibs=unknown
7596 # Compile-time system search path for libraries
7597 sys_lib_search_path_spec="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4 /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib"
7599 # Run-time system search path for libraries
7600 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 "
7602 # Fix the shell variable $srcfile for the compiler.
7603 fix_srcfile_path=""
7605 # Set to yes if exported symbols are required.
7606 always_export_symbols=no
7608 # The commands to list exported symbols.
7609 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7611 # The commands to extract the exported symbol list from a shared archive.
7612 extract_expsyms_cmds=""
7614 # Symbols that should not be listed in the preloaded symbols.
7615 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
7617 # Symbols that must always be exported.
7618 include_expsyms=""
7620 # ### END LIBTOOL TAG CONFIG: CXX