3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (cyassl) 1.9.0
5 # Libtool was configured on host vicente-P5K-E:
6 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
8 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9 # 2006, 2007, 2008 Free Software Foundation, Inc.
10 # Written by Gordon Matzigkeit, 1996
12 # This file is part of GNU Libtool.
14 # GNU Libtool is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation; either version 2 of
17 # the License, or (at your option) any later version.
19 # As a special exception to the GNU General Public License,
20 # if you distribute this file as part of a program or library that
21 # is built using GNU Libtool, you may include this file under the
22 # same distribution terms that you use for the rest of that program.
24 # GNU Libtool is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with GNU Libtool; see the file COPYING. If not, a copy
31 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32 # obtained by writing to the Free Software Foundation, Inc.,
33 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36 # The names of the tagged configurations supported by this script.
39 # ### BEGIN LIBTOOL CONFIG
44 # DLL creation program.
47 # Object dumper program.
50 # Which release of libtool.m4 was used?
54 # Whether or not to build shared libraries.
55 build_libtool_libs
=yes
57 # Whether or not to build static libraries.
60 # What type of objects to build.
63 # Whether or not to optimize for fast installation.
67 host_alias
=mipsel-linux
68 host=mipsel-unknown-linux-gnu
72 build_alias
=x86_64-linux-gnu
73 build
=x86_64-pc-linux-gnu
76 # A sed program that does not truncate output.
79 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
80 Xsed
="$SED -e 1s/^X//"
82 # A grep program that handles long lines.
88 # A literal string matcher.
91 # A BSD- or MS-compatible name lister.
94 # Whether we need soft or hard links.
97 # What is the maximum length of a command?
98 max_cmd_len
=3458764513820540925
100 # Object file suffix (normally "o").
103 # Executable file suffix (normally "").
106 # whether the shell understands "unset".
109 # turn spaces into newlines.
110 SP2NL
="tr \\040 \\012"
112 # turn newlines into spaces.
113 NL2SP
="tr \\015\\012 \\040\\040"
115 # How to create reloadable object files.
117 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
119 # Method to check whether dependent libraries are shared objects.
120 deplibs_check_method
="pass_all"
122 # Command to use when deplibs_check_method == "file_magic".
123 file_magic_cmd
="\$MAGIC_CMD"
126 AR
="mipsel-uclibc-ar"
129 # A symbol stripping program.
130 STRIP
="mipsel-uclibc-strip -R .note -R .comment"
132 # Commands used to install an old-style archive.
133 RANLIB
="mipsel-uclibc-ranlib"
134 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
135 old_postuninstall_cmds
=""
138 LTCC
="mipsel-uclibc-gcc"
140 # LTCC compiler flags.
141 LTCFLAGS
="-Os -Wall -DLINUX26 -DCONFIG_BCMWL5 -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 -fPIC -ffunction-sections -fdata-sections -DNO_MD4 -DNO_AES -DNO_ERROR_STRINGS -DNO_HC128 -DNO_RABBIT -DNO_PSK -DNO_DSA -DNO_DH -DNO_PWDBASED -DNDEBUG -DNO_HC128 -DNO_PSK -Wall -Wno-unused -Os -fomit-frame-pointer "
143 # Take the output of nm and produce a listing of raw symbols and C names.
144 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
146 # Transform the output of nm in a proper C declaration.
147 global_symbol_to_cdecl
="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
149 # Transform the output of nm in a C name address pair.
150 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
152 # Transform the output of nm in a C name address pair when lib prefix is needed.
153 global_symbol_to_c_name_address_lib_prefix
="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
155 # The name of the directory that contains temporary libtool files.
158 # Shell to use when invoking shell scripts.
161 # An echo program that does not interpret backslashes.
164 # Used to examine libraries when file_magic_cmd begins with "file".
167 # Must we lock files when doing compilation?
170 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
173 # Tool to change global to local symbols on Mac OS X.
176 # Tool to manipulate fat objects and archives on Mac OS X.
179 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
182 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
185 # Old archive suffix (normally "a").
188 # Shared library suffix (normally ".so").
191 # The commands to extract the exported symbol list from a shared archive.
192 extract_expsyms_cmds
=""
194 # Variables whose values should be saved in libtool wrapper scripts and
195 # restored at link time.
196 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
198 # Do we need the "lib" prefix for modules?
201 # Do we need a version for libraries?
204 # Library versioning type.
207 # Shared library runtime path variable.
208 runpath_var
=LD_RUN_PATH
210 # Shared library path variable.
211 shlibpath_var
=LD_LIBRARY_PATH
213 # Is shlibpath searched before the hard-coded library search path?
214 shlibpath_overrides_runpath
=no
216 # Format of library name prefix.
217 libname_spec
="lib\$name"
219 # List of archive names. First name is the real one, the rest are links.
220 # The last name is the one that the linker finds with -lNAME
221 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
223 # The coded name of the library, if different from the real name.
224 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
226 # Command to use after installation of a shared archive.
229 # Command to use after uninstallation of a shared archive.
230 postuninstall_cmds
=""
232 # Commands used to finish a libtool library installation in a directory.
233 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
235 # As "finish_cmds", except a single script fragment to be evaled but
239 # Whether we should hardcode library paths into libraries.
240 hardcode_into_libs
=yes
242 # Compile-time system search path for libraries.
243 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"
245 # Run-time system search path for libraries.
246 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 "
248 # Whether dlopen is supported.
249 dlopen_support
=unknown
251 # Whether dlopen of programs is supported.
254 # Whether dlopen of statically linked programs is supported.
255 dlopen_self_static
=unknown
257 # Commands to strip libraries.
258 old_striplib
="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
259 striplib
="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
262 # The linker used to build libraries.
263 LD
="mipsel-uclibc-ld"
265 # Commands used to build an old-style archive.
266 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
268 # A language specific compiler.
269 CC
="mipsel-uclibc-gcc"
271 # Is the compiler the GNU compiler?
274 # Compiler flag to turn off builtin functions.
275 no_builtin_flag
=" -fno-builtin"
277 # How to pass a linker flag through the compiler.
280 # Additional compiler flags for building library objects.
281 pic_flag
=" -fPIC -DPIC"
283 # Compiler flag to prevent dynamic linking.
284 link_static_flag
="-static"
286 # Does compiler simultaneously support -c and -o options?
289 # Whether or not to add -lc for building shared libraries.
290 build_libtool_need_lc
=no
292 # Whether or not to disallow shared libs when runtime libs are static.
293 allow_libtool_libs_with_static_runtimes
=no
295 # Compiler flag to allow reflexive dlopens.
296 export_dynamic_flag_spec
="\${wl}--export-dynamic"
298 # Compiler flag to generate shared objects directly from archives.
299 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
301 # Whether the compiler copes with passing no objects directly.
302 compiler_needs_object
="no"
304 # Create an old-style archive from a shared archive.
305 old_archive_from_new_cmds
=""
307 # Create a temporary old-style archive to link instead of a shared archive.
308 old_archive_from_expsyms_cmds
=""
310 # Commands used to build a shared archive.
311 archive_cmds
="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
312 archive_expsym_cmds
="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
313 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
314 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
315 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
317 # Commands used to build a loadable module if different from building
320 module_expsym_cmds
=""
322 # Whether we are building with GNU ld or not.
325 # Flag that allows shared libraries with undefined symbols to be built.
326 allow_undefined_flag
=""
328 # Flag that enforces no undefined symbols.
331 # Flag to hardcode $libdir into a binary during linking.
332 # This must work even if $libdir does not exist
333 hardcode_libdir_flag_spec
="\${wl}-rpath \${wl}\$libdir"
335 # If ld is used when linking, flag to hardcode $libdir into a binary
336 # during linking. This must work even if $libdir does not exist.
337 hardcode_libdir_flag_spec_ld
=""
339 # Whether we need a single "-rpath" flag with a separated argument.
340 hardcode_libdir_separator
=""
342 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
343 # DIR into the resulting binary.
346 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
347 # DIR into the resulting binary and the resulting library dependency is
348 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
349 # library is relocated.
350 hardcode_direct_absolute
=no
352 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
353 # into the resulting binary.
356 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
357 # into the resulting binary.
358 hardcode_shlibpath_var
=unsupported
360 # Set to "yes" if building a shared library automatically hardcodes DIR
361 # into the library and all subsequent libraries and executables linked
363 hardcode_automatic
=no
365 # Set to yes if linker adds runtime paths of dependent libraries
366 # to runtime path list.
369 # Whether libtool must link a program against all its dependency libraries.
370 link_all_deplibs
=unknown
372 # Fix the shell variable $srcfile for the compiler.
375 # Set to "yes" if exported symbols are required.
376 always_export_symbols
=no
378 # The commands to list exported symbols.
379 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
381 # Symbols that should not be listed in the preloaded symbols.
382 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
384 # Symbols that must always be exported.
387 # Commands necessary for linking programs (against libraries) with templates.
390 # Specify filename containing input files.
393 # How to hardcode a shared library path into an executable.
394 hardcode_action
=immediate
396 # ### END LIBTOOL CONFIG
398 # Generated from ltmain.m4sh.
400 # ltmain.sh (GNU libtool) 2.2.4
401 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
403 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
404 # This is free software; see the source for copying conditions. There is NO
405 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
407 # GNU Libtool is free software; you can redistribute it and/or modify
408 # it under the terms of the GNU General Public License as published by
409 # the Free Software Foundation; either version 2 of the License, or
410 # (at your option) any later version.
412 # As a special exception to the GNU General Public License,
413 # if you distribute this file as part of a program or library that
414 # is built using GNU Libtool, you may include this file under the
415 # same distribution terms that you use for the rest of that program.
417 # GNU Libtool is distributed in the hope that it will be useful, but
418 # WITHOUT ANY WARRANTY; without even the implied warranty of
419 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
420 # General Public License for more details.
422 # You should have received a copy of the GNU General Public License
423 # along with GNU Libtool; see the file COPYING. If not, a copy
424 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
425 # or obtained by writing to the Free Software Foundation, Inc.,
426 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
428 # Usage: $progname [OPTION]... [MODE-ARG]...
430 # Provide generalized library-building support services.
432 # --config show all configuration variables
433 # --debug enable verbose shell tracing
434 # -n, --dry-run display commands without modifying any files
435 # --features display basic configuration information and exit
436 # --mode=MODE use operation mode MODE
437 # --preserve-dup-deps don't remove duplicate dependency libraries
438 # --quiet, --silent don't print informational messages
439 # --tag=TAG use configuration variables from tag TAG
440 # -v, --verbose print informational messages (default)
441 # --version print version information
442 # -h, --help print short or long help message
444 # MODE must be one of the following:
446 # clean remove files from the build directory
447 # compile compile a source file into a libtool object
448 # execute automatically set library path, then run a program
449 # finish complete the installation of libtool libraries
450 # install install libraries or executables
451 # link create a library or an executable
452 # uninstall remove libraries from an installed directory
454 # MODE-ARGS vary depending on the MODE.
455 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
457 # When reporting a bug, please describe a test case to reproduce it and
458 # include the following information:
460 # host-triplet: $host
463 # compiler flags: $LTCFLAGS
464 # linker: $LD (gnu? $with_gnu_ld)
465 # $progname: (GNU libtool) 2.2.4
466 # automake: $automake_version
467 # autoconf: $autoconf_version
469 # Report bugs to <bug-libtool@gnu.org>.
475 package_revision
=1.2976
477 # Be Bourne compatible
478 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
481 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
482 # is contrary to our usage. Disable this feature.
483 alias -g '${1+"$@"}'='"$@"'
486 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
488 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
489 DUALCASE
=1; export DUALCASE
# for MKS sh
491 # NLS nuisances: We save the old values to restore during execute mode.
492 # Only set LANG and LC_ALL to C if already set.
493 # These must not be set unconditionally because not all systems understand
494 # e.g. LANG=C (notably SCO).
497 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
499 eval "if test \"\${$lt_var+set}\" = set; then
500 save_$lt_var=\$$lt_var
503 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
504 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
516 : ${EGREP="/usr/bin/grep -E"}
517 : ${FGREP="/usr/bin/grep -F"}
518 : ${GREP="/usr/bin/grep"}
524 : ${SED="/opt/local/bin/gsed"}
525 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
526 : ${Xsed="$SED -e 1s/^X//"}
531 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
532 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
534 exit_status
=$EXIT_SUCCESS
536 # Make sure IFS has a sensible default
541 dirname="s,/[^/]*$,,"
544 # func_dirname_and_basename file append nondir_replacement
545 # perform func_basename and func_dirname in a single function
547 # dirname: Compute the dirname of FILE. If nonempty,
548 # add APPEND to the result, otherwise set result
549 # to NONDIR_REPLACEMENT.
550 # value returned in "$func_dirname_result"
551 # basename: Compute filename of FILE.
552 # value retuned in "$func_basename_result"
553 # Implementation must be kept synchronized with func_dirname
554 # and func_basename. For efficiency, we do not delegate to
555 # those functions but instead duplicate the functionality here.
556 func_dirname_and_basename
()
558 # Extract subdirectory from the argument.
559 func_dirname_result
=`$ECHO "X${1}" | $Xsed -e "$dirname"`
560 if test "X$func_dirname_result" = "X${1}"; then
561 func_dirname_result
="${3}"
563 func_dirname_result
="$func_dirname_result${2}"
565 func_basename_result
=`$ECHO "X${1}" | $Xsed -e "$basename"`
568 # Generated shell functions inserted here.
570 # func_dirname file append nondir_replacement
571 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
572 # otherwise set result to NONDIR_REPLACEMENT.
576 */*) func_dirname_result
="${1%/*}${2}" ;;
577 * ) func_dirname_result
="${3}" ;;
584 func_basename_result
="${1##*/}"
587 # func_dirname_and_basename file append nondir_replacement
588 # perform func_basename and func_dirname in a single function
590 # dirname: Compute the dirname of FILE. If nonempty,
591 # add APPEND to the result, otherwise set result
592 # to NONDIR_REPLACEMENT.
593 # value returned in "$func_dirname_result"
594 # basename: Compute filename of FILE.
595 # value retuned in "$func_basename_result"
596 # Implementation must be kept synchronized with func_dirname
597 # and func_basename. For efficiency, we do not delegate to
598 # those functions but instead duplicate the functionality here.
599 func_dirname_and_basename
()
602 */*) func_dirname_result
="${1%/*}${2}" ;;
603 * ) func_dirname_result
="${3}" ;;
605 func_basename_result
="${1##*/}"
608 # func_stripname prefix suffix name
609 # strip PREFIX and SUFFIX off of NAME.
610 # PREFIX and SUFFIX must not contain globbing or regex special
611 # characters, hashes, percent signs, but SUFFIX may contain a leading
612 # dot (in which case that matches only a dot).
615 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
616 # positional parameters, so assign one to ordinary parameter first.
617 func_stripname_result
=${3}
618 func_stripname_result
=${func_stripname_result#"${1}"}
619 func_stripname_result
=${func_stripname_result%"${2}"}
625 func_opt_split_opt
=${1%%=*}
626 func_opt_split_arg
=${1#*=}
633 *.lo
) func_lo2o_result
=${1%.lo}.
${objext} ;;
634 *) func_lo2o_result
=${1} ;;
638 # func_xform libobj-or-source
641 func_xform_result
=${1%.*}.lo
644 # func_arith arithmetic-term...
647 func_arith_result
=$
(( $
* ))
651 # STRING may not start with a hyphen.
654 func_len_result
=${#1}
658 # func_append var value
659 # Append VALUE to the end of shell variable VAR.
664 # Generated shell functions inserted here.
666 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
667 # is ksh but when the shell is invoked as "sh" and the current value of
668 # the _XPG environment variable is not equal to 1 (one), the special
669 # positional parameter $0, within a function call, is the name of the
673 # The name of this program:
674 # In the unlikely event $progname began with a '-', it would play havoc with
675 # func_echo (imagine progname=-n), so we prepend ./ in that case:
676 func_dirname_and_basename
"$progpath"
677 progname
=$func_basename_result
679 -*) progname
=.
/$progname ;;
682 # Make sure we have an absolute path for reexecution:
684 [\\/]*|
[A-Za-z
]:\\*) ;;
686 progdir
=$func_dirname_result
687 progdir
=`cd "$progdir" && pwd`
688 progpath
="$progdir/$progname"
693 for progdir
in $PATH; do
695 test -x "$progdir/$progname" && break
698 test -n "$progdir" || progdir
=`pwd`
699 progpath
="$progdir/$progname"
703 # Sed substitution that helps us do robust quoting. It backslashifies
704 # metacharacters that are still active within double-quoted strings.
705 Xsed
="${SED}"' -e 1s/^X//'
706 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
708 # Same as above, but do not quote variable references.
709 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
711 # Re-`\' parameter expansions in output of double_quote_subst that were
712 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
713 # in input to double_quote_subst, that '$' was protected from expansion.
714 # Since each input `\' is now two `\'s, look for any number of runs of
715 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
720 sed_double_backslash
="\
724 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
735 # Echo program name prefixed message, along with the current mode
736 # name if it has been set yet.
739 $ECHO "$progname${mode+: }$mode: $*"
742 # func_verbose arg...
743 # Echo program name prefixed message in verbose mode only.
746 $opt_verbose && func_echo
${1+"$@"}
748 # A bug in bash halts the script if the last line of a function
749 # fails when set -e is in force, so we need another command to
755 # Echo program name prefixed message to standard error.
758 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
761 # func_warning arg...
762 # Echo program name prefixed warning message to standard error.
765 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
771 # func_fatal_error arg...
772 # Echo program name prefixed message to standard error, and exit.
779 # func_fatal_help arg...
780 # Echo program name prefixed message to standard error, followed by
781 # a help hint, and exit.
785 func_fatal_error
"$help"
787 help="Try \`$progname --help' for more information." ## default
790 # func_grep expression filename
791 # Check whether EXPRESSION matches any line of FILENAME, without output.
794 $GREP "$1" "$2" >/dev
/null
2>&1
798 # func_mkdir_p directory-path
799 # Make sure the entire path to DIRECTORY-PATH is available.
802 my_directory_path
="$1"
805 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
807 # Protect directory names starting with `-'
808 case $my_directory_path in
809 -*) my_directory_path
="./$my_directory_path" ;;
812 # While some portion of DIR does not yet exist...
813 while test ! -d "$my_directory_path"; do
814 # ...make a list in topmost first order. Use a colon delimited
815 # list incase some portion of path contains whitespace.
816 my_dir_list
="$my_directory_path:$my_dir_list"
818 # If the last portion added has no slash in it, the list is done
819 case $my_directory_path in */*) ;; *) break ;; esac
821 # ...otherwise throw away the child directory and loop
822 my_directory_path
=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
824 my_dir_list
=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
826 save_mkdir_p_IFS
="$IFS"; IFS
=':'
827 for my_dir
in $my_dir_list; do
828 IFS
="$save_mkdir_p_IFS"
829 # mkdir can fail with a `File exist' error if two processes
830 # try to create one of the directories concurrently. Don't
832 $MKDIR "$my_dir" 2>/dev
/null ||
:
834 IFS
="$save_mkdir_p_IFS"
836 # Bail out if we (or some other process) failed to create a directory.
837 test -d "$my_directory_path" || \
838 func_fatal_error
"Failed to create \`$1'"
843 # func_mktempdir [string]
844 # Make a temporary directory that won't clash with other running
845 # libtool processes, and avoids race conditions if possible. If
846 # given, STRING is the basename for that directory.
849 my_template
="${TMPDIR-/tmp}/${1-$progname}"
851 if test "$opt_dry_run" = ":"; then
852 # Return a directory name, but don't create it in dry-run mode
853 my_tmpdir
="${my_template}-$$"
856 # If mktemp works, use that first and foremost
857 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
859 if test ! -d "$my_tmpdir"; then
860 # Failing that, at least try and use $RANDOM to avoid a race
861 my_tmpdir
="${my_template}-${RANDOM-0}$$"
863 save_mktempdir_umask
=`umask`
866 umask $save_mktempdir_umask
869 # If we're not in dry-run mode, bomb out on failure
870 test -d "$my_tmpdir" || \
871 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
874 $ECHO "X$my_tmpdir" |
$Xsed
878 # func_quote_for_eval arg
879 # Aesthetically quote ARG to be evaled later.
880 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
881 # is double-quoted, suitable for a subsequent eval, whereas
882 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
883 # which are still active within double quotes backslashified.
884 func_quote_for_eval
()
888 func_quote_for_eval_unquoted_result=`$ECHO "X$1" |
$Xsed -e "$sed_quote_subst"` ;;
890 func_quote_for_eval_unquoted_result="$1" ;;
893 case $func_quote_for_eval_unquoted_result in
894 # Double-quote args containing shell metacharacters to delay
895 # word splitting, command substitution and and variable
896 # expansion for a subsequent eval.
897 # Many Bourne shells cannot handle close brackets correctly
898 # in scan sets, so we specify it separately.
899 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
900 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
903 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
908 # func_quote_for_expand arg
909 # Aesthetically quote ARG to be evaled later; same as above,
910 # but do not quote variable references.
911 func_quote_for_expand ()
915 my_arg
=`$ECHO "X$1" | $Xsed \
916 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
922 # Double-quote args containing shell metacharacters to delay
923 # word splitting and command substitution for a subsequent eval.
924 # Many Bourne shells cannot handle close brackets correctly
925 # in scan sets, so we specify it separately.
926 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
931 func_quote_for_expand_result
="$my_arg"
935 # func_show_eval cmd [fail_exp]
936 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
937 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
938 # is given, then evaluate it.
944 ${opt_silent-false} ||
{
945 func_quote_for_expand
"$my_cmd"
946 eval "func_echo $func_quote_for_expand_result"
949 if ${opt_dry_run-false}; then :; else
952 if test "$my_status" -eq 0; then :; else
953 eval "(exit $my_status); $my_fail_exp"
959 # func_show_eval_locale cmd [fail_exp]
960 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
961 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
962 # is given, then evaluate it. Use the saved locale for evaluation.
963 func_show_eval_locale
()
968 ${opt_silent-false} ||
{
969 func_quote_for_expand
"$my_cmd"
970 eval "func_echo $func_quote_for_expand_result"
973 if ${opt_dry_run-false}; then :; else
974 eval "$lt_user_locale
977 eval "$lt_safe_locale"
978 if test "$my_status" -eq 0; then :; else
979 eval "(exit $my_status); $my_fail_exp"
989 # Echo version message to standard output and exit.
992 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
995 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1002 # Echo short help message to standard output and exit.
1005 $SED -n '/^# Usage:/,/# -h/ {
1008 s/\$progname/'$progname'/
1012 $ECHO "run \`$progname --help | more' for full usage"
1017 # Echo long help message to standard output and exit.
1020 $SED -n '/^# Usage:/,/# Report bugs to/ {
1023 s*\$progname*'$progname'*
1025 s*\$SHELL*'"$SHELL"'*
1027 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1029 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1030 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1031 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1037 # func_missing_arg argname
1038 # Echo program name prefixed message to standard error and set global
1042 func_error
"missing argument for $1"
1052 # Check that we have a working $ECHO.
1053 if test "X$1" = X--no-reexec
; then
1054 # Discard the --no-reexec flag, and continue.
1056 elif test "X$1" = X--fallback-echo
; then
1057 # Avoid inline document here, it may be left over
1059 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1060 # Yippee, $ECHO works!
1063 # Restart under the correct shell, and then maybe $ECHO will work.
1064 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1067 if test "X$1" = X--fallback-echo
; then
1068 # used as fallback echo
1076 magic
="%%%MAGIC variable%%%"
1077 magic_exe
="%%%MAGIC EXE variable%%%"
1084 lo2o
="s/\\.lo\$/.${objext}/"
1085 o2lo
="s/\\.${objext}\$/.lo/"
1090 opt_duplicate_deps
=false
1094 # If this variable is set in any of the actions, the command in it
1095 # will be execed at the end. This prevents here-documents from being
1096 # left over by shells.
1099 # func_fatal_configuration arg...
1100 # Echo program name prefixed message to standard error, followed by
1101 # a configuration failure hint, and exit.
1102 func_fatal_configuration
()
1104 func_error
${1+"$@"}
1105 func_error
"See the $PACKAGE documentation for more information."
1106 func_fatal_error
"Fatal configuration error."
1111 # Display the configuration for all the tags in this script.
1114 re_begincf
='^# ### BEGIN LIBTOOL'
1115 re_endcf
='^# ### END LIBTOOL'
1117 # Default configuration.
1118 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1120 # Now print the configurations for the tags.
1121 for tagname
in $taglist; do
1122 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1129 # Display the features supported by this script.
1133 if test "$build_libtool_libs" = yes; then
1134 $ECHO "enable shared libraries"
1136 $ECHO "disable shared libraries"
1138 if test "$build_old_libs" = yes; then
1139 $ECHO "enable static libraries"
1141 $ECHO "disable static libraries"
1147 # func_enable_tag tagname
1148 # Verify that TAGNAME is valid, and either flag an error and exit, or
1149 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1156 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1157 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1158 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
1163 func_fatal_error
"invalid tag name: $tagname"
1167 # Don't test for the "default" C tag, as we know it's
1168 # there but not specially marked.
1172 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
1173 taglist
="$taglist $tagname"
1175 # Evaluate the configuration. Be careful to quote the path
1176 # and the sed script, to avoid splitting on whitespace, but
1177 # also don't use non-portable quotes within backquotes within
1178 # quotes we have to do it in 2 steps:
1179 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
1182 func_error
"ignoring unknown tag $tagname"
1188 # Parse options once, thoroughly. This comes as soon as possible in
1189 # the script to make things like `libtool --version' happen quickly.
1192 # Shorthand for --mode=foo, only valid as the first argument
1195 shift; set dummy
--mode clean
${1+"$@"}; shift
1197 compile|compil|compi|comp|com|co|c
)
1198 shift; set dummy
--mode compile
${1+"$@"}; shift
1200 execute|execut|execu|
exec|exe|ex|e
)
1201 shift; set dummy
--mode execute
${1+"$@"}; shift
1203 finish|finis|fini|fin|
fi|f
)
1204 shift; set dummy
--mode finish
${1+"$@"}; shift
1206 install|instal|insta|inst|ins|
in|i
)
1207 shift; set dummy
--mode install ${1+"$@"}; shift
1210 shift; set dummy
--mode link
${1+"$@"}; shift
1212 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u
)
1213 shift; set dummy
--mode uninstall
${1+"$@"}; shift
1217 # Parse non-mode specific arguments:
1218 while test "$#" -gt 0; do
1223 --config) func_config
;;
1225 --debug) preserve_args
="$preserve_args $opt"
1226 func_echo
"enabling shell trace mode"
1231 -dlopen) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1232 execute_dlfiles
="$execute_dlfiles $1"
1236 --dry-run |
-n) opt_dry_run
=: ;;
1237 --features) func_features
;;
1238 --finish) mode
="finish" ;;
1240 --mode) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1242 # Valid mode arguments:
1252 # Catch anything else as an error
1253 *) func_error
"invalid argument for $opt"
1263 --preserve-dup-deps)
1264 opt_duplicate_deps
=: ;;
1266 --quiet|
--silent) preserve_args
="$preserve_args $opt"
1270 --verbose|
-v) preserve_args
="$preserve_args $opt"
1274 --tag) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1275 preserve_args
="$preserve_args $opt $1"
1276 func_enable_tag
"$1" # tagname is set here
1280 # Separate optargs to long options:
1281 -dlopen=*|
--mode=*|
--tag=*)
1282 func_opt_split
"$opt"
1283 set dummy
"$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1287 -\?|
-h) func_usage
;;
1288 --help) opt_help
=: ;;
1289 --version) func_version
;;
1291 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
1301 *cygwin
* |
*mingw
* |
*pw32
*)
1302 # don't eliminate duplications in $postdeps and $predeps
1303 opt_duplicate_compiler_generated_deps
=:
1306 opt_duplicate_compiler_generated_deps
=$opt_duplicate_deps
1310 # Having warned about all mis-specified options, bail out if
1311 # anything was wrong.
1312 $exit_cmd $EXIT_FAILURE
1315 # func_check_version_match
1316 # Ensure that we are using m4 macros, and libtool script from the same
1317 # release of libtool.
1318 func_check_version_match
()
1320 if test "$package_revision" != "$macro_revision"; then
1321 if test "$VERSION" != "$macro_version"; then
1322 if test -z "$macro_version"; then
1324 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1325 $progname: definition of this LT_INIT comes from an older release.
1326 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1327 $progname: and run autoconf again.
1331 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1332 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1333 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1334 $progname: and run autoconf again.
1339 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1340 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1341 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1342 $progname: of $PACKAGE $VERSION and run autoconf again.
1356 # Sanity checks first:
1357 func_check_version_match
1359 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1360 func_fatal_configuration
"not configured to build any kind of library"
1363 test -z "$mode" && func_fatal_error
"error: you must specify a MODE."
1367 eval std_shrext
=\"$shrext_cmds\"
1370 # Only execute mode is allowed to have -dlopen flags.
1371 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
1372 func_error
"unrecognized option \`-dlopen'"
1377 # Change the help message to a mode-specific one.
1378 generic_help
="$help"
1379 help="Try \`$progname --help --mode=$mode' for more information."
1384 # True iff FILE is a libtool `.la' library or `.lo' object file.
1385 # This function is only a basic sanity check; it will hardly flush out
1386 # determined imposters.
1389 $SED -e 4q
"$1" 2>/dev
/null \
1390 |
$GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
1393 # func_lalib_unsafe_p file
1394 # True iff FILE is a libtool `.la' library or `.lo' object file.
1395 # This function implements the same check as func_lalib_p without
1396 # resorting to external programs. To this end, it redirects stdin and
1397 # closes it afterwards, without saving the original file descriptor.
1398 # As a safety measure, use it only where a negative result would be
1399 # fatal anyway. Works if `file' does not exist.
1400 func_lalib_unsafe_p
()
1403 if test -r "$1" && exec 5<&0 <"$1"; then
1404 for lalib_p_l
in 1 2 3 4
1407 case "$lalib_p_line" in
1408 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1413 test "$lalib_p" = yes
1416 # func_ltwrapper_script_p file
1417 # True iff FILE is a libtool wrapper script
1418 # This function is only a basic sanity check; it will hardly flush out
1419 # determined imposters.
1420 func_ltwrapper_script_p
()
1425 # func_ltwrapper_executable_p file
1426 # True iff FILE is a libtool wrapper executable
1427 # This function is only a basic sanity check; it will hardly flush out
1428 # determined imposters.
1429 func_ltwrapper_executable_p
()
1431 func_ltwrapper_exec_suffix
=
1434 *) func_ltwrapper_exec_suffix
=.exe
;;
1436 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev
/null
2>&1
1439 # func_ltwrapper_scriptname file
1440 # Assumes file is an ltwrapper_executable
1441 # uses $file to determine the appropriate filename for a
1442 # temporary ltwrapper_script.
1443 func_ltwrapper_scriptname
()
1445 func_ltwrapper_scriptname_result
=""
1446 if func_ltwrapper_executable_p
"$1"; then
1447 func_dirname_and_basename
"$1" "" "."
1448 func_stripname
'' '.exe' "$func_basename_result"
1449 func_ltwrapper_scriptname_result
="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1453 # func_ltwrapper_p file
1454 # True iff FILE is a libtool wrapper script or wrapper executable
1455 # This function is only a basic sanity check; it will hardly flush out
1456 # determined imposters.
1459 func_ltwrapper_script_p
"$1" || func_ltwrapper_executable_p
"$1"
1463 # func_execute_cmds commands fail_cmd
1464 # Execute tilde-delimited COMMANDS.
1465 # If FAIL_CMD is given, eval that upon failure.
1466 # FAIL_CMD may read-access the current command in variable CMD!
1467 func_execute_cmds
()
1470 save_ifs
=$IFS; IFS
='~'
1474 func_show_eval
"$cmd" "${2-:}"
1481 # Source FILE, adding directory component if necessary.
1482 # Note that it is not necessary on cygwin/mingw to append a dot to
1483 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1484 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1485 # `FILE.' does not work on cygwin managed mounts.
1490 */* |
*\\*) .
"$1" ;;
1496 # func_infer_tag arg
1497 # Infer tagged configuration to use if any are available and
1498 # if one wasn't chosen via the "--tag" command line option.
1499 # Only attempt this if the compiler in the base compile
1500 # command doesn't match the default compiler.
1501 # arg is usually of the form 'gcc ...'
1505 if test -n "$available_tags" && test -z "$tagname"; then
1508 func_quote_for_eval
"$arg"
1509 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1512 # Blanks in the command may have been stripped by the calling shell,
1513 # but not from the CC environment variable when configure was run.
1514 " $CC "* |
"$CC "* |
" `$ECHO $CC` "* |
"`$ECHO $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$ECHO $CC_quoted` "* |
"`$ECHO $CC_quoted` "*) ;;
1515 # Blanks at the start of $base_compile will cause this to fail
1516 # if we don't check for them as well.
1518 for z
in $available_tags; do
1519 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1520 # Evaluate the configuration.
1521 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1524 # Double-quote args containing other shell metacharacters.
1525 func_quote_for_eval
"$arg"
1526 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1529 " $CC "* |
"$CC "* |
" `$ECHO $CC` "* |
"`$ECHO $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$ECHO $CC_quoted` "* |
"`$ECHO $CC_quoted` "*)
1530 # The compiler in the base compile command matches
1531 # the one in the tagged configuration.
1532 # Assume this is the tagged configuration we want.
1539 # If $tagname still isn't set, then no tagged configuration
1540 # was found and let the user know that the "--tag" command
1541 # line option must be used.
1542 if test -z "$tagname"; then
1543 func_echo
"unable to infer tagged configuration"
1544 func_fatal_error
"specify a tag with \`--tag'"
1546 # func_verbose "using $tagname tagged configuration"
1555 # func_write_libtool_object output_name pic_name nonpic_name
1556 # Create a libtool object file (analogous to a ".la" file),
1557 # but don't create it if we're doing a dry run.
1558 func_write_libtool_object
()
1561 if test "$build_libtool_libs" = yes; then
1567 if test "$build_old_libs" = yes; then
1568 write_oldobj
=\'${3}\'
1574 cat >${write_libobj}T
<<EOF
1575 # $write_libobj - a libtool object file
1576 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1578 # Please DO NOT delete this file!
1579 # It is necessary for linking the library.
1581 # Name of the PIC object.
1582 pic_object=$write_lobj
1584 # Name of the non-PIC object
1585 non_pic_object=$write_oldobj
1588 $MV "${write_libobj}T" "${write_libobj}"
1592 # func_mode_compile arg...
1593 func_mode_compile
()
1596 # Get the compilation command and the source file.
1598 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1610 # do not "continue". Instead, add this to base_compile
1622 # Accept any command-line options.
1625 test -n "$libobj" && \
1626 func_fatal_error
"you cannot specify \`-o' more than once"
1631 -pie |
-fpie |
-fPIE)
1632 pie_flag
="$pie_flag $arg"
1636 -shared |
-static |
-prefer-pic |
-prefer-non-pic)
1647 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1648 continue # The current "srcfile" will either be retained or
1649 ;; # replaced later. I would guess that would be a bug.
1652 func_stripname
'-Wc,' '' "$arg"
1653 args
=$func_stripname_result
1655 save_ifs
="$IFS"; IFS
=','
1656 for arg
in $args; do
1658 func_quote_for_eval
"$arg"
1659 lastarg
="$lastarg $func_quote_for_eval_result"
1662 func_stripname
' ' '' "$lastarg"
1663 lastarg
=$func_stripname_result
1665 # Add the arguments to base_compile.
1666 base_compile
="$base_compile $lastarg"
1671 # Accept the current argument as the source file.
1672 # The previous "srcfile" becomes the current argument.
1679 esac # case $arg_mode
1681 # Aesthetically quote the previous argument.
1682 func_quote_for_eval
"$lastarg"
1683 base_compile
="$base_compile $func_quote_for_eval_result"
1688 func_fatal_error
"you must specify an argument for -Xcompile"
1691 func_fatal_error
"you must specify a target with \`-o'"
1694 # Get the name of the library object.
1695 test -z "$libobj" && {
1696 func_basename
"$srcfile"
1697 libobj
="$func_basename_result"
1702 # Recognize several different file suffixes.
1703 # If the user specifies -o file.o, it is replaced with file.lo
1706 *.ada |
*.adb |
*.ads |
*.asm | \
1707 *.c
++ |
*.cc |
*.ii |
*.class |
*.cpp |
*.cxx | \
1708 *.
[fF
][09]? |
*.
for |
*.java |
*.obj |
*.sx
)
1709 func_xform
"$libobj"
1710 libobj
=$func_xform_result
1715 *.lo
) func_lo2o
"$libobj"; obj
=$func_lo2o_result ;;
1717 func_fatal_error
"cannot determine name of library object from \`$libobj'"
1721 func_infer_tag
$base_compile
1723 for arg
in $later; do
1726 test "$build_libtool_libs" != yes && \
1727 func_fatal_configuration
"can not build a shared library"
1733 build_libtool_libs
=no
1750 func_quote_for_eval
"$libobj"
1751 test "X$libobj" != "X$func_quote_for_eval_result" \
1752 && $ECHO "X$libobj" |
$GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1753 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
1754 func_dirname_and_basename
"$obj" "/" ""
1755 objname
="$func_basename_result"
1756 xdir
="$func_dirname_result"
1757 lobj
=${xdir}$objdir/$objname
1759 test -z "$base_compile" && \
1760 func_fatal_help
"you must specify a compilation command"
1762 # Delete any leftover library objects.
1763 if test "$build_old_libs" = yes; then
1764 removelist
="$obj $lobj $libobj ${libobj}T"
1766 removelist
="$lobj $libobj ${libobj}T"
1769 # On Cygwin there's no "real" PIC flag so we must build both object types
1771 cygwin
* | mingw
* | pw32
* | os2
*)
1775 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1776 # non-PIC code in shared libraries is not supported
1780 # Calculate the filename of the output object if compiler does
1781 # not support -o with -c
1782 if test "$compiler_c_o" = no
; then
1783 output_obj
=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
1784 lockfile
="$output_obj.lock"
1791 # Lock this critical section if it is needed
1792 # We use this script file to make the link, it avoids creating a new file
1793 if test "$need_locks" = yes; then
1794 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
1795 func_echo
"Waiting for $lockfile to be removed"
1798 elif test "$need_locks" = warn
; then
1799 if test -f "$lockfile"; then
1801 *** ERROR, $lockfile exists and contains:
1802 `cat $lockfile 2>/dev/null`
1804 This indicates that another process is trying to use the same
1805 temporary object file, and libtool could not work around it because
1806 your compiler does not support \`-c' and \`-o' together. If you
1807 repeat this compilation, it may succeed, by chance, but you had better
1808 avoid parallel builds (make -j) in this platform, or get a better
1811 $opt_dry_run ||
$RM $removelist
1814 removelist
="$removelist $output_obj"
1815 $ECHO "$srcfile" > "$lockfile"
1818 $opt_dry_run ||
$RM $removelist
1819 removelist
="$removelist $lockfile"
1820 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1822 if test -n "$fix_srcfile_path"; then
1823 eval srcfile
=\"$fix_srcfile_path\"
1825 func_quote_for_eval
"$srcfile"
1826 qsrcfile
=$func_quote_for_eval_result
1828 # Only build a PIC object if we are building libtool libraries.
1829 if test "$build_libtool_libs" = yes; then
1830 # Without this assignment, base_compile gets emptied.
1831 fbsd_hideous_sh_bug
=$base_compile
1833 if test "$pic_mode" != no
; then
1834 command="$base_compile $qsrcfile $pic_flag"
1836 # Don't build PIC code
1837 command="$base_compile $qsrcfile"
1840 func_mkdir_p
"$xdir$objdir"
1842 if test -z "$output_obj"; then
1843 # Place PIC objects in $objdir
1844 command="$command -o $lobj"
1847 func_show_eval_locale
"$command" \
1848 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1850 if test "$need_locks" = warn
&&
1851 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1853 *** ERROR, $lockfile contains:
1854 `cat $lockfile 2>/dev/null`
1856 but it should contain:
1859 This indicates that another process is trying to use the same
1860 temporary object file, and libtool could not work around it because
1861 your compiler does not support \`-c' and \`-o' together. If you
1862 repeat this compilation, it may succeed, by chance, but you had better
1863 avoid parallel builds (make -j) in this platform, or get a better
1866 $opt_dry_run ||
$RM $removelist
1870 # Just move the object if needed, then go on to compile the next one
1871 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1872 func_show_eval
'$MV "$output_obj" "$lobj"' \
1873 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1876 # Allow error messages only from the first compilation.
1877 if test "$suppress_opt" = yes; then
1878 suppress_output
=' >/dev/null 2>&1'
1882 # Only build a position-dependent object if we build old libraries.
1883 if test "$build_old_libs" = yes; then
1884 if test "$pic_mode" != yes; then
1885 # Don't build PIC code
1886 command="$base_compile $qsrcfile$pie_flag"
1888 command="$base_compile $qsrcfile $pic_flag"
1890 if test "$compiler_c_o" = yes; then
1891 command="$command -o $obj"
1894 # Suppress compiler output if we already did a PIC compilation.
1895 command="$command$suppress_output"
1896 func_show_eval_locale
"$command" \
1897 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1899 if test "$need_locks" = warn
&&
1900 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1902 *** ERROR, $lockfile contains:
1903 `cat $lockfile 2>/dev/null`
1905 but it should contain:
1908 This indicates that another process is trying to use the same
1909 temporary object file, and libtool could not work around it because
1910 your compiler does not support \`-c' and \`-o' together. If you
1911 repeat this compilation, it may succeed, by chance, but you had better
1912 avoid parallel builds (make -j) in this platform, or get a better
1915 $opt_dry_run ||
$RM $removelist
1919 # Just move the object if needed
1920 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1921 func_show_eval
'$MV "$output_obj" "$obj"' \
1922 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1927 func_write_libtool_object
"$libobj" "$objdir/$objname" "$objname"
1929 # Unlock the critical section if it was locked
1930 if test "$need_locks" != no
; then
1931 removelist
=$lockfile
1940 test "$mode" = compile
&& func_mode_compile
${1+"$@"}
1945 # We need to display help for each of the modes.
1948 # Generic help is extracted from the usage comments
1949 # at the start of this file.
1955 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1957 Remove files from the build directory.
1959 RM is the name of the program to use to delete files associated with each FILE
1960 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1963 If FILE is a libtool library, object or program, all the files associated
1964 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1969 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1971 Compile a source file into a libtool library object.
1973 This mode accepts the following additional options:
1975 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1976 -no-suppress do not suppress compiler output for multiple passes
1977 -prefer-pic try to building PIC objects only
1978 -prefer-non-pic try to building non-PIC objects only
1979 -shared do not build a \`.o' file suitable for static linking
1980 -static only build a \`.o' file suitable for static linking
1982 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1983 from the given SOURCEFILE.
1985 The output file name is determined by removing the directory component from
1986 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1987 library object suffix, \`.lo'."
1992 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1994 Automatically set library path, then run a program.
1996 This mode accepts the following additional options:
1998 -dlopen FILE add the directory containing FILE to the library path
2000 This mode sets the library path environment variable according to \`-dlopen'
2003 If any of the ARGS are libtool executable wrappers, then they are translated
2004 into their corresponding uninstalled binary, and any of their required library
2005 directories are added to the library path.
2007 Then, COMMAND is executed, with ARGS as arguments."
2012 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2014 Complete the installation of libtool libraries.
2016 Each LIBDIR is a directory that contains libtool libraries.
2018 The commands that this mode executes may require superuser privileges. Use
2019 the \`--dry-run' option if you just want to see what would be executed."
2024 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2026 Install executables or libraries.
2028 INSTALL-COMMAND is the installation command. The first component should be
2029 either the \`install' or \`cp' program.
2031 The following components of INSTALL-COMMAND are treated specially:
2033 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2035 The rest of the components are interpreted as arguments to that command (only
2036 BSD-compatible install options are recognized)."
2041 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2043 Link object files or libraries together to form another library, or to
2044 create an executable program.
2046 LINK-COMMAND is a command using the C compiler that you would use to create
2047 a program from several object files.
2049 The following components of LINK-COMMAND are treated specially:
2051 -all-static do not do any dynamic linking at all
2052 -avoid-version do not add a version suffix if possible
2053 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2054 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2055 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2056 -export-symbols SYMFILE
2057 try to export only the symbols listed in SYMFILE
2058 -export-symbols-regex REGEX
2059 try to export only the symbols matching REGEX
2060 -LLIBDIR search LIBDIR for required installed libraries
2061 -lNAME OUTPUT-FILE requires the installed library libNAME
2062 -module build a library that can dlopened
2063 -no-fast-install disable the fast-install mode
2064 -no-install link a not-installable executable
2065 -no-undefined declare that a library does not refer to external symbols
2066 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2067 -objectlist FILE Use a list of object files found in FILE to specify objects
2068 -precious-files-regex REGEX
2069 don't remove output files matching REGEX
2070 -release RELEASE specify package release information
2071 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2072 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2073 -shared only do dynamic linking of libtool libraries
2074 -shrext SUFFIX override the standard shared library file extension
2075 -static do not do any dynamic linking of uninstalled libtool libraries
2076 -static-libtool-libs
2077 do not do any dynamic linking of libtool libraries
2078 -version-info CURRENT[:REVISION[:AGE]]
2079 specify library version info [each variable defaults to 0]
2080 -weak LIBNAME declare that the target provides the LIBNAME interface
2082 All other options (arguments beginning with \`-') are ignored.
2084 Every other argument is treated as a filename. Files ending in \`.la' are
2085 treated as uninstalled libtool libraries, other files are standard or library
2088 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2089 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2090 required, except when creating a convenience library.
2092 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2093 using \`ar' and \`ranlib', or on Windows using \`lib'.
2095 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2096 is created, otherwise an executable program is created."
2101 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2103 Remove libraries from an installation directory.
2105 RM is the name of the program to use to delete files associated with each FILE
2106 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2109 If FILE is a libtool library, all the files associated with it are deleted.
2110 Otherwise, only FILE itself is deleted using RM."
2114 func_fatal_help
"invalid operation mode \`$mode'"
2119 $ECHO "Try \`$progname --help' for more information about other modes."
2124 # Now that we've collected a possible --mode arg, show help if necessary
2125 $opt_help && func_mode_help
2128 # func_mode_execute arg...
2129 func_mode_execute
()
2132 # The first argument is the command name.
2135 func_fatal_help
"you must specify a COMMAND"
2137 # Handle -dlopen flags immediately.
2138 for file in $execute_dlfiles; do
2140 || func_fatal_help
"\`$file' is not a file"
2145 # Check to see that this really is a libtool archive.
2146 func_lalib_unsafe_p
"$file" \
2147 || func_fatal_help
"\`$lib' is not a valid libtool archive"
2149 # Read the libtool library.
2154 # Skip this library if it cannot be dlopened.
2155 if test -z "$dlname"; then
2156 # Warn if it was a shared library.
2157 test -n "$library_names" && \
2158 func_warning
"\`$file' was not linked with \`-export-dynamic'"
2162 func_dirname
"$file" "" "."
2163 dir
="$func_dirname_result"
2165 if test -f "$dir/$objdir/$dlname"; then
2168 if test ! -f "$dir/$dlname"; then
2169 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2175 # Just add the directory containing the .lo file.
2176 func_dirname
"$file" "" "."
2177 dir
="$func_dirname_result"
2181 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
2186 # Get the absolute pathname.
2187 absdir
=`cd "$dir" && pwd`
2188 test -n "$absdir" && dir
="$absdir"
2190 # Now add the directory to shlibpath_var.
2191 if eval "test -z \"\$$shlibpath_var\""; then
2192 eval "$shlibpath_var=\"\$dir\""
2194 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2198 # This variable tells wrapper scripts just to set shlibpath_var
2199 # rather than running their programs.
2200 libtool_execute_magic
="$magic"
2202 # Check if any of the arguments is a wrapper script.
2209 # Do a test to see if this is really a libtool program.
2210 if func_ltwrapper_script_p
"$file"; then
2212 # Transform arg to wrapped name.
2213 file="$progdir/$program"
2214 elif func_ltwrapper_executable_p
"$file"; then
2215 func_ltwrapper_scriptname
"$file"
2216 func_source
"$func_ltwrapper_scriptname_result"
2217 # Transform arg to wrapped name.
2218 file="$progdir/$program"
2222 # Quote arguments (to preserve shell metacharacters).
2223 func_quote_for_eval
"$file"
2224 args
="$args $func_quote_for_eval_result"
2227 if test "X$opt_dry_run" = Xfalse
; then
2228 if test -n "$shlibpath_var"; then
2229 # Export the shlibpath_var.
2230 eval "export $shlibpath_var"
2233 # Restore saved environment variables
2234 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2236 eval "if test \"\${save_$lt_var+set}\" = set; then
2237 $lt_var=\$save_$lt_var; export $lt_var
2243 # Now prepare to actually exec the command.
2244 exec_cmd
="\$cmd$args"
2246 # Display what would be done.
2247 if test -n "$shlibpath_var"; then
2248 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2249 $ECHO "export $shlibpath_var"
2256 test "$mode" = execute
&& func_mode_execute
${1+"$@"}
2259 # func_mode_finish arg...
2266 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2269 libdirs
="$libdirs $dir"
2272 for libdir
in $libdirs; do
2273 if test -n "$finish_cmds"; then
2274 # Do each command in the finish commands.
2275 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
2278 if test -n "$finish_eval"; then
2279 # Do the single finish_eval.
2280 eval cmds
=\"$finish_eval\"
2281 $opt_dry_run ||
eval "$cmds" || admincmds
="$admincmds
2287 # Exit here if they wanted silent mode.
2288 $opt_silent && exit $EXIT_SUCCESS
2290 $ECHO "X----------------------------------------------------------------------" |
$Xsed
2291 $ECHO "Libraries have been installed in:"
2292 for libdir
in $libdirs; do
2296 $ECHO "If you ever happen to want to link against installed libraries"
2297 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2298 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2299 $ECHO "flag during linking and do at least one of the following:"
2300 if test -n "$shlibpath_var"; then
2301 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2302 $ECHO " during execution"
2304 if test -n "$runpath_var"; then
2305 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2306 $ECHO " during linking"
2308 if test -n "$hardcode_libdir_flag_spec"; then
2310 eval flag
=\"$hardcode_libdir_flag_spec\"
2312 $ECHO " - use the \`$flag' linker flag"
2314 if test -n "$admincmds"; then
2315 $ECHO " - have your system administrator run these commands:$admincmds"
2317 if test -f /etc
/ld.so.conf
; then
2318 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2322 $ECHO "See any operating system documentation about shared libraries for"
2324 solaris2.
[6789]|solaris2.1
[0-9])
2325 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2329 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2332 $ECHO "X----------------------------------------------------------------------" |
$Xsed
2336 test "$mode" = finish
&& func_mode_finish
${1+"$@"}
2339 # func_mode_install arg...
2340 func_mode_install
()
2343 # There may be an optional sh(1) argument at the beginning of
2344 # install_prog (especially on Windows NT).
2345 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
2346 # Allow the use of GNU shtool's install command.
2347 $ECHO "X$nonopt" |
$GREP shtool
>/dev
/null
; then
2348 # Aesthetically quote it.
2349 func_quote_for_eval
"$nonopt"
2350 install_prog
="$func_quote_for_eval_result "
2358 # The real first argument should be the name of the installation program.
2359 # Aesthetically quote it.
2360 func_quote_for_eval
"$arg"
2361 install_prog
="$install_prog$func_quote_for_eval_result"
2363 # We need to accept at least all the BSD install flags.
2373 if test -n "$dest"; then
2374 files
="$files $dest"
2382 case " $install_prog " in
2397 # If the previous option needed an argument, then skip it.
2398 if test -n "$prev"; then
2407 # Aesthetically quote the argument.
2408 func_quote_for_eval
"$arg"
2409 install_prog
="$install_prog $func_quote_for_eval_result"
2412 test -z "$install_prog" && \
2413 func_fatal_help
"you must specify an install program"
2415 test -n "$prev" && \
2416 func_fatal_help
"the \`$prev' option requires an argument"
2418 if test -z "$files"; then
2419 if test -z "$dest"; then
2420 func_fatal_help
"no file or destination specified"
2422 func_fatal_help
"you must specify a destination"
2426 # Strip any trailing slash from the destination.
2427 func_stripname
'' '/' "$dest"
2428 dest
=$func_stripname_result
2430 # Check to see that the destination is a directory.
2431 test -d "$dest" && isdir
=yes
2432 if test "$isdir" = yes; then
2436 func_dirname_and_basename
"$dest" "" "."
2437 destdir
="$func_dirname_result"
2438 destname
="$func_basename_result"
2440 # Not a directory, so check to see that there is only one file specified.
2441 set dummy
$files; shift
2442 test "$#" -gt 1 && \
2443 func_fatal_help
"\`$dest' is not a directory"
2446 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2448 for file in $files; do
2452 func_fatal_help
"\`$destdir' must be an absolute directory name"
2459 # This variable tells wrapper scripts just to set variables rather
2460 # than running their programs.
2461 libtool_install_magic
="$magic"
2466 for file in $files; do
2468 # Do each installation.
2471 # Do the static libraries later.
2472 staticlibs
="$staticlibs $file"
2476 # Check to see that this really is a libtool archive.
2477 func_lalib_unsafe_p
"$file" \
2478 || func_fatal_help
"\`$file' is not a valid libtool archive"
2485 # Add the libdir to current_libdirs if it is the destination.
2486 if test "X$destdir" = "X$libdir"; then
2487 case "$current_libdirs " in
2489 *) current_libdirs
="$current_libdirs $libdir" ;;
2492 # Note the libdir as a future libdir.
2493 case "$future_libdirs " in
2495 *) future_libdirs
="$future_libdirs $libdir" ;;
2499 func_dirname
"$file" "/" ""
2500 dir
="$func_dirname_result"
2503 if test -n "$relink_command"; then
2504 # Determine the prefix the user has applied to our future dir.
2505 inst_prefix_dir
=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2507 # Don't allow the user to place us outside of our expected
2508 # location b/c this prevents finding dependent libraries that
2509 # are installed to the same prefix.
2510 # At present, this check doesn't affect windows .dll's that
2511 # are installed into $libdir/../bin (currently, that works fine)
2512 # but it's something to keep an eye on.
2513 test "$inst_prefix_dir" = "$destdir" && \
2514 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
2516 if test -n "$inst_prefix_dir"; then
2517 # Stick the inst_prefix_dir data into the link command.
2518 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2520 relink_command
=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2523 func_warning
"relinking \`$file'"
2524 func_show_eval
"$relink_command" \
2525 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2528 # See the names of the shared library.
2529 set dummy
$library_names; shift
2530 if test -n "$1"; then
2535 test -n "$relink_command" && srcname
="$realname"T
2537 # Install the shared library and build the symlinks.
2538 func_show_eval
"$install_prog $dir/$srcname $destdir/$realname" \
2542 cygwin
* | mingw
* | pw32
*)
2550 if test -n "$tstripme" && test -n "$striplib"; then
2551 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
2554 if test "$#" -gt 0; then
2555 # Delete the old symlinks, and create new ones.
2556 # Try `ln -sf' first, because the `ln' binary might depend on
2557 # the symlink we replace! Solaris /bin/ln does not understand -f,
2558 # so we also need to try rm && ln -s.
2561 test "$linkname" != "$realname" \
2562 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2566 # Do each command in the postinstall commands.
2567 lib
="$destdir/$realname"
2568 func_execute_cmds
"$postinstall_cmds" 'exit $?'
2571 # Install the pseudo-library for information purposes.
2572 func_basename
"$file"
2573 name
="$func_basename_result"
2574 instname
="$dir/$name"i
2575 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
2577 # Maybe install the static library, too.
2578 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2582 # Install (i.e. copy) a libtool object.
2584 # Figure out destination file name, if it wasn't already specified.
2585 if test -n "$destname"; then
2586 destfile
="$destdir/$destname"
2588 func_basename
"$file"
2589 destfile
="$func_basename_result"
2590 destfile
="$destdir/$destfile"
2593 # Deduce the name of the destination old-style object file.
2596 func_lo2o
"$destfile"
2597 staticdest
=$func_lo2o_result
2600 staticdest
="$destfile"
2604 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
2608 # Install the libtool object if requested.
2609 test -n "$destfile" && \
2610 func_show_eval
"$install_prog $file $destfile" 'exit $?'
2612 # Install the old object if enabled.
2613 if test "$build_old_libs" = yes; then
2614 # Deduce the name of the old-style object file.
2616 staticobj
=$func_lo2o_result
2617 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
2623 # Figure out destination file name, if it wasn't already specified.
2624 if test -n "$destname"; then
2625 destfile
="$destdir/$destname"
2627 func_basename
"$file"
2628 destfile
="$func_basename_result"
2629 destfile
="$destdir/$destfile"
2632 # If the file is missing, and there is a .exe on the end, strip it
2633 # because it is most likely a libtool script we actually want to
2638 if test ! -f "$file"; then
2639 func_stripname
'' '.exe' "$file"
2640 file=$func_stripname_result
2646 # Do a test to see if this is really a libtool program.
2649 if func_ltwrapper_executable_p
"$file"; then
2650 func_ltwrapper_scriptname
"$file"
2651 wrapper
=$func_ltwrapper_scriptname_result
2653 func_stripname
'' '.exe' "$file"
2654 wrapper
=$func_stripname_result
2661 if func_ltwrapper_script_p
"$wrapper"; then
2665 func_source
"$wrapper"
2667 # Check the variables that should have been set.
2668 test -z "$generated_by_libtool_version" && \
2669 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
2672 for lib
in $notinst_deplibs; do
2673 # Check to see that each library is installed.
2675 if test -f "$lib"; then
2678 libfile
="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2679 if test -n "$libdir" && test ! -f "$libfile"; then
2680 func_warning
"\`$lib' has not been installed in \`$libdir'"
2686 func_source
"$wrapper"
2689 if test "$fast_install" = no
&& test -n "$relink_command"; then
2691 if test "$finalize" = yes; then
2692 tmpdir
=`func_mktempdir`
2693 func_basename
"$file$stripped_ext"
2694 file="$func_basename_result"
2695 outputname
="$tmpdir/$file"
2696 # Replace the output file specification.
2697 relink_command
=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2700 func_quote_for_expand
"$relink_command"
2701 eval "func_echo $func_quote_for_expand_result"
2703 if eval "$relink_command"; then :
2705 func_error
"error: relink \`$file' with the above command before installing it"
2706 $opt_dry_run ||
${RM}r
"$tmpdir"
2711 func_warning
"cannot relink \`$file'"
2715 # Install the binary that we compiled earlier.
2716 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2720 # remove .exe since cygwin /usr/bin/install will append another
2722 case $install_prog,$host in
2723 */usr
/bin
/install*,*cygwin
*)
2724 case $file:$destfile in
2729 destfile
=$destfile.exe
2732 func_stripname
'' '.exe' "$destfile"
2733 destfile
=$func_stripname_result
2738 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
2739 $opt_dry_run ||
if test -n "$outputname"; then
2746 for file in $staticlibs; do
2747 func_basename
"$file"
2748 name
="$func_basename_result"
2750 # Set up the ranlib parameters.
2751 oldlib
="$destdir/$name"
2753 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
2755 if test -n "$stripme" && test -n "$old_striplib"; then
2756 func_show_eval
"$old_striplib $oldlib" 'exit $?'
2759 # Do each command in the postinstall commands.
2760 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
2763 test -n "$future_libdirs" && \
2764 func_warning
"remember to run \`$progname --finish$future_libdirs'"
2766 if test -n "$current_libdirs"; then
2767 # Maybe just do a dry run.
2768 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
2769 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
2775 test "$mode" = install && func_mode_install
${1+"$@"}
2778 # func_generate_dlsyms outputname originator pic_p
2779 # Extract symbols from dlprefiles and create ${outputname}S.o with
2780 # a dlpreopen symbol table.
2781 func_generate_dlsyms
()
2787 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2790 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2791 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2792 my_dlsyms
="${my_outputname}S.c"
2794 func_error
"not configured to extract global symbols from dlpreopened files"
2798 if test -n "$my_dlsyms"; then
2802 # Discover the nlist of each of the dlfiles.
2803 nlist
="$output_objdir/${my_outputname}.nm"
2805 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
2807 # Parse the name list into a source file.
2808 func_verbose
"creating $output_objdir/$my_dlsyms"
2810 $opt_dry_run ||
$ECHO > "$output_objdir/$my_dlsyms" "\
2811 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2812 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2818 /* External symbol declarations for the compiler. */\
2821 if test "$dlself" = yes; then
2822 func_verbose
"generating symbol list for \`$output'"
2824 $opt_dry_run ||
echo ': @PROGRAM@ ' > "$nlist"
2826 # Add our own program objects to the symbol list.
2827 progfiles
=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2828 for progfile
in $progfiles; do
2829 func_verbose
"extracting global C symbols from \`$progfile'"
2830 $opt_dry_run ||
eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2833 if test -n "$exclude_expsyms"; then
2835 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2836 eval '$MV "$nlist"T "$nlist"'
2840 if test -n "$export_symbols_regex"; then
2842 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2843 eval '$MV "$nlist"T "$nlist"'
2847 # Prepare the list of exported symbols
2848 if test -z "$export_symbols"; then
2849 export_symbols
="$output_objdir/$outputname.exp"
2852 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2854 *cygwin
* |
*mingw
* )
2855 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2856 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2862 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2863 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2864 eval '$MV "$nlist"T "$nlist"'
2867 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2868 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2875 for dlprefile
in $dlprefiles; do
2876 func_verbose
"extracting global C symbols from \`$dlprefile'"
2877 func_basename
"$dlprefile"
2878 name
="$func_basename_result"
2880 eval '$ECHO ": $name " >> "$nlist"'
2881 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2886 # Make sure we have at least an empty file.
2887 test -f "$nlist" ||
: > "$nlist"
2889 if test -n "$exclude_expsyms"; then
2890 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2891 $MV "$nlist"T
"$nlist"
2894 # Try sorting and uniquifying the output.
2895 if $GREP -v "^: " < "$nlist" |
2896 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
2901 uniq > "$nlist"S
; then
2904 $GREP -v "^: " < "$nlist" > "$nlist"S
2907 if test -f "$nlist"S
; then
2908 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2910 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2913 $ECHO >> "$output_objdir/$my_dlsyms" "\
2915 /* The mapping between symbol names and symbols. */
2922 *cygwin
* |
*mingw
* )
2923 $ECHO >> "$output_objdir/$my_dlsyms" "\
2924 /* DATA imports from DLLs on WIN32 con't be const, because
2925 runtime relocations are performed -- see ld's documentation
2926 on pseudo-relocs. */"
2929 echo >> "$output_objdir/$my_dlsyms" "\
2930 /* This system does not cope well with relocations in const data */"
2933 lt_dlsym_const
=const
;;
2936 $ECHO >> "$output_objdir/$my_dlsyms" "\
2937 extern $lt_dlsym_const lt_dlsymlist
2938 lt_${my_prefix}_LTX_preloaded_symbols[];
2939 $lt_dlsym_const lt_dlsymlist
2940 lt_${my_prefix}_LTX_preloaded_symbols[] =
2942 { \"$my_originator\", (void *) 0 },"
2944 case $need_lib_prefix in
2946 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2949 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2952 $ECHO >> "$output_objdir/$my_dlsyms" "\
2956 /* This works around a problem in FreeBSD linker */
2957 #ifdef FREEBSD_WORKAROUND
2958 static const void *lt_preloaded_setup() {
2959 return lt_${my_prefix}_LTX_preloaded_symbols;
2969 pic_flag_for_symtable
=
2970 case "$compile_command " in
2974 # compiling the symbol table file with pic_flag works around
2975 # a FreeBSD bug that causes programs to crash when -lm is
2976 # linked before any other PIC object. But we must not use
2977 # pic_flag when linking with -static. The problem exists in
2978 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2979 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
2980 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2982 pic_flag_for_symtable
=" $pic_flag" ;;
2984 if test "X$my_pic_p" != Xno
; then
2985 pic_flag_for_symtable
=" $pic_flag"
2992 for arg
in $LTCFLAGS; do
2994 -pie |
-fpie |
-fPIE) ;;
2995 *) symtab_cflags
="$symtab_cflags $arg" ;;
2999 # Now compile the dynamic symbol file.
3000 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3002 # Clean up the generated files.
3003 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3005 # Transform the symbol file into the correct name.
3006 symfileobj
="$output_objdir/${my_outputname}S.$objext"
3008 *cygwin
* |
*mingw
* )
3009 if test -f "$output_objdir/$my_outputname.def"; then
3010 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3011 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3013 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3014 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3018 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3019 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3024 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
3028 # We keep going just in case the user didn't refer to
3029 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3030 # really was required.
3032 # Nullify the symbol file.
3033 compile_command
=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3034 finalize_command
=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3038 # func_win32_libid arg
3039 # return the library type of file 'arg'
3041 # Need a lot of goo to handle *both* DLLs and import libs
3042 # Has to be a shell function in order to 'eat' the argument
3043 # that is supplied when $file_magic_command is called.
3047 win32_libid_type
="unknown"
3048 win32_fileres
=`file -L $1 2>/dev/null`
3049 case $win32_fileres in
3050 *ar\ archive\ import\ library
*) # definitely import
3051 win32_libid_type
="x86 archive import"
3053 *ar\ archive
*) # could be an import, or static
3054 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null |
3055 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
3056 win32_nmres
=`eval $NM -f posix -A $1 |
3065 case $win32_nmres in
3066 import
*) win32_libid_type
="x86 archive import";;
3067 *) win32_libid_type
="x86 archive static";;
3072 win32_libid_type
="x86 DLL"
3074 *executable
*) # but shell scripts are "executable" too...
3075 case $win32_fileres in
3076 *MS\ Windows\ PE\ Intel
*)
3077 win32_libid_type
="x86 DLL"
3082 $ECHO "$win32_libid_type"
3087 # func_extract_an_archive dir oldlib
3088 func_extract_an_archive
()
3091 f_ex_an_ar_dir
="$1"; shift
3092 f_ex_an_ar_oldlib
="$1"
3093 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
3094 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
3097 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3102 # func_extract_archives gentop oldlib ...
3103 func_extract_archives
()
3106 my_gentop
="$1"; shift
3107 my_oldlibs
=${1+"$@"}
3113 for my_xlib
in $my_oldlibs; do
3114 # Extract the objects.
3116 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
3117 *) my_xabs
=`pwd`"/$my_xlib" ;;
3119 func_basename
"$my_xlib"
3120 my_xlib
="$func_basename_result"
3123 case " $extracted_archives " in
3125 func_arith
$extracted_serial + 1
3126 extracted_serial
=$func_arith_result
3127 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
3131 extracted_archives
="$extracted_archives $my_xlib_u"
3132 my_xdir
="$my_gentop/$my_xlib_u"
3134 func_mkdir_p
"$my_xdir"
3138 func_verbose
"Extracting $my_xabs"
3139 # Do not bother doing anything if just a dry run
3141 darwin_orig_dir
=`pwd`
3142 cd $my_xdir ||
exit $?
3143 darwin_archive
=$my_xabs
3145 darwin_base_archive
=`basename "$darwin_archive"`
3146 darwin_arches
=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3147 if test -n "$darwin_arches"; then
3148 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3150 func_verbose
"$darwin_base_archive has multiple architectures $darwin_arches"
3151 for darwin_arch
in $darwin_arches ; do
3152 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
3153 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3154 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3155 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
3157 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3158 done # $darwin_arches
3159 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3160 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3163 for darwin_file
in $darwin_filelist; do
3164 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
3165 $LIPO -create -output "$darwin_file" $darwin_files
3166 done # $darwin_filelist
3168 cd "$darwin_orig_dir"
3171 func_extract_an_archive
"$my_xdir" "$my_xabs"
3176 func_extract_an_archive
"$my_xdir" "$my_xabs"
3179 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3182 func_extract_archives_result
="$my_oldobjs"
3187 # func_emit_wrapper arg
3189 # emit a libtool wrapper script on stdout
3190 # don't directly open a file because we may want to
3191 # incorporate the script contents within a cygwin/mingw
3192 # wrapper executable. Must ONLY be called from within
3193 # func_mode_link because it depends on a number of variable
3196 # arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3197 # variable will take. If 'yes', then the emitted script
3198 # will assume that the directory in which it is stored is
3199 # the '.lib' directory. This is a cygwin/mingw-specific
3201 func_emit_wrapper
()
3203 func_emit_wrapper_arg1
=no
3204 if test -n "$1" ; then
3205 func_emit_wrapper_arg1
=$1
3211 # $output - temporary wrapper script for $objdir/$outputname
3212 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3214 # The $output program cannot be directly executed until all the libtool
3215 # libraries that it depends on are installed.
3217 # This wrapper script should never be moved out of the build directory.
3218 # If it is, it will not operate correctly.
3220 # Sed substitution that helps us do robust quoting. It backslashifies
3221 # metacharacters that are still active within double-quoted strings.
3222 Xsed='${SED} -e 1s/^X//'
3223 sed_quote_subst='$sed_quote_subst'
3225 # Be Bourne compatible
3226 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3229 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3230 # is contrary to our usage. Disable this feature.
3231 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3232 setopt NO_GLOB_SUBST
3234 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3236 BIN_SH=xpg4; export BIN_SH # for Tru64
3237 DUALCASE=1; export DUALCASE # for MKS sh
3239 # The HP-UX ksh and POSIX shell print the target directory to stdout
3241 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3243 relink_command=\"$relink_command\"
3245 # This environment variable determines our operation mode.
3246 if test \"\$libtool_install_magic\" = \"$magic\"; then
3247 # install mode needs the following variables:
3248 generated_by_libtool_version='$macro_version'
3249 notinst_deplibs='$notinst_deplibs'
3251 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3252 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3255 # Make sure echo works.
3256 if test \"X\$1\" = X--no-reexec; then
3257 # Discard the --no-reexec flag, and continue.
3259 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
3260 # Yippee, \$ECHO works!
3263 # Restart under the correct shell, and then maybe \$ECHO will work.
3264 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3270 # Find the directory that this script lives in.
3271 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3272 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3274 # Follow symbolic links until we get to the real thisdir.
3275 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3276 while test -n \"\$file\"; do
3277 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3279 # If there was a directory component, then change thisdir.
3280 if test \"x\$destdir\" != \"x\$file\"; then
3281 case \"\$destdir\" in
3282 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3283 *) thisdir=\"\$thisdir/\$destdir\" ;;
3287 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3288 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3291 # Usually 'no', except on cygwin/mingw when embedded into
3293 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
3294 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3295 # special case for '.'
3296 if test \"\$thisdir\" = \".\"; then
3299 # remove .libs from thisdir
3300 case \"\$thisdir\" in
3301 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
3302 $objdir ) thisdir=. ;;
3306 # Try to get the absolute directory name.
3307 absdir=\`cd \"\$thisdir\" && pwd\`
3308 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3311 if test "$fast_install" = yes; then
3313 program=lt-'$outputname'$exeext
3314 progdir=\"\$thisdir/$objdir\"
3316 if test ! -f \"\$progdir/\$program\" ||
3317 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3318 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3320 file=\"\$\$-\$program\"
3322 if test ! -d \"\$progdir\"; then
3323 $MKDIR \"\$progdir\"
3325 $RM \"\$progdir/\$file\"
3330 # relink executable if necessary
3331 if test -n \"\$relink_command\"; then
3332 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3334 $ECHO \"\$relink_command_output\" >&2
3335 $RM \"\$progdir/\$file\"
3340 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3341 { $RM \"\$progdir/\$program\";
3342 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3343 $RM \"\$progdir/\$file\"
3347 program='$outputname'
3348 progdir=\"\$thisdir/$objdir\"
3354 if test -f \"\$progdir/\$program\"; then"
3356 # Export our shlibpath_var if we have one.
3357 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3359 # Add our own library path to $shlibpath_var
3360 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3362 # Some systems cannot cope with colon-terminated $shlibpath_var
3363 # The second colon is a workaround for a bug in BeOS R4 sed
3364 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3366 export $shlibpath_var
3370 # fixup the dll searchpath if we need to.
3371 if test -n "$dllsearchpath"; then
3373 # Add the dll search path components to the executable PATH
3374 PATH=$dllsearchpath:\$PATH
3379 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3380 # Run the actual program with our arguments.
3383 # Backslashes separate directories on plain windows
3384 *-*-mingw |
*-*-os2*)
3386 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3392 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3397 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3401 # The program doesn't exist.
3402 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3403 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3404 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3410 # end: func_emit_wrapper
3412 # func_emit_cwrapperexe_src
3413 # emit the source code for a wrapper executable on stdout
3414 # Must ONLY be called from within func_mode_link because
3415 # it depends on a number of variable set therein.
3416 func_emit_cwrapperexe_src
()
3420 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3421 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3423 The $output program cannot be directly executed until all the libtool
3424 libraries that it depends on are installed.
3426 This wrapper executable should never be moved out of the build directory.
3427 If it is, it will not operate correctly.
3429 Currently, it simply execs the wrapper *script* "$SHELL $output",
3430 but could eventually absorb all of the scripts functionality and
3431 exec $objdir/$outputname directly.
3438 # include <direct.h>
3439 # include <process.h>
3441 # define setmode _setmode
3443 # include <unistd.h>
3444 # include <stdint.h>
3456 #include <sys/stat.h>
3458 #if defined(PATH_MAX)
3459 # define LT_PATHMAX PATH_MAX
3460 #elif defined(MAXPATHLEN)
3461 # define LT_PATHMAX MAXPATHLEN
3463 # define LT_PATHMAX 1024
3474 # define S_IXUSR _S_IEXEC
3476 # ifndef _INTPTR_T_DEFINED
3477 # define intptr_t int
3481 #ifndef DIR_SEPARATOR
3482 # define DIR_SEPARATOR '/'
3483 # define PATH_SEPARATOR ':'
3486 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3488 # define HAVE_DOS_BASED_FILE_SYSTEM
3489 # define FOPEN_WB "wb"
3490 # ifndef DIR_SEPARATOR_2
3491 # define DIR_SEPARATOR_2 '\\'
3493 # ifndef PATH_SEPARATOR_2
3494 # define PATH_SEPARATOR_2 ';'
3498 #ifndef DIR_SEPARATOR_2
3499 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3500 #else /* DIR_SEPARATOR_2 */
3501 # define IS_DIR_SEPARATOR(ch) \
3502 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3503 #endif /* DIR_SEPARATOR_2 */
3505 #ifndef PATH_SEPARATOR_2
3506 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3507 #else /* PATH_SEPARATOR_2 */
3508 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3509 #endif /* PATH_SEPARATOR_2 */
3512 # define FOPEN_WB "wb"
3516 # define FOPEN_WB "w"
3519 # define _O_BINARY 0
3522 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3523 #define XFREE(stale) do { \
3524 if (stale) { free ((void *) stale); stale = 0; } \
3527 #undef LTWRAPPER_DEBUGPRINTF
3528 #if defined DEBUGWRAPPER
3529 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3531 ltwrapper_debugprintf (const char *fmt, ...)
3534 va_start (args, fmt);
3535 (void) vfprintf (stderr, fmt, args);
3539 # define LTWRAPPER_DEBUGPRINTF(args)
3542 const char *program_name = NULL;
3544 void *xmalloc (size_t num);
3545 char *xstrdup (const char *string);
3546 const char *base_name (const char *name);
3547 char *find_executable (const char *wrapper);
3548 char *chase_symlinks (const char *pathspec);
3549 int make_executable (const char *path);
3550 int check_executable (const char *path);
3551 char *strendzap (char *str, const char *pat);
3552 void lt_fatal (const char *message, ...);
3554 static const char *script_text =
3557 func_emit_wrapper yes |
3558 $SED -e 's/\([\\"]\)/\\\1/g' \
3559 -e 's/^/ "/' -e 's/$/\\n"/'
3563 const char * MAGIC_EXE = "$magic_exe";
3566 main (int argc, char *argv[])
3570 char *actual_cwrapper_path;
3571 char *shwrapper_name;
3572 intptr_t rval = 127;
3575 const char *dumpscript_opt = "--lt-dump-script";
3578 program_name = (char *) xstrdup (base_name (argv[0]));
3579 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3580 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3582 /* very simple arg parsing; don't want to rely on getopt */
3583 for (i = 1; i < argc; i++)
3585 if (strcmp (argv[i], dumpscript_opt) == 0)
3589 *mingw* | *cygwin* )
3590 # make stdout use "unix" line endings
3591 echo " setmode(1,_O_BINARY);"
3596 printf ("%s", script_text);
3601 newargz = XMALLOC (char *, argc + 2);
3604 if test -n "$TARGETSHELL" ; then
3605 # no path translation at all
3606 lt_newargv0=$TARGETSHELL
3610 # awkward: cmd appends spaces to result
3611 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3612 lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`
3613 case $lt_newargv0 in
3615 *) lt_newargv0=$lt_newargv0.exe ;;
3618 * ) lt_newargv0=$SHELL ;;
3623 newargz[0] = (char *) xstrdup ("$lt_newargv0");
3627 tmp_pathspec
= find_executable
(argv
[0]);
3628 if (tmp_pathspec
== NULL
)
3629 lt_fatal
("Couldn't find %s", argv
[0]);
3630 LTWRAPPER_DEBUGPRINTF
(("(main) found exe (before symlink chase) at : %s\n",
3633 actual_cwrapper_path
= chase_symlinks
(tmp_pathspec
);
3634 LTWRAPPER_DEBUGPRINTF
(("(main) found exe (after symlink chase) at : %s\n",
3635 actual_cwrapper_path
));
3636 XFREE
(tmp_pathspec
);
3638 shwrapper_name
= (char
*) xstrdup
(base_name
(actual_cwrapper_path
));
3639 strendzap
(actual_cwrapper_path
, shwrapper_name
);
3641 /* shwrapper_name transforms
*/
3642 strendzap
(shwrapper_name
, ".exe");
3643 tmp_pathspec
= XMALLOC
(char
, (strlen
(shwrapper_name
) +
3644 strlen
("_ltshwrapperTMP") + 1));
3645 strcpy
(tmp_pathspec
, shwrapper_name
);
3646 strcat
(tmp_pathspec
, "_ltshwrapperTMP");
3647 XFREE
(shwrapper_name
);
3648 shwrapper_name
= tmp_pathspec
;
3650 LTWRAPPER_DEBUGPRINTF
(("(main) libtool shell wrapper name: %s\n",
3656 XMALLOC (char, (strlen (actual_cwrapper_path) +
3657 strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));
3658 strcpy (newargz[1], actual_cwrapper_path);
3659 strcat (newargz[1], "$objdir");
3660 strcat (newargz[1], "/");
3661 strcat (newargz[1], shwrapper_name);
3670 while ((p = strchr (newargz[1], '\\')) != NULL)
3680 XFREE
(shwrapper_name
);
3681 XFREE
(actual_cwrapper_path
);
3683 /* always
write in binary mode
*/
3684 if ((shwrapper
= fopen
(newargz
[1], FOPEN_WB
)) == 0)
3686 lt_fatal
("Could not open %s for writing", newargz
[1]);
3688 fprintf
(shwrapper
, "%s", script_text
);
3691 make_executable
(newargz
[1]);
3693 for (i
= 1; i
< argc
; i
++)
3694 newargz
[i
+ 1] = xstrdup
(argv
[i
]);
3695 newargz
[argc
+ 1] = NULL
;
3697 for (i
= 0; i
< argc
+ 1; i
++)
3699 LTWRAPPER_DEBUGPRINTF
(("(main) newargz[%d] : %s\n", i
, newargz
[i
]));
3707 /* execv doesn't actually work on mingw as expected on unix */
3708 rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);
3711 /* failed to start process */
3712 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno));
3721 execv ("$lt_newargv0", newargz);
3722 return rval; /* =127, but avoids unused variable warning */
3731 xmalloc (size_t num)
3733 void *p = (void *) malloc (num);
3735 lt_fatal ("Memory exhausted");
3741 xstrdup (const char *string)
3743 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3748 base_name (const char *name)
3752 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3753 /* Skip over the disk name in MSDOS pathnames. */
3754 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3758 for (base = name; *name; name++)
3759 if (IS_DIR_SEPARATOR (*name))
3765 check_executable (const char *path)
3769 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3770 path ? (*path ? path : "EMPTY!") : "NULL!"));
3771 if ((!path) || (!*path))
3774 if ((stat (path, &st) >= 0)
3775 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3782 make_executable (const char *path)
3787 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3788 path ? (*path ? path : "EMPTY!") : "NULL!"));
3789 if ((!path) || (!*path))
3792 if (stat (path, &st) >= 0)
3794 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3799 /* Searches for the full path of the wrapper. Returns
3800 newly allocated full path name if found, NULL otherwise
3801 Does not chase symlinks, even on platforms that support them.
3804 find_executable (const char *wrapper)
3809 /* static buffer for getcwd */
3810 char tmp[LT_PATHMAX + 1];
3814 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3815 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3817 if ((wrapper == NULL) || (*wrapper == '\0'))
3820 /* Absolute path? */
3821 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3822 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3824 concat_name = xstrdup (wrapper);
3825 if (check_executable (concat_name))
3827 XFREE (concat_name);
3832 if (IS_DIR_SEPARATOR (wrapper[0]))
3834 concat_name = xstrdup (wrapper);
3835 if (check_executable (concat_name))
3837 XFREE (concat_name);
3839 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3843 for (p = wrapper; *p; p++)
3851 /* no slashes; search PATH */
3852 const char *path = getenv ("PATH");
3855 for (p = path; *p; p = p_next)
3859 for (q = p; *q; q++)
3860 if (IS_PATH_SEPARATOR (*q))
3863 p_next = (*q == '\0' ? q : q + 1);
3866 /* empty path: current directory */
3867 if (getcwd (tmp, LT_PATHMAX) == NULL)
3868 lt_fatal ("getcwd failed");
3869 tmp_len = strlen (tmp);
3871 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3872 memcpy (concat_name, tmp, tmp_len);
3873 concat_name[tmp_len] = '/';
3874 strcpy (concat_name + tmp_len + 1, wrapper);
3879 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3880 memcpy (concat_name, p, p_len);
3881 concat_name[p_len] = '/';
3882 strcpy (concat_name + p_len + 1, wrapper);
3884 if (check_executable (concat_name))
3886 XFREE (concat_name);
3889 /* not found in PATH; assume curdir */
3891 /* Relative path | not found in path: prepend cwd */
3892 if (getcwd (tmp, LT_PATHMAX) == NULL)
3893 lt_fatal ("getcwd failed");
3894 tmp_len = strlen (tmp);
3895 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3896 memcpy (concat_name, tmp, tmp_len);
3897 concat_name[tmp_len] = '/';
3898 strcpy (concat_name + tmp_len + 1, wrapper);
3900 if (check_executable (concat_name))
3902 XFREE (concat_name);
3907 chase_symlinks (const char *pathspec)
3910 return xstrdup (pathspec);
3912 char buf[LT_PATHMAX];
3914 char *tmp_pathspec = xstrdup (pathspec);
3916 int has_symlinks = 0;
3917 while (strlen (tmp_pathspec) && !has_symlinks)
3919 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3921 if (lstat (tmp_pathspec, &s) == 0)
3923 if (S_ISLNK (s.st_mode) != 0)
3929 /* search backwards for last DIR_SEPARATOR */
3930 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3931 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3933 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3935 /* no more DIR_SEPARATORS left */
3942 char *errstr = strerror (errno);
3943 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3946 XFREE (tmp_pathspec);
3950 return xstrdup (pathspec);
3953 tmp_pathspec = realpath (pathspec, buf);
3954 if (tmp_pathspec == 0)
3956 lt_fatal ("Could not follow symlinks for %s", pathspec);
3958 return xstrdup (tmp_pathspec);
3963 strendzap (char *str, const char *pat)
3967 assert (str != NULL);
3968 assert (pat != NULL);
3971 patlen = strlen (pat);
3975 str += len - patlen;
3976 if (strcmp (str, pat) == 0)
3983 lt_error_core (int exit_status, const char *mode,
3984 const char *message, va_list ap)
3986 fprintf (stderr, "%s: %s: ", program_name, mode);
3987 vfprintf (stderr, message, ap);
3988 fprintf (stderr, ".\n");
3990 if (exit_status >= 0)
3995 lt_fatal (const char *message, ...)
3998 va_start (ap, message);
3999 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4004 # end: func_emit_cwrapperexe_src
4006 # func_mode_link arg...
4011 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4012 # It is impossible to link a dll without this setting, and
4013 # we shouldn't force the makefile maintainer to figure out
4014 # which system we are compiling for in order to pass an extra
4015 # flag for every libtool invocation.
4016 # allow_undefined=no
4018 # FIXME: Unfortunately, there are problems with the above when trying
4019 # to make a dll which has undefined symbols, in which case not
4020 # even a static library is built. For now, we need to specify
4021 # -no-undefined on the libtool link line when we can be certain
4022 # that all symbols are satisfied, otherwise we get a static library.
4029 libtool_args=$nonopt
4030 base_compile="$nonopt $@"
4031 compile_command=$nonopt
4032 finalize_command=$nonopt
4045 lib_search_path=`pwd`
4047 new_inherited_linker_flags=
4055 export_symbols_regex=
4063 precious_files_regex=
4064 prefer_static_libs=no
4077 single_module="${wl}-single_module"
4078 func_infer_tag $base_compile
4080 # We need to know -static, to get the right output filenames.
4085 test "$build_libtool_libs" != yes && \
4086 func_fatal_configuration "can not build a shared library"
4090 -all-static | -static | -static-libtool-libs)
4093 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4094 func_warning "complete static linking is impossible in this configuration"
4096 if test -n "$link_static_flag"; then
4097 dlopen_self=$dlopen_self_static
4099 prefer_static_libs=yes
4102 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4103 dlopen_self=$dlopen_self_static
4105 prefer_static_libs=built
4107 -static-libtool-libs)
4108 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4109 dlopen_self=$dlopen_self_static
4111 prefer_static_libs=yes
4114 build_libtool_libs=no
4121 # See if our shared archives depend on static archives.
4122 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4124 # Go through the arguments, transforming them on the way.
4125 while test "$#" -gt 0; do
4128 func_quote_for_eval "$arg"
4129 qarg=$func_quote_for_eval_unquoted_result
4130 func_append libtool_args " $func_quote_for_eval_result"
4132 # If the previous option needs an argument, assign it.
4133 if test -n "$prev"; then
4136 func_append compile_command " @OUTPUT@"
4137 func_append finalize_command " @OUTPUT@"
4143 if test "$preload" = no; then
4144 # Add the symbol object into the linking commands.
4145 func_append compile_command " @SYMFILE@"
4146 func_append finalize_command " @SYMFILE@"
4150 *.la | *.lo) ;; # We handle these cases below.
4152 if test "$dlself" = no; then
4160 if test "$prev" = dlprefiles; then
4162 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4172 if test "$prev" = dlfiles; then
4173 dlfiles="$dlfiles $arg"
4175 dlprefiles="$dlprefiles $arg"
4183 export_symbols="$arg"
4185 || func_fatal_error "symbol file \`$arg' does not exist"
4190 export_symbols_regex="$arg"
4198 *" $qarg.ltframework "*) ;;
4199 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4208 inst_prefix_dir="$arg"
4213 if test -f "$arg"; then
4216 for fil in `cat "$save_arg"`
4218 # moreargs="$moreargs $fil"
4220 # A libtool-controlled object.
4222 # Check to see that this really is a libtool object.
4223 if func_lalib_unsafe_p "$arg"; then
4230 if test -z "$pic_object" ||
4231 test -z "$non_pic_object" ||
4232 test "$pic_object" = none &&
4233 test "$non_pic_object" = none; then
4234 func_fatal_error "cannot find name of object for \`$arg'"
4237 # Extract subdirectory from the argument.
4238 func_dirname "$arg" "/" ""
4239 xdir="$func_dirname_result"
4241 if test "$pic_object" != none; then
4242 # Prepend the subdirectory the object is found in.
4243 pic_object="$xdir$pic_object"
4245 if test "$prev" = dlfiles; then
4246 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4247 dlfiles="$dlfiles $pic_object"
4251 # If libtool objects are unsupported, then we need to preload.
4256 # CHECK ME: I think I busted this. -Ossama
4257 if test "$prev" = dlprefiles; then
4258 # Preload the old-style object.
4259 dlprefiles="$dlprefiles $pic_object"
4264 func_append libobjs " $pic_object"
4269 if test "$non_pic_object" != none; then
4270 # Prepend the subdirectory the object is found in.
4271 non_pic_object="$xdir$non_pic_object"
4273 # A standard non-PIC object
4274 func_append non_pic_objects " $non_pic_object"
4275 if test -z "$pic_object" || test "$pic_object" = none ; then
4276 arg="$non_pic_object"
4279 # If the PIC object exists, use it instead.
4280 # $xdir was prepended to $pic_object above.
4281 non_pic_object="$pic_object"
4282 func_append non_pic_objects " $non_pic_object"
4285 # Only an error if not doing a dry-run.
4286 if $opt_dry_run; then
4287 # Extract subdirectory from the argument.
4288 func_dirname "$arg" "/" ""
4289 xdir="$func_dirname_result"
4292 pic_object=$xdir$objdir/$func_lo2o_result
4293 non_pic_object=$xdir$func_lo2o_result
4294 func_append libobjs " $pic_object"
4295 func_append non_pic_objects " $non_pic_object"
4297 func_fatal_error "\`$arg' is not a valid libtool object"
4302 func_fatal_error "link input file \`$arg' does not exist"
4309 precious_files_regex="$arg"
4319 # We need an absolute path.
4321 [\\/]* | [A-Za-z]:[\\/]*) ;;
4323 func_fatal_error "only absolute run-paths are allowed"
4326 if test "$prev" = rpath; then
4329 *) rpath="$rpath $arg" ;;
4334 *) xrpath="$xrpath $arg" ;;
4346 weak_libs="$weak_libs $arg"
4351 linker_flags="$linker_flags $qarg"
4352 compiler_flags="$compiler_flags $qarg"
4354 func_append compile_command " $qarg"
4355 func_append finalize_command " $qarg"
4359 compiler_flags="$compiler_flags $qarg"
4361 func_append compile_command " $qarg"
4362 func_append finalize_command " $qarg"
4366 linker_flags="$linker_flags $qarg"
4367 compiler_flags="$compiler_flags $wl$qarg"
4369 func_append compile_command " $wl$qarg"
4370 func_append finalize_command " $wl$qarg"
4374 eval "$prev=\"\$arg\""
4379 fi # test -n "$prev"
4385 if test -n "$link_static_flag"; then
4386 # See comment for -static flag below, for more details.
4387 func_append compile_command " $link_static_flag"
4388 func_append finalize_command " $link_static_flag"
4394 # FIXME: remove this flag sometime in the future.
4395 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4418 -export-symbols | -export-symbols-regex)
4419 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4420 func_fatal_error "more than one -exported-symbols argument is not allowed"
4422 if test "X$arg" = "X-export-symbols"; then
4440 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4441 # so, if we see these flags be careful not to treat them like -L
4443 case $with_gcc/$host in
4444 no/*-*-irix* | /*-*-irix*)
4445 func_append compile_command " $arg"
4446 func_append finalize_command " $arg"
4453 func_stripname '-L' '' "$arg"
4454 dir=$func_stripname_result
4455 # We need an absolute path.
4457 [\\/]* | [A-Za-z]:[\\/]*) ;;
4459 absdir=`cd "$dir" && pwd`
4460 test -z "$absdir" && \
4461 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4468 deplibs="$deplibs -L$dir"
4469 lib_search_path="$lib_search_path $dir"
4473 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4474 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4475 case :$dllsearchpath: in
4477 *) dllsearchpath="$dllsearchpath:$dir";;
4479 case :$dllsearchpath: in
4480 *":$testbindir:"*) ;;
4481 *) dllsearchpath="$dllsearchpath:$testbindir";;
4489 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4491 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
4492 # These systems don't actually have a C or math library (as such)
4496 # These systems don't actually have a C library (as such)
4497 test "X$arg" = "X-lc" && continue
4499 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4500 # Do not include libc due to us having libc/libc_r.
4501 test "X$arg" = "X-lc" && continue
4503 *-*-rhapsody* | *-*-darwin1.[012])
4504 # Rhapsody C and math libraries are in the System framework
4505 deplibs="$deplibs System.ltframework"
4508 *-*-sco3.2v5* | *-*-sco5v6*)
4509 # Causes problems with __ctype
4510 test "X$arg" = "X-lc" && continue
4512 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4513 # Compiler inserts libc in the correct place for threads to work
4514 test "X$arg" = "X-lc" && continue
4517 elif test "X$arg" = "X-lc_r"; then
4519 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4520 # Do not include libc_r directly, use -pthread flag.
4525 deplibs="$deplibs $arg"
4534 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4535 # classes, name mangling, and exception handling.
4536 # Darwin uses the -arch flag to determine output architecture.
4537 -model|-arch|-isysroot)
4538 compiler_flags="$compiler_flags $arg"
4539 func_append compile_command " $arg"
4540 func_append finalize_command " $arg"
4545 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4546 compiler_flags="$compiler_flags $arg"
4547 func_append compile_command " $arg"
4548 func_append finalize_command " $arg"
4549 case "$new_inherited_linker_flags " in
4551 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4557 single_module="${wl}-multi_module"
4568 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
4569 # The PATH hackery in wrapper scripts is required on Windows
4570 # and Darwin in order for the loader to find any dlls it needs.
4571 func_warning "\`-no-install' is ignored for $host"
4572 func_warning "assuming \`-no-fast-install' instead"
4575 *) no_install=yes ;;
4592 -precious-files-regex)
4613 func_stripname '-R' '' "$arg"
4614 dir=$func_stripname_result
4615 # We need an absolute path.
4617 [\\/]* | [A-Za-z]:[\\/]*) ;;
4619 func_fatal_error "only absolute run-paths are allowed"
4624 *) xrpath="$xrpath $dir" ;;
4630 # The effects of -shared are defined in a previous loop.
4639 -static | -static-libtool-libs)
4640 # The effects of -static are defined in a previous loop.
4641 # We used to do the same as -all-static on platforms that
4642 # didn't have a PIC flag, but the assumption that the effects
4643 # would be equivalent was wrong. It would break on at least
4644 # Digital Unix and AIX.
4670 func_stripname '-Wc,' '' "$arg"
4671 args=$func_stripname_result
4673 save_ifs="$IFS"; IFS=','
4674 for flag in $args; do
4676 func_quote_for_eval "$flag"
4677 arg="$arg $wl$func_quote_for_eval_result"
4678 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4681 func_stripname ' ' '' "$arg"
4682 arg=$func_stripname_result
4686 func_stripname '-Wl,' '' "$arg"
4687 args=$func_stripname_result
4689 save_ifs="$IFS"; IFS=','
4690 for flag in $args; do
4692 func_quote_for_eval "$flag"
4693 arg="$arg $wl$func_quote_for_eval_result"
4694 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4695 linker_flags="$linker_flags $func_quote_for_eval_result"
4698 func_stripname ' ' '' "$arg"
4699 arg=$func_stripname_result
4719 func_quote_for_eval "$arg"
4720 arg="$func_quote_for_eval_result"
4723 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4724 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4725 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4726 # +DA*, +DD* enable 64-bit mode on the HP compiler
4727 # -q* pass through compiler args for the IBM compiler
4728 # -m*, -t[45]*, -txscale* pass through architecture-specific
4729 # compiler args for GCC
4730 # -F/path gives path to uninstalled frameworks, gcc on darwin
4731 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4732 # @file GCC response files
4733 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4734 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4735 func_quote_for_eval "$arg"
4736 arg="$func_quote_for_eval_result"
4737 func_append compile_command " $arg"
4738 func_append finalize_command " $arg"
4739 compiler_flags="$compiler_flags $arg"
4743 # Some other compiler flag.
4745 func_quote_for_eval "$arg"
4746 arg="$func_quote_for_eval_result"
4750 # A standard object.
4755 # A libtool-controlled object.
4757 # Check to see that this really is a libtool object.
4758 if func_lalib_unsafe_p "$arg"; then
4765 if test -z "$pic_object" ||
4766 test -z "$non_pic_object" ||
4767 test "$pic_object" = none &&
4768 test "$non_pic_object" = none; then
4769 func_fatal_error "cannot find name of object for \`$arg'"
4772 # Extract subdirectory from the argument.
4773 func_dirname "$arg" "/" ""
4774 xdir="$func_dirname_result"
4776 if test "$pic_object" != none; then
4777 # Prepend the subdirectory the object is found in.
4778 pic_object="$xdir$pic_object"
4780 if test "$prev" = dlfiles; then
4781 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4782 dlfiles="$dlfiles $pic_object"
4786 # If libtool objects are unsupported, then we need to preload.
4791 # CHECK ME: I think I busted this. -Ossama
4792 if test "$prev" = dlprefiles; then
4793 # Preload the old-style object.
4794 dlprefiles="$dlprefiles $pic_object"
4799 func_append libobjs " $pic_object"
4804 if test "$non_pic_object" != none; then
4805 # Prepend the subdirectory the object is found in.
4806 non_pic_object="$xdir$non_pic_object"
4808 # A standard non-PIC object
4809 func_append non_pic_objects " $non_pic_object"
4810 if test -z "$pic_object" || test "$pic_object" = none ; then
4811 arg="$non_pic_object"
4814 # If the PIC object exists, use it instead.
4815 # $xdir was prepended to $pic_object above.
4816 non_pic_object="$pic_object"
4817 func_append non_pic_objects " $non_pic_object"
4820 # Only an error if not doing a dry-run.
4821 if $opt_dry_run; then
4822 # Extract subdirectory from the argument.
4823 func_dirname "$arg" "/" ""
4824 xdir="$func_dirname_result"
4827 pic_object=$xdir$objdir/$func_lo2o_result
4828 non_pic_object=$xdir$func_lo2o_result
4829 func_append libobjs " $pic_object"
4830 func_append non_pic_objects " $non_pic_object"
4832 func_fatal_error "\`$arg' is not a valid libtool object"
4839 deplibs="$deplibs $arg"
4840 old_deplibs="$old_deplibs $arg"
4845 # A libtool-controlled library.
4847 if test "$prev" = dlfiles; then
4848 # This library was specified with -dlopen.
4849 dlfiles="$dlfiles $arg"
4851 elif test "$prev" = dlprefiles; then
4852 # The library was specified with -dlpreopen.
4853 dlprefiles="$dlprefiles $arg"
4856 deplibs="$deplibs $arg"
4861 # Some other compiler argument.
4863 # Unknown arguments in both finalize_command and compile_command need
4864 # to be aesthetically quoted because they are evaled later.
4865 func_quote_for_eval "$arg"
4866 arg="$func_quote_for_eval_result"
4870 # Now actually substitute the argument into the commands.
4871 if test -n "$arg"; then
4872 func_append compile_command " $arg"
4873 func_append finalize_command " $arg"
4875 done # argument parsing loop
4877 test -n "$prev" && \
4878 func_fatal_help "the \`$prevarg' option requires an argument"
4880 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4881 eval arg=\"$export_dynamic_flag_spec\"
4882 func_append compile_command " $arg"
4883 func_append finalize_command " $arg"
4887 # calculate the name of the file, without its directory
4888 func_basename "$output"
4889 outputname="$func_basename_result"
4890 libobjs_save="$libobjs"
4892 if test -n "$shlibpath_var"; then
4893 # get the directories listed in $shlibpath_var
4894 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4898 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4899 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4901 func_dirname "$output" "/" ""
4902 output_objdir="$func_dirname_result$objdir"
4903 # Create the object directory.
4904 func_mkdir_p "$output_objdir"
4906 # Determine the type of output
4909 func_fatal_help "you must specify an output file"
4911 *.$libext) linkmode=oldlib ;;
4912 *.lo | *.$objext) linkmode=obj ;;
4913 *.la) linkmode=lib ;;
4914 *) linkmode=prog ;; # Anything else should be a program.
4920 # Find all interdependent deplibs by searching for libraries
4921 # that are linked more than once (e.g. -la -lb -la)
4922 for deplib in $deplibs; do
4923 if $opt_duplicate_deps ; then
4925 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4928 libs="$libs $deplib"
4931 if test "$linkmode" = lib; then
4932 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4934 # Compute libraries that are listed more than once in $predeps
4935 # $postdeps and mark them as special (i.e., whose duplicates are
4936 # not to be eliminated).
4938 if $opt_duplicate_compiler_generated_deps; then
4939 for pre_post_dep in $predeps $postdeps; do
4940 case "$pre_post_deps " in
4941 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4943 pre_post_deps="$pre_post_deps $pre_post_dep"
4952 need_relink=no # whether we're linking any uninstalled libtool libraries
4953 notinst_deplibs= # not-installed libtool libraries
4954 notinst_path= # paths that contain not-installed libtool libraries
4958 passes="conv dlpreopen link"
4959 for file in $dlfiles $dlprefiles; do
4963 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4974 passes="conv scan dlopen dlpreopen link"
4980 for pass in $passes; do
4981 # The preopen pass in lib mode reverses $deplibs; put it back here
4982 # so that -L comes before libs that need it for instance...
4983 if test "$linkmode,$pass" = "lib,link"; then
4984 ## FIXME: Find the place where the list is rebuilt in the wrong
4985 ## order, and fix it there properly
4987 for deplib in $deplibs; do
4988 tmp_deplibs="$deplib $tmp_deplibs"
4990 deplibs="$tmp_deplibs"
4993 if test "$linkmode,$pass" = "lib,link" ||
4994 test "$linkmode,$pass" = "prog,scan"; then
4998 if test "$linkmode" = prog; then
5000 dlopen) libs="$dlfiles" ;;
5001 dlpreopen) libs="$dlprefiles" ;;
5002 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5005 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5006 # Collect and forward deplibs of preopened libtool libs
5007 for lib in $dlprefiles; do
5008 # Ignore non-libtool-libs
5011 *.la) func_source "$lib" ;;
5014 # Collect preopened libtool deplibs, except any this library
5015 # has declared as weak libs
5016 for deplib in $dependency_libs; do
5017 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5018 case " $weak_libs " in
5019 *" $deplib_base "*) ;;
5020 *) deplibs="$deplibs $deplib" ;;
5026 if test "$pass" = dlopen; then
5027 # Collect dlpreopened libraries
5028 save_deplibs="$deplibs"
5032 for deplib in $libs; do
5036 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5037 if test "$linkmode,$pass" = "prog,link"; then
5038 compile_deplibs="$deplib $compile_deplibs"
5039 finalize_deplibs="$deplib $finalize_deplibs"
5041 compiler_flags="$compiler_flags $deplib"
5042 if test "$linkmode" = lib ; then
5043 case "$new_inherited_linker_flags " in
5045 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5052 if test "$linkmode" != lib && test "$linkmode" != prog; then
5053 func_warning "\`-l' is ignored for archives/objects"
5056 func_stripname '-l' '' "$deplib"
5057 name=$func_stripname_result
5058 if test "$linkmode" = lib; then
5059 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5061 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5063 for searchdir in $searchdirs; do
5064 for search_ext in .la $std_shrext .so .a; do
5065 # Search the libtool library
5066 lib="$searchdir/lib${name}${search_ext}"
5067 if test -f "$lib"; then
5068 if test "$search_ext" = ".la"; then
5077 if test "$found" != yes; then
5078 # deplib doesn't seem to be a libtool library
5079 if test "$linkmode,$pass" = "prog,link"; then
5080 compile_deplibs="$deplib $compile_deplibs"
5081 finalize_deplibs="$deplib $finalize_deplibs"
5083 deplibs="$deplib $deplibs"
5084 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5087 else # deplib is a libtool library
5088 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5089 # We need to do some special things here, and not later.
5090 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5091 case " $predeps $postdeps " in
5093 if func_lalib_p "$lib"; then
5097 for l in $old_library $library_names; do
5100 if test "X$ll" = "X$old_library" ; then # only static version available
5102 func_dirname "$lib" "" "."
5103 ladir="$func_dirname_result"
5104 lib=$ladir/$old_library
5105 if test "$linkmode,$pass" = "prog,link"; then
5106 compile_deplibs="$deplib $compile_deplibs"
5107 finalize_deplibs="$deplib $finalize_deplibs"
5109 deplibs="$deplib $deplibs"
5110 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5122 if test "$linkmode,$pass" = "prog,link"; then
5123 compile_deplibs="$deplib $compile_deplibs"
5124 finalize_deplibs="$deplib $finalize_deplibs"
5126 deplibs="$deplib $deplibs"
5127 if test "$linkmode" = lib ; then
5128 case "$new_inherited_linker_flags " in
5130 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5139 deplibs="$deplib $deplibs"
5140 test "$pass" = conv && continue
5141 newdependency_libs="$deplib $newdependency_libs"
5142 func_stripname '-L' '' "$deplib"
5143 newlib_search_path="$newlib_search_path $func_stripname_result"
5146 if test "$pass" = conv; then
5147 deplibs="$deplib $deplibs"
5150 if test "$pass" = scan; then
5151 deplibs="$deplib $deplibs"
5153 compile_deplibs="$deplib $compile_deplibs"
5154 finalize_deplibs="$deplib $finalize_deplibs"
5156 func_stripname '-L' '' "$deplib"
5157 newlib_search_path="$newlib_search_path $func_stripname_result"
5160 func_warning "\`-L' is ignored for archives/objects"
5166 if test "$pass" = link; then
5167 func_stripname '-R' '' "$deplib"
5168 dir=$func_stripname_result
5169 # Make sure the xrpath contains only unique directories.
5172 *) xrpath="$xrpath $dir" ;;
5175 deplibs="$deplib $deplibs"
5178 *.la) lib="$deplib" ;;
5180 if test "$pass" = conv; then
5181 deplibs="$deplib $deplibs"
5186 # Linking convenience modules into shared libraries is allowed,
5187 # but linking other static libraries is non-portable.
5188 case " $dlpreconveniencelibs " in
5192 case $deplibs_check_method in
5194 set dummy $deplibs_check_method; shift
5195 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5196 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5197 | $EGREP "$match_pattern_regex" > /dev/null; then
5205 if test "$valid_a_lib" != yes; then
5207 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5208 $ECHO "*** I have the capability to make that library automatically link in when"
5209 $ECHO "*** you link to this library. But I can only do this if you have a"
5210 $ECHO "*** shared version of the library, which you do not appear to have"
5211 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5212 $ECHO "*** that it is just a static archive that I should not use here."
5215 $ECHO "*** Warning: Linking the shared library $output against the"
5216 $ECHO "*** static library $deplib is not portable!"
5217 deplibs="$deplib $deplibs"
5224 if test "$pass" != link; then
5225 deplibs="$deplib $deplibs"
5227 compile_deplibs="$deplib $compile_deplibs"
5228 finalize_deplibs="$deplib $finalize_deplibs"
5235 if test "$pass" = conv; then
5236 deplibs="$deplib $deplibs"
5237 elif test "$linkmode" = prog; then
5238 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5239 # If there is no dlopen support or we're linking statically,
5240 # we need to preload.
5241 newdlprefiles="$newdlprefiles $deplib"
5242 compile_deplibs="$deplib $compile_deplibs"
5243 finalize_deplibs="$deplib $finalize_deplibs"
5245 newdlfiles="$newdlfiles $deplib"
5256 if test "$found" = yes || test -f "$lib"; then :
5258 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5261 # Check to see that this really is a libtool archive.
5262 func_lalib_unsafe_p "$lib" \
5263 || func_fatal_error "\`$lib' is not a valid libtool archive"
5265 func_dirname "$lib" "" "."
5266 ladir="$func_dirname_result"
5274 inherited_linker_flags=
5275 # If the library was installed with an old release of libtool,
5276 # it will not redefine variables installed, or shouldnotlink
5285 # Convert "-framework foo" to "foo.ltframework"
5286 if test -n "$inherited_linker_flags"; then
5287 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5288 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5289 case " $new_inherited_linker_flags " in
5290 *" $tmp_inherited_linker_flag "*) ;;
5291 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5295 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5296 if test "$linkmode,$pass" = "lib,link" ||
5297 test "$linkmode,$pass" = "prog,scan" ||
5298 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5299 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5300 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5303 if test "$pass" = conv; then
5304 # Only check for convenience libraries
5305 deplibs="$lib $deplibs"
5306 if test -z "$libdir"; then
5307 if test -z "$old_library"; then
5308 func_fatal_error "cannot find name of link library for \`$lib'"
5310 # It is a libtool convenience library, so add in its objects.
5311 convenience="$convenience $ladir/$objdir/$old_library"
5312 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5313 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5314 func_fatal_error "\`$lib' is not a convenience library"
5317 for deplib in $dependency_libs; do
5318 deplibs="$deplib $deplibs"
5319 if $opt_duplicate_deps ; then
5320 case "$tmp_libs " in
5321 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5324 tmp_libs="$tmp_libs $deplib"
5330 # Get the name of the library we link against.
5332 for l in $old_library $library_names; do
5335 if test -z "$linklib"; then
5336 func_fatal_error "cannot find name of link library for \`$lib'"
5339 # This library was specified with -dlopen.
5340 if test "$pass" = dlopen; then
5341 if test -z "$libdir"; then
5342 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5344 if test -z "$dlname" ||
5345 test "$dlopen_support" != yes ||
5346 test "$build_libtool_libs" = no; then
5347 # If there is no dlname, no dlopen support or we're linking
5348 # statically, we need to preload. We also need to preload any
5349 # dependent libraries so libltdl's deplib preloader doesn't
5350 # bomb out in the load deplibs phase.
5351 dlprefiles="$dlprefiles $lib $dependency_libs"
5353 newdlfiles="$newdlfiles $lib"
5358 # We need an absolute path.
5360 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5362 abs_ladir=`cd "$ladir" && pwd`
5363 if test -z "$abs_ladir"; then
5364 func_warning "cannot determine absolute directory name of \`$ladir'"
5365 func_warning "passing it literally to the linker, although it might fail"
5370 func_basename "$lib"
5371 laname="$func_basename_result"
5373 # Find the relevant object directory and library name.
5374 if test "X$installed" = Xyes; then
5375 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5376 func_warning "library \`$lib' was moved."
5384 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5386 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5389 # Remove this search path later
5390 notinst_path="$notinst_path $abs_ladir"
5392 dir="$ladir/$objdir"
5393 absdir="$abs_ladir/$objdir"
5394 # Remove this search path later
5395 notinst_path="$notinst_path $abs_ladir"
5397 fi # $installed = yes
5398 func_stripname 'lib' '.la' "$laname"
5399 name=$func_stripname_result
5401 # This library was specified with -dlpreopen.
5402 if test "$pass" = dlpreopen; then
5403 if test -z "$libdir" && test "$linkmode" = prog; then
5404 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5406 # Prefer using a static library (so that no silly _DYNAMIC symbols
5407 # are required to link).
5408 if test -n "$old_library"; then
5409 newdlprefiles="$newdlprefiles $dir/$old_library"
5410 # Keep a list of preopened convenience libraries to check
5411 # that they are being used correctly in the link pass.
5412 test -z "$libdir" && \
5413 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5414 # Otherwise, use the dlname, so that lt_dlopen finds it.
5415 elif test -n "$dlname"; then
5416 newdlprefiles="$newdlprefiles $dir/$dlname"
5418 newdlprefiles="$newdlprefiles $dir/$linklib"
5420 fi # $pass = dlpreopen
5422 if test -z "$libdir"; then
5423 # Link the convenience library
5424 if test "$linkmode" = lib; then
5425 deplibs="$dir/$old_library $deplibs"
5426 elif test "$linkmode,$pass" = "prog,link"; then
5427 compile_deplibs="$dir/$old_library $compile_deplibs"
5428 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5430 deplibs="$lib $deplibs" # used for prog,scan pass
5436 if test "$linkmode" = prog && test "$pass" != link; then
5437 newlib_search_path="$newlib_search_path $ladir"
5438 deplibs="$lib $deplibs"
5441 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5442 test "$build_libtool_libs" = no; then
5447 for deplib in $dependency_libs; do
5449 -L*) func_stripname '-L' '' "$deplib"
5450 newlib_search_path="$newlib_search_path $func_stripname_result"
5453 # Need to link against all dependency_libs?
5454 if test "$linkalldeplibs" = yes; then
5455 deplibs="$deplib $deplibs"
5457 # Need to hardcode shared library paths
5458 # or/and link against static libraries
5459 newdependency_libs="$deplib $newdependency_libs"
5461 if $opt_duplicate_deps ; then
5462 case "$tmp_libs " in
5463 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5466 tmp_libs="$tmp_libs $deplib"
5469 fi # $linkmode = prog...
5471 if test "$linkmode,$pass" = "prog,link"; then
5472 if test -n "$library_names" &&
5473 { { test "$prefer_static_libs" = no ||
5474 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5475 test -z "$old_library"; }; then
5476 # We need to hardcode the library path
5477 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5478 # Make sure the rpath contains only unique directories.
5479 case "$temp_rpath:" in
5481 *) temp_rpath="$temp_rpath$absdir:" ;;
5485 # Hardcode the library path.
5486 # Skip directories that are in the system default run-time
5488 case " $sys_lib_dlsearch_path " in
5491 case "$compile_rpath " in
5493 *) compile_rpath="$compile_rpath $absdir"
5497 case " $sys_lib_dlsearch_path " in
5500 case "$finalize_rpath " in
5502 *) finalize_rpath="$finalize_rpath $libdir"
5506 fi # $linkmode,$pass = prog,link...
5508 if test "$alldeplibs" = yes &&
5509 { test "$deplibs_check_method" = pass_all ||
5510 { test "$build_libtool_libs" = yes &&
5511 test -n "$library_names"; }; }; then
5512 # We only need to search for static libraries
5517 link_static=no # Whether the deplib will be linked statically
5518 use_static_libs=$prefer_static_libs
5519 if test "$use_static_libs" = built && test "$installed" = yes; then
5522 if test -n "$library_names" &&
5523 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5526 # No point in relinking DLLs because paths are not encoded
5527 notinst_deplibs="$notinst_deplibs $lib"
5531 if test "$installed" = no; then
5532 notinst_deplibs="$notinst_deplibs $lib"
5537 # This is a shared library
5539 # Warn about portability, can't link against -module's on some
5540 # systems (darwin). Don't bleat about dlopened modules though!
5542 for dlpremoduletest in $dlprefiles; do
5543 if test "X$dlpremoduletest" = "X$lib"; then
5544 dlopenmodule="$dlpremoduletest"
5548 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5550 if test "$linkmode" = prog; then
5551 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5553 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5555 $ECHO "*** $linklib is not portable!"
5557 if test "$linkmode" = lib &&
5558 test "$hardcode_into_libs" = yes; then
5559 # Hardcode the library path.
5560 # Skip directories that are in the system default run-time
5562 case " $sys_lib_dlsearch_path " in
5565 case "$compile_rpath " in
5567 *) compile_rpath="$compile_rpath $absdir"
5571 case " $sys_lib_dlsearch_path " in
5574 case "$finalize_rpath " in
5576 *) finalize_rpath="$finalize_rpath $libdir"
5582 if test -n "$old_archive_from_expsyms_cmds"; then
5583 # figure out the soname
5584 set dummy $library_names
5588 libname=`eval "\\$ECHO \"$libname_spec\""`
5589 # use dlname if we got it. it's perfectly good, no?
5590 if test -n "$dlname"; then
5592 elif test -n "$soname_spec"; then
5596 func_arith $current - $age
5597 major=$func_arith_result
5601 eval soname=\"$soname_spec\"
5606 # Make a new name for the extract_expsyms_cmds to use
5608 func_basename "$soroot"
5609 soname="$func_basename_result"
5610 func_stripname 'lib' '.dll' "$soname"
5611 newlib=libimp-$func_stripname_result.a
5613 # If the library has no export list, then create one now
5614 if test -f "$output_objdir/$soname-def"; then :
5616 func_verbose "extracting exported symbol list from \`$soname'"
5617 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5621 if test -f "$output_objdir/$newlib"; then :; else
5622 func_verbose "generating import library for \`$soname'"
5623 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5625 # make sure the library variables are pointing to the new library
5628 fi # test -n "$old_archive_from_expsyms_cmds"
5630 if test "$linkmode" = prog || test "$mode" != relink; then
5635 case $hardcode_action in
5636 immediate | unsupported)
5637 if test "$hardcode_direct" = no; then
5640 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5641 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5642 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5643 *-*-unixware7*) add_dir="-L$dir" ;;
5645 # if the lib is a (non-dlopened) module then we can not
5646 # link against it, someone is ignoring the earlier warnings
5647 if /usr/bin/file -L $add 2> /dev/null |
5648 $GREP ": [^:]* bundle" >/dev/null ; then
5649 if test "X$dlopenmodule" != "X$lib"; then
5650 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5651 if test -z "$old_library" ; then
5653 $ECHO "*** And there doesn't seem to be a static archive available"
5654 $ECHO "*** The link will probably fail, sorry"
5656 add="$dir/$old_library"
5658 elif test -n "$old_library"; then
5659 add="$dir/$old_library"
5663 elif test "$hardcode_minus_L" = no; then
5665 *-*-sunos*) add_shlibpath="$dir" ;;
5669 elif test "$hardcode_shlibpath_var" = no; then
5670 add_shlibpath="$dir"
5677 if test "$hardcode_direct" = yes &&
5678 test "$hardcode_direct_absolute" = no; then
5680 elif test "$hardcode_minus_L" = yes; then
5682 # Try looking first in the location we're being installed to.
5683 if test -n "$inst_prefix_dir"; then
5686 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5691 elif test "$hardcode_shlibpath_var" = yes; then
5692 add_shlibpath="$dir"
5701 if test "$lib_linked" != yes; then
5702 func_fatal_configuration "unsupported hardcode properties"
5705 if test -n "$add_shlibpath"; then
5706 case :$compile_shlibpath: in
5707 *":$add_shlibpath:"*) ;;
5708 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5711 if test "$linkmode" = prog; then
5712 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5713 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5715 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5716 test -n "$add" && deplibs="$add $deplibs"
5717 if test "$hardcode_direct" != yes &&
5718 test "$hardcode_minus_L" != yes &&
5719 test "$hardcode_shlibpath_var" = yes; then
5720 case :$finalize_shlibpath: in
5722 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5728 if test "$linkmode" = prog || test "$mode" = relink; then
5732 # Finalize command for both is simple: just hardcode it.
5733 if test "$hardcode_direct" = yes &&
5734 test "$hardcode_direct_absolute" = no; then
5735 add="$libdir/$linklib"
5736 elif test "$hardcode_minus_L" = yes; then
5739 elif test "$hardcode_shlibpath_var" = yes; then
5740 case :$finalize_shlibpath: in
5742 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5745 elif test "$hardcode_automatic" = yes; then
5746 if test -n "$inst_prefix_dir" &&
5747 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5748 add="$inst_prefix_dir$libdir/$linklib"
5750 add="$libdir/$linklib"
5753 # We cannot seem to hardcode it, guess we'll fake it.
5755 # Try looking first in the location we're being installed to.
5756 if test -n "$inst_prefix_dir"; then
5759 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5766 if test "$linkmode" = prog; then
5767 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5768 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5770 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5771 test -n "$add" && deplibs="$add $deplibs"
5774 elif test "$linkmode" = prog; then
5775 # Here we assume that one of hardcode_direct or hardcode_minus_L
5776 # is not unsupported. This is valid on all known static and
5778 if test "$hardcode_direct" != unsupported; then
5779 test -n "$old_library" && linklib="$old_library"
5780 compile_deplibs="$dir/$linklib $compile_deplibs"
5781 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5783 compile_deplibs="-l$name -L$dir $compile_deplibs"
5784 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5786 elif test "$build_libtool_libs" = yes; then
5787 # Not a shared library
5788 if test "$deplibs_check_method" != pass_all; then
5789 # We're trying link a shared library against a static one
5790 # but the system doesn't support it.
5792 # Just print a warning and add the library to dependency_libs so
5793 # that the program can be linked against the static library.
5795 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5796 $ECHO "*** I have the capability to make that library automatically link in when"
5797 $ECHO "*** you link to this library. But I can only do this if you have a"
5798 $ECHO "*** shared version of the library, which you do not appear to have."
5799 if test "$module" = yes; then
5800 $ECHO "*** But as you try to build a module library, libtool will still create "
5801 $ECHO "*** a static module, that should work as long as the dlopening application"
5802 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5803 if test -z "$global_symbol_pipe"; then
5805 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5806 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5807 $ECHO "*** not find such a program. So, this module is probably useless."
5808 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5810 if test "$build_old_libs" = no; then
5811 build_libtool_libs=module
5814 build_libtool_libs=no
5818 deplibs="$dir/$old_library $deplibs"
5821 fi # link shared/static library?
5823 if test "$linkmode" = lib; then
5824 if test -n "$dependency_libs" &&
5825 { test "$hardcode_into_libs" != yes ||
5826 test "$build_old_libs" = yes ||
5827 test "$link_static" = yes; }; then
5828 # Extract -R from dependency_libs
5830 for libdir in $dependency_libs; do
5832 -R*) func_stripname '-R' '' "$libdir"
5833 temp_xrpath=$func_stripname_result
5835 *" $temp_xrpath "*) ;;
5836 *) xrpath="$xrpath $temp_xrpath";;
5838 *) temp_deplibs="$temp_deplibs $libdir";;
5841 dependency_libs="$temp_deplibs"
5844 newlib_search_path="$newlib_search_path $absdir"
5845 # Link against this library
5846 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5847 # ... and its dependency_libs
5849 for deplib in $dependency_libs; do
5850 newdependency_libs="$deplib $newdependency_libs"
5851 if $opt_duplicate_deps ; then
5852 case "$tmp_libs " in
5853 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5856 tmp_libs="$tmp_libs $deplib"
5859 if test "$link_all_deplibs" != no; then
5860 # Add the search paths of all dependency libraries
5861 for deplib in $dependency_libs; do
5863 -L*) path="$deplib" ;;
5865 func_dirname "$deplib" "" "."
5866 dir="$func_dirname_result"
5867 # We need an absolute path.
5869 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5871 absdir=`cd "$dir" && pwd`
5872 if test -z "$absdir"; then
5873 func_warning "cannot determine absolute directory name of \`$dir'"
5878 if $GREP "^installed=no" $deplib > /dev/null; then
5882 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5883 if test -n "$deplibrary_names" ; then
5884 for tmp in $deplibrary_names ; do
5887 if test -f "$absdir/$objdir/$depdepl" ; then
5888 depdepl="$absdir/$objdir/$depdepl"
5889 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5890 if test -z "$darwin_install_name"; then
5891 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5893 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5894 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5900 path="-L$absdir/$objdir"
5904 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5905 test -z "$libdir" && \
5906 func_fatal_error "\`$deplib' is not a valid libtool archive"
5907 test "$absdir" != "$libdir" && \
5908 func_warning "\`$deplib' seems to be moved"
5914 case " $deplibs " in
5916 *) deplibs="$path $deplibs" ;;
5919 fi # link_all_deplibs != no
5921 done # for deplib in $libs
5922 if test "$pass" = link; then
5923 if test "$linkmode" = "prog"; then
5924 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5925 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5927 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5930 dependency_libs="$newdependency_libs"
5931 if test "$pass" = dlpreopen; then
5932 # Link the dlpreopened libraries before other libraries
5933 for deplib in $save_deplibs; do
5934 deplibs="$deplib $deplibs"
5937 if test "$pass" != dlopen; then
5938 if test "$pass" != conv; then
5939 # Make sure lib_search_path contains only unique directories.
5941 for dir in $newlib_search_path; do
5942 case "$lib_search_path " in
5944 *) lib_search_path="$lib_search_path $dir" ;;
5950 if test "$linkmode,$pass" != "prog,link"; then
5953 vars="compile_deplibs finalize_deplibs"
5955 for var in $vars dependency_libs; do
5956 # Add libraries to $var in reverse order
5957 eval tmp_libs=\"\$$var\"
5959 for deplib in $tmp_libs; do
5960 # FIXME: Pedantically, this is the right thing to do, so
5961 # that some nasty dependency loop isn't accidentally
5963 #new_libs="$deplib $new_libs"
5964 # Pragmatically, this seems to cause very few problems in
5967 -L*) new_libs="$deplib $new_libs" ;;
5970 # And here is the reason: when a library appears more
5971 # than once as an explicit dependence of a library, or
5972 # is implicitly linked in more than once by the
5973 # compiler, it is considered special, and multiple
5974 # occurrences thereof are not removed. Compare this
5975 # with having the same library being listed as a
5976 # dependency of multiple other libraries: in this case,
5977 # we know (pedantically, we assume) the library does not
5978 # need to be listed more than once, so we keep only the
5979 # last copy. This is not always right, but it is rare
5980 # enough that we require users that really mean to play
5981 # such unportable linking tricks to link the library
5982 # using -Wl,-lname, so that libtool does not consider it
5983 # for duplicate removal.
5984 case " $specialdeplibs " in
5985 *" $deplib "*) new_libs="$deplib $new_libs" ;;
5987 case " $new_libs " in
5989 *) new_libs="$deplib $new_libs" ;;
5997 for deplib in $new_libs; do
6000 case " $tmp_libs " in
6002 *) tmp_libs="$tmp_libs $deplib" ;;
6005 *) tmp_libs="$tmp_libs $deplib" ;;
6008 eval $var=\"$tmp_libs\"
6011 # Last step: remove runtime libs from dependency_libs
6012 # (they stay in deplibs)
6014 for i in $dependency_libs ; do
6015 case " $predeps $postdeps $compiler_lib_search_path " in
6020 if test -n "$i" ; then
6021 tmp_libs="$tmp_libs $i"
6024 dependency_libs=$tmp_libs
6026 if test "$linkmode" = prog; then
6027 dlfiles="$newdlfiles"
6029 if test "$linkmode" = prog || test "$linkmode" = lib; then
6030 dlprefiles="$newdlprefiles"
6035 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6036 func_warning "\`-dlopen' is ignored for archives"
6041 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6044 test -n "$rpath" && \
6045 func_warning "\`-rpath' is ignored for archives"
6047 test -n "$xrpath" && \
6048 func_warning "\`-R' is ignored for archives"
6050 test -n "$vinfo" && \
6051 func_warning "\`-version-info/-version-number' is ignored for archives"
6053 test -n "$release" && \
6054 func_warning "\`-release' is ignored for archives"
6056 test -n "$export_symbols$export_symbols_regex" && \
6057 func_warning "\`-export-symbols' is ignored for archives"
6059 # Now set the variables for building old libraries.
6060 build_libtool_libs=no
6062 objs="$objs$old_deplibs"
6066 # Make sure we only generate libraries of the form `libNAME.la'.
6069 func_stripname 'lib' '.la' "$outputname"
6070 name=$func_stripname_result
6071 eval shared_ext=\"$shrext_cmds\"
6072 eval libname=\"$libname_spec\"
6075 test "$module" = no && \
6076 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6078 if test "$need_lib_prefix" != no; then
6079 # Add the "lib" prefix for modules if required
6080 func_stripname '' '.la' "$outputname"
6081 name=$func_stripname_result
6082 eval shared_ext=\"$shrext_cmds\"
6083 eval libname=\"$libname_spec\"
6085 func_stripname '' '.la' "$outputname"
6086 libname=$func_stripname_result
6091 if test -n "$objs"; then
6092 if test "$deplibs_check_method" != pass_all; then
6093 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6096 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6097 $ECHO "*** objects $objs is not portable!"
6098 libobjs="$libobjs $objs"
6102 test "$dlself" != no && \
6103 func_warning "\`-dlopen self' is ignored for libtool libraries"
6107 test "$#" -gt 1 && \
6108 func_warning "ignoring multiple \`-rpath's for a libtool library"
6113 if test -z "$rpath"; then
6114 if test "$build_libtool_libs" = yes; then
6115 # Building a libtool convenience library.
6116 # Some compilers have problems with a `.al' extension so
6117 # convenience libraries should have the same extension an
6118 # archive normally would.
6119 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6120 build_libtool_libs=convenience
6124 test -n "$vinfo" && \
6125 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6127 test -n "$release" && \
6128 func_warning "\`-release' is ignored for convenience libraries"
6131 # Parse the version information argument.
6132 save_ifs="$IFS"; IFS=':'
6133 set dummy $vinfo 0 0 0
6138 func_fatal_help "too many parameters to \`-version-info'"
6140 # convert absolute version numbers to libtool ages
6141 # this retains compatibility with .la files and attempts
6142 # to make the code below a bit more comprehensible
6144 case $vinfo_number in
6148 number_revision="$3"
6150 # There are really only two kinds -- those that
6151 # use the current revision as the major version
6152 # and those that subtract age and use age as
6153 # a minor version. But, then there is irix
6154 # which has an extra 1 added just for fun
6156 case $version_type in
6157 darwin|linux|osf|windows|none)
6158 func_arith $number_major + $number_minor
6159 current=$func_arith_result
6161 revision="$number_revision"
6163 freebsd-aout|freebsd-elf|sunos)
6164 current="$number_major"
6165 revision="$number_minor"
6169 func_arith $number_major + $number_minor
6170 current=$func_arith_result
6172 revision="$number_minor"
6173 lt_irix_increment=no
6184 # Check that each of the things are valid numbers.
6186 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]) ;;
6188 func_error "CURRENT \`$current' must be a nonnegative integer"
6189 func_fatal_error "\`$vinfo' is not valid version information"
6194 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]) ;;
6196 func_error "REVISION \`$revision' must be a nonnegative integer"
6197 func_fatal_error "\`$vinfo' is not valid version information"
6202 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]) ;;
6204 func_error "AGE \`$age' must be a nonnegative integer"
6205 func_fatal_error "\`$vinfo' is not valid version information"
6209 if test "$age" -gt "$current"; then
6210 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6211 func_fatal_error "\`$vinfo' is not valid version information"
6214 # Calculate the version variables.
6218 case $version_type in
6222 # Like Linux, but with the current version available in
6223 # verstring for coding it into the library header
6224 func_arith $current - $age
6225 major=.$func_arith_result
6226 versuffix="$major.$age.$revision"
6227 # Darwin ld doesn't like 0 for these options...
6228 func_arith $current + 1
6229 minor_current=$func_arith_result
6230 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6231 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6236 versuffix=".$current.$revision";
6241 versuffix=".$current"
6245 if test "X$lt_irix_increment" = "Xno"; then
6246 func_arith $current - $age
6248 func_arith $current - $age + 1
6250 major=$func_arith_result
6252 case $version_type in
6253 nonstopux) verstring_prefix=nonstopux ;;
6254 *) verstring_prefix=sgi ;;
6256 verstring="$verstring_prefix$major.$revision"
6258 # Add in all the interfaces that we are compatible with.
6260 while test "$loop" -ne 0; do
6261 func_arith $revision - $loop
6262 iface=$func_arith_result
6263 func_arith $loop - 1
6264 loop=$func_arith_result
6265 verstring="$verstring_prefix$major.$iface:$verstring"
6268 # Before this point, $major must not contain `.'.
6270 versuffix="$major.$revision"
6274 func_arith $current - $age
6275 major=.$func_arith_result
6276 versuffix="$major.$age.$revision"
6280 func_arith $current - $age
6281 major=.$func_arith_result
6282 versuffix=".$current.$age.$revision"
6283 verstring="$current.$age.$revision"
6285 # Add in all the interfaces that we are compatible with.
6287 while test "$loop" -ne 0; do
6288 func_arith $current - $loop
6289 iface=$func_arith_result
6290 func_arith $loop - 1
6291 loop=$func_arith_result
6292 verstring="$verstring:${iface}.0"
6295 # Make executables depend on our current version.
6296 verstring="$verstring:${current}.0"
6301 versuffix=".$current"
6306 versuffix=".$current.$revision"
6310 # Use '-' rather than '.', since we only want one
6311 # extension on DOS 8.3 filesystems.
6312 func_arith $current - $age
6313 major=$func_arith_result
6318 func_fatal_configuration "unknown library version type \`$version_type'"
6322 # Clear the version info if we defaulted, and they specified a release.
6323 if test -z "$vinfo" && test -n "$release"; then
6325 case $version_type in
6327 # we can't check for "0.0" in archive_cmds due to quoting
6328 # problems, so we reset it completely
6335 if test "$need_version" = no; then
6342 # Remove version info from name if versioning should be avoided
6343 if test "$avoid_version" = yes && test "$need_version" = no; then
6349 # Check to see if the archive will have undefined symbols.
6350 if test "$allow_undefined" = yes; then
6351 if test "$allow_undefined_flag" = unsupported; then
6352 func_warning "undefined symbols not allowed in $host shared libraries"
6353 build_libtool_libs=no
6357 # Don't allow undefined symbols.
6358 allow_undefined_flag="$no_undefined_flag"
6363 func_generate_dlsyms "$libname" "$libname" "yes"
6364 libobjs="$libobjs $symfileobj"
6365 test "X$libobjs" = "X " && libobjs=
6367 if test "$mode" != relink; then
6368 # Remove our outputs, but don't remove object files since they
6369 # may have been created when compiling PIC objects.
6371 tempremovelist=`$ECHO "$output_objdir/*"`
6372 for p in $tempremovelist; do
6376 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6377 if test "X$precious_files_regex" != "X"; then
6378 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6383 removelist="$removelist $p"
6388 test -n "$removelist" && \
6389 func_show_eval "${RM}r \$removelist"
6392 # Now set the variables for building old libraries.
6393 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6394 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6396 # Transform .lo files to .o files.
6397 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6400 # Eliminate all temporary directories.
6401 #for path in $notinst_path; do
6402 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6403 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6404 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6407 if test -n "$xrpath"; then
6408 # If the user specified any rpath flags, then add them.
6410 for libdir in $xrpath; do
6411 temp_xrpath="$temp_xrpath -R$libdir"
6412 case "$finalize_rpath " in
6414 *) finalize_rpath="$finalize_rpath $libdir" ;;
6417 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6418 dependency_libs="$temp_xrpath $dependency_libs"
6422 # Make sure dlfiles contains only unique files that won't be dlpreopened
6423 old_dlfiles="$dlfiles"
6425 for lib in $old_dlfiles; do
6426 case " $dlprefiles $dlfiles " in
6428 *) dlfiles="$dlfiles $lib" ;;
6432 # Make sure dlprefiles contains only unique files
6433 old_dlprefiles="$dlprefiles"
6435 for lib in $old_dlprefiles; do
6436 case "$dlprefiles " in
6438 *) dlprefiles="$dlprefiles $lib" ;;
6442 if test "$build_libtool_libs" = yes; then
6443 if test -n "$rpath"; then
6445 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
6446 # these systems don't actually have a c library (as such)!
6448 *-*-rhapsody* | *-*-darwin1.[012])
6449 # Rhapsody C library is in the System framework
6450 deplibs="$deplibs System.ltframework"
6453 # Don't link with libc until the a.out ld.so is fixed.
6455 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6456 # Do not include libc due to us having libc/libc_r.
6458 *-*-sco3.2v5* | *-*-sco5v6*)
6459 # Causes problems with __ctype
6461 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6462 # Compiler inserts libc in the correct place for threads to work
6465 # Add libc to deplibs on all other systems if necessary.
6466 if test "$build_libtool_need_lc" = "yes"; then
6467 deplibs="$deplibs -lc"
6473 # Transform deplibs into only deplibs that can be linked in shared.
6475 libname_save=$libname
6476 release_save=$release
6477 versuffix_save=$versuffix
6479 # I'm not sure if I'm treating the release correctly. I think
6480 # release should show up in the -l (ie -lgmp5) so we don't want to
6481 # add it in twice. Is that correct?
6487 case $deplibs_check_method in
6489 # Don't check for shared/static. Everything works.
6490 # This might be a little naive. We might want to check
6491 # whether the library exists or not. But this is on
6492 # osf3 & osf4 and I'm not really sure... Just
6493 # implementing what was already the behavior.
6497 # This code stresses the "libraries are programs" paradigm to its
6498 # limits. Maybe even breaks it. We compile a program, linking it
6499 # against the deplibs as a proxy for the library. Then we can check
6500 # whether they linked in statically or dynamically with ldd.
6501 $opt_dry_run || $RM conftest.c
6502 cat > conftest.c <<EOF
6503 int main() { return 0; }
6505 $opt_dry_run || $RM conftest
6506 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6507 ldd_output=`ldd conftest`
6508 for i in $deplibs; do
6511 func_stripname -l '' "$i"
6512 name=$func_stripname_result
6513 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6514 case " $predeps $postdeps " in
6516 newdeplibs="$newdeplibs $i"
6521 if test -n "$i" ; then
6522 libname=`eval "\\$ECHO \"$libname_spec\""`
6523 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6524 set dummy $deplib_matches; shift
6526 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6527 newdeplibs="$newdeplibs $i"
6531 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6532 $ECHO "*** I have the capability to make that library automatically link in when"
6533 $ECHO "*** you link to this library. But I can only do this if you have a"
6534 $ECHO "*** shared version of the library, which I believe you do not have"
6535 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6536 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6541 newdeplibs="$newdeplibs $i"
6546 # Error occurred in the first compile. Let's try to salvage
6547 # the situation: Compile a separate program for each library.
6548 for i in $deplibs; do
6551 func_stripname -l '' "$i"
6552 name=$func_stripname_result
6553 $opt_dry_run || $RM conftest
6554 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6555 ldd_output=`ldd conftest`
6556 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6557 case " $predeps $postdeps " in
6559 newdeplibs="$newdeplibs $i"
6564 if test -n "$i" ; then
6565 libname=`eval "\\$ECHO \"$libname_spec\""`
6566 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6567 set dummy $deplib_matches; shift
6569 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6570 newdeplibs="$newdeplibs $i"
6574 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6575 $ECHO "*** I have the capability to make that library automatically link in when"
6576 $ECHO "*** you link to this library. But I can only do this if you have a"
6577 $ECHO "*** shared version of the library, which you do not appear to have"
6578 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6579 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6585 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6586 $ECHO "*** make it link in! You will probably need to install it or some"
6587 $ECHO "*** library that it depends on before this library will be fully"
6588 $ECHO "*** functional. Installing it before continuing would be even better."
6592 newdeplibs="$newdeplibs $i"
6599 set dummy $deplibs_check_method; shift
6600 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6601 for a_deplib in $deplibs; do
6604 func_stripname -l '' "$a_deplib"
6605 name=$func_stripname_result
6606 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6607 case " $predeps $postdeps " in
6609 newdeplibs="$newdeplibs $a_deplib"
6614 if test -n "$a_deplib" ; then
6615 libname=`eval "\\$ECHO \"$libname_spec\""`
6616 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6617 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6618 for potent_lib in $potential_libs; do
6619 # Follow soft links.
6620 if ls -lLd "$potent_lib" 2>/dev/null |
6621 $GREP " -> " >/dev/null; then
6624 # The statement above tries to avoid entering an
6625 # endless loop below, in case of cyclic links.
6626 # We might still enter an endless loop, since a link
6627 # loop can be closed while we follow links,
6629 potlib="$potent_lib"
6630 while test -h "$potlib" 2>/dev/null; do
6631 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6633 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6634 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6637 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6639 $EGREP "$file_magic_regex" > /dev/null; then
6640 newdeplibs="$newdeplibs $a_deplib"
6647 if test -n "$a_deplib" ; then
6650 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6651 $ECHO "*** I have the capability to make that library automatically link in when"
6652 $ECHO "*** you link to this library. But I can only do this if you have a"
6653 $ECHO "*** shared version of the library, which you do not appear to have"
6654 $ECHO "*** because I did check the linker path looking for a file starting"
6655 if test -z "$potlib" ; then
6656 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6658 $ECHO "*** with $libname and none of the candidates passed a file format test"
6659 $ECHO "*** using a file magic. Last file checked: $potlib"
6664 # Add a -L argument.
6665 newdeplibs="$newdeplibs $a_deplib"
6668 done # Gone through all deplibs.
6671 set dummy $deplibs_check_method; shift
6672 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6673 for a_deplib in $deplibs; do
6676 func_stripname -l '' "$a_deplib"
6677 name=$func_stripname_result
6678 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6679 case " $predeps $postdeps " in
6681 newdeplibs="$newdeplibs $a_deplib"
6686 if test -n "$a_deplib" ; then
6687 libname=`eval "\\$ECHO \"$libname_spec\""`
6688 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6689 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6690 for potent_lib in $potential_libs; do
6691 potlib="$potent_lib" # see symlink-check above in file_magic test
6692 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6693 $EGREP "$match_pattern_regex" > /dev/null; then
6694 newdeplibs="$newdeplibs $a_deplib"
6701 if test -n "$a_deplib" ; then
6704 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6705 $ECHO "*** I have the capability to make that library automatically link in when"
6706 $ECHO "*** you link to this library. But I can only do this if you have a"
6707 $ECHO "*** shared version of the library, which you do not appear to have"
6708 $ECHO "*** because I did check the linker path looking for a file starting"
6709 if test -z "$potlib" ; then
6710 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6712 $ECHO "*** with $libname and none of the candidates passed a file format test"
6713 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6718 # Add a -L argument.
6719 newdeplibs="$newdeplibs $a_deplib"
6722 done # Gone through all deplibs.
6726 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6727 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6728 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6729 for i in $predeps $postdeps ; do
6730 # can't use Xsed below, because $i might contain '/'
6731 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6734 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6735 $GREP . >/dev/null; then
6737 if test "X$deplibs_check_method" = "Xnone"; then
6738 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6740 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6742 $ECHO "*** All declared inter-library dependencies are being dropped."
6747 versuffix=$versuffix_save
6749 release=$release_save
6750 libname=$libname_save
6754 *-*-rhapsody* | *-*-darwin1.[012])
6755 # On Rhapsody replace the C library with the System framework
6756 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6760 if test "$droppeddeps" = yes; then
6761 if test "$module" = yes; then
6763 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6764 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6765 $ECHO "*** a static module, that should work as long as the dlopening"
6766 $ECHO "*** application is linked with the -dlopen flag."
6767 if test -z "$global_symbol_pipe"; then
6769 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6770 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6771 $ECHO "*** not find such a program. So, this module is probably useless."
6772 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6774 if test "$build_old_libs" = no; then
6775 oldlibs="$output_objdir/$libname.$libext"
6776 build_libtool_libs=module
6779 build_libtool_libs=no
6782 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6783 $ECHO "*** automatically added whenever a program is linked with this library"
6784 $ECHO "*** or is declared to -dlopen it."
6786 if test "$allow_undefined" = no; then
6788 $ECHO "*** Since this library must not contain undefined symbols,"
6789 $ECHO "*** because either the platform does not support them or"
6790 $ECHO "*** it was explicitly requested with -no-undefined,"
6791 $ECHO "*** libtool will only create a static version of it."
6792 if test "$build_old_libs" = no; then
6793 oldlibs="$output_objdir/$libname.$libext"
6794 build_libtool_libs=module
6797 build_libtool_libs=no
6802 # Done checking deplibs!
6805 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6808 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6809 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6810 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6814 # move library search paths that coincide with paths to not yet
6815 # installed libraries to the beginning of the library search list
6817 for path in $notinst_path; do
6818 case " $new_libs " in
6819 *" -L$path/$objdir "*) ;;
6821 case " $deplibs " in
6822 *" -L$path/$objdir "*)
6823 new_libs="$new_libs -L$path/$objdir" ;;
6828 for deplib in $deplibs; do
6831 case " $new_libs " in
6833 *) new_libs="$new_libs $deplib" ;;
6836 *) new_libs="$new_libs $deplib" ;;
6841 # All the library-specific variables (install_libdir is set above).
6846 # Test again, we may have decided not to build it any more
6847 if test "$build_libtool_libs" = yes; then
6848 if test "$hardcode_into_libs" = yes; then
6849 # Hardcode the library paths
6852 rpath="$finalize_rpath"
6853 test "$mode" != relink && rpath="$compile_rpath$rpath"
6854 for libdir in $rpath; do
6855 if test -n "$hardcode_libdir_flag_spec"; then
6856 if test -n "$hardcode_libdir_separator"; then
6857 if test -z "$hardcode_libdirs"; then
6858 hardcode_libdirs="$libdir"
6860 # Just accumulate the unique libdirs.
6861 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6862 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6865 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6870 eval flag=\"$hardcode_libdir_flag_spec\"
6871 dep_rpath="$dep_rpath $flag"
6873 elif test -n "$runpath_var"; then
6874 case "$perm_rpath " in
6876 *) perm_rpath="$perm_rpath $libdir" ;;
6880 # Substitute the hardcoded libdirs into the rpath.
6881 if test -n "$hardcode_libdir_separator" &&
6882 test -n "$hardcode_libdirs"; then
6883 libdir="$hardcode_libdirs"
6884 if test -n "$hardcode_libdir_flag_spec_ld"; then
6885 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6887 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6890 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6891 # We should set the runpath_var.
6893 for dir in $perm_rpath; do
6896 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6898 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6901 shlibpath="$finalize_shlibpath"
6902 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6903 if test -n "$shlibpath"; then
6904 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6907 # Get the real and link names of the library.
6908 eval shared_ext=\"$shrext_cmds\"
6909 eval library_names=\"$library_names_spec\"
6910 set dummy $library_names
6915 if test -n "$soname_spec"; then
6916 eval soname=\"$soname_spec\"
6920 if test -z "$dlname"; then
6924 lib="$output_objdir/$realname"
6928 linknames="$linknames $link"
6931 # Use standard objects if they are pic
6932 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6933 test "X$libobjs" = "X " && libobjs=
6936 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6937 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6938 export_symbols="$output_objdir/$libname.uexp"
6939 delfiles="$delfiles $export_symbols"
6942 orig_export_symbols=
6945 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6946 # exporting using user supplied symfile
6947 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6948 # and it's NOT already a .def file. Must figure out
6949 # which of the given symbols are data symbols and tag
6950 # them as such. So, trigger use of export_symbols_cmds.
6951 # export_symbols gets reassigned inside the "prepare
6952 # the list of exported symbols" if statement, so the
6953 # include_expsyms logic still works.
6954 orig_export_symbols="$export_symbols"
6956 always_export_symbols=yes
6962 # Prepare the list of exported symbols
6963 if test -z "$export_symbols"; then
6964 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
6965 func_verbose "generating symbol list for \`$libname.la'"
6966 export_symbols="$output_objdir/$libname.exp"
6967 $opt_dry_run || $RM $export_symbols
6968 cmds=$export_symbols_cmds
6969 save_ifs="$IFS"; IFS='~'
6970 for cmd in $cmds; do
6974 len=$func_len_result
6975 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6976 func_show_eval "$cmd" 'exit $?'
6977 skipped_export=false
6979 # The command line is too long to execute in one step.
6980 func_verbose "using reloadable object file for export list..."
6982 # Break out early, otherwise skipped_export may be
6983 # set to false by a later but shorter cmd.
6988 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
6989 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
6990 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
6995 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6996 tmp_export_symbols="$export_symbols"
6997 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
6998 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7001 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7002 # The given exports_symbols file has to be filtered, so filter it.
7003 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7004 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7005 # 's' commands which not all seds can handle. GNU sed should be fine
7006 # though. Also, the filter scales superlinearly with the number of
7007 # global variables. join(1) would be nice here, but unfortunately
7008 # isn't a blessed tool.
7009 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7010 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7011 export_symbols=$output_objdir/$libname.def
7012 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7016 for test_deplib in $deplibs; do
7017 case " $convenience " in
7018 *" $test_deplib "*) ;;
7020 tmp_deplibs="$tmp_deplibs $test_deplib"
7024 deplibs="$tmp_deplibs"
7026 if test -n "$convenience"; then
7027 if test -n "$whole_archive_flag_spec" &&
7028 test "$compiler_needs_object" = yes &&
7029 test -z "$libobjs"; then
7030 # extract the archives, so we have objects to list.
7031 # TODO: could optimize this to just extract one archive.
7032 whole_archive_flag_spec=
7034 if test -n "$whole_archive_flag_spec"; then
7035 save_libobjs=$libobjs
7036 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7037 test "X$libobjs" = "X " && libobjs=
7039 gentop="$output_objdir/${outputname}x"
7040 generated="$generated $gentop"
7042 func_extract_archives $gentop $convenience
7043 libobjs="$libobjs $func_extract_archives_result"
7044 test "X$libobjs" = "X " && libobjs=
7048 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7049 eval flag=\"$thread_safe_flag_spec\"
7050 linker_flags="$linker_flags $flag"
7053 # Make a backup of the uninstalled library when relinking
7054 if test "$mode" = relink; then
7055 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7058 # Do each of the archive commands.
7059 if test "$module" = yes && test -n "$module_cmds" ; then
7060 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7061 eval test_cmds=\"$module_expsym_cmds\"
7062 cmds=$module_expsym_cmds
7064 eval test_cmds=\"$module_cmds\"
7068 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7069 eval test_cmds=\"$archive_expsym_cmds\"
7070 cmds=$archive_expsym_cmds
7072 eval test_cmds=\"$archive_cmds\"
7077 if test "X$skipped_export" != "X:" &&
7078 func_len " $test_cmds" &&
7079 len=$func_len_result &&
7080 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7083 # The command line is too long to link in one step, link piecewise
7084 # or, if using GNU ld and skipped_export is not :, use a linker
7087 # Save the value of $output and $libobjs because we want to
7088 # use them later. If we have whole_archive_flag_spec, we
7089 # want to use save_libobjs as it was before
7090 # whole_archive_flag_spec was expanded, because we can't
7091 # assume the linker understands whole_archive_flag_spec.
7092 # This may have to be revisited, in case too many
7093 # convenience libraries get linked in and end up exceeding
7095 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7096 save_libobjs=$libobjs
7099 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7101 # Clear the reloadable object creation command queue and
7102 # initialize k to one.
7109 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7110 output=${output_objdir}/${output_la}.lnkscript
7111 func_verbose "creating GNU ld script: $output"
7112 $ECHO 'INPUT (' > $output
7113 for obj in $save_libobjs
7115 $ECHO "$obj" >> $output
7117 $ECHO ')' >> $output
7118 delfiles="$delfiles $output"
7119 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7120 output=${output_objdir}/${output_la}.lnk
7121 func_verbose "creating linker input file list: $output"
7126 if test "$compiler_needs_object" = yes; then
7132 $ECHO "$obj" >> $output
7134 delfiles="$delfiles $output"
7135 output=$firstobj\"$file_list_spec$output\"
7137 if test -n "$save_libobjs"; then
7138 func_verbose "creating reloadable object files..."
7139 output=$output_objdir/$output_la-${k}.$objext
7140 eval test_cmds=\"$reload_cmds\"
7141 func_len " $test_cmds"
7142 len0=$func_len_result
7145 # Loop over the list of objects to be linked.
7146 for obj in $save_libobjs
7149 func_arith $len + $func_len_result
7150 len=$func_arith_result
7151 if test "X$objlist" = X ||
7152 test "$len" -lt "$max_cmd_len"; then
7153 func_append objlist " $obj"
7155 # The command $test_cmds is almost too long, add a
7156 # command to the queue.
7157 if test "$k" -eq 1 ; then
7158 # The first file doesn't have a previous command to add.
7159 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7161 # All subsequent reloadable object files will link in
7162 # the last one created.
7163 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7165 last_robj=$output_objdir/$output_la-${k}.$objext
7167 k=$func_arith_result
7168 output=$output_objdir/$output_la-${k}.$objext
7170 func_len " $last_robj"
7171 func_arith $len0 + $func_len_result
7172 len=$func_arith_result
7175 # Handle the remaining objects by creating one last
7176 # reloadable object file. All subsequent reloadable object
7177 # files will link in the last one created.
7178 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7179 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7180 if test -n "$last_robj"; then
7181 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7183 delfiles="$delfiles $output"
7189 if ${skipped_export-false}; then
7190 func_verbose "generating symbol list for \`$libname.la'"
7191 export_symbols="$output_objdir/$libname.exp"
7192 $opt_dry_run || $RM $export_symbols
7194 # Append the command to create the export file.
7195 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7196 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7197 if test -n "$last_robj"; then
7198 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7202 test -n "$save_libobjs" &&
7203 func_verbose "creating a temporary reloadable object file: $output"
7205 # Loop through the commands generated above and execute them.
7206 save_ifs="$IFS"; IFS='~'
7207 for cmd in $concat_cmds; do
7210 func_quote_for_expand "$cmd"
7211 eval "func_echo $func_quote_for_expand_result"
7213 $opt_dry_run || eval "$cmd" || {
7216 # Restore the uninstalled library and exit
7217 if test "$mode" = relink; then
7218 ( cd "$output_objdir" && \
7219 $RM "${realname}T" && \
7220 $MV "${realname}U" "$realname" )
7228 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7229 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7230 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7234 if ${skipped_export-false}; then
7235 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7236 tmp_export_symbols="$export_symbols"
7237 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7238 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7241 if test -n "$orig_export_symbols"; then
7242 # The given exports_symbols file has to be filtered, so filter it.
7243 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7244 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7245 # 's' commands which not all seds can handle. GNU sed should be fine
7246 # though. Also, the filter scales superlinearly with the number of
7247 # global variables. join(1) would be nice here, but unfortunately
7248 # isn't a blessed tool.
7249 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7250 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7251 export_symbols=$output_objdir/$libname.def
7252 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7257 # Restore the value of output.
7260 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7261 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7262 test "X$libobjs" = "X " && libobjs=
7264 # Expand the library linking commands again to reset the
7265 # value of $libobjs for piecewise linking.
7267 # Do each of the archive commands.
7268 if test "$module" = yes && test -n "$module_cmds" ; then
7269 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7270 cmds=$module_expsym_cmds
7275 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7276 cmds=$archive_expsym_cmds
7283 if test -n "$delfiles"; then
7284 # Append the command to remove temporary files to $cmds.
7285 eval cmds=\"\$cmds~\$RM $delfiles\"
7288 # Add any objects from preloaded convenience libraries
7289 if test -n "$dlprefiles"; then
7290 gentop="$output_objdir/${outputname}x"
7291 generated="$generated $gentop"
7293 func_extract_archives $gentop $dlprefiles
7294 libobjs="$libobjs $func_extract_archives_result"
7295 test "X$libobjs" = "X " && libobjs=
7298 save_ifs="$IFS"; IFS='~'
7299 for cmd in $cmds; do
7303 func_quote_for_expand "$cmd"
7304 eval "func_echo $func_quote_for_expand_result"
7306 $opt_dry_run || eval "$cmd" || {
7309 # Restore the uninstalled library and exit
7310 if test "$mode" = relink; then
7311 ( cd "$output_objdir" && \
7312 $RM "${realname}T" && \
7313 $MV "${realname}U" "$realname" )
7321 # Restore the uninstalled library and exit
7322 if test "$mode" = relink; then
7323 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7325 if test -n "$convenience"; then
7326 if test -z "$whole_archive_flag_spec"; then
7327 func_show_eval '${RM}r "$gentop"'
7334 # Create links to the real library.
7335 for linkname in $linknames; do
7336 if test "$realname" != "$linkname"; then
7337 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7341 # If -module or -export-dynamic was specified, set the dlname.
7342 if test "$module" = yes || test "$export_dynamic" = yes; then
7343 # On all known operating systems, these are identical.
7350 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7351 func_warning "\`-dlopen' is ignored for objects"
7356 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7359 test -n "$rpath" && \
7360 func_warning "\`-rpath' is ignored for objects"
7362 test -n "$xrpath" && \
7363 func_warning "\`-R' is ignored for objects"
7365 test -n "$vinfo" && \
7366 func_warning "\`-version-info' is ignored for objects"
7368 test -n "$release" && \
7369 func_warning "\`-release' is ignored for objects"
7373 test -n "$objs$old_deplibs" && \
7374 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7378 obj=$func_lo2o_result
7386 # Delete the old objects.
7387 $opt_dry_run || $RM $obj $libobj
7389 # Objects from convenience libraries. This assumes
7390 # single-version convenience libraries. Whenever we create
7391 # different ones for PIC/non-PIC, this we'll have to duplicate
7395 # reload_cmds runs $LD directly, so let us get rid of
7396 # -Wl from whole_archive_flag_spec and hope we can get by with
7397 # turning comma into space..
7400 if test -n "$convenience"; then
7401 if test -n "$whole_archive_flag_spec"; then
7402 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7403 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7405 gentop="$output_objdir/${obj}x"
7406 generated="$generated $gentop"
7408 func_extract_archives $gentop $convenience
7409 reload_conv_objs="$reload_objs $func_extract_archives_result"
7413 # Create the old-style object.
7414 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
7417 func_execute_cmds "$reload_cmds" 'exit $?'
7419 # Exit if we aren't doing a library object file.
7420 if test -z "$libobj"; then
7421 if test -n "$gentop"; then
7422 func_show_eval '${RM}r "$gentop"'
7428 if test "$build_libtool_libs" != yes; then
7429 if test -n "$gentop"; then
7430 func_show_eval '${RM}r "$gentop"'
7433 # Create an invalid libtool object if no PIC, so that we don't
7434 # accidentally link it into a program.
7435 # $show "echo timestamp > $libobj"
7436 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7440 if test -n "$pic_flag" || test "$pic_mode" != default; then
7441 # Only do commands if we really have different PIC objects.
7442 reload_objs="$libobjs $reload_conv_objs"
7444 func_execute_cmds "$reload_cmds" 'exit $?'
7447 if test -n "$gentop"; then
7448 func_show_eval '${RM}r "$gentop"'
7456 *cygwin*) func_stripname '' '.exe' "$output"
7457 output=$func_stripname_result.exe;;
7459 test -n "$vinfo" && \
7460 func_warning "\`-version-info' is ignored for programs"
7462 test -n "$release" && \
7463 func_warning "\`-release' is ignored for programs"
7465 test "$preload" = yes \
7466 && test "$dlopen_support" = unknown \
7467 && test "$dlopen_self" = unknown \
7468 && test "$dlopen_self_static" = unknown && \
7469 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7472 *-*-rhapsody* | *-*-darwin1.[012])
7473 # On Rhapsody replace the C library is the System framework
7474 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7475 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7481 # Don't allow lazy linking, it breaks C++ global constructors
7482 # But is supposedly fixed on 10.4 or later (yay!).
7483 if test "$tagname" = CXX ; then
7484 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7486 compile_command="$compile_command ${wl}-bind_at_load"
7487 finalize_command="$finalize_command ${wl}-bind_at_load"
7491 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7492 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7493 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7498 # move library search paths that coincide with paths to not yet
7499 # installed libraries to the beginning of the library search list
7501 for path in $notinst_path; do
7502 case " $new_libs " in
7503 *" -L$path/$objdir "*) ;;
7505 case " $compile_deplibs " in
7506 *" -L$path/$objdir "*)
7507 new_libs="$new_libs -L$path/$objdir" ;;
7512 for deplib in $compile_deplibs; do
7515 case " $new_libs " in
7517 *) new_libs="$new_libs $deplib" ;;
7520 *) new_libs="$new_libs $deplib" ;;
7523 compile_deplibs="$new_libs"
7526 compile_command="$compile_command $compile_deplibs"
7527 finalize_command="$finalize_command $finalize_deplibs"
7529 if test -n "$rpath$xrpath"; then
7530 # If the user specified any rpath flags, then add them.
7531 for libdir in $rpath $xrpath; do
7532 # This is the magic to use -rpath.
7533 case "$finalize_rpath " in
7535 *) finalize_rpath="$finalize_rpath $libdir" ;;
7540 # Now hardcode the library paths
7543 for libdir in $compile_rpath $finalize_rpath; do
7544 if test -n "$hardcode_libdir_flag_spec"; then
7545 if test -n "$hardcode_libdir_separator"; then
7546 if test -z "$hardcode_libdirs"; then
7547 hardcode_libdirs="$libdir"
7549 # Just accumulate the unique libdirs.
7550 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7551 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7554 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7559 eval flag=\"$hardcode_libdir_flag_spec\"
7560 rpath="$rpath $flag"
7562 elif test -n "$runpath_var"; then
7563 case "$perm_rpath " in
7565 *) perm_rpath="$perm_rpath $libdir" ;;
7569 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
7570 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7571 case :$dllsearchpath: in
7573 *) dllsearchpath="$dllsearchpath:$libdir";;
7575 case :$dllsearchpath: in
7576 *":$testbindir:"*) ;;
7577 *) dllsearchpath="$dllsearchpath:$testbindir";;
7582 # Substitute the hardcoded libdirs into the rpath.
7583 if test -n "$hardcode_libdir_separator" &&
7584 test -n "$hardcode_libdirs"; then
7585 libdir="$hardcode_libdirs"
7586 eval rpath=\" $hardcode_libdir_flag_spec\"
7588 compile_rpath="$rpath"
7592 for libdir in $finalize_rpath; do
7593 if test -n "$hardcode_libdir_flag_spec"; then
7594 if test -n "$hardcode_libdir_separator"; then
7595 if test -z "$hardcode_libdirs"; then
7596 hardcode_libdirs="$libdir"
7598 # Just accumulate the unique libdirs.
7599 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7600 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7603 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7608 eval flag=\"$hardcode_libdir_flag_spec\"
7609 rpath="$rpath $flag"
7611 elif test -n "$runpath_var"; then
7612 case "$finalize_perm_rpath " in
7614 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7618 # Substitute the hardcoded libdirs into the rpath.
7619 if test -n "$hardcode_libdir_separator" &&
7620 test -n "$hardcode_libdirs"; then
7621 libdir="$hardcode_libdirs"
7622 eval rpath=\" $hardcode_libdir_flag_spec\"
7624 finalize_rpath="$rpath"
7626 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7627 # Transform all the library objects into standard objects.
7628 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7629 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7632 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7634 # template prelinking step
7635 if test -n "$prelink_cmds"; then
7636 func_execute_cmds "$prelink_cmds" 'exit $?'
7639 wrappers_required=yes
7641 *cygwin* | *mingw* )
7642 if test "$build_libtool_libs" != yes; then
7643 wrappers_required=no
7647 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7648 wrappers_required=no
7652 if test "$wrappers_required" = no; then
7653 # Replace the output file specification.
7654 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7655 link_command="$compile_command$compile_rpath"
7657 # We have no uninstalled library dependencies, so finalize right now.
7659 func_show_eval "$link_command" 'exit_status=$?'
7661 # Delete the generated files.
7662 if test -f "$output_objdir/${outputname}S.${objext}"; then
7663 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7669 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7670 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7672 if test -n "$finalize_shlibpath"; then
7673 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7678 if test -n "$runpath_var"; then
7679 if test -n "$perm_rpath"; then
7680 # We should set the runpath_var.
7682 for dir in $perm_rpath; do
7685 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7687 if test -n "$finalize_perm_rpath"; then
7688 # We should set the runpath_var.
7690 for dir in $finalize_perm_rpath; do
7693 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7697 if test "$no_install" = yes; then
7698 # We don't need to create a wrapper script.
7699 link_command="$compile_var$compile_command$compile_rpath"
7700 # Replace the output file specification.
7701 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7702 # Delete the old output file.
7703 $opt_dry_run || $RM $output
7704 # Link the executable and exit
7705 func_show_eval "$link_command" 'exit $?'
7709 if test "$hardcode_action" = relink; then
7710 # Fast installation is not supported
7711 link_command="$compile_var$compile_command$compile_rpath"
7712 relink_command="$finalize_var$finalize_command$finalize_rpath"
7714 func_warning "this platform does not like uninstalled shared libraries"
7715 func_warning "\`$output' will be relinked during installation"
7717 if test "$fast_install" != no; then
7718 link_command="$finalize_var$compile_command$finalize_rpath"
7719 if test "$fast_install" = yes; then
7720 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7722 # fast_install is set to needless
7726 link_command="$compile_var$compile_command$compile_rpath"
7727 relink_command="$finalize_var$finalize_command$finalize_rpath"
7731 # Replace the output file specification.
7732 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7734 # Delete the old output files.
7735 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7737 func_show_eval "$link_command" 'exit $?'
7739 # Now create the wrapper script.
7740 func_verbose "creating $output"
7742 # Quote the relink command for shipping.
7743 if test -n "$relink_command"; then
7744 # Preserve any variables that may affect compiler behavior
7745 for var in $variables_saved_for_relink; do
7746 if eval test -z \"\${$var+set}\"; then
7747 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7748 elif eval var_value=\$$var; test -z "$var_value"; then
7749 relink_command="$var=; export $var; $relink_command"
7751 func_quote_for_eval "$var_value"
7752 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7755 relink_command="(cd `pwd`; $relink_command)"
7756 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7759 # Quote $ECHO for shipping.
7760 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7762 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7763 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7765 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7767 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7770 # Only actually do things if not in dry run mode.
7772 # win32 will think the script is a binary if it has
7773 # a .exe suffix, so we strip it off here.
7775 *.exe) func_stripname '' '.exe' "$output"
7776 output=$func_stripname_result ;;
7778 # test for cygwin because mv fails w/o .exe extensions
7782 func_stripname '' '.exe' "$outputname"
7783 outputname=$func_stripname_result ;;
7787 *cygwin* | *mingw* )
7788 func_dirname_and_basename "$output" "" "."
7789 output_name=$func_basename_result
7790 output_path=$func_dirname_result
7791 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7792 cwrapper="$output_path/$output_name.exe"
7793 $RM $cwrappersource $cwrapper
7794 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7796 func_emit_cwrapperexe_src > $cwrappersource
7798 # we should really use a build-platform specific compiler
7799 # here, but OTOH, the wrappers (shell script and this C one)
7800 # are only useful if you want to execute the "real" binary.
7801 # Since the "real" binary is built for $host, then this
7802 # wrapper might as well be built for $host, too.
7804 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7808 # Now, create the wrapper script for func_source use:
7809 func_ltwrapper_scriptname $cwrapper
7810 $RM $func_ltwrapper_scriptname_result
7811 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7813 # note: this script will not be executed, so do not chmod.
7814 if test "x$build" = "x$host" ; then
7815 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7817 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7823 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7825 func_emit_wrapper no > $output
7834 # See if we need to build an old-fashioned archive.
7835 for oldlib in $oldlibs; do
7837 if test "$build_libtool_libs" = convenience; then
7838 oldobjs="$libobjs_save $symfileobj"
7839 addlibs="$convenience"
7840 build_libtool_libs=no
7842 if test "$build_libtool_libs" = module; then
7843 oldobjs="$libobjs_save"
7844 build_libtool_libs=no
7846 oldobjs="$old_deplibs $non_pic_objects"
7847 if test "$preload" = yes && test -f "$symfileobj"; then
7848 oldobjs="$oldobjs $symfileobj"
7851 addlibs="$old_convenience"
7854 if test -n "$addlibs"; then
7855 gentop="$output_objdir/${outputname}x"
7856 generated="$generated $gentop"
7858 func_extract_archives $gentop $addlibs
7859 oldobjs="$oldobjs $func_extract_archives_result"
7862 # Do each command in the archive commands.
7863 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7864 cmds=$old_archive_from_new_cmds
7867 # Add any objects from preloaded convenience libraries
7868 if test -n "$dlprefiles"; then
7869 gentop="$output_objdir/${outputname}x"
7870 generated="$generated $gentop"
7872 func_extract_archives $gentop $dlprefiles
7873 oldobjs="$oldobjs $func_extract_archives_result"
7876 # POSIX demands no paths to be encoded in archives. We have
7877 # to avoid creating archives with duplicate basenames if we
7878 # might have to extract them afterwards, e.g., when creating a
7879 # static archive out of a convenience library, or when linking
7880 # the entirety of a libtool archive into another (currently
7881 # not supported by libtool).
7882 if (for obj in $oldobjs
7884 func_basename "$obj"
7885 $ECHO "$func_basename_result"
7886 done | sort | sort -uc >/dev/null 2>&1); then
7889 $ECHO "copying selected object files to avoid basename conflicts..."
7890 gentop="$output_objdir/${outputname}x"
7891 generated="$generated $gentop"
7892 func_mkdir_p "$gentop"
7893 save_oldobjs=$oldobjs
7896 for obj in $save_oldobjs
7898 func_basename "$obj"
7899 objbase="$func_basename_result"
7900 case " $oldobjs " in
7901 " ") oldobjs=$obj ;;
7904 # Make sure we don't pick an alternate name that also
7906 newobj=lt$counter-$objbase
7907 func_arith $counter + 1
7908 counter=$func_arith_result
7909 case " $oldobjs " in
7910 *[\ /]"$newobj "*) ;;
7911 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7914 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7915 oldobjs="$oldobjs $gentop/$newobj"
7917 *) oldobjs="$oldobjs $obj" ;;
7921 eval cmds=\"$old_archive_cmds\"
7924 len=$func_len_result
7925 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7926 cmds=$old_archive_cmds
7928 # the command line is too long to link in one step, link in parts
7929 func_verbose "using piecewise archive linking..."
7934 save_oldobjs=$oldobjs
7936 # Is there a better way of finding the last object in the list?
7937 for obj in $save_oldobjs
7941 eval test_cmds=\"$old_archive_cmds\"
7942 func_len " $test_cmds"
7943 len0=$func_len_result
7945 for obj in $save_oldobjs
7948 func_arith $len + $func_len_result
7949 len=$func_arith_result
7950 func_append objlist " $obj"
7951 if test "$len" -lt "$max_cmd_len"; then
7954 # the above command should be used before it gets too long
7956 if test "$obj" = "$last_oldobj" ; then
7959 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7960 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7967 if test "X$oldobjs" = "X" ; then
7968 eval cmds=\"\$concat_cmds\"
7970 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
7974 func_execute_cmds "$cmds" 'exit $?'
7977 test -n "$generated" && \
7978 func_show_eval "${RM}r$generated"
7980 # Now create the libtool archive.
7984 test "$build_old_libs" = yes && old_library="$libname.$libext"
7985 func_verbose "creating $output"
7987 # Preserve any variables that may affect compiler behavior
7988 for var in $variables_saved_for_relink; do
7989 if eval test -z \"\${$var+set}\"; then
7990 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7991 elif eval var_value=\$$var; test -z "$var_value"; then
7992 relink_command="$var=; export $var; $relink_command"
7994 func_quote_for_eval "$var_value"
7995 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7998 # Quote the link command for shipping.
7999 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8000 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8001 if test "$hardcode_automatic" = yes ; then
8005 # Only create the output if not a dry run.
8007 for installed in no yes; do
8008 if test "$installed" = yes; then
8009 if test -z "$install_libdir"; then
8012 output="$output_objdir/$outputname"i
8013 # Replace all uninstalled libtool libraries with the installed ones
8015 for deplib in $dependency_libs; do
8018 func_basename "$deplib"
8019 name="$func_basename_result"
8020 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8021 test -z "$libdir" && \
8022 func_fatal_error "\`$deplib' is not a valid libtool archive"
8023 newdependency_libs="$newdependency_libs $libdir/$name"
8025 *) newdependency_libs="$newdependency_libs $deplib" ;;
8028 dependency_libs="$newdependency_libs"
8031 for lib in $dlfiles; do
8034 func_basename "$lib"
8035 name="$func_basename_result"
8036 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8037 test -z "$libdir" && \
8038 func_fatal_error "\`$lib' is not a valid libtool archive"
8039 newdlfiles="$newdlfiles $libdir/$name"
8041 *) newdlfiles="$newdlfiles $lib" ;;
8044 dlfiles="$newdlfiles"
8046 for lib in $dlprefiles; do
8049 # Only pass preopened files to the pseudo-archive (for
8050 # eventual linking with the app. that links it) if we
8051 # didn't already link the preopened objects directly into
8053 func_basename "$lib"
8054 name="$func_basename_result"
8055 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8056 test -z "$libdir" && \
8057 func_fatal_error "\`$lib' is not a valid libtool archive"
8058 newdlprefiles="$newdlprefiles $libdir/$name"
8062 dlprefiles="$newdlprefiles"
8065 for lib in $dlfiles; do
8067 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8068 *) abs=`pwd`"/$lib" ;;
8070 newdlfiles="$newdlfiles $abs"
8072 dlfiles="$newdlfiles"
8074 for lib in $dlprefiles; do
8076 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8077 *) abs=`pwd`"/$lib" ;;
8079 newdlprefiles="$newdlprefiles $abs"
8081 dlprefiles="$newdlprefiles"
8084 # place dlname in correct position for cygwin
8086 case $host,$output,$installed,$module,$dlname in
8087 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8090 # $outputname - a libtool library file
8091 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8093 # Please DO NOT delete this file!
8094 # It is necessary for linking the library.
8096 # The name that we can dlopen(3).
8099 # Names of this library.
8100 library_names='$library_names'
8102 # The name of the static archive.
8103 old_library='$old_library'
8105 # Linker flags that can not go in dependency_libs.
8106 inherited_linker_flags='$new_inherited_linker_flags'
8108 # Libraries that this one depends upon.
8109 dependency_libs='$dependency_libs'
8111 # Names of additional weak libraries provided by this library
8112 weak_library_names='$weak_libs'
8114 # Version information for $libname.
8119 # Is this an already installed library?
8120 installed=$installed
8122 # Should we warn about portability when linking against -modules?
8123 shouldnotlink=$module
8125 # Files to dlopen/dlpreopen
8127 dlpreopen='$dlprefiles'
8129 # Directory that this library needs to be installed in:
8130 libdir='$install_libdir'"
8131 if test "$installed" = no && test "$need_relink" = yes; then
8133 relink_command=\"$relink_command\""
8138 # Do a symbolic link so that the libtool archive can be found in
8139 # LD_LIBRARY_PATH before the program is installed.
8140 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8146 { test "$mode" = link || test "$mode" = relink; } &&
8147 func_mode_link ${1+"$@"}
8150 # func_mode_uninstall arg...
8151 func_mode_uninstall ()
8159 # This variable tells wrapper scripts just to set variables rather
8160 # than running their programs.
8161 libtool_install_magic="$magic"
8166 -f) RM="$RM $arg"; rmforce=yes ;;
8167 -*) RM="$RM $arg" ;;
8168 *) files="$files $arg" ;;
8173 func_fatal_help "you must specify an RM program"
8177 origobjdir="$objdir"
8178 for file in $files; do
8179 func_dirname "$file" "" "."
8180 dir="$func_dirname_result"
8181 if test "X$dir" = X.; then
8182 objdir="$origobjdir"
8184 objdir="$dir/$origobjdir"
8186 func_basename "$file"
8187 name="$func_basename_result"
8188 test "$mode" = uninstall && objdir="$dir"
8190 # Remember objdir for removal later, being careful to avoid duplicates
8191 if test "$mode" = clean; then
8194 *) rmdirs="$rmdirs $objdir" ;;
8198 # Don't error if the file doesn't exist and rm -f was used.
8199 if { test -L "$file"; } >/dev/null 2>&1 ||
8200 { test -h "$file"; } >/dev/null 2>&1 ||
8201 test -f "$file"; then
8203 elif test -d "$file"; then
8206 elif test "$rmforce" = yes; then
8214 # Possibly a libtool archive, so verify it.
8215 if func_lalib_p "$file"; then
8216 func_source $dir/$name
8218 # Delete the libtool libraries and symlinks.
8219 for n in $library_names; do
8220 rmfiles="$rmfiles $objdir/$n"
8222 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8226 case " $library_names " in
8227 # " " in the beginning catches empty $dlname
8229 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8231 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8234 if test -n "$library_names"; then
8235 # Do each command in the postuninstall commands.
8236 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8239 if test -n "$old_library"; then
8240 # Do each command in the old_postuninstall commands.
8241 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8243 # FIXME: should reinstall the best remaining shared library.
8250 # Possibly a libtool object, so verify it.
8251 if func_lalib_p "$file"; then
8254 func_source $dir/$name
8256 # Add PIC object to the list of files to remove.
8257 if test -n "$pic_object" &&
8258 test "$pic_object" != none; then
8259 rmfiles="$rmfiles $dir/$pic_object"
8262 # Add non-PIC object to the list of files to remove.
8263 if test -n "$non_pic_object" &&
8264 test "$non_pic_object" != none; then
8265 rmfiles="$rmfiles $dir/$non_pic_object"
8271 if test "$mode" = clean ; then
8275 func_stripname '' '.exe' "$file"
8276 file=$func_stripname_result
8277 func_stripname '' '.exe' "$name"
8278 noexename=$func_stripname_result
8279 # $file with .exe has already been added to rmfiles,
8280 # add $file without .exe
8281 rmfiles="$rmfiles $file"
8284 # Do a test to see if this is a libtool program.
8285 if func_ltwrapper_p "$file"; then
8286 if func_ltwrapper_executable_p "$file"; then
8287 func_ltwrapper_scriptname "$file"
8289 func_source $func_ltwrapper_scriptname_result
8290 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8293 func_source $dir/$noexename
8296 # note $name still contains .exe if it was in $file originally
8297 # as does the version of $file that was added into $rmfiles
8298 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8299 if test "$fast_install" = yes && test -n "$relink_command"; then
8300 rmfiles="$rmfiles $objdir/lt-$name"
8302 if test "X$noexename" != "X$name" ; then
8303 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8309 func_show_eval "$RM $rmfiles" 'exit_status=1'
8311 objdir="$origobjdir"
8313 # Try to remove the ${objdir}s in the directories where we deleted files
8314 for dir in $rmdirs; do
8315 if test -d "$dir"; then
8316 func_show_eval "rmdir $dir >/dev/null 2>&1"
8323 { test "$mode" = uninstall || test "$mode" = clean; } &&
8324 func_mode_uninstall ${1+"$@"}
8326 test -z "$mode" && {
8327 help="$generic_help"
8328 func_fatal_help "you must specify a MODE"
8331 test -z "$exec_cmd" && \
8332 func_fatal_help "invalid operation mode \`$mode'"
8334 if test -n "$exec_cmd"; then
8335 eval exec "$exec_cmd"
8342 # The TAGs below are defined such that we never get into a situation
8343 # in which we disable both kinds of libraries. Given conflicting
8344 # choices, we go for a static library, that is the most portable,
8345 # since we can't tell whether shared libraries were disabled because
8346 # the user asked for that or because the platform doesn't support
8347 # them. This is particularly important on AIX, because we don't
8348 # support having both static and shared libraries enabled at the same
8349 # time on that platform, so we default to a shared-only configuration.
8350 # If a disable-shared tag is given, we'll fallback to a static-only
8351 # configuration. But we'll never go from static-only to shared-only.
8353 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8354 build_libtool_libs=no
8356 # ### END LIBTOOL TAG CONFIG: disable-shared
8358 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8359 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8360 # ### END LIBTOOL TAG CONFIG: disable-static