3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (lcms2) 2.3
5 # Libtool was configured on host gpeegpee-ubuntu:
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, 2009, 2010 Free Software Foundation,
11 # Written by Gordon Matzigkeit, 1996
13 # This file is part of GNU Libtool.
15 # GNU Libtool is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation; either version 2 of
18 # the License, or (at your option) any later version.
20 # As a special exception to the GNU General Public License,
21 # if you distribute this file as part of a program or library that
22 # is built using GNU Libtool, you may include this file under the
23 # same distribution terms that you use for the rest of that program.
25 # GNU Libtool is distributed in the hope that it will be useful,
26 # but WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 # GNU General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with GNU Libtool; see the file COPYING. If not, a copy
32 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
33 # obtained by writing to the Free Software Foundation, Inc.,
34 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37 # The names of the tagged configurations supported by this script.
40 # ### BEGIN LIBTOOL CONFIG
42 # Whether or not to build shared libraries.
43 build_libtool_libs=yes
45 # Whether or not to build static libraries.
51 # DLL creation program.
54 # Object dumper program.
57 # Which release of libtool.m4 was used?
61 # What type of objects to build.
64 # Whether or not to optimize for fast installation.
67 # Shell to use when invoking shell scripts.
70 # An echo program that protects backslashes.
75 host=arm-unknown-linux-gnueabi
80 build=arm-unknown-linux-gnueabi
81 build_os=linux-gnueabi
83 # A sed program that does not truncate output.
86 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
87 Xsed="$SED -e 1s/^X//"
89 # A grep program that handles long lines.
95 # A literal string matcher.
98 # A BSD- or MS-compatible name lister.
101 # Whether we need soft or hard links.
104 # What is the maximum length of a command?
107 # Object file suffix (normally "o").
110 # Executable file suffix (normally "").
113 # whether the shell understands "unset".
116 # turn spaces into newlines.
117 SP2NL="tr \\040 \\012"
119 # turn newlines into spaces.
120 NL2SP="tr \\015\\012 \\040\\040"
122 # convert $build file names to $host format.
123 to_host_file_cmd=func_convert_file_noop
125 # convert $build files to toolchain format.
126 to_tool_file_cmd=func_convert_file_noop
128 # Method to check whether dependent libraries are shared objects.
129 deplibs_check_method="pass_all"
131 # Command to use when deplibs_check_method = "file_magic".
132 file_magic_cmd="\$MAGIC_CMD"
134 # How to find potential files when deplibs_check_method = "file_magic".
137 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
140 # Command to associate shared and link libraries.
141 sharedlib_from_linklib_cmd="printf %s\\n"
146 # Flags to create an archive.
149 # How to feed a file listing to the archiver.
150 archiver_list_spec="@"
152 # A symbol stripping program.
155 # Commands used to install an old-style archive.
157 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
158 old_postuninstall_cmds=""
160 # Whether to use a lock for old archive extraction.
161 lock_old_archive_extraction=no
164 LTCC="gcc -std=gnu99"
166 # LTCC compiler flags.
169 # Take the output of nm and produce a listing of raw symbols and C names.
170 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
172 # Transform the output of nm in a proper C declaration.
173 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
175 # Transform the output of nm in a C name address pair.
176 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
178 # Transform the output of nm in a C name address pair when lib prefix is needed.
179 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'"
181 # Specify filename containing input files for $NM.
182 nm_file_list_spec="@"
184 # The root where to search for dependent libraries,and in which our libraries should be installed.
187 # The name of the directory that contains temporary libtool files.
190 # Used to examine libraries when file_magic_cmd begins with "file".
193 # Must we lock files when doing compilation?
199 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
202 # Tool to change global to local symbols on Mac OS X.
205 # Tool to manipulate fat objects and archives on Mac OS X.
208 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
211 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
214 # Old archive suffix (normally "a").
217 # Shared library suffix (normally ".so").
220 # The commands to extract the exported symbol list from a shared archive.
221 extract_expsyms_cmds=""
223 # Variables whose values should be saved in libtool wrapper scripts and
224 # restored at link time.
225 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
227 # Do we need the "lib" prefix for modules?
230 # Do we need a version for libraries?
233 # Library versioning type.
236 # Shared library runtime path variable.
237 runpath_var=LD_RUN_PATH
239 # Shared library path variable.
240 shlibpath_var=LD_LIBRARY_PATH
242 # Is shlibpath searched before the hard-coded library search path?
243 shlibpath_overrides_runpath=no
245 # Format of library name prefix.
246 libname_spec="lib\$name"
248 # List of archive names. First name is the real one, the rest are links.
249 # The last name is the one that the linker finds with -lNAME
250 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
252 # The coded name of the library, if different from the real name.
253 soname_spec="\${libname}\${release}\${shared_ext}\$major"
255 # Permission mode override for installation of shared libraries.
256 install_override_mode=""
258 # Command to use after installation of a shared archive.
261 # Command to use after uninstallation of a shared archive.
262 postuninstall_cmds=""
264 # Commands used to finish a libtool library installation in a directory.
265 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
267 # As "finish_cmds", except a single script fragment to be evaled but
271 # Whether we should hardcode library paths into libraries.
272 hardcode_into_libs=yes
274 # Compile-time system search path for libraries.
275 sys_lib_search_path_spec="/usr/lib/gcc/arm-linux-gnueabi/4.5.3 /usr/arm-linux-gnueabi/lib "
277 # Run-time system search path for libraries.
278 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/local/lib "
280 # Whether dlopen is supported.
281 dlopen_support=unknown
283 # Whether dlopen of programs is supported.
286 # Whether dlopen of statically linked programs is supported.
287 dlopen_self_static=unknown
289 # Commands to strip libraries.
290 old_striplib="strip --strip-debug"
291 striplib="strip --strip-unneeded"
294 # The linker used to build libraries.
295 LD="/usr/arm-linux-gnueabi/bin/ld"
297 # How to create reloadable object files.
299 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
301 # Commands used to build an old-style archive.
302 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
304 # A language specific compiler.
307 # Is the compiler the GNU compiler?
310 # Compiler flag to turn off builtin functions.
311 no_builtin_flag=" -fno-builtin"
313 # Additional compiler flags for building library objects.
314 pic_flag=" -fPIC -DPIC"
316 # How to pass a linker flag through the compiler.
319 # Compiler flag to prevent dynamic linking.
320 link_static_flag="-static"
322 # Does compiler simultaneously support -c and -o options?
325 # Whether or not to add -lc for building shared libraries.
326 build_libtool_need_lc=no
328 # Whether or not to disallow shared libs when runtime libs are static.
329 allow_libtool_libs_with_static_runtimes=no
331 # Compiler flag to allow reflexive dlopens.
332 export_dynamic_flag_spec="\${wl}--export-dynamic"
334 # Compiler flag to generate shared objects directly from archives.
335 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
337 # Whether the compiler copes with passing no objects directly.
338 compiler_needs_object="no"
340 # Create an old-style archive from a shared archive.
341 old_archive_from_new_cmds=""
343 # Create a temporary old-style archive to link instead of a shared archive.
344 old_archive_from_expsyms_cmds=""
346 # Commands used to build a shared archive.
347 archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
348 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
349 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
350 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
351 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
353 # Commands used to build a loadable module if different from building
356 module_expsym_cmds=""
358 # Whether we are building with GNU ld or not.
361 # Flag that allows shared libraries with undefined symbols to be built.
362 allow_undefined_flag=""
364 # Flag that enforces no undefined symbols.
367 # Flag to hardcode $libdir into a binary during linking.
368 # This must work even if $libdir does not exist
369 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
371 # If ld is used when linking, flag to hardcode $libdir into a binary
372 # during linking. This must work even if $libdir does not exist.
373 hardcode_libdir_flag_spec_ld=""
375 # Whether we need a single "-rpath" flag with a separated argument.
376 hardcode_libdir_separator=""
378 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
379 # DIR into the resulting binary.
382 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
383 # DIR into the resulting binary and the resulting library dependency is
384 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
385 # library is relocated.
386 hardcode_direct_absolute=no
388 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
389 # into the resulting binary.
392 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
393 # into the resulting binary.
394 hardcode_shlibpath_var=unsupported
396 # Set to "yes" if building a shared library automatically hardcodes DIR
397 # into the library and all subsequent libraries and executables linked
399 hardcode_automatic=no
401 # Set to yes if linker adds runtime paths of dependent libraries
402 # to runtime path list.
405 # Whether libtool must link a program against all its dependency libraries.
406 link_all_deplibs=unknown
408 # Set to "yes" if exported symbols are required.
409 always_export_symbols=no
411 # The commands to list exported symbols.
412 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
414 # Symbols that should not be listed in the preloaded symbols.
415 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
417 # Symbols that must always be exported.
420 # Commands necessary for linking programs (against libraries) with templates.
423 # Commands necessary for finishing linking programs.
426 # Specify filename containing input files.
429 # How to hardcode a shared library path into an executable.
430 hardcode_action=immediate
432 # The directories searched by this compiler when creating a shared library.
433 compiler_lib_search_dirs=""
435 # Dependencies to place before and after the objects being linked to
436 # create a shared library.
442 # The library search path used internally by the compiler when linking
444 compiler_lib_search_path=""
446 # ### END LIBTOOL CONFIG
449 # libtool (GNU libtool) 2.4
450 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
452 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
453 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
454 # This is free software; see the source for copying conditions. There is NO
455 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
457 # GNU Libtool is free software; you can redistribute it and/or modify
458 # it under the terms of the GNU General Public License as published by
459 # the Free Software Foundation; either version 2 of the License, or
460 # (at your option) any later version.
462 # As a special exception to the GNU General Public License,
463 # if you distribute this file as part of a program or library that
464 # is built using GNU Libtool, you may include this file under the
465 # same distribution terms that you use for the rest of that program.
467 # GNU Libtool is distributed in the hope that it will be useful, but
468 # WITHOUT ANY WARRANTY; without even the implied warranty of
469 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
470 # General Public License for more details.
472 # You should have received a copy of the GNU General Public License
473 # along with GNU Libtool; see the file COPYING. If not, a copy
474 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
475 # or obtained by writing to the Free Software Foundation, Inc.,
476 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
478 # Usage: $progname [OPTION]... [MODE-ARG]...
480 # Provide generalized library-building support services.
482 # --config show all configuration variables
483 # --debug enable verbose shell tracing
484 # -n, --dry-run display commands without modifying any files
485 # --features display basic configuration information and exit
486 # --mode=MODE use operation mode MODE
487 # --preserve-dup-deps don't remove duplicate dependency libraries
488 # --quiet, --silent don't print informational messages
489 # --no-quiet, --no-silent
490 # print informational messages (default)
491 # --tag=TAG use configuration variables from tag TAG
492 # -v, --verbose print more informational messages than default
493 # --no-verbose don't print the extra informational messages
494 # --version print version information
495 # -h, --help, --help-all print short, long, or detailed help message
497 # MODE must be one of the following:
499 # clean remove files from the build directory
500 # compile compile a source file into a libtool object
501 # execute automatically set library path, then run a program
502 # finish complete the installation of libtool libraries
503 # install install libraries or executables
504 # link create a library or an executable
505 # uninstall remove libraries from an installed directory
507 # MODE-ARGS vary depending on the MODE. When passed as first option,
508 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
509 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
511 # When reporting a bug, please describe a test case to reproduce it and
512 # include the following information:
514 # host-triplet: $host
517 # compiler flags: $LTCFLAGS
518 # linker: $LD (gnu? $with_gnu_ld)
519 # $progname: (GNU libtool) 2.4
520 # automake: $automake_version
521 # autoconf: $autoconf_version
523 # Report bugs to <bug-libtool@gnu.org>.
524 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
525 # General help using GNU software: <http://www.gnu.org/gethelp/>.
531 package_revision=1.3294
533 # Be Bourne compatible
534 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
537 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
538 # is contrary to our usage. Disable this feature.
539 alias -g '${1+"$@"}'='"$@"'
542 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
544 BIN_SH=xpg4; export BIN_SH # for Tru64
545 DUALCASE=1; export DUALCASE # for MKS sh
547 # A function that is used when there is no print builtin or printf.
548 func_fallback_echo ()
550 eval 'cat <<_LTECHO_EOF
555 # NLS nuisances: We save the old values to restore during execute mode.
558 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
560 eval "if test \"\${$lt_var+set}\" = set; then
561 save_$lt_var=\$$lt_var
564 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
565 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
570 export LANGUAGE LC_ALL
575 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
576 # is ksh but when the shell is invoked as "sh" and the current value of
577 # the _XPG environment variable is not equal to 1 (one), the special
578 # positional parameter $0, within a function call, is the name of the
585 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
586 : ${EGREP="/usr/bin/grep -E"}
587 : ${FGREP="/usr/bin/grep -F"}
588 : ${GREP="/usr/bin/grep"}
594 : ${SED="/usr/bin/sed"}
595 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
596 : ${Xsed="$SED -e 1s/^X//"}
601 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
602 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
604 exit_status=$EXIT_SUCCESS
606 # Make sure IFS has a sensible default
611 dirname="s,/[^/]*$,,"
614 # func_dirname file append nondir_replacement
615 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
616 # otherwise set result to NONDIR_REPLACEMENT.
620 */*) func_dirname_result="${1%/*}${2}" ;;
621 * ) func_dirname_result="${3}" ;;
623 } # Extended-shell func_dirname implementation
629 func_basename_result="${1##*/}"
630 } # Extended-shell func_basename implementation
633 # func_dirname_and_basename file append nondir_replacement
634 # perform func_basename and func_dirname in a single function
636 # dirname: Compute the dirname of FILE. If nonempty,
637 # add APPEND to the result, otherwise set result
638 # to NONDIR_REPLACEMENT.
639 # value returned in "$func_dirname_result"
640 # basename: Compute filename of FILE.
641 # value retuned in "$func_basename_result"
642 # Implementation must be kept synchronized with func_dirname
643 # and func_basename. For efficiency, we do not delegate to
644 # those functions but instead duplicate the functionality here.
645 func_dirname_and_basename ()
648 */*) func_dirname_result="${1%/*}${2}" ;;
649 * ) func_dirname_result="${3}" ;;
651 func_basename_result="${1##*/}"
652 } # Extended-shell func_dirname_and_basename implementation
655 # func_stripname prefix suffix name
656 # strip PREFIX and SUFFIX off of NAME.
657 # PREFIX and SUFFIX must not contain globbing or regex special
658 # characters, hashes, percent signs, but SUFFIX may contain a leading
659 # dot (in which case that matches only a dot).
660 # func_strip_suffix prefix name
663 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
664 # positional parameters, so assign one to ordinary parameter first.
665 func_stripname_result=${3}
666 func_stripname_result=${func_stripname_result#"${1}"}
667 func_stripname_result=${func_stripname_result%"${2}"}
668 } # Extended-shell func_stripname implementation
671 # These SED scripts presuppose an absolute path with a trailing slash.
672 pathcar='s,^/\([^/]*\).*$,\1,'
673 pathcdr='s,^/[^/]*,,'
674 removedotparts=':dotsl
678 collapseslashes='s@/\{1,\}@/@g'
679 finalslash='s,/*$,/,'
681 # func_normal_abspath PATH
682 # Remove doubled-up and trailing slashes, "." path components,
683 # and cancel out any ".." path components in PATH after making
684 # it an absolute path.
685 # value returned in "$func_normal_abspath_result"
686 func_normal_abspath ()
688 # Start from root dir and reassemble the path.
689 func_normal_abspath_result=
690 func_normal_abspath_tpath=$1
691 func_normal_abspath_altnamespace=
692 case $func_normal_abspath_tpath in
694 # Empty path, that just means $cwd.
695 func_stripname '' '/' "`pwd`"
696 func_normal_abspath_result=$func_stripname_result
699 # The next three entries are used to spot a run of precisely
700 # two leading slashes without using negated character classes;
701 # we take advantage of case's first-match behaviour.
703 # Unusual form of absolute path, do nothing.
706 # Not necessarily an ordinary path; POSIX reserves leading '//'
707 # and for example Cygwin uses it to access remote file shares
708 # over CIFS/SMB, so we conserve a leading double slash if found.
709 func_normal_abspath_altnamespace=/
712 # Absolute path, do nothing.
715 # Relative path, prepend $cwd.
716 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
719 # Cancel out all the simple stuff to save iterations. We also want
720 # the path to end with a slash for ease of parsing, so make sure
721 # there is one (and only one) here.
722 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
723 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
725 # Processed it all yet?
726 if test "$func_normal_abspath_tpath" = / ; then
727 # If we ascended to the root using ".." the result may be empty now.
728 if test -z "$func_normal_abspath_result" ; then
729 func_normal_abspath_result=/
733 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
735 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
737 # Figure out what to do with it
738 case $func_normal_abspath_tcomponent in
740 # Trailing empty path component, ignore it.
743 # Parent dir; strip last assembled component from result.
744 func_dirname "$func_normal_abspath_result"
745 func_normal_abspath_result=$func_dirname_result
748 # Actual path component, append it.
749 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
753 # Restore leading double-slash if one was found on entry.
754 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
757 # func_relative_path SRCDIR DSTDIR
758 # generates a relative path from SRCDIR to DSTDIR, with a trailing
759 # slash if non-empty, suitable for immediately appending a filename
760 # without needing to append a separator.
761 # value returned in "$func_relative_path_result"
762 func_relative_path ()
764 func_relative_path_result=
765 func_normal_abspath "$1"
766 func_relative_path_tlibdir=$func_normal_abspath_result
767 func_normal_abspath "$2"
768 func_relative_path_tbindir=$func_normal_abspath_result
770 # Ascend the tree starting from libdir
772 # check if we have found a prefix of bindir
773 case $func_relative_path_tbindir in
774 $func_relative_path_tlibdir)
775 # found an exact match
776 func_relative_path_tcancelled=
779 $func_relative_path_tlibdir*)
780 # found a matching prefix
781 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
782 func_relative_path_tcancelled=$func_stripname_result
783 if test -z "$func_relative_path_result"; then
784 func_relative_path_result=.
789 func_dirname $func_relative_path_tlibdir
790 func_relative_path_tlibdir=${func_dirname_result}
791 if test "x$func_relative_path_tlibdir" = x ; then
792 # Have to descend all the way to the root!
793 func_relative_path_result=../$func_relative_path_result
794 func_relative_path_tcancelled=$func_relative_path_tbindir
797 func_relative_path_result=../$func_relative_path_result
802 # Now calculate path; take care to avoid doubling-up slashes.
803 func_stripname '' '/' "$func_relative_path_result"
804 func_relative_path_result=$func_stripname_result
805 func_stripname '/' '/' "$func_relative_path_tcancelled"
806 if test "x$func_stripname_result" != x ; then
807 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
810 # Normalisation. If bindir is libdir, return empty string,
811 # else relative path ending with a slash; either way, target
812 # file name can be directly appended.
813 if test ! -z "$func_relative_path_result"; then
814 func_stripname './' '' "$func_relative_path_result/"
815 func_relative_path_result=$func_stripname_result
819 # The name of this program:
820 func_dirname_and_basename "$progpath"
821 progname=$func_basename_result
823 # Make sure we have an absolute path for reexecution:
825 [\\/]*|[A-Za-z]:\\*) ;;
827 progdir=$func_dirname_result
828 progdir=`cd "$progdir" && pwd`
829 progpath="$progdir/$progname"
834 for progdir in $PATH; do
836 test -x "$progdir/$progname" && break
839 test -n "$progdir" || progdir=`pwd`
840 progpath="$progdir/$progname"
844 # Sed substitution that helps us do robust quoting. It backslashifies
845 # metacharacters that are still active within double-quoted strings.
846 Xsed="${SED}"' -e 1s/^X//'
847 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
849 # Same as above, but do not quote variable references.
850 double_quote_subst='s/\(["`\\]\)/\\\1/g'
852 # Sed substitution that turns a string into a regex matching for the
854 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
856 # Sed substitution that converts a w32 file name or path
857 # which contains forward slashes, into one that contains
858 # (escaped) backslashes. A very naive implementation.
859 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
861 # Re-`\' parameter expansions in output of double_quote_subst that were
862 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
863 # in input to double_quote_subst, that '$' was protected from expansion.
864 # Since each input `\' is now two `\'s, look for any number of runs of
865 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
870 sed_double_backslash="\
874 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
885 # Echo program name prefixed message, along with the current mode
886 # name if it has been set yet.
889 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
892 # func_verbose arg...
893 # Echo program name prefixed message in verbose mode only.
896 $opt_verbose && func_echo ${1+"$@"}
898 # A bug in bash halts the script if the last line of a function
899 # fails when set -e is in force, so we need another command to
904 # func_echo_all arg...
905 # Invoke $ECHO with all args, space-separated.
912 # Echo program name prefixed message to standard error.
915 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
918 # func_warning arg...
919 # Echo program name prefixed warning message to standard error.
922 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
928 # func_fatal_error arg...
929 # Echo program name prefixed message to standard error, and exit.
936 # func_fatal_help arg...
937 # Echo program name prefixed message to standard error, followed by
938 # a help hint, and exit.
942 func_fatal_error "$help"
944 help="Try \`$progname --help' for more information." ## default
947 # func_grep expression filename
948 # Check whether EXPRESSION matches any line of FILENAME, without output.
951 $GREP "$1" "$2" >/dev/null 2>&1
955 # func_mkdir_p directory-path
956 # Make sure the entire path to DIRECTORY-PATH is available.
959 my_directory_path="$1"
962 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
964 # Protect directory names starting with `-'
965 case $my_directory_path in
966 -*) my_directory_path="./$my_directory_path" ;;
969 # While some portion of DIR does not yet exist...
970 while test ! -d "$my_directory_path"; do
971 # ...make a list in topmost first order. Use a colon delimited
972 # list incase some portion of path contains whitespace.
973 my_dir_list="$my_directory_path:$my_dir_list"
975 # If the last portion added has no slash in it, the list is done
976 case $my_directory_path in */*) ;; *) break ;; esac
978 # ...otherwise throw away the child directory and loop
979 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
981 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
983 save_mkdir_p_IFS="$IFS"; IFS=':'
984 for my_dir in $my_dir_list; do
985 IFS="$save_mkdir_p_IFS"
986 # mkdir can fail with a `File exist' error if two processes
987 # try to create one of the directories concurrently. Don't
989 $MKDIR "$my_dir" 2>/dev/null || :
991 IFS="$save_mkdir_p_IFS"
993 # Bail out if we (or some other process) failed to create a directory.
994 test -d "$my_directory_path" || \
995 func_fatal_error "Failed to create \`$1'"
1000 # func_mktempdir [string]
1001 # Make a temporary directory that won't clash with other running
1002 # libtool processes, and avoids race conditions if possible. If
1003 # given, STRING is the basename for that directory.
1006 my_template="${TMPDIR-/tmp}/${1-$progname}"
1008 if test "$opt_dry_run" = ":"; then
1009 # Return a directory name, but don't create it in dry-run mode
1010 my_tmpdir="${my_template}-$$"
1013 # If mktemp works, use that first and foremost
1014 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
1016 if test ! -d "$my_tmpdir"; then
1017 # Failing that, at least try and use $RANDOM to avoid a race
1018 my_tmpdir="${my_template}-${RANDOM-0}$$"
1020 save_mktempdir_umask=`umask`
1023 umask $save_mktempdir_umask
1026 # If we're not in dry-run mode, bomb out on failure
1027 test -d "$my_tmpdir" || \
1028 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1035 # func_quote_for_eval arg
1036 # Aesthetically quote ARG to be evaled later.
1037 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1038 # is double-quoted, suitable for a subsequent eval, whereas
1039 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1040 # which are still active within double quotes backslashified.
1041 func_quote_for_eval ()
1045 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1047 func_quote_for_eval_unquoted_result="$1" ;;
1050 case $func_quote_for_eval_unquoted_result in
1051 # Double-quote args containing shell metacharacters to delay
1052 # word splitting, command substitution and and variable
1053 # expansion for a subsequent eval.
1054 # Many Bourne shells cannot handle close brackets correctly
1055 # in scan sets, so we specify it separately.
1056 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1057 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1060 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1065 # func_quote_for_expand arg
1066 # Aesthetically quote ARG to be evaled later; same as above,
1067 # but do not quote variable references.
1068 func_quote_for_expand ()
1072 my_arg=`$ECHO "$1" | $SED \
1073 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1079 # Double-quote args containing shell metacharacters to delay
1080 # word splitting and command substitution for a subsequent eval.
1081 # Many Bourne shells cannot handle close brackets correctly
1082 # in scan sets, so we specify it separately.
1083 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1084 my_arg="\"$my_arg\""
1088 func_quote_for_expand_result="$my_arg"
1092 # func_show_eval cmd [fail_exp]
1093 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1094 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1095 # is given, then evaluate it.
1099 my_fail_exp="${2-:}"
1101 ${opt_silent-false} || {
1102 func_quote_for_expand "$my_cmd"
1103 eval "func_echo $func_quote_for_expand_result"
1106 if ${opt_dry_run-false}; then :; else
1109 if test "$my_status" -eq 0; then :; else
1110 eval "(exit $my_status); $my_fail_exp"
1116 # func_show_eval_locale cmd [fail_exp]
1117 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1118 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1119 # is given, then evaluate it. Use the saved locale for evaluation.
1120 func_show_eval_locale ()
1123 my_fail_exp="${2-:}"
1125 ${opt_silent-false} || {
1126 func_quote_for_expand "$my_cmd"
1127 eval "func_echo $func_quote_for_expand_result"
1130 if ${opt_dry_run-false}; then :; else
1131 eval "$lt_user_locale
1134 eval "$lt_safe_locale"
1135 if test "$my_status" -eq 0; then :; else
1136 eval "(exit $my_status); $my_fail_exp"
1142 # Turn $1 into a string suitable for a shell variable name.
1143 # Result is stored in $func_tr_sh_result. All characters
1144 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1145 # if $1 begins with a digit, a '_' is prepended as well.
1149 [0-9]* | *[!a-zA-Z0-9_]*)
1150 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1153 func_tr_sh_result=$1
1160 # Echo version message to standard output and exit.
1173 /^# '$PROGRAM' (GNU /,/# warranty; / {
1176 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1183 # Echo short help message to standard output and exit.
1188 $SED -n '/^# Usage:/,/^# *.*--help/ {
1191 s/\$progname/'$progname'/
1195 $ECHO "run \`$progname --help | more' for full usage"
1199 # func_help [NOEXIT]
1200 # Echo long help message to standard output and exit,
1201 # unless 'noexit' is passed as argument.
1206 $SED -n '/^# Usage:/,/# Report bugs to/ {
1210 s*\$progname*'$progname'*
1212 s*\$SHELL*'"$SHELL"'*
1214 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1216 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1217 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1218 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1222 /^# .* home page:/b print
1223 /^# General help using/b print
1226 if test -z "$1"; then
1231 # func_missing_arg argname
1232 # Echo program name prefixed message to standard error and set global
1238 func_error "missing argument for $1."
1243 # func_split_short_opt shortopt
1244 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1245 # variables after splitting SHORTOPT after the 2nd character.
1246 func_split_short_opt ()
1248 func_split_short_opt_arg=${1#??}
1249 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1250 } # Extended-shell func_split_short_opt implementation
1253 # func_split_long_opt longopt
1254 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1255 # variables after splitting LONGOPT at the `=' sign.
1256 func_split_long_opt ()
1258 func_split_long_opt_name=${1%%=*}
1259 func_split_long_opt_arg=${1#*=}
1260 } # Extended-shell func_split_long_opt implementation
1268 magic="%%%MAGIC variable%%%"
1269 magic_exe="%%%MAGIC EXE variable%%%"
1274 lo2o="s/\\.lo\$/.${objext}/"
1275 o2lo="s/\\.${objext}\$/.lo/"
1279 # If this variable is set in any of the actions, the command in it
1280 # will be execed at the end. This prevents here-documents from being
1281 # left over by shells.
1284 # func_append var value
1285 # Append VALUE to the end of shell variable VAR.
1289 } # Extended-shell func_append implementation
1291 # func_append_quoted var value
1292 # Quote VALUE and append to the end of shell variable VAR, separated
1294 func_append_quoted ()
1296 func_quote_for_eval "${2}"
1297 eval "${1}+=\\ \$func_quote_for_eval_result"
1298 } # Extended-shell func_append_quoted implementation
1301 # func_arith arithmetic-term...
1304 func_arith_result=$(( $* ))
1305 } # Extended-shell func_arith implementation
1309 # STRING may not start with a hyphen.
1312 func_len_result=${#1}
1313 } # Extended-shell func_len implementation
1320 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1321 *) func_lo2o_result=${1} ;;
1323 } # Extended-shell func_lo2o implementation
1326 # func_xform libobj-or-source
1329 func_xform_result=${1%.*}.lo
1330 } # Extended-shell func_xform implementation
1333 # func_fatal_configuration arg...
1334 # Echo program name prefixed message to standard error, followed by
1335 # a configuration failure hint, and exit.
1336 func_fatal_configuration ()
1338 func_error ${1+"$@"}
1339 func_error "See the $PACKAGE documentation for more information."
1340 func_fatal_error "Fatal configuration error."
1345 # Display the configuration for all the tags in this script.
1348 re_begincf='^# ### BEGIN LIBTOOL'
1349 re_endcf='^# ### END LIBTOOL'
1351 # Default configuration.
1352 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1354 # Now print the configurations for the tags.
1355 for tagname in $taglist; do
1356 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1363 # Display the features supported by this script.
1367 if test "$build_libtool_libs" = yes; then
1368 echo "enable shared libraries"
1370 echo "disable shared libraries"
1372 if test "$build_old_libs" = yes; then
1373 echo "enable static libraries"
1375 echo "disable static libraries"
1381 # func_enable_tag tagname
1382 # Verify that TAGNAME is valid, and either flag an error and exit, or
1383 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1390 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1391 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1392 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1397 func_fatal_error "invalid tag name: $tagname"
1401 # Don't test for the "default" C tag, as we know it's
1402 # there but not specially marked.
1406 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1407 taglist="$taglist $tagname"
1409 # Evaluate the configuration. Be careful to quote the path
1410 # and the sed script, to avoid splitting on whitespace, but
1411 # also don't use non-portable quotes within backquotes within
1412 # quotes we have to do it in 2 steps:
1413 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1416 func_error "ignoring unknown tag $tagname"
1422 # func_check_version_match
1423 # Ensure that we are using m4 macros, and libtool script from the same
1424 # release of libtool.
1425 func_check_version_match ()
1427 if test "$package_revision" != "$macro_revision"; then
1428 if test "$VERSION" != "$macro_version"; then
1429 if test -z "$macro_version"; then
1431 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1432 $progname: definition of this LT_INIT comes from an older release.
1433 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1434 $progname: and run autoconf again.
1438 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1439 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1440 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1441 $progname: and run autoconf again.
1446 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1447 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1448 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1449 $progname: of $PACKAGE $VERSION and run autoconf again.
1458 # Shorthand for --mode=foo, only valid as the first argument
1461 shift; set dummy --mode clean ${1+"$@"}; shift
1463 compile|compil|compi|comp|com|co|c)
1464 shift; set dummy --mode compile ${1+"$@"}; shift
1466 execute|execut|execu|exec|exe|ex|e)
1467 shift; set dummy --mode execute ${1+"$@"}; shift
1469 finish|finis|fini|fin|fi|f)
1470 shift; set dummy --mode finish ${1+"$@"}; shift
1472 install|instal|insta|inst|ins|in|i)
1473 shift; set dummy --mode install ${1+"$@"}; shift
1476 shift; set dummy --mode link ${1+"$@"}; shift
1478 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1479 shift; set dummy --mode uninstall ${1+"$@"}; shift
1489 opt_preserve_dup_deps=false
1500 # Parse options once, thoroughly. This comes as soon as possible in the
1501 # script to make things like `--version' happen as quickly as we can.
1503 # this just eases exit handling
1504 while test $# -gt 0; do
1508 --debug|-x) opt_debug='set -x'
1509 func_echo "enabling shell trace mode"
1512 --dry-run|--dryrun|-n)
1521 opt_dlopen="${opt_dlopen+$opt_dlopen
1525 --preserve-dup-deps)
1526 opt_preserve_dup_deps=:
1534 set dummy --mode finish ${1+"$@"}; shift
1541 opt_help=': help-all'
1544 test $# = 0 && func_missing_arg $opt && break
1548 # Valid mode arguments:
1549 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1551 # Catch anything else as an error
1552 *) func_error "invalid argument for $opt"
1559 --no-silent|--no-quiet)
1561 preserve_args+=" $opt"
1565 preserve_args+=" $opt"
1569 preserve_args+=" $opt"
1574 preserve_args+=" $opt"
1578 test $# = 0 && func_missing_arg $opt && break
1581 preserve_args+=" $opt $optarg"
1582 func_enable_tag "$optarg"
1586 -\?|-h) func_usage ;;
1587 --help) func_help ;;
1588 --version) func_version ;;
1590 # Separate optargs to long options:
1592 func_split_long_opt "$opt"
1593 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1597 # Separate non-argument short options:
1599 func_split_short_opt "$opt"
1600 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1605 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1606 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1612 # save first non-option argument
1613 if test "$#" -gt 0; then
1619 test "$opt_debug" = : || preserve_args+=" --debug"
1622 *cygwin* | *mingw* | *pw32* | *cegcc*)
1623 # don't eliminate duplications in $postdeps and $predeps
1624 opt_duplicate_compiler_generated_deps=:
1627 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1632 # Sanity checks first:
1633 func_check_version_match
1635 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1636 func_fatal_configuration "not configured to build any kind of library"
1640 eval std_shrext=\"$shrext_cmds\"
1642 # Only execute mode is allowed to have -dlopen flags.
1643 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1644 func_error "unrecognized option \`-dlopen'"
1649 # Change the help message to a mode-specific one.
1650 generic_help="$help"
1651 help="Try \`$progname --help --mode=$opt_mode' for more information."
1655 # Bail if the options were screwed
1656 $exit_cmd $EXIT_FAILURE
1667 # True iff FILE is a libtool `.la' library or `.lo' object file.
1668 # This function is only a basic sanity check; it will hardly flush out
1669 # determined imposters.
1673 $SED -e 4q "$1" 2>/dev/null \
1674 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1677 # func_lalib_unsafe_p file
1678 # True iff FILE is a libtool `.la' library or `.lo' object file.
1679 # This function implements the same check as func_lalib_p without
1680 # resorting to external programs. To this end, it redirects stdin and
1681 # closes it afterwards, without saving the original file descriptor.
1682 # As a safety measure, use it only where a negative result would be
1683 # fatal anyway. Works if `file' does not exist.
1684 func_lalib_unsafe_p ()
1687 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1688 for lalib_p_l in 1 2 3 4
1691 case "$lalib_p_line" in
1692 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1697 test "$lalib_p" = yes
1700 # func_ltwrapper_script_p file
1701 # True iff FILE is a libtool wrapper script
1702 # This function is only a basic sanity check; it will hardly flush out
1703 # determined imposters.
1704 func_ltwrapper_script_p ()
1709 # func_ltwrapper_executable_p file
1710 # True iff FILE is a libtool wrapper executable
1711 # This function is only a basic sanity check; it will hardly flush out
1712 # determined imposters.
1713 func_ltwrapper_executable_p ()
1715 func_ltwrapper_exec_suffix=
1718 *) func_ltwrapper_exec_suffix=.exe ;;
1720 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1723 # func_ltwrapper_scriptname file
1724 # Assumes file is an ltwrapper_executable
1725 # uses $file to determine the appropriate filename for a
1726 # temporary ltwrapper_script.
1727 func_ltwrapper_scriptname ()
1729 func_dirname_and_basename "$1" "" "."
1730 func_stripname '' '.exe' "$func_basename_result"
1731 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1734 # func_ltwrapper_p file
1735 # True iff FILE is a libtool wrapper script or wrapper executable
1736 # This function is only a basic sanity check; it will hardly flush out
1737 # determined imposters.
1740 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1744 # func_execute_cmds commands fail_cmd
1745 # Execute tilde-delimited COMMANDS.
1746 # If FAIL_CMD is given, eval that upon failure.
1747 # FAIL_CMD may read-access the current command in variable CMD!
1748 func_execute_cmds ()
1751 save_ifs=$IFS; IFS='~'
1755 func_show_eval "$cmd" "${2-:}"
1762 # Source FILE, adding directory component if necessary.
1763 # Note that it is not necessary on cygwin/mingw to append a dot to
1764 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1765 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1766 # `FILE.' does not work on cygwin managed mounts.
1771 */* | *\\*) . "$1" ;;
1777 # func_resolve_sysroot PATH
1778 # Replace a leading = in PATH with a sysroot. Store the result into
1779 # func_resolve_sysroot_result
1780 func_resolve_sysroot ()
1782 func_resolve_sysroot_result=$1
1783 case $func_resolve_sysroot_result in
1785 func_stripname '=' '' "$func_resolve_sysroot_result"
1786 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1791 # func_replace_sysroot PATH
1792 # If PATH begins with the sysroot, replace it with = and
1793 # store the result into func_replace_sysroot_result.
1794 func_replace_sysroot ()
1796 case "$lt_sysroot:$1" in
1798 func_stripname "$lt_sysroot" '' "$1"
1799 func_replace_sysroot_result="=$func_stripname_result"
1802 # Including no sysroot.
1803 func_replace_sysroot_result=$1
1808 # func_infer_tag arg
1809 # Infer tagged configuration to use if any are available and
1810 # if one wasn't chosen via the "--tag" command line option.
1811 # Only attempt this if the compiler in the base compile
1812 # command doesn't match the default compiler.
1813 # arg is usually of the form 'gcc ...'
1817 if test -n "$available_tags" && test -z "$tagname"; then
1820 func_append_quoted CC_quoted "$arg"
1822 CC_expanded=`func_echo_all $CC`
1823 CC_quoted_expanded=`func_echo_all $CC_quoted`
1825 # Blanks in the command may have been stripped by the calling shell,
1826 # but not from the CC environment variable when configure was run.
1827 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1828 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1829 # Blanks at the start of $base_compile will cause this to fail
1830 # if we don't check for them as well.
1832 for z in $available_tags; do
1833 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1834 # Evaluate the configuration.
1835 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1838 # Double-quote args containing other shell metacharacters.
1839 func_append_quoted CC_quoted "$arg"
1841 CC_expanded=`func_echo_all $CC`
1842 CC_quoted_expanded=`func_echo_all $CC_quoted`
1844 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1845 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1846 # The compiler in the base compile command matches
1847 # the one in the tagged configuration.
1848 # Assume this is the tagged configuration we want.
1855 # If $tagname still isn't set, then no tagged configuration
1856 # was found and let the user know that the "--tag" command
1857 # line option must be used.
1858 if test -z "$tagname"; then
1859 func_echo "unable to infer tagged configuration"
1860 func_fatal_error "specify a tag with \`--tag'"
1862 # func_verbose "using $tagname tagged configuration"
1871 # func_write_libtool_object output_name pic_name nonpic_name
1872 # Create a libtool object file (analogous to a ".la" file),
1873 # but don't create it if we're doing a dry run.
1874 func_write_libtool_object ()
1877 if test "$build_libtool_libs" = yes; then
1883 if test "$build_old_libs" = yes; then
1884 write_oldobj=\'${3}\'
1890 cat >${write_libobj}T <<EOF
1891 # $write_libobj - a libtool object file
1892 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1894 # Please DO NOT delete this file!
1895 # It is necessary for linking the library.
1897 # Name of the PIC object.
1898 pic_object=$write_lobj
1900 # Name of the non-PIC object
1901 non_pic_object=$write_oldobj
1904 $MV "${write_libobj}T" "${write_libobj}"
1909 ##################################################
1910 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1911 ##################################################
1913 # func_convert_core_file_wine_to_w32 ARG
1914 # Helper function used by file name conversion functions when $build is *nix,
1915 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1916 # correctly configured wine environment available, with the winepath program
1917 # in $build's $PATH.
1919 # ARG is the $build file name to be converted to w32 format.
1920 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1921 # be empty on error (or when ARG is empty)
1922 func_convert_core_file_wine_to_w32 ()
1925 func_convert_core_file_wine_to_w32_result="$1"
1926 if test -n "$1"; then
1927 # Unfortunately, winepath does not exit with a non-zero error code, so we
1928 # are forced to check the contents of stdout. On the other hand, if the
1929 # command is not found, the shell will set an exit code of 127 and print
1930 # *an error message* to stdout. So we must check for both error code of
1931 # zero AND non-empty stdout, which explains the odd construction:
1932 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1933 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1934 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1935 $SED -e "$lt_sed_naive_backslashify"`
1937 func_convert_core_file_wine_to_w32_result=
1941 # end: func_convert_core_file_wine_to_w32
1944 # func_convert_core_path_wine_to_w32 ARG
1945 # Helper function used by path conversion functions when $build is *nix, and
1946 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1947 # configured wine environment available, with the winepath program in $build's
1948 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1950 # ARG is path to be converted from $build format to win32.
1951 # Result is available in $func_convert_core_path_wine_to_w32_result.
1952 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1953 # are convertible, then the result may be empty.
1954 func_convert_core_path_wine_to_w32 ()
1957 # unfortunately, winepath doesn't convert paths, only file names
1958 func_convert_core_path_wine_to_w32_result=""
1959 if test -n "$1"; then
1962 for func_convert_core_path_wine_to_w32_f in $1; do
1964 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1965 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1966 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1967 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1969 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1976 # end: func_convert_core_path_wine_to_w32
1979 # func_cygpath ARGS...
1980 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1981 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1982 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1983 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1984 # file name or path is assumed to be in w32 format, as previously converted
1985 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1986 # or path in func_cygpath_result (input file name or path is assumed to be in
1987 # Cygwin format). Returns an empty string on error.
1989 # ARGS are passed to cygpath, with the last one being the file name or path to
1992 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1993 # environment variable; do not put it in $PATH.
1997 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1998 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1999 if test "$?" -ne 0; then
2000 # on failure, ensure result is empty
2001 func_cygpath_result=
2004 func_cygpath_result=
2005 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2011 # func_convert_core_msys_to_w32 ARG
2012 # Convert file name or path ARG from MSYS format to w32 format. Return
2013 # result in func_convert_core_msys_to_w32_result.
2014 func_convert_core_msys_to_w32 ()
2017 # awkward: cmd appends spaces to result
2018 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2019 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2021 #end: func_convert_core_msys_to_w32
2024 # func_convert_file_check ARG1 ARG2
2025 # Verify that ARG1 (a file name in $build format) was converted to $host
2026 # format in ARG2. Otherwise, emit an error message, but continue (resetting
2027 # func_to_host_file_result to ARG1).
2028 func_convert_file_check ()
2031 if test -z "$2" && test -n "$1" ; then
2032 func_error "Could not determine host file name corresponding to"
2034 func_error "Continuing, but uninstalled executables may not work."
2036 func_to_host_file_result="$1"
2039 # end func_convert_file_check
2042 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2043 # Verify that FROM_PATH (a path in $build format) was converted to $host
2044 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2045 # func_to_host_file_result to a simplistic fallback value (see below).
2046 func_convert_path_check ()
2049 if test -z "$4" && test -n "$3"; then
2050 func_error "Could not determine the host path corresponding to"
2052 func_error "Continuing, but uninstalled executables may not work."
2053 # Fallback. This is a deliberately simplistic "conversion" and
2054 # should not be "improved". See libtool.info.
2055 if test "x$1" != "x$2"; then
2056 lt_replace_pathsep_chars="s|$1|$2|g"
2057 func_to_host_path_result=`echo "$3" |
2058 $SED -e "$lt_replace_pathsep_chars"`
2060 func_to_host_path_result="$3"
2064 # end func_convert_path_check
2067 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2068 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2069 # and appending REPL if ORIG matches BACKPAT.
2070 func_convert_path_front_back_pathsep ()
2074 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2078 $2 ) func_to_host_path_result+="$3"
2082 # end func_convert_path_front_back_pathsep
2085 ##################################################
2086 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2087 ##################################################
2088 # invoked via `$to_host_file_cmd ARG'
2090 # In each case, ARG is the path to be converted from $build to $host format.
2091 # Result will be available in $func_to_host_file_result.
2094 # func_to_host_file ARG
2095 # Converts the file name ARG from $build format to $host format. Return result
2096 # in func_to_host_file_result.
2097 func_to_host_file ()
2100 $to_host_file_cmd "$1"
2102 # end func_to_host_file
2105 # func_to_tool_file ARG LAZY
2106 # converts the file name ARG from $build format to toolchain format. Return
2107 # result in func_to_tool_file_result. If the conversion in use is listed
2108 # in (the comma separated) LAZY, no conversion takes place.
2109 func_to_tool_file ()
2113 *,"$to_tool_file_cmd",*)
2114 func_to_tool_file_result=$1
2117 $to_tool_file_cmd "$1"
2118 func_to_tool_file_result=$func_to_host_file_result
2122 # end func_to_tool_file
2125 # func_convert_file_noop ARG
2126 # Copy ARG to func_to_host_file_result.
2127 func_convert_file_noop ()
2129 func_to_host_file_result="$1"
2131 # end func_convert_file_noop
2134 # func_convert_file_msys_to_w32 ARG
2135 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2136 # conversion to w32 is not available inside the cwrapper. Returns result in
2137 # func_to_host_file_result.
2138 func_convert_file_msys_to_w32 ()
2141 func_to_host_file_result="$1"
2142 if test -n "$1"; then
2143 func_convert_core_msys_to_w32 "$1"
2144 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2146 func_convert_file_check "$1" "$func_to_host_file_result"
2148 # end func_convert_file_msys_to_w32
2151 # func_convert_file_cygwin_to_w32 ARG
2152 # Convert file name ARG from Cygwin to w32 format. Returns result in
2153 # func_to_host_file_result.
2154 func_convert_file_cygwin_to_w32 ()
2157 func_to_host_file_result="$1"
2158 if test -n "$1"; then
2159 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2160 # LT_CYGPATH in this case.
2161 func_to_host_file_result=`cygpath -m "$1"`
2163 func_convert_file_check "$1" "$func_to_host_file_result"
2165 # end func_convert_file_cygwin_to_w32
2168 # func_convert_file_nix_to_w32 ARG
2169 # Convert file name ARG from *nix to w32 format. Requires a wine environment
2170 # and a working winepath. Returns result in func_to_host_file_result.
2171 func_convert_file_nix_to_w32 ()
2174 func_to_host_file_result="$1"
2175 if test -n "$1"; then
2176 func_convert_core_file_wine_to_w32 "$1"
2177 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2179 func_convert_file_check "$1" "$func_to_host_file_result"
2181 # end func_convert_file_nix_to_w32
2184 # func_convert_file_msys_to_cygwin ARG
2185 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2186 # Returns result in func_to_host_file_result.
2187 func_convert_file_msys_to_cygwin ()
2190 func_to_host_file_result="$1"
2191 if test -n "$1"; then
2192 func_convert_core_msys_to_w32 "$1"
2193 func_cygpath -u "$func_convert_core_msys_to_w32_result"
2194 func_to_host_file_result="$func_cygpath_result"
2196 func_convert_file_check "$1" "$func_to_host_file_result"
2198 # end func_convert_file_msys_to_cygwin
2201 # func_convert_file_nix_to_cygwin ARG
2202 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2203 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2204 # in func_to_host_file_result.
2205 func_convert_file_nix_to_cygwin ()
2208 func_to_host_file_result="$1"
2209 if test -n "$1"; then
2210 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2211 func_convert_core_file_wine_to_w32 "$1"
2212 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2213 func_to_host_file_result="$func_cygpath_result"
2215 func_convert_file_check "$1" "$func_to_host_file_result"
2217 # end func_convert_file_nix_to_cygwin
2220 #############################################
2221 # $build to $host PATH CONVERSION FUNCTIONS #
2222 #############################################
2223 # invoked via `$to_host_path_cmd ARG'
2225 # In each case, ARG is the path to be converted from $build to $host format.
2226 # The result will be available in $func_to_host_path_result.
2228 # Path separators are also converted from $build format to $host format. If
2229 # ARG begins or ends with a path separator character, it is preserved (but
2230 # converted to $host format) on output.
2232 # All path conversion functions are named using the following convention:
2233 # file name conversion function : func_convert_file_X_to_Y ()
2234 # path conversion function : func_convert_path_X_to_Y ()
2235 # where, for any given $build/$host combination the 'X_to_Y' value is the
2236 # same. If conversion functions are added for new $build/$host combinations,
2237 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
2241 # func_init_to_host_path_cmd
2242 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
2243 # appropriate value, based on the value of $to_host_file_cmd.
2245 func_init_to_host_path_cmd ()
2248 if test -z "$to_host_path_cmd"; then
2249 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2250 to_host_path_cmd="func_convert_path_${func_stripname_result}"
2255 # func_to_host_path ARG
2256 # Converts the path ARG from $build format to $host format. Return result
2257 # in func_to_host_path_result.
2258 func_to_host_path ()
2261 func_init_to_host_path_cmd
2262 $to_host_path_cmd "$1"
2264 # end func_to_host_path
2267 # func_convert_path_noop ARG
2268 # Copy ARG to func_to_host_path_result.
2269 func_convert_path_noop ()
2271 func_to_host_path_result="$1"
2273 # end func_convert_path_noop
2276 # func_convert_path_msys_to_w32 ARG
2277 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2278 # conversion to w32 is not available inside the cwrapper. Returns result in
2279 # func_to_host_path_result.
2280 func_convert_path_msys_to_w32 ()
2283 func_to_host_path_result="$1"
2284 if test -n "$1"; then
2285 # Remove leading and trailing path separator characters from ARG. MSYS
2286 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2287 # and winepath ignores them completely.
2288 func_stripname : : "$1"
2289 func_to_host_path_tmp1=$func_stripname_result
2290 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2291 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2292 func_convert_path_check : ";" \
2293 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2294 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2297 # end func_convert_path_msys_to_w32
2300 # func_convert_path_cygwin_to_w32 ARG
2301 # Convert path ARG from Cygwin to w32 format. Returns result in
2302 # func_to_host_file_result.
2303 func_convert_path_cygwin_to_w32 ()
2306 func_to_host_path_result="$1"
2307 if test -n "$1"; then
2308 # See func_convert_path_msys_to_w32:
2309 func_stripname : : "$1"
2310 func_to_host_path_tmp1=$func_stripname_result
2311 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2312 func_convert_path_check : ";" \
2313 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2314 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2317 # end func_convert_path_cygwin_to_w32
2320 # func_convert_path_nix_to_w32 ARG
2321 # Convert path ARG from *nix to w32 format. Requires a wine environment and
2322 # a working winepath. Returns result in func_to_host_file_result.
2323 func_convert_path_nix_to_w32 ()
2326 func_to_host_path_result="$1"
2327 if test -n "$1"; then
2328 # See func_convert_path_msys_to_w32:
2329 func_stripname : : "$1"
2330 func_to_host_path_tmp1=$func_stripname_result
2331 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2332 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2333 func_convert_path_check : ";" \
2334 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2335 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2338 # end func_convert_path_nix_to_w32
2341 # func_convert_path_msys_to_cygwin ARG
2342 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2343 # Returns result in func_to_host_file_result.
2344 func_convert_path_msys_to_cygwin ()
2347 func_to_host_path_result="$1"
2348 if test -n "$1"; then
2349 # See func_convert_path_msys_to_w32:
2350 func_stripname : : "$1"
2351 func_to_host_path_tmp1=$func_stripname_result
2352 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2353 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2354 func_to_host_path_result="$func_cygpath_result"
2355 func_convert_path_check : : \
2356 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2357 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2360 # end func_convert_path_msys_to_cygwin
2363 # func_convert_path_nix_to_cygwin ARG
2364 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2365 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2366 # func_to_host_file_result.
2367 func_convert_path_nix_to_cygwin ()
2370 func_to_host_path_result="$1"
2371 if test -n "$1"; then
2372 # Remove leading and trailing path separator characters from
2373 # ARG. msys behavior is inconsistent here, cygpath turns them
2374 # into '.;' and ';.', and winepath ignores them completely.
2375 func_stripname : : "$1"
2376 func_to_host_path_tmp1=$func_stripname_result
2377 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2378 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2379 func_to_host_path_result="$func_cygpath_result"
2380 func_convert_path_check : : \
2381 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2382 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2385 # end func_convert_path_nix_to_cygwin
2388 # func_mode_compile arg...
2389 func_mode_compile ()
2392 # Get the compilation command and the source file.
2394 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
2406 # do not "continue". Instead, add this to base_compile
2418 # Accept any command-line options.
2421 test -n "$libobj" && \
2422 func_fatal_error "you cannot specify \`-o' more than once"
2427 -pie | -fpie | -fPIE)
2432 -shared | -static | -prefer-pic | -prefer-non-pic)
2443 arg_mode=arg # the next one goes into the "base_compile" arg list
2444 continue # The current "srcfile" will either be retained or
2445 ;; # replaced later. I would guess that would be a bug.
2448 func_stripname '-Wc,' '' "$arg"
2449 args=$func_stripname_result
2451 save_ifs="$IFS"; IFS=','
2452 for arg in $args; do
2454 func_append_quoted lastarg "$arg"
2457 func_stripname ' ' '' "$lastarg"
2458 lastarg=$func_stripname_result
2460 # Add the arguments to base_compile.
2461 base_compile+=" $lastarg"
2466 # Accept the current argument as the source file.
2467 # The previous "srcfile" becomes the current argument.
2474 esac # case $arg_mode
2476 # Aesthetically quote the previous argument.
2477 func_append_quoted base_compile "$lastarg"
2482 func_fatal_error "you must specify an argument for -Xcompile"
2485 func_fatal_error "you must specify a target with \`-o'"
2488 # Get the name of the library object.
2489 test -z "$libobj" && {
2490 func_basename "$srcfile"
2491 libobj="$func_basename_result"
2496 # Recognize several different file suffixes.
2497 # If the user specifies -o file.o, it is replaced with file.lo
2500 *.ada | *.adb | *.ads | *.asm | \
2501 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2502 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
2503 func_xform "$libobj"
2504 libobj=$func_xform_result
2509 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2511 func_fatal_error "cannot determine name of library object from \`$libobj'"
2515 func_infer_tag $base_compile
2517 for arg in $later; do
2520 test "$build_libtool_libs" != yes && \
2521 func_fatal_configuration "can not build a shared library"
2527 build_libtool_libs=no
2544 func_quote_for_eval "$libobj"
2545 test "X$libobj" != "X$func_quote_for_eval_result" \
2546 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2547 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2548 func_dirname_and_basename "$obj" "/" ""
2549 objname="$func_basename_result"
2550 xdir="$func_dirname_result"
2551 lobj=${xdir}$objdir/$objname
2553 test -z "$base_compile" && \
2554 func_fatal_help "you must specify a compilation command"
2556 # Delete any leftover library objects.
2557 if test "$build_old_libs" = yes; then
2558 removelist="$obj $lobj $libobj ${libobj}T"
2560 removelist="$lobj $libobj ${libobj}T"
2563 # On Cygwin there's no "real" PIC flag so we must build both object types
2565 cygwin* | mingw* | pw32* | os2* | cegcc*)
2569 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2570 # non-PIC code in shared libraries is not supported
2574 # Calculate the filename of the output object if compiler does
2575 # not support -o with -c
2576 if test "$compiler_c_o" = no; then
2577 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2578 lockfile="$output_obj.lock"
2585 # Lock this critical section if it is needed
2586 # We use this script file to make the link, it avoids creating a new file
2587 if test "$need_locks" = yes; then
2588 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2589 func_echo "Waiting for $lockfile to be removed"
2592 elif test "$need_locks" = warn; then
2593 if test -f "$lockfile"; then
2595 *** ERROR, $lockfile exists and contains:
2596 `cat $lockfile 2>/dev/null`
2598 This indicates that another process is trying to use the same
2599 temporary object file, and libtool could not work around it because
2600 your compiler does not support \`-c' and \`-o' together. If you
2601 repeat this compilation, it may succeed, by chance, but you had better
2602 avoid parallel builds (make -j) in this platform, or get a better
2605 $opt_dry_run || $RM $removelist
2608 removelist+=" $output_obj"
2609 $ECHO "$srcfile" > "$lockfile"
2612 $opt_dry_run || $RM $removelist
2613 removelist+=" $lockfile"
2614 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2616 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2617 srcfile=$func_to_tool_file_result
2618 func_quote_for_eval "$srcfile"
2619 qsrcfile=$func_quote_for_eval_result
2621 # Only build a PIC object if we are building libtool libraries.
2622 if test "$build_libtool_libs" = yes; then
2623 # Without this assignment, base_compile gets emptied.
2624 fbsd_hideous_sh_bug=$base_compile
2626 if test "$pic_mode" != no; then
2627 command="$base_compile $qsrcfile $pic_flag"
2629 # Don't build PIC code
2630 command="$base_compile $qsrcfile"
2633 func_mkdir_p "$xdir$objdir"
2635 if test -z "$output_obj"; then
2636 # Place PIC objects in $objdir
2637 command+=" -o $lobj"
2640 func_show_eval_locale "$command" \
2641 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2643 if test "$need_locks" = warn &&
2644 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2646 *** ERROR, $lockfile contains:
2647 `cat $lockfile 2>/dev/null`
2649 but it should contain:
2652 This indicates that another process is trying to use the same
2653 temporary object file, and libtool could not work around it because
2654 your compiler does not support \`-c' and \`-o' together. If you
2655 repeat this compilation, it may succeed, by chance, but you had better
2656 avoid parallel builds (make -j) in this platform, or get a better
2659 $opt_dry_run || $RM $removelist
2663 # Just move the object if needed, then go on to compile the next one
2664 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2665 func_show_eval '$MV "$output_obj" "$lobj"' \
2666 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2669 # Allow error messages only from the first compilation.
2670 if test "$suppress_opt" = yes; then
2671 suppress_output=' >/dev/null 2>&1'
2675 # Only build a position-dependent object if we build old libraries.
2676 if test "$build_old_libs" = yes; then
2677 if test "$pic_mode" != yes; then
2678 # Don't build PIC code
2679 command="$base_compile $qsrcfile$pie_flag"
2681 command="$base_compile $qsrcfile $pic_flag"
2683 if test "$compiler_c_o" = yes; then
2687 # Suppress compiler output if we already did a PIC compilation.
2688 command+="$suppress_output"
2689 func_show_eval_locale "$command" \
2690 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2692 if test "$need_locks" = warn &&
2693 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2695 *** ERROR, $lockfile contains:
2696 `cat $lockfile 2>/dev/null`
2698 but it should contain:
2701 This indicates that another process is trying to use the same
2702 temporary object file, and libtool could not work around it because
2703 your compiler does not support \`-c' and \`-o' together. If you
2704 repeat this compilation, it may succeed, by chance, but you had better
2705 avoid parallel builds (make -j) in this platform, or get a better
2708 $opt_dry_run || $RM $removelist
2712 # Just move the object if needed
2713 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2714 func_show_eval '$MV "$output_obj" "$obj"' \
2715 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2720 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2722 # Unlock the critical section if it was locked
2723 if test "$need_locks" != no; then
2724 removelist=$lockfile
2733 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2738 # We need to display help for each of the modes.
2741 # Generic help is extracted from the usage comments
2742 # at the start of this file.
2748 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2750 Remove files from the build directory.
2752 RM is the name of the program to use to delete files associated with each FILE
2753 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2756 If FILE is a libtool library, object or program, all the files associated
2757 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2762 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2764 Compile a source file into a libtool library object.
2766 This mode accepts the following additional options:
2768 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2769 -no-suppress do not suppress compiler output for multiple passes
2770 -prefer-pic try to build PIC objects only
2771 -prefer-non-pic try to build non-PIC objects only
2772 -shared do not build a \`.o' file suitable for static linking
2773 -static only build a \`.o' file suitable for static linking
2774 -Wc,FLAG pass FLAG directly to the compiler
2776 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2777 from the given SOURCEFILE.
2779 The output file name is determined by removing the directory component from
2780 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2781 library object suffix, \`.lo'."
2786 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2788 Automatically set library path, then run a program.
2790 This mode accepts the following additional options:
2792 -dlopen FILE add the directory containing FILE to the library path
2794 This mode sets the library path environment variable according to \`-dlopen'
2797 If any of the ARGS are libtool executable wrappers, then they are translated
2798 into their corresponding uninstalled binary, and any of their required library
2799 directories are added to the library path.
2801 Then, COMMAND is executed, with ARGS as arguments."
2806 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2808 Complete the installation of libtool libraries.
2810 Each LIBDIR is a directory that contains libtool libraries.
2812 The commands that this mode executes may require superuser privileges. Use
2813 the \`--dry-run' option if you just want to see what would be executed."
2818 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2820 Install executables or libraries.
2822 INSTALL-COMMAND is the installation command. The first component should be
2823 either the \`install' or \`cp' program.
2825 The following components of INSTALL-COMMAND are treated specially:
2827 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2829 The rest of the components are interpreted as arguments to that command (only
2830 BSD-compatible install options are recognized)."
2835 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2837 Link object files or libraries together to form another library, or to
2838 create an executable program.
2840 LINK-COMMAND is a command using the C compiler that you would use to create
2841 a program from several object files.
2843 The following components of LINK-COMMAND are treated specially:
2845 -all-static do not do any dynamic linking at all
2846 -avoid-version do not add a version suffix if possible
2847 -bindir BINDIR specify path to binaries directory (for systems where
2848 libraries must be found in the PATH setting at runtime)
2849 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2850 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2851 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2852 -export-symbols SYMFILE
2853 try to export only the symbols listed in SYMFILE
2854 -export-symbols-regex REGEX
2855 try to export only the symbols matching REGEX
2856 -LLIBDIR search LIBDIR for required installed libraries
2857 -lNAME OUTPUT-FILE requires the installed library libNAME
2858 -module build a library that can dlopened
2859 -no-fast-install disable the fast-install mode
2860 -no-install link a not-installable executable
2861 -no-undefined declare that a library does not refer to external symbols
2862 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2863 -objectlist FILE Use a list of object files found in FILE to specify objects
2864 -precious-files-regex REGEX
2865 don't remove output files matching REGEX
2866 -release RELEASE specify package release information
2867 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2868 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2869 -shared only do dynamic linking of libtool libraries
2870 -shrext SUFFIX override the standard shared library file extension
2871 -static do not do any dynamic linking of uninstalled libtool libraries
2872 -static-libtool-libs
2873 do not do any dynamic linking of libtool libraries
2874 -version-info CURRENT[:REVISION[:AGE]]
2875 specify library version info [each variable defaults to 0]
2876 -weak LIBNAME declare that the target provides the LIBNAME interface
2878 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2880 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2881 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2883 All other options (arguments beginning with \`-') are ignored.
2885 Every other argument is treated as a filename. Files ending in \`.la' are
2886 treated as uninstalled libtool libraries, other files are standard or library
2889 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2890 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2891 required, except when creating a convenience library.
2893 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2894 using \`ar' and \`ranlib', or on Windows using \`lib'.
2896 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2897 is created, otherwise an executable program is created."
2902 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2904 Remove libraries from an installation directory.
2906 RM is the name of the program to use to delete files associated with each FILE
2907 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2910 If FILE is a libtool library, all the files associated with it are deleted.
2911 Otherwise, only FILE itself is deleted using RM."
2915 func_fatal_help "invalid operation mode \`$opt_mode'"
2920 $ECHO "Try \`$progname --help' for more information about other modes."
2923 # Now that we've collected a possible --mode arg, show help if necessary
2925 if test "$opt_help" = :; then
2930 for opt_mode in compile link execute install finish uninstall clean; do
2933 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2936 for opt_mode in compile link execute install finish uninstall clean; do
2942 /^When reporting/,/^Report/{
2947 /information about other modes/d
2948 /more detailed .*MODE/d
2949 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2955 # func_mode_execute arg...
2956 func_mode_execute ()
2959 # The first argument is the command name.
2962 func_fatal_help "you must specify a COMMAND"
2964 # Handle -dlopen flags immediately.
2965 for file in $opt_dlopen; do
2967 || func_fatal_help "\`$file' is not a file"
2972 func_resolve_sysroot "$file"
2973 file=$func_resolve_sysroot_result
2975 # Check to see that this really is a libtool archive.
2976 func_lalib_unsafe_p "$file" \
2977 || func_fatal_help "\`$lib' is not a valid libtool archive"
2979 # Read the libtool library.
2984 # Skip this library if it cannot be dlopened.
2985 if test -z "$dlname"; then
2986 # Warn if it was a shared library.
2987 test -n "$library_names" && \
2988 func_warning "\`$file' was not linked with \`-export-dynamic'"
2992 func_dirname "$file" "" "."
2993 dir="$func_dirname_result"
2995 if test -f "$dir/$objdir/$dlname"; then
2998 if test ! -f "$dir/$dlname"; then
2999 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
3005 # Just add the directory containing the .lo file.
3006 func_dirname "$file" "" "."
3007 dir="$func_dirname_result"
3011 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3016 # Get the absolute pathname.
3017 absdir=`cd "$dir" && pwd`
3018 test -n "$absdir" && dir="$absdir"
3020 # Now add the directory to shlibpath_var.
3021 if eval "test -z \"\$$shlibpath_var\""; then
3022 eval "$shlibpath_var=\"\$dir\""
3024 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3028 # This variable tells wrapper scripts just to set shlibpath_var
3029 # rather than running their programs.
3030 libtool_execute_magic="$magic"
3032 # Check if any of the arguments is a wrapper script.
3037 -* | *.la | *.lo ) ;;
3039 # Do a test to see if this is really a libtool program.
3040 if func_ltwrapper_script_p "$file"; then
3042 # Transform arg to wrapped name.
3043 file="$progdir/$program"
3044 elif func_ltwrapper_executable_p "$file"; then
3045 func_ltwrapper_scriptname "$file"
3046 func_source "$func_ltwrapper_scriptname_result"
3047 # Transform arg to wrapped name.
3048 file="$progdir/$program"
3052 # Quote arguments (to preserve shell metacharacters).
3053 func_append_quoted args "$file"
3056 if test "X$opt_dry_run" = Xfalse; then
3057 if test -n "$shlibpath_var"; then
3058 # Export the shlibpath_var.
3059 eval "export $shlibpath_var"
3062 # Restore saved environment variables
3063 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3065 eval "if test \"\${save_$lt_var+set}\" = set; then
3066 $lt_var=\$save_$lt_var; export $lt_var
3072 # Now prepare to actually exec the command.
3073 exec_cmd="\$cmd$args"
3075 # Display what would be done.
3076 if test -n "$shlibpath_var"; then
3077 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3078 echo "export $shlibpath_var"
3085 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3088 # func_mode_finish arg...
3096 for opt in "$nonopt" ${1+"$@"}
3098 if test -d "$opt"; then
3101 elif test -f "$opt"; then
3102 if func_lalib_unsafe_p "$opt"; then
3105 func_warning "\`$opt' is not a valid libtool archive"
3109 func_fatal_error "invalid argument \`$opt'"
3113 if test -n "$libs"; then
3114 if test -n "$lt_sysroot"; then
3115 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3116 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3121 # Remove sysroot references
3122 if $opt_dry_run; then
3123 for lib in $libs; do
3124 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3127 tmpdir=`func_mktempdir`
3128 for lib in $libs; do
3129 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3131 mv -f $tmpdir/tmp-la $lib
3137 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3138 for libdir in $libdirs; do
3139 if test -n "$finish_cmds"; then
3140 # Do each command in the finish commands.
3141 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3144 if test -n "$finish_eval"; then
3145 # Do the single finish_eval.
3146 eval cmds=\"$finish_eval\"
3147 $opt_dry_run || eval "$cmds" || admincmds+="
3153 # Exit here if they wanted silent mode.
3154 $opt_silent && exit $EXIT_SUCCESS
3156 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3157 echo "----------------------------------------------------------------------"
3158 echo "Libraries have been installed in:"
3159 for libdir in $libdirs; do
3163 echo "If you ever happen to want to link against installed libraries"
3164 echo "in a given directory, LIBDIR, you must either use libtool, and"
3165 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3166 echo "flag during linking and do at least one of the following:"
3167 if test -n "$shlibpath_var"; then
3168 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3169 echo " during execution"
3171 if test -n "$runpath_var"; then
3172 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3173 echo " during linking"
3175 if test -n "$hardcode_libdir_flag_spec"; then
3177 eval flag=\"$hardcode_libdir_flag_spec\"
3179 $ECHO " - use the \`$flag' linker flag"
3181 if test -n "$admincmds"; then
3182 $ECHO " - have your system administrator run these commands:$admincmds"
3184 if test -f /etc/ld.so.conf; then
3185 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3189 echo "See any operating system documentation about shared libraries for"
3191 solaris2.[6789]|solaris2.1[0-9])
3192 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3196 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3199 echo "----------------------------------------------------------------------"
3204 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3207 # func_mode_install arg...
3208 func_mode_install ()
3211 # There may be an optional sh(1) argument at the beginning of
3212 # install_prog (especially on Windows NT).
3213 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3214 # Allow the use of GNU shtool's install command.
3215 case $nonopt in *shtool*) :;; *) false;; esac; then
3216 # Aesthetically quote it.
3217 func_quote_for_eval "$nonopt"
3218 install_prog="$func_quote_for_eval_result "
3226 # The real first argument should be the name of the installation program.
3227 # Aesthetically quote it.
3228 func_quote_for_eval "$arg"
3229 install_prog+="$func_quote_for_eval_result"
3230 install_shared_prog=$install_prog
3231 case " $install_prog " in
3232 *[\\\ /]cp\ *) install_cp=: ;;
3233 *) install_cp=false ;;
3236 # We need to accept at least all the BSD install flags.
3248 if test -n "$dest"; then
3257 if $install_cp; then :; else
3271 # If the previous option needed an argument, then skip it.
3272 if test -n "$prev"; then
3273 if test "x$prev" = x-m && test -n "$install_override_mode"; then
3274 arg2=$install_override_mode
3285 # Aesthetically quote the argument.
3286 func_quote_for_eval "$arg"
3287 install_prog+=" $func_quote_for_eval_result"
3288 if test -n "$arg2"; then
3289 func_quote_for_eval "$arg2"
3291 install_shared_prog+=" $func_quote_for_eval_result"
3294 test -z "$install_prog" && \
3295 func_fatal_help "you must specify an install program"
3297 test -n "$prev" && \
3298 func_fatal_help "the \`$prev' option requires an argument"
3300 if test -n "$install_override_mode" && $no_mode; then
3301 if $install_cp; then :; else
3302 func_quote_for_eval "$install_override_mode"
3303 install_shared_prog+=" -m $func_quote_for_eval_result"
3307 if test -z "$files"; then
3308 if test -z "$dest"; then
3309 func_fatal_help "no file or destination specified"
3311 func_fatal_help "you must specify a destination"
3315 # Strip any trailing slash from the destination.
3316 func_stripname '' '/' "$dest"
3317 dest=$func_stripname_result
3319 # Check to see that the destination is a directory.
3320 test -d "$dest" && isdir=yes
3321 if test "$isdir" = yes; then
3325 func_dirname_and_basename "$dest" "" "."
3326 destdir="$func_dirname_result"
3327 destname="$func_basename_result"
3329 # Not a directory, so check to see that there is only one file specified.
3330 set dummy $files; shift
3331 test "$#" -gt 1 && \
3332 func_fatal_help "\`$dest' is not a directory"
3335 [\\/]* | [A-Za-z]:[\\/]*) ;;
3337 for file in $files; do
3341 func_fatal_help "\`$destdir' must be an absolute directory name"
3348 # This variable tells wrapper scripts just to set variables rather
3349 # than running their programs.
3350 libtool_install_magic="$magic"
3355 for file in $files; do
3357 # Do each installation.
3360 # Do the static libraries later.
3361 staticlibs+=" $file"
3365 func_resolve_sysroot "$file"
3366 file=$func_resolve_sysroot_result
3368 # Check to see that this really is a libtool archive.
3369 func_lalib_unsafe_p "$file" \
3370 || func_fatal_help "\`$file' is not a valid libtool archive"
3377 # Add the libdir to current_libdirs if it is the destination.
3378 if test "X$destdir" = "X$libdir"; then
3379 case "$current_libdirs " in
3381 *) current_libdirs+=" $libdir" ;;
3384 # Note the libdir as a future libdir.
3385 case "$future_libdirs " in
3387 *) future_libdirs+=" $libdir" ;;
3391 func_dirname "$file" "/" ""
3392 dir="$func_dirname_result"
3395 if test -n "$relink_command"; then
3396 # Determine the prefix the user has applied to our future dir.
3397 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3399 # Don't allow the user to place us outside of our expected
3400 # location b/c this prevents finding dependent libraries that
3401 # are installed to the same prefix.
3402 # At present, this check doesn't affect windows .dll's that
3403 # are installed into $libdir/../bin (currently, that works fine)
3404 # but it's something to keep an eye on.
3405 test "$inst_prefix_dir" = "$destdir" && \
3406 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3408 if test -n "$inst_prefix_dir"; then
3409 # Stick the inst_prefix_dir data into the link command.
3410 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3412 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3415 func_warning "relinking \`$file'"
3416 func_show_eval "$relink_command" \
3417 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3420 # See the names of the shared library.
3421 set dummy $library_names; shift
3422 if test -n "$1"; then
3427 test -n "$relink_command" && srcname="$realname"T
3429 # Install the shared library and build the symlinks.
3430 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3434 cygwin* | mingw* | pw32* | cegcc*)
3442 if test -n "$tstripme" && test -n "$striplib"; then
3443 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3446 if test "$#" -gt 0; then
3447 # Delete the old symlinks, and create new ones.
3448 # Try `ln -sf' first, because the `ln' binary might depend on
3449 # the symlink we replace! Solaris /bin/ln does not understand -f,
3450 # so we also need to try rm && ln -s.
3453 test "$linkname" != "$realname" \
3454 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3458 # Do each command in the postinstall commands.
3459 lib="$destdir/$realname"
3460 func_execute_cmds "$postinstall_cmds" 'exit $?'
3463 # Install the pseudo-library for information purposes.
3464 func_basename "$file"
3465 name="$func_basename_result"
3466 instname="$dir/$name"i
3467 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3469 # Maybe install the static library, too.
3470 test -n "$old_library" && staticlibs+=" $dir/$old_library"
3474 # Install (i.e. copy) a libtool object.
3476 # Figure out destination file name, if it wasn't already specified.
3477 if test -n "$destname"; then
3478 destfile="$destdir/$destname"
3480 func_basename "$file"
3481 destfile="$func_basename_result"
3482 destfile="$destdir/$destfile"
3485 # Deduce the name of the destination old-style object file.
3488 func_lo2o "$destfile"
3489 staticdest=$func_lo2o_result
3492 staticdest="$destfile"
3496 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3500 # Install the libtool object if requested.
3501 test -n "$destfile" && \
3502 func_show_eval "$install_prog $file $destfile" 'exit $?'
3504 # Install the old object if enabled.
3505 if test "$build_old_libs" = yes; then
3506 # Deduce the name of the old-style object file.
3508 staticobj=$func_lo2o_result
3509 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3515 # Figure out destination file name, if it wasn't already specified.
3516 if test -n "$destname"; then
3517 destfile="$destdir/$destname"
3519 func_basename "$file"
3520 destfile="$func_basename_result"
3521 destfile="$destdir/$destfile"
3524 # If the file is missing, and there is a .exe on the end, strip it
3525 # because it is most likely a libtool script we actually want to
3530 if test ! -f "$file"; then
3531 func_stripname '' '.exe' "$file"
3532 file=$func_stripname_result
3538 # Do a test to see if this is really a libtool program.
3541 if func_ltwrapper_executable_p "$file"; then
3542 func_ltwrapper_scriptname "$file"
3543 wrapper=$func_ltwrapper_scriptname_result
3545 func_stripname '' '.exe' "$file"
3546 wrapper=$func_stripname_result
3553 if func_ltwrapper_script_p "$wrapper"; then
3557 func_source "$wrapper"
3559 # Check the variables that should have been set.
3560 test -z "$generated_by_libtool_version" && \
3561 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3564 for lib in $notinst_deplibs; do
3565 # Check to see that each library is installed.
3567 if test -f "$lib"; then
3570 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3571 if test -n "$libdir" && test ! -f "$libfile"; then
3572 func_warning "\`$lib' has not been installed in \`$libdir'"
3578 func_source "$wrapper"
3581 if test "$fast_install" = no && test -n "$relink_command"; then
3583 if test "$finalize" = yes; then
3584 tmpdir=`func_mktempdir`
3585 func_basename "$file$stripped_ext"
3586 file="$func_basename_result"
3587 outputname="$tmpdir/$file"
3588 # Replace the output file specification.
3589 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3592 func_quote_for_expand "$relink_command"
3593 eval "func_echo $func_quote_for_expand_result"
3595 if eval "$relink_command"; then :
3597 func_error "error: relink \`$file' with the above command before installing it"
3598 $opt_dry_run || ${RM}r "$tmpdir"
3603 func_warning "cannot relink \`$file'"
3607 # Install the binary that we compiled earlier.
3608 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3612 # remove .exe since cygwin /usr/bin/install will append another
3614 case $install_prog,$host in
3615 */usr/bin/install*,*cygwin*)
3616 case $file:$destfile in
3621 destfile=$destfile.exe
3624 func_stripname '' '.exe' "$destfile"
3625 destfile=$func_stripname_result
3630 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3631 $opt_dry_run || if test -n "$outputname"; then
3638 for file in $staticlibs; do
3639 func_basename "$file"
3640 name="$func_basename_result"
3642 # Set up the ranlib parameters.
3643 oldlib="$destdir/$name"
3645 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3647 if test -n "$stripme" && test -n "$old_striplib"; then
3648 func_show_eval "$old_striplib $oldlib" 'exit $?'
3651 # Do each command in the postinstall commands.
3652 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3655 test -n "$future_libdirs" && \
3656 func_warning "remember to run \`$progname --finish$future_libdirs'"
3658 if test -n "$current_libdirs"; then
3659 # Maybe just do a dry run.
3660 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3661 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3667 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3670 # func_generate_dlsyms outputname originator pic_p
3671 # Extract symbols from dlprefiles and create ${outputname}S.o with
3672 # a dlpreopen symbol table.
3673 func_generate_dlsyms ()
3679 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3682 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3683 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3684 my_dlsyms="${my_outputname}S.c"
3686 func_error "not configured to extract global symbols from dlpreopened files"
3690 if test -n "$my_dlsyms"; then
3694 # Discover the nlist of each of the dlfiles.
3695 nlist="$output_objdir/${my_outputname}.nm"
3697 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3699 # Parse the name list into a source file.
3700 func_verbose "creating $output_objdir/$my_dlsyms"
3702 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3703 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3704 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3710 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3711 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3714 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3715 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3716 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3717 relocations are performed -- see ld's documentation on pseudo-relocs. */
3718 # define LT_DLSYM_CONST
3719 #elif defined(__osf__)
3720 /* This system does not cope well with relocations in const data. */
3721 # define LT_DLSYM_CONST
3723 # define LT_DLSYM_CONST const
3726 /* External symbol declarations for the compiler. */\
3729 if test "$dlself" = yes; then
3730 func_verbose "generating symbol list for \`$output'"
3732 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3734 # Add our own program objects to the symbol list.
3735 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3736 for progfile in $progfiles; do
3737 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3738 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3739 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3742 if test -n "$exclude_expsyms"; then
3744 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3745 eval '$MV "$nlist"T "$nlist"'
3749 if test -n "$export_symbols_regex"; then
3751 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3752 eval '$MV "$nlist"T "$nlist"'
3756 # Prepare the list of exported symbols
3757 if test -z "$export_symbols"; then
3758 export_symbols="$output_objdir/$outputname.exp"
3761 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3763 *cygwin* | *mingw* | *cegcc* )
3764 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3765 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3771 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3772 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3773 eval '$MV "$nlist"T "$nlist"'
3775 *cygwin* | *mingw* | *cegcc* )
3776 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3777 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3784 for dlprefile in $dlprefiles; do
3785 func_verbose "extracting global C symbols from \`$dlprefile'"
3786 func_basename "$dlprefile"
3787 name="$func_basename_result"
3789 *cygwin* | *mingw* | *cegcc* )
3790 # if an import library, we need to obtain dlname
3791 if func_win32_import_lib_p "$dlprefile"; then
3792 func_tr_sh "$dlprefile"
3793 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3794 dlprefile_dlbasename=""
3795 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3796 # Use subshell, to avoid clobbering current variable values
3797 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3798 if test -n "$dlprefile_dlname" ; then
3799 func_basename "$dlprefile_dlname"
3800 dlprefile_dlbasename="$func_basename_result"
3802 # no lafile. user explicitly requested -dlpreopen <import library>.
3803 $sharedlib_from_linklib_cmd "$dlprefile"
3804 dlprefile_dlbasename=$sharedlib_from_linklib_result
3808 if test -n "$dlprefile_dlbasename" ; then
3809 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3811 func_warning "Could not compute DLL name from $name"
3812 eval '$ECHO ": $name " >> "$nlist"'
3814 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3815 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3816 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3818 else # not an import lib
3820 eval '$ECHO ": $name " >> "$nlist"'
3821 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3822 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3828 eval '$ECHO ": $name " >> "$nlist"'
3829 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3830 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3837 # Make sure we have at least an empty file.
3838 test -f "$nlist" || : > "$nlist"
3840 if test -n "$exclude_expsyms"; then
3841 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3842 $MV "$nlist"T "$nlist"
3845 # Try sorting and uniquifying the output.
3846 if $GREP -v "^: " < "$nlist" |
3847 if sort -k 3 </dev/null >/dev/null 2>&1; then
3852 uniq > "$nlist"S; then
3855 $GREP -v "^: " < "$nlist" > "$nlist"S
3858 if test -f "$nlist"S; then
3859 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3861 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3864 echo >> "$output_objdir/$my_dlsyms" "\
3866 /* The mapping between symbol names and symbols. */
3871 extern LT_DLSYM_CONST lt_dlsymlist
3872 lt_${my_prefix}_LTX_preloaded_symbols[];
3873 LT_DLSYM_CONST lt_dlsymlist
3874 lt_${my_prefix}_LTX_preloaded_symbols[] =
3876 { \"$my_originator\", (void *) 0 },"
3878 case $need_lib_prefix in
3880 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3883 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3886 echo >> "$output_objdir/$my_dlsyms" "\
3890 /* This works around a problem in FreeBSD linker */
3891 #ifdef FREEBSD_WORKAROUND
3892 static const void *lt_preloaded_setup() {
3893 return lt_${my_prefix}_LTX_preloaded_symbols;
3903 pic_flag_for_symtable=
3904 case "$compile_command " in
3908 # compiling the symbol table file with pic_flag works around
3909 # a FreeBSD bug that causes programs to crash when -lm is
3910 # linked before any other PIC object. But we must not use
3911 # pic_flag when linking with -static. The problem exists in
3912 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3913 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3914 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3916 pic_flag_for_symtable=" $pic_flag" ;;
3918 if test "X$my_pic_p" != Xno; then
3919 pic_flag_for_symtable=" $pic_flag"
3926 for arg in $LTCFLAGS; do
3928 -pie | -fpie | -fPIE) ;;
3929 *) symtab_cflags+=" $arg" ;;
3933 # Now compile the dynamic symbol file.
3934 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3936 # Clean up the generated files.
3937 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3939 # Transform the symbol file into the correct name.
3940 symfileobj="$output_objdir/${my_outputname}S.$objext"
3942 *cygwin* | *mingw* | *cegcc* )
3943 if test -f "$output_objdir/$my_outputname.def"; then
3944 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3945 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3947 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3948 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3952 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3953 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3958 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3962 # We keep going just in case the user didn't refer to
3963 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3964 # really was required.
3966 # Nullify the symbol file.
3967 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3968 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3972 # func_win32_libid arg
3973 # return the library type of file 'arg'
3975 # Need a lot of goo to handle *both* DLLs and import libs
3976 # Has to be a shell function in order to 'eat' the argument
3977 # that is supplied when $file_magic_command is called.
3978 # Despite the name, also deal with 64 bit binaries.
3982 win32_libid_type="unknown"
3983 win32_fileres=`file -L $1 2>/dev/null`
3984 case $win32_fileres in
3985 *ar\ archive\ import\ library*) # definitely import
3986 win32_libid_type="x86 archive import"
3988 *ar\ archive*) # could be an import, or static
3989 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3990 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3991 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3992 func_to_tool_file "$1" func_convert_file_msys_to_w32
3993 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4002 case $win32_nmres in
4003 import*) win32_libid_type="x86 archive import";;
4004 *) win32_libid_type="x86 archive static";;
4009 win32_libid_type="x86 DLL"
4011 *executable*) # but shell scripts are "executable" too...
4012 case $win32_fileres in
4013 *MS\ Windows\ PE\ Intel*)
4014 win32_libid_type="x86 DLL"
4019 $ECHO "$win32_libid_type"
4022 # func_cygming_dll_for_implib ARG
4024 # Platform-specific function to extract the
4025 # name of the DLL associated with the specified
4026 # import library ARG.
4027 # Invoked by eval'ing the libtool variable
4028 # $sharedlib_from_linklib_cmd
4029 # Result is available in the variable
4030 # $sharedlib_from_linklib_result
4031 func_cygming_dll_for_implib ()
4034 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4037 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
4039 # The is the core of a fallback implementation of a
4040 # platform-specific function to extract the name of the
4041 # DLL associated with the specified import library LIBNAME.
4043 # SECTION_NAME is either .idata$6 or .idata$7, depending
4044 # on the platform and compiler that created the implib.
4046 # Echos the name of the DLL associated with the
4047 # specified import library.
4048 func_cygming_dll_for_implib_fallback_core ()
4051 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4052 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
4053 $SED '/^Contents of section '"$match_literal"':/{
4054 # Place marker at beginning of archive member dllname section
4059 # These lines can sometimes be longer than 43 characters, but
4060 # are always uninteresting
4061 /:[ ]*file format pe[i]\{,1\}-/d
4062 /^In archive [^:]*:/d
4063 # Ensure marker is printed
4065 # Remove all lines with less than 43 characters
4067 # From remaining lines, remove first 43 characters
4070 # Join marker and all lines until next marker into a single line
4071 /^====MARK====/ b para
4080 # Remove trailing dots and whitespace
4084 # we now have a list, one entry per line, of the stringified
4085 # contents of the appropriate section of all members of the
4086 # archive which possess that section. Heuristic: eliminate
4087 # all those which have a first or second character that is
4088 # a '.' (that is, objdump's representation of an unprintable
4089 # character.) This should work for all archives with less than
4090 # 0x302f exports -- but will fail for DLLs whose name actually
4091 # begins with a literal '.' or a single character followed by
4094 # Of those that remain, print the first one.
4095 $SED -e '/^\./d;/^.\./d;q'
4098 # func_cygming_gnu_implib_p ARG
4099 # This predicate returns with zero status (TRUE) if
4100 # ARG is a GNU/binutils-style import library. Returns
4101 # with nonzero status (FALSE) otherwise.
4102 func_cygming_gnu_implib_p ()
4105 func_to_tool_file "$1" func_convert_file_msys_to_w32
4106 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4107 test -n "$func_cygming_gnu_implib_tmp"
4110 # func_cygming_ms_implib_p ARG
4111 # This predicate returns with zero status (TRUE) if
4112 # ARG is an MS-style import library. Returns
4113 # with nonzero status (FALSE) otherwise.
4114 func_cygming_ms_implib_p ()
4117 func_to_tool_file "$1" func_convert_file_msys_to_w32
4118 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4119 test -n "$func_cygming_ms_implib_tmp"
4122 # func_cygming_dll_for_implib_fallback ARG
4123 # Platform-specific function to extract the
4124 # name of the DLL associated with the specified
4125 # import library ARG.
4127 # This fallback implementation is for use when $DLLTOOL
4128 # does not support the --identify-strict option.
4129 # Invoked by eval'ing the libtool variable
4130 # $sharedlib_from_linklib_cmd
4131 # Result is available in the variable
4132 # $sharedlib_from_linklib_result
4133 func_cygming_dll_for_implib_fallback ()
4136 if func_cygming_gnu_implib_p "$1" ; then
4137 # binutils import library
4138 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4139 elif func_cygming_ms_implib_p "$1" ; then
4140 # ms-generated import library
4141 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4144 sharedlib_from_linklib_result=""
4149 # func_extract_an_archive dir oldlib
4150 func_extract_an_archive ()
4153 f_ex_an_ar_dir="$1"; shift
4154 f_ex_an_ar_oldlib="$1"
4155 if test "$lock_old_archive_extraction" = yes; then
4156 lockfile=$f_ex_an_ar_oldlib.lock
4157 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
4158 func_echo "Waiting for $lockfile to be removed"
4162 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4163 'stat=$?; rm -f "$lockfile"; exit $stat'
4164 if test "$lock_old_archive_extraction" = yes; then
4165 $opt_dry_run || rm -f "$lockfile"
4167 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
4170 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
4175 # func_extract_archives gentop oldlib ...
4176 func_extract_archives ()
4179 my_gentop="$1"; shift
4180 my_oldlibs=${1+"$@"}
4186 for my_xlib in $my_oldlibs; do
4187 # Extract the objects.
4189 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
4190 *) my_xabs=`pwd`"/$my_xlib" ;;
4192 func_basename "$my_xlib"
4193 my_xlib="$func_basename_result"
4196 case " $extracted_archives " in
4198 func_arith $extracted_serial + 1
4199 extracted_serial=$func_arith_result
4200 my_xlib_u=lt$extracted_serial-$my_xlib ;;
4204 extracted_archives="$extracted_archives $my_xlib_u"
4205 my_xdir="$my_gentop/$my_xlib_u"
4207 func_mkdir_p "$my_xdir"
4211 func_verbose "Extracting $my_xabs"
4212 # Do not bother doing anything if just a dry run
4214 darwin_orig_dir=`pwd`
4215 cd $my_xdir || exit $?
4216 darwin_archive=$my_xabs
4218 darwin_base_archive=`basename "$darwin_archive"`
4219 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4220 if test -n "$darwin_arches"; then
4221 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4223 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
4224 for darwin_arch in $darwin_arches ; do
4225 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4226 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4227 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4228 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
4230 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
4231 done # $darwin_arches
4232 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
4233 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
4236 for darwin_file in $darwin_filelist; do
4237 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
4238 $LIPO -create -output "$darwin_file" $darwin_files
4239 done # $darwin_filelist
4241 cd "$darwin_orig_dir"
4244 func_extract_an_archive "$my_xdir" "$my_xabs"
4249 func_extract_an_archive "$my_xdir" "$my_xabs"
4252 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4255 func_extract_archives_result="$my_oldobjs"
4259 # func_emit_wrapper [arg=no]
4261 # Emit a libtool wrapper script on stdout.
4262 # Don't directly open a file because we may want to
4263 # incorporate the script contents within a cygwin/mingw
4264 # wrapper executable. Must ONLY be called from within
4265 # func_mode_link because it depends on a number of variables
4268 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
4269 # variable will take. If 'yes', then the emitted script
4270 # will assume that the directory in which it is stored is
4271 # the $objdir directory. This is a cygwin/mingw-specific
4273 func_emit_wrapper ()
4275 func_emit_wrapper_arg1=${1-no}
4280 # $output - temporary wrapper script for $objdir/$outputname
4281 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4283 # The $output program cannot be directly executed until all the libtool
4284 # libraries that it depends on are installed.
4286 # This wrapper script should never be moved out of the build directory.
4287 # If it is, it will not operate correctly.
4289 # Sed substitution that helps us do robust quoting. It backslashifies
4290 # metacharacters that are still active within double-quoted strings.
4291 sed_quote_subst='$sed_quote_subst'
4293 # Be Bourne compatible
4294 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
4297 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
4298 # is contrary to our usage. Disable this feature.
4299 alias -g '\${1+\"\$@\"}'='\"\$@\"'
4300 setopt NO_GLOB_SUBST
4302 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
4304 BIN_SH=xpg4; export BIN_SH # for Tru64
4305 DUALCASE=1; export DUALCASE # for MKS sh
4307 # The HP-UX ksh and POSIX shell print the target directory to stdout
4309 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4311 relink_command=\"$relink_command\"
4313 # This environment variable determines our operation mode.
4314 if test \"\$libtool_install_magic\" = \"$magic\"; then
4315 # install mode needs the following variables:
4316 generated_by_libtool_version='$macro_version'
4317 notinst_deplibs='$notinst_deplibs'
4319 # When we are sourced in execute mode, \$file and \$ECHO are already set.
4320 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4323 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
4326 # A function that is used when there is no print builtin or printf.
4327 func_fallback_echo ()
4329 eval 'cat <<_LTECHO_EOF
4336 # Very basic option parsing. These options are (a) specific to
4337 # the libtool wrapper, (b) are identical between the wrapper
4338 # /script/ and the wrapper /executable/ which is used only on
4339 # windows platforms, and (c) all begin with the string "--lt-"
4340 # (application programs are unlikely to have options which match
4343 # There are only two supported options: --lt-debug and
4344 # --lt-dump-script. There is, deliberately, no --lt-help.
4346 # The first argument to this parsing function should be the
4347 # script's $0 value, followed by "$@".
4349 func_parse_lt_options ()
4355 case \"\$lt_opt\" in
4356 --lt-debug) lt_option_debug=1 ;;
4358 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
4359 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
4360 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
4361 cat \"\$lt_dump_D/\$lt_dump_F\"
4365 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
4371 # Print the debug banner immediately:
4372 if test -n \"\$lt_option_debug\"; then
4373 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
4377 # Used when --lt-debug. Prints its arguments to stdout
4378 # (redirection is the responsibility of the caller)
4379 func_lt_dump_args ()
4384 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
4385 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4389 # Core function for launching the target application
4390 func_exec_program_core ()
4394 # Backslashes separate directories on plain windows
4395 *-*-mingw | *-*-os2* | *-cegcc*)
4397 if test -n \"\$lt_option_debug\"; then
4398 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
4399 func_lt_dump_args \${1+\"\$@\"} 1>&2
4401 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4407 if test -n \"\$lt_option_debug\"; then
4408 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
4409 func_lt_dump_args \${1+\"\$@\"} 1>&2
4411 exec \"\$progdir/\$program\" \${1+\"\$@\"}
4416 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
4420 # A function to encapsulate launching the target application
4421 # Strips options in the --lt-* namespace from \$@ and
4422 # launches target application with the remaining arguments.
4423 func_exec_program ()
4429 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4433 func_exec_program_core \${1+\"\$@\"}
4437 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4439 # Find the directory that this script lives in.
4440 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4441 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4443 # Follow symbolic links until we get to the real thisdir.
4444 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4445 while test -n \"\$file\"; do
4446 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4448 # If there was a directory component, then change thisdir.
4449 if test \"x\$destdir\" != \"x\$file\"; then
4450 case \"\$destdir\" in
4451 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4452 *) thisdir=\"\$thisdir/\$destdir\" ;;
4456 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4457 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4460 # Usually 'no', except on cygwin/mingw when embedded into
4462 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4463 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4464 # special case for '.'
4465 if test \"\$thisdir\" = \".\"; then
4468 # remove .libs from thisdir
4469 case \"\$thisdir\" in
4470 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4471 $objdir ) thisdir=. ;;
4475 # Try to get the absolute directory name.
4476 absdir=\`cd \"\$thisdir\" && pwd\`
4477 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4480 if test "$fast_install" = yes; then
4482 program=lt-'$outputname'$exeext
4483 progdir=\"\$thisdir/$objdir\"
4485 if test ! -f \"\$progdir/\$program\" ||
4486 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4487 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4489 file=\"\$\$-\$program\"
4491 if test ! -d \"\$progdir\"; then
4492 $MKDIR \"\$progdir\"
4494 $RM \"\$progdir/\$file\"
4499 # relink executable if necessary
4500 if test -n \"\$relink_command\"; then
4501 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4503 $ECHO \"\$relink_command_output\" >&2
4504 $RM \"\$progdir/\$file\"
4509 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4510 { $RM \"\$progdir/\$program\";
4511 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4512 $RM \"\$progdir/\$file\"
4516 program='$outputname'
4517 progdir=\"\$thisdir/$objdir\"
4523 if test -f \"\$progdir/\$program\"; then"
4525 # fixup the dll searchpath if we need to.
4527 # Fix the DLL searchpath if we need to. Do this before prepending
4528 # to shlibpath, because on Windows, both are PATH and uninstalled
4529 # libraries must come first.
4530 if test -n "$dllsearchpath"; then
4532 # Add the dll search path components to the executable PATH
4533 PATH=$dllsearchpath:\$PATH
4537 # Export our shlibpath_var if we have one.
4538 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4540 # Add our own library path to $shlibpath_var
4541 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4543 # Some systems cannot cope with colon-terminated $shlibpath_var
4544 # The second colon is a workaround for a bug in BeOS R4 sed
4545 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4547 export $shlibpath_var
4552 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4553 # Run the actual program with our arguments.
4554 func_exec_program \${1+\"\$@\"}
4557 # The program doesn't exist.
4558 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4559 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4560 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4568 # func_emit_cwrapperexe_src
4569 # emit the source code for a wrapper executable on stdout
4570 # Must ONLY be called from within func_mode_link because
4571 # it depends on a number of variable set therein.
4572 func_emit_cwrapperexe_src ()
4576 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4577 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4579 The $output program cannot be directly executed until all the libtool
4580 libraries that it depends on are installed.
4582 This wrapper executable should never be moved out of the build directory.
4583 If it is, it will not operate correctly.
4588 # define _CRT_SECURE_NO_DEPRECATE 1
4593 # include <direct.h>
4594 # include <process.h>
4597 # include <unistd.h>
4598 # include <stdint.h>
4610 #include <sys/stat.h>
4612 /* declarations of non-ANSI functions */
4613 #if defined(__MINGW32__)
4614 # ifdef __STRICT_ANSI__
4615 int _putenv (const char *);
4617 #elif defined(__CYGWIN__)
4618 # ifdef __STRICT_ANSI__
4619 char *realpath (const char *, char *);
4620 int putenv (char *);
4621 int setenv (const char *, const char *, int);
4623 /* #elif defined (other platforms) ... */
4626 /* portability defines, excluding path handling macros */
4627 #if defined(_MSC_VER)
4628 # define setmode _setmode
4630 # define chmod _chmod
4631 # define getcwd _getcwd
4632 # define putenv _putenv
4633 # define S_IXUSR _S_IEXEC
4634 # ifndef _INTPTR_T_DEFINED
4635 # define _INTPTR_T_DEFINED
4636 # define intptr_t int
4638 #elif defined(__MINGW32__)
4639 # define setmode _setmode
4641 # define chmod _chmod
4642 # define getcwd _getcwd
4643 # define putenv _putenv
4644 #elif defined(__CYGWIN__)
4645 # define HAVE_SETENV
4646 # define FOPEN_WB "wb"
4647 /* #elif defined (other platforms) ... */
4650 #if defined(PATH_MAX)
4651 # define LT_PATHMAX PATH_MAX
4652 #elif defined(MAXPATHLEN)
4653 # define LT_PATHMAX MAXPATHLEN
4655 # define LT_PATHMAX 1024
4665 /* path handling portability macros */
4666 #ifndef DIR_SEPARATOR
4667 # define DIR_SEPARATOR '/'
4668 # define PATH_SEPARATOR ':'
4671 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4673 # define HAVE_DOS_BASED_FILE_SYSTEM
4674 # define FOPEN_WB "wb"
4675 # ifndef DIR_SEPARATOR_2
4676 # define DIR_SEPARATOR_2 '\\'
4678 # ifndef PATH_SEPARATOR_2
4679 # define PATH_SEPARATOR_2 ';'
4683 #ifndef DIR_SEPARATOR_2
4684 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4685 #else /* DIR_SEPARATOR_2 */
4686 # define IS_DIR_SEPARATOR(ch) \
4687 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4688 #endif /* DIR_SEPARATOR_2 */
4690 #ifndef PATH_SEPARATOR_2
4691 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4692 #else /* PATH_SEPARATOR_2 */
4693 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4694 #endif /* PATH_SEPARATOR_2 */
4697 # define FOPEN_WB "w"
4700 # define _O_BINARY 0
4703 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4704 #define XFREE(stale) do { \
4705 if (stale) { free ((void *) stale); stale = 0; } \
4708 #if defined(LT_DEBUGWRAPPER)
4709 static int lt_debug = 1;
4711 static int lt_debug = 0;
4714 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4716 void *xmalloc (size_t num);
4717 char *xstrdup (const char *string);
4718 const char *base_name (const char *name);
4719 char *find_executable (const char *wrapper);
4720 char *chase_symlinks (const char *pathspec);
4721 int make_executable (const char *path);
4722 int check_executable (const char *path);
4723 char *strendzap (char *str, const char *pat);
4724 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4725 void lt_fatal (const char *file, int line, const char *message, ...);
4726 static const char *nonnull (const char *s);
4727 static const char *nonempty (const char *s);
4728 void lt_setenv (const char *name, const char *value);
4729 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4730 void lt_update_exe_path (const char *name, const char *value);
4731 void lt_update_lib_path (const char *name, const char *value);
4732 char **prepare_spawn (char **argv);
4733 void lt_dump_script (FILE *f);
4737 volatile const char * MAGIC_EXE = "$magic_exe";
4738 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4741 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4742 func_to_host_path "$temp_rpath"
4744 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4748 const char * LIB_PATH_VALUE = "";
4752 if test -n "$dllsearchpath"; then
4753 func_to_host_path "$dllsearchpath:"
4755 const char * EXE_PATH_VARNAME = "PATH";
4756 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4760 const char * EXE_PATH_VARNAME = "";
4761 const char * EXE_PATH_VALUE = "";
4765 if test "$fast_install" = yes; then
4767 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4771 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4778 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4780 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4781 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4782 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4785 main (int argc, char *argv[])
4790 char *actual_cwrapper_path;
4791 char *actual_cwrapper_name;
4794 intptr_t rval = 127;
4798 program_name = (char *) xstrdup (base_name (argv[0]));
4799 newargz = XMALLOC (char *, argc + 1);
4801 /* very simple arg parsing; don't want to rely on getopt
4802 * also, copy all non cwrapper options to newargz, except
4803 * argz[0], which is handled differently
4806 for (i = 1; i < argc; i++)
4808 if (strcmp (argv[i], dumpscript_opt) == 0)
4812 *mingw* | *cygwin* )
4813 # make stdout use "unix" line endings
4814 echo " setmode(1,_O_BINARY);"
4819 lt_dump_script (stdout);
4822 if (strcmp (argv[i], debug_opt) == 0)
4827 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4829 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4830 namespace, but it is not one of the ones we know about and
4831 have already dealt with, above (inluding dump-script), then
4832 report an error. Otherwise, targets might begin to believe
4833 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4834 namespace. The first time any user complains about this, we'll
4835 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4836 or a configure.ac-settable value.
4838 lt_fatal (__FILE__, __LINE__,
4839 "unrecognized %s option: '%s'",
4840 ltwrapper_option_prefix, argv[i]);
4843 newargz[++newargc] = xstrdup (argv[i]);
4845 newargz[++newargc] = NULL;
4849 /* The GNU banner must be the first non-error debug message */
4850 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4853 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4854 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4856 tmp_pathspec = find_executable (argv[0]);
4857 if (tmp_pathspec == NULL)
4858 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4859 lt_debugprintf (__FILE__, __LINE__,
4860 "(main) found exe (before symlink chase) at: %s\n",
4863 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4864 lt_debugprintf (__FILE__, __LINE__,
4865 "(main) found exe (after symlink chase) at: %s\n",
4866 actual_cwrapper_path);
4867 XFREE (tmp_pathspec);
4869 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4870 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4872 /* wrapper name transforms */
4873 strendzap (actual_cwrapper_name, ".exe");
4874 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4875 XFREE (actual_cwrapper_name);
4876 actual_cwrapper_name = tmp_pathspec;
4879 /* target_name transforms -- use actual target program name; might have lt- prefix */
4880 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4881 strendzap (target_name, ".exe");
4882 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4883 XFREE (target_name);
4884 target_name = tmp_pathspec;
4887 lt_debugprintf (__FILE__, __LINE__,
4888 "(main) libtool target name: %s\n",
4894 XMALLOC (char, (strlen (actual_cwrapper_path) +
4895 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4896 strcpy (newargz[0], actual_cwrapper_path);
4897 strcat (newargz[0], "$objdir");
4898 strcat (newargz[0], "/");
4902 /* stop here, and copy so we don't have to do this twice */
4903 tmp_pathspec = xstrdup (newargz[0]);
4905 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4906 strcat (newargz[0], actual_cwrapper_name);
4908 /* DO want the lt- prefix here if it exists, so use target_name */
4909 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4910 XFREE (tmp_pathspec);
4911 tmp_pathspec = NULL;
4919 while ((p = strchr (newargz[0], '\\')) != NULL)
4923 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4933 XFREE (target_name);
4934 XFREE (actual_cwrapper_path);
4935 XFREE (actual_cwrapper_name);
4937 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4938 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4939 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4940 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4941 because on Windows, both *_VARNAMEs are PATH but uninstalled
4942 libraries must come first. */
4943 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4944 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4946 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4947 nonnull (lt_argv_zero));
4948 for (i = 0; i < newargc; i++)
4950 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4951 i, nonnull (newargz[i]));
4959 /* execv doesn't actually work on mingw as expected on unix */
4960 newargz = prepare_spawn (newargz);
4961 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4964 /* failed to start process */
4965 lt_debugprintf (__FILE__, __LINE__,
4966 "(main) failed to launch target \"%s\": %s\n",
4967 lt_argv_zero, nonnull (strerror (errno)));
4975 execv (lt_argv_zero, newargz);
4976 return rval; /* =127, but avoids unused variable warning */
4985 xmalloc (size_t num)
4987 void *p = (void *) malloc (num);
4989 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4995 xstrdup (const char *string)
4997 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
5002 base_name (const char *name)
5006 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5007 /* Skip over the disk name in MSDOS pathnames. */
5008 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5012 for (base = name; *name; name++)
5013 if (IS_DIR_SEPARATOR (*name))
5019 check_executable (const char *path)
5023 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
5025 if ((!path) || (!*path))
5028 if ((stat (path, &st) >= 0)
5029 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5036 make_executable (const char *path)
5041 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
5043 if ((!path) || (!*path))
5046 if (stat (path, &st) >= 0)
5048 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
5053 /* Searches for the full path of the wrapper. Returns
5054 newly allocated full path name if found, NULL otherwise
5055 Does not chase symlinks, even on platforms that support them.
5058 find_executable (const char *wrapper)
5063 /* static buffer for getcwd */
5064 char tmp[LT_PATHMAX + 1];
5068 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
5069 nonempty (wrapper));
5071 if ((wrapper == NULL) || (*wrapper == '\0'))
5074 /* Absolute path? */
5075 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5076 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
5078 concat_name = xstrdup (wrapper);
5079 if (check_executable (concat_name))
5081 XFREE (concat_name);
5086 if (IS_DIR_SEPARATOR (wrapper[0]))
5088 concat_name = xstrdup (wrapper);
5089 if (check_executable (concat_name))
5091 XFREE (concat_name);
5093 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5097 for (p = wrapper; *p; p++)
5105 /* no slashes; search PATH */
5106 const char *path = getenv ("PATH");
5109 for (p = path; *p; p = p_next)
5113 for (q = p; *q; q++)
5114 if (IS_PATH_SEPARATOR (*q))
5117 p_next = (*q == '\0' ? q : q + 1);
5120 /* empty path: current directory */
5121 if (getcwd (tmp, LT_PATHMAX) == NULL)
5122 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5123 nonnull (strerror (errno)));
5124 tmp_len = strlen (tmp);
5126 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5127 memcpy (concat_name, tmp, tmp_len);
5128 concat_name[tmp_len] = '/';
5129 strcpy (concat_name + tmp_len + 1, wrapper);
5134 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
5135 memcpy (concat_name, p, p_len);
5136 concat_name[p_len] = '/';
5137 strcpy (concat_name + p_len + 1, wrapper);
5139 if (check_executable (concat_name))
5141 XFREE (concat_name);
5144 /* not found in PATH; assume curdir */
5146 /* Relative path | not found in path: prepend cwd */
5147 if (getcwd (tmp, LT_PATHMAX) == NULL)
5148 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5149 nonnull (strerror (errno)));
5150 tmp_len = strlen (tmp);
5151 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5152 memcpy (concat_name, tmp, tmp_len);
5153 concat_name[tmp_len] = '/';
5154 strcpy (concat_name + tmp_len + 1, wrapper);
5156 if (check_executable (concat_name))
5158 XFREE (concat_name);
5163 chase_symlinks (const char *pathspec)
5166 return xstrdup (pathspec);
5168 char buf[LT_PATHMAX];
5170 char *tmp_pathspec = xstrdup (pathspec);
5172 int has_symlinks = 0;
5173 while (strlen (tmp_pathspec) && !has_symlinks)
5175 lt_debugprintf (__FILE__, __LINE__,
5176 "checking path component for symlinks: %s\n",
5178 if (lstat (tmp_pathspec, &s) == 0)
5180 if (S_ISLNK (s.st_mode) != 0)
5186 /* search backwards for last DIR_SEPARATOR */
5187 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
5188 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5190 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5192 /* no more DIR_SEPARATORS left */
5199 lt_fatal (__FILE__, __LINE__,
5200 "error accessing file \"%s\": %s",
5201 tmp_pathspec, nonnull (strerror (errno)));
5204 XFREE (tmp_pathspec);
5208 return xstrdup (pathspec);
5211 tmp_pathspec = realpath (pathspec, buf);
5212 if (tmp_pathspec == 0)
5214 lt_fatal (__FILE__, __LINE__,
5215 "could not follow symlinks for %s", pathspec);
5217 return xstrdup (tmp_pathspec);
5222 strendzap (char *str, const char *pat)
5226 assert (str != NULL);
5227 assert (pat != NULL);
5230 patlen = strlen (pat);
5234 str += len - patlen;
5235 if (strcmp (str, pat) == 0)
5242 lt_debugprintf (const char *file, int line, const char *fmt, ...)
5247 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
5248 va_start (args, fmt);
5249 (void) vfprintf (stderr, fmt, args);
5255 lt_error_core (int exit_status, const char *file,
5256 int line, const char *mode,
5257 const char *message, va_list ap)
5259 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
5260 vfprintf (stderr, message, ap);
5261 fprintf (stderr, ".\n");
5263 if (exit_status >= 0)
5268 lt_fatal (const char *file, int line, const char *message, ...)
5271 va_start (ap, message);
5272 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
5277 nonnull (const char *s)
5279 return s ? s : "(null)";
5283 nonempty (const char *s)
5285 return (s && !*s) ? "(empty)" : nonnull (s);
5289 lt_setenv (const char *name, const char *value)
5291 lt_debugprintf (__FILE__, __LINE__,
5292 "(lt_setenv) setting '%s' to '%s'\n",
5293 nonnull (name), nonnull (value));
5296 /* always make a copy, for consistency with !HAVE_SETENV */
5297 char *str = xstrdup (value);
5298 setenv (name, str, 1);
5300 int len = strlen (name) + 1 + strlen (value) + 1;
5301 char *str = XMALLOC (char, len);
5302 sprintf (str, "%s=%s", name, value);
5303 if (putenv (str) != EXIT_SUCCESS)
5312 lt_extend_str (const char *orig_value, const char *add, int to_end)
5315 if (orig_value && *orig_value)
5317 int orig_value_len = strlen (orig_value);
5318 int add_len = strlen (add);
5319 new_value = XMALLOC (char, add_len + orig_value_len + 1);
5322 strcpy (new_value, orig_value);
5323 strcpy (new_value + orig_value_len, add);
5327 strcpy (new_value, add);
5328 strcpy (new_value + add_len, orig_value);
5333 new_value = xstrdup (add);
5339 lt_update_exe_path (const char *name, const char *value)
5341 lt_debugprintf (__FILE__, __LINE__,
5342 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
5343 nonnull (name), nonnull (value));
5345 if (name && *name && value && *value)
5347 char *new_value = lt_extend_str (getenv (name), value, 0);
5348 /* some systems can't cope with a ':'-terminated path #' */
5349 int len = strlen (new_value);
5350 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
5352 new_value[len-1] = '\0';
5354 lt_setenv (name, new_value);
5360 lt_update_lib_path (const char *name, const char *value)
5362 lt_debugprintf (__FILE__, __LINE__,
5363 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
5364 nonnull (name), nonnull (value));
5366 if (name && *name && value && *value)
5368 char *new_value = lt_extend_str (getenv (name), value, 0);
5369 lt_setenv (name, new_value);
5379 /* Prepares an argument vector before calling spawn().
5380 Note that spawn() does not by itself call the command interpreter
5381 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
5382 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
5384 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
5385 }) ? "cmd.exe" : "command.com").
5386 Instead it simply concatenates the arguments, separated by ' ', and calls
5387 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
5388 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
5390 - Space and tab are interpreted as delimiters. They are not treated as
5391 delimiters if they are surrounded by double quotes: "...".
5392 - Unescaped double quotes are removed from the input. Their only effect is
5393 that within double quotes, space and tab are treated like normal
5395 - Backslashes not followed by double quotes are not special.
5396 - But 2*n+1 backslashes followed by a double quote become
5397 n backslashes followed by a double quote (n >= 0):
5402 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
5403 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
5405 prepare_spawn (char **argv)
5411 /* Count number of arguments. */
5412 for (argc = 0; argv[argc] != NULL; argc++)
5415 /* Allocate new argument vector. */
5416 new_argv = XMALLOC (char *, argc + 1);
5418 /* Put quoted arguments into the new argument vector. */
5419 for (i = 0; i < argc; i++)
5421 const char *string = argv[i];
5423 if (string[0] == '\0')
5424 new_argv[i] = xstrdup ("\"\"");
5425 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
5427 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
5429 unsigned int backslashes;
5431 char *quoted_string;
5438 for (s = string; *s != '\0'; s++)
5442 length += backslashes + 1;
5450 length += backslashes + 1;
5452 quoted_string = XMALLOC (char, length + 1);
5458 for (s = string; *s != '\0'; s++)
5464 for (j = backslashes + 1; j > 0; j--)
5476 for (j = backslashes; j > 0; j--)
5482 new_argv[i] = quoted_string;
5485 new_argv[i] = (char *) string;
5487 new_argv[argc] = NULL;
5496 void lt_dump_script (FILE* f)
5499 func_emit_wrapper yes |
5500 $SED -e 's/\([\\"]\)/\\\1/g' \
5501 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
5507 # end: func_emit_cwrapperexe_src
5509 # func_emit_exe_manifest
5510 # emit a Win32 UAC manifest for executable on stdout
5511 # Must ONLY be called from within func_mode_link because
5512 # it depends on a number of variable set therein.
5513 func_emit_exe_manifest ()
5516 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
5517 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
5518 <assemblyIdentity version="1.0.0.0"
5522 i?86-*-* ) echo ' processorArchitecture="x86"' ;;
5523 ia64-*-* ) echo ' processorArchitecture="ia64"' ;;
5524 x86_64-*-* ) echo ' processorArchitecture="amd64"' ;;
5525 *) echo ' processorArchitecture="*"' ;;
5529 name="$host_os.$PROGRAM.$outputname"
5532 <!-- Identify the application security requirements. -->
5533 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
5535 <requestedPrivileges>
5536 <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
5537 </requestedPrivileges>
5544 # func_win32_import_lib_p ARG
5545 # True if ARG is an import lib, as indicated by $file_magic_cmd
5546 func_win32_import_lib_p ()
5549 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5555 # func_mode_link arg...
5560 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5561 # It is impossible to link a dll without this setting, and
5562 # we shouldn't force the makefile maintainer to figure out
5563 # which system we are compiling for in order to pass an extra
5564 # flag for every libtool invocation.
5565 # allow_undefined=no
5567 # FIXME: Unfortunately, there are problems with the above when trying
5568 # to make a dll which has undefined symbols, in which case not
5569 # even a static library is built. For now, we need to specify
5570 # -no-undefined on the libtool link line when we can be certain
5571 # that all symbols are satisfied, otherwise we get a static library.
5578 libtool_args=$nonopt
5579 base_compile="$nonopt $@"
5580 compile_command=$nonopt
5581 finalize_command=$nonopt
5594 lib_search_path=`pwd`
5596 new_inherited_linker_flags=
5605 export_symbols_regex=
5613 precious_files_regex=
5614 prefer_static_libs=no
5627 single_module="${wl}-single_module"
5628 func_infer_tag $base_compile
5630 # We need to know -static, to get the right output filenames.
5635 test "$build_libtool_libs" != yes && \
5636 func_fatal_configuration "can not build a shared library"
5640 -all-static | -static | -static-libtool-libs)
5643 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5644 func_warning "complete static linking is impossible in this configuration"
5646 if test -n "$link_static_flag"; then
5647 dlopen_self=$dlopen_self_static
5649 prefer_static_libs=yes
5652 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5653 dlopen_self=$dlopen_self_static
5655 prefer_static_libs=built
5657 -static-libtool-libs)
5658 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5659 dlopen_self=$dlopen_self_static
5661 prefer_static_libs=yes
5664 build_libtool_libs=no
5671 # See if our shared archives depend on static archives.
5672 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5674 # Go through the arguments, transforming them on the way.
5675 while test "$#" -gt 0; do
5678 func_quote_for_eval "$arg"
5679 qarg=$func_quote_for_eval_unquoted_result
5680 libtool_args+=" $func_quote_for_eval_result"
5682 # If the previous option needs an argument, assign it.
5683 if test -n "$prev"; then
5686 compile_command+=" @OUTPUT@"
5687 finalize_command+=" @OUTPUT@"
5698 if test "$preload" = no; then
5699 # Add the symbol object into the linking commands.
5700 compile_command+=" @SYMFILE@"
5701 finalize_command+=" @SYMFILE@"
5705 *.la | *.lo) ;; # We handle these cases below.
5707 if test "$dlself" = no; then
5715 if test "$prev" = dlprefiles; then
5717 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5727 if test "$prev" = dlfiles; then
5738 export_symbols="$arg"
5740 || func_fatal_error "symbol file \`$arg' does not exist"
5745 export_symbols_regex="$arg"
5753 *" $qarg.ltframework "*) ;;
5754 *) deplibs+=" $qarg.ltframework" # this is fixed later
5763 inst_prefix_dir="$arg"
5768 if test -f "$arg"; then
5771 for fil in `cat "$save_arg"`
5775 # A libtool-controlled object.
5777 # Check to see that this really is a libtool object.
5778 if func_lalib_unsafe_p "$arg"; then
5785 if test -z "$pic_object" ||
5786 test -z "$non_pic_object" ||
5787 test "$pic_object" = none &&
5788 test "$non_pic_object" = none; then
5789 func_fatal_error "cannot find name of object for \`$arg'"
5792 # Extract subdirectory from the argument.
5793 func_dirname "$arg" "/" ""
5794 xdir="$func_dirname_result"
5796 if test "$pic_object" != none; then
5797 # Prepend the subdirectory the object is found in.
5798 pic_object="$xdir$pic_object"
5800 if test "$prev" = dlfiles; then
5801 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5802 dlfiles+=" $pic_object"
5806 # If libtool objects are unsupported, then we need to preload.
5811 # CHECK ME: I think I busted this. -Ossama
5812 if test "$prev" = dlprefiles; then
5813 # Preload the old-style object.
5814 dlprefiles+=" $pic_object"
5819 libobjs+=" $pic_object"
5824 if test "$non_pic_object" != none; then
5825 # Prepend the subdirectory the object is found in.
5826 non_pic_object="$xdir$non_pic_object"
5828 # A standard non-PIC object
5829 non_pic_objects+=" $non_pic_object"
5830 if test -z "$pic_object" || test "$pic_object" = none ; then
5831 arg="$non_pic_object"
5834 # If the PIC object exists, use it instead.
5835 # $xdir was prepended to $pic_object above.
5836 non_pic_object="$pic_object"
5837 non_pic_objects+=" $non_pic_object"
5840 # Only an error if not doing a dry-run.
5841 if $opt_dry_run; then
5842 # Extract subdirectory from the argument.
5843 func_dirname "$arg" "/" ""
5844 xdir="$func_dirname_result"
5847 pic_object=$xdir$objdir/$func_lo2o_result
5848 non_pic_object=$xdir$func_lo2o_result
5849 libobjs+=" $pic_object"
5850 non_pic_objects+=" $non_pic_object"
5852 func_fatal_error "\`$arg' is not a valid libtool object"
5857 func_fatal_error "link input file \`$arg' does not exist"
5864 precious_files_regex="$arg"
5874 # We need an absolute path.
5876 [\\/]* | [A-Za-z]:[\\/]*) ;;
5878 func_fatal_error "only absolute run-paths are allowed"
5881 if test "$prev" = rpath; then
5884 *) rpath+=" $arg" ;;
5889 *) xrpath+=" $arg" ;;
5906 linker_flags+=" $qarg"
5907 compiler_flags+=" $qarg"
5909 compile_command+=" $qarg"
5910 finalize_command+=" $qarg"
5914 compiler_flags+=" $qarg"
5916 compile_command+=" $qarg"
5917 finalize_command+=" $qarg"
5921 linker_flags+=" $qarg"
5922 compiler_flags+=" $wl$qarg"
5924 compile_command+=" $wl$qarg"
5925 finalize_command+=" $wl$qarg"
5929 eval "$prev=\"\$arg\""
5934 fi # test -n "$prev"
5940 if test -n "$link_static_flag"; then
5941 # See comment for -static flag below, for more details.
5942 compile_command+=" $link_static_flag"
5943 finalize_command+=" $link_static_flag"
5949 # FIXME: remove this flag sometime in the future.
5950 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5978 -export-symbols | -export-symbols-regex)
5979 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5980 func_fatal_error "more than one -exported-symbols argument is not allowed"
5982 if test "X$arg" = "X-export-symbols"; then
6000 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
6001 # so, if we see these flags be careful not to treat them like -L
6003 case $with_gcc/$host in
6004 no/*-*-irix* | /*-*-irix*)
6005 compile_command+=" $arg"
6006 finalize_command+=" $arg"
6013 func_stripname "-L" '' "$arg"
6014 if test -z "$func_stripname_result"; then
6015 if test "$#" -gt 0; then
6016 func_fatal_error "require no space between \`-L' and \`$1'"
6018 func_fatal_error "need path for \`-L' option"
6021 func_resolve_sysroot "$func_stripname_result"
6022 dir=$func_resolve_sysroot_result
6023 # We need an absolute path.
6025 [\\/]* | [A-Za-z]:[\\/]*) ;;
6027 absdir=`cd "$dir" && pwd`
6028 test -z "$absdir" && \
6029 func_fatal_error "cannot determine absolute directory name of \`$dir'"
6034 *" -L$dir "* | *" $arg "*)
6035 # Will only happen for absolute or sysroot arguments
6038 # Preserve sysroot, but never include relative directories
6040 [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
6041 *) deplibs+=" -L$dir" ;;
6043 lib_search_path+=" $dir"
6047 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6048 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6049 case :$dllsearchpath: in
6051 ::) dllsearchpath=$dir;;
6052 *) dllsearchpath+=":$dir";;
6054 case :$dllsearchpath: in
6055 *":$testbindir:"*) ;;
6056 ::) dllsearchpath=$testbindir;;
6057 *) dllsearchpath+=":$testbindir";;
6065 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
6067 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6068 # These systems don't actually have a C or math library (as such)
6072 # These systems don't actually have a C library (as such)
6073 test "X$arg" = "X-lc" && continue
6075 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6076 # Do not include libc due to us having libc/libc_r.
6077 test "X$arg" = "X-lc" && continue
6079 *-*-rhapsody* | *-*-darwin1.[012])
6080 # Rhapsody C and math libraries are in the System framework
6081 deplibs+=" System.ltframework"
6084 *-*-sco3.2v5* | *-*-sco5v6*)
6085 # Causes problems with __ctype
6086 test "X$arg" = "X-lc" && continue
6088 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6089 # Compiler inserts libc in the correct place for threads to work
6090 test "X$arg" = "X-lc" && continue
6093 elif test "X$arg" = "X-lc_r"; then
6095 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6096 # Do not include libc_r directly, use -pthread flag.
6110 # Tru64 UNIX uses -model [arg] to determine the layout of C++
6111 # classes, name mangling, and exception handling.
6112 # Darwin uses the -arch flag to determine output architecture.
6113 -model|-arch|-isysroot|--sysroot)
6114 compiler_flags+=" $arg"
6115 compile_command+=" $arg"
6116 finalize_command+=" $arg"
6121 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
6122 compiler_flags+=" $arg"
6123 compile_command+=" $arg"
6124 finalize_command+=" $arg"
6125 case "$new_inherited_linker_flags " in
6127 * ) new_inherited_linker_flags+=" $arg" ;;
6133 single_module="${wl}-multi_module"
6144 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
6145 # The PATH hackery in wrapper scripts is required on Windows
6146 # and Darwin in order for the loader to find any dlls it needs.
6147 func_warning "\`-no-install' is ignored for $host"
6148 func_warning "assuming \`-no-fast-install' instead"
6151 *) no_install=yes ;;
6168 -precious-files-regex)
6189 func_stripname '-R' '' "$arg"
6190 dir=$func_stripname_result
6191 # We need an absolute path.
6193 [\\/]* | [A-Za-z]:[\\/]*) ;;
6195 func_stripname '=' '' "$dir"
6196 dir=$lt_sysroot$func_stripname_result
6199 func_fatal_error "only absolute run-paths are allowed"
6204 *) xrpath+=" $dir" ;;
6210 # The effects of -shared are defined in a previous loop.
6219 -static | -static-libtool-libs)
6220 # The effects of -static are defined in a previous loop.
6221 # We used to do the same as -all-static on platforms that
6222 # didn't have a PIC flag, but the assumption that the effects
6223 # would be equivalent was wrong. It would break on at least
6224 # Digital Unix and AIX.
6250 func_stripname '-Wc,' '' "$arg"
6251 args=$func_stripname_result
6253 save_ifs="$IFS"; IFS=','
6254 for flag in $args; do
6256 func_quote_for_eval "$flag"
6257 arg+=" $func_quote_for_eval_result"
6258 compiler_flags+=" $func_quote_for_eval_result"
6261 func_stripname ' ' '' "$arg"
6262 arg=$func_stripname_result
6266 func_stripname '-Wl,' '' "$arg"
6267 args=$func_stripname_result
6269 save_ifs="$IFS"; IFS=','
6270 for flag in $args; do
6272 func_quote_for_eval "$flag"
6273 arg+=" $wl$func_quote_for_eval_result"
6274 compiler_flags+=" $wl$func_quote_for_eval_result"
6275 linker_flags+=" $func_quote_for_eval_result"
6278 func_stripname ' ' '' "$arg"
6279 arg=$func_stripname_result
6299 func_quote_for_eval "$arg"
6300 arg="$func_quote_for_eval_result"
6303 # Flags to be passed through unchanged, with rationale:
6304 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
6305 # -r[0-9][0-9]* specify processor for the SGI compiler
6306 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
6307 # +DA*, +DD* enable 64-bit mode for the HP compiler
6308 # -q* compiler args for the IBM compiler
6309 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
6310 # -F/path path to uninstalled frameworks, gcc on darwin
6311 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
6312 # @file GCC response files
6313 # -tp=* Portland pgcc target processor selection
6314 # --sysroot=* for sysroot support
6315 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
6316 # -{shared,static}-libgcc, -static-{libgfortran|libstdc++}
6317 # link against specified runtime library
6318 # -fstack-protector* stack protector flags for GCC
6319 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
6320 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
6321 -O*|-flto*|-fwhopr*|-fuse-linker-plugin| \
6322 -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++| \
6324 func_quote_for_eval "$arg"
6325 arg="$func_quote_for_eval_result"
6326 compile_command+=" $arg"
6327 finalize_command+=" $arg"
6328 compiler_flags+=" $arg"
6332 # Some other compiler flag.
6334 func_quote_for_eval "$arg"
6335 arg="$func_quote_for_eval_result"
6339 # A standard object.
6344 # A libtool-controlled object.
6346 # Check to see that this really is a libtool object.
6347 if func_lalib_unsafe_p "$arg"; then
6354 if test -z "$pic_object" ||
6355 test -z "$non_pic_object" ||
6356 test "$pic_object" = none &&
6357 test "$non_pic_object" = none; then
6358 func_fatal_error "cannot find name of object for \`$arg'"
6361 # Extract subdirectory from the argument.
6362 func_dirname "$arg" "/" ""
6363 xdir="$func_dirname_result"
6365 if test "$pic_object" != none; then
6366 # Prepend the subdirectory the object is found in.
6367 pic_object="$xdir$pic_object"
6369 if test "$prev" = dlfiles; then
6370 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6371 dlfiles+=" $pic_object"
6375 # If libtool objects are unsupported, then we need to preload.
6380 # CHECK ME: I think I busted this. -Ossama
6381 if test "$prev" = dlprefiles; then
6382 # Preload the old-style object.
6383 dlprefiles+=" $pic_object"
6388 libobjs+=" $pic_object"
6393 if test "$non_pic_object" != none; then
6394 # Prepend the subdirectory the object is found in.
6395 non_pic_object="$xdir$non_pic_object"
6397 # A standard non-PIC object
6398 non_pic_objects+=" $non_pic_object"
6399 if test -z "$pic_object" || test "$pic_object" = none ; then
6400 arg="$non_pic_object"
6403 # If the PIC object exists, use it instead.
6404 # $xdir was prepended to $pic_object above.
6405 non_pic_object="$pic_object"
6406 non_pic_objects+=" $non_pic_object"
6409 # Only an error if not doing a dry-run.
6410 if $opt_dry_run; then
6411 # Extract subdirectory from the argument.
6412 func_dirname "$arg" "/" ""
6413 xdir="$func_dirname_result"
6416 pic_object=$xdir$objdir/$func_lo2o_result
6417 non_pic_object=$xdir$func_lo2o_result
6418 libobjs+=" $pic_object"
6419 non_pic_objects+=" $non_pic_object"
6421 func_fatal_error "\`$arg' is not a valid libtool object"
6429 old_deplibs+=" $arg"
6434 # A libtool-controlled library.
6436 func_resolve_sysroot "$arg"
6437 if test "$prev" = dlfiles; then
6438 # This library was specified with -dlopen.
6439 dlfiles+=" $func_resolve_sysroot_result"
6441 elif test "$prev" = dlprefiles; then
6442 # The library was specified with -dlpreopen.
6443 dlprefiles+=" $func_resolve_sysroot_result"
6446 deplibs+=" $func_resolve_sysroot_result"
6451 # Some other compiler argument.
6453 # Unknown arguments in both finalize_command and compile_command need
6454 # to be aesthetically quoted because they are evaled later.
6455 func_quote_for_eval "$arg"
6456 arg="$func_quote_for_eval_result"
6460 # Now actually substitute the argument into the commands.
6461 if test -n "$arg"; then
6462 compile_command+=" $arg"
6463 finalize_command+=" $arg"
6465 done # argument parsing loop
6467 test -n "$prev" && \
6468 func_fatal_help "the \`$prevarg' option requires an argument"
6470 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6471 eval arg=\"$export_dynamic_flag_spec\"
6472 compile_command+=" $arg"
6473 finalize_command+=" $arg"
6477 # calculate the name of the file, without its directory
6478 func_basename "$output"
6479 outputname="$func_basename_result"
6480 libobjs_save="$libobjs"
6482 if test -n "$shlibpath_var"; then
6483 # get the directories listed in $shlibpath_var
6484 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6488 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6489 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6491 func_dirname "$output" "/" ""
6492 output_objdir="$func_dirname_result$objdir"
6493 func_to_tool_file "$output_objdir/"
6494 tool_output_objdir=$func_to_tool_file_result
6495 # Create the object directory.
6496 func_mkdir_p "$output_objdir"
6498 # Determine the type of output
6501 func_fatal_help "you must specify an output file"
6503 *.$libext) linkmode=oldlib ;;
6504 *.lo | *.$objext) linkmode=obj ;;
6505 *.la) linkmode=lib ;;
6506 *) linkmode=prog ;; # Anything else should be a program.
6512 # Find all interdependent deplibs by searching for libraries
6513 # that are linked more than once (e.g. -la -lb -la)
6514 for deplib in $deplibs; do
6515 if $opt_preserve_dup_deps ; then
6517 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6523 if test "$linkmode" = lib; then
6524 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6526 # Compute libraries that are listed more than once in $predeps
6527 # $postdeps and mark them as special (i.e., whose duplicates are
6528 # not to be eliminated).
6530 if $opt_duplicate_compiler_generated_deps; then
6531 for pre_post_dep in $predeps $postdeps; do
6532 case "$pre_post_deps " in
6533 *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
6535 pre_post_deps+=" $pre_post_dep"
6544 need_relink=no # whether we're linking any uninstalled libtool libraries
6545 notinst_deplibs= # not-installed libtool libraries
6546 notinst_path= # paths that contain not-installed libtool libraries
6550 passes="conv dlpreopen link"
6551 for file in $dlfiles $dlprefiles; do
6555 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6566 passes="conv scan dlopen dlpreopen link"
6572 for pass in $passes; do
6573 # The preopen pass in lib mode reverses $deplibs; put it back here
6574 # so that -L comes before libs that need it for instance...
6575 if test "$linkmode,$pass" = "lib,link"; then
6576 ## FIXME: Find the place where the list is rebuilt in the wrong
6577 ## order, and fix it there properly
6579 for deplib in $deplibs; do
6580 tmp_deplibs="$deplib $tmp_deplibs"
6582 deplibs="$tmp_deplibs"
6585 if test "$linkmode,$pass" = "lib,link" ||
6586 test "$linkmode,$pass" = "prog,scan"; then
6590 if test "$linkmode" = prog; then
6592 dlopen) libs="$dlfiles" ;;
6593 dlpreopen) libs="$dlprefiles" ;;
6594 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6597 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6598 # Collect and forward deplibs of preopened libtool libs
6599 for lib in $dlprefiles; do
6600 # Ignore non-libtool-libs
6602 func_resolve_sysroot "$lib"
6604 *.la) func_source "$func_resolve_sysroot_result" ;;
6607 # Collect preopened libtool deplibs, except any this library
6608 # has declared as weak libs
6609 for deplib in $dependency_libs; do
6610 func_basename "$deplib"
6611 deplib_base=$func_basename_result
6612 case " $weak_libs " in
6613 *" $deplib_base "*) ;;
6614 *) deplibs+=" $deplib" ;;
6620 if test "$pass" = dlopen; then
6621 # Collect dlpreopened libraries
6622 save_deplibs="$deplibs"
6626 for deplib in $libs; do
6630 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
6631 if test "$linkmode,$pass" = "prog,link"; then
6632 compile_deplibs="$deplib $compile_deplibs"
6633 finalize_deplibs="$deplib $finalize_deplibs"
6635 compiler_flags+=" $deplib"
6636 if test "$linkmode" = lib ; then
6637 case "$new_inherited_linker_flags " in
6639 * ) new_inherited_linker_flags+=" $deplib" ;;
6646 if test "$linkmode" != lib && test "$linkmode" != prog; then
6647 func_warning "\`-l' is ignored for archives/objects"
6650 func_stripname '-l' '' "$deplib"
6651 name=$func_stripname_result
6652 if test "$linkmode" = lib; then
6653 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6655 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6657 for searchdir in $searchdirs; do
6658 for search_ext in .la $std_shrext .so .a; do
6659 # Search the libtool library
6660 lib="$searchdir/lib${name}${search_ext}"
6661 if test -f "$lib"; then
6662 if test "$search_ext" = ".la"; then
6671 if test "$found" != yes; then
6672 # deplib doesn't seem to be a libtool library
6673 if test "$linkmode,$pass" = "prog,link"; then
6674 compile_deplibs="$deplib $compile_deplibs"
6675 finalize_deplibs="$deplib $finalize_deplibs"
6677 deplibs="$deplib $deplibs"
6678 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6681 else # deplib is a libtool library
6682 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6683 # We need to do some special things here, and not later.
6684 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6685 case " $predeps $postdeps " in
6687 if func_lalib_p "$lib"; then
6691 for l in $old_library $library_names; do
6694 if test "X$ll" = "X$old_library" ; then # only static version available
6696 func_dirname "$lib" "" "."
6697 ladir="$func_dirname_result"
6698 lib=$ladir/$old_library
6699 if test "$linkmode,$pass" = "prog,link"; then
6700 compile_deplibs="$deplib $compile_deplibs"
6701 finalize_deplibs="$deplib $finalize_deplibs"
6703 deplibs="$deplib $deplibs"
6704 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6716 if test "$linkmode,$pass" = "prog,link"; then
6717 compile_deplibs="$deplib $compile_deplibs"
6718 finalize_deplibs="$deplib $finalize_deplibs"
6720 deplibs="$deplib $deplibs"
6721 if test "$linkmode" = lib ; then
6722 case "$new_inherited_linker_flags " in
6724 * ) new_inherited_linker_flags+=" $deplib" ;;
6733 deplibs="$deplib $deplibs"
6734 test "$pass" = conv && continue
6735 newdependency_libs="$deplib $newdependency_libs"
6736 func_stripname '-L' '' "$deplib"
6737 func_resolve_sysroot "$func_stripname_result"
6738 newlib_search_path+=" $func_resolve_sysroot_result"
6741 if test "$pass" = conv; then
6742 deplibs="$deplib $deplibs"
6745 if test "$pass" = scan; then
6746 deplibs="$deplib $deplibs"
6748 compile_deplibs="$deplib $compile_deplibs"
6749 finalize_deplibs="$deplib $finalize_deplibs"
6751 func_stripname '-L' '' "$deplib"
6752 func_resolve_sysroot "$func_stripname_result"
6753 newlib_search_path+=" $func_resolve_sysroot_result"
6756 func_warning "\`-L' is ignored for archives/objects"
6762 if test "$pass" = link; then
6763 func_stripname '-R' '' "$deplib"
6764 func_resolve_sysroot "$func_stripname_result"
6765 dir=$func_resolve_sysroot_result
6766 # Make sure the xrpath contains only unique directories.
6769 *) xrpath+=" $dir" ;;
6772 deplibs="$deplib $deplibs"
6776 func_resolve_sysroot "$deplib"
6777 lib=$func_resolve_sysroot_result
6780 if test "$pass" = conv; then
6781 deplibs="$deplib $deplibs"
6786 # Linking convenience modules into shared libraries is allowed,
6787 # but linking other static libraries is non-portable.
6788 case " $dlpreconveniencelibs " in
6792 case $deplibs_check_method in
6794 set dummy $deplibs_check_method; shift
6795 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6796 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6797 | $EGREP "$match_pattern_regex" > /dev/null; then
6805 if test "$valid_a_lib" != yes; then
6807 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6808 echo "*** I have the capability to make that library automatically link in when"
6809 echo "*** you link to this library. But I can only do this if you have a"
6810 echo "*** shared version of the library, which you do not appear to have"
6811 echo "*** because the file extensions .$libext of this argument makes me believe"
6812 echo "*** that it is just a static archive that I should not use here."
6815 $ECHO "*** Warning: Linking the shared library $output against the"
6816 $ECHO "*** static library $deplib is not portable!"
6817 deplibs="$deplib $deplibs"
6824 if test "$pass" != link; then
6825 deplibs="$deplib $deplibs"
6827 compile_deplibs="$deplib $compile_deplibs"
6828 finalize_deplibs="$deplib $finalize_deplibs"
6835 if test "$pass" = conv; then
6836 deplibs="$deplib $deplibs"
6837 elif test "$linkmode" = prog; then
6838 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6839 # If there is no dlopen support or we're linking statically,
6840 # we need to preload.
6841 newdlprefiles+=" $deplib"
6842 compile_deplibs="$deplib $compile_deplibs"
6843 finalize_deplibs="$deplib $finalize_deplibs"
6845 newdlfiles+=" $deplib"
6856 if test "$found" = yes || test -f "$lib"; then :
6858 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6861 # Check to see that this really is a libtool archive.
6862 func_lalib_unsafe_p "$lib" \
6863 || func_fatal_error "\`$lib' is not a valid libtool archive"
6865 func_dirname "$lib" "" "."
6866 ladir="$func_dirname_result"
6874 inherited_linker_flags=
6875 # If the library was installed with an old release of libtool,
6876 # it will not redefine variables installed, or shouldnotlink
6885 # Convert "-framework foo" to "foo.ltframework"
6886 if test -n "$inherited_linker_flags"; then
6887 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6888 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6889 case " $new_inherited_linker_flags " in
6890 *" $tmp_inherited_linker_flag "*) ;;
6891 *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
6895 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6896 if test "$linkmode,$pass" = "lib,link" ||
6897 test "$linkmode,$pass" = "prog,scan" ||
6898 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6899 test -n "$dlopen" && dlfiles+=" $dlopen"
6900 test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
6903 if test "$pass" = conv; then
6904 # Only check for convenience libraries
6905 deplibs="$lib $deplibs"
6906 if test -z "$libdir"; then
6907 if test -z "$old_library"; then
6908 func_fatal_error "cannot find name of link library for \`$lib'"
6910 # It is a libtool convenience library, so add in its objects.
6911 convenience+=" $ladir/$objdir/$old_library"
6912 old_convenience+=" $ladir/$objdir/$old_library"
6913 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6914 func_fatal_error "\`$lib' is not a convenience library"
6917 for deplib in $dependency_libs; do
6918 deplibs="$deplib $deplibs"
6919 if $opt_preserve_dup_deps ; then
6920 case "$tmp_libs " in
6921 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6924 tmp_libs+=" $deplib"
6930 # Get the name of the library we link against.
6932 if test -n "$old_library" &&
6933 { test "$prefer_static_libs" = yes ||
6934 test "$prefer_static_libs,$installed" = "built,no"; }; then
6935 linklib=$old_library
6937 for l in $old_library $library_names; do
6941 if test -z "$linklib"; then
6942 func_fatal_error "cannot find name of link library for \`$lib'"
6945 # This library was specified with -dlopen.
6946 if test "$pass" = dlopen; then
6947 if test -z "$libdir"; then
6948 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6950 if test -z "$dlname" ||
6951 test "$dlopen_support" != yes ||
6952 test "$build_libtool_libs" = no; then
6953 # If there is no dlname, no dlopen support or we're linking
6954 # statically, we need to preload. We also need to preload any
6955 # dependent libraries so libltdl's deplib preloader doesn't
6956 # bomb out in the load deplibs phase.
6957 dlprefiles+=" $lib $dependency_libs"
6964 # We need an absolute path.
6966 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6968 abs_ladir=`cd "$ladir" && pwd`
6969 if test -z "$abs_ladir"; then
6970 func_warning "cannot determine absolute directory name of \`$ladir'"
6971 func_warning "passing it literally to the linker, although it might fail"
6976 func_basename "$lib"
6977 laname="$func_basename_result"
6979 # Find the relevant object directory and library name.
6980 if test "X$installed" = Xyes; then
6981 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6982 func_warning "library \`$lib' was moved."
6987 dir="$lt_sysroot$libdir"
6988 absdir="$lt_sysroot$libdir"
6990 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6992 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6995 # Remove this search path later
6996 notinst_path+=" $abs_ladir"
6998 dir="$ladir/$objdir"
6999 absdir="$abs_ladir/$objdir"
7000 # Remove this search path later
7001 notinst_path+=" $abs_ladir"
7003 fi # $installed = yes
7004 func_stripname 'lib' '.la' "$laname"
7005 name=$func_stripname_result
7007 # This library was specified with -dlpreopen.
7008 if test "$pass" = dlpreopen; then
7009 if test -z "$libdir" && test "$linkmode" = prog; then
7010 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
7013 # special handling for platforms with PE-DLLs.
7014 *cygwin* | *mingw* | *cegcc* )
7015 # Linker will automatically link against shared library if both
7016 # static and shared are present. Therefore, ensure we extract
7017 # symbols from the import library if a shared library is present
7018 # (otherwise, the dlopen module name will be incorrect). We do
7019 # this by putting the import library name into $newdlprefiles.
7020 # We recover the dlopen module name by 'saving' the la file
7021 # name in a special purpose variable, and (later) extracting the
7022 # dlname from the la file.
7023 if test -n "$dlname"; then
7024 func_tr_sh "$dir/$linklib"
7025 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
7026 newdlprefiles+=" $dir/$linklib"
7028 newdlprefiles+=" $dir/$old_library"
7029 # Keep a list of preopened convenience libraries to check
7030 # that they are being used correctly in the link pass.
7031 test -z "$libdir" && \
7032 dlpreconveniencelibs+=" $dir/$old_library"
7036 # Prefer using a static library (so that no silly _DYNAMIC symbols
7037 # are required to link).
7038 if test -n "$old_library"; then
7039 newdlprefiles+=" $dir/$old_library"
7040 # Keep a list of preopened convenience libraries to check
7041 # that they are being used correctly in the link pass.
7042 test -z "$libdir" && \
7043 dlpreconveniencelibs+=" $dir/$old_library"
7044 # Otherwise, use the dlname, so that lt_dlopen finds it.
7045 elif test -n "$dlname"; then
7046 newdlprefiles+=" $dir/$dlname"
7048 newdlprefiles+=" $dir/$linklib"
7052 fi # $pass = dlpreopen
7054 if test -z "$libdir"; then
7055 # Link the convenience library
7056 if test "$linkmode" = lib; then
7057 deplibs="$dir/$old_library $deplibs"
7058 elif test "$linkmode,$pass" = "prog,link"; then
7059 compile_deplibs="$dir/$old_library $compile_deplibs"
7060 finalize_deplibs="$dir/$old_library $finalize_deplibs"
7062 deplibs="$lib $deplibs" # used for prog,scan pass
7068 if test "$linkmode" = prog && test "$pass" != link; then
7069 newlib_search_path+=" $ladir"
7070 deplibs="$lib $deplibs"
7073 if test "$link_all_deplibs" != no || test -z "$library_names" ||
7074 test "$build_libtool_libs" = no; then
7079 for deplib in $dependency_libs; do
7081 -L*) func_stripname '-L' '' "$deplib"
7082 func_resolve_sysroot "$func_stripname_result"
7083 newlib_search_path+=" $func_resolve_sysroot_result"
7086 # Need to link against all dependency_libs?
7087 if test "$linkalldeplibs" = yes; then
7088 deplibs="$deplib $deplibs"
7090 # Need to hardcode shared library paths
7091 # or/and link against static libraries
7092 newdependency_libs="$deplib $newdependency_libs"
7094 if $opt_preserve_dup_deps ; then
7095 case "$tmp_libs " in
7096 *" $deplib "*) specialdeplibs+=" $deplib" ;;
7099 tmp_libs+=" $deplib"
7102 fi # $linkmode = prog...
7104 if test "$linkmode,$pass" = "prog,link"; then
7105 if test -n "$library_names" &&
7106 { { test "$prefer_static_libs" = no ||
7107 test "$prefer_static_libs,$installed" = "built,yes"; } ||
7108 test -z "$old_library"; }; then
7109 # We need to hardcode the library path
7110 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
7111 # Make sure the rpath contains only unique directories.
7112 case "$temp_rpath:" in
7114 *) temp_rpath+="$absdir:" ;;
7118 # Hardcode the library path.
7119 # Skip directories that are in the system default run-time
7121 case " $sys_lib_dlsearch_path " in
7124 case "$compile_rpath " in
7126 *) compile_rpath+=" $absdir" ;;
7130 case " $sys_lib_dlsearch_path " in
7133 case "$finalize_rpath " in
7135 *) finalize_rpath+=" $libdir" ;;
7139 fi # $linkmode,$pass = prog,link...
7141 if test "$alldeplibs" = yes &&
7142 { test "$deplibs_check_method" = pass_all ||
7143 { test "$build_libtool_libs" = yes &&
7144 test -n "$library_names"; }; }; then
7145 # We only need to search for static libraries
7150 link_static=no # Whether the deplib will be linked statically
7151 use_static_libs=$prefer_static_libs
7152 if test "$use_static_libs" = built && test "$installed" = yes; then
7155 if test -n "$library_names" &&
7156 { test "$use_static_libs" = no || test -z "$old_library"; }; then
7158 *cygwin* | *mingw* | *cegcc*)
7159 # No point in relinking DLLs because paths are not encoded
7160 notinst_deplibs+=" $lib"
7164 if test "$installed" = no; then
7165 notinst_deplibs+=" $lib"
7170 # This is a shared library
7172 # Warn about portability, can't link against -module's on some
7173 # systems (darwin). Don't bleat about dlopened modules though!
7175 for dlpremoduletest in $dlprefiles; do
7176 if test "X$dlpremoduletest" = "X$lib"; then
7177 dlopenmodule="$dlpremoduletest"
7181 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
7183 if test "$linkmode" = prog; then
7184 $ECHO "*** Warning: Linking the executable $output against the loadable module"
7186 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
7188 $ECHO "*** $linklib is not portable!"
7190 if test "$linkmode" = lib &&
7191 test "$hardcode_into_libs" = yes; then
7192 # Hardcode the library path.
7193 # Skip directories that are in the system default run-time
7195 case " $sys_lib_dlsearch_path " in
7198 case "$compile_rpath " in
7200 *) compile_rpath+=" $absdir" ;;
7204 case " $sys_lib_dlsearch_path " in
7207 case "$finalize_rpath " in
7209 *) finalize_rpath+=" $libdir" ;;
7215 if test -n "$old_archive_from_expsyms_cmds"; then
7216 # figure out the soname
7217 set dummy $library_names
7221 libname=`eval "\\$ECHO \"$libname_spec\""`
7222 # use dlname if we got it. it's perfectly good, no?
7223 if test -n "$dlname"; then
7225 elif test -n "$soname_spec"; then
7228 *cygwin* | mingw* | *cegcc*)
7229 func_arith $current - $age
7230 major=$func_arith_result
7234 eval soname=\"$soname_spec\"
7239 # Make a new name for the extract_expsyms_cmds to use
7241 func_basename "$soroot"
7242 soname="$func_basename_result"
7243 func_stripname 'lib' '.dll' "$soname"
7244 newlib=libimp-$func_stripname_result.a
7246 # If the library has no export list, then create one now
7247 if test -f "$output_objdir/$soname-def"; then :
7249 func_verbose "extracting exported symbol list from \`$soname'"
7250 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
7254 if test -f "$output_objdir/$newlib"; then :; else
7255 func_verbose "generating import library for \`$soname'"
7256 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
7258 # make sure the library variables are pointing to the new library
7261 fi # test -n "$old_archive_from_expsyms_cmds"
7263 if test "$linkmode" = prog || test "$opt_mode" != relink; then
7268 case $hardcode_action in
7269 immediate | unsupported)
7270 if test "$hardcode_direct" = no; then
7273 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7274 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
7275 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
7276 *-*-unixware7*) add_dir="-L$dir" ;;
7278 # if the lib is a (non-dlopened) module then we can not
7279 # link against it, someone is ignoring the earlier warnings
7280 if /usr/bin/file -L $add 2> /dev/null |
7281 $GREP ": [^:]* bundle" >/dev/null ; then
7282 if test "X$dlopenmodule" != "X$lib"; then
7283 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
7284 if test -z "$old_library" ; then
7286 echo "*** And there doesn't seem to be a static archive available"
7287 echo "*** The link will probably fail, sorry"
7289 add="$dir/$old_library"
7291 elif test -n "$old_library"; then
7292 add="$dir/$old_library"
7296 elif test "$hardcode_minus_L" = no; then
7298 *-*-sunos*) add_shlibpath="$dir" ;;
7302 elif test "$hardcode_shlibpath_var" = no; then
7303 add_shlibpath="$dir"
7310 if test "$hardcode_direct" = yes &&
7311 test "$hardcode_direct_absolute" = no; then
7313 elif test "$hardcode_minus_L" = yes; then
7315 # Try looking first in the location we're being installed to.
7316 if test -n "$inst_prefix_dir"; then
7319 add_dir+=" -L$inst_prefix_dir$libdir"
7324 elif test "$hardcode_shlibpath_var" = yes; then
7325 add_shlibpath="$dir"
7334 if test "$lib_linked" != yes; then
7335 func_fatal_configuration "unsupported hardcode properties"
7338 if test -n "$add_shlibpath"; then
7339 case :$compile_shlibpath: in
7340 *":$add_shlibpath:"*) ;;
7341 *) compile_shlibpath+="$add_shlibpath:" ;;
7344 if test "$linkmode" = prog; then
7345 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
7346 test -n "$add" && compile_deplibs="$add $compile_deplibs"
7348 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7349 test -n "$add" && deplibs="$add $deplibs"
7350 if test "$hardcode_direct" != yes &&
7351 test "$hardcode_minus_L" != yes &&
7352 test "$hardcode_shlibpath_var" = yes; then
7353 case :$finalize_shlibpath: in
7355 *) finalize_shlibpath+="$libdir:" ;;
7361 if test "$linkmode" = prog || test "$opt_mode" = relink; then
7365 # Finalize command for both is simple: just hardcode it.
7366 if test "$hardcode_direct" = yes &&
7367 test "$hardcode_direct_absolute" = no; then
7368 add="$libdir/$linklib"
7369 elif test "$hardcode_minus_L" = yes; then
7372 elif test "$hardcode_shlibpath_var" = yes; then
7373 case :$finalize_shlibpath: in
7375 *) finalize_shlibpath+="$libdir:" ;;
7378 elif test "$hardcode_automatic" = yes; then
7379 if test -n "$inst_prefix_dir" &&
7380 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7381 add="$inst_prefix_dir$libdir/$linklib"
7383 add="$libdir/$linklib"
7386 # We cannot seem to hardcode it, guess we'll fake it.
7388 # Try looking first in the location we're being installed to.
7389 if test -n "$inst_prefix_dir"; then
7392 add_dir+=" -L$inst_prefix_dir$libdir"
7399 if test "$linkmode" = prog; then
7400 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
7401 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
7403 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7404 test -n "$add" && deplibs="$add $deplibs"
7407 elif test "$linkmode" = prog; then
7408 # Here we assume that one of hardcode_direct or hardcode_minus_L
7409 # is not unsupported. This is valid on all known static and
7411 if test "$hardcode_direct" != unsupported; then
7412 test -n "$old_library" && linklib="$old_library"
7413 compile_deplibs="$dir/$linklib $compile_deplibs"
7414 finalize_deplibs="$dir/$linklib $finalize_deplibs"
7416 compile_deplibs="-l$name -L$dir $compile_deplibs"
7417 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
7419 elif test "$build_libtool_libs" = yes; then
7420 # Not a shared library
7421 if test "$deplibs_check_method" != pass_all; then
7422 # We're trying link a shared library against a static one
7423 # but the system doesn't support it.
7425 # Just print a warning and add the library to dependency_libs so
7426 # that the program can be linked against the static library.
7428 $ECHO "*** Warning: This system can not link to static lib archive $lib."
7429 echo "*** I have the capability to make that library automatically link in when"
7430 echo "*** you link to this library. But I can only do this if you have a"
7431 echo "*** shared version of the library, which you do not appear to have."
7432 if test "$module" = yes; then
7433 echo "*** But as you try to build a module library, libtool will still create "
7434 echo "*** a static module, that should work as long as the dlopening application"
7435 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
7436 if test -z "$global_symbol_pipe"; then
7438 echo "*** However, this would only work if libtool was able to extract symbol"
7439 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7440 echo "*** not find such a program. So, this module is probably useless."
7441 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7443 if test "$build_old_libs" = no; then
7444 build_libtool_libs=module
7447 build_libtool_libs=no
7451 deplibs="$dir/$old_library $deplibs"
7454 fi # link shared/static library?
7456 if test "$linkmode" = lib; then
7457 if test -n "$dependency_libs" &&
7458 { test "$hardcode_into_libs" != yes ||
7459 test "$build_old_libs" = yes ||
7460 test "$link_static" = yes; }; then
7461 # Extract -R from dependency_libs
7463 for libdir in $dependency_libs; do
7465 -R*) func_stripname '-R' '' "$libdir"
7466 temp_xrpath=$func_stripname_result
7468 *" $temp_xrpath "*) ;;
7469 *) xrpath+=" $temp_xrpath";;
7471 *) temp_deplibs+=" $libdir";;
7474 dependency_libs="$temp_deplibs"
7477 newlib_search_path+=" $absdir"
7478 # Link against this library
7479 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7480 # ... and its dependency_libs
7482 for deplib in $dependency_libs; do
7483 newdependency_libs="$deplib $newdependency_libs"
7485 -L*) func_stripname '-L' '' "$deplib"
7486 func_resolve_sysroot "$func_stripname_result";;
7487 *) func_resolve_sysroot "$deplib" ;;
7489 if $opt_preserve_dup_deps ; then
7490 case "$tmp_libs " in
7491 *" $func_resolve_sysroot_result "*)
7492 specialdeplibs+=" $func_resolve_sysroot_result" ;;
7495 tmp_libs+=" $func_resolve_sysroot_result"
7498 if test "$link_all_deplibs" != no; then
7499 # Add the search paths of all dependency libraries
7500 for deplib in $dependency_libs; do
7503 -L*) path="$deplib" ;;
7505 func_resolve_sysroot "$deplib"
7506 deplib=$func_resolve_sysroot_result
7507 func_dirname "$deplib" "" "."
7508 dir=$func_dirname_result
7509 # We need an absolute path.
7511 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7513 absdir=`cd "$dir" && pwd`
7514 if test -z "$absdir"; then
7515 func_warning "cannot determine absolute directory name of \`$dir'"
7520 if $GREP "^installed=no" $deplib > /dev/null; then
7524 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7525 if test -n "$deplibrary_names" ; then
7526 for tmp in $deplibrary_names ; do
7529 if test -f "$absdir/$objdir/$depdepl" ; then
7530 depdepl="$absdir/$objdir/$depdepl"
7531 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7532 if test -z "$darwin_install_name"; then
7533 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7535 compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7536 linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
7542 path="-L$absdir/$objdir"
7546 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7547 test -z "$libdir" && \
7548 func_fatal_error "\`$deplib' is not a valid libtool archive"
7549 test "$absdir" != "$libdir" && \
7550 func_warning "\`$deplib' seems to be moved"
7556 case " $deplibs " in
7558 *) deplibs="$path $deplibs" ;;
7561 fi # link_all_deplibs != no
7563 done # for deplib in $libs
7564 if test "$pass" = link; then
7565 if test "$linkmode" = "prog"; then
7566 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7567 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7569 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7572 dependency_libs="$newdependency_libs"
7573 if test "$pass" = dlpreopen; then
7574 # Link the dlpreopened libraries before other libraries
7575 for deplib in $save_deplibs; do
7576 deplibs="$deplib $deplibs"
7579 if test "$pass" != dlopen; then
7580 if test "$pass" != conv; then
7581 # Make sure lib_search_path contains only unique directories.
7583 for dir in $newlib_search_path; do
7584 case "$lib_search_path " in
7586 *) lib_search_path+=" $dir" ;;
7592 if test "$linkmode,$pass" != "prog,link"; then
7595 vars="compile_deplibs finalize_deplibs"
7597 for var in $vars dependency_libs; do
7598 # Add libraries to $var in reverse order
7599 eval tmp_libs=\"\$$var\"
7601 for deplib in $tmp_libs; do
7602 # FIXME: Pedantically, this is the right thing to do, so
7603 # that some nasty dependency loop isn't accidentally
7605 #new_libs="$deplib $new_libs"
7606 # Pragmatically, this seems to cause very few problems in
7609 -L*) new_libs="$deplib $new_libs" ;;
7612 # And here is the reason: when a library appears more
7613 # than once as an explicit dependence of a library, or
7614 # is implicitly linked in more than once by the
7615 # compiler, it is considered special, and multiple
7616 # occurrences thereof are not removed. Compare this
7617 # with having the same library being listed as a
7618 # dependency of multiple other libraries: in this case,
7619 # we know (pedantically, we assume) the library does not
7620 # need to be listed more than once, so we keep only the
7621 # last copy. This is not always right, but it is rare
7622 # enough that we require users that really mean to play
7623 # such unportable linking tricks to link the library
7624 # using -Wl,-lname, so that libtool does not consider it
7625 # for duplicate removal.
7626 case " $specialdeplibs " in
7627 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7629 case " $new_libs " in
7631 *) new_libs="$deplib $new_libs" ;;
7639 for deplib in $new_libs; do
7642 case " $tmp_libs " in
7644 *) tmp_libs+=" $deplib" ;;
7647 *) tmp_libs+=" $deplib" ;;
7650 eval $var=\"$tmp_libs\"
7653 # Last step: remove runtime libs from dependency_libs
7654 # (they stay in deplibs)
7656 for i in $dependency_libs ; do
7657 case " $predeps $postdeps $compiler_lib_search_path " in
7662 if test -n "$i" ; then
7666 dependency_libs=$tmp_libs
7668 if test "$linkmode" = prog; then
7669 dlfiles="$newdlfiles"
7671 if test "$linkmode" = prog || test "$linkmode" = lib; then
7672 dlprefiles="$newdlprefiles"
7677 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7678 func_warning "\`-dlopen' is ignored for archives"
7683 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7686 test -n "$rpath" && \
7687 func_warning "\`-rpath' is ignored for archives"
7689 test -n "$xrpath" && \
7690 func_warning "\`-R' is ignored for archives"
7692 test -n "$vinfo" && \
7693 func_warning "\`-version-info/-version-number' is ignored for archives"
7695 test -n "$release" && \
7696 func_warning "\`-release' is ignored for archives"
7698 test -n "$export_symbols$export_symbols_regex" && \
7699 func_warning "\`-export-symbols' is ignored for archives"
7701 # Now set the variables for building old libraries.
7702 build_libtool_libs=no
7704 objs+="$old_deplibs"
7708 # Make sure we only generate libraries of the form `libNAME.la'.
7711 func_stripname 'lib' '.la' "$outputname"
7712 name=$func_stripname_result
7713 eval shared_ext=\"$shrext_cmds\"
7714 eval libname=\"$libname_spec\"
7717 test "$module" = no && \
7718 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7720 if test "$need_lib_prefix" != no; then
7721 # Add the "lib" prefix for modules if required
7722 func_stripname '' '.la' "$outputname"
7723 name=$func_stripname_result
7724 eval shared_ext=\"$shrext_cmds\"
7725 eval libname=\"$libname_spec\"
7727 func_stripname '' '.la' "$outputname"
7728 libname=$func_stripname_result
7733 if test -n "$objs"; then
7734 if test "$deplibs_check_method" != pass_all; then
7735 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7738 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7739 $ECHO "*** objects $objs is not portable!"
7744 test "$dlself" != no && \
7745 func_warning "\`-dlopen self' is ignored for libtool libraries"
7749 test "$#" -gt 1 && \
7750 func_warning "ignoring multiple \`-rpath's for a libtool library"
7755 if test -z "$rpath"; then
7756 if test "$build_libtool_libs" = yes; then
7757 # Building a libtool convenience library.
7758 # Some compilers have problems with a `.al' extension so
7759 # convenience libraries should have the same extension an
7760 # archive normally would.
7761 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7762 build_libtool_libs=convenience
7766 test -n "$vinfo" && \
7767 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7769 test -n "$release" && \
7770 func_warning "\`-release' is ignored for convenience libraries"
7773 # Parse the version information argument.
7774 save_ifs="$IFS"; IFS=':'
7775 set dummy $vinfo 0 0 0
7780 func_fatal_help "too many parameters to \`-version-info'"
7782 # convert absolute version numbers to libtool ages
7783 # this retains compatibility with .la files and attempts
7784 # to make the code below a bit more comprehensible
7786 case $vinfo_number in
7790 number_revision="$3"
7792 # There are really only two kinds -- those that
7793 # use the current revision as the major version
7794 # and those that subtract age and use age as
7795 # a minor version. But, then there is irix
7796 # which has an extra 1 added just for fun
7798 case $version_type in
7799 darwin|linux|osf|windows|none)
7800 func_arith $number_major + $number_minor
7801 current=$func_arith_result
7803 revision="$number_revision"
7805 freebsd-aout|freebsd-elf|qnx|sunos)
7806 current="$number_major"
7807 revision="$number_minor"
7811 func_arith $number_major + $number_minor
7812 current=$func_arith_result
7814 revision="$number_minor"
7815 lt_irix_increment=no
7826 # Check that each of the things are valid numbers.
7828 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]) ;;
7830 func_error "CURRENT \`$current' must be a nonnegative integer"
7831 func_fatal_error "\`$vinfo' is not valid version information"
7836 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]) ;;
7838 func_error "REVISION \`$revision' must be a nonnegative integer"
7839 func_fatal_error "\`$vinfo' is not valid version information"
7844 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]) ;;
7846 func_error "AGE \`$age' must be a nonnegative integer"
7847 func_fatal_error "\`$vinfo' is not valid version information"
7851 if test "$age" -gt "$current"; then
7852 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7853 func_fatal_error "\`$vinfo' is not valid version information"
7856 # Calculate the version variables.
7860 case $version_type in
7864 # Like Linux, but with the current version available in
7865 # verstring for coding it into the library header
7866 func_arith $current - $age
7867 major=.$func_arith_result
7868 versuffix="$major.$age.$revision"
7869 # Darwin ld doesn't like 0 for these options...
7870 func_arith $current + 1
7871 minor_current=$func_arith_result
7872 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7873 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7878 versuffix=".$current.$revision";
7883 versuffix=".$current"
7887 if test "X$lt_irix_increment" = "Xno"; then
7888 func_arith $current - $age
7890 func_arith $current - $age + 1
7892 major=$func_arith_result
7894 case $version_type in
7895 nonstopux) verstring_prefix=nonstopux ;;
7896 *) verstring_prefix=sgi ;;
7898 verstring="$verstring_prefix$major.$revision"
7900 # Add in all the interfaces that we are compatible with.
7902 while test "$loop" -ne 0; do
7903 func_arith $revision - $loop
7904 iface=$func_arith_result
7905 func_arith $loop - 1
7906 loop=$func_arith_result
7907 verstring="$verstring_prefix$major.$iface:$verstring"
7910 # Before this point, $major must not contain `.'.
7912 versuffix="$major.$revision"
7916 func_arith $current - $age
7917 major=.$func_arith_result
7918 versuffix="$major.$age.$revision"
7922 func_arith $current - $age
7923 major=.$func_arith_result
7924 versuffix=".$current.$age.$revision"
7925 verstring="$current.$age.$revision"
7927 # Add in all the interfaces that we are compatible with.
7929 while test "$loop" -ne 0; do
7930 func_arith $current - $loop
7931 iface=$func_arith_result
7932 func_arith $loop - 1
7933 loop=$func_arith_result
7934 verstring="$verstring:${iface}.0"
7937 # Make executables depend on our current version.
7938 verstring+=":${current}.0"
7943 versuffix=".$current"
7948 versuffix=".$current.$revision"
7952 # Use '-' rather than '.', since we only want one
7953 # extension on DOS 8.3 filesystems.
7954 func_arith $current - $age
7955 major=$func_arith_result
7960 func_fatal_configuration "unknown library version type \`$version_type'"
7964 # Clear the version info if we defaulted, and they specified a release.
7965 if test -z "$vinfo" && test -n "$release"; then
7967 case $version_type in
7969 # we can't check for "0.0" in archive_cmds due to quoting
7970 # problems, so we reset it completely
7977 if test "$need_version" = no; then
7984 # Remove version info from name if versioning should be avoided
7985 if test "$avoid_version" = yes && test "$need_version" = no; then
7991 # Check to see if the archive will have undefined symbols.
7992 if test "$allow_undefined" = yes; then
7993 if test "$allow_undefined_flag" = unsupported; then
7994 func_warning "undefined symbols not allowed in $host shared libraries"
7995 build_libtool_libs=no
7999 # Don't allow undefined symbols.
8000 allow_undefined_flag="$no_undefined_flag"
8005 func_generate_dlsyms "$libname" "$libname" "yes"
8006 libobjs+=" $symfileobj"
8007 test "X$libobjs" = "X " && libobjs=
8009 if test "$opt_mode" != relink; then
8010 # Remove our outputs, but don't remove object files since they
8011 # may have been created when compiling PIC objects.
8013 tempremovelist=`$ECHO "$output_objdir/*"`
8014 for p in $tempremovelist; do
8018 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
8019 if test "X$precious_files_regex" != "X"; then
8020 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
8030 test -n "$removelist" && \
8031 func_show_eval "${RM}r \$removelist"
8034 # Now set the variables for building old libraries.
8035 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8036 oldlibs+=" $output_objdir/$libname.$libext"
8038 # Transform .lo files to .o files.
8039 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
8042 # Eliminate all temporary directories.
8043 #for path in $notinst_path; do
8044 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
8045 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
8046 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
8049 if test -n "$xrpath"; then
8050 # If the user specified any rpath flags, then add them.
8052 for libdir in $xrpath; do
8053 func_replace_sysroot "$libdir"
8054 temp_xrpath+=" -R$func_replace_sysroot_result"
8055 case "$finalize_rpath " in
8057 *) finalize_rpath+=" $libdir" ;;
8060 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
8061 dependency_libs="$temp_xrpath $dependency_libs"
8065 # Make sure dlfiles contains only unique files that won't be dlpreopened
8066 old_dlfiles="$dlfiles"
8068 for lib in $old_dlfiles; do
8069 case " $dlprefiles $dlfiles " in
8071 *) dlfiles+=" $lib" ;;
8075 # Make sure dlprefiles contains only unique files
8076 old_dlprefiles="$dlprefiles"
8078 for lib in $old_dlprefiles; do
8079 case "$dlprefiles " in
8081 *) dlprefiles+=" $lib" ;;
8085 if test "$build_libtool_libs" = yes; then
8086 if test -n "$rpath"; then
8088 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
8089 # these systems don't actually have a c library (as such)!
8091 *-*-rhapsody* | *-*-darwin1.[012])
8092 # Rhapsody C library is in the System framework
8093 deplibs+=" System.ltframework"
8096 # Don't link with libc until the a.out ld.so is fixed.
8098 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
8099 # Do not include libc due to us having libc/libc_r.
8101 *-*-sco3.2v5* | *-*-sco5v6*)
8102 # Causes problems with __ctype
8104 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
8105 # Compiler inserts libc in the correct place for threads to work
8108 # Add libc to deplibs on all other systems if necessary.
8109 if test "$build_libtool_need_lc" = "yes"; then
8116 # Transform deplibs into only deplibs that can be linked in shared.
8118 libname_save=$libname
8119 release_save=$release
8120 versuffix_save=$versuffix
8122 # I'm not sure if I'm treating the release correctly. I think
8123 # release should show up in the -l (ie -lgmp5) so we don't want to
8124 # add it in twice. Is that correct?
8130 case $deplibs_check_method in
8132 # Don't check for shared/static. Everything works.
8133 # This might be a little naive. We might want to check
8134 # whether the library exists or not. But this is on
8135 # osf3 & osf4 and I'm not really sure... Just
8136 # implementing what was already the behavior.
8140 # This code stresses the "libraries are programs" paradigm to its
8141 # limits. Maybe even breaks it. We compile a program, linking it
8142 # against the deplibs as a proxy for the library. Then we can check
8143 # whether they linked in statically or dynamically with ldd.
8144 $opt_dry_run || $RM conftest.c
8145 cat > conftest.c <<EOF
8146 int main() { return 0; }
8148 $opt_dry_run || $RM conftest
8149 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
8150 ldd_output=`ldd conftest`
8151 for i in $deplibs; do
8154 func_stripname -l '' "$i"
8155 name=$func_stripname_result
8156 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8157 case " $predeps $postdeps " in
8164 if test -n "$i" ; then
8165 libname=`eval "\\$ECHO \"$libname_spec\""`
8166 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8167 set dummy $deplib_matches; shift
8169 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8174 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8175 echo "*** I have the capability to make that library automatically link in when"
8176 echo "*** you link to this library. But I can only do this if you have a"
8177 echo "*** shared version of the library, which I believe you do not have"
8178 echo "*** because a test_compile did reveal that the linker did not use it for"
8179 echo "*** its dynamic dependency list that programs get resolved with at runtime."
8189 # Error occurred in the first compile. Let's try to salvage
8190 # the situation: Compile a separate program for each library.
8191 for i in $deplibs; do
8194 func_stripname -l '' "$i"
8195 name=$func_stripname_result
8196 $opt_dry_run || $RM conftest
8197 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
8198 ldd_output=`ldd conftest`
8199 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8200 case " $predeps $postdeps " in
8207 if test -n "$i" ; then
8208 libname=`eval "\\$ECHO \"$libname_spec\""`
8209 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8210 set dummy $deplib_matches; shift
8212 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8217 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8218 echo "*** I have the capability to make that library automatically link in when"
8219 echo "*** you link to this library. But I can only do this if you have a"
8220 echo "*** shared version of the library, which you do not appear to have"
8221 echo "*** because a test_compile did reveal that the linker did not use this one"
8222 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
8228 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
8229 echo "*** make it link in! You will probably need to install it or some"
8230 echo "*** library that it depends on before this library will be fully"
8231 echo "*** functional. Installing it before continuing would be even better."
8242 set dummy $deplibs_check_method; shift
8243 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8244 for a_deplib in $deplibs; do
8247 func_stripname -l '' "$a_deplib"
8248 name=$func_stripname_result
8249 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8250 case " $predeps $postdeps " in
8252 newdeplibs+=" $a_deplib"
8257 if test -n "$a_deplib" ; then
8258 libname=`eval "\\$ECHO \"$libname_spec\""`
8259 if test -n "$file_magic_glob"; then
8260 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
8262 libnameglob=$libname
8264 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
8265 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8266 if test "$want_nocaseglob" = yes; then
8268 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8271 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8273 for potent_lib in $potential_libs; do
8274 # Follow soft links.
8275 if ls -lLd "$potent_lib" 2>/dev/null |
8276 $GREP " -> " >/dev/null; then
8279 # The statement above tries to avoid entering an
8280 # endless loop below, in case of cyclic links.
8281 # We might still enter an endless loop, since a link
8282 # loop can be closed while we follow links,
8284 potlib="$potent_lib"
8285 while test -h "$potlib" 2>/dev/null; do
8286 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
8288 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8289 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
8292 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
8294 $EGREP "$file_magic_regex" > /dev/null; then
8295 newdeplibs+=" $a_deplib"
8302 if test -n "$a_deplib" ; then
8305 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8306 echo "*** I have the capability to make that library automatically link in when"
8307 echo "*** you link to this library. But I can only do this if you have a"
8308 echo "*** shared version of the library, which you do not appear to have"
8309 echo "*** because I did check the linker path looking for a file starting"
8310 if test -z "$potlib" ; then
8311 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
8313 $ECHO "*** with $libname and none of the candidates passed a file format test"
8314 $ECHO "*** using a file magic. Last file checked: $potlib"
8319 # Add a -L argument.
8320 newdeplibs+=" $a_deplib"
8323 done # Gone through all deplibs.
8326 set dummy $deplibs_check_method; shift
8327 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8328 for a_deplib in $deplibs; do
8331 func_stripname -l '' "$a_deplib"
8332 name=$func_stripname_result
8333 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8334 case " $predeps $postdeps " in
8336 newdeplibs+=" $a_deplib"
8341 if test -n "$a_deplib" ; then
8342 libname=`eval "\\$ECHO \"$libname_spec\""`
8343 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8344 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
8345 for potent_lib in $potential_libs; do
8346 potlib="$potent_lib" # see symlink-check above in file_magic test
8347 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
8348 $EGREP "$match_pattern_regex" > /dev/null; then
8349 newdeplibs+=" $a_deplib"
8356 if test -n "$a_deplib" ; then
8359 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8360 echo "*** I have the capability to make that library automatically link in when"
8361 echo "*** you link to this library. But I can only do this if you have a"
8362 echo "*** shared version of the library, which you do not appear to have"
8363 echo "*** because I did check the linker path looking for a file starting"
8364 if test -z "$potlib" ; then
8365 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
8367 $ECHO "*** with $libname and none of the candidates passed a file format test"
8368 $ECHO "*** using a regex pattern. Last file checked: $potlib"
8373 # Add a -L argument.
8374 newdeplibs+=" $a_deplib"
8377 done # Gone through all deplibs.
8381 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
8382 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8383 for i in $predeps $postdeps ; do
8384 # can't use Xsed below, because $i might contain '/'
8385 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
8388 case $tmp_deplibs in
8391 if test "X$deplibs_check_method" = "Xnone"; then
8392 echo "*** Warning: inter-library dependencies are not supported in this platform."
8394 echo "*** Warning: inter-library dependencies are not known to be supported."
8396 echo "*** All declared inter-library dependencies are being dropped."
8402 versuffix=$versuffix_save
8404 release=$release_save
8405 libname=$libname_save
8409 *-*-rhapsody* | *-*-darwin1.[012])
8410 # On Rhapsody replace the C library with the System framework
8411 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
8415 if test "$droppeddeps" = yes; then
8416 if test "$module" = yes; then
8418 echo "*** Warning: libtool could not satisfy all declared inter-library"
8419 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
8420 echo "*** a static module, that should work as long as the dlopening"
8421 echo "*** application is linked with the -dlopen flag."
8422 if test -z "$global_symbol_pipe"; then
8424 echo "*** However, this would only work if libtool was able to extract symbol"
8425 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8426 echo "*** not find such a program. So, this module is probably useless."
8427 echo "*** \`nm' from GNU binutils and a full rebuild may help."
8429 if test "$build_old_libs" = no; then
8430 oldlibs="$output_objdir/$libname.$libext"
8431 build_libtool_libs=module
8434 build_libtool_libs=no
8437 echo "*** The inter-library dependencies that have been dropped here will be"
8438 echo "*** automatically added whenever a program is linked with this library"
8439 echo "*** or is declared to -dlopen it."
8441 if test "$allow_undefined" = no; then
8443 echo "*** Since this library must not contain undefined symbols,"
8444 echo "*** because either the platform does not support them or"
8445 echo "*** it was explicitly requested with -no-undefined,"
8446 echo "*** libtool will only create a static version of it."
8447 if test "$build_old_libs" = no; then
8448 oldlibs="$output_objdir/$libname.$libext"
8449 build_libtool_libs=module
8452 build_libtool_libs=no
8457 # Done checking deplibs!
8460 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8463 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8464 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8465 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8469 # move library search paths that coincide with paths to not yet
8470 # installed libraries to the beginning of the library search list
8472 for path in $notinst_path; do
8473 case " $new_libs " in
8474 *" -L$path/$objdir "*) ;;
8476 case " $deplibs " in
8477 *" -L$path/$objdir "*)
8478 new_libs+=" -L$path/$objdir" ;;
8483 for deplib in $deplibs; do
8486 case " $new_libs " in
8488 *) new_libs+=" $deplib" ;;
8491 *) new_libs+=" $deplib" ;;
8496 # All the library-specific variables (install_libdir is set above).
8501 # Test again, we may have decided not to build it any more
8502 if test "$build_libtool_libs" = yes; then
8503 if test "$hardcode_into_libs" = yes; then
8504 # Hardcode the library paths
8507 rpath="$finalize_rpath"
8508 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8509 for libdir in $rpath; do
8510 if test -n "$hardcode_libdir_flag_spec"; then
8511 if test -n "$hardcode_libdir_separator"; then
8512 func_replace_sysroot "$libdir"
8513 libdir=$func_replace_sysroot_result
8514 if test -z "$hardcode_libdirs"; then
8515 hardcode_libdirs="$libdir"
8517 # Just accumulate the unique libdirs.
8518 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8519 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8522 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
8527 eval flag=\"$hardcode_libdir_flag_spec\"
8530 elif test -n "$runpath_var"; then
8531 case "$perm_rpath " in
8533 *) func_apped perm_rpath " $libdir" ;;
8537 # Substitute the hardcoded libdirs into the rpath.
8538 if test -n "$hardcode_libdir_separator" &&
8539 test -n "$hardcode_libdirs"; then
8540 libdir="$hardcode_libdirs"
8541 if test -n "$hardcode_libdir_flag_spec_ld"; then
8542 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
8544 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
8547 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8548 # We should set the runpath_var.
8550 for dir in $perm_rpath; do
8553 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8555 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8558 shlibpath="$finalize_shlibpath"
8559 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8560 if test -n "$shlibpath"; then
8561 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8564 # Get the real and link names of the library.
8565 eval shared_ext=\"$shrext_cmds\"
8566 eval library_names=\"$library_names_spec\"
8567 set dummy $library_names
8572 if test -n "$soname_spec"; then
8573 eval soname=\"$soname_spec\"
8577 if test -z "$dlname"; then
8581 lib="$output_objdir/$realname"
8588 # Use standard objects if they are pic
8589 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8590 test "X$libobjs" = "X " && libobjs=
8593 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8594 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8595 export_symbols="$output_objdir/$libname.uexp"
8596 delfiles+=" $export_symbols"
8599 orig_export_symbols=
8601 cygwin* | mingw* | cegcc*)
8602 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8603 # exporting using user supplied symfile
8604 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8605 # and it's NOT already a .def file. Must figure out
8606 # which of the given symbols are data symbols and tag
8607 # them as such. So, trigger use of export_symbols_cmds.
8608 # export_symbols gets reassigned inside the "prepare
8609 # the list of exported symbols" if statement, so the
8610 # include_expsyms logic still works.
8611 orig_export_symbols="$export_symbols"
8613 always_export_symbols=yes
8619 # Prepare the list of exported symbols
8620 if test -z "$export_symbols"; then
8621 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8622 func_verbose "generating symbol list for \`$libname.la'"
8623 export_symbols="$output_objdir/$libname.exp"
8624 $opt_dry_run || $RM $export_symbols
8625 cmds=$export_symbols_cmds
8626 save_ifs="$IFS"; IFS='~'
8627 for cmd1 in $cmds; do
8629 # Take the normal branch if the nm_file_list_spec branch
8630 # doesn't work or if tool conversion is not needed.
8631 case $nm_file_list_spec~$to_tool_file_cmd in
8632 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8633 try_normal_branch=yes
8636 len=$func_len_result
8639 try_normal_branch=no
8642 if test "$try_normal_branch" = yes \
8643 && { test "$len" -lt "$max_cmd_len" \
8644 || test "$max_cmd_len" -le -1; }
8646 func_show_eval "$cmd" 'exit $?'
8647 skipped_export=false
8648 elif test -n "$nm_file_list_spec"; then
8649 func_basename "$output"
8650 output_la=$func_basename_result
8651 save_libobjs=$libobjs
8653 output=${output_objdir}/${output_la}.nm
8654 func_to_tool_file "$output"
8655 libobjs=$nm_file_list_spec$func_to_tool_file_result
8656 delfiles+=" $output"
8657 func_verbose "creating $NM input file list: $output"
8658 for obj in $save_libobjs; do
8659 func_to_tool_file "$obj"
8660 $ECHO "$func_to_tool_file_result"
8663 func_show_eval "$cmd" 'exit $?'
8665 libobjs=$save_libobjs
8666 skipped_export=false
8668 # The command line is too long to execute in one step.
8669 func_verbose "using reloadable object file for export list..."
8671 # Break out early, otherwise skipped_export may be
8672 # set to false by a later but shorter cmd.
8677 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8678 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8679 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8684 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8685 tmp_export_symbols="$export_symbols"
8686 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8687 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8690 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8691 # The given exports_symbols file has to be filtered, so filter it.
8692 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8693 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8694 # 's' commands which not all seds can handle. GNU sed should be fine
8695 # though. Also, the filter scales superlinearly with the number of
8696 # global variables. join(1) would be nice here, but unfortunately
8697 # isn't a blessed tool.
8698 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8699 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8700 export_symbols=$output_objdir/$libname.def
8701 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8705 for test_deplib in $deplibs; do
8706 case " $convenience " in
8707 *" $test_deplib "*) ;;
8709 tmp_deplibs+=" $test_deplib"
8713 deplibs="$tmp_deplibs"
8715 if test -n "$convenience"; then
8716 if test -n "$whole_archive_flag_spec" &&
8717 test "$compiler_needs_object" = yes &&
8718 test -z "$libobjs"; then
8719 # extract the archives, so we have objects to list.
8720 # TODO: could optimize this to just extract one archive.
8721 whole_archive_flag_spec=
8723 if test -n "$whole_archive_flag_spec"; then
8724 save_libobjs=$libobjs
8725 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8726 test "X$libobjs" = "X " && libobjs=
8728 gentop="$output_objdir/${outputname}x"
8729 generated+=" $gentop"
8731 func_extract_archives $gentop $convenience
8732 libobjs+=" $func_extract_archives_result"
8733 test "X$libobjs" = "X " && libobjs=
8737 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8738 eval flag=\"$thread_safe_flag_spec\"
8739 linker_flags+=" $flag"
8742 # Make a backup of the uninstalled library when relinking
8743 if test "$opt_mode" = relink; then
8744 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8747 # Do each of the archive commands.
8748 if test "$module" = yes && test -n "$module_cmds" ; then
8749 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8750 eval test_cmds=\"$module_expsym_cmds\"
8751 cmds=$module_expsym_cmds
8753 eval test_cmds=\"$module_cmds\"
8757 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8758 eval test_cmds=\"$archive_expsym_cmds\"
8759 cmds=$archive_expsym_cmds
8761 eval test_cmds=\"$archive_cmds\"
8766 if test "X$skipped_export" != "X:" &&
8767 func_len " $test_cmds" &&
8768 len=$func_len_result &&
8769 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8772 # The command line is too long to link in one step, link piecewise
8773 # or, if using GNU ld and skipped_export is not :, use a linker
8776 # Save the value of $output and $libobjs because we want to
8777 # use them later. If we have whole_archive_flag_spec, we
8778 # want to use save_libobjs as it was before
8779 # whole_archive_flag_spec was expanded, because we can't
8780 # assume the linker understands whole_archive_flag_spec.
8781 # This may have to be revisited, in case too many
8782 # convenience libraries get linked in and end up exceeding
8784 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8785 save_libobjs=$libobjs
8788 func_basename "$output"
8789 output_la=$func_basename_result
8791 # Clear the reloadable object creation command queue and
8792 # initialize k to one.
8799 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8800 output=${output_objdir}/${output_la}.lnkscript
8801 func_verbose "creating GNU ld script: $output"
8802 echo 'INPUT (' > $output
8803 for obj in $save_libobjs
8805 func_to_tool_file "$obj"
8806 $ECHO "$func_to_tool_file_result" >> $output
8809 delfiles+=" $output"
8810 func_to_tool_file "$output"
8811 output=$func_to_tool_file_result
8812 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8813 output=${output_objdir}/${output_la}.lnk
8814 func_verbose "creating linker input file list: $output"
8819 if test "$compiler_needs_object" = yes; then
8825 func_to_tool_file "$obj"
8826 $ECHO "$func_to_tool_file_result" >> $output
8828 delfiles+=" $output"
8829 func_to_tool_file "$output"
8830 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8832 if test -n "$save_libobjs"; then
8833 func_verbose "creating reloadable object files..."
8834 output=$output_objdir/$output_la-${k}.$objext
8835 eval test_cmds=\"$reload_cmds\"
8836 func_len " $test_cmds"
8837 len0=$func_len_result
8840 # Loop over the list of objects to be linked.
8841 for obj in $save_libobjs
8844 func_arith $len + $func_len_result
8845 len=$func_arith_result
8846 if test "X$objlist" = X ||
8847 test "$len" -lt "$max_cmd_len"; then
8850 # The command $test_cmds is almost too long, add a
8851 # command to the queue.
8852 if test "$k" -eq 1 ; then
8853 # The first file doesn't have a previous command to add.
8854 reload_objs=$objlist
8855 eval concat_cmds=\"$reload_cmds\"
8857 # All subsequent reloadable object files will link in
8858 # the last one created.
8859 reload_objs="$objlist $last_robj"
8860 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8862 last_robj=$output_objdir/$output_la-${k}.$objext
8864 k=$func_arith_result
8865 output=$output_objdir/$output_la-${k}.$objext
8867 func_len " $last_robj"
8868 func_arith $len0 + $func_len_result
8869 len=$func_arith_result
8872 # Handle the remaining objects by creating one last
8873 # reloadable object file. All subsequent reloadable object
8874 # files will link in the last one created.
8875 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8876 reload_objs="$objlist $last_robj"
8877 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8878 if test -n "$last_robj"; then
8879 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8881 delfiles+=" $output"
8887 if ${skipped_export-false}; then
8888 func_verbose "generating symbol list for \`$libname.la'"
8889 export_symbols="$output_objdir/$libname.exp"
8890 $opt_dry_run || $RM $export_symbols
8892 # Append the command to create the export file.
8893 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8894 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8895 if test -n "$last_robj"; then
8896 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8900 test -n "$save_libobjs" &&
8901 func_verbose "creating a temporary reloadable object file: $output"
8903 # Loop through the commands generated above and execute them.
8904 save_ifs="$IFS"; IFS='~'
8905 for cmd in $concat_cmds; do
8908 func_quote_for_expand "$cmd"
8909 eval "func_echo $func_quote_for_expand_result"
8911 $opt_dry_run || eval "$cmd" || {
8914 # Restore the uninstalled library and exit
8915 if test "$opt_mode" = relink; then
8916 ( cd "$output_objdir" && \
8917 $RM "${realname}T" && \
8918 $MV "${realname}U" "$realname" )
8926 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8927 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8928 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8932 if ${skipped_export-false}; then
8933 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8934 tmp_export_symbols="$export_symbols"
8935 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8936 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8939 if test -n "$orig_export_symbols"; then
8940 # The given exports_symbols file has to be filtered, so filter it.
8941 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8942 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8943 # 's' commands which not all seds can handle. GNU sed should be fine
8944 # though. Also, the filter scales superlinearly with the number of
8945 # global variables. join(1) would be nice here, but unfortunately
8946 # isn't a blessed tool.
8947 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8948 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8949 export_symbols=$output_objdir/$libname.def
8950 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8955 # Restore the value of output.
8958 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8959 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8960 test "X$libobjs" = "X " && libobjs=
8962 # Expand the library linking commands again to reset the
8963 # value of $libobjs for piecewise linking.
8965 # Do each of the archive commands.
8966 if test "$module" = yes && test -n "$module_cmds" ; then
8967 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8968 cmds=$module_expsym_cmds
8973 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8974 cmds=$archive_expsym_cmds
8981 if test -n "$delfiles"; then
8982 # Append the command to remove temporary files to $cmds.
8983 eval cmds=\"\$cmds~\$RM $delfiles\"
8986 # Add any objects from preloaded convenience libraries
8987 if test -n "$dlprefiles"; then
8988 gentop="$output_objdir/${outputname}x"
8989 generated+=" $gentop"
8991 func_extract_archives $gentop $dlprefiles
8992 libobjs+=" $func_extract_archives_result"
8993 test "X$libobjs" = "X " && libobjs=
8996 save_ifs="$IFS"; IFS='~'
8997 for cmd in $cmds; do
9001 func_quote_for_expand "$cmd"
9002 eval "func_echo $func_quote_for_expand_result"
9004 $opt_dry_run || eval "$cmd" || {
9007 # Restore the uninstalled library and exit
9008 if test "$opt_mode" = relink; then
9009 ( cd "$output_objdir" && \
9010 $RM "${realname}T" && \
9011 $MV "${realname}U" "$realname" )
9019 # Restore the uninstalled library and exit
9020 if test "$opt_mode" = relink; then
9021 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
9023 if test -n "$convenience"; then
9024 if test -z "$whole_archive_flag_spec"; then
9025 func_show_eval '${RM}r "$gentop"'
9032 # Create links to the real library.
9033 for linkname in $linknames; do
9034 if test "$realname" != "$linkname"; then
9035 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
9039 # If -module or -export-dynamic was specified, set the dlname.
9040 if test "$module" = yes || test "$export_dynamic" = yes; then
9041 # On all known operating systems, these are identical.
9048 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9049 func_warning "\`-dlopen' is ignored for objects"
9054 func_warning "\`-l' and \`-L' are ignored for objects" ;;
9057 test -n "$rpath" && \
9058 func_warning "\`-rpath' is ignored for objects"
9060 test -n "$xrpath" && \
9061 func_warning "\`-R' is ignored for objects"
9063 test -n "$vinfo" && \
9064 func_warning "\`-version-info' is ignored for objects"
9066 test -n "$release" && \
9067 func_warning "\`-release' is ignored for objects"
9071 test -n "$objs$old_deplibs" && \
9072 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
9076 obj=$func_lo2o_result
9084 # Delete the old objects.
9085 $opt_dry_run || $RM $obj $libobj
9087 # Objects from convenience libraries. This assumes
9088 # single-version convenience libraries. Whenever we create
9089 # different ones for PIC/non-PIC, this we'll have to duplicate
9093 # reload_cmds runs $LD directly, so let us get rid of
9094 # -Wl from whole_archive_flag_spec and hope we can get by with
9095 # turning comma into space..
9098 if test -n "$convenience"; then
9099 if test -n "$whole_archive_flag_spec"; then
9100 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
9101 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
9103 gentop="$output_objdir/${obj}x"
9104 generated+=" $gentop"
9106 func_extract_archives $gentop $convenience
9107 reload_conv_objs="$reload_objs $func_extract_archives_result"
9111 # If we're not building shared, we need to use non_pic_objs
9112 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
9114 # Create the old-style object.
9115 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
9118 func_execute_cmds "$reload_cmds" 'exit $?'
9120 # Exit if we aren't doing a library object file.
9121 if test -z "$libobj"; then
9122 if test -n "$gentop"; then
9123 func_show_eval '${RM}r "$gentop"'
9129 if test "$build_libtool_libs" != yes; then
9130 if test -n "$gentop"; then
9131 func_show_eval '${RM}r "$gentop"'
9134 # Create an invalid libtool object if no PIC, so that we don't
9135 # accidentally link it into a program.
9136 # $show "echo timestamp > $libobj"
9137 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
9141 if test -n "$pic_flag" || test "$pic_mode" != default; then
9142 # Only do commands if we really have different PIC objects.
9143 reload_objs="$libobjs $reload_conv_objs"
9145 func_execute_cmds "$reload_cmds" 'exit $?'
9148 if test -n "$gentop"; then
9149 func_show_eval '${RM}r "$gentop"'
9157 *cygwin*) func_stripname '' '.exe' "$output"
9158 output=$func_stripname_result.exe;;
9160 test -n "$vinfo" && \
9161 func_warning "\`-version-info' is ignored for programs"
9163 test -n "$release" && \
9164 func_warning "\`-release' is ignored for programs"
9166 test "$preload" = yes \
9167 && test "$dlopen_support" = unknown \
9168 && test "$dlopen_self" = unknown \
9169 && test "$dlopen_self_static" = unknown && \
9170 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
9173 *-*-rhapsody* | *-*-darwin1.[012])
9174 # On Rhapsody replace the C library is the System framework
9175 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
9176 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
9182 # Don't allow lazy linking, it breaks C++ global constructors
9183 # But is supposedly fixed on 10.4 or later (yay!).
9184 if test "$tagname" = CXX ; then
9185 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
9187 compile_command+=" ${wl}-bind_at_load"
9188 finalize_command+=" ${wl}-bind_at_load"
9192 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9193 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9194 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9199 # move library search paths that coincide with paths to not yet
9200 # installed libraries to the beginning of the library search list
9202 for path in $notinst_path; do
9203 case " $new_libs " in
9204 *" -L$path/$objdir "*) ;;
9206 case " $compile_deplibs " in
9207 *" -L$path/$objdir "*)
9208 new_libs+=" -L$path/$objdir" ;;
9213 for deplib in $compile_deplibs; do
9216 case " $new_libs " in
9218 *) new_libs+=" $deplib" ;;
9221 *) new_libs+=" $deplib" ;;
9224 compile_deplibs="$new_libs"
9227 compile_command+=" $compile_deplibs"
9228 finalize_command+=" $finalize_deplibs"
9230 if test -n "$rpath$xrpath"; then
9231 # If the user specified any rpath flags, then add them.
9232 for libdir in $rpath $xrpath; do
9233 # This is the magic to use -rpath.
9234 case "$finalize_rpath " in
9236 *) finalize_rpath+=" $libdir" ;;
9241 # Now hardcode the library paths
9244 for libdir in $compile_rpath $finalize_rpath; do
9245 if test -n "$hardcode_libdir_flag_spec"; then
9246 if test -n "$hardcode_libdir_separator"; then
9247 if test -z "$hardcode_libdirs"; then
9248 hardcode_libdirs="$libdir"
9250 # Just accumulate the unique libdirs.
9251 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9252 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9255 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9260 eval flag=\"$hardcode_libdir_flag_spec\"
9263 elif test -n "$runpath_var"; then
9264 case "$perm_rpath " in
9266 *) perm_rpath+=" $libdir" ;;
9270 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
9271 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
9272 case :$dllsearchpath: in
9274 ::) dllsearchpath=$libdir;;
9275 *) dllsearchpath+=":$libdir";;
9277 case :$dllsearchpath: in
9278 *":$testbindir:"*) ;;
9279 ::) dllsearchpath=$testbindir;;
9280 *) dllsearchpath+=":$testbindir";;
9285 # Substitute the hardcoded libdirs into the rpath.
9286 if test -n "$hardcode_libdir_separator" &&
9287 test -n "$hardcode_libdirs"; then
9288 libdir="$hardcode_libdirs"
9289 eval rpath=\" $hardcode_libdir_flag_spec\"
9291 compile_rpath="$rpath"
9295 for libdir in $finalize_rpath; do
9296 if test -n "$hardcode_libdir_flag_spec"; then
9297 if test -n "$hardcode_libdir_separator"; then
9298 if test -z "$hardcode_libdirs"; then
9299 hardcode_libdirs="$libdir"
9301 # Just accumulate the unique libdirs.
9302 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9303 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9306 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9311 eval flag=\"$hardcode_libdir_flag_spec\"
9314 elif test -n "$runpath_var"; then
9315 case "$finalize_perm_rpath " in
9317 *) finalize_perm_rpath+=" $libdir" ;;
9321 # Substitute the hardcoded libdirs into the rpath.
9322 if test -n "$hardcode_libdir_separator" &&
9323 test -n "$hardcode_libdirs"; then
9324 libdir="$hardcode_libdirs"
9325 eval rpath=\" $hardcode_libdir_flag_spec\"
9327 finalize_rpath="$rpath"
9329 if test -n "$libobjs" && test "$build_old_libs" = yes; then
9330 # Transform all the library objects into standard objects.
9331 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9332 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9335 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
9337 # template prelinking step
9338 if test -n "$prelink_cmds"; then
9339 func_execute_cmds "$prelink_cmds" 'exit $?'
9342 wrappers_required=yes
9344 *cegcc* | *mingw32ce*)
9345 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
9346 wrappers_required=no
9348 *cygwin* | *mingw* )
9349 if test "$build_libtool_libs" != yes; then
9350 wrappers_required=no
9354 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9355 wrappers_required=no
9359 if test "$wrappers_required" = no; then
9360 # Replace the output file specification.
9361 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9362 link_command="$compile_command$compile_rpath"
9364 # We have no uninstalled library dependencies, so finalize right now.
9366 func_show_eval "$link_command" 'exit_status=$?'
9368 if test -n "$postlink_cmds"; then
9369 func_to_tool_file "$output"
9370 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9371 func_execute_cmds "$postlink_cmds" 'exit $?'
9374 # Delete the generated files.
9375 if test -f "$output_objdir/${outputname}S.${objext}"; then
9376 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
9382 if test -n "$compile_shlibpath$finalize_shlibpath"; then
9383 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
9385 if test -n "$finalize_shlibpath"; then
9386 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
9391 if test -n "$runpath_var"; then
9392 if test -n "$perm_rpath"; then
9393 # We should set the runpath_var.
9395 for dir in $perm_rpath; do
9398 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
9400 if test -n "$finalize_perm_rpath"; then
9401 # We should set the runpath_var.
9403 for dir in $finalize_perm_rpath; do
9406 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
9410 if test "$no_install" = yes; then
9411 # We don't need to create a wrapper script.
9412 link_command="$compile_var$compile_command$compile_rpath"
9413 # Replace the output file specification.
9414 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9415 # Delete the old output file.
9416 $opt_dry_run || $RM $output
9417 # Link the executable and exit
9418 func_show_eval "$link_command" 'exit $?'
9420 if test -n "$postlink_cmds"; then
9421 func_to_tool_file "$output"
9422 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9423 func_execute_cmds "$postlink_cmds" 'exit $?'
9429 if test "$hardcode_action" = relink; then
9430 # Fast installation is not supported
9431 link_command="$compile_var$compile_command$compile_rpath"
9432 relink_command="$finalize_var$finalize_command$finalize_rpath"
9434 func_warning "this platform does not like uninstalled shared libraries"
9435 func_warning "\`$output' will be relinked during installation"
9437 if test "$fast_install" != no; then
9438 link_command="$finalize_var$compile_command$finalize_rpath"
9439 if test "$fast_install" = yes; then
9440 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9442 # fast_install is set to needless
9446 link_command="$compile_var$compile_command$compile_rpath"
9447 relink_command="$finalize_var$finalize_command$finalize_rpath"
9451 # Replace the output file specification.
9452 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9454 # Delete the old output files.
9455 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
9457 func_show_eval "$link_command" 'exit $?'
9459 if test -n "$postlink_cmds"; then
9460 func_to_tool_file "$output_objdir/$outputname"
9461 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9462 func_execute_cmds "$postlink_cmds" 'exit $?'
9465 # Now create the wrapper script.
9466 func_verbose "creating $output"
9468 # Quote the relink command for shipping.
9469 if test -n "$relink_command"; then
9470 # Preserve any variables that may affect compiler behavior
9471 for var in $variables_saved_for_relink; do
9472 if eval test -z \"\${$var+set}\"; then
9473 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9474 elif eval var_value=\$$var; test -z "$var_value"; then
9475 relink_command="$var=; export $var; $relink_command"
9477 func_quote_for_eval "$var_value"
9478 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9481 relink_command="(cd `pwd`; $relink_command)"
9482 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9485 # Only actually do things if not in dry run mode.
9487 # win32 will think the script is a binary if it has
9488 # a .exe suffix, so we strip it off here.
9490 *.exe) func_stripname '' '.exe' "$output"
9491 output=$func_stripname_result ;;
9493 # test for cygwin because mv fails w/o .exe extensions
9497 func_stripname '' '.exe' "$outputname"
9498 outputname=$func_stripname_result ;;
9502 *cygwin* | *mingw* )
9503 func_dirname_and_basename "$output" "" "."
9504 output_name=$func_basename_result
9505 output_path=$func_dirname_result
9506 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9507 cwrapper="$output_path/$output_name.exe"
9508 $RM $cwrappersource $cwrapper
9509 trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15
9511 func_emit_cwrapperexe_src > $cwrappersource
9513 # The wrapper executable is built using the $host compiler,
9514 # because it contains $host paths and files. If cross-
9515 # compiling, it, like the target executable, must be
9516 # executed on the $host or under an emulation environment.
9518 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9522 # Now, create the wrapper script for func_source use:
9523 func_ltwrapper_scriptname $cwrapper
9524 $RM $func_ltwrapper_scriptname_result
9525 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9527 # note: this script will not be executed, so do not chmod.
9528 if test "x$build" = "x$host" ; then
9529 # Create the UAC manifests first if necessary (but the
9530 # manifest files must have executable permission regardless).
9531 case $output_name in
9532 *instal*|*patch*|*setup*|*update*)
9533 func_emit_exe_manifest > $cwrapper.manifest
9534 func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest
9535 chmod +x $cwrapper.manifest
9536 chmod +x $output_path/$objdir/$output_name.exe.manifest
9539 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9541 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9547 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9549 func_emit_wrapper no > $output
9558 # See if we need to build an old-fashioned archive.
9559 for oldlib in $oldlibs; do
9561 if test "$build_libtool_libs" = convenience; then
9562 oldobjs="$libobjs_save $symfileobj"
9563 addlibs="$convenience"
9564 build_libtool_libs=no
9566 if test "$build_libtool_libs" = module; then
9567 oldobjs="$libobjs_save"
9568 build_libtool_libs=no
9570 oldobjs="$old_deplibs $non_pic_objects"
9571 if test "$preload" = yes && test -f "$symfileobj"; then
9572 oldobjs+=" $symfileobj"
9575 addlibs="$old_convenience"
9578 if test -n "$addlibs"; then
9579 gentop="$output_objdir/${outputname}x"
9580 generated+=" $gentop"
9582 func_extract_archives $gentop $addlibs
9583 oldobjs+=" $func_extract_archives_result"
9586 # Do each command in the archive commands.
9587 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9588 cmds=$old_archive_from_new_cmds
9591 # Add any objects from preloaded convenience libraries
9592 if test -n "$dlprefiles"; then
9593 gentop="$output_objdir/${outputname}x"
9594 generated+=" $gentop"
9596 func_extract_archives $gentop $dlprefiles
9597 oldobjs+=" $func_extract_archives_result"
9600 # POSIX demands no paths to be encoded in archives. We have
9601 # to avoid creating archives with duplicate basenames if we
9602 # might have to extract them afterwards, e.g., when creating a
9603 # static archive out of a convenience library, or when linking
9604 # the entirety of a libtool archive into another (currently
9605 # not supported by libtool).
9606 if (for obj in $oldobjs
9608 func_basename "$obj"
9609 $ECHO "$func_basename_result"
9610 done | sort | sort -uc >/dev/null 2>&1); then
9613 echo "copying selected object files to avoid basename conflicts..."
9614 gentop="$output_objdir/${outputname}x"
9615 generated+=" $gentop"
9616 func_mkdir_p "$gentop"
9617 save_oldobjs=$oldobjs
9620 for obj in $save_oldobjs
9622 func_basename "$obj"
9623 objbase="$func_basename_result"
9624 case " $oldobjs " in
9625 " ") oldobjs=$obj ;;
9628 # Make sure we don't pick an alternate name that also
9630 newobj=lt$counter-$objbase
9631 func_arith $counter + 1
9632 counter=$func_arith_result
9633 case " $oldobjs " in
9634 *[\ /]"$newobj "*) ;;
9635 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9638 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9639 oldobjs+=" $gentop/$newobj"
9641 *) oldobjs+=" $obj" ;;
9645 eval cmds=\"$old_archive_cmds\"
9648 len=$func_len_result
9649 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9650 cmds=$old_archive_cmds
9651 elif test -n "$archiver_list_spec"; then
9652 func_verbose "using command file archive linking..."
9655 func_to_tool_file "$obj"
9656 $ECHO "$func_to_tool_file_result"
9657 done > $output_objdir/$libname.libcmd
9658 func_to_tool_file "$output_objdir/$libname.libcmd"
9659 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9660 cmds=$old_archive_cmds
9662 # the command line is too long to link in one step, link in parts
9663 func_verbose "using piecewise archive linking..."
9668 save_oldobjs=$oldobjs
9670 # Is there a better way of finding the last object in the list?
9671 for obj in $save_oldobjs
9675 eval test_cmds=\"$old_archive_cmds\"
9676 func_len " $test_cmds"
9677 len0=$func_len_result
9679 for obj in $save_oldobjs
9682 func_arith $len + $func_len_result
9683 len=$func_arith_result
9685 if test "$len" -lt "$max_cmd_len"; then
9688 # the above command should be used before it gets too long
9690 if test "$obj" = "$last_oldobj" ; then
9693 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9694 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9701 if test "X$oldobjs" = "X" ; then
9702 eval cmds=\"\$concat_cmds\"
9704 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9708 func_execute_cmds "$cmds" 'exit $?'
9711 test -n "$generated" && \
9712 func_show_eval "${RM}r$generated"
9714 # Now create the libtool archive.
9718 test "$build_old_libs" = yes && old_library="$libname.$libext"
9719 func_verbose "creating $output"
9721 # Preserve any variables that may affect compiler behavior
9722 for var in $variables_saved_for_relink; do
9723 if eval test -z \"\${$var+set}\"; then
9724 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9725 elif eval var_value=\$$var; test -z "$var_value"; then
9726 relink_command="$var=; export $var; $relink_command"
9728 func_quote_for_eval "$var_value"
9729 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9732 # Quote the link command for shipping.
9733 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9734 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9735 if test "$hardcode_automatic" = yes ; then
9739 # Only create the output if not a dry run.
9741 for installed in no yes; do
9742 if test "$installed" = yes; then
9743 if test -z "$install_libdir"; then
9746 output="$output_objdir/$outputname"i
9747 # Replace all uninstalled libtool libraries with the installed ones
9749 for deplib in $dependency_libs; do
9752 func_basename "$deplib"
9753 name="$func_basename_result"
9754 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9755 test -z "$libdir" && \
9756 func_fatal_error "\`$deplib' is not a valid libtool archive"
9757 newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
9760 func_stripname -L '' "$deplib"
9761 func_replace_sysroot "$func_stripname_result"
9762 newdependency_libs+=" -L$func_replace_sysroot_result"
9765 func_stripname -R '' "$deplib"
9766 func_replace_sysroot "$func_stripname_result"
9767 newdependency_libs+=" -R$func_replace_sysroot_result"
9769 *) newdependency_libs+=" $deplib" ;;
9772 dependency_libs="$newdependency_libs"
9775 for lib in $dlfiles; do
9778 func_basename "$lib"
9779 name="$func_basename_result"
9780 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9781 test -z "$libdir" && \
9782 func_fatal_error "\`$lib' is not a valid libtool archive"
9783 newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
9785 *) newdlfiles+=" $lib" ;;
9788 dlfiles="$newdlfiles"
9790 for lib in $dlprefiles; do
9793 # Only pass preopened files to the pseudo-archive (for
9794 # eventual linking with the app. that links it) if we
9795 # didn't already link the preopened objects directly into
9797 func_basename "$lib"
9798 name="$func_basename_result"
9799 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9800 test -z "$libdir" && \
9801 func_fatal_error "\`$lib' is not a valid libtool archive"
9802 newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
9806 dlprefiles="$newdlprefiles"
9809 for lib in $dlfiles; do
9811 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9812 *) abs=`pwd`"/$lib" ;;
9816 dlfiles="$newdlfiles"
9818 for lib in $dlprefiles; do
9820 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9821 *) abs=`pwd`"/$lib" ;;
9823 newdlprefiles+=" $abs"
9825 dlprefiles="$newdlprefiles"
9828 # place dlname in correct position for cygwin
9829 # In fact, it would be nice if we could use this code for all target
9830 # systems that can't hard-code library paths into their executables
9831 # and that have no shared library path variable independent of PATH,
9832 # but it turns out we can't easily determine that from inspecting
9833 # libtool variables, so we have to hard-code the OSs to which it
9834 # applies here; at the moment, that means platforms that use the PE
9835 # object format with DLL files. See the long comment at the top of
9836 # tests/bindir.at for full details.
9838 case $host,$output,$installed,$module,$dlname in
9839 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9840 # If a -bindir argument was supplied, place the dll there.
9841 if test "x$bindir" != x ;
9843 func_relative_path "$install_libdir" "$bindir"
9844 tdlname=$func_relative_path_result$dlname
9846 # Otherwise fall back on heuristic.
9847 tdlname=../bin/$dlname
9852 # $outputname - a libtool library file
9853 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9855 # Please DO NOT delete this file!
9856 # It is necessary for linking the library.
9858 # The name that we can dlopen(3).
9861 # Names of this library.
9862 library_names='$library_names'
9864 # The name of the static archive.
9865 old_library='$old_library'
9867 # Linker flags that can not go in dependency_libs.
9868 inherited_linker_flags='$new_inherited_linker_flags'
9870 # Libraries that this one depends upon.
9871 dependency_libs='$dependency_libs'
9873 # Names of additional weak libraries provided by this library
9874 weak_library_names='$weak_libs'
9876 # Version information for $libname.
9881 # Is this an already installed library?
9882 installed=$installed
9884 # Should we warn about portability when linking against -modules?
9885 shouldnotlink=$module
9887 # Files to dlopen/dlpreopen
9889 dlpreopen='$dlprefiles'
9891 # Directory that this library needs to be installed in:
9892 libdir='$install_libdir'"
9893 if test "$installed" = no && test "$need_relink" = yes; then
9895 relink_command=\"$relink_command\""
9900 # Do a symbolic link so that the libtool archive can be found in
9901 # LD_LIBRARY_PATH before the program is installed.
9902 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9908 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9909 func_mode_link ${1+"$@"}
9912 # func_mode_uninstall arg...
9913 func_mode_uninstall ()
9921 # This variable tells wrapper scripts just to set variables rather
9922 # than running their programs.
9923 libtool_install_magic="$magic"
9928 -f) RM+=" $arg"; rmforce=yes ;;
9930 *) files+=" $arg" ;;
9935 func_fatal_help "you must specify an RM program"
9939 for file in $files; do
9940 func_dirname "$file" "" "."
9941 dir="$func_dirname_result"
9942 if test "X$dir" = X.; then
9947 func_basename "$file"
9948 name="$func_basename_result"
9949 test "$opt_mode" = uninstall && odir="$dir"
9951 # Remember odir for removal later, being careful to avoid duplicates
9952 if test "$opt_mode" = clean; then
9955 *) rmdirs+=" $odir" ;;
9959 # Don't error if the file doesn't exist and rm -f was used.
9960 if { test -L "$file"; } >/dev/null 2>&1 ||
9961 { test -h "$file"; } >/dev/null 2>&1 ||
9962 test -f "$file"; then
9964 elif test -d "$file"; then
9967 elif test "$rmforce" = yes; then
9975 # Possibly a libtool archive, so verify it.
9976 if func_lalib_p "$file"; then
9977 func_source $dir/$name
9979 # Delete the libtool libraries and symlinks.
9980 for n in $library_names; do
9981 rmfiles+=" $odir/$n"
9983 test -n "$old_library" && rmfiles+=" $odir/$old_library"
9987 case " $library_names " in
9989 *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
9991 test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
9994 if test -n "$library_names"; then
9995 # Do each command in the postuninstall commands.
9996 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9999 if test -n "$old_library"; then
10000 # Do each command in the old_postuninstall commands.
10001 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
10003 # FIXME: should reinstall the best remaining shared library.
10010 # Possibly a libtool object, so verify it.
10011 if func_lalib_p "$file"; then
10013 # Read the .lo file
10014 func_source $dir/$name
10016 # Add PIC object to the list of files to remove.
10017 if test -n "$pic_object" &&
10018 test "$pic_object" != none; then
10019 rmfiles+=" $dir/$pic_object"
10022 # Add non-PIC object to the list of files to remove.
10023 if test -n "$non_pic_object" &&
10024 test "$non_pic_object" != none; then
10025 rmfiles+=" $dir/$non_pic_object"
10031 if test "$opt_mode" = clean ; then
10035 func_stripname '' '.exe' "$file"
10036 file=$func_stripname_result
10037 func_stripname '' '.exe' "$name"
10038 noexename=$func_stripname_result
10039 # $file with .exe has already been added to rmfiles,
10040 # add $file without .exe
10044 # Do a test to see if this is a libtool program.
10045 if func_ltwrapper_p "$file"; then
10046 if func_ltwrapper_executable_p "$file"; then
10047 func_ltwrapper_scriptname "$file"
10049 func_source $func_ltwrapper_scriptname_result
10050 rmfiles+=" $func_ltwrapper_scriptname_result"
10053 func_source $dir/$noexename
10056 # note $name still contains .exe if it was in $file originally
10057 # as does the version of $file that was added into $rmfiles
10058 rmfiles+=" $odir/$name $odir/${name}S.${objext}"
10059 rmfiles+=" ${name}.manifest $objdir/${name}.manifest"
10060 if test "$fast_install" = yes && test -n "$relink_command"; then
10061 rmfiles+=" $odir/lt-$name $objdir/lt-${name}.manifest"
10063 if test "X$noexename" != "X$name" ; then
10064 rmfiles+=" $odir/lt-${noexename}.c"
10070 func_show_eval "$RM $rmfiles" 'exit_status=1'
10073 # Try to remove the ${objdir}s in the directories where we deleted files
10074 for dir in $rmdirs; do
10075 if test -d "$dir"; then
10076 func_show_eval "rmdir $dir >/dev/null 2>&1"
10083 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10084 func_mode_uninstall ${1+"$@"}
10086 test -z "$opt_mode" && {
10087 help="$generic_help"
10088 func_fatal_help "you must specify a MODE"
10091 test -z "$exec_cmd" && \
10092 func_fatal_help "invalid operation mode \`$opt_mode'"
10094 if test -n "$exec_cmd"; then
10095 eval exec "$exec_cmd"
10102 # The TAGs below are defined such that we never get into a situation
10103 # in which we disable both kinds of libraries. Given conflicting
10104 # choices, we go for a static library, that is the most portable,
10105 # since we can't tell whether shared libraries were disabled because
10106 # the user asked for that or because the platform doesn't support
10107 # them. This is particularly important on AIX, because we don't
10108 # support having both static and shared libraries enabled at the same
10109 # time on that platform, so we default to a shared-only configuration.
10110 # If a disable-shared tag is given, we'll fallback to a static-only
10111 # configuration. But we'll never go from static-only to shared-only.
10113 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
10114 build_libtool_libs=no
10116 # ### END LIBTOOL TAG CONFIG: disable-shared
10118 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
10119 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
10120 # ### END LIBTOOL TAG CONFIG: disable-static
10123 # mode:shell-script
10129 # ### BEGIN LIBTOOL TAG CONFIG: CXX
10131 # The linker used to build libraries.
10132 LD="/usr/arm-linux-gnueabi/bin/ld"
10134 # How to create reloadable object files.
10136 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
10138 # Commands used to build an old-style archive.
10139 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
10141 # A language specific compiler.
10144 # Is the compiler the GNU compiler?
10147 # Compiler flag to turn off builtin functions.
10148 no_builtin_flag=" -fno-builtin"
10150 # Additional compiler flags for building library objects.
10151 pic_flag=" -fPIC -DPIC"
10153 # How to pass a linker flag through the compiler.
10156 # Compiler flag to prevent dynamic linking.
10157 link_static_flag="-static"
10159 # Does compiler simultaneously support -c and -o options?
10162 # Whether or not to add -lc for building shared libraries.
10163 build_libtool_need_lc=no
10165 # Whether or not to disallow shared libs when runtime libs are static.
10166 allow_libtool_libs_with_static_runtimes=no
10168 # Compiler flag to allow reflexive dlopens.
10169 export_dynamic_flag_spec="\${wl}--export-dynamic"
10171 # Compiler flag to generate shared objects directly from archives.
10172 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
10174 # Whether the compiler copes with passing no objects directly.
10175 compiler_needs_object="no"
10177 # Create an old-style archive from a shared archive.
10178 old_archive_from_new_cmds=""
10180 # Create a temporary old-style archive to link instead of a shared archive.
10181 old_archive_from_expsyms_cmds=""
10183 # Commands used to build a shared archive.
10184 archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
10185 archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
10187 # Commands used to build a loadable module if different from building
10188 # a shared archive.
10190 module_expsym_cmds=""
10192 # Whether we are building with GNU ld or not.
10195 # Flag that allows shared libraries with undefined symbols to be built.
10196 allow_undefined_flag=""
10198 # Flag that enforces no undefined symbols.
10199 no_undefined_flag=""
10201 # Flag to hardcode $libdir into a binary during linking.
10202 # This must work even if $libdir does not exist
10203 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
10205 # If ld is used when linking, flag to hardcode $libdir into a binary
10206 # during linking. This must work even if $libdir does not exist.
10207 hardcode_libdir_flag_spec_ld=""
10209 # Whether we need a single "-rpath" flag with a separated argument.
10210 hardcode_libdir_separator=""
10212 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
10213 # DIR into the resulting binary.
10216 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
10217 # DIR into the resulting binary and the resulting library dependency is
10218 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
10219 # library is relocated.
10220 hardcode_direct_absolute=no
10222 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
10223 # into the resulting binary.
10224 hardcode_minus_L=no
10226 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
10227 # into the resulting binary.
10228 hardcode_shlibpath_var=unsupported
10230 # Set to "yes" if building a shared library automatically hardcodes DIR
10231 # into the library and all subsequent libraries and executables linked
10233 hardcode_automatic=no
10235 # Set to yes if linker adds runtime paths of dependent libraries
10236 # to runtime path list.
10239 # Whether libtool must link a program against all its dependency libraries.
10240 link_all_deplibs=unknown
10242 # Set to "yes" if exported symbols are required.
10243 always_export_symbols=no
10245 # The commands to list exported symbols.
10246 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
10248 # Symbols that should not be listed in the preloaded symbols.
10249 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
10251 # Symbols that must always be exported.
10254 # Commands necessary for linking programs (against libraries) with templates.
10257 # Commands necessary for finishing linking programs.
10260 # Specify filename containing input files.
10263 # How to hardcode a shared library path into an executable.
10264 hardcode_action=immediate
10266 # The directories searched by this compiler when creating a shared library.
10267 compiler_lib_search_dirs="/home/gpeegpee/sbs/target-armel/usr/lib /home/gpeegpee/sbs/target-armel/lib /usr/lib/gcc/arm-linux-gnueabi/4.5.3 /usr/lib/gcc/arm-linux-gnueabi/4.5.3/../../../../arm-linux-gnueabi/lib"
10269 # Dependencies to place before and after the objects being linked to
10270 # create a shared library.
10271 predep_objects="/usr/lib/gcc/arm-linux-gnueabi/4.5.3/../../../../arm-linux-gnueabi/lib/crti.o /usr/lib/gcc/arm-linux-gnueabi/4.5.3/crtbeginS.o"
10272 postdep_objects="/usr/lib/gcc/arm-linux-gnueabi/4.5.3/crtendS.o /usr/lib/gcc/arm-linux-gnueabi/4.5.3/../../../../arm-linux-gnueabi/lib/crtn.o"
10274 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
10276 # The library search path used internally by the compiler when linking
10277 # a shared library.
10278 compiler_lib_search_path="-L/home/gpeegpee/sbs/target-armel/usr/lib -L/home/gpeegpee/sbs/target-armel/lib -L/usr/lib/gcc/arm-linux-gnueabi/4.5.3 -L/usr/lib/gcc/arm-linux-gnueabi/4.5.3/../../../../arm-linux-gnueabi/lib"
10280 # ### END LIBTOOL TAG CONFIG: CXX