3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by config.status (tsremuxcpp) 0.1
5 # Libtool was configured on host koichi-desktop:
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 Free Software Foundation, Inc.
10 # Written by Gordon Matzigkeit, 1996
12 # This file is part of GNU Libtool.
14 # GNU Libtool is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation; either version 2 of
17 # the License, or (at your option) any later version.
19 # As a special exception to the GNU General Public License,
20 # if you distribute this file as part of a program or library that
21 # is built using GNU Libtool, you may include this file under the
22 # same distribution terms that you use for the rest of that program.
24 # GNU Libtool is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with GNU Libtool; see the file COPYING. If not, a copy
31 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32 # obtained by writing to the Free Software Foundation, Inc.,
33 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36 # The names of the tagged configurations supported by this script.
39 # ### BEGIN LIBTOOL CONFIG
41 # Which release of libtool.m4 was used?
45 # Whether or not to build shared libraries.
46 build_libtool_libs=yes
48 # Whether or not to build static libraries.
51 # What type of objects to build.
54 # Whether or not to optimize for fast installation.
59 host=i686-pc-linux-gnu
64 build=i686-pc-linux-gnu
67 # A sed program that does not truncate output.
70 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
71 Xsed="$SED -e 1s/^X//"
73 # A grep program that handles long lines.
79 # A literal string matcher.
82 # A BSD- or MS-compatible name lister.
85 # Whether we need soft or hard links.
88 # What is the maximum length of a command?
91 # Object file suffix (normally "o").
94 # Executable file suffix (normally "").
97 # whether the shell understands "unset".
100 # turn spaces into newlines.
101 SP2NL="tr \\040 \\012"
103 # turn newlines into spaces.
104 NL2SP="tr \\015\\012 \\040\\040"
106 # How to create reloadable object files.
108 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
110 # Method to check whether dependent libraries are shared objects.
111 deplibs_check_method="pass_all"
113 # Command to use when deplibs_check_method == "file_magic".
114 file_magic_cmd="\$MAGIC_CMD"
120 # A symbol stripping program.
123 # Commands used to install an old-style archive.
125 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
126 old_postuninstall_cmds=""
131 # LTCC compiler flags.
134 # Take the output of nm and produce a listing of raw symbols and C names.
135 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
137 # Transform the output of nm in a proper C declaration.
138 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
140 # Transform the output of nm in a C name address pair.
141 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
143 # Transform the output of nm in a C name address pair when lib prefix is needed.
144 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'"
146 # The name of the directory that contains temporary libtool files.
149 # Shell to use when invoking shell scripts.
152 # An echo program that does not interpret backslashes.
155 # Used to examine libraries when file_magic_cmd begins with "file".
158 # Must we lock files when doing compilation?
161 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
164 # Tool to change global to local symbols on Mac OS X.
167 # Tool to manipulate fat objects and archives on Mac OS X.
170 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
173 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
176 # Old archive suffix (normally "a").
179 # Shared library suffix (normally ".so").
182 # The commands to extract the exported symbol list from a shared archive.
183 extract_expsyms_cmds=""
185 # Variables whose values should be saved in libtool wrapper scripts and
186 # restored at link time.
187 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
189 # Do we need the "lib" prefix for modules?
192 # Do we need a version for libraries?
195 # Library versioning type.
198 # Shared library runtime path variable.
199 runpath_var=LD_RUN_PATH
201 # Shared library path variable.
202 shlibpath_var=LD_LIBRARY_PATH
204 # Is shlibpath searched before the hard-coded library search path?
205 shlibpath_overrides_runpath=no
207 # Format of library name prefix.
208 libname_spec="lib\$name"
210 # List of archive names. First name is the real one, the rest are links.
211 # The last name is the one that the linker finds with -lNAME
212 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
214 # The coded name of the library, if different from the real name.
215 soname_spec="\${libname}\${release}\${shared_ext}\$major"
217 # Command to use after installation of a shared archive.
220 # Command to use after uninstallation of a shared archive.
221 postuninstall_cmds=""
223 # Commands used to finish a libtool library installation in a directory.
224 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
226 # As "finish_cmds", except a single script fragment to be evaled but
230 # Whether we should hardcode library paths into libraries.
231 hardcode_into_libs=yes
233 # Compile-time system search path for libraries.
234 sys_lib_search_path_spec="/usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib /lib"
236 # Run-time system search path for libraries.
237 sys_lib_dlsearch_path_spec="/lib /usr/lib /lib/i486-linux-gnu /usr/lib/i486-linux-gnu /usr/lib/alsa-lib /usr/local/lib "
239 # Whether dlopen is supported.
240 dlopen_support=unknown
242 # Whether dlopen of programs is supported.
245 # Whether dlopen of statically linked programs is supported.
246 dlopen_self_static=unknown
248 # Commands to strip libraries.
249 old_striplib="strip --strip-debug"
250 striplib="strip --strip-unneeded"
253 # The linker used to build libraries.
256 # Commands used to build an old-style archive.
257 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
259 # A language specific compiler.
262 # Is the compiler the GNU compiler?
265 # Compiler flag to turn off builtin functions.
266 no_builtin_flag=" -fno-builtin"
268 # How to pass a linker flag through the compiler.
271 # Additional compiler flags for building library objects.
272 pic_flag=" -fPIC -DPIC"
274 # Compiler flag to prevent dynamic linking.
275 link_static_flag="-static"
277 # Does compiler simultaneously support -c and -o options?
280 # Whether or not to add -lc for building shared libraries.
281 build_libtool_need_lc=no
283 # Whether or not to disallow shared libs when runtime libs are static.
284 allow_libtool_libs_with_static_runtimes=no
286 # Compiler flag to allow reflexive dlopens.
287 export_dynamic_flag_spec="\${wl}--export-dynamic"
289 # Compiler flag to generate shared objects directly from archives.
290 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
292 # Whether the compiler copes with passing no objects directly.
293 compiler_needs_object="no"
295 # Create an old-style archive from a shared archive.
296 old_archive_from_new_cmds=""
298 # Create a temporary old-style archive to link instead of a shared archive.
299 old_archive_from_expsyms_cmds=""
301 # Commands used to build a shared archive.
302 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
303 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
304 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
305 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
306 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
308 # Commands used to build a loadable module if different from building
311 module_expsym_cmds=""
313 # Whether we are building with GNU ld or not.
316 # Flag that allows shared libraries with undefined symbols to be built.
317 allow_undefined_flag=""
319 # Flag that enforces no undefined symbols.
322 # Flag to hardcode $libdir into a binary during linking.
323 # This must work even if $libdir does not exist
324 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
326 # If ld is used when linking, flag to hardcode $libdir into a binary
327 # during linking. This must work even if $libdir does not exist.
328 hardcode_libdir_flag_spec_ld=""
330 # Whether we need a single "-rpath" flag with a separated argument.
331 hardcode_libdir_separator=""
333 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
334 # DIR into the resulting binary.
337 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
338 # DIR into the resulting binary and the resulting library dependency is
339 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
340 # library is relocated.
341 hardcode_direct_absolute=no
343 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
344 # into the resulting binary.
347 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
348 # into the resulting binary.
349 hardcode_shlibpath_var=unsupported
351 # Set to "yes" if building a shared library automatically hardcodes DIR
352 # into the library and all subsequent libraries and executables linked
354 hardcode_automatic=no
356 # Set to yes if linker adds runtime paths of dependent libraries
357 # to runtime path list.
360 # Whether libtool must link a program against all its dependency libraries.
361 link_all_deplibs=unknown
363 # Fix the shell variable $srcfile for the compiler.
366 # Set to "yes" if exported symbols are required.
367 always_export_symbols=no
369 # The commands to list exported symbols.
370 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
372 # Symbols that should not be listed in the preloaded symbols.
373 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
375 # Symbols that must always be exported.
378 # Commands necessary for linking programs (against libraries) with templates.
381 # Specify filename containing input files.
384 # How to hardcode a shared library path into an executable.
385 hardcode_action=immediate
387 # The directories searched by this compiler when creating a shared library.
388 compiler_lib_search_dirs=""
390 # Dependencies to place before and after the objects being linked to
391 # create a shared library.
397 # The library search path used internally by the compiler when linking
399 compiler_lib_search_path=""
401 # ### END LIBTOOL CONFIG
403 # Generated from ltmain.m4sh.
405 # ltmain.sh (GNU libtool) 2.2.4
406 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
408 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
409 # This is free software; see the source for copying conditions. There is NO
410 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
412 # GNU Libtool is free software; you can redistribute it and/or modify
413 # it under the terms of the GNU General Public License as published by
414 # the Free Software Foundation; either version 2 of the License, or
415 # (at your option) any later version.
417 # As a special exception to the GNU General Public License,
418 # if you distribute this file as part of a program or library that
419 # is built using GNU Libtool, you may include this file under the
420 # same distribution terms that you use for the rest of that program.
422 # GNU Libtool is distributed in the hope that it will be useful, but
423 # WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
425 # General Public License for more details.
427 # You should have received a copy of the GNU General Public License
428 # along with GNU Libtool; see the file COPYING. If not, a copy
429 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
430 # or obtained by writing to the Free Software Foundation, Inc.,
431 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
433 # Usage: $progname [OPTION]... [MODE-ARG]...
435 # Provide generalized library-building support services.
437 # --config show all configuration variables
438 # --debug enable verbose shell tracing
439 # -n, --dry-run display commands without modifying any files
440 # --features display basic configuration information and exit
441 # --mode=MODE use operation mode MODE
442 # --preserve-dup-deps don't remove duplicate dependency libraries
443 # --quiet, --silent don't print informational messages
444 # --tag=TAG use configuration variables from tag TAG
445 # -v, --verbose print informational messages (default)
446 # --version print version information
447 # -h, --help print short or long 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.
460 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
462 # When reporting a bug, please describe a test case to reproduce it and
463 # include the following information:
465 # host-triplet: $host
468 # compiler flags: $LTCFLAGS
469 # linker: $LD (gnu? $with_gnu_ld)
470 # $progname: (GNU libtool) 2.2.4 Debian-2.2.4-0ubuntu4
471 # automake: $automake_version
472 # autoconf: $autoconf_version
474 # Report bugs to <bug-libtool@gnu.org>.
478 VERSION="2.2.4 Debian-2.2.4-0ubuntu4"
480 package_revision=1.2976
482 # Be Bourne compatible
483 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
486 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
487 # is contrary to our usage. Disable this feature.
488 alias -g '${1+"$@"}'='"$@"'
491 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
493 BIN_SH=xpg4; export BIN_SH # for Tru64
494 DUALCASE=1; export DUALCASE # for MKS sh
496 # NLS nuisances: We save the old values to restore during execute mode.
497 # Only set LANG and LC_ALL to C if already set.
498 # These must not be set unconditionally because not all systems understand
499 # e.g. LANG=C (notably SCO).
502 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
504 eval "if test \"\${$lt_var+set}\" = set; then
505 save_$lt_var=\$$lt_var
508 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
509 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
521 : ${EGREP="/bin/grep -E"}
522 : ${FGREP="/bin/grep -F"}
523 : ${GREP="/bin/grep"}
530 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
531 : ${Xsed="$SED -e 1s/^X//"}
536 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
537 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
539 exit_status=$EXIT_SUCCESS
541 # Make sure IFS has a sensible default
546 dirname="s,/[^/]*$,,"
549 # func_dirname_and_basename file append nondir_replacement
550 # perform func_basename and func_dirname in a single function
552 # dirname: Compute the dirname of FILE. If nonempty,
553 # add APPEND to the result, otherwise set result
554 # to NONDIR_REPLACEMENT.
555 # value returned in "$func_dirname_result"
556 # basename: Compute filename of FILE.
557 # value retuned in "$func_basename_result"
558 # Implementation must be kept synchronized with func_dirname
559 # and func_basename. For efficiency, we do not delegate to
560 # those functions but instead duplicate the functionality here.
561 func_dirname_and_basename ()
563 # Extract subdirectory from the argument.
564 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
565 if test "X$func_dirname_result" = "X${1}"; then
566 func_dirname_result="${3}"
568 func_dirname_result="$func_dirname_result${2}"
570 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
573 # Generated shell functions inserted here.
575 # func_dirname file append nondir_replacement
576 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
577 # otherwise set result to NONDIR_REPLACEMENT.
581 */*) func_dirname_result="${1%/*}${2}" ;;
582 * ) func_dirname_result="${3}" ;;
589 func_basename_result="${1##*/}"
592 # func_dirname_and_basename file append nondir_replacement
593 # perform func_basename and func_dirname in a single function
595 # dirname: Compute the dirname of FILE. If nonempty,
596 # add APPEND to the result, otherwise set result
597 # to NONDIR_REPLACEMENT.
598 # value returned in "$func_dirname_result"
599 # basename: Compute filename of FILE.
600 # value retuned in "$func_basename_result"
601 # Implementation must be kept synchronized with func_dirname
602 # and func_basename. For efficiency, we do not delegate to
603 # those functions but instead duplicate the functionality here.
604 func_dirname_and_basename ()
607 */*) func_dirname_result="${1%/*}${2}" ;;
608 * ) func_dirname_result="${3}" ;;
610 func_basename_result="${1##*/}"
613 # func_stripname prefix suffix name
614 # strip PREFIX and SUFFIX off of NAME.
615 # PREFIX and SUFFIX must not contain globbing or regex special
616 # characters, hashes, percent signs, but SUFFIX may contain a leading
617 # dot (in which case that matches only a dot).
620 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
621 # positional parameters, so assign one to ordinary parameter first.
622 func_stripname_result=${3}
623 func_stripname_result=${func_stripname_result#"${1}"}
624 func_stripname_result=${func_stripname_result%"${2}"}
630 func_opt_split_opt=${1%%=*}
631 func_opt_split_arg=${1#*=}
638 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
639 *) func_lo2o_result=${1} ;;
643 # func_xform libobj-or-source
646 func_xform_result=${1%.*}.lo
649 # func_arith arithmetic-term...
652 func_arith_result=$(( $* ))
656 # STRING may not start with a hyphen.
659 func_len_result=${#1}
663 # func_append var value
664 # Append VALUE to the end of shell variable VAR.
669 # Generated shell functions inserted here.
671 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
672 # is ksh but when the shell is invoked as "sh" and the current value of
673 # the _XPG environment variable is not equal to 1 (one), the special
674 # positional parameter $0, within a function call, is the name of the
678 # The name of this program:
679 # In the unlikely event $progname began with a '-', it would play havoc with
680 # func_echo (imagine progname=-n), so we prepend ./ in that case:
681 func_dirname_and_basename "$progpath"
682 progname=$func_basename_result
684 -*) progname=./$progname ;;
687 # Make sure we have an absolute path for reexecution:
689 [\\/]*|[A-Za-z]:\\*) ;;
691 progdir=$func_dirname_result
692 progdir=`cd "$progdir" && pwd`
693 progpath="$progdir/$progname"
698 for progdir in $PATH; do
700 test -x "$progdir/$progname" && break
703 test -n "$progdir" || progdir=`pwd`
704 progpath="$progdir/$progname"
708 # Sed substitution that helps us do robust quoting. It backslashifies
709 # metacharacters that are still active within double-quoted strings.
710 Xsed="${SED}"' -e 1s/^X//'
711 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
713 # Same as above, but do not quote variable references.
714 double_quote_subst='s/\(["`\\]\)/\\\1/g'
716 # Re-`\' parameter expansions in output of double_quote_subst that were
717 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
718 # in input to double_quote_subst, that '$' was protected from expansion.
719 # Since each input `\' is now two `\'s, look for any number of runs of
720 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
725 sed_double_backslash="\
729 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
740 # Echo program name prefixed message, along with the current mode
741 # name if it has been set yet.
744 $ECHO "$progname${mode+: }$mode: $*"
747 # func_verbose arg...
748 # Echo program name prefixed message in verbose mode only.
751 $opt_verbose && func_echo ${1+"$@"}
753 # A bug in bash halts the script if the last line of a function
754 # fails when set -e is in force, so we need another command to
760 # Echo program name prefixed message to standard error.
763 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
766 # func_warning arg...
767 # Echo program name prefixed warning message to standard error.
770 $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
776 # func_fatal_error arg...
777 # Echo program name prefixed message to standard error, and exit.
784 # func_fatal_help arg...
785 # Echo program name prefixed message to standard error, followed by
786 # a help hint, and exit.
790 func_fatal_error "$help"
792 help="Try \`$progname --help' for more information." ## default
795 # func_grep expression filename
796 # Check whether EXPRESSION matches any line of FILENAME, without output.
799 $GREP "$1" "$2" >/dev/null 2>&1
803 # func_mkdir_p directory-path
804 # Make sure the entire path to DIRECTORY-PATH is available.
807 my_directory_path="$1"
810 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
812 # Protect directory names starting with `-'
813 case $my_directory_path in
814 -*) my_directory_path="./$my_directory_path" ;;
817 # While some portion of DIR does not yet exist...
818 while test ! -d "$my_directory_path"; do
819 # ...make a list in topmost first order. Use a colon delimited
820 # list incase some portion of path contains whitespace.
821 my_dir_list="$my_directory_path:$my_dir_list"
823 # If the last portion added has no slash in it, the list is done
824 case $my_directory_path in */*) ;; *) break ;; esac
826 # ...otherwise throw away the child directory and loop
827 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
829 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
831 save_mkdir_p_IFS="$IFS"; IFS=':'
832 for my_dir in $my_dir_list; do
833 IFS="$save_mkdir_p_IFS"
834 # mkdir can fail with a `File exist' error if two processes
835 # try to create one of the directories concurrently. Don't
837 $MKDIR "$my_dir" 2>/dev/null || :
839 IFS="$save_mkdir_p_IFS"
841 # Bail out if we (or some other process) failed to create a directory.
842 test -d "$my_directory_path" || \
843 func_fatal_error "Failed to create \`$1'"
848 # func_mktempdir [string]
849 # Make a temporary directory that won't clash with other running
850 # libtool processes, and avoids race conditions if possible. If
851 # given, STRING is the basename for that directory.
854 my_template="${TMPDIR-/tmp}/${1-$progname}"
856 if test "$opt_dry_run" = ":"; then
857 # Return a directory name, but don't create it in dry-run mode
858 my_tmpdir="${my_template}-$$"
861 # If mktemp works, use that first and foremost
862 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
864 if test ! -d "$my_tmpdir"; then
865 # Failing that, at least try and use $RANDOM to avoid a race
866 my_tmpdir="${my_template}-${RANDOM-0}$$"
868 save_mktempdir_umask=`umask`
871 umask $save_mktempdir_umask
874 # If we're not in dry-run mode, bomb out on failure
875 test -d "$my_tmpdir" || \
876 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
879 $ECHO "X$my_tmpdir" | $Xsed
883 # func_quote_for_eval arg
884 # Aesthetically quote ARG to be evaled later.
885 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
886 # is double-quoted, suitable for a subsequent eval, whereas
887 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
888 # which are still active within double quotes backslashified.
889 func_quote_for_eval ()
893 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
895 func_quote_for_eval_unquoted_result="$1" ;;
898 case $func_quote_for_eval_unquoted_result in
899 # Double-quote args containing shell metacharacters to delay
900 # word splitting, command substitution and and variable
901 # expansion for a subsequent eval.
902 # Many Bourne shells cannot handle close brackets correctly
903 # in scan sets, so we specify it separately.
904 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
905 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
908 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
913 # func_quote_for_expand arg
914 # Aesthetically quote ARG to be evaled later; same as above,
915 # but do not quote variable references.
916 func_quote_for_expand ()
920 my_arg=`$ECHO "X$1" | $Xsed \
921 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
927 # Double-quote args containing shell metacharacters to delay
928 # word splitting and command substitution for a subsequent eval.
929 # Many Bourne shells cannot handle close brackets correctly
930 # in scan sets, so we specify it separately.
931 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
936 func_quote_for_expand_result="$my_arg"
940 # func_show_eval cmd [fail_exp]
941 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
942 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
943 # is given, then evaluate it.
949 ${opt_silent-false} || {
950 func_quote_for_expand "$my_cmd"
951 eval "func_echo $func_quote_for_expand_result"
954 if ${opt_dry_run-false}; then :; else
957 if test "$my_status" -eq 0; then :; else
958 eval "(exit $my_status); $my_fail_exp"
964 # func_show_eval_locale cmd [fail_exp]
965 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
966 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
967 # is given, then evaluate it. Use the saved locale for evaluation.
968 func_show_eval_locale ()
973 ${opt_silent-false} || {
974 func_quote_for_expand "$my_cmd"
975 eval "func_echo $func_quote_for_expand_result"
978 if ${opt_dry_run-false}; then :; else
979 eval "$lt_user_locale
982 eval "$lt_safe_locale"
983 if test "$my_status" -eq 0; then :; else
984 eval "(exit $my_status); $my_fail_exp"
994 # Echo version message to standard output and exit.
997 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
1000 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1007 # Echo short help message to standard output and exit.
1010 $SED -n '/^# Usage:/,/# -h/ {
1013 s/\$progname/'$progname'/
1017 $ECHO "run \`$progname --help | more' for full usage"
1022 # Echo long help message to standard output and exit.
1025 $SED -n '/^# Usage:/,/# Report bugs to/ {
1028 s*\$progname*'$progname'*
1030 s*\$SHELL*'"$SHELL"'*
1032 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1034 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1035 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1036 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1042 # func_missing_arg argname
1043 # Echo program name prefixed message to standard error and set global
1047 func_error "missing argument for $1"
1057 # Check that we have a working $ECHO.
1058 if test "X$1" = X--no-reexec; then
1059 # Discard the --no-reexec flag, and continue.
1061 elif test "X$1" = X--fallback-echo; then
1062 # Avoid inline document here, it may be left over
1064 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1065 # Yippee, $ECHO works!
1068 # Restart under the correct shell, and then maybe $ECHO will work.
1069 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1072 if test "X$1" = X--fallback-echo; then
1073 # used as fallback echo
1081 magic="%%%MAGIC variable%%%"
1082 magic_exe="%%%MAGIC EXE variable%%%"
1089 lo2o="s/\\.lo\$/.${objext}/"
1090 o2lo="s/\\.${objext}\$/.lo/"
1095 opt_duplicate_deps=false
1099 # If this variable is set in any of the actions, the command in it
1100 # will be execed at the end. This prevents here-documents from being
1101 # left over by shells.
1104 # func_fatal_configuration arg...
1105 # Echo program name prefixed message to standard error, followed by
1106 # a configuration failure hint, and exit.
1107 func_fatal_configuration ()
1109 func_error ${1+"$@"}
1110 func_error "See the $PACKAGE documentation for more information."
1111 func_fatal_error "Fatal configuration error."
1116 # Display the configuration for all the tags in this script.
1119 re_begincf='^# ### BEGIN LIBTOOL'
1120 re_endcf='^# ### END LIBTOOL'
1122 # Default configuration.
1123 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1125 # Now print the configurations for the tags.
1126 for tagname in $taglist; do
1127 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1134 # Display the features supported by this script.
1138 if test "$build_libtool_libs" = yes; then
1139 $ECHO "enable shared libraries"
1141 $ECHO "disable shared libraries"
1143 if test "$build_old_libs" = yes; then
1144 $ECHO "enable static libraries"
1146 $ECHO "disable static libraries"
1152 # func_enable_tag tagname
1153 # Verify that TAGNAME is valid, and either flag an error and exit, or
1154 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1161 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1162 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1163 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1168 func_fatal_error "invalid tag name: $tagname"
1172 # Don't test for the "default" C tag, as we know it's
1173 # there but not specially marked.
1177 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1178 taglist="$taglist $tagname"
1180 # Evaluate the configuration. Be careful to quote the path
1181 # and the sed script, to avoid splitting on whitespace, but
1182 # also don't use non-portable quotes within backquotes within
1183 # quotes we have to do it in 2 steps:
1184 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1187 func_error "ignoring unknown tag $tagname"
1193 # Parse options once, thoroughly. This comes as soon as possible in
1194 # the script to make things like `libtool --version' happen quickly.
1197 # Shorthand for --mode=foo, only valid as the first argument
1200 shift; set dummy --mode clean ${1+"$@"}; shift
1202 compile|compil|compi|comp|com|co|c)
1203 shift; set dummy --mode compile ${1+"$@"}; shift
1205 execute|execut|execu|exec|exe|ex|e)
1206 shift; set dummy --mode execute ${1+"$@"}; shift
1208 finish|finis|fini|fin|fi|f)
1209 shift; set dummy --mode finish ${1+"$@"}; shift
1211 install|instal|insta|inst|ins|in|i)
1212 shift; set dummy --mode install ${1+"$@"}; shift
1215 shift; set dummy --mode link ${1+"$@"}; shift
1217 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1218 shift; set dummy --mode uninstall ${1+"$@"}; shift
1222 # Parse non-mode specific arguments:
1223 while test "$#" -gt 0; do
1228 --config) func_config ;;
1230 --debug) preserve_args="$preserve_args $opt"
1231 func_echo "enabling shell trace mode"
1236 -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
1237 execute_dlfiles="$execute_dlfiles $1"
1241 --dry-run | -n) opt_dry_run=: ;;
1242 --features) func_features ;;
1243 --finish) mode="finish" ;;
1245 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
1247 # Valid mode arguments:
1257 # Catch anything else as an error
1258 *) func_error "invalid argument for $opt"
1268 --preserve-dup-deps)
1269 opt_duplicate_deps=: ;;
1271 --quiet|--silent) preserve_args="$preserve_args $opt"
1275 --verbose| -v) preserve_args="$preserve_args $opt"
1279 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
1280 preserve_args="$preserve_args $opt $1"
1281 func_enable_tag "$1" # tagname is set here
1285 # Separate optargs to long options:
1286 -dlopen=*|--mode=*|--tag=*)
1287 func_opt_split "$opt"
1288 set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1292 -\?|-h) func_usage ;;
1293 --help) opt_help=: ;;
1294 --version) func_version ;;
1296 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1306 *cygwin* | *mingw* | *pw32*)
1307 # don't eliminate duplications in $postdeps and $predeps
1308 opt_duplicate_compiler_generated_deps=:
1311 opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
1315 # Having warned about all mis-specified options, bail out if
1316 # anything was wrong.
1317 $exit_cmd $EXIT_FAILURE
1320 # func_check_version_match
1321 # Ensure that we are using m4 macros, and libtool script from the same
1322 # release of libtool.
1323 func_check_version_match ()
1325 if test "$package_revision" != "$macro_revision"; then
1326 if test "$VERSION" != "$macro_version"; then
1327 if test -z "$macro_version"; then
1329 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1330 $progname: definition of this LT_INIT comes from an older release.
1331 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1332 $progname: and run autoconf again.
1336 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1337 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1338 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1339 $progname: and run autoconf again.
1344 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1345 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
1346 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
1347 $progname: of $PACKAGE $VERSION and run autoconf again.
1361 # Sanity checks first:
1362 func_check_version_match
1364 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1365 func_fatal_configuration "not configured to build any kind of library"
1368 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1372 eval std_shrext=\"$shrext_cmds\"
1375 # Only execute mode is allowed to have -dlopen flags.
1376 if test -n "$execute_dlfiles" && test "$mode" != execute; then
1377 func_error "unrecognized option \`-dlopen'"
1382 # Change the help message to a mode-specific one.
1383 generic_help="$help"
1384 help="Try \`$progname --help --mode=$mode' for more information."
1389 # True iff FILE is a libtool `.la' library or `.lo' object file.
1390 # This function is only a basic sanity check; it will hardly flush out
1391 # determined imposters.
1394 $SED -e 4q "$1" 2>/dev/null \
1395 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1398 # func_lalib_unsafe_p file
1399 # True iff FILE is a libtool `.la' library or `.lo' object file.
1400 # This function implements the same check as func_lalib_p without
1401 # resorting to external programs. To this end, it redirects stdin and
1402 # closes it afterwards, without saving the original file descriptor.
1403 # As a safety measure, use it only where a negative result would be
1404 # fatal anyway. Works if `file' does not exist.
1405 func_lalib_unsafe_p ()
1408 if test -r "$1" && exec 5<&0 <"$1"; then
1409 for lalib_p_l in 1 2 3 4
1412 case "$lalib_p_line" in
1413 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1418 test "$lalib_p" = yes
1421 # func_ltwrapper_script_p file
1422 # True iff FILE is a libtool wrapper script
1423 # This function is only a basic sanity check; it will hardly flush out
1424 # determined imposters.
1425 func_ltwrapper_script_p ()
1430 # func_ltwrapper_executable_p file
1431 # True iff FILE is a libtool wrapper executable
1432 # This function is only a basic sanity check; it will hardly flush out
1433 # determined imposters.
1434 func_ltwrapper_executable_p ()
1436 func_ltwrapper_exec_suffix=
1439 *) func_ltwrapper_exec_suffix=.exe ;;
1441 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1444 # func_ltwrapper_scriptname file
1445 # Assumes file is an ltwrapper_executable
1446 # uses $file to determine the appropriate filename for a
1447 # temporary ltwrapper_script.
1448 func_ltwrapper_scriptname ()
1450 func_ltwrapper_scriptname_result=""
1451 if func_ltwrapper_executable_p "$1"; then
1452 func_dirname_and_basename "$1" "" "."
1453 func_stripname '' '.exe' "$func_basename_result"
1454 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1458 # func_ltwrapper_p file
1459 # True iff FILE is a libtool wrapper script or wrapper executable
1460 # This function is only a basic sanity check; it will hardly flush out
1461 # determined imposters.
1464 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1468 # func_execute_cmds commands fail_cmd
1469 # Execute tilde-delimited COMMANDS.
1470 # If FAIL_CMD is given, eval that upon failure.
1471 # FAIL_CMD may read-access the current command in variable CMD!
1472 func_execute_cmds ()
1475 save_ifs=$IFS; IFS='~'
1479 func_show_eval "$cmd" "${2-:}"
1486 # Source FILE, adding directory component if necessary.
1487 # Note that it is not necessary on cygwin/mingw to append a dot to
1488 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1489 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1490 # `FILE.' does not work on cygwin managed mounts.
1495 */* | *\\*) . "$1" ;;
1501 # func_infer_tag arg
1502 # Infer tagged configuration to use if any are available and
1503 # if one wasn't chosen via the "--tag" command line option.
1504 # Only attempt this if the compiler in the base compile
1505 # command doesn't match the default compiler.
1506 # arg is usually of the form 'gcc ...'
1510 if test -n "$available_tags" && test -z "$tagname"; then
1513 func_quote_for_eval "$arg"
1514 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1517 # Blanks in the command may have been stripped by the calling shell,
1518 # but not from the CC environment variable when configure was run.
1519 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1520 # Blanks at the start of $base_compile will cause this to fail
1521 # if we don't check for them as well.
1523 for z in $available_tags; do
1524 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1525 # Evaluate the configuration.
1526 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1529 # Double-quote args containing other shell metacharacters.
1530 func_quote_for_eval "$arg"
1531 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1534 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1535 # The compiler in the base compile command matches
1536 # the one in the tagged configuration.
1537 # Assume this is the tagged configuration we want.
1544 # If $tagname still isn't set, then no tagged configuration
1545 # was found and let the user know that the "--tag" command
1546 # line option must be used.
1547 if test -z "$tagname"; then
1548 func_echo "unable to infer tagged configuration"
1549 func_fatal_error "specify a tag with \`--tag'"
1551 # func_verbose "using $tagname tagged configuration"
1560 # func_write_libtool_object output_name pic_name nonpic_name
1561 # Create a libtool object file (analogous to a ".la" file),
1562 # but don't create it if we're doing a dry run.
1563 func_write_libtool_object ()
1566 if test "$build_libtool_libs" = yes; then
1572 if test "$build_old_libs" = yes; then
1573 write_oldobj=\'${3}\'
1579 cat >${write_libobj}T <<EOF
1580 # $write_libobj - a libtool object file
1581 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1583 # Please DO NOT delete this file!
1584 # It is necessary for linking the library.
1586 # Name of the PIC object.
1587 pic_object=$write_lobj
1589 # Name of the non-PIC object
1590 non_pic_object=$write_oldobj
1593 $MV "${write_libobj}T" "${write_libobj}"
1597 # func_mode_compile arg...
1598 func_mode_compile ()
1601 # Get the compilation command and the source file.
1603 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1615 # do not "continue". Instead, add this to base_compile
1627 # Accept any command-line options.
1630 test -n "$libobj" && \
1631 func_fatal_error "you cannot specify \`-o' more than once"
1636 -pie | -fpie | -fPIE)
1637 pie_flag="$pie_flag $arg"
1641 -shared | -static | -prefer-pic | -prefer-non-pic)
1652 arg_mode=arg # the next one goes into the "base_compile" arg list
1653 continue # The current "srcfile" will either be retained or
1654 ;; # replaced later. I would guess that would be a bug.
1657 func_stripname '-Wc,' '' "$arg"
1658 args=$func_stripname_result
1660 save_ifs="$IFS"; IFS=','
1661 for arg in $args; do
1663 func_quote_for_eval "$arg"
1664 lastarg="$lastarg $func_quote_for_eval_result"
1667 func_stripname ' ' '' "$lastarg"
1668 lastarg=$func_stripname_result
1670 # Add the arguments to base_compile.
1671 base_compile="$base_compile $lastarg"
1676 # Accept the current argument as the source file.
1677 # The previous "srcfile" becomes the current argument.
1684 esac # case $arg_mode
1686 # Aesthetically quote the previous argument.
1687 func_quote_for_eval "$lastarg"
1688 base_compile="$base_compile $func_quote_for_eval_result"
1693 func_fatal_error "you must specify an argument for -Xcompile"
1696 func_fatal_error "you must specify a target with \`-o'"
1699 # Get the name of the library object.
1700 test -z "$libobj" && {
1701 func_basename "$srcfile"
1702 libobj="$func_basename_result"
1707 # Recognize several different file suffixes.
1708 # If the user specifies -o file.o, it is replaced with file.lo
1711 *.ada | *.adb | *.ads | *.asm | \
1712 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1713 *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1714 func_xform "$libobj"
1715 libobj=$func_xform_result
1720 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1722 func_fatal_error "cannot determine name of library object from \`$libobj'"
1726 func_infer_tag $base_compile
1728 for arg in $later; do
1731 test "$build_libtool_libs" != yes && \
1732 func_fatal_configuration "can not build a shared library"
1738 build_libtool_libs=no
1755 func_quote_for_eval "$libobj"
1756 test "X$libobj" != "X$func_quote_for_eval_result" \
1757 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1758 && func_warning "libobj name \`$libobj' may not contain shell special characters."
1759 func_dirname_and_basename "$obj" "/" ""
1760 objname="$func_basename_result"
1761 xdir="$func_dirname_result"
1762 lobj=${xdir}$objdir/$objname
1764 test -z "$base_compile" && \
1765 func_fatal_help "you must specify a compilation command"
1767 # Delete any leftover library objects.
1768 if test "$build_old_libs" = yes; then
1769 removelist="$obj $lobj $libobj ${libobj}T"
1771 removelist="$lobj $libobj ${libobj}T"
1774 # On Cygwin there's no "real" PIC flag so we must build both object types
1776 cygwin* | mingw* | pw32* | os2*)
1780 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1781 # non-PIC code in shared libraries is not supported
1785 # Calculate the filename of the output object if compiler does
1786 # not support -o with -c
1787 if test "$compiler_c_o" = no; then
1788 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1789 lockfile="$output_obj.lock"
1796 # Lock this critical section if it is needed
1797 # We use this script file to make the link, it avoids creating a new file
1798 if test "$need_locks" = yes; then
1799 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1800 func_echo "Waiting for $lockfile to be removed"
1803 elif test "$need_locks" = warn; then
1804 if test -f "$lockfile"; then
1806 *** ERROR, $lockfile exists and contains:
1807 `cat $lockfile 2>/dev/null`
1809 This indicates that another process is trying to use the same
1810 temporary object file, and libtool could not work around it because
1811 your compiler does not support \`-c' and \`-o' together. If you
1812 repeat this compilation, it may succeed, by chance, but you had better
1813 avoid parallel builds (make -j) in this platform, or get a better
1816 $opt_dry_run || $RM $removelist
1819 removelist="$removelist $output_obj"
1820 $ECHO "$srcfile" > "$lockfile"
1823 $opt_dry_run || $RM $removelist
1824 removelist="$removelist $lockfile"
1825 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1827 if test -n "$fix_srcfile_path"; then
1828 eval srcfile=\"$fix_srcfile_path\"
1830 func_quote_for_eval "$srcfile"
1831 qsrcfile=$func_quote_for_eval_result
1833 # Only build a PIC object if we are building libtool libraries.
1834 if test "$build_libtool_libs" = yes; then
1835 # Without this assignment, base_compile gets emptied.
1836 fbsd_hideous_sh_bug=$base_compile
1838 if test "$pic_mode" != no; then
1839 command="$base_compile $qsrcfile $pic_flag"
1841 # Don't build PIC code
1842 command="$base_compile $qsrcfile"
1845 func_mkdir_p "$xdir$objdir"
1847 if test -z "$output_obj"; then
1848 # Place PIC objects in $objdir
1849 command="$command -o $lobj"
1852 func_show_eval_locale "$command" \
1853 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1855 if test "$need_locks" = warn &&
1856 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1858 *** ERROR, $lockfile contains:
1859 `cat $lockfile 2>/dev/null`
1861 but it should contain:
1864 This indicates that another process is trying to use the same
1865 temporary object file, and libtool could not work around it because
1866 your compiler does not support \`-c' and \`-o' together. If you
1867 repeat this compilation, it may succeed, by chance, but you had better
1868 avoid parallel builds (make -j) in this platform, or get a better
1871 $opt_dry_run || $RM $removelist
1875 # Just move the object if needed, then go on to compile the next one
1876 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1877 func_show_eval '$MV "$output_obj" "$lobj"' \
1878 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1881 # Allow error messages only from the first compilation.
1882 if test "$suppress_opt" = yes; then
1883 suppress_output=' >/dev/null 2>&1'
1887 # Only build a position-dependent object if we build old libraries.
1888 if test "$build_old_libs" = yes; then
1889 if test "$pic_mode" != yes; then
1890 # Don't build PIC code
1891 command="$base_compile $qsrcfile$pie_flag"
1893 command="$base_compile $qsrcfile $pic_flag"
1895 if test "$compiler_c_o" = yes; then
1896 command="$command -o $obj"
1899 # Suppress compiler output if we already did a PIC compilation.
1900 command="$command$suppress_output"
1901 func_show_eval_locale "$command" \
1902 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1904 if test "$need_locks" = warn &&
1905 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1907 *** ERROR, $lockfile contains:
1908 `cat $lockfile 2>/dev/null`
1910 but it should contain:
1913 This indicates that another process is trying to use the same
1914 temporary object file, and libtool could not work around it because
1915 your compiler does not support \`-c' and \`-o' together. If you
1916 repeat this compilation, it may succeed, by chance, but you had better
1917 avoid parallel builds (make -j) in this platform, or get a better
1920 $opt_dry_run || $RM $removelist
1924 # Just move the object if needed
1925 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1926 func_show_eval '$MV "$output_obj" "$obj"' \
1927 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1932 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1934 # Unlock the critical section if it was locked
1935 if test "$need_locks" != no; then
1936 removelist=$lockfile
1945 test "$mode" = compile && func_mode_compile ${1+"$@"}
1950 # We need to display help for each of the modes.
1953 # Generic help is extracted from the usage comments
1954 # at the start of this file.
1960 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1962 Remove files from the build directory.
1964 RM is the name of the program to use to delete files associated with each FILE
1965 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1968 If FILE is a libtool library, object or program, all the files associated
1969 with it are deleted. Otherwise, only FILE itself is deleted using RM."
1974 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1976 Compile a source file into a libtool library object.
1978 This mode accepts the following additional options:
1980 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1981 -no-suppress do not suppress compiler output for multiple passes
1982 -prefer-pic try to building PIC objects only
1983 -prefer-non-pic try to building non-PIC objects only
1984 -shared do not build a \`.o' file suitable for static linking
1985 -static only build a \`.o' file suitable for static linking
1987 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1988 from the given SOURCEFILE.
1990 The output file name is determined by removing the directory component from
1991 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1992 library object suffix, \`.lo'."
1997 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1999 Automatically set library path, then run a program.
2001 This mode accepts the following additional options:
2003 -dlopen FILE add the directory containing FILE to the library path
2005 This mode sets the library path environment variable according to \`-dlopen'
2008 If any of the ARGS are libtool executable wrappers, then they are translated
2009 into their corresponding uninstalled binary, and any of their required library
2010 directories are added to the library path.
2012 Then, COMMAND is executed, with ARGS as arguments."
2017 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2019 Complete the installation of libtool libraries.
2021 Each LIBDIR is a directory that contains libtool libraries.
2023 The commands that this mode executes may require superuser privileges. Use
2024 the \`--dry-run' option if you just want to see what would be executed."
2029 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2031 Install executables or libraries.
2033 INSTALL-COMMAND is the installation command. The first component should be
2034 either the \`install' or \`cp' program.
2036 The following components of INSTALL-COMMAND are treated specially:
2038 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2040 The rest of the components are interpreted as arguments to that command (only
2041 BSD-compatible install options are recognized)."
2046 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2048 Link object files or libraries together to form another library, or to
2049 create an executable program.
2051 LINK-COMMAND is a command using the C compiler that you would use to create
2052 a program from several object files.
2054 The following components of LINK-COMMAND are treated specially:
2056 -all-static do not do any dynamic linking at all
2057 -avoid-version do not add a version suffix if possible
2058 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2059 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2060 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2061 -export-symbols SYMFILE
2062 try to export only the symbols listed in SYMFILE
2063 -export-symbols-regex REGEX
2064 try to export only the symbols matching REGEX
2065 -LLIBDIR search LIBDIR for required installed libraries
2066 -lNAME OUTPUT-FILE requires the installed library libNAME
2067 -module build a library that can dlopened
2068 -no-fast-install disable the fast-install mode
2069 -no-install link a not-installable executable
2070 -no-undefined declare that a library does not refer to external symbols
2071 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2072 -objectlist FILE Use a list of object files found in FILE to specify objects
2073 -precious-files-regex REGEX
2074 don't remove output files matching REGEX
2075 -release RELEASE specify package release information
2076 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2077 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2078 -shared only do dynamic linking of libtool libraries
2079 -shrext SUFFIX override the standard shared library file extension
2080 -static do not do any dynamic linking of uninstalled libtool libraries
2081 -static-libtool-libs
2082 do not do any dynamic linking of libtool libraries
2083 -version-info CURRENT[:REVISION[:AGE]]
2084 specify library version info [each variable defaults to 0]
2085 -weak LIBNAME declare that the target provides the LIBNAME interface
2087 All other options (arguments beginning with \`-') are ignored.
2089 Every other argument is treated as a filename. Files ending in \`.la' are
2090 treated as uninstalled libtool libraries, other files are standard or library
2093 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2094 only library objects (\`.lo' files) may be specified, and \`-rpath' is
2095 required, except when creating a convenience library.
2097 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2098 using \`ar' and \`ranlib', or on Windows using \`lib'.
2100 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2101 is created, otherwise an executable program is created."
2106 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2108 Remove libraries from an installation directory.
2110 RM is the name of the program to use to delete files associated with each FILE
2111 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2114 If FILE is a libtool library, all the files associated with it are deleted.
2115 Otherwise, only FILE itself is deleted using RM."
2119 func_fatal_help "invalid operation mode \`$mode'"
2124 $ECHO "Try \`$progname --help' for more information about other modes."
2129 # Now that we've collected a possible --mode arg, show help if necessary
2130 $opt_help && func_mode_help
2133 # func_mode_execute arg...
2134 func_mode_execute ()
2137 # The first argument is the command name.
2140 func_fatal_help "you must specify a COMMAND"
2142 # Handle -dlopen flags immediately.
2143 for file in $execute_dlfiles; do
2145 || func_fatal_help "\`$file' is not a file"
2150 # Check to see that this really is a libtool archive.
2151 func_lalib_unsafe_p "$file" \
2152 || func_fatal_help "\`$lib' is not a valid libtool archive"
2154 # Read the libtool library.
2159 # Skip this library if it cannot be dlopened.
2160 if test -z "$dlname"; then
2161 # Warn if it was a shared library.
2162 test -n "$library_names" && \
2163 func_warning "\`$file' was not linked with \`-export-dynamic'"
2167 func_dirname "$file" "" "."
2168 dir="$func_dirname_result"
2170 if test -f "$dir/$objdir/$dlname"; then
2173 if test ! -f "$dir/$dlname"; then
2174 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2180 # Just add the directory containing the .lo file.
2181 func_dirname "$file" "" "."
2182 dir="$func_dirname_result"
2186 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2191 # Get the absolute pathname.
2192 absdir=`cd "$dir" && pwd`
2193 test -n "$absdir" && dir="$absdir"
2195 # Now add the directory to shlibpath_var.
2196 if eval "test -z \"\$$shlibpath_var\""; then
2197 eval "$shlibpath_var=\"\$dir\""
2199 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2203 # This variable tells wrapper scripts just to set shlibpath_var
2204 # rather than running their programs.
2205 libtool_execute_magic="$magic"
2207 # Check if any of the arguments is a wrapper script.
2214 # Do a test to see if this is really a libtool program.
2215 if func_ltwrapper_script_p "$file"; then
2217 # Transform arg to wrapped name.
2218 file="$progdir/$program"
2219 elif func_ltwrapper_executable_p "$file"; then
2220 func_ltwrapper_scriptname "$file"
2221 func_source "$func_ltwrapper_scriptname_result"
2222 # Transform arg to wrapped name.
2223 file="$progdir/$program"
2227 # Quote arguments (to preserve shell metacharacters).
2228 func_quote_for_eval "$file"
2229 args="$args $func_quote_for_eval_result"
2232 if test "X$opt_dry_run" = Xfalse; then
2233 if test -n "$shlibpath_var"; then
2234 # Export the shlibpath_var.
2235 eval "export $shlibpath_var"
2238 # Restore saved environment variables
2239 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2241 eval "if test \"\${save_$lt_var+set}\" = set; then
2242 $lt_var=\$save_$lt_var; export $lt_var
2248 # Now prepare to actually exec the command.
2249 exec_cmd="\$cmd$args"
2251 # Display what would be done.
2252 if test -n "$shlibpath_var"; then
2253 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2254 $ECHO "export $shlibpath_var"
2261 test "$mode" = execute && func_mode_execute ${1+"$@"}
2264 # func_mode_finish arg...
2271 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2274 libdirs="$libdirs $dir"
2277 for libdir in $libdirs; do
2278 if test -n "$finish_cmds"; then
2279 # Do each command in the finish commands.
2280 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2283 if test -n "$finish_eval"; then
2284 # Do the single finish_eval.
2285 eval cmds=\"$finish_eval\"
2286 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
2292 # Exit here if they wanted silent mode.
2293 $opt_silent && exit $EXIT_SUCCESS
2295 $ECHO "X----------------------------------------------------------------------" | $Xsed
2296 $ECHO "Libraries have been installed in:"
2297 for libdir in $libdirs; do
2301 $ECHO "If you ever happen to want to link against installed libraries"
2302 $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
2303 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
2304 $ECHO "flag during linking and do at least one of the following:"
2305 if test -n "$shlibpath_var"; then
2306 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
2307 $ECHO " during execution"
2309 if test -n "$runpath_var"; then
2310 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
2311 $ECHO " during linking"
2313 if test -n "$hardcode_libdir_flag_spec"; then
2315 eval flag=\"$hardcode_libdir_flag_spec\"
2317 $ECHO " - use the \`$flag' linker flag"
2319 if test -n "$admincmds"; then
2320 $ECHO " - have your system administrator run these commands:$admincmds"
2322 if test -f /etc/ld.so.conf; then
2323 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2327 $ECHO "See any operating system documentation about shared libraries for"
2329 solaris2.[6789]|solaris2.1[0-9])
2330 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2334 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
2337 $ECHO "X----------------------------------------------------------------------" | $Xsed
2341 test "$mode" = finish && func_mode_finish ${1+"$@"}
2344 # func_mode_install arg...
2345 func_mode_install ()
2348 # There may be an optional sh(1) argument at the beginning of
2349 # install_prog (especially on Windows NT).
2350 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2351 # Allow the use of GNU shtool's install command.
2352 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
2353 # Aesthetically quote it.
2354 func_quote_for_eval "$nonopt"
2355 install_prog="$func_quote_for_eval_result "
2363 # The real first argument should be the name of the installation program.
2364 # Aesthetically quote it.
2365 func_quote_for_eval "$arg"
2366 install_prog="$install_prog$func_quote_for_eval_result"
2368 # We need to accept at least all the BSD install flags.
2378 if test -n "$dest"; then
2379 files="$files $dest"
2387 case " $install_prog " in
2402 # If the previous option needed an argument, then skip it.
2403 if test -n "$prev"; then
2412 # Aesthetically quote the argument.
2413 func_quote_for_eval "$arg"
2414 install_prog="$install_prog $func_quote_for_eval_result"
2417 test -z "$install_prog" && \
2418 func_fatal_help "you must specify an install program"
2420 test -n "$prev" && \
2421 func_fatal_help "the \`$prev' option requires an argument"
2423 if test -z "$files"; then
2424 if test -z "$dest"; then
2425 func_fatal_help "no file or destination specified"
2427 func_fatal_help "you must specify a destination"
2431 # Strip any trailing slash from the destination.
2432 func_stripname '' '/' "$dest"
2433 dest=$func_stripname_result
2435 # Check to see that the destination is a directory.
2436 test -d "$dest" && isdir=yes
2437 if test "$isdir" = yes; then
2441 func_dirname_and_basename "$dest" "" "."
2442 destdir="$func_dirname_result"
2443 destname="$func_basename_result"
2445 # Not a directory, so check to see that there is only one file specified.
2446 set dummy $files; shift
2447 test "$#" -gt 1 && \
2448 func_fatal_help "\`$dest' is not a directory"
2451 [\\/]* | [A-Za-z]:[\\/]*) ;;
2453 for file in $files; do
2457 func_fatal_help "\`$destdir' must be an absolute directory name"
2464 # This variable tells wrapper scripts just to set variables rather
2465 # than running their programs.
2466 libtool_install_magic="$magic"
2471 for file in $files; do
2473 # Do each installation.
2476 # Do the static libraries later.
2477 staticlibs="$staticlibs $file"
2481 # Check to see that this really is a libtool archive.
2482 func_lalib_unsafe_p "$file" \
2483 || func_fatal_help "\`$file' is not a valid libtool archive"
2490 # Add the libdir to current_libdirs if it is the destination.
2491 if test "X$destdir" = "X$libdir"; then
2492 case "$current_libdirs " in
2494 *) current_libdirs="$current_libdirs $libdir" ;;
2497 # Note the libdir as a future libdir.
2498 case "$future_libdirs " in
2500 *) future_libdirs="$future_libdirs $libdir" ;;
2504 func_dirname "$file" "/" ""
2505 dir="$func_dirname_result"
2508 if test -n "$relink_command"; then
2509 # Determine the prefix the user has applied to our future dir.
2510 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2512 # Don't allow the user to place us outside of our expected
2513 # location b/c this prevents finding dependent libraries that
2514 # are installed to the same prefix.
2515 # At present, this check doesn't affect windows .dll's that
2516 # are installed into $libdir/../bin (currently, that works fine)
2517 # but it's something to keep an eye on.
2518 test "$inst_prefix_dir" = "$destdir" && \
2519 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2521 if test -n "$inst_prefix_dir"; then
2522 # Stick the inst_prefix_dir data into the link command.
2523 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2525 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2528 func_warning "relinking \`$file'"
2529 func_show_eval "$relink_command" \
2530 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2533 # See the names of the shared library.
2534 set dummy $library_names; shift
2535 if test -n "$1"; then
2540 test -n "$relink_command" && srcname="$realname"T
2542 # Install the shared library and build the symlinks.
2543 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2547 cygwin* | mingw* | pw32*)
2555 if test -n "$tstripme" && test -n "$striplib"; then
2556 func_show_eval "$striplib $destdir/$realname" 'exit $?'
2559 if test "$#" -gt 0; then
2560 # Delete the old symlinks, and create new ones.
2561 # Try `ln -sf' first, because the `ln' binary might depend on
2562 # the symlink we replace! Solaris /bin/ln does not understand -f,
2563 # so we also need to try rm && ln -s.
2566 test "$linkname" != "$realname" \
2567 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2571 # Do each command in the postinstall commands.
2572 lib="$destdir/$realname"
2573 func_execute_cmds "$postinstall_cmds" 'exit $?'
2576 # Install the pseudo-library for information purposes.
2577 func_basename "$file"
2578 name="$func_basename_result"
2579 instname="$dir/$name"i
2580 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2582 # Maybe install the static library, too.
2583 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2587 # Install (i.e. copy) a libtool object.
2589 # Figure out destination file name, if it wasn't already specified.
2590 if test -n "$destname"; then
2591 destfile="$destdir/$destname"
2593 func_basename "$file"
2594 destfile="$func_basename_result"
2595 destfile="$destdir/$destfile"
2598 # Deduce the name of the destination old-style object file.
2601 func_lo2o "$destfile"
2602 staticdest=$func_lo2o_result
2605 staticdest="$destfile"
2609 func_fatal_help "cannot copy a libtool object to \`$destfile'"
2613 # Install the libtool object if requested.
2614 test -n "$destfile" && \
2615 func_show_eval "$install_prog $file $destfile" 'exit $?'
2617 # Install the old object if enabled.
2618 if test "$build_old_libs" = yes; then
2619 # Deduce the name of the old-style object file.
2621 staticobj=$func_lo2o_result
2622 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2628 # Figure out destination file name, if it wasn't already specified.
2629 if test -n "$destname"; then
2630 destfile="$destdir/$destname"
2632 func_basename "$file"
2633 destfile="$func_basename_result"
2634 destfile="$destdir/$destfile"
2637 # If the file is missing, and there is a .exe on the end, strip it
2638 # because it is most likely a libtool script we actually want to
2643 if test ! -f "$file"; then
2644 func_stripname '' '.exe' "$file"
2645 file=$func_stripname_result
2651 # Do a test to see if this is really a libtool program.
2654 if func_ltwrapper_executable_p "$file"; then
2655 func_ltwrapper_scriptname "$file"
2656 wrapper=$func_ltwrapper_scriptname_result
2658 func_stripname '' '.exe' "$file"
2659 wrapper=$func_stripname_result
2666 if func_ltwrapper_script_p "$wrapper"; then
2670 func_source "$wrapper"
2672 # Check the variables that should have been set.
2673 test -z "$generated_by_libtool_version" && \
2674 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2677 for lib in $notinst_deplibs; do
2678 # Check to see that each library is installed.
2680 if test -f "$lib"; then
2683 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2684 if test -n "$libdir" && test ! -f "$libfile"; then
2685 func_warning "\`$lib' has not been installed in \`$libdir'"
2691 func_source "$wrapper"
2694 if test "$fast_install" = no && test -n "$relink_command"; then
2696 if test "$finalize" = yes; then
2697 tmpdir=`func_mktempdir`
2698 func_basename "$file$stripped_ext"
2699 file="$func_basename_result"
2700 outputname="$tmpdir/$file"
2701 # Replace the output file specification.
2702 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2705 func_quote_for_expand "$relink_command"
2706 eval "func_echo $func_quote_for_expand_result"
2708 if eval "$relink_command"; then :
2710 func_error "error: relink \`$file' with the above command before installing it"
2711 $opt_dry_run || ${RM}r "$tmpdir"
2716 func_warning "cannot relink \`$file'"
2720 # Install the binary that we compiled earlier.
2721 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2725 # remove .exe since cygwin /usr/bin/install will append another
2727 case $install_prog,$host in
2728 */usr/bin/install*,*cygwin*)
2729 case $file:$destfile in
2734 destfile=$destfile.exe
2737 func_stripname '' '.exe' "$destfile"
2738 destfile=$func_stripname_result
2743 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2744 $opt_dry_run || if test -n "$outputname"; then
2751 for file in $staticlibs; do
2752 func_basename "$file"
2753 name="$func_basename_result"
2755 # Set up the ranlib parameters.
2756 oldlib="$destdir/$name"
2758 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2760 if test -n "$stripme" && test -n "$old_striplib"; then
2761 func_show_eval "$old_striplib $oldlib" 'exit $?'
2764 # Do each command in the postinstall commands.
2765 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2768 test -n "$future_libdirs" && \
2769 func_warning "remember to run \`$progname --finish$future_libdirs'"
2771 if test -n "$current_libdirs"; then
2772 # Maybe just do a dry run.
2773 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2774 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2780 test "$mode" = install && func_mode_install ${1+"$@"}
2783 # func_generate_dlsyms outputname originator pic_p
2784 # Extract symbols from dlprefiles and create ${outputname}S.o with
2785 # a dlpreopen symbol table.
2786 func_generate_dlsyms ()
2792 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2795 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2796 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2797 my_dlsyms="${my_outputname}S.c"
2799 func_error "not configured to extract global symbols from dlpreopened files"
2803 if test -n "$my_dlsyms"; then
2807 # Discover the nlist of each of the dlfiles.
2808 nlist="$output_objdir/${my_outputname}.nm"
2810 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2812 # Parse the name list into a source file.
2813 func_verbose "creating $output_objdir/$my_dlsyms"
2815 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2816 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2817 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2823 /* External symbol declarations for the compiler. */\
2826 if test "$dlself" = yes; then
2827 func_verbose "generating symbol list for \`$output'"
2829 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2831 # Add our own program objects to the symbol list.
2832 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2833 for progfile in $progfiles; do
2834 func_verbose "extracting global C symbols from \`$progfile'"
2835 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2838 if test -n "$exclude_expsyms"; then
2840 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2841 eval '$MV "$nlist"T "$nlist"'
2845 if test -n "$export_symbols_regex"; then
2847 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2848 eval '$MV "$nlist"T "$nlist"'
2852 # Prepare the list of exported symbols
2853 if test -z "$export_symbols"; then
2854 export_symbols="$output_objdir/$outputname.exp"
2857 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2859 *cygwin* | *mingw* )
2860 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2861 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2867 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2868 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2869 eval '$MV "$nlist"T "$nlist"'
2872 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2873 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2880 for dlprefile in $dlprefiles; do
2881 func_verbose "extracting global C symbols from \`$dlprefile'"
2882 func_basename "$dlprefile"
2883 name="$func_basename_result"
2885 eval '$ECHO ": $name " >> "$nlist"'
2886 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2891 # Make sure we have at least an empty file.
2892 test -f "$nlist" || : > "$nlist"
2894 if test -n "$exclude_expsyms"; then
2895 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2896 $MV "$nlist"T "$nlist"
2899 # Try sorting and uniquifying the output.
2900 if $GREP -v "^: " < "$nlist" |
2901 if sort -k 3 </dev/null >/dev/null 2>&1; then
2906 uniq > "$nlist"S; then
2909 $GREP -v "^: " < "$nlist" > "$nlist"S
2912 if test -f "$nlist"S; then
2913 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2915 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2918 $ECHO >> "$output_objdir/$my_dlsyms" "\
2920 /* The mapping between symbol names and symbols. */
2927 *cygwin* | *mingw* )
2928 $ECHO >> "$output_objdir/$my_dlsyms" "\
2929 /* DATA imports from DLLs on WIN32 con't be const, because
2930 runtime relocations are performed -- see ld's documentation
2931 on pseudo-relocs. */"
2934 echo >> "$output_objdir/$my_dlsyms" "\
2935 /* This system does not cope well with relocations in const data */"
2938 lt_dlsym_const=const ;;
2941 $ECHO >> "$output_objdir/$my_dlsyms" "\
2942 extern $lt_dlsym_const lt_dlsymlist
2943 lt_${my_prefix}_LTX_preloaded_symbols[];
2944 $lt_dlsym_const lt_dlsymlist
2945 lt_${my_prefix}_LTX_preloaded_symbols[] =
2947 { \"$my_originator\", (void *) 0 },"
2949 case $need_lib_prefix in
2951 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2954 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2957 $ECHO >> "$output_objdir/$my_dlsyms" "\
2961 /* This works around a problem in FreeBSD linker */
2962 #ifdef FREEBSD_WORKAROUND
2963 static const void *lt_preloaded_setup() {
2964 return lt_${my_prefix}_LTX_preloaded_symbols;
2974 pic_flag_for_symtable=
2975 case "$compile_command " in
2979 # compiling the symbol table file with pic_flag works around
2980 # a FreeBSD bug that causes programs to crash when -lm is
2981 # linked before any other PIC object. But we must not use
2982 # pic_flag when linking with -static. The problem exists in
2983 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2984 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2985 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2987 pic_flag_for_symtable=" $pic_flag" ;;
2989 if test "X$my_pic_p" != Xno; then
2990 pic_flag_for_symtable=" $pic_flag"
2997 for arg in $LTCFLAGS; do
2999 -pie | -fpie | -fPIE) ;;
3000 *) symtab_cflags="$symtab_cflags $arg" ;;
3004 # Now compile the dynamic symbol file.
3005 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3007 # Clean up the generated files.
3008 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3010 # Transform the symbol file into the correct name.
3011 symfileobj="$output_objdir/${my_outputname}S.$objext"
3013 *cygwin* | *mingw* )
3014 if test -f "$output_objdir/$my_outputname.def"; then
3015 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3016 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3018 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3019 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3023 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3024 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
3029 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3033 # We keep going just in case the user didn't refer to
3034 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3035 # really was required.
3037 # Nullify the symbol file.
3038 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3039 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3043 # func_win32_libid arg
3044 # return the library type of file 'arg'
3046 # Need a lot of goo to handle *both* DLLs and import libs
3047 # Has to be a shell function in order to 'eat' the argument
3048 # that is supplied when $file_magic_command is called.
3052 win32_libid_type="unknown"
3053 win32_fileres=`file -L $1 2>/dev/null`
3054 case $win32_fileres in
3055 *ar\ archive\ import\ library*) # definitely import
3056 win32_libid_type="x86 archive import"
3058 *ar\ archive*) # could be an import, or static
3059 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3060 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
3061 win32_nmres=`eval $NM -f posix -A $1 |
3070 case $win32_nmres in
3071 import*) win32_libid_type="x86 archive import";;
3072 *) win32_libid_type="x86 archive static";;
3077 win32_libid_type="x86 DLL"
3079 *executable*) # but shell scripts are "executable" too...
3080 case $win32_fileres in
3081 *MS\ Windows\ PE\ Intel*)
3082 win32_libid_type="x86 DLL"
3087 $ECHO "$win32_libid_type"
3092 # func_extract_an_archive dir oldlib
3093 func_extract_an_archive ()
3096 f_ex_an_ar_dir="$1"; shift
3097 f_ex_an_ar_oldlib="$1"
3098 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
3099 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3102 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3107 # func_extract_archives gentop oldlib ...
3108 func_extract_archives ()
3111 my_gentop="$1"; shift
3112 my_oldlibs=${1+"$@"}
3118 for my_xlib in $my_oldlibs; do
3119 # Extract the objects.
3121 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3122 *) my_xabs=`pwd`"/$my_xlib" ;;
3124 func_basename "$my_xlib"
3125 my_xlib="$func_basename_result"
3128 case " $extracted_archives " in
3130 func_arith $extracted_serial + 1
3131 extracted_serial=$func_arith_result
3132 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3136 extracted_archives="$extracted_archives $my_xlib_u"
3137 my_xdir="$my_gentop/$my_xlib_u"
3139 func_mkdir_p "$my_xdir"
3143 func_verbose "Extracting $my_xabs"
3144 # Do not bother doing anything if just a dry run
3146 darwin_orig_dir=`pwd`
3147 cd $my_xdir || exit $?
3148 darwin_archive=$my_xabs
3150 darwin_base_archive=`basename "$darwin_archive"`
3151 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3152 if test -n "$darwin_arches"; then
3153 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3155 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3156 for darwin_arch in $darwin_arches ; do
3157 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3158 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3159 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3160 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3162 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3163 done # $darwin_arches
3164 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3165 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3168 for darwin_file in $darwin_filelist; do
3169 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
3170 $LIPO -create -output "$darwin_file" $darwin_files
3171 done # $darwin_filelist
3173 cd "$darwin_orig_dir"
3176 func_extract_an_archive "$my_xdir" "$my_xabs"
3181 func_extract_an_archive "$my_xdir" "$my_xabs"
3184 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3187 func_extract_archives_result="$my_oldobjs"
3192 # func_emit_wrapper arg
3194 # emit a libtool wrapper script on stdout
3195 # don't directly open a file because we may want to
3196 # incorporate the script contents within a cygwin/mingw
3197 # wrapper executable. Must ONLY be called from within
3198 # func_mode_link because it depends on a number of variable
3201 # arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3202 # variable will take. If 'yes', then the emitted script
3203 # will assume that the directory in which it is stored is
3204 # the '.lib' directory. This is a cygwin/mingw-specific
3206 func_emit_wrapper ()
3208 func_emit_wrapper_arg1=no
3209 if test -n "$1" ; then
3210 func_emit_wrapper_arg1=$1
3216 # $output - temporary wrapper script for $objdir/$outputname
3217 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3219 # The $output program cannot be directly executed until all the libtool
3220 # libraries that it depends on are installed.
3222 # This wrapper script should never be moved out of the build directory.
3223 # If it is, it will not operate correctly.
3225 # Sed substitution that helps us do robust quoting. It backslashifies
3226 # metacharacters that are still active within double-quoted strings.
3227 Xsed='${SED} -e 1s/^X//'
3228 sed_quote_subst='$sed_quote_subst'
3230 # Be Bourne compatible
3231 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3234 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3235 # is contrary to our usage. Disable this feature.
3236 alias -g '\${1+\"\$@\"}'='\"\$@\"'
3237 setopt NO_GLOB_SUBST
3239 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3241 BIN_SH=xpg4; export BIN_SH # for Tru64
3242 DUALCASE=1; export DUALCASE # for MKS sh
3244 # The HP-UX ksh and POSIX shell print the target directory to stdout
3246 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3248 relink_command=\"$relink_command\"
3250 # This environment variable determines our operation mode.
3251 if test \"\$libtool_install_magic\" = \"$magic\"; then
3252 # install mode needs the following variables:
3253 generated_by_libtool_version='$macro_version'
3254 notinst_deplibs='$notinst_deplibs'
3256 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3257 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3260 # Make sure echo works.
3261 if test \"X\$1\" = X--no-reexec; then
3262 # Discard the --no-reexec flag, and continue.
3264 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
3265 # Yippee, \$ECHO works!
3268 # Restart under the correct shell, and then maybe \$ECHO will work.
3269 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3275 # Find the directory that this script lives in.
3276 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3277 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3279 # Follow symbolic links until we get to the real thisdir.
3280 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
3281 while test -n \"\$file\"; do
3282 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3284 # If there was a directory component, then change thisdir.
3285 if test \"x\$destdir\" != \"x\$file\"; then
3286 case \"\$destdir\" in
3287 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3288 *) thisdir=\"\$thisdir/\$destdir\" ;;
3292 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3293 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
3296 # Usually 'no', except on cygwin/mingw when embedded into
3298 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
3299 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3300 # special case for '.'
3301 if test \"\$thisdir\" = \".\"; then
3304 # remove .libs from thisdir
3305 case \"\$thisdir\" in
3306 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
3307 $objdir ) thisdir=. ;;
3311 # Try to get the absolute directory name.
3312 absdir=\`cd \"\$thisdir\" && pwd\`
3313 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3316 if test "$fast_install" = yes; then
3318 program=lt-'$outputname'$exeext
3319 progdir=\"\$thisdir/$objdir\"
3321 if test ! -f \"\$progdir/\$program\" ||
3322 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3323 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3325 file=\"\$\$-\$program\"
3327 if test ! -d \"\$progdir\"; then
3328 $MKDIR \"\$progdir\"
3330 $RM \"\$progdir/\$file\"
3335 # relink executable if necessary
3336 if test -n \"\$relink_command\"; then
3337 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3339 $ECHO \"\$relink_command_output\" >&2
3340 $RM \"\$progdir/\$file\"
3345 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3346 { $RM \"\$progdir/\$program\";
3347 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3348 $RM \"\$progdir/\$file\"
3352 program='$outputname'
3353 progdir=\"\$thisdir/$objdir\"
3359 if test -f \"\$progdir/\$program\"; then"
3361 # Export our shlibpath_var if we have one.
3362 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3364 # Add our own library path to $shlibpath_var
3365 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3367 # Some systems cannot cope with colon-terminated $shlibpath_var
3368 # The second colon is a workaround for a bug in BeOS R4 sed
3369 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3371 export $shlibpath_var
3375 # fixup the dll searchpath if we need to.
3376 if test -n "$dllsearchpath"; then
3378 # Add the dll search path components to the executable PATH
3379 PATH=$dllsearchpath:\$PATH
3384 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3385 # Run the actual program with our arguments.
3388 # Backslashes separate directories on plain windows
3389 *-*-mingw | *-*-os2*)
3391 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3397 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3402 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3406 # The program doesn't exist.
3407 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3408 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3409 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3415 # end: func_emit_wrapper
3417 # func_emit_cwrapperexe_src
3418 # emit the source code for a wrapper executable on stdout
3419 # Must ONLY be called from within func_mode_link because
3420 # it depends on a number of variable set therein.
3421 func_emit_cwrapperexe_src ()
3425 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3426 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3428 The $output program cannot be directly executed until all the libtool
3429 libraries that it depends on are installed.
3431 This wrapper executable should never be moved out of the build directory.
3432 If it is, it will not operate correctly.
3434 Currently, it simply execs the wrapper *script* "$SHELL $output",
3435 but could eventually absorb all of the scripts functionality and
3436 exec $objdir/$outputname directly.
3443 # include <direct.h>
3444 # include <process.h>
3446 # define setmode _setmode
3448 # include <unistd.h>
3449 # include <stdint.h>
3461 #include <sys/stat.h>
3463 #if defined(PATH_MAX)
3464 # define LT_PATHMAX PATH_MAX
3465 #elif defined(MAXPATHLEN)
3466 # define LT_PATHMAX MAXPATHLEN
3468 # define LT_PATHMAX 1024
3479 # define S_IXUSR _S_IEXEC
3481 # ifndef _INTPTR_T_DEFINED
3482 # define intptr_t int
3486 #ifndef DIR_SEPARATOR
3487 # define DIR_SEPARATOR '/'
3488 # define PATH_SEPARATOR ':'
3491 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3493 # define HAVE_DOS_BASED_FILE_SYSTEM
3494 # define FOPEN_WB "wb"
3495 # ifndef DIR_SEPARATOR_2
3496 # define DIR_SEPARATOR_2 '\\'
3498 # ifndef PATH_SEPARATOR_2
3499 # define PATH_SEPARATOR_2 ';'
3503 #ifndef DIR_SEPARATOR_2
3504 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3505 #else /* DIR_SEPARATOR_2 */
3506 # define IS_DIR_SEPARATOR(ch) \
3507 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3508 #endif /* DIR_SEPARATOR_2 */
3510 #ifndef PATH_SEPARATOR_2
3511 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3512 #else /* PATH_SEPARATOR_2 */
3513 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3514 #endif /* PATH_SEPARATOR_2 */
3517 # define FOPEN_WB "wb"
3521 # define FOPEN_WB "w"
3524 # define _O_BINARY 0
3527 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3528 #define XFREE(stale) do { \
3529 if (stale) { free ((void *) stale); stale = 0; } \
3532 #undef LTWRAPPER_DEBUGPRINTF
3533 #if defined DEBUGWRAPPER
3534 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3536 ltwrapper_debugprintf (const char *fmt, ...)
3539 va_start (args, fmt);
3540 (void) vfprintf (stderr, fmt, args);
3544 # define LTWRAPPER_DEBUGPRINTF(args)
3547 const char *program_name = NULL;
3549 void *xmalloc (size_t num);
3550 char *xstrdup (const char *string);
3551 const char *base_name (const char *name);
3552 char *find_executable (const char *wrapper);
3553 char *chase_symlinks (const char *pathspec);
3554 int make_executable (const char *path);
3555 int check_executable (const char *path);
3556 char *strendzap (char *str, const char *pat);
3557 void lt_fatal (const char *message, ...);
3559 static const char *script_text =
3562 func_emit_wrapper yes |
3563 $SED -e 's/\([\\"]\)/\\\1/g' \
3564 -e 's/^/ "/' -e 's/$/\\n"/'
3568 const char * MAGIC_EXE = "$magic_exe";
3571 main (int argc, char *argv[])
3575 char *actual_cwrapper_path;
3576 char *shwrapper_name;
3577 intptr_t rval = 127;
3580 const char *dumpscript_opt = "--lt-dump-script";
3583 program_name = (char *) xstrdup (base_name (argv[0]));
3584 LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3585 LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3587 /* very simple arg parsing; don't want to rely on getopt */
3588 for (i = 1; i < argc; i++)
3590 if (strcmp (argv[i], dumpscript_opt) == 0)
3594 *mingw* | *cygwin* )
3595 # make stdout use "unix" line endings
3596 echo " setmode(1,_O_BINARY);"
3601 printf ("%s", script_text);
3606 newargz = XMALLOC (char *, argc + 2);
3609 if test -n "$TARGETSHELL" ; then
3610 # no path translation at all
3611 lt_newargv0=$TARGETSHELL
3615 # awkward: cmd appends spaces to result
3616 lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3617 lt_newargv0=`( cmd //c echo $SHELL | $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo $SHELL`
3618 case $lt_newargv0 in
3620 *) lt_newargv0=$lt_newargv0.exe ;;
3623 * ) lt_newargv0=$SHELL ;;
3628 newargz[0] = (char *) xstrdup ("$lt_newargv0");
3632 tmp_pathspec = find_executable (argv[0]);
3633 if (tmp_pathspec == NULL)
3634 lt_fatal ("Couldn't find %s", argv[0]);
3635 LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3638 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3639 LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3640 actual_cwrapper_path));
3641 XFREE (tmp_pathspec);
3643 shwrapper_name = (char *) xstrdup (base_name (actual_cwrapper_path));
3644 strendzap (actual_cwrapper_path, shwrapper_name);
3646 /* shwrapper_name transforms */
3647 strendzap (shwrapper_name, ".exe");
3648 tmp_pathspec = XMALLOC (char, (strlen (shwrapper_name) +
3649 strlen ("_ltshwrapperTMP") + 1));
3650 strcpy (tmp_pathspec, shwrapper_name);
3651 strcat (tmp_pathspec, "_ltshwrapperTMP");
3652 XFREE (shwrapper_name);
3653 shwrapper_name = tmp_pathspec;
3655 LTWRAPPER_DEBUGPRINTF (("(main) libtool shell wrapper name: %s\n",
3661 XMALLOC (char, (strlen (actual_cwrapper_path) +
3662 strlen ("$objdir") + 1 + strlen (shwrapper_name) + 1));
3663 strcpy (newargz[1], actual_cwrapper_path);
3664 strcat (newargz[1], "$objdir");
3665 strcat (newargz[1], "/");
3666 strcat (newargz[1], shwrapper_name);
3675 while ((p = strchr (newargz[1], '\\')) != NULL)
3685 XFREE (shwrapper_name);
3686 XFREE (actual_cwrapper_path);
3688 /* always write in binary mode */
3689 if ((shwrapper = fopen (newargz[1], FOPEN_WB)) == 0)
3691 lt_fatal ("Could not open %s for writing", newargz[1]);
3693 fprintf (shwrapper, "%s", script_text);
3696 make_executable (newargz[1]);
3698 for (i = 1; i < argc; i++)
3699 newargz[i + 1] = xstrdup (argv[i]);
3700 newargz[argc + 1] = NULL;
3702 for (i = 0; i < argc + 1; i++)
3704 LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i]));
3712 /* execv doesn't actually work on mingw as expected on unix */
3713 rval = _spawnv (_P_WAIT, "$lt_newargv0", (const char * const *) newargz);
3716 /* failed to start process */
3717 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"$lt_newargv0\": errno = %d\n", errno));
3726 execv ("$lt_newargv0", newargz);
3727 return rval; /* =127, but avoids unused variable warning */
3736 xmalloc (size_t num)
3738 void *p = (void *) malloc (num);
3740 lt_fatal ("Memory exhausted");
3746 xstrdup (const char *string)
3748 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3753 base_name (const char *name)
3757 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3758 /* Skip over the disk name in MSDOS pathnames. */
3759 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3763 for (base = name; *name; name++)
3764 if (IS_DIR_SEPARATOR (*name))
3770 check_executable (const char *path)
3774 LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3775 path ? (*path ? path : "EMPTY!") : "NULL!"));
3776 if ((!path) || (!*path))
3779 if ((stat (path, &st) >= 0)
3780 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3787 make_executable (const char *path)
3792 LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3793 path ? (*path ? path : "EMPTY!") : "NULL!"));
3794 if ((!path) || (!*path))
3797 if (stat (path, &st) >= 0)
3799 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3804 /* Searches for the full path of the wrapper. Returns
3805 newly allocated full path name if found, NULL otherwise
3806 Does not chase symlinks, even on platforms that support them.
3809 find_executable (const char *wrapper)
3814 /* static buffer for getcwd */
3815 char tmp[LT_PATHMAX + 1];
3819 LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3820 wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3822 if ((wrapper == NULL) || (*wrapper == '\0'))
3825 /* Absolute path? */
3826 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3827 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3829 concat_name = xstrdup (wrapper);
3830 if (check_executable (concat_name))
3832 XFREE (concat_name);
3837 if (IS_DIR_SEPARATOR (wrapper[0]))
3839 concat_name = xstrdup (wrapper);
3840 if (check_executable (concat_name))
3842 XFREE (concat_name);
3844 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3848 for (p = wrapper; *p; p++)
3856 /* no slashes; search PATH */
3857 const char *path = getenv ("PATH");
3860 for (p = path; *p; p = p_next)
3864 for (q = p; *q; q++)
3865 if (IS_PATH_SEPARATOR (*q))
3868 p_next = (*q == '\0' ? q : q + 1);
3871 /* empty path: current directory */
3872 if (getcwd (tmp, LT_PATHMAX) == NULL)
3873 lt_fatal ("getcwd failed");
3874 tmp_len = strlen (tmp);
3876 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3877 memcpy (concat_name, tmp, tmp_len);
3878 concat_name[tmp_len] = '/';
3879 strcpy (concat_name + tmp_len + 1, wrapper);
3884 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3885 memcpy (concat_name, p, p_len);
3886 concat_name[p_len] = '/';
3887 strcpy (concat_name + p_len + 1, wrapper);
3889 if (check_executable (concat_name))
3891 XFREE (concat_name);
3894 /* not found in PATH; assume curdir */
3896 /* Relative path | not found in path: prepend cwd */
3897 if (getcwd (tmp, LT_PATHMAX) == NULL)
3898 lt_fatal ("getcwd failed");
3899 tmp_len = strlen (tmp);
3900 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3901 memcpy (concat_name, tmp, tmp_len);
3902 concat_name[tmp_len] = '/';
3903 strcpy (concat_name + tmp_len + 1, wrapper);
3905 if (check_executable (concat_name))
3907 XFREE (concat_name);
3912 chase_symlinks (const char *pathspec)
3915 return xstrdup (pathspec);
3917 char buf[LT_PATHMAX];
3919 char *tmp_pathspec = xstrdup (pathspec);
3921 int has_symlinks = 0;
3922 while (strlen (tmp_pathspec) && !has_symlinks)
3924 LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3926 if (lstat (tmp_pathspec, &s) == 0)
3928 if (S_ISLNK (s.st_mode) != 0)
3934 /* search backwards for last DIR_SEPARATOR */
3935 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3936 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3938 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3940 /* no more DIR_SEPARATORS left */
3947 char *errstr = strerror (errno);
3948 lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3951 XFREE (tmp_pathspec);
3955 return xstrdup (pathspec);
3958 tmp_pathspec = realpath (pathspec, buf);
3959 if (tmp_pathspec == 0)
3961 lt_fatal ("Could not follow symlinks for %s", pathspec);
3963 return xstrdup (tmp_pathspec);
3968 strendzap (char *str, const char *pat)
3972 assert (str != NULL);
3973 assert (pat != NULL);
3976 patlen = strlen (pat);
3980 str += len - patlen;
3981 if (strcmp (str, pat) == 0)
3988 lt_error_core (int exit_status, const char *mode,
3989 const char *message, va_list ap)
3991 fprintf (stderr, "%s: %s: ", program_name, mode);
3992 vfprintf (stderr, message, ap);
3993 fprintf (stderr, ".\n");
3995 if (exit_status >= 0)
4000 lt_fatal (const char *message, ...)
4003 va_start (ap, message);
4004 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4009 # end: func_emit_cwrapperexe_src
4011 # func_mode_link arg...
4016 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4017 # It is impossible to link a dll without this setting, and
4018 # we shouldn't force the makefile maintainer to figure out
4019 # which system we are compiling for in order to pass an extra
4020 # flag for every libtool invocation.
4021 # allow_undefined=no
4023 # FIXME: Unfortunately, there are problems with the above when trying
4024 # to make a dll which has undefined symbols, in which case not
4025 # even a static library is built. For now, we need to specify
4026 # -no-undefined on the libtool link line when we can be certain
4027 # that all symbols are satisfied, otherwise we get a static library.
4034 libtool_args=$nonopt
4035 base_compile="$nonopt $@"
4036 compile_command=$nonopt
4037 finalize_command=$nonopt
4050 lib_search_path=`pwd`
4052 new_inherited_linker_flags=
4060 export_symbols_regex=
4068 precious_files_regex=
4069 prefer_static_libs=no
4082 single_module="${wl}-single_module"
4083 func_infer_tag $base_compile
4085 # We need to know -static, to get the right output filenames.
4090 test "$build_libtool_libs" != yes && \
4091 func_fatal_configuration "can not build a shared library"
4095 -all-static | -static | -static-libtool-libs)
4098 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4099 func_warning "complete static linking is impossible in this configuration"
4101 if test -n "$link_static_flag"; then
4102 dlopen_self=$dlopen_self_static
4104 prefer_static_libs=yes
4107 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4108 dlopen_self=$dlopen_self_static
4110 prefer_static_libs=built
4112 -static-libtool-libs)
4113 if test -z "$pic_flag" && test -n "$link_static_flag"; then
4114 dlopen_self=$dlopen_self_static
4116 prefer_static_libs=yes
4119 build_libtool_libs=no
4126 # See if our shared archives depend on static archives.
4127 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4129 # Go through the arguments, transforming them on the way.
4130 while test "$#" -gt 0; do
4133 func_quote_for_eval "$arg"
4134 qarg=$func_quote_for_eval_unquoted_result
4135 func_append libtool_args " $func_quote_for_eval_result"
4137 # If the previous option needs an argument, assign it.
4138 if test -n "$prev"; then
4141 func_append compile_command " @OUTPUT@"
4142 func_append finalize_command " @OUTPUT@"
4148 if test "$preload" = no; then
4149 # Add the symbol object into the linking commands.
4150 func_append compile_command " @SYMFILE@"
4151 func_append finalize_command " @SYMFILE@"
4155 *.la | *.lo) ;; # We handle these cases below.
4157 if test "$dlself" = no; then
4165 if test "$prev" = dlprefiles; then
4167 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4177 if test "$prev" = dlfiles; then
4178 dlfiles="$dlfiles $arg"
4180 dlprefiles="$dlprefiles $arg"
4188 export_symbols="$arg"
4190 || func_fatal_error "symbol file \`$arg' does not exist"
4195 export_symbols_regex="$arg"
4203 *" $qarg.ltframework "*) ;;
4204 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4213 inst_prefix_dir="$arg"
4218 if test -f "$arg"; then
4221 for fil in `cat "$save_arg"`
4223 # moreargs="$moreargs $fil"
4225 # A libtool-controlled object.
4227 # Check to see that this really is a libtool object.
4228 if func_lalib_unsafe_p "$arg"; then
4235 if test -z "$pic_object" ||
4236 test -z "$non_pic_object" ||
4237 test "$pic_object" = none &&
4238 test "$non_pic_object" = none; then
4239 func_fatal_error "cannot find name of object for \`$arg'"
4242 # Extract subdirectory from the argument.
4243 func_dirname "$arg" "/" ""
4244 xdir="$func_dirname_result"
4246 if test "$pic_object" != none; then
4247 # Prepend the subdirectory the object is found in.
4248 pic_object="$xdir$pic_object"
4250 if test "$prev" = dlfiles; then
4251 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4252 dlfiles="$dlfiles $pic_object"
4256 # If libtool objects are unsupported, then we need to preload.
4261 # CHECK ME: I think I busted this. -Ossama
4262 if test "$prev" = dlprefiles; then
4263 # Preload the old-style object.
4264 dlprefiles="$dlprefiles $pic_object"
4269 func_append libobjs " $pic_object"
4274 if test "$non_pic_object" != none; then
4275 # Prepend the subdirectory the object is found in.
4276 non_pic_object="$xdir$non_pic_object"
4278 # A standard non-PIC object
4279 func_append non_pic_objects " $non_pic_object"
4280 if test -z "$pic_object" || test "$pic_object" = none ; then
4281 arg="$non_pic_object"
4284 # If the PIC object exists, use it instead.
4285 # $xdir was prepended to $pic_object above.
4286 non_pic_object="$pic_object"
4287 func_append non_pic_objects " $non_pic_object"
4290 # Only an error if not doing a dry-run.
4291 if $opt_dry_run; then
4292 # Extract subdirectory from the argument.
4293 func_dirname "$arg" "/" ""
4294 xdir="$func_dirname_result"
4297 pic_object=$xdir$objdir/$func_lo2o_result
4298 non_pic_object=$xdir$func_lo2o_result
4299 func_append libobjs " $pic_object"
4300 func_append non_pic_objects " $non_pic_object"
4302 func_fatal_error "\`$arg' is not a valid libtool object"
4307 func_fatal_error "link input file \`$arg' does not exist"
4314 precious_files_regex="$arg"
4324 # We need an absolute path.
4326 [\\/]* | [A-Za-z]:[\\/]*) ;;
4328 func_fatal_error "only absolute run-paths are allowed"
4331 if test "$prev" = rpath; then
4334 *) rpath="$rpath $arg" ;;
4339 *) xrpath="$xrpath $arg" ;;
4351 weak_libs="$weak_libs $arg"
4356 linker_flags="$linker_flags $qarg"
4357 compiler_flags="$compiler_flags $qarg"
4359 func_append compile_command " $qarg"
4360 func_append finalize_command " $qarg"
4364 compiler_flags="$compiler_flags $qarg"
4366 func_append compile_command " $qarg"
4367 func_append finalize_command " $qarg"
4371 linker_flags="$linker_flags $qarg"
4372 compiler_flags="$compiler_flags $wl$qarg"
4374 func_append compile_command " $wl$qarg"
4375 func_append finalize_command " $wl$qarg"
4379 eval "$prev=\"\$arg\""
4384 fi # test -n "$prev"
4390 if test -n "$link_static_flag"; then
4391 # See comment for -static flag below, for more details.
4392 func_append compile_command " $link_static_flag"
4393 func_append finalize_command " $link_static_flag"
4399 # FIXME: remove this flag sometime in the future.
4400 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4423 -export-symbols | -export-symbols-regex)
4424 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4425 func_fatal_error "more than one -exported-symbols argument is not allowed"
4427 if test "X$arg" = "X-export-symbols"; then
4445 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4446 # so, if we see these flags be careful not to treat them like -L
4448 case $with_gcc/$host in
4449 no/*-*-irix* | /*-*-irix*)
4450 func_append compile_command " $arg"
4451 func_append finalize_command " $arg"
4458 func_stripname '-L' '' "$arg"
4459 dir=$func_stripname_result
4460 # We need an absolute path.
4462 [\\/]* | [A-Za-z]:[\\/]*) ;;
4464 absdir=`cd "$dir" && pwd`
4465 test -z "$absdir" && \
4466 func_fatal_error "cannot determine absolute directory name of \`$dir'"
4473 deplibs="$deplibs -L$dir"
4474 lib_search_path="$lib_search_path $dir"
4478 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4479 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4480 case :$dllsearchpath: in
4482 *) dllsearchpath="$dllsearchpath:$dir";;
4484 case :$dllsearchpath: in
4485 *":$testbindir:"*) ;;
4486 *) dllsearchpath="$dllsearchpath:$testbindir";;
4494 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4496 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
4497 # These systems don't actually have a C or math library (as such)
4501 # These systems don't actually have a C library (as such)
4502 test "X$arg" = "X-lc" && continue
4504 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4505 # Do not include libc due to us having libc/libc_r.
4506 test "X$arg" = "X-lc" && continue
4508 *-*-rhapsody* | *-*-darwin1.[012])
4509 # Rhapsody C and math libraries are in the System framework
4510 deplibs="$deplibs System.ltframework"
4513 *-*-sco3.2v5* | *-*-sco5v6*)
4514 # Causes problems with __ctype
4515 test "X$arg" = "X-lc" && continue
4517 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4518 # Compiler inserts libc in the correct place for threads to work
4519 test "X$arg" = "X-lc" && continue
4522 elif test "X$arg" = "X-lc_r"; then
4524 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4525 # Do not include libc_r directly, use -pthread flag.
4530 deplibs="$deplibs $arg"
4539 # Tru64 UNIX uses -model [arg] to determine the layout of C++
4540 # classes, name mangling, and exception handling.
4541 # Darwin uses the -arch flag to determine output architecture.
4542 -model|-arch|-isysroot)
4543 compiler_flags="$compiler_flags $arg"
4544 func_append compile_command " $arg"
4545 func_append finalize_command " $arg"
4550 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4551 compiler_flags="$compiler_flags $arg"
4552 func_append compile_command " $arg"
4553 func_append finalize_command " $arg"
4554 case "$new_inherited_linker_flags " in
4556 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4562 single_module="${wl}-multi_module"
4573 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
4574 # The PATH hackery in wrapper scripts is required on Windows
4575 # and Darwin in order for the loader to find any dlls it needs.
4576 func_warning "\`-no-install' is ignored for $host"
4577 func_warning "assuming \`-no-fast-install' instead"
4580 *) no_install=yes ;;
4597 -precious-files-regex)
4618 func_stripname '-R' '' "$arg"
4619 dir=$func_stripname_result
4620 # We need an absolute path.
4622 [\\/]* | [A-Za-z]:[\\/]*) ;;
4624 func_fatal_error "only absolute run-paths are allowed"
4629 *) xrpath="$xrpath $dir" ;;
4635 # The effects of -shared are defined in a previous loop.
4644 -static | -static-libtool-libs)
4645 # The effects of -static are defined in a previous loop.
4646 # We used to do the same as -all-static on platforms that
4647 # didn't have a PIC flag, but the assumption that the effects
4648 # would be equivalent was wrong. It would break on at least
4649 # Digital Unix and AIX.
4675 func_stripname '-Wc,' '' "$arg"
4676 args=$func_stripname_result
4678 save_ifs="$IFS"; IFS=','
4679 for flag in $args; do
4681 func_quote_for_eval "$flag"
4682 arg="$arg $wl$func_quote_for_eval_result"
4683 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4686 func_stripname ' ' '' "$arg"
4687 arg=$func_stripname_result
4691 func_stripname '-Wl,' '' "$arg"
4692 args=$func_stripname_result
4694 save_ifs="$IFS"; IFS=','
4695 for flag in $args; do
4697 func_quote_for_eval "$flag"
4698 arg="$arg $wl$func_quote_for_eval_result"
4699 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4700 linker_flags="$linker_flags $func_quote_for_eval_result"
4703 func_stripname ' ' '' "$arg"
4704 arg=$func_stripname_result
4724 func_quote_for_eval "$arg"
4725 arg="$func_quote_for_eval_result"
4728 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4729 # -r[0-9][0-9]* specifies the processor on the SGI compiler
4730 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4731 # +DA*, +DD* enable 64-bit mode on the HP compiler
4732 # -q* pass through compiler args for the IBM compiler
4733 # -m*, -t[45]*, -txscale* pass through architecture-specific
4734 # compiler args for GCC
4735 # -F/path gives path to uninstalled frameworks, gcc on darwin
4736 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4737 # @file GCC response files
4738 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4739 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4740 func_quote_for_eval "$arg"
4741 arg="$func_quote_for_eval_result"
4742 func_append compile_command " $arg"
4743 func_append finalize_command " $arg"
4744 compiler_flags="$compiler_flags $arg"
4748 # Some other compiler flag.
4750 func_quote_for_eval "$arg"
4751 arg="$func_quote_for_eval_result"
4755 # A standard object.
4760 # A libtool-controlled object.
4762 # Check to see that this really is a libtool object.
4763 if func_lalib_unsafe_p "$arg"; then
4770 if test -z "$pic_object" ||
4771 test -z "$non_pic_object" ||
4772 test "$pic_object" = none &&
4773 test "$non_pic_object" = none; then
4774 func_fatal_error "cannot find name of object for \`$arg'"
4777 # Extract subdirectory from the argument.
4778 func_dirname "$arg" "/" ""
4779 xdir="$func_dirname_result"
4781 if test "$pic_object" != none; then
4782 # Prepend the subdirectory the object is found in.
4783 pic_object="$xdir$pic_object"
4785 if test "$prev" = dlfiles; then
4786 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4787 dlfiles="$dlfiles $pic_object"
4791 # If libtool objects are unsupported, then we need to preload.
4796 # CHECK ME: I think I busted this. -Ossama
4797 if test "$prev" = dlprefiles; then
4798 # Preload the old-style object.
4799 dlprefiles="$dlprefiles $pic_object"
4804 func_append libobjs " $pic_object"
4809 if test "$non_pic_object" != none; then
4810 # Prepend the subdirectory the object is found in.
4811 non_pic_object="$xdir$non_pic_object"
4813 # A standard non-PIC object
4814 func_append non_pic_objects " $non_pic_object"
4815 if test -z "$pic_object" || test "$pic_object" = none ; then
4816 arg="$non_pic_object"
4819 # If the PIC object exists, use it instead.
4820 # $xdir was prepended to $pic_object above.
4821 non_pic_object="$pic_object"
4822 func_append non_pic_objects " $non_pic_object"
4825 # Only an error if not doing a dry-run.
4826 if $opt_dry_run; then
4827 # Extract subdirectory from the argument.
4828 func_dirname "$arg" "/" ""
4829 xdir="$func_dirname_result"
4832 pic_object=$xdir$objdir/$func_lo2o_result
4833 non_pic_object=$xdir$func_lo2o_result
4834 func_append libobjs " $pic_object"
4835 func_append non_pic_objects " $non_pic_object"
4837 func_fatal_error "\`$arg' is not a valid libtool object"
4844 deplibs="$deplibs $arg"
4845 old_deplibs="$old_deplibs $arg"
4850 # A libtool-controlled library.
4852 if test "$prev" = dlfiles; then
4853 # This library was specified with -dlopen.
4854 dlfiles="$dlfiles $arg"
4856 elif test "$prev" = dlprefiles; then
4857 # The library was specified with -dlpreopen.
4858 dlprefiles="$dlprefiles $arg"
4861 deplibs="$deplibs $arg"
4866 # Some other compiler argument.
4868 # Unknown arguments in both finalize_command and compile_command need
4869 # to be aesthetically quoted because they are evaled later.
4870 func_quote_for_eval "$arg"
4871 arg="$func_quote_for_eval_result"
4875 # Now actually substitute the argument into the commands.
4876 if test -n "$arg"; then
4877 func_append compile_command " $arg"
4878 func_append finalize_command " $arg"
4880 done # argument parsing loop
4882 test -n "$prev" && \
4883 func_fatal_help "the \`$prevarg' option requires an argument"
4885 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4886 eval arg=\"$export_dynamic_flag_spec\"
4887 func_append compile_command " $arg"
4888 func_append finalize_command " $arg"
4892 # calculate the name of the file, without its directory
4893 func_basename "$output"
4894 outputname="$func_basename_result"
4895 libobjs_save="$libobjs"
4897 if test -n "$shlibpath_var"; then
4898 # get the directories listed in $shlibpath_var
4899 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4903 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4904 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4906 func_dirname "$output" "/" ""
4907 output_objdir="$func_dirname_result$objdir"
4908 # Create the object directory.
4909 func_mkdir_p "$output_objdir"
4911 # Determine the type of output
4914 func_fatal_help "you must specify an output file"
4916 *.$libext) linkmode=oldlib ;;
4917 *.lo | *.$objext) linkmode=obj ;;
4918 *.la) linkmode=lib ;;
4919 *) linkmode=prog ;; # Anything else should be a program.
4925 # Find all interdependent deplibs by searching for libraries
4926 # that are linked more than once (e.g. -la -lb -la)
4927 for deplib in $deplibs; do
4928 if $opt_duplicate_deps ; then
4930 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4933 libs="$libs $deplib"
4936 if test "$linkmode" = lib; then
4937 libs="$predeps $libs $compiler_lib_search_path $postdeps"
4939 # Compute libraries that are listed more than once in $predeps
4940 # $postdeps and mark them as special (i.e., whose duplicates are
4941 # not to be eliminated).
4943 if $opt_duplicate_compiler_generated_deps; then
4944 for pre_post_dep in $predeps $postdeps; do
4945 case "$pre_post_deps " in
4946 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4948 pre_post_deps="$pre_post_deps $pre_post_dep"
4957 need_relink=no # whether we're linking any uninstalled libtool libraries
4958 notinst_deplibs= # not-installed libtool libraries
4959 notinst_path= # paths that contain not-installed libtool libraries
4963 passes="conv dlpreopen link"
4964 for file in $dlfiles $dlprefiles; do
4968 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
4979 passes="conv scan dlopen dlpreopen link"
4985 for pass in $passes; do
4986 # The preopen pass in lib mode reverses $deplibs; put it back here
4987 # so that -L comes before libs that need it for instance...
4988 if test "$linkmode,$pass" = "lib,link"; then
4989 ## FIXME: Find the place where the list is rebuilt in the wrong
4990 ## order, and fix it there properly
4992 for deplib in $deplibs; do
4993 tmp_deplibs="$deplib $tmp_deplibs"
4995 deplibs="$tmp_deplibs"
4998 if test "$linkmode,$pass" = "lib,link" ||
4999 test "$linkmode,$pass" = "prog,scan"; then
5003 if test "$linkmode" = prog; then
5005 dlopen) libs="$dlfiles" ;;
5006 dlpreopen) libs="$dlprefiles" ;;
5008 libs="$deplibs %DEPLIBS%"
5009 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
5013 if test "$linkmode,$pass" = "lib,dlpreopen"; then
5014 # Collect and forward deplibs of preopened libtool libs
5015 for lib in $dlprefiles; do
5016 # Ignore non-libtool-libs
5019 *.la) func_source "$lib" ;;
5022 # Collect preopened libtool deplibs, except any this library
5023 # has declared as weak libs
5024 for deplib in $dependency_libs; do
5025 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
5026 case " $weak_libs " in
5027 *" $deplib_base "*) ;;
5028 *) deplibs="$deplibs $deplib" ;;
5034 if test "$pass" = dlopen; then
5035 # Collect dlpreopened libraries
5036 save_deplibs="$deplibs"
5040 for deplib in $libs; do
5044 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
5045 if test "$linkmode,$pass" = "prog,link"; then
5046 compile_deplibs="$deplib $compile_deplibs"
5047 finalize_deplibs="$deplib $finalize_deplibs"
5049 compiler_flags="$compiler_flags $deplib"
5050 if test "$linkmode" = lib ; then
5051 case "$new_inherited_linker_flags " in
5053 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5060 if test "$linkmode" != lib && test "$linkmode" != prog; then
5061 func_warning "\`-l' is ignored for archives/objects"
5064 func_stripname '-l' '' "$deplib"
5065 name=$func_stripname_result
5066 if test "$linkmode" = lib; then
5067 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5069 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5071 for searchdir in $searchdirs; do
5072 for search_ext in .la $std_shrext .so .a; do
5073 # Search the libtool library
5074 lib="$searchdir/lib${name}${search_ext}"
5075 if test -f "$lib"; then
5076 if test "$search_ext" = ".la"; then
5085 if test "$found" != yes; then
5086 # deplib doesn't seem to be a libtool library
5087 if test "$linkmode,$pass" = "prog,link"; then
5088 compile_deplibs="$deplib $compile_deplibs"
5089 finalize_deplibs="$deplib $finalize_deplibs"
5091 deplibs="$deplib $deplibs"
5092 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5095 else # deplib is a libtool library
5096 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5097 # We need to do some special things here, and not later.
5098 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
5099 case " $predeps $postdeps " in
5101 if func_lalib_p "$lib"; then
5105 for l in $old_library $library_names; do
5108 if test "X$ll" = "X$old_library" ; then # only static version available
5110 func_dirname "$lib" "" "."
5111 ladir="$func_dirname_result"
5112 lib=$ladir/$old_library
5113 if test "$linkmode,$pass" = "prog,link"; then
5114 compile_deplibs="$deplib $compile_deplibs"
5115 finalize_deplibs="$deplib $finalize_deplibs"
5117 deplibs="$deplib $deplibs"
5118 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
5130 if test "$linkmode,$pass" = "prog,link"; then
5131 compile_deplibs="$deplib $compile_deplibs"
5132 finalize_deplibs="$deplib $finalize_deplibs"
5134 deplibs="$deplib $deplibs"
5135 if test "$linkmode" = lib ; then
5136 case "$new_inherited_linker_flags " in
5138 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
5147 deplibs="$deplib $deplibs"
5148 test "$pass" = conv && continue
5149 newdependency_libs="$deplib $newdependency_libs"
5150 func_stripname '-L' '' "$deplib"
5151 newlib_search_path="$newlib_search_path $func_stripname_result"
5154 if test "$pass" = conv; then
5155 deplibs="$deplib $deplibs"
5158 if test "$pass" = scan; then
5159 deplibs="$deplib $deplibs"
5161 compile_deplibs="$deplib $compile_deplibs"
5162 finalize_deplibs="$deplib $finalize_deplibs"
5164 func_stripname '-L' '' "$deplib"
5165 newlib_search_path="$newlib_search_path $func_stripname_result"
5168 func_warning "\`-L' is ignored for archives/objects"
5174 if test "$pass" = link; then
5175 func_stripname '-R' '' "$deplib"
5176 dir=$func_stripname_result
5177 # Make sure the xrpath contains only unique directories.
5180 *) xrpath="$xrpath $dir" ;;
5183 deplibs="$deplib $deplibs"
5186 *.la) lib="$deplib" ;;
5188 if test "$pass" = conv; then
5189 deplibs="$deplib $deplibs"
5194 # Linking convenience modules into shared libraries is allowed,
5195 # but linking other static libraries is non-portable.
5196 case " $dlpreconveniencelibs " in
5200 case $deplibs_check_method in
5202 set dummy $deplibs_check_method; shift
5203 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5204 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
5205 | $EGREP "$match_pattern_regex" > /dev/null; then
5213 if test "$valid_a_lib" != yes; then
5215 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5216 $ECHO "*** I have the capability to make that library automatically link in when"
5217 $ECHO "*** you link to this library. But I can only do this if you have a"
5218 $ECHO "*** shared version of the library, which you do not appear to have"
5219 $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5220 $ECHO "*** that it is just a static archive that I should not use here."
5223 $ECHO "*** Warning: Linking the shared library $output against the"
5224 $ECHO "*** static library $deplib is not portable!"
5225 deplibs="$deplib $deplibs"
5232 if test "$pass" != link; then
5233 deplibs="$deplib $deplibs"
5235 compile_deplibs="$deplib $compile_deplibs"
5236 finalize_deplibs="$deplib $finalize_deplibs"
5243 if test "$pass" = conv; then
5244 deplibs="$deplib $deplibs"
5245 elif test "$linkmode" = prog; then
5246 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5247 # If there is no dlopen support or we're linking statically,
5248 # we need to preload.
5249 newdlprefiles="$newdlprefiles $deplib"
5250 compile_deplibs="$deplib $compile_deplibs"
5251 finalize_deplibs="$deplib $finalize_deplibs"
5253 newdlfiles="$newdlfiles $deplib"
5264 if test "$found" = yes || test -f "$lib"; then :
5266 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
5269 # Check to see that this really is a libtool archive.
5270 func_lalib_unsafe_p "$lib" \
5271 || func_fatal_error "\`$lib' is not a valid libtool archive"
5273 func_dirname "$lib" "" "."
5274 ladir="$func_dirname_result"
5282 inherited_linker_flags=
5283 # If the library was installed with an old release of libtool,
5284 # it will not redefine variables installed, or shouldnotlink
5293 # Convert "-framework foo" to "foo.ltframework"
5294 if test -n "$inherited_linker_flags"; then
5295 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
5296 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5297 case " $new_inherited_linker_flags " in
5298 *" $tmp_inherited_linker_flag "*) ;;
5299 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5303 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5304 if test "$linkmode,$pass" = "lib,link" ||
5305 test "$linkmode,$pass" = "prog,scan" ||
5306 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5307 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5308 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5311 if test "$pass" = conv; then
5312 # Only check for convenience libraries
5313 deplibs="$lib $deplibs"
5314 if test -z "$libdir"; then
5315 if test -z "$old_library"; then
5316 func_fatal_error "cannot find name of link library for \`$lib'"
5318 # It is a libtool convenience library, so add in its objects.
5319 convenience="$convenience $ladir/$objdir/$old_library"
5320 old_convenience="$old_convenience $ladir/$objdir/$old_library"
5321 elif test "$linkmode" != prog && test "$linkmode" != lib; then
5322 func_fatal_error "\`$lib' is not a convenience library"
5325 for deplib in $dependency_libs; do
5326 deplibs="$deplib $deplibs"
5327 if $opt_duplicate_deps ; then
5328 case "$tmp_libs " in
5329 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5332 tmp_libs="$tmp_libs $deplib"
5338 # Get the name of the library we link against.
5340 for l in $old_library $library_names; do
5343 if test -z "$linklib"; then
5344 func_fatal_error "cannot find name of link library for \`$lib'"
5347 # This library was specified with -dlopen.
5348 if test "$pass" = dlopen; then
5349 if test -z "$libdir"; then
5350 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
5352 if test -z "$dlname" ||
5353 test "$dlopen_support" != yes ||
5354 test "$build_libtool_libs" = no; then
5355 # If there is no dlname, no dlopen support or we're linking
5356 # statically, we need to preload. We also need to preload any
5357 # dependent libraries so libltdl's deplib preloader doesn't
5358 # bomb out in the load deplibs phase.
5359 dlprefiles="$dlprefiles $lib $dependency_libs"
5361 newdlfiles="$newdlfiles $lib"
5366 # We need an absolute path.
5368 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
5370 abs_ladir=`cd "$ladir" && pwd`
5371 if test -z "$abs_ladir"; then
5372 func_warning "cannot determine absolute directory name of \`$ladir'"
5373 func_warning "passing it literally to the linker, although it might fail"
5378 func_basename "$lib"
5379 laname="$func_basename_result"
5381 # Find the relevant object directory and library name.
5382 if test "X$installed" = Xyes; then
5383 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5384 func_warning "library \`$lib' was moved."
5392 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5394 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5397 # Remove this search path later
5398 notinst_path="$notinst_path $abs_ladir"
5400 dir="$ladir/$objdir"
5401 absdir="$abs_ladir/$objdir"
5402 # Remove this search path later
5403 notinst_path="$notinst_path $abs_ladir"
5405 fi # $installed = yes
5406 func_stripname 'lib' '.la' "$laname"
5407 name=$func_stripname_result
5409 # This library was specified with -dlpreopen.
5410 if test "$pass" = dlpreopen; then
5411 if test -z "$libdir" && test "$linkmode" = prog; then
5412 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5414 # Prefer using a static library (so that no silly _DYNAMIC symbols
5415 # are required to link).
5416 if test -n "$old_library"; then
5417 newdlprefiles="$newdlprefiles $dir/$old_library"
5418 # Keep a list of preopened convenience libraries to check
5419 # that they are being used correctly in the link pass.
5420 test -z "$libdir" && \
5421 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5422 # Otherwise, use the dlname, so that lt_dlopen finds it.
5423 elif test -n "$dlname"; then
5424 newdlprefiles="$newdlprefiles $dir/$dlname"
5426 newdlprefiles="$newdlprefiles $dir/$linklib"
5428 fi # $pass = dlpreopen
5430 if test -z "$libdir"; then
5431 # Link the convenience library
5432 if test "$linkmode" = lib; then
5433 deplibs="$dir/$old_library $deplibs"
5434 elif test "$linkmode,$pass" = "prog,link"; then
5435 compile_deplibs="$dir/$old_library $compile_deplibs"
5436 finalize_deplibs="$dir/$old_library $finalize_deplibs"
5438 deplibs="$lib $deplibs" # used for prog,scan pass
5444 if test "$linkmode" = prog && test "$pass" != link; then
5445 newlib_search_path="$newlib_search_path $ladir"
5446 deplibs="$lib $deplibs"
5449 if test "$link_all_deplibs" != no || test -z "$library_names" ||
5450 test "$build_libtool_libs" = no; then
5455 for deplib in $dependency_libs; do
5457 -L*) func_stripname '-L' '' "$deplib"
5458 newlib_search_path="$newlib_search_path $func_stripname_result"
5461 # Need to link against all dependency_libs?
5462 if test "$linkalldeplibs" = yes; then
5463 deplibs="$deplib $deplibs"
5465 # Need to hardcode shared library paths
5466 # or/and link against static libraries
5467 newdependency_libs="$deplib $newdependency_libs"
5469 if $opt_duplicate_deps ; then
5470 case "$tmp_libs " in
5471 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5474 tmp_libs="$tmp_libs $deplib"
5477 fi # $linkmode = prog...
5479 if test "$linkmode,$pass" = "prog,link"; then
5480 if test -n "$library_names" &&
5481 { { test "$prefer_static_libs" = no ||
5482 test "$prefer_static_libs,$installed" = "built,yes"; } ||
5483 test -z "$old_library"; }; then
5484 # We need to hardcode the library path
5485 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
5486 # Make sure the rpath contains only unique directories.
5487 case "$temp_rpath:" in
5489 *) temp_rpath="$temp_rpath$absdir:" ;;
5493 # Hardcode the library path.
5494 # Skip directories that are in the system default run-time
5496 case " $sys_lib_dlsearch_path " in
5499 case "$compile_rpath " in
5501 *) compile_rpath="$compile_rpath $absdir"
5505 case " $sys_lib_dlsearch_path " in
5508 case "$finalize_rpath " in
5510 *) finalize_rpath="$finalize_rpath $libdir"
5514 fi # $linkmode,$pass = prog,link...
5516 if test "$alldeplibs" = yes &&
5517 { test "$deplibs_check_method" = pass_all ||
5518 { test "$build_libtool_libs" = yes &&
5519 test -n "$library_names"; }; }; then
5520 # We only need to search for static libraries
5525 link_static=no # Whether the deplib will be linked statically
5526 use_static_libs=$prefer_static_libs
5527 if test "$use_static_libs" = built && test "$installed" = yes; then
5530 if test -n "$library_names" &&
5531 { test "$use_static_libs" = no || test -z "$old_library"; }; then
5534 # No point in relinking DLLs because paths are not encoded
5535 notinst_deplibs="$notinst_deplibs $lib"
5539 if test "$installed" = no; then
5540 notinst_deplibs="$notinst_deplibs $lib"
5545 # This is a shared library
5547 # Warn about portability, can't link against -module's on some
5548 # systems (darwin). Don't bleat about dlopened modules though!
5550 for dlpremoduletest in $dlprefiles; do
5551 if test "X$dlpremoduletest" = "X$lib"; then
5552 dlopenmodule="$dlpremoduletest"
5556 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5558 if test "$linkmode" = prog; then
5559 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5561 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5563 $ECHO "*** $linklib is not portable!"
5565 if test "$linkmode" = lib &&
5566 test "$hardcode_into_libs" = yes; then
5567 # Hardcode the library path.
5568 # Skip directories that are in the system default run-time
5570 case " $sys_lib_dlsearch_path " in
5573 case "$compile_rpath " in
5575 *) compile_rpath="$compile_rpath $absdir"
5579 case " $sys_lib_dlsearch_path " in
5582 case "$finalize_rpath " in
5584 *) finalize_rpath="$finalize_rpath $libdir"
5590 if test -n "$old_archive_from_expsyms_cmds"; then
5591 # figure out the soname
5592 set dummy $library_names
5596 libname=`eval "\\$ECHO \"$libname_spec\""`
5597 # use dlname if we got it. it's perfectly good, no?
5598 if test -n "$dlname"; then
5600 elif test -n "$soname_spec"; then
5604 func_arith $current - $age
5605 major=$func_arith_result
5609 eval soname=\"$soname_spec\"
5614 # Make a new name for the extract_expsyms_cmds to use
5616 func_basename "$soroot"
5617 soname="$func_basename_result"
5618 func_stripname 'lib' '.dll' "$soname"
5619 newlib=libimp-$func_stripname_result.a
5621 # If the library has no export list, then create one now
5622 if test -f "$output_objdir/$soname-def"; then :
5624 func_verbose "extracting exported symbol list from \`$soname'"
5625 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5629 if test -f "$output_objdir/$newlib"; then :; else
5630 func_verbose "generating import library for \`$soname'"
5631 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5633 # make sure the library variables are pointing to the new library
5636 fi # test -n "$old_archive_from_expsyms_cmds"
5638 if test "$linkmode" = prog || test "$mode" != relink; then
5643 case $hardcode_action in
5644 immediate | unsupported)
5645 if test "$hardcode_direct" = no; then
5648 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
5649 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
5650 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5651 *-*-unixware7*) add_dir="-L$dir" ;;
5653 # if the lib is a (non-dlopened) module then we can not
5654 # link against it, someone is ignoring the earlier warnings
5655 if /usr/bin/file -L $add 2> /dev/null |
5656 $GREP ": [^:]* bundle" >/dev/null ; then
5657 if test "X$dlopenmodule" != "X$lib"; then
5658 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5659 if test -z "$old_library" ; then
5661 $ECHO "*** And there doesn't seem to be a static archive available"
5662 $ECHO "*** The link will probably fail, sorry"
5664 add="$dir/$old_library"
5666 elif test -n "$old_library"; then
5667 add="$dir/$old_library"
5671 elif test "$hardcode_minus_L" = no; then
5673 *-*-sunos*) add_shlibpath="$dir" ;;
5677 elif test "$hardcode_shlibpath_var" = no; then
5678 add_shlibpath="$dir"
5685 if test "$hardcode_direct" = yes &&
5686 test "$hardcode_direct_absolute" = no; then
5688 elif test "$hardcode_minus_L" = yes; then
5690 # Try looking first in the location we're being installed to.
5691 if test -n "$inst_prefix_dir"; then
5694 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5699 elif test "$hardcode_shlibpath_var" = yes; then
5700 add_shlibpath="$dir"
5709 if test "$lib_linked" != yes; then
5710 func_fatal_configuration "unsupported hardcode properties"
5713 if test -n "$add_shlibpath"; then
5714 case :$compile_shlibpath: in
5715 *":$add_shlibpath:"*) ;;
5716 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
5719 if test "$linkmode" = prog; then
5720 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5721 test -n "$add" && compile_deplibs="$add $compile_deplibs"
5723 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5724 test -n "$add" && deplibs="$add $deplibs"
5725 if test "$hardcode_direct" != yes &&
5726 test "$hardcode_minus_L" != yes &&
5727 test "$hardcode_shlibpath_var" = yes; then
5728 case :$finalize_shlibpath: in
5730 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5736 if test "$linkmode" = prog || test "$mode" = relink; then
5740 # Finalize command for both is simple: just hardcode it.
5741 if test "$hardcode_direct" = yes &&
5742 test "$hardcode_direct_absolute" = no; then
5743 add="$libdir/$linklib"
5744 elif test "$hardcode_minus_L" = yes; then
5747 elif test "$hardcode_shlibpath_var" = yes; then
5748 case :$finalize_shlibpath: in
5750 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
5753 elif test "$hardcode_automatic" = yes; then
5754 if test -n "$inst_prefix_dir" &&
5755 test -f "$inst_prefix_dir$libdir/$linklib" ; then
5756 add="$inst_prefix_dir$libdir/$linklib"
5758 add="$libdir/$linklib"
5761 # We cannot seem to hardcode it, guess we'll fake it.
5763 # Try looking first in the location we're being installed to.
5764 if test -n "$inst_prefix_dir"; then
5767 add_dir="$add_dir -L$inst_prefix_dir$libdir"
5774 if test "$linkmode" = prog; then
5775 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5776 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5778 test -n "$add_dir" && deplibs="$add_dir $deplibs"
5779 test -n "$add" && deplibs="$add $deplibs"
5782 elif test "$linkmode" = prog; then
5783 # Here we assume that one of hardcode_direct or hardcode_minus_L
5784 # is not unsupported. This is valid on all known static and
5786 if test "$hardcode_direct" != unsupported; then
5787 test -n "$old_library" && linklib="$old_library"
5788 compile_deplibs="$dir/$linklib $compile_deplibs"
5789 finalize_deplibs="$dir/$linklib $finalize_deplibs"
5791 compile_deplibs="-l$name -L$dir $compile_deplibs"
5792 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5794 elif test "$build_libtool_libs" = yes; then
5795 # Not a shared library
5796 if test "$deplibs_check_method" != pass_all; then
5797 # We're trying link a shared library against a static one
5798 # but the system doesn't support it.
5800 # Just print a warning and add the library to dependency_libs so
5801 # that the program can be linked against the static library.
5803 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5804 $ECHO "*** I have the capability to make that library automatically link in when"
5805 $ECHO "*** you link to this library. But I can only do this if you have a"
5806 $ECHO "*** shared version of the library, which you do not appear to have."
5807 if test "$module" = yes; then
5808 $ECHO "*** But as you try to build a module library, libtool will still create "
5809 $ECHO "*** a static module, that should work as long as the dlopening application"
5810 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
5811 if test -z "$global_symbol_pipe"; then
5813 $ECHO "*** However, this would only work if libtool was able to extract symbol"
5814 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5815 $ECHO "*** not find such a program. So, this module is probably useless."
5816 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
5818 if test "$build_old_libs" = no; then
5819 build_libtool_libs=module
5822 build_libtool_libs=no
5826 deplibs="$dir/$old_library $deplibs"
5829 fi # link shared/static library?
5831 if test "$linkmode" = lib; then
5832 if test -n "$dependency_libs" &&
5833 { test "$hardcode_into_libs" != yes ||
5834 test "$build_old_libs" = yes ||
5835 test "$link_static" = yes; }; then
5836 # Extract -R from dependency_libs
5838 for libdir in $dependency_libs; do
5840 -R*) func_stripname '-R' '' "$libdir"
5841 temp_xrpath=$func_stripname_result
5843 *" $temp_xrpath "*) ;;
5844 *) xrpath="$xrpath $temp_xrpath";;
5846 *) temp_deplibs="$temp_deplibs $libdir";;
5849 dependency_libs="$temp_deplibs"
5852 newlib_search_path="$newlib_search_path $absdir"
5853 # Link against this library
5854 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5855 # ... and its dependency_libs
5857 for deplib in $dependency_libs; do
5858 newdependency_libs="$deplib $newdependency_libs"
5859 if $opt_duplicate_deps ; then
5860 case "$tmp_libs " in
5861 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
5864 tmp_libs="$tmp_libs $deplib"
5867 if test "$link_all_deplibs" != no; then
5868 # Add the search paths of all dependency libraries
5869 for deplib in $dependency_libs; do
5871 -L*) path="$deplib" ;;
5873 func_dirname "$deplib" "" "."
5874 dir="$func_dirname_result"
5875 # We need an absolute path.
5877 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5879 absdir=`cd "$dir" && pwd`
5880 if test -z "$absdir"; then
5881 func_warning "cannot determine absolute directory name of \`$dir'"
5886 if $GREP "^installed=no" $deplib > /dev/null; then
5890 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5891 if test -n "$deplibrary_names" ; then
5892 for tmp in $deplibrary_names ; do
5895 if test -f "$absdir/$objdir/$depdepl" ; then
5896 depdepl="$absdir/$objdir/$depdepl"
5897 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5898 if test -z "$darwin_install_name"; then
5899 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5901 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5902 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
5908 path="-L$absdir/$objdir"
5912 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5913 test -z "$libdir" && \
5914 func_fatal_error "\`$deplib' is not a valid libtool archive"
5915 test "$absdir" != "$libdir" && \
5916 func_warning "\`$deplib' seems to be moved"
5922 case " $deplibs " in
5924 *) deplibs="$path $deplibs" ;;
5927 fi # link_all_deplibs != no
5929 done # for deplib in $libs
5930 if test "$pass" = link; then
5931 if test "$linkmode" = "prog"; then
5932 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5933 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5935 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
5938 dependency_libs="$newdependency_libs"
5939 if test "$pass" = dlpreopen; then
5940 # Link the dlpreopened libraries before other libraries
5941 for deplib in $save_deplibs; do
5942 deplibs="$deplib $deplibs"
5945 if test "$pass" != dlopen; then
5946 if test "$pass" != conv; then
5947 # Make sure lib_search_path contains only unique directories.
5949 for dir in $newlib_search_path; do
5950 case "$lib_search_path " in
5952 *) lib_search_path="$lib_search_path $dir" ;;
5958 if test "$linkmode,$pass" != "prog,link"; then
5961 vars="compile_deplibs finalize_deplibs"
5963 for var in $vars dependency_libs; do
5964 # Add libraries to $var in reverse order
5965 eval tmp_libs=\"\$$var\"
5967 for deplib in $tmp_libs; do
5968 # FIXME: Pedantically, this is the right thing to do, so
5969 # that some nasty dependency loop isn't accidentally
5971 #new_libs="$deplib $new_libs"
5972 # Pragmatically, this seems to cause very few problems in
5975 -L*) new_libs="$deplib $new_libs" ;;
5978 # And here is the reason: when a library appears more
5979 # than once as an explicit dependence of a library, or
5980 # is implicitly linked in more than once by the
5981 # compiler, it is considered special, and multiple
5982 # occurrences thereof are not removed. Compare this
5983 # with having the same library being listed as a
5984 # dependency of multiple other libraries: in this case,
5985 # we know (pedantically, we assume) the library does not
5986 # need to be listed more than once, so we keep only the
5987 # last copy. This is not always right, but it is rare
5988 # enough that we require users that really mean to play
5989 # such unportable linking tricks to link the library
5990 # using -Wl,-lname, so that libtool does not consider it
5991 # for duplicate removal.
5992 case " $specialdeplibs " in
5993 *" $deplib "*) new_libs="$deplib $new_libs" ;;
5995 case " $new_libs " in
5997 *) new_libs="$deplib $new_libs" ;;
6005 for deplib in $new_libs; do
6008 case " $tmp_libs " in
6010 *) tmp_libs="$tmp_libs $deplib" ;;
6013 *) tmp_libs="$tmp_libs $deplib" ;;
6016 eval $var=\"$tmp_libs\"
6019 # Last step: remove runtime libs from dependency_libs
6020 # (they stay in deplibs)
6022 for i in $dependency_libs ; do
6023 case " $predeps $postdeps $compiler_lib_search_path " in
6028 if test -n "$i" ; then
6029 tmp_libs="$tmp_libs $i"
6032 dependency_libs=$tmp_libs
6034 if test "$linkmode" = prog; then
6035 dlfiles="$newdlfiles"
6037 if test "$linkmode" = prog || test "$linkmode" = lib; then
6038 dlprefiles="$newdlprefiles"
6043 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
6044 func_warning "\`-dlopen' is ignored for archives"
6049 func_warning "\`-l' and \`-L' are ignored for archives" ;;
6052 test -n "$rpath" && \
6053 func_warning "\`-rpath' is ignored for archives"
6055 test -n "$xrpath" && \
6056 func_warning "\`-R' is ignored for archives"
6058 test -n "$vinfo" && \
6059 func_warning "\`-version-info/-version-number' is ignored for archives"
6061 test -n "$release" && \
6062 func_warning "\`-release' is ignored for archives"
6064 test -n "$export_symbols$export_symbols_regex" && \
6065 func_warning "\`-export-symbols' is ignored for archives"
6067 # Now set the variables for building old libraries.
6068 build_libtool_libs=no
6070 objs="$objs$old_deplibs"
6074 # Make sure we only generate libraries of the form `libNAME.la'.
6077 func_stripname 'lib' '.la' "$outputname"
6078 name=$func_stripname_result
6079 eval shared_ext=\"$shrext_cmds\"
6080 eval libname=\"$libname_spec\"
6083 test "$module" = no && \
6084 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6086 if test "$need_lib_prefix" != no; then
6087 # Add the "lib" prefix for modules if required
6088 func_stripname '' '.la' "$outputname"
6089 name=$func_stripname_result
6090 eval shared_ext=\"$shrext_cmds\"
6091 eval libname=\"$libname_spec\"
6093 func_stripname '' '.la' "$outputname"
6094 libname=$func_stripname_result
6099 if test -n "$objs"; then
6100 if test "$deplibs_check_method" != pass_all; then
6101 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6104 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6105 $ECHO "*** objects $objs is not portable!"
6106 libobjs="$libobjs $objs"
6110 test "$dlself" != no && \
6111 func_warning "\`-dlopen self' is ignored for libtool libraries"
6115 test "$#" -gt 1 && \
6116 func_warning "ignoring multiple \`-rpath's for a libtool library"
6121 if test -z "$rpath"; then
6122 if test "$build_libtool_libs" = yes; then
6123 # Building a libtool convenience library.
6124 # Some compilers have problems with a `.al' extension so
6125 # convenience libraries should have the same extension an
6126 # archive normally would.
6127 oldlibs="$output_objdir/$libname.$libext $oldlibs"
6128 build_libtool_libs=convenience
6132 test -n "$vinfo" && \
6133 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
6135 test -n "$release" && \
6136 func_warning "\`-release' is ignored for convenience libraries"
6139 # Parse the version information argument.
6140 save_ifs="$IFS"; IFS=':'
6141 set dummy $vinfo 0 0 0
6146 func_fatal_help "too many parameters to \`-version-info'"
6148 # convert absolute version numbers to libtool ages
6149 # this retains compatibility with .la files and attempts
6150 # to make the code below a bit more comprehensible
6152 case $vinfo_number in
6156 number_revision="$3"
6158 # There are really only two kinds -- those that
6159 # use the current revision as the major version
6160 # and those that subtract age and use age as
6161 # a minor version. But, then there is irix
6162 # which has an extra 1 added just for fun
6164 case $version_type in
6165 darwin|linux|osf|windows|none)
6166 func_arith $number_major + $number_minor
6167 current=$func_arith_result
6169 revision="$number_revision"
6171 freebsd-aout|freebsd-elf|sunos)
6172 current="$number_major"
6173 revision="$number_minor"
6177 func_arith $number_major + $number_minor
6178 current=$func_arith_result
6180 revision="$number_minor"
6181 lt_irix_increment=no
6184 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
6195 # Check that each of the things are valid numbers.
6197 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]) ;;
6199 func_error "CURRENT \`$current' must be a nonnegative integer"
6200 func_fatal_error "\`$vinfo' is not valid version information"
6205 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]) ;;
6207 func_error "REVISION \`$revision' must be a nonnegative integer"
6208 func_fatal_error "\`$vinfo' is not valid version information"
6213 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]) ;;
6215 func_error "AGE \`$age' must be a nonnegative integer"
6216 func_fatal_error "\`$vinfo' is not valid version information"
6220 if test "$age" -gt "$current"; then
6221 func_error "AGE \`$age' is greater than the current interface number \`$current'"
6222 func_fatal_error "\`$vinfo' is not valid version information"
6225 # Calculate the version variables.
6229 case $version_type in
6233 # Like Linux, but with the current version available in
6234 # verstring for coding it into the library header
6235 func_arith $current - $age
6236 major=.$func_arith_result
6237 versuffix="$major.$age.$revision"
6238 # Darwin ld doesn't like 0 for these options...
6239 func_arith $current + 1
6240 minor_current=$func_arith_result
6241 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
6242 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
6247 versuffix=".$current.$revision";
6252 versuffix=".$current"
6256 if test "X$lt_irix_increment" = "Xno"; then
6257 func_arith $current - $age
6259 func_arith $current - $age + 1
6261 major=$func_arith_result
6263 case $version_type in
6264 nonstopux) verstring_prefix=nonstopux ;;
6265 *) verstring_prefix=sgi ;;
6267 verstring="$verstring_prefix$major.$revision"
6269 # Add in all the interfaces that we are compatible with.
6271 while test "$loop" -ne 0; do
6272 func_arith $revision - $loop
6273 iface=$func_arith_result
6274 func_arith $loop - 1
6275 loop=$func_arith_result
6276 verstring="$verstring_prefix$major.$iface:$verstring"
6279 # Before this point, $major must not contain `.'.
6281 versuffix="$major.$revision"
6285 func_arith $current - $age
6286 major=.$func_arith_result
6287 versuffix="$major.$age.$revision"
6291 func_arith $current - $age
6292 major=.$func_arith_result
6293 versuffix=".$current.$age.$revision"
6294 verstring="$current.$age.$revision"
6296 # Add in all the interfaces that we are compatible with.
6298 while test "$loop" -ne 0; do
6299 func_arith $current - $loop
6300 iface=$func_arith_result
6301 func_arith $loop - 1
6302 loop=$func_arith_result
6303 verstring="$verstring:${iface}.0"
6306 # Make executables depend on our current version.
6307 verstring="$verstring:${current}.0"
6312 versuffix=".$current"
6317 versuffix=".$current.$revision"
6321 # Use '-' rather than '.', since we only want one
6322 # extension on DOS 8.3 filesystems.
6323 func_arith $current - $age
6324 major=$func_arith_result
6329 func_fatal_configuration "unknown library version type \`$version_type'"
6333 # Clear the version info if we defaulted, and they specified a release.
6334 if test -z "$vinfo" && test -n "$release"; then
6336 case $version_type in
6338 # we can't check for "0.0" in archive_cmds due to quoting
6339 # problems, so we reset it completely
6346 if test "$need_version" = no; then
6353 # Remove version info from name if versioning should be avoided
6354 if test "$avoid_version" = yes && test "$need_version" = no; then
6360 # Check to see if the archive will have undefined symbols.
6361 if test "$allow_undefined" = yes; then
6362 if test "$allow_undefined_flag" = unsupported; then
6363 func_warning "undefined symbols not allowed in $host shared libraries"
6364 build_libtool_libs=no
6368 # Don't allow undefined symbols.
6369 allow_undefined_flag="$no_undefined_flag"
6374 func_generate_dlsyms "$libname" "$libname" "yes"
6375 libobjs="$libobjs $symfileobj"
6376 test "X$libobjs" = "X " && libobjs=
6378 if test "$mode" != relink; then
6379 # Remove our outputs, but don't remove object files since they
6380 # may have been created when compiling PIC objects.
6382 tempremovelist=`$ECHO "$output_objdir/*"`
6383 for p in $tempremovelist; do
6387 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
6388 if test "X$precious_files_regex" != "X"; then
6389 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6394 removelist="$removelist $p"
6399 test -n "$removelist" && \
6400 func_show_eval "${RM}r \$removelist"
6403 # Now set the variables for building old libraries.
6404 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6405 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6407 # Transform .lo files to .o files.
6408 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
6411 # Eliminate all temporary directories.
6412 #for path in $notinst_path; do
6413 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6414 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6415 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
6418 if test -n "$xrpath"; then
6419 # If the user specified any rpath flags, then add them.
6421 for libdir in $xrpath; do
6422 temp_xrpath="$temp_xrpath -R$libdir"
6423 case "$finalize_rpath " in
6425 *) finalize_rpath="$finalize_rpath $libdir" ;;
6428 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6429 dependency_libs="$temp_xrpath $dependency_libs"
6433 # Make sure dlfiles contains only unique files that won't be dlpreopened
6434 old_dlfiles="$dlfiles"
6436 for lib in $old_dlfiles; do
6437 case " $dlprefiles $dlfiles " in
6439 *) dlfiles="$dlfiles $lib" ;;
6443 # Make sure dlprefiles contains only unique files
6444 old_dlprefiles="$dlprefiles"
6446 for lib in $old_dlprefiles; do
6447 case "$dlprefiles " in
6449 *) dlprefiles="$dlprefiles $lib" ;;
6453 if test "$build_libtool_libs" = yes; then
6454 if test -n "$rpath"; then
6456 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
6457 # these systems don't actually have a c library (as such)!
6459 *-*-rhapsody* | *-*-darwin1.[012])
6460 # Rhapsody C library is in the System framework
6461 deplibs="$deplibs System.ltframework"
6464 # Don't link with libc until the a.out ld.so is fixed.
6466 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6467 # Do not include libc due to us having libc/libc_r.
6469 *-*-sco3.2v5* | *-*-sco5v6*)
6470 # Causes problems with __ctype
6472 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6473 # Compiler inserts libc in the correct place for threads to work
6476 # Add libc to deplibs on all other systems if necessary.
6477 if test "$build_libtool_need_lc" = "yes"; then
6478 deplibs="$deplibs -lc"
6484 # Transform deplibs into only deplibs that can be linked in shared.
6486 libname_save=$libname
6487 release_save=$release
6488 versuffix_save=$versuffix
6490 # I'm not sure if I'm treating the release correctly. I think
6491 # release should show up in the -l (ie -lgmp5) so we don't want to
6492 # add it in twice. Is that correct?
6498 case $deplibs_check_method in
6500 # Don't check for shared/static. Everything works.
6501 # This might be a little naive. We might want to check
6502 # whether the library exists or not. But this is on
6503 # osf3 & osf4 and I'm not really sure... Just
6504 # implementing what was already the behavior.
6508 # This code stresses the "libraries are programs" paradigm to its
6509 # limits. Maybe even breaks it. We compile a program, linking it
6510 # against the deplibs as a proxy for the library. Then we can check
6511 # whether they linked in statically or dynamically with ldd.
6512 $opt_dry_run || $RM conftest.c
6513 cat > conftest.c <<EOF
6514 int main() { return 0; }
6516 $opt_dry_run || $RM conftest
6517 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
6518 ldd_output=`ldd conftest`
6519 for i in $deplibs; do
6522 func_stripname -l '' "$i"
6523 name=$func_stripname_result
6524 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6525 case " $predeps $postdeps " in
6527 newdeplibs="$newdeplibs $i"
6532 if test -n "$i" ; then
6533 libname=`eval "\\$ECHO \"$libname_spec\""`
6534 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6535 set dummy $deplib_matches; shift
6537 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6538 newdeplibs="$newdeplibs $i"
6542 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6543 $ECHO "*** I have the capability to make that library automatically link in when"
6544 $ECHO "*** you link to this library. But I can only do this if you have a"
6545 $ECHO "*** shared version of the library, which I believe you do not have"
6546 $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6547 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
6552 newdeplibs="$newdeplibs $i"
6557 # Error occurred in the first compile. Let's try to salvage
6558 # the situation: Compile a separate program for each library.
6559 for i in $deplibs; do
6562 func_stripname -l '' "$i"
6563 name=$func_stripname_result
6564 $opt_dry_run || $RM conftest
6565 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6566 ldd_output=`ldd conftest`
6567 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6568 case " $predeps $postdeps " in
6570 newdeplibs="$newdeplibs $i"
6575 if test -n "$i" ; then
6576 libname=`eval "\\$ECHO \"$libname_spec\""`
6577 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6578 set dummy $deplib_matches; shift
6580 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6581 newdeplibs="$newdeplibs $i"
6585 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6586 $ECHO "*** I have the capability to make that library automatically link in when"
6587 $ECHO "*** you link to this library. But I can only do this if you have a"
6588 $ECHO "*** shared version of the library, which you do not appear to have"
6589 $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6590 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
6596 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6597 $ECHO "*** make it link in! You will probably need to install it or some"
6598 $ECHO "*** library that it depends on before this library will be fully"
6599 $ECHO "*** functional. Installing it before continuing would be even better."
6603 newdeplibs="$newdeplibs $i"
6610 set dummy $deplibs_check_method; shift
6611 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6612 for a_deplib in $deplibs; do
6615 func_stripname -l '' "$a_deplib"
6616 name=$func_stripname_result
6617 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6618 case " $predeps $postdeps " in
6620 newdeplibs="$newdeplibs $a_deplib"
6625 if test -n "$a_deplib" ; then
6626 libname=`eval "\\$ECHO \"$libname_spec\""`
6627 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6628 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6629 for potent_lib in $potential_libs; do
6630 # Follow soft links.
6631 if ls -lLd "$potent_lib" 2>/dev/null |
6632 $GREP " -> " >/dev/null; then
6635 # The statement above tries to avoid entering an
6636 # endless loop below, in case of cyclic links.
6637 # We might still enter an endless loop, since a link
6638 # loop can be closed while we follow links,
6640 potlib="$potent_lib"
6641 while test -h "$potlib" 2>/dev/null; do
6642 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6644 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6645 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
6648 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6650 $EGREP "$file_magic_regex" > /dev/null; then
6651 newdeplibs="$newdeplibs $a_deplib"
6658 if test -n "$a_deplib" ; then
6661 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6662 $ECHO "*** I have the capability to make that library automatically link in when"
6663 $ECHO "*** you link to this library. But I can only do this if you have a"
6664 $ECHO "*** shared version of the library, which you do not appear to have"
6665 $ECHO "*** because I did check the linker path looking for a file starting"
6666 if test -z "$potlib" ; then
6667 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6669 $ECHO "*** with $libname and none of the candidates passed a file format test"
6670 $ECHO "*** using a file magic. Last file checked: $potlib"
6675 # Add a -L argument.
6676 newdeplibs="$newdeplibs $a_deplib"
6679 done # Gone through all deplibs.
6682 set dummy $deplibs_check_method; shift
6683 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6684 for a_deplib in $deplibs; do
6687 func_stripname -l '' "$a_deplib"
6688 name=$func_stripname_result
6689 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6690 case " $predeps $postdeps " in
6692 newdeplibs="$newdeplibs $a_deplib"
6697 if test -n "$a_deplib" ; then
6698 libname=`eval "\\$ECHO \"$libname_spec\""`
6699 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6700 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6701 for potent_lib in $potential_libs; do
6702 potlib="$potent_lib" # see symlink-check above in file_magic test
6703 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
6704 $EGREP "$match_pattern_regex" > /dev/null; then
6705 newdeplibs="$newdeplibs $a_deplib"
6712 if test -n "$a_deplib" ; then
6715 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6716 $ECHO "*** I have the capability to make that library automatically link in when"
6717 $ECHO "*** you link to this library. But I can only do this if you have a"
6718 $ECHO "*** shared version of the library, which you do not appear to have"
6719 $ECHO "*** because I did check the linker path looking for a file starting"
6720 if test -z "$potlib" ; then
6721 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6723 $ECHO "*** with $libname and none of the candidates passed a file format test"
6724 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6729 # Add a -L argument.
6730 newdeplibs="$newdeplibs $a_deplib"
6733 done # Gone through all deplibs.
6737 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6738 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6739 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6740 for i in $predeps $postdeps ; do
6741 # can't use Xsed below, because $i might contain '/'
6742 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
6745 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
6746 $GREP . >/dev/null; then
6748 if test "X$deplibs_check_method" = "Xnone"; then
6749 $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
6751 $ECHO "*** Warning: inter-library dependencies are not known to be supported."
6753 $ECHO "*** All declared inter-library dependencies are being dropped."
6758 versuffix=$versuffix_save
6760 release=$release_save
6761 libname=$libname_save
6765 *-*-rhapsody* | *-*-darwin1.[012])
6766 # On Rhapsody replace the C library with the System framework
6767 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
6771 if test "$droppeddeps" = yes; then
6772 if test "$module" = yes; then
6774 $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
6775 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6776 $ECHO "*** a static module, that should work as long as the dlopening"
6777 $ECHO "*** application is linked with the -dlopen flag."
6778 if test -z "$global_symbol_pipe"; then
6780 $ECHO "*** However, this would only work if libtool was able to extract symbol"
6781 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6782 $ECHO "*** not find such a program. So, this module is probably useless."
6783 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
6785 if test "$build_old_libs" = no; then
6786 oldlibs="$output_objdir/$libname.$libext"
6787 build_libtool_libs=module
6790 build_libtool_libs=no
6793 $ECHO "*** The inter-library dependencies that have been dropped here will be"
6794 $ECHO "*** automatically added whenever a program is linked with this library"
6795 $ECHO "*** or is declared to -dlopen it."
6797 if test "$allow_undefined" = no; then
6799 $ECHO "*** Since this library must not contain undefined symbols,"
6800 $ECHO "*** because either the platform does not support them or"
6801 $ECHO "*** it was explicitly requested with -no-undefined,"
6802 $ECHO "*** libtool will only create a static version of it."
6803 if test "$build_old_libs" = no; then
6804 oldlibs="$output_objdir/$libname.$libext"
6805 build_libtool_libs=module
6808 build_libtool_libs=no
6813 # Done checking deplibs!
6816 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6819 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6820 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6821 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6825 # move library search paths that coincide with paths to not yet
6826 # installed libraries to the beginning of the library search list
6828 for path in $notinst_path; do
6829 case " $new_libs " in
6830 *" -L$path/$objdir "*) ;;
6832 case " $deplibs " in
6833 *" -L$path/$objdir "*)
6834 new_libs="$new_libs -L$path/$objdir" ;;
6839 for deplib in $deplibs; do
6842 case " $new_libs " in
6844 *) new_libs="$new_libs $deplib" ;;
6847 *) new_libs="$new_libs $deplib" ;;
6852 # All the library-specific variables (install_libdir is set above).
6857 # Test again, we may have decided not to build it any more
6858 if test "$build_libtool_libs" = yes; then
6859 if test "$hardcode_into_libs" = yes; then
6860 # Hardcode the library paths
6863 rpath="$finalize_rpath"
6864 test "$mode" != relink && rpath="$compile_rpath$rpath"
6865 for libdir in $rpath; do
6866 if test -n "$hardcode_libdir_flag_spec"; then
6867 if test -n "$hardcode_libdir_separator"; then
6868 if test -z "$hardcode_libdirs"; then
6869 hardcode_libdirs="$libdir"
6871 # Just accumulate the unique libdirs.
6872 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6873 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6876 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6881 eval flag=\"$hardcode_libdir_flag_spec\"
6882 dep_rpath="$dep_rpath $flag"
6884 elif test -n "$runpath_var"; then
6885 case "$perm_rpath " in
6887 *) perm_rpath="$perm_rpath $libdir" ;;
6891 # Substitute the hardcoded libdirs into the rpath.
6892 if test -n "$hardcode_libdir_separator" &&
6893 test -n "$hardcode_libdirs"; then
6894 libdir="$hardcode_libdirs"
6895 if test -n "$hardcode_libdir_flag_spec_ld"; then
6896 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6898 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6901 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6902 # We should set the runpath_var.
6904 for dir in $perm_rpath; do
6907 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6909 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6912 shlibpath="$finalize_shlibpath"
6913 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6914 if test -n "$shlibpath"; then
6915 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6918 # Get the real and link names of the library.
6919 eval shared_ext=\"$shrext_cmds\"
6920 eval library_names=\"$library_names_spec\"
6921 set dummy $library_names
6926 if test -n "$soname_spec"; then
6927 eval soname=\"$soname_spec\"
6931 if test -z "$dlname"; then
6935 lib="$output_objdir/$realname"
6939 linknames="$linknames $link"
6942 # Use standard objects if they are pic
6943 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
6944 test "X$libobjs" = "X " && libobjs=
6947 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6948 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6949 export_symbols="$output_objdir/$libname.uexp"
6950 delfiles="$delfiles $export_symbols"
6953 orig_export_symbols=
6956 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6957 # exporting using user supplied symfile
6958 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
6959 # and it's NOT already a .def file. Must figure out
6960 # which of the given symbols are data symbols and tag
6961 # them as such. So, trigger use of export_symbols_cmds.
6962 # export_symbols gets reassigned inside the "prepare
6963 # the list of exported symbols" if statement, so the
6964 # include_expsyms logic still works.
6965 orig_export_symbols="$export_symbols"
6967 always_export_symbols=yes
6973 # Prepare the list of exported symbols
6974 if test -z "$export_symbols"; then
6975 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
6976 func_verbose "generating symbol list for \`$libname.la'"
6977 export_symbols="$output_objdir/$libname.exp"
6978 $opt_dry_run || $RM $export_symbols
6979 cmds=$export_symbols_cmds
6980 save_ifs="$IFS"; IFS='~'
6981 for cmd in $cmds; do
6985 len=$func_len_result
6986 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
6987 func_show_eval "$cmd" 'exit $?'
6988 skipped_export=false
6990 # The command line is too long to execute in one step.
6991 func_verbose "using reloadable object file for export list..."
6993 # Break out early, otherwise skipped_export may be
6994 # set to false by a later but shorter cmd.
6999 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
7000 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7001 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7006 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7007 tmp_export_symbols="$export_symbols"
7008 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7009 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7012 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7013 # The given exports_symbols file has to be filtered, so filter it.
7014 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7015 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7016 # 's' commands which not all seds can handle. GNU sed should be fine
7017 # though. Also, the filter scales superlinearly with the number of
7018 # global variables. join(1) would be nice here, but unfortunately
7019 # isn't a blessed tool.
7020 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7021 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7022 export_symbols=$output_objdir/$libname.def
7023 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7027 for test_deplib in $deplibs; do
7028 case " $convenience " in
7029 *" $test_deplib "*) ;;
7031 tmp_deplibs="$tmp_deplibs $test_deplib"
7035 deplibs="$tmp_deplibs"
7037 if test -n "$convenience"; then
7038 if test -n "$whole_archive_flag_spec" &&
7039 test "$compiler_needs_object" = yes &&
7040 test -z "$libobjs"; then
7041 # extract the archives, so we have objects to list.
7042 # TODO: could optimize this to just extract one archive.
7043 whole_archive_flag_spec=
7045 if test -n "$whole_archive_flag_spec"; then
7046 save_libobjs=$libobjs
7047 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7048 test "X$libobjs" = "X " && libobjs=
7050 gentop="$output_objdir/${outputname}x"
7051 generated="$generated $gentop"
7053 func_extract_archives $gentop $convenience
7054 libobjs="$libobjs $func_extract_archives_result"
7055 test "X$libobjs" = "X " && libobjs=
7059 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7060 eval flag=\"$thread_safe_flag_spec\"
7061 linker_flags="$linker_flags $flag"
7064 # Make a backup of the uninstalled library when relinking
7065 if test "$mode" = relink; then
7066 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7069 # Do each of the archive commands.
7070 if test "$module" = yes && test -n "$module_cmds" ; then
7071 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7072 eval test_cmds=\"$module_expsym_cmds\"
7073 cmds=$module_expsym_cmds
7075 eval test_cmds=\"$module_cmds\"
7079 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7080 eval test_cmds=\"$archive_expsym_cmds\"
7081 cmds=$archive_expsym_cmds
7083 eval test_cmds=\"$archive_cmds\"
7088 if test "X$skipped_export" != "X:" &&
7089 func_len " $test_cmds" &&
7090 len=$func_len_result &&
7091 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7094 # The command line is too long to link in one step, link piecewise
7095 # or, if using GNU ld and skipped_export is not :, use a linker
7098 # Save the value of $output and $libobjs because we want to
7099 # use them later. If we have whole_archive_flag_spec, we
7100 # want to use save_libobjs as it was before
7101 # whole_archive_flag_spec was expanded, because we can't
7102 # assume the linker understands whole_archive_flag_spec.
7103 # This may have to be revisited, in case too many
7104 # convenience libraries get linked in and end up exceeding
7106 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7107 save_libobjs=$libobjs
7110 output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
7112 # Clear the reloadable object creation command queue and
7113 # initialize k to one.
7120 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7121 output=${output_objdir}/${output_la}.lnkscript
7122 func_verbose "creating GNU ld script: $output"
7123 $ECHO 'INPUT (' > $output
7124 for obj in $save_libobjs
7126 $ECHO "$obj" >> $output
7128 $ECHO ')' >> $output
7129 delfiles="$delfiles $output"
7130 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7131 output=${output_objdir}/${output_la}.lnk
7132 func_verbose "creating linker input file list: $output"
7137 if test "$compiler_needs_object" = yes; then
7143 $ECHO "$obj" >> $output
7145 delfiles="$delfiles $output"
7146 output=$firstobj\"$file_list_spec$output\"
7148 if test -n "$save_libobjs"; then
7149 func_verbose "creating reloadable object files..."
7150 output=$output_objdir/$output_la-${k}.$objext
7151 eval test_cmds=\"$reload_cmds\"
7152 func_len " $test_cmds"
7153 len0=$func_len_result
7156 # Loop over the list of objects to be linked.
7157 for obj in $save_libobjs
7160 func_arith $len + $func_len_result
7161 len=$func_arith_result
7162 if test "X$objlist" = X ||
7163 test "$len" -lt "$max_cmd_len"; then
7164 func_append objlist " $obj"
7166 # The command $test_cmds is almost too long, add a
7167 # command to the queue.
7168 if test "$k" -eq 1 ; then
7169 # The first file doesn't have a previous command to add.
7170 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
7172 # All subsequent reloadable object files will link in
7173 # the last one created.
7174 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
7176 last_robj=$output_objdir/$output_la-${k}.$objext
7178 k=$func_arith_result
7179 output=$output_objdir/$output_la-${k}.$objext
7181 func_len " $last_robj"
7182 func_arith $len0 + $func_len_result
7183 len=$func_arith_result
7186 # Handle the remaining objects by creating one last
7187 # reloadable object file. All subsequent reloadable object
7188 # files will link in the last one created.
7189 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7190 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
7191 if test -n "$last_robj"; then
7192 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7194 delfiles="$delfiles $output"
7200 if ${skipped_export-false}; then
7201 func_verbose "generating symbol list for \`$libname.la'"
7202 export_symbols="$output_objdir/$libname.exp"
7203 $opt_dry_run || $RM $export_symbols
7205 # Append the command to create the export file.
7206 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7207 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7208 if test -n "$last_robj"; then
7209 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7213 test -n "$save_libobjs" &&
7214 func_verbose "creating a temporary reloadable object file: $output"
7216 # Loop through the commands generated above and execute them.
7217 save_ifs="$IFS"; IFS='~'
7218 for cmd in $concat_cmds; do
7221 func_quote_for_expand "$cmd"
7222 eval "func_echo $func_quote_for_expand_result"
7224 $opt_dry_run || eval "$cmd" || {
7227 # Restore the uninstalled library and exit
7228 if test "$mode" = relink; then
7229 ( cd "$output_objdir" && \
7230 $RM "${realname}T" && \
7231 $MV "${realname}U" "$realname" )
7239 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7240 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7241 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7245 if ${skipped_export-false}; then
7246 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7247 tmp_export_symbols="$export_symbols"
7248 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7249 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
7252 if test -n "$orig_export_symbols"; then
7253 # The given exports_symbols file has to be filtered, so filter it.
7254 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7255 # FIXME: $output_objdir/$libname.filter potentially contains lots of
7256 # 's' commands which not all seds can handle. GNU sed should be fine
7257 # though. Also, the filter scales superlinearly with the number of
7258 # global variables. join(1) would be nice here, but unfortunately
7259 # isn't a blessed tool.
7260 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7261 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
7262 export_symbols=$output_objdir/$libname.def
7263 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7268 # Restore the value of output.
7271 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7272 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7273 test "X$libobjs" = "X " && libobjs=
7275 # Expand the library linking commands again to reset the
7276 # value of $libobjs for piecewise linking.
7278 # Do each of the archive commands.
7279 if test "$module" = yes && test -n "$module_cmds" ; then
7280 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7281 cmds=$module_expsym_cmds
7286 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7287 cmds=$archive_expsym_cmds
7294 if test -n "$delfiles"; then
7295 # Append the command to remove temporary files to $cmds.
7296 eval cmds=\"\$cmds~\$RM $delfiles\"
7299 # Add any objects from preloaded convenience libraries
7300 if test -n "$dlprefiles"; then
7301 gentop="$output_objdir/${outputname}x"
7302 generated="$generated $gentop"
7304 func_extract_archives $gentop $dlprefiles
7305 libobjs="$libobjs $func_extract_archives_result"
7306 test "X$libobjs" = "X " && libobjs=
7309 save_ifs="$IFS"; IFS='~'
7310 for cmd in $cmds; do
7314 func_quote_for_expand "$cmd"
7315 eval "func_echo $func_quote_for_expand_result"
7317 $opt_dry_run || eval "$cmd" || {
7320 # Restore the uninstalled library and exit
7321 if test "$mode" = relink; then
7322 ( cd "$output_objdir" && \
7323 $RM "${realname}T" && \
7324 $MV "${realname}U" "$realname" )
7332 # Restore the uninstalled library and exit
7333 if test "$mode" = relink; then
7334 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7336 if test -n "$convenience"; then
7337 if test -z "$whole_archive_flag_spec"; then
7338 func_show_eval '${RM}r "$gentop"'
7345 # Create links to the real library.
7346 for linkname in $linknames; do
7347 if test "$realname" != "$linkname"; then
7348 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7352 # If -module or -export-dynamic was specified, set the dlname.
7353 if test "$module" = yes || test "$export_dynamic" = yes; then
7354 # On all known operating systems, these are identical.
7361 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7362 func_warning "\`-dlopen' is ignored for objects"
7367 func_warning "\`-l' and \`-L' are ignored for objects" ;;
7370 test -n "$rpath" && \
7371 func_warning "\`-rpath' is ignored for objects"
7373 test -n "$xrpath" && \
7374 func_warning "\`-R' is ignored for objects"
7376 test -n "$vinfo" && \
7377 func_warning "\`-version-info' is ignored for objects"
7379 test -n "$release" && \
7380 func_warning "\`-release' is ignored for objects"
7384 test -n "$objs$old_deplibs" && \
7385 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
7389 obj=$func_lo2o_result
7397 # Delete the old objects.
7398 $opt_dry_run || $RM $obj $libobj
7400 # Objects from convenience libraries. This assumes
7401 # single-version convenience libraries. Whenever we create
7402 # different ones for PIC/non-PIC, this we'll have to duplicate
7406 # reload_cmds runs $LD directly, so let us get rid of
7407 # -Wl from whole_archive_flag_spec and hope we can get by with
7408 # turning comma into space..
7411 if test -n "$convenience"; then
7412 if test -n "$whole_archive_flag_spec"; then
7413 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7414 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
7416 gentop="$output_objdir/${obj}x"
7417 generated="$generated $gentop"
7419 func_extract_archives $gentop $convenience
7420 reload_conv_objs="$reload_objs $func_extract_archives_result"
7424 # Create the old-style object.
7425 reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7428 func_execute_cmds "$reload_cmds" 'exit $?'
7430 # Exit if we aren't doing a library object file.
7431 if test -z "$libobj"; then
7432 if test -n "$gentop"; then
7433 func_show_eval '${RM}r "$gentop"'
7439 if test "$build_libtool_libs" != yes; then
7440 if test -n "$gentop"; then
7441 func_show_eval '${RM}r "$gentop"'
7444 # Create an invalid libtool object if no PIC, so that we don't
7445 # accidentally link it into a program.
7446 # $show "echo timestamp > $libobj"
7447 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7451 if test -n "$pic_flag" || test "$pic_mode" != default; then
7452 # Only do commands if we really have different PIC objects.
7453 reload_objs="$libobjs $reload_conv_objs"
7455 func_execute_cmds "$reload_cmds" 'exit $?'
7458 if test -n "$gentop"; then
7459 func_show_eval '${RM}r "$gentop"'
7467 *cygwin*) func_stripname '' '.exe' "$output"
7468 output=$func_stripname_result.exe;;
7470 test -n "$vinfo" && \
7471 func_warning "\`-version-info' is ignored for programs"
7473 test -n "$release" && \
7474 func_warning "\`-release' is ignored for programs"
7476 test "$preload" = yes \
7477 && test "$dlopen_support" = unknown \
7478 && test "$dlopen_self" = unknown \
7479 && test "$dlopen_self_static" = unknown && \
7480 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7483 *-*-rhapsody* | *-*-darwin1.[012])
7484 # On Rhapsody replace the C library is the System framework
7485 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7486 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7492 # Don't allow lazy linking, it breaks C++ global constructors
7493 # But is supposedly fixed on 10.4 or later (yay!).
7494 if test "$tagname" = CXX ; then
7495 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7497 compile_command="$compile_command ${wl}-bind_at_load"
7498 finalize_command="$finalize_command ${wl}-bind_at_load"
7502 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7503 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7504 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7509 # move library search paths that coincide with paths to not yet
7510 # installed libraries to the beginning of the library search list
7512 for path in $notinst_path; do
7513 case " $new_libs " in
7514 *" -L$path/$objdir "*) ;;
7516 case " $compile_deplibs " in
7517 *" -L$path/$objdir "*)
7518 new_libs="$new_libs -L$path/$objdir" ;;
7523 for deplib in $compile_deplibs; do
7526 case " $new_libs " in
7528 *) new_libs="$new_libs $deplib" ;;
7531 *) new_libs="$new_libs $deplib" ;;
7534 compile_deplibs="$new_libs"
7537 compile_command="$compile_command $compile_deplibs"
7538 finalize_command="$finalize_command $finalize_deplibs"
7540 if test -n "$rpath$xrpath"; then
7541 # If the user specified any rpath flags, then add them.
7542 for libdir in $rpath $xrpath; do
7543 # This is the magic to use -rpath.
7544 case "$finalize_rpath " in
7546 *) finalize_rpath="$finalize_rpath $libdir" ;;
7551 # Now hardcode the library paths
7554 for libdir in $compile_rpath $finalize_rpath; do
7555 if test -n "$hardcode_libdir_flag_spec"; then
7556 if test -n "$hardcode_libdir_separator"; then
7557 if test -z "$hardcode_libdirs"; then
7558 hardcode_libdirs="$libdir"
7560 # Just accumulate the unique libdirs.
7561 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7562 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7565 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7570 eval flag=\"$hardcode_libdir_flag_spec\"
7571 rpath="$rpath $flag"
7573 elif test -n "$runpath_var"; then
7574 case "$perm_rpath " in
7576 *) perm_rpath="$perm_rpath $libdir" ;;
7580 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
7581 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
7582 case :$dllsearchpath: in
7584 *) dllsearchpath="$dllsearchpath:$libdir";;
7586 case :$dllsearchpath: in
7587 *":$testbindir:"*) ;;
7588 *) dllsearchpath="$dllsearchpath:$testbindir";;
7593 # Substitute the hardcoded libdirs into the rpath.
7594 if test -n "$hardcode_libdir_separator" &&
7595 test -n "$hardcode_libdirs"; then
7596 libdir="$hardcode_libdirs"
7597 eval rpath=\" $hardcode_libdir_flag_spec\"
7599 compile_rpath="$rpath"
7603 for libdir in $finalize_rpath; do
7604 if test -n "$hardcode_libdir_flag_spec"; then
7605 if test -n "$hardcode_libdir_separator"; then
7606 if test -z "$hardcode_libdirs"; then
7607 hardcode_libdirs="$libdir"
7609 # Just accumulate the unique libdirs.
7610 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7611 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7614 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7619 eval flag=\"$hardcode_libdir_flag_spec\"
7620 rpath="$rpath $flag"
7622 elif test -n "$runpath_var"; then
7623 case "$finalize_perm_rpath " in
7625 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
7629 # Substitute the hardcoded libdirs into the rpath.
7630 if test -n "$hardcode_libdir_separator" &&
7631 test -n "$hardcode_libdirs"; then
7632 libdir="$hardcode_libdirs"
7633 eval rpath=\" $hardcode_libdir_flag_spec\"
7635 finalize_rpath="$rpath"
7637 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7638 # Transform all the library objects into standard objects.
7639 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7640 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7643 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7645 # template prelinking step
7646 if test -n "$prelink_cmds"; then
7647 func_execute_cmds "$prelink_cmds" 'exit $?'
7650 wrappers_required=yes
7652 *cygwin* | *mingw* )
7653 if test "$build_libtool_libs" != yes; then
7654 wrappers_required=no
7658 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7659 wrappers_required=no
7663 if test "$wrappers_required" = no; then
7664 # Replace the output file specification.
7665 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7666 link_command="$compile_command$compile_rpath"
7668 # We have no uninstalled library dependencies, so finalize right now.
7670 func_show_eval "$link_command" 'exit_status=$?'
7672 # Delete the generated files.
7673 if test -f "$output_objdir/${outputname}S.${objext}"; then
7674 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7680 if test -n "$compile_shlibpath$finalize_shlibpath"; then
7681 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7683 if test -n "$finalize_shlibpath"; then
7684 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
7689 if test -n "$runpath_var"; then
7690 if test -n "$perm_rpath"; then
7691 # We should set the runpath_var.
7693 for dir in $perm_rpath; do
7696 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7698 if test -n "$finalize_perm_rpath"; then
7699 # We should set the runpath_var.
7701 for dir in $finalize_perm_rpath; do
7704 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7708 if test "$no_install" = yes; then
7709 # We don't need to create a wrapper script.
7710 link_command="$compile_var$compile_command$compile_rpath"
7711 # Replace the output file specification.
7712 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
7713 # Delete the old output file.
7714 $opt_dry_run || $RM $output
7715 # Link the executable and exit
7716 func_show_eval "$link_command" 'exit $?'
7720 if test "$hardcode_action" = relink; then
7721 # Fast installation is not supported
7722 link_command="$compile_var$compile_command$compile_rpath"
7723 relink_command="$finalize_var$finalize_command$finalize_rpath"
7725 func_warning "this platform does not like uninstalled shared libraries"
7726 func_warning "\`$output' will be relinked during installation"
7728 if test "$fast_install" != no; then
7729 link_command="$finalize_var$compile_command$finalize_rpath"
7730 if test "$fast_install" = yes; then
7731 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
7733 # fast_install is set to needless
7737 link_command="$compile_var$compile_command$compile_rpath"
7738 relink_command="$finalize_var$finalize_command$finalize_rpath"
7742 # Replace the output file specification.
7743 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7745 # Delete the old output files.
7746 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7748 func_show_eval "$link_command" 'exit $?'
7750 # Now create the wrapper script.
7751 func_verbose "creating $output"
7753 # Quote the relink command for shipping.
7754 if test -n "$relink_command"; then
7755 # Preserve any variables that may affect compiler behavior
7756 for var in $variables_saved_for_relink; do
7757 if eval test -z \"\${$var+set}\"; then
7758 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
7759 elif eval var_value=\$$var; test -z "$var_value"; then
7760 relink_command="$var=; export $var; $relink_command"
7762 func_quote_for_eval "$var_value"
7763 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7766 relink_command="(cd `pwd`; $relink_command)"
7767 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7770 # Quote $ECHO for shipping.
7771 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7773 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7774 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7776 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7778 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7781 # Only actually do things if not in dry run mode.
7783 # win32 will think the script is a binary if it has
7784 # a .exe suffix, so we strip it off here.
7786 *.exe) func_stripname '' '.exe' "$output"
7787 output=$func_stripname_result ;;
7789 # test for cygwin because mv fails w/o .exe extensions
7793 func_stripname '' '.exe' "$outputname"
7794 outputname=$func_stripname_result ;;
7798 *cygwin* | *mingw* )
7799 func_dirname_and_basename "$output" "" "."
7800 output_name=$func_basename_result
7801 output_path=$func_dirname_result
7802 cwrappersource="$output_path/$objdir/lt-$output_name.c"
7803 cwrapper="$output_path/$output_name.exe"
7804 $RM $cwrappersource $cwrapper
7805 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7807 func_emit_cwrapperexe_src > $cwrappersource
7809 # we should really use a build-platform specific compiler
7810 # here, but OTOH, the wrappers (shell script and this C one)
7811 # are only useful if you want to execute the "real" binary.
7812 # Since the "real" binary is built for $host, then this
7813 # wrapper might as well be built for $host, too.
7815 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
7819 # Now, create the wrapper script for func_source use:
7820 func_ltwrapper_scriptname $cwrapper
7821 $RM $func_ltwrapper_scriptname_result
7822 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7824 # note: this script will not be executed, so do not chmod.
7825 if test "x$build" = "x$host" ; then
7826 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7828 func_emit_wrapper no > $func_ltwrapper_scriptname_result
7834 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
7836 func_emit_wrapper no > $output
7845 # See if we need to build an old-fashioned archive.
7846 for oldlib in $oldlibs; do
7848 if test "$build_libtool_libs" = convenience; then
7849 oldobjs="$libobjs_save $symfileobj"
7850 addlibs="$convenience"
7851 build_libtool_libs=no
7853 if test "$build_libtool_libs" = module; then
7854 oldobjs="$libobjs_save"
7855 build_libtool_libs=no
7857 oldobjs="$old_deplibs $non_pic_objects"
7858 if test "$preload" = yes && test -f "$symfileobj"; then
7859 oldobjs="$oldobjs $symfileobj"
7862 addlibs="$old_convenience"
7865 if test -n "$addlibs"; then
7866 gentop="$output_objdir/${outputname}x"
7867 generated="$generated $gentop"
7869 func_extract_archives $gentop $addlibs
7870 oldobjs="$oldobjs $func_extract_archives_result"
7873 # Do each command in the archive commands.
7874 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
7875 cmds=$old_archive_from_new_cmds
7878 # Add any objects from preloaded convenience libraries
7879 if test -n "$dlprefiles"; then
7880 gentop="$output_objdir/${outputname}x"
7881 generated="$generated $gentop"
7883 func_extract_archives $gentop $dlprefiles
7884 oldobjs="$oldobjs $func_extract_archives_result"
7887 # POSIX demands no paths to be encoded in archives. We have
7888 # to avoid creating archives with duplicate basenames if we
7889 # might have to extract them afterwards, e.g., when creating a
7890 # static archive out of a convenience library, or when linking
7891 # the entirety of a libtool archive into another (currently
7892 # not supported by libtool).
7893 if (for obj in $oldobjs
7895 func_basename "$obj"
7896 $ECHO "$func_basename_result"
7897 done | sort | sort -uc >/dev/null 2>&1); then
7900 $ECHO "copying selected object files to avoid basename conflicts..."
7901 gentop="$output_objdir/${outputname}x"
7902 generated="$generated $gentop"
7903 func_mkdir_p "$gentop"
7904 save_oldobjs=$oldobjs
7907 for obj in $save_oldobjs
7909 func_basename "$obj"
7910 objbase="$func_basename_result"
7911 case " $oldobjs " in
7912 " ") oldobjs=$obj ;;
7915 # Make sure we don't pick an alternate name that also
7917 newobj=lt$counter-$objbase
7918 func_arith $counter + 1
7919 counter=$func_arith_result
7920 case " $oldobjs " in
7921 *[\ /]"$newobj "*) ;;
7922 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
7925 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7926 oldobjs="$oldobjs $gentop/$newobj"
7928 *) oldobjs="$oldobjs $obj" ;;
7932 eval cmds=\"$old_archive_cmds\"
7935 len=$func_len_result
7936 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7937 cmds=$old_archive_cmds
7939 # the command line is too long to link in one step, link in parts
7940 func_verbose "using piecewise archive linking..."
7945 save_oldobjs=$oldobjs
7947 # Is there a better way of finding the last object in the list?
7948 for obj in $save_oldobjs
7952 eval test_cmds=\"$old_archive_cmds\"
7953 func_len " $test_cmds"
7954 len0=$func_len_result
7956 for obj in $save_oldobjs
7959 func_arith $len + $func_len_result
7960 len=$func_arith_result
7961 func_append objlist " $obj"
7962 if test "$len" -lt "$max_cmd_len"; then
7965 # the above command should be used before it gets too long
7967 if test "$obj" = "$last_oldobj" ; then
7970 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7971 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
7978 if test "X$oldobjs" = "X" ; then
7979 eval cmds=\"\$concat_cmds\"
7981 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
7985 func_execute_cmds "$cmds" 'exit $?'
7988 test -n "$generated" && \
7989 func_show_eval "${RM}r$generated"
7991 # Now create the libtool archive.
7995 test "$build_old_libs" = yes && old_library="$libname.$libext"
7996 func_verbose "creating $output"
7998 # Preserve any variables that may affect compiler behavior
7999 for var in $variables_saved_for_relink; do
8000 if eval test -z \"\${$var+set}\"; then
8001 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
8002 elif eval var_value=\$$var; test -z "$var_value"; then
8003 relink_command="$var=; export $var; $relink_command"
8005 func_quote_for_eval "$var_value"
8006 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8009 # Quote the link command for shipping.
8010 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8011 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
8012 if test "$hardcode_automatic" = yes ; then
8016 # Only create the output if not a dry run.
8018 for installed in no yes; do
8019 if test "$installed" = yes; then
8020 if test -z "$install_libdir"; then
8023 output="$output_objdir/$outputname"i
8024 # Replace all uninstalled libtool libraries with the installed ones
8026 for deplib in $dependency_libs; do
8029 func_basename "$deplib"
8030 name="$func_basename_result"
8031 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8032 test -z "$libdir" && \
8033 func_fatal_error "\`$deplib' is not a valid libtool archive"
8034 newdependency_libs="$newdependency_libs $libdir/$name"
8036 *) newdependency_libs="$newdependency_libs $deplib" ;;
8039 dependency_libs="$newdependency_libs"
8042 for lib in $dlfiles; do
8045 func_basename "$lib"
8046 name="$func_basename_result"
8047 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8048 test -z "$libdir" && \
8049 func_fatal_error "\`$lib' is not a valid libtool archive"
8050 newdlfiles="$newdlfiles $libdir/$name"
8052 *) newdlfiles="$newdlfiles $lib" ;;
8055 dlfiles="$newdlfiles"
8057 for lib in $dlprefiles; do
8060 # Only pass preopened files to the pseudo-archive (for
8061 # eventual linking with the app. that links it) if we
8062 # didn't already link the preopened objects directly into
8064 func_basename "$lib"
8065 name="$func_basename_result"
8066 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8067 test -z "$libdir" && \
8068 func_fatal_error "\`$lib' is not a valid libtool archive"
8069 newdlprefiles="$newdlprefiles $libdir/$name"
8073 dlprefiles="$newdlprefiles"
8076 for lib in $dlfiles; do
8078 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8079 *) abs=`pwd`"/$lib" ;;
8081 newdlfiles="$newdlfiles $abs"
8083 dlfiles="$newdlfiles"
8085 for lib in $dlprefiles; do
8087 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8088 *) abs=`pwd`"/$lib" ;;
8090 newdlprefiles="$newdlprefiles $abs"
8092 dlprefiles="$newdlprefiles"
8095 # place dlname in correct position for cygwin
8097 case $host,$output,$installed,$module,$dlname in
8098 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
8101 # $outputname - a libtool library file
8102 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8104 # Please DO NOT delete this file!
8105 # It is necessary for linking the library.
8107 # The name that we can dlopen(3).
8110 # Names of this library.
8111 library_names='$library_names'
8113 # The name of the static archive.
8114 old_library='$old_library'
8116 # Linker flags that can not go in dependency_libs.
8117 inherited_linker_flags='$new_inherited_linker_flags'
8119 # Libraries that this one depends upon.
8120 dependency_libs='$dependency_libs'
8122 # Names of additional weak libraries provided by this library
8123 weak_library_names='$weak_libs'
8125 # Version information for $libname.
8130 # Is this an already installed library?
8131 installed=$installed
8133 # Should we warn about portability when linking against -modules?
8134 shouldnotlink=$module
8136 # Files to dlopen/dlpreopen
8138 dlpreopen='$dlprefiles'
8140 # Directory that this library needs to be installed in:
8141 libdir='$install_libdir'"
8142 if test "$installed" = no && test "$need_relink" = yes; then
8144 relink_command=\"$relink_command\""
8149 # Do a symbolic link so that the libtool archive can be found in
8150 # LD_LIBRARY_PATH before the program is installed.
8151 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
8157 { test "$mode" = link || test "$mode" = relink; } &&
8158 func_mode_link ${1+"$@"}
8161 # func_mode_uninstall arg...
8162 func_mode_uninstall ()
8170 # This variable tells wrapper scripts just to set variables rather
8171 # than running their programs.
8172 libtool_install_magic="$magic"
8177 -f) RM="$RM $arg"; rmforce=yes ;;
8178 -*) RM="$RM $arg" ;;
8179 *) files="$files $arg" ;;
8184 func_fatal_help "you must specify an RM program"
8188 origobjdir="$objdir"
8189 for file in $files; do
8190 func_dirname "$file" "" "."
8191 dir="$func_dirname_result"
8192 if test "X$dir" = X.; then
8193 objdir="$origobjdir"
8195 objdir="$dir/$origobjdir"
8197 func_basename "$file"
8198 name="$func_basename_result"
8199 test "$mode" = uninstall && objdir="$dir"
8201 # Remember objdir for removal later, being careful to avoid duplicates
8202 if test "$mode" = clean; then
8205 *) rmdirs="$rmdirs $objdir" ;;
8209 # Don't error if the file doesn't exist and rm -f was used.
8210 if { test -L "$file"; } >/dev/null 2>&1 ||
8211 { test -h "$file"; } >/dev/null 2>&1 ||
8212 test -f "$file"; then
8214 elif test -d "$file"; then
8217 elif test "$rmforce" = yes; then
8225 # Possibly a libtool archive, so verify it.
8226 if func_lalib_p "$file"; then
8227 func_source $dir/$name
8229 # Delete the libtool libraries and symlinks.
8230 for n in $library_names; do
8231 rmfiles="$rmfiles $objdir/$n"
8233 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
8237 case " $library_names " in
8238 # " " in the beginning catches empty $dlname
8240 *) rmfiles="$rmfiles $objdir/$dlname" ;;
8242 test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
8245 if test -n "$library_names"; then
8246 # Do each command in the postuninstall commands.
8247 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8250 if test -n "$old_library"; then
8251 # Do each command in the old_postuninstall commands.
8252 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
8254 # FIXME: should reinstall the best remaining shared library.
8261 # Possibly a libtool object, so verify it.
8262 if func_lalib_p "$file"; then
8265 func_source $dir/$name
8267 # Add PIC object to the list of files to remove.
8268 if test -n "$pic_object" &&
8269 test "$pic_object" != none; then
8270 rmfiles="$rmfiles $dir/$pic_object"
8273 # Add non-PIC object to the list of files to remove.
8274 if test -n "$non_pic_object" &&
8275 test "$non_pic_object" != none; then
8276 rmfiles="$rmfiles $dir/$non_pic_object"
8282 if test "$mode" = clean ; then
8286 func_stripname '' '.exe' "$file"
8287 file=$func_stripname_result
8288 func_stripname '' '.exe' "$name"
8289 noexename=$func_stripname_result
8290 # $file with .exe has already been added to rmfiles,
8291 # add $file without .exe
8292 rmfiles="$rmfiles $file"
8295 # Do a test to see if this is a libtool program.
8296 if func_ltwrapper_p "$file"; then
8297 if func_ltwrapper_executable_p "$file"; then
8298 func_ltwrapper_scriptname "$file"
8300 func_source $func_ltwrapper_scriptname_result
8301 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
8304 func_source $dir/$noexename
8307 # note $name still contains .exe if it was in $file originally
8308 # as does the version of $file that was added into $rmfiles
8309 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
8310 if test "$fast_install" = yes && test -n "$relink_command"; then
8311 rmfiles="$rmfiles $objdir/lt-$name"
8313 if test "X$noexename" != "X$name" ; then
8314 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
8320 func_show_eval "$RM $rmfiles" 'exit_status=1'
8322 objdir="$origobjdir"
8324 # Try to remove the ${objdir}s in the directories where we deleted files
8325 for dir in $rmdirs; do
8326 if test -d "$dir"; then
8327 func_show_eval "rmdir $dir >/dev/null 2>&1"
8334 { test "$mode" = uninstall || test "$mode" = clean; } &&
8335 func_mode_uninstall ${1+"$@"}
8337 test -z "$mode" && {
8338 help="$generic_help"
8339 func_fatal_help "you must specify a MODE"
8342 test -z "$exec_cmd" && \
8343 func_fatal_help "invalid operation mode \`$mode'"
8345 if test -n "$exec_cmd"; then
8346 eval exec "$exec_cmd"
8353 # The TAGs below are defined such that we never get into a situation
8354 # in which we disable both kinds of libraries. Given conflicting
8355 # choices, we go for a static library, that is the most portable,
8356 # since we can't tell whether shared libraries were disabled because
8357 # the user asked for that or because the platform doesn't support
8358 # them. This is particularly important on AIX, because we don't
8359 # support having both static and shared libraries enabled at the same
8360 # time on that platform, so we default to a shared-only configuration.
8361 # If a disable-shared tag is given, we'll fallback to a static-only
8362 # configuration. But we'll never go from static-only to shared-only.
8364 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
8365 build_libtool_libs=no
8367 # ### END LIBTOOL TAG CONFIG: disable-shared
8369 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
8370 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
8371 # ### END LIBTOOL TAG CONFIG: disable-static
8380 # ### BEGIN LIBTOOL TAG CONFIG: CXX
8382 # The linker used to build libraries.
8385 # Commands used to build an old-style archive.
8386 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
8388 # A language specific compiler.
8391 # Is the compiler the GNU compiler?
8394 # Compiler flag to turn off builtin functions.
8395 no_builtin_flag=" -fno-builtin"
8397 # How to pass a linker flag through the compiler.
8400 # Additional compiler flags for building library objects.
8401 pic_flag=" -fPIC -DPIC"
8403 # Compiler flag to prevent dynamic linking.
8404 link_static_flag="-static"
8406 # Does compiler simultaneously support -c and -o options?
8409 # Whether or not to add -lc for building shared libraries.
8410 build_libtool_need_lc=no
8412 # Whether or not to disallow shared libs when runtime libs are static.
8413 allow_libtool_libs_with_static_runtimes=no
8415 # Compiler flag to allow reflexive dlopens.
8416 export_dynamic_flag_spec="\${wl}--export-dynamic"
8418 # Compiler flag to generate shared objects directly from archives.
8419 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
8421 # Whether the compiler copes with passing no objects directly.
8422 compiler_needs_object="no"
8424 # Create an old-style archive from a shared archive.
8425 old_archive_from_new_cmds=""
8427 # Create a temporary old-style archive to link instead of a shared archive.
8428 old_archive_from_expsyms_cmds=""
8430 # Commands used to build a shared archive.
8431 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
8432 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
8434 # Commands used to build a loadable module if different from building
8437 module_expsym_cmds=""
8439 # Whether we are building with GNU ld or not.
8442 # Flag that allows shared libraries with undefined symbols to be built.
8443 allow_undefined_flag=""
8445 # Flag that enforces no undefined symbols.
8446 no_undefined_flag=""
8448 # Flag to hardcode $libdir into a binary during linking.
8449 # This must work even if $libdir does not exist
8450 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
8452 # If ld is used when linking, flag to hardcode $libdir into a binary
8453 # during linking. This must work even if $libdir does not exist.
8454 hardcode_libdir_flag_spec_ld=""
8456 # Whether we need a single "-rpath" flag with a separated argument.
8457 hardcode_libdir_separator=""
8459 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
8460 # DIR into the resulting binary.
8463 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
8464 # DIR into the resulting binary and the resulting library dependency is
8465 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
8466 # library is relocated.
8467 hardcode_direct_absolute=no
8469 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
8470 # into the resulting binary.
8473 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
8474 # into the resulting binary.
8475 hardcode_shlibpath_var=unsupported
8477 # Set to "yes" if building a shared library automatically hardcodes DIR
8478 # into the library and all subsequent libraries and executables linked
8480 hardcode_automatic=no
8482 # Set to yes if linker adds runtime paths of dependent libraries
8483 # to runtime path list.
8486 # Whether libtool must link a program against all its dependency libraries.
8489 # Fix the shell variable $srcfile for the compiler.
8492 # Set to "yes" if exported symbols are required.
8493 always_export_symbols=no
8495 # The commands to list exported symbols.
8496 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
8498 # Symbols that should not be listed in the preloaded symbols.
8499 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
8501 # Symbols that must always be exported.
8504 # Commands necessary for linking programs (against libraries) with templates.
8507 # Specify filename containing input files.
8510 # How to hardcode a shared library path into an executable.
8511 hardcode_action=immediate
8513 # The directories searched by this compiler when creating a shared library.
8514 compiler_lib_search_dirs="/usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib/gcc/i486-linux-gnu/4.3.2 /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib /lib/../lib /usr/lib/../lib /usr/lib/gcc/i486-linux-gnu/4.3.2/../../.."
8516 # Dependencies to place before and after the objects being linked to
8517 # create a shared library.
8518 predep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.2/crtbeginS.o"
8519 postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crtn.o"
8521 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
8523 # The library search path used internally by the compiler when linking
8525 compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2 -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.2/../../.."
8527 # ### END LIBTOOL TAG CONFIG: CXX