3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (lcr) 1.14
5 # Libtool was configured on host netbook:
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 # An object symbol dumper.
116 # Method to check whether dependent libraries are shared objects.
117 deplibs_check_method="pass_all"
119 # Command to use when deplibs_check_method == "file_magic".
120 file_magic_cmd="\$MAGIC_CMD"
126 # A symbol stripping program.
129 # Commands used to install an old-style archive.
131 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
132 old_postuninstall_cmds=""
134 # Whether to use a lock for old archive extraction.
135 lock_old_archive_extraction=no
140 # LTCC compiler flags.
143 # Take the output of nm and produce a listing of raw symbols and C names.
144 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
146 # Transform the output of nm in a proper C declaration.
147 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
149 # Transform the output of nm in a C name address pair.
150 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
152 # Transform the output of nm in a C name address pair when lib prefix is needed.
153 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
155 # The name of the directory that contains temporary libtool files.
158 # Used to examine libraries when file_magic_cmd begins with "file".
161 # Must we lock files when doing compilation?
164 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
167 # Tool to change global to local symbols on Mac OS X.
170 # Tool to manipulate fat objects and archives on Mac OS X.
173 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
176 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
179 # Old archive suffix (normally "a").
182 # Shared library suffix (normally ".so").
185 # The commands to extract the exported symbol list from a shared archive.
186 extract_expsyms_cmds=""
188 # Variables whose values should be saved in libtool wrapper scripts and
189 # restored at link time.
190 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
192 # Do we need the "lib" prefix for modules?
195 # Do we need a version for libraries?
198 # Library versioning type.
201 # Shared library runtime path variable.
202 runpath_var=LD_RUN_PATH
204 # Shared library path variable.
205 shlibpath_var=LD_LIBRARY_PATH
207 # Is shlibpath searched before the hard-coded library search path?
208 shlibpath_overrides_runpath=yes
210 # Format of library name prefix.
211 libname_spec="lib\$name"
213 # List of archive names. First name is the real one, the rest are links.
214 # The last name is the one that the linker finds with -lNAME
215 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
217 # The coded name of the library, if different from the real name.
218 soname_spec="\${libname}\${release}\${shared_ext}\$major"
220 # Permission mode override for installation of shared libraries.
221 install_override_mode=""
223 # Command to use after installation of a shared archive.
226 # Command to use after uninstallation of a shared archive.
227 postuninstall_cmds=""
229 # Commands used to finish a libtool library installation in a directory.
230 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
232 # As "finish_cmds", except a single script fragment to be evaled but
236 # Whether we should hardcode library paths into libraries.
237 hardcode_into_libs=yes
239 # Compile-time system search path for libraries.
240 sys_lib_search_path_spec="/usr/lib/gcc/i686-pc-linux-gnu/4.4.5 /usr/i686-pc-linux-gnu/lib /usr/lib /lib "
242 # Run-time system search path for libraries.
243 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /usr/i686-pc-linux-gnu/lib /opt/uhd/lib //usr/lib/opengl/xorg-x11/lib /usr/lib/gcc/i686-pc-linux-gnu/4.4.5 /usr/lib/qt4 "
245 # Whether dlopen is supported.
246 dlopen_support=unknown
248 # Whether dlopen of programs is supported.
251 # Whether dlopen of statically linked programs is supported.
252 dlopen_self_static=unknown
254 # Commands to strip libraries.
255 old_striplib="strip --strip-debug"
256 striplib="strip --strip-unneeded"
259 # The linker used to build libraries.
260 LD="/usr/i686-pc-linux-gnu/bin/ld"
262 # How to create reloadable object files.
264 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
266 # Commands used to build an old-style archive.
267 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
269 # A language specific compiler.
272 # Is the compiler the GNU compiler?
275 # Compiler flag to turn off builtin functions.
276 no_builtin_flag=" -fno-builtin"
278 # How to pass a linker flag through the compiler.
281 # Additional compiler flags for building library objects.
282 pic_flag=" -fPIC -DPIC"
284 # Compiler flag to prevent dynamic linking.
285 link_static_flag="-static"
287 # Does compiler simultaneously support -c and -o options?
290 # Whether or not to add -lc for building shared libraries.
291 build_libtool_need_lc=no
293 # Whether or not to disallow shared libs when runtime libs are static.
294 allow_libtool_libs_with_static_runtimes=no
296 # Compiler flag to allow reflexive dlopens.
297 export_dynamic_flag_spec="\${wl}--export-dynamic"
299 # Compiler flag to generate shared objects directly from archives.
300 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
302 # Whether the compiler copes with passing no objects directly.
303 compiler_needs_object="no"
305 # Create an old-style archive from a shared archive.
306 old_archive_from_new_cmds=""
308 # Create a temporary old-style archive to link instead of a shared archive.
309 old_archive_from_expsyms_cmds=""
311 # Commands used to build a shared archive.
312 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
313 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
314 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
315 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
316 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
318 # Commands used to build a loadable module if different from building
321 module_expsym_cmds=""
323 # Whether we are building with GNU ld or not.
326 # Flag that allows shared libraries with undefined symbols to be built.
327 allow_undefined_flag=""
329 # Flag that enforces no undefined symbols.
332 # Flag to hardcode $libdir into a binary during linking.
333 # This must work even if $libdir does not exist
334 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
336 # If ld is used when linking, flag to hardcode $libdir into a binary
337 # during linking. This must work even if $libdir does not exist.
338 hardcode_libdir_flag_spec_ld=""
340 # Whether we need a single "-rpath" flag with a separated argument.
341 hardcode_libdir_separator=""
343 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
344 # DIR into the resulting binary.
347 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
348 # DIR into the resulting binary and the resulting library dependency is
349 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
350 # library is relocated.
351 hardcode_direct_absolute=no
353 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
354 # into the resulting binary.
357 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
358 # into the resulting binary.
359 hardcode_shlibpath_var=unsupported
361 # Set to "yes" if building a shared library automatically hardcodes DIR
362 # into the library and all subsequent libraries and executables linked
364 hardcode_automatic=no
366 # Set to yes if linker adds runtime paths of dependent libraries
367 # to runtime path list.
370 # Whether libtool must link a program against all its dependency libraries.
371 link_all_deplibs=unknown
373 # Fix the shell variable $srcfile for the compiler.
376 # Set to "yes" if exported symbols are required.
377 always_export_symbols=no
379 # The commands to list exported symbols.
380 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
382 # Symbols that should not be listed in the preloaded symbols.
383 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
385 # Symbols that must always be exported.
388 # Commands necessary for linking programs (against libraries) with templates.
391 # Specify filename containing input files.
394 # How to hardcode a shared library path into an executable.
395 hardcode_action=immediate
397 # The directories searched by this compiler when creating a shared library.
398 compiler_lib_search_dirs=""
400 # Dependencies to place before and after the objects being linked to
401 # create a shared library.
407 # The library search path used internally by the compiler when linking
409 compiler_lib_search_path=""
411 # ### END LIBTOOL CONFIG
414 # libtool (GNU libtool) 2.4
415 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
417 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
418 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
419 # This is free software; see the source for copying conditions. There is NO
420 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
422 # GNU Libtool is free software; you can redistribute it and/or modify
423 # it under the terms of the GNU General Public License as published by
424 # the Free Software Foundation; either version 2 of the License, or
425 # (at your option) any later version.
427 # As a special exception to the GNU General Public License,
428 # if you distribute this file as part of a program or library that
429 # is built using GNU Libtool, you may include this file under the
430 # same distribution terms that you use for the rest of that program.
432 # GNU Libtool is distributed in the hope that it will be useful, but
433 # WITHOUT ANY WARRANTY; without even the implied warranty of
434 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
435 # General Public License for more details.
437 # You should have received a copy of the GNU General Public License
438 # along with GNU Libtool; see the file COPYING. If not, a copy
439 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
440 # or obtained by writing to the Free Software Foundation, Inc.,
441 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
443 # Usage: $progname [OPTION]... [MODE-ARG]...
445 # Provide generalized library-building support services.
447 # --config show all configuration variables
448 # --debug enable verbose shell tracing
449 # -n, --dry-run display commands without modifying any files
450 # --features display basic configuration information and exit
451 # --mode=MODE use operation mode MODE
452 # --preserve-dup-deps don't remove duplicate dependency libraries
453 # --quiet, --silent don't print informational messages
454 # --no-quiet, --no-silent
455 # print informational messages (default)
456 # --tag=TAG use configuration variables from tag TAG
457 # -v, --verbose print more informational messages than default
458 # --no-verbose don't print the extra informational messages
459 # --version print version information
460 # -h, --help, --help-all print short, long, or detailed help message
462 # MODE must be one of the following:
464 # clean remove files from the build directory
465 # compile compile a source file into a libtool object
466 # execute automatically set library path, then run a program
467 # finish complete the installation of libtool libraries
468 # install install libraries or executables
469 # link create a library or an executable
470 # uninstall remove libraries from an installed directory
472 # MODE-ARGS vary depending on the MODE. When passed as first option,
473 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
474 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
476 # When reporting a bug, please describe a test case to reproduce it and
477 # include the following information:
479 # host-triplet: $host
482 # compiler flags: $LTCFLAGS
483 # linker: $LD (gnu? $with_gnu_ld)
484 # $progname: (GNU libtool) 2.4
485 # automake: $automake_version
486 # autoconf: $autoconf_version
488 # Report bugs to <bug-libtool@gnu.org>.
489 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
490 # General help using GNU software: <http://www.gnu.org/gethelp/>.
496 package_revision=1.3293
498 # Be Bourne compatible
499 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
502 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
503 # is contrary to our usage. Disable this feature.
504 alias -g '${1+"$@"}'='"$@"'
507 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
509 BIN_SH=xpg4; export BIN_SH # for Tru64
510 DUALCASE=1; export DUALCASE # for MKS sh
512 # A function that is used when there is no print builtin or printf.
513 func_fallback_echo ()
515 eval 'cat <<_LTECHO_EOF
520 # NLS nuisances: We save the old values to restore during execute mode.
523 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
525 eval "if test \"\${$lt_var+set}\" = set; then
526 save_$lt_var=\$$lt_var
529 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
530 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
535 export LANGUAGE LC_ALL
540 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
541 # is ksh but when the shell is invoked as "sh" and the current value of
542 # the _XPG environment variable is not equal to 1 (one), the special
543 # positional parameter $0, within a function call, is the name of the
550 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
560 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
561 : ${Xsed="$SED -e 1s/^X//"}
566 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
567 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
569 exit_status=$EXIT_SUCCESS
571 # Make sure IFS has a sensible default
576 dirname="s,/[^/]*$,,"
579 # func_dirname file append nondir_replacement
580 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
581 # otherwise set result to NONDIR_REPLACEMENT.
584 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
585 if test "X$func_dirname_result" = "X${1}"; then
586 func_dirname_result="${3}"
588 func_dirname_result="$func_dirname_result${2}"
590 } # func_dirname may be replaced by extended shell implementation
596 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
597 } # func_basename may be replaced by extended shell implementation
600 # func_dirname_and_basename file append nondir_replacement
601 # perform func_basename and func_dirname in a single function
603 # dirname: Compute the dirname of FILE. If nonempty,
604 # add APPEND to the result, otherwise set result
605 # to NONDIR_REPLACEMENT.
606 # value returned in "$func_dirname_result"
607 # basename: Compute filename of FILE.
608 # value retuned in "$func_basename_result"
609 # Implementation must be kept synchronized with func_dirname
610 # and func_basename. For efficiency, we do not delegate to
611 # those functions but instead duplicate the functionality here.
612 func_dirname_and_basename ()
614 # Extract subdirectory from the argument.
615 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
616 if test "X$func_dirname_result" = "X${1}"; then
617 func_dirname_result="${3}"
619 func_dirname_result="$func_dirname_result${2}"
621 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
622 } # func_dirname_and_basename may be replaced by extended shell implementation
625 # func_stripname prefix suffix name
626 # strip PREFIX and SUFFIX off of NAME.
627 # PREFIX and SUFFIX must not contain globbing or regex special
628 # characters, hashes, percent signs, but SUFFIX may contain a leading
629 # dot (in which case that matches only a dot).
630 # func_strip_suffix prefix name
634 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
635 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
637 } # func_stripname may be replaced by extended shell implementation
640 # These SED scripts presuppose an absolute path with a trailing slash.
641 pathcar='s,^/\([^/]*\).*$,\1,'
642 pathcdr='s,^/[^/]*,,'
643 removedotparts=':dotsl
647 collapseslashes='s@/\{1,\}@/@g'
648 finalslash='s,/*$,/,'
650 # func_normal_abspath PATH
651 # Remove doubled-up and trailing slashes, "." path components,
652 # and cancel out any ".." path components in PATH after making
653 # it an absolute path.
654 # value returned in "$func_normal_abspath_result"
655 func_normal_abspath ()
657 # Start from root dir and reassemble the path.
658 func_normal_abspath_result=
659 func_normal_abspath_tpath=$1
660 func_normal_abspath_altnamespace=
661 case $func_normal_abspath_tpath in
663 # Empty path, that just means $cwd.
664 func_stripname '' '/' "`pwd`"
665 func_normal_abspath_result=$func_stripname_result
668 # The next three entries are used to spot a run of precisely
669 # two leading slashes without using negated character classes;
670 # we take advantage of case's first-match behaviour.
672 # Unusual form of absolute path, do nothing.
675 # Not necessarily an ordinary path; POSIX reserves leading '//'
676 # and for example Cygwin uses it to access remote file shares
677 # over CIFS/SMB, so we conserve a leading double slash if found.
678 func_normal_abspath_altnamespace=/
681 # Absolute path, do nothing.
684 # Relative path, prepend $cwd.
685 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
688 # Cancel out all the simple stuff to save iterations. We also want
689 # the path to end with a slash for ease of parsing, so make sure
690 # there is one (and only one) here.
691 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
692 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
694 # Processed it all yet?
695 if test "$func_normal_abspath_tpath" = / ; then
696 # If we ascended to the root using ".." the result may be empty now.
697 if test -z "$func_normal_abspath_result" ; then
698 func_normal_abspath_result=/
702 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
704 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
706 # Figure out what to do with it
707 case $func_normal_abspath_tcomponent in
709 # Trailing empty path component, ignore it.
712 # Parent dir; strip last assembled component from result.
713 func_dirname "$func_normal_abspath_result"
714 func_normal_abspath_result=$func_dirname_result
717 # Actual path component, append it.
718 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
722 # Restore leading double-slash if one was found on entry.
723 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
726 # func_relative_path SRCDIR DSTDIR
727 # generates a relative path from SRCDIR to DSTDIR, with a trailing
728 # slash if non-empty, suitable for immediately appending a filename
729 # without needing to append a separator.
730 # value returned in "$func_relative_path_result"
731 func_relative_path ()
733 func_relative_path_result=
734 func_normal_abspath "$1"
735 func_relative_path_tlibdir=$func_normal_abspath_result
736 func_normal_abspath "$2"
737 func_relative_path_tbindir=$func_normal_abspath_result
739 # Ascend the tree starting from libdir
741 # check if we have found a prefix of bindir
742 case $func_relative_path_tbindir in
743 $func_relative_path_tlibdir)
744 # found an exact match
745 func_relative_path_tcancelled=
748 $func_relative_path_tlibdir*)
749 # found a matching prefix
750 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
751 func_relative_path_tcancelled=$func_stripname_result
752 if test -z "$func_relative_path_result"; then
753 func_relative_path_result=.
758 func_dirname $func_relative_path_tlibdir
759 func_relative_path_tlibdir=${func_dirname_result}
760 if test "x$func_relative_path_tlibdir" = x ; then
761 # Have to descend all the way to the root!
762 func_relative_path_result=../$func_relative_path_result
763 func_relative_path_tcancelled=$func_relative_path_tbindir
766 func_relative_path_result=../$func_relative_path_result
771 # Now calculate path; take care to avoid doubling-up slashes.
772 func_stripname '' '/' "$func_relative_path_result"
773 func_relative_path_result=$func_stripname_result
774 func_stripname '/' '/' "$func_relative_path_tcancelled"
775 if test "x$func_stripname_result" != x ; then
776 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
779 # Normalisation. If bindir is libdir, return empty string,
780 # else relative path ending with a slash; either way, target
781 # file name can be directly appended.
782 if test ! -z "$func_relative_path_result"; then
783 func_stripname './' '' "$func_relative_path_result/"
784 func_relative_path_result=$func_stripname_result
788 # The name of this program:
789 func_dirname_and_basename "$progpath"
790 progname=$func_basename_result
792 # Make sure we have an absolute path for reexecution:
794 [\\/]*|[A-Za-z]:\\*) ;;
796 progdir=$func_dirname_result
797 progdir=`cd "$progdir" && pwd`
798 progpath="$progdir/$progname"
803 for progdir in $PATH; do
805 test -x "$progdir/$progname" && break
808 test -n "$progdir" || progdir=`pwd`
809 progpath="$progdir/$progname"
813 # Sed substitution that helps us do robust quoting. It backslashifies
814 # metacharacters that are still active within double-quoted strings.
815 Xsed="${SED}"' -e 1s/^X//'
816 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
818 # Same as above, but do not quote variable references.
819 double_quote_subst='s/\(["`\\]\)/\\\1/g'
821 # Sed substitution that turns a string into a regex matching for the
823 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
825 # Sed substitution that converts a w32 file name or path
826 # which contains forward slashes, into one that contains
827 # (escaped) backslashes. A very naive implementation.
828 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
830 # Re-`\' parameter expansions in output of double_quote_subst that were
831 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
832 # in input to double_quote_subst, that '$' was protected from expansion.
833 # Since each input `\' is now two `\'s, look for any number of runs of
834 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
839 sed_double_backslash="\
843 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
854 # Echo program name prefixed message, along with the current mode
855 # name if it has been set yet.
858 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
861 # func_verbose arg...
862 # Echo program name prefixed message in verbose mode only.
865 $opt_verbose && func_echo ${1+"$@"}
867 # A bug in bash halts the script if the last line of a function
868 # fails when set -e is in force, so we need another command to
873 # func_echo_all arg...
874 # Invoke $ECHO with all args, space-separated.
881 # Echo program name prefixed message to standard error.
884 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
887 # func_warning arg...
888 # Echo program name prefixed warning message to standard error.
891 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
897 # func_fatal_error arg...
898 # Echo program name prefixed message to standard error, and exit.
905 # func_fatal_help arg...
906 # Echo program name prefixed message to standard error, followed by
907 # a help hint, and exit.
911 func_fatal_error "$help"
913 help="Try \`$progname --help' for more information." ## default
916 # func_grep expression filename
917 # Check whether EXPRESSION matches any line of FILENAME, without output.
920 $GREP "$1" "$2" >/dev/null 2>&1
924 # func_mkdir_p directory-path
925 # Make sure the entire path to DIRECTORY-PATH is available.
928 my_directory_path="$1"
931 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
933 # Protect directory names starting with `-'
934 case $my_directory_path in
935 -*) my_directory_path="./$my_directory_path" ;;
938 # While some portion of DIR does not yet exist...
939 while test ! -d "$my_directory_path"; do
940 # ...make a list in topmost first order. Use a colon delimited
941 # list incase some portion of path contains whitespace.
942 my_dir_list="$my_directory_path:$my_dir_list"
944 # If the last portion added has no slash in it, the list is done
945 case $my_directory_path in */*) ;; *) break ;; esac
947 # ...otherwise throw away the child directory and loop
948 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
950 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
952 save_mkdir_p_IFS="$IFS"; IFS=':'
953 for my_dir in $my_dir_list; do
954 IFS="$save_mkdir_p_IFS"
955 # mkdir can fail with a `File exist' error if two processes
956 # try to create one of the directories concurrently. Don't
958 $MKDIR "$my_dir" 2>/dev/null || :
960 IFS="$save_mkdir_p_IFS"
962 # Bail out if we (or some other process) failed to create a directory.
963 test -d "$my_directory_path" || \
964 func_fatal_error "Failed to create \`$1'"
969 # func_mktempdir [string]
970 # Make a temporary directory that won't clash with other running
971 # libtool processes, and avoids race conditions if possible. If
972 # given, STRING is the basename for that directory.
975 my_template="${TMPDIR-/tmp}/${1-$progname}"
977 if test "$opt_dry_run" = ":"; then
978 # Return a directory name, but don't create it in dry-run mode
979 my_tmpdir="${my_template}-$$"
982 # If mktemp works, use that first and foremost
983 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
985 if test ! -d "$my_tmpdir"; then
986 # Failing that, at least try and use $RANDOM to avoid a race
987 my_tmpdir="${my_template}-${RANDOM-0}$$"
989 save_mktempdir_umask=`umask`
992 umask $save_mktempdir_umask
995 # If we're not in dry-run mode, bomb out on failure
996 test -d "$my_tmpdir" || \
997 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1004 # func_quote_for_eval arg
1005 # Aesthetically quote ARG to be evaled later.
1006 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1007 # is double-quoted, suitable for a subsequent eval, whereas
1008 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1009 # which are still active within double quotes backslashified.
1010 func_quote_for_eval ()
1014 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1016 func_quote_for_eval_unquoted_result="$1" ;;
1019 case $func_quote_for_eval_unquoted_result in
1020 # Double-quote args containing shell metacharacters to delay
1021 # word splitting, command substitution and and variable
1022 # expansion for a subsequent eval.
1023 # Many Bourne shells cannot handle close brackets correctly
1024 # in scan sets, so we specify it separately.
1025 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1026 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1029 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1034 # func_quote_for_expand arg
1035 # Aesthetically quote ARG to be evaled later; same as above,
1036 # but do not quote variable references.
1037 func_quote_for_expand ()
1041 my_arg=`$ECHO "$1" | $SED \
1042 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1048 # Double-quote args containing shell metacharacters to delay
1049 # word splitting and command substitution for a subsequent eval.
1050 # Many Bourne shells cannot handle close brackets correctly
1051 # in scan sets, so we specify it separately.
1052 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1053 my_arg="\"$my_arg\""
1057 func_quote_for_expand_result="$my_arg"
1061 # func_show_eval cmd [fail_exp]
1062 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1063 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1064 # is given, then evaluate it.
1068 my_fail_exp="${2-:}"
1070 ${opt_silent-false} || {
1071 func_quote_for_expand "$my_cmd"
1072 eval "func_echo $func_quote_for_expand_result"
1075 if ${opt_dry_run-false}; then :; else
1078 if test "$my_status" -eq 0; then :; else
1079 eval "(exit $my_status); $my_fail_exp"
1085 # func_show_eval_locale cmd [fail_exp]
1086 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1087 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1088 # is given, then evaluate it. Use the saved locale for evaluation.
1089 func_show_eval_locale ()
1092 my_fail_exp="${2-:}"
1094 ${opt_silent-false} || {
1095 func_quote_for_expand "$my_cmd"
1096 eval "func_echo $func_quote_for_expand_result"
1099 if ${opt_dry_run-false}; then :; else
1100 eval "$lt_user_locale
1103 eval "$lt_safe_locale"
1104 if test "$my_status" -eq 0; then :; else
1105 eval "(exit $my_status); $my_fail_exp"
1111 # Turn $1 into a string suitable for a shell variable name.
1112 # Result is stored in $func_tr_sh_result. All characters
1113 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1114 # if $1 begins with a digit, a '_' is prepended as well.
1118 [0-9]* | *[!a-zA-Z0-9_]*)
1119 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1122 func_tr_sh_result=$1
1129 # Echo version message to standard output and exit.
1142 /^# '$PROGRAM' (GNU /,/# warranty; / {
1145 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1152 # Echo short help message to standard output and exit.
1157 $SED -n '/^# Usage:/,/^# *.*--help/ {
1160 s/\$progname/'$progname'/
1164 $ECHO "run \`$progname --help | more' for full usage"
1168 # func_help [NOEXIT]
1169 # Echo long help message to standard output and exit,
1170 # unless 'noexit' is passed as argument.
1175 $SED -n '/^# Usage:/,/# Report bugs to/ {
1179 s*\$progname*'$progname'*
1181 s*\$SHELL*'"$SHELL"'*
1183 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1185 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1186 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1187 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1191 /^# .* home page:/b print
1192 /^# General help using/b print
1195 if test -z "$1"; then
1200 # func_missing_arg argname
1201 # Echo program name prefixed message to standard error and set global
1207 func_error "missing argument for $1."
1212 # func_split_short_opt shortopt
1213 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1214 # variables after splitting SHORTOPT after the 2nd character.
1215 func_split_short_opt ()
1217 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
1218 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
1220 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
1221 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
1222 } # func_split_short_opt may be replaced by extended shell implementation
1225 # func_split_long_opt longopt
1226 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1227 # variables after splitting LONGOPT at the `=' sign.
1228 func_split_long_opt ()
1230 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
1231 my_sed_long_arg='1s/^--[^=]*=//'
1233 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
1234 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
1235 } # func_split_long_opt may be replaced by extended shell implementation
1243 magic="%%%MAGIC variable%%%"
1244 magic_exe="%%%MAGIC EXE variable%%%"
1249 lo2o="s/\\.lo\$/.${objext}/"
1250 o2lo="s/\\.${objext}\$/.lo/"
1254 # If this variable is set in any of the actions, the command in it
1255 # will be execed at the end. This prevents here-documents from being
1256 # left over by shells.
1259 # func_append var value
1260 # Append VALUE to the end of shell variable VAR.
1263 eval "${1}=\$${1}\${2}"
1264 } # func_append may be replaced by extended shell implementation
1266 # func_append_quoted var value
1267 # Quote VALUE and append to the end of shell variable VAR, separated
1269 func_append_quoted ()
1271 func_quote_for_eval "${2}"
1272 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
1273 } # func_append_quoted may be replaced by extended shell implementation
1276 # func_arith arithmetic-term...
1279 func_arith_result=`expr "${@}"`
1280 } # func_arith may be replaced by extended shell implementation
1284 # STRING may not start with a hyphen.
1287 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
1288 } # func_len may be replaced by extended shell implementation
1294 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
1295 } # func_lo2o may be replaced by extended shell implementation
1298 # func_xform libobj-or-source
1301 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
1302 } # func_xform may be replaced by extended shell implementation
1305 # func_fatal_configuration arg...
1306 # Echo program name prefixed message to standard error, followed by
1307 # a configuration failure hint, and exit.
1308 func_fatal_configuration ()
1310 func_error ${1+"$@"}
1311 func_error "See the $PACKAGE documentation for more information."
1312 func_fatal_error "Fatal configuration error."
1317 # Display the configuration for all the tags in this script.
1320 re_begincf='^# ### BEGIN LIBTOOL'
1321 re_endcf='^# ### END LIBTOOL'
1323 # Default configuration.
1324 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1326 # Now print the configurations for the tags.
1327 for tagname in $taglist; do
1328 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1335 # Display the features supported by this script.
1339 if test "$build_libtool_libs" = yes; then
1340 echo "enable shared libraries"
1342 echo "disable shared libraries"
1344 if test "$build_old_libs" = yes; then
1345 echo "enable static libraries"
1347 echo "disable static libraries"
1353 # func_enable_tag tagname
1354 # Verify that TAGNAME is valid, and either flag an error and exit, or
1355 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1362 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1363 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1364 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1369 func_fatal_error "invalid tag name: $tagname"
1373 # Don't test for the "default" C tag, as we know it's
1374 # there but not specially marked.
1378 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1379 taglist="$taglist $tagname"
1381 # Evaluate the configuration. Be careful to quote the path
1382 # and the sed script, to avoid splitting on whitespace, but
1383 # also don't use non-portable quotes within backquotes within
1384 # quotes we have to do it in 2 steps:
1385 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1388 func_error "ignoring unknown tag $tagname"
1394 # func_check_version_match
1395 # Ensure that we are using m4 macros, and libtool script from the same
1396 # release of libtool.
1397 func_check_version_match ()
1399 if test "$package_revision" != "$macro_revision"; then
1400 if test "$VERSION" != "$macro_version"; then
1401 if test -z "$macro_version"; then
1403 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1404 $progname: definition of this LT_INIT comes from an older release.
1405 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1406 $progname: and run autoconf again.
1410 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1411 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1412 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1413 $progname: and run autoconf again.
1418 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1419 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1420 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1421 $progname: of $PACKAGE $VERSION and run autoconf again.
1430 # Shorthand for --mode=foo, only valid as the first argument
1433 shift; set dummy --mode clean ${1+"$@"}; shift
1435 compile|compil|compi|comp|com|co|c)
1436 shift; set dummy --mode compile ${1+"$@"}; shift
1438 execute|execut|execu|exec|exe|ex|e)
1439 shift; set dummy --mode execute ${1+"$@"}; shift
1441 finish|finis|fini|fin|fi|f)
1442 shift; set dummy --mode finish ${1+"$@"}; shift
1444 install|instal|insta|inst|ins|in|i)
1445 shift; set dummy --mode install ${1+"$@"}; shift
1448 shift; set dummy --mode link ${1+"$@"}; shift
1450 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1451 shift; set dummy --mode uninstall ${1+"$@"}; shift
1461 opt_preserve_dup_deps=false
1472 # Parse options once, thoroughly. This comes as soon as possible in the
1473 # script to make things like `--version' happen as quickly as we can.
1475 # this just eases exit handling
1476 while test $# -gt 0; do
1480 --debug|-x) opt_debug='set -x'
1481 func_echo "enabling shell trace mode"
1484 --dry-run|--dryrun|-n)
1493 opt_dlopen="${opt_dlopen+$opt_dlopen
1497 --preserve-dup-deps)
1498 opt_preserve_dup_deps=:
1506 set dummy --mode finish ${1+"$@"}; shift
1513 opt_help=': help-all'
1516 test $# = 0 && func_missing_arg $opt && break
1520 # Valid mode arguments:
1521 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1523 # Catch anything else as an error
1524 *) func_error "invalid argument for $opt"
1531 --no-silent|--no-quiet)
1533 func_append preserve_args " $opt"
1537 func_append preserve_args " $opt"
1541 func_append preserve_args " $opt"
1546 func_append preserve_args " $opt"
1550 test $# = 0 && func_missing_arg $opt && break
1553 func_append preserve_args " $opt $optarg"
1554 func_enable_tag "$optarg"
1558 -\?|-h) func_usage ;;
1559 --help) func_help ;;
1560 --version) func_version ;;
1562 # Separate optargs to long options:
1564 func_split_long_opt "$opt"
1565 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1569 # Separate non-argument short options:
1571 func_split_short_opt "$opt"
1572 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1577 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1578 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1584 # save first non-option argument
1585 if test "$#" -gt 0; then
1591 test "$opt_debug" = : || func_append preserve_args " --debug"
1594 *cygwin* | *mingw* | *pw32* | *cegcc*)
1595 # don't eliminate duplications in $postdeps and $predeps
1596 opt_duplicate_compiler_generated_deps=:
1599 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1604 # Sanity checks first:
1605 func_check_version_match
1607 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1608 func_fatal_configuration "not configured to build any kind of library"
1612 eval std_shrext=\"$shrext_cmds\"
1614 # Only execute mode is allowed to have -dlopen flags.
1615 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1616 func_error "unrecognized option \`-dlopen'"
1621 # Change the help message to a mode-specific one.
1622 generic_help="$help"
1623 help="Try \`$progname --help --mode=$opt_mode' for more information."
1627 # Bail if the options were screwed
1628 $exit_cmd $EXIT_FAILURE
1639 # True iff FILE is a libtool `.la' library or `.lo' object file.
1640 # This function is only a basic sanity check; it will hardly flush out
1641 # determined imposters.
1645 $SED -e 4q "$1" 2>/dev/null \
1646 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1649 # func_lalib_unsafe_p file
1650 # True iff FILE is a libtool `.la' library or `.lo' object file.
1651 # This function implements the same check as func_lalib_p without
1652 # resorting to external programs. To this end, it redirects stdin and
1653 # closes it afterwards, without saving the original file descriptor.
1654 # As a safety measure, use it only where a negative result would be
1655 # fatal anyway. Works if `file' does not exist.
1656 func_lalib_unsafe_p ()
1659 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1660 for lalib_p_l in 1 2 3 4
1663 case "$lalib_p_line" in
1664 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1669 test "$lalib_p" = yes
1672 # func_ltwrapper_script_p file
1673 # True iff FILE is a libtool wrapper script
1674 # This function is only a basic sanity check; it will hardly flush out
1675 # determined imposters.
1676 func_ltwrapper_script_p ()
1681 # func_ltwrapper_executable_p file
1682 # True iff FILE is a libtool wrapper executable
1683 # This function is only a basic sanity check; it will hardly flush out
1684 # determined imposters.
1685 func_ltwrapper_executable_p ()
1687 func_ltwrapper_exec_suffix=
1690 *) func_ltwrapper_exec_suffix=.exe ;;
1692 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1695 # func_ltwrapper_scriptname file
1696 # Assumes file is an ltwrapper_executable
1697 # uses $file to determine the appropriate filename for a
1698 # temporary ltwrapper_script.
1699 func_ltwrapper_scriptname ()
1701 func_dirname_and_basename "$1" "" "."
1702 func_stripname '' '.exe' "$func_basename_result"
1703 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1706 # func_ltwrapper_p file
1707 # True iff FILE is a libtool wrapper script or wrapper executable
1708 # This function is only a basic sanity check; it will hardly flush out
1709 # determined imposters.
1712 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1716 # func_execute_cmds commands fail_cmd
1717 # Execute tilde-delimited COMMANDS.
1718 # If FAIL_CMD is given, eval that upon failure.
1719 # FAIL_CMD may read-access the current command in variable CMD!
1720 func_execute_cmds ()
1723 save_ifs=$IFS; IFS='~'
1727 func_show_eval "$cmd" "${2-:}"
1734 # Source FILE, adding directory component if necessary.
1735 # Note that it is not necessary on cygwin/mingw to append a dot to
1736 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1737 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1738 # `FILE.' does not work on cygwin managed mounts.
1743 */* | *\\*) . "$1" ;;
1749 # func_resolve_sysroot PATH
1750 # Replace a leading = in PATH with a sysroot. Store the result into
1751 # func_resolve_sysroot_result
1752 func_resolve_sysroot ()
1754 func_resolve_sysroot_result=$1
1755 case $func_resolve_sysroot_result in
1757 func_stripname '=' '' "$func_resolve_sysroot_result"
1758 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1763 # func_replace_sysroot PATH
1764 # If PATH begins with the sysroot, replace it with = and
1765 # store the result into func_replace_sysroot_result.
1766 func_replace_sysroot ()
1768 case "$lt_sysroot:$1" in
1770 func_stripname "$lt_sysroot" '' "$1"
1771 func_replace_sysroot_result="=$func_stripname_result"
1774 # Including no sysroot.
1775 func_replace_sysroot_result=$1
1780 # func_infer_tag arg
1781 # Infer tagged configuration to use if any are available and
1782 # if one wasn't chosen via the "--tag" command line option.
1783 # Only attempt this if the compiler in the base compile
1784 # command doesn't match the default compiler.
1785 # arg is usually of the form 'gcc ...'
1789 if test -n "$available_tags" && test -z "$tagname"; then
1792 func_append_quoted CC_quoted "$arg"
1794 CC_expanded=`func_echo_all $CC`
1795 CC_quoted_expanded=`func_echo_all $CC_quoted`
1797 # Blanks in the command may have been stripped by the calling shell,
1798 # but not from the CC environment variable when configure was run.
1799 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1800 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1801 # Blanks at the start of $base_compile will cause this to fail
1802 # if we don't check for them as well.
1804 for z in $available_tags; do
1805 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1806 # Evaluate the configuration.
1807 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1810 # Double-quote args containing other shell metacharacters.
1811 func_append_quoted CC_quoted "$arg"
1813 CC_expanded=`func_echo_all $CC`
1814 CC_quoted_expanded=`func_echo_all $CC_quoted`
1816 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1817 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1818 # The compiler in the base compile command matches
1819 # the one in the tagged configuration.
1820 # Assume this is the tagged configuration we want.
1827 # If $tagname still isn't set, then no tagged configuration
1828 # was found and let the user know that the "--tag" command
1829 # line option must be used.
1830 if test -z "$tagname"; then
1831 func_echo "unable to infer tagged configuration"
1832 func_fatal_error "specify a tag with \`--tag'"
1834 # func_verbose "using $tagname tagged configuration"
1843 # func_write_libtool_object output_name pic_name nonpic_name
1844 # Create a libtool object file (analogous to a ".la" file),
1845 # but don't create it if we're doing a dry run.
1846 func_write_libtool_object ()
1849 if test "$build_libtool_libs" = yes; then
1855 if test "$build_old_libs" = yes; then
1856 write_oldobj=\'${3}\'
1862 cat >${write_libobj}T <<EOF
1863 # $write_libobj - a libtool object file
1864 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1866 # Please DO NOT delete this file!
1867 # It is necessary for linking the library.
1869 # Name of the PIC object.
1870 pic_object=$write_lobj
1872 # Name of the non-PIC object
1873 non_pic_object=$write_oldobj
1876 $MV "${write_libobj}T" "${write_libobj}"
1881 ##################################################
1882 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1883 ##################################################
1885 # func_convert_core_file_wine_to_w32 ARG
1886 # Helper function used by file name conversion functions when $build is *nix,
1887 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1888 # correctly configured wine environment available, with the winepath program
1889 # in $build's $PATH.
1891 # ARG is the $build file name to be converted to w32 format.
1892 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1893 # be empty on error (or when ARG is empty)
1894 func_convert_core_file_wine_to_w32 ()
1897 func_convert_core_file_wine_to_w32_result="$1"
1898 if test -n "$1"; then
1899 # Unfortunately, winepath does not exit with a non-zero error code, so we
1900 # are forced to check the contents of stdout. On the other hand, if the
1901 # command is not found, the shell will set an exit code of 127 and print
1902 # *an error message* to stdout. So we must check for both error code of
1903 # zero AND non-empty stdout, which explains the odd construction:
1904 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1905 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1906 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1907 $SED -e "$lt_sed_naive_backslashify"`
1909 func_convert_core_file_wine_to_w32_result=
1913 # end: func_convert_core_file_wine_to_w32
1916 # func_convert_core_path_wine_to_w32 ARG
1917 # Helper function used by path conversion functions when $build is *nix, and
1918 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1919 # configured wine environment available, with the winepath program in $build's
1920 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1922 # ARG is path to be converted from $build format to win32.
1923 # Result is available in $func_convert_core_path_wine_to_w32_result.
1924 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1925 # are convertible, then the result may be empty.
1926 func_convert_core_path_wine_to_w32 ()
1929 # unfortunately, winepath doesn't convert paths, only file names
1930 func_convert_core_path_wine_to_w32_result=""
1931 if test -n "$1"; then
1934 for func_convert_core_path_wine_to_w32_f in $1; do
1936 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1937 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1938 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1939 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1941 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1948 # end: func_convert_core_path_wine_to_w32
1951 # func_cygpath ARGS...
1952 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1953 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1954 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1955 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1956 # file name or path is assumed to be in w32 format, as previously converted
1957 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1958 # or path in func_cygpath_result (input file name or path is assumed to be in
1959 # Cygwin format). Returns an empty string on error.
1961 # ARGS are passed to cygpath, with the last one being the file name or path to
1964 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1965 # environment variable; do not put it in $PATH.
1969 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1970 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1971 if test "$?" -ne 0; then
1972 # on failure, ensure result is empty
1973 func_cygpath_result=
1976 func_cygpath_result=
1977 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1983 # func_convert_core_msys_to_w32 ARG
1984 # Convert file name or path ARG from MSYS format to w32 format. Return
1985 # result in func_convert_core_msys_to_w32_result.
1986 func_convert_core_msys_to_w32 ()
1989 # awkward: cmd appends spaces to result
1990 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1991 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1993 #end: func_convert_core_msys_to_w32
1996 # func_convert_file_check ARG1 ARG2
1997 # Verify that ARG1 (a file name in $build format) was converted to $host
1998 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1999 # func_to_host_file_result to ARG1).
2000 func_convert_file_check ()
2003 if test -z "$2" && test -n "$1" ; then
2004 func_error "Could not determine host file name corresponding to"
2006 func_error "Continuing, but uninstalled executables may not work."
2008 func_to_host_file_result="$1"
2011 # end func_convert_file_check
2014 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2015 # Verify that FROM_PATH (a path in $build format) was converted to $host
2016 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2017 # func_to_host_file_result to a simplistic fallback value (see below).
2018 func_convert_path_check ()
2021 if test -z "$4" && test -n "$3"; then
2022 func_error "Could not determine the host path corresponding to"
2024 func_error "Continuing, but uninstalled executables may not work."
2025 # Fallback. This is a deliberately simplistic "conversion" and
2026 # should not be "improved". See libtool.info.
2027 if test "x$1" != "x$2"; then
2028 lt_replace_pathsep_chars="s|$1|$2|g"
2029 func_to_host_path_result=`echo "$3" |
2030 $SED -e "$lt_replace_pathsep_chars"`
2032 func_to_host_path_result="$3"
2036 # end func_convert_path_check
2039 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2040 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2041 # and appending REPL if ORIG matches BACKPAT.
2042 func_convert_path_front_back_pathsep ()
2046 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2050 $2 ) func_append func_to_host_path_result "$3"
2054 # end func_convert_path_front_back_pathsep
2057 ##################################################
2058 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2059 ##################################################
2060 # invoked via `$to_host_file_cmd ARG'
2062 # In each case, ARG is the path to be converted from $build to $host format.
2063 # Result will be available in $func_to_host_file_result.
2066 # func_to_host_file ARG
2067 # Converts the file name ARG from $build format to $host format. Return result
2068 # in func_to_host_file_result.
2069 func_to_host_file ()
2072 $to_host_file_cmd "$1"
2074 # end func_to_host_file
2077 # func_to_tool_file ARG LAZY
2078 # converts the file name ARG from $build format to toolchain format. Return
2079 # result in func_to_tool_file_result. If the conversion in use is listed
2080 # in (the comma separated) LAZY, no conversion takes place.
2081 func_to_tool_file ()
2085 *,"$to_tool_file_cmd",*)
2086 func_to_tool_file_result=$1
2089 $to_tool_file_cmd "$1"
2090 func_to_tool_file_result=$func_to_host_file_result
2094 # end func_to_tool_file
2097 # func_convert_file_noop ARG
2098 # Copy ARG to func_to_host_file_result.
2099 func_convert_file_noop ()
2101 func_to_host_file_result="$1"
2103 # end func_convert_file_noop
2106 # func_convert_file_msys_to_w32 ARG
2107 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2108 # conversion to w32 is not available inside the cwrapper. Returns result in
2109 # func_to_host_file_result.
2110 func_convert_file_msys_to_w32 ()
2113 func_to_host_file_result="$1"
2114 if test -n "$1"; then
2115 func_convert_core_msys_to_w32 "$1"
2116 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2118 func_convert_file_check "$1" "$func_to_host_file_result"
2120 # end func_convert_file_msys_to_w32
2123 # func_convert_file_cygwin_to_w32 ARG
2124 # Convert file name ARG from Cygwin to w32 format. Returns result in
2125 # func_to_host_file_result.
2126 func_convert_file_cygwin_to_w32 ()
2129 func_to_host_file_result="$1"
2130 if test -n "$1"; then
2131 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2132 # LT_CYGPATH in this case.
2133 func_to_host_file_result=`cygpath -m "$1"`
2135 func_convert_file_check "$1" "$func_to_host_file_result"
2137 # end func_convert_file_cygwin_to_w32
2140 # func_convert_file_nix_to_w32 ARG
2141 # Convert file name ARG from *nix to w32 format. Requires a wine environment
2142 # and a working winepath. Returns result in func_to_host_file_result.
2143 func_convert_file_nix_to_w32 ()
2146 func_to_host_file_result="$1"
2147 if test -n "$1"; then
2148 func_convert_core_file_wine_to_w32 "$1"
2149 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2151 func_convert_file_check "$1" "$func_to_host_file_result"
2153 # end func_convert_file_nix_to_w32
2156 # func_convert_file_msys_to_cygwin ARG
2157 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2158 # Returns result in func_to_host_file_result.
2159 func_convert_file_msys_to_cygwin ()
2162 func_to_host_file_result="$1"
2163 if test -n "$1"; then
2164 func_convert_core_msys_to_w32 "$1"
2165 func_cygpath -u "$func_convert_core_msys_to_w32_result"
2166 func_to_host_file_result="$func_cygpath_result"
2168 func_convert_file_check "$1" "$func_to_host_file_result"
2170 # end func_convert_file_msys_to_cygwin
2173 # func_convert_file_nix_to_cygwin ARG
2174 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2175 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2176 # in func_to_host_file_result.
2177 func_convert_file_nix_to_cygwin ()
2180 func_to_host_file_result="$1"
2181 if test -n "$1"; then
2182 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2183 func_convert_core_file_wine_to_w32 "$1"
2184 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2185 func_to_host_file_result="$func_cygpath_result"
2187 func_convert_file_check "$1" "$func_to_host_file_result"
2189 # end func_convert_file_nix_to_cygwin
2192 #############################################
2193 # $build to $host PATH CONVERSION FUNCTIONS #
2194 #############################################
2195 # invoked via `$to_host_path_cmd ARG'
2197 # In each case, ARG is the path to be converted from $build to $host format.
2198 # The result will be available in $func_to_host_path_result.
2200 # Path separators are also converted from $build format to $host format. If
2201 # ARG begins or ends with a path separator character, it is preserved (but
2202 # converted to $host format) on output.
2204 # All path conversion functions are named using the following convention:
2205 # file name conversion function : func_convert_file_X_to_Y ()
2206 # path conversion function : func_convert_path_X_to_Y ()
2207 # where, for any given $build/$host combination the 'X_to_Y' value is the
2208 # same. If conversion functions are added for new $build/$host combinations,
2209 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
2213 # func_init_to_host_path_cmd
2214 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
2215 # appropriate value, based on the value of $to_host_file_cmd.
2217 func_init_to_host_path_cmd ()
2220 if test -z "$to_host_path_cmd"; then
2221 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2222 to_host_path_cmd="func_convert_path_${func_stripname_result}"
2227 # func_to_host_path ARG
2228 # Converts the path ARG from $build format to $host format. Return result
2229 # in func_to_host_path_result.
2230 func_to_host_path ()
2233 func_init_to_host_path_cmd
2234 $to_host_path_cmd "$1"
2236 # end func_to_host_path
2239 # func_convert_path_noop ARG
2240 # Copy ARG to func_to_host_path_result.
2241 func_convert_path_noop ()
2243 func_to_host_path_result="$1"
2245 # end func_convert_path_noop
2248 # func_convert_path_msys_to_w32 ARG
2249 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2250 # conversion to w32 is not available inside the cwrapper. Returns result in
2251 # func_to_host_path_result.
2252 func_convert_path_msys_to_w32 ()
2255 func_to_host_path_result="$1"
2256 if test -n "$1"; then
2257 # Remove leading and trailing path separator characters from ARG. MSYS
2258 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2259 # and winepath ignores them completely.
2260 func_stripname : : "$1"
2261 func_to_host_path_tmp1=$func_stripname_result
2262 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2263 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2264 func_convert_path_check : ";" \
2265 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2266 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2269 # end func_convert_path_msys_to_w32
2272 # func_convert_path_cygwin_to_w32 ARG
2273 # Convert path ARG from Cygwin to w32 format. Returns result in
2274 # func_to_host_file_result.
2275 func_convert_path_cygwin_to_w32 ()
2278 func_to_host_path_result="$1"
2279 if test -n "$1"; then
2280 # See func_convert_path_msys_to_w32:
2281 func_stripname : : "$1"
2282 func_to_host_path_tmp1=$func_stripname_result
2283 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2284 func_convert_path_check : ";" \
2285 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2286 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2289 # end func_convert_path_cygwin_to_w32
2292 # func_convert_path_nix_to_w32 ARG
2293 # Convert path ARG from *nix to w32 format. Requires a wine environment and
2294 # a working winepath. Returns result in func_to_host_file_result.
2295 func_convert_path_nix_to_w32 ()
2298 func_to_host_path_result="$1"
2299 if test -n "$1"; then
2300 # See func_convert_path_msys_to_w32:
2301 func_stripname : : "$1"
2302 func_to_host_path_tmp1=$func_stripname_result
2303 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2304 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2305 func_convert_path_check : ";" \
2306 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2307 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2310 # end func_convert_path_nix_to_w32
2313 # func_convert_path_msys_to_cygwin ARG
2314 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2315 # Returns result in func_to_host_file_result.
2316 func_convert_path_msys_to_cygwin ()
2319 func_to_host_path_result="$1"
2320 if test -n "$1"; then
2321 # See func_convert_path_msys_to_w32:
2322 func_stripname : : "$1"
2323 func_to_host_path_tmp1=$func_stripname_result
2324 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2325 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2326 func_to_host_path_result="$func_cygpath_result"
2327 func_convert_path_check : : \
2328 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2329 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2332 # end func_convert_path_msys_to_cygwin
2335 # func_convert_path_nix_to_cygwin ARG
2336 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2337 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2338 # func_to_host_file_result.
2339 func_convert_path_nix_to_cygwin ()
2342 func_to_host_path_result="$1"
2343 if test -n "$1"; then
2344 # Remove leading and trailing path separator characters from
2345 # ARG. msys behavior is inconsistent here, cygpath turns them
2346 # into '.;' and ';.', and winepath ignores them completely.
2347 func_stripname : : "$1"
2348 func_to_host_path_tmp1=$func_stripname_result
2349 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2350 func_cygpath -u -p "$func_convert_core_path_wine_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_nix_to_cygwin
2360 # func_mode_compile arg...
2361 func_mode_compile ()
2364 # Get the compilation command and the source file.
2366 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
2378 # do not "continue". Instead, add this to base_compile
2390 # Accept any command-line options.
2393 test -n "$libobj" && \
2394 func_fatal_error "you cannot specify \`-o' more than once"
2399 -pie | -fpie | -fPIE)
2400 func_append pie_flag " $arg"
2404 -shared | -static | -prefer-pic | -prefer-non-pic)
2405 func_append later " $arg"
2415 arg_mode=arg # the next one goes into the "base_compile" arg list
2416 continue # The current "srcfile" will either be retained or
2417 ;; # replaced later. I would guess that would be a bug.
2420 func_stripname '-Wc,' '' "$arg"
2421 args=$func_stripname_result
2423 save_ifs="$IFS"; IFS=','
2424 for arg in $args; do
2426 func_append_quoted lastarg "$arg"
2429 func_stripname ' ' '' "$lastarg"
2430 lastarg=$func_stripname_result
2432 # Add the arguments to base_compile.
2433 func_append base_compile " $lastarg"
2438 # Accept the current argument as the source file.
2439 # The previous "srcfile" becomes the current argument.
2446 esac # case $arg_mode
2448 # Aesthetically quote the previous argument.
2449 func_append_quoted base_compile "$lastarg"
2454 func_fatal_error "you must specify an argument for -Xcompile"
2457 func_fatal_error "you must specify a target with \`-o'"
2460 # Get the name of the library object.
2461 test -z "$libobj" && {
2462 func_basename "$srcfile"
2463 libobj="$func_basename_result"
2468 # Recognize several different file suffixes.
2469 # If the user specifies -o file.o, it is replaced with file.lo
2472 *.ada | *.adb | *.ads | *.asm | \
2473 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2474 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
2475 func_xform "$libobj"
2476 libobj=$func_xform_result
2481 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2483 func_fatal_error "cannot determine name of library object from \`$libobj'"
2487 func_infer_tag $base_compile
2489 for arg in $later; do
2492 test "$build_libtool_libs" != yes && \
2493 func_fatal_configuration "can not build a shared library"
2499 build_libtool_libs=no
2516 func_quote_for_eval "$libobj"
2517 test "X$libobj" != "X$func_quote_for_eval_result" \
2518 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2519 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2520 func_dirname_and_basename "$obj" "/" ""
2521 objname="$func_basename_result"
2522 xdir="$func_dirname_result"
2523 lobj=${xdir}$objdir/$objname
2525 test -z "$base_compile" && \
2526 func_fatal_help "you must specify a compilation command"
2528 # Delete any leftover library objects.
2529 if test "$build_old_libs" = yes; then
2530 removelist="$obj $lobj $libobj ${libobj}T"
2532 removelist="$lobj $libobj ${libobj}T"
2535 # On Cygwin there's no "real" PIC flag so we must build both object types
2537 cygwin* | mingw* | pw32* | os2* | cegcc*)
2541 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2542 # non-PIC code in shared libraries is not supported
2546 # Calculate the filename of the output object if compiler does
2547 # not support -o with -c
2548 if test "$compiler_c_o" = no; then
2549 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2550 lockfile="$output_obj.lock"
2557 # Lock this critical section if it is needed
2558 # We use this script file to make the link, it avoids creating a new file
2559 if test "$need_locks" = yes; then
2560 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2561 func_echo "Waiting for $lockfile to be removed"
2564 elif test "$need_locks" = warn; then
2565 if test -f "$lockfile"; then
2567 *** ERROR, $lockfile exists and contains:
2568 `cat $lockfile 2>/dev/null`
2570 This indicates that another process is trying to use the same
2571 temporary object file, and libtool could not work around it because
2572 your compiler does not support \`-c' and \`-o' together. If you
2573 repeat this compilation, it may succeed, by chance, but you had better
2574 avoid parallel builds (make -j) in this platform, or get a better
2577 $opt_dry_run || $RM $removelist
2580 func_append removelist " $output_obj"
2581 $ECHO "$srcfile" > "$lockfile"
2584 $opt_dry_run || $RM $removelist
2585 func_append removelist " $lockfile"
2586 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2588 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2589 srcfile=$func_to_tool_file_result
2590 func_quote_for_eval "$srcfile"
2591 qsrcfile=$func_quote_for_eval_result
2593 # Only build a PIC object if we are building libtool libraries.
2594 if test "$build_libtool_libs" = yes; then
2595 # Without this assignment, base_compile gets emptied.
2596 fbsd_hideous_sh_bug=$base_compile
2598 if test "$pic_mode" != no; then
2599 command="$base_compile $qsrcfile $pic_flag"
2601 # Don't build PIC code
2602 command="$base_compile $qsrcfile"
2605 func_mkdir_p "$xdir$objdir"
2607 if test -z "$output_obj"; then
2608 # Place PIC objects in $objdir
2609 func_append command " -o $lobj"
2612 func_show_eval_locale "$command" \
2613 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2615 if test "$need_locks" = warn &&
2616 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2618 *** ERROR, $lockfile contains:
2619 `cat $lockfile 2>/dev/null`
2621 but it should contain:
2624 This indicates that another process is trying to use the same
2625 temporary object file, and libtool could not work around it because
2626 your compiler does not support \`-c' and \`-o' together. If you
2627 repeat this compilation, it may succeed, by chance, but you had better
2628 avoid parallel builds (make -j) in this platform, or get a better
2631 $opt_dry_run || $RM $removelist
2635 # Just move the object if needed, then go on to compile the next one
2636 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2637 func_show_eval '$MV "$output_obj" "$lobj"' \
2638 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2641 # Allow error messages only from the first compilation.
2642 if test "$suppress_opt" = yes; then
2643 suppress_output=' >/dev/null 2>&1'
2647 # Only build a position-dependent object if we build old libraries.
2648 if test "$build_old_libs" = yes; then
2649 if test "$pic_mode" != yes; then
2650 # Don't build PIC code
2651 command="$base_compile $qsrcfile$pie_flag"
2653 command="$base_compile $qsrcfile $pic_flag"
2655 if test "$compiler_c_o" = yes; then
2656 func_append command " -o $obj"
2659 # Suppress compiler output if we already did a PIC compilation.
2660 func_append command "$suppress_output"
2661 func_show_eval_locale "$command" \
2662 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2664 if test "$need_locks" = warn &&
2665 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2667 *** ERROR, $lockfile contains:
2668 `cat $lockfile 2>/dev/null`
2670 but it should contain:
2673 This indicates that another process is trying to use the same
2674 temporary object file, and libtool could not work around it because
2675 your compiler does not support \`-c' and \`-o' together. If you
2676 repeat this compilation, it may succeed, by chance, but you had better
2677 avoid parallel builds (make -j) in this platform, or get a better
2680 $opt_dry_run || $RM $removelist
2684 # Just move the object if needed
2685 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2686 func_show_eval '$MV "$output_obj" "$obj"' \
2687 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2692 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2694 # Unlock the critical section if it was locked
2695 if test "$need_locks" != no; then
2696 removelist=$lockfile
2705 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2710 # We need to display help for each of the modes.
2713 # Generic help is extracted from the usage comments
2714 # at the start of this file.
2720 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2722 Remove files from the build directory.
2724 RM is the name of the program to use to delete files associated with each FILE
2725 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2728 If FILE is a libtool library, object or program, all the files associated
2729 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2734 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2736 Compile a source file into a libtool library object.
2738 This mode accepts the following additional options:
2740 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2741 -no-suppress do not suppress compiler output for multiple passes
2742 -prefer-pic try to build PIC objects only
2743 -prefer-non-pic try to build non-PIC objects only
2744 -shared do not build a \`.o' file suitable for static linking
2745 -static only build a \`.o' file suitable for static linking
2746 -Wc,FLAG pass FLAG directly to the compiler
2748 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2749 from the given SOURCEFILE.
2751 The output file name is determined by removing the directory component from
2752 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2753 library object suffix, \`.lo'."
2758 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2760 Automatically set library path, then run a program.
2762 This mode accepts the following additional options:
2764 -dlopen FILE add the directory containing FILE to the library path
2766 This mode sets the library path environment variable according to \`-dlopen'
2769 If any of the ARGS are libtool executable wrappers, then they are translated
2770 into their corresponding uninstalled binary, and any of their required library
2771 directories are added to the library path.
2773 Then, COMMAND is executed, with ARGS as arguments."
2778 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2780 Complete the installation of libtool libraries.
2782 Each LIBDIR is a directory that contains libtool libraries.
2784 The commands that this mode executes may require superuser privileges. Use
2785 the \`--dry-run' option if you just want to see what would be executed."
2790 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2792 Install executables or libraries.
2794 INSTALL-COMMAND is the installation command. The first component should be
2795 either the \`install' or \`cp' program.
2797 The following components of INSTALL-COMMAND are treated specially:
2799 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2801 The rest of the components are interpreted as arguments to that command (only
2802 BSD-compatible install options are recognized)."
2807 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2809 Link object files or libraries together to form another library, or to
2810 create an executable program.
2812 LINK-COMMAND is a command using the C compiler that you would use to create
2813 a program from several object files.
2815 The following components of LINK-COMMAND are treated specially:
2817 -all-static do not do any dynamic linking at all
2818 -avoid-version do not add a version suffix if possible
2819 -bindir BINDIR specify path to binaries directory (for systems where
2820 libraries must be found in the PATH setting at runtime)
2821 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2822 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2823 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2824 -export-symbols SYMFILE
2825 try to export only the symbols listed in SYMFILE
2826 -export-symbols-regex REGEX
2827 try to export only the symbols matching REGEX
2828 -LLIBDIR search LIBDIR for required installed libraries
2829 -lNAME OUTPUT-FILE requires the installed library libNAME
2830 -module build a library that can dlopened
2831 -no-fast-install disable the fast-install mode
2832 -no-install link a not-installable executable
2833 -no-undefined declare that a library does not refer to external symbols
2834 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2835 -objectlist FILE Use a list of object files found in FILE to specify objects
2836 -precious-files-regex REGEX
2837 don't remove output files matching REGEX
2838 -release RELEASE specify package release information
2839 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2840 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2841 -shared only do dynamic linking of libtool libraries
2842 -shrext SUFFIX override the standard shared library file extension
2843 -static do not do any dynamic linking of uninstalled libtool libraries
2844 -static-libtool-libs
2845 do not do any dynamic linking of libtool libraries
2846 -version-info CURRENT[:REVISION[:AGE]]
2847 specify library version info [each variable defaults to 0]
2848 -weak LIBNAME declare that the target provides the LIBNAME interface
2850 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2852 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2853 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2855 All other options (arguments beginning with \`-') are ignored.
2857 Every other argument is treated as a filename. Files ending in \`.la' are
2858 treated as uninstalled libtool libraries, other files are standard or library
2861 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2862 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2863 required, except when creating a convenience library.
2865 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2866 using \`ar' and \`ranlib', or on Windows using \`lib'.
2868 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2869 is created, otherwise an executable program is created."
2874 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2876 Remove libraries from an installation directory.
2878 RM is the name of the program to use to delete files associated with each FILE
2879 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2882 If FILE is a libtool library, all the files associated with it are deleted.
2883 Otherwise, only FILE itself is deleted using RM."
2887 func_fatal_help "invalid operation mode \`$opt_mode'"
2892 $ECHO "Try \`$progname --help' for more information about other modes."
2895 # Now that we've collected a possible --mode arg, show help if necessary
2897 if test "$opt_help" = :; then
2902 for opt_mode in compile link execute install finish uninstall clean; do
2905 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2908 for opt_mode in compile link execute install finish uninstall clean; do
2914 /^When reporting/,/^Report/{
2919 /information about other modes/d
2920 /more detailed .*MODE/d
2921 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2927 # func_mode_execute arg...
2928 func_mode_execute ()
2931 # The first argument is the command name.
2934 func_fatal_help "you must specify a COMMAND"
2936 # Handle -dlopen flags immediately.
2937 for file in $opt_dlopen; do
2939 || func_fatal_help "\`$file' is not a file"
2944 func_resolve_sysroot "$file"
2945 file=$func_resolve_sysroot_result
2947 # Check to see that this really is a libtool archive.
2948 func_lalib_unsafe_p "$file" \
2949 || func_fatal_help "\`$lib' is not a valid libtool archive"
2951 # Read the libtool library.
2956 # Skip this library if it cannot be dlopened.
2957 if test -z "$dlname"; then
2958 # Warn if it was a shared library.
2959 test -n "$library_names" && \
2960 func_warning "\`$file' was not linked with \`-export-dynamic'"
2964 func_dirname "$file" "" "."
2965 dir="$func_dirname_result"
2967 if test -f "$dir/$objdir/$dlname"; then
2968 func_append dir "/$objdir"
2970 if test ! -f "$dir/$dlname"; then
2971 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2977 # Just add the directory containing the .lo file.
2978 func_dirname "$file" "" "."
2979 dir="$func_dirname_result"
2983 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2988 # Get the absolute pathname.
2989 absdir=`cd "$dir" && pwd`
2990 test -n "$absdir" && dir="$absdir"
2992 # Now add the directory to shlibpath_var.
2993 if eval "test -z \"\$$shlibpath_var\""; then
2994 eval "$shlibpath_var=\"\$dir\""
2996 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3000 # This variable tells wrapper scripts just to set shlibpath_var
3001 # rather than running their programs.
3002 libtool_execute_magic="$magic"
3004 # Check if any of the arguments is a wrapper script.
3009 -* | *.la | *.lo ) ;;
3011 # Do a test to see if this is really a libtool program.
3012 if func_ltwrapper_script_p "$file"; then
3014 # Transform arg to wrapped name.
3015 file="$progdir/$program"
3016 elif func_ltwrapper_executable_p "$file"; then
3017 func_ltwrapper_scriptname "$file"
3018 func_source "$func_ltwrapper_scriptname_result"
3019 # Transform arg to wrapped name.
3020 file="$progdir/$program"
3024 # Quote arguments (to preserve shell metacharacters).
3025 func_append_quoted args "$file"
3028 if test "X$opt_dry_run" = Xfalse; then
3029 if test -n "$shlibpath_var"; then
3030 # Export the shlibpath_var.
3031 eval "export $shlibpath_var"
3034 # Restore saved environment variables
3035 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3037 eval "if test \"\${save_$lt_var+set}\" = set; then
3038 $lt_var=\$save_$lt_var; export $lt_var
3044 # Now prepare to actually exec the command.
3045 exec_cmd="\$cmd$args"
3047 # Display what would be done.
3048 if test -n "$shlibpath_var"; then
3049 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3050 echo "export $shlibpath_var"
3057 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3060 # func_mode_finish arg...
3068 for opt in "$nonopt" ${1+"$@"}
3070 if test -d "$opt"; then
3071 func_append libdirs " $opt"
3073 elif test -f "$opt"; then
3074 if func_lalib_unsafe_p "$opt"; then
3075 func_append libs " $opt"
3077 func_warning "\`$opt' is not a valid libtool archive"
3081 func_fatal_error "invalid argument \`$opt'"
3085 if test -n "$libs"; then
3086 if test -n "$lt_sysroot"; then
3087 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3088 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3093 # Remove sysroot references
3094 if $opt_dry_run; then
3095 for lib in $libs; do
3096 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3099 tmpdir=`func_mktempdir`
3100 for lib in $libs; do
3101 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3103 mv -f $tmpdir/tmp-la $lib
3109 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3110 for libdir in $libdirs; do
3111 if test -n "$finish_cmds"; then
3112 # Do each command in the finish commands.
3113 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3116 if test -n "$finish_eval"; then
3117 # Do the single finish_eval.
3118 eval cmds=\"$finish_eval\"
3119 $opt_dry_run || eval "$cmds" || func_append admincmds "
3125 # Exit here if they wanted silent mode.
3126 $opt_silent && exit $EXIT_SUCCESS
3128 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3129 echo "----------------------------------------------------------------------"
3130 echo "Libraries have been installed in:"
3131 for libdir in $libdirs; do
3135 echo "If you ever happen to want to link against installed libraries"
3136 echo "in a given directory, LIBDIR, you must either use libtool, and"
3137 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3138 echo "flag during linking and do at least one of the following:"
3139 if test -n "$shlibpath_var"; then
3140 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3141 echo " during execution"
3143 if test -n "$runpath_var"; then
3144 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3145 echo " during linking"
3147 if test -n "$hardcode_libdir_flag_spec"; then
3149 eval flag=\"$hardcode_libdir_flag_spec\"
3151 $ECHO " - use the \`$flag' linker flag"
3153 if test -n "$admincmds"; then
3154 $ECHO " - have your system administrator run these commands:$admincmds"
3156 if test -f /etc/ld.so.conf; then
3157 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3161 echo "See any operating system documentation about shared libraries for"
3163 solaris2.[6789]|solaris2.1[0-9])
3164 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3168 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3171 echo "----------------------------------------------------------------------"
3176 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3179 # func_mode_install arg...
3180 func_mode_install ()
3183 # There may be an optional sh(1) argument at the beginning of
3184 # install_prog (especially on Windows NT).
3185 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3186 # Allow the use of GNU shtool's install command.
3187 case $nonopt in *shtool*) :;; *) false;; esac; then
3188 # Aesthetically quote it.
3189 func_quote_for_eval "$nonopt"
3190 install_prog="$func_quote_for_eval_result "
3198 # The real first argument should be the name of the installation program.
3199 # Aesthetically quote it.
3200 func_quote_for_eval "$arg"
3201 func_append install_prog "$func_quote_for_eval_result"
3202 install_shared_prog=$install_prog
3203 case " $install_prog " in
3204 *[\\\ /]cp\ *) install_cp=: ;;
3205 *) install_cp=false ;;
3208 # We need to accept at least all the BSD install flags.
3220 if test -n "$dest"; then
3221 func_append files " $dest"
3229 if $install_cp; then :; else
3243 # If the previous option needed an argument, then skip it.
3244 if test -n "$prev"; then
3245 if test "x$prev" = x-m && test -n "$install_override_mode"; then
3246 arg2=$install_override_mode
3257 # Aesthetically quote the argument.
3258 func_quote_for_eval "$arg"
3259 func_append install_prog " $func_quote_for_eval_result"
3260 if test -n "$arg2"; then
3261 func_quote_for_eval "$arg2"
3263 func_append install_shared_prog " $func_quote_for_eval_result"
3266 test -z "$install_prog" && \
3267 func_fatal_help "you must specify an install program"
3269 test -n "$prev" && \
3270 func_fatal_help "the \`$prev' option requires an argument"
3272 if test -n "$install_override_mode" && $no_mode; then
3273 if $install_cp; then :; else
3274 func_quote_for_eval "$install_override_mode"
3275 func_append install_shared_prog " -m $func_quote_for_eval_result"
3279 if test -z "$files"; then
3280 if test -z "$dest"; then
3281 func_fatal_help "no file or destination specified"
3283 func_fatal_help "you must specify a destination"
3287 # Strip any trailing slash from the destination.
3288 func_stripname '' '/' "$dest"
3289 dest=$func_stripname_result
3291 # Check to see that the destination is a directory.
3292 test -d "$dest" && isdir=yes
3293 if test "$isdir" = yes; then
3297 func_dirname_and_basename "$dest" "" "."
3298 destdir="$func_dirname_result"
3299 destname="$func_basename_result"
3301 # Not a directory, so check to see that there is only one file specified.
3302 set dummy $files; shift
3303 test "$#" -gt 1 && \
3304 func_fatal_help "\`$dest' is not a directory"
3307 [\\/]* | [A-Za-z]:[\\/]*) ;;
3309 for file in $files; do
3313 func_fatal_help "\`$destdir' must be an absolute directory name"
3320 # This variable tells wrapper scripts just to set variables rather
3321 # than running their programs.
3322 libtool_install_magic="$magic"
3327 for file in $files; do
3329 # Do each installation.
3332 # Do the static libraries later.
3333 func_append staticlibs " $file"
3337 func_resolve_sysroot "$file"
3338 file=$func_resolve_sysroot_result
3340 # Check to see that this really is a libtool archive.
3341 func_lalib_unsafe_p "$file" \
3342 || func_fatal_help "\`$file' is not a valid libtool archive"
3349 # Add the libdir to current_libdirs if it is the destination.
3350 if test "X$destdir" = "X$libdir"; then
3351 case "$current_libdirs " in
3353 *) func_append current_libdirs " $libdir" ;;
3356 # Note the libdir as a future libdir.
3357 case "$future_libdirs " in
3359 *) func_append future_libdirs " $libdir" ;;
3363 func_dirname "$file" "/" ""
3364 dir="$func_dirname_result"
3365 func_append dir "$objdir"
3367 if test -n "$relink_command"; then
3368 # Determine the prefix the user has applied to our future dir.
3369 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3371 # Don't allow the user to place us outside of our expected
3372 # location b/c this prevents finding dependent libraries that
3373 # are installed to the same prefix.
3374 # At present, this check doesn't affect windows .dll's that
3375 # are installed into $libdir/../bin (currently, that works fine)
3376 # but it's something to keep an eye on.
3377 test "$inst_prefix_dir" = "$destdir" && \
3378 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3380 if test -n "$inst_prefix_dir"; then
3381 # Stick the inst_prefix_dir data into the link command.
3382 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3384 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3387 func_warning "relinking \`$file'"
3388 func_show_eval "$relink_command" \
3389 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3392 # See the names of the shared library.
3393 set dummy $library_names; shift
3394 if test -n "$1"; then
3399 test -n "$relink_command" && srcname="$realname"T
3401 # Install the shared library and build the symlinks.
3402 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3406 cygwin* | mingw* | pw32* | cegcc*)
3414 if test -n "$tstripme" && test -n "$striplib"; then
3415 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3418 if test "$#" -gt 0; then
3419 # Delete the old symlinks, and create new ones.
3420 # Try `ln -sf' first, because the `ln' binary might depend on
3421 # the symlink we replace! Solaris /bin/ln does not understand -f,
3422 # so we also need to try rm && ln -s.
3425 test "$linkname" != "$realname" \
3426 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3430 # Do each command in the postinstall commands.
3431 lib="$destdir/$realname"
3432 func_execute_cmds "$postinstall_cmds" 'exit $?'
3435 # Install the pseudo-library for information purposes.
3436 func_basename "$file"
3437 name="$func_basename_result"
3438 instname="$dir/$name"i
3439 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3441 # Maybe install the static library, too.
3442 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3446 # Install (i.e. copy) a libtool object.
3448 # Figure out destination file name, if it wasn't already specified.
3449 if test -n "$destname"; then
3450 destfile="$destdir/$destname"
3452 func_basename "$file"
3453 destfile="$func_basename_result"
3454 destfile="$destdir/$destfile"
3457 # Deduce the name of the destination old-style object file.
3460 func_lo2o "$destfile"
3461 staticdest=$func_lo2o_result
3464 staticdest="$destfile"
3468 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3472 # Install the libtool object if requested.
3473 test -n "$destfile" && \
3474 func_show_eval "$install_prog $file $destfile" 'exit $?'
3476 # Install the old object if enabled.
3477 if test "$build_old_libs" = yes; then
3478 # Deduce the name of the old-style object file.
3480 staticobj=$func_lo2o_result
3481 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3487 # Figure out destination file name, if it wasn't already specified.
3488 if test -n "$destname"; then
3489 destfile="$destdir/$destname"
3491 func_basename "$file"
3492 destfile="$func_basename_result"
3493 destfile="$destdir/$destfile"
3496 # If the file is missing, and there is a .exe on the end, strip it
3497 # because it is most likely a libtool script we actually want to
3502 if test ! -f "$file"; then
3503 func_stripname '' '.exe' "$file"
3504 file=$func_stripname_result
3510 # Do a test to see if this is really a libtool program.
3513 if func_ltwrapper_executable_p "$file"; then
3514 func_ltwrapper_scriptname "$file"
3515 wrapper=$func_ltwrapper_scriptname_result
3517 func_stripname '' '.exe' "$file"
3518 wrapper=$func_stripname_result
3525 if func_ltwrapper_script_p "$wrapper"; then
3529 func_source "$wrapper"
3531 # Check the variables that should have been set.
3532 test -z "$generated_by_libtool_version" && \
3533 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3536 for lib in $notinst_deplibs; do
3537 # Check to see that each library is installed.
3539 if test -f "$lib"; then
3542 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3543 if test -n "$libdir" && test ! -f "$libfile"; then
3544 func_warning "\`$lib' has not been installed in \`$libdir'"
3550 func_source "$wrapper"
3553 if test "$fast_install" = no && test -n "$relink_command"; then
3555 if test "$finalize" = yes; then
3556 tmpdir=`func_mktempdir`
3557 func_basename "$file$stripped_ext"
3558 file="$func_basename_result"
3559 outputname="$tmpdir/$file"
3560 # Replace the output file specification.
3561 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3564 func_quote_for_expand "$relink_command"
3565 eval "func_echo $func_quote_for_expand_result"
3567 if eval "$relink_command"; then :
3569 func_error "error: relink \`$file' with the above command before installing it"
3570 $opt_dry_run || ${RM}r "$tmpdir"
3575 func_warning "cannot relink \`$file'"
3579 # Install the binary that we compiled earlier.
3580 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3584 # remove .exe since cygwin /usr/bin/install will append another
3586 case $install_prog,$host in
3587 */usr/bin/install*,*cygwin*)
3588 case $file:$destfile in
3593 destfile=$destfile.exe
3596 func_stripname '' '.exe' "$destfile"
3597 destfile=$func_stripname_result
3602 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3603 $opt_dry_run || if test -n "$outputname"; then
3610 for file in $staticlibs; do
3611 func_basename "$file"
3612 name="$func_basename_result"
3614 # Set up the ranlib parameters.
3615 oldlib="$destdir/$name"
3617 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3619 if test -n "$stripme" && test -n "$old_striplib"; then
3620 func_show_eval "$old_striplib $oldlib" 'exit $?'
3623 # Do each command in the postinstall commands.
3624 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3627 test -n "$future_libdirs" && \
3628 func_warning "remember to run \`$progname --finish$future_libdirs'"
3630 if test -n "$current_libdirs"; then
3631 # Maybe just do a dry run.
3632 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3633 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3639 test "$opt_mode" = install && func_mode_install ${1+"$@"}
3642 # func_generate_dlsyms outputname originator pic_p
3643 # Extract symbols from dlprefiles and create ${outputname}S.o with
3644 # a dlpreopen symbol table.
3645 func_generate_dlsyms ()
3651 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3654 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3655 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3656 my_dlsyms="${my_outputname}S.c"
3658 func_error "not configured to extract global symbols from dlpreopened files"
3662 if test -n "$my_dlsyms"; then
3666 # Discover the nlist of each of the dlfiles.
3667 nlist="$output_objdir/${my_outputname}.nm"
3669 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3671 # Parse the name list into a source file.
3672 func_verbose "creating $output_objdir/$my_dlsyms"
3674 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3675 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3676 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3682 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3683 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3686 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3687 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3688 /* DATA imports from DLLs on WIN32 con't be const, because runtime
3689 relocations are performed -- see ld's documentation on pseudo-relocs. */
3690 # define LT_DLSYM_CONST
3691 #elif defined(__osf__)
3692 /* This system does not cope well with relocations in const data. */
3693 # define LT_DLSYM_CONST
3695 # define LT_DLSYM_CONST const
3698 /* External symbol declarations for the compiler. */\
3701 if test "$dlself" = yes; then
3702 func_verbose "generating symbol list for \`$output'"
3704 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3706 # Add our own program objects to the symbol list.
3707 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3708 for progfile in $progfiles; do
3709 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3710 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3711 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3714 if test -n "$exclude_expsyms"; then
3716 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3717 eval '$MV "$nlist"T "$nlist"'
3721 if test -n "$export_symbols_regex"; then
3723 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3724 eval '$MV "$nlist"T "$nlist"'
3728 # Prepare the list of exported symbols
3729 if test -z "$export_symbols"; then
3730 export_symbols="$output_objdir/$outputname.exp"
3733 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3735 *cygwin* | *mingw* | *cegcc* )
3736 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3737 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3743 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3744 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3745 eval '$MV "$nlist"T "$nlist"'
3747 *cygwin* | *mingw* | *cegcc* )
3748 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3749 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3756 for dlprefile in $dlprefiles; do
3757 func_verbose "extracting global C symbols from \`$dlprefile'"
3758 func_basename "$dlprefile"
3759 name="$func_basename_result"
3761 *cygwin* | *mingw* | *cegcc* )
3762 # if an import library, we need to obtain dlname
3763 if func_win32_import_lib_p "$dlprefile"; then
3764 func_tr_sh "$dlprefile"
3765 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3766 dlprefile_dlbasename=""
3767 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3768 # Use subshell, to avoid clobbering current variable values
3769 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3770 if test -n "$dlprefile_dlname" ; then
3771 func_basename "$dlprefile_dlname"
3772 dlprefile_dlbasename="$func_basename_result"
3774 # no lafile. user explicitly requested -dlpreopen <import library>.
3775 $sharedlib_from_linklib_cmd "$dlprefile"
3776 dlprefile_dlbasename=$sharedlib_from_linklib_result
3780 if test -n "$dlprefile_dlbasename" ; then
3781 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3783 func_warning "Could not compute DLL name from $name"
3784 eval '$ECHO ": $name " >> "$nlist"'
3786 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3787 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3788 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3790 else # not an import lib
3792 eval '$ECHO ": $name " >> "$nlist"'
3793 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3794 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3800 eval '$ECHO ": $name " >> "$nlist"'
3801 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3802 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3809 # Make sure we have at least an empty file.
3810 test -f "$nlist" || : > "$nlist"
3812 if test -n "$exclude_expsyms"; then
3813 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3814 $MV "$nlist"T "$nlist"
3817 # Try sorting and uniquifying the output.
3818 if $GREP -v "^: " < "$nlist" |
3819 if sort -k 3 </dev/null >/dev/null 2>&1; then
3824 uniq > "$nlist"S; then
3827 $GREP -v "^: " < "$nlist" > "$nlist"S
3830 if test -f "$nlist"S; then
3831 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3833 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3836 echo >> "$output_objdir/$my_dlsyms" "\
3838 /* The mapping between symbol names and symbols. */
3843 extern LT_DLSYM_CONST lt_dlsymlist
3844 lt_${my_prefix}_LTX_preloaded_symbols[];
3845 LT_DLSYM_CONST lt_dlsymlist
3846 lt_${my_prefix}_LTX_preloaded_symbols[] =
3848 { \"$my_originator\", (void *) 0 },"
3850 case $need_lib_prefix in
3852 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3855 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3858 echo >> "$output_objdir/$my_dlsyms" "\
3862 /* This works around a problem in FreeBSD linker */
3863 #ifdef FREEBSD_WORKAROUND
3864 static const void *lt_preloaded_setup() {
3865 return lt_${my_prefix}_LTX_preloaded_symbols;
3875 pic_flag_for_symtable=
3876 case "$compile_command " in
3880 # compiling the symbol table file with pic_flag works around
3881 # a FreeBSD bug that causes programs to crash when -lm is
3882 # linked before any other PIC object. But we must not use