3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (glib) 1.2.10
5 # Libtool was configured on host vicente-P5K-E:
6 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
8 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9 # 2006, 2007, 2008, 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 # Which release of libtool.m4 was used?
46 # Whether or not to build shared libraries.
47 build_libtool_libs
=yes
49 # Whether or not to build static libraries.
52 # What type of objects to build.
55 # Whether or not to optimize for fast installation.
58 # Shell to use when invoking shell scripts.
61 # An echo program that protects backslashes.
65 host_alias
=mipsel-linux
66 host=mipsel-unknown-linux-gnu
70 build_alias
=x86_64-linux-gnu
71 build
=x86_64-pc-linux-gnu
74 # A sed program that does not truncate output.
77 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
78 Xsed
="$SED -e 1s/^X//"
80 # A grep program that handles long lines.
86 # A literal string matcher.
89 # A BSD- or MS-compatible name lister.
92 # Whether we need soft or hard links.
95 # What is the maximum length of a command?
96 max_cmd_len
=3458764513820540925
98 # Object file suffix (normally "o").
101 # Executable file suffix (normally "").
104 # whether the shell understands "unset".
107 # turn spaces into newlines.
108 SP2NL
="tr \\040 \\012"
110 # turn newlines into spaces.
111 NL2SP
="tr \\015\\012 \\040\\040"
113 # convert $build file names to $host format.
114 to_host_file_cmd
=func_convert_file_noop
116 # convert $build files to toolchain format.
117 to_tool_file_cmd
=func_convert_file_noop
119 # An object symbol dumper.
120 OBJDUMP
="mipsel-linux-objdump"
122 # Method to check whether dependent libraries are shared objects.
123 deplibs_check_method
="pass_all"
125 # Command to use when deplibs_check_method = "file_magic".
126 file_magic_cmd
="\$MAGIC_CMD"
128 # How to find potential files when deplibs_check_method = "file_magic".
131 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
134 # DLL creation program.
137 # Command to associate shared and link libraries.
138 sharedlib_from_linklib_cmd
="printf %s\\n"
141 AR
="mipsel-uclibc-ar"
143 # Flags to create an archive.
146 # How to feed a file listing to the archiver.
147 archiver_list_spec
="@"
149 # A symbol stripping program.
150 STRIP
="mipsel-uclibc-strip -R .note -R .comment"
152 # Commands used to install an old-style archive.
153 RANLIB
="mipsel-uclibc-ranlib"
154 old_postinstall_cmds
="chmod 644 \$oldlib~\$RANLIB \$oldlib"
155 old_postuninstall_cmds
=""
157 # Whether to use a lock for old archive extraction.
158 lock_old_archive_extraction
=no
161 LTCC
="mipsel-uclibc-gcc"
163 # LTCC compiler flags.
164 LTCFLAGS
="-g -O2 -Wall -D_REENTRANT"
166 # Take the output of nm and produce a listing of raw symbols and C names.
167 global_symbol_pipe
="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
169 # Transform the output of nm in a proper C declaration.
170 global_symbol_to_cdecl
="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
172 # Transform the output of nm in a C name address pair.
173 global_symbol_to_c_name_address
="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
175 # Transform the output of nm in a C name address pair when lib prefix is needed.
176 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'"
178 # Specify filename containing input files for $NM.
179 nm_file_list_spec
="@"
181 # The root where to search for dependent libraries,and in which our libraries should be installed.
184 # The name of the directory that contains temporary libtool files.
187 # Used to examine libraries when file_magic_cmd begins with "file".
190 # Must we lock files when doing compilation?
196 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
199 # Tool to change global to local symbols on Mac OS X.
202 # Tool to manipulate fat objects and archives on Mac OS X.
205 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
208 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
211 # Old archive suffix (normally "a").
214 # Shared library suffix (normally ".so").
217 # The commands to extract the exported symbol list from a shared archive.
218 extract_expsyms_cmds
=""
220 # Variables whose values should be saved in libtool wrapper scripts and
221 # restored at link time.
222 variables_saved_for_relink
="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
224 # Do we need the "lib" prefix for modules?
227 # Do we need a version for libraries?
230 # Library versioning type.
233 # Shared library runtime path variable.
234 runpath_var
=LD_RUN_PATH
236 # Shared library path variable.
237 shlibpath_var
=LD_LIBRARY_PATH
239 # Is shlibpath searched before the hard-coded library search path?
240 shlibpath_overrides_runpath
=no
242 # Format of library name prefix.
243 libname_spec
="lib\$name"
245 # List of archive names. First name is the real one, the rest are links.
246 # The last name is the one that the linker finds with -lNAME
247 library_names_spec
="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
249 # The coded name of the library, if different from the real name.
250 soname_spec
="\${libname}\${release}\${shared_ext}\$major"
252 # Permission mode override for installation of shared libraries.
253 install_override_mode
=""
255 # Command to use after installation of a shared archive.
258 # Command to use after uninstallation of a shared archive.
259 postuninstall_cmds
=""
261 # Commands used to finish a libtool library installation in a directory.
262 finish_cmds
="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
264 # As "finish_cmds", except a single script fragment to be evaled but
268 # Whether we should hardcode library paths into libraries.
269 hardcode_into_libs
=yes
271 # Compile-time system search path for libraries.
272 sys_lib_search_path_spec
="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4 /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib "
274 # Run-time system search path for libraries.
275 sys_lib_dlsearch_path_spec
="/lib /usr/lib /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/lib/nvidia-settings /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/nvidia-current /usr/lib32/nvidia-current /lib32 /usr/lib32 "
277 # Whether dlopen is supported.
278 dlopen_support
=unknown
280 # Whether dlopen of programs is supported.
283 # Whether dlopen of statically linked programs is supported.
284 dlopen_self_static
=unknown
286 # Commands to strip libraries.
287 old_striplib
="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
288 striplib
="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
291 # The linker used to build libraries.
292 LD
="mipsel-uclibc-ld"
294 # How to create reloadable object files.
296 reload_cmds
="\$LD\$reload_flag -o \$output\$reload_objs"
298 # Commands used to build an old-style archive.
299 old_archive_cmds
="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
301 # A language specific compiler.
302 CC
="mipsel-uclibc-gcc"
304 # Is the compiler the GNU compiler?
307 # Compiler flag to turn off builtin functions.
308 no_builtin_flag
=" -fno-builtin"
310 # Additional compiler flags for building library objects.
311 pic_flag
=" -fPIC -DPIC"
313 # How to pass a linker flag through the compiler.
316 # Compiler flag to prevent dynamic linking.
317 link_static_flag
="-static"
319 # Does compiler simultaneously support -c and -o options?
322 # Whether or not to add -lc for building shared libraries.
323 build_libtool_need_lc
=no
325 # Whether or not to disallow shared libs when runtime libs are static.
326 allow_libtool_libs_with_static_runtimes
=no
328 # Compiler flag to allow reflexive dlopens.
329 export_dynamic_flag_spec
="\${wl}--export-dynamic"
331 # Compiler flag to generate shared objects directly from archives.
332 whole_archive_flag_spec
="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
334 # Whether the compiler copes with passing no objects directly.
335 compiler_needs_object
="no"
337 # Create an old-style archive from a shared archive.
338 old_archive_from_new_cmds
=""
340 # Create a temporary old-style archive to link instead of a shared archive.
341 old_archive_from_expsyms_cmds
=""
343 # Commands used to build a shared archive.
344 archive_cmds
="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
345 archive_expsym_cmds
="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
346 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
347 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
348 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
350 # Commands used to build a loadable module if different from building
353 module_expsym_cmds
=""
355 # Whether we are building with GNU ld or not.
358 # Flag that allows shared libraries with undefined symbols to be built.
359 allow_undefined_flag
=""
361 # Flag that enforces no undefined symbols.
364 # Flag to hardcode $libdir into a binary during linking.
365 # This must work even if $libdir does not exist
366 hardcode_libdir_flag_spec
="\${wl}-rpath \${wl}\$libdir"
368 # If ld is used when linking, flag to hardcode $libdir into a binary
369 # during linking. This must work even if $libdir does not exist.
370 hardcode_libdir_flag_spec_ld
=""
372 # Whether we need a single "-rpath" flag with a separated argument.
373 hardcode_libdir_separator
=""
375 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
376 # DIR into the resulting binary.
379 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
380 # DIR into the resulting binary and the resulting library dependency is
381 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
382 # library is relocated.
383 hardcode_direct_absolute
=no
385 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
386 # into the resulting binary.
389 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
390 # into the resulting binary.
391 hardcode_shlibpath_var
=unsupported
393 # Set to "yes" if building a shared library automatically hardcodes DIR
394 # into the library and all subsequent libraries and executables linked
396 hardcode_automatic
=no
398 # Set to yes if linker adds runtime paths of dependent libraries
399 # to runtime path list.
402 # Whether libtool must link a program against all its dependency libraries.
403 link_all_deplibs
=unknown
405 # Set to "yes" if exported symbols are required.
406 always_export_symbols
=no
408 # The commands to list exported symbols.
409 export_symbols_cmds
="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
411 # Symbols that should not be listed in the preloaded symbols.
412 exclude_expsyms
="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
414 # Symbols that must always be exported.
417 # Commands necessary for linking programs (against libraries) with templates.
420 # Commands necessary for finishing linking programs.
423 # Specify filename containing input files.
426 # How to hardcode a shared library path into an executable.
427 hardcode_action
=immediate
429 # ### END LIBTOOL CONFIG
432 # libtool (GNU libtool) 2.4
433 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
435 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
436 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
437 # This is free software; see the source for copying conditions. There is NO
438 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
440 # GNU Libtool is free software; you can redistribute it and/or modify
441 # it under the terms of the GNU General Public License as published by
442 # the Free Software Foundation; either version 2 of the License, or
443 # (at your option) any later version.
445 # As a special exception to the GNU General Public License,
446 # if you distribute this file as part of a program or library that
447 # is built using GNU Libtool, you may include this file under the
448 # same distribution terms that you use for the rest of that program.
450 # GNU Libtool is distributed in the hope that it will be useful, but
451 # WITHOUT ANY WARRANTY; without even the implied warranty of
452 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
453 # General Public License for more details.
455 # You should have received a copy of the GNU General Public License
456 # along with GNU Libtool; see the file COPYING. If not, a copy
457 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
458 # or obtained by writing to the Free Software Foundation, Inc.,
459 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
461 # Usage: $progname [OPTION]... [MODE-ARG]...
463 # Provide generalized library-building support services.
465 # --config show all configuration variables
466 # --debug enable verbose shell tracing
467 # -n, --dry-run display commands without modifying any files
468 # --features display basic configuration information and exit
469 # --mode=MODE use operation mode MODE
470 # --preserve-dup-deps don't remove duplicate dependency libraries
471 # --quiet, --silent don't print informational messages
472 # --no-quiet, --no-silent
473 # print informational messages (default)
474 # --tag=TAG use configuration variables from tag TAG
475 # -v, --verbose print more informational messages than default
476 # --no-verbose don't print the extra informational messages
477 # --version print version information
478 # -h, --help, --help-all print short, long, or detailed help message
480 # MODE must be one of the following:
482 # clean remove files from the build directory
483 # compile compile a source file into a libtool object
484 # execute automatically set library path, then run a program
485 # finish complete the installation of libtool libraries
486 # install install libraries or executables
487 # link create a library or an executable
488 # uninstall remove libraries from an installed directory
490 # MODE-ARGS vary depending on the MODE. When passed as first option,
491 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
492 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
494 # When reporting a bug, please describe a test case to reproduce it and
495 # include the following information:
497 # host-triplet: $host
500 # compiler flags: $LTCFLAGS
501 # linker: $LD (gnu? $with_gnu_ld)
502 # $progname: (GNU libtool) 2.4
503 # automake: $automake_version
504 # autoconf: $autoconf_version
506 # Report bugs to <bug-libtool@gnu.org>.
507 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
508 # General help using GNU software: <http://www.gnu.org/gethelp/>.
514 package_revision
=1.3293
516 # Be Bourne compatible
517 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
520 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
521 # is contrary to our usage. Disable this feature.
522 alias -g '${1+"$@"}'='"$@"'
525 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
527 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
528 DUALCASE
=1; export DUALCASE
# for MKS sh
530 # A function that is used when there is no print builtin or printf.
531 func_fallback_echo
()
533 eval 'cat <<_LTECHO_EOF
538 # NLS nuisances: We save the old values to restore during execute mode.
541 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
543 eval "if test \"\${$lt_var+set}\" = set; then
544 save_$lt_var=\$$lt_var
547 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
548 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
553 export LANGUAGE LC_ALL
558 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
559 # is ksh but when the shell is invoked as "sh" and the current value of
560 # the _XPG environment variable is not equal to 1 (one), the special
561 # positional parameter $0, within a function call, is the name of the
568 test "${ECHO+set}" = set || ECHO
=${as_echo-'printf %s\n'}
578 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
579 : ${Xsed="$SED -e 1s/^X//"}
584 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
585 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
587 exit_status
=$EXIT_SUCCESS
589 # Make sure IFS has a sensible default
594 dirname="s,/[^/]*$,,"
597 # func_dirname file append nondir_replacement
598 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
599 # otherwise set result to NONDIR_REPLACEMENT.
603 */*) func_dirname_result
="${1%/*}${2}" ;;
604 * ) func_dirname_result
="${3}" ;;
606 } # Extended-shell func_dirname implementation
612 func_basename_result
="${1##*/}"
613 } # Extended-shell func_basename implementation
616 # func_dirname_and_basename file append nondir_replacement
617 # perform func_basename and func_dirname in a single function
619 # dirname: Compute the dirname of FILE. If nonempty,
620 # add APPEND to the result, otherwise set result
621 # to NONDIR_REPLACEMENT.
622 # value returned in "$func_dirname_result"
623 # basename: Compute filename of FILE.
624 # value retuned in "$func_basename_result"
625 # Implementation must be kept synchronized with func_dirname
626 # and func_basename. For efficiency, we do not delegate to
627 # those functions but instead duplicate the functionality here.
628 func_dirname_and_basename
()
631 */*) func_dirname_result
="${1%/*}${2}" ;;
632 * ) func_dirname_result
="${3}" ;;
634 func_basename_result
="${1##*/}"
635 } # Extended-shell func_dirname_and_basename implementation
638 # func_stripname prefix suffix name
639 # strip PREFIX and SUFFIX off of NAME.
640 # PREFIX and SUFFIX must not contain globbing or regex special
641 # characters, hashes, percent signs, but SUFFIX may contain a leading
642 # dot (in which case that matches only a dot).
643 # func_strip_suffix prefix name
646 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
647 # positional parameters, so assign one to ordinary parameter first.
648 func_stripname_result
=${3}
649 func_stripname_result
=${func_stripname_result#"${1}"}
650 func_stripname_result
=${func_stripname_result%"${2}"}
651 } # Extended-shell func_stripname implementation
654 # These SED scripts presuppose an absolute path with a trailing slash.
655 pathcar
='s,^/\([^/]*\).*$,\1,'
656 pathcdr
='s,^/[^/]*,,'
657 removedotparts
=':dotsl
661 collapseslashes
='s@/\{1,\}@/@g'
662 finalslash
='s,/*$,/,'
664 # func_normal_abspath PATH
665 # Remove doubled-up and trailing slashes, "." path components,
666 # and cancel out any ".." path components in PATH after making
667 # it an absolute path.
668 # value returned in "$func_normal_abspath_result"
669 func_normal_abspath
()
671 # Start from root dir and reassemble the path.
672 func_normal_abspath_result
=
673 func_normal_abspath_tpath
=$1
674 func_normal_abspath_altnamespace
=
675 case $func_normal_abspath_tpath in
677 # Empty path, that just means $cwd.
678 func_stripname
'' '/' "`pwd`"
679 func_normal_abspath_result
=$func_stripname_result
682 # The next three entries are used to spot a run of precisely
683 # two leading slashes without using negated character classes;
684 # we take advantage of case's first-match behaviour.
686 # Unusual form of absolute path, do nothing.
689 # Not necessarily an ordinary path; POSIX reserves leading '//'
690 # and for example Cygwin uses it to access remote file shares
691 # over CIFS/SMB, so we conserve a leading double slash if found.
692 func_normal_abspath_altnamespace
=/
695 # Absolute path, do nothing.
698 # Relative path, prepend $cwd.
699 func_normal_abspath_tpath
=`pwd`/$func_normal_abspath_tpath
702 # Cancel out all the simple stuff to save iterations. We also want
703 # the path to end with a slash for ease of parsing, so make sure
704 # there is one (and only one) here.
705 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
706 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
708 # Processed it all yet?
709 if test "$func_normal_abspath_tpath" = / ; then
710 # If we ascended to the root using ".." the result may be empty now.
711 if test -z "$func_normal_abspath_result" ; then
712 func_normal_abspath_result
=/
716 func_normal_abspath_tcomponent
=`$ECHO "$func_normal_abspath_tpath" | $SED \
718 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
720 # Figure out what to do with it
721 case $func_normal_abspath_tcomponent in
723 # Trailing empty path component, ignore it.
726 # Parent dir; strip last assembled component from result.
727 func_dirname
"$func_normal_abspath_result"
728 func_normal_abspath_result
=$func_dirname_result
731 # Actual path component, append it.
732 func_normal_abspath_result
=$func_normal_abspath_result/$func_normal_abspath_tcomponent
736 # Restore leading double-slash if one was found on entry.
737 func_normal_abspath_result
=$func_normal_abspath_altnamespace$func_normal_abspath_result
740 # func_relative_path SRCDIR DSTDIR
741 # generates a relative path from SRCDIR to DSTDIR, with a trailing
742 # slash if non-empty, suitable for immediately appending a filename
743 # without needing to append a separator.
744 # value returned in "$func_relative_path_result"
745 func_relative_path
()
747 func_relative_path_result
=
748 func_normal_abspath
"$1"
749 func_relative_path_tlibdir
=$func_normal_abspath_result
750 func_normal_abspath
"$2"
751 func_relative_path_tbindir
=$func_normal_abspath_result
753 # Ascend the tree starting from libdir
755 # check if we have found a prefix of bindir
756 case $func_relative_path_tbindir in
757 $func_relative_path_tlibdir)
758 # found an exact match
759 func_relative_path_tcancelled
=
762 $func_relative_path_tlibdir*)
763 # found a matching prefix
764 func_stripname
"$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
765 func_relative_path_tcancelled
=$func_stripname_result
766 if test -z "$func_relative_path_result"; then
767 func_relative_path_result
=.
772 func_dirname
$func_relative_path_tlibdir
773 func_relative_path_tlibdir
=${func_dirname_result}
774 if test "x$func_relative_path_tlibdir" = x
; then
775 # Have to descend all the way to the root!
776 func_relative_path_result
=..
/$func_relative_path_result
777 func_relative_path_tcancelled
=$func_relative_path_tbindir
780 func_relative_path_result
=..
/$func_relative_path_result
785 # Now calculate path; take care to avoid doubling-up slashes.
786 func_stripname
'' '/' "$func_relative_path_result"
787 func_relative_path_result
=$func_stripname_result
788 func_stripname
'/' '/' "$func_relative_path_tcancelled"
789 if test "x$func_stripname_result" != x
; then
790 func_relative_path_result
=${func_relative_path_result}/${func_stripname_result}
793 # Normalisation. If bindir is libdir, return empty string,
794 # else relative path ending with a slash; either way, target
795 # file name can be directly appended.
796 if test ! -z "$func_relative_path_result"; then
797 func_stripname
'./' '' "$func_relative_path_result/"
798 func_relative_path_result
=$func_stripname_result
802 # The name of this program:
803 func_dirname_and_basename
"$progpath"
804 progname
=$func_basename_result
806 # Make sure we have an absolute path for reexecution:
808 [\\/]*|
[A-Za-z
]:\\*) ;;
810 progdir
=$func_dirname_result
811 progdir
=`cd "$progdir" && pwd`
812 progpath
="$progdir/$progname"
817 for progdir
in $PATH; do
819 test -x "$progdir/$progname" && break
822 test -n "$progdir" || progdir
=`pwd`
823 progpath
="$progdir/$progname"
827 # Sed substitution that helps us do robust quoting. It backslashifies
828 # metacharacters that are still active within double-quoted strings.
829 Xsed
="${SED}"' -e 1s/^X//'
830 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
832 # Same as above, but do not quote variable references.
833 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
835 # Sed substitution that turns a string into a regex matching for the
837 sed_make_literal_regex
='s,[].[^$\\*\/],\\&,g'
839 # Sed substitution that converts a w32 file name or path
840 # which contains forward slashes, into one that contains
841 # (escaped) backslashes. A very naive implementation.
842 lt_sed_naive_backslashify
='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
844 # Re-`\' parameter expansions in output of double_quote_subst that were
845 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
846 # in input to double_quote_subst, that '$' was protected from expansion.
847 # Since each input `\' is now two `\'s, look for any number of runs of
848 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
853 sed_double_backslash
="\
857 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
868 # Echo program name prefixed message, along with the current mode
869 # name if it has been set yet.
872 $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }$*"
875 # func_verbose arg...
876 # Echo program name prefixed message in verbose mode only.
879 $opt_verbose && func_echo
${1+"$@"}
881 # A bug in bash halts the script if the last line of a function
882 # fails when set -e is in force, so we need another command to
887 # func_echo_all arg...
888 # Invoke $ECHO with all args, space-separated.
895 # Echo program name prefixed message to standard error.
898 $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
901 # func_warning arg...
902 # Echo program name prefixed warning message to standard error.
905 $opt_warning && $ECHO "OpenWrt-$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
911 # func_fatal_error arg...
912 # Echo program name prefixed message to standard error, and exit.
919 # func_fatal_help arg...
920 # Echo program name prefixed message to standard error, followed by
921 # a help hint, and exit.
925 func_fatal_error
"$help"
927 help="Try \`$progname --help' for more information." ## default
930 # func_grep expression filename
931 # Check whether EXPRESSION matches any line of FILENAME, without output.
934 $GREP "$1" "$2" >/dev
/null
2>&1
938 # func_mkdir_p directory-path
939 # Make sure the entire path to DIRECTORY-PATH is available.
942 my_directory_path
="$1"
945 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
947 # Protect directory names starting with `-'
948 case $my_directory_path in
949 -*) my_directory_path
="./$my_directory_path" ;;
952 # While some portion of DIR does not yet exist...
953 while test ! -d "$my_directory_path"; do
954 # ...make a list in topmost first order. Use a colon delimited
955 # list incase some portion of path contains whitespace.
956 my_dir_list
="$my_directory_path:$my_dir_list"
958 # If the last portion added has no slash in it, the list is done
959 case $my_directory_path in */*) ;; *) break ;; esac
961 # ...otherwise throw away the child directory and loop
962 my_directory_path
=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
964 my_dir_list
=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
966 save_mkdir_p_IFS
="$IFS"; IFS
=':'
967 for my_dir
in $my_dir_list; do
968 IFS
="$save_mkdir_p_IFS"
969 # mkdir can fail with a `File exist' error if two processes
970 # try to create one of the directories concurrently. Don't
972 $MKDIR "$my_dir" 2>/dev
/null ||
:
974 IFS
="$save_mkdir_p_IFS"
976 # Bail out if we (or some other process) failed to create a directory.
977 test -d "$my_directory_path" || \
978 func_fatal_error
"Failed to create \`$1'"
983 # func_mktempdir [string]
984 # Make a temporary directory that won't clash with other running
985 # libtool processes, and avoids race conditions if possible. If
986 # given, STRING is the basename for that directory.
989 my_template
="${TMPDIR-/tmp}/${1-$progname}"
991 if test "$opt_dry_run" = ":"; then
992 # Return a directory name, but don't create it in dry-run mode
993 my_tmpdir
="${my_template}-$$"
996 # If mktemp works, use that first and foremost
997 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
999 if test ! -d "$my_tmpdir"; then
1000 # Failing that, at least try and use $RANDOM to avoid a race
1001 my_tmpdir
="${my_template}-${RANDOM-0}$$"
1003 save_mktempdir_umask
=`umask`
1006 umask $save_mktempdir_umask
1009 # If we're not in dry-run mode, bomb out on failure
1010 test -d "$my_tmpdir" || \
1011 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
1018 # func_quote_for_eval arg
1019 # Aesthetically quote ARG to be evaled later.
1020 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1021 # is double-quoted, suitable for a subsequent eval, whereas
1022 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1023 # which are still active within double quotes backslashified.
1024 func_quote_for_eval
()
1028 func_quote_for_eval_unquoted_result=`$ECHO "$1" |
$SED "$sed_quote_subst"` ;;
1030 func_quote_for_eval_unquoted_result="$1" ;;
1033 case $func_quote_for_eval_unquoted_result in
1034 # Double-quote args containing shell metacharacters to delay
1035 # word splitting, command substitution and and variable
1036 # expansion for a subsequent eval.
1037 # Many Bourne shells cannot handle close brackets correctly
1038 # in scan sets, so we specify it separately.
1039 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1040 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1043 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1048 # func_quote_for_expand arg
1049 # Aesthetically quote ARG to be evaled later; same as above,
1050 # but do not quote variable references.
1051 func_quote_for_expand ()
1055 my_arg
=`$ECHO "$1" | $SED \
1056 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1062 # Double-quote args containing shell metacharacters to delay
1063 # word splitting and command substitution for a subsequent eval.
1064 # Many Bourne shells cannot handle close brackets correctly
1065 # in scan sets, so we specify it separately.
1066 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1067 my_arg
="\"$my_arg\""
1071 func_quote_for_expand_result
="$my_arg"
1075 # func_show_eval cmd [fail_exp]
1076 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1077 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1078 # is given, then evaluate it.
1082 my_fail_exp
="${2-:}"
1084 ${opt_silent-false} ||
{
1085 func_quote_for_expand
"$my_cmd"
1086 eval "func_echo $func_quote_for_expand_result"
1089 if ${opt_dry_run-false}; then :; else
1092 if test "$my_status" -eq 0; then :; else
1093 eval "(exit $my_status); $my_fail_exp"
1099 # func_show_eval_locale cmd [fail_exp]
1100 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1101 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1102 # is given, then evaluate it. Use the saved locale for evaluation.
1103 func_show_eval_locale
()
1106 my_fail_exp
="${2-:}"
1108 ${opt_silent-false} ||
{
1109 func_quote_for_expand
"$my_cmd"
1110 eval "func_echo $func_quote_for_expand_result"
1113 if ${opt_dry_run-false}; then :; else
1114 eval "$lt_user_locale
1117 eval "$lt_safe_locale"
1118 if test "$my_status" -eq 0; then :; else
1119 eval "(exit $my_status); $my_fail_exp"
1125 # Turn $1 into a string suitable for a shell variable name.
1126 # Result is stored in $func_tr_sh_result. All characters
1127 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1128 # if $1 begins with a digit, a '_' is prepended as well.
1132 [0-9]* |
*[!a-zA-Z0-9_
]*)
1133 func_tr_sh_result
=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1136 func_tr_sh_result
=$1
1143 # Echo version message to standard output and exit.
1156 /^# '$PROGRAM' (GNU /,/# warranty; / {
1159 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1166 # Echo short help message to standard output and exit.
1171 $SED -n '/^# Usage:/,/^# *.*--help/ {
1174 s/\$progname/'$progname'/
1178 $ECHO "run \`$progname --help | more' for full usage"
1182 # func_help [NOEXIT]
1183 # Echo long help message to standard output and exit,
1184 # unless 'noexit' is passed as argument.
1189 $SED -n '/^# Usage:/,/# Report bugs to/ {
1193 s*\$progname*'$progname'*
1195 s*\$SHELL*'"$SHELL"'*
1197 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1199 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1200 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1201 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1205 /^# .* home page:/b print
1206 /^# General help using/b print
1209 if test -z "$1"; then
1214 # func_missing_arg argname
1215 # Echo program name prefixed message to standard error and set global
1221 func_error
"missing argument for $1."
1226 # func_split_short_opt shortopt
1227 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1228 # variables after splitting SHORTOPT after the 2nd character.
1229 func_split_short_opt
()
1231 func_split_short_opt_arg
=${1#??}
1232 func_split_short_opt_name
=${1%"$func_split_short_opt_arg"}
1233 } # Extended-shell func_split_short_opt implementation
1236 # func_split_long_opt longopt
1237 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1238 # variables after splitting LONGOPT at the `=' sign.
1239 func_split_long_opt
()
1241 func_split_long_opt_name
=${1%%=*}
1242 func_split_long_opt_arg
=${1#*=}
1243 } # Extended-shell func_split_long_opt implementation
1251 magic
="%%%MAGIC variable%%%"
1252 magic_exe
="%%%MAGIC EXE variable%%%"
1257 lo2o
="s/\\.lo\$/.${objext}/"
1258 o2lo
="s/\\.${objext}\$/.lo/"
1262 # If this variable is set in any of the actions, the command in it
1263 # will be execed at the end. This prevents here-documents from being
1264 # left over by shells.
1267 # func_append var value
1268 # Append VALUE to the end of shell variable VAR.
1272 } # Extended-shell func_append implementation
1274 # func_append_quoted var value
1275 # Quote VALUE and append to the end of shell variable VAR, separated
1277 func_append_quoted
()
1279 func_quote_for_eval
"${2}"
1280 eval "${1}+=\\ \$func_quote_for_eval_result"
1281 } # Extended-shell func_append_quoted implementation
1284 # func_arith arithmetic-term...
1287 func_arith_result
=$
(( $
* ))
1288 } # Extended-shell func_arith implementation
1292 # STRING may not start with a hyphen.
1295 func_len_result
=${#1}
1296 } # Extended-shell func_len implementation
1303 *.lo
) func_lo2o_result
=${1%.lo}.
${objext} ;;
1304 *) func_lo2o_result
=${1} ;;
1306 } # Extended-shell func_lo2o implementation
1309 # func_xform libobj-or-source
1312 func_xform_result
=${1%.*}.lo
1313 } # Extended-shell func_xform implementation
1316 # func_fatal_configuration arg...
1317 # Echo program name prefixed message to standard error, followed by
1318 # a configuration failure hint, and exit.
1319 func_fatal_configuration
()
1321 func_error
${1+"$@"}
1322 func_error
"See the $PACKAGE documentation for more information."
1323 func_fatal_error
"Fatal configuration error."
1328 # Display the configuration for all the tags in this script.
1331 re_begincf
='^# ### BEGIN LIBTOOL'
1332 re_endcf
='^# ### END LIBTOOL'
1334 # Default configuration.
1335 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1337 # Now print the configurations for the tags.
1338 for tagname
in $taglist; do
1339 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1346 # Display the features supported by this script.
1350 if test "$build_libtool_libs" = yes; then
1351 echo "enable shared libraries"
1353 echo "disable shared libraries"
1355 if test "$build_old_libs" = yes; then
1356 echo "enable static libraries"
1358 echo "disable static libraries"
1364 # func_enable_tag tagname
1365 # Verify that TAGNAME is valid, and either flag an error and exit, or
1366 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1373 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1374 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1375 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
1380 func_fatal_error
"invalid tag name: $tagname"
1384 # Don't test for the "default" C tag, as we know it's
1385 # there but not specially marked.
1389 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
1390 taglist
="$taglist $tagname"
1392 # Evaluate the configuration. Be careful to quote the path
1393 # and the sed script, to avoid splitting on whitespace, but
1394 # also don't use non-portable quotes within backquotes within
1395 # quotes we have to do it in 2 steps:
1396 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
1399 func_error
"ignoring unknown tag $tagname"
1405 # func_check_version_match
1406 # Ensure that we are using m4 macros, and libtool script from the same
1407 # release of libtool.
1408 func_check_version_match
()
1410 if test "$package_revision" != "$macro_revision"; then
1411 if test "$VERSION" != "$macro_version"; then
1412 if test -z "$macro_version"; then
1414 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1415 $progname: definition of this LT_INIT comes from an older release.
1416 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1417 $progname: and run autoconf again.
1421 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1422 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1423 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1424 $progname: and run autoconf again.
1429 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1430 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1431 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1432 $progname: of $PACKAGE $VERSION and run autoconf again.
1441 # Shorthand for --mode=foo, only valid as the first argument
1444 shift; set dummy
--mode clean
${1+"$@"}; shift
1446 compile|compil|compi|comp|com|co|c
)
1447 shift; set dummy
--mode compile
${1+"$@"}; shift
1449 execute|execut|execu|
exec|exe|ex|e
)
1450 shift; set dummy
--mode execute
${1+"$@"}; shift
1452 finish|finis|fini|fin|
fi|f
)
1453 shift; set dummy
--mode finish
${1+"$@"}; shift
1455 install|instal|insta|inst|ins|
in|i
)
1456 shift; set dummy
--mode install ${1+"$@"}; shift
1459 shift; set dummy
--mode link
${1+"$@"}; shift
1461 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u
)
1462 shift; set dummy
--mode uninstall
${1+"$@"}; shift
1472 opt_preserve_dup_deps
=false
1483 # Parse options once, thoroughly. This comes as soon as possible in the
1484 # script to make things like `--version' happen as quickly as we can.
1486 # this just eases exit handling
1487 while test $# -gt 0; do
1491 --debug|
-x) opt_debug
='set -x'
1492 func_echo
"enabling shell trace mode"
1495 --dry-run|
--dryrun|
-n)
1504 opt_dlopen
="${opt_dlopen+$opt_dlopen
1508 --preserve-dup-deps)
1509 opt_preserve_dup_deps
=:
1517 set dummy
--mode finish
${1+"$@"}; shift
1524 opt_help
=': help-all'
1527 test $# = 0 && func_missing_arg
$opt && break
1531 # Valid mode arguments:
1532 clean|compile|execute|finish|
install|link|relink|uninstall
) ;;
1534 # Catch anything else as an error
1535 *) func_error
"invalid argument for $opt"
1542 --no-silent|
--no-quiet)
1544 preserve_args
+=" $opt"
1548 preserve_args
+=" $opt"
1552 preserve_args
+=" $opt"
1557 preserve_args
+=" $opt"
1561 test $# = 0 && func_missing_arg
$opt && break
1564 preserve_args
+=" $opt $optarg"
1565 func_enable_tag
"$optarg"
1569 -\?|
-h) func_usage
;;
1570 --help) func_help
;;
1571 --version) func_version
;;
1573 # Separate optargs to long options:
1575 func_split_long_opt
"$opt"
1576 set dummy
"$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1580 # Separate non-argument short options:
1582 func_split_short_opt
"$opt"
1583 set dummy
"$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1588 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
1589 *) set dummy
"$opt" ${1+"$@"}; shift; break ;;
1595 # save first non-option argument
1596 if test "$#" -gt 0; then
1602 test "$opt_debug" = : || preserve_args
+=" --debug"
1605 *cygwin
* |
*mingw
* |
*pw32
* |
*cegcc
*)
1606 # don't eliminate duplications in $postdeps and $predeps
1607 opt_duplicate_compiler_generated_deps
=:
1610 opt_duplicate_compiler_generated_deps
=$opt_preserve_dup_deps
1615 # Sanity checks first:
1616 func_check_version_match
1618 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1619 func_fatal_configuration
"not configured to build any kind of library"
1623 eval std_shrext
=\"$shrext_cmds\"
1625 # Only execute mode is allowed to have -dlopen flags.
1626 if test -n "$opt_dlopen" && test "$opt_mode" != execute
; then
1627 func_error
"unrecognized option \`-dlopen'"
1632 # Change the help message to a mode-specific one.
1633 generic_help
="$help"
1634 help="Try \`$progname --help --mode=$opt_mode' for more information."
1638 # Bail if the options were screwed
1639 $exit_cmd $EXIT_FAILURE
1650 # True iff FILE is a libtool `.la' library or `.lo' object file.
1651 # This function is only a basic sanity check; it will hardly flush out
1652 # determined imposters.
1656 $SED -e 4q
"$1" 2>/dev
/null \
1657 |
$GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
1660 # func_lalib_unsafe_p file
1661 # True iff FILE is a libtool `.la' library or `.lo' object file.
1662 # This function implements the same check as func_lalib_p without
1663 # resorting to external programs. To this end, it redirects stdin and
1664 # closes it afterwards, without saving the original file descriptor.
1665 # As a safety measure, use it only where a negative result would be
1666 # fatal anyway. Works if `file' does not exist.
1667 func_lalib_unsafe_p
()
1670 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1671 for lalib_p_l
in 1 2 3 4
1674 case "$lalib_p_line" in
1675 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1680 test "$lalib_p" = yes
1683 # func_ltwrapper_script_p file
1684 # True iff FILE is a libtool wrapper script
1685 # This function is only a basic sanity check; it will hardly flush out
1686 # determined imposters.
1687 func_ltwrapper_script_p
()
1692 # func_ltwrapper_executable_p file
1693 # True iff FILE is a libtool wrapper executable
1694 # This function is only a basic sanity check; it will hardly flush out
1695 # determined imposters.
1696 func_ltwrapper_executable_p
()
1698 func_ltwrapper_exec_suffix
=
1701 *) func_ltwrapper_exec_suffix
=.exe
;;
1703 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev
/null
2>&1
1706 # func_ltwrapper_scriptname file
1707 # Assumes file is an ltwrapper_executable
1708 # uses $file to determine the appropriate filename for a
1709 # temporary ltwrapper_script.
1710 func_ltwrapper_scriptname
()
1712 func_dirname_and_basename
"$1" "" "."
1713 func_stripname
'' '.exe' "$func_basename_result"
1714 func_ltwrapper_scriptname_result
="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1717 # func_ltwrapper_p file
1718 # True iff FILE is a libtool wrapper script or wrapper executable
1719 # This function is only a basic sanity check; it will hardly flush out
1720 # determined imposters.
1723 func_ltwrapper_script_p
"$1" || func_ltwrapper_executable_p
"$1"
1727 # func_execute_cmds commands fail_cmd
1728 # Execute tilde-delimited COMMANDS.
1729 # If FAIL_CMD is given, eval that upon failure.
1730 # FAIL_CMD may read-access the current command in variable CMD!
1731 func_execute_cmds
()
1734 save_ifs
=$IFS; IFS
='~'
1738 func_show_eval
"$cmd" "${2-:}"
1745 # Source FILE, adding directory component if necessary.
1746 # Note that it is not necessary on cygwin/mingw to append a dot to
1747 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1748 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1749 # `FILE.' does not work on cygwin managed mounts.
1754 */* |
*\\*) .
"$1" ;;
1760 # func_resolve_sysroot PATH
1761 # Replace a leading = in PATH with a sysroot. Store the result into
1762 # func_resolve_sysroot_result
1763 func_resolve_sysroot
()
1765 func_resolve_sysroot_result
=$1
1766 case $func_resolve_sysroot_result in
1768 func_stripname
'=' '' "$func_resolve_sysroot_result"
1769 func_resolve_sysroot_result
=$lt_sysroot$func_stripname_result
1774 # func_replace_sysroot PATH
1775 # If PATH begins with the sysroot, replace it with = and
1776 # store the result into func_replace_sysroot_result.
1777 func_replace_sysroot
()
1779 case "$lt_sysroot:$1" in
1781 func_stripname
"$lt_sysroot" '' "$1"
1782 func_replace_sysroot_result
="=$func_stripname_result"
1785 # Including no sysroot.
1786 func_replace_sysroot_result
=$1
1791 # func_infer_tag arg
1792 # Infer tagged configuration to use if any are available and
1793 # if one wasn't chosen via the "--tag" command line option.
1794 # Only attempt this if the compiler in the base compile
1795 # command doesn't match the default compiler.
1796 # arg is usually of the form 'gcc ...'
1800 if test -n "$available_tags" && test -z "$tagname"; then
1803 func_append_quoted CC_quoted
"$arg"
1805 CC_expanded
=`func_echo_all $CC`
1806 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1808 # Blanks in the command may have been stripped by the calling shell,
1809 # but not from the CC environment variable when configure was run.
1810 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1811 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*) ;;
1812 # Blanks at the start of $base_compile will cause this to fail
1813 # if we don't check for them as well.
1815 for z
in $available_tags; do
1816 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1817 # Evaluate the configuration.
1818 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1821 # Double-quote args containing other shell metacharacters.
1822 func_append_quoted CC_quoted
"$arg"
1824 CC_expanded
=`func_echo_all $CC`
1825 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1827 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1828 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*)
1829 # The compiler in the base compile command matches
1830 # the one in the tagged configuration.
1831 # Assume this is the tagged configuration we want.
1838 # If $tagname still isn't set, then no tagged configuration
1839 # was found and let the user know that the "--tag" command
1840 # line option must be used.
1841 if test -z "$tagname"; then
1842 func_echo
"unable to infer tagged configuration"
1843 func_fatal_error
"specify a tag with \`--tag'"
1845 # func_verbose "using $tagname tagged configuration"
1854 # func_write_libtool_object output_name pic_name nonpic_name
1855 # Create a libtool object file (analogous to a ".la" file),
1856 # but don't create it if we're doing a dry run.
1857 func_write_libtool_object
()
1860 if test "$build_libtool_libs" = yes; then
1866 if test "$build_old_libs" = yes; then
1867 write_oldobj
=\'${3}\'
1873 cat >${write_libobj}T
<<EOF
1874 # $write_libobj - a libtool object file
1875 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1877 # Please DO NOT delete this file!
1878 # It is necessary for linking the library.
1880 # Name of the PIC object.
1881 pic_object=$write_lobj
1883 # Name of the non-PIC object
1884 non_pic_object=$write_oldobj
1887 $MV "${write_libobj}T" "${write_libobj}"
1892 ##################################################
1893 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1894 ##################################################
1896 # func_convert_core_file_wine_to_w32 ARG
1897 # Helper function used by file name conversion functions when $build is *nix,
1898 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1899 # correctly configured wine environment available, with the winepath program
1900 # in $build's $PATH.
1902 # ARG is the $build file name to be converted to w32 format.
1903 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1904 # be empty on error (or when ARG is empty)
1905 func_convert_core_file_wine_to_w32
()
1908 func_convert_core_file_wine_to_w32_result
="$1"
1909 if test -n "$1"; then
1910 # Unfortunately, winepath does not exit with a non-zero error code, so we
1911 # are forced to check the contents of stdout. On the other hand, if the
1912 # command is not found, the shell will set an exit code of 127 and print
1913 # *an error message* to stdout. So we must check for both error code of
1914 # zero AND non-empty stdout, which explains the odd construction:
1915 func_convert_core_file_wine_to_w32_tmp
=`winepath -w "$1" 2>/dev/null`
1916 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1917 func_convert_core_file_wine_to_w32_result
=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1918 $SED -e "$lt_sed_naive_backslashify"`
1920 func_convert_core_file_wine_to_w32_result
=
1924 # end: func_convert_core_file_wine_to_w32
1927 # func_convert_core_path_wine_to_w32 ARG
1928 # Helper function used by path conversion functions when $build is *nix, and
1929 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1930 # configured wine environment available, with the winepath program in $build's
1931 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1933 # ARG is path to be converted from $build format to win32.
1934 # Result is available in $func_convert_core_path_wine_to_w32_result.
1935 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1936 # are convertible, then the result may be empty.
1937 func_convert_core_path_wine_to_w32
()
1940 # unfortunately, winepath doesn't convert paths, only file names
1941 func_convert_core_path_wine_to_w32_result
=""
1942 if test -n "$1"; then
1945 for func_convert_core_path_wine_to_w32_f
in $1; do
1947 func_convert_core_file_wine_to_w32
"$func_convert_core_path_wine_to_w32_f"
1948 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1949 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1950 func_convert_core_path_wine_to_w32_result
="$func_convert_core_file_wine_to_w32_result"
1952 func_append func_convert_core_path_wine_to_w32_result
";$func_convert_core_file_wine_to_w32_result"
1959 # end: func_convert_core_path_wine_to_w32
1962 # func_cygpath ARGS...
1963 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1964 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1965 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1966 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1967 # file name or path is assumed to be in w32 format, as previously converted
1968 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1969 # or path in func_cygpath_result (input file name or path is assumed to be in
1970 # Cygwin format). Returns an empty string on error.
1972 # ARGS are passed to cygpath, with the last one being the file name or path to
1975 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1976 # environment variable; do not put it in $PATH.
1980 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1981 func_cygpath_result
=`$LT_CYGPATH "$@" 2>/dev/null`
1982 if test "$?" -ne 0; then
1983 # on failure, ensure result is empty
1984 func_cygpath_result
=
1987 func_cygpath_result
=
1988 func_error
"LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1994 # func_convert_core_msys_to_w32 ARG
1995 # Convert file name or path ARG from MSYS format to w32 format. Return
1996 # result in func_convert_core_msys_to_w32_result.
1997 func_convert_core_msys_to_w32
()
2000 # awkward: cmd appends spaces to result
2001 func_convert_core_msys_to_w32_result
=`( cmd //c echo "$1" ) 2>/dev/null |
2002 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2004 #end: func_convert_core_msys_to_w32
2007 # func_convert_file_check ARG1 ARG2
2008 # Verify that ARG1 (a file name in $build format) was converted to $host
2009 # format in ARG2. Otherwise, emit an error message, but continue (resetting
2010 # func_to_host_file_result to ARG1).
2011 func_convert_file_check
()
2014 if test -z "$2" && test -n "$1" ; then
2015 func_error
"Could not determine host file name corresponding to"
2017 func_error
"Continuing, but uninstalled executables may not work."
2019 func_to_host_file_result
="$1"
2022 # end func_convert_file_check
2025 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2026 # Verify that FROM_PATH (a path in $build format) was converted to $host
2027 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2028 # func_to_host_file_result to a simplistic fallback value (see below).
2029 func_convert_path_check
()
2032 if test -z "$4" && test -n "$3"; then
2033 func_error
"Could not determine the host path corresponding to"
2035 func_error
"Continuing, but uninstalled executables may not work."
2036 # Fallback. This is a deliberately simplistic "conversion" and
2037 # should not be "improved". See libtool.info.
2038 if test "x$1" != "x$2"; then
2039 lt_replace_pathsep_chars
="s|$1|$2|g"
2040 func_to_host_path_result
=`echo "$3" |
2041 $SED -e "$lt_replace_pathsep_chars"`
2043 func_to_host_path_result
="$3"
2047 # end func_convert_path_check
2050 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2051 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2052 # and appending REPL if ORIG matches BACKPAT.
2053 func_convert_path_front_back_pathsep
()
2057 $1 ) func_to_host_path_result
="$3$func_to_host_path_result"
2061 $2 ) func_to_host_path_result
+="$3"
2065 # end func_convert_path_front_back_pathsep
2068 ##################################################
2069 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2070 ##################################################
2071 # invoked via `$to_host_file_cmd ARG'
2073 # In each case, ARG is the path to be converted from $build to $host format.
2074 # Result will be available in $func_to_host_file_result.
2077 # func_to_host_file ARG
2078 # Converts the file name ARG from $build format to $host format. Return result
2079 # in func_to_host_file_result.
2080 func_to_host_file
()
2083 $to_host_file_cmd "$1"
2085 # end func_to_host_file
2088 # func_to_tool_file ARG LAZY
2089 # converts the file name ARG from $build format to toolchain format. Return
2090 # result in func_to_tool_file_result. If the conversion in use is listed
2091 # in (the comma separated) LAZY, no conversion takes place.
2092 func_to_tool_file
()
2096 *,"$to_tool_file_cmd",*)
2097 func_to_tool_file_result
=$1
2100 $to_tool_file_cmd "$1"
2101 func_to_tool_file_result
=$func_to_host_file_result
2105 # end func_to_tool_file
2108 # func_convert_file_noop ARG
2109 # Copy ARG to func_to_host_file_result.
2110 func_convert_file_noop
()
2112 func_to_host_file_result
="$1"
2114 # end func_convert_file_noop
2117 # func_convert_file_msys_to_w32 ARG
2118 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2119 # conversion to w32 is not available inside the cwrapper. Returns result in
2120 # func_to_host_file_result.
2121 func_convert_file_msys_to_w32
()
2124 func_to_host_file_result
="$1"
2125 if test -n "$1"; then
2126 func_convert_core_msys_to_w32
"$1"
2127 func_to_host_file_result
="$func_convert_core_msys_to_w32_result"
2129 func_convert_file_check
"$1" "$func_to_host_file_result"
2131 # end func_convert_file_msys_to_w32
2134 # func_convert_file_cygwin_to_w32 ARG
2135 # Convert file name ARG from Cygwin to w32 format. Returns result in
2136 # func_to_host_file_result.
2137 func_convert_file_cygwin_to_w32
()
2140 func_to_host_file_result
="$1"
2141 if test -n "$1"; then
2142 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2143 # LT_CYGPATH in this case.
2144 func_to_host_file_result
=`cygpath -m "$1"`
2146 func_convert_file_check
"$1" "$func_to_host_file_result"
2148 # end func_convert_file_cygwin_to_w32
2151 # func_convert_file_nix_to_w32 ARG
2152 # Convert file name ARG from *nix to w32 format. Requires a wine environment
2153 # and a working winepath. Returns result in func_to_host_file_result.
2154 func_convert_file_nix_to_w32
()
2157 func_to_host_file_result
="$1"
2158 if test -n "$1"; then
2159 func_convert_core_file_wine_to_w32
"$1"
2160 func_to_host_file_result
="$func_convert_core_file_wine_to_w32_result"
2162 func_convert_file_check
"$1" "$func_to_host_file_result"
2164 # end func_convert_file_nix_to_w32
2167 # func_convert_file_msys_to_cygwin ARG
2168 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2169 # Returns result in func_to_host_file_result.
2170 func_convert_file_msys_to_cygwin
()
2173 func_to_host_file_result
="$1"
2174 if test -n "$1"; then
2175 func_convert_core_msys_to_w32
"$1"
2176 func_cygpath
-u "$func_convert_core_msys_to_w32_result"
2177 func_to_host_file_result
="$func_cygpath_result"
2179 func_convert_file_check
"$1" "$func_to_host_file_result"
2181 # end func_convert_file_msys_to_cygwin
2184 # func_convert_file_nix_to_cygwin ARG
2185 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2186 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2187 # in func_to_host_file_result.
2188 func_convert_file_nix_to_cygwin
()
2191 func_to_host_file_result
="$1"
2192 if test -n "$1"; then
2193 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2194 func_convert_core_file_wine_to_w32
"$1"
2195 func_cygpath
-u "$func_convert_core_file_wine_to_w32_result"
2196 func_to_host_file_result
="$func_cygpath_result"
2198 func_convert_file_check
"$1" "$func_to_host_file_result"
2200 # end func_convert_file_nix_to_cygwin
2203 #############################################
2204 # $build to $host PATH CONVERSION FUNCTIONS #
2205 #############################################
2206 # invoked via `$to_host_path_cmd ARG'
2208 # In each case, ARG is the path to be converted from $build to $host format.
2209 # The result will be available in $func_to_host_path_result.
2211 # Path separators are also converted from $build format to $host format. If
2212 # ARG begins or ends with a path separator character, it is preserved (but
2213 # converted to $host format) on output.
2215 # All path conversion functions are named using the following convention:
2216 # file name conversion function : func_convert_file_X_to_Y ()
2217 # path conversion function : func_convert_path_X_to_Y ()
2218 # where, for any given $build/$host combination the 'X_to_Y' value is the
2219 # same. If conversion functions are added for new $build/$host combinations,
2220 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
2224 # func_init_to_host_path_cmd
2225 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
2226 # appropriate value, based on the value of $to_host_file_cmd.
2228 func_init_to_host_path_cmd
()
2231 if test -z "$to_host_path_cmd"; then
2232 func_stripname
'func_convert_file_' '' "$to_host_file_cmd"
2233 to_host_path_cmd
="func_convert_path_${func_stripname_result}"
2238 # func_to_host_path ARG
2239 # Converts the path ARG from $build format to $host format. Return result
2240 # in func_to_host_path_result.
2241 func_to_host_path
()
2244 func_init_to_host_path_cmd
2245 $to_host_path_cmd "$1"
2247 # end func_to_host_path
2250 # func_convert_path_noop ARG
2251 # Copy ARG to func_to_host_path_result.
2252 func_convert_path_noop
()
2254 func_to_host_path_result
="$1"
2256 # end func_convert_path_noop
2259 # func_convert_path_msys_to_w32 ARG
2260 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2261 # conversion to w32 is not available inside the cwrapper. Returns result in
2262 # func_to_host_path_result.
2263 func_convert_path_msys_to_w32
()
2266 func_to_host_path_result
="$1"
2267 if test -n "$1"; then
2268 # Remove leading and trailing path separator characters from ARG. MSYS
2269 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2270 # and winepath ignores them completely.
2271 func_stripname
: : "$1"
2272 func_to_host_path_tmp1
=$func_stripname_result
2273 func_convert_core_msys_to_w32
"$func_to_host_path_tmp1"
2274 func_to_host_path_result
="$func_convert_core_msys_to_w32_result"
2275 func_convert_path_check
: ";" \
2276 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2277 func_convert_path_front_back_pathsep
":*" "*:" ";" "$1"
2280 # end func_convert_path_msys_to_w32
2283 # func_convert_path_cygwin_to_w32 ARG
2284 # Convert path ARG from Cygwin to w32 format. Returns result in
2285 # func_to_host_file_result.
2286 func_convert_path_cygwin_to_w32
()
2289 func_to_host_path_result
="$1"
2290 if test -n "$1"; then
2291 # See func_convert_path_msys_to_w32:
2292 func_stripname
: : "$1"
2293 func_to_host_path_tmp1
=$func_stripname_result
2294 func_to_host_path_result
=`cygpath -m -p "$func_to_host_path_tmp1"`
2295 func_convert_path_check
: ";" \
2296 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2297 func_convert_path_front_back_pathsep
":*" "*:" ";" "$1"
2300 # end func_convert_path_cygwin_to_w32
2303 # func_convert_path_nix_to_w32 ARG
2304 # Convert path ARG from *nix to w32 format. Requires a wine environment and
2305 # a working winepath. Returns result in func_to_host_file_result.
2306 func_convert_path_nix_to_w32
()
2309 func_to_host_path_result
="$1"
2310 if test -n "$1"; then
2311 # See func_convert_path_msys_to_w32:
2312 func_stripname
: : "$1"
2313 func_to_host_path_tmp1
=$func_stripname_result
2314 func_convert_core_path_wine_to_w32
"$func_to_host_path_tmp1"
2315 func_to_host_path_result
="$func_convert_core_path_wine_to_w32_result"
2316 func_convert_path_check
: ";" \
2317 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2318 func_convert_path_front_back_pathsep
":*" "*:" ";" "$1"
2321 # end func_convert_path_nix_to_w32
2324 # func_convert_path_msys_to_cygwin ARG
2325 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2326 # Returns result in func_to_host_file_result.
2327 func_convert_path_msys_to_cygwin
()
2330 func_to_host_path_result
="$1"
2331 if test -n "$1"; then
2332 # See func_convert_path_msys_to_w32:
2333 func_stripname
: : "$1"
2334 func_to_host_path_tmp1
=$func_stripname_result
2335 func_convert_core_msys_to_w32
"$func_to_host_path_tmp1"
2336 func_cygpath
-u -p "$func_convert_core_msys_to_w32_result"
2337 func_to_host_path_result
="$func_cygpath_result"
2338 func_convert_path_check
: : \
2339 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2340 func_convert_path_front_back_pathsep
":*" "*:" : "$1"
2343 # end func_convert_path_msys_to_cygwin
2346 # func_convert_path_nix_to_cygwin ARG
2347 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2348 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2349 # func_to_host_file_result.
2350 func_convert_path_nix_to_cygwin
()
2353 func_to_host_path_result
="$1"
2354 if test -n "$1"; then
2355 # Remove leading and trailing path separator characters from
2356 # ARG. msys behavior is inconsistent here, cygpath turns them
2357 # into '.;' and ';.', and winepath ignores them completely.
2358 func_stripname
: : "$1"
2359 func_to_host_path_tmp1
=$func_stripname_result
2360 func_convert_core_path_wine_to_w32
"$func_to_host_path_tmp1"
2361 func_cygpath
-u -p "$func_convert_core_path_wine_to_w32_result"
2362 func_to_host_path_result
="$func_cygpath_result"
2363 func_convert_path_check
: : \
2364 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2365 func_convert_path_front_back_pathsep
":*" "*:" : "$1"
2368 # end func_convert_path_nix_to_cygwin
2371 # func_mode_compile arg...
2372 func_mode_compile
()
2375 # Get the compilation command and the source file.
2377 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
2389 # do not "continue". Instead, add this to base_compile
2401 # Accept any command-line options.
2404 test -n "$libobj" && \
2405 func_fatal_error
"you cannot specify \`-o' more than once"
2410 -pie |
-fpie |
-fPIE)
2415 -shared |
-static |
-prefer-pic |
-prefer-non-pic)
2426 arg_mode
=arg
# the next one goes into the "base_compile" arg list
2427 continue # The current "srcfile" will either be retained or
2428 ;; # replaced later. I would guess that would be a bug.
2431 func_stripname
'-Wc,' '' "$arg"
2432 args
=$func_stripname_result
2434 save_ifs
="$IFS"; IFS
=','
2435 for arg
in $args; do
2437 func_append_quoted lastarg
"$arg"
2440 func_stripname
' ' '' "$lastarg"
2441 lastarg
=$func_stripname_result
2443 # Add the arguments to base_compile.
2444 base_compile
+=" $lastarg"
2449 # Accept the current argument as the source file.
2450 # The previous "srcfile" becomes the current argument.
2457 esac # case $arg_mode
2459 # Aesthetically quote the previous argument.
2460 func_append_quoted base_compile
"$lastarg"
2465 func_fatal_error
"you must specify an argument for -Xcompile"
2468 func_fatal_error
"you must specify a target with \`-o'"
2471 # Get the name of the library object.
2472 test -z "$libobj" && {
2473 func_basename
"$srcfile"
2474 libobj
="$func_basename_result"
2479 # Recognize several different file suffixes.
2480 # If the user specifies -o file.o, it is replaced with file.lo
2483 *.ada |
*.adb |
*.ads |
*.asm | \
2484 *.c
++ |
*.cc |
*.ii |
*.class |
*.cpp |
*.cxx | \
2485 *.
[fF
][09]? |
*.
for |
*.java |
*.obj |
*.sx |
*.cu |
*.cup
)
2486 func_xform
"$libobj"
2487 libobj
=$func_xform_result
2492 *.lo
) func_lo2o
"$libobj"; obj
=$func_lo2o_result ;;
2494 func_fatal_error
"cannot determine name of library object from \`$libobj'"
2498 func_infer_tag
$base_compile
2500 for arg
in $later; do
2503 test "$build_libtool_libs" != yes && \
2504 func_fatal_configuration
"can not build a shared library"
2510 build_libtool_libs
=no
2527 func_quote_for_eval
"$libobj"
2528 test "X$libobj" != "X$func_quote_for_eval_result" \
2529 && $ECHO "X$libobj" |
$GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2530 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
2531 func_dirname_and_basename
"$obj" "/" ""
2532 objname
="$func_basename_result"
2533 xdir
="$func_dirname_result"
2534 lobj
=${xdir}$objdir/$objname
2536 test -z "$base_compile" && \
2537 func_fatal_help
"you must specify a compilation command"
2539 # Delete any leftover library objects.
2540 if test "$build_old_libs" = yes; then
2541 removelist
="$obj $lobj $libobj ${libobj}T"
2543 removelist
="$lobj $libobj ${libobj}T"
2546 # On Cygwin there's no "real" PIC flag so we must build both object types
2548 cygwin
* | mingw
* | pw32
* | os2
* | cegcc
*)
2552 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
2553 # non-PIC code in shared libraries is not supported
2557 # Calculate the filename of the output object if compiler does
2558 # not support -o with -c
2559 if test "$compiler_c_o" = no
; then
2560 output_obj
=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.
${objext}
2561 lockfile
="$output_obj.lock"
2568 # Lock this critical section if it is needed
2569 # We use this script file to make the link, it avoids creating a new file
2570 if test "$need_locks" = yes; then
2571 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
2572 func_echo
"Waiting for $lockfile to be removed"
2575 elif test "$need_locks" = warn
; then
2576 if test -f "$lockfile"; then
2578 *** ERROR, $lockfile exists and contains:
2579 `cat $lockfile 2>/dev/null`
2581 This indicates that another process is trying to use the same
2582 temporary object file, and libtool could not work around it because
2583 your compiler does not support \`-c' and \`-o' together. If you
2584 repeat this compilation, it may succeed, by chance, but you had better
2585 avoid parallel builds (make -j) in this platform, or get a better
2588 $opt_dry_run ||
$RM $removelist
2591 removelist
+=" $output_obj"
2592 $ECHO "$srcfile" > "$lockfile"
2595 $opt_dry_run ||
$RM $removelist
2596 removelist
+=" $lockfile"
2597 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2599 func_to_tool_file
"$srcfile" func_convert_file_msys_to_w32
2600 srcfile
=$func_to_tool_file_result
2601 func_quote_for_eval
"$srcfile"
2602 qsrcfile
=$func_quote_for_eval_result
2604 # Only build a PIC object if we are building libtool libraries.
2605 if test "$build_libtool_libs" = yes; then
2606 # Without this assignment, base_compile gets emptied.
2607 fbsd_hideous_sh_bug
=$base_compile
2609 if test "$pic_mode" != no
; then
2610 command="$base_compile $qsrcfile $pic_flag"
2612 # Don't build PIC code
2613 command="$base_compile $qsrcfile"
2616 func_mkdir_p
"$xdir$objdir"
2618 if test -z "$output_obj"; then
2619 # Place PIC objects in $objdir
2620 command+=" -o $lobj"
2623 func_show_eval_locale
"$command" \
2624 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2626 if test "$need_locks" = warn
&&
2627 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2629 *** ERROR, $lockfile contains:
2630 `cat $lockfile 2>/dev/null`
2632 but it should contain:
2635 This indicates that another process is trying to use the same
2636 temporary object file, and libtool could not work around it because
2637 your compiler does not support \`-c' and \`-o' together. If you
2638 repeat this compilation, it may succeed, by chance, but you had better
2639 avoid parallel builds (make -j) in this platform, or get a better
2642 $opt_dry_run ||
$RM $removelist
2646 # Just move the object if needed, then go on to compile the next one
2647 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2648 func_show_eval
'$MV "$output_obj" "$lobj"' \
2649 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2652 # Allow error messages only from the first compilation.
2653 if test "$suppress_opt" = yes; then
2654 suppress_output
=' >/dev/null 2>&1'
2658 # Only build a position-dependent object if we build old libraries.
2659 if test "$build_old_libs" = yes; then
2660 if test "$pic_mode" != yes; then
2661 # Don't build PIC code
2662 command="$base_compile $qsrcfile$pie_flag"
2664 command="$base_compile $qsrcfile $pic_flag"
2666 if test "$compiler_c_o" = yes; then
2670 # Suppress compiler output if we already did a PIC compilation.
2671 command+="$suppress_output"
2672 func_show_eval_locale
"$command" \
2673 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2675 if test "$need_locks" = warn
&&
2676 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2678 *** ERROR, $lockfile contains:
2679 `cat $lockfile 2>/dev/null`
2681 but it should contain:
2684 This indicates that another process is trying to use the same
2685 temporary object file, and libtool could not work around it because
2686 your compiler does not support \`-c' and \`-o' together. If you
2687 repeat this compilation, it may succeed, by chance, but you had better
2688 avoid parallel builds (make -j) in this platform, or get a better
2691 $opt_dry_run ||
$RM $removelist
2695 # Just move the object if needed
2696 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2697 func_show_eval
'$MV "$output_obj" "$obj"' \
2698 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2703 func_write_libtool_object
"$libobj" "$objdir/$objname" "$objname"
2705 # Unlock the critical section if it was locked
2706 if test "$need_locks" != no
; then
2707 removelist
=$lockfile
2716 test "$opt_mode" = compile
&& func_mode_compile
${1+"$@"}
2721 # We need to display help for each of the modes.
2724 # Generic help is extracted from the usage comments
2725 # at the start of this file.
2731 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2733 Remove files from the build directory.
2735 RM is the name of the program to use to delete files associated with each FILE
2736 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2739 If FILE is a libtool library, object or program, all the files associated
2740 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2745 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2747 Compile a source file into a libtool library object.
2749 This mode accepts the following additional options:
2751 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2752 -no-suppress do not suppress compiler output for multiple passes
2753 -prefer-pic try to build PIC objects only
2754 -prefer-non-pic try to build non-PIC objects only
2755 -shared do not build a \`.o' file suitable for static linking
2756 -static only build a \`.o' file suitable for static linking
2757 -Wc,FLAG pass FLAG directly to the compiler
2759 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2760 from the given SOURCEFILE.
2762 The output file name is determined by removing the directory component from
2763 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2764 library object suffix, \`.lo'."
2769 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2771 Automatically set library path, then run a program.
2773 This mode accepts the following additional options:
2775 -dlopen FILE add the directory containing FILE to the library path
2777 This mode sets the library path environment variable according to \`-dlopen'
2780 If any of the ARGS are libtool executable wrappers, then they are translated
2781 into their corresponding uninstalled binary, and any of their required library
2782 directories are added to the library path.
2784 Then, COMMAND is executed, with ARGS as arguments."
2789 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2791 Complete the installation of libtool libraries.
2793 Each LIBDIR is a directory that contains libtool libraries.
2795 The commands that this mode executes may require superuser privileges. Use
2796 the \`--dry-run' option if you just want to see what would be executed."
2801 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2803 Install executables or libraries.
2805 INSTALL-COMMAND is the installation command. The first component should be
2806 either the \`install' or \`cp' program.
2808 The following components of INSTALL-COMMAND are treated specially:
2810 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2812 The rest of the components are interpreted as arguments to that command (only
2813 BSD-compatible install options are recognized)."
2818 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2820 Link object files or libraries together to form another library, or to
2821 create an executable program.
2823 LINK-COMMAND is a command using the C compiler that you would use to create
2824 a program from several object files.
2826 The following components of LINK-COMMAND are treated specially:
2828 -all-static do not do any dynamic linking at all
2829 -avoid-version do not add a version suffix if possible
2830 -bindir BINDIR specify path to binaries directory (for systems where
2831 libraries must be found in the PATH setting at runtime)
2832 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2833 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2834 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2835 -export-symbols SYMFILE
2836 try to export only the symbols listed in SYMFILE
2837 -export-symbols-regex REGEX
2838 try to export only the symbols matching REGEX
2839 -LLIBDIR search LIBDIR for required installed libraries
2840 -lNAME OUTPUT-FILE requires the installed library libNAME
2841 -module build a library that can dlopened
2842 -no-fast-install disable the fast-install mode
2843 -no-install link a not-installable executable
2844 -no-undefined declare that a library does not refer to external symbols
2845 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2846 -objectlist FILE Use a list of object files found in FILE to specify objects
2847 -precious-files-regex REGEX
2848 don't remove output files matching REGEX
2849 -release RELEASE specify package release information
2850 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2851 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2852 -shared only do dynamic linking of libtool libraries
2853 -shrext SUFFIX override the standard shared library file extension
2854 -static do not do any dynamic linking of uninstalled libtool libraries
2855 -static-libtool-libs
2856 do not do any dynamic linking of libtool libraries
2857 -version-info CURRENT[:REVISION[:AGE]]
2858 specify library version info [each variable defaults to 0]
2859 -weak LIBNAME declare that the target provides the LIBNAME interface
2861 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2863 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2864 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2866 All other options (arguments beginning with \`-') are ignored.
2868 Every other argument is treated as a filename. Files ending in \`.la' are
2869 treated as uninstalled libtool libraries, other files are standard or library
2872 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2873 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2874 required, except when creating a convenience library.
2876 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2877 using \`ar' and \`ranlib', or on Windows using \`lib'.
2879 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2880 is created, otherwise an executable program is created."
2885 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2887 Remove libraries from an installation directory.
2889 RM is the name of the program to use to delete files associated with each FILE
2890 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2893 If FILE is a libtool library, all the files associated with it are deleted.
2894 Otherwise, only FILE itself is deleted using RM."
2898 func_fatal_help
"invalid operation mode \`$opt_mode'"
2903 $ECHO "Try \`$progname --help' for more information about other modes."
2906 # Now that we've collected a possible --mode arg, show help if necessary
2908 if test "$opt_help" = :; then
2913 for opt_mode
in compile link execute
install finish uninstall clean
; do
2916 } |
sed -n '1p; 2,$s/^Usage:/ or: /p'
2919 for opt_mode
in compile link execute
install finish uninstall clean
; do
2925 /^When reporting/,/^Report/{
2930 /information about other modes/d
2931 /more detailed .*MODE/d
2932 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2938 # func_mode_execute arg...
2939 func_mode_execute
()
2942 # The first argument is the command name.
2945 func_fatal_help
"you must specify a COMMAND"
2947 # Handle -dlopen flags immediately.
2948 for file in $opt_dlopen; do
2950 || func_fatal_help
"\`$file' is not a file"
2955 func_resolve_sysroot
"$file"
2956 file=$func_resolve_sysroot_result
2958 # Check to see that this really is a libtool archive.
2959 func_lalib_unsafe_p
"$file" \
2960 || func_fatal_help
"\`$lib' is not a valid libtool archive"
2962 # Read the libtool library.
2967 # Skip this library if it cannot be dlopened.
2968 if test -z "$dlname"; then
2969 # Warn if it was a shared library.
2970 test -n "$library_names" && \
2971 func_warning
"\`$file' was not linked with \`-export-dynamic'"
2975 func_dirname
"$file" "" "."
2976 dir
="$func_dirname_result"
2978 if test -f "$dir/$objdir/$dlname"; then
2981 if test ! -f "$dir/$dlname"; then
2982 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2988 # Just add the directory containing the .lo file.
2989 func_dirname
"$file" "" "."
2990 dir
="$func_dirname_result"
2994 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
2999 # Get the absolute pathname.
3000 absdir
=`cd "$dir" && pwd`
3001 test -n "$absdir" && dir
="$absdir"
3003 # Now add the directory to shlibpath_var.
3004 if eval "test -z \"\$$shlibpath_var\""; then
3005 eval "$shlibpath_var=\"\$dir\""
3007 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3011 # This variable tells wrapper scripts just to set shlibpath_var
3012 # rather than running their programs.
3013 libtool_execute_magic
="$magic"
3015 # Check if any of the arguments is a wrapper script.
3020 -* |
*.la |
*.lo
) ;;
3022 # Do a test to see if this is really a libtool program.
3023 if func_ltwrapper_script_p
"$file"; then
3025 # Transform arg to wrapped name.
3026 file="$progdir/$program"
3027 elif func_ltwrapper_executable_p
"$file"; then
3028 func_ltwrapper_scriptname
"$file"
3029 func_source
"$func_ltwrapper_scriptname_result"
3030 # Transform arg to wrapped name.
3031 file="$progdir/$program"
3035 # Quote arguments (to preserve shell metacharacters).
3036 func_append_quoted args
"$file"
3039 if test "X$opt_dry_run" = Xfalse
; then
3040 if test -n "$shlibpath_var"; then
3041 # Export the shlibpath_var.
3042 eval "export $shlibpath_var"
3045 # Restore saved environment variables
3046 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3048 eval "if test \"\${save_$lt_var+set}\" = set; then
3049 $lt_var=\$save_$lt_var; export $lt_var
3055 # Now prepare to actually exec the command.
3056 exec_cmd
="\$cmd$args"
3058 # Display what would be done.
3059 if test -n "$shlibpath_var"; then
3060 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3061 echo "export $shlibpath_var"
3068 test "$opt_mode" = execute
&& func_mode_execute
${1+"$@"}
3071 # func_mode_finish arg...
3079 for opt
in "$nonopt" ${1+"$@"}
3081 if test -d "$opt"; then
3084 elif test -f "$opt"; then
3085 if func_lalib_unsafe_p
"$opt"; then
3088 func_warning
"\`$opt' is not a valid libtool archive"
3092 func_fatal_error
"invalid argument \`$opt'"
3096 if test -n "$libs"; then
3097 if test -n "$lt_sysroot"; then
3098 sysroot_regex
=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3099 sysroot_cmd
="s/\([ ']\)$sysroot_regex/\1/g;"
3104 # Remove sysroot references
3105 if $opt_dry_run; then
3106 for lib
in $libs; do
3107 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3110 tmpdir
=`func_mktempdir`
3111 for lib
in $libs; do
3112 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3114 mv -f $tmpdir/tmp-la
$lib
3120 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3121 for libdir
in $libdirs; do
3122 if test -n "$finish_cmds"; then
3123 # Do each command in the finish commands.
3124 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
3127 if test -n "$finish_eval"; then
3128 # Do the single finish_eval.
3129 eval cmds
=\"$finish_eval\"
3130 $opt_dry_run ||
eval "$cmds" || admincmds
+="
3136 # Exit here if they wanted silent mode.
3137 $opt_silent && exit $EXIT_SUCCESS
3139 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3140 echo "----------------------------------------------------------------------"
3141 echo "Libraries have been installed in:"
3142 for libdir
in $libdirs; do
3146 echo "If you ever happen to want to link against installed libraries"
3147 echo "in a given directory, LIBDIR, you must either use libtool, and"
3148 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3149 echo "flag during linking and do at least one of the following:"
3150 if test -n "$shlibpath_var"; then
3151 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3152 echo " during execution"
3154 if test -n "$runpath_var"; then
3155 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3156 echo " during linking"
3158 if test -n "$hardcode_libdir_flag_spec"; then
3160 eval flag
=\"$hardcode_libdir_flag_spec\"
3162 $ECHO " - use the \`$flag' linker flag"
3164 if test -n "$admincmds"; then
3165 $ECHO " - have your system administrator run these commands:$admincmds"
3167 if test -f /etc
/ld.so.conf
; then
3168 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3172 echo "See any operating system documentation about shared libraries for"
3174 solaris2.
[6789]|solaris2.1
[0-9])
3175 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3179 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3182 echo "----------------------------------------------------------------------"
3187 test "$opt_mode" = finish
&& func_mode_finish
${1+"$@"}
3190 # func_mode_install arg...
3191 func_mode_install
()
3194 # There may be an optional sh(1) argument at the beginning of
3195 # install_prog (especially on Windows NT).
3196 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
3197 # Allow the use of GNU shtool's install command.
3198 case $nonopt in *shtool
*) :;; *) false
;; esac; then
3199 # Aesthetically quote it.
3200 func_quote_for_eval
"$nonopt"
3201 install_prog
="$func_quote_for_eval_result "
3209 # The real first argument should be the name of the installation program.
3210 # Aesthetically quote it.
3211 func_quote_for_eval
"$arg"
3212 install_prog
+="$func_quote_for_eval_result"
3213 install_shared_prog
=$install_prog
3214 case " $install_prog " in
3215 *[\\\
/]cp\
*) install_cp
=: ;;
3216 *) install_cp
=false
;;
3219 # We need to accept at least all the BSD install flags.
3231 if test -n "$dest"; then
3240 if $install_cp; then :; else
3254 # If the previous option needed an argument, then skip it.
3255 if test -n "$prev"; then
3256 if test "x$prev" = x-m
&& test -n "$install_override_mode"; then
3257 arg2
=$install_override_mode
3268 # Aesthetically quote the argument.
3269 func_quote_for_eval
"$arg"
3270 install_prog
+=" $func_quote_for_eval_result"
3271 if test -n "$arg2"; then
3272 func_quote_for_eval
"$arg2"
3274 install_shared_prog
+=" $func_quote_for_eval_result"
3277 test -z "$install_prog" && \
3278 func_fatal_help
"you must specify an install program"
3280 test -n "$prev" && \
3281 func_fatal_help
"the \`$prev' option requires an argument"
3283 if test -n "$install_override_mode" && $no_mode; then
3284 if $install_cp; then :; else
3285 func_quote_for_eval
"$install_override_mode"
3286 install_shared_prog
+=" -m $func_quote_for_eval_result"
3290 if test -z "$files"; then
3291 if test -z "$dest"; then
3292 func_fatal_help
"no file or destination specified"
3294 func_fatal_help
"you must specify a destination"
3298 # Strip any trailing slash from the destination.
3299 func_stripname
'' '/' "$dest"
3300 dest
=$func_stripname_result
3302 # Check to see that the destination is a directory.
3303 test -d "$dest" && isdir
=yes
3304 if test "$isdir" = yes; then
3308 func_dirname_and_basename
"$dest" "" "."
3309 destdir
="$func_dirname_result"
3310 destname
="$func_basename_result"
3312 # Not a directory, so check to see that there is only one file specified.
3313 set dummy
$files; shift
3314 test "$#" -gt 1 && \
3315 func_fatal_help
"\`$dest' is not a directory"
3318 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
3320 for file in $files; do
3324 func_fatal_help
"\`$destdir' must be an absolute directory name"
3331 # This variable tells wrapper scripts just to set variables rather
3332 # than running their programs.
3333 libtool_install_magic
="$magic"
3338 for file in $files; do
3340 # Do each installation.
3343 # Do the static libraries later.
3344 staticlibs
+=" $file"
3348 func_resolve_sysroot
"$file"
3349 file=$func_resolve_sysroot_result
3351 # Check to see that this really is a libtool archive.
3352 func_lalib_unsafe_p
"$file" \
3353 || func_fatal_help
"\`$file' is not a valid libtool archive"
3360 # Add the libdir to current_libdirs if it is the destination.
3361 if test "X$destdir" = "X$libdir"; then
3362 case "$current_libdirs " in
3364 *) current_libdirs
+=" $libdir" ;;
3367 # Note the libdir as a future libdir.
3368 case "$future_libdirs " in
3370 *) future_libdirs
+=" $libdir" ;;
3374 func_dirname
"$file" "/" ""
3375 dir
="$func_dirname_result"
3378 if test -n "$relink_command"; then
3379 # Strip any trailing slash from the destination.
3380 func_stripname
'' '/' "$libdir"
3381 destlibdir
=$func_stripname_result
3383 func_stripname
'' '/' "$destdir"
3384 s_destdir
=$func_stripname_result
3386 # Determine the prefix the user has applied to our future dir.
3387 inst_prefix_dir
=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
3389 # Don't allow the user to place us outside of our expected
3390 # location b/c this prevents finding dependent libraries that
3391 # are installed to the same prefix.
3392 # At present, this check doesn't affect windows .dll's that
3393 # are installed into $libdir/../bin (currently, that works fine)
3394 # but it's something to keep an eye on.
3395 test "$inst_prefix_dir" = "$destdir" && \
3396 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
3398 if test -n "$inst_prefix_dir"; then
3399 # Stick the inst_prefix_dir data into the link command.
3400 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3402 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3405 relink_command
=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/lib[^[:space:]]*%%"`
3406 relink_command
=`$ECHO "$relink_command" | $SED "s%-L[[:space:]]*/usr/lib[^[:space:]]*%%"`
3408 func_warning
"relinking \`$file'"
3409 func_show_eval
"$relink_command" \
3410 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3413 # See the names of the shared library.
3414 set dummy
$library_names; shift
3415 if test -n "$1"; then
3420 test -n "$relink_command" && srcname
="$realname"T
3422 # Install the shared library and build the symlinks.
3423 func_show_eval
"$install_shared_prog $dir/$srcname $destdir/$realname" \
3427 cygwin
* | mingw
* | pw32
* | cegcc
*)
3435 if test -n "$tstripme" && test -n "$striplib"; then
3436 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
3439 if test "$#" -gt 0; then
3440 # Delete the old symlinks, and create new ones.
3441 # Try `ln -sf' first, because the `ln' binary might depend on
3442 # the symlink we replace! Solaris /bin/ln does not understand -f,
3443 # so we also need to try rm && ln -s.
3446 test "$linkname" != "$realname" \
3447 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3451 # Do each command in the postinstall commands.
3452 lib
="$destdir/$realname"
3453 func_execute_cmds
"$postinstall_cmds" 'exit $?'
3456 # Install the pseudo-library for information purposes.
3457 func_basename
"$file"
3458 name
="$func_basename_result"
3459 instname
="$dir/$name"i
3460 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
3462 # Maybe install the static library, too.
3463 test -n "$old_library" && staticlibs
+=" $dir/$old_library"
3467 # Install (i.e. copy) a libtool object.
3469 # Figure out destination file name, if it wasn't already specified.
3470 if test -n "$destname"; then
3471 destfile
="$destdir/$destname"
3473 func_basename
"$file"
3474 destfile
="$func_basename_result"
3475 destfile
="$destdir/$destfile"
3478 # Deduce the name of the destination old-style object file.
3481 func_lo2o
"$destfile"
3482 staticdest
=$func_lo2o_result
3485 staticdest
="$destfile"
3489 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
3493 # Install the libtool object if requested.
3494 test -n "$destfile" && \
3495 func_show_eval
"$install_prog $file $destfile" 'exit $?'
3497 # Install the old object if enabled.
3498 if test "$build_old_libs" = yes; then
3499 # Deduce the name of the old-style object file.
3501 staticobj
=$func_lo2o_result
3502 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
3508 # Figure out destination file name, if it wasn't already specified.
3509 if test -n "$destname"; then
3510 destfile
="$destdir/$destname"
3512 func_basename
"$file"
3513 destfile
="$func_basename_result"
3514 destfile
="$destdir/$destfile"
3517 # If the file is missing, and there is a .exe on the end, strip it
3518 # because it is most likely a libtool script we actually want to
3523 if test ! -f "$file"; then
3524 func_stripname
'' '.exe' "$file"
3525 file=$func_stripname_result
3531 # Do a test to see if this is really a libtool program.
3534 if func_ltwrapper_executable_p
"$file"; then
3535 func_ltwrapper_scriptname
"$file"
3536 wrapper
=$func_ltwrapper_scriptname_result
3538 func_stripname
'' '.exe' "$file"
3539 wrapper
=$func_stripname_result
3546 if func_ltwrapper_script_p
"$wrapper"; then
3550 func_source
"$wrapper"
3552 # Check the variables that should have been set.
3553 test -z "$generated_by_libtool_version" && \
3554 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
3557 for lib
in $notinst_deplibs; do
3558 # Check to see that each library is installed.
3560 if test -f "$lib"; then
3563 libfile
="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3564 if test -n "$libdir" && test ! -f "$libfile"; then
3565 func_warning
"\`$lib' has not been installed in \`$libdir'"
3571 func_source
"$wrapper"
3574 if test "$fast_install" = no
&& test -n "$relink_command"; then
3576 if test "$finalize" = yes; then
3577 tmpdir
=`func_mktempdir`
3578 func_basename
"$file$stripped_ext"
3579 file="$func_basename_result"
3580 outputname
="$tmpdir/$file"
3581 # Replace the output file specification.
3582 relink_command
=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3585 func_quote_for_expand
"$relink_command"
3586 eval "func_echo $func_quote_for_expand_result"
3588 if eval "$relink_command"; then :
3590 func_error
"error: relink \`$file' with the above command before installing it"
3591 $opt_dry_run ||
${RM}r
"$tmpdir"
3596 func_warning
"cannot relink \`$file'"
3600 # Install the binary that we compiled earlier.
3601 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3605 # remove .exe since cygwin /usr/bin/install will append another
3607 case $install_prog,$host in
3608 */usr
/bin
/install*,*cygwin
*)
3609 case $file:$destfile in
3614 destfile
=$destfile.exe
3617 func_stripname
'' '.exe' "$destfile"
3618 destfile
=$func_stripname_result
3623 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
3624 $opt_dry_run ||
if test -n "$outputname"; then
3631 for file in $staticlibs; do
3632 func_basename
"$file"
3633 name
="$func_basename_result"
3635 # Set up the ranlib parameters.
3636 oldlib
="$destdir/$name"
3638 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
3640 if test -n "$stripme" && test -n "$old_striplib"; then
3641 func_show_eval
"$old_striplib $oldlib" 'exit $?'
3644 # Do each command in the postinstall commands.
3645 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
3648 test -n "$future_libdirs" && \
3649 func_warning
"remember to run \`$progname --finish$future_libdirs'"
3651 if test -n "$current_libdirs"; then
3652 # Maybe just do a dry run.
3653 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
3654 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
3660 test "$opt_mode" = install && func_mode_install
${1+"$@"}
3663 # func_generate_dlsyms outputname originator pic_p
3664 # Extract symbols from dlprefiles and create ${outputname}S.o with
3665 # a dlpreopen symbol table.
3666 func_generate_dlsyms
()
3672 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3675 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3676 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3677 my_dlsyms
="${my_outputname}S.c"
3679 func_error
"not configured to extract global symbols from dlpreopened files"
3683 if test -n "$my_dlsyms"; then
3687 # Discover the nlist of each of the dlfiles.
3688 nlist
="$output_objdir/${my_outputname}.nm"
3690 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
3692 # Parse the name list into a source file.
3693 func_verbose
"creating $output_objdir/$my_dlsyms"
3695 $opt_dry_run ||
$ECHO > "$output_objdir/$my_dlsyms" "\
3696 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3697 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3703 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3704 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3707 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3708 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3709 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3710 relocations are performed -- see ld's documentation on pseudo-relocs. */
3711 # define LT_DLSYM_CONST
3712 #elif defined(__osf__)
3713 /* This system does not cope well with relocations in const data. */
3714 # define LT_DLSYM_CONST
3716 # define LT_DLSYM_CONST const
3719 /* External symbol declarations for the compiler. */\
3722 if test "$dlself" = yes; then
3723 func_verbose
"generating symbol list for \`$output'"
3725 $opt_dry_run ||
echo ': @PROGRAM@ ' > "$nlist"
3727 # Add our own program objects to the symbol list.
3728 progfiles
=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3729 for progfile
in $progfiles; do
3730 func_to_tool_file
"$progfile" func_convert_file_msys_to_w32
3731 func_verbose
"extracting global C symbols from \`$func_to_tool_file_result'"
3732 $opt_dry_run ||
eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3735 if test -n "$exclude_expsyms"; then
3737 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3738 eval '$MV "$nlist"T "$nlist"'
3742 if test -n "$export_symbols_regex"; then
3744 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3745 eval '$MV "$nlist"T "$nlist"'
3749 # Prepare the list of exported symbols
3750 if test -z "$export_symbols"; then
3751 export_symbols
="$output_objdir/$outputname.exp"
3754 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3756 *cygwin
* |
*mingw
* |
*cegcc
* )
3757 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3758 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3764 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3765 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3766 eval '$MV "$nlist"T "$nlist"'
3768 *cygwin
* |
*mingw
* |
*cegcc
* )
3769 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3770 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3777 for dlprefile
in $dlprefiles; do
3778 func_verbose
"extracting global C symbols from \`$dlprefile'"
3779 func_basename
"$dlprefile"
3780 name
="$func_basename_result"
3782 *cygwin
* |
*mingw
* |
*cegcc
* )
3783 # if an import library, we need to obtain dlname
3784 if func_win32_import_lib_p
"$dlprefile"; then
3785 func_tr_sh
"$dlprefile"
3786 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3787 dlprefile_dlbasename
=""
3788 if test -n "$curr_lafile" && func_lalib_p
"$curr_lafile"; then
3789 # Use subshell, to avoid clobbering current variable values
3790 dlprefile_dlname
=`source "$curr_lafile" && echo "$dlname"`
3791 if test -n "$dlprefile_dlname" ; then
3792 func_basename
"$dlprefile_dlname"
3793 dlprefile_dlbasename
="$func_basename_result"
3795 # no lafile. user explicitly requested -dlpreopen <import library>.
3796 $sharedlib_from_linklib_cmd "$dlprefile"
3797 dlprefile_dlbasename
=$sharedlib_from_linklib_result
3801 if test -n "$dlprefile_dlbasename" ; then
3802 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3804 func_warning
"Could not compute DLL name from $name"
3805 eval '$ECHO ": $name " >> "$nlist"'
3807 func_to_tool_file
"$dlprefile" func_convert_file_msys_to_w32
3808 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3809 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3811 else # not an import lib
3813 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 >> '$nlist'"
3821 eval '$ECHO ": $name " >> "$nlist"'
3822 func_to_tool_file
"$dlprefile" func_convert_file_msys_to_w32
3823 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3830 # Make sure we have at least an empty file.
3831 test -f "$nlist" ||
: > "$nlist"
3833 if test -n "$exclude_expsyms"; then
3834 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3835 $MV "$nlist"T
"$nlist"
3838 # Try sorting and uniquifying the output.
3839 if $GREP -v "^: " < "$nlist" |
3840 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
3845 uniq > "$nlist"S
; then
3848 $GREP -v "^: " < "$nlist" > "$nlist"S
3851 if test -f "$nlist"S
; then
3852 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3854 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3857 echo >> "$output_objdir/$my_dlsyms" "\
3859 /* The mapping between symbol names and symbols. */
3864 extern LT_DLSYM_CONST lt_dlsymlist
3865 lt_${my_prefix}_LTX_preloaded_symbols[];
3866 LT_DLSYM_CONST lt_dlsymlist
3867 lt_${my_prefix}_LTX_preloaded_symbols[] =
3869 { \"$my_originator\", (void *) 0 },"
3871 case $need_lib_prefix in
3873 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3876 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3879 echo >> "$output_objdir/$my_dlsyms" "\
3883 /* This works around a problem in FreeBSD linker */
3884 #ifdef FREEBSD_WORKAROUND
3885 static const void *lt_preloaded_setup() {
3886 return lt_${my_prefix}_LTX_preloaded_symbols;
3896 pic_flag_for_symtable
=
3897 case "$compile_command " in
3901 # compiling the symbol table file with pic_flag works around
3902 # a FreeBSD bug that causes programs to crash when -lm is
3903 # linked before any other PIC object. But we must not use
3904 # pic_flag when linking with -static. The problem exists in
3905 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3906 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3907 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3909 pic_flag_for_symtable
=" $pic_flag" ;;
3911 if test "X$my_pic_p" != Xno
; then
3912 pic_flag_for_symtable
=" $pic_flag"
3919 for arg
in $LTCFLAGS; do
3921 -pie |
-fpie |
-fPIE) ;;
3922 *) symtab_cflags
+=" $arg" ;;
3926 # Now compile the dynamic symbol file.
3927 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3929 # Clean up the generated files.
3930 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3932 # Transform the symbol file into the correct name.
3933 symfileobj
="$output_objdir/${my_outputname}S.$objext"
3935 *cygwin
* |
*mingw
* |
*cegcc
* )
3936 if test -f "$output_objdir/$my_outputname.def"; then
3937 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3938 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3940 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3941 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3945 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3946 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3951 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
3955 # We keep going just in case the user didn't refer to
3956 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3957 # really was required.
3959 # Nullify the symbol file.
3960 compile_command
=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3961 finalize_command
=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3965 # func_win32_libid arg
3966 # return the library type of file 'arg'
3968 # Need a lot of goo to handle *both* DLLs and import libs
3969 # Has to be a shell function in order to 'eat' the argument
3970 # that is supplied when $file_magic_command is called.
3971 # Despite the name, also deal with 64 bit binaries.
3975 win32_libid_type
="unknown"
3976 win32_fileres
=`file -L $1 2>/dev/null`
3977 case $win32_fileres in
3978 *ar\ archive\ import\ library
*) # definitely import
3979 win32_libid_type
="x86 archive import"
3981 *ar\ archive
*) # could be an import, or static
3982 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3983 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null |
3984 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev
/null
; then
3985 func_to_tool_file
"$1" func_convert_file_msys_to_w32
3986 win32_nmres
=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3995 case $win32_nmres in
3996 import
*) win32_libid_type
="x86 archive import";;
3997 *) win32_libid_type
="x86 archive static";;
4002 win32_libid_type
="x86 DLL"
4004 *executable
*) # but shell scripts are "executable" too...
4005 case $win32_fileres in
4006 *MS\ Windows\ PE\ Intel
*)
4007 win32_libid_type
="x86 DLL"
4012 $ECHO "$win32_libid_type"
4015 # func_cygming_dll_for_implib ARG
4017 # Platform-specific function to extract the
4018 # name of the DLL associated with the specified
4019 # import library ARG.
4020 # Invoked by eval'ing the libtool variable
4021 # $sharedlib_from_linklib_cmd
4022 # Result is available in the variable
4023 # $sharedlib_from_linklib_result
4024 func_cygming_dll_for_implib
()
4027 sharedlib_from_linklib_result
=`$DLLTOOL --identify-strict --identify "$1"`
4030 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
4032 # The is the core of a fallback implementation of a
4033 # platform-specific function to extract the name of the
4034 # DLL associated with the specified import library LIBNAME.
4036 # SECTION_NAME is either .idata$6 or .idata$7, depending
4037 # on the platform and compiler that created the implib.
4039 # Echos the name of the DLL associated with the
4040 # specified import library.
4041 func_cygming_dll_for_implib_fallback_core
()
4044 match_literal
=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4045 $OBJDUMP -s --section "$1" "$2" 2>/dev
/null |
4046 $SED '/^Contents of section '"$match_literal"':/{
4047 # Place marker at beginning of archive member dllname section
4052 # These lines can sometimes be longer than 43 characters, but
4053 # are always uninteresting
4054 /:[ ]*file format pe[i]\{,1\}-/d
4055 /^In archive [^:]*:/d
4056 # Ensure marker is printed
4058 # Remove all lines with less than 43 characters
4060 # From remaining lines, remove first 43 characters
4063 # Join marker and all lines until next marker into a single line
4064 /^====MARK====/ b para
4073 # Remove trailing dots and whitespace
4077 # we now have a list, one entry per line, of the stringified
4078 # contents of the appropriate section of all members of the
4079 # archive which possess that section. Heuristic: eliminate
4080 # all those which have a first or second character that is
4081 # a '.' (that is, objdump's representation of an unprintable
4082 # character.) This should work for all archives with less than
4083 # 0x302f exports -- but will fail for DLLs whose name actually
4084 # begins with a literal '.' or a single character followed by
4087 # Of those that remain, print the first one.
4088 $SED -e '/^\./d;/^.\./d;q'
4091 # func_cygming_gnu_implib_p ARG
4092 # This predicate returns with zero status (TRUE) if
4093 # ARG is a GNU/binutils-style import library. Returns
4094 # with nonzero status (FALSE) otherwise.
4095 func_cygming_gnu_implib_p
()
4098 func_to_tool_file
"$1" func_convert_file_msys_to_w32
4099 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)$'`
4100 test -n "$func_cygming_gnu_implib_tmp"
4103 # func_cygming_ms_implib_p ARG
4104 # This predicate returns with zero status (TRUE) if
4105 # ARG is an MS-style import library. Returns
4106 # with nonzero status (FALSE) otherwise.
4107 func_cygming_ms_implib_p
()
4110 func_to_tool_file
"$1" func_convert_file_msys_to_w32
4111 func_cygming_ms_implib_tmp
=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4112 test -n "$func_cygming_ms_implib_tmp"
4115 # func_cygming_dll_for_implib_fallback ARG
4116 # Platform-specific function to extract the
4117 # name of the DLL associated with the specified
4118 # import library ARG.
4120 # This fallback implementation is for use when $DLLTOOL
4121 # does not support the --identify-strict option.
4122 # Invoked by eval'ing the libtool variable
4123 # $sharedlib_from_linklib_cmd
4124 # Result is available in the variable
4125 # $sharedlib_from_linklib_result
4126 func_cygming_dll_for_implib_fallback
()
4129 if func_cygming_gnu_implib_p
"$1" ; then
4130 # binutils import library
4131 sharedlib_from_linklib_result
=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4132 elif func_cygming_ms_implib_p
"$1" ; then
4133 # ms-generated import library
4134 sharedlib_from_linklib_result
=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4137 sharedlib_from_linklib_result
=""
4142 # func_extract_an_archive dir oldlib
4143 func_extract_an_archive
()
4146 f_ex_an_ar_dir
="$1"; shift
4147 f_ex_an_ar_oldlib
="$1"
4148 if test "$lock_old_archive_extraction" = yes; then
4149 lockfile
=$f_ex_an_ar_oldlib.lock
4150 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
4151 func_echo
"Waiting for $lockfile to be removed"
4155 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4156 'stat=$?; rm -f "$lockfile"; exit $stat'
4157 if test "$lock_old_archive_extraction" = yes; then
4158 $opt_dry_run ||
rm -f "$lockfile"
4160 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
4163 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
4168 # func_extract_archives gentop oldlib ...
4169 func_extract_archives
()
4172 my_gentop
="$1"; shift
4173 my_oldlibs
=${1+"$@"}
4179 for my_xlib
in $my_oldlibs; do
4180 # Extract the objects.
4182 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
4183 *) my_xabs
=`pwd`"/$my_xlib" ;;
4185 func_basename
"$my_xlib"
4186 my_xlib
="$func_basename_result"
4189 case " $extracted_archives " in
4191 func_arith
$extracted_serial + 1
4192 extracted_serial
=$func_arith_result
4193 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
4197 extracted_archives
="$extracted_archives $my_xlib_u"
4198 my_xdir
="$my_gentop/$my_xlib_u"
4200 func_mkdir_p
"$my_xdir"
4204 func_verbose
"Extracting $my_xabs"
4205 # Do not bother doing anything if just a dry run
4207 darwin_orig_dir
=`pwd`
4208 cd $my_xdir ||
exit $?
4209 darwin_archive
=$my_xabs
4211 darwin_base_archive
=`basename "$darwin_archive"`
4212 darwin_arches
=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4213 if test -n "$darwin_arches"; then
4214 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4216 func_verbose
"$darwin_base_archive has multiple architectures $darwin_arches"
4217 for darwin_arch
in $darwin_arches ; do
4218 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
4219 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4220 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4221 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
4223 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
4224 done # $darwin_arches
4225 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
4226 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
4229 for darwin_file
in $darwin_filelist; do
4230 darwin_files
=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
4231 $LIPO -create -output "$darwin_file" $darwin_files
4232 done # $darwin_filelist
4234 cd "$darwin_orig_dir"
4237 func_extract_an_archive
"$my_xdir" "$my_xabs"
4242 func_extract_an_archive
"$my_xdir" "$my_xabs"
4245 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4248 func_extract_archives_result
="$my_oldobjs"
4252 # func_emit_wrapper [arg=no]
4254 # Emit a libtool wrapper script on stdout.
4255 # Don't directly open a file because we may want to
4256 # incorporate the script contents within a cygwin/mingw
4257 # wrapper executable. Must ONLY be called from within
4258 # func_mode_link because it depends on a number of variables
4261 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
4262 # variable will take. If 'yes', then the emitted script
4263 # will assume that the directory in which it is stored is
4264 # the $objdir directory. This is a cygwin/mingw-specific
4266 func_emit_wrapper
()
4268 func_emit_wrapper_arg1
=${1-no}
4273 # $output - temporary wrapper script for $objdir/$outputname
4274 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4276 # The $output program cannot be directly executed until all the libtool
4277 # libraries that it depends on are installed.
4279 # This wrapper script should never be moved out of the build directory.
4280 # If it is, it will not operate correctly.
4282 # Sed substitution that helps us do robust quoting. It backslashifies
4283 # metacharacters that are still active within double-quoted strings.
4284 sed_quote_subst='$sed_quote_subst'
4286 # Be Bourne compatible
4287 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
4290 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
4291 # is contrary to our usage. Disable this feature.
4292 alias -g '\${1+\"\$@\"}'='\"\$@\"'
4293 setopt NO_GLOB_SUBST
4295 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
4297 BIN_SH=xpg4; export BIN_SH # for Tru64
4298 DUALCASE=1; export DUALCASE # for MKS sh
4300 # The HP-UX ksh and POSIX shell print the target directory to stdout
4302 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4304 relink_command=\"$relink_command\"
4306 # This environment variable determines our operation mode.
4307 if test \"\$libtool_install_magic\" = \"$magic\"; then
4308 # install mode needs the following variables:
4309 generated_by_libtool_version='$macro_version'
4310 notinst_deplibs='$notinst_deplibs'
4312 # When we are sourced in execute mode, \$file and \$ECHO are already set.
4313 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4316 qECHO
=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
4319 # A function that is used when there is no print builtin or printf.
4320 func_fallback_echo ()
4322 eval 'cat <<_LTECHO_EOF
4329 # Very basic option parsing. These options are (a) specific to
4330 # the libtool wrapper, (b) are identical between the wrapper
4331 # /script/ and the wrapper /executable/ which is used only on
4332 # windows platforms, and (c) all begin with the string "--lt-"
4333 # (application programs are unlikely to have options which match
4336 # There are only two supported options: --lt-debug and
4337 # --lt-dump-script. There is, deliberately, no --lt-help.
4339 # The first argument to this parsing function should be the
4340 # script's $0 value, followed by "$@
".
4342 func_parse_lt_options ()
4348 case \"\$lt_opt\" in
4349 --lt-debug) lt_option_debug=1 ;;
4351 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
4352 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
4353 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
4354 cat \"\$lt_dump_D/\$lt_dump_F\"
4358 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
4364 # Print the debug banner immediately:
4365 if test -n \"\$lt_option_debug\"; then
4366 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
4370 # Used when --lt-debug. Prints its arguments to stdout
4371 # (redirection is the responsibility of the caller)
4372 func_lt_dump_args ()
4377 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
4378 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4382 # Core function for launching the target application
4383 func_exec_program_core ()
4387 # Backslashes separate directories on plain windows
4388 *-*-mingw |
*-*-os2* |
*-cegcc*)
4390 if test -n \"\$lt_option_debug\"; then
4391 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
4392 func_lt_dump_args \${1+\"\$@\"} 1>&2
4394 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4400 if test -n \"\$lt_option_debug\"; then
4401 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
4402 func_lt_dump_args \${1+\"\$@\"} 1>&2
4404 exec \"\$progdir/\$program\" \${1+\"\$@\"}
4409 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
4413 # A function to encapsulate launching the target application
4414 # Strips options in the --lt-* namespace from \$@ and
4415 # launches target application with the remaining arguments.
4416 func_exec_program ()
4422 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4426 func_exec_program_core \${1+\"\$@\"}
4430 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4432 # Find the directory that this script lives in.
4433 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4434 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4436 # Follow symbolic links until we get to the real thisdir.
4437 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4438 while test -n \"\$file\"; do
4439 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4441 # If there was a directory component, then change thisdir.
4442 if test \"x\$destdir\" != \"x\$file\"; then
4443 case \"\$destdir\" in
4444 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4445 *) thisdir=\"\$thisdir/\$destdir\" ;;
4449 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4450 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4453 # Usually 'no', except on cygwin/mingw when embedded into
4455 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4456 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4457 # special case for '.'
4458 if test \"\$thisdir\" = \".\"; then
4461 # remove .libs from thisdir
4462 case \"\$thisdir\" in
4463 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4464 $objdir ) thisdir=. ;;
4468 # Try to get the absolute directory name.
4469 absdir=\`cd \"\$thisdir\" && pwd\`
4470 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4473 if test "$fast_install" = yes; then
4475 program=lt-'$outputname'$exeext
4476 progdir=\"\$thisdir/$objdir\"
4478 if test ! -f \"\$progdir/\$program\" ||
4479 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4480 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4482 file=\"\$\$-\$program\"
4484 if test ! -d \"\$progdir\"; then
4485 $MKDIR \"\$progdir\"
4487 $RM \"\$progdir/\$file\"
4492 # relink executable if necessary
4493 if test -n \"\$relink_command\"; then
4494 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4496 $ECHO \"\$relink_command_output\" >&2
4497 $RM \"\$progdir/\$file\"
4502 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4503 { $RM \"\$progdir/\$program\";
4504 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4505 $RM \"\$progdir/\$file\"
4509 program='$outputname'
4510 progdir=\"\$thisdir/$objdir\"
4516 if test -f \"\$progdir/\$program\"; then"
4518 # fixup the dll searchpath if we need to.
4520 # Fix the DLL searchpath if we need to. Do this before prepending
4521 # to shlibpath, because on Windows, both are PATH and uninstalled
4522 # libraries must come first.
4523 if test -n "$dllsearchpath"; then
4525 # Add the dll search path components to the executable PATH
4526 PATH=$dllsearchpath:\$PATH
4530 # Export our shlibpath_var if we have one.
4531 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4533 # Add our own library path to $shlibpath_var
4534 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4536 # Some systems cannot cope with colon-terminated $shlibpath_var
4537 # The second colon is a workaround for a bug in BeOS R4 sed
4538 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4540 export $shlibpath_var
4545 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4546 # Run the actual program with our arguments.
4547 func_exec_program \${1+\"\$@\"}
4550 # The program doesn't exist.
4551 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4552 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4553 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4561 # func_emit_cwrapperexe_src
4562 # emit the source code for a wrapper executable on stdout
4563 # Must ONLY be called from within func_mode_link because
4564 # it depends on a number of variable set therein.
4565 func_emit_cwrapperexe_src
()
4569 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4570 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4572 The $output program cannot be directly executed until all the libtool
4573 libraries that it depends on are installed.
4575 This wrapper executable should never be moved out of the build directory.
4576 If it is, it will not operate correctly.
4581 # define _CRT_SECURE_NO_DEPRECATE 1
4586 # include <direct.h>
4587 # include <process.h>
4590 # include <unistd.h>
4591 # include <stdint.h>
4603 #include <sys/stat.h>
4605 /* declarations of non-ANSI functions */
4606 #if defined(__MINGW32__)
4607 # ifdef __STRICT_ANSI__
4608 int _putenv (const char *);
4610 #elif defined(__CYGWIN__)
4611 # ifdef __STRICT_ANSI__
4612 char *realpath (const char *, char *);
4613 int putenv (char *);
4614 int setenv (const char *, const char *, int);
4616 /* #elif defined (other platforms) ... */
4619 /* portability defines, excluding path handling macros */
4620 #if defined(_MSC_VER)
4621 # define setmode _setmode
4623 # define chmod _chmod
4624 # define getcwd _getcwd
4625 # define putenv _putenv
4626 # define S_IXUSR _S_IEXEC
4627 # ifndef _INTPTR_T_DEFINED
4628 # define _INTPTR_T_DEFINED
4629 # define intptr_t int
4631 #elif defined(__MINGW32__)
4632 # define setmode _setmode
4634 # define chmod _chmod
4635 # define getcwd _getcwd
4636 # define putenv _putenv
4637 #elif defined(__CYGWIN__)
4638 # define HAVE_SETENV
4639 # define FOPEN_WB "wb"
4640 /* #elif defined (other platforms) ... */
4643 #if defined(PATH_MAX)
4644 # define LT_PATHMAX PATH_MAX
4645 #elif defined(MAXPATHLEN)
4646 # define LT_PATHMAX MAXPATHLEN
4648 # define LT_PATHMAX 1024
4658 /* path handling portability macros */
4659 #ifndef DIR_SEPARATOR
4660 # define DIR_SEPARATOR '/'
4661 # define PATH_SEPARATOR ':'
4664 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4666 # define HAVE_DOS_BASED_FILE_SYSTEM
4667 # define FOPEN_WB "wb"
4668 # ifndef DIR_SEPARATOR_2
4669 # define DIR_SEPARATOR_2 '\\'
4671 # ifndef PATH_SEPARATOR_2
4672 # define PATH_SEPARATOR_2 ';'
4676 #ifndef DIR_SEPARATOR_2
4677 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4678 #else /* DIR_SEPARATOR_2 */
4679 # define IS_DIR_SEPARATOR(ch) \
4680 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4681 #endif /* DIR_SEPARATOR_2 */
4683 #ifndef PATH_SEPARATOR_2
4684 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4685 #else /* PATH_SEPARATOR_2 */
4686 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4687 #endif /* PATH_SEPARATOR_2 */
4690 # define FOPEN_WB "w"
4693 # define _O_BINARY 0
4696 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4697 #define XFREE(stale) do { \
4698 if (stale) { free ((void *) stale); stale = 0; } \
4701 #if defined(LT_DEBUGWRAPPER)
4702 static int lt_debug = 1;
4704 static int lt_debug = 0;
4707 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4709 void *xmalloc (size_t num);
4710 char *xstrdup (const char *string);
4711 const char *base_name (const char *name);
4712 char *find_executable (const char *wrapper);
4713 char *chase_symlinks (const char *pathspec);
4714 int make_executable (const char *path);
4715 int check_executable (const char *path);
4716 char *strendzap (char *str, const char *pat);
4717 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4718 void lt_fatal (const char *file, int line, const char *message, ...);
4719 static const char *nonnull (const char *s);
4720 static const char *nonempty (const char *s);
4721 void lt_setenv (const char *name, const char *value);
4722 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4723 void lt_update_exe_path (const char *name, const char *value);
4724 void lt_update_lib_path (const char *name, const char *value);
4725 char **prepare_spawn (char **argv);
4726 void lt_dump_script (FILE *f);
4730 volatile const char * MAGIC_EXE = "$magic_exe";
4731 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4734 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4735 func_to_host_path "$temp_rpath"
4737 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4741 const char
* LIB_PATH_VALUE
= "";
4745 if test -n "$dllsearchpath"; then
4746 func_to_host_path
"$dllsearchpath:"
4748 const char * EXE_PATH_VARNAME = "PATH";
4749 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4753 const char * EXE_PATH_VARNAME = "";
4754 const char * EXE_PATH_VALUE = "";
4758 if test "$fast_install" = yes; then
4760 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4764 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4771 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4773 static const char
*ltwrapper_option_prefix
= LTWRAPPER_OPTION_PREFIX
;
4774 static const char
*dumpscript_opt
= LTWRAPPER_OPTION_PREFIX
"dump-script";
4775 static const char
*debug_opt
= LTWRAPPER_OPTION_PREFIX
"debug";
4778 main
(int argc
, char
*argv
[])
4783 char
*actual_cwrapper_path
;
4784 char
*actual_cwrapper_name
;
4787 intptr_t rval
= 127;
4791 program_name
= (char
*) xstrdup
(base_name
(argv
[0]));
4792 newargz
= XMALLOC
(char
*, argc
+ 1);
4794 /* very simple arg parsing
; don
't want to rely on getopt
4795 * also, copy all non cwrapper options to newargz, except
4796 * argz[0], which is handled differently
4799 for (i = 1; i < argc; i++)
4801 if (strcmp (argv[i], dumpscript_opt) == 0)
4805 *mingw* | *cygwin* )
4806 # make stdout use "unix" line endings
4807 echo " setmode(1,_O_BINARY);"
4812 lt_dump_script (stdout);
4815 if (strcmp (argv[i], debug_opt) == 0)
4820 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4822 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4823 namespace, but it is not one of the ones we know about and
4824 have already dealt with, above (inluding dump-script), then
4825 report an error. Otherwise, targets might begin to believe
4826 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4827 namespace. The first time any user complains about this, we'll
4828 need to
make LTWRAPPER_OPTION_PREFIX a configure-time option
4829 or a configure.ac-settable value.
4831 lt_fatal
(__FILE__
, __LINE__
,
4832 "unrecognized %s option: '%s'",
4833 ltwrapper_option_prefix
, argv
[i
]);
4836 newargz
[++newargc
] = xstrdup
(argv
[i
]);
4838 newargz
[++newargc
] = NULL
;
4842 /* The GNU banner must be the first non-error debug message */
4843 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4846 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4847 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4849 tmp_pathspec = find_executable (argv[0]);
4850 if (tmp_pathspec == NULL)
4851 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4852 lt_debugprintf (__FILE__, __LINE__,
4853 "(main) found exe (before symlink chase) at: %s\n",
4856 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4857 lt_debugprintf (__FILE__, __LINE__,
4858 "(main) found exe (after symlink chase) at: %s\n",
4859 actual_cwrapper_path);
4860 XFREE (tmp_pathspec);
4862 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4863 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4865 /* wrapper name transforms */
4866 strendzap (actual_cwrapper_name, ".exe");
4867 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4868 XFREE (actual_cwrapper_name);
4869 actual_cwrapper_name = tmp_pathspec;
4872 /* target_name transforms -- use actual target program name; might have lt- prefix */
4873 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4874 strendzap (target_name, ".exe");
4875 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4876 XFREE (target_name);
4877 target_name = tmp_pathspec;
4880 lt_debugprintf (__FILE__, __LINE__,
4881 "(main) libtool target name: %s\n",
4887 XMALLOC (char, (strlen (actual_cwrapper_path) +
4888 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4889 strcpy (newargz[0], actual_cwrapper_path);
4890 strcat (newargz[0], "$objdir");
4891 strcat (newargz[0], "/");
4895 /* stop here
, and copy so we don
't have to do this twice */
4896 tmp_pathspec = xstrdup (newargz[0]);
4898 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4899 strcat (newargz[0], actual_cwrapper_name);
4901 /* DO want the lt- prefix here if it exists, so use target_name */
4902 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4903 XFREE (tmp_pathspec);
4904 tmp_pathspec = NULL;
4912 while ((p = strchr (newargz[0], '\\')) != NULL)
4916 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4926 XFREE (target_name);
4927 XFREE (actual_cwrapper_path);
4928 XFREE (actual_cwrapper_name);
4930 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4931 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4932 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4933 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4934 because on Windows, both *_VARNAMEs are PATH but uninstalled
4935 libraries must come first. */
4936 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4937 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4939 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4940 nonnull (lt_argv_zero));
4941 for (i = 0; i < newargc; i++)
4943 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4944 i, nonnull (newargz[i]));
4952 /* execv doesn't actually work on mingw as expected on unix
*/
4953 newargz
= prepare_spawn
(newargz
);
4954 rval
= _spawnv
(_P_WAIT
, lt_argv_zero
, (const char
* const
*) newargz
);
4957 /* failed to start process
*/
4958 lt_debugprintf
(__FILE__
, __LINE__
,
4959 "(main) failed to launch target \"%s\": %s\n",
4960 lt_argv_zero
, nonnull
(strerror
(errno
)));
4968 execv (lt_argv_zero, newargz);
4969 return rval; /* =127, but avoids unused variable warning */
4978 xmalloc
(size_t num
)
4980 void
*p
= (void
*) malloc
(num
);
4982 lt_fatal
(__FILE__
, __LINE__
, "memory exhausted");
4988 xstrdup
(const char
*string
)
4990 return string ? strcpy
((char
*) xmalloc
(strlen
(string
) + 1),
4995 base_name
(const char
*name
)
4999 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5000 /* Skip over the disk name
in MSDOS pathnames.
*/
5001 if (isalpha
((unsigned char
) name
[0]) && name
[1] == ':')
5005 for (base
= name
; *name
; name
++)
5006 if (IS_DIR_SEPARATOR
(*name
))
5012 check_executable
(const char
*path
)
5016 lt_debugprintf
(__FILE__
, __LINE__
, "(check_executable): %s\n",
5018 if ((!path
) ||
(!*path
))
5021 if ((stat
(path
, &st
) >= 0)
5022 && (st.st_mode
& (S_IXUSR | S_IXGRP | S_IXOTH
)))
5029 make_executable
(const char
*path
)
5034 lt_debugprintf
(__FILE__
, __LINE__
, "(make_executable): %s\n",
5036 if ((!path
) ||
(!*path
))
5039 if (stat
(path
, &st
) >= 0)
5041 rval
= chmod (path
, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR
);
5046 /* Searches
for the full path of the wrapper. Returns
5047 newly allocated full path name
if found
, NULL otherwise
5048 Does not chase symlinks
, even on platforms that support them.
5051 find_executable
(const char
*wrapper
)
5056 /* static buffer
for getcwd
*/
5057 char tmp
[LT_PATHMAX
+ 1];
5061 lt_debugprintf
(__FILE__
, __LINE__
, "(find_executable): %s\n",
5062 nonempty
(wrapper
));
5064 if ((wrapper
== NULL
) ||
(*wrapper
== '\0'))
5067 /* Absolute path?
*/
5068 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5069 if (isalpha
((unsigned char
) wrapper
[0]) && wrapper
[1] == ':')
5071 concat_name
= xstrdup
(wrapper
);
5072 if (check_executable
(concat_name
))
5074 XFREE
(concat_name
);
5079 if (IS_DIR_SEPARATOR
(wrapper
[0]))
5081 concat_name
= xstrdup
(wrapper
);
5082 if (check_executable
(concat_name
))
5084 XFREE
(concat_name
);
5086 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5090 for (p
= wrapper
; *p
; p
++)
5098 /* no slashes
; search PATH
*/
5099 const char
*path
= getenv
("PATH");
5102 for (p
= path
; *p
; p
= p_next
)
5106 for (q
= p
; *q
; q
++)
5107 if (IS_PATH_SEPARATOR
(*q
))
5110 p_next
= (*q
== '\0' ? q
: q
+ 1);
5113 /* empty path
: current directory
*/
5114 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
5115 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
5116 nonnull
(strerror
(errno
)));
5117 tmp_len
= strlen
(tmp
);
5119 XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
5120 memcpy
(concat_name
, tmp
, tmp_len
);
5121 concat_name
[tmp_len
] = '/';
5122 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
5127 XMALLOC
(char
, p_len
+ 1 + strlen
(wrapper
) + 1);
5128 memcpy
(concat_name
, p
, p_len
);
5129 concat_name
[p_len
] = '/';
5130 strcpy
(concat_name
+ p_len
+ 1, wrapper
);
5132 if (check_executable
(concat_name
))
5134 XFREE
(concat_name
);
5137 /* not found
in PATH
; assume curdir
*/
5139 /* Relative path | not found
in path
: prepend cwd
*/
5140 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
5141 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
5142 nonnull
(strerror
(errno
)));
5143 tmp_len
= strlen
(tmp
);
5144 concat_name
= XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
5145 memcpy
(concat_name
, tmp
, tmp_len
);
5146 concat_name
[tmp_len
] = '/';
5147 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
5149 if (check_executable
(concat_name
))
5151 XFREE
(concat_name
);
5156 chase_symlinks
(const char
*pathspec
)
5159 return xstrdup
(pathspec
);
5161 char buf
[LT_PATHMAX
];
5163 char
*tmp_pathspec
= xstrdup
(pathspec
);
5165 int has_symlinks
= 0;
5166 while (strlen
(tmp_pathspec
) && !has_symlinks
)
5168 lt_debugprintf
(__FILE__
, __LINE__
,
5169 "checking path component for symlinks: %s\n",
5171 if (lstat
(tmp_pathspec
, &s
) == 0)
5173 if (S_ISLNK
(s.st_mode
) != 0)
5179 /* search backwards
for last DIR_SEPARATOR
*/
5180 p
= tmp_pathspec
+ strlen
(tmp_pathspec
) - 1;
5181 while ((p
> tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
5183 if ((p
== tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
5185 /* no
more DIR_SEPARATORS left
*/
5192 lt_fatal
(__FILE__
, __LINE__
,
5193 "error accessing file \"%s\": %s",
5194 tmp_pathspec
, nonnull
(strerror
(errno
)));
5197 XFREE
(tmp_pathspec
);
5201 return xstrdup
(pathspec
);
5204 tmp_pathspec
= realpath
(pathspec
, buf
);
5205 if (tmp_pathspec
== 0)
5207 lt_fatal
(__FILE__
, __LINE__
,
5208 "could not follow symlinks for %s", pathspec
);
5210 return xstrdup
(tmp_pathspec
);
5215 strendzap
(char
*str
, const char
*pat
)
5219 assert
(str
!= NULL
);
5220 assert
(pat
!= NULL
);
5223 patlen
= strlen
(pat
);
5227 str
+= len
- patlen
;
5228 if (strcmp
(str
, pat
) == 0)
5235 lt_debugprintf
(const char
*file, int line
, const char
*fmt, ...
)
5240 (void
) fprintf
(stderr
, "%s:%s:%d: ", program_name
, file, line
);
5241 va_start
(args
, fmt);
5242 (void
) vfprintf
(stderr
, fmt, args
);
5248 lt_error_core
(int exit_status
, const char
*file,
5249 int line
, const char
*mode
,
5250 const char
*message
, va_list ap
)
5252 fprintf
(stderr
, "%s:%s:%d: %s: ", program_name
, file, line
, mode
);
5253 vfprintf
(stderr
, message
, ap
);
5254 fprintf
(stderr
, ".\n");
5256 if (exit_status
>= 0)
5261 lt_fatal
(const char
*file, int line
, const char
*message
, ...
)
5264 va_start
(ap
, message
);
5265 lt_error_core
(EXIT_FAILURE
, file, line
, "FATAL", message
, ap
);
5270 nonnull
(const char
*s
)
5272 return s ? s
: "(null)";
5276 nonempty
(const char
*s
)
5278 return (s
&& !*s
) ?
"(empty)" : nonnull
(s
);
5282 lt_setenv
(const char
*name
, const char
*value
)
5284 lt_debugprintf
(__FILE__
, __LINE__
,
5285 "(lt_setenv) setting '%s' to '%s'\n",
5286 nonnull
(name
), nonnull
(value
));
5289 /* always
make a copy
, for consistency with
!HAVE_SETENV
*/
5290 char
*str
= xstrdup
(value
);
5291 setenv
(name
, str
, 1);
5293 int len
= strlen
(name
) + 1 + strlen
(value
) + 1;
5294 char
*str
= XMALLOC
(char
, len
);
5295 sprintf
(str
, "%s=%s", name
, value
);
5296 if (putenv
(str
) != EXIT_SUCCESS
)
5305 lt_extend_str
(const char
*orig_value
, const char
*add
, int to_end
)
5308 if (orig_value
&& *orig_value
)
5310 int orig_value_len
= strlen
(orig_value
);
5311 int add_len
= strlen
(add
);
5312 new_value
= XMALLOC
(char
, add_len
+ orig_value_len
+ 1);
5315 strcpy
(new_value
, orig_value
);
5316 strcpy
(new_value
+ orig_value_len
, add
);
5320 strcpy
(new_value
, add
);
5321 strcpy
(new_value
+ add_len
, orig_value
);
5326 new_value
= xstrdup
(add
);
5332 lt_update_exe_path
(const char
*name
, const char
*value
)
5334 lt_debugprintf
(__FILE__
, __LINE__
,
5335 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
5336 nonnull
(name
), nonnull
(value
));
5338 if (name
&& *name
&& value
&& *value
)
5340 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
5341 /* some systems can
't cope with a ':'-terminated path #' */
5342 int len
= strlen
(new_value
);
5343 while (((len
= strlen
(new_value
)) > 0) && IS_PATH_SEPARATOR
(new_value
[len-1
]))
5345 new_value
[len-1
] = '\0';
5347 lt_setenv
(name
, new_value
);
5353 lt_update_lib_path
(const char
*name
, const char
*value
)
5355 lt_debugprintf
(__FILE__
, __LINE__
,
5356 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
5357 nonnull
(name
), nonnull
(value
));
5359 if (name
&& *name
&& value
&& *value
)
5361 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
5362 lt_setenv
(name
, new_value
);
5372 /* Prepares an argument vector before calling spawn().
5373 Note that spawn() does not by itself call the command interpreter
5374 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
5375 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
5377 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
5378 }) ? "cmd.exe" : "command.com").
5379 Instead it simply concatenates the arguments, separated by ' ', and calls
5380 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
5381 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
5383 - Space and tab are interpreted as delimiters. They are not treated as
5384 delimiters if they are surrounded by double quotes: "...".
5385 - Unescaped double quotes are removed from the input. Their only effect is
5386 that within double quotes, space and tab are treated like normal
5388 - Backslashes not followed by double quotes are not special.
5389 - But 2*n+1 backslashes followed by a double quote become
5390 n backslashes followed by a double quote (n >= 0):
5395 #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"
5396 #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"
5398 prepare_spawn (char **argv)
5404 /* Count number of arguments. */
5405 for (argc = 0; argv[argc] != NULL; argc++)
5408 /* Allocate new argument vector. */
5409 new_argv = XMALLOC (char *, argc + 1);
5411 /* Put quoted arguments into the new argument vector. */
5412 for (i = 0; i < argc; i++)
5414 const char *string = argv[i];
5416 if (string[0] == '\0')
5417 new_argv[i] = xstrdup ("\"\"");
5418 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
5420 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
5422 unsigned int backslashes;
5424 char *quoted_string;
5431 for (s = string; *s != '\0'; s++)
5435 length += backslashes + 1;
5443 length += backslashes + 1;
5445 quoted_string = XMALLOC (char, length + 1);
5451 for (s = string; *s != '\0'; s++)
5457 for (j = backslashes + 1; j > 0; j--)
5469 for (j = backslashes; j > 0; j--)
5475 new_argv[i] = quoted_string;
5478 new_argv[i] = (char *) string;
5480 new_argv[argc] = NULL;
5489 void lt_dump_script
(FILE
* f
)
5492 func_emit_wrapper
yes |
5493 $SED -e 's/\([\\"]\)/\\\1/g' \
5494 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
5500 # end: func_emit_cwrapperexe_src
5502 # func_win32_import_lib_p ARG
5503 # True if ARG is an import lib, as indicated by $file_magic_cmd
5504 func_win32_import_lib_p ()
5507 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5513 # func_mode_link arg...
5518 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5519 # It is impossible to link a dll without this setting, and
5520 # we shouldn't force the makefile maintainer to figure out
5521 # which system we are compiling for in order to pass an extra
5522 # flag for every libtool invocation.
5523 # allow_undefined=no
5525 # FIXME: Unfortunately, there are problems with the above when trying
5526 # to make a dll which has undefined symbols, in which case not
5527 # even a static library is built. For now, we need to specify
5528 # -no-undefined on the libtool link line when we can be certain
5529 # that all symbols are satisfied, otherwise we get a static library.
5536 libtool_args=$nonopt
5537 base_compile="$nonopt $@"
5538 compile_command=$nonopt
5539 finalize_command=$nonopt
5552 lib_search_path=`pwd`
5554 new_inherited_linker_flags=
5563 export_symbols_regex=
5571 precious_files_regex=
5572 prefer_static_libs=no
5585 single_module="${wl}-single_module"
5586 func_infer_tag $base_compile
5588 # We need to know -static, to get the right output filenames.
5593 test "$build_libtool_libs" != yes && \
5594 func_fatal_configuration "can not build a shared library"
5598 -all-static | -static | -static-libtool-libs)
5601 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5602 func_warning "complete static linking is impossible in this configuration"
5604 if test -n "$link_static_flag"; then
5605 dlopen_self=$dlopen_self_static
5607 prefer_static_libs=yes
5610 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5611 dlopen_self=$dlopen_self_static
5613 prefer_static_libs=built
5615 -static-libtool-libs)
5616 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5617 dlopen_self=$dlopen_self_static
5619 prefer_static_libs=yes
5622 build_libtool_libs=no
5629 # See if our shared archives depend on static archives.
5630 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5632 # Go through the arguments, transforming them on the way.
5633 while test "$#" -gt 0; do
5636 func_quote_for_eval "$arg"
5637 qarg=$func_quote_for_eval_unquoted_result
5638 libtool_args+=" $func_quote_for_eval_result"
5640 # If the previous option needs an argument, assign it.
5641 if test -n "$prev"; then
5644 compile_command+=" @OUTPUT@"
5645 finalize_command+=" @OUTPUT@"
5656 if test "$preload" = no; then
5657 # Add the symbol object into the linking commands.
5658 compile_command+=" @SYMFILE@"
5659 finalize_command+=" @SYMFILE@"
5663 *.la | *.lo) ;; # We handle these cases below.
5665 if test "$dlself" = no; then
5673 if test "$prev" = dlprefiles; then
5675 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5685 if test "$prev" = dlfiles; then
5696 export_symbols="$arg"
5698 || func_fatal_error "symbol file \`$arg' does not exist"
5703 export_symbols_regex="$arg"
5711 *" $qarg.ltframework "*) ;;
5712 *) deplibs+=" $qarg.ltframework" # this is fixed later
5721 inst_prefix_dir="$arg"
5726 if test -f "$arg"; then
5729 for fil in `cat "$save_arg"`
5733 # A libtool-controlled object.
5735 # Check to see that this really is a libtool object.
5736 if func_lalib_unsafe_p "$arg"; then
5743 if test -z "$pic_object" ||
5744 test -z "$non_pic_object" ||
5745 test "$pic_object" = none &&
5746 test "$non_pic_object" = none; then
5747 func_fatal_error "cannot find name of object for \`$arg'"
5750 # Extract subdirectory from the argument.
5751 func_dirname "$arg" "/" ""
5752 xdir="$func_dirname_result"
5754 if test "$pic_object" != none; then
5755 # Prepend the subdirectory the object is found in.
5756 pic_object="$xdir$pic_object"
5758 if test "$prev" = dlfiles; then
5759 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5760 dlfiles+=" $pic_object"
5764 # If libtool objects are unsupported, then we need to preload.
5769 # CHECK ME: I think I busted this. -Ossama
5770 if test "$prev" = dlprefiles; then
5771 # Preload the old-style object.
5772 dlprefiles+=" $pic_object"
5777 libobjs+=" $pic_object"
5782 if test "$non_pic_object" != none; then
5783 # Prepend the subdirectory the object is found in.
5784 non_pic_object="$xdir$non_pic_object"
5786 # A standard non-PIC object
5787 non_pic_objects+=" $non_pic_object"
5788 if test -z "$pic_object" || test "$pic_object" = none ; then
5789 arg="$non_pic_object"
5792 # If the PIC object exists, use it instead.
5793 # $xdir was prepended to $pic_object above.
5794 non_pic_object="$pic_object"
5795 non_pic_objects+=" $non_pic_object"
5798 # Only an error if not doing a dry-run.
5799 if $opt_dry_run; then
5800 # Extract subdirectory from the argument.
5801 func_dirname "$arg" "/" ""
5802 xdir="$func_dirname_result"
5805 pic_object=$xdir$objdir/$func_lo2o_result
5806 non_pic_object=$xdir$func_lo2o_result
5807 libobjs+=" $pic_object"
5808 non_pic_objects+=" $non_pic_object"
5810 func_fatal_error "\`$arg' is not a valid libtool object"
5815 func_fatal_error "link input file \`$arg' does not exist"
5822 precious_files_regex="$arg"
5832 # We need an absolute path.
5834 [\\/]* | [A-Za-z]:[\\/]*) ;;
5836 func_fatal_error "only absolute run-paths are allowed"
5839 if test "$prev" = rpath; then
5842 *) rpath+=" $arg" ;;
5847 *) xrpath+=" $arg" ;;
5864 linker_flags+=" $qarg"
5865 compiler_flags+=" $qarg"
5867 compile_command+=" $qarg"
5868 finalize_command+=" $qarg"
5872 compiler_flags+=" $qarg"
5874 compile_command+=" $qarg"
5875 finalize_command+=" $qarg"
5879 linker_flags+=" $qarg"
5880 compiler_flags+=" $wl$qarg"
5882 compile_command+=" $wl$qarg"
5883 finalize_command+=" $wl$qarg"
5887 eval "$prev=\"\$arg\""
5892 fi # test -n "$prev"
5898 if test -n "$link_static_flag"; then
5899 # See comment for -static flag below, for more details.
5900 compile_command+=" $link_static_flag"
5901 finalize_command+=" $link_static_flag"
5907 # FIXME: remove this flag sometime in the future.
5908 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5936 -export-symbols | -export-symbols-regex)
5937 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5938 func_fatal_error "more than one -exported-symbols argument is not allowed"
5940 if test "X$arg" = "X-export-symbols"; then
5958 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5959 # so, if we see these flags be careful not to treat them like -L
5961 case $with_gcc/$host in
5962 no/*-*-irix* | /*-*-irix*)
5963 compile_command+=" $arg"
5964 finalize_command+=" $arg"
5971 func_stripname "-L" '' "$arg"
5972 if test -z "$func_stripname_result"; then
5973 if test "$#" -gt 0; then
5974 func_fatal_error "require no space between \`-L' and \`$1'"
5976 func_fatal_error "need path for \`-L' option"
5979 func_resolve_sysroot "$func_stripname_result"
5980 dir=$func_resolve_sysroot_result
5981 # We need an absolute path.
5983 [\\/]* | [A-Za-z]:[\\/]*) ;;
5985 absdir=`cd "$dir" && pwd`
5986 test -z "$absdir" && \
5987 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5992 *" -L$dir "* | *" $arg "*)
5993 # Will only happen for absolute or sysroot arguments
5996 # Preserve sysroot, but never include relative directories
5998 [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
5999 *) deplibs+=" -L$dir" ;;
6001 lib_search_path+=" $dir"
6005 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6006 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6007 case :$dllsearchpath: in
6009 ::) dllsearchpath=$dir;;
6010 *) dllsearchpath+=":$dir";;
6012 case :$dllsearchpath: in
6013 *":$testbindir:"*) ;;
6014 ::) dllsearchpath=$testbindir;;
6015 *) dllsearchpath+=":$testbindir";;
6023 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
6025 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6026 # These systems don't actually have a C or math library (as such)
6030 # These systems don't actually have a C library (as such)
6031 test "X$arg" = "X-lc" && continue
6033 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6034 # Do not include libc due to us having libc/libc_r.
6035 test "X$arg" = "X-lc" && continue
6037 *-*-rhapsody* | *-*-darwin1.[012])
6038 # Rhapsody C and math libraries are in the System framework
6039 deplibs+=" System.ltframework"
6042 *-*-sco3.2v5* | *-*-sco5v6*)
6043 # Causes problems with __ctype
6044 test "X$arg" = "X-lc" && continue
6046 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6047 # Compiler inserts libc in the correct place for threads to work
6048 test "X$arg" = "X-lc" && continue
6051 elif test "X$arg" = "X-lc_r"; then
6053 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6054 # Do not include libc_r directly, use -pthread flag.
6068 # Tru64 UNIX uses -model [arg] to determine the layout of C++
6069 # classes, name mangling, and exception handling.
6070 # Darwin uses the -arch flag to determine output architecture.
6071 -model|-arch|-isysroot|--sysroot)
6072 compiler_flags+=" $arg"
6073 compile_command+=" $arg"
6074 finalize_command+=" $arg"
6079 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
6080 compiler_flags+=" $arg"
6081 compile_command+=" $arg"
6082 finalize_command+=" $arg"
6083 case "$new_inherited_linker_flags " in
6085 * ) new_inherited_linker_flags+=" $arg" ;;
6091 single_module="${wl}-multi_module"
6102 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
6103 # The PATH hackery in wrapper scripts is required on Windows
6104 # and Darwin in order for the loader to find any dlls it needs.
6105 func_warning "\`-no-install' is ignored for $host"
6106 func_warning "assuming \`-no-fast-install' instead"
6109 *) no_install=yes ;;
6126 -precious-files-regex)
6147 func_stripname '-R' '' "$arg"
6148 dir=$func_stripname_result
6149 # We need an absolute path.
6151 [\\/]* | [A-Za-z]:[\\/]*) ;;
6153 func_stripname '=' '' "$dir"
6154 dir=$lt_sysroot$func_stripname_result
6157 func_fatal_error "only absolute run-paths are allowed"
6162 *) xrpath+=" $dir" ;;
6168 # The effects of -shared are defined in a previous loop.
6177 -static | -static-libtool-libs)
6178 # The effects of -static are defined in a previous loop.
6179 # We used to do the same as -all-static on platforms that
6180 # didn't have a PIC flag, but the assumption that the effects
6181 # would be equivalent was wrong. It would break on at least
6182 # Digital Unix and AIX.
6208 func_stripname '-Wc,' '' "$arg"
6209 args=$func_stripname_result
6211 save_ifs="$IFS"; IFS=','
6212 for flag in $args; do
6214 func_quote_for_eval "$flag"
6215 arg+=" $func_quote_for_eval_result"
6216 compiler_flags+=" $func_quote_for_eval_result"
6219 func_stripname ' ' '' "$arg"
6220 arg=$func_stripname_result
6224 func_stripname '-Wl,' '' "$arg"
6225 args=$func_stripname_result
6227 save_ifs="$IFS"; IFS=','
6228 for flag in $args; do
6230 func_quote_for_eval "$flag"
6231 arg+=" $wl$func_quote_for_eval_result"
6232 compiler_flags+=" $wl$func_quote_for_eval_result"
6233 linker_flags+=" $func_quote_for_eval_result"
6236 func_stripname ' ' '' "$arg"
6237 arg=$func_stripname_result
6257 func_quote_for_eval "$arg"
6258 arg="$func_quote_for_eval_result"
6261 # Flags to be passed through unchanged, with rationale:
6262 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
6263 # -r[0-9][0-9]* specify processor for the SGI compiler
6264 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
6265 # +DA*, +DD* enable 64-bit mode for the HP compiler
6266 # -q* compiler args for the IBM compiler
6267 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
6268 # -F/path path to uninstalled frameworks, gcc on darwin
6269 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
6270 # @file GCC response files
6271 # -tp=* Portland pgcc target processor selection
6272 # --sysroot=* for sysroot support
6273 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
6274 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
6275 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
6276 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
6277 func_quote_for_eval "$arg"
6278 arg="$func_quote_for_eval_result"
6279 compile_command+=" $arg"
6280 finalize_command+=" $arg"
6281 compiler_flags+=" $arg"
6285 # Some other compiler flag.
6287 func_quote_for_eval "$arg"
6288 arg="$func_quote_for_eval_result"
6292 # A standard object.
6297 # A libtool-controlled object.
6299 # Check to see that this really is a libtool object.
6300 if func_lalib_unsafe_p "$arg"; then
6307 if test -z "$pic_object" ||
6308 test -z "$non_pic_object" ||
6309 test "$pic_object" = none &&
6310 test "$non_pic_object" = none; then
6311 func_fatal_error "cannot find name of object for \`$arg'"
6314 # Extract subdirectory from the argument.
6315 func_dirname "$arg" "/" ""
6316 xdir="$func_dirname_result"
6318 if test "$pic_object" != none; then
6319 # Prepend the subdirectory the object is found in.
6320 pic_object="$xdir$pic_object"
6322 if test "$prev" = dlfiles; then
6323 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6324 dlfiles+=" $pic_object"
6328 # If libtool objects are unsupported, then we need to preload.
6333 # CHECK ME: I think I busted this. -Ossama
6334 if test "$prev" = dlprefiles; then
6335 # Preload the old-style object.
6336 dlprefiles+=" $pic_object"
6341 libobjs+=" $pic_object"
6346 if test "$non_pic_object" != none; then
6347 # Prepend the subdirectory the object is found in.
6348 non_pic_object="$xdir$non_pic_object"
6350 # A standard non-PIC object
6351 non_pic_objects+=" $non_pic_object"
6352 if test -z "$pic_object" || test "$pic_object" = none ; then
6353 arg="$non_pic_object"
6356 # If the PIC object exists, use it instead.
6357 # $xdir was prepended to $pic_object above.
6358 non_pic_object="$pic_object"
6359 non_pic_objects+=" $non_pic_object"
6362 # Only an error if not doing a dry-run.
6363 if $opt_dry_run; then
6364 # Extract subdirectory from the argument.
6365 func_dirname "$arg" "/" ""
6366 xdir="$func_dirname_result"
6369 pic_object=$xdir$objdir/$func_lo2o_result
6370 non_pic_object=$xdir$func_lo2o_result
6371 libobjs+=" $pic_object"
6372 non_pic_objects+=" $non_pic_object"
6374 func_fatal_error "\`$arg' is not a valid libtool object"
6382 old_deplibs+=" $arg"
6387 # A libtool-controlled library.
6389 func_resolve_sysroot "$arg"
6390 if test "$prev" = dlfiles; then
6391 # This library was specified with -dlopen.
6392 dlfiles+=" $func_resolve_sysroot_result"
6394 elif test "$prev" = dlprefiles; then
6395 # The library was specified with -dlpreopen.
6396 dlprefiles+=" $func_resolve_sysroot_result"
6399 deplibs+=" $func_resolve_sysroot_result"
6404 # Some other compiler argument.
6406 # Unknown arguments in both finalize_command and compile_command need
6407 # to be aesthetically quoted because they are evaled later.
6408 func_quote_for_eval "$arg"
6409 arg="$func_quote_for_eval_result"
6413 # Now actually substitute the argument into the commands.
6414 if test -n "$arg"; then
6415 compile_command+=" $arg"
6416 finalize_command+=" $arg"
6418 done # argument parsing loop
6420 test -n "$prev" && \
6421 func_fatal_help "the \`$prevarg' option requires an argument"
6423 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6424 eval arg=\"$export_dynamic_flag_spec\"
6425 compile_command+=" $arg"
6426 finalize_command+=" $arg"
6430 # calculate the name of the file, without its directory
6431 func_basename "$output"
6432 outputname="$func_basename_result"
6433 libobjs_save="$libobjs"
6435 if test -n "$shlibpath_var"; then
6436 # get the directories listed in $shlibpath_var
6437 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6441 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6442 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6444 func_dirname "$output" "/" ""
6445 output_objdir="$func_dirname_result$objdir"
6446 func_to_tool_file "$output_objdir/"
6447 tool_output_objdir=$func_to_tool_file_result
6448 # Create the object directory.
6449 func_mkdir_p "$output_objdir"
6451 # Determine the type of output
6454 func_fatal_help "you must specify an output file"
6456 *.$libext) linkmode=oldlib ;;
6457 *.lo | *.$objext) linkmode=obj ;;
6458 *.la) linkmode=lib ;;
6459 *) linkmode=prog ;; # Anything else should be a program.
6465 # Find all interdependent deplibs by searching for libraries
6466 # that are linked more than once (e.g. -la -lb -la)
6467 for deplib in $deplibs; do
6468 if $opt_preserve_dup_deps ; then
6470 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6476 if test "$linkmode" = lib; then
6477 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6479 # Compute libraries that are listed more than once in $predeps
6480 # $postdeps and mark them as special (i.e., whose duplicates are
6481 # not to be eliminated).
6483 if $opt_duplicate_compiler_generated_deps; then
6484 for pre_post_dep in $predeps $postdeps; do
6485 case "$pre_post_deps " in
6486 *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
6488 pre_post_deps+=" $pre_post_dep"
6497 need_relink=no # whether we're linking any uninstalled libtool libraries
6498 notinst_deplibs= # not-installed libtool libraries
6499 notinst_path= # paths that contain not-installed libtool libraries
6503 passes="conv dlpreopen link"
6504 for file in $dlfiles $dlprefiles; do
6508 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6519 passes="conv scan dlopen dlpreopen link"
6525 for pass in $passes; do
6526 # The preopen pass in lib mode reverses $deplibs; put it back here
6527 # so that -L comes before libs that need it for instance...
6528 if test "$linkmode,$pass" = "lib,link"; then
6529 ## FIXME: Find the place where the list is rebuilt in the wrong
6530 ## order, and fix it there properly
6532 for deplib in $deplibs; do
6533 tmp_deplibs="$deplib $tmp_deplibs"
6535 deplibs="$tmp_deplibs"
6538 if test "$linkmode,$pass" = "lib,link" ||
6539 test "$linkmode,$pass" = "prog,scan"; then
6543 if test "$linkmode" = prog; then
6545 dlopen) libs="$dlfiles" ;;
6546 dlpreopen) libs="$dlprefiles" ;;
6547 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6550 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6551 # Collect and forward deplibs of preopened libtool libs
6552 for lib in $dlprefiles; do
6553 # Ignore non-libtool-libs
6555 func_resolve_sysroot "$lib"
6557 *.la) func_source "$func_resolve_sysroot_result" ;;
6560 # Collect preopened libtool deplibs, except any this library
6561 # has declared as weak libs
6562 for deplib in $dependency_libs; do
6563 func_basename "$deplib"
6564 deplib_base=$func_basename_result
6565 case " $weak_libs " in
6566 *" $deplib_base "*) ;;
6567 *) deplibs+=" $deplib" ;;
6573 if test "$pass" = dlopen; then
6574 # Collect dlpreopened libraries
6575 save_deplibs="$deplibs"
6579 for deplib in $libs; do
6583 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
6584 if test "$linkmode,$pass" = "prog,link"; then
6585 compile_deplibs="$deplib $compile_deplibs"
6586 finalize_deplibs="$deplib $finalize_deplibs"
6588 compiler_flags+=" $deplib"
6589 if test "$linkmode" = lib ; then
6590 case "$new_inherited_linker_flags " in
6592 * ) new_inherited_linker_flags+=" $deplib" ;;
6599 if test "$linkmode" != lib && test "$linkmode" != prog; then
6600 func_warning "\`-l' is ignored for archives/objects"
6603 func_stripname '-l' '' "$deplib"
6604 name=$func_stripname_result
6605 if test "$linkmode" = lib; then
6606 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6608 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6610 for searchdir in $searchdirs; do
6611 for search_ext in .la $std_shrext .so .a; do
6612 # Search the libtool library
6613 lib="$searchdir/lib${name}${search_ext}"
6614 if test -f "$lib"; then
6615 if test "$search_ext" = ".la"; then
6624 if test "$found" != yes; then
6625 # deplib doesn't seem to be a libtool library
6626 if test "$linkmode,$pass" = "prog,link"; then
6627 compile_deplibs="$deplib $compile_deplibs"
6628 finalize_deplibs="$deplib $finalize_deplibs"
6630 deplibs="$deplib $deplibs"
6631 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6634 else # deplib is a libtool library
6635 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6636 # We need to do some special things here, and not later.
6637 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6638 case " $predeps $postdeps " in
6640 if func_lalib_p "$lib"; then
6644 for l in $old_library $library_names; do
6647 if test "X$ll" = "X$old_library" ; then # only static version available
6649 func_dirname "$lib" "" "."
6650 ladir="$func_dirname_result"
6651 lib=$ladir/$old_library
6652 if test "$linkmode,$pass" = "prog,link"; then
6653 compile_deplibs="$deplib $compile_deplibs"
6654 finalize_deplibs="$deplib $finalize_deplibs"
6656 deplibs="$deplib $deplibs"
6657 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6669 if test "$linkmode,$pass" = "prog,link"; then
6670 compile_deplibs="$deplib $compile_deplibs"
6671 finalize_deplibs="$deplib $finalize_deplibs"
6673 deplibs="$deplib $deplibs"
6674 if test "$linkmode" = lib ; then
6675 case "$new_inherited_linker_flags " in
6677 * ) new_inherited_linker_flags+=" $deplib" ;;
6686 deplibs="$deplib $deplibs"
6687 test "$pass" = conv && continue
6688 newdependency_libs="$deplib $newdependency_libs"
6689 func_stripname '-L' '' "$deplib"
6690 func_resolve_sysroot "$func_stripname_result"
6691 newlib_search_path+=" $func_resolve_sysroot_result"
6694 if test "$pass" = conv; then
6695 deplibs="$deplib $deplibs"
6698 if test "$pass" = scan; then
6699 deplibs="$deplib $deplibs"
6701 compile_deplibs="$deplib $compile_deplibs"
6702 finalize_deplibs="$deplib $finalize_deplibs"
6704 func_stripname '-L' '' "$deplib"
6705 func_resolve_sysroot "$func_stripname_result"
6706 newlib_search_path+=" $func_resolve_sysroot_result"
6709 func_warning "\`-L' is ignored for archives/objects"
6715 if test "$pass" = link; then
6716 func_stripname '-R' '' "$deplib"
6717 func_resolve_sysroot "$func_stripname_result"
6718 dir=$func_resolve_sysroot_result
6719 # Make sure the xrpath contains only unique directories.
6722 *) xrpath+=" $dir" ;;
6725 deplibs="$deplib $deplibs"
6729 func_resolve_sysroot "$deplib"
6730 lib=$func_resolve_sysroot_result
6733 if test "$pass" = conv; then
6734 deplibs="$deplib $deplibs"
6739 # Linking convenience modules into shared libraries is allowed,
6740 # but linking other static libraries is non-portable.
6741 case " $dlpreconveniencelibs " in
6745 case $deplibs_check_method in
6747 set dummy $deplibs_check_method; shift
6748 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6749 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6750 | $EGREP "$match_pattern_regex" > /dev/null; then
6758 if test "$valid_a_lib" != yes; then
6760 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6761 echo "*** I have the capability to make that library automatically link in when"
6762 echo "*** you link to this library. But I can only do this if you have a"
6763 echo "*** shared version of the library, which you do not appear to have"
6764 echo "*** because the file extensions .$libext of this argument makes me believe"
6765 echo "*** that it is just a static archive that I should not use here."
6768 $ECHO "*** Warning: Linking the shared library $output against the"
6769 $ECHO "*** static library $deplib is not portable!"
6770 deplibs="$deplib $deplibs"
6777 if test "$pass" != link; then
6778 deplibs="$deplib $deplibs"
6780 compile_deplibs="$deplib $compile_deplibs"
6781 finalize_deplibs="$deplib $finalize_deplibs"
6788 if test "$pass" = conv; then
6789 deplibs="$deplib $deplibs"
6790 elif test "$linkmode" = prog; then
6791 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6792 # If there is no dlopen support or we're linking statically,
6793 # we need to preload.
6794 newdlprefiles+=" $deplib"
6795 compile_deplibs="$deplib $compile_deplibs"
6796 finalize_deplibs="$deplib $finalize_deplibs"
6798 newdlfiles+=" $deplib"
6809 if test "$found" = yes || test -f "$lib"; then :
6811 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6814 # Check to see that this really is a libtool archive.
6815 func_lalib_unsafe_p "$lib" \
6816 || func_fatal_error "\`$lib' is not a valid libtool archive"
6818 func_dirname "$lib" "" "."
6819 ladir="$func_dirname_result"
6827 inherited_linker_flags=
6828 # If the library was installed with an old release of libtool,
6829 # it will not redefine variables installed, or shouldnotlink
6838 # Convert "-framework foo" to "foo.ltframework"
6839 if test -n "$inherited_linker_flags"; then
6840 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6841 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6842 case " $new_inherited_linker_flags " in
6843 *" $tmp_inherited_linker_flag "*) ;;
6844 *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
6848 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6849 if test "$linkmode,$pass" = "lib,link" ||
6850 test "$linkmode,$pass" = "prog,scan" ||
6851 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6852 test -n "$dlopen" && dlfiles+=" $dlopen"
6853 test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
6856 if test "$pass" = conv; then
6857 # Only check for convenience libraries
6858 deplibs="$lib $deplibs"
6859 if test -z "$libdir"; then
6860 if test -z "$old_library"; then
6861 func_fatal_error "cannot find name of link library for \`$lib'"
6863 # It is a libtool convenience library, so add in its objects.
6864 convenience+=" $ladir/$objdir/$old_library"
6865 old_convenience+=" $ladir/$objdir/$old_library"
6866 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6867 func_fatal_error "\`$lib' is not a convenience library"
6870 for deplib in $dependency_libs; do
6871 deplibs="$deplib $deplibs"
6872 if $opt_preserve_dup_deps ; then
6873 case "$tmp_libs " in
6874 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6877 tmp_libs+=" $deplib"
6883 # Get the name of the library we link against.
6885 if test -n "$old_library" &&
6886 { test "$prefer_static_libs" = yes ||
6887 test "$prefer_static_libs,$installed" = "built,no"; }; then
6888 linklib=$old_library
6890 for l in $old_library $library_names; do
6894 if test -z "$linklib"; then
6895 func_fatal_error "cannot find name of link library for \`$lib'"
6898 # This library was specified with -dlopen.
6899 if test "$pass" = dlopen; then
6900 if test -z "$libdir"; then
6901 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6903 if test -z "$dlname" ||
6904 test "$dlopen_support" != yes ||
6905 test "$build_libtool_libs" = no; then
6906 # If there is no dlname, no dlopen support or we're linking
6907 # statically, we need to preload. We also need to preload any
6908 # dependent libraries so libltdl's deplib preloader doesn't
6909 # bomb out in the load deplibs phase.
6910 dlprefiles+=" $lib $dependency_libs"
6917 # We need an absolute path.
6919 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6921 abs_ladir=`cd "$ladir" && pwd`
6922 if test -z "$abs_ladir"; then
6923 func_warning "cannot determine absolute directory name of \`$ladir'"
6924 func_warning "passing it literally to the linker, although it might fail"
6929 func_basename "$lib"
6930 laname="$func_basename_result"
6932 # Find the relevant object directory and library name.
6933 if test "X$installed" = Xyes; then
6934 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6935 func_warning "library \`$lib' was moved."
6940 # Adding 'libdir' from the .la file to our library search paths
6941 # breaks crosscompilation horribly. We cheat here and don't add
6942 # it, instead adding the path where we found the .la. -CL
6943 dir="$lt_sysroot$abs_ladir"
6947 #absdir="$lt_sysroot$libdir"
6949 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6951 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6954 # Remove this search path later
6955 notinst_path+=" $abs_ladir"
6957 dir="$ladir/$objdir"
6958 absdir="$abs_ladir/$objdir"
6959 # Remove this search path later
6960 notinst_path+=" $abs_ladir"
6962 fi # $installed = yes
6963 func_stripname 'lib' '.la' "$laname"
6964 name=$func_stripname_result
6966 # This library was specified with -dlpreopen.
6967 if test "$pass" = dlpreopen; then
6968 if test -z "$libdir" && test "$linkmode" = prog; then
6969 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6972 # special handling for platforms with PE-DLLs.
6973 *cygwin* | *mingw* | *cegcc* )
6974 # Linker will automatically link against shared library if both
6975 # static and shared are present. Therefore, ensure we extract
6976 # symbols from the import library if a shared library is present
6977 # (otherwise, the dlopen module name will be incorrect). We do
6978 # this by putting the import library name into $newdlprefiles.
6979 # We recover the dlopen module name by 'saving' the la file
6980 # name in a special purpose variable, and (later) extracting the
6981 # dlname from the la file.
6982 if test -n "$dlname"; then
6983 func_tr_sh "$dir/$linklib"
6984 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6985 newdlprefiles+=" $dir/$linklib"
6987 newdlprefiles+=" $dir/$old_library"
6988 # Keep a list of preopened convenience libraries to check
6989 # that they are being used correctly in the link pass.
6990 test -z "$libdir" && \
6991 dlpreconveniencelibs+=" $dir/$old_library"
6995 # Prefer using a static library (so that no silly _DYNAMIC symbols
6996 # are required to link).
6997 if test -n "$old_library"; then
6998 newdlprefiles+=" $dir/$old_library"
6999 # Keep a list of preopened convenience libraries to check
7000 # that they are being used correctly in the link pass.
7001 test -z "$libdir" && \
7002 dlpreconveniencelibs+=" $dir/$old_library"
7003 # Otherwise, use the dlname, so that lt_dlopen finds it.
7004 elif test -n "$dlname"; then
7005 newdlprefiles+=" $dir/$dlname"
7007 newdlprefiles+=" $dir/$linklib"
7011 fi # $pass = dlpreopen
7013 if test -z "$libdir"; then
7014 # Link the convenience library
7015 if test "$linkmode" = lib; then
7016 deplibs="$dir/$old_library $deplibs"
7017 elif test "$linkmode,$pass" = "prog,link"; then
7018 compile_deplibs="$dir/$old_library $compile_deplibs"
7019 finalize_deplibs="$dir/$old_library $finalize_deplibs"
7021 deplibs="$lib $deplibs" # used for prog,scan pass
7027 if test "$linkmode" = prog && test "$pass" != link; then
7028 newlib_search_path+=" $ladir"
7029 deplibs="$lib $deplibs"
7032 if test "$link_all_deplibs" != no || test -z "$library_names" ||
7033 test "$build_libtool_libs" = no; then
7038 for deplib in $dependency_libs; do
7040 -L*) func_stripname '-L' '' "$deplib"
7041 func_resolve_sysroot "$func_stripname_result"
7042 newlib_search_path+=" $func_resolve_sysroot_result"
7045 # Need to link against all dependency_libs?
7046 if test "$linkalldeplibs" = yes; then
7047 deplibs="$deplib $deplibs"
7049 # Need to hardcode shared library paths
7050 # or/and link against static libraries
7051 newdependency_libs="$deplib $newdependency_libs"
7053 if $opt_preserve_dup_deps ; then
7054 case "$tmp_libs " in
7055 *" $deplib "*) specialdeplibs+=" $deplib" ;;
7058 tmp_libs+=" $deplib"
7061 fi # $linkmode = prog...
7063 if test "$linkmode,$pass" = "prog,link"; then
7064 if test -n "$library_names" &&
7065 { { test "$prefer_static_libs" = no ||
7066 test "$prefer_static_libs,$installed" = "built,yes"; } ||
7067 test -z "$old_library"; }; then
7068 # We need to hardcode the library path
7069 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
7070 # Make sure the rpath contains only unique directories.
7071 case "$temp_rpath:" in
7073 *) temp_rpath+="$absdir:" ;;
7077 # Hardcode the library path.
7078 # Skip directories that are in the system default run-time
7080 case " $sys_lib_dlsearch_path " in
7083 case "$compile_rpath " in
7085 *) compile_rpath+=" $absdir" ;;
7089 case " $sys_lib_dlsearch_path " in
7092 case "$finalize_rpath " in
7094 *) finalize_rpath+=" $libdir" ;;
7098 fi # $linkmode,$pass = prog,link...
7100 if test "$alldeplibs" = yes &&
7101 { test "$deplibs_check_method" = pass_all ||
7102 { test "$build_libtool_libs" = yes &&
7103 test -n "$library_names"; }; }; then
7104 # We only need to search for static libraries
7109 link_static=no # Whether the deplib will be linked statically
7110 use_static_libs=$prefer_static_libs
7111 if test "$use_static_libs" = built && test "$installed" = yes; then
7114 if test -n "$library_names" &&
7115 { test "$use_static_libs" = no || test -z "$old_library"; }; then
7117 *cygwin* | *mingw* | *cegcc*)
7118 # No point in relinking DLLs because paths are not encoded
7119 notinst_deplibs+=" $lib"
7123 if test "$installed" = no; then
7124 notinst_deplibs+=" $lib"
7129 # This is a shared library
7131 # Warn about portability, can't link against -module's on some
7132 # systems (darwin). Don't bleat about dlopened modules though!
7134 for dlpremoduletest in $dlprefiles; do
7135 if test "X$dlpremoduletest" = "X$lib"; then
7136 dlopenmodule="$dlpremoduletest"
7140 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
7142 if test "$linkmode" = prog; then
7143 $ECHO "*** Warning: Linking the executable $output against the loadable module"
7145 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
7147 $ECHO "*** $linklib is not portable!"
7149 if test "$linkmode" = lib &&
7150 test "$hardcode_into_libs" = yes; then
7151 # Hardcode the library path.
7152 # Skip directories that are in the system default run-time
7154 case " $sys_lib_dlsearch_path " in
7157 case "$compile_rpath " in
7159 *) compile_rpath+=" $absdir" ;;
7163 case " $sys_lib_dlsearch_path " in
7166 case "$finalize_rpath " in
7168 *) finalize_rpath+=" $libdir" ;;
7174 if test -n "$old_archive_from_expsyms_cmds"; then
7175 # figure out the soname
7176 set dummy $library_names
7180 libname=`eval "\\$ECHO \"$libname_spec\""`
7181 # use dlname if we got it. it's perfectly good, no?
7182 if test -n "$dlname"; then
7184 elif test -n "$soname_spec"; then
7187 *cygwin* | mingw* | *cegcc*)
7188 func_arith $current - $age
7189 major=$func_arith_result
7193 eval soname=\"$soname_spec\"
7198 # Make a new name for the extract_expsyms_cmds to use
7200 func_basename "$soroot"
7201 soname="$func_basename_result"
7202 func_stripname 'lib' '.dll' "$soname"
7203 newlib=libimp-$func_stripname_result.a
7205 # If the library has no export list, then create one now
7206 if test -f "$output_objdir/$soname-def"; then :
7208 func_verbose "extracting exported symbol list from \`$soname'"
7209 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
7213 if test -f "$output_objdir/$newlib"; then :; else
7214 func_verbose "generating import library for \`$soname'"
7215 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
7217 # make sure the library variables are pointing to the new library
7220 fi # test -n "$old_archive_from_expsyms_cmds"
7222 if test "$linkmode" = prog || test "$opt_mode" != relink; then
7227 case $hardcode_action in
7228 immediate | unsupported)
7229 if test "$hardcode_direct" = no; then
7232 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7233 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
7234 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
7235 *-*-unixware7*) add_dir="-L$dir" ;;
7237 # if the lib is a (non-dlopened) module then we can not
7238 # link against it, someone is ignoring the earlier warnings
7239 if /usr/bin/file -L $add 2> /dev/null |
7240 $GREP ": [^:]* bundle" >/dev/null ; then
7241 if test "X$dlopenmodule" != "X$lib"; then
7242 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
7243 if test -z "$old_library" ; then
7245 echo "*** And there doesn't seem to be a static archive available"
7246 echo "*** The link will probably fail, sorry"
7248 add="$dir/$old_library"
7250 elif test -n "$old_library"; then
7251 add="$dir/$old_library"
7255 elif test "$hardcode_minus_L" = no; then
7257 *-*-sunos*) add_shlibpath="$dir" ;;
7261 elif test "$hardcode_shlibpath_var" = no; then
7262 add_shlibpath="$dir"
7269 if test "$hardcode_direct" = yes &&
7270 test "$hardcode_direct_absolute" = no; then
7272 elif test "$hardcode_minus_L" = yes; then
7274 # Try looking first in the location we're being installed to.
7275 if test -n "$inst_prefix_dir"; then
7278 add_dir+=" -L$inst_prefix_dir$libdir"
7283 elif test "$hardcode_shlibpath_var" = yes; then
7284 add_shlibpath="$dir"
7293 if test "$lib_linked" != yes; then
7294 func_fatal_configuration "unsupported hardcode properties"
7297 if test -n "$add_shlibpath"; then
7298 case :$compile_shlibpath: in
7299 *":$add_shlibpath:"*) ;;
7300 *) compile_shlibpath+="$add_shlibpath:" ;;
7303 if test "$linkmode" = prog; then
7304 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
7305 test -n "$add" && compile_deplibs="$add $compile_deplibs"
7307 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7308 test -n "$add" && deplibs="$add $deplibs"
7309 if test "$hardcode_direct" != yes &&
7310 test "$hardcode_minus_L" != yes &&
7311 test "$hardcode_shlibpath_var" = yes; then
7312 case :$finalize_shlibpath: in
7314 *) finalize_shlibpath+="$libdir:" ;;
7320 if test "$linkmode" = prog || test "$opt_mode" = relink; then
7324 # Finalize command for both is simple: just hardcode it.
7325 if test "$hardcode_direct" = yes &&
7326 test "$hardcode_direct_absolute" = no; then
7327 add="$libdir/$linklib"
7328 elif test "$hardcode_minus_L" = yes; then
7330 elif test "$hardcode_shlibpath_var" = yes; then
7331 case :$finalize_shlibpath: in
7333 *) finalize_shlibpath+="$libdir:" ;;
7336 elif test "$hardcode_automatic" = yes; then
7337 if test -n "$inst_prefix_dir" &&
7338 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7339 add="$inst_prefix_dir$libdir/$linklib"
7341 add="$libdir/$linklib"
7344 # Try looking first in the location we're being installed to.
7345 if test -n "$inst_prefix_dir"; then
7348 add_dir+=" -L$inst_prefix_dir$libdir"
7355 if test "$linkmode" = prog; then
7356 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
7357 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
7359 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7360 test -n "$add" && deplibs="$add $deplibs"
7363 elif test "$linkmode" = prog; then
7364 # Here we assume that one of hardcode_direct or hardcode_minus_L
7365 # is not unsupported. This is valid on all known static and
7367 if test "$hardcode_direct" != unsupported; then
7368 test -n "$old_library" && linklib="$old_library"
7369 compile_deplibs="$dir/$linklib $compile_deplibs"
7370 finalize_deplibs="$dir/$linklib $finalize_deplibs"
7372 compile_deplibs="-l$name -L$dir $compile_deplibs"
7373 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
7375 elif test "$build_libtool_libs" = yes; then
7376 # Not a shared library
7377 if test "$deplibs_check_method" != pass_all; then
7378 # We're trying link a shared library against a static one
7379 # but the system doesn't support it.
7381 # Just print a warning and add the library to dependency_libs so
7382 # that the program can be linked against the static library.
7384 $ECHO "*** Warning: This system can not link to static lib archive $lib."
7385 echo "*** I have the capability to make that library automatically link in when"
7386 echo "*** you link to this library. But I can only do this if you have a"
7387 echo "*** shared version of the library, which you do not appear to have."
7388 if test "$module" = yes; then
7389 echo "*** But as you try to build a module library, libtool will still create "
7390 echo "*** a static module, that should work as long as the dlopening application"
7391 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
7392 if test -z "$global_symbol_pipe"; then
7394 echo "*** However, this would only work if libtool was able to extract symbol"
7395 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7396 echo "*** not find such a program. So, this module is probably useless."
7397 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7399 if test "$build_old_libs" = no; then
7400 build_libtool_libs=module
7403 build_libtool_libs=no
7407 deplibs="$dir/$old_library $deplibs"
7410 fi # link shared/static library?
7412 if test "$linkmode" = lib; then
7413 if test -n "$dependency_libs" &&
7414 { test "$hardcode_into_libs" != yes ||
7415 test "$build_old_libs" = yes ||
7416 test "$link_static" = yes; }; then
7417 # Extract -R from dependency_libs
7419 for libdir in $dependency_libs; do
7421 -R*) func_stripname '-R' '' "$libdir"
7422 temp_xrpath=$func_stripname_result
7424 *" $temp_xrpath "*) ;;
7425 *) xrpath+=" $temp_xrpath";;
7427 *) temp_deplibs+=" $libdir";;
7430 dependency_libs="$temp_deplibs"
7433 newlib_search_path+=" $absdir"
7434 # Link against this library
7435 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7436 # ... and its dependency_libs
7438 for deplib in $dependency_libs; do
7439 newdependency_libs="$deplib $newdependency_libs"
7441 -L*) func_stripname '-L' '' "$deplib"
7442 func_resolve_sysroot "$func_stripname_result";;
7443 *) func_resolve_sysroot "$deplib" ;;
7445 if $opt_preserve_dup_deps ; then
7446 case "$tmp_libs " in
7447 *" $func_resolve_sysroot_result "*)
7448 specialdeplibs+=" $func_resolve_sysroot_result" ;;
7451 tmp_libs+=" $func_resolve_sysroot_result"
7454 if test "$link_all_deplibs" != no; then
7455 # Add the search paths of all dependency libraries
7456 for deplib in $dependency_libs; do
7459 -L*) path="$deplib" ;;
7461 func_resolve_sysroot "$deplib"
7462 deplib=$func_resolve_sysroot_result
7463 func_dirname "$deplib" "" "."
7464 dir=$func_dirname_result
7465 # We need an absolute path.
7467 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7469 absdir=`cd "$dir" && pwd`
7470 if test -z "$absdir"; then
7471 func_warning "cannot determine absolute directory name of \`$dir'"
7476 if $GREP "^installed=no" $deplib > /dev/null; then
7480 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7481 if test -n "$deplibrary_names" ; then
7482 for tmp in $deplibrary_names ; do
7485 if test -f "$absdir/$objdir/$depdepl" ; then
7486 depdepl="$absdir/$objdir/$depdepl"
7487 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7488 if test -z "$darwin_install_name"; then
7489 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7491 compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7492 linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
7498 # OE sets installed=no in staging. We need to look in $objdir and $absdir,
7499 # preferring $objdir. RP 31/04/2008
7500 if test -f "$absdir/$objdir/$depdepl" ; then
7501 depdepl="$absdir/$objdir/$depdepl"
7502 path="-L$absdir/$objdir"
7503 elif test -f "$absdir/$depdepl" ; then
7504 depdepl="$absdir/$depdepl"
7507 path="-L$absdir/$objdir"
7512 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7513 test -z "$libdir" && \
7514 func_fatal_error "\`$deplib' is not a valid libtool archive"
7515 test "$absdir" != "$libdir" && \
7516 func_warning "\`$deplib' seems to be moved"
7522 case " $deplibs " in
7524 *) deplibs="$path $deplibs" ;;
7527 fi # link_all_deplibs != no
7529 done # for deplib in $libs
7530 if test "$pass" = link; then
7531 if test "$linkmode" = "prog"; then
7532 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7533 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7535 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7538 dependency_libs="$newdependency_libs"
7539 if test "$pass" = dlpreopen; then
7540 # Link the dlpreopened libraries before other libraries
7541 for deplib in $save_deplibs; do
7542 deplibs="$deplib $deplibs"
7545 if test "$pass" != dlopen; then
7546 if test "$pass" != conv; then
7547 # Make sure lib_search_path contains only unique directories.
7549 for dir in $newlib_search_path; do
7550 case "$lib_search_path " in
7552 *) lib_search_path+=" $dir" ;;
7558 if test "$linkmode,$pass" != "prog,link"; then
7561 vars="compile_deplibs finalize_deplibs"
7563 for var in $vars dependency_libs; do
7564 # Add libraries to $var in reverse order
7565 eval tmp_libs=\"\$$var\"
7567 for deplib in $tmp_libs; do
7568 # FIXME: Pedantically, this is the right thing to do, so
7569 # that some nasty dependency loop isn't accidentally
7571 #new_libs="$deplib $new_libs"
7572 # Pragmatically, this seems to cause very few problems in
7575 -L*) new_libs="$deplib $new_libs" ;;
7578 # And here is the reason: when a library appears more
7579 # than once as an explicit dependence of a library, or
7580 # is implicitly linked in more than once by the
7581 # compiler, it is considered special, and multiple
7582 # occurrences thereof are not removed. Compare this
7583 # with having the same library being listed as a
7584 # dependency of multiple other libraries: in this case,
7585 # we know (pedantically, we assume) the library does not
7586 # need to be listed more than once, so we keep only the
7587 # last copy. This is not always right, but it is rare
7588 # enough that we require users that really mean to play
7589 # such unportable linking tricks to link the library
7590 # using -Wl,-lname, so that libtool does not consider it
7591 # for duplicate removal.
7592 case " $specialdeplibs " in
7593 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7595 case " $new_libs " in
7597 *) new_libs="$deplib $new_libs" ;;
7605 for deplib in $new_libs; do
7608 case " $tmp_libs " in
7610 *) tmp_libs+=" $deplib" ;;
7613 *) tmp_libs+=" $deplib" ;;
7616 eval $var=\"$tmp_libs\"
7619 # Last step: remove runtime libs from dependency_libs
7620 # (they stay in deplibs)
7622 for i in $dependency_libs ; do
7623 case " $predeps $postdeps $compiler_lib_search_path " in
7628 if test -n "$i" ; then
7632 dependency_libs=$tmp_libs
7634 if test "$linkmode" = prog; then
7635 dlfiles="$newdlfiles"
7637 if test "$linkmode" = prog || test "$linkmode" = lib; then
7638 dlprefiles="$newdlprefiles"
7643 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7644 func_warning "\`-dlopen' is ignored for archives"
7649 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7652 test -n "$rpath" && \
7653 func_warning "\`-rpath' is ignored for archives"
7655 test -n "$xrpath" && \
7656 func_warning "\`-R' is ignored for archives"
7658 test -n "$vinfo" && \
7659 func_warning "\`-version-info/-version-number' is ignored for archives"
7661 test -n "$release" && \
7662 func_warning "\`-release' is ignored for archives"
7664 test -n "$export_symbols$export_symbols_regex" && \
7665 func_warning "\`-export-symbols' is ignored for archives"
7667 # Now set the variables for building old libraries.
7668 build_libtool_libs=no
7670 objs+="$old_deplibs"
7674 # Make sure we only generate libraries of the form `libNAME.la'.
7677 func_stripname 'lib' '.la' "$outputname"
7678 name=$func_stripname_result
7679 eval shared_ext=\"$shrext_cmds\"
7680 eval libname=\"$libname_spec\"
7683 test "$module" = no && \
7684 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7686 if test "$need_lib_prefix" != no; then
7687 # Add the "lib" prefix for modules if required
7688 func_stripname '' '.la' "$outputname"
7689 name=$func_stripname_result
7690 eval shared_ext=\"$shrext_cmds\"
7691 eval libname=\"$libname_spec\"
7693 func_stripname '' '.la' "$outputname"
7694 libname=$func_stripname_result
7699 if test -n "$objs"; then
7700 if test "$deplibs_check_method" != pass_all; then
7701 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7704 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7705 $ECHO "*** objects $objs is not portable!"
7710 test "$dlself" != no && \
7711 func_warning "\`-dlopen self' is ignored for libtool libraries"
7715 test "$#" -gt 1 && \
7716 func_warning "ignoring multiple \`-rpath's for a libtool library"
7721 if test -z "$rpath"; then
7722 if test "$build_libtool_libs" = yes; then
7723 # Building a libtool convenience library.
7724 # Some compilers have problems with a `.al' extension so
7725 # convenience libraries should have the same extension an
7726 # archive normally would.
7727 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7728 build_libtool_libs=convenience
7732 test -n "$vinfo" && \
7733 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7735 test -n "$release" && \
7736 func_warning "\`-release' is ignored for convenience libraries"
7739 # Parse the version information argument.
7740 save_ifs="$IFS"; IFS=':'
7741 set dummy $vinfo 0 0 0
7746 func_fatal_help "too many parameters to \`-version-info'"
7748 # convert absolute version numbers to libtool ages
7749 # this retains compatibility with .la files and attempts
7750 # to make the code below a bit more comprehensible
7752 case $vinfo_number in
7756 number_revision="$3"
7758 # There are really only two kinds -- those that
7759 # use the current revision as the major version
7760 # and those that subtract age and use age as
7761 # a minor version. But, then there is irix
7762 # which has an extra 1 added just for fun
7764 case $version_type in
7765 darwin|linux|osf|windows|none)
7766 func_arith $number_major + $number_minor
7767 current=$func_arith_result
7769 revision="$number_revision"
7771 freebsd-aout|freebsd-elf|qnx|sunos)
7772 current="$number_major"
7773 revision="$number_minor"
7777 func_arith $number_major + $number_minor
7778 current=$func_arith_result
7780 revision="$number_minor"
7781 lt_irix_increment=no
7792 # Check that each of the things are valid numbers.
7794 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]) ;;
7796 func_error "CURRENT \`$current' must be a nonnegative integer"
7797 func_fatal_error "\`$vinfo' is not valid version information"
7802 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]) ;;
7804 func_error "REVISION \`$revision' must be a nonnegative integer"
7805 func_fatal_error "\`$vinfo' is not valid version information"
7810 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]) ;;
7812 func_error "AGE \`$age' must be a nonnegative integer"
7813 func_fatal_error "\`$vinfo' is not valid version information"
7817 if test "$age" -gt "$current"; then
7818 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7819 func_fatal_error "\`$vinfo' is not valid version information"
7822 # Calculate the version variables.
7826 case $version_type in
7830 # Like Linux, but with the current version available in
7831 # verstring for coding it into the library header
7832 func_arith $current - $age
7833 major=.$func_arith_result
7834 versuffix="$major.$age.$revision"
7835 # Darwin ld doesn't like 0 for these options...
7836 func_arith $current + 1
7837 minor_current=$func_arith_result
7838 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7839 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7844 versuffix=".$current.$revision";
7849 versuffix=".$current"
7853 if test "X$lt_irix_increment" = "Xno"; then
7854 func_arith $current - $age
7856 func_arith $current - $age + 1
7858 major=$func_arith_result
7860 case $version_type in
7861 nonstopux) verstring_prefix=nonstopux ;;
7862 *) verstring_prefix=sgi ;;
7864 verstring="$verstring_prefix$major.$revision"
7866 # Add in all the interfaces that we are compatible with.
7868 while test "$loop" -ne 0; do
7869 func_arith $revision - $loop
7870 iface=$func_arith_result
7871 func_arith $loop - 1
7872 loop=$func_arith_result
7873 verstring="$verstring_prefix$major.$iface:$verstring"
7876 # Before this point, $major must not contain `.'.
7878 versuffix="$major.$revision"
7882 func_arith $current - $age
7883 major=.$func_arith_result
7884 versuffix="$major.$age.$revision"
7888 func_arith $current - $age
7889 major=.$func_arith_result
7890 versuffix=".$current.$age.$revision"
7891 verstring="$current.$age.$revision"
7893 # Add in all the interfaces that we are compatible with.
7895 while test "$loop" -ne 0; do
7896 func_arith $current - $loop
7897 iface=$func_arith_result
7898 func_arith $loop - 1
7899 loop=$func_arith_result
7900 verstring="$verstring:${iface}.0"
7903 # Make executables depend on our current version.
7904 verstring+=":${current}.0"
7909 versuffix=".$current"
7914 versuffix=".$current.$revision"
7918 # Use '-' rather than '.', since we only want one
7919 # extension on DOS 8.3 filesystems.
7920 func_arith $current - $age
7921 major=$func_arith_result
7926 func_fatal_configuration "unknown library version type \`$version_type'"
7930 # Clear the version info if we defaulted, and they specified a release.
7931 if test -z "$vinfo" && test -n "$release"; then
7933 case $version_type in
7935 # we can't check for "0.0" in archive_cmds due to quoting
7936 # problems, so we reset it completely
7943 if test "$need_version" = no; then
7950 # Remove version info from name if versioning should be avoided
7951 if test "$avoid_version" = yes && test "$need_version" = no; then
7957 # Check to see if the archive will have undefined symbols.
7958 if test "$allow_undefined" = yes; then
7959 if test "$allow_undefined_flag" = unsupported; then
7960 func_warning "undefined symbols not allowed in $host shared libraries"
7961 build_libtool_libs=no
7965 # Don't allow undefined symbols.
7966 allow_undefined_flag="$no_undefined_flag"
7971 func_generate_dlsyms "$libname" "$libname" "yes"
7972 libobjs+=" $symfileobj"
7973 test "X$libobjs" = "X " && libobjs=
7975 if test "$opt_mode" != relink; then
7976 # Remove our outputs, but don't remove object files since they
7977 # may have been created when compiling PIC objects.
7979 tempremovelist=`$ECHO "$output_objdir/*"`
7980 for p in $tempremovelist; do
7984 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7985 if test "X$precious_files_regex" != "X"; then
7986 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7996 test -n "$removelist" && \
7997 func_show_eval "${RM}r \$removelist"
8000 # Now set the variables for building old libraries.
8001 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8002 oldlibs+=" $output_objdir/$libname.$libext"
8004 # Transform .lo files to .o files.
8005 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
8008 # Eliminate all temporary directories.
8009 #for path in $notinst_path; do
8010 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
8011 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
8012 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
8015 if test -n "$xrpath"; then
8016 # If the user specified any rpath flags, then add them.
8018 for libdir in $xrpath; do
8019 func_replace_sysroot "$libdir"
8020 temp_xrpath+=" -R$func_replace_sysroot_result"
8021 case "$finalize_rpath " in
8023 *) finalize_rpath+=" $libdir" ;;
8026 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
8027 dependency_libs="$temp_xrpath $dependency_libs"
8031 # Make sure dlfiles contains only unique files that won't be dlpreopened
8032 old_dlfiles="$dlfiles"
8034 for lib in $old_dlfiles; do
8035 case " $dlprefiles $dlfiles " in
8037 *) dlfiles+=" $lib" ;;
8041 # Make sure dlprefiles contains only unique files
8042 old_dlprefiles="$dlprefiles"
8044 for lib in $old_dlprefiles; do
8045 case "$dlprefiles " in
8047 *) dlprefiles+=" $lib" ;;
8051 if test "$build_libtool_libs" = yes; then
8052 if test -n "$rpath"; then
8054 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
8055 # these systems don't actually have a c library (as such)!
8057 *-*-rhapsody* | *-*-darwin1.[012])
8058 # Rhapsody C library is in the System framework
8059 deplibs+=" System.ltframework"
8062 # Don't link with libc until the a.out ld.so is fixed.
8064 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
8065 # Do not include libc due to us having libc/libc_r.
8067 *-*-sco3.2v5* | *-*-sco5v6*)
8068 # Causes problems with __ctype
8070 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
8071 # Compiler inserts libc in the correct place for threads to work
8074 # Add libc to deplibs on all other systems if necessary.
8075 if test "$build_libtool_need_lc" = "yes"; then
8082 # Transform deplibs into only deplibs that can be linked in shared.
8084 libname_save=$libname
8085 release_save=$release
8086 versuffix_save=$versuffix
8088 # I'm not sure if I'm treating the release correctly. I think
8089 # release should show up in the -l (ie -lgmp5) so we don't want to
8090 # add it in twice. Is that correct?
8096 case $deplibs_check_method in
8098 # Don't check for shared/static. Everything works.
8099 # This might be a little naive. We might want to check
8100 # whether the library exists or not. But this is on
8101 # osf3 & osf4 and I'm not really sure... Just
8102 # implementing what was already the behavior.
8106 # This code stresses the "libraries are programs" paradigm to its
8107 # limits. Maybe even breaks it. We compile a program, linking it
8108 # against the deplibs as a proxy for the library. Then we can check
8109 # whether they linked in statically or dynamically with ldd.
8110 $opt_dry_run || $RM conftest.c
8111 cat > conftest.c <<EOF
8112 int main() { return 0; }
8114 $opt_dry_run || $RM conftest
8115 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
8116 ldd_output=`ldd conftest`
8117 for i in $deplibs; do
8120 func_stripname -l '' "$i"
8121 name=$func_stripname_result
8122 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8123 case " $predeps $postdeps " in
8130 if test -n "$i" ; then
8131 libname=`eval "\\$ECHO \"$libname_spec\""`
8132 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8133 set dummy $deplib_matches; shift
8135 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8140 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8141 echo "*** I have the capability to make that library automatically link in when"
8142 echo "*** you link to this library. But I can only do this if you have a"
8143 echo "*** shared version of the library, which I believe you do not have"
8144 echo "*** because a test_compile did reveal that the linker did not use it for"
8145 echo "*** its dynamic dependency list that programs get resolved with at runtime."
8155 # Error occurred in the first compile. Let's try to salvage
8156 # the situation: Compile a separate program for each library.
8157 for i in $deplibs; do
8160 func_stripname -l '' "$i"
8161 name=$func_stripname_result
8162 $opt_dry_run || $RM conftest
8163 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
8164 ldd_output=`ldd conftest`
8165 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8166 case " $predeps $postdeps " in
8173 if test -n "$i" ; then
8174 libname=`eval "\\$ECHO \"$libname_spec\""`
8175 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8176 set dummy $deplib_matches; shift
8178 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8183 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8184 echo "*** I have the capability to make that library automatically link in when"
8185 echo "*** you link to this library. But I can only do this if you have a"
8186 echo "*** shared version of the library, which you do not appear to have"
8187 echo "*** because a test_compile did reveal that the linker did not use this one"
8188 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
8194 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
8195 echo "*** make it link in! You will probably need to install it or some"
8196 echo "*** library that it depends on before this library will be fully"
8197 echo "*** functional. Installing it before continuing would be even better."
8208 set dummy $deplibs_check_method; shift
8209 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8210 for a_deplib in $deplibs; do
8213 func_stripname -l '' "$a_deplib"
8214 name=$func_stripname_result
8215 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8216 case " $predeps $postdeps " in
8218 newdeplibs+=" $a_deplib"
8223 if test -n "$a_deplib" ; then
8224 libname=`eval "\\$ECHO \"$libname_spec\""`
8225 if test -n "$file_magic_glob"; then
8226 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
8228 libnameglob=$libname
8230 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
8231 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8232 if test "$want_nocaseglob" = yes; then
8234 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8237 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8239 for potent_lib in $potential_libs; do
8240 # Follow soft links.
8241 if ls -lLd "$potent_lib" 2>/dev/null |
8242 $GREP " -> " >/dev/null; then
8245 # The statement above tries to avoid entering an
8246 # endless loop below, in case of cyclic links.
8247 # We might still enter an endless loop, since a link
8248 # loop can be closed while we follow links,
8250 potlib="$potent_lib"
8251 while test -h "$potlib" 2>/dev/null; do
8252 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
8254 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8255 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
8258 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
8260 $EGREP "$file_magic_regex" > /dev/null; then
8261 newdeplibs+=" $a_deplib"
8268 if test -n "$a_deplib" ; then
8271 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8272 echo "*** I have the capability to make that library automatically link in when"
8273 echo "*** you link to this library. But I can only do this if you have a"
8274 echo "*** shared version of the library, which you do not appear to have"
8275 echo "*** because I did check the linker path looking for a file starting"
8276 if test -z "$potlib" ; then
8277 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
8279 $ECHO "*** with $libname and none of the candidates passed a file format test"
8280 $ECHO "*** using a file magic. Last file checked: $potlib"
8285 # Add a -L argument.
8286 newdeplibs+=" $a_deplib"
8289 done # Gone through all deplibs.
8292 set dummy $deplibs_check_method; shift
8293 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8294 for a_deplib in $deplibs; do
8297 func_stripname -l '' "$a_deplib"
8298 name=$func_stripname_result
8299 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8300 case " $predeps $postdeps " in
8302 newdeplibs+=" $a_deplib"
8307 if test -n "$a_deplib" ; then
8308 libname=`eval "\\$ECHO \"$libname_spec\""`
8309 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8310 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
8311 for potent_lib in $potential_libs; do
8312 potlib="$potent_lib" # see symlink-check above in file_magic test
8313 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
8314 $EGREP "$match_pattern_regex" > /dev/null; then
8315 newdeplibs+=" $a_deplib"
8322 if test -n "$a_deplib" ; then
8325 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8326 echo "*** I have the capability to make that library automatically link in when"
8327 echo "*** you link to this library. But I can only do this if you have a"
8328 echo "*** shared version of the library, which you do not appear to have"
8329 echo "*** because I did check the linker path looking for a file starting"
8330 if test -z "$potlib" ; then
8331 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
8333 $ECHO "*** with $libname and none of the candidates passed a file format test"
8334 $ECHO "*** using a regex pattern. Last file checked: $potlib"
8339 # Add a -L argument.
8340 newdeplibs+=" $a_deplib"
8343 done # Gone through all deplibs.
8347 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
8348 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8349 for i in $predeps $postdeps ; do
8350 # can't use Xsed below, because $i might contain '/'
8351 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
8354 case $tmp_deplibs in
8357 if test "X$deplibs_check_method" = "Xnone"; then
8358 echo "*** Warning: inter-library dependencies are not supported in this platform."
8360 echo "*** Warning: inter-library dependencies are not known to be supported."
8362 echo "*** All declared inter-library dependencies are being dropped."
8368 versuffix=$versuffix_save
8370 release=$release_save
8371 libname=$libname_save
8375 *-*-rhapsody* | *-*-darwin1.[012])
8376 # On Rhapsody replace the C library with the System framework
8377 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
8381 if test "$droppeddeps" = yes; then
8382 if test "$module" = yes; then
8384 echo "*** Warning: libtool could not satisfy all declared inter-library"
8385 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
8386 echo "*** a static module, that should work as long as the dlopening"
8387 echo "*** application is linked with the -dlopen flag."
8388 if test -z "$global_symbol_pipe"; then
8390 echo "*** However, this would only work if libtool was able to extract symbol"
8391 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8392 echo "*** not find such a program. So, this module is probably useless."
8393 echo "*** \`nm' from GNU binutils and a full rebuild may help."
8395 if test "$build_old_libs" = no; then
8396 oldlibs="$output_objdir/$libname.$libext"
8397 build_libtool_libs=module
8400 build_libtool_libs=no
8403 echo "*** The inter-library dependencies that have been dropped here will be"
8404 echo "*** automatically added whenever a program is linked with this library"
8405 echo "*** or is declared to -dlopen it."
8407 if test "$allow_undefined" = no; then
8409 echo "*** Since this library must not contain undefined symbols,"
8410 echo "*** because either the platform does not support them or"
8411 echo "*** it was explicitly requested with -no-undefined,"
8412 echo "*** libtool will only create a static version of it."
8413 if test "$build_old_libs" = no; then
8414 oldlibs="$output_objdir/$libname.$libext"
8415 build_libtool_libs=module
8418 build_libtool_libs=no
8423 # Done checking deplibs!
8426 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8429 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8430 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8431 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8435 # move library search paths that coincide with paths to not yet
8436 # installed libraries to the beginning of the library search list
8438 for path in $notinst_path; do
8439 case " $new_libs " in
8440 *" -L$path/$objdir "*) ;;
8442 case " $deplibs " in
8443 *" -L$path/$objdir "*)
8444 new_libs+=" -L$path/$objdir" ;;
8449 for deplib in $deplibs; do
8452 case " $new_libs " in
8454 *) new_libs+=" $deplib" ;;
8457 *) new_libs+=" $deplib" ;;
8462 # All the library-specific variables (install_libdir is set above).
8467 # Test again, we may have decided not to build it any more
8468 if test "$build_libtool_libs" = yes; then
8469 if test "$hardcode_into_libs" = yes; then
8470 # Hardcode the library paths
8473 rpath="$finalize_rpath"
8474 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8475 for libdir in $rpath; do
8476 if test -n "$hardcode_libdir_flag_spec"; then
8477 if test -n "$hardcode_libdir_separator"; then
8478 func_replace_sysroot "$libdir"
8479 libdir=$func_replace_sysroot_result
8480 if test -z "$hardcode_libdirs"; then
8481 hardcode_libdirs="$libdir"
8483 # Just accumulate the unique libdirs.
8484 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8485 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8488 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
8493 eval flag=\"$hardcode_libdir_flag_spec\"
8496 elif test -n "$runpath_var"; then
8497 case "$perm_rpath " in
8499 *) perm_rpath+=" $libdir" ;;
8503 # Substitute the hardcoded libdirs into the rpath.
8504 if test -n "$hardcode_libdir_separator" &&
8505 test -n "$hardcode_libdirs"; then
8506 libdir="$hardcode_libdirs"
8507 if test -n "$hardcode_libdir_flag_spec_ld"; then
8508 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
8510 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
8513 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8514 # We should set the runpath_var.
8516 for dir in $perm_rpath; do
8519 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8521 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8524 shlibpath="$finalize_shlibpath"
8525 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8526 if test -n "$shlibpath"; then
8527 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8530 # Get the real and link names of the library.
8531 eval shared_ext=\"$shrext_cmds\"
8532 eval library_names=\"$library_names_spec\"
8533 set dummy $library_names
8538 if test -n "$soname_spec"; then
8539 eval soname=\"$soname_spec\"
8543 if test -z "$dlname"; then
8547 lib="$output_objdir/$realname"
8554 # Use standard objects if they are pic
8555 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8556 test "X$libobjs" = "X " && libobjs=
8559 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8560 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8561 export_symbols="$output_objdir/$libname.uexp"
8562 delfiles+=" $export_symbols"
8565 orig_export_symbols=
8567 cygwin* | mingw* | cegcc*)
8568 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8569 # exporting using user supplied symfile
8570 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8571 # and it's NOT already a .def file. Must figure out
8572 # which of the given symbols are data symbols and tag
8573 # them as such. So, trigger use of export_symbols_cmds.
8574 # export_symbols gets reassigned inside the "prepare
8575 # the list of exported symbols" if statement, so the
8576 # include_expsyms logic still works.
8577 orig_export_symbols="$export_symbols"
8579 always_export_symbols=yes
8585 # Prepare the list of exported symbols
8586 if test -z "$export_symbols"; then
8587 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8588 func_verbose "generating symbol list for \`$libname.la'"
8589 export_symbols="$output_objdir/$libname.exp"
8590 $opt_dry_run || $RM $export_symbols
8591 cmds=$export_symbols_cmds
8592 save_ifs="$IFS"; IFS='~'
8593 for cmd1 in $cmds; do
8595 # Take the normal branch if the nm_file_list_spec branch
8596 # doesn't work or if tool conversion is not needed.
8597 case $nm_file_list_spec~$to_tool_file_cmd in
8598 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8599 try_normal_branch=yes
8602 len=$func_len_result
8605 try_normal_branch=no
8608 if test "$try_normal_branch" = yes \
8609 && { test "$len" -lt "$max_cmd_len" \
8610 || test "$max_cmd_len" -le -1; }
8612 func_show_eval "$cmd" 'exit $?'
8613 skipped_export=false
8614 elif test -n "$nm_file_list_spec"; then
8615 func_basename "$output"
8616 output_la=$func_basename_result
8617 save_libobjs=$libobjs
8619 output=${output_objdir}/${output_la}.nm
8620 func_to_tool_file "$output"
8621 libobjs=$nm_file_list_spec$func_to_tool_file_result
8622 delfiles+=" $output"
8623 func_verbose "creating $NM input file list: $output"
8624 for obj in $save_libobjs; do
8625 func_to_tool_file "$obj"
8626 $ECHO "$func_to_tool_file_result"
8629 func_show_eval "$cmd" 'exit $?'
8631 libobjs=$save_libobjs
8632 skipped_export=false
8634 # The command line is too long to execute in one step.
8635 func_verbose "using reloadable object file for export list..."
8637 # Break out early, otherwise skipped_export may be
8638 # set to false by a later but shorter cmd.
8643 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8644 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8645 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8650 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8651 tmp_export_symbols="$export_symbols"
8652 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8653 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8656 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8657 # The given exports_symbols file has to be filtered, so filter it.
8658 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8659 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8660 # 's' commands which not all seds can handle. GNU sed should be fine
8661 # though. Also, the filter scales superlinearly with the number of
8662 # global variables. join(1) would be nice here, but unfortunately
8663 # isn't a blessed tool.
8664 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8665 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8666 export_symbols=$output_objdir/$libname.def
8667 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8671 for test_deplib in $deplibs; do
8672 case " $convenience " in
8673 *" $test_deplib "*) ;;
8675 tmp_deplibs+=" $test_deplib"
8679 deplibs="$tmp_deplibs"
8681 if test -n "$convenience"; then
8682 if test -n "$whole_archive_flag_spec" &&
8683 test "$compiler_needs_object" = yes &&
8684 test -z "$libobjs"; then
8685 # extract the archives, so we have objects to list.
8686 # TODO: could optimize this to just extract one archive.
8687 whole_archive_flag_spec=
8689 if test -n "$whole_archive_flag_spec"; then
8690 save_libobjs=$libobjs
8691 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8692 test "X$libobjs" = "X " && libobjs=
8694 gentop="$output_objdir/${outputname}x"
8695 generated+=" $gentop"
8697 func_extract_archives $gentop $convenience
8698 libobjs+=" $func_extract_archives_result"
8699 test "X$libobjs" = "X " && libobjs=
8703 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8704 eval flag=\"$thread_safe_flag_spec\"
8705 linker_flags+=" $flag"
8708 # Make a backup of the uninstalled library when relinking
8709 if test "$opt_mode" = relink; then
8710 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8713 # Do each of the archive commands.
8714 if test "$module" = yes && test -n "$module_cmds" ; then
8715 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8716 eval test_cmds=\"$module_expsym_cmds\"
8717 cmds=$module_expsym_cmds
8719 eval test_cmds=\"$module_cmds\"
8723 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8724 eval test_cmds=\"$archive_expsym_cmds\"
8725 cmds=$archive_expsym_cmds
8727 eval test_cmds=\"$archive_cmds\"
8732 if test "X$skipped_export" != "X:" &&
8733 func_len " $test_cmds" &&
8734 len=$func_len_result &&
8735 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8738 # The command line is too long to link in one step, link piecewise
8739 # or, if using GNU ld and skipped_export is not :, use a linker
8742 # Save the value of $output and $libobjs because we want to
8743 # use them later. If we have whole_archive_flag_spec, we
8744 # want to use save_libobjs as it was before
8745 # whole_archive_flag_spec was expanded, because we can't
8746 # assume the linker understands whole_archive_flag_spec.
8747 # This may have to be revisited, in case too many
8748 # convenience libraries get linked in and end up exceeding
8750 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8751 save_libobjs=$libobjs
8754 func_basename "$output"
8755 output_la=$func_basename_result
8757 # Clear the reloadable object creation command queue and
8758 # initialize k to one.
8765 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8766 output=${output_objdir}/${output_la}.lnkscript
8767 func_verbose "creating GNU ld script: $output"
8768 echo 'INPUT (' > $output
8769 for obj in $save_libobjs
8771 func_to_tool_file "$obj"
8772 $ECHO "$func_to_tool_file_result" >> $output
8775 delfiles+=" $output"
8776 func_to_tool_file "$output"
8777 output=$func_to_tool_file_result
8778 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8779 output=${output_objdir}/${output_la}.lnk
8780 func_verbose "creating linker input file list: $output"
8785 if test "$compiler_needs_object" = yes; then
8791 func_to_tool_file "$obj"
8792 $ECHO "$func_to_tool_file_result" >> $output
8794 delfiles+=" $output"
8795 func_to_tool_file "$output"
8796 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8798 if test -n "$save_libobjs"; then
8799 func_verbose "creating reloadable object files..."
8800 output=$output_objdir/$output_la-${k}.$objext
8801 eval test_cmds=\"$reload_cmds\"
8802 func_len " $test_cmds"
8803 len0=$func_len_result
8806 # Loop over the list of objects to be linked.
8807 for obj in $save_libobjs
8810 func_arith $len + $func_len_result
8811 len=$func_arith_result
8812 if test "X$objlist" = X ||
8813 test "$len" -lt "$max_cmd_len"; then
8816 # The command $test_cmds is almost too long, add a
8817 # command to the queue.
8818 if test "$k" -eq 1 ; then
8819 # The first file doesn't have a previous command to add.
8820 reload_objs=$objlist
8821 eval concat_cmds=\"$reload_cmds\"
8823 # All subsequent reloadable object files will link in
8824 # the last one created.
8825 reload_objs="$objlist $last_robj"
8826 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8828 last_robj=$output_objdir/$output_la-${k}.$objext
8830 k=$func_arith_result
8831 output=$output_objdir/$output_la-${k}.$objext
8833 func_len " $last_robj"
8834 func_arith $len0 + $func_len_result
8835 len=$func_arith_result
8838 # Handle the remaining objects by creating one last
8839 # reloadable object file. All subsequent reloadable object
8840 # files will link in the last one created.
8841 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8842 reload_objs="$objlist $last_robj"
8843 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8844 if test -n "$last_robj"; then
8845 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8847 delfiles+=" $output"
8853 if ${skipped_export-false}; then
8854 func_verbose "generating symbol list for \`$libname.la'"
8855 export_symbols="$output_objdir/$libname.exp"
8856 $opt_dry_run || $RM $export_symbols
8858 # Append the command to create the export file.
8859 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8860 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8861 if test -n "$last_robj"; then
8862 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8866 test -n "$save_libobjs" &&
8867 func_verbose "creating a temporary reloadable object file: $output"
8869 # Loop through the commands generated above and execute them.
8870 save_ifs="$IFS"; IFS='~'
8871 for cmd in $concat_cmds; do
8874 func_quote_for_expand "$cmd"
8875 eval "func_echo $func_quote_for_expand_result"
8877 $opt_dry_run || eval "$cmd" || {
8880 # Restore the uninstalled library and exit
8881 if test "$opt_mode" = relink; then
8882 ( cd "$output_objdir" && \
8883 $RM "${realname}T" && \
8884 $MV "${realname}U" "$realname" )
8892 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8893 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8894 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8898 if ${skipped_export-false}; then
8899 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8900 tmp_export_symbols="$export_symbols"
8901 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8902 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8905 if test -n "$orig_export_symbols"; then
8906 # The given exports_symbols file has to be filtered, so filter it.
8907 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8908 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8909 # 's' commands which not all seds can handle. GNU sed should be fine
8910 # though. Also, the filter scales superlinearly with the number of
8911 # global variables. join(1) would be nice here, but unfortunately
8912 # isn't a blessed tool.
8913 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8914 delfiles+=" $export_symbols $output_objdir/$libname.filter"
8915 export_symbols=$output_objdir/$libname.def
8916 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8921 # Restore the value of output.
8924 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8925 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8926 test "X$libobjs" = "X " && libobjs=
8928 # Expand the library linking commands again to reset the
8929 # value of $libobjs for piecewise linking.
8931 # Do each of the archive commands.
8932 if test "$module" = yes && test -n "$module_cmds" ; then
8933 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8934 cmds=$module_expsym_cmds
8939 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8940 cmds=$archive_expsym_cmds
8947 if test -n "$delfiles"; then
8948 # Append the command to remove temporary files to $cmds.
8949 eval cmds=\"\$cmds~\$RM $delfiles\"
8952 # Add any objects from preloaded convenience libraries
8953 if test -n "$dlprefiles"; then
8954 gentop="$output_objdir/${outputname}x"
8955 generated+=" $gentop"
8957 func_extract_archives $gentop $dlprefiles
8958 libobjs+=" $func_extract_archives_result"
8959 test "X$libobjs" = "X " && libobjs=
8962 save_ifs="$IFS"; IFS='~'
8963 for cmd in $cmds; do
8967 func_quote_for_expand "$cmd"
8968 eval "func_echo $func_quote_for_expand_result"
8970 $opt_dry_run || eval "$cmd" || {
8973 # Restore the uninstalled library and exit
8974 if test "$opt_mode" = relink; then
8975 ( cd "$output_objdir" && \
8976 $RM "${realname}T" && \
8977 $MV "${realname}U" "$realname" )
8985 # Restore the uninstalled library and exit
8986 if test "$opt_mode" = relink; then
8987 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8989 if test -n "$convenience"; then
8990 if test -z "$whole_archive_flag_spec"; then
8991 func_show_eval '${RM}r "$gentop"'
8998 # Create links to the real library.
8999 for linkname in $linknames; do
9000 if test "$realname" != "$linkname"; then
9001 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
9005 # If -module or -export-dynamic was specified, set the dlname.
9006 if test "$module" = yes || test "$export_dynamic" = yes; then
9007 # On all known operating systems, these are identical.
9014 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9015 func_warning "\`-dlopen' is ignored for objects"
9020 func_warning "\`-l' and \`-L' are ignored for objects" ;;
9023 test -n "$rpath" && \
9024 func_warning "\`-rpath' is ignored for objects"
9026 test -n "$xrpath" && \
9027 func_warning "\`-R' is ignored for objects"
9029 test -n "$vinfo" && \
9030 func_warning "\`-version-info' is ignored for objects"
9032 test -n "$release" && \
9033 func_warning "\`-release' is ignored for objects"
9037 test -n "$objs$old_deplibs" && \
9038 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
9042 obj=$func_lo2o_result
9050 # Delete the old objects.
9051 $opt_dry_run || $RM $obj $libobj
9053 # Objects from convenience libraries. This assumes
9054 # single-version convenience libraries. Whenever we create
9055 # different ones for PIC/non-PIC, this we'll have to duplicate
9059 # reload_cmds runs $LD directly, so let us get rid of
9060 # -Wl from whole_archive_flag_spec and hope we can get by with
9061 # turning comma into space..
9064 if test -n "$convenience"; then
9065 if test -n "$whole_archive_flag_spec"; then
9066 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
9067 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
9069 gentop="$output_objdir/${obj}x"
9070 generated+=" $gentop"
9072 func_extract_archives $gentop $convenience
9073 reload_conv_objs="$reload_objs $func_extract_archives_result"
9077 # If we're not building shared, we need to use non_pic_objs
9078 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
9080 # Create the old-style object.
9081 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
9084 func_execute_cmds "$reload_cmds" 'exit $?'
9086 # Exit if we aren't doing a library object file.
9087 if test -z "$libobj"; then
9088 if test -n "$gentop"; then
9089 func_show_eval '${RM}r "$gentop"'
9095 if test "$build_libtool_libs" != yes; then
9096 if test -n "$gentop"; then
9097 func_show_eval '${RM}r "$gentop"'
9100 # Create an invalid libtool object if no PIC, so that we don't
9101 # accidentally link it into a program.
9102 # $show "echo timestamp > $libobj"
9103 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
9107 if test -n "$pic_flag" || test "$pic_mode" != default; then
9108 # Only do commands if we really have different PIC objects.
9109 reload_objs="$libobjs $reload_conv_objs"
9111 func_execute_cmds "$reload_cmds" 'exit $?'
9114 if test -n "$gentop"; then
9115 func_show_eval '${RM}r "$gentop"'
9123 *cygwin*) func_stripname '' '.exe' "$output"
9124 output=$func_stripname_result.exe;;
9126 test -n "$vinfo" && \
9127 func_warning "\`-version-info' is ignored for programs"
9129 test -n "$release" && \
9130 func_warning "\`-release' is ignored for programs"
9132 test "$preload" = yes \
9133 && test "$dlopen_support" = unknown \
9134 && test "$dlopen_self" = unknown \
9135 && test "$dlopen_self_static" = unknown && \
9136 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
9139 *-*-rhapsody* | *-*-darwin1.[012])
9140 # On Rhapsody replace the C library is the System framework
9141 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
9142 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
9148 # Don't allow lazy linking, it breaks C++ global constructors
9149 # But is supposedly fixed on 10.4 or later (yay!).
9150 if test "$tagname" = CXX ; then
9151 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
9153 compile_command+=" ${wl}-bind_at_load"
9154 finalize_command+=" ${wl}-bind_at_load"
9158 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9159 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9160 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9165 # move library search paths that coincide with paths to not yet
9166 # installed libraries to the beginning of the library search list
9168 for path in $notinst_path; do
9169 case " $new_libs " in
9170 *" -L$path/$objdir "*) ;;
9172 case " $compile_deplibs " in
9173 *" -L$path/$objdir "*)
9174 new_libs+=" -L$path/$objdir" ;;
9179 for deplib in $compile_deplibs; do
9182 case " $new_libs " in
9184 *) new_libs+=" $deplib" ;;
9187 *) new_libs+=" $deplib" ;;
9190 compile_deplibs="$new_libs"
9193 compile_command+=" $compile_deplibs"
9194 finalize_command+=" $finalize_deplibs"
9196 if test -n "$rpath$xrpath"; then
9197 # If the user specified any rpath flags, then add them.
9198 for libdir in $rpath $xrpath; do
9199 # This is the magic to use -rpath.
9200 case "$finalize_rpath " in
9202 *) finalize_rpath+=" $libdir" ;;
9207 # Now hardcode the library paths
9210 for libdir in $compile_rpath $finalize_rpath; do
9211 if test -n "$hardcode_libdir_flag_spec"; then
9212 if test -n "$hardcode_libdir_separator"; then
9213 if test -z "$hardcode_libdirs"; then
9214 hardcode_libdirs="$libdir"
9216 # Just accumulate the unique libdirs.
9217 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9218 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9221 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9226 eval flag=\"$hardcode_libdir_flag_spec\"
9229 elif test -n "$runpath_var"; then
9230 case "$perm_rpath " in
9232 *) perm_rpath+=" $libdir" ;;
9236 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
9237 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
9238 case :$dllsearchpath: in
9240 ::) dllsearchpath=$libdir;;
9241 *) dllsearchpath+=":$libdir";;
9243 case :$dllsearchpath: in
9244 *":$testbindir:"*) ;;
9245 ::) dllsearchpath=$testbindir;;
9246 *) dllsearchpath+=":$testbindir";;
9251 # Substitute the hardcoded libdirs into the rpath.
9252 if test -n "$hardcode_libdir_separator" &&
9253 test -n "$hardcode_libdirs"; then
9254 libdir="$hardcode_libdirs"
9255 eval rpath=\" $hardcode_libdir_flag_spec\"
9257 compile_rpath="$rpath"
9261 for libdir in $finalize_rpath; do
9262 if test -n "$hardcode_libdir_flag_spec"; then
9263 if test -n "$hardcode_libdir_separator"; then
9264 if test -z "$hardcode_libdirs"; then
9265 hardcode_libdirs="$libdir"
9267 # Just accumulate the unique libdirs.
9268 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9269 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9272 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
9277 eval flag=\"$hardcode_libdir_flag_spec\"
9280 elif test -n "$runpath_var"; then
9281 case "$finalize_perm_rpath " in
9283 *) finalize_perm_rpath+=" $libdir" ;;
9287 # Substitute the hardcoded libdirs into the rpath.
9288 if test -n "$hardcode_libdir_separator" &&
9289 test -n "$hardcode_libdirs"; then
9290 libdir="$hardcode_libdirs"
9291 eval rpath=\" $hardcode_libdir_flag_spec\"
9293 finalize_rpath="$rpath"
9295 if test -n "$libobjs" && test "$build_old_libs" = yes; then
9296 # Transform all the library objects into standard objects.
9297 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9298 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9301 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
9303 # template prelinking step
9304 if test -n "$prelink_cmds"; then
9305 func_execute_cmds "$prelink_cmds" 'exit $?'
9308 wrappers_required=yes
9310 *cegcc* | *mingw32ce*)
9311 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
9312 wrappers_required=no
9314 *cygwin* | *mingw* )
9315 if test "$build_libtool_libs" != yes; then
9316 wrappers_required=no
9320 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9321 wrappers_required=no
9325 if test "$wrappers_required" = no; then
9326 # Replace the output file specification.
9327 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9328 link_command="$compile_command$compile_rpath"
9330 # We have no uninstalled library dependencies, so finalize right now.
9332 func_show_eval "$link_command" 'exit_status=$?'
9334 if test -n "$postlink_cmds"; then
9335 func_to_tool_file "$output"
9336 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9337 func_execute_cmds "$postlink_cmds" 'exit $?'
9340 # Delete the generated files.
9341 if test -f "$output_objdir/${outputname}S.${objext}"; then
9342 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
9348 if test -n "$compile_shlibpath$finalize_shlibpath"; then
9349 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
9351 if test -n "$finalize_shlibpath"; then
9352 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
9357 if test -n "$runpath_var"; then
9358 if test -n "$perm_rpath"; then
9359 # We should set the runpath_var.
9361 for dir in $perm_rpath; do
9364 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
9366 if test -n "$finalize_perm_rpath"; then
9367 # We should set the runpath_var.
9369 for dir in $finalize_perm_rpath; do
9372 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
9376 if test "$no_install" = yes; then
9377 # We don't need to create a wrapper script.
9378 link_command="$compile_var$compile_command$compile_rpath"
9379 # Replace the output file specification.
9380 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9381 # Delete the old output file.
9382 $opt_dry_run || $RM $output
9383 # Link the executable and exit
9384 func_show_eval "$link_command" 'exit $?'
9386 if test -n "$postlink_cmds"; then
9387 func_to_tool_file "$output"
9388 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9389 func_execute_cmds "$postlink_cmds" 'exit $?'
9395 if test "$hardcode_action" = relink; then
9396 # Fast installation is not supported
9397 link_command="$compile_var$compile_command$compile_rpath"
9398 relink_command="$finalize_var$finalize_command$finalize_rpath"
9400 func_warning "this platform does not like uninstalled shared libraries"
9401 func_warning "\`$output' will be relinked during installation"
9403 if test "$fast_install" != no; then
9404 link_command="$finalize_var$compile_command$finalize_rpath"
9405 if test "$fast_install" = yes; then
9406 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9408 # fast_install is set to needless
9412 link_command="$compile_var$compile_command$compile_rpath"
9413 relink_command="$finalize_var$finalize_command$finalize_rpath"
9417 # Replace the output file specification.
9418 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9420 # Delete the old output files.
9421 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
9423 func_show_eval "$link_command" 'exit $?'
9425 if test -n "$postlink_cmds"; then
9426 func_to_tool_file "$output_objdir/$outputname"
9427 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'`
9428 func_execute_cmds "$postlink_cmds" 'exit $?'
9431 # Now create the wrapper script.
9432 func_verbose "creating $output"
9434 # Quote the relink command for shipping.
9435 if test -n "$relink_command"; then
9436 # Preserve any variables that may affect compiler behavior
9437 for var in $variables_saved_for_relink; do
9438 if eval test -z \"\${$var+set}\"; then
9439 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9440 elif eval var_value=\$$var; test -z "$var_value"; then
9441 relink_command="$var=; export $var; $relink_command"
9443 func_quote_for_eval "$var_value"
9444 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9447 relink_command="(cd `pwd`; $relink_command)"
9448 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9451 # Only actually do things if not in dry run mode.
9453 # win32 will think the script is a binary if it has
9454 # a .exe suffix, so we strip it off here.
9456 *.exe) func_stripname '' '.exe' "$output"
9457 output=$func_stripname_result ;;
9459 # test for cygwin because mv fails w/o .exe extensions
9463 func_stripname '' '.exe' "$outputname"
9464 outputname=$func_stripname_result ;;
9468 *cygwin* | *mingw* )
9469 func_dirname_and_basename "$output" "" "."
9470 output_name=$func_basename_result
9471 output_path=$func_dirname_result
9472 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9473 cwrapper="$output_path/$output_name.exe"
9474 $RM $cwrappersource $cwrapper
9475 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9477 func_emit_cwrapperexe_src > $cwrappersource
9479 # The wrapper executable is built using the $host compiler,
9480 # because it contains $host paths and files. If cross-
9481 # compiling, it, like the target executable, must be
9482 # executed on the $host or under an emulation environment.
9484 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9488 # Now, create the wrapper script for func_source use:
9489 func_ltwrapper_scriptname $cwrapper
9490 $RM $func_ltwrapper_scriptname_result
9491 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9493 # note: this script will not be executed, so do not chmod.
9494 if test "x$build" = "x$host" ; then
9495 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9497 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9503 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9505 func_emit_wrapper no > $output
9514 # See if we need to build an old-fashioned archive.
9515 for oldlib in $oldlibs; do
9517 if test "$build_libtool_libs" = convenience; then
9518 oldobjs="$libobjs_save $symfileobj"
9519 addlibs="$convenience"
9520 build_libtool_libs=no
9522 if test "$build_libtool_libs" = module; then
9523 oldobjs="$libobjs_save"
9524 build_libtool_libs=no
9526 oldobjs="$old_deplibs $non_pic_objects"
9527 if test "$preload" = yes && test -f "$symfileobj"; then
9528 oldobjs+=" $symfileobj"
9531 addlibs="$old_convenience"
9534 if test -n "$addlibs"; then
9535 gentop="$output_objdir/${outputname}x"
9536 generated+=" $gentop"
9538 func_extract_archives $gentop $addlibs
9539 oldobjs+=" $func_extract_archives_result"
9542 # Do each command in the archive commands.
9543 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9544 cmds=$old_archive_from_new_cmds
9547 # Add any objects from preloaded convenience libraries
9548 if test -n "$dlprefiles"; then
9549 gentop="$output_objdir/${outputname}x"
9550 generated+=" $gentop"
9552 func_extract_archives $gentop $dlprefiles
9553 oldobjs+=" $func_extract_archives_result"
9556 # POSIX demands no paths to be encoded in archives. We have
9557 # to avoid creating archives with duplicate basenames if we
9558 # might have to extract them afterwards, e.g., when creating a
9559 # static archive out of a convenience library, or when linking
9560 # the entirety of a libtool archive into another (currently
9561 # not supported by libtool).
9562 if (for obj in $oldobjs
9564 func_basename "$obj"
9565 $ECHO "$func_basename_result"
9566 done | sort | sort -uc >/dev/null 2>&1); then
9569 echo "copying selected object files to avoid basename conflicts..."
9570 gentop="$output_objdir/${outputname}x"
9571 generated+=" $gentop"
9572 func_mkdir_p "$gentop"
9573 save_oldobjs=$oldobjs
9576 for obj in $save_oldobjs
9578 func_basename "$obj"
9579 objbase="$func_basename_result"
9580 case " $oldobjs " in
9581 " ") oldobjs=$obj ;;
9584 # Make sure we don't pick an alternate name that also
9586 newobj=lt$counter-$objbase
9587 func_arith $counter + 1
9588 counter=$func_arith_result
9589 case " $oldobjs " in
9590 *[\ /]"$newobj "*) ;;
9591 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9594 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9595 oldobjs+=" $gentop/$newobj"
9597 *) oldobjs+=" $obj" ;;
9601 eval cmds=\"$old_archive_cmds\"
9604 len=$func_len_result
9605 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9606 cmds=$old_archive_cmds
9607 elif test -n "$archiver_list_spec"; then
9608 func_verbose "using command file archive linking..."
9611 func_to_tool_file "$obj"
9612 $ECHO "$func_to_tool_file_result"
9613 done > $output_objdir/$libname.libcmd
9614 func_to_tool_file "$output_objdir/$libname.libcmd"
9615 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9616 cmds=$old_archive_cmds
9618 # the command line is too long to link in one step, link in parts
9619 func_verbose "using piecewise archive linking..."
9624 save_oldobjs=$oldobjs
9626 # Is there a better way of finding the last object in the list?
9627 for obj in $save_oldobjs
9631 eval test_cmds=\"$old_archive_cmds\"
9632 func_len " $test_cmds"
9633 len0=$func_len_result
9635 for obj in $save_oldobjs
9638 func_arith $len + $func_len_result
9639 len=$func_arith_result
9641 if test "$len" -lt "$max_cmd_len"; then
9644 # the above command should be used before it gets too long
9646 if test "$obj" = "$last_oldobj" ; then
9649 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9650 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9657 if test "X$oldobjs" = "X" ; then
9658 eval cmds=\"\$concat_cmds\"
9660 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9664 func_execute_cmds "$cmds" 'exit $?'
9667 test -n "$generated" && \
9668 func_show_eval "${RM}r$generated"
9670 # Now create the libtool archive.
9674 test "$build_old_libs" = yes && old_library="$libname.$libext"
9675 func_verbose "creating $output"
9677 # Preserve any variables that may affect compiler behavior
9678 for var in $variables_saved_for_relink; do
9679 if eval test -z \"\${$var+set}\"; then
9680 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9681 elif eval var_value=\$$var; test -z "$var_value"; then
9682 relink_command="$var=; export $var; $relink_command"
9684 func_quote_for_eval "$var_value"
9685 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9688 # Quote the link command for shipping.
9689 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9690 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9691 if test "$hardcode_automatic" = yes ; then
9695 # Only create the output if not a dry run.
9697 for installed in no yes; do
9698 if test "$installed" = yes; then
9699 if test -z "$install_libdir"; then
9702 output="$output_objdir/$outputname"i
9703 # Replace all uninstalled libtool libraries with the installed ones
9705 for deplib in $dependency_libs; do
9708 func_basename "$deplib"
9709 name="$func_basename_result"
9710 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9711 test -z "$libdir" && \
9712 func_fatal_error "\`$deplib' is not a valid libtool archive"
9713 newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
9716 func_stripname -L '' "$deplib"
9717 func_replace_sysroot "$func_stripname_result"
9718 newdependency_libs+=" -L$func_replace_sysroot_result"
9721 func_stripname -R '' "$deplib"
9722 func_replace_sysroot "$func_stripname_result"
9723 newdependency_libs+=" -R$func_replace_sysroot_result"
9725 *) newdependency_libs+=" $deplib" ;;
9728 dependency_libs="$newdependency_libs"
9731 for lib in $dlfiles; do
9734 func_basename "$lib"
9735 name="$func_basename_result"
9736 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9737 test -z "$libdir" && \
9738 func_fatal_error "\`$lib' is not a valid libtool archive"
9739 newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
9741 *) newdlfiles+=" $lib" ;;
9744 dlfiles="$newdlfiles"
9746 for lib in $dlprefiles; do
9749 # Only pass preopened files to the pseudo-archive (for
9750 # eventual linking with the app. that links it) if we
9751 # didn't already link the preopened objects directly into
9753 func_basename "$lib"
9754 name="$func_basename_result"
9755 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9756 test -z "$libdir" && \
9757 func_fatal_error "\`$lib' is not a valid libtool archive"
9758 newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
9762 dlprefiles="$newdlprefiles"
9765 for lib in $dlfiles; do
9767 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9768 *) abs=`pwd`"/$lib" ;;
9772 dlfiles="$newdlfiles"
9774 for lib in $dlprefiles; do
9776 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9777 *) abs=`pwd`"/$lib" ;;
9779 newdlprefiles+=" $abs"
9781 dlprefiles="$newdlprefiles"
9784 # place dlname in correct position for cygwin
9785 # In fact, it would be nice if we could use this code for all target
9786 # systems that can't hard-code library paths into their executables
9787 # and that have no shared library path variable independent of PATH,
9788 # but it turns out we can't easily determine that from inspecting
9789 # libtool variables, so we have to hard-code the OSs to which it
9790 # applies here; at the moment, that means platforms that use the PE
9791 # object format with DLL files. See the long comment at the top of
9792 # tests/bindir.at for full details.
9794 case $host,$output,$installed,$module,$dlname in
9795 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9796 # If a -bindir argument was supplied, place the dll there.
9797 if test "x$bindir" != x ;
9799 func_relative_path "$install_libdir" "$bindir"
9800 tdlname=$func_relative_path_result$dlname
9802 # Otherwise fall back on heuristic.
9803 tdlname=../bin/$dlname
9808 # $outputname - a libtool library file
9809 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9811 # Please DO NOT delete this file!
9812 # It is necessary for linking the library.
9814 # The name that we can dlopen(3).
9817 # Names of this library.
9818 library_names='$library_names'
9820 # The name of the static archive.
9821 old_library='$old_library'
9823 # Linker flags that can not go in dependency_libs.
9824 inherited_linker_flags='$new_inherited_linker_flags'
9826 # Libraries that this one depends upon.
9827 dependency_libs='$dependency_libs'
9829 # Names of additional weak libraries provided by this library
9830 weak_library_names='$weak_libs'
9832 # Version information for $libname.
9837 # Is this an already installed library?
9838 installed=$installed
9840 # Should we warn about portability when linking against -modules?
9841 shouldnotlink=$module
9843 # Files to dlopen/dlpreopen
9845 dlpreopen='$dlprefiles'
9847 # Directory that this library needs to be installed in:
9848 libdir='$install_libdir'"
9849 if test "$installed" = no && test "$need_relink" = yes; then
9851 relink_command=\"$relink_command\""
9856 # Do a symbolic link so that the libtool archive can be found in
9857 # LD_LIBRARY_PATH before the program is installed.
9858 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9864 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9865 func_mode_link ${1+"$@"}
9868 # func_mode_uninstall arg...
9869 func_mode_uninstall ()
9877 # This variable tells wrapper scripts just to set variables rather
9878 # than running their programs.
9879 libtool_install_magic="$magic"
9884 -f) RM+=" $arg"; rmforce=yes ;;
9886 *) files+=" $arg" ;;
9891 func_fatal_help "you must specify an RM program"
9895 for file in $files; do
9896 func_dirname "$file" "" "."
9897 dir="$func_dirname_result"
9898 if test "X$dir" = X.; then
9903 func_basename "$file"
9904 name="$func_basename_result"
9905 test "$opt_mode" = uninstall && odir="$dir"
9907 # Remember odir for removal later, being careful to avoid duplicates
9908 if test "$opt_mode" = clean; then
9911 *) rmdirs+=" $odir" ;;
9915 # Don't error if the file doesn't exist and rm -f was used.
9916 if { test -L "$file"; } >/dev/null 2>&1 ||
9917 { test -h "$file"; } >/dev/null 2>&1 ||
9918 test -f "$file"; then
9920 elif test -d "$file"; then
9923 elif test "$rmforce" = yes; then
9931 # Possibly a libtool archive, so verify it.
9932 if func_lalib_p "$file"; then
9933 func_source $dir/$name
9935 # Delete the libtool libraries and symlinks.
9936 for n in $library_names; do
9937 rmfiles+=" $odir/$n"
9939 test -n "$old_library" && rmfiles+=" $odir/$old_library"
9943 case " $library_names " in
9945 *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
9947 test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
9950 if test -n "$library_names"; then
9951 # Do each command in the postuninstall commands.
9952 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9955 if test -n "$old_library"; then
9956 # Do each command in the old_postuninstall commands.
9957 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9959 # FIXME: should reinstall the best remaining shared library.
9966 # Possibly a libtool object, so verify it.
9967 if func_lalib_p "$file"; then
9970 func_source $dir/$name
9972 # Add PIC object to the list of files to remove.
9973 if test -n "$pic_object" &&
9974 test "$pic_object" != none; then
9975 rmfiles+=" $dir/$pic_object"
9978 # Add non-PIC object to the list of files to remove.
9979 if test -n "$non_pic_object" &&
9980 test "$non_pic_object" != none; then
9981 rmfiles+=" $dir/$non_pic_object"
9987 if test "$opt_mode" = clean ; then
9991 func_stripname '' '.exe' "$file"
9992 file=$func_stripname_result
9993 func_stripname '' '.exe' "$name"
9994 noexename=$func_stripname_result
9995 # $file with .exe has already been added to rmfiles,
9996 # add $file without .exe
10000 # Do a test to see if this is a libtool program.
10001 if func_ltwrapper_p "$file"; then
10002 if func_ltwrapper_executable_p "$file"; then
10003 func_ltwrapper_scriptname "$file"
10005 func_source $func_ltwrapper_scriptname_result
10006 rmfiles+=" $func_ltwrapper_scriptname_result"
10009 func_source $dir/$noexename
10012 # note $name still contains .exe if it was in $file originally
10013 # as does the version of $file that was added into $rmfiles
10014 rmfiles+=" $odir/$name $odir/${name}S.${objext}"
10015 if test "$fast_install" = yes && test -n "$relink_command"; then
10016 rmfiles+=" $odir/lt-$name"
10018 if test "X$noexename" != "X$name" ; then
10019 rmfiles+=" $odir/lt-${noexename}.c"
10025 func_show_eval "$RM $rmfiles" 'exit_status=1'
10028 # Try to remove the ${objdir}s in the directories where we deleted files
10029 for dir in $rmdirs; do
10030 if test -d "$dir"; then
10031 func_show_eval "rmdir $dir >/dev/null 2>&1"
10038 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10039 func_mode_uninstall ${1+"$@"}
10041 test -z "$opt_mode" && {
10042 help="$generic_help"
10043 func_fatal_help "you must specify a MODE"
10046 test -z "$exec_cmd" && \
10047 func_fatal_help "invalid operation mode \`$opt_mode'"
10049 if test -n "$exec_cmd"; then
10050 eval exec "$exec_cmd"
10057 # The TAGs below are defined such that we never get into a situation
10058 # in which we disable both kinds of libraries. Given conflicting
10059 # choices, we go for a static library, that is the most portable,
10060 # since we can't tell whether shared libraries were disabled because
10061 # the user asked for that or because the platform doesn't support
10062 # them. This is particularly important on AIX, because we don't
10063 # support having both static and shared libraries enabled at the same
10064 # time on that platform, so we default to a shared-only configuration.
10065 # If a disable-shared tag is given, we'll fallback to a static-only
10066 # configuration. But we'll never go from static-only to shared-only.
10068 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
10069 build_libtool_libs=no
10071 # ### END LIBTOOL TAG CONFIG: disable-shared
10073 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
10074 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
10075 # ### END LIBTOOL TAG CONFIG: disable-static
10078 # mode:shell-script