3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (lzo) 2.06
5 # Libtool was configured on host vicente-P5K-E:
6 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
8 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
11 # Written by Gordon Matzigkeit, 1996
13 # This file is part of GNU Libtool.
15 # GNU Libtool is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation; either version 2 of
18 # the License, or (at your option) any later version.
20 # As a special exception to the GNU General Public License,
21 # if you distribute this file as part of a program or library that
22 # is built using GNU Libtool, you may include this file under the
23 # same distribution terms that you use for the rest of that program.
25 # GNU Libtool is distributed in the hope that it will be useful,
26 # but WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 # GNU General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with GNU Libtool; see the file COPYING. If not, a copy
32 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
33 # obtained by writing to the Free Software Foundation, Inc.,
34 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37 # The names of the tagged configurations supported by this script.
40 # ### BEGIN LIBTOOL CONFIG
42 # Whether or not to build static libraries.
45 # Whether or not to build shared libraries.
46 build_libtool_libs
=yes
48 # Which release of libtool.m4 was used?
52 # What type of objects to build.
55 # Whether or not to optimize for fast installation.
58 # Shell to use when invoking shell scripts.
61 # An echo program that protects backslashes.
65 host_alias
=mipsel-linux
66 host=mipsel-unknown-linux-gnu
70 build_alias
=x86_64-linux-gnu
71 build
=x86_64-pc-linux-gnu
74 # A sed program that does not truncate output.
77 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
78 Xsed
="$SED -e 1s/^X//"
80 # A grep program that handles long lines.
86 # A literal string matcher.
89 # A BSD- or MS-compatible name lister.
92 # Whether we need soft or hard links.
95 # What is the maximum length of a command?
96 max_cmd_len
=3458764513820540925
98 # Object file suffix (normally "o").
101 # Executable file suffix (normally "").
104 # whether the shell understands "unset".
107 # turn spaces into newlines.
108 SP2NL
="tr \\040 \\012"
110 # turn newlines into spaces.
111 NL2SP
="tr \\015\\012 \\040\\040"
113 # An object symbol dumper.
114 OBJDUMP
="mipsel-linux-objdump"
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"
123 AR
="mipsel-uclibc-ar"
126 # A symbol stripping program.
127 STRIP
="mipsel-uclibc-strip -R .note -R .comment"
129 # Commands used to install an old-style archive.
130 RANLIB
="mipsel-uclibc-ranlib"
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
138 LTCC
="mipsel-uclibc-gcc"
140 # LTCC compiler flags.
141 LTCFLAGS
="-O3 -Wall -fPIC -DLINUX26 -DCONFIG_BCMWL5 -pipe -DBCMWPA2 -funit-at-a-time -Wno-pointer-sign -mtune=mips32 -mips32 "
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
=no
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
="/home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc/mipsel-linux-uclibc/4.2.4 /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/lib/gcc /home/vicente/tomato/tools/brcm/K26/hndtools-mipsel-uclibc-4.2.4/mipsel-linux-uclibc/lib "
242 # Run-time system search path for libraries.
243 sys_lib_dlsearch_path_spec
="/lib64 /usr/lib64 /lib /usr/lib /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/lib/nvidia-settings /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/nvidia-current /usr/lib32/nvidia-current /lib32 /usr/lib32 "
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
="mipsel-uclibc-strip -R .note -R .comment --strip-debug"
256 striplib
="mipsel-uclibc-strip -R .note -R .comment --strip-unneeded"
259 # The linker used to build libraries.
260 LD
="mipsel-uclibc-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.
270 CC
="mipsel-uclibc-gcc"
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 # ### END LIBTOOL CONFIG
399 # Generated from ltmain.m4sh.
401 # libtool (GNU libtool) 2.2.10
402 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
404 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
405 # 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
406 # This is free software; see the source for copying conditions. There is NO
407 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
409 # GNU Libtool is free software; you can redistribute it and/or modify
410 # it under the terms of the GNU General Public License as published by
411 # the Free Software Foundation; either version 2 of the License, or
412 # (at your option) any later version.
414 # As a special exception to the GNU General Public License,
415 # if you distribute this file as part of a program or library that
416 # is built using GNU Libtool, you may include this file under the
417 # same distribution terms that you use for the rest of that program.
419 # GNU Libtool is distributed in the hope that it will be useful, but
420 # WITHOUT ANY WARRANTY; without even the implied warranty of
421 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
422 # General Public License for more details.
424 # You should have received a copy of the GNU General Public License
425 # along with GNU Libtool; see the file COPYING. If not, a copy
426 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
427 # or obtained by writing to the Free Software Foundation, Inc.,
428 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
430 # Usage: $progname [OPTION]... [MODE-ARG]...
432 # Provide generalized library-building support services.
434 # --config show all configuration variables
435 # --debug enable verbose shell tracing
436 # -n, --dry-run display commands without modifying any files
437 # --features display basic configuration information and exit
438 # --mode=MODE use operation mode MODE
439 # --preserve-dup-deps don't remove duplicate dependency libraries
440 # --quiet, --silent don't print informational messages
441 # --no-quiet, --no-silent
442 # print informational messages (default)
443 # --tag=TAG use configuration variables from tag TAG
444 # -v, --verbose print more informational messages than default
445 # --no-verbose don't print the extra informational messages
446 # --version print version information
447 # -h, --help, --help-all print short, long, or detailed help message
449 # MODE must be one of the following:
451 # clean remove files from the build directory
452 # compile compile a source file into a libtool object
453 # execute automatically set library path, then run a program
454 # finish complete the installation of libtool libraries
455 # install install libraries or executables
456 # link create a library or an executable
457 # uninstall remove libraries from an installed directory
459 # MODE-ARGS vary depending on the MODE. When passed as first option,
460 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
461 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
463 # When reporting a bug, please describe a test case to reproduce it and
464 # include the following information:
466 # host-triplet: $host
469 # compiler flags: $LTCFLAGS
470 # linker: $LD (gnu? $with_gnu_ld)
471 # $progname: (GNU libtool) 2.2.10
472 # automake: $automake_version
473 # autoconf: $autoconf_version
475 # Report bugs to <bug-libtool@gnu.org>.
481 package_revision
=1.3175
483 # Be Bourne compatible
484 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
487 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
488 # is contrary to our usage. Disable this feature.
489 alias -g '${1+"$@"}'='"$@"'
492 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
494 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
495 DUALCASE
=1; export DUALCASE
# for MKS sh
497 # A function that is used when there is no print builtin or printf.
498 func_fallback_echo
()
500 eval 'cat <<_LTECHO_EOF
505 # NLS nuisances: We save the old values to restore during execute mode.
508 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
510 eval "if test \"\${$lt_var+set}\" = set; then
511 save_$lt_var=\$$lt_var
514 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
515 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
520 export LANGUAGE LC_ALL
525 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
526 # is ksh but when the shell is invoked as "sh" and the current value of
527 # the _XPG environment variable is not equal to 1 (one), the special
528 # positional parameter $0, within a function call, is the name of the
535 test "${ECHO+set}" = set || ECHO
=${as_echo-'printf %s\n'}
545 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
546 : ${Xsed="$SED -e 1s/^X//"}
551 EXIT_MISMATCH
=63 # $? = 63 is used to indicate version mismatch to missing.
552 EXIT_SKIP
=77 # $? = 77 is used to indicate a skipped test to automake.
554 exit_status
=$EXIT_SUCCESS
556 # Make sure IFS has a sensible default
561 dirname="s,/[^/]*$,,"
564 # func_dirname_and_basename file append nondir_replacement
565 # perform func_basename and func_dirname in a single function
567 # dirname: Compute the dirname of FILE. If nonempty,
568 # add APPEND to the result, otherwise set result
569 # to NONDIR_REPLACEMENT.
570 # value returned in "$func_dirname_result"
571 # basename: Compute filename of FILE.
572 # value retuned in "$func_basename_result"
573 # Implementation must be kept synchronized with func_dirname
574 # and func_basename. For efficiency, we do not delegate to
575 # those functions but instead duplicate the functionality here.
576 func_dirname_and_basename
()
578 # Extract subdirectory from the argument.
579 func_dirname_result
=`$ECHO "${1}" | $SED -e "$dirname"`
580 if test "X$func_dirname_result" = "X${1}"; then
581 func_dirname_result
="${3}"
583 func_dirname_result
="$func_dirname_result${2}"
585 func_basename_result
=`$ECHO "${1}" | $SED -e "$basename"`
588 # Generated shell functions inserted here.
590 # func_dirname file append nondir_replacement
591 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
592 # otherwise set result to NONDIR_REPLACEMENT.
596 */*) func_dirname_result
="${1%/*}${2}" ;;
597 * ) func_dirname_result
="${3}" ;;
604 func_basename_result
="${1##*/}"
607 # func_dirname_and_basename file append nondir_replacement
608 # perform func_basename and func_dirname in a single function
610 # dirname: Compute the dirname of FILE. If nonempty,
611 # add APPEND to the result, otherwise set result
612 # to NONDIR_REPLACEMENT.
613 # value returned in "$func_dirname_result"
614 # basename: Compute filename of FILE.
615 # value retuned in "$func_basename_result"
616 # Implementation must be kept synchronized with func_dirname
617 # and func_basename. For efficiency, we do not delegate to
618 # those functions but instead duplicate the functionality here.
619 func_dirname_and_basename
()
622 */*) func_dirname_result
="${1%/*}${2}" ;;
623 * ) func_dirname_result
="${3}" ;;
625 func_basename_result
="${1##*/}"
628 # func_stripname prefix suffix name
629 # strip PREFIX and SUFFIX off of NAME.
630 # PREFIX and SUFFIX must not contain globbing or regex special
631 # characters, hashes, percent signs, but SUFFIX may contain a leading
632 # dot (in which case that matches only a dot).
635 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
636 # positional parameters, so assign one to ordinary parameter first.
637 func_stripname_result
=${3}
638 func_stripname_result
=${func_stripname_result#"${1}"}
639 func_stripname_result
=${func_stripname_result%"${2}"}
645 func_opt_split_opt
=${1%%=*}
646 func_opt_split_arg
=${1#*=}
653 *.lo
) func_lo2o_result
=${1%.lo}.
${objext} ;;
654 *) func_lo2o_result
=${1} ;;
658 # func_xform libobj-or-source
661 func_xform_result
=${1%.*}.lo
664 # func_arith arithmetic-term...
667 func_arith_result
=$
(( $
* ))
671 # STRING may not start with a hyphen.
674 func_len_result
=${#1}
678 # func_append var value
679 # Append VALUE to the end of shell variable VAR.
684 # Generated shell functions inserted here.
686 # These SED scripts presuppose an absolute path with a trailing slash.
687 pathcar
='s,^/\([^/]*\).*$,\1,'
688 pathcdr
='s,^/[^/]*,,'
689 removedotparts
=':dotsl
693 collapseslashes
='s@/\{1,\}@/@g'
694 finalslash
='s,/*$,/,'
696 # func_normal_abspath PATH
697 # Remove doubled-up and trailing slashes, "." path components,
698 # and cancel out any ".." path components in PATH after making
699 # it an absolute path.
700 # value returned in "$func_normal_abspath_result"
701 func_normal_abspath
()
703 # Start from root dir and reassemble the path.
704 func_normal_abspath_result
=
705 func_normal_abspath_tpath
=$1
706 func_normal_abspath_altnamespace
=
707 case $func_normal_abspath_tpath in
709 # Empty path, that just means $cwd.
710 func_stripname
'' '/' "`pwd`"
711 func_normal_abspath_result
=$func_stripname_result
714 # The next three entries are used to spot a run of precisely
715 # two leading slashes without using negated character classes;
716 # we take advantage of case's first-match behaviour.
718 # Unusual form of absolute path, do nothing.
721 # Not necessarily an ordinary path; POSIX reserves leading '//'
722 # and for example Cygwin uses it to access remote file shares
723 # over CIFS/SMB, so we conserve a leading double slash if found.
724 func_normal_abspath_altnamespace
=/
727 # Absolute path, do nothing.
730 # Relative path, prepend $cwd.
731 func_normal_abspath_tpath
=`pwd`/$func_normal_abspath_tpath
734 # Cancel out all the simple stuff to save iterations. We also want
735 # the path to end with a slash for ease of parsing, so make sure
736 # there is one (and only one) here.
737 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
738 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
740 # Processed it all yet?
741 if test "$func_normal_abspath_tpath" = / ; then
742 # If we ascended to the root using ".." the result may be empty now.
743 if test -z "$func_normal_abspath_result" ; then
744 func_normal_abspath_result
=/
748 func_normal_abspath_tcomponent
=`$ECHO "$func_normal_abspath_tpath" | $SED \
750 func_normal_abspath_tpath
=`$ECHO "$func_normal_abspath_tpath" | $SED \
752 # Figure out what to do with it
753 case $func_normal_abspath_tcomponent in
755 # Trailing empty path component, ignore it.
758 # Parent dir; strip last assembled component from result.
759 func_dirname
"$func_normal_abspath_result"
760 func_normal_abspath_result
=$func_dirname_result
763 # Actual path component, append it.
764 func_normal_abspath_result
=$func_normal_abspath_result/$func_normal_abspath_tcomponent
768 # Restore leading double-slash if one was found on entry.
769 func_normal_abspath_result
=$func_normal_abspath_altnamespace$func_normal_abspath_result
772 # func_relative_path SRCDIR DSTDIR
773 # generates a relative path from SRCDIR to DSTDIR, with a trailing
774 # slash if non-empty, suitable for immediately appending a filename
775 # without needing to append a separator.
776 # value returned in "$func_relative_path_result"
777 func_relative_path
()
779 func_relative_path_result
=
780 func_normal_abspath
"$1"
781 func_relative_path_tlibdir
=$func_normal_abspath_result
782 func_normal_abspath
"$2"
783 func_relative_path_tbindir
=$func_normal_abspath_result
785 # Ascend the tree starting from libdir
787 # check if we have found a prefix of bindir
788 case $func_relative_path_tbindir in
789 $func_relative_path_tlibdir)
790 # found an exact match
791 func_relative_path_tcancelled
=
794 $func_relative_path_tlibdir*)
795 # found a matching prefix
796 func_stripname
"$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
797 func_relative_path_tcancelled
=$func_stripname_result
798 if test -z "$func_relative_path_result"; then
799 func_relative_path_result
=.
804 func_dirname
$func_relative_path_tlibdir
805 func_relative_path_tlibdir
=${func_dirname_result}
806 if test "x$func_relative_path_tlibdir" = x
; then
807 # Have to descend all the way to the root!
808 func_relative_path_result
=..
/$func_relative_path_result
809 func_relative_path_tcancelled
=$func_relative_path_tbindir
812 func_relative_path_result
=..
/$func_relative_path_result
817 # Now calculate path; take care to avoid doubling-up slashes.
818 func_stripname
'' '/' "$func_relative_path_result"
819 func_relative_path_result
=$func_stripname_result
820 func_stripname
'/' '/' "$func_relative_path_tcancelled"
821 if test "x$func_stripname_result" != x
; then
822 func_relative_path_result
=${func_relative_path_result}/${func_stripname_result}
825 # Normalisation. If bindir is libdir, return empty string,
826 # else relative path ending with a slash; either way, target
827 # file name can be directly appended.
828 if test ! -z "$func_relative_path_result"; then
829 func_stripname
'./' '' "$func_relative_path_result/"
830 func_relative_path_result
=$func_stripname_result
834 # The name of this program:
835 func_dirname_and_basename
"$progpath"
836 progname
=$func_basename_result
838 # Make sure we have an absolute path for reexecution:
840 [\\/]*|
[A-Za-z
]:\\*) ;;
842 progdir
=$func_dirname_result
843 progdir
=`cd "$progdir" && pwd`
844 progpath
="$progdir/$progname"
849 for progdir
in $PATH; do
851 test -x "$progdir/$progname" && break
854 test -n "$progdir" || progdir
=`pwd`
855 progpath
="$progdir/$progname"
859 # Sed substitution that helps us do robust quoting. It backslashifies
860 # metacharacters that are still active within double-quoted strings.
861 Xsed
="${SED}"' -e 1s/^X//'
862 sed_quote_subst
='s/\([`"$\\]\)/\\\1/g'
864 # Same as above, but do not quote variable references.
865 double_quote_subst
='s/\(["`\\]\)/\\\1/g'
867 # Re-`\' parameter expansions in output of double_quote_subst that were
868 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
869 # in input to double_quote_subst, that '$' was protected from expansion.
870 # Since each input `\' is now two `\'s, look for any number of runs of
871 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
876 sed_double_backslash
="\
880 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
891 # Echo program name prefixed message, along with the current mode
892 # name if it has been set yet.
895 $ECHO "$progname${mode+: }$mode: $*"
898 # func_verbose arg...
899 # Echo program name prefixed message in verbose mode only.
902 $opt_verbose && func_echo
${1+"$@"}
904 # A bug in bash halts the script if the last line of a function
905 # fails when set -e is in force, so we need another command to
910 # func_echo_all arg...
911 # Invoke $ECHO with all args, space-separated.
918 # Echo program name prefixed message to standard error.
921 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
924 # func_warning arg...
925 # Echo program name prefixed warning message to standard error.
928 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
934 # func_fatal_error arg...
935 # Echo program name prefixed message to standard error, and exit.
942 # func_fatal_help arg...
943 # Echo program name prefixed message to standard error, followed by
944 # a help hint, and exit.
948 func_fatal_error
"$help"
950 help="Try \`$progname --help' for more information." ## default
953 # func_grep expression filename
954 # Check whether EXPRESSION matches any line of FILENAME, without output.
957 $GREP "$1" "$2" >/dev
/null
2>&1
961 # func_mkdir_p directory-path
962 # Make sure the entire path to DIRECTORY-PATH is available.
965 my_directory_path
="$1"
968 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
970 # Protect directory names starting with `-'
971 case $my_directory_path in
972 -*) my_directory_path
="./$my_directory_path" ;;
975 # While some portion of DIR does not yet exist...
976 while test ! -d "$my_directory_path"; do
977 # ...make a list in topmost first order. Use a colon delimited
978 # list incase some portion of path contains whitespace.
979 my_dir_list
="$my_directory_path:$my_dir_list"
981 # If the last portion added has no slash in it, the list is done
982 case $my_directory_path in */*) ;; *) break ;; esac
984 # ...otherwise throw away the child directory and loop
985 my_directory_path
=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
987 my_dir_list
=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
989 save_mkdir_p_IFS
="$IFS"; IFS
=':'
990 for my_dir
in $my_dir_list; do
991 IFS
="$save_mkdir_p_IFS"
992 # mkdir can fail with a `File exist' error if two processes
993 # try to create one of the directories concurrently. Don't
995 $MKDIR "$my_dir" 2>/dev
/null ||
:
997 IFS
="$save_mkdir_p_IFS"
999 # Bail out if we (or some other process) failed to create a directory.
1000 test -d "$my_directory_path" || \
1001 func_fatal_error
"Failed to create \`$1'"
1006 # func_mktempdir [string]
1007 # Make a temporary directory that won't clash with other running
1008 # libtool processes, and avoids race conditions if possible. If
1009 # given, STRING is the basename for that directory.
1012 my_template
="${TMPDIR-/tmp}/${1-$progname}"
1014 if test "$opt_dry_run" = ":"; then
1015 # Return a directory name, but don't create it in dry-run mode
1016 my_tmpdir
="${my_template}-$$"
1019 # If mktemp works, use that first and foremost
1020 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
1022 if test ! -d "$my_tmpdir"; then
1023 # Failing that, at least try and use $RANDOM to avoid a race
1024 my_tmpdir
="${my_template}-${RANDOM-0}$$"
1026 save_mktempdir_umask
=`umask`
1029 umask $save_mktempdir_umask
1032 # If we're not in dry-run mode, bomb out on failure
1033 test -d "$my_tmpdir" || \
1034 func_fatal_error
"cannot create temporary directory \`$my_tmpdir'"
1041 # func_quote_for_eval arg
1042 # Aesthetically quote ARG to be evaled later.
1043 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1044 # is double-quoted, suitable for a subsequent eval, whereas
1045 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1046 # which are still active within double quotes backslashified.
1047 func_quote_for_eval
()
1051 func_quote_for_eval_unquoted_result=`$ECHO "$1" |
$SED "$sed_quote_subst"` ;;
1053 func_quote_for_eval_unquoted_result="$1" ;;
1056 case $func_quote_for_eval_unquoted_result in
1057 # Double-quote args containing shell metacharacters to delay
1058 # word splitting, command substitution and and variable
1059 # expansion for a subsequent eval.
1060 # Many Bourne shells cannot handle close brackets correctly
1061 # in scan sets, so we specify it separately.
1062 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1063 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1066 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1071 # func_quote_for_expand arg
1072 # Aesthetically quote ARG to be evaled later; same as above,
1073 # but do not quote variable references.
1074 func_quote_for_expand ()
1078 my_arg
=`$ECHO "$1" | $SED \
1079 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1085 # Double-quote args containing shell metacharacters to delay
1086 # word splitting and command substitution for a subsequent eval.
1087 # Many Bourne shells cannot handle close brackets correctly
1088 # in scan sets, so we specify it separately.
1089 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1090 my_arg
="\"$my_arg\""
1094 func_quote_for_expand_result
="$my_arg"
1098 # func_show_eval cmd [fail_exp]
1099 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1100 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1101 # is given, then evaluate it.
1105 my_fail_exp
="${2-:}"
1107 ${opt_silent-false} ||
{
1108 func_quote_for_expand
"$my_cmd"
1109 eval "func_echo $func_quote_for_expand_result"
1112 if ${opt_dry_run-false}; then :; else
1115 if test "$my_status" -eq 0; then :; else
1116 eval "(exit $my_status); $my_fail_exp"
1122 # func_show_eval_locale cmd [fail_exp]
1123 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1124 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1125 # is given, then evaluate it. Use the saved locale for evaluation.
1126 func_show_eval_locale
()
1129 my_fail_exp
="${2-:}"
1131 ${opt_silent-false} ||
{
1132 func_quote_for_expand
"$my_cmd"
1133 eval "func_echo $func_quote_for_expand_result"
1136 if ${opt_dry_run-false}; then :; else
1137 eval "$lt_user_locale
1140 eval "$lt_safe_locale"
1141 if test "$my_status" -eq 0; then :; else
1142 eval "(exit $my_status); $my_fail_exp"
1149 # Echo version message to standard output and exit.
1160 /^# '$PROGRAM' (GNU /,/# warranty; / {
1163 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1170 # Echo short help message to standard output and exit.
1173 $SED -n '/^# Usage:/,/^# *.*--help/ {
1176 s/\$progname/'$progname'/
1180 $ECHO "run \`$progname --help | more' for full usage"
1184 # func_help [NOEXIT]
1185 # Echo long help message to standard output and exit,
1186 # unless 'noexit' is passed as argument.
1189 $SED -n '/^# Usage:/,/# Report bugs to/ {
1192 s*\$progname*'$progname'*
1194 s*\$SHELL*'"$SHELL"'*
1196 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1198 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1199 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1200 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1204 if test -z "$1"; then
1209 # func_missing_arg argname
1210 # Echo program name prefixed message to standard error and set global
1214 func_error
"missing argument for $1."
1225 magic
="%%%MAGIC variable%%%"
1226 magic_exe
="%%%MAGIC EXE variable%%%"
1233 lo2o
="s/\\.lo\$/.${objext}/"
1234 o2lo
="s/\\.${objext}\$/.lo/"
1239 opt_duplicate_deps
=false
1243 # If this variable is set in any of the actions, the command in it
1244 # will be execed at the end. This prevents here-documents from being
1245 # left over by shells.
1248 # func_fatal_configuration arg...
1249 # Echo program name prefixed message to standard error, followed by
1250 # a configuration failure hint, and exit.
1251 func_fatal_configuration
()
1253 func_error
${1+"$@"}
1254 func_error
"See the $PACKAGE documentation for more information."
1255 func_fatal_error
"Fatal configuration error."
1260 # Display the configuration for all the tags in this script.
1263 re_begincf
='^# ### BEGIN LIBTOOL'
1264 re_endcf
='^# ### END LIBTOOL'
1266 # Default configuration.
1267 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1269 # Now print the configurations for the tags.
1270 for tagname
in $taglist; do
1271 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1278 # Display the features supported by this script.
1282 if test "$build_libtool_libs" = yes; then
1283 echo "enable shared libraries"
1285 echo "disable shared libraries"
1287 if test "$build_old_libs" = yes; then
1288 echo "enable static libraries"
1290 echo "disable static libraries"
1296 # func_enable_tag tagname
1297 # Verify that TAGNAME is valid, and either flag an error and exit, or
1298 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1305 re_begincf
="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1306 re_endcf
="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1307 sed_extractcf
="/$re_begincf/,/$re_endcf/p"
1312 func_fatal_error
"invalid tag name: $tagname"
1316 # Don't test for the "default" C tag, as we know it's
1317 # there but not specially marked.
1321 if $GREP "$re_begincf" "$progpath" >/dev
/null
2>&1; then
1322 taglist
="$taglist $tagname"
1324 # Evaluate the configuration. Be careful to quote the path
1325 # and the sed script, to avoid splitting on whitespace, but
1326 # also don't use non-portable quotes within backquotes within
1327 # quotes we have to do it in 2 steps:
1328 extractedcf
=`$SED -n -e "$sed_extractcf" < "$progpath"`
1331 func_error
"ignoring unknown tag $tagname"
1337 # Parse options once, thoroughly. This comes as soon as possible in
1338 # the script to make things like `libtool --version' happen quickly.
1341 # Shorthand for --mode=foo, only valid as the first argument
1344 shift; set dummy
--mode clean
${1+"$@"}; shift
1346 compile|compil|compi|comp|com|co|c
)
1347 shift; set dummy
--mode compile
${1+"$@"}; shift
1349 execute|execut|execu|
exec|exe|ex|e
)
1350 shift; set dummy
--mode execute
${1+"$@"}; shift
1352 finish|finis|fini|fin|
fi|f
)
1353 shift; set dummy
--mode finish
${1+"$@"}; shift
1355 install|instal|insta|inst|ins|
in|i
)
1356 shift; set dummy
--mode install ${1+"$@"}; shift
1359 shift; set dummy
--mode link
${1+"$@"}; shift
1361 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u
)
1362 shift; set dummy
--mode uninstall
${1+"$@"}; shift
1366 # Parse non-mode specific arguments:
1367 while test "$#" -gt 0; do
1372 --config) func_config
;;
1374 --debug) preserve_args
="$preserve_args $opt"
1375 func_echo
"enabling shell trace mode"
1380 -dlopen) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1381 execute_dlfiles
="$execute_dlfiles $1"
1385 --dry-run |
-n) opt_dry_run
=: ;;
1386 --features) func_features
;;
1387 --finish) mode
="finish" ;;
1389 --mode) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1391 # Valid mode arguments:
1401 # Catch anything else as an error
1402 *) func_error
"invalid argument for $opt"
1412 --preserve-dup-deps)
1413 opt_duplicate_deps
=: ;;
1415 --quiet|
--silent) preserve_args
="$preserve_args $opt"
1420 --no-quiet|
--no-silent)
1421 preserve_args
="$preserve_args $opt"
1425 --verbose|
-v) preserve_args
="$preserve_args $opt"
1430 --no-verbose) preserve_args
="$preserve_args $opt"
1434 --tag) test "$#" -eq 0 && func_missing_arg
"$opt" && break
1435 preserve_args
="$preserve_args $opt $1"
1436 func_enable_tag
"$1" # tagname is set here
1440 # Separate optargs to long options:
1441 -dlopen=*|
--mode=*|
--tag=*)
1442 func_opt_split
"$opt"
1443 set dummy
"$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1447 -\?|
-h) func_usage
;;
1448 --help) opt_help
=: ;;
1449 --help-all) opt_help
=': help-all' ;;
1450 --version) func_version
;;
1452 -*) func_fatal_help
"unrecognized option \`$opt'" ;;
1462 *cygwin
* |
*mingw
* |
*pw32
* |
*cegcc
*)
1463 # don't eliminate duplications in $postdeps and $predeps
1464 opt_duplicate_compiler_generated_deps
=:
1467 opt_duplicate_compiler_generated_deps
=$opt_duplicate_deps
1471 # Having warned about all mis-specified options, bail out if
1472 # anything was wrong.
1473 $exit_cmd $EXIT_FAILURE
1476 # func_check_version_match
1477 # Ensure that we are using m4 macros, and libtool script from the same
1478 # release of libtool.
1479 func_check_version_match
()
1481 if test "$package_revision" != "$macro_revision"; then
1482 if test "$VERSION" != "$macro_version"; then
1483 if test -z "$macro_version"; then
1485 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1486 $progname: definition of this LT_INIT comes from an older release.
1487 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1488 $progname: and run autoconf again.
1492 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1493 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1494 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1495 $progname: and run autoconf again.
1500 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1501 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1502 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1503 $progname: of $PACKAGE $VERSION and run autoconf again.
1517 # Sanity checks first:
1518 func_check_version_match
1520 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1521 func_fatal_configuration
"not configured to build any kind of library"
1524 test -z "$mode" && func_fatal_error
"error: you must specify a MODE."
1528 eval std_shrext
=\"$shrext_cmds\"
1531 # Only execute mode is allowed to have -dlopen flags.
1532 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
1533 func_error
"unrecognized option \`-dlopen'"
1538 # Change the help message to a mode-specific one.
1539 generic_help
="$help"
1540 help="Try \`$progname --help --mode=$mode' for more information."
1545 # True iff FILE is a libtool `.la' library or `.lo' object file.
1546 # This function is only a basic sanity check; it will hardly flush out
1547 # determined imposters.
1551 $SED -e 4q
"$1" 2>/dev
/null \
1552 |
$GREP "^# Generated by .*$PACKAGE" > /dev
/null
2>&1
1555 # func_lalib_unsafe_p file
1556 # True iff FILE is a libtool `.la' library or `.lo' object file.
1557 # This function implements the same check as func_lalib_p without
1558 # resorting to external programs. To this end, it redirects stdin and
1559 # closes it afterwards, without saving the original file descriptor.
1560 # As a safety measure, use it only where a negative result would be
1561 # fatal anyway. Works if `file' does not exist.
1562 func_lalib_unsafe_p
()
1565 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1566 for lalib_p_l
in 1 2 3 4
1569 case "$lalib_p_line" in
1570 \
#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1575 test "$lalib_p" = yes
1578 # func_ltwrapper_script_p file
1579 # True iff FILE is a libtool wrapper script
1580 # This function is only a basic sanity check; it will hardly flush out
1581 # determined imposters.
1582 func_ltwrapper_script_p
()
1587 # func_ltwrapper_executable_p file
1588 # True iff FILE is a libtool wrapper executable
1589 # This function is only a basic sanity check; it will hardly flush out
1590 # determined imposters.
1591 func_ltwrapper_executable_p
()
1593 func_ltwrapper_exec_suffix
=
1596 *) func_ltwrapper_exec_suffix
=.exe
;;
1598 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev
/null
2>&1
1601 # func_ltwrapper_scriptname file
1602 # Assumes file is an ltwrapper_executable
1603 # uses $file to determine the appropriate filename for a
1604 # temporary ltwrapper_script.
1605 func_ltwrapper_scriptname
()
1607 func_ltwrapper_scriptname_result
=""
1608 if func_ltwrapper_executable_p
"$1"; then
1609 func_dirname_and_basename
"$1" "" "."
1610 func_stripname
'' '.exe' "$func_basename_result"
1611 func_ltwrapper_scriptname_result
="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1615 # func_ltwrapper_p file
1616 # True iff FILE is a libtool wrapper script or wrapper executable
1617 # This function is only a basic sanity check; it will hardly flush out
1618 # determined imposters.
1621 func_ltwrapper_script_p
"$1" || func_ltwrapper_executable_p
"$1"
1625 # func_execute_cmds commands fail_cmd
1626 # Execute tilde-delimited COMMANDS.
1627 # If FAIL_CMD is given, eval that upon failure.
1628 # FAIL_CMD may read-access the current command in variable CMD!
1629 func_execute_cmds
()
1632 save_ifs
=$IFS; IFS
='~'
1636 func_show_eval
"$cmd" "${2-:}"
1643 # Source FILE, adding directory component if necessary.
1644 # Note that it is not necessary on cygwin/mingw to append a dot to
1645 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1646 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1647 # `FILE.' does not work on cygwin managed mounts.
1652 */* |
*\\*) .
"$1" ;;
1658 # func_infer_tag arg
1659 # Infer tagged configuration to use if any are available and
1660 # if one wasn't chosen via the "--tag" command line option.
1661 # Only attempt this if the compiler in the base compile
1662 # command doesn't match the default compiler.
1663 # arg is usually of the form 'gcc ...'
1667 if test -n "$available_tags" && test -z "$tagname"; then
1670 func_quote_for_eval
"$arg"
1671 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1673 CC_expanded
=`func_echo_all $CC`
1674 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1676 # Blanks in the command may have been stripped by the calling shell,
1677 # but not from the CC environment variable when configure was run.
1678 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1679 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*) ;;
1680 # Blanks at the start of $base_compile will cause this to fail
1681 # if we don't check for them as well.
1683 for z
in $available_tags; do
1684 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
1685 # Evaluate the configuration.
1686 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1689 # Double-quote args containing other shell metacharacters.
1690 func_quote_for_eval
"$arg"
1691 CC_quoted
="$CC_quoted $func_quote_for_eval_result"
1693 CC_expanded
=`func_echo_all $CC`
1694 CC_quoted_expanded
=`func_echo_all $CC_quoted`
1696 " $CC "* |
"$CC "* |
" $CC_expanded "* |
"$CC_expanded "* | \
1697 " $CC_quoted"* |
"$CC_quoted "* |
" $CC_quoted_expanded "* |
"$CC_quoted_expanded "*)
1698 # The compiler in the base compile command matches
1699 # the one in the tagged configuration.
1700 # Assume this is the tagged configuration we want.
1707 # If $tagname still isn't set, then no tagged configuration
1708 # was found and let the user know that the "--tag" command
1709 # line option must be used.
1710 if test -z "$tagname"; then
1711 func_echo
"unable to infer tagged configuration"
1712 func_fatal_error
"specify a tag with \`--tag'"
1714 # func_verbose "using $tagname tagged configuration"
1723 # func_write_libtool_object output_name pic_name nonpic_name
1724 # Create a libtool object file (analogous to a ".la" file),
1725 # but don't create it if we're doing a dry run.
1726 func_write_libtool_object
()
1729 if test "$build_libtool_libs" = yes; then
1735 if test "$build_old_libs" = yes; then
1736 write_oldobj
=\'${3}\'
1742 cat >${write_libobj}T
<<EOF
1743 # $write_libobj - a libtool object file
1744 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1746 # Please DO NOT delete this file!
1747 # It is necessary for linking the library.
1749 # Name of the PIC object.
1750 pic_object=$write_lobj
1752 # Name of the non-PIC object
1753 non_pic_object=$write_oldobj
1756 $MV "${write_libobj}T" "${write_libobj}"
1760 # func_mode_compile arg...
1761 func_mode_compile
()
1764 # Get the compilation command and the source file.
1766 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
1778 # do not "continue". Instead, add this to base_compile
1790 # Accept any command-line options.
1793 test -n "$libobj" && \
1794 func_fatal_error
"you cannot specify \`-o' more than once"
1799 -pie |
-fpie |
-fPIE)
1800 pie_flag
="$pie_flag $arg"
1804 -shared |
-static |
-prefer-pic |
-prefer-non-pic)
1815 arg_mode
=arg
# the next one goes into the "base_compile" arg list
1816 continue # The current "srcfile" will either be retained or
1817 ;; # replaced later. I would guess that would be a bug.
1820 func_stripname
'-Wc,' '' "$arg"
1821 args
=$func_stripname_result
1823 save_ifs
="$IFS"; IFS
=','
1824 for arg
in $args; do
1826 func_quote_for_eval
"$arg"
1827 lastarg
="$lastarg $func_quote_for_eval_result"
1830 func_stripname
' ' '' "$lastarg"
1831 lastarg
=$func_stripname_result
1833 # Add the arguments to base_compile.
1834 base_compile
="$base_compile $lastarg"
1839 # Accept the current argument as the source file.
1840 # The previous "srcfile" becomes the current argument.
1847 esac # case $arg_mode
1849 # Aesthetically quote the previous argument.
1850 func_quote_for_eval
"$lastarg"
1851 base_compile
="$base_compile $func_quote_for_eval_result"
1856 func_fatal_error
"you must specify an argument for -Xcompile"
1859 func_fatal_error
"you must specify a target with \`-o'"
1862 # Get the name of the library object.
1863 test -z "$libobj" && {
1864 func_basename
"$srcfile"
1865 libobj
="$func_basename_result"
1870 # Recognize several different file suffixes.
1871 # If the user specifies -o file.o, it is replaced with file.lo
1874 *.ada |
*.adb |
*.ads |
*.asm | \
1875 *.c
++ |
*.cc |
*.ii |
*.class |
*.cpp |
*.cxx | \
1876 *.
[fF
][09]? |
*.
for |
*.java |
*.obj |
*.sx |
*.cu |
*.cup
)
1877 func_xform
"$libobj"
1878 libobj
=$func_xform_result
1883 *.lo
) func_lo2o
"$libobj"; obj
=$func_lo2o_result ;;
1885 func_fatal_error
"cannot determine name of library object from \`$libobj'"
1889 func_infer_tag
$base_compile
1891 for arg
in $later; do
1894 test "$build_libtool_libs" != yes && \
1895 func_fatal_configuration
"can not build a shared library"
1901 build_libtool_libs
=no
1918 func_quote_for_eval
"$libobj"
1919 test "X$libobj" != "X$func_quote_for_eval_result" \
1920 && $ECHO "X$libobj" |
$GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1921 && func_warning
"libobj name \`$libobj' may not contain shell special characters."
1922 func_dirname_and_basename
"$obj" "/" ""
1923 objname
="$func_basename_result"
1924 xdir
="$func_dirname_result"
1925 lobj
=${xdir}$objdir/$objname
1927 test -z "$base_compile" && \
1928 func_fatal_help
"you must specify a compilation command"
1930 # Delete any leftover library objects.
1931 if test "$build_old_libs" = yes; then
1932 removelist
="$obj $lobj $libobj ${libobj}T"
1934 removelist
="$lobj $libobj ${libobj}T"
1937 # On Cygwin there's no "real" PIC flag so we must build both object types
1939 cygwin
* | mingw
* | pw32
* | os2
* | cegcc
*)
1943 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
1944 # non-PIC code in shared libraries is not supported
1948 # Calculate the filename of the output object if compiler does
1949 # not support -o with -c
1950 if test "$compiler_c_o" = no
; then
1951 output_obj
=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.
${objext}
1952 lockfile
="$output_obj.lock"
1959 # Lock this critical section if it is needed
1960 # We use this script file to make the link, it avoids creating a new file
1961 if test "$need_locks" = yes; then
1962 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
1963 func_echo
"Waiting for $lockfile to be removed"
1966 elif test "$need_locks" = warn
; then
1967 if test -f "$lockfile"; then
1969 *** ERROR, $lockfile exists and contains:
1970 `cat $lockfile 2>/dev/null`
1972 This indicates that another process is trying to use the same
1973 temporary object file, and libtool could not work around it because
1974 your compiler does not support \`-c' and \`-o' together. If you
1975 repeat this compilation, it may succeed, by chance, but you had better
1976 avoid parallel builds (make -j) in this platform, or get a better
1979 $opt_dry_run ||
$RM $removelist
1982 removelist
="$removelist $output_obj"
1983 $ECHO "$srcfile" > "$lockfile"
1986 $opt_dry_run ||
$RM $removelist
1987 removelist
="$removelist $lockfile"
1988 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1990 if test -n "$fix_srcfile_path"; then
1991 eval srcfile
=\"$fix_srcfile_path\"
1993 func_quote_for_eval
"$srcfile"
1994 qsrcfile
=$func_quote_for_eval_result
1996 # Only build a PIC object if we are building libtool libraries.
1997 if test "$build_libtool_libs" = yes; then
1998 # Without this assignment, base_compile gets emptied.
1999 fbsd_hideous_sh_bug
=$base_compile
2001 if test "$pic_mode" != no
; then
2002 command="$base_compile $qsrcfile $pic_flag"
2004 # Don't build PIC code
2005 command="$base_compile $qsrcfile"
2008 func_mkdir_p
"$xdir$objdir"
2010 if test -z "$output_obj"; then
2011 # Place PIC objects in $objdir
2012 command="$command -o $lobj"
2015 func_show_eval_locale
"$command" \
2016 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2018 if test "$need_locks" = warn
&&
2019 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2021 *** ERROR, $lockfile contains:
2022 `cat $lockfile 2>/dev/null`
2024 but it should contain:
2027 This indicates that another process is trying to use the same
2028 temporary object file, and libtool could not work around it because
2029 your compiler does not support \`-c' and \`-o' together. If you
2030 repeat this compilation, it may succeed, by chance, but you had better
2031 avoid parallel builds (make -j) in this platform, or get a better
2034 $opt_dry_run ||
$RM $removelist
2038 # Just move the object if needed, then go on to compile the next one
2039 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2040 func_show_eval
'$MV "$output_obj" "$lobj"' \
2041 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2044 # Allow error messages only from the first compilation.
2045 if test "$suppress_opt" = yes; then
2046 suppress_output
=' >/dev/null 2>&1'
2050 # Only build a position-dependent object if we build old libraries.
2051 if test "$build_old_libs" = yes; then
2052 if test "$pic_mode" != yes; then
2053 # Don't build PIC code
2054 command="$base_compile $qsrcfile$pie_flag"
2056 command="$base_compile $qsrcfile $pic_flag"
2058 if test "$compiler_c_o" = yes; then
2059 command="$command -o $obj"
2062 # Suppress compiler output if we already did a PIC compilation.
2063 command="$command$suppress_output"
2064 func_show_eval_locale
"$command" \
2065 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2067 if test "$need_locks" = warn
&&
2068 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2070 *** ERROR, $lockfile contains:
2071 `cat $lockfile 2>/dev/null`
2073 but it should contain:
2076 This indicates that another process is trying to use the same
2077 temporary object file, and libtool could not work around it because
2078 your compiler does not support \`-c' and \`-o' together. If you
2079 repeat this compilation, it may succeed, by chance, but you had better
2080 avoid parallel builds (make -j) in this platform, or get a better
2083 $opt_dry_run ||
$RM $removelist
2087 # Just move the object if needed
2088 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2089 func_show_eval
'$MV "$output_obj" "$obj"' \
2090 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2095 func_write_libtool_object
"$libobj" "$objdir/$objname" "$objname"
2097 # Unlock the critical section if it was locked
2098 if test "$need_locks" != no
; then
2099 removelist
=$lockfile
2108 test "$mode" = compile
&& func_mode_compile
${1+"$@"}
2113 # We need to display help for each of the modes.
2116 # Generic help is extracted from the usage comments
2117 # at the start of this file.
2123 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2125 Remove files from the build directory.
2127 RM is the name of the program to use to delete files associated with each FILE
2128 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2131 If FILE is a libtool library, object or program, all the files associated
2132 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2137 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2139 Compile a source file into a libtool library object.
2141 This mode accepts the following additional options:
2143 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2144 -no-suppress do not suppress compiler output for multiple passes
2145 -prefer-pic try to build PIC objects only
2146 -prefer-non-pic try to build non-PIC objects only
2147 -shared do not build a \`.o' file suitable for static linking
2148 -static only build a \`.o' file suitable for static linking
2149 -Wc,FLAG pass FLAG directly to the compiler
2151 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2152 from the given SOURCEFILE.
2154 The output file name is determined by removing the directory component from
2155 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2156 library object suffix, \`.lo'."
2161 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2163 Automatically set library path, then run a program.
2165 This mode accepts the following additional options:
2167 -dlopen FILE add the directory containing FILE to the library path
2169 This mode sets the library path environment variable according to \`-dlopen'
2172 If any of the ARGS are libtool executable wrappers, then they are translated
2173 into their corresponding uninstalled binary, and any of their required library
2174 directories are added to the library path.
2176 Then, COMMAND is executed, with ARGS as arguments."
2181 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2183 Complete the installation of libtool libraries.
2185 Each LIBDIR is a directory that contains libtool libraries.
2187 The commands that this mode executes may require superuser privileges. Use
2188 the \`--dry-run' option if you just want to see what would be executed."
2193 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2195 Install executables or libraries.
2197 INSTALL-COMMAND is the installation command. The first component should be
2198 either the \`install' or \`cp' program.
2200 The following components of INSTALL-COMMAND are treated specially:
2202 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2204 The rest of the components are interpreted as arguments to that command (only
2205 BSD-compatible install options are recognized)."
2210 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2212 Link object files or libraries together to form another library, or to
2213 create an executable program.
2215 LINK-COMMAND is a command using the C compiler that you would use to create
2216 a program from several object files.
2218 The following components of LINK-COMMAND are treated specially:
2220 -all-static do not do any dynamic linking at all
2221 -avoid-version do not add a version suffix if possible
2222 -bindir BINDIR specify path to binaries directory (for systems where
2223 libraries must be found in the PATH setting at runtime)
2224 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2225 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2226 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2227 -export-symbols SYMFILE
2228 try to export only the symbols listed in SYMFILE
2229 -export-symbols-regex REGEX
2230 try to export only the symbols matching REGEX
2231 -LLIBDIR search LIBDIR for required installed libraries
2232 -lNAME OUTPUT-FILE requires the installed library libNAME
2233 -module build a library that can dlopened
2234 -no-fast-install disable the fast-install mode
2235 -no-install link a not-installable executable
2236 -no-undefined declare that a library does not refer to external symbols
2237 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2238 -objectlist FILE Use a list of object files found in FILE to specify objects
2239 -precious-files-regex REGEX
2240 don't remove output files matching REGEX
2241 -release RELEASE specify package release information
2242 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2243 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2244 -shared only do dynamic linking of libtool libraries
2245 -shrext SUFFIX override the standard shared library file extension
2246 -static do not do any dynamic linking of uninstalled libtool libraries
2247 -static-libtool-libs
2248 do not do any dynamic linking of libtool libraries
2249 -version-info CURRENT[:REVISION[:AGE]]
2250 specify library version info [each variable defaults to 0]
2251 -weak LIBNAME declare that the target provides the LIBNAME interface
2253 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2255 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2256 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2258 All other options (arguments beginning with \`-') are ignored.
2260 Every other argument is treated as a filename. Files ending in \`.la' are
2261 treated as uninstalled libtool libraries, other files are standard or library
2264 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2265 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2266 required, except when creating a convenience library.
2268 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2269 using \`ar' and \`ranlib', or on Windows using \`lib'.
2271 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2272 is created, otherwise an executable program is created."
2277 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2279 Remove libraries from an installation directory.
2281 RM is the name of the program to use to delete files associated with each FILE
2282 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2285 If FILE is a libtool library, all the files associated with it are deleted.
2286 Otherwise, only FILE itself is deleted using RM."
2290 func_fatal_help
"invalid operation mode \`$mode'"
2295 $ECHO "Try \`$progname --help' for more information about other modes."
2298 # Now that we've collected a possible --mode arg, show help if necessary
2300 if test "$opt_help" = :; then
2305 for mode
in compile link execute
install finish uninstall clean
; do
2308 } |
sed -n '1p; 2,$s/^Usage:/ or: /p'
2311 for mode
in compile link execute
install finish uninstall clean
; do
2317 /^When reporting/,/^Report/{
2322 /information about other modes/d
2323 /more detailed .*MODE/d
2324 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2330 # func_mode_execute arg...
2331 func_mode_execute
()
2334 # The first argument is the command name.
2337 func_fatal_help
"you must specify a COMMAND"
2339 # Handle -dlopen flags immediately.
2340 for file in $execute_dlfiles; do
2342 || func_fatal_help
"\`$file' is not a file"
2347 # Check to see that this really is a libtool archive.
2348 func_lalib_unsafe_p
"$file" \
2349 || func_fatal_help
"\`$lib' is not a valid libtool archive"
2351 # Read the libtool library.
2356 # Skip this library if it cannot be dlopened.
2357 if test -z "$dlname"; then
2358 # Warn if it was a shared library.
2359 test -n "$library_names" && \
2360 func_warning
"\`$file' was not linked with \`-export-dynamic'"
2364 func_dirname
"$file" "" "."
2365 dir
="$func_dirname_result"
2367 if test -f "$dir/$objdir/$dlname"; then
2370 if test ! -f "$dir/$dlname"; then
2371 func_fatal_error
"cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2377 # Just add the directory containing the .lo file.
2378 func_dirname
"$file" "" "."
2379 dir
="$func_dirname_result"
2383 func_warning
"\`-dlopen' is ignored for non-libtool libraries and objects"
2388 # Get the absolute pathname.
2389 absdir
=`cd "$dir" && pwd`
2390 test -n "$absdir" && dir
="$absdir"
2392 # Now add the directory to shlibpath_var.
2393 if eval "test -z \"\$$shlibpath_var\""; then
2394 eval "$shlibpath_var=\"\$dir\""
2396 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2400 # This variable tells wrapper scripts just to set shlibpath_var
2401 # rather than running their programs.
2402 libtool_execute_magic
="$magic"
2404 # Check if any of the arguments is a wrapper script.
2409 -* |
*.la |
*.lo
) ;;
2411 # Do a test to see if this is really a libtool program.
2412 if func_ltwrapper_script_p
"$file"; then
2414 # Transform arg to wrapped name.
2415 file="$progdir/$program"
2416 elif func_ltwrapper_executable_p
"$file"; then
2417 func_ltwrapper_scriptname
"$file"
2418 func_source
"$func_ltwrapper_scriptname_result"
2419 # Transform arg to wrapped name.
2420 file="$progdir/$program"
2424 # Quote arguments (to preserve shell metacharacters).
2425 func_quote_for_eval
"$file"
2426 args
="$args $func_quote_for_eval_result"
2429 if test "X$opt_dry_run" = Xfalse
; then
2430 if test -n "$shlibpath_var"; then
2431 # Export the shlibpath_var.
2432 eval "export $shlibpath_var"
2435 # Restore saved environment variables
2436 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2438 eval "if test \"\${save_$lt_var+set}\" = set; then
2439 $lt_var=\$save_$lt_var; export $lt_var
2445 # Now prepare to actually exec the command.
2446 exec_cmd
="\$cmd$args"
2448 # Display what would be done.
2449 if test -n "$shlibpath_var"; then
2450 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2451 echo "export $shlibpath_var"
2458 test "$mode" = execute
&& func_mode_execute
${1+"$@"}
2461 # func_mode_finish arg...
2468 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2471 libdirs
="$libdirs $dir"
2474 for libdir
in $libdirs; do
2475 if test -n "$finish_cmds"; then
2476 # Do each command in the finish commands.
2477 func_execute_cmds
"$finish_cmds" 'admincmds="$admincmds
2480 if test -n "$finish_eval"; then
2481 # Do the single finish_eval.
2482 eval cmds
=\"$finish_eval\"
2483 $opt_dry_run ||
eval "$cmds" || admincmds
="$admincmds
2489 # Exit here if they wanted silent mode.
2490 $opt_silent && exit $EXIT_SUCCESS
2492 echo "----------------------------------------------------------------------"
2493 echo "Libraries have been installed in:"
2494 for libdir
in $libdirs; do
2498 echo "If you ever happen to want to link against installed libraries"
2499 echo "in a given directory, LIBDIR, you must either use libtool, and"
2500 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2501 echo "flag during linking and do at least one of the following:"
2502 if test -n "$shlibpath_var"; then
2503 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2504 echo " during execution"
2506 if test -n "$runpath_var"; then
2507 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2508 echo " during linking"
2510 if test -n "$hardcode_libdir_flag_spec"; then
2512 eval flag
=\"$hardcode_libdir_flag_spec\"
2514 $ECHO " - use the \`$flag' linker flag"
2516 if test -n "$admincmds"; then
2517 $ECHO " - have your system administrator run these commands:$admincmds"
2519 if test -f /etc
/ld.so.conf
; then
2520 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2524 echo "See any operating system documentation about shared libraries for"
2526 solaris2.
[6789]|solaris2.1
[0-9])
2527 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2531 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2534 echo "----------------------------------------------------------------------"
2538 test "$mode" = finish
&& func_mode_finish
${1+"$@"}
2541 # func_mode_install arg...
2542 func_mode_install
()
2545 # There may be an optional sh(1) argument at the beginning of
2546 # install_prog (especially on Windows NT).
2547 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
2548 # Allow the use of GNU shtool's install command.
2549 case $nonopt in *shtool
*) :;; *) false
;; esac; then
2550 # Aesthetically quote it.
2551 func_quote_for_eval
"$nonopt"
2552 install_prog
="$func_quote_for_eval_result "
2560 # The real first argument should be the name of the installation program.
2561 # Aesthetically quote it.
2562 func_quote_for_eval
"$arg"
2563 install_prog
="$install_prog$func_quote_for_eval_result"
2564 install_shared_prog
=$install_prog
2565 case " $install_prog " in
2566 *[\\\
/]cp\
*) install_cp
=: ;;
2567 *) install_cp
=false
;;
2570 # We need to accept at least all the BSD install flags.
2582 if test -n "$dest"; then
2583 files
="$files $dest"
2591 if $install_cp; then :; else
2605 # If the previous option needed an argument, then skip it.
2606 if test -n "$prev"; then
2607 if test "x$prev" = x-m
&& test -n "$install_override_mode"; then
2608 arg2
=$install_override_mode
2619 # Aesthetically quote the argument.
2620 func_quote_for_eval
"$arg"
2621 install_prog
="$install_prog $func_quote_for_eval_result"
2622 if test -n "$arg2"; then
2623 func_quote_for_eval
"$arg2"
2625 install_shared_prog
="$install_shared_prog $func_quote_for_eval_result"
2628 test -z "$install_prog" && \
2629 func_fatal_help
"you must specify an install program"
2631 test -n "$prev" && \
2632 func_fatal_help
"the \`$prev' option requires an argument"
2634 if test -n "$install_override_mode" && $no_mode; then
2635 if $install_cp; then :; else
2636 func_quote_for_eval
"$install_override_mode"
2637 install_shared_prog
="$install_shared_prog -m $func_quote_for_eval_result"
2641 if test -z "$files"; then
2642 if test -z "$dest"; then
2643 func_fatal_help
"no file or destination specified"
2645 func_fatal_help
"you must specify a destination"
2649 # Strip any trailing slash from the destination.
2650 func_stripname
'' '/' "$dest"
2651 dest
=$func_stripname_result
2653 # Check to see that the destination is a directory.
2654 test -d "$dest" && isdir
=yes
2655 if test "$isdir" = yes; then
2659 func_dirname_and_basename
"$dest" "" "."
2660 destdir
="$func_dirname_result"
2661 destname
="$func_basename_result"
2663 # Not a directory, so check to see that there is only one file specified.
2664 set dummy
$files; shift
2665 test "$#" -gt 1 && \
2666 func_fatal_help
"\`$dest' is not a directory"
2669 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
2671 for file in $files; do
2675 func_fatal_help
"\`$destdir' must be an absolute directory name"
2682 # This variable tells wrapper scripts just to set variables rather
2683 # than running their programs.
2684 libtool_install_magic
="$magic"
2689 for file in $files; do
2691 # Do each installation.
2694 # Do the static libraries later.
2695 staticlibs
="$staticlibs $file"
2699 # Check to see that this really is a libtool archive.
2700 func_lalib_unsafe_p
"$file" \
2701 || func_fatal_help
"\`$file' is not a valid libtool archive"
2708 # Add the libdir to current_libdirs if it is the destination.
2709 if test "X$destdir" = "X$libdir"; then
2710 case "$current_libdirs " in
2712 *) current_libdirs
="$current_libdirs $libdir" ;;
2715 # Note the libdir as a future libdir.
2716 case "$future_libdirs " in
2718 *) future_libdirs
="$future_libdirs $libdir" ;;
2722 func_dirname
"$file" "/" ""
2723 dir
="$func_dirname_result"
2726 if test -n "$relink_command"; then
2727 # Determine the prefix the user has applied to our future dir.
2728 inst_prefix_dir
=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2730 # Don't allow the user to place us outside of our expected
2731 # location b/c this prevents finding dependent libraries that
2732 # are installed to the same prefix.
2733 # At present, this check doesn't affect windows .dll's that
2734 # are installed into $libdir/../bin (currently, that works fine)
2735 # but it's something to keep an eye on.
2736 test "$inst_prefix_dir" = "$destdir" && \
2737 func_fatal_error
"error: cannot install \`$file' to a directory not ending in $libdir"
2739 if test -n "$inst_prefix_dir"; then
2740 # Stick the inst_prefix_dir data into the link command.
2741 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2743 relink_command
=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2746 func_warning
"relinking \`$file'"
2747 func_show_eval
"$relink_command" \
2748 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2751 # See the names of the shared library.
2752 set dummy
$library_names; shift
2753 if test -n "$1"; then
2758 test -n "$relink_command" && srcname
="$realname"T
2760 # Install the shared library and build the symlinks.
2761 func_show_eval
"$install_shared_prog $dir/$srcname $destdir/$realname" \
2765 cygwin
* | mingw
* | pw32
* | cegcc
*)
2773 if test -n "$tstripme" && test -n "$striplib"; then
2774 func_show_eval
"$striplib $destdir/$realname" 'exit $?'
2777 if test "$#" -gt 0; then
2778 # Delete the old symlinks, and create new ones.
2779 # Try `ln -sf' first, because the `ln' binary might depend on
2780 # the symlink we replace! Solaris /bin/ln does not understand -f,
2781 # so we also need to try rm && ln -s.
2784 test "$linkname" != "$realname" \
2785 && func_show_eval
"(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2789 # Do each command in the postinstall commands.
2790 lib
="$destdir/$realname"
2791 func_execute_cmds
"$postinstall_cmds" 'exit $?'
2794 # Install the pseudo-library for information purposes.
2795 func_basename
"$file"
2796 name
="$func_basename_result"
2797 instname
="$dir/$name"i
2798 func_show_eval
"$install_prog $instname $destdir/$name" 'exit $?'
2800 # Maybe install the static library, too.
2801 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2805 # Install (i.e. copy) a libtool object.
2807 # Figure out destination file name, if it wasn't already specified.
2808 if test -n "$destname"; then
2809 destfile
="$destdir/$destname"
2811 func_basename
"$file"
2812 destfile
="$func_basename_result"
2813 destfile
="$destdir/$destfile"
2816 # Deduce the name of the destination old-style object file.
2819 func_lo2o
"$destfile"
2820 staticdest
=$func_lo2o_result
2823 staticdest
="$destfile"
2827 func_fatal_help
"cannot copy a libtool object to \`$destfile'"
2831 # Install the libtool object if requested.
2832 test -n "$destfile" && \
2833 func_show_eval
"$install_prog $file $destfile" 'exit $?'
2835 # Install the old object if enabled.
2836 if test "$build_old_libs" = yes; then
2837 # Deduce the name of the old-style object file.
2839 staticobj
=$func_lo2o_result
2840 func_show_eval
"$install_prog \$staticobj \$staticdest" 'exit $?'
2846 # Figure out destination file name, if it wasn't already specified.
2847 if test -n "$destname"; then
2848 destfile
="$destdir/$destname"
2850 func_basename
"$file"
2851 destfile
="$func_basename_result"
2852 destfile
="$destdir/$destfile"
2855 # If the file is missing, and there is a .exe on the end, strip it
2856 # because it is most likely a libtool script we actually want to
2861 if test ! -f "$file"; then
2862 func_stripname
'' '.exe' "$file"
2863 file=$func_stripname_result
2869 # Do a test to see if this is really a libtool program.
2872 if func_ltwrapper_executable_p
"$file"; then
2873 func_ltwrapper_scriptname
"$file"
2874 wrapper
=$func_ltwrapper_scriptname_result
2876 func_stripname
'' '.exe' "$file"
2877 wrapper
=$func_stripname_result
2884 if func_ltwrapper_script_p
"$wrapper"; then
2888 func_source
"$wrapper"
2890 # Check the variables that should have been set.
2891 test -z "$generated_by_libtool_version" && \
2892 func_fatal_error
"invalid libtool wrapper script \`$wrapper'"
2895 for lib
in $notinst_deplibs; do
2896 # Check to see that each library is installed.
2898 if test -f "$lib"; then
2901 libfile
="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2902 if test -n "$libdir" && test ! -f "$libfile"; then
2903 func_warning
"\`$lib' has not been installed in \`$libdir'"
2909 func_source
"$wrapper"
2912 if test "$fast_install" = no
&& test -n "$relink_command"; then
2914 if test "$finalize" = yes; then
2915 tmpdir
=`func_mktempdir`
2916 func_basename
"$file$stripped_ext"
2917 file="$func_basename_result"
2918 outputname
="$tmpdir/$file"
2919 # Replace the output file specification.
2920 relink_command
=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2923 func_quote_for_expand
"$relink_command"
2924 eval "func_echo $func_quote_for_expand_result"
2926 if eval "$relink_command"; then :
2928 func_error
"error: relink \`$file' with the above command before installing it"
2929 $opt_dry_run ||
${RM}r
"$tmpdir"
2934 func_warning
"cannot relink \`$file'"
2938 # Install the binary that we compiled earlier.
2939 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2943 # remove .exe since cygwin /usr/bin/install will append another
2945 case $install_prog,$host in
2946 */usr
/bin
/install*,*cygwin
*)
2947 case $file:$destfile in
2952 destfile
=$destfile.exe
2955 func_stripname
'' '.exe' "$destfile"
2956 destfile
=$func_stripname_result
2961 func_show_eval
"$install_prog\$stripme \$file \$destfile" 'exit $?'
2962 $opt_dry_run ||
if test -n "$outputname"; then
2969 for file in $staticlibs; do
2970 func_basename
"$file"
2971 name
="$func_basename_result"
2973 # Set up the ranlib parameters.
2974 oldlib
="$destdir/$name"
2976 func_show_eval
"$install_prog \$file \$oldlib" 'exit $?'
2978 if test -n "$stripme" && test -n "$old_striplib"; then
2979 func_show_eval
"$old_striplib $oldlib" 'exit $?'
2982 # Do each command in the postinstall commands.
2983 func_execute_cmds
"$old_postinstall_cmds" 'exit $?'
2986 test -n "$future_libdirs" && \
2987 func_warning
"remember to run \`$progname --finish$future_libdirs'"
2989 if test -n "$current_libdirs"; then
2990 # Maybe just do a dry run.
2991 $opt_dry_run && current_libdirs
=" -n$current_libdirs"
2992 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
2998 test "$mode" = install && func_mode_install
${1+"$@"}
3001 # func_generate_dlsyms outputname originator pic_p
3002 # Extract symbols from dlprefiles and create ${outputname}S.o with
3003 # a dlpreopen symbol table.
3004 func_generate_dlsyms
()
3010 my_prefix
=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3013 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3014 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3015 my_dlsyms
="${my_outputname}S.c"
3017 func_error
"not configured to extract global symbols from dlpreopened files"
3021 if test -n "$my_dlsyms"; then
3025 # Discover the nlist of each of the dlfiles.
3026 nlist
="$output_objdir/${my_outputname}.nm"
3028 func_show_eval
"$RM $nlist ${nlist}S ${nlist}T"
3030 # Parse the name list into a source file.
3031 func_verbose
"creating $output_objdir/$my_dlsyms"
3033 $opt_dry_run ||
$ECHO > "$output_objdir/$my_dlsyms" "\
3034 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3035 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3041 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3042 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3045 /* External symbol declarations for the compiler. */\
3048 if test "$dlself" = yes; then
3049 func_verbose
"generating symbol list for \`$output'"
3051 $opt_dry_run ||
echo ': @PROGRAM@ ' > "$nlist"
3053 # Add our own program objects to the symbol list.
3054 progfiles
=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3055 for progfile
in $progfiles; do
3056 func_verbose
"extracting global C symbols from \`$progfile'"
3057 $opt_dry_run ||
eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
3060 if test -n "$exclude_expsyms"; then
3062 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3063 eval '$MV "$nlist"T "$nlist"'
3067 if test -n "$export_symbols_regex"; then
3069 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3070 eval '$MV "$nlist"T "$nlist"'
3074 # Prepare the list of exported symbols
3075 if test -z "$export_symbols"; then
3076 export_symbols
="$output_objdir/$outputname.exp"
3079 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3081 *cygwin
* |
*mingw
* |
*cegcc
* )
3082 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3083 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3089 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3090 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3091 eval '$MV "$nlist"T "$nlist"'
3093 *cygwin
* |
*mingw
* |
*cegcc
* )
3094 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3095 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3102 for dlprefile
in $dlprefiles; do
3103 func_verbose
"extracting global C symbols from \`$dlprefile'"
3104 func_basename
"$dlprefile"
3105 name
="$func_basename_result"
3107 eval '$ECHO ": $name " >> "$nlist"'
3108 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3113 # Make sure we have at least an empty file.
3114 test -f "$nlist" ||
: > "$nlist"
3116 if test -n "$exclude_expsyms"; then
3117 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3118 $MV "$nlist"T
"$nlist"
3121 # Try sorting and uniquifying the output.
3122 if $GREP -v "^: " < "$nlist" |
3123 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
3128 uniq > "$nlist"S
; then
3131 $GREP -v "^: " < "$nlist" > "$nlist"S
3134 if test -f "$nlist"S
; then
3135 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3137 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3140 echo >> "$output_objdir/$my_dlsyms" "\
3142 /* The mapping between symbol names and symbols. */
3149 *cygwin
* |
*mingw
* |
*cegcc
* )
3150 echo >> "$output_objdir/$my_dlsyms" "\
3151 /* DATA imports from DLLs on WIN32 con't be const, because
3152 runtime relocations are performed -- see ld's documentation
3153 on pseudo-relocs. */"
3156 echo >> "$output_objdir/$my_dlsyms" "\
3157 /* This system does not cope well with relocations in const data */"
3160 lt_dlsym_const
=const
;;
3163 echo >> "$output_objdir/$my_dlsyms" "\
3164 extern $lt_dlsym_const lt_dlsymlist
3165 lt_${my_prefix}_LTX_preloaded_symbols[];
3166 $lt_dlsym_const lt_dlsymlist
3167 lt_${my_prefix}_LTX_preloaded_symbols[] =
3169 { \"$my_originator\", (void *) 0 },"
3171 case $need_lib_prefix in
3173 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3176 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3179 echo >> "$output_objdir/$my_dlsyms" "\
3183 /* This works around a problem in FreeBSD linker */
3184 #ifdef FREEBSD_WORKAROUND
3185 static const void *lt_preloaded_setup() {
3186 return lt_${my_prefix}_LTX_preloaded_symbols;
3196 pic_flag_for_symtable
=
3197 case "$compile_command " in
3201 # compiling the symbol table file with pic_flag works around
3202 # a FreeBSD bug that causes programs to crash when -lm is
3203 # linked before any other PIC object. But we must not use
3204 # pic_flag when linking with -static. The problem exists in
3205 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3206 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
3207 pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3209 pic_flag_for_symtable
=" $pic_flag" ;;
3211 if test "X$my_pic_p" != Xno
; then
3212 pic_flag_for_symtable
=" $pic_flag"
3219 for arg
in $LTCFLAGS; do
3221 -pie |
-fpie |
-fPIE) ;;
3222 *) symtab_cflags
="$symtab_cflags $arg" ;;
3226 # Now compile the dynamic symbol file.
3227 func_show_eval
'(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3229 # Clean up the generated files.
3230 func_show_eval
'$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3232 # Transform the symbol file into the correct name.
3233 symfileobj
="$output_objdir/${my_outputname}S.$objext"
3235 *cygwin
* |
*mingw
* |
*cegcc
* )
3236 if test -f "$output_objdir/$my_outputname.def"; then
3237 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3238 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3240 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3241 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3245 compile_command
=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3246 finalize_command
=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3251 func_fatal_error
"unknown suffix for \`$my_dlsyms'"
3255 # We keep going just in case the user didn't refer to
3256 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3257 # really was required.
3259 # Nullify the symbol file.
3260 compile_command
=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3261 finalize_command
=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3265 # func_win32_libid arg
3266 # return the library type of file 'arg'
3268 # Need a lot of goo to handle *both* DLLs and import libs
3269 # Has to be a shell function in order to 'eat' the argument
3270 # that is supplied when $file_magic_command is called.
3271 # Despite the name, also deal with 64 bit binaries.
3275 win32_libid_type
="unknown"
3276 win32_fileres
=`file -L $1 2>/dev/null`
3277 case $win32_fileres in
3278 *ar\ archive\ import\ library
*) # definitely import
3279 win32_libid_type
="x86 archive import"
3281 *ar\ archive
*) # could be an import, or static
3282 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3283 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null |
3284 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev
/null
; then
3285 win32_nmres
=`eval $NM -f posix -A $1 |
3294 case $win32_nmres in
3295 import
*) win32_libid_type
="x86 archive import";;
3296 *) win32_libid_type
="x86 archive static";;
3301 win32_libid_type
="x86 DLL"
3303 *executable
*) # but shell scripts are "executable" too...
3304 case $win32_fileres in
3305 *MS\ Windows\ PE\ Intel
*)
3306 win32_libid_type
="x86 DLL"
3311 $ECHO "$win32_libid_type"
3316 # func_extract_an_archive dir oldlib
3317 func_extract_an_archive
()
3320 f_ex_an_ar_dir
="$1"; shift
3321 f_ex_an_ar_oldlib
="$1"
3322 if test "$lock_old_archive_extraction" = yes; then
3323 lockfile
=$f_ex_an_ar_oldlib.lock
3324 until $opt_dry_run ||
ln "$progpath" "$lockfile" 2>/dev
/null
; do
3325 func_echo
"Waiting for $lockfile to be removed"
3329 func_show_eval
"(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3330 'stat=$?; rm -f "$lockfile"; exit $stat'
3331 if test "$lock_old_archive_extraction" = yes; then
3332 $opt_dry_run ||
rm -f "$lockfile"
3334 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
3337 func_fatal_error
"object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3342 # func_extract_archives gentop oldlib ...
3343 func_extract_archives
()
3346 my_gentop
="$1"; shift
3347 my_oldlibs
=${1+"$@"}
3353 for my_xlib
in $my_oldlibs; do
3354 # Extract the objects.
3356 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
3357 *) my_xabs
=`pwd`"/$my_xlib" ;;
3359 func_basename
"$my_xlib"
3360 my_xlib
="$func_basename_result"
3363 case " $extracted_archives " in
3365 func_arith
$extracted_serial + 1
3366 extracted_serial
=$func_arith_result
3367 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
3371 extracted_archives
="$extracted_archives $my_xlib_u"
3372 my_xdir
="$my_gentop/$my_xlib_u"
3374 func_mkdir_p
"$my_xdir"
3378 func_verbose
"Extracting $my_xabs"
3379 # Do not bother doing anything if just a dry run
3381 darwin_orig_dir
=`pwd`
3382 cd $my_xdir ||
exit $?
3383 darwin_archive
=$my_xabs
3385 darwin_base_archive
=`basename "$darwin_archive"`
3386 darwin_arches
=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3387 if test -n "$darwin_arches"; then
3388 darwin_arches
=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3390 func_verbose
"$darwin_base_archive has multiple architectures $darwin_arches"
3391 for darwin_arch
in $darwin_arches ; do
3392 func_mkdir_p
"unfat-$$/${darwin_base_archive}-${darwin_arch}"
3393 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3394 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3395 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
3397 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3398 done # $darwin_arches
3399 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3400 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3403 for darwin_file
in $darwin_filelist; do
3404 darwin_files
=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3405 $LIPO -create -output "$darwin_file" $darwin_files
3406 done # $darwin_filelist
3408 cd "$darwin_orig_dir"
3411 func_extract_an_archive
"$my_xdir" "$my_xabs"
3416 func_extract_an_archive
"$my_xdir" "$my_xabs"
3419 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3422 func_extract_archives_result
="$my_oldobjs"
3426 # func_emit_wrapper [arg=no]
3428 # Emit a libtool wrapper script on stdout.
3429 # Don't directly open a file because we may want to
3430 # incorporate the script contents within a cygwin/mingw
3431 # wrapper executable. Must ONLY be called from within
3432 # func_mode_link because it depends on a number of variables
3435 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3436 # variable will take. If 'yes', then the emitted script
3437 # will assume that the directory in which it is stored is
3438 # the $objdir directory. This is a cygwin/mingw-specific
3440 func_emit_wrapper
()
3442 func_emit_wrapper_arg1
=${1-no}
3447 # $output - temporary wrapper script for $objdir/$outputname
3448 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3450 # The $output program cannot be directly executed until all the libtool
3451 # libraries that it depends on are installed.
3453 # This wrapper script should never be moved out of the build directory.
3454 # If it is, it will not operate correctly.
3456 # Sed substitution that helps us do robust quoting. It backslashifies
3457 # metacharacters that are still active within double-quoted strings.
3458 sed_quote_subst='$sed_quote_subst'
3460 # Be Bourne compatible
3461 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3464 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3465 # is contrary to our usage. Disable this feature.
3466 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3467 setopt NO_GLOB_SUBST
3469 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3471 BIN_SH=xpg4; export BIN_SH # for Tru64
3472 DUALCASE=1; export DUALCASE # for MKS sh
3474 # The HP-UX ksh and POSIX shell print the target directory to stdout
3476 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3478 relink_command=\"$relink_command\"
3480 # This environment variable determines our operation mode.
3481 if test \"\$libtool_install_magic\" = \"$magic\"; then
3482 # install mode needs the following variables:
3483 generated_by_libtool_version='$macro_version'
3484 notinst_deplibs='$notinst_deplibs'
3486 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3487 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3490 qECHO
=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3493 # A function that is used when there is no print builtin or printf.
3494 func_fallback_echo ()
3496 eval 'cat <<_LTECHO_EOF
3503 # Very basic option parsing. These options are (a) specific to
3504 # the libtool wrapper, (b) are identical between the wrapper
3505 # /script/ and the wrapper /executable/ which is used only on
3506 # windows platforms, and (c) all begin with the string "--lt-"
3507 # (application programs are unlikely to have options which match
3510 # There are only two supported options: --lt-debug and
3511 # --lt-dump-script. There is, deliberately, no --lt-help.
3513 # The first argument to this parsing function should be the
3514 # script's $0 value, followed by "$@
".
3516 func_parse_lt_options ()
3522 case \"\$lt_opt\" in
3523 --lt-debug) lt_option_debug=1 ;;
3525 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3526 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3527 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3528 cat \"\$lt_dump_D/\$lt_dump_F\"
3532 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3538 # Print the debug banner immediately:
3539 if test -n \"\$lt_option_debug\"; then
3540 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3544 # Used when --lt-debug. Prints its arguments to stdout
3545 # (redirection is the responsibility of the caller)
3546 func_lt_dump_args ()
3551 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3552 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3556 # Core function for launching the target application
3557 func_exec_program_core ()
3561 # Backslashes separate directories on plain windows
3562 *-*-mingw |
*-*-os2* |
*-cegcc*)
3564 if test -n \"\$lt_option_debug\"; then
3565 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3566 func_lt_dump_args \${1+\"\$@\"} 1>&2
3568 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3574 if test -n \"\$lt_option_debug\"; then
3575 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3576 func_lt_dump_args \${1+\"\$@\"} 1>&2
3578 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3583 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3587 # A function to encapsulate launching the target application
3588 # Strips options in the --lt-* namespace from \$@ and
3589 # launches target application with the remaining arguments.
3590 func_exec_program ()
3596 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
3600 func_exec_program_core \${1+\"\$@\"}
3604 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
3606 # Find the directory that this script lives in.
3607 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
3608 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3610 # Follow symbolic links until we get to the real thisdir.
3611 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
3612 while test -n \"\$file\"; do
3613 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
3615 # If there was a directory component, then change thisdir.
3616 if test \"x\$destdir\" != \"x\$file\"; then
3617 case \"\$destdir\" in
3618 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3619 *) thisdir=\"\$thisdir/\$destdir\" ;;
3623 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
3624 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
3627 # Usually 'no', except on cygwin/mingw when embedded into
3629 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
3630 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3631 # special case for '.'
3632 if test \"\$thisdir\" = \".\"; then
3635 # remove .libs from thisdir
3636 case \"\$thisdir\" in
3637 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
3638 $objdir ) thisdir=. ;;
3642 # Try to get the absolute directory name.
3643 absdir=\`cd \"\$thisdir\" && pwd\`
3644 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3647 if test "$fast_install" = yes; then
3649 program=lt-'$outputname'$exeext
3650 progdir=\"\$thisdir/$objdir\"
3652 if test ! -f \"\$progdir/\$program\" ||
3653 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3654 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3656 file=\"\$\$-\$program\"
3658 if test ! -d \"\$progdir\"; then
3659 $MKDIR \"\$progdir\"
3661 $RM \"\$progdir/\$file\"
3666 # relink executable if necessary
3667 if test -n \"\$relink_command\"; then
3668 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3670 $ECHO \"\$relink_command_output\" >&2
3671 $RM \"\$progdir/\$file\"
3676 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3677 { $RM \"\$progdir/\$program\";
3678 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3679 $RM \"\$progdir/\$file\"
3683 program='$outputname'
3684 progdir=\"\$thisdir/$objdir\"
3690 if test -f \"\$progdir/\$program\"; then"
3692 # Export our shlibpath_var if we have one.
3693 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3695 # Add our own library path to $shlibpath_var
3696 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3698 # Some systems cannot cope with colon-terminated $shlibpath_var
3699 # The second colon is a workaround for a bug in BeOS R4 sed
3700 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
3702 export $shlibpath_var
3706 # fixup the dll searchpath if we need to.
3707 if test -n "$dllsearchpath"; then
3709 # Add the dll search path components to the executable PATH
3710 PATH=$dllsearchpath:\$PATH
3715 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3716 # Run the actual program with our arguments.
3717 func_exec_program \${1+\"\$@\"}
3720 # The program doesn't exist.
3721 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3722 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3723 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3731 # func_to_host_path arg
3733 # Convert paths to host format when used with build tools.
3734 # Intended for use with "native" mingw (where libtool itself
3735 # is running under the msys shell), or in the following cross-
3736 # build environments:
3738 # mingw (msys) mingw [e.g. native]
3741 # where wine is equipped with the `winepath' executable.
3742 # In the native mingw case, the (msys) shell automatically
3743 # converts paths for any non-msys applications it launches,
3744 # but that facility isn't available from inside the cwrapper.
3745 # Similar accommodations are necessary for $host mingw and
3746 # $build cygwin. Calling this function does no harm for other
3747 # $host/$build combinations not listed above.
3749 # ARG is the path (on $build) that should be converted to
3750 # the proper representation for $host. The result is stored
3751 # in $func_to_host_path_result.
3752 func_to_host_path
()
3754 func_to_host_path_result
="$1"
3755 if test -n "$1"; then
3758 lt_sed_naive_backslashify
='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3760 *mingw
* ) # actually, msys
3761 # awkward: cmd appends spaces to result
3762 func_to_host_path_result
=`( cmd //c echo "$1" ) 2>/dev/null |
3763 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3766 func_to_host_path_result
=`cygpath -w "$1" |
3767 $SED -e "$lt_sed_naive_backslashify"`
3770 # Unfortunately, winepath does not exit with a non-zero
3771 # error code, so we are forced to check the contents of
3772 # stdout. On the other hand, if the command is not
3773 # found, the shell will set an exit code of 127 and print
3774 # *an error message* to stdout. So we must check for both
3775 # error code of zero AND non-empty stdout, which explains
3776 # the odd construction:
3777 func_to_host_path_tmp1
=`winepath -w "$1" 2>/dev/null`
3778 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3779 func_to_host_path_result
=`$ECHO "$func_to_host_path_tmp1" |
3780 $SED -e "$lt_sed_naive_backslashify"`
3782 # Allow warning below.
3783 func_to_host_path_result
=
3787 if test -z "$func_to_host_path_result" ; then
3788 func_error
"Could not determine host path corresponding to"
3790 func_error
"Continuing, but uninstalled executables may not work."
3792 func_to_host_path_result
="$1"
3798 # end: func_to_host_path
3800 # func_to_host_pathlist arg
3802 # Convert pathlists to host format when used with build tools.
3803 # See func_to_host_path(), above. This function supports the
3804 # following $build/$host combinations (but does no harm for
3805 # combinations not listed here):
3807 # mingw (msys) mingw [e.g. native]
3811 # Path separators are also converted from $build format to
3812 # $host format. If ARG begins or ends with a path separator
3813 # character, it is preserved (but converted to $host format)
3816 # ARG is a pathlist (on $build) that should be converted to
3817 # the proper representation on $host. The result is stored
3818 # in $func_to_host_pathlist_result.
3819 func_to_host_pathlist
()
3821 func_to_host_pathlist_result
="$1"
3822 if test -n "$1"; then
3825 lt_sed_naive_backslashify
='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3826 # Remove leading and trailing path separator characters from
3827 # ARG. msys behavior is inconsistent here, cygpath turns them
3828 # into '.;' and ';.', and winepath ignores them completely.
3829 func_stripname
: : "$1"
3830 func_to_host_pathlist_tmp1
=$func_stripname_result
3832 *mingw
* ) # Actually, msys.
3833 # Awkward: cmd appends spaces to result.
3834 func_to_host_pathlist_result
=`
3835 ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3836 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3839 func_to_host_pathlist_result
=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3840 $SED -e "$lt_sed_naive_backslashify"`
3843 # unfortunately, winepath doesn't convert pathlists
3844 func_to_host_pathlist_result
=""
3845 func_to_host_pathlist_oldIFS
=$IFS
3847 for func_to_host_pathlist_f
in $func_to_host_pathlist_tmp1 ; do
3848 IFS
=$func_to_host_pathlist_oldIFS
3849 if test -n "$func_to_host_pathlist_f" ; then
3850 func_to_host_path
"$func_to_host_pathlist_f"
3851 if test -n "$func_to_host_path_result" ; then
3852 if test -z "$func_to_host_pathlist_result" ; then
3853 func_to_host_pathlist_result
="$func_to_host_path_result"
3855 func_append func_to_host_pathlist_result
";$func_to_host_path_result"
3860 IFS
=$func_to_host_pathlist_oldIFS
3863 if test -z "$func_to_host_pathlist_result"; then
3864 func_error
"Could not determine the host path(s) corresponding to"
3866 func_error
"Continuing, but uninstalled executables may not work."
3867 # Fallback. This may break if $1 contains DOS-style drive
3868 # specifications. The fix is not to complicate the expression
3869 # below, but for the user to provide a working wine installation
3870 # with winepath so that path translation in the cross-to-mingw
3871 # case works properly.
3872 lt_replace_pathsep_nix_to_dos
="s|:|;|g"
3873 func_to_host_pathlist_result
=`echo "$func_to_host_pathlist_tmp1" |\
3874 $SED -e "$lt_replace_pathsep_nix_to_dos"`
3876 # Now, add the leading and trailing path separators back
3878 :* ) func_to_host_pathlist_result
=";$func_to_host_pathlist_result"
3882 *: ) func_append func_to_host_pathlist_result
";"
3889 # end: func_to_host_pathlist
3891 # func_emit_cwrapperexe_src
3892 # emit the source code for a wrapper executable on stdout
3893 # Must ONLY be called from within func_mode_link because
3894 # it depends on a number of variable set therein.
3895 func_emit_cwrapperexe_src
()
3899 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3900 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3902 The $output program cannot be directly executed until all the libtool
3903 libraries that it depends on are installed.
3905 This wrapper executable should never be moved out of the build directory.
3906 If it is, it will not operate correctly.
3911 # define _CRT_SECURE_NO_DEPRECATE 1
3916 # include <direct.h>
3917 # include <process.h>
3920 # include <unistd.h>
3921 # include <stdint.h>
3933 #include <sys/stat.h>
3935 /* declarations of non-ANSI functions */
3936 #if defined(__MINGW32__)
3937 # ifdef __STRICT_ANSI__
3938 int _putenv (const char *);
3940 #elif defined(__CYGWIN__)
3941 # ifdef __STRICT_ANSI__
3942 char *realpath (const char *, char *);
3943 int putenv (char *);
3944 int setenv (const char *, const char *, int);
3946 /* #elif defined (other platforms) ... */
3949 /* portability defines, excluding path handling macros */
3950 #if defined(_MSC_VER)
3951 # define setmode _setmode
3953 # define chmod _chmod
3954 # define getcwd _getcwd
3955 # define putenv _putenv
3956 # define S_IXUSR _S_IEXEC
3957 # ifndef _INTPTR_T_DEFINED
3958 # define _INTPTR_T_DEFINED
3959 # define intptr_t int
3961 #elif defined(__MINGW32__)
3962 # define setmode _setmode
3964 # define chmod _chmod
3965 # define getcwd _getcwd
3966 # define putenv _putenv
3967 #elif defined(__CYGWIN__)
3968 # define HAVE_SETENV
3969 # define FOPEN_WB "wb"
3970 /* #elif defined (other platforms) ... */
3973 #if defined(PATH_MAX)
3974 # define LT_PATHMAX PATH_MAX
3975 #elif defined(MAXPATHLEN)
3976 # define LT_PATHMAX MAXPATHLEN
3978 # define LT_PATHMAX 1024
3988 /* path handling portability macros */
3989 #ifndef DIR_SEPARATOR
3990 # define DIR_SEPARATOR '/'
3991 # define PATH_SEPARATOR ':'
3994 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3996 # define HAVE_DOS_BASED_FILE_SYSTEM
3997 # define FOPEN_WB "wb"
3998 # ifndef DIR_SEPARATOR_2
3999 # define DIR_SEPARATOR_2 '\\'
4001 # ifndef PATH_SEPARATOR_2
4002 # define PATH_SEPARATOR_2 ';'
4006 #ifndef DIR_SEPARATOR_2
4007 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4008 #else /* DIR_SEPARATOR_2 */
4009 # define IS_DIR_SEPARATOR(ch) \
4010 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4011 #endif /* DIR_SEPARATOR_2 */
4013 #ifndef PATH_SEPARATOR_2
4014 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4015 #else /* PATH_SEPARATOR_2 */
4016 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4017 #endif /* PATH_SEPARATOR_2 */
4020 # define FOPEN_WB "w"
4023 # define _O_BINARY 0
4026 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4027 #define XFREE(stale) do { \
4028 if (stale) { free ((void *) stale); stale = 0; } \
4031 #if defined(LT_DEBUGWRAPPER)
4032 static int lt_debug = 1;
4034 static int lt_debug = 0;
4037 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4039 void *xmalloc (size_t num);
4040 char *xstrdup (const char *string);
4041 const char *base_name (const char *name);
4042 char *find_executable (const char *wrapper);
4043 char *chase_symlinks (const char *pathspec);
4044 int make_executable (const char *path);
4045 int check_executable (const char *path);
4046 char *strendzap (char *str, const char *pat);
4047 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4048 void lt_fatal (const char *file, int line, const char *message, ...);
4049 static const char *nonnull (const char *s);
4050 static const char *nonempty (const char *s);
4051 void lt_setenv (const char *name, const char *value);
4052 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4053 void lt_update_exe_path (const char *name, const char *value);
4054 void lt_update_lib_path (const char *name, const char *value);
4055 char **prepare_spawn (char **argv);
4056 void lt_dump_script (FILE *f);
4060 const char * MAGIC_EXE = "$magic_exe";
4061 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4064 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4065 func_to_host_pathlist "$temp_rpath"
4067 const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
4071 const char
* LIB_PATH_VALUE
= "";
4075 if test -n "$dllsearchpath"; then
4076 func_to_host_pathlist
"$dllsearchpath:"
4078 const char * EXE_PATH_VARNAME = "PATH";
4079 const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
4083 const char * EXE_PATH_VARNAME = "";
4084 const char * EXE_PATH_VALUE = "";
4088 if test "$fast_install" = yes; then
4090 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4094 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4101 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4103 static const char
*ltwrapper_option_prefix
= LTWRAPPER_OPTION_PREFIX
;
4104 static const char
*dumpscript_opt
= LTWRAPPER_OPTION_PREFIX
"dump-script";
4105 static const char
*debug_opt
= LTWRAPPER_OPTION_PREFIX
"debug";
4108 main
(int argc
, char
*argv
[])
4113 char
*actual_cwrapper_path
;
4114 char
*actual_cwrapper_name
;
4117 intptr_t rval
= 127;
4121 program_name
= (char
*) xstrdup
(base_name
(argv
[0]));
4122 newargz
= XMALLOC
(char
*, argc
+ 1);
4124 /* very simple arg parsing
; don
't want to rely on getopt
4125 * also, copy all non cwrapper options to newargz, except
4126 * argz[0], which is handled differently
4129 for (i = 1; i < argc; i++)
4131 if (strcmp (argv[i], dumpscript_opt) == 0)
4135 *mingw* | *cygwin* )
4136 # make stdout use "unix" line endings
4137 echo " setmode(1,_O_BINARY);"
4142 lt_dump_script (stdout);
4145 if (strcmp (argv[i], debug_opt) == 0)
4150 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4152 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4153 namespace, but it is not one of the ones we know about and
4154 have already dealt with, above (inluding dump-script), then
4155 report an error. Otherwise, targets might begin to believe
4156 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4157 namespace. The first time any user complains about this, we'll
4158 need to
make LTWRAPPER_OPTION_PREFIX a configure-time option
4159 or a configure.ac-settable value.
4161 lt_fatal
(__FILE__
, __LINE__
,
4162 "unrecognized %s option: '%s'",
4163 ltwrapper_option_prefix
, argv
[i
]);
4166 newargz
[++newargc
] = xstrdup
(argv
[i
]);
4168 newargz
[++newargc
] = NULL
;
4172 /* The GNU banner must be the first non-error debug message */
4173 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4176 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4177 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4179 tmp_pathspec = find_executable (argv[0]);
4180 if (tmp_pathspec == NULL)
4181 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4182 lt_debugprintf (__FILE__, __LINE__,
4183 "(main) found exe (before symlink chase) at: %s\n",
4186 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4187 lt_debugprintf (__FILE__, __LINE__,
4188 "(main) found exe (after symlink chase) at: %s\n",
4189 actual_cwrapper_path);
4190 XFREE (tmp_pathspec);
4192 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4193 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4195 /* wrapper name transforms */
4196 strendzap (actual_cwrapper_name, ".exe");
4197 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4198 XFREE (actual_cwrapper_name);
4199 actual_cwrapper_name = tmp_pathspec;
4202 /* target_name transforms -- use actual target program name; might have lt- prefix */
4203 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4204 strendzap (target_name, ".exe");
4205 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4206 XFREE (target_name);
4207 target_name = tmp_pathspec;
4210 lt_debugprintf (__FILE__, __LINE__,
4211 "(main) libtool target name: %s\n",
4217 XMALLOC (char, (strlen (actual_cwrapper_path) +
4218 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4219 strcpy (newargz[0], actual_cwrapper_path);
4220 strcat (newargz[0], "$objdir");
4221 strcat (newargz[0], "/");
4225 /* stop here
, and copy so we don
't have to do this twice */
4226 tmp_pathspec = xstrdup (newargz[0]);
4228 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4229 strcat (newargz[0], actual_cwrapper_name);
4231 /* DO want the lt- prefix here if it exists, so use target_name */
4232 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4233 XFREE (tmp_pathspec);
4234 tmp_pathspec = NULL;
4242 while ((p = strchr (newargz[0], '\\')) != NULL)
4246 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4256 XFREE (target_name);
4257 XFREE (actual_cwrapper_path);
4258 XFREE (actual_cwrapper_name);
4260 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4261 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4262 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4263 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4265 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4266 nonnull (lt_argv_zero));
4267 for (i = 0; i < newargc; i++)
4269 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4270 i, nonnull (newargz[i]));
4278 /* execv doesn't actually work on mingw as expected on unix
*/
4279 newargz
= prepare_spawn
(newargz
);
4280 rval
= _spawnv
(_P_WAIT
, lt_argv_zero
, (const char
* const
*) newargz
);
4283 /* failed to start process
*/
4284 lt_debugprintf
(__FILE__
, __LINE__
,
4285 "(main) failed to launch target \"%s\": %s\n",
4286 lt_argv_zero
, nonnull
(strerror
(errno
)));
4294 execv (lt_argv_zero, newargz);
4295 return rval; /* =127, but avoids unused variable warning */
4304 xmalloc
(size_t num
)
4306 void
*p
= (void
*) malloc
(num
);
4308 lt_fatal
(__FILE__
, __LINE__
, "memory exhausted");
4314 xstrdup
(const char
*string
)
4316 return string ? strcpy
((char
*) xmalloc
(strlen
(string
) + 1),
4321 base_name
(const char
*name
)
4325 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4326 /* Skip over the disk name
in MSDOS pathnames.
*/
4327 if (isalpha
((unsigned char
) name
[0]) && name
[1] == ':')
4331 for (base
= name
; *name
; name
++)
4332 if (IS_DIR_SEPARATOR
(*name
))
4338 check_executable
(const char
*path
)
4342 lt_debugprintf
(__FILE__
, __LINE__
, "(check_executable): %s\n",
4344 if ((!path
) ||
(!*path
))
4347 if ((stat
(path
, &st
) >= 0)
4348 && (st.st_mode
& (S_IXUSR | S_IXGRP | S_IXOTH
)))
4355 make_executable
(const char
*path
)
4360 lt_debugprintf
(__FILE__
, __LINE__
, "(make_executable): %s\n",
4362 if ((!path
) ||
(!*path
))
4365 if (stat
(path
, &st
) >= 0)
4367 rval
= chmod (path
, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR
);
4372 /* Searches
for the full path of the wrapper. Returns
4373 newly allocated full path name
if found
, NULL otherwise
4374 Does not chase symlinks
, even on platforms that support them.
4377 find_executable
(const char
*wrapper
)
4382 /* static buffer
for getcwd
*/
4383 char tmp
[LT_PATHMAX
+ 1];
4387 lt_debugprintf
(__FILE__
, __LINE__
, "(find_executable): %s\n",
4388 nonempty
(wrapper
));
4390 if ((wrapper
== NULL
) ||
(*wrapper
== '\0'))
4393 /* Absolute path?
*/
4394 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4395 if (isalpha
((unsigned char
) wrapper
[0]) && wrapper
[1] == ':')
4397 concat_name
= xstrdup
(wrapper
);
4398 if (check_executable
(concat_name
))
4400 XFREE
(concat_name
);
4405 if (IS_DIR_SEPARATOR
(wrapper
[0]))
4407 concat_name
= xstrdup
(wrapper
);
4408 if (check_executable
(concat_name
))
4410 XFREE
(concat_name
);
4412 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4416 for (p
= wrapper
; *p
; p
++)
4424 /* no slashes
; search PATH
*/
4425 const char
*path
= getenv
("PATH");
4428 for (p
= path
; *p
; p
= p_next
)
4432 for (q
= p
; *q
; q
++)
4433 if (IS_PATH_SEPARATOR
(*q
))
4436 p_next
= (*q
== '\0' ? q
: q
+ 1);
4439 /* empty path
: current directory
*/
4440 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4441 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
4442 nonnull
(strerror
(errno
)));
4443 tmp_len
= strlen
(tmp
);
4445 XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
4446 memcpy
(concat_name
, tmp
, tmp_len
);
4447 concat_name
[tmp_len
] = '/';
4448 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
4453 XMALLOC
(char
, p_len
+ 1 + strlen
(wrapper
) + 1);
4454 memcpy
(concat_name
, p
, p_len
);
4455 concat_name
[p_len
] = '/';
4456 strcpy
(concat_name
+ p_len
+ 1, wrapper
);
4458 if (check_executable
(concat_name
))
4460 XFREE
(concat_name
);
4463 /* not found
in PATH
; assume curdir
*/
4465 /* Relative path | not found
in path
: prepend cwd
*/
4466 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4467 lt_fatal
(__FILE__
, __LINE__
, "getcwd failed: %s",
4468 nonnull
(strerror
(errno
)));
4469 tmp_len
= strlen
(tmp
);
4470 concat_name
= XMALLOC
(char
, tmp_len
+ 1 + strlen
(wrapper
) + 1);
4471 memcpy
(concat_name
, tmp
, tmp_len
);
4472 concat_name
[tmp_len
] = '/';
4473 strcpy
(concat_name
+ tmp_len
+ 1, wrapper
);
4475 if (check_executable
(concat_name
))
4477 XFREE
(concat_name
);
4482 chase_symlinks
(const char
*pathspec
)
4485 return xstrdup
(pathspec
);
4487 char buf
[LT_PATHMAX
];
4489 char
*tmp_pathspec
= xstrdup
(pathspec
);
4491 int has_symlinks
= 0;
4492 while (strlen
(tmp_pathspec
) && !has_symlinks
)
4494 lt_debugprintf
(__FILE__
, __LINE__
,
4495 "checking path component for symlinks: %s\n",
4497 if (lstat
(tmp_pathspec
, &s
) == 0)
4499 if (S_ISLNK
(s.st_mode
) != 0)
4505 /* search backwards
for last DIR_SEPARATOR
*/
4506 p
= tmp_pathspec
+ strlen
(tmp_pathspec
) - 1;
4507 while ((p
> tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
4509 if ((p
== tmp_pathspec
) && (!IS_DIR_SEPARATOR
(*p
)))
4511 /* no
more DIR_SEPARATORS left
*/
4518 lt_fatal
(__FILE__
, __LINE__
,
4519 "error accessing file \"%s\": %s",
4520 tmp_pathspec
, nonnull
(strerror
(errno
)));
4523 XFREE
(tmp_pathspec
);
4527 return xstrdup
(pathspec
);
4530 tmp_pathspec
= realpath
(pathspec
, buf
);
4531 if (tmp_pathspec
== 0)
4533 lt_fatal
(__FILE__
, __LINE__
,
4534 "could not follow symlinks for %s", pathspec
);
4536 return xstrdup
(tmp_pathspec
);
4541 strendzap
(char
*str
, const char
*pat
)
4545 assert
(str
!= NULL
);
4546 assert
(pat
!= NULL
);
4549 patlen
= strlen
(pat
);
4553 str
+= len
- patlen
;
4554 if (strcmp
(str
, pat
) == 0)
4561 lt_debugprintf
(const char
*file, int line
, const char
*fmt, ...
)
4566 (void
) fprintf
(stderr
, "%s:%s:%d: ", program_name
, file, line
);
4567 va_start
(args
, fmt);
4568 (void
) vfprintf
(stderr
, fmt, args
);
4574 lt_error_core
(int exit_status
, const char
*file,
4575 int line
, const char
*mode
,
4576 const char
*message
, va_list ap
)
4578 fprintf
(stderr
, "%s:%s:%d: %s: ", program_name
, file, line
, mode
);
4579 vfprintf
(stderr
, message
, ap
);
4580 fprintf
(stderr
, ".\n");
4582 if (exit_status
>= 0)
4587 lt_fatal
(const char
*file, int line
, const char
*message
, ...
)
4590 va_start
(ap
, message
);
4591 lt_error_core
(EXIT_FAILURE
, file, line
, "FATAL", message
, ap
);
4596 nonnull
(const char
*s
)
4598 return s ? s
: "(null)";
4602 nonempty
(const char
*s
)
4604 return (s
&& !*s
) ?
"(empty)" : nonnull
(s
);
4608 lt_setenv
(const char
*name
, const char
*value
)
4610 lt_debugprintf
(__FILE__
, __LINE__
,
4611 "(lt_setenv) setting '%s' to '%s'\n",
4612 nonnull
(name
), nonnull
(value
));
4615 /* always
make a copy
, for consistency with
!HAVE_SETENV
*/
4616 char
*str
= xstrdup
(value
);
4617 setenv
(name
, str
, 1);
4619 int len
= strlen
(name
) + 1 + strlen
(value
) + 1;
4620 char
*str
= XMALLOC
(char
, len
);
4621 sprintf
(str
, "%s=%s", name
, value
);
4622 if (putenv
(str
) != EXIT_SUCCESS
)
4631 lt_extend_str
(const char
*orig_value
, const char
*add
, int to_end
)
4634 if (orig_value
&& *orig_value
)
4636 int orig_value_len
= strlen
(orig_value
);
4637 int add_len
= strlen
(add
);
4638 new_value
= XMALLOC
(char
, add_len
+ orig_value_len
+ 1);
4641 strcpy
(new_value
, orig_value
);
4642 strcpy
(new_value
+ orig_value_len
, add
);
4646 strcpy
(new_value
, add
);
4647 strcpy
(new_value
+ add_len
, orig_value
);
4652 new_value
= xstrdup
(add
);
4658 lt_update_exe_path
(const char
*name
, const char
*value
)
4660 lt_debugprintf
(__FILE__
, __LINE__
,
4661 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4662 nonnull
(name
), nonnull
(value
));
4664 if (name
&& *name
&& value
&& *value
)
4666 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
4667 /* some systems can
't cope with a ':'-terminated path #' */
4668 int len
= strlen
(new_value
);
4669 while (((len
= strlen
(new_value
)) > 0) && IS_PATH_SEPARATOR
(new_value
[len-1
]))
4671 new_value
[len-1
] = '\0';
4673 lt_setenv
(name
, new_value
);
4679 lt_update_lib_path
(const char
*name
, const char
*value
)
4681 lt_debugprintf
(__FILE__
, __LINE__
,
4682 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4683 nonnull
(name
), nonnull
(value
));
4685 if (name
&& *name
&& value
&& *value
)
4687 char
*new_value
= lt_extend_str
(getenv
(name
), value
, 0);
4688 lt_setenv
(name
, new_value
);
4698 /* Prepares an argument vector before calling spawn().
4699 Note that spawn() does not by itself call the command interpreter
4700 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4701 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4703 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4704 }) ? "cmd.exe" : "command.com").
4705 Instead it simply concatenates the arguments, separated by ' ', and calls
4706 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4707 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4709 - Space and tab are interpreted as delimiters. They are not treated as
4710 delimiters if they are surrounded by double quotes: "...".
4711 - Unescaped double quotes are removed from the input. Their only effect is
4712 that within double quotes, space and tab are treated like normal
4714 - Backslashes not followed by double quotes are not special.
4715 - But 2*n+1 backslashes followed by a double quote become
4716 n backslashes followed by a double quote (n >= 0):
4721 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4722 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4724 prepare_spawn (char **argv)
4730 /* Count number of arguments. */
4731 for (argc = 0; argv[argc] != NULL; argc++)
4734 /* Allocate new argument vector. */
4735 new_argv = XMALLOC (char *, argc + 1);
4737 /* Put quoted arguments into the new argument vector. */
4738 for (i = 0; i < argc; i++)
4740 const char *string = argv[i];
4742 if (string[0] == '\0')
4743 new_argv[i] = xstrdup ("\"\"");
4744 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4746 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4748 unsigned int backslashes;
4750 char *quoted_string;
4757 for (s = string; *s != '\0'; s++)
4761 length += backslashes + 1;
4769 length += backslashes + 1;
4771 quoted_string = XMALLOC (char, length + 1);
4777 for (s = string; *s != '\0'; s++)
4783 for (j = backslashes + 1; j > 0; j--)
4795 for (j = backslashes; j > 0; j--)
4801 new_argv[i] = quoted_string;
4804 new_argv[i] = (char *) string;
4806 new_argv[argc] = NULL;
4815 void lt_dump_script
(FILE
* f
)
4818 func_emit_wrapper
yes |
4819 $SED -e 's/\([\\"]\)/\\\1/g' \
4820 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
4826 # end: func_emit_cwrapperexe_src
4828 # func_win32_import_lib_p ARG
4829 # True if ARG is an import lib, as indicated by $file_magic_cmd
4830 func_win32_import_lib_p ()
4833 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
4839 # func_mode_link arg...
4844 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4845 # It is impossible to link a dll without this setting, and
4846 # we shouldn't force the makefile maintainer to figure out
4847 # which system we are compiling for in order to pass an extra
4848 # flag for every libtool invocation.
4849 # allow_undefined=no
4851 # FIXME: Unfortunately, there are problems with the above when trying
4852 # to make a dll which has undefined symbols, in which case not
4853 # even a static library is built. For now, we need to specify
4854 # -no-undefined on the libtool link line when we can be certain
4855 # that all symbols are satisfied, otherwise we get a static library.
4862 libtool_args=$nonopt
4863 base_compile="$nonopt $@"
4864 compile_command=$nonopt
4865 finalize_command=$nonopt
4878 lib_search_path=`pwd`
4880 new_inherited_linker_flags=
4889 export_symbols_regex=
4897 precious_files_regex=
4898 prefer_static_libs=no
4911 single_module="${wl}-single_module"
4912 func_infer_tag $base_compile
4914 # We need to know -static, to get the right output filenames.
4919 test "$build_libtool_libs" != yes && \
4920 func_fatal_configuration "can not build a shared library"
4924 -all-static | -static | -static-libtool-libs)
4927 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4928 func_warning "complete static linking is impossible in this configuration"
4930 if test -n "$link_static_flag"; then
4931 dlopen_self=$dlopen_self_static
4933 prefer_static_libs=yes
4936 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4937 dlopen_self=$dlopen_self_static
4939 prefer_static_libs=built
4941 -static-libtool-libs)
4942 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4943 dlopen_self=$dlopen_self_static
4945 prefer_static_libs=yes
4948 build_libtool_libs=no
4955 # See if our shared archives depend on static archives.
4956 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4958 # Go through the arguments, transforming them on the way.
4959 while test "$#" -gt 0; do
4962 func_quote_for_eval "$arg"
4963 qarg=$func_quote_for_eval_unquoted_result
4964 func_append libtool_args " $func_quote_for_eval_result"
4966 # If the previous option needs an argument, assign it.
4967 if test -n "$prev"; then
4970 func_append compile_command " @OUTPUT@"
4971 func_append finalize_command " @OUTPUT@"
4982 if test "$preload" = no; then
4983 # Add the symbol object into the linking commands.
4984 func_append compile_command " @SYMFILE@"
4985 func_append finalize_command " @SYMFILE@"
4989 *.la | *.lo) ;; # We handle these cases below.
4991 if test "$dlself" = no; then
4999 if test "$prev" = dlprefiles; then
5001 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5011 if test "$prev" = dlfiles; then
5012 dlfiles="$dlfiles $arg"
5014 dlprefiles="$dlprefiles $arg"
5022 export_symbols="$arg"
5024 || func_fatal_error "symbol file \`$arg' does not exist"
5029 export_symbols_regex="$arg"
5037 *" $qarg.ltframework "*) ;;
5038 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
5047 inst_prefix_dir="$arg"
5052 if test -f "$arg"; then
5055 for fil in `cat "$save_arg"`
5057 # moreargs="$moreargs $fil"
5059 # A libtool-controlled object.
5061 # Check to see that this really is a libtool object.
5062 if func_lalib_unsafe_p "$arg"; then
5069 if test -z "$pic_object" ||
5070 test -z "$non_pic_object" ||
5071 test "$pic_object" = none &&
5072 test "$non_pic_object" = none; then
5073 func_fatal_error "cannot find name of object for \`$arg'"
5076 # Extract subdirectory from the argument.
5077 func_dirname "$arg" "/" ""
5078 xdir="$func_dirname_result"
5080 if test "$pic_object" != none; then
5081 # Prepend the subdirectory the object is found in.
5082 pic_object="$xdir$pic_object"
5084 if test "$prev" = dlfiles; then
5085 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5086 dlfiles="$dlfiles $pic_object"
5090 # If libtool objects are unsupported, then we need to preload.
5095 # CHECK ME: I think I busted this. -Ossama
5096 if test "$prev" = dlprefiles; then
5097 # Preload the old-style object.
5098 dlprefiles="$dlprefiles $pic_object"
5103 func_append libobjs " $pic_object"
5108 if test "$non_pic_object" != none; then
5109 # Prepend the subdirectory the object is found in.
5110 non_pic_object="$xdir$non_pic_object"
5112 # A standard non-PIC object
5113 func_append non_pic_objects " $non_pic_object"
5114 if test -z "$pic_object" || test "$pic_object" = none ; then
5115 arg="$non_pic_object"
5118 # If the PIC object exists, use it instead.
5119 # $xdir was prepended to $pic_object above.
5120 non_pic_object="$pic_object"
5121 func_append non_pic_objects " $non_pic_object"
5124 # Only an error if not doing a dry-run.
5125 if $opt_dry_run; then
5126 # Extract subdirectory from the argument.
5127 func_dirname "$arg" "/" ""
5128 xdir="$func_dirname_result"
5131 pic_object=$xdir$objdir/$func_lo2o_result
5132 non_pic_object=$xdir$func_lo2o_result
5133 func_append libobjs " $pic_object"
5134 func_append non_pic_objects " $non_pic_object"
5136 func_fatal_error "\`$arg' is not a valid libtool object"
5141 func_fatal_error "link input file \`$arg' does not exist"
5148 precious_files_regex="$arg"
5158 # We need an absolute path.
5160 [\\/]* | [A-Za-z]:[\\/]*) ;;
5162 func_fatal_error "only absolute run-paths are allowed"
5165 if test "$prev" = rpath; then
5168 *) rpath="$rpath $arg" ;;
5173 *) xrpath="$xrpath $arg" ;;
5185 weak_libs="$weak_libs $arg"
5190 linker_flags="$linker_flags $qarg"
5191 compiler_flags="$compiler_flags $qarg"
5193 func_append compile_command " $qarg"
5194 func_append finalize_command " $qarg"
5198 compiler_flags="$compiler_flags $qarg"
5200 func_append compile_command " $qarg"
5201 func_append finalize_command " $qarg"
5205 linker_flags="$linker_flags $qarg"
5206 compiler_flags="$compiler_flags $wl$qarg"
5208 func_append compile_command " $wl$qarg"
5209 func_append finalize_command " $wl$qarg"
5213 eval "$prev=\"\$arg\""
5218 fi # test -n "$prev"
5224 if test -n "$link_static_flag"; then
5225 # See comment for -static flag below, for more details.
5226 func_append compile_command " $link_static_flag"
5227 func_append finalize_command " $link_static_flag"
5233 # FIXME: remove this flag sometime in the future.
5234 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5262 -export-symbols | -export-symbols-regex)
5263 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5264 func_fatal_error "more than one -exported-symbols argument is not allowed"
5266 if test "X$arg" = "X-export-symbols"; then
5284 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5285 # so, if we see these flags be careful not to treat them like -L
5287 case $with_gcc/$host in
5288 no/*-*-irix* | /*-*-irix*)
5289 func_append compile_command " $arg"
5290 func_append finalize_command " $arg"
5297 func_stripname '-L' '' "$arg"
5298 dir=$func_stripname_result
5299 if test -z "$dir"; then
5300 if test "$#" -gt 0; then
5301 func_fatal_error "require no space between \`-L' and \`$1'"
5303 func_fatal_error "need path for \`-L' option"
5306 # We need an absolute path.
5308 [\\/]* | [A-Za-z]:[\\/]*) ;;
5310 absdir=`cd "$dir" && pwd`
5311 test -z "$absdir" && \
5312 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5319 deplibs="$deplibs -L$dir"
5320 lib_search_path="$lib_search_path $dir"
5324 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5325 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5326 case :$dllsearchpath: in
5328 ::) dllsearchpath=$dir;;
5329 *) dllsearchpath="$dllsearchpath:$dir";;
5331 case :$dllsearchpath: in
5332 *":$testbindir:"*) ;;
5333 ::) dllsearchpath=$testbindir;;
5334 *) dllsearchpath="$dllsearchpath:$testbindir";;
5342 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5344 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5345 # These systems don't actually have a C or math library (as such)
5349 # These systems don't actually have a C library (as such)
5350 test "X$arg" = "X-lc" && continue
5352 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5353 # Do not include libc due to us having libc/libc_r.
5354 test "X$arg" = "X-lc" && continue
5356 *-*-rhapsody* | *-*-darwin1.[012])
5357 # Rhapsody C and math libraries are in the System framework
5358 deplibs="$deplibs System.ltframework"
5361 *-*-sco3.2v5* | *-*-sco5v6*)
5362 # Causes problems with __ctype
5363 test "X$arg" = "X-lc" && continue
5365 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5366 # Compiler inserts libc in the correct place for threads to work
5367 test "X$arg" = "X-lc" && continue
5370 elif test "X$arg" = "X-lc_r"; then
5372 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5373 # Do not include libc_r directly, use -pthread flag.
5378 deplibs="$deplibs $arg"
5387 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5388 # classes, name mangling, and exception handling.
5389 # Darwin uses the -arch flag to determine output architecture.
5390 -model|-arch|-isysroot)
5391 compiler_flags="$compiler_flags $arg"
5392 func_append compile_command " $arg"
5393 func_append finalize_command " $arg"
5398 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5399 compiler_flags="$compiler_flags $arg"
5400 func_append compile_command " $arg"
5401 func_append finalize_command " $arg"
5402 case "$new_inherited_linker_flags " in
5404 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
5410 single_module="${wl}-multi_module"
5421 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5422 # The PATH hackery in wrapper scripts is required on Windows
5423 # and Darwin in order for the loader to find any dlls it needs.
5424 func_warning "\`-no-install' is ignored for $host"
5425 func_warning "assuming \`-no-fast-install' instead"
5428 *) no_install=yes ;;
5445 -precious-files-regex)
5466 func_stripname '-R' '' "$arg"
5467 dir=$func_stripname_result
5468 # We need an absolute path.
5470 [\\/]* | [A-Za-z]:[\\/]*) ;;
5472 func_fatal_error "only absolute run-paths are allowed"
5477 *) xrpath="$xrpath $dir" ;;
5483 # The effects of -shared are defined in a previous loop.
5492 -static | -static-libtool-libs)
5493 # The effects of -static are defined in a previous loop.
5494 # We used to do the same as -all-static on platforms that
5495 # didn't have a PIC flag, but the assumption that the effects
5496 # would be equivalent was wrong. It would break on at least
5497 # Digital Unix and AIX.
5523 func_stripname '-Wc,' '' "$arg"
5524 args=$func_stripname_result
5526 save_ifs="$IFS"; IFS=','
5527 for flag in $args; do
5529 func_quote_for_eval "$flag"
5530 arg="$arg $func_quote_for_eval_result"
5531 compiler_flags="$compiler_flags $func_quote_for_eval_result"
5534 func_stripname ' ' '' "$arg"
5535 arg=$func_stripname_result
5539 func_stripname '-Wl,' '' "$arg"
5540 args=$func_stripname_result
5542 save_ifs="$IFS"; IFS=','
5543 for flag in $args; do
5545 func_quote_for_eval "$flag"
5546 arg="$arg $wl$func_quote_for_eval_result"
5547 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
5548 linker_flags="$linker_flags $func_quote_for_eval_result"
5551 func_stripname ' ' '' "$arg"
5552 arg=$func_stripname_result
5572 func_quote_for_eval "$arg"
5573 arg="$func_quote_for_eval_result"
5576 # Flags to be passed through unchanged, with rationale:
5577 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5578 # -r[0-9][0-9]* specify processor for the SGI compiler
5579 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5580 # +DA*, +DD* enable 64-bit mode for the HP compiler
5581 # -q* compiler args for the IBM compiler
5582 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5583 # -F/path path to uninstalled frameworks, gcc on darwin
5584 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
5585 # @file GCC response files
5586 # -tp=* Portland pgcc target processor selection
5587 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5588 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
5589 func_quote_for_eval "$arg"
5590 arg="$func_quote_for_eval_result"
5591 func_append compile_command " $arg"
5592 func_append finalize_command " $arg"
5593 compiler_flags="$compiler_flags $arg"
5597 # Some other compiler flag.
5599 func_quote_for_eval "$arg"
5600 arg="$func_quote_for_eval_result"
5604 # A standard object.
5609 # A libtool-controlled object.
5611 # Check to see that this really is a libtool object.
5612 if func_lalib_unsafe_p "$arg"; then
5619 if test -z "$pic_object" ||
5620 test -z "$non_pic_object" ||
5621 test "$pic_object" = none &&
5622 test "$non_pic_object" = none; then
5623 func_fatal_error "cannot find name of object for \`$arg'"
5626 # Extract subdirectory from the argument.
5627 func_dirname "$arg" "/" ""
5628 xdir="$func_dirname_result"
5630 if test "$pic_object" != none; then
5631 # Prepend the subdirectory the object is found in.
5632 pic_object="$xdir$pic_object"
5634 if test "$prev" = dlfiles; then
5635 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5636 dlfiles="$dlfiles $pic_object"
5640 # If libtool objects are unsupported, then we need to preload.
5645 # CHECK ME: I think I busted this. -Ossama
5646 if test "$prev" = dlprefiles; then
5647 # Preload the old-style object.
5648 dlprefiles="$dlprefiles $pic_object"
5653 func_append libobjs " $pic_object"
5658 if test "$non_pic_object" != none; then
5659 # Prepend the subdirectory the object is found in.
5660 non_pic_object="$xdir$non_pic_object"
5662 # A standard non-PIC object
5663 func_append non_pic_objects " $non_pic_object"
5664 if test -z "$pic_object" || test "$pic_object" = none ; then
5665 arg="$non_pic_object"
5668 # If the PIC object exists, use it instead.
5669 # $xdir was prepended to $pic_object above.
5670 non_pic_object="$pic_object"
5671 func_append non_pic_objects " $non_pic_object"
5674 # Only an error if not doing a dry-run.
5675 if $opt_dry_run; then
5676 # Extract subdirectory from the argument.
5677 func_dirname "$arg" "/" ""
5678 xdir="$func_dirname_result"
5681 pic_object=$xdir$objdir/$func_lo2o_result
5682 non_pic_object=$xdir$func_lo2o_result
5683 func_append libobjs " $pic_object"
5684 func_append non_pic_objects " $non_pic_object"
5686 func_fatal_error "\`$arg' is not a valid libtool object"
5693 deplibs="$deplibs $arg"
5694 old_deplibs="$old_deplibs $arg"
5699 # A libtool-controlled library.
5701 if test "$prev" = dlfiles; then
5702 # This library was specified with -dlopen.
5703 dlfiles="$dlfiles $arg"
5705 elif test "$prev" = dlprefiles; then
5706 # The library was specified with -dlpreopen.
5707 dlprefiles="$dlprefiles $arg"
5710 deplibs="$deplibs $arg"
5715 # Some other compiler argument.
5717 # Unknown arguments in both finalize_command and compile_command need
5718 # to be aesthetically quoted because they are evaled later.
5719 func_quote_for_eval "$arg"
5720 arg="$func_quote_for_eval_result"
5724 # Now actually substitute the argument into the commands.
5725 if test -n "$arg"; then
5726 func_append compile_command " $arg"
5727 func_append finalize_command " $arg"
5729 done # argument parsing loop
5731 test -n "$prev" && \
5732 func_fatal_help "the \`$prevarg' option requires an argument"
5734 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
5735 eval arg=\"$export_dynamic_flag_spec\"
5736 func_append compile_command " $arg"
5737 func_append finalize_command " $arg"
5741 # calculate the name of the file, without its directory
5742 func_basename "$output"
5743 outputname="$func_basename_result"
5744 libobjs_save="$libobjs"
5746 if test -n "$shlibpath_var"; then
5747 # get the directories listed in $shlibpath_var
5748 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
5752 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
5753 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
5755 func_dirname "$output" "/" ""
5756 output_objdir="$func_dirname_result$objdir"
5757 # Create the object directory.
5758 func_mkdir_p "$output_objdir"
5760 # Determine the type of output
5763 func_fatal_help "you must specify an output file"
5765 *.$libext) linkmode=oldlib ;;
5766 *.lo | *.$objext) linkmode=obj ;;
5767 *.la) linkmode=lib ;;
5768 *) linkmode=prog ;; # Anything else should be a program.
5774 # Find all interdependent deplibs by searching for libraries
5775 # that are linked more than once (e.g. -la -lb -la)
5776 for deplib in $deplibs; do
5777 if $opt_duplicate_deps ; then
5779 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5782 libs="$libs $deplib"
5785 if test "$linkmode" = lib; then
5786 libs="$predeps $libs $compiler_lib_search_path $postdeps"
5788 # Compute libraries that are listed more than once in $predeps
5789 # $postdeps and mark them as special (i.e., whose duplicates are
5790 # not to be eliminated).
5792 if $opt_duplicate_compiler_generated_deps; then
5793 for pre_post_dep in $predeps $postdeps; do
5794 case "$pre_post_deps " in
5795 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
5797 pre_post_deps="$pre_post_deps $pre_post_dep"
5806 need_relink=no # whether we're linking any uninstalled libtool libraries
5807 notinst_deplibs= # not-installed libtool libraries
5808 notinst_path= # paths that contain not-installed libtool libraries
5812 passes="conv dlpreopen link"
5813 for file in $dlfiles $dlprefiles; do
5817 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
5828 passes="conv scan dlopen dlpreopen link"
5834 for pass in $passes; do
5835 # The preopen pass in lib mode reverses $deplibs; put it back here
5836 # so that -L comes before libs that need it for instance...
5837 if test "$linkmode,$pass" = "lib,link"; then
5838 ## FIXME: Find the place where the list is rebuilt in the wrong
5839 ## order, and fix it there properly
5841 for deplib in $deplibs; do
5842 tmp_deplibs="$deplib $tmp_deplibs"
5844 deplibs="$tmp_deplibs"
5847 if test "$linkmode,$pass" = "lib,link" ||
5848 test "$linkmode,$pass" = "prog,scan"; then
5852 if test "$linkmode" = prog; then
5854 dlopen) libs="$dlfiles" ;;
5855 dlpreopen) libs="$dlprefiles" ;;
5856 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5859 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5860 # Collect and forward deplibs of preopened libtool libs
5861 for lib in $dlprefiles; do
5862 # Ignore non-libtool-libs
5865 *.la) func_source "$lib" ;;
5868 # Collect preopened libtool deplibs, except any this library
5869 # has declared as weak libs
5870 for deplib in $dependency_libs; do
5871 func_basename "$deplib"
5872 deplib_base=$func_basename_result
5873 case " $weak_libs " in
5874 *" $deplib_base "*) ;;
5875 *) deplibs="$deplibs $deplib" ;;
5881 if test "$pass" = dlopen; then
5882 # Collect dlpreopened libraries
5883 save_deplibs="$deplibs"
5887 for deplib in $libs; do
5891 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5892 if test "$linkmode,$pass" = "prog,link"; then
5893 compile_deplibs="$deplib $compile_deplibs"
5894 finalize_deplibs="$deplib $finalize_deplibs"
5896 compiler_flags="$compiler_flags $deplib"
5897 if test "$linkmode" = lib ; then
5898 case "$new_inherited_linker_flags " in
5900 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5907 if test "$linkmode" != lib && test "$linkmode" != prog; then
5908 func_warning "\`-l' is ignored for archives/objects"
5911 func_stripname '-l' '' "$deplib"
5912 name=$func_stripname_result
5913 if test "$linkmode" = lib; then
5914 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5916 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5918 for searchdir in $searchdirs; do
5919 for search_ext in .la $std_shrext .so .a; do
5920 # Search the libtool library
5921 lib="$searchdir/lib${name}${search_ext}"
5922 if test -f "$lib"; then
5923 if test "$search_ext" = ".la"; then
5932 if test "$found" != yes; then
5933 # deplib doesn't seem to be a libtool library
5934 if test "$linkmode,$pass" = "prog,link"; then
5935 compile_deplibs="$deplib $compile_deplibs"
5936 finalize_deplibs="$deplib $finalize_deplibs"
5938 deplibs="$deplib $deplibs"
5939 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5942 else # deplib is a libtool library
5943 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5944 # We need to do some special things here, and not later.
5945 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5946 case " $predeps $postdeps " in
5948 if func_lalib_p "$lib"; then
5952 for l in $old_library $library_names; do
5955 if test "X$ll" = "X$old_library" ; then # only static version available
5957 func_dirname "$lib" "" "."
5958 ladir="$func_dirname_result"
5959 lib=$ladir/$old_library
5960 if test "$linkmode,$pass" = "prog,link"; then
5961 compile_deplibs="$deplib $compile_deplibs"
5962 finalize_deplibs="$deplib $finalize_deplibs"
5964 deplibs="$deplib $deplibs"
5965 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5977 if test "$linkmode,$pass" = "prog,link"; then
5978 compile_deplibs="$deplib $compile_deplibs"
5979 finalize_deplibs="$deplib $finalize_deplibs"
5981 deplibs="$deplib $deplibs"
5982 if test "$linkmode" = lib ; then
5983 case "$new_inherited_linker_flags " in
5985 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5994 deplibs="$deplib $deplibs"
5995 test "$pass" = conv && continue
5996 newdependency_libs="$deplib $newdependency_libs"
5997 func_stripname '-L' '' "$deplib"
5998 newlib_search_path="$newlib_search_path $func_stripname_result"
6001 if test "$pass" = conv; then
6002 deplibs="$deplib $deplibs"
6005 if test "$pass" = scan; then
6006 deplibs="$deplib $deplibs"
6008 compile_deplibs="$deplib $compile_deplibs"
6009 finalize_deplibs="$deplib $finalize_deplibs"
6011 func_stripname '-L' '' "$deplib"
6012 newlib_search_path="$newlib_search_path $func_stripname_result"
6015 func_warning "\`-L' is ignored for archives/objects"
6021 if test "$pass" = link; then
6022 func_stripname '-R' '' "$deplib"
6023 dir=$func_stripname_result
6024 # Make sure the xrpath contains only unique directories.
6027 *) xrpath="$xrpath $dir" ;;
6030 deplibs="$deplib $deplibs"
6033 *.la) lib="$deplib" ;;
6035 if test "$pass" = conv; then
6036 deplibs="$deplib $deplibs"
6041 # Linking convenience modules into shared libraries is allowed,
6042 # but linking other static libraries is non-portable.
6043 case " $dlpreconveniencelibs " in
6047 case $deplibs_check_method in
6049 set dummy $deplibs_check_method; shift
6050 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6051 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6052 | $EGREP "$match_pattern_regex" > /dev/null; then
6060 if test "$valid_a_lib" != yes; then
6062 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6063 echo "*** I have the capability to make that library automatically link in when"
6064 echo "*** you link to this library. But I can only do this if you have a"
6065 echo "*** shared version of the library, which you do not appear to have"
6066 echo "*** because the file extensions .$libext of this argument makes me believe"
6067 echo "*** that it is just a static archive that I should not use here."
6070 $ECHO "*** Warning: Linking the shared library $output against the"
6071 $ECHO "*** static library $deplib is not portable!"
6072 deplibs="$deplib $deplibs"
6079 if test "$pass" != link; then
6080 deplibs="$deplib $deplibs"
6082 compile_deplibs="$deplib $compile_deplibs"
6083 finalize_deplibs="$deplib $finalize_deplibs"
6090 if test "$pass" = conv; then
6091 deplibs="$deplib $deplibs"
6092 elif test "$linkmode" = prog; then
6093 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6094 # If there is no dlopen support or we're linking statically,
6095 # we need to preload.
6096 newdlprefiles="$newdlprefiles $deplib"
6097 compile_deplibs="$deplib $compile_deplibs"
6098 finalize_deplibs="$deplib $finalize_deplibs"
6100 newdlfiles="$newdlfiles $deplib"
6111 if test "$found" = yes || test -f "$lib"; then :
6113 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6116 # Check to see that this really is a libtool archive.
6117 func_lalib_unsafe_p "$lib" \
6118 || func_fatal_error "\`$lib' is not a valid libtool archive"
6120 func_dirname "$lib" "" "."
6121 ladir="$func_dirname_result"
6129 inherited_linker_flags=
6130 # If the library was installed with an old release of libtool,
6131 # it will not redefine variables installed, or shouldnotlink
6140 # Convert "-framework foo" to "foo.ltframework"
6141 if test -n "$inherited_linker_flags"; then
6142 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6143 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6144 case " $new_inherited_linker_flags " in
6145 *" $tmp_inherited_linker_flag "*) ;;
6146 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
6150 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6151 if test "$linkmode,$pass" = "lib,link" ||
6152 test "$linkmode,$pass" = "prog,scan" ||
6153 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6154 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
6155 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
6158 if test "$pass" = conv; then
6159 # Only check for convenience libraries
6160 deplibs="$lib $deplibs"
6161 if test -z "$libdir"; then
6162 if test -z "$old_library"; then
6163 func_fatal_error "cannot find name of link library for \`$lib'"
6165 # It is a libtool convenience library, so add in its objects.
6166 convenience="$convenience $ladir/$objdir/$old_library"
6167 old_convenience="$old_convenience $ladir/$objdir/$old_library"
6168 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6169 func_fatal_error "\`$lib' is not a convenience library"
6172 for deplib in $dependency_libs; do
6173 deplibs="$deplib $deplibs"
6174 if $opt_duplicate_deps ; then
6175 case "$tmp_libs " in
6176 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6179 tmp_libs="$tmp_libs $deplib"
6185 # Get the name of the library we link against.
6187 for l in $old_library $library_names; do
6190 if test -z "$linklib"; then
6191 func_fatal_error "cannot find name of link library for \`$lib'"
6194 # This library was specified with -dlopen.
6195 if test "$pass" = dlopen; then
6196 if test -z "$libdir"; then
6197 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6199 if test -z "$dlname" ||
6200 test "$dlopen_support" != yes ||
6201 test "$build_libtool_libs" = no; then
6202 # If there is no dlname, no dlopen support or we're linking
6203 # statically, we need to preload. We also need to preload any
6204 # dependent libraries so libltdl's deplib preloader doesn't
6205 # bomb out in the load deplibs phase.
6206 dlprefiles="$dlprefiles $lib $dependency_libs"
6208 newdlfiles="$newdlfiles $lib"
6213 # We need an absolute path.
6215 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6217 abs_ladir=`cd "$ladir" && pwd`
6218 if test -z "$abs_ladir"; then
6219 func_warning "cannot determine absolute directory name of \`$ladir'"
6220 func_warning "passing it literally to the linker, although it might fail"
6225 func_basename "$lib"
6226 laname="$func_basename_result"
6228 # Find the relevant object directory and library name.
6229 if test "X$installed" = Xyes; then
6230 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6231 func_warning "library \`$lib' was moved."
6239 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6241 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6244 # Remove this search path later
6245 notinst_path="$notinst_path $abs_ladir"
6247 dir="$ladir/$objdir"
6248 absdir="$abs_ladir/$objdir"
6249 # Remove this search path later
6250 notinst_path="$notinst_path $abs_ladir"
6252 fi # $installed = yes
6253 func_stripname 'lib' '.la' "$laname"
6254 name=$func_stripname_result
6256 # This library was specified with -dlpreopen.
6257 if test "$pass" = dlpreopen; then
6258 if test -z "$libdir" && test "$linkmode" = prog; then
6259 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6261 # Prefer using a static library (so that no silly _DYNAMIC symbols
6262 # are required to link).
6263 if test -n "$old_library"; then
6264 newdlprefiles="$newdlprefiles $dir/$old_library"
6265 # Keep a list of preopened convenience libraries to check
6266 # that they are being used correctly in the link pass.
6267 test -z "$libdir" && \
6268 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
6269 # Otherwise, use the dlname, so that lt_dlopen finds it.
6270 elif test -n "$dlname"; then
6271 newdlprefiles="$newdlprefiles $dir/$dlname"
6273 newdlprefiles="$newdlprefiles $dir/$linklib"
6275 fi # $pass = dlpreopen
6277 if test -z "$libdir"; then
6278 # Link the convenience library
6279 if test "$linkmode" = lib; then
6280 deplibs="$dir/$old_library $deplibs"
6281 elif test "$linkmode,$pass" = "prog,link"; then
6282 compile_deplibs="$dir/$old_library $compile_deplibs"
6283 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6285 deplibs="$lib $deplibs" # used for prog,scan pass
6291 if test "$linkmode" = prog && test "$pass" != link; then
6292 newlib_search_path="$newlib_search_path $ladir"
6293 deplibs="$lib $deplibs"
6296 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6297 test "$build_libtool_libs" = no; then
6302 for deplib in $dependency_libs; do
6304 -L*) func_stripname '-L' '' "$deplib"
6305 newlib_search_path="$newlib_search_path $func_stripname_result"
6308 # Need to link against all dependency_libs?
6309 if test "$linkalldeplibs" = yes; then
6310 deplibs="$deplib $deplibs"
6312 # Need to hardcode shared library paths
6313 # or/and link against static libraries
6314 newdependency_libs="$deplib $newdependency_libs"
6316 if $opt_duplicate_deps ; then
6317 case "$tmp_libs " in
6318 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6321 tmp_libs="$tmp_libs $deplib"
6324 fi # $linkmode = prog...
6326 if test "$linkmode,$pass" = "prog,link"; then
6327 if test -n "$library_names" &&
6328 { { test "$prefer_static_libs" = no ||
6329 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6330 test -z "$old_library"; }; then
6331 # We need to hardcode the library path
6332 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6333 # Make sure the rpath contains only unique directories.
6334 case "$temp_rpath:" in
6336 *) temp_rpath="$temp_rpath$absdir:" ;;
6340 # Hardcode the library path.
6341 # Skip directories that are in the system default run-time
6343 case " $sys_lib_dlsearch_path " in
6346 case "$compile_rpath " in
6348 *) compile_rpath="$compile_rpath $absdir"
6352 case " $sys_lib_dlsearch_path " in
6355 case "$finalize_rpath " in
6357 *) finalize_rpath="$finalize_rpath $libdir"
6361 fi # $linkmode,$pass = prog,link...
6363 if test "$alldeplibs" = yes &&
6364 { test "$deplibs_check_method" = pass_all ||
6365 { test "$build_libtool_libs" = yes &&
6366 test -n "$library_names"; }; }; then
6367 # We only need to search for static libraries
6372 link_static=no # Whether the deplib will be linked statically
6373 use_static_libs=$prefer_static_libs
6374 if test "$use_static_libs" = built && test "$installed" = yes; then
6377 if test -n "$library_names" &&
6378 { test "$use_static_libs" = no || test -z "$old_library"; }; then
6380 *cygwin* | *mingw* | *cegcc*)
6381 # No point in relinking DLLs because paths are not encoded
6382 notinst_deplibs="$notinst_deplibs $lib"
6386 if test "$installed" = no; then
6387 notinst_deplibs="$notinst_deplibs $lib"
6392 # This is a shared library
6394 # Warn about portability, can't link against -module's on some
6395 # systems (darwin). Don't bleat about dlopened modules though!
6397 for dlpremoduletest in $dlprefiles; do
6398 if test "X$dlpremoduletest" = "X$lib"; then
6399 dlopenmodule="$dlpremoduletest"
6403 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6405 if test "$linkmode" = prog; then
6406 $ECHO "*** Warning: Linking the executable $output against the loadable module"
6408 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6410 $ECHO "*** $linklib is not portable!"
6412 if test "$linkmode" = lib &&
6413 test "$hardcode_into_libs" = yes; then
6414 # Hardcode the library path.
6415 # Skip directories that are in the system default run-time
6417 case " $sys_lib_dlsearch_path " in
6420 case "$compile_rpath " in
6422 *) compile_rpath="$compile_rpath $absdir"
6426 case " $sys_lib_dlsearch_path " in
6429 case "$finalize_rpath " in
6431 *) finalize_rpath="$finalize_rpath $libdir"
6437 if test -n "$old_archive_from_expsyms_cmds"; then
6438 # figure out the soname
6439 set dummy $library_names
6443 libname=`eval "\\$ECHO \"$libname_spec\""`
6444 # use dlname if we got it. it's perfectly good, no?
6445 if test -n "$dlname"; then
6447 elif test -n "$soname_spec"; then
6450 *cygwin* | mingw* | *cegcc*)
6451 func_arith $current - $age
6452 major=$func_arith_result
6456 eval soname=\"$soname_spec\"
6461 # Make a new name for the extract_expsyms_cmds to use
6463 func_basename "$soroot"
6464 soname="$func_basename_result"
6465 func_stripname 'lib' '.dll' "$soname"
6466 newlib=libimp-$func_stripname_result.a
6468 # If the library has no export list, then create one now
6469 if test -f "$output_objdir/$soname-def"; then :
6471 func_verbose "extracting exported symbol list from \`$soname'"
6472 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6476 if test -f "$output_objdir/$newlib"; then :; else
6477 func_verbose "generating import library for \`$soname'"
6478 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6480 # make sure the library variables are pointing to the new library
6483 fi # test -n "$old_archive_from_expsyms_cmds"
6485 if test "$linkmode" = prog || test "$mode" != relink; then
6490 case $hardcode_action in
6491 immediate | unsupported)
6492 if test "$hardcode_direct" = no; then
6495 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6496 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6497 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6498 *-*-unixware7*) add_dir="-L$dir" ;;
6500 # if the lib is a (non-dlopened) module then we can not
6501 # link against it, someone is ignoring the earlier warnings
6502 if /usr/bin/file -L $add 2> /dev/null |
6503 $GREP ": [^:]* bundle" >/dev/null ; then
6504 if test "X$dlopenmodule" != "X$lib"; then
6505 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6506 if test -z "$old_library" ; then
6508 echo "*** And there doesn't seem to be a static archive available"
6509 echo "*** The link will probably fail, sorry"
6511 add="$dir/$old_library"
6513 elif test -n "$old_library"; then
6514 add="$dir/$old_library"
6518 elif test "$hardcode_minus_L" = no; then
6520 *-*-sunos*) add_shlibpath="$dir" ;;
6524 elif test "$hardcode_shlibpath_var" = no; then
6525 add_shlibpath="$dir"
6532 if test "$hardcode_direct" = yes &&
6533 test "$hardcode_direct_absolute" = no; then
6535 elif test "$hardcode_minus_L" = yes; then
6537 # Try looking first in the location we're being installed to.
6538 if test -n "$inst_prefix_dir"; then
6541 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6546 elif test "$hardcode_shlibpath_var" = yes; then
6547 add_shlibpath="$dir"
6556 if test "$lib_linked" != yes; then
6557 func_fatal_configuration "unsupported hardcode properties"
6560 if test -n "$add_shlibpath"; then
6561 case :$compile_shlibpath: in
6562 *":$add_shlibpath:"*) ;;
6563 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
6566 if test "$linkmode" = prog; then
6567 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6568 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6570 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6571 test -n "$add" && deplibs="$add $deplibs"
6572 if test "$hardcode_direct" != yes &&
6573 test "$hardcode_minus_L" != yes &&
6574 test "$hardcode_shlibpath_var" = yes; then
6575 case :$finalize_shlibpath: in
6577 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6583 if test "$linkmode" = prog || test "$mode" = relink; then
6587 # Finalize command for both is simple: just hardcode it.
6588 if test "$hardcode_direct" = yes &&
6589 test "$hardcode_direct_absolute" = no; then
6590 add="$libdir/$linklib"
6591 elif test "$hardcode_minus_L" = yes; then
6594 elif test "$hardcode_shlibpath_var" = yes; then
6595 case :$finalize_shlibpath: in
6597 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
6600 elif test "$hardcode_automatic" = yes; then
6601 if test -n "$inst_prefix_dir" &&
6602 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6603 add="$inst_prefix_dir$libdir/$linklib"
6605 add="$libdir/$linklib"
6608 # We cannot seem to hardcode it, guess we'll fake it.
6610 # Try looking first in the location we're being installed to.
6611 if test -n "$inst_prefix_dir"; then
6614 add_dir="$add_dir -L$inst_prefix_dir$libdir"
6621 if test "$linkmode" = prog; then
6622 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6623 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6625 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6626 test -n "$add" && deplibs="$add $deplibs"
6629 elif test "$linkmode" = prog; then
6630 # Here we assume that one of hardcode_direct or hardcode_minus_L
6631 # is not unsupported. This is valid on all known static and
6633 if test "$hardcode_direct" != unsupported; then
6634 test -n "$old_library" && linklib="$old_library"
6635 compile_deplibs="$dir/$linklib $compile_deplibs"
6636 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6638 compile_deplibs="-l$name -L$dir $compile_deplibs"
6639 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6641 elif test "$build_libtool_libs" = yes; then
6642 # Not a shared library
6643 if test "$deplibs_check_method" != pass_all; then
6644 # We're trying link a shared library against a static one
6645 # but the system doesn't support it.
6647 # Just print a warning and add the library to dependency_libs so
6648 # that the program can be linked against the static library.
6650 $ECHO "*** Warning: This system can not link to static lib archive $lib."
6651 echo "*** I have the capability to make that library automatically link in when"
6652 echo "*** you link to this library. But I can only do this if you have a"
6653 echo "*** shared version of the library, which you do not appear to have."
6654 if test "$module" = yes; then
6655 echo "*** But as you try to build a module library, libtool will still create "
6656 echo "*** a static module, that should work as long as the dlopening application"
6657 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6658 if test -z "$global_symbol_pipe"; then
6660 echo "*** However, this would only work if libtool was able to extract symbol"
6661 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6662 echo "*** not find such a program. So, this module is probably useless."
6663 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6665 if test "$build_old_libs" = no; then
6666 build_libtool_libs=module
6669 build_libtool_libs=no
6673 deplibs="$dir/$old_library $deplibs"
6676 fi # link shared/static library?
6678 if test "$linkmode" = lib; then
6679 if test -n "$dependency_libs" &&
6680 { test "$hardcode_into_libs" != yes ||
6681 test "$build_old_libs" = yes ||
6682 test "$link_static" = yes; }; then
6683 # Extract -R from dependency_libs
6685 for libdir in $dependency_libs; do
6687 -R*) func_stripname '-R' '' "$libdir"
6688 temp_xrpath=$func_stripname_result
6690 *" $temp_xrpath "*) ;;
6691 *) xrpath="$xrpath $temp_xrpath";;
6693 *) temp_deplibs="$temp_deplibs $libdir";;
6696 dependency_libs="$temp_deplibs"
6699 newlib_search_path="$newlib_search_path $absdir"
6700 # Link against this library
6701 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
6702 # ... and its dependency_libs
6704 for deplib in $dependency_libs; do
6705 newdependency_libs="$deplib $newdependency_libs"
6706 if $opt_duplicate_deps ; then
6707 case "$tmp_libs " in
6708 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6711 tmp_libs="$tmp_libs $deplib"
6714 if test "$link_all_deplibs" != no; then
6715 # Add the search paths of all dependency libraries
6716 for deplib in $dependency_libs; do
6719 -L*) path="$deplib" ;;
6721 func_dirname "$deplib" "" "."
6722 dir="$func_dirname_result"
6723 # We need an absolute path.
6725 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
6727 absdir=`cd "$dir" && pwd`
6728 if test -z "$absdir"; then
6729 func_warning "cannot determine absolute directory name of \`$dir'"
6734 if $GREP "^installed=no" $deplib > /dev/null; then
6738 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
6739 if test -n "$deplibrary_names" ; then
6740 for tmp in $deplibrary_names ; do
6743 if test -f "$absdir/$objdir/$depdepl" ; then
6744 depdepl="$absdir/$objdir/$depdepl"
6745 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6746 if test -z "$darwin_install_name"; then
6747 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
6749 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
6750 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
6756 path="-L$absdir/$objdir"
6760 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
6761 test -z "$libdir" && \
6762 func_fatal_error "\`$deplib' is not a valid libtool archive"
6763 test "$absdir" != "$libdir" && \
6764 func_warning "\`$deplib' seems to be moved"
6770 case " $deplibs " in
6772 *) deplibs="$path $deplibs" ;;
6775 fi # link_all_deplibs != no
6777 done # for deplib in $libs
6778 if test "$pass" = link; then
6779 if test "$linkmode" = "prog"; then
6780 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
6781 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
6783 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6786 dependency_libs="$newdependency_libs"
6787 if test "$pass" = dlpreopen; then
6788 # Link the dlpreopened libraries before other libraries
6789 for deplib in $save_deplibs; do
6790 deplibs="$deplib $deplibs"
6793 if test "$pass" != dlopen; then
6794 if test "$pass" != conv; then
6795 # Make sure lib_search_path contains only unique directories.
6797 for dir in $newlib_search_path; do
6798 case "$lib_search_path " in
6800 *) lib_search_path="$lib_search_path $dir" ;;
6806 if test "$linkmode,$pass" != "prog,link"; then
6809 vars="compile_deplibs finalize_deplibs"
6811 for var in $vars dependency_libs; do
6812 # Add libraries to $var in reverse order
6813 eval tmp_libs=\"\$$var\"
6815 for deplib in $tmp_libs; do
6816 # FIXME: Pedantically, this is the right thing to do, so
6817 # that some nasty dependency loop isn't accidentally
6819 #new_libs="$deplib $new_libs"
6820 # Pragmatically, this seems to cause very few problems in
6823 -L*) new_libs="$deplib $new_libs" ;;
6826 # And here is the reason: when a library appears more
6827 # than once as an explicit dependence of a library, or
6828 # is implicitly linked in more than once by the
6829 # compiler, it is considered special, and multiple
6830 # occurrences thereof are not removed. Compare this
6831 # with having the same library being listed as a
6832 # dependency of multiple other libraries: in this case,
6833 # we know (pedantically, we assume) the library does not
6834 # need to be listed more than once, so we keep only the
6835 # last copy. This is not always right, but it is rare
6836 # enough that we require users that really mean to play
6837 # such unportable linking tricks to link the library
6838 # using -Wl,-lname, so that libtool does not consider it
6839 # for duplicate removal.
6840 case " $specialdeplibs " in
6841 *" $deplib "*) new_libs="$deplib $new_libs" ;;
6843 case " $new_libs " in
6845 *) new_libs="$deplib $new_libs" ;;
6853 for deplib in $new_libs; do
6856 case " $tmp_libs " in
6858 *) tmp_libs="$tmp_libs $deplib" ;;
6861 *) tmp_libs="$tmp_libs $deplib" ;;
6864 eval $var=\"$tmp_libs\"
6867 # Last step: remove runtime libs from dependency_libs
6868 # (they stay in deplibs)
6870 for i in $dependency_libs ; do
6871 case " $predeps $postdeps $compiler_lib_search_path " in
6876 if test -n "$i" ; then
6877 tmp_libs="$tmp_libs $i"
6880 dependency_libs=$tmp_libs
6882 if test "$linkmode" = prog; then
6883 dlfiles="$newdlfiles"
6885 if test "$linkmode" = prog || test "$linkmode" = lib; then
6886 dlprefiles="$newdlprefiles"
6891 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6892 func_warning "\`-dlopen' is ignored for archives"
6897 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6900 test -n "$rpath" && \
6901 func_warning "\`-rpath' is ignored for archives"
6903 test -n "$xrpath" && \
6904 func_warning "\`-R' is ignored for archives"
6906 test -n "$vinfo" && \
6907 func_warning "\`-version-info/-version-number' is ignored for archives"
6909 test -n "$release" && \
6910 func_warning "\`-release' is ignored for archives"
6912 test -n "$export_symbols$export_symbols_regex" && \
6913 func_warning "\`-export-symbols' is ignored for archives"
6915 # Now set the variables for building old libraries.
6916 build_libtool_libs=no
6918 objs="$objs$old_deplibs"
6922 # Make sure we only generate libraries of the form `libNAME.la'.
6925 func_stripname 'lib' '.la' "$outputname"
6926 name=$func_stripname_result
6927 eval shared_ext=\"$shrext_cmds\"
6928 eval libname=\"$libname_spec\"
6931 test "$module" = no && \
6932 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6934 if test "$need_lib_prefix" != no; then
6935 # Add the "lib" prefix for modules if required
6936 func_stripname '' '.la' "$outputname"
6937 name=$func_stripname_result
6938 eval shared_ext=\"$shrext_cmds\"
6939 eval libname=\"$libname_spec\"
6941 func_stripname '' '.la' "$outputname"
6942 libname=$func_stripname_result
6947 if test -n "$objs"; then
6948 if test "$deplibs_check_method" != pass_all; then
6949 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6952 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6953 $ECHO "*** objects $objs is not portable!"
6954 libobjs="$libobjs $objs"
6958 test "$dlself" != no && \
6959 func_warning "\`-dlopen self' is ignored for libtool libraries"
6963 test "$#" -gt 1 && \
6964 func_warning "ignoring multiple \`-rpath's for a libtool library"
6969 if test -z "$rpath"; then
6970 if test "$build_libtool_libs" = yes; then
6971 # Building a libtool convenience library.
6972 # Some compilers have problems with a `.al' extension so
6973 # convenience libraries should have the same extension an
6974 # archive normally would.
6975 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6976 build_libtool_libs=convenience
6980 test -n "$vinfo" && \
6981 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6983 test -n "$release" && \
6984 func_warning "\`-release' is ignored for convenience libraries"
6987 # Parse the version information argument.
6988 save_ifs="$IFS"; IFS=':'
6989 set dummy $vinfo 0 0 0
6994 func_fatal_help "too many parameters to \`-version-info'"
6996 # convert absolute version numbers to libtool ages
6997 # this retains compatibility with .la files and attempts
6998 # to make the code below a bit more comprehensible
7000 case $vinfo_number in
7004 number_revision="$3"
7006 # There are really only two kinds -- those that
7007 # use the current revision as the major version
7008 # and those that subtract age and use age as
7009 # a minor version. But, then there is irix
7010 # which has an extra 1 added just for fun
7012 case $version_type in
7013 darwin|linux|osf|windows|none)
7014 func_arith $number_major + $number_minor
7015 current=$func_arith_result
7017 revision="$number_revision"
7019 freebsd-aout|freebsd-elf|qnx|sunos)
7020 current="$number_major"
7021 revision="$number_minor"
7025 func_arith $number_major + $number_minor
7026 current=$func_arith_result
7028 revision="$number_minor"
7029 lt_irix_increment=no
7040 # Check that each of the things are valid numbers.
7042 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7044 func_error "CURRENT \`$current' must be a nonnegative integer"
7045 func_fatal_error "\`$vinfo' is not valid version information"
7050 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7052 func_error "REVISION \`$revision' must be a nonnegative integer"
7053 func_fatal_error "\`$vinfo' is not valid version information"
7058 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7060 func_error "AGE \`$age' must be a nonnegative integer"
7061 func_fatal_error "\`$vinfo' is not valid version information"
7065 if test "$age" -gt "$current"; then
7066 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7067 func_fatal_error "\`$vinfo' is not valid version information"
7070 # Calculate the version variables.
7074 case $version_type in
7078 # Like Linux, but with the current version available in
7079 # verstring for coding it into the library header
7080 func_arith $current - $age
7081 major=.$func_arith_result
7082 versuffix="$major.$age.$revision"
7083 # Darwin ld doesn't like 0 for these options...
7084 func_arith $current + 1
7085 minor_current=$func_arith_result
7086 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7087 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7092 versuffix=".$current.$revision";
7097 versuffix=".$current"
7101 if test "X$lt_irix_increment" = "Xno"; then
7102 func_arith $current - $age
7104 func_arith $current - $age + 1
7106 major=$func_arith_result
7108 case $version_type in
7109 nonstopux) verstring_prefix=nonstopux ;;
7110 *) verstring_prefix=sgi ;;
7112 verstring="$verstring_prefix$major.$revision"
7114 # Add in all the interfaces that we are compatible with.
7116 while test "$loop" -ne 0; do
7117 func_arith $revision - $loop
7118 iface=$func_arith_result
7119 func_arith $loop - 1
7120 loop=$func_arith_result
7121 verstring="$verstring_prefix$major.$iface:$verstring"
7124 # Before this point, $major must not contain `.'.
7126 versuffix="$major.$revision"
7130 func_arith $current - $age
7131 major=.$func_arith_result
7132 versuffix="$major.$age.$revision"
7136 func_arith $current - $age
7137 major=.$func_arith_result
7138 versuffix=".$current.$age.$revision"
7139 verstring="$current.$age.$revision"
7141 # Add in all the interfaces that we are compatible with.
7143 while test "$loop" -ne 0; do
7144 func_arith $current - $loop
7145 iface=$func_arith_result
7146 func_arith $loop - 1
7147 loop=$func_arith_result
7148 verstring="$verstring:${iface}.0"
7151 # Make executables depend on our current version.
7152 verstring="$verstring:${current}.0"
7157 versuffix=".$current"
7162 versuffix=".$current.$revision"
7166 # Use '-' rather than '.', since we only want one
7167 # extension on DOS 8.3 filesystems.
7168 func_arith $current - $age
7169 major=$func_arith_result
7174 func_fatal_configuration "unknown library version type \`$version_type'"
7178 # Clear the version info if we defaulted, and they specified a release.
7179 if test -z "$vinfo" && test -n "$release"; then
7181 case $version_type in
7183 # we can't check for "0.0" in archive_cmds due to quoting
7184 # problems, so we reset it completely
7191 if test "$need_version" = no; then
7198 # Remove version info from name if versioning should be avoided
7199 if test "$avoid_version" = yes && test "$need_version" = no; then
7205 # Check to see if the archive will have undefined symbols.
7206 if test "$allow_undefined" = yes; then
7207 if test "$allow_undefined_flag" = unsupported; then
7208 func_warning "undefined symbols not allowed in $host shared libraries"
7209 build_libtool_libs=no
7213 # Don't allow undefined symbols.
7214 allow_undefined_flag="$no_undefined_flag"
7219 func_generate_dlsyms "$libname" "$libname" "yes"
7220 libobjs="$libobjs $symfileobj"
7221 test "X$libobjs" = "X " && libobjs=
7223 if test "$mode" != relink; then
7224 # Remove our outputs, but don't remove object files since they
7225 # may have been created when compiling PIC objects.
7227 tempremovelist=`$ECHO "$output_objdir/*"`
7228 for p in $tempremovelist; do
7232 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7233 if test "X$precious_files_regex" != "X"; then
7234 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7239 removelist="$removelist $p"
7244 test -n "$removelist" && \
7245 func_show_eval "${RM}r \$removelist"
7248 # Now set the variables for building old libraries.
7249 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7250 oldlibs="$oldlibs $output_objdir/$libname.$libext"
7252 # Transform .lo files to .o files.
7253 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7256 # Eliminate all temporary directories.
7257 #for path in $notinst_path; do
7258 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7259 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7260 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7263 if test -n "$xrpath"; then
7264 # If the user specified any rpath flags, then add them.
7266 for libdir in $xrpath; do
7267 temp_xrpath="$temp_xrpath -R$libdir"
7268 case "$finalize_rpath " in
7270 *) finalize_rpath="$finalize_rpath $libdir" ;;
7273 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7274 dependency_libs="$temp_xrpath $dependency_libs"
7278 # Make sure dlfiles contains only unique files that won't be dlpreopened
7279 old_dlfiles="$dlfiles"
7281 for lib in $old_dlfiles; do
7282 case " $dlprefiles $dlfiles " in
7284 *) dlfiles="$dlfiles $lib" ;;
7288 # Make sure dlprefiles contains only unique files
7289 old_dlprefiles="$dlprefiles"
7291 for lib in $old_dlprefiles; do
7292 case "$dlprefiles " in
7294 *) dlprefiles="$dlprefiles $lib" ;;
7298 if test "$build_libtool_libs" = yes; then
7299 if test -n "$rpath"; then
7301 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7302 # these systems don't actually have a c library (as such)!
7304 *-*-rhapsody* | *-*-darwin1.[012])
7305 # Rhapsody C library is in the System framework
7306 deplibs="$deplibs System.ltframework"
7309 # Don't link with libc until the a.out ld.so is fixed.
7311 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7312 # Do not include libc due to us having libc/libc_r.
7314 *-*-sco3.2v5* | *-*-sco5v6*)
7315 # Causes problems with __ctype
7317 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7318 # Compiler inserts libc in the correct place for threads to work
7321 # Add libc to deplibs on all other systems if necessary.
7322 if test "$build_libtool_need_lc" = "yes"; then
7323 deplibs="$deplibs -lc"
7329 # Transform deplibs into only deplibs that can be linked in shared.
7331 libname_save=$libname
7332 release_save=$release
7333 versuffix_save=$versuffix
7335 # I'm not sure if I'm treating the release correctly. I think
7336 # release should show up in the -l (ie -lgmp5) so we don't want to
7337 # add it in twice. Is that correct?
7343 case $deplibs_check_method in
7345 # Don't check for shared/static. Everything works.
7346 # This might be a little naive. We might want to check
7347 # whether the library exists or not. But this is on
7348 # osf3 & osf4 and I'm not really sure... Just
7349 # implementing what was already the behavior.
7353 # This code stresses the "libraries are programs" paradigm to its
7354 # limits. Maybe even breaks it. We compile a program, linking it
7355 # against the deplibs as a proxy for the library. Then we can check
7356 # whether they linked in statically or dynamically with ldd.
7357 $opt_dry_run || $RM conftest.c
7358 cat > conftest.c <<EOF
7359 int main() { return 0; }
7361 $opt_dry_run || $RM conftest
7362 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7363 ldd_output=`ldd conftest`
7364 for i in $deplibs; do
7367 func_stripname -l '' "$i"
7368 name=$func_stripname_result
7369 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7370 case " $predeps $postdeps " in
7372 newdeplibs="$newdeplibs $i"
7377 if test -n "$i" ; then
7378 libname=`eval "\\$ECHO \"$libname_spec\""`
7379 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7380 set dummy $deplib_matches; shift
7382 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7383 newdeplibs="$newdeplibs $i"
7387 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7388 echo "*** I have the capability to make that library automatically link in when"
7389 echo "*** you link to this library. But I can only do this if you have a"
7390 echo "*** shared version of the library, which I believe you do not have"
7391 echo "*** because a test_compile did reveal that the linker did not use it for"
7392 echo "*** its dynamic dependency list that programs get resolved with at runtime."
7397 newdeplibs="$newdeplibs $i"
7402 # Error occurred in the first compile. Let's try to salvage
7403 # the situation: Compile a separate program for each library.
7404 for i in $deplibs; do
7407 func_stripname -l '' "$i"
7408 name=$func_stripname_result
7409 $opt_dry_run || $RM conftest
7410 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7411 ldd_output=`ldd conftest`
7412 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7413 case " $predeps $postdeps " in
7415 newdeplibs="$newdeplibs $i"
7420 if test -n "$i" ; then
7421 libname=`eval "\\$ECHO \"$libname_spec\""`
7422 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7423 set dummy $deplib_matches; shift
7425 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7426 newdeplibs="$newdeplibs $i"
7430 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7431 echo "*** I have the capability to make that library automatically link in when"
7432 echo "*** you link to this library. But I can only do this if you have a"
7433 echo "*** shared version of the library, which you do not appear to have"
7434 echo "*** because a test_compile did reveal that the linker did not use this one"
7435 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7441 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
7442 echo "*** make it link in! You will probably need to install it or some"
7443 echo "*** library that it depends on before this library will be fully"
7444 echo "*** functional. Installing it before continuing would be even better."
7448 newdeplibs="$newdeplibs $i"
7455 set dummy $deplibs_check_method; shift
7456 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7457 for a_deplib in $deplibs; do
7460 func_stripname -l '' "$a_deplib"
7461 name=$func_stripname_result
7462 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7463 case " $predeps $postdeps " in
7465 newdeplibs="$newdeplibs $a_deplib"
7470 if test -n "$a_deplib" ; then
7471 libname=`eval "\\$ECHO \"$libname_spec\""`
7472 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7473 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7474 for potent_lib in $potential_libs; do
7475 # Follow soft links.
7476 if ls -lLd "$potent_lib" 2>/dev/null |
7477 $GREP " -> " >/dev/null; then
7480 # The statement above tries to avoid entering an
7481 # endless loop below, in case of cyclic links.
7482 # We might still enter an endless loop, since a link
7483 # loop can be closed while we follow links,
7485 potlib="$potent_lib"
7486 while test -h "$potlib" 2>/dev/null; do
7487 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7489 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7490 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7493 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7495 $EGREP "$file_magic_regex" > /dev/null; then
7496 newdeplibs="$newdeplibs $a_deplib"
7503 if test -n "$a_deplib" ; then
7506 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7507 echo "*** I have the capability to make that library automatically link in when"
7508 echo "*** you link to this library. But I can only do this if you have a"
7509 echo "*** shared version of the library, which you do not appear to have"
7510 echo "*** because I did check the linker path looking for a file starting"
7511 if test -z "$potlib" ; then
7512 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7514 $ECHO "*** with $libname and none of the candidates passed a file format test"
7515 $ECHO "*** using a file magic. Last file checked: $potlib"
7520 # Add a -L argument.
7521 newdeplibs="$newdeplibs $a_deplib"
7524 done # Gone through all deplibs.
7527 set dummy $deplibs_check_method; shift
7528 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7529 for a_deplib in $deplibs; do
7532 func_stripname -l '' "$a_deplib"
7533 name=$func_stripname_result
7534 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7535 case " $predeps $postdeps " in
7537 newdeplibs="$newdeplibs $a_deplib"
7542 if test -n "$a_deplib" ; then
7543 libname=`eval "\\$ECHO \"$libname_spec\""`
7544 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7545 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7546 for potent_lib in $potential_libs; do
7547 potlib="$potent_lib" # see symlink-check above in file_magic test
7548 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7549 $EGREP "$match_pattern_regex" > /dev/null; then
7550 newdeplibs="$newdeplibs $a_deplib"
7557 if test -n "$a_deplib" ; then
7560 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7561 echo "*** I have the capability to make that library automatically link in when"
7562 echo "*** you link to this library. But I can only do this if you have a"
7563 echo "*** shared version of the library, which you do not appear to have"
7564 echo "*** because I did check the linker path looking for a file starting"
7565 if test -z "$potlib" ; then
7566 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7568 $ECHO "*** with $libname and none of the candidates passed a file format test"
7569 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7574 # Add a -L argument.
7575 newdeplibs="$newdeplibs $a_deplib"
7578 done # Gone through all deplibs.
7582 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7583 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7584 for i in $predeps $postdeps ; do
7585 # can't use Xsed below, because $i might contain '/'
7586 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7589 case $tmp_deplibs in
7592 if test "X$deplibs_check_method" = "Xnone"; then
7593 echo "*** Warning: inter-library dependencies are not supported in this platform."
7595 echo "*** Warning: inter-library dependencies are not known to be supported."
7597 echo "*** All declared inter-library dependencies are being dropped."
7603 versuffix=$versuffix_save
7605 release=$release_save
7606 libname=$libname_save
7610 *-*-rhapsody* | *-*-darwin1.[012])
7611 # On Rhapsody replace the C library with the System framework
7612 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7616 if test "$droppeddeps" = yes; then
7617 if test "$module" = yes; then
7619 echo "*** Warning: libtool could not satisfy all declared inter-library"
7620 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7621 echo "*** a static module, that should work as long as the dlopening"
7622 echo "*** application is linked with the -dlopen flag."
7623 if test -z "$global_symbol_pipe"; then
7625 echo "*** However, this would only work if libtool was able to extract symbol"
7626 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7627 echo "*** not find such a program. So, this module is probably useless."
7628 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7630 if test "$build_old_libs" = no; then
7631 oldlibs="$output_objdir/$libname.$libext"
7632 build_libtool_libs=module
7635 build_libtool_libs=no
7638 echo "*** The inter-library dependencies that have been dropped here will be"
7639 echo "*** automatically added whenever a program is linked with this library"
7640 echo "*** or is declared to -dlopen it."
7642 if test "$allow_undefined" = no; then
7644 echo "*** Since this library must not contain undefined symbols,"
7645 echo "*** because either the platform does not support them or"
7646 echo "*** it was explicitly requested with -no-undefined,"
7647 echo "*** libtool will only create a static version of it."
7648 if test "$build_old_libs" = no; then
7649 oldlibs="$output_objdir/$libname.$libext"
7650 build_libtool_libs=module
7653 build_libtool_libs=no
7658 # Done checking deplibs!
7661 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7664 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7665 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7666 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7670 # move library search paths that coincide with paths to not yet
7671 # installed libraries to the beginning of the library search list
7673 for path in $notinst_path; do
7674 case " $new_libs " in
7675 *" -L$path/$objdir "*) ;;
7677 case " $deplibs " in
7678 *" -L$path/$objdir "*)
7679 new_libs="$new_libs -L$path/$objdir" ;;
7684 for deplib in $deplibs; do
7687 case " $new_libs " in
7689 *) new_libs="$new_libs $deplib" ;;
7692 *) new_libs="$new_libs $deplib" ;;
7697 # All the library-specific variables (install_libdir is set above).
7702 # Test again, we may have decided not to build it any more
7703 if test "$build_libtool_libs" = yes; then
7704 if test "$hardcode_into_libs" = yes; then
7705 # Hardcode the library paths
7708 rpath="$finalize_rpath"
7709 test "$mode" != relink && rpath="$compile_rpath$rpath"
7710 for libdir in $rpath; do
7711 if test -n "$hardcode_libdir_flag_spec"; then
7712 if test -n "$hardcode_libdir_separator"; then
7713 if test -z "$hardcode_libdirs"; then
7714 hardcode_libdirs="$libdir"
7716 # Just accumulate the unique libdirs.
7717 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7718 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7721 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7726 eval flag=\"$hardcode_libdir_flag_spec\"
7727 dep_rpath="$dep_rpath $flag"
7729 elif test -n "$runpath_var"; then
7730 case "$perm_rpath " in
7732 *) perm_rpath="$perm_rpath $libdir" ;;
7736 # Substitute the hardcoded libdirs into the rpath.
7737 if test -n "$hardcode_libdir_separator" &&
7738 test -n "$hardcode_libdirs"; then
7739 libdir="$hardcode_libdirs"
7740 if test -n "$hardcode_libdir_flag_spec_ld"; then
7741 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
7743 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
7746 if test -n "$runpath_var" && test -n "$perm_rpath"; then
7747 # We should set the runpath_var.
7749 for dir in $perm_rpath; do
7752 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
7754 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
7757 shlibpath="$finalize_shlibpath"
7758 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
7759 if test -n "$shlibpath"; then
7760 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
7763 # Get the real and link names of the library.
7764 eval shared_ext=\"$shrext_cmds\"
7765 eval library_names=\"$library_names_spec\"
7766 set dummy $library_names
7771 if test -n "$soname_spec"; then
7772 eval soname=\"$soname_spec\"
7776 if test -z "$dlname"; then
7780 lib="$output_objdir/$realname"
7784 linknames="$linknames $link"
7787 # Use standard objects if they are pic
7788 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
7789 test "X$libobjs" = "X " && libobjs=
7792 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7793 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7794 export_symbols="$output_objdir/$libname.uexp"
7795 delfiles="$delfiles $export_symbols"
7798 orig_export_symbols=
7800 cygwin* | mingw* | cegcc*)
7801 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
7802 # exporting using user supplied symfile
7803 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
7804 # and it's NOT already a .def file. Must figure out
7805 # which of the given symbols are data symbols and tag
7806 # them as such. So, trigger use of export_symbols_cmds.
7807 # export_symbols gets reassigned inside the "prepare
7808 # the list of exported symbols" if statement, so the
7809 # include_expsyms logic still works.
7810 orig_export_symbols="$export_symbols"
7812 always_export_symbols=yes
7818 # Prepare the list of exported symbols
7819 if test -z "$export_symbols"; then
7820 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
7821 func_verbose "generating symbol list for \`$libname.la'"
7822 export_symbols="$output_objdir/$libname.exp"
7823 $opt_dry_run || $RM $export_symbols
7824 cmds=$export_symbols_cmds
7825 save_ifs="$IFS"; IFS='~'
7826 for cmd in $cmds; do
7830 len=$func_len_result
7831 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7832 func_show_eval "$cmd" 'exit $?'
7833 skipped_export=false
7835 # The command line is too long to execute in one step.
7836 func_verbose "using reloadable object file for export list..."
7838 # Break out early, otherwise skipped_export may be
7839 # set to false by a later but shorter cmd.
7844 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7845 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7846 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7851 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7852 tmp_export_symbols="$export_symbols"
7853 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7854 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7857 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7858 # The given exports_symbols file has to be filtered, so filter it.
7859 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7860 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7861 # 's' commands which not all seds can handle. GNU sed should be fine
7862 # though. Also, the filter scales superlinearly with the number of
7863 # global variables. join(1) would be nice here, but unfortunately
7864 # isn't a blessed tool.
7865 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7866 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7867 export_symbols=$output_objdir/$libname.def
7868 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7872 for test_deplib in $deplibs; do
7873 case " $convenience " in
7874 *" $test_deplib "*) ;;
7876 tmp_deplibs="$tmp_deplibs $test_deplib"
7880 deplibs="$tmp_deplibs"
7882 if test -n "$convenience"; then
7883 if test -n "$whole_archive_flag_spec" &&
7884 test "$compiler_needs_object" = yes &&
7885 test -z "$libobjs"; then
7886 # extract the archives, so we have objects to list.
7887 # TODO: could optimize this to just extract one archive.
7888 whole_archive_flag_spec=
7890 if test -n "$whole_archive_flag_spec"; then
7891 save_libobjs=$libobjs
7892 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7893 test "X$libobjs" = "X " && libobjs=
7895 gentop="$output_objdir/${outputname}x"
7896 generated="$generated $gentop"
7898 func_extract_archives $gentop $convenience
7899 libobjs="$libobjs $func_extract_archives_result"
7900 test "X$libobjs" = "X " && libobjs=
7904 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7905 eval flag=\"$thread_safe_flag_spec\"
7906 linker_flags="$linker_flags $flag"
7909 # Make a backup of the uninstalled library when relinking
7910 if test "$mode" = relink; then
7911 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7914 # Do each of the archive commands.
7915 if test "$module" = yes && test -n "$module_cmds" ; then
7916 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7917 eval test_cmds=\"$module_expsym_cmds\"
7918 cmds=$module_expsym_cmds
7920 eval test_cmds=\"$module_cmds\"
7924 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7925 eval test_cmds=\"$archive_expsym_cmds\"
7926 cmds=$archive_expsym_cmds
7928 eval test_cmds=\"$archive_cmds\"
7933 if test "X$skipped_export" != "X:" &&
7934 func_len " $test_cmds" &&
7935 len=$func_len_result &&
7936 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7939 # The command line is too long to link in one step, link piecewise
7940 # or, if using GNU ld and skipped_export is not :, use a linker
7943 # Save the value of $output and $libobjs because we want to
7944 # use them later. If we have whole_archive_flag_spec, we
7945 # want to use save_libobjs as it was before
7946 # whole_archive_flag_spec was expanded, because we can't
7947 # assume the linker understands whole_archive_flag_spec.
7948 # This may have to be revisited, in case too many
7949 # convenience libraries get linked in and end up exceeding
7951 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7952 save_libobjs=$libobjs
7955 func_basename "$output"
7956 output_la=$func_basename_result
7958 # Clear the reloadable object creation command queue and
7959 # initialize k to one.
7966 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7967 output=${output_objdir}/${output_la}.lnkscript
7968 func_verbose "creating GNU ld script: $output"
7969 echo 'INPUT (' > $output
7970 for obj in $save_libobjs
7972 $ECHO "$obj" >> $output
7975 delfiles="$delfiles $output"
7976 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7977 output=${output_objdir}/${output_la}.lnk
7978 func_verbose "creating linker input file list: $output"
7983 if test "$compiler_needs_object" = yes; then
7989 $ECHO "$obj" >> $output
7991 delfiles="$delfiles $output"
7992 output=$firstobj\"$file_list_spec$output\"
7994 if test -n "$save_libobjs"; then
7995 func_verbose "creating reloadable object files..."
7996 output=$output_objdir/$output_la-${k}.$objext
7997 eval test_cmds=\"$reload_cmds\"
7998 func_len " $test_cmds"
7999 len0=$func_len_result
8002 # Loop over the list of objects to be linked.
8003 for obj in $save_libobjs
8006 func_arith $len + $func_len_result
8007 len=$func_arith_result
8008 if test "X$objlist" = X ||
8009 test "$len" -lt "$max_cmd_len"; then
8010 func_append objlist " $obj"
8012 # The command $test_cmds is almost too long, add a
8013 # command to the queue.
8014 if test "$k" -eq 1 ; then
8015 # The first file doesn't have a previous command to add.
8016 reload_objs=$objlist
8017 eval concat_cmds=\"$reload_cmds\"
8019 # All subsequent reloadable object files will link in
8020 # the last one created.
8021 reload_objs="$objlist $last_robj"
8022 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8024 last_robj=$output_objdir/$output_la-${k}.$objext
8026 k=$func_arith_result
8027 output=$output_objdir/$output_la-${k}.$objext
8029 func_len " $last_robj"
8030 func_arith $len0 + $func_len_result
8031 len=$func_arith_result
8034 # Handle the remaining objects by creating one last
8035 # reloadable object file. All subsequent reloadable object
8036 # files will link in the last one created.
8037 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8038 reload_objs="$objlist $last_robj"
8039 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8040 if test -n "$last_robj"; then
8041 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8043 delfiles="$delfiles $output"
8049 if ${skipped_export-false}; then
8050 func_verbose "generating symbol list for \`$libname.la'"
8051 export_symbols="$output_objdir/$libname.exp"
8052 $opt_dry_run || $RM $export_symbols
8054 # Append the command to create the export file.
8055 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8056 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8057 if test -n "$last_robj"; then
8058 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8062 test -n "$save_libobjs" &&
8063 func_verbose "creating a temporary reloadable object file: $output"
8065 # Loop through the commands generated above and execute them.
8066 save_ifs="$IFS"; IFS='~'
8067 for cmd in $concat_cmds; do
8070 func_quote_for_expand "$cmd"
8071 eval "func_echo $func_quote_for_expand_result"
8073 $opt_dry_run || eval "$cmd" || {
8076 # Restore the uninstalled library and exit
8077 if test "$mode" = relink; then
8078 ( cd "$output_objdir" && \
8079 $RM "${realname}T" && \
8080 $MV "${realname}U" "$realname" )
8088 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8089 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8090 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8094 if ${skipped_export-false}; then
8095 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8096 tmp_export_symbols="$export_symbols"
8097 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8098 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8101 if test -n "$orig_export_symbols"; then
8102 # The given exports_symbols file has to be filtered, so filter it.
8103 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8104 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8105 # 's' commands which not all seds can handle. GNU sed should be fine
8106 # though. Also, the filter scales superlinearly with the number of
8107 # global variables. join(1) would be nice here, but unfortunately
8108 # isn't a blessed tool.
8109 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8110 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8111 export_symbols=$output_objdir/$libname.def
8112 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8117 # Restore the value of output.
8120 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8121 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8122 test "X$libobjs" = "X " && libobjs=
8124 # Expand the library linking commands again to reset the
8125 # value of $libobjs for piecewise linking.
8127 # Do each of the archive commands.
8128 if test "$module" = yes && test -n "$module_cmds" ; then
8129 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8130 cmds=$module_expsym_cmds
8135 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8136 cmds=$archive_expsym_cmds
8143 if test -n "$delfiles"; then
8144 # Append the command to remove temporary files to $cmds.
8145 eval cmds=\"\$cmds~\$RM $delfiles\"
8148 # Add any objects from preloaded convenience libraries
8149 if test -n "$dlprefiles"; then
8150 gentop="$output_objdir/${outputname}x"
8151 generated="$generated $gentop"
8153 func_extract_archives $gentop $dlprefiles
8154 libobjs="$libobjs $func_extract_archives_result"
8155 test "X$libobjs" = "X " && libobjs=
8158 save_ifs="$IFS"; IFS='~'
8159 for cmd in $cmds; do
8163 func_quote_for_expand "$cmd"
8164 eval "func_echo $func_quote_for_expand_result"
8166 $opt_dry_run || eval "$cmd" || {
8169 # Restore the uninstalled library and exit
8170 if test "$mode" = relink; then
8171 ( cd "$output_objdir" && \
8172 $RM "${realname}T" && \
8173 $MV "${realname}U" "$realname" )
8181 # Restore the uninstalled library and exit
8182 if test "$mode" = relink; then
8183 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8185 if test -n "$convenience"; then
8186 if test -z "$whole_archive_flag_spec"; then
8187 func_show_eval '${RM}r "$gentop"'
8194 # Create links to the real library.
8195 for linkname in $linknames; do
8196 if test "$realname" != "$linkname"; then
8197 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8201 # If -module or -export-dynamic was specified, set the dlname.
8202 if test "$module" = yes || test "$export_dynamic" = yes; then
8203 # On all known operating systems, these are identical.
8210 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8211 func_warning "\`-dlopen' is ignored for objects"
8216 func_warning "\`-l' and \`-L' are ignored for objects" ;;
8219 test -n "$rpath" && \
8220 func_warning "\`-rpath' is ignored for objects"
8222 test -n "$xrpath" && \
8223 func_warning "\`-R' is ignored for objects"
8225 test -n "$vinfo" && \
8226 func_warning "\`-version-info' is ignored for objects"
8228 test -n "$release" && \
8229 func_warning "\`-release' is ignored for objects"
8233 test -n "$objs$old_deplibs" && \
8234 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8238 obj=$func_lo2o_result
8246 # Delete the old objects.
8247 $opt_dry_run || $RM $obj $libobj
8249 # Objects from convenience libraries. This assumes
8250 # single-version convenience libraries. Whenever we create
8251 # different ones for PIC/non-PIC, this we'll have to duplicate
8255 # reload_cmds runs $LD directly, so let us get rid of
8256 # -Wl from whole_archive_flag_spec and hope we can get by with
8257 # turning comma into space..
8260 if test -n "$convenience"; then
8261 if test -n "$whole_archive_flag_spec"; then
8262 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8263 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8265 gentop="$output_objdir/${obj}x"
8266 generated="$generated $gentop"
8268 func_extract_archives $gentop $convenience
8269 reload_conv_objs="$reload_objs $func_extract_archives_result"
8273 # Create the old-style object.
8274 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8277 func_execute_cmds "$reload_cmds" 'exit $?'
8279 # Exit if we aren't doing a library object file.
8280 if test -z "$libobj"; then
8281 if test -n "$gentop"; then
8282 func_show_eval '${RM}r "$gentop"'
8288 if test "$build_libtool_libs" != yes; then
8289 if test -n "$gentop"; then
8290 func_show_eval '${RM}r "$gentop"'
8293 # Create an invalid libtool object if no PIC, so that we don't
8294 # accidentally link it into a program.
8295 # $show "echo timestamp > $libobj"
8296 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8300 if test -n "$pic_flag" || test "$pic_mode" != default; then
8301 # Only do commands if we really have different PIC objects.
8302 reload_objs="$libobjs $reload_conv_objs"
8304 func_execute_cmds "$reload_cmds" 'exit $?'
8307 if test -n "$gentop"; then
8308 func_show_eval '${RM}r "$gentop"'
8316 *cygwin*) func_stripname '' '.exe' "$output"
8317 output=$func_stripname_result.exe;;
8319 test -n "$vinfo" && \
8320 func_warning "\`-version-info' is ignored for programs"
8322 test -n "$release" && \
8323 func_warning "\`-release' is ignored for programs"
8325 test "$preload" = yes \
8326 && test "$dlopen_support" = unknown \
8327 && test "$dlopen_self" = unknown \
8328 && test "$dlopen_self_static" = unknown && \
8329 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8332 *-*-rhapsody* | *-*-darwin1.[012])
8333 # On Rhapsody replace the C library is the System framework
8334 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8335 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8341 # Don't allow lazy linking, it breaks C++ global constructors
8342 # But is supposedly fixed on 10.4 or later (yay!).
8343 if test "$tagname" = CXX ; then
8344 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8346 compile_command="$compile_command ${wl}-bind_at_load"
8347 finalize_command="$finalize_command ${wl}-bind_at_load"
8351 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8352 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8353 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8358 # move library search paths that coincide with paths to not yet
8359 # installed libraries to the beginning of the library search list
8361 for path in $notinst_path; do
8362 case " $new_libs " in
8363 *" -L$path/$objdir "*) ;;
8365 case " $compile_deplibs " in
8366 *" -L$path/$objdir "*)
8367 new_libs="$new_libs -L$path/$objdir" ;;
8372 for deplib in $compile_deplibs; do
8375 case " $new_libs " in
8377 *) new_libs="$new_libs $deplib" ;;
8380 *) new_libs="$new_libs $deplib" ;;
8383 compile_deplibs="$new_libs"
8386 compile_command="$compile_command $compile_deplibs"
8387 finalize_command="$finalize_command $finalize_deplibs"
8389 if test -n "$rpath$xrpath"; then
8390 # If the user specified any rpath flags, then add them.
8391 for libdir in $rpath $xrpath; do
8392 # This is the magic to use -rpath.
8393 case "$finalize_rpath " in
8395 *) finalize_rpath="$finalize_rpath $libdir" ;;
8400 # Now hardcode the library paths
8403 for libdir in $compile_rpath $finalize_rpath; do
8404 if test -n "$hardcode_libdir_flag_spec"; then
8405 if test -n "$hardcode_libdir_separator"; then
8406 if test -z "$hardcode_libdirs"; then
8407 hardcode_libdirs="$libdir"
8409 # Just accumulate the unique libdirs.
8410 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8411 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8414 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8419 eval flag=\"$hardcode_libdir_flag_spec\"
8420 rpath="$rpath $flag"
8422 elif test -n "$runpath_var"; then
8423 case "$perm_rpath " in
8425 *) perm_rpath="$perm_rpath $libdir" ;;
8429 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8430 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8431 case :$dllsearchpath: in
8433 ::) dllsearchpath=$libdir;;
8434 *) dllsearchpath="$dllsearchpath:$libdir";;
8436 case :$dllsearchpath: in
8437 *":$testbindir:"*) ;;
8438 ::) dllsearchpath=$testbindir;;
8439 *) dllsearchpath="$dllsearchpath:$testbindir";;
8444 # Substitute the hardcoded libdirs into the rpath.
8445 if test -n "$hardcode_libdir_separator" &&
8446 test -n "$hardcode_libdirs"; then
8447 libdir="$hardcode_libdirs"
8448 eval rpath=\" $hardcode_libdir_flag_spec\"
8450 compile_rpath="$rpath"
8454 for libdir in $finalize_rpath; do
8455 if test -n "$hardcode_libdir_flag_spec"; then
8456 if test -n "$hardcode_libdir_separator"; then
8457 if test -z "$hardcode_libdirs"; then
8458 hardcode_libdirs="$libdir"
8460 # Just accumulate the unique libdirs.
8461 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8462 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8465 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8470 eval flag=\"$hardcode_libdir_flag_spec\"
8471 rpath="$rpath $flag"
8473 elif test -n "$runpath_var"; then
8474 case "$finalize_perm_rpath " in
8476 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
8480 # Substitute the hardcoded libdirs into the rpath.
8481 if test -n "$hardcode_libdir_separator" &&
8482 test -n "$hardcode_libdirs"; then
8483 libdir="$hardcode_libdirs"
8484 eval rpath=\" $hardcode_libdir_flag_spec\"
8486 finalize_rpath="$rpath"
8488 if test -n "$libobjs" && test "$build_old_libs" = yes; then
8489 # Transform all the library objects into standard objects.
8490 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8491 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8494 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8496 # template prelinking step
8497 if test -n "$prelink_cmds"; then
8498 func_execute_cmds "$prelink_cmds" 'exit $?'
8501 wrappers_required=yes
8503 *cegcc* | *mingw32ce*)
8504 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8505 wrappers_required=no
8507 *cygwin* | *mingw* )
8508 if test "$build_libtool_libs" != yes; then
8509 wrappers_required=no
8513 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8514 wrappers_required=no
8518 if test "$wrappers_required" = no; then
8519 # Replace the output file specification.
8520 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8521 link_command="$compile_command$compile_rpath"
8523 # We have no uninstalled library dependencies, so finalize right now.
8525 func_show_eval "$link_command" 'exit_status=$?'
8527 # Delete the generated files.
8528 if test -f "$output_objdir/${outputname}S.${objext}"; then
8529 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8535 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8536 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8538 if test -n "$finalize_shlibpath"; then
8539 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8544 if test -n "$runpath_var"; then
8545 if test -n "$perm_rpath"; then
8546 # We should set the runpath_var.
8548 for dir in $perm_rpath; do
8551 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8553 if test -n "$finalize_perm_rpath"; then
8554 # We should set the runpath_var.
8556 for dir in $finalize_perm_rpath; do
8559 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8563 if test "$no_install" = yes; then
8564 # We don't need to create a wrapper script.
8565 link_command="$compile_var$compile_command$compile_rpath"
8566 # Replace the output file specification.
8567 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8568 # Delete the old output file.
8569 $opt_dry_run || $RM $output
8570 # Link the executable and exit
8571 func_show_eval "$link_command" 'exit $?'
8575 if test "$hardcode_action" = relink; then
8576 # Fast installation is not supported
8577 link_command="$compile_var$compile_command$compile_rpath"
8578 relink_command="$finalize_var$finalize_command$finalize_rpath"
8580 func_warning "this platform does not like uninstalled shared libraries"
8581 func_warning "\`$output' will be relinked during installation"
8583 if test "$fast_install" != no; then
8584 link_command="$finalize_var$compile_command$finalize_rpath"
8585 if test "$fast_install" = yes; then
8586 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8588 # fast_install is set to needless
8592 link_command="$compile_var$compile_command$compile_rpath"
8593 relink_command="$finalize_var$finalize_command$finalize_rpath"
8597 # Replace the output file specification.
8598 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
8600 # Delete the old output files.
8601 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
8603 func_show_eval "$link_command" 'exit $?'
8605 # Now create the wrapper script.
8606 func_verbose "creating $output"
8608 # Quote the relink command for shipping.
8609 if test -n "$relink_command"; then
8610 # Preserve any variables that may affect compiler behavior
8611 for var in $variables_saved_for_relink; do
8612 if eval test -z \"\${$var+set}\"; then
8613 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8614 elif eval var_value=\$$var; test -z "$var_value"; then
8615 relink_command="$var=; export $var; $relink_command"
8617 func_quote_for_eval "$var_value"
8618 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8621 relink_command="(cd `pwd`; $relink_command)"
8622 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8625 # Only actually do things if not in dry run mode.
8627 # win32 will think the script is a binary if it has
8628 # a .exe suffix, so we strip it off here.
8630 *.exe) func_stripname '' '.exe' "$output"
8631 output=$func_stripname_result ;;
8633 # test for cygwin because mv fails w/o .exe extensions
8637 func_stripname '' '.exe' "$outputname"
8638 outputname=$func_stripname_result ;;
8642 *cygwin* | *mingw* )
8643 func_dirname_and_basename "$output" "" "."
8644 output_name=$func_basename_result
8645 output_path=$func_dirname_result
8646 cwrappersource="$output_path/$objdir/lt-$output_name.c"
8647 cwrapper="$output_path/$output_name.exe"
8648 $RM $cwrappersource $cwrapper
8649 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
8651 func_emit_cwrapperexe_src > $cwrappersource
8653 # The wrapper executable is built using the $host compiler,
8654 # because it contains $host paths and files. If cross-
8655 # compiling, it, like the target executable, must be
8656 # executed on the $host or under an emulation environment.
8658 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
8662 # Now, create the wrapper script for func_source use:
8663 func_ltwrapper_scriptname $cwrapper
8664 $RM $func_ltwrapper_scriptname_result
8665 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
8667 # note: this script will not be executed, so do not chmod.
8668 if test "x$build" = "x$host" ; then
8669 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
8671 func_emit_wrapper no > $func_ltwrapper_scriptname_result
8677 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
8679 func_emit_wrapper no > $output
8688 # See if we need to build an old-fashioned archive.
8689 for oldlib in $oldlibs; do
8691 if test "$build_libtool_libs" = convenience; then
8692 oldobjs="$libobjs_save $symfileobj"
8693 addlibs="$convenience"
8694 build_libtool_libs=no
8696 if test "$build_libtool_libs" = module; then
8697 oldobjs="$libobjs_save"
8698 build_libtool_libs=no
8700 oldobjs="$old_deplibs $non_pic_objects"
8701 if test "$preload" = yes && test -f "$symfileobj"; then
8702 oldobjs="$oldobjs $symfileobj"
8705 addlibs="$old_convenience"
8708 if test -n "$addlibs"; then
8709 gentop="$output_objdir/${outputname}x"
8710 generated="$generated $gentop"
8712 func_extract_archives $gentop $addlibs
8713 oldobjs="$oldobjs $func_extract_archives_result"
8716 # Do each command in the archive commands.
8717 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
8718 cmds=$old_archive_from_new_cmds
8721 # Add any objects from preloaded convenience libraries
8722 if test -n "$dlprefiles"; then
8723 gentop="$output_objdir/${outputname}x"
8724 generated="$generated $gentop"
8726 func_extract_archives $gentop $dlprefiles
8727 oldobjs="$oldobjs $func_extract_archives_result"
8730 # POSIX demands no paths to be encoded in archives. We have
8731 # to avoid creating archives with duplicate basenames if we
8732 # might have to extract them afterwards, e.g., when creating a
8733 # static archive out of a convenience library, or when linking
8734 # the entirety of a libtool archive into another (currently
8735 # not supported by libtool).
8736 if (for obj in $oldobjs
8738 func_basename "$obj"
8739 $ECHO "$func_basename_result"
8740 done | sort | sort -uc >/dev/null 2>&1); then
8743 echo "copying selected object files to avoid basename conflicts..."
8744 gentop="$output_objdir/${outputname}x"
8745 generated="$generated $gentop"
8746 func_mkdir_p "$gentop"
8747 save_oldobjs=$oldobjs
8750 for obj in $save_oldobjs
8752 func_basename "$obj"
8753 objbase="$func_basename_result"
8754 case " $oldobjs " in
8755 " ") oldobjs=$obj ;;
8758 # Make sure we don't pick an alternate name that also
8760 newobj=lt$counter-$objbase
8761 func_arith $counter + 1
8762 counter=$func_arith_result
8763 case " $oldobjs " in
8764 *[\ /]"$newobj "*) ;;
8765 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
8768 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
8769 oldobjs="$oldobjs $gentop/$newobj"
8771 *) oldobjs="$oldobjs $obj" ;;
8775 eval cmds=\"$old_archive_cmds\"
8778 len=$func_len_result
8779 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8780 cmds=$old_archive_cmds
8782 # the command line is too long to link in one step, link in parts
8783 func_verbose "using piecewise archive linking..."
8788 save_oldobjs=$oldobjs
8790 # Is there a better way of finding the last object in the list?
8791 for obj in $save_oldobjs
8795 eval test_cmds=\"$old_archive_cmds\"
8796 func_len " $test_cmds"
8797 len0=$func_len_result
8799 for obj in $save_oldobjs
8802 func_arith $len + $func_len_result
8803 len=$func_arith_result
8804 func_append objlist " $obj"
8805 if test "$len" -lt "$max_cmd_len"; then
8808 # the above command should be used before it gets too long
8810 if test "$obj" = "$last_oldobj" ; then
8813 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8814 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
8821 if test "X$oldobjs" = "X" ; then
8822 eval cmds=\"\$concat_cmds\"
8824 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8828 func_execute_cmds "$cmds" 'exit $?'
8831 test -n "$generated" && \
8832 func_show_eval "${RM}r$generated"
8834 # Now create the libtool archive.
8838 test "$build_old_libs" = yes && old_library="$libname.$libext"
8839 func_verbose "creating $output"
8841 # Preserve any variables that may affect compiler behavior
8842 for var in $variables_saved_for_relink; do
8843 if eval test -z \"\${$var+set}\"; then
8844 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8845 elif eval var_value=\$$var; test -z "$var_value"; then
8846 relink_command="$var=; export $var; $relink_command"
8848 func_quote_for_eval "$var_value"
8849 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8852 # Quote the link command for shipping.
8853 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8854 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8855 if test "$hardcode_automatic" = yes ; then
8859 # Only create the output if not a dry run.
8861 for installed in no yes; do
8862 if test "$installed" = yes; then
8863 if test -z "$install_libdir"; then
8866 output="$output_objdir/$outputname"i
8867 # Replace all uninstalled libtool libraries with the installed ones
8869 for deplib in $dependency_libs; do
8872 func_basename "$deplib"
8873 name="$func_basename_result"
8874 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8875 test -z "$libdir" && \
8876 func_fatal_error "\`$deplib' is not a valid libtool archive"
8877 newdependency_libs="$newdependency_libs $libdir/$name"
8879 *) newdependency_libs="$newdependency_libs $deplib" ;;
8882 dependency_libs="$newdependency_libs"
8885 for lib in $dlfiles; do
8888 func_basename "$lib"
8889 name="$func_basename_result"
8890 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8891 test -z "$libdir" && \
8892 func_fatal_error "\`$lib' is not a valid libtool archive"
8893 newdlfiles="$newdlfiles $libdir/$name"
8895 *) newdlfiles="$newdlfiles $lib" ;;
8898 dlfiles="$newdlfiles"
8900 for lib in $dlprefiles; do
8903 # Only pass preopened files to the pseudo-archive (for
8904 # eventual linking with the app. that links it) if we
8905 # didn't already link the preopened objects directly into
8907 func_basename "$lib"
8908 name="$func_basename_result"
8909 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8910 test -z "$libdir" && \
8911 func_fatal_error "\`$lib' is not a valid libtool archive"
8912 newdlprefiles="$newdlprefiles $libdir/$name"
8916 dlprefiles="$newdlprefiles"
8919 for lib in $dlfiles; do
8921 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8922 *) abs=`pwd`"/$lib" ;;
8924 newdlfiles="$newdlfiles $abs"
8926 dlfiles="$newdlfiles"
8928 for lib in $dlprefiles; do
8930 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8931 *) abs=`pwd`"/$lib" ;;
8933 newdlprefiles="$newdlprefiles $abs"
8935 dlprefiles="$newdlprefiles"
8938 # place dlname in correct position for cygwin
8939 # In fact, it would be nice if we could use this code for all target
8940 # systems that can't hard-code library paths into their executables
8941 # and that have no shared library path variable independent of PATH,
8942 # but it turns out we can't easily determine that from inspecting
8943 # libtool variables, so we have to hard-code the OSs to which it
8944 # applies here; at the moment, that means platforms that use the PE
8945 # object format with DLL files. See the long comment at the top of
8946 # tests/bindir.at for full details.
8948 case $host,$output,$installed,$module,$dlname in
8949 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
8950 # If a -bindir argument was supplied, place the dll there.
8951 if test "x$bindir" != x ;
8953 func_relative_path "$install_libdir" "$bindir"
8954 tdlname=$func_relative_path_result$dlname
8956 # Otherwise fall back on heuristic.
8957 tdlname=../bin/$dlname
8962 # $outputname - a libtool library file
8963 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8965 # Please DO NOT delete this file!
8966 # It is necessary for linking the library.
8968 # The name that we can dlopen(3).
8971 # Names of this library.
8972 library_names='$library_names'
8974 # The name of the static archive.
8975 old_library='$old_library'
8977 # Linker flags that can not go in dependency_libs.
8978 inherited_linker_flags='$new_inherited_linker_flags'
8980 # Libraries that this one depends upon.
8981 dependency_libs='$dependency_libs'
8983 # Names of additional weak libraries provided by this library
8984 weak_library_names='$weak_libs'
8986 # Version information for $libname.
8991 # Is this an already installed library?
8992 installed=$installed
8994 # Should we warn about portability when linking against -modules?
8995 shouldnotlink=$module
8997 # Files to dlopen/dlpreopen
8999 dlpreopen='$dlprefiles'
9001 # Directory that this library needs to be installed in:
9002 libdir='$install_libdir'"
9003 if test "$installed" = no && test "$need_relink" = yes; then
9005 relink_command=\"$relink_command\""
9010 # Do a symbolic link so that the libtool archive can be found in
9011 # LD_LIBRARY_PATH before the program is installed.
9012 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9018 { test "$mode" = link || test "$mode" = relink; } &&
9019 func_mode_link ${1+"$@"}
9022 # func_mode_uninstall arg...
9023 func_mode_uninstall ()
9031 # This variable tells wrapper scripts just to set variables rather
9032 # than running their programs.
9033 libtool_install_magic="$magic"
9038 -f) RM="$RM $arg"; rmforce=yes ;;
9039 -*) RM="$RM $arg" ;;
9040 *) files="$files $arg" ;;
9045 func_fatal_help "you must specify an RM program"
9049 origobjdir="$objdir"
9050 for file in $files; do
9051 func_dirname "$file" "" "."
9052 dir="$func_dirname_result"
9053 if test "X$dir" = X.; then
9054 objdir="$origobjdir"
9056 objdir="$dir/$origobjdir"
9058 func_basename "$file"
9059 name="$func_basename_result"
9060 test "$mode" = uninstall && objdir="$dir"
9062 # Remember objdir for removal later, being careful to avoid duplicates
9063 if test "$mode" = clean; then
9066 *) rmdirs="$rmdirs $objdir" ;;
9070 # Don't error if the file doesn't exist and rm -f was used.
9071 if { test -L "$file"; } >/dev/null 2>&1 ||
9072 { test -h "$file"; } >/dev/null 2>&1 ||
9073 test -f "$file"; then
9075 elif test -d "$file"; then
9078 elif test "$rmforce" = yes; then
9086 # Possibly a libtool archive, so verify it.
9087 if func_lalib_p "$file"; then
9088 func_source $dir/$name
9090 # Delete the libtool libraries and symlinks.
9091 for n in $library_names; do
9092 rmfiles="$rmfiles $objdir/$n"
9094 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
9098 case " $library_names " in
9099 # " " in the beginning catches empty $dlname
9101 *) rmfiles="$rmfiles $objdir/$dlname" ;;
9103 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
9106 if test -n "$library_names"; then
9107 # Do each command in the postuninstall commands.
9108 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9111 if test -n "$old_library"; then
9112 # Do each command in the old_postuninstall commands.
9113 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9115 # FIXME: should reinstall the best remaining shared library.
9122 # Possibly a libtool object, so verify it.
9123 if func_lalib_p "$file"; then
9126 func_source $dir/$name
9128 # Add PIC object to the list of files to remove.
9129 if test -n "$pic_object" &&
9130 test "$pic_object" != none; then
9131 rmfiles="$rmfiles $dir/$pic_object"
9134 # Add non-PIC object to the list of files to remove.
9135 if test -n "$non_pic_object" &&
9136 test "$non_pic_object" != none; then
9137 rmfiles="$rmfiles $dir/$non_pic_object"
9143 if test "$mode" = clean ; then
9147 func_stripname '' '.exe' "$file"
9148 file=$func_stripname_result
9149 func_stripname '' '.exe' "$name"
9150 noexename=$func_stripname_result
9151 # $file with .exe has already been added to rmfiles,
9152 # add $file without .exe
9153 rmfiles="$rmfiles $file"
9156 # Do a test to see if this is a libtool program.
9157 if func_ltwrapper_p "$file"; then
9158 if func_ltwrapper_executable_p "$file"; then
9159 func_ltwrapper_scriptname "$file"
9161 func_source $func_ltwrapper_scriptname_result
9162 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
9165 func_source $dir/$noexename
9168 # note $name still contains .exe if it was in $file originally
9169 # as does the version of $file that was added into $rmfiles
9170 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
9171 if test "$fast_install" = yes && test -n "$relink_command"; then
9172 rmfiles="$rmfiles $objdir/lt-$name"
9174 if test "X$noexename" != "X$name" ; then
9175 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
9181 func_show_eval "$RM $rmfiles" 'exit_status=1'
9183 objdir="$origobjdir"
9185 # Try to remove the ${objdir}s in the directories where we deleted files
9186 for dir in $rmdirs; do
9187 if test -d "$dir"; then
9188 func_show_eval "rmdir $dir >/dev/null 2>&1"
9195 { test "$mode" = uninstall || test "$mode" = clean; } &&
9196 func_mode_uninstall ${1+"$@"}
9198 test -z "$mode" && {
9199 help="$generic_help"
9200 func_fatal_help "you must specify a MODE"
9203 test -z "$exec_cmd" && \
9204 func_fatal_help "invalid operation mode \`$mode'"
9206 if test -n "$exec_cmd"; then
9207 eval exec "$exec_cmd"
9214 # The TAGs below are defined such that we never get into a situation
9215 # in which we disable both kinds of libraries. Given conflicting
9216 # choices, we go for a static library, that is the most portable,
9217 # since we can't tell whether shared libraries were disabled because
9218 # the user asked for that or because the platform doesn't support
9219 # them. This is particularly important on AIX, because we don't
9220 # support having both static and shared libraries enabled at the same
9221 # time on that platform, so we default to a shared-only configuration.
9222 # If a disable-shared tag is given, we'll fallback to a static-only
9223 # configuration. But we'll never go from static-only to shared-only.
9225 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9226 build_libtool_libs=no
9228 # ### END LIBTOOL TAG CONFIG: disable-shared
9230 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
9231 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9232 # ### END LIBTOOL TAG CONFIG: disable-static