3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (lcr) 1.14
5 # Libtool was configured on host freeswitch:
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.
66 host=i686-pc-linux-gnu
71 build=i686-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?
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.
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"
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.
152 # Commands used to install an old-style archive.
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
163 # LTCC compiler flags.
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=yes
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="/usr/lib/gcc/i686-pc-linux-gnu/4.5.3 /usr/i686-pc-linux-gnu/lib /usr/lib /lib "
274 # Run-time system search path for libraries.
275 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/i686-pc-linux-gnu/lib /usr/lib/gcc/i486-pc-linux-gnu/4.5.3 /usr/lib/gcc/i686-pc-linux-gnu/4.5.3 /usr/local/freeswitch/lib "
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="strip --strip-debug"
288 striplib="strip --strip-unneeded"
291 # The linker used to build libraries.
292 LD="/usr/i686-pc-linux-gnu/bin/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.
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 # The directories searched by this compiler when creating a shared library.
430 compiler_lib_search_dirs=""
432 # Dependencies to place before and after the objects being linked to
433 # create a shared library.
439 # The library search path used internally by the compiler when linking
441 compiler_lib_search_path=""
443 # ### END LIBTOOL CONFIG
446 # libtool (GNU libtool) 2.4
447 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
449 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
450 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
451 # This is free software; see the source for copying conditions. There is NO
452 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
454 # GNU Libtool is free software; you can redistribute it and/or modify
455 # it under the terms of the GNU General Public License as published by
456 # the Free Software Foundation; either version 2 of the License, or
457 # (at your option) any later version.
459 # As a special exception to the GNU General Public License,
460 # if you distribute this file as part of a program or library that
461 # is built using GNU Libtool, you may include this file under the
462 # same distribution terms that you use for the rest of that program.
464 # GNU Libtool is distributed in the hope that it will be useful, but
465 # WITHOUT ANY WARRANTY; without even the implied warranty of
466 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
467 # General Public License for more details.
469 # You should have received a copy of the GNU General Public License
470 # along with GNU Libtool; see the file COPYING. If not, a copy
471 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
472 # or obtained by writing to the Free Software Foundation, Inc.,
473 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
475 # Usage: $progname [OPTION]... [MODE-ARG]...
477 # Provide generalized library-building support services.
479 # --config show all configuration variables
480 # --debug enable verbose shell tracing
481 # -n, --dry-run display commands without modifying any files
482 # --features display basic configuration information and exit
483 # --mode=MODE use operation mode MODE
484 # --preserve-dup-deps don't remove duplicate dependency libraries
485 # --quiet, --silent don't print informational messages
486 # --no-quiet, --no-silent
487 # print informational messages (default)
488 # --tag=TAG use configuration variables from tag TAG
489 # -v, --verbose print more informational messages than default
490 # --no-verbose don't print the extra informational messages
491 # --version print version information
492 # -h, --help, --help-all print short, long, or detailed help message
494 # MODE must be one of the following:
496 # clean remove files from the build directory
497 # compile compile a source file into a libtool object
498 # execute automatically set library path, then run a program
499 # finish complete the installation of libtool libraries
500 # install install libraries or executables
501 # link create a library or an executable
502 # uninstall remove libraries from an installed directory
504 # MODE-ARGS vary depending on the MODE. When passed as first option,
505 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
506 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
508 # When reporting a bug, please describe a test case to reproduce it and
509 # include the following information:
511 # host-triplet: $host
514 # compiler flags: $LTCFLAGS
515 # linker: $LD (gnu? $with_gnu_ld)
516 # $progname: (GNU libtool) 2.4
517 # automake: $automake_version
518 # autoconf: $autoconf_version
520 # Report bugs to <bug-libtool@gnu.org>.
521 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
522 # General help using GNU software: <http://www.gnu.org/gethelp/>.
528 package_revision=1.3293
530 # Be Bourne compatible
531 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
534 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
535 # is contrary to our usage. Disable this feature.
536 alias -g '${1+"$@"}'='"$@"'
539 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
541 BIN_SH=xpg4; export BIN_SH # for Tru64
542 DUALCASE=1; export DUALCASE # for MKS sh
544 # A function that is used when there is no print builtin or printf.
545 func_fallback_echo ()
547 eval 'cat <<_LTECHO_EOF
552 # NLS nuisances: We save the old values to restore during execute mode.
555 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
557 eval "if test \"\${$lt_var+set}\" = set; then
558 save_$lt_var=\$$lt_var
561 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
562 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
567 export LANGUAGE LC_ALL
572 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
573 # is ksh but when the shell is invoked as "sh" and the current value of
574 # the _XPG environment variable is not equal to 1 (one), the special
575 # positional parameter $0, within a function call, is the name of the
582 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
592 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
593 : ${Xsed="$SED -e 1s/^X//"}
598 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
599 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
601 exit_status=$EXIT_SUCCESS
603 # Make sure IFS has a sensible default
608 dirname="s,/[^/]*$,,"
611 # func_dirname file append nondir_replacement
612 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
613 # otherwise set result to NONDIR_REPLACEMENT.
617 */*) func_dirname_result="${1%/*}${2}" ;;
618 * ) func_dirname_result="${3}" ;;
620 } # Extended-shell func_dirname implementation
626 func_basename_result="${1##*/}"
627 } # Extended-shell func_basename implementation
630 # func_dirname_and_basename file append nondir_replacement
631 # perform func_basename and func_dirname in a single function
633 # dirname: Compute the dirname of FILE. If nonempty,
634 # add APPEND to the result, otherwise set result
635 # to NONDIR_REPLACEMENT.
636 # value returned in "$func_dirname_result"
637 # basename: Compute filename of FILE.
638 # value retuned in "$func_basename_result"
639 # Implementation must be kept synchronized with func_dirname
640 # and func_basename. For efficiency, we do not delegate to
641 # those functions but instead duplicate the functionality here.
642 func_dirname_and_basename ()
645 */*) func_dirname_result="${1%/*}${2}" ;;
646 * ) func_dirname_result="${3}" ;;
648 func_basename_result="${1##*/}"
649 } # Extended-shell func_dirname_and_basename implementation
652 # func_stripname prefix suffix name
653 # strip PREFIX and SUFFIX off of NAME.
654 # PREFIX and SUFFIX must not contain globbing or regex special
655 # characters, hashes, percent signs, but SUFFIX may contain a leading
656 # dot (in which case that matches only a dot).
657 # func_strip_suffix prefix name
660 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
661 # positional parameters, so assign one to ordinary parameter first.
662 func_stripname_result=${3}
663 func_stripname_result=${func_stripname_result#"${1}"}
664 func_stripname_result=${func_stripname_result%"${2}"}
665 } # Extended-shell func_stripname implementation
668 # These SED scripts presuppose an absolute path with a trailing slash.
669 pathcar='s,^/\([^/]*\).*$,\1,'
670 pathcdr='s,^/[^/]*,,'
671 removedotparts=':dotsl
675 collapseslashes='s@/\{1,\}@/@g'
676 finalslash='s,/*$,/,'
678 # func_normal_abspath PATH
679 # Remove doubled-up and trailing slashes, "." path components,
680 # and cancel out any ".." path components in PATH after making
681 # it an absolute path.
682 # value returned in "$func_normal_abspath_result"
683 func_normal_abspath ()
685 # Start from root dir and reassemble the path.
686 func_normal_abspath_result=
687 func_normal_abspath_tpath=$1
688 func_normal_abspath_altnamespace=
689 case $func_normal_abspath_tpath in
691 # Empty path, that just means $cwd.
692 func_stripname '' '/' "`pwd`"
693 func_normal_abspath_result=$func_stripname_result
696 # The next three entries are used to spot a run of precisely
697 # two leading slashes without using negated character classes;
698 # we take advantage of case's first-match behaviour.
700 # Unusual form of absolute path, do nothing.
703 # Not necessarily an ordinary path; POSIX reserves leading '//'
704 # and for example Cygwin uses it to access remote file shares
705 # over CIFS/SMB, so we conserve a leading double slash if found.
706 func_normal_abspath_altnamespace=/
709 # Absolute path, do nothing.
712 # Relative path, prepend $cwd.
713 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
716 # Cancel out all the simple stuff to save iterations. We also want
717 # the path to end with a slash for ease of parsing, so make sure
718 # there is one (and only one) here.
719 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
720 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
722 # Processed it all yet?
723 if test "$func_normal_abspath_tpath" = / ; then
724 # If we ascended to the root using ".." the result may be empty now.
725 if test -z "$func_normal_abspath_result" ; then
726 func_normal_abspath_result=/
730 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
732 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
734 # Figure out what to do with it
735 case $func_normal_abspath_tcomponent in
737 # Trailing empty path component, ignore it.
740 # Parent dir; strip last assembled component from result.
741 func_dirname "$func_normal_abspath_result"
742 func_normal_abspath_result=$func_dirname_result
745 # Actual path component, append it.
746 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
750 # Restore leading double-slash if one was found on entry.
751 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
754 # func_relative_path SRCDIR DSTDIR
755 # generates a relative path from SRCDIR to DSTDIR, with a trailing
756 # slash if non-empty, suitable for immediately appending a filename
757 # without needing to append a separator.
758 # value returned in "$func_relative_path_result"
759 func_relative_path ()
761 func_relative_path_result=
762 func_normal_abspath "$1"
763 func_relative_path_tlibdir=$func_normal_abspath_result
764 func_normal_abspath "$2"
765 func_relative_path_tbindir=$func_normal_abspath_result
767 # Ascend the tree starting from libdir
769 # check if we have found a prefix of bindir
770 case $func_relative_path_tbindir in
771 $func_relative_path_tlibdir)
772 # found an exact match
773 func_relative_path_tcancelled=
776 $func_relative_path_tlibdir*)
777 # found a matching prefix
778 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
779 func_relative_path_tcancelled=$func_stripname_result
780 if test -z "$func_relative_path_result"; then
781 func_relative_path_result=.
786 func_dirname $func_relative_path_tlibdir
787 func_relative_path_tlibdir=${func_dirname_result}
788 if test "x$func_relative_path_tlibdir" = x ; then
789 # Have to descend all the way to the root!
790 func_relative_path_result=../$func_relative_path_result
791 func_relative_path_tcancelled=$func_relative_path_tbindir
794 func_relative_path_result=../$func_relative_path_result
799 # Now calculate path; take care to avoid doubling-up slashes.
800 func_stripname '' '/' "$func_relative_path_result"
801 func_relative_path_result=$func_stripname_result
802 func_stripname '/' '/' "$func_relative_path_tcancelled"
803 if test "x$func_stripname_result" != x ; then
804 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
807 # Normalisation. If bindir is libdir, return empty string,
808 # else relative path ending with a slash; either way, target
809 # file name can be directly appended.
810 if test ! -z "$func_relative_path_result"; then
811 func_stripname './' '' "$func_relative_path_result/"
812 func_relative_path_result=$func_stripname_result
816 # The name of this program:
817 func_dirname_and_basename "$progpath"
818 progname=$func_basename_result
820 # Make sure we have an absolute path for reexecution:
822 [\\/]*|[A-Za-z]:\\*) ;;
824 progdir=$func_dirname_result
825 progdir=`cd "$progdir" && pwd`
826 progpath="$progdir/$progname"
831 for progdir in $PATH; do
833 test -x "$progdir/$progname" && break
836 test -n "$progdir" || progdir=`pwd`
837 progpath="$progdir/$progname"
841 # Sed substitution that helps us do robust quoting. It backslashifies
842 # metacharacters that are still active within double-quoted strings.
843 Xsed="${SED}"' -e 1s/^X//'
844 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
846 # Same as above, but do not quote variable references.
847 double_quote_subst='s/\(["`\\]\)/\\\1/g'
849 # Sed substitution that turns a string into a regex matching for the
851 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
853 # Sed substitution that converts a w32 file name or path
854 # which contains forward slashes, into one that contains
855 # (escaped) backslashes. A very naive implementation.
856 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
858 # Re-`\' parameter expansions in output of double_quote_subst that were
859 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
860 # in input to double_quote_subst, that '$' was protected from expansion.
861 # Since each input `\' is now two `\'s, look for any number of runs of
862 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
867 sed_double_backslash="\
871 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
882 # Echo program name prefixed message, along with the current mode
883 # name if it has been set yet.
886 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
889 # func_verbose arg...
890 # Echo program name prefixed message in verbose mode only.
893 $opt_verbose && func_echo ${1+"$@"}
895 # A bug in bash halts the script if the last line of a function
896 # fails when set -e is in force, so we need another command to
901 # func_echo_all arg...
902 # Invoke $ECHO with all args, space-separated.
909 # Echo program name prefixed message to standard error.
912 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
915 # func_warning arg...
916 # Echo program name prefixed warning message to standard error.
919 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
925 # func_fatal_error arg...
926 # Echo program name prefixed message to standard error, and exit.
933 # func_fatal_help arg...
934 # Echo program name prefixed message to standard error, followed by
935 # a help hint, and exit.
939 func_fatal_error "$help"
941 help="Try \`$progname --help' for more information." ## default
944 # func_grep expression filename
945 # Check whether EXPRESSION matches any line of FILENAME, without output.
948 $GREP "$1" "$2" >/dev/null 2>&1
952 # func_mkdir_p directory-path
953 # Make sure the entire path to DIRECTORY-PATH is available.
956 my_directory_path="$1"
959 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
961 # Protect directory names starting with `-'
962 case $my_directory_path in
963 -*) my_directory_path="./$my_directory_path" ;;
966 # While some portion of DIR does not yet exist...
967 while test ! -d "$my_directory_path"; do
968 # ...make a list in topmost first order. Use a colon delimited
969 # list incase some portion of path contains whitespace.
970 my_dir_list="$my_directory_path:$my_dir_list"
972 # If the last portion added has no slash in it, the list is done
973 case $my_directory_path in */*) ;; *) break ;; esac
975 # ...otherwise throw away the child directory and loop
976 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
978 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
980 save_mkdir_p_IFS="$IFS"; IFS=':'
981 for my_dir in $my_dir_list; do
982 IFS="$save_mkdir_p_IFS"
983 # mkdir can fail with a `File exist' error if two processes
984 # try to create one of the directories concurrently. Don't
986 $MKDIR "$my_dir" 2>/dev/null || :
988 IFS="$save_mkdir_p_IFS"
990 # Bail out if we (or some other process) failed to create a directory.
991 test -d "$my_directory_path" || \
992 func_fatal_error "Failed to create \`$1'"
997 # func_mktempdir [string]
998 # Make a temporary directory that won't clash with other running
999 # libtool processes, and avoids race conditions if possible. If
1000 # given, STRING is the basename for that directory.
1003 my_template="${TMPDIR-/tmp}/${1-$progname}"
1005 if test "$opt_dry_run" = ":"; then
1006 # Return a directory name, but don't create it in dry-run mode
1007 my_tmpdir="${my_template}-$$"
1010 # If mktemp works, use that first and foremost
1011 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
1013 if test ! -d "$my_tmpdir"; then
1014 # Failing that, at least try and use $RANDOM to avoid a race
1015 my_tmpdir="${my_template}-${RANDOM-0}$$"
1017 save_mktempdir_umask=`umask`
1020 umask $save_mktempdir_umask
1023 # If we're not in dry-run mode, bomb out on failure
1024 test -d "$my_tmpdir" || \
1025 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1032 # func_quote_for_eval arg
1033 # Aesthetically quote ARG to be evaled later.
1034 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1035 # is double-quoted, suitable for a subsequent eval, whereas
1036 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1037 # which are still active within double quotes backslashified.
1038 func_quote_for_eval ()
1042 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1044 func_quote_for_eval_unquoted_result="$1" ;;
1047 case $func_quote_for_eval_unquoted_result in
1048 # Double-quote args containing shell metacharacters to delay
1049 # word splitting, command substitution and and variable
1050 # expansion for a subsequent eval.
1051 # Many Bourne shells cannot handle close brackets correctly
1052 # in scan sets, so we specify it separately.
1053 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1054 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1057 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1062 # func_quote_for_expand arg
1063 # Aesthetically quote ARG to be evaled later; same as above,
1064 # but do not quote variable references.
1065 func_quote_for_expand ()
1069 my_arg=`$ECHO "$1" | $SED \
1070 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1076 # Double-quote args containing shell metacharacters to delay
1077 # word splitting and command substitution for a subsequent eval.
1078 # Many Bourne shells cannot handle close brackets correctly
1079 # in scan sets, so we specify it separately.
1080 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1081 my_arg="\"$my_arg\""
1085 func_quote_for_expand_result="$my_arg"
1089 # func_show_eval cmd [fail_exp]
1090 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1091 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1092 # is given, then evaluate it.
1096 my_fail_exp="${2-:}"
1098 ${opt_silent-false} || {
1099 func_quote_for_expand "$my_cmd"
1100 eval "func_echo $func_quote_for_expand_result"
1103 if ${opt_dry_run-false}; then :; else
1106 if test "$my_status" -eq 0; then :; else
1107 eval "(exit $my_status); $my_fail_exp"
1113 # func_show_eval_locale cmd [fail_exp]
1114 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1115 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1116 # is given, then evaluate it. Use the saved locale for evaluation.
1117 func_show_eval_locale ()
1120 my_fail_exp="${2-:}"
1122 ${opt_silent-false} || {
1123 func_quote_for_expand "$my_cmd"
1124 eval "func_echo $func_quote_for_expand_result"
1127 if ${opt_dry_run-false}; then :; else
1128 eval "$lt_user_locale
1131 eval "$lt_safe_locale"
1132 if test "$my_status" -eq 0; then :; else
1133 eval "(exit $my_status); $my_fail_exp"
1139 # Turn $1 into a string suitable for a shell variable name.
1140 # Result is stored in $func_tr_sh_result. All characters
1141 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1142 # if $1 begins with a digit, a '_' is prepended as well.
1146 [0-9]* | *[!a-zA-Z0-9_]*)
1147 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1150 func_tr_sh_result=$1
1157 # Echo version message to standard output and exit.
1170 /^# '$PROGRAM' (GNU /,/# warranty; / {
1173 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1180 # Echo short help message to standard output and exit.
1185 $SED -n '/^# Usage:/,/^# *.*--help/ {
1188 s/\$progname/'$progname'/
1192 $ECHO "run \`$progname --help | more' for full usage"
1196 # func_help [NOEXIT]
1197 # Echo long help message to standard output and exit,
1198 # unless 'noexit' is passed as argument.
1203 $SED -n '/^# Usage:/,/# Report bugs to/ {
1207 s*\$progname*'$progname'*
1209 s*\$SHELL*'"$SHELL"'*
1211 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1213 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1214 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1215 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1219 /^# .* home page:/b print
1220 /^# General help using/b print
1223 if test -z "$1"; then
1228 # func_missing_arg argname
1229 # Echo program name prefixed message to standard error and set global
1235 func_error "missing argument for $1."
1240 # func_split_short_opt shortopt
1241 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1242 # variables after splitting SHORTOPT after the 2nd character.
1243 func_split_short_opt ()
1245 func_split_short_opt_arg=${1#??}
1246 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1247 } # Extended-shell func_split_short_opt implementation
1250 # func_split_long_opt longopt
1251 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1252 # variables after splitting LONGOPT at the `=' sign.
1253 func_split_long_opt ()
1255 func_split_long_opt_name=${1%%=*}
1256 func_split_long_opt_arg=${1#*=}
1257 } # Extended-shell func_split_long_opt implementation
1265 magic="%%%MAGIC variable%%%"
1266 magic_exe="%%%MAGIC EXE variable%%%"
1271 lo2o="s/\\.lo\$/.${objext}/"
1272 o2lo="s/\\.${objext}\$/.lo/"
1276 # If this variable is set in any of the actions, the command in it
1277 # will be execed at the end. This prevents here-documents from being
1278 # left over by shells.
1281 # func_append var value
1282 # Append VALUE to the end of shell variable VAR.
1286 } # Extended-shell func_append implementation
1288 # func_append_quoted var value
1289 # Quote VALUE and append to the end of shell variable VAR, separated
1291 func_append_quoted ()
1293 func_quote_for_eval "${2}"
1294 eval "${1}+=\\ \$func_quote_for_eval_result"
1295 } # Extended-shell func_append_quoted implementation
1298 # func_arith arithmetic-term...
1301 func_arith_result=$(( $* ))
1302 } # Extended-shell func_arith implementation
1306 # STRING may not start with a hyphen.
1309 func_len_result=${#1}
1310 } # Extended-shell func_len implementation
1317 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1318 *) func_lo2o_result=${1} ;;
1320 } # Extended-shell func_lo2o implementation
1323 # func_xform libobj-or-source
1326 func_xform_result=${1%.*}.lo
1327 } # Extended-shell func_xform implementation
1330 # func_fatal_configuration arg...
1331 # Echo program name prefixed message to standard error, followed by
1332 # a configuration failure hint, and exit.
1333 func_fatal_configuration ()
1335 func_error ${1+"$@"}
1336 func_error "See the $PACKAGE documentation for more information."
1337 func_fatal_error "Fatal configuration error."
1342 # Display the configuration for all the tags in this script.
1345 re_begincf='^# ### BEGIN LIBTOOL'
1346 re_endcf='^# ### END LIBTOOL'
1348 # Default configuration.
1349 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1351 # Now print the configurations for the tags.
1352 for tagname in $taglist; do
1353 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1360 # Display the features supported by this script.
1364 if test "$build_libtool_libs" = yes; then
1365 echo "enable shared libraries"
1367 echo "disable shared libraries"
1369 if test "$build_old_libs" = yes; then
1370 echo "enable static libraries"
1372 echo "disable static libraries"
1378 # func_enable_tag tagname
1379 # Verify that TAGNAME is valid, and either flag an error and exit, or
1380 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1387 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1388 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1389 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1394 func_fatal_error "invalid tag name: $tagname"
1398 # Don't test for the "default" C tag, as we know it's
1399 # there but not specially marked.
1403 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1404 taglist="$taglist $tagname"
1406 # Evaluate the configuration. Be careful to quote the path
1407 # and the sed script, to avoid splitting on whitespace, but
1408 # also don't use non-portable quotes within backquotes within
1409 # quotes we have to do it in 2 steps:
1410 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1413 func_error "ignoring unknown tag $tagname"
1419 # func_check_version_match
1420 # Ensure that we are using m4 macros, and libtool script from the same
1421 # release of libtool.
1422 func_check_version_match ()
1424 if test "$package_revision" != "$macro_revision"; then
1425 if test "$VERSION" != "$macro_version"; then
1426 if test -z "$macro_version"; then
1428 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1429 $progname: definition of this LT_INIT comes from an older release.
1430 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1431 $progname: and run autoconf again.
1435 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1436 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1437 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1438 $progname: and run autoconf again.
1443 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1444 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1445 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1446 $progname: of $PACKAGE $VERSION and run autoconf again.
1455 # Shorthand for --mode=foo, only valid as the first argument
1458 shift; set dummy --mode clean ${1+"$@"}; shift
1460 compile|compil|compi|comp|com|co|c)
1461 shift; set dummy --mode compile ${1+"$@"}; shift
1463 execute|execut|execu|exec|exe|ex|e)
1464 shift; set dummy --mode execute ${1+"$@"}; shift
1466 finish|finis|fini|fin|fi|f)
1467 shift; set dummy --mode finish ${1+"$@"}; shift
1469 install|instal|insta|inst|ins|in|i)
1470 shift; set dummy --mode install ${1+"$@"}; shift
1473 shift; set dummy --mode link ${1+"$@"}; shift
1475 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1476 shift; set dummy --mode uninstall ${1+"$@"}; shift
1486 opt_preserve_dup_deps=false
1497 # Parse options once, thoroughly. This comes as soon as possible in the
1498 # script to make things like `--version' happen as quickly as we can.
1500 # this just eases exit handling
1501 while test $# -gt 0; do
1505 --debug|-x) opt_debug='set -x'
1506 func_echo "enabling shell trace mode"
1509 --dry-run|--dryrun|-n)
1518 opt_dlopen="${opt_dlopen+$opt_dlopen
1522 --preserve-dup-deps)
1523 opt_preserve_dup_deps=:
1531 set dummy --mode finish ${1+"$@"}; shift
1538 opt_help=': help-all'
1541 test $# = 0 && func_missing_arg $opt && break
1545 # Valid mode arguments:
1546 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1548 # Catch anything else as an error
1549 *) func_error "invalid argument for $opt"
1556 --no-silent|--no-quiet)
1558 preserve_args+=" $opt"
1562 preserve_args+=" $opt"
1566 preserve_args+=" $opt"
1571 preserve_args+=" $opt"
1575 test $# = 0 && func_missing_arg $opt && break
1578 preserve_args+=" $opt $optarg"
1579 func_enable_tag "$optarg"
1583 -\?|-h) func_usage ;;
1584 --help) func_help ;;
1585 --version) func_version ;;
1587 # Separate optargs to long options:
1589 func_split_long_opt "$opt"
1590 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1594 # Separate non-argument short options:
1596 func_split_short_opt "$opt"
1597 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1602 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1603 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1609 # save first non-option argument
1610 if test "$#" -gt 0; then
1616 test "$opt_debug" = : || preserve_args+=" --debug"
1619 *cygwin* | *mingw* | *pw32* | *cegcc*)
1620 # don't eliminate duplications in $postdeps and $predeps
1621 opt_duplicate_compiler_generated_deps=:
1624 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1629 # Sanity checks first:
1630 func_check_version_match
1632 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1633 func_fatal_configuration "not configured to build any kind of library"
1637 eval std_shrext=\"$shrext_cmds\"
1639 # Only execute mode is allowed to have -dlopen flags.
1640 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1641 func_error "unrecognized option \`-dlopen'"
1646 # Change the help message to a mode-specific one.
1647 generic_help="$help"
1648 help="Try \`$progname --help --mode=$opt_mode' for more information."
1652 # Bail if the options were screwed
1653 $exit_cmd $EXIT_FAILURE
1664 # True iff FILE is a libtool `.la' library or `.lo' object file.
1665 # This function is only a basic sanity check; it will hardly flush out
1666 # determined imposters.
1670 $SED -e 4q "$1" 2>/dev/null \
1671 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1674 # func_lalib_unsafe_p file
1675 # True iff FILE is a libtool `.la' library or `.lo' object file.
1676 # This function implements the same check as func_lalib_p without
1677 # resorting to external programs. To this end, it redirects stdin and
1678 # closes it afterwards, without saving the original file descriptor.
1679 # As a safety measure, use it only where a negative result would be
1680 # fatal anyway. Works if `file' does not exist.
1681 func_lalib_unsafe_p ()
1684 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1685 for lalib_p_l in 1 2 3 4
1688 case "$lalib_p_line" in
1689 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1694 test "$lalib_p" = yes
1697 # func_ltwrapper_script_p file
1698 # True iff FILE is a libtool wrapper script
1699 # This function is only a basic sanity check; it will hardly flush out
1700 # determined imposters.
1701 func_ltwrapper_script_p ()
1706 # func_ltwrapper_executable_p file
1707 # True iff FILE is a libtool wrapper executable
1708 # This function is only a basic sanity check; it will hardly flush out
1709 # determined imposters.
1710 func_ltwrapper_executable_p ()
1712 func_ltwrapper_exec_suffix=
1715 *) func_ltwrapper_exec_suffix=.exe ;;
1717 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1720 # func_ltwrapper_scriptname file
1721 # Assumes file is an ltwrapper_executable
1722 # uses $file to determine the appropriate filename for a
1723 # temporary ltwrapper_script.
1724 func_ltwrapper_scriptname ()
1726 func_dirname_and_basename "$1" "" "."
1727 func_stripname '' '.exe' "$func_basename_result"
1728 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1731 # func_ltwrapper_p file
1732 # True iff FILE is a libtool wrapper script or wrapper executable
1733 # This function is only a basic sanity check; it will hardly flush out
1734 # determined imposters.
1737 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1741 # func_execute_cmds commands fail_cmd
1742 # Execute tilde-delimited COMMANDS.
1743 # If FAIL_CMD is given, eval that upon failure.
1744 # FAIL_CMD may read-access the current command in variable CMD!
1745 func_execute_cmds ()
1748 save_ifs=$IFS; IFS='~'
1752 func_show_eval "$cmd" "${2-:}"
1759 # Source FILE, adding directory component if necessary.
1760 # Note that it is not necessary on cygwin/mingw to append a dot to
1761 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1762 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1763 # `FILE.' does not work on cygwin managed mounts.
1768 */* | *\\*) . "$1" ;;
1774 # func_resolve_sysroot PATH
1775 # Replace a leading = in PATH with a sysroot. Store the result into
1776 # func_resolve_sysroot_result
1777 func_resolve_sysroot ()
1779 func_resolve_sysroot_result=$1
1780 case $func_resolve_sysroot_result in
1782 func_stripname '=' '' "$func_resolve_sysroot_result"
1783 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1788 # func_replace_sysroot PATH
1789 # If PATH begins with the sysroot, replace it with = and
1790 # store the result into func_replace_sysroot_result.
1791 func_replace_sysroot ()
1793 case "$lt_sysroot:$1" in
1795 func_stripname "$lt_sysroot" '' "$1"
1796 func_replace_sysroot_result="=$func_stripname_result"
1799 # Including no sysroot.
1800 func_replace_sysroot_result=$1
1805 # func_infer_tag arg
1806 # Infer tagged configuration to use if any are available and
1807 # if one wasn't chosen via the "--tag" command line option.
1808 # Only attempt this if the compiler in the base compile
1809 # command doesn't match the default compiler.
1810 # arg is usually of the form 'gcc ...'
1814 if test -n "$available_tags" && test -z "$tagname"; then
1817 func_append_quoted CC_quoted "$arg"
1819 CC_expanded=`func_echo_all $CC`
1820 CC_quoted_expanded=`func_echo_all $CC_quoted`
1822 # Blanks in the command may have been stripped by the calling shell,
1823 # but not from the CC environment variable when configure was run.
1824 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1825 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1826 # Blanks at the start of $base_compile will cause this to fail
1827 # if we don't check for them as well.
1829 for z in $available_tags; do
1830 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1831 # Evaluate the configuration.
1832 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1835 # Double-quote args containing other shell metacharacters.
1836 func_append_quoted CC_quoted "$arg"
1838 CC_expanded=`func_echo_all $CC`
1839 CC_quoted_expanded=`func_echo_all $CC_quoted`
1841 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1842 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1843 # The compiler in the base compile command matches
1844 # the one in the tagged configuration.
1845 # Assume this is the tagged configuration we want.
1852 # If $tagname still isn't set, then no tagged configuration
1853 # was found and let the user know that the "--tag" command
1854 # line option must be used.
1855 if test -z "$tagname"; then
1856 func_echo "unable to infer tagged configuration"
1857 func_fatal_error "specify a tag with \`--tag'"
1859 # func_verbose "using $tagname tagged configuration"
1868 # func_write_libtool_object output_name pic_name nonpic_name
1869 # Create a libtool object file (analogous to a ".la" file),
1870 # but don't create it if we're doing a dry run.
1871 func_write_libtool_object ()
1874 if test "$build_libtool_libs" = yes; then
1880 if test "$build_old_libs" = yes; then
1881 write_oldobj=\'${3}\'
1887 cat >${write_libobj}T <<EOF
1888 # $write_libobj - a libtool object file
1889 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1891 # Please DO NOT delete this file!
1892 # It is necessary for linking the library.
1894 # Name of the PIC object.
1895 pic_object=$write_lobj
1897 # Name of the non-PIC object
1898 non_pic_object=$write_oldobj
1901 $MV "${write_libobj}T" "${write_libobj}"
1906 ##################################################
1907 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1908 ##################################################
1910 # func_convert_core_file_wine_to_w32 ARG
1911 # Helper function used by file name conversion functions when $build is *nix,
1912 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1913 # correctly configured wine environment available, with the winepath program
1914 # in $build's $PATH.
1916 # ARG is the $build file name to be converted to w32 format.
1917 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1918 # be empty on error (or when ARG is empty)
1919 func_convert_core_file_wine_to_w32 ()
1922 func_convert_core_file_wine_to_w32_result="$1"
1923 if test -n "$1"; then
1924 # Unfortunately, winepath does not exit with a non-zero error code, so we
1925 # are forced to check the contents of stdout. On the other hand, if the
1926 # command is not found, the shell will set an exit code of 127 and print
1927 # *an error message* to stdout. So we must check for both error code of
1928 # zero AND non-empty stdout, which explains the odd construction:
1929 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1930 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1931 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1932 $SED -e "$lt_sed_naive_backslashify"`
1934 func_convert_core_file_wine_to_w32_result=
1938 # end: func_convert_core_file_wine_to_w32
1941 # func_convert_core_path_wine_to_w32 ARG
1942 # Helper function used by path conversion functions when $build is *nix, and
1943 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1944 # configured wine environment available, with the winepath program in $build's
1945 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1947 # ARG is path to be converted from $build format to win32.
1948 # Result is available in $func_convert_core_path_wine_to_w32_result.
1949 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1950 # are convertible, then the result may be empty.
1951 func_convert_core_path_wine_to_w32 ()
1954 # unfortunately, winepath doesn't convert paths, only file names
1955 func_convert_core_path_wine_to_w32_result=""
1956 if test -n "$1"; then
1959 for func_convert_core_path_wine_to_w32_f in $1; do
1961 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1962 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1963 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1964 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1966 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1973 # end: func_convert_core_path_wine_to_w32
1976 # func_cygpath ARGS...
1977 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1978 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1979 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1980 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1981 # file name or path is assumed to be in w32 format, as previously converted
1982 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1983 # or path in func_cygpath_result (input file name or path is assumed to be in
1984 # Cygwin format). Returns an empty string on error.
1986 # ARGS are passed to cygpath, with the last one being the file name or path to
1989 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1990 # environment variable; do not put it in $PATH.
1994 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1995 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1996 if test "$?" -ne 0; then
1997 # on failure, ensure result is empty
1998 func_cygpath_result=
2001 func_cygpath_result=
2002 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2008 # func_convert_core_msys_to_w32 ARG
2009 # Convert file name or path ARG from MSYS format to w32 format. Return
2010 # result in func_convert_core_msys_to_w32_result.
2011 func_convert_core_msys_to_w32 ()
2014 # awkward: cmd appends spaces to result
2015 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2016 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2018 #end: func_convert_core_msys_to_w32
2021 # func_convert_file_check ARG1 ARG2
2022 # Verify that ARG1 (a file name in $build format) was converted to $host
2023 # format in ARG2. Otherwise, emit an error message, but continue (resetting
2024 # func_to_host_file_result to ARG1).
2025 func_convert_file_check ()
2028 if test -z "$2" && test -n "$1" ; then
2029 func_error "Could not determine host file name corresponding to"
2031 func_error "Continuing, but uninstalled executables may not work."
2033 func_to_host_file_result="$1"
2036 # end func_convert_file_check
2039 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2040 # Verify that FROM_PATH (a path in $build format) was converted to $host
2041 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2042 # func_to_host_file_result to a simplistic fallback value (see below).
2043 func_convert_path_check ()
2046 if test -z "$4" && test -n "$3"; then
2047 func_error "Could not determine the host path corresponding to"
2049 func_error "Continuing, but uninstalled executables may not work."
2050 # Fallback. This is a deliberately simplistic "conversion" and
2051 # should not be "improved". See libtool.info.
2052 if test "x$1" != "x$2"; then
2053 lt_replace_pathsep_chars="s|$1|$2|g"
2054 func_to_host_path_result=`echo "$3" |
2055 $SED -e "$lt_replace_pathsep_chars"`
2057 func_to_host_path_result="$3"
2061 # end func_convert_path_check
2064 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2065 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2066 # and appending REPL if ORIG matches BACKPAT.
2067 func_convert_path_front_back_pathsep ()
2071 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2075 $2 ) func_to_host_path_result+="$3"
2079 # end func_convert_path_front_back_pathsep
2082 ##################################################
2083 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2084 ##################################################
2085 # invoked via `$to_host_file_cmd ARG'
2087 # In each case, ARG is the path to be converted from $build to $host format.
2088 # Result will be available in $func_to_host_file_result.
2091 # func_to_host_file ARG
2092 # Converts the file name ARG from $build format to $host format. Return result
2093 # in func_to_host_file_result.
2094 func_to_host_file ()
2097 $to_host_file_cmd "$1"
2099 # end func_to_host_file
2102 # func_to_tool_file ARG LAZY
2103 # converts the file name ARG from $build format to toolchain format. Return
2104 # result in func_to_tool_file_result. If the conversion in use is listed
2105 # in (the comma separated) LAZY, no conversion takes place.
2106 func_to_tool_file ()
2110 *,"$to_tool_file_cmd",*)
2111 func_to_tool_file_result=$1
2114 $to_tool_file_cmd "$1"
2115 func_to_tool_file_result=$func_to_host_file_result
2119 # end func_to_tool_file
2122 # func_convert_file_noop ARG
2123 # Copy ARG to func_to_host_file_result.
2124 func_convert_file_noop ()
2126 func_to_host_file_result="$1"
2128 # end func_convert_file_noop
2131 # func_convert_file_msys_to_w32 ARG
2132 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2133 # conversion to w32 is not available inside the cwrapper. Returns result in
2134 # func_to_host_file_result.
2135 func_convert_file_msys_to_w32 ()
2138 func_to_host_file_result="$1"
2139 if test -n "$1"; then
2140 func_convert_core_msys_to_w32 "$1"
2141 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2143 func_convert_file_check "$1" "$func_to_host_file_result"
2145 # end func_convert_file_msys_to_w32
2148 # func_convert_file_cygwin_to_w32 ARG
2149 # Convert file name ARG from Cygwin to w32 format. Returns result in
2150 # func_to_host_file_result.
2151 func_convert_file_cygwin_to_w32 ()
2154 func_to_host_file_result="$1"
2155 if test -n "$1"; then
2156 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2157 # LT_CYGPATH in this case.
2158 func_to_host_file_result=`cygpath -m "$1"`
2160 func_convert_file_check "$1" "$func_to_host_file_result"
2162 # end func_convert_file_cygwin_to_w32
2165 # func_convert_file_nix_to_w32 ARG
2166 # Convert file name ARG from *nix to w32 format. Requires a wine environment
2167 # and a working winepath. Returns result in func_to_host_file_result.
2168 func_convert_file_nix_to_w32 ()
2171 func_to_host_file_result="$1"
2172 if test -n "$1"; then
2173 func_convert_core_file_wine_to_w32 "$1"
2174 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2176 func_convert_file_check "$1" "$func_to_host_file_result"
2178 # end func_convert_file_nix_to_w32
2181 # func_convert_file_msys_to_cygwin ARG
2182 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2183 # Returns result in func_to_host_file_result.
2184 func_convert_file_msys_to_cygwin ()
2187 func_to_host_file_result="$1"
2188 if test -n "$1"; then
2189 func_convert_core_msys_to_w32 "$1"
2190 func_cygpath -u "$func_convert_core_msys_to_w32_result"
2191 func_to_host_file_result="$func_cygpath_result"
2193 func_convert_file_check "$1" "$func_to_host_file_result"
2195 # end func_convert_file_msys_to_cygwin
2198 # func_convert_file_nix_to_cygwin ARG
2199 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2200 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2201 # in func_to_host_file_result.
2202 func_convert_file_nix_to_cygwin ()
2205 func_to_host_file_result="$1"
2206 if test -n "$1"; then
2207 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2208 func_convert_core_file_wine_to_w32 "$1"
2209 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2210 func_to_host_file_result="$func_cygpath_result"
2212 func_convert_file_check "$1" "$func_to_host_file_result"
2214 # end func_convert_file_nix_to_cygwin
2217 #############################################
2218 # $build to $host PATH CONVERSION FUNCTIONS #
2219 #############################################
2220 # invoked via `$to_host_path_cmd ARG'
2222 # In each case, ARG is the path to be converted from $build to $host format.
2223 # The result will be available in $func_to_host_path_result.
2225 # Path separators are also converted from $build format to $host format. If
2226 # ARG begins or ends with a path separator character, it is preserved (but
2227 # converted to $host format) on output.
2229 # All path conversion functions are named using the following convention:
2230 # file name conversion function : func_convert_file_X_to_Y ()
2231 # path conversion function : func_convert_path_X_to_Y ()
2232 # where, for any given $build/$host combination the 'X_to_Y' value is the
2233 # same. If conversion functions are added for new $build/$host combinations,
2234 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
2238 # func_init_to_host_path_cmd
2239 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
2240 # appropriate value, based on the value of $to_host_file_cmd.
2242 func_init_to_host_path_cmd ()
2245 if test -z "$to_host_path_cmd"; then
2246 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2247 to_host_path_cmd="func_convert_path_${func_stripname_result}"
2252 # func_to_host_path ARG
2253 # Converts the path ARG from $build format to $host format. Return result
2254 # in func_to_host_path_result.
2255 func_to_host_path ()
2258 func_init_to_host_path_cmd
2259 $to_host_path_cmd "$1"
2261 # end func_to_host_path
2264 # func_convert_path_noop ARG
2265 # Copy ARG to func_to_host_path_result.
2266 func_convert_path_noop ()
2268 func_to_host_path_result="$1"
2270 # end func_convert_path_noop
2273 # func_convert_path_msys_to_w32 ARG
2274 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2275 # conversion to w32 is not available inside the cwrapper. Returns result in
2276 # func_to_host_path_result.
2277 func_convert_path_msys_to_w32 ()
2280 func_to_host_path_result="$1"
2281 if test -n "$1"; then
2282 # Remove leading and trailing path separator characters from ARG. MSYS
2283 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2284 # and winepath ignores them completely.
2285 func_stripname : : "$1"
2286 func_to_host_path_tmp1=$func_stripname_result
2287 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2288 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2289 func_convert_path_check : ";" \
2290 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2291 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2294 # end func_convert_path_msys_to_w32
2297 # func_convert_path_cygwin_to_w32 ARG
2298 # Convert path ARG from Cygwin to w32 format. Returns result in
2299 # func_to_host_file_result.
2300 func_convert_path_cygwin_to_w32 ()
2303 func_to_host_path_result="$1"
2304 if test -n "$1"; then
2305 # See func_convert_path_msys_to_w32:
2306 func_stripname : : "$1"
2307 func_to_host_path_tmp1=$func_stripname_result
2308 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2309 func_convert_path_check : ";" \
2310 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2311 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2314 # end func_convert_path_cygwin_to_w32
2317 # func_convert_path_nix_to_w32 ARG
2318 # Convert path ARG from *nix to w32 format. Requires a wine environment and
2319 # a working winepath. Returns result in func_to_host_file_result.
2320 func_convert_path_nix_to_w32 ()
2323 func_to_host_path_result="$1"
2324 if test -n "$1"; then
2325 # See func_convert_path_msys_to_w32:
2326 func_stripname : : "$1"
2327 func_to_host_path_tmp1=$func_stripname_result
2328 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2329 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2330 func_convert_path_check : ";" \
2331 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2332 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2335 # end func_convert_path_nix_to_w32
2338 # func_convert_path_msys_to_cygwin ARG
2339 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2340 # Returns result in func_to_host_file_result.
2341 func_convert_path_msys_to_cygwin ()
2344 func_to_host_path_result="$1"
2345 if test -n "$1"; then
2346 # See func_convert_path_msys_to_w32:
2347 func_stripname : : "$1"
2348 func_to_host_path_tmp1=$func_stripname_result
2349 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2350 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2351 func_to_host_path_result="$func_cygpath_result"
2352 func_convert_path_check : : \
2353 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2354 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2357 # end func_convert_path_msys_to_cygwin
2360 # func_convert_path_nix_to_cygwin ARG
2361 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2362 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2363 # func_to_host_file_result.
2364 func_convert_path_nix_to_cygwin ()
2367 func_to_host_path_result="$1"
2368 if test -n "$1"; then
2369 # Remove leading and trailing path separator characters from
2370 # ARG. msys behavior is inconsistent here, cygpath turns them
2371 # into '.;' and ';.', and winepath ignores them completely.
2372 func_stripname : : "$1"
2373 func_to_host_path_tmp1=$func_stripname_result
2374 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2375 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2376 func_to_host_path_result="$func_cygpath_result"
2377 func_convert_path_check : : \
2378 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2379 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2382 # end func_convert_path_nix_to_cygwin
2385 # func_mode_compile arg...
2386 func_mode_compile ()
2389 # Get the compilation command and the source file.
2391 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
2403 # do not "continue". Instead, add this to base_compile
2415 # Accept any command-line options.
2418 test -n "$libobj" && \
2419 func_fatal_error "you cannot specify \`-o' more than once"
2424 -pie | -fpie | -fPIE)
2429 -shared | -static | -prefer-pic | -prefer-non-pic)
2440 arg_mode=arg # the next one goes into the "base_compile" arg list
2441 continue # The current "srcfile" will either be retained or
2442 ;; # replaced later. I would guess that would be a bug.
2445 func_stripname '-Wc,' '' "$arg"
2446 args=$func_stripname_result
2448 save_ifs="$IFS"; IFS=','
2449 for arg in $args; do
2451 func_append_quoted lastarg "$arg"
2454 func_stripname ' ' '' "$lastarg"
2455 lastarg=$func_stripname_result
2457 # Add the arguments to base_compile.
2458 base_compile+=" $lastarg"
2463 # Accept the current argument as the source file.
2464 # The previous "srcfile" becomes the current argument.
2471 esac # case $arg_mode
2473 # Aesthetically quote the previous argument.
2474 func_append_quoted base_compile "$lastarg"
2479 func_fatal_error "you must specify an argument for -Xcompile"
2482 func_fatal_error "you must specify a target with \`-o'"
2485 # Get the name of the library object.
2486 test -z "$libobj" && {
2487 func_basename "$srcfile"
2488 libobj="$func_basename_result"
2493 # Recognize several different file suffixes.
2494 # If the user specifies -o file.o, it is replaced with file.lo
2497 *.ada | *.adb | *.ads | *.asm | \
2498 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2499 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
2500 func_xform "$libobj"
2501 libobj=$func_xform_result
2506 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2508 func_fatal_error "cannot determine name of library object from \`$libobj'"
2512 func_infer_tag $base_compile
2514 for arg in $later; do
2517 test "$build_libtool_libs" != yes && \
2518 func_fatal_configuration "can not build a shared library"
2524 build_libtool_libs=no
2541 func_quote_for_eval "$libobj"
2542 test "X$libobj" != "X$func_quote_for_eval_result" \
2543 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2544 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2545 func_dirname_and_basename "$obj" "/" ""
2546 objname="$func_basename_result"
2547 xdir="$func_dirname_result"
2548 lobj=${xdir}$objdir/$objname
2550 test -z "$base_compile" && \
2551 func_fatal_help "you must specify a compilation command"
2553 # Delete any leftover library objects.
2554 if test "$build_old_libs" = yes; then
2555 removelist="$obj $lobj $libobj ${libobj}T"
2557 removelist="$lobj $libobj ${libobj}T"
2560 # On Cygwin there's no "real" PIC flag so we must build both object types
2562 cygwin* | mingw* | pw32* | os2* | cegcc*)
2566 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2567 # non-PIC code in shared libraries is not supported
2571 # Calculate the filename of the output object if compiler does
2572 # not support -o with -c
2573 if test "$compiler_c_o" = no; then
2574 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2575 lockfile="$output_obj.lock"
2582 # Lock this critical section if it is needed
2583 # We use this script file to make the link, it avoids creating a new file
2584 if test "$need_locks" = yes; then
2585 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2586 func_echo "Waiting for $lockfile to be removed"
2589 elif test "$need_locks" = warn; then
2590 if test -f "$lockfile"; then
2592 *** ERROR, $lockfile exists and contains:
2593 `cat $lockfile 2>/dev/null`
2595 This indicates that another process is trying to use the same
2596 temporary object file, and libtool could not work around it because
2597 your compiler does not support \`-c' and \`-o' together. If you
2598 repeat this compilation, it may succeed, by chance, but you had better
2599 avoid parallel builds (make -j) in this platform, or get a better
2602 $opt_dry_run || $RM $removelist
2605 removelist+=" $output_obj"
2606 $ECHO "$srcfile" > "$lockfile"
2609 $opt_dry_run || $RM $removelist
2610 removelist+=" $lockfile"
2611 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2613 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2614 srcfile=$func_to_tool_file_result
2615 func_quote_for_eval "$srcfile"
2616 qsrcfile=$func_quote_for_eval_result
2618 # Only build a PIC object if we are building libtool libraries.
2619 if test "$build_libtool_libs" = yes; then
2620 # Without this assignment, base_compile gets emptied.
2621 fbsd_hideous_sh_bug=$base_compile
2623 if test "$pic_mode" != no; then
2624 command="$base_compile $qsrcfile $pic_flag"
2626 # Don't build PIC code
2627 command="$base_compile $qsrcfile"
2630 func_mkdir_p "$xdir$objdir"
2632 if test -z "$output_obj"; then
2633 # Place PIC objects in $objdir
2634 command+=" -o $lobj"
2637 func_show_eval_locale "$command" \
2638 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2640 if test "$need_locks" = warn &&
2641 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2643 *** ERROR, $lockfile contains:
2644 `cat $lockfile 2>/dev/null`
2646 but it should contain:
2649 This indicates that another process is trying to use the same
2650 temporary object file, and libtool could not work around it because
2651 your compiler does not support \`-c' and \`-o' together. If you
2652 repeat this compilation, it may succeed, by chance, but you had better
2653 avoid parallel builds (make -j) in this platform, or get a better
2656 $opt_dry_run || $RM $removelist
2660 # Just move the object if needed, then go on to compile the next one
2661 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2662 func_show_eval '$MV "$output_obj" "$lobj"' \
2663 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2666 # Allow error messages only from the first compilation.
2667 if test "$suppress_opt" = yes; then
2668 suppress_output=' >/dev/null 2>&1'
2672 # Only build a position-dependent object if we build old libraries.
2673 if test "$build_old_libs" = yes; then
2674 if test "$pic_mode" != yes; then
2675 # Don't build PIC code
2676 command="$base_compile $qsrcfile$pie_flag"
2678 command="$base_compile $qsrcfile $pic_flag"
2680 if test "$compiler_c_o" = yes; then
2684 # Suppress compiler output if we already did a PIC compilation.
2685 command+="$suppress_output"
2686 func_show_eval_locale "$command" \
2687 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2689 if test "$need_locks" = warn &&
2690 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2692 *** ERROR, $lockfile contains:
2693 `cat $lockfile 2>/dev/null`
2695 but it should contain:
2698 This indicates that another process is trying to use the same
2699 temporary object file, and libtool could not work around it because
2700 your compiler does not support \`-c' and \`-o' together. If you
2701 repeat this compilation, it may succeed, by chance, but you had better
2702 avoid parallel builds (make -j) in this platform, or get a better
2705 $opt_dry_run || $RM $removelist
2709 # Just move the object if needed
2710 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2711 func_show_eval '$MV "$output_obj" "$obj"' \
2712 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2717 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2719 # Unlock the critical section if it was locked
2720 if test "$need_locks" != no; then
2721 removelist=$lockfile
2730 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2735 # We need to display help for each of the modes.
2738 # Generic help is extracted from the usage comments
2739 # at the start of this file.
2745 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2747 Remove files from the build directory.
2749 RM is the name of the program to use to delete files associated with each FILE
2750 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2753 If FILE is a libtool library, object or program, all the files associated
2754 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2759 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2761 Compile a source file into a libtool library object.
2763 This mode accepts the following additional options:
2765 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2766 -no-suppress do not suppress compiler output for multiple passes
2767 -prefer-pic try to build PIC objects only
2768 -prefer-non-pic try to build non-PIC objects only
2769 -shared do not build a \`.o' file suitable for static linking
2770 -static only build a \`.o' file suitable for static linking
2771 -Wc,FLAG pass FLAG directly to the compiler
2773 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2774 from the given SOURCEFILE.
2776 The output file name is determined by removing the directory component from
2777 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2778 library object suffix, \`.lo'."
2783 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2785 Automatically set library path, then run a program.
2787 This mode accepts the following additional options:
2789 -dlopen FILE add the directory containing FILE to the library path
2791 This mode sets the library path environment variable according to \`-dlopen'
2794 If any of the ARGS are libtool executable wrappers, then they are translated
2795 into their corresponding uninstalled binary, and any of their required library
2796 directories are added to the library path.
2798 Then, COMMAND is executed, with ARGS as arguments."
2803 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2805 Complete the installation of libtool libraries.
2807 Each LIBDIR is a directory that contains libtool libraries.
2809 The commands that this mode executes may require superuser privileges. Use
2810 the \`--dry-run' option if you just want to see what would be executed."
2815 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2817 Install executables or libraries.
2819 INSTALL-COMMAND is the installation command. The first component should be
2820 either the \`install' or \`cp' program.
2822 The following components of INSTALL-COMMAND are treated specially:
2824 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2826 The rest of the components are interpreted as arguments to that command (only
2827 BSD-compatible install options are recognized)."
2832 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2834 Link object files or libraries together to form another library, or to
2835 create an executable program.
2837 LINK-COMMAND is a command using the C compiler that you would use to create
2838 a program from several object files.
2840 The following components of LINK-COMMAND are treated specially:
2842 -all-static do not do any dynamic linking at all
2843 -avoid-version do not add a version suffix if possible
2844 -bindir BINDIR specify path to binaries directory (for systems where
2845 libraries must be found in the PATH setting at runtime)
2846 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2847 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2848 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2849 -export-symbols SYMFILE
2850 try to export only the symbols listed in SYMFILE
2851 -export-symbols-regex REGEX
2852 try to export only the symbols matching REGEX
2853 -LLIBDIR search LIBDIR for required installed libraries
2854 -lNAME OUTPUT-FILE requires the installed library libNAME
2855 -module build a library that can dlopened
2856 -no-fast-install disable the fast-install mode
2857 -no-install link a not-installable executable
2858 -no-undefined declare that a library does not refer to external symbols
2859 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2860 -objectlist FILE Use a list of object files found in FILE to specify objects
2861 -precious-files-regex REGEX
2862 don't remove output files matching REGEX
2863 -release RELEASE specify package release information
2864 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2865 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2866 -shared only do dynamic linking of libtool libraries
2867 -shrext SUFFIX override the standard shared library file extension
2868 -static do not do any dynamic linking of uninstalled libtool libraries
2869 -static-libtool-libs
2870 do not do any dynamic linking of libtool libraries
2871 -version-info CURRENT[:REVISION[:AGE]]
2872 specify library version info [each variable defaults to 0]
2873 -weak LIBNAME declare that the target provides the LIBNAME interface
2875 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2877 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2878 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2880 All other options (arguments beginning with \`-') are ignored.
2882 Every other argument is treated as a filename. Files ending in \`.la' are
2883 treated as uninstalled libtool libraries, other files are standard or library
2886 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2887 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2888 required, except when creating a convenience library.
2890 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2891 using \`ar' and \`ranlib', or on Windows using \`lib'.
2893 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2894 is created, otherwise an executable program is created."
2899 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2901 Remove libraries from an installation directory.
2903 RM is the name of the program to use to delete files associated with each FILE
2904 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2907 If FILE is a libtool library, all the files associated with it are deleted.
2908 Otherwise, only FILE itself is deleted using RM."
2912 func_fatal_help "invalid operation mode \`$opt_mode'"
2917 $ECHO "Try \`$progname --help' for more information about other modes."
2920 # Now that we've collected a possible --mode arg, show help if necessary
2922 if test "$opt_help" = :; then
2927 for opt_mode in compile link execute install finish uninstall clean; do
2930 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2933 for opt_mode in compile link execute install finish uninstall clean; do
2939 /^When reporting/,/^Report/{
2944 /information about other modes/d
2945 /more detailed .*MODE/d
2946 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2952 # func_mode_execute arg...
2953 func_mode_execute ()
2956 # The first argument is the command name.
2959 func_fatal_help "you must specify a COMMAND"
2961 # Handle -dlopen flags immediately.
2962 for file in $opt_dlopen; do
2964 || func_fatal_help "\`$file' is not a file"
2969 func_resolve_sysroot "$file"
2970 file=$func_resolve_sysroot_result
2972 # Check to see that this really is a libtool archive.
2973 func_lalib_unsafe_p "$file" \
2974 || func_fatal_help "\`$lib' is not a valid libtool archive"
2976 # Read the libtool library.
2981 # Skip this library if it cannot be dlopened.
2982 if test -z "$dlname"; then
2983 # Warn if it was a shared library.
2984 test -n "$library_names" && \
2985 func_warning "\`$file' was not linked with \`-export-dynamic'"
2989 func_dirname "$file" "" "."
2990 dir="$func_dirname_result"
2992 if test -f "$dir/$objdir/$dlname"; then
2995 if test ! -f "$dir/$dlname"; then
2996 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
3002 # Just add the directory containing the .lo file.
3003 func_dirname "$file" "" "."
3004 dir="$func_dirname_result"
3008 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3013 # Get the absolute pathname.
3014 absdir=`cd "$dir" && pwd`
3015 test -n "$absdir" && dir="$absdir"
3017 # Now add the directory to shlibpath_var.
3018 if eval "test -z \"\$$shlibpath_var\""; then
3019 eval "$shlibpath_var=\"\$dir\""
3021 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3025 # This variable tells wrapper scripts just to set shlibpath_var
3026 # rather than running their programs.
3027 libtool_execute_magic="$magic"
3029 # Check if any of the arguments is a wrapper script.
3034 -* | *.la | *.lo ) ;;
3036 # Do a test to see if this is really a libtool program.
3037 if func_ltwrapper_script_p "$file"; then
3039 # Transform arg to wrapped name.
3040 file="$progdir/$program"
3041 elif func_ltwrapper_executable_p "$file"; then
3042 func_ltwrapper_scriptname "$file"
3043 func_source "$func_ltwrapper_scriptname_result"
3044 # Transform arg to wrapped name.
3045 file="$progdir/$program"
3049 # Quote arguments (to preserve shell metacharacters).
3050 func_append_quoted args "$file"
3053 if test "X$opt_dry_run" = Xfalse; then
3054 if test -n "$shlibpath_var"; then
3055 # Export the shlibpath_var.
3056 eval "export $shlibpath_var"
3059 # Restore saved environment variables
3060 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3062 eval "if test \"\${save_$lt_var+set}\" = set; then
3063 $lt_var=\$save_$lt_var; export $lt_var
3069 # Now prepare to actually exec the command.
3070 exec_cmd="\$cmd$args"
3072 # Display what would be done.
3073 if test -n "$shlibpath_var"; then
3074 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3075 echo "export $shlibpath_var"
3082 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3085 # func_mode_finish arg...
3093 for opt in "$nonopt" ${1+"$@"}
3095 if test -d "$opt"; then
3098 elif test -f "$opt"; then
3099 if func_lalib_unsafe_p "$opt"; then
3102 func_warning "\`$opt' is not a valid libtool archive"
3106 func_fatal_error "invalid argument \`$opt'"
3110 if test -n "$libs"; then
3111 if test -n "$lt_sysroot"; then
3112 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3113 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3118 # Remove sysroot references
3119 if $opt_dry_run; then
3120 for lib in $libs; do
3121 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3124 tmpdir=`func_mktempdir`
3125 for lib in $libs; do
3126 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3128 mv -f $tmpdir/tmp-la $lib
3134 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3135 for libdir in $libdirs; do
3136 if test -n "$finish_cmds"; then
3137 # Do each command in the finish commands.
3138 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3141 if test -n "$finish_eval"; then
3142 # Do the single finish_eval.
3143 eval cmds=\"$finish_eval\"
3144 $opt_dry_run || eval "$cmds" || admincmds+="
3150 # Exit here if they wanted silent mode.
3151 $opt_silent && exit $EXIT_SUCCESS
3153 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3154 echo "----------------------------------------------------------------------"
3155 echo "Libraries have been installed in:"
3156 for libdir in $libdirs; do
3160 echo "If you ever happen to want to link against installed libraries"
3161 echo "in a given directory, LIBDIR, you must either use libtool, and"
3162 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3163 echo "flag during linking and do at least one of the following:"
3164 if test -n "$shlibpath_var"; then
3165 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3166 echo " during execution"
3168 if test -n "$runpath_var"; then
3169 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3170 echo " during linking"
3172 if test -n "$hardcode_libdir_flag_spec"; then
3174 eval flag=\"$hardcode_libdir_flag_spec\"
3176 $ECHO " - use the \`$flag' linker flag"
3178 if test -n "$admincmds"; then
3179 $ECHO " - have your system administrator run these commands:$admincmds"
3181 if test -f /etc/ld.so.conf; then
3182 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3186 echo "See any operating system documentation about shared libraries for"
3188 solaris2.[6789]|solaris2.1[0-9])
3189 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3193 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3196 echo "----------------------------------------------------------------------"
3201 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3204 # func_mode_install arg...
3205 func_mode_install ()
3208 # There may be an optional sh(1) argument at the beginning of
3209 # install_prog (especially on Windows NT).
3210 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3211 # Allow the use of GNU shtool's install command.
3212 case $nonopt in *shtool*) :;; *) false;; esac; then
3213 # Aesthetically quote it.
3214 func_quote_for_eval "$nonopt"
3215 install_prog="$func_quote_for_eval_result "
3223 # The real first argument should be the name of the installation program.
3224 # Aesthetically quote it.
3225 func_quote_for_eval "$arg"
3226 install_prog+="$func_quote_for_eval_result"
3227 install_shared_prog=$install_prog
3228 case " $install_prog " in
3229 *[\\\ /]cp\ *) install_cp=: ;;
3230 *) install_cp=false ;;
3233 # We need to accept at least all the BSD install flags.
3245 if test -n "$dest"; then
3254 if $install_cp; then :; else
3268 # If the previous option needed an argument, then skip it.
3269 if test -n "$prev"; then
3270 if test "x$prev" = x-m && test -n "$install_override_mode"; then
3271 arg2=$install_override_mode
3282 # Aesthetically quote the argument.
3283 func_quote_for_eval "$arg"
3284 install_prog+=" $func_quote_for_eval_result"
3285 if test -n "$arg2"; then
3286 func_quote_for_eval "$arg2"
3288 install_shared_prog+=" $func_quote_for_eval_result"
3291 test -z "$install_prog" && \
3292 func_fatal_help "you must specify an install program"
3294 test -n "$prev" && \
3295 func_fatal_help "the \`$prev' option requires an argument"
3297 if test -n "$install_override_mode" && $no_mode; then
3298 if $install_cp; then :; else
3299 func_quote_for_eval "$install_override_mode"
3300 install_shared_prog+=" -m $func_quote_for_eval_result"
3304 if test -z "$files"; then
3305 if test -z "$dest"; then
3306 func_fatal_help "no file or destination specified"
3308 func_fatal_help "you must specify a destination"
3312 # Strip any trailing slash from the destination.
3313 func_stripname '' '/' "$dest"
3314 dest=$func_stripname_result
3316 # Check to see that the destination is a directory.
3317 test -d "$dest" && isdir=yes
3318 if test "$isdir" = yes; then
3322 func_dirname_and_basename "$dest" "" "."
3323 destdir="$func_dirname_result"
3324 destname="$func_basename_result"
3326 # Not a directory, so check to see that there is only one file specified.
3327 set dummy $files; shift
3328 test "$#" -gt 1 && \
3329 func_fatal_help "\`$dest' is not a directory"
3332 [\\/]* | [A-Za-z]:[\\/]*) ;;
3334 for file in $files; do
3338 func_fatal_help "\`$destdir' must be an absolute directory name"
3345 # This variable tells wrapper scripts just to set variables rather
3346 # than running their programs.
3347 libtool_install_magic="$magic"
3352 for file in $files; do
3354 # Do each installation.
3357 # Do the static libraries later.
3358 staticlibs+=" $file"
3362 func_resolve_sysroot "$file"
3363 file=$func_resolve_sysroot_result
3365 # Check to see that this really is a libtool archive.
3366 func_lalib_unsafe_p "$file" \
3367 || func_fatal_help "\`$file' is not a valid libtool archive"
3374 # Add the libdir to current_libdirs if it is the destination.
3375 if test "X$destdir" = "X$libdir"; then
3376 case "$current_libdirs " in
3378 *) current_libdirs+=" $libdir" ;;
3381 # Note the libdir as a future libdir.
3382 case "$future_libdirs " in
3384 *) future_libdirs+=" $libdir" ;;
3388 func_dirname "$file" "/" ""
3389 dir="$func_dirname_result"
3392 if test -n "$relink_command"; then
3393 # Determine the prefix the user has applied to our future dir.
3394 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3396 # Don't allow the user to place us outside of our expected
3397 # location b/c this prevents finding dependent libraries that
3398 # are installed to the same prefix.
3399 # At present, this check doesn't affect windows .dll's that
3400 # are installed into $libdir/../bin (currently, that works fine)
3401 # but it's something to keep an eye on.
3402 test "$inst_prefix_dir" = "$destdir" && \
3403 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3405 if test -n "$inst_prefix_dir"; then
3406 # Stick the inst_prefix_dir data into the link command.
3407 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3409 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3412 func_warning "relinking \`$file'"
3413 func_show_eval "$relink_command" \
3414 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3417 # See the names of the shared library.
3418 set dummy $library_names; shift
3419 if test -n "$1"; then
3424 test -n "$relink_command" && srcname="$realname"T
3426 # Install the shared library and build the symlinks.
3427 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3431 cygwin* | mingw* | pw32* | cegcc*)
3439 if test -n "$tstripme" && test -n "$striplib"; then
3440 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3443 if test "$#" -gt 0; then
3444 # Delete the old symlinks, and create new ones.
3445 # Try `ln -sf' first, because the `ln' binary might depend on
3446 # the symlink we replace! Solaris /bin/ln does not understand -f,
3447 # so we also need to try rm && ln -s.
3450 test "$linkname" != "$realname" \
3451 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3455 # Do each command in the postinstall commands.
3456 lib="$destdir/$realname"
3457 func_execute_cmds "$postinstall_cmds" 'exit $?'
3460 # Install the pseudo-library for information purposes.
3461 func_basename "$file"
3462 name="$func_basename_result"
3463 instname="$dir/$name"i
3464 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3466 # Maybe install the static library, too.
3467 test -n "$old_library" && staticlibs+=" $dir/$old_library"
3471 # Install (i.e. copy) a libtool object.
3473 # Figure out destination file name, if it wasn't already specified.
3474 if test -n "$destname"; then
3475 destfile="$destdir/$destname"
3477 func_basename "$file"
3478 destfile="$func_basename_result"
3479 destfile="$destdir/$destfile"
3482 # Deduce the name of the destination old-style object file.
3485 func_lo2o "$destfile"
3486 staticdest=$func_lo2o_result
3489 staticdest="$destfile"
3493 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3497 # Install the libtool object if requested.
3498 test -n "$destfile" && \
3499 func_show_eval "$install_prog $file $destfile" 'exit $?'
3501 # Install the old object if enabled.
3502 if test "$build_old_libs" = yes; then
3503 # Deduce the name of the old-style object file.
3505 staticobj=$func_lo2o_result
3506 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3512 # Figure out destination file name, if it wasn't already specified.
3513 if test -n "$destname"; then
3514 destfile="$destdir/$destname"
3516 func_basename "$file"
3517 destfile="$func_basename_result"
3518 destfile="$destdir/$destfile"
3521 # If the file is missing, and there is a .exe on the end, strip it
3522 # because it is most likely a libtool script we actually want to
3527 if test ! -f "$file"; then
3528 func_stripname '' '.exe' "$file"
3529 file=$func_stripname_result
3535 # Do a test to see if this is really a libtool program.
3538 if func_ltwrapper_executable_p "$file"; then
3539 func_ltwrapper_scriptname "$file"
3540 wrapper=$func_ltwrapper_scriptname_result
3542 func_stripname '' '.exe' "$file"
3543 wrapper=$func_stripname_result
3550 if func_ltwrapper_script_p "$wrapper"; then
3554 func_source "$wrapper"
3556 # Check the variables that should have been set.
3557 test -z "$generated_by_libtool_version" && \
3558 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3561 for lib in $notinst_deplibs; do
3562 # Check to see that each library is installed.
3564 if test -f "$lib"; then
3567 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3568 if test -n "$libdir" && test ! -f "$libfile"; then
3569 func_warning "\`$lib' has not been installed in \`$libdir'"
3575 func_source "$wrapper"
3578 if test "$fast_install" = no && test -n "$relink_command"; then
3580 if test "$finalize" = yes; then
3581 tmpdir=`func_mktempdir`
3582 func_basename "$file$stripped_ext"
3583 file="$func_basename_result"
3584 outputname="$tmpdir/$file"
3585 # Replace the output file specification.
3586 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3589 func_quote_for_expand "$relink_command"
3590 eval "func_echo $func_quote_for_expand_result"
3592 if eval "$relink_command"; then :
3594 func_error "error: relink \`$file' with the above command before installing it"
3595 $opt_dry_run || ${RM}r "$tmpdir"
3600 func_warning "cannot relink \`$file'"
3604 # Install the binary that we compiled earlier.
3605 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3609 # remove .exe since cygwin /usr/bin/install will append another
3611 case $install_prog,$host in
3612 */usr/bin/install*,*cygwin*)
3613 case $file:$destfile in
3618 destfile=$destfile.exe
3621 func_stripname '' '.exe' "$destfile"
3622 destfile=$func_stripname_result
3627 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3628 $opt_dry_run || if test -n "$outputname"; then
3635 for file in $staticlibs; do
3636 func_basename "$file"
3637 name="$func_basename_result"
3639 # Set up the ranlib parameters.
3640 oldlib="$destdir/$name"
3642 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3644 if test -n "$stripme" && test -n "$old_striplib"; then
3645 func_show_eval "$old_striplib $oldlib" 'exit $?'
3648 # Do each command in the postinstall commands.
3649 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3652 test -n "$future_libdirs" && \
3653 func_warning "remember to run \`$progname --finish$future_libdirs'"
3655 if test -n "$current_libdirs"; then
3656 # Maybe just do a dry run.
3657 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3658 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3664 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3667 # func_generate_dlsyms outputname originator pic_p
3668 # Extract symbols from dlprefiles and create ${outputname}S.o with
3669 # a dlpreopen symbol table.
3670 func_generate_dlsyms ()
3676 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3679 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3680 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3681 my_dlsyms="${my_outputname}S.c"
3683 func_error "not configured to extract global symbols from dlpreopened files"
3687 if test -n "$my_dlsyms"; then
3691 # Discover the nlist of each of the dlfiles.
3692 nlist="$output_objdir/${my_outputname}.nm"
3694 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3696 # Parse the name list into a source file.
3697 func_verbose "creating $output_objdir/$my_dlsyms"
3699 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3700 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3701 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3707 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3708 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3711 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3712 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3713 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3714 relocations are performed -- see ld's documentation on pseudo-relocs. */
3715 # define LT_DLSYM_CONST
3716 #elif defined(__osf__)
3717 /* This system does not cope well with relocations in const data. */
3718 # define LT_DLSYM_CONST
3720 # define LT_DLSYM_CONST const
3723 /* External symbol declarations for the compiler. */\
3726 if test "$dlself" = yes; then
3727 func_verbose "generating symbol list for \`$output'"
3729 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3731 # Add our own program objects to the symbol list.
3732 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3733 for progfile in $progfiles; do
3734 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3735 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3736 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3739 if test -n "$exclude_expsyms"; then
3741 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3742 eval '$MV "$nlist"T "$nlist"'
3746 if test -n "$export_symbols_regex"; then
3748 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3749 eval '$MV "$nlist"T "$nlist"'
3753 # Prepare the list of exported symbols
3754 if test -z "$export_symbols"; then
3755 export_symbols="$output_objdir/$outputname.exp"
3758 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3760 *cygwin* | *mingw* | *cegcc* )
3761 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3762 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3768 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3769 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3770 eval '$MV "$nlist"T "$nlist"'
3772 *cygwin* | *mingw* | *cegcc* )
3773 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3774 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3781 for dlprefile in $dlprefiles; do
3782 func_verbose "extracting global C symbols from \`$dlprefile'"
3783 func_basename "$dlprefile"
3784 name="$func_basename_result"
3786 *cygwin* | *mingw* | *cegcc* )
3787 # if an import library, we need to obtain dlname
3788 if func_win32_import_lib_p "$dlprefile"; then
3789 func_tr_sh "$dlprefile"
3790 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3791 dlprefile_dlbasename=""
3792 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3793 # Use subshell, to avoid clobbering current variable values
3794 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3795 if test -n "$dlprefile_dlname" ; then
3796 func_basename "$dlprefile_dlname"
3797 dlprefile_dlbasename="$func_basename_result"
3799 # no lafile. user explicitly requested -dlpreopen <import library>.
3800 $sharedlib_from_linklib_cmd "$dlprefile"
3801 dlprefile_dlbasename=$sharedlib_from_linklib_result
3805 if test -n "$dlprefile_dlbasename" ; then
3806 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3808 func_warning "Could not compute DLL name from $name"
3809 eval '$ECHO ": $name " >> "$nlist"'
3811 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3812 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3813 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3815 else # not an import lib
3817 eval '$ECHO ": $name " >> "$nlist"'
3818 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3819 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3825 eval '$ECHO ": $name " >> "$nlist"'
3826 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3827 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3834 # Make sure we have at least an empty file.
3835 test -f "$nlist" || : > "$nlist"
3837 if test -n "$exclude_expsyms"; then
3838 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3839 $MV "$nlist"T "$nlist"
3842 # Try sorting and uniquifying the output.
3843 if $GREP -v "^: " < "$nlist" |
3844 if sort -k 3 </dev/null >/dev/null 2>&1; then
3849 uniq > "$nlist"S; then
3852 $GREP -v "^: " < "$nlist" > "$nlist"S
3855 if test -f "$nlist"S; then
3856 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3858 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3861 echo >> "$output_objdir/$my_dlsyms" "\
3863 /* The mapping between symbol names and symbols. */
3868 extern LT_DLSYM_CONST lt_dlsymlist
3869 lt_${my_prefix}_LTX_preloaded_symbols[];
3870 LT_DLSYM_CONST lt_dlsymlist
3871 lt_${my_prefix}_LTX_preloaded_symbols[] =
3873 { \"$my_originator\", (void *) 0 },"
3875 case $need_lib_prefix in
3877 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3880 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3883 echo >> "$output_objdir/$my_dlsyms" "\
3887 /* This works around a problem in FreeBSD linker */
3888 #ifdef FREEBSD_WORKAROUND
3889 static const void *lt_preloaded_setup() {
3890 return lt_${my_prefix}_LTX_preloaded_symbols;