toolkit/crashreporter/google-breakpad/autotools/ltmain.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/google-breakpad/autotools/ltmain.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,8406 @@
     1.4 +# Generated from ltmain.m4sh.
     1.5 +
     1.6 +# ltmain.sh (GNU libtool) 2.2.6b
     1.7 +# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
     1.8 +
     1.9 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
    1.10 +# This is free software; see the source for copying conditions.  There is NO
    1.11 +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1.12 +
    1.13 +# GNU Libtool is free software; you can redistribute it and/or modify
    1.14 +# it under the terms of the GNU General Public License as published by
    1.15 +# the Free Software Foundation; either version 2 of the License, or
    1.16 +# (at your option) any later version.
    1.17 +#
    1.18 +# As a special exception to the GNU General Public License,
    1.19 +# if you distribute this file as part of a program or library that
    1.20 +# is built using GNU Libtool, you may include this file under the
    1.21 +# same distribution terms that you use for the rest of that program.
    1.22 +#
    1.23 +# GNU Libtool is distributed in the hope that it will be useful, but
    1.24 +# WITHOUT ANY WARRANTY; without even the implied warranty of
    1.25 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.26 +# General Public License for more details.
    1.27 +#
    1.28 +# You should have received a copy of the GNU General Public License
    1.29 +# along with GNU Libtool; see the file COPYING.  If not, a copy
    1.30 +# can be downloaded from http://www.gnu.org/licenses/gpl.html,
    1.31 +# or obtained by writing to the Free Software Foundation, Inc.,
    1.32 +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    1.33 +
    1.34 +# Usage: $progname [OPTION]... [MODE-ARG]...
    1.35 +#
    1.36 +# Provide generalized library-building support services.
    1.37 +#
    1.38 +#     --config             show all configuration variables
    1.39 +#     --debug              enable verbose shell tracing
    1.40 +# -n, --dry-run            display commands without modifying any files
    1.41 +#     --features           display basic configuration information and exit
    1.42 +#     --mode=MODE          use operation mode MODE
    1.43 +#     --preserve-dup-deps  don't remove duplicate dependency libraries
    1.44 +#     --quiet, --silent    don't print informational messages
    1.45 +#     --tag=TAG            use configuration variables from tag TAG
    1.46 +# -v, --verbose            print informational messages (default)
    1.47 +#     --version            print version information
    1.48 +# -h, --help               print short or long help message
    1.49 +#
    1.50 +# MODE must be one of the following:
    1.51 +#
    1.52 +#       clean              remove files from the build directory
    1.53 +#       compile            compile a source file into a libtool object
    1.54 +#       execute            automatically set library path, then run a program
    1.55 +#       finish             complete the installation of libtool libraries
    1.56 +#       install            install libraries or executables
    1.57 +#       link               create a library or an executable
    1.58 +#       uninstall          remove libraries from an installed directory
    1.59 +#
    1.60 +# MODE-ARGS vary depending on the MODE.
    1.61 +# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
    1.62 +#
    1.63 +# When reporting a bug, please describe a test case to reproduce it and
    1.64 +# include the following information:
    1.65 +#
    1.66 +#       host-triplet:	$host
    1.67 +#       shell:		$SHELL
    1.68 +#       compiler:		$LTCC
    1.69 +#       compiler flags:		$LTCFLAGS
    1.70 +#       linker:		$LD (gnu? $with_gnu_ld)
    1.71 +#       $progname:		(GNU libtool) 2.2.6b
    1.72 +#       automake:		$automake_version
    1.73 +#       autoconf:		$autoconf_version
    1.74 +#
    1.75 +# Report bugs to <bug-libtool@gnu.org>.
    1.76 +
    1.77 +PROGRAM=ltmain.sh
    1.78 +PACKAGE=libtool
    1.79 +VERSION=2.2.6b
    1.80 +TIMESTAMP=""
    1.81 +package_revision=1.3017
    1.82 +
    1.83 +# Be Bourne compatible
    1.84 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
    1.85 +  emulate sh
    1.86 +  NULLCMD=:
    1.87 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
    1.88 +  # is contrary to our usage.  Disable this feature.
    1.89 +  alias -g '${1+"$@"}'='"$@"'
    1.90 +  setopt NO_GLOB_SUBST
    1.91 +else
    1.92 +  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
    1.93 +fi
    1.94 +BIN_SH=xpg4; export BIN_SH # for Tru64
    1.95 +DUALCASE=1; export DUALCASE # for MKS sh
    1.96 +
    1.97 +# NLS nuisances: We save the old values to restore during execute mode.
    1.98 +# Only set LANG and LC_ALL to C if already set.
    1.99 +# These must not be set unconditionally because not all systems understand
   1.100 +# e.g. LANG=C (notably SCO).
   1.101 +lt_user_locale=
   1.102 +lt_safe_locale=
   1.103 +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
   1.104 +do
   1.105 +  eval "if test \"\${$lt_var+set}\" = set; then
   1.106 +          save_$lt_var=\$$lt_var
   1.107 +          $lt_var=C
   1.108 +	  export $lt_var
   1.109 +	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
   1.110 +	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
   1.111 +	fi"
   1.112 +done
   1.113 +
   1.114 +$lt_unset CDPATH
   1.115 +
   1.116 +
   1.117 +
   1.118 +
   1.119 +
   1.120 +: ${CP="cp -f"}
   1.121 +: ${ECHO="echo"}
   1.122 +: ${EGREP="/bin/grep -E"}
   1.123 +: ${FGREP="/bin/grep -F"}
   1.124 +: ${GREP="/bin/grep"}
   1.125 +: ${LN_S="ln -s"}
   1.126 +: ${MAKE="make"}
   1.127 +: ${MKDIR="mkdir"}
   1.128 +: ${MV="mv -f"}
   1.129 +: ${RM="rm -f"}
   1.130 +: ${SED="/bin/sed"}
   1.131 +: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
   1.132 +: ${Xsed="$SED -e 1s/^X//"}
   1.133 +
   1.134 +# Global variables:
   1.135 +EXIT_SUCCESS=0
   1.136 +EXIT_FAILURE=1
   1.137 +EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
   1.138 +EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
   1.139 +
   1.140 +exit_status=$EXIT_SUCCESS
   1.141 +
   1.142 +# Make sure IFS has a sensible default
   1.143 +lt_nl='
   1.144 +'
   1.145 +IFS=" 	$lt_nl"
   1.146 +
   1.147 +dirname="s,/[^/]*$,,"
   1.148 +basename="s,^.*/,,"
   1.149 +
   1.150 +# func_dirname_and_basename file append nondir_replacement
   1.151 +# perform func_basename and func_dirname in a single function
   1.152 +# call:
   1.153 +#   dirname:  Compute the dirname of FILE.  If nonempty,
   1.154 +#             add APPEND to the result, otherwise set result
   1.155 +#             to NONDIR_REPLACEMENT.
   1.156 +#             value returned in "$func_dirname_result"
   1.157 +#   basename: Compute filename of FILE.
   1.158 +#             value retuned in "$func_basename_result"
   1.159 +# Implementation must be kept synchronized with func_dirname
   1.160 +# and func_basename. For efficiency, we do not delegate to
   1.161 +# those functions but instead duplicate the functionality here.
   1.162 +func_dirname_and_basename ()
   1.163 +{
   1.164 +  # Extract subdirectory from the argument.
   1.165 +  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
   1.166 +  if test "X$func_dirname_result" = "X${1}"; then
   1.167 +    func_dirname_result="${3}"
   1.168 +  else
   1.169 +    func_dirname_result="$func_dirname_result${2}"
   1.170 +  fi
   1.171 +  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
   1.172 +}
   1.173 +
   1.174 +# Generated shell functions inserted here.
   1.175 +
   1.176 +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
   1.177 +# is ksh but when the shell is invoked as "sh" and the current value of
   1.178 +# the _XPG environment variable is not equal to 1 (one), the special
   1.179 +# positional parameter $0, within a function call, is the name of the
   1.180 +# function.
   1.181 +progpath="$0"
   1.182 +
   1.183 +# The name of this program:
   1.184 +# In the unlikely event $progname began with a '-', it would play havoc with
   1.185 +# func_echo (imagine progname=-n), so we prepend ./ in that case:
   1.186 +func_dirname_and_basename "$progpath"
   1.187 +progname=$func_basename_result
   1.188 +case $progname in
   1.189 +  -*) progname=./$progname ;;
   1.190 +esac
   1.191 +
   1.192 +# Make sure we have an absolute path for reexecution:
   1.193 +case $progpath in
   1.194 +  [\\/]*|[A-Za-z]:\\*) ;;
   1.195 +  *[\\/]*)
   1.196 +     progdir=$func_dirname_result
   1.197 +     progdir=`cd "$progdir" && pwd`
   1.198 +     progpath="$progdir/$progname"
   1.199 +     ;;
   1.200 +  *)
   1.201 +     save_IFS="$IFS"
   1.202 +     IFS=:
   1.203 +     for progdir in $PATH; do
   1.204 +       IFS="$save_IFS"
   1.205 +       test -x "$progdir/$progname" && break
   1.206 +     done
   1.207 +     IFS="$save_IFS"
   1.208 +     test -n "$progdir" || progdir=`pwd`
   1.209 +     progpath="$progdir/$progname"
   1.210 +     ;;
   1.211 +esac
   1.212 +
   1.213 +# Sed substitution that helps us do robust quoting.  It backslashifies
   1.214 +# metacharacters that are still active within double-quoted strings.
   1.215 +Xsed="${SED}"' -e 1s/^X//'
   1.216 +sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
   1.217 +
   1.218 +# Same as above, but do not quote variable references.
   1.219 +double_quote_subst='s/\(["`\\]\)/\\\1/g'
   1.220 +
   1.221 +# Re-`\' parameter expansions in output of double_quote_subst that were
   1.222 +# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
   1.223 +# in input to double_quote_subst, that '$' was protected from expansion.
   1.224 +# Since each input `\' is now two `\'s, look for any number of runs of
   1.225 +# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
   1.226 +bs='\\'
   1.227 +bs2='\\\\'
   1.228 +bs4='\\\\\\\\'
   1.229 +dollar='\$'
   1.230 +sed_double_backslash="\
   1.231 +  s/$bs4/&\\
   1.232 +/g
   1.233 +  s/^$bs2$dollar/$bs&/
   1.234 +  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
   1.235 +  s/\n//g"
   1.236 +
   1.237 +# Standard options:
   1.238 +opt_dry_run=false
   1.239 +opt_help=false
   1.240 +opt_quiet=false
   1.241 +opt_verbose=false
   1.242 +opt_warning=:
   1.243 +
   1.244 +# func_echo arg...
   1.245 +# Echo program name prefixed message, along with the current mode
   1.246 +# name if it has been set yet.
   1.247 +func_echo ()
   1.248 +{
   1.249 +    $ECHO "$progname${mode+: }$mode: $*"
   1.250 +}
   1.251 +
   1.252 +# func_verbose arg...
   1.253 +# Echo program name prefixed message in verbose mode only.
   1.254 +func_verbose ()
   1.255 +{
   1.256 +    $opt_verbose && func_echo ${1+"$@"}
   1.257 +
   1.258 +    # A bug in bash halts the script if the last line of a function
   1.259 +    # fails when set -e is in force, so we need another command to
   1.260 +    # work around that:
   1.261 +    :
   1.262 +}
   1.263 +
   1.264 +# func_error arg...
   1.265 +# Echo program name prefixed message to standard error.
   1.266 +func_error ()
   1.267 +{
   1.268 +    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
   1.269 +}
   1.270 +
   1.271 +# func_warning arg...
   1.272 +# Echo program name prefixed warning message to standard error.
   1.273 +func_warning ()
   1.274 +{
   1.275 +    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
   1.276 +
   1.277 +    # bash bug again:
   1.278 +    :
   1.279 +}
   1.280 +
   1.281 +# func_fatal_error arg...
   1.282 +# Echo program name prefixed message to standard error, and exit.
   1.283 +func_fatal_error ()
   1.284 +{
   1.285 +    func_error ${1+"$@"}
   1.286 +    exit $EXIT_FAILURE
   1.287 +}
   1.288 +
   1.289 +# func_fatal_help arg...
   1.290 +# Echo program name prefixed message to standard error, followed by
   1.291 +# a help hint, and exit.
   1.292 +func_fatal_help ()
   1.293 +{
   1.294 +    func_error ${1+"$@"}
   1.295 +    func_fatal_error "$help"
   1.296 +}
   1.297 +help="Try \`$progname --help' for more information."  ## default
   1.298 +
   1.299 +
   1.300 +# func_grep expression filename
   1.301 +# Check whether EXPRESSION matches any line of FILENAME, without output.
   1.302 +func_grep ()
   1.303 +{
   1.304 +    $GREP "$1" "$2" >/dev/null 2>&1
   1.305 +}
   1.306 +
   1.307 +
   1.308 +# func_mkdir_p directory-path
   1.309 +# Make sure the entire path to DIRECTORY-PATH is available.
   1.310 +func_mkdir_p ()
   1.311 +{
   1.312 +    my_directory_path="$1"
   1.313 +    my_dir_list=
   1.314 +
   1.315 +    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
   1.316 +
   1.317 +      # Protect directory names starting with `-'
   1.318 +      case $my_directory_path in
   1.319 +        -*) my_directory_path="./$my_directory_path" ;;
   1.320 +      esac
   1.321 +
   1.322 +      # While some portion of DIR does not yet exist...
   1.323 +      while test ! -d "$my_directory_path"; do
   1.324 +        # ...make a list in topmost first order.  Use a colon delimited
   1.325 +	# list incase some portion of path contains whitespace.
   1.326 +        my_dir_list="$my_directory_path:$my_dir_list"
   1.327 +
   1.328 +        # If the last portion added has no slash in it, the list is done
   1.329 +        case $my_directory_path in */*) ;; *) break ;; esac
   1.330 +
   1.331 +        # ...otherwise throw away the child directory and loop
   1.332 +        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
   1.333 +      done
   1.334 +      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
   1.335 +
   1.336 +      save_mkdir_p_IFS="$IFS"; IFS=':'
   1.337 +      for my_dir in $my_dir_list; do
   1.338 +	IFS="$save_mkdir_p_IFS"
   1.339 +        # mkdir can fail with a `File exist' error if two processes
   1.340 +        # try to create one of the directories concurrently.  Don't
   1.341 +        # stop in that case!
   1.342 +        $MKDIR "$my_dir" 2>/dev/null || :
   1.343 +      done
   1.344 +      IFS="$save_mkdir_p_IFS"
   1.345 +
   1.346 +      # Bail out if we (or some other process) failed to create a directory.
   1.347 +      test -d "$my_directory_path" || \
   1.348 +        func_fatal_error "Failed to create \`$1'"
   1.349 +    fi
   1.350 +}
   1.351 +
   1.352 +
   1.353 +# func_mktempdir [string]
   1.354 +# Make a temporary directory that won't clash with other running
   1.355 +# libtool processes, and avoids race conditions if possible.  If
   1.356 +# given, STRING is the basename for that directory.
   1.357 +func_mktempdir ()
   1.358 +{
   1.359 +    my_template="${TMPDIR-/tmp}/${1-$progname}"
   1.360 +
   1.361 +    if test "$opt_dry_run" = ":"; then
   1.362 +      # Return a directory name, but don't create it in dry-run mode
   1.363 +      my_tmpdir="${my_template}-$$"
   1.364 +    else
   1.365 +
   1.366 +      # If mktemp works, use that first and foremost
   1.367 +      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
   1.368 +
   1.369 +      if test ! -d "$my_tmpdir"; then
   1.370 +        # Failing that, at least try and use $RANDOM to avoid a race
   1.371 +        my_tmpdir="${my_template}-${RANDOM-0}$$"
   1.372 +
   1.373 +        save_mktempdir_umask=`umask`
   1.374 +        umask 0077
   1.375 +        $MKDIR "$my_tmpdir"
   1.376 +        umask $save_mktempdir_umask
   1.377 +      fi
   1.378 +
   1.379 +      # If we're not in dry-run mode, bomb out on failure
   1.380 +      test -d "$my_tmpdir" || \
   1.381 +        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
   1.382 +    fi
   1.383 +
   1.384 +    $ECHO "X$my_tmpdir" | $Xsed
   1.385 +}
   1.386 +
   1.387 +
   1.388 +# func_quote_for_eval arg
   1.389 +# Aesthetically quote ARG to be evaled later.
   1.390 +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
   1.391 +# is double-quoted, suitable for a subsequent eval, whereas
   1.392 +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
   1.393 +# which are still active within double quotes backslashified.
   1.394 +func_quote_for_eval ()
   1.395 +{
   1.396 +    case $1 in
   1.397 +      *[\\\`\"\$]*)
   1.398 +	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
   1.399 +      *)
   1.400 +        func_quote_for_eval_unquoted_result="$1" ;;
   1.401 +    esac
   1.402 +
   1.403 +    case $func_quote_for_eval_unquoted_result in
   1.404 +      # Double-quote args containing shell metacharacters to delay
   1.405 +      # word splitting, command substitution and and variable
   1.406 +      # expansion for a subsequent eval.
   1.407 +      # Many Bourne shells cannot handle close brackets correctly
   1.408 +      # in scan sets, so we specify it separately.
   1.409 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.410 +        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
   1.411 +        ;;
   1.412 +      *)
   1.413 +        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
   1.414 +    esac
   1.415 +}
   1.416 +
   1.417 +
   1.418 +# func_quote_for_expand arg
   1.419 +# Aesthetically quote ARG to be evaled later; same as above,
   1.420 +# but do not quote variable references.
   1.421 +func_quote_for_expand ()
   1.422 +{
   1.423 +    case $1 in
   1.424 +      *[\\\`\"]*)
   1.425 +	my_arg=`$ECHO "X$1" | $Xsed \
   1.426 +	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
   1.427 +      *)
   1.428 +        my_arg="$1" ;;
   1.429 +    esac
   1.430 +
   1.431 +    case $my_arg in
   1.432 +      # Double-quote args containing shell metacharacters to delay
   1.433 +      # word splitting and command substitution for a subsequent eval.
   1.434 +      # Many Bourne shells cannot handle close brackets correctly
   1.435 +      # in scan sets, so we specify it separately.
   1.436 +      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   1.437 +        my_arg="\"$my_arg\""
   1.438 +        ;;
   1.439 +    esac
   1.440 +
   1.441 +    func_quote_for_expand_result="$my_arg"
   1.442 +}
   1.443 +
   1.444 +
   1.445 +# func_show_eval cmd [fail_exp]
   1.446 +# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
   1.447 +# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
   1.448 +# is given, then evaluate it.
   1.449 +func_show_eval ()
   1.450 +{
   1.451 +    my_cmd="$1"
   1.452 +    my_fail_exp="${2-:}"
   1.453 +
   1.454 +    ${opt_silent-false} || {
   1.455 +      func_quote_for_expand "$my_cmd"
   1.456 +      eval "func_echo $func_quote_for_expand_result"
   1.457 +    }
   1.458 +
   1.459 +    if ${opt_dry_run-false}; then :; else
   1.460 +      eval "$my_cmd"
   1.461 +      my_status=$?
   1.462 +      if test "$my_status" -eq 0; then :; else
   1.463 +	eval "(exit $my_status); $my_fail_exp"
   1.464 +      fi
   1.465 +    fi
   1.466 +}
   1.467 +
   1.468 +
   1.469 +# func_show_eval_locale cmd [fail_exp]
   1.470 +# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
   1.471 +# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
   1.472 +# is given, then evaluate it.  Use the saved locale for evaluation.
   1.473 +func_show_eval_locale ()
   1.474 +{
   1.475 +    my_cmd="$1"
   1.476 +    my_fail_exp="${2-:}"
   1.477 +
   1.478 +    ${opt_silent-false} || {
   1.479 +      func_quote_for_expand "$my_cmd"
   1.480 +      eval "func_echo $func_quote_for_expand_result"
   1.481 +    }
   1.482 +
   1.483 +    if ${opt_dry_run-false}; then :; else
   1.484 +      eval "$lt_user_locale
   1.485 +	    $my_cmd"
   1.486 +      my_status=$?
   1.487 +      eval "$lt_safe_locale"
   1.488 +      if test "$my_status" -eq 0; then :; else
   1.489 +	eval "(exit $my_status); $my_fail_exp"
   1.490 +      fi
   1.491 +    fi
   1.492 +}
   1.493 +
   1.494 +
   1.495 +
   1.496 +
   1.497 +
   1.498 +# func_version
   1.499 +# Echo version message to standard output and exit.
   1.500 +func_version ()
   1.501 +{
   1.502 +    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
   1.503 +        s/^# //
   1.504 +	s/^# *$//
   1.505 +        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
   1.506 +        p
   1.507 +     }' < "$progpath"
   1.508 +     exit $?
   1.509 +}
   1.510 +
   1.511 +# func_usage
   1.512 +# Echo short help message to standard output and exit.
   1.513 +func_usage ()
   1.514 +{
   1.515 +    $SED -n '/^# Usage:/,/# -h/ {
   1.516 +        s/^# //
   1.517 +	s/^# *$//
   1.518 +	s/\$progname/'$progname'/
   1.519 +	p
   1.520 +    }' < "$progpath"
   1.521 +    $ECHO
   1.522 +    $ECHO "run \`$progname --help | more' for full usage"
   1.523 +    exit $?
   1.524 +}
   1.525 +
   1.526 +# func_help
   1.527 +# Echo long help message to standard output and exit.
   1.528 +func_help ()
   1.529 +{
   1.530 +    $SED -n '/^# Usage:/,/# Report bugs to/ {
   1.531 +        s/^# //
   1.532 +	s/^# *$//
   1.533 +	s*\$progname*'$progname'*
   1.534 +	s*\$host*'"$host"'*
   1.535 +	s*\$SHELL*'"$SHELL"'*
   1.536 +	s*\$LTCC*'"$LTCC"'*
   1.537 +	s*\$LTCFLAGS*'"$LTCFLAGS"'*
   1.538 +	s*\$LD*'"$LD"'*
   1.539 +	s/\$with_gnu_ld/'"$with_gnu_ld"'/
   1.540 +	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
   1.541 +	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
   1.542 +	p
   1.543 +     }' < "$progpath"
   1.544 +    exit $?
   1.545 +}
   1.546 +
   1.547 +# func_missing_arg argname
   1.548 +# Echo program name prefixed message to standard error and set global
   1.549 +# exit_cmd.
   1.550 +func_missing_arg ()
   1.551 +{
   1.552 +    func_error "missing argument for $1"
   1.553 +    exit_cmd=exit
   1.554 +}
   1.555 +
   1.556 +exit_cmd=:
   1.557 +
   1.558 +
   1.559 +
   1.560 +
   1.561 +
   1.562 +# Check that we have a working $ECHO.
   1.563 +if test "X$1" = X--no-reexec; then
   1.564 +  # Discard the --no-reexec flag, and continue.
   1.565 +  shift
   1.566 +elif test "X$1" = X--fallback-echo; then
   1.567 +  # Avoid inline document here, it may be left over
   1.568 +  :
   1.569 +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
   1.570 +  # Yippee, $ECHO works!
   1.571 +  :
   1.572 +else
   1.573 +  # Restart under the correct shell, and then maybe $ECHO will work.
   1.574 +  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
   1.575 +fi
   1.576 +
   1.577 +if test "X$1" = X--fallback-echo; then
   1.578 +  # used as fallback echo
   1.579 +  shift
   1.580 +  cat <<EOF
   1.581 +$*
   1.582 +EOF
   1.583 +  exit $EXIT_SUCCESS
   1.584 +fi
   1.585 +
   1.586 +magic="%%%MAGIC variable%%%"
   1.587 +magic_exe="%%%MAGIC EXE variable%%%"
   1.588 +
   1.589 +# Global variables.
   1.590 +# $mode is unset
   1.591 +nonopt=
   1.592 +execute_dlfiles=
   1.593 +preserve_args=
   1.594 +lo2o="s/\\.lo\$/.${objext}/"
   1.595 +o2lo="s/\\.${objext}\$/.lo/"
   1.596 +extracted_archives=
   1.597 +extracted_serial=0
   1.598 +
   1.599 +opt_dry_run=false
   1.600 +opt_duplicate_deps=false
   1.601 +opt_silent=false
   1.602 +opt_debug=:
   1.603 +
   1.604 +# If this variable is set in any of the actions, the command in it
   1.605 +# will be execed at the end.  This prevents here-documents from being
   1.606 +# left over by shells.
   1.607 +exec_cmd=
   1.608 +
   1.609 +# func_fatal_configuration arg...
   1.610 +# Echo program name prefixed message to standard error, followed by
   1.611 +# a configuration failure hint, and exit.
   1.612 +func_fatal_configuration ()
   1.613 +{
   1.614 +    func_error ${1+"$@"}
   1.615 +    func_error "See the $PACKAGE documentation for more information."
   1.616 +    func_fatal_error "Fatal configuration error."
   1.617 +}
   1.618 +
   1.619 +
   1.620 +# func_config
   1.621 +# Display the configuration for all the tags in this script.
   1.622 +func_config ()
   1.623 +{
   1.624 +    re_begincf='^# ### BEGIN LIBTOOL'
   1.625 +    re_endcf='^# ### END LIBTOOL'
   1.626 +
   1.627 +    # Default configuration.
   1.628 +    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
   1.629 +
   1.630 +    # Now print the configurations for the tags.
   1.631 +    for tagname in $taglist; do
   1.632 +      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
   1.633 +    done
   1.634 +
   1.635 +    exit $?
   1.636 +}
   1.637 +
   1.638 +# func_features
   1.639 +# Display the features supported by this script.
   1.640 +func_features ()
   1.641 +{
   1.642 +    $ECHO "host: $host"
   1.643 +    if test "$build_libtool_libs" = yes; then
   1.644 +      $ECHO "enable shared libraries"
   1.645 +    else
   1.646 +      $ECHO "disable shared libraries"
   1.647 +    fi
   1.648 +    if test "$build_old_libs" = yes; then
   1.649 +      $ECHO "enable static libraries"
   1.650 +    else
   1.651 +      $ECHO "disable static libraries"
   1.652 +    fi
   1.653 +
   1.654 +    exit $?
   1.655 +}
   1.656 +
   1.657 +# func_enable_tag tagname
   1.658 +# Verify that TAGNAME is valid, and either flag an error and exit, or
   1.659 +# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
   1.660 +# variable here.
   1.661 +func_enable_tag ()
   1.662 +{
   1.663 +  # Global variable:
   1.664 +  tagname="$1"
   1.665 +
   1.666 +  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
   1.667 +  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
   1.668 +  sed_extractcf="/$re_begincf/,/$re_endcf/p"
   1.669 +
   1.670 +  # Validate tagname.
   1.671 +  case $tagname in
   1.672 +    *[!-_A-Za-z0-9,/]*)
   1.673 +      func_fatal_error "invalid tag name: $tagname"
   1.674 +      ;;
   1.675 +  esac
   1.676 +
   1.677 +  # Don't test for the "default" C tag, as we know it's
   1.678 +  # there but not specially marked.
   1.679 +  case $tagname in
   1.680 +    CC) ;;
   1.681 +    *)
   1.682 +      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
   1.683 +	taglist="$taglist $tagname"
   1.684 +
   1.685 +	# Evaluate the configuration.  Be careful to quote the path
   1.686 +	# and the sed script, to avoid splitting on whitespace, but
   1.687 +	# also don't use non-portable quotes within backquotes within
   1.688 +	# quotes we have to do it in 2 steps:
   1.689 +	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
   1.690 +	eval "$extractedcf"
   1.691 +      else
   1.692 +	func_error "ignoring unknown tag $tagname"
   1.693 +      fi
   1.694 +      ;;
   1.695 +  esac
   1.696 +}
   1.697 +
   1.698 +# Parse options once, thoroughly.  This comes as soon as possible in
   1.699 +# the script to make things like `libtool --version' happen quickly.
   1.700 +{
   1.701 +
   1.702 +  # Shorthand for --mode=foo, only valid as the first argument
   1.703 +  case $1 in
   1.704 +  clean|clea|cle|cl)
   1.705 +    shift; set dummy --mode clean ${1+"$@"}; shift
   1.706 +    ;;
   1.707 +  compile|compil|compi|comp|com|co|c)
   1.708 +    shift; set dummy --mode compile ${1+"$@"}; shift
   1.709 +    ;;
   1.710 +  execute|execut|execu|exec|exe|ex|e)
   1.711 +    shift; set dummy --mode execute ${1+"$@"}; shift
   1.712 +    ;;
   1.713 +  finish|finis|fini|fin|fi|f)
   1.714 +    shift; set dummy --mode finish ${1+"$@"}; shift
   1.715 +    ;;
   1.716 +  install|instal|insta|inst|ins|in|i)
   1.717 +    shift; set dummy --mode install ${1+"$@"}; shift
   1.718 +    ;;
   1.719 +  link|lin|li|l)
   1.720 +    shift; set dummy --mode link ${1+"$@"}; shift
   1.721 +    ;;
   1.722 +  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
   1.723 +    shift; set dummy --mode uninstall ${1+"$@"}; shift
   1.724 +    ;;
   1.725 +  esac
   1.726 +
   1.727 +  # Parse non-mode specific arguments:
   1.728 +  while test "$#" -gt 0; do
   1.729 +    opt="$1"
   1.730 +    shift
   1.731 +
   1.732 +    case $opt in
   1.733 +      --config)		func_config					;;
   1.734 +
   1.735 +      --debug)		preserve_args="$preserve_args $opt"
   1.736 +			func_echo "enabling shell trace mode"
   1.737 +			opt_debug='set -x'
   1.738 +			$opt_debug
   1.739 +			;;
   1.740 +
   1.741 +      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
   1.742 +			execute_dlfiles="$execute_dlfiles $1"
   1.743 +			shift
   1.744 +			;;
   1.745 +
   1.746 +      --dry-run | -n)	opt_dry_run=:					;;
   1.747 +      --features)       func_features					;;
   1.748 +      --finish)		mode="finish"					;;
   1.749 +
   1.750 +      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
   1.751 +			case $1 in
   1.752 +			  # Valid mode arguments:
   1.753 +			  clean)	;;
   1.754 +			  compile)	;;
   1.755 +			  execute)	;;
   1.756 +			  finish)	;;
   1.757 +			  install)	;;
   1.758 +			  link)		;;
   1.759 +			  relink)	;;
   1.760 +			  uninstall)	;;
   1.761 +
   1.762 +			  # Catch anything else as an error
   1.763 +			  *) func_error "invalid argument for $opt"
   1.764 +			     exit_cmd=exit
   1.765 +			     break
   1.766 +			     ;;
   1.767 +		        esac
   1.768 +
   1.769 +			mode="$1"
   1.770 +			shift
   1.771 +			;;
   1.772 +
   1.773 +      --preserve-dup-deps)
   1.774 +			opt_duplicate_deps=:				;;
   1.775 +
   1.776 +      --quiet|--silent)	preserve_args="$preserve_args $opt"
   1.777 +			opt_silent=:
   1.778 +			;;
   1.779 +
   1.780 +      --verbose| -v)	preserve_args="$preserve_args $opt"
   1.781 +			opt_silent=false
   1.782 +			;;
   1.783 +
   1.784 +      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
   1.785 +			preserve_args="$preserve_args $opt $1"
   1.786 +			func_enable_tag "$1"	# tagname is set here
   1.787 +			shift
   1.788 +			;;
   1.789 +
   1.790 +      # Separate optargs to long options:
   1.791 +      -dlopen=*|--mode=*|--tag=*)
   1.792 +			func_opt_split "$opt"
   1.793 +			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
   1.794 +			shift
   1.795 +			;;
   1.796 +
   1.797 +      -\?|-h)		func_usage					;;
   1.798 +      --help)		opt_help=:					;;
   1.799 +      --version)	func_version					;;
   1.800 +
   1.801 +      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
   1.802 +
   1.803 +      *)		nonopt="$opt"
   1.804 +			break
   1.805 +			;;
   1.806 +    esac
   1.807 +  done
   1.808 +
   1.809 +
   1.810 +  case $host in
   1.811 +    *cygwin* | *mingw* | *pw32* | *cegcc*)
   1.812 +      # don't eliminate duplications in $postdeps and $predeps
   1.813 +      opt_duplicate_compiler_generated_deps=:
   1.814 +      ;;
   1.815 +    *)
   1.816 +      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
   1.817 +      ;;
   1.818 +  esac
   1.819 +
   1.820 +  # Having warned about all mis-specified options, bail out if
   1.821 +  # anything was wrong.
   1.822 +  $exit_cmd $EXIT_FAILURE
   1.823 +}
   1.824 +
   1.825 +# func_check_version_match
   1.826 +# Ensure that we are using m4 macros, and libtool script from the same
   1.827 +# release of libtool.
   1.828 +func_check_version_match ()
   1.829 +{
   1.830 +  if test "$package_revision" != "$macro_revision"; then
   1.831 +    if test "$VERSION" != "$macro_version"; then
   1.832 +      if test -z "$macro_version"; then
   1.833 +        cat >&2 <<_LT_EOF
   1.834 +$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
   1.835 +$progname: definition of this LT_INIT comes from an older release.
   1.836 +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
   1.837 +$progname: and run autoconf again.
   1.838 +_LT_EOF
   1.839 +      else
   1.840 +        cat >&2 <<_LT_EOF
   1.841 +$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
   1.842 +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
   1.843 +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
   1.844 +$progname: and run autoconf again.
   1.845 +_LT_EOF
   1.846 +      fi
   1.847 +    else
   1.848 +      cat >&2 <<_LT_EOF
   1.849 +$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
   1.850 +$progname: but the definition of this LT_INIT comes from revision $macro_revision.
   1.851 +$progname: You should recreate aclocal.m4 with macros from revision $package_revision
   1.852 +$progname: of $PACKAGE $VERSION and run autoconf again.
   1.853 +_LT_EOF
   1.854 +    fi
   1.855 +
   1.856 +    exit $EXIT_MISMATCH
   1.857 +  fi
   1.858 +}
   1.859 +
   1.860 +
   1.861 +## ----------- ##
   1.862 +##    Main.    ##
   1.863 +## ----------- ##
   1.864 +
   1.865 +$opt_help || {
   1.866 +  # Sanity checks first:
   1.867 +  func_check_version_match
   1.868 +
   1.869 +  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   1.870 +    func_fatal_configuration "not configured to build any kind of library"
   1.871 +  fi
   1.872 +
   1.873 +  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
   1.874 +
   1.875 +
   1.876 +  # Darwin sucks
   1.877 +  eval std_shrext=\"$shrext_cmds\"
   1.878 +
   1.879 +
   1.880 +  # Only execute mode is allowed to have -dlopen flags.
   1.881 +  if test -n "$execute_dlfiles" && test "$mode" != execute; then
   1.882 +    func_error "unrecognized option \`-dlopen'"
   1.883 +    $ECHO "$help" 1>&2
   1.884 +    exit $EXIT_FAILURE
   1.885 +  fi
   1.886 +
   1.887 +  # Change the help message to a mode-specific one.
   1.888 +  generic_help="$help"
   1.889 +  help="Try \`$progname --help --mode=$mode' for more information."
   1.890 +}
   1.891 +
   1.892 +
   1.893 +# func_lalib_p file
   1.894 +# True iff FILE is a libtool `.la' library or `.lo' object file.
   1.895 +# This function is only a basic sanity check; it will hardly flush out
   1.896 +# determined imposters.
   1.897 +func_lalib_p ()
   1.898 +{
   1.899 +    test -f "$1" &&
   1.900 +      $SED -e 4q "$1" 2>/dev/null \
   1.901 +        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
   1.902 +}
   1.903 +
   1.904 +# func_lalib_unsafe_p file
   1.905 +# True iff FILE is a libtool `.la' library or `.lo' object file.
   1.906 +# This function implements the same check as func_lalib_p without
   1.907 +# resorting to external programs.  To this end, it redirects stdin and
   1.908 +# closes it afterwards, without saving the original file descriptor.
   1.909 +# As a safety measure, use it only where a negative result would be
   1.910 +# fatal anyway.  Works if `file' does not exist.
   1.911 +func_lalib_unsafe_p ()
   1.912 +{
   1.913 +    lalib_p=no
   1.914 +    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
   1.915 +	for lalib_p_l in 1 2 3 4
   1.916 +	do
   1.917 +	    read lalib_p_line
   1.918 +	    case "$lalib_p_line" in
   1.919 +		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
   1.920 +	    esac
   1.921 +	done
   1.922 +	exec 0<&5 5<&-
   1.923 +    fi
   1.924 +    test "$lalib_p" = yes
   1.925 +}
   1.926 +
   1.927 +# func_ltwrapper_script_p file
   1.928 +# True iff FILE is a libtool wrapper script
   1.929 +# This function is only a basic sanity check; it will hardly flush out
   1.930 +# determined imposters.
   1.931 +func_ltwrapper_script_p ()
   1.932 +{
   1.933 +    func_lalib_p "$1"
   1.934 +}
   1.935 +
   1.936 +# func_ltwrapper_executable_p file
   1.937 +# True iff FILE is a libtool wrapper executable
   1.938 +# This function is only a basic sanity check; it will hardly flush out
   1.939 +# determined imposters.
   1.940 +func_ltwrapper_executable_p ()
   1.941 +{
   1.942 +    func_ltwrapper_exec_suffix=
   1.943 +    case $1 in
   1.944 +    *.exe) ;;
   1.945 +    *) func_ltwrapper_exec_suffix=.exe ;;
   1.946 +    esac
   1.947 +    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
   1.948 +}
   1.949 +
   1.950 +# func_ltwrapper_scriptname file
   1.951 +# Assumes file is an ltwrapper_executable
   1.952 +# uses $file to determine the appropriate filename for a
   1.953 +# temporary ltwrapper_script.
   1.954 +func_ltwrapper_scriptname ()
   1.955 +{
   1.956 +    func_ltwrapper_scriptname_result=""
   1.957 +    if func_ltwrapper_executable_p "$1"; then
   1.958 +	func_dirname_and_basename "$1" "" "."
   1.959 +	func_stripname '' '.exe' "$func_basename_result"
   1.960 +	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
   1.961 +    fi
   1.962 +}
   1.963 +
   1.964 +# func_ltwrapper_p file
   1.965 +# True iff FILE is a libtool wrapper script or wrapper executable
   1.966 +# This function is only a basic sanity check; it will hardly flush out
   1.967 +# determined imposters.
   1.968 +func_ltwrapper_p ()
   1.969 +{
   1.970 +    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
   1.971 +}
   1.972 +
   1.973 +
   1.974 +# func_execute_cmds commands fail_cmd
   1.975 +# Execute tilde-delimited COMMANDS.
   1.976 +# If FAIL_CMD is given, eval that upon failure.
   1.977 +# FAIL_CMD may read-access the current command in variable CMD!
   1.978 +func_execute_cmds ()
   1.979 +{
   1.980 +    $opt_debug
   1.981 +    save_ifs=$IFS; IFS='~'
   1.982 +    for cmd in $1; do
   1.983 +      IFS=$save_ifs
   1.984 +      eval cmd=\"$cmd\"
   1.985 +      func_show_eval "$cmd" "${2-:}"
   1.986 +    done
   1.987 +    IFS=$save_ifs
   1.988 +}
   1.989 +
   1.990 +
   1.991 +# func_source file
   1.992 +# Source FILE, adding directory component if necessary.
   1.993 +# Note that it is not necessary on cygwin/mingw to append a dot to
   1.994 +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
   1.995 +# behavior happens only for exec(3), not for open(2)!  Also, sourcing
   1.996 +# `FILE.' does not work on cygwin managed mounts.
   1.997 +func_source ()
   1.998 +{
   1.999 +    $opt_debug
  1.1000 +    case $1 in
  1.1001 +    */* | *\\*)	. "$1" ;;
  1.1002 +    *)		. "./$1" ;;
  1.1003 +    esac
  1.1004 +}
  1.1005 +
  1.1006 +
  1.1007 +# func_infer_tag arg
  1.1008 +# Infer tagged configuration to use if any are available and
  1.1009 +# if one wasn't chosen via the "--tag" command line option.
  1.1010 +# Only attempt this if the compiler in the base compile
  1.1011 +# command doesn't match the default compiler.
  1.1012 +# arg is usually of the form 'gcc ...'
  1.1013 +func_infer_tag ()
  1.1014 +{
  1.1015 +    $opt_debug
  1.1016 +    if test -n "$available_tags" && test -z "$tagname"; then
  1.1017 +      CC_quoted=
  1.1018 +      for arg in $CC; do
  1.1019 +        func_quote_for_eval "$arg"
  1.1020 +	CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1.1021 +      done
  1.1022 +      case $@ in
  1.1023 +      # Blanks in the command may have been stripped by the calling shell,
  1.1024 +      # but not from the CC environment variable when configure was run.
  1.1025 +      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
  1.1026 +      # Blanks at the start of $base_compile will cause this to fail
  1.1027 +      # if we don't check for them as well.
  1.1028 +      *)
  1.1029 +	for z in $available_tags; do
  1.1030 +	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  1.1031 +	    # Evaluate the configuration.
  1.1032 +	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  1.1033 +	    CC_quoted=
  1.1034 +	    for arg in $CC; do
  1.1035 +	      # Double-quote args containing other shell metacharacters.
  1.1036 +	      func_quote_for_eval "$arg"
  1.1037 +	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1.1038 +	    done
  1.1039 +	    case "$@ " in
  1.1040 +	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
  1.1041 +	      # The compiler in the base compile command matches
  1.1042 +	      # the one in the tagged configuration.
  1.1043 +	      # Assume this is the tagged configuration we want.
  1.1044 +	      tagname=$z
  1.1045 +	      break
  1.1046 +	      ;;
  1.1047 +	    esac
  1.1048 +	  fi
  1.1049 +	done
  1.1050 +	# If $tagname still isn't set, then no tagged configuration
  1.1051 +	# was found and let the user know that the "--tag" command
  1.1052 +	# line option must be used.
  1.1053 +	if test -z "$tagname"; then
  1.1054 +	  func_echo "unable to infer tagged configuration"
  1.1055 +	  func_fatal_error "specify a tag with \`--tag'"
  1.1056 +#	else
  1.1057 +#	  func_verbose "using $tagname tagged configuration"
  1.1058 +	fi
  1.1059 +	;;
  1.1060 +      esac
  1.1061 +    fi
  1.1062 +}
  1.1063 +
  1.1064 +
  1.1065 +
  1.1066 +# func_write_libtool_object output_name pic_name nonpic_name
  1.1067 +# Create a libtool object file (analogous to a ".la" file),
  1.1068 +# but don't create it if we're doing a dry run.
  1.1069 +func_write_libtool_object ()
  1.1070 +{
  1.1071 +    write_libobj=${1}
  1.1072 +    if test "$build_libtool_libs" = yes; then
  1.1073 +      write_lobj=\'${2}\'
  1.1074 +    else
  1.1075 +      write_lobj=none
  1.1076 +    fi
  1.1077 +
  1.1078 +    if test "$build_old_libs" = yes; then
  1.1079 +      write_oldobj=\'${3}\'
  1.1080 +    else
  1.1081 +      write_oldobj=none
  1.1082 +    fi
  1.1083 +
  1.1084 +    $opt_dry_run || {
  1.1085 +      cat >${write_libobj}T <<EOF
  1.1086 +# $write_libobj - a libtool object file
  1.1087 +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1.1088 +#
  1.1089 +# Please DO NOT delete this file!
  1.1090 +# It is necessary for linking the library.
  1.1091 +
  1.1092 +# Name of the PIC object.
  1.1093 +pic_object=$write_lobj
  1.1094 +
  1.1095 +# Name of the non-PIC object
  1.1096 +non_pic_object=$write_oldobj
  1.1097 +
  1.1098 +EOF
  1.1099 +      $MV "${write_libobj}T" "${write_libobj}"
  1.1100 +    }
  1.1101 +}
  1.1102 +
  1.1103 +# func_mode_compile arg...
  1.1104 +func_mode_compile ()
  1.1105 +{
  1.1106 +    $opt_debug
  1.1107 +    # Get the compilation command and the source file.
  1.1108 +    base_compile=
  1.1109 +    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
  1.1110 +    suppress_opt=yes
  1.1111 +    suppress_output=
  1.1112 +    arg_mode=normal
  1.1113 +    libobj=
  1.1114 +    later=
  1.1115 +    pie_flag=
  1.1116 +
  1.1117 +    for arg
  1.1118 +    do
  1.1119 +      case $arg_mode in
  1.1120 +      arg  )
  1.1121 +	# do not "continue".  Instead, add this to base_compile
  1.1122 +	lastarg="$arg"
  1.1123 +	arg_mode=normal
  1.1124 +	;;
  1.1125 +
  1.1126 +      target )
  1.1127 +	libobj="$arg"
  1.1128 +	arg_mode=normal
  1.1129 +	continue
  1.1130 +	;;
  1.1131 +
  1.1132 +      normal )
  1.1133 +	# Accept any command-line options.
  1.1134 +	case $arg in
  1.1135 +	-o)
  1.1136 +	  test -n "$libobj" && \
  1.1137 +	    func_fatal_error "you cannot specify \`-o' more than once"
  1.1138 +	  arg_mode=target
  1.1139 +	  continue
  1.1140 +	  ;;
  1.1141 +
  1.1142 +	-pie | -fpie | -fPIE)
  1.1143 +          pie_flag="$pie_flag $arg"
  1.1144 +	  continue
  1.1145 +	  ;;
  1.1146 +
  1.1147 +	-shared | -static | -prefer-pic | -prefer-non-pic)
  1.1148 +	  later="$later $arg"
  1.1149 +	  continue
  1.1150 +	  ;;
  1.1151 +
  1.1152 +	-no-suppress)
  1.1153 +	  suppress_opt=no
  1.1154 +	  continue
  1.1155 +	  ;;
  1.1156 +
  1.1157 +	-Xcompiler)
  1.1158 +	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
  1.1159 +	  continue      #  The current "srcfile" will either be retained or
  1.1160 +	  ;;            #  replaced later.  I would guess that would be a bug.
  1.1161 +
  1.1162 +	-Wc,*)
  1.1163 +	  func_stripname '-Wc,' '' "$arg"
  1.1164 +	  args=$func_stripname_result
  1.1165 +	  lastarg=
  1.1166 +	  save_ifs="$IFS"; IFS=','
  1.1167 +	  for arg in $args; do
  1.1168 +	    IFS="$save_ifs"
  1.1169 +	    func_quote_for_eval "$arg"
  1.1170 +	    lastarg="$lastarg $func_quote_for_eval_result"
  1.1171 +	  done
  1.1172 +	  IFS="$save_ifs"
  1.1173 +	  func_stripname ' ' '' "$lastarg"
  1.1174 +	  lastarg=$func_stripname_result
  1.1175 +
  1.1176 +	  # Add the arguments to base_compile.
  1.1177 +	  base_compile="$base_compile $lastarg"
  1.1178 +	  continue
  1.1179 +	  ;;
  1.1180 +
  1.1181 +	*)
  1.1182 +	  # Accept the current argument as the source file.
  1.1183 +	  # The previous "srcfile" becomes the current argument.
  1.1184 +	  #
  1.1185 +	  lastarg="$srcfile"
  1.1186 +	  srcfile="$arg"
  1.1187 +	  ;;
  1.1188 +	esac  #  case $arg
  1.1189 +	;;
  1.1190 +      esac    #  case $arg_mode
  1.1191 +
  1.1192 +      # Aesthetically quote the previous argument.
  1.1193 +      func_quote_for_eval "$lastarg"
  1.1194 +      base_compile="$base_compile $func_quote_for_eval_result"
  1.1195 +    done # for arg
  1.1196 +
  1.1197 +    case $arg_mode in
  1.1198 +    arg)
  1.1199 +      func_fatal_error "you must specify an argument for -Xcompile"
  1.1200 +      ;;
  1.1201 +    target)
  1.1202 +      func_fatal_error "you must specify a target with \`-o'"
  1.1203 +      ;;
  1.1204 +    *)
  1.1205 +      # Get the name of the library object.
  1.1206 +      test -z "$libobj" && {
  1.1207 +	func_basename "$srcfile"
  1.1208 +	libobj="$func_basename_result"
  1.1209 +      }
  1.1210 +      ;;
  1.1211 +    esac
  1.1212 +
  1.1213 +    # Recognize several different file suffixes.
  1.1214 +    # If the user specifies -o file.o, it is replaced with file.lo
  1.1215 +    case $libobj in
  1.1216 +    *.[cCFSifmso] | \
  1.1217 +    *.ada | *.adb | *.ads | *.asm | \
  1.1218 +    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  1.1219 +    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
  1.1220 +      func_xform "$libobj"
  1.1221 +      libobj=$func_xform_result
  1.1222 +      ;;
  1.1223 +    esac
  1.1224 +
  1.1225 +    case $libobj in
  1.1226 +    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  1.1227 +    *)
  1.1228 +      func_fatal_error "cannot determine name of library object from \`$libobj'"
  1.1229 +      ;;
  1.1230 +    esac
  1.1231 +
  1.1232 +    func_infer_tag $base_compile
  1.1233 +
  1.1234 +    for arg in $later; do
  1.1235 +      case $arg in
  1.1236 +      -shared)
  1.1237 +	test "$build_libtool_libs" != yes && \
  1.1238 +	  func_fatal_configuration "can not build a shared library"
  1.1239 +	build_old_libs=no
  1.1240 +	continue
  1.1241 +	;;
  1.1242 +
  1.1243 +      -static)
  1.1244 +	build_libtool_libs=no
  1.1245 +	build_old_libs=yes
  1.1246 +	continue
  1.1247 +	;;
  1.1248 +
  1.1249 +      -prefer-pic)
  1.1250 +	pic_mode=yes
  1.1251 +	continue
  1.1252 +	;;
  1.1253 +
  1.1254 +      -prefer-non-pic)
  1.1255 +	pic_mode=no
  1.1256 +	continue
  1.1257 +	;;
  1.1258 +      esac
  1.1259 +    done
  1.1260 +
  1.1261 +    func_quote_for_eval "$libobj"
  1.1262 +    test "X$libobj" != "X$func_quote_for_eval_result" \
  1.1263 +      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
  1.1264 +      && func_warning "libobj name \`$libobj' may not contain shell special characters."
  1.1265 +    func_dirname_and_basename "$obj" "/" ""
  1.1266 +    objname="$func_basename_result"
  1.1267 +    xdir="$func_dirname_result"
  1.1268 +    lobj=${xdir}$objdir/$objname
  1.1269 +
  1.1270 +    test -z "$base_compile" && \
  1.1271 +      func_fatal_help "you must specify a compilation command"
  1.1272 +
  1.1273 +    # Delete any leftover library objects.
  1.1274 +    if test "$build_old_libs" = yes; then
  1.1275 +      removelist="$obj $lobj $libobj ${libobj}T"
  1.1276 +    else
  1.1277 +      removelist="$lobj $libobj ${libobj}T"
  1.1278 +    fi
  1.1279 +
  1.1280 +    # On Cygwin there's no "real" PIC flag so we must build both object types
  1.1281 +    case $host_os in
  1.1282 +    cygwin* | mingw* | pw32* | os2* | cegcc*)
  1.1283 +      pic_mode=default
  1.1284 +      ;;
  1.1285 +    esac
  1.1286 +    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  1.1287 +      # non-PIC code in shared libraries is not supported
  1.1288 +      pic_mode=default
  1.1289 +    fi
  1.1290 +
  1.1291 +    # Calculate the filename of the output object if compiler does
  1.1292 +    # not support -o with -c
  1.1293 +    if test "$compiler_c_o" = no; then
  1.1294 +      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  1.1295 +      lockfile="$output_obj.lock"
  1.1296 +    else
  1.1297 +      output_obj=
  1.1298 +      need_locks=no
  1.1299 +      lockfile=
  1.1300 +    fi
  1.1301 +
  1.1302 +    # Lock this critical section if it is needed
  1.1303 +    # We use this script file to make the link, it avoids creating a new file
  1.1304 +    if test "$need_locks" = yes; then
  1.1305 +      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  1.1306 +	func_echo "Waiting for $lockfile to be removed"
  1.1307 +	sleep 2
  1.1308 +      done
  1.1309 +    elif test "$need_locks" = warn; then
  1.1310 +      if test -f "$lockfile"; then
  1.1311 +	$ECHO "\
  1.1312 +*** ERROR, $lockfile exists and contains:
  1.1313 +`cat $lockfile 2>/dev/null`
  1.1314 +
  1.1315 +This indicates that another process is trying to use the same
  1.1316 +temporary object file, and libtool could not work around it because
  1.1317 +your compiler does not support \`-c' and \`-o' together.  If you
  1.1318 +repeat this compilation, it may succeed, by chance, but you had better
  1.1319 +avoid parallel builds (make -j) in this platform, or get a better
  1.1320 +compiler."
  1.1321 +
  1.1322 +	$opt_dry_run || $RM $removelist
  1.1323 +	exit $EXIT_FAILURE
  1.1324 +      fi
  1.1325 +      removelist="$removelist $output_obj"
  1.1326 +      $ECHO "$srcfile" > "$lockfile"
  1.1327 +    fi
  1.1328 +
  1.1329 +    $opt_dry_run || $RM $removelist
  1.1330 +    removelist="$removelist $lockfile"
  1.1331 +    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  1.1332 +
  1.1333 +    if test -n "$fix_srcfile_path"; then
  1.1334 +      eval srcfile=\"$fix_srcfile_path\"
  1.1335 +    fi
  1.1336 +    func_quote_for_eval "$srcfile"
  1.1337 +    qsrcfile=$func_quote_for_eval_result
  1.1338 +
  1.1339 +    # Only build a PIC object if we are building libtool libraries.
  1.1340 +    if test "$build_libtool_libs" = yes; then
  1.1341 +      # Without this assignment, base_compile gets emptied.
  1.1342 +      fbsd_hideous_sh_bug=$base_compile
  1.1343 +
  1.1344 +      if test "$pic_mode" != no; then
  1.1345 +	command="$base_compile $qsrcfile $pic_flag"
  1.1346 +      else
  1.1347 +	# Don't build PIC code
  1.1348 +	command="$base_compile $qsrcfile"
  1.1349 +      fi
  1.1350 +
  1.1351 +      func_mkdir_p "$xdir$objdir"
  1.1352 +
  1.1353 +      if test -z "$output_obj"; then
  1.1354 +	# Place PIC objects in $objdir
  1.1355 +	command="$command -o $lobj"
  1.1356 +      fi
  1.1357 +
  1.1358 +      func_show_eval_locale "$command"	\
  1.1359 +          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  1.1360 +
  1.1361 +      if test "$need_locks" = warn &&
  1.1362 +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1.1363 +	$ECHO "\
  1.1364 +*** ERROR, $lockfile contains:
  1.1365 +`cat $lockfile 2>/dev/null`
  1.1366 +
  1.1367 +but it should contain:
  1.1368 +$srcfile
  1.1369 +
  1.1370 +This indicates that another process is trying to use the same
  1.1371 +temporary object file, and libtool could not work around it because
  1.1372 +your compiler does not support \`-c' and \`-o' together.  If you
  1.1373 +repeat this compilation, it may succeed, by chance, but you had better
  1.1374 +avoid parallel builds (make -j) in this platform, or get a better
  1.1375 +compiler."
  1.1376 +
  1.1377 +	$opt_dry_run || $RM $removelist
  1.1378 +	exit $EXIT_FAILURE
  1.1379 +      fi
  1.1380 +
  1.1381 +      # Just move the object if needed, then go on to compile the next one
  1.1382 +      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  1.1383 +	func_show_eval '$MV "$output_obj" "$lobj"' \
  1.1384 +	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1.1385 +      fi
  1.1386 +
  1.1387 +      # Allow error messages only from the first compilation.
  1.1388 +      if test "$suppress_opt" = yes; then
  1.1389 +	suppress_output=' >/dev/null 2>&1'
  1.1390 +      fi
  1.1391 +    fi
  1.1392 +
  1.1393 +    # Only build a position-dependent object if we build old libraries.
  1.1394 +    if test "$build_old_libs" = yes; then
  1.1395 +      if test "$pic_mode" != yes; then
  1.1396 +	# Don't build PIC code
  1.1397 +	command="$base_compile $qsrcfile$pie_flag"
  1.1398 +      else
  1.1399 +	command="$base_compile $qsrcfile $pic_flag"
  1.1400 +      fi
  1.1401 +      if test "$compiler_c_o" = yes; then
  1.1402 +	command="$command -o $obj"
  1.1403 +      fi
  1.1404 +
  1.1405 +      # Suppress compiler output if we already did a PIC compilation.
  1.1406 +      command="$command$suppress_output"
  1.1407 +      func_show_eval_locale "$command" \
  1.1408 +        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  1.1409 +
  1.1410 +      if test "$need_locks" = warn &&
  1.1411 +	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1.1412 +	$ECHO "\
  1.1413 +*** ERROR, $lockfile contains:
  1.1414 +`cat $lockfile 2>/dev/null`
  1.1415 +
  1.1416 +but it should contain:
  1.1417 +$srcfile
  1.1418 +
  1.1419 +This indicates that another process is trying to use the same
  1.1420 +temporary object file, and libtool could not work around it because
  1.1421 +your compiler does not support \`-c' and \`-o' together.  If you
  1.1422 +repeat this compilation, it may succeed, by chance, but you had better
  1.1423 +avoid parallel builds (make -j) in this platform, or get a better
  1.1424 +compiler."
  1.1425 +
  1.1426 +	$opt_dry_run || $RM $removelist
  1.1427 +	exit $EXIT_FAILURE
  1.1428 +      fi
  1.1429 +
  1.1430 +      # Just move the object if needed
  1.1431 +      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  1.1432 +	func_show_eval '$MV "$output_obj" "$obj"' \
  1.1433 +	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1.1434 +      fi
  1.1435 +    fi
  1.1436 +
  1.1437 +    $opt_dry_run || {
  1.1438 +      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  1.1439 +
  1.1440 +      # Unlock the critical section if it was locked
  1.1441 +      if test "$need_locks" != no; then
  1.1442 +	removelist=$lockfile
  1.1443 +        $RM "$lockfile"
  1.1444 +      fi
  1.1445 +    }
  1.1446 +
  1.1447 +    exit $EXIT_SUCCESS
  1.1448 +}
  1.1449 +
  1.1450 +$opt_help || {
  1.1451 +test "$mode" = compile && func_mode_compile ${1+"$@"}
  1.1452 +}
  1.1453 +
  1.1454 +func_mode_help ()
  1.1455 +{
  1.1456 +    # We need to display help for each of the modes.
  1.1457 +    case $mode in
  1.1458 +      "")
  1.1459 +        # Generic help is extracted from the usage comments
  1.1460 +        # at the start of this file.
  1.1461 +        func_help
  1.1462 +        ;;
  1.1463 +
  1.1464 +      clean)
  1.1465 +        $ECHO \
  1.1466 +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  1.1467 +
  1.1468 +Remove files from the build directory.
  1.1469 +
  1.1470 +RM is the name of the program to use to delete files associated with each FILE
  1.1471 +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
  1.1472 +to RM.
  1.1473 +
  1.1474 +If FILE is a libtool library, object or program, all the files associated
  1.1475 +with it are deleted. Otherwise, only FILE itself is deleted using RM."
  1.1476 +        ;;
  1.1477 +
  1.1478 +      compile)
  1.1479 +      $ECHO \
  1.1480 +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  1.1481 +
  1.1482 +Compile a source file into a libtool library object.
  1.1483 +
  1.1484 +This mode accepts the following additional options:
  1.1485 +
  1.1486 +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  1.1487 +  -no-suppress      do not suppress compiler output for multiple passes
  1.1488 +  -prefer-pic       try to building PIC objects only
  1.1489 +  -prefer-non-pic   try to building non-PIC objects only
  1.1490 +  -shared           do not build a \`.o' file suitable for static linking
  1.1491 +  -static           only build a \`.o' file suitable for static linking
  1.1492 +
  1.1493 +COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  1.1494 +from the given SOURCEFILE.
  1.1495 +
  1.1496 +The output file name is determined by removing the directory component from
  1.1497 +SOURCEFILE, then substituting the C source code suffix \`.c' with the
  1.1498 +library object suffix, \`.lo'."
  1.1499 +        ;;
  1.1500 +
  1.1501 +      execute)
  1.1502 +        $ECHO \
  1.1503 +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  1.1504 +
  1.1505 +Automatically set library path, then run a program.
  1.1506 +
  1.1507 +This mode accepts the following additional options:
  1.1508 +
  1.1509 +  -dlopen FILE      add the directory containing FILE to the library path
  1.1510 +
  1.1511 +This mode sets the library path environment variable according to \`-dlopen'
  1.1512 +flags.
  1.1513 +
  1.1514 +If any of the ARGS are libtool executable wrappers, then they are translated
  1.1515 +into their corresponding uninstalled binary, and any of their required library
  1.1516 +directories are added to the library path.
  1.1517 +
  1.1518 +Then, COMMAND is executed, with ARGS as arguments."
  1.1519 +        ;;
  1.1520 +
  1.1521 +      finish)
  1.1522 +        $ECHO \
  1.1523 +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  1.1524 +
  1.1525 +Complete the installation of libtool libraries.
  1.1526 +
  1.1527 +Each LIBDIR is a directory that contains libtool libraries.
  1.1528 +
  1.1529 +The commands that this mode executes may require superuser privileges.  Use
  1.1530 +the \`--dry-run' option if you just want to see what would be executed."
  1.1531 +        ;;
  1.1532 +
  1.1533 +      install)
  1.1534 +        $ECHO \
  1.1535 +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  1.1536 +
  1.1537 +Install executables or libraries.
  1.1538 +
  1.1539 +INSTALL-COMMAND is the installation command.  The first component should be
  1.1540 +either the \`install' or \`cp' program.
  1.1541 +
  1.1542 +The following components of INSTALL-COMMAND are treated specially:
  1.1543 +
  1.1544 +  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
  1.1545 +
  1.1546 +The rest of the components are interpreted as arguments to that command (only
  1.1547 +BSD-compatible install options are recognized)."
  1.1548 +        ;;
  1.1549 +
  1.1550 +      link)
  1.1551 +        $ECHO \
  1.1552 +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  1.1553 +
  1.1554 +Link object files or libraries together to form another library, or to
  1.1555 +create an executable program.
  1.1556 +
  1.1557 +LINK-COMMAND is a command using the C compiler that you would use to create
  1.1558 +a program from several object files.
  1.1559 +
  1.1560 +The following components of LINK-COMMAND are treated specially:
  1.1561 +
  1.1562 +  -all-static       do not do any dynamic linking at all
  1.1563 +  -avoid-version    do not add a version suffix if possible
  1.1564 +  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  1.1565 +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  1.1566 +  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  1.1567 +  -export-symbols SYMFILE
  1.1568 +                    try to export only the symbols listed in SYMFILE
  1.1569 +  -export-symbols-regex REGEX
  1.1570 +                    try to export only the symbols matching REGEX
  1.1571 +  -LLIBDIR          search LIBDIR for required installed libraries
  1.1572 +  -lNAME            OUTPUT-FILE requires the installed library libNAME
  1.1573 +  -module           build a library that can dlopened
  1.1574 +  -no-fast-install  disable the fast-install mode
  1.1575 +  -no-install       link a not-installable executable
  1.1576 +  -no-undefined     declare that a library does not refer to external symbols
  1.1577 +  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  1.1578 +  -objectlist FILE  Use a list of object files found in FILE to specify objects
  1.1579 +  -precious-files-regex REGEX
  1.1580 +                    don't remove output files matching REGEX
  1.1581 +  -release RELEASE  specify package release information
  1.1582 +  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  1.1583 +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  1.1584 +  -shared           only do dynamic linking of libtool libraries
  1.1585 +  -shrext SUFFIX    override the standard shared library file extension
  1.1586 +  -static           do not do any dynamic linking of uninstalled libtool libraries
  1.1587 +  -static-libtool-libs
  1.1588 +                    do not do any dynamic linking of libtool libraries
  1.1589 +  -version-info CURRENT[:REVISION[:AGE]]
  1.1590 +                    specify library version info [each variable defaults to 0]
  1.1591 +  -weak LIBNAME     declare that the target provides the LIBNAME interface
  1.1592 +
  1.1593 +All other options (arguments beginning with \`-') are ignored.
  1.1594 +
  1.1595 +Every other argument is treated as a filename.  Files ending in \`.la' are
  1.1596 +treated as uninstalled libtool libraries, other files are standard or library
  1.1597 +object files.
  1.1598 +
  1.1599 +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  1.1600 +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  1.1601 +required, except when creating a convenience library.
  1.1602 +
  1.1603 +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  1.1604 +using \`ar' and \`ranlib', or on Windows using \`lib'.
  1.1605 +
  1.1606 +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  1.1607 +is created, otherwise an executable program is created."
  1.1608 +        ;;
  1.1609 +
  1.1610 +      uninstall)
  1.1611 +        $ECHO \
  1.1612 +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  1.1613 +
  1.1614 +Remove libraries from an installation directory.
  1.1615 +
  1.1616 +RM is the name of the program to use to delete files associated with each FILE
  1.1617 +(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
  1.1618 +to RM.
  1.1619 +
  1.1620 +If FILE is a libtool library, all the files associated with it are deleted.
  1.1621 +Otherwise, only FILE itself is deleted using RM."
  1.1622 +        ;;
  1.1623 +
  1.1624 +      *)
  1.1625 +        func_fatal_help "invalid operation mode \`$mode'"
  1.1626 +        ;;
  1.1627 +    esac
  1.1628 +
  1.1629 +    $ECHO
  1.1630 +    $ECHO "Try \`$progname --help' for more information about other modes."
  1.1631 +
  1.1632 +    exit $?
  1.1633 +}
  1.1634 +
  1.1635 +  # Now that we've collected a possible --mode arg, show help if necessary
  1.1636 +  $opt_help && func_mode_help
  1.1637 +
  1.1638 +
  1.1639 +# func_mode_execute arg...
  1.1640 +func_mode_execute ()
  1.1641 +{
  1.1642 +    $opt_debug
  1.1643 +    # The first argument is the command name.
  1.1644 +    cmd="$nonopt"
  1.1645 +    test -z "$cmd" && \
  1.1646 +      func_fatal_help "you must specify a COMMAND"
  1.1647 +
  1.1648 +    # Handle -dlopen flags immediately.
  1.1649 +    for file in $execute_dlfiles; do
  1.1650 +      test -f "$file" \
  1.1651 +	|| func_fatal_help "\`$file' is not a file"
  1.1652 +
  1.1653 +      dir=
  1.1654 +      case $file in
  1.1655 +      *.la)
  1.1656 +	# Check to see that this really is a libtool archive.
  1.1657 +	func_lalib_unsafe_p "$file" \
  1.1658 +	  || func_fatal_help "\`$lib' is not a valid libtool archive"
  1.1659 +
  1.1660 +	# Read the libtool library.
  1.1661 +	dlname=
  1.1662 +	library_names=
  1.1663 +	func_source "$file"
  1.1664 +
  1.1665 +	# Skip this library if it cannot be dlopened.
  1.1666 +	if test -z "$dlname"; then
  1.1667 +	  # Warn if it was a shared library.
  1.1668 +	  test -n "$library_names" && \
  1.1669 +	    func_warning "\`$file' was not linked with \`-export-dynamic'"
  1.1670 +	  continue
  1.1671 +	fi
  1.1672 +
  1.1673 +	func_dirname "$file" "" "."
  1.1674 +	dir="$func_dirname_result"
  1.1675 +
  1.1676 +	if test -f "$dir/$objdir/$dlname"; then
  1.1677 +	  dir="$dir/$objdir"
  1.1678 +	else
  1.1679 +	  if test ! -f "$dir/$dlname"; then
  1.1680 +	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
  1.1681 +	  fi
  1.1682 +	fi
  1.1683 +	;;
  1.1684 +
  1.1685 +      *.lo)
  1.1686 +	# Just add the directory containing the .lo file.
  1.1687 +	func_dirname "$file" "" "."
  1.1688 +	dir="$func_dirname_result"
  1.1689 +	;;
  1.1690 +
  1.1691 +      *)
  1.1692 +	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
  1.1693 +	continue
  1.1694 +	;;
  1.1695 +      esac
  1.1696 +
  1.1697 +      # Get the absolute pathname.
  1.1698 +      absdir=`cd "$dir" && pwd`
  1.1699 +      test -n "$absdir" && dir="$absdir"
  1.1700 +
  1.1701 +      # Now add the directory to shlibpath_var.
  1.1702 +      if eval "test -z \"\$$shlibpath_var\""; then
  1.1703 +	eval "$shlibpath_var=\"\$dir\""
  1.1704 +      else
  1.1705 +	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  1.1706 +      fi
  1.1707 +    done
  1.1708 +
  1.1709 +    # This variable tells wrapper scripts just to set shlibpath_var
  1.1710 +    # rather than running their programs.
  1.1711 +    libtool_execute_magic="$magic"
  1.1712 +
  1.1713 +    # Check if any of the arguments is a wrapper script.
  1.1714 +    args=
  1.1715 +    for file
  1.1716 +    do
  1.1717 +      case $file in
  1.1718 +      -*) ;;
  1.1719 +      *)
  1.1720 +	# Do a test to see if this is really a libtool program.
  1.1721 +	if func_ltwrapper_script_p "$file"; then
  1.1722 +	  func_source "$file"
  1.1723 +	  # Transform arg to wrapped name.
  1.1724 +	  file="$progdir/$program"
  1.1725 +	elif func_ltwrapper_executable_p "$file"; then
  1.1726 +	  func_ltwrapper_scriptname "$file"
  1.1727 +	  func_source "$func_ltwrapper_scriptname_result"
  1.1728 +	  # Transform arg to wrapped name.
  1.1729 +	  file="$progdir/$program"
  1.1730 +	fi
  1.1731 +	;;
  1.1732 +      esac
  1.1733 +      # Quote arguments (to preserve shell metacharacters).
  1.1734 +      func_quote_for_eval "$file"
  1.1735 +      args="$args $func_quote_for_eval_result"
  1.1736 +    done
  1.1737 +
  1.1738 +    if test "X$opt_dry_run" = Xfalse; then
  1.1739 +      if test -n "$shlibpath_var"; then
  1.1740 +	# Export the shlibpath_var.
  1.1741 +	eval "export $shlibpath_var"
  1.1742 +      fi
  1.1743 +
  1.1744 +      # Restore saved environment variables
  1.1745 +      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  1.1746 +      do
  1.1747 +	eval "if test \"\${save_$lt_var+set}\" = set; then
  1.1748 +                $lt_var=\$save_$lt_var; export $lt_var
  1.1749 +	      else
  1.1750 +		$lt_unset $lt_var
  1.1751 +	      fi"
  1.1752 +      done
  1.1753 +
  1.1754 +      # Now prepare to actually exec the command.
  1.1755 +      exec_cmd="\$cmd$args"
  1.1756 +    else
  1.1757 +      # Display what would be done.
  1.1758 +      if test -n "$shlibpath_var"; then
  1.1759 +	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  1.1760 +	$ECHO "export $shlibpath_var"
  1.1761 +      fi
  1.1762 +      $ECHO "$cmd$args"
  1.1763 +      exit $EXIT_SUCCESS
  1.1764 +    fi
  1.1765 +}
  1.1766 +
  1.1767 +test "$mode" = execute && func_mode_execute ${1+"$@"}
  1.1768 +
  1.1769 +
  1.1770 +# func_mode_finish arg...
  1.1771 +func_mode_finish ()
  1.1772 +{
  1.1773 +    $opt_debug
  1.1774 +    libdirs="$nonopt"
  1.1775 +    admincmds=
  1.1776 +
  1.1777 +    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  1.1778 +      for dir
  1.1779 +      do
  1.1780 +	libdirs="$libdirs $dir"
  1.1781 +      done
  1.1782 +
  1.1783 +      for libdir in $libdirs; do
  1.1784 +	if test -n "$finish_cmds"; then
  1.1785 +	  # Do each command in the finish commands.
  1.1786 +	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  1.1787 +'"$cmd"'"'
  1.1788 +	fi
  1.1789 +	if test -n "$finish_eval"; then
  1.1790 +	  # Do the single finish_eval.
  1.1791 +	  eval cmds=\"$finish_eval\"
  1.1792 +	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
  1.1793 +       $cmds"
  1.1794 +	fi
  1.1795 +      done
  1.1796 +    fi
  1.1797 +
  1.1798 +    # Exit here if they wanted silent mode.
  1.1799 +    $opt_silent && exit $EXIT_SUCCESS
  1.1800 +
  1.1801 +    $ECHO "X----------------------------------------------------------------------" | $Xsed
  1.1802 +    $ECHO "Libraries have been installed in:"
  1.1803 +    for libdir in $libdirs; do
  1.1804 +      $ECHO "   $libdir"
  1.1805 +    done
  1.1806 +    $ECHO
  1.1807 +    $ECHO "If you ever happen to want to link against installed libraries"
  1.1808 +    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
  1.1809 +    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
  1.1810 +    $ECHO "flag during linking and do at least one of the following:"
  1.1811 +    if test -n "$shlibpath_var"; then
  1.1812 +      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  1.1813 +      $ECHO "     during execution"
  1.1814 +    fi
  1.1815 +    if test -n "$runpath_var"; then
  1.1816 +      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
  1.1817 +      $ECHO "     during linking"
  1.1818 +    fi
  1.1819 +    if test -n "$hardcode_libdir_flag_spec"; then
  1.1820 +      libdir=LIBDIR
  1.1821 +      eval flag=\"$hardcode_libdir_flag_spec\"
  1.1822 +
  1.1823 +      $ECHO "   - use the \`$flag' linker flag"
  1.1824 +    fi
  1.1825 +    if test -n "$admincmds"; then
  1.1826 +      $ECHO "   - have your system administrator run these commands:$admincmds"
  1.1827 +    fi
  1.1828 +    if test -f /etc/ld.so.conf; then
  1.1829 +      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  1.1830 +    fi
  1.1831 +    $ECHO
  1.1832 +
  1.1833 +    $ECHO "See any operating system documentation about shared libraries for"
  1.1834 +    case $host in
  1.1835 +      solaris2.[6789]|solaris2.1[0-9])
  1.1836 +        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  1.1837 +	$ECHO "pages."
  1.1838 +	;;
  1.1839 +      *)
  1.1840 +        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
  1.1841 +        ;;
  1.1842 +    esac
  1.1843 +    $ECHO "X----------------------------------------------------------------------" | $Xsed
  1.1844 +    exit $EXIT_SUCCESS
  1.1845 +}
  1.1846 +
  1.1847 +test "$mode" = finish && func_mode_finish ${1+"$@"}
  1.1848 +
  1.1849 +
  1.1850 +# func_mode_install arg...
  1.1851 +func_mode_install ()
  1.1852 +{
  1.1853 +    $opt_debug
  1.1854 +    # There may be an optional sh(1) argument at the beginning of
  1.1855 +    # install_prog (especially on Windows NT).
  1.1856 +    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  1.1857 +       # Allow the use of GNU shtool's install command.
  1.1858 +       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
  1.1859 +      # Aesthetically quote it.
  1.1860 +      func_quote_for_eval "$nonopt"
  1.1861 +      install_prog="$func_quote_for_eval_result "
  1.1862 +      arg=$1
  1.1863 +      shift
  1.1864 +    else
  1.1865 +      install_prog=
  1.1866 +      arg=$nonopt
  1.1867 +    fi
  1.1868 +
  1.1869 +    # The real first argument should be the name of the installation program.
  1.1870 +    # Aesthetically quote it.
  1.1871 +    func_quote_for_eval "$arg"
  1.1872 +    install_prog="$install_prog$func_quote_for_eval_result"
  1.1873 +
  1.1874 +    # We need to accept at least all the BSD install flags.
  1.1875 +    dest=
  1.1876 +    files=
  1.1877 +    opts=
  1.1878 +    prev=
  1.1879 +    install_type=
  1.1880 +    isdir=no
  1.1881 +    stripme=
  1.1882 +    for arg
  1.1883 +    do
  1.1884 +      if test -n "$dest"; then
  1.1885 +	files="$files $dest"
  1.1886 +	dest=$arg
  1.1887 +	continue
  1.1888 +      fi
  1.1889 +
  1.1890 +      case $arg in
  1.1891 +      -d) isdir=yes ;;
  1.1892 +      -f)
  1.1893 +	case " $install_prog " in
  1.1894 +	*[\\\ /]cp\ *) ;;
  1.1895 +	*) prev=$arg ;;
  1.1896 +	esac
  1.1897 +	;;
  1.1898 +      -g | -m | -o)
  1.1899 +	prev=$arg
  1.1900 +	;;
  1.1901 +      -s)
  1.1902 +	stripme=" -s"
  1.1903 +	continue
  1.1904 +	;;
  1.1905 +      -*)
  1.1906 +	;;
  1.1907 +      *)
  1.1908 +	# If the previous option needed an argument, then skip it.
  1.1909 +	if test -n "$prev"; then
  1.1910 +	  prev=
  1.1911 +	else
  1.1912 +	  dest=$arg
  1.1913 +	  continue
  1.1914 +	fi
  1.1915 +	;;
  1.1916 +      esac
  1.1917 +
  1.1918 +      # Aesthetically quote the argument.
  1.1919 +      func_quote_for_eval "$arg"
  1.1920 +      install_prog="$install_prog $func_quote_for_eval_result"
  1.1921 +    done
  1.1922 +
  1.1923 +    test -z "$install_prog" && \
  1.1924 +      func_fatal_help "you must specify an install program"
  1.1925 +
  1.1926 +    test -n "$prev" && \
  1.1927 +      func_fatal_help "the \`$prev' option requires an argument"
  1.1928 +
  1.1929 +    if test -z "$files"; then
  1.1930 +      if test -z "$dest"; then
  1.1931 +	func_fatal_help "no file or destination specified"
  1.1932 +      else
  1.1933 +	func_fatal_help "you must specify a destination"
  1.1934 +      fi
  1.1935 +    fi
  1.1936 +
  1.1937 +    # Strip any trailing slash from the destination.
  1.1938 +    func_stripname '' '/' "$dest"
  1.1939 +    dest=$func_stripname_result
  1.1940 +
  1.1941 +    # Check to see that the destination is a directory.
  1.1942 +    test -d "$dest" && isdir=yes
  1.1943 +    if test "$isdir" = yes; then
  1.1944 +      destdir="$dest"
  1.1945 +      destname=
  1.1946 +    else
  1.1947 +      func_dirname_and_basename "$dest" "" "."
  1.1948 +      destdir="$func_dirname_result"
  1.1949 +      destname="$func_basename_result"
  1.1950 +
  1.1951 +      # Not a directory, so check to see that there is only one file specified.
  1.1952 +      set dummy $files; shift
  1.1953 +      test "$#" -gt 1 && \
  1.1954 +	func_fatal_help "\`$dest' is not a directory"
  1.1955 +    fi
  1.1956 +    case $destdir in
  1.1957 +    [\\/]* | [A-Za-z]:[\\/]*) ;;
  1.1958 +    *)
  1.1959 +      for file in $files; do
  1.1960 +	case $file in
  1.1961 +	*.lo) ;;
  1.1962 +	*)
  1.1963 +	  func_fatal_help "\`$destdir' must be an absolute directory name"
  1.1964 +	  ;;
  1.1965 +	esac
  1.1966 +      done
  1.1967 +      ;;
  1.1968 +    esac
  1.1969 +
  1.1970 +    # This variable tells wrapper scripts just to set variables rather
  1.1971 +    # than running their programs.
  1.1972 +    libtool_install_magic="$magic"
  1.1973 +
  1.1974 +    staticlibs=
  1.1975 +    future_libdirs=
  1.1976 +    current_libdirs=
  1.1977 +    for file in $files; do
  1.1978 +
  1.1979 +      # Do each installation.
  1.1980 +      case $file in
  1.1981 +      *.$libext)
  1.1982 +	# Do the static libraries later.
  1.1983 +	staticlibs="$staticlibs $file"
  1.1984 +	;;
  1.1985 +
  1.1986 +      *.la)
  1.1987 +	# Check to see that this really is a libtool archive.
  1.1988 +	func_lalib_unsafe_p "$file" \
  1.1989 +	  || func_fatal_help "\`$file' is not a valid libtool archive"
  1.1990 +
  1.1991 +	library_names=
  1.1992 +	old_library=
  1.1993 +	relink_command=
  1.1994 +	func_source "$file"
  1.1995 +
  1.1996 +	# Add the libdir to current_libdirs if it is the destination.
  1.1997 +	if test "X$destdir" = "X$libdir"; then
  1.1998 +	  case "$current_libdirs " in
  1.1999 +	  *" $libdir "*) ;;
  1.2000 +	  *) current_libdirs="$current_libdirs $libdir" ;;
  1.2001 +	  esac
  1.2002 +	else
  1.2003 +	  # Note the libdir as a future libdir.
  1.2004 +	  case "$future_libdirs " in
  1.2005 +	  *" $libdir "*) ;;
  1.2006 +	  *) future_libdirs="$future_libdirs $libdir" ;;
  1.2007 +	  esac
  1.2008 +	fi
  1.2009 +
  1.2010 +	func_dirname "$file" "/" ""
  1.2011 +	dir="$func_dirname_result"
  1.2012 +	dir="$dir$objdir"
  1.2013 +
  1.2014 +	if test -n "$relink_command"; then
  1.2015 +	  # Determine the prefix the user has applied to our future dir.
  1.2016 +	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
  1.2017 +
  1.2018 +	  # Don't allow the user to place us outside of our expected
  1.2019 +	  # location b/c this prevents finding dependent libraries that
  1.2020 +	  # are installed to the same prefix.
  1.2021 +	  # At present, this check doesn't affect windows .dll's that
  1.2022 +	  # are installed into $libdir/../bin (currently, that works fine)
  1.2023 +	  # but it's something to keep an eye on.
  1.2024 +	  test "$inst_prefix_dir" = "$destdir" && \
  1.2025 +	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
  1.2026 +
  1.2027 +	  if test -n "$inst_prefix_dir"; then
  1.2028 +	    # Stick the inst_prefix_dir data into the link command.
  1.2029 +	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  1.2030 +	  else
  1.2031 +	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
  1.2032 +	  fi
  1.2033 +
  1.2034 +	  func_warning "relinking \`$file'"
  1.2035 +	  func_show_eval "$relink_command" \
  1.2036 +	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
  1.2037 +	fi
  1.2038 +
  1.2039 +	# See the names of the shared library.
  1.2040 +	set dummy $library_names; shift
  1.2041 +	if test -n "$1"; then
  1.2042 +	  realname="$1"
  1.2043 +	  shift
  1.2044 +
  1.2045 +	  srcname="$realname"
  1.2046 +	  test -n "$relink_command" && srcname="$realname"T
  1.2047 +
  1.2048 +	  # Install the shared library and build the symlinks.
  1.2049 +	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
  1.2050 +	      'exit $?'
  1.2051 +	  tstripme="$stripme"
  1.2052 +	  case $host_os in
  1.2053 +	  cygwin* | mingw* | pw32* | cegcc*)
  1.2054 +	    case $realname in
  1.2055 +	    *.dll.a)
  1.2056 +	      tstripme=""
  1.2057 +	      ;;
  1.2058 +	    esac
  1.2059 +	    ;;
  1.2060 +	  esac
  1.2061 +	  if test -n "$tstripme" && test -n "$striplib"; then
  1.2062 +	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
  1.2063 +	  fi
  1.2064 +
  1.2065 +	  if test "$#" -gt 0; then
  1.2066 +	    # Delete the old symlinks, and create new ones.
  1.2067 +	    # Try `ln -sf' first, because the `ln' binary might depend on
  1.2068 +	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
  1.2069 +	    # so we also need to try rm && ln -s.
  1.2070 +	    for linkname
  1.2071 +	    do
  1.2072 +	      test "$linkname" != "$realname" \
  1.2073 +		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  1.2074 +	    done
  1.2075 +	  fi
  1.2076 +
  1.2077 +	  # Do each command in the postinstall commands.
  1.2078 +	  lib="$destdir/$realname"
  1.2079 +	  func_execute_cmds "$postinstall_cmds" 'exit $?'
  1.2080 +	fi
  1.2081 +
  1.2082 +	# Install the pseudo-library for information purposes.
  1.2083 +	func_basename "$file"
  1.2084 +	name="$func_basename_result"
  1.2085 +	instname="$dir/$name"i
  1.2086 +	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  1.2087 +
  1.2088 +	# Maybe install the static library, too.
  1.2089 +	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  1.2090 +	;;
  1.2091 +
  1.2092 +      *.lo)
  1.2093 +	# Install (i.e. copy) a libtool object.
  1.2094 +
  1.2095 +	# Figure out destination file name, if it wasn't already specified.
  1.2096 +	if test -n "$destname"; then
  1.2097 +	  destfile="$destdir/$destname"
  1.2098 +	else
  1.2099 +	  func_basename "$file"
  1.2100 +	  destfile="$func_basename_result"
  1.2101 +	  destfile="$destdir/$destfile"
  1.2102 +	fi
  1.2103 +
  1.2104 +	# Deduce the name of the destination old-style object file.
  1.2105 +	case $destfile in
  1.2106 +	*.lo)
  1.2107 +	  func_lo2o "$destfile"
  1.2108 +	  staticdest=$func_lo2o_result
  1.2109 +	  ;;
  1.2110 +	*.$objext)
  1.2111 +	  staticdest="$destfile"
  1.2112 +	  destfile=
  1.2113 +	  ;;
  1.2114 +	*)
  1.2115 +	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
  1.2116 +	  ;;
  1.2117 +	esac
  1.2118 +
  1.2119 +	# Install the libtool object if requested.
  1.2120 +	test -n "$destfile" && \
  1.2121 +	  func_show_eval "$install_prog $file $destfile" 'exit $?'
  1.2122 +
  1.2123 +	# Install the old object if enabled.
  1.2124 +	if test "$build_old_libs" = yes; then
  1.2125 +	  # Deduce the name of the old-style object file.
  1.2126 +	  func_lo2o "$file"
  1.2127 +	  staticobj=$func_lo2o_result
  1.2128 +	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  1.2129 +	fi
  1.2130 +	exit $EXIT_SUCCESS
  1.2131 +	;;
  1.2132 +
  1.2133 +      *)
  1.2134 +	# Figure out destination file name, if it wasn't already specified.
  1.2135 +	if test -n "$destname"; then
  1.2136 +	  destfile="$destdir/$destname"
  1.2137 +	else
  1.2138 +	  func_basename "$file"
  1.2139 +	  destfile="$func_basename_result"
  1.2140 +	  destfile="$destdir/$destfile"
  1.2141 +	fi
  1.2142 +
  1.2143 +	# If the file is missing, and there is a .exe on the end, strip it
  1.2144 +	# because it is most likely a libtool script we actually want to
  1.2145 +	# install
  1.2146 +	stripped_ext=""
  1.2147 +	case $file in
  1.2148 +	  *.exe)
  1.2149 +	    if test ! -f "$file"; then
  1.2150 +	      func_stripname '' '.exe' "$file"
  1.2151 +	      file=$func_stripname_result
  1.2152 +	      stripped_ext=".exe"
  1.2153 +	    fi
  1.2154 +	    ;;
  1.2155 +	esac
  1.2156 +
  1.2157 +	# Do a test to see if this is really a libtool program.
  1.2158 +	case $host in
  1.2159 +	*cygwin* | *mingw*)
  1.2160 +	    if func_ltwrapper_executable_p "$file"; then
  1.2161 +	      func_ltwrapper_scriptname "$file"
  1.2162 +	      wrapper=$func_ltwrapper_scriptname_result
  1.2163 +	    else
  1.2164 +	      func_stripname '' '.exe' "$file"
  1.2165 +	      wrapper=$func_stripname_result
  1.2166 +	    fi
  1.2167 +	    ;;
  1.2168 +	*)
  1.2169 +	    wrapper=$file
  1.2170 +	    ;;
  1.2171 +	esac
  1.2172 +	if func_ltwrapper_script_p "$wrapper"; then
  1.2173 +	  notinst_deplibs=
  1.2174 +	  relink_command=
  1.2175 +
  1.2176 +	  func_source "$wrapper"
  1.2177 +
  1.2178 +	  # Check the variables that should have been set.
  1.2179 +	  test -z "$generated_by_libtool_version" && \
  1.2180 +	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
  1.2181 +
  1.2182 +	  finalize=yes
  1.2183 +	  for lib in $notinst_deplibs; do
  1.2184 +	    # Check to see that each library is installed.
  1.2185 +	    libdir=
  1.2186 +	    if test -f "$lib"; then
  1.2187 +	      func_source "$lib"
  1.2188 +	    fi
  1.2189 +	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  1.2190 +	    if test -n "$libdir" && test ! -f "$libfile"; then
  1.2191 +	      func_warning "\`$lib' has not been installed in \`$libdir'"
  1.2192 +	      finalize=no
  1.2193 +	    fi
  1.2194 +	  done
  1.2195 +
  1.2196 +	  relink_command=
  1.2197 +	  func_source "$wrapper"
  1.2198 +
  1.2199 +	  outputname=
  1.2200 +	  if test "$fast_install" = no && test -n "$relink_command"; then
  1.2201 +	    $opt_dry_run || {
  1.2202 +	      if test "$finalize" = yes; then
  1.2203 +	        tmpdir=`func_mktempdir`
  1.2204 +		func_basename "$file$stripped_ext"
  1.2205 +		file="$func_basename_result"
  1.2206 +	        outputname="$tmpdir/$file"
  1.2207 +	        # Replace the output file specification.
  1.2208 +	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  1.2209 +
  1.2210 +	        $opt_silent || {
  1.2211 +	          func_quote_for_expand "$relink_command"
  1.2212 +		  eval "func_echo $func_quote_for_expand_result"
  1.2213 +	        }
  1.2214 +	        if eval "$relink_command"; then :
  1.2215 +	          else
  1.2216 +		  func_error "error: relink \`$file' with the above command before installing it"
  1.2217 +		  $opt_dry_run || ${RM}r "$tmpdir"
  1.2218 +		  continue
  1.2219 +	        fi
  1.2220 +	        file="$outputname"
  1.2221 +	      else
  1.2222 +	        func_warning "cannot relink \`$file'"
  1.2223 +	      fi
  1.2224 +	    }
  1.2225 +	  else
  1.2226 +	    # Install the binary that we compiled earlier.
  1.2227 +	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  1.2228 +	  fi
  1.2229 +	fi
  1.2230 +
  1.2231 +	# remove .exe since cygwin /usr/bin/install will append another
  1.2232 +	# one anyway
  1.2233 +	case $install_prog,$host in
  1.2234 +	*/usr/bin/install*,*cygwin*)
  1.2235 +	  case $file:$destfile in
  1.2236 +	  *.exe:*.exe)
  1.2237 +	    # this is ok
  1.2238 +	    ;;
  1.2239 +	  *.exe:*)
  1.2240 +	    destfile=$destfile.exe
  1.2241 +	    ;;
  1.2242 +	  *:*.exe)
  1.2243 +	    func_stripname '' '.exe' "$destfile"
  1.2244 +	    destfile=$func_stripname_result
  1.2245 +	    ;;
  1.2246 +	  esac
  1.2247 +	  ;;
  1.2248 +	esac
  1.2249 +	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  1.2250 +	$opt_dry_run || if test -n "$outputname"; then
  1.2251 +	  ${RM}r "$tmpdir"
  1.2252 +	fi
  1.2253 +	;;
  1.2254 +      esac
  1.2255 +    done
  1.2256 +
  1.2257 +    for file in $staticlibs; do
  1.2258 +      func_basename "$file"
  1.2259 +      name="$func_basename_result"
  1.2260 +
  1.2261 +      # Set up the ranlib parameters.
  1.2262 +      oldlib="$destdir/$name"
  1.2263 +
  1.2264 +      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  1.2265 +
  1.2266 +      if test -n "$stripme" && test -n "$old_striplib"; then
  1.2267 +	func_show_eval "$old_striplib $oldlib" 'exit $?'
  1.2268 +      fi
  1.2269 +
  1.2270 +      # Do each command in the postinstall commands.
  1.2271 +      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  1.2272 +    done
  1.2273 +
  1.2274 +    test -n "$future_libdirs" && \
  1.2275 +      func_warning "remember to run \`$progname --finish$future_libdirs'"
  1.2276 +
  1.2277 +    if test -n "$current_libdirs"; then
  1.2278 +      # Maybe just do a dry run.
  1.2279 +      $opt_dry_run && current_libdirs=" -n$current_libdirs"
  1.2280 +      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  1.2281 +    else
  1.2282 +      exit $EXIT_SUCCESS
  1.2283 +    fi
  1.2284 +}
  1.2285 +
  1.2286 +test "$mode" = install && func_mode_install ${1+"$@"}
  1.2287 +
  1.2288 +
  1.2289 +# func_generate_dlsyms outputname originator pic_p
  1.2290 +# Extract symbols from dlprefiles and create ${outputname}S.o with
  1.2291 +# a dlpreopen symbol table.
  1.2292 +func_generate_dlsyms ()
  1.2293 +{
  1.2294 +    $opt_debug
  1.2295 +    my_outputname="$1"
  1.2296 +    my_originator="$2"
  1.2297 +    my_pic_p="${3-no}"
  1.2298 +    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
  1.2299 +    my_dlsyms=
  1.2300 +
  1.2301 +    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.2302 +      if test -n "$NM" && test -n "$global_symbol_pipe"; then
  1.2303 +	my_dlsyms="${my_outputname}S.c"
  1.2304 +      else
  1.2305 +	func_error "not configured to extract global symbols from dlpreopened files"
  1.2306 +      fi
  1.2307 +    fi
  1.2308 +
  1.2309 +    if test -n "$my_dlsyms"; then
  1.2310 +      case $my_dlsyms in
  1.2311 +      "") ;;
  1.2312 +      *.c)
  1.2313 +	# Discover the nlist of each of the dlfiles.
  1.2314 +	nlist="$output_objdir/${my_outputname}.nm"
  1.2315 +
  1.2316 +	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  1.2317 +
  1.2318 +	# Parse the name list into a source file.
  1.2319 +	func_verbose "creating $output_objdir/$my_dlsyms"
  1.2320 +
  1.2321 +	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  1.2322 +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
  1.2323 +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
  1.2324 +
  1.2325 +#ifdef __cplusplus
  1.2326 +extern \"C\" {
  1.2327 +#endif
  1.2328 +
  1.2329 +/* External symbol declarations for the compiler. */\
  1.2330 +"
  1.2331 +
  1.2332 +	if test "$dlself" = yes; then
  1.2333 +	  func_verbose "generating symbol list for \`$output'"
  1.2334 +
  1.2335 +	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  1.2336 +
  1.2337 +	  # Add our own program objects to the symbol list.
  1.2338 +	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.2339 +	  for progfile in $progfiles; do
  1.2340 +	    func_verbose "extracting global C symbols from \`$progfile'"
  1.2341 +	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
  1.2342 +	  done
  1.2343 +
  1.2344 +	  if test -n "$exclude_expsyms"; then
  1.2345 +	    $opt_dry_run || {
  1.2346 +	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  1.2347 +	      eval '$MV "$nlist"T "$nlist"'
  1.2348 +	    }
  1.2349 +	  fi
  1.2350 +
  1.2351 +	  if test -n "$export_symbols_regex"; then
  1.2352 +	    $opt_dry_run || {
  1.2353 +	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  1.2354 +	      eval '$MV "$nlist"T "$nlist"'
  1.2355 +	    }
  1.2356 +	  fi
  1.2357 +
  1.2358 +	  # Prepare the list of exported symbols
  1.2359 +	  if test -z "$export_symbols"; then
  1.2360 +	    export_symbols="$output_objdir/$outputname.exp"
  1.2361 +	    $opt_dry_run || {
  1.2362 +	      $RM $export_symbols
  1.2363 +	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  1.2364 +	      case $host in
  1.2365 +	      *cygwin* | *mingw* | *cegcc* )
  1.2366 +                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  1.2367 +                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  1.2368 +	        ;;
  1.2369 +	      esac
  1.2370 +	    }
  1.2371 +	  else
  1.2372 +	    $opt_dry_run || {
  1.2373 +	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  1.2374 +	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  1.2375 +	      eval '$MV "$nlist"T "$nlist"'
  1.2376 +	      case $host in
  1.2377 +	        *cygwin | *mingw* | *cegcc* )
  1.2378 +	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  1.2379 +	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  1.2380 +	          ;;
  1.2381 +	      esac
  1.2382 +	    }
  1.2383 +	  fi
  1.2384 +	fi
  1.2385 +
  1.2386 +	for dlprefile in $dlprefiles; do
  1.2387 +	  func_verbose "extracting global C symbols from \`$dlprefile'"
  1.2388 +	  func_basename "$dlprefile"
  1.2389 +	  name="$func_basename_result"
  1.2390 +	  $opt_dry_run || {
  1.2391 +	    eval '$ECHO ": $name " >> "$nlist"'
  1.2392 +	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  1.2393 +	  }
  1.2394 +	done
  1.2395 +
  1.2396 +	$opt_dry_run || {
  1.2397 +	  # Make sure we have at least an empty file.
  1.2398 +	  test -f "$nlist" || : > "$nlist"
  1.2399 +
  1.2400 +	  if test -n "$exclude_expsyms"; then
  1.2401 +	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  1.2402 +	    $MV "$nlist"T "$nlist"
  1.2403 +	  fi
  1.2404 +
  1.2405 +	  # Try sorting and uniquifying the output.
  1.2406 +	  if $GREP -v "^: " < "$nlist" |
  1.2407 +	      if sort -k 3 </dev/null >/dev/null 2>&1; then
  1.2408 +		sort -k 3
  1.2409 +	      else
  1.2410 +		sort +2
  1.2411 +	      fi |
  1.2412 +	      uniq > "$nlist"S; then
  1.2413 +	    :
  1.2414 +	  else
  1.2415 +	    $GREP -v "^: " < "$nlist" > "$nlist"S
  1.2416 +	  fi
  1.2417 +
  1.2418 +	  if test -f "$nlist"S; then
  1.2419 +	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  1.2420 +	  else
  1.2421 +	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
  1.2422 +	  fi
  1.2423 +
  1.2424 +	  $ECHO >> "$output_objdir/$my_dlsyms" "\
  1.2425 +
  1.2426 +/* The mapping between symbol names and symbols.  */
  1.2427 +typedef struct {
  1.2428 +  const char *name;
  1.2429 +  void *address;
  1.2430 +} lt_dlsymlist;
  1.2431 +"
  1.2432 +	  case $host in
  1.2433 +	  *cygwin* | *mingw* | *cegcc* )
  1.2434 +	    $ECHO >> "$output_objdir/$my_dlsyms" "\
  1.2435 +/* DATA imports from DLLs on WIN32 con't be const, because
  1.2436 +   runtime relocations are performed -- see ld's documentation
  1.2437 +   on pseudo-relocs.  */"
  1.2438 +	    lt_dlsym_const= ;;
  1.2439 +	  *osf5*)
  1.2440 +	    echo >> "$output_objdir/$my_dlsyms" "\
  1.2441 +/* This system does not cope well with relocations in const data */"
  1.2442 +	    lt_dlsym_const= ;;
  1.2443 +	  *)
  1.2444 +	    lt_dlsym_const=const ;;
  1.2445 +	  esac
  1.2446 +
  1.2447 +	  $ECHO >> "$output_objdir/$my_dlsyms" "\
  1.2448 +extern $lt_dlsym_const lt_dlsymlist
  1.2449 +lt_${my_prefix}_LTX_preloaded_symbols[];
  1.2450 +$lt_dlsym_const lt_dlsymlist
  1.2451 +lt_${my_prefix}_LTX_preloaded_symbols[] =
  1.2452 +{\
  1.2453 +  { \"$my_originator\", (void *) 0 },"
  1.2454 +
  1.2455 +	  case $need_lib_prefix in
  1.2456 +	  no)
  1.2457 +	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  1.2458 +	    ;;
  1.2459 +	  *)
  1.2460 +	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  1.2461 +	    ;;
  1.2462 +	  esac
  1.2463 +	  $ECHO >> "$output_objdir/$my_dlsyms" "\
  1.2464 +  {0, (void *) 0}
  1.2465 +};
  1.2466 +
  1.2467 +/* This works around a problem in FreeBSD linker */
  1.2468 +#ifdef FREEBSD_WORKAROUND
  1.2469 +static const void *lt_preloaded_setup() {
  1.2470 +  return lt_${my_prefix}_LTX_preloaded_symbols;
  1.2471 +}
  1.2472 +#endif
  1.2473 +
  1.2474 +#ifdef __cplusplus
  1.2475 +}
  1.2476 +#endif\
  1.2477 +"
  1.2478 +	} # !$opt_dry_run
  1.2479 +
  1.2480 +	pic_flag_for_symtable=
  1.2481 +	case "$compile_command " in
  1.2482 +	*" -static "*) ;;
  1.2483 +	*)
  1.2484 +	  case $host in
  1.2485 +	  # compiling the symbol table file with pic_flag works around
  1.2486 +	  # a FreeBSD bug that causes programs to crash when -lm is
  1.2487 +	  # linked before any other PIC object.  But we must not use
  1.2488 +	  # pic_flag when linking with -static.  The problem exists in
  1.2489 +	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  1.2490 +	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  1.2491 +	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  1.2492 +	  *-*-hpux*)
  1.2493 +	    pic_flag_for_symtable=" $pic_flag"  ;;
  1.2494 +	  *)
  1.2495 +	    if test "X$my_pic_p" != Xno; then
  1.2496 +	      pic_flag_for_symtable=" $pic_flag"
  1.2497 +	    fi
  1.2498 +	    ;;
  1.2499 +	  esac
  1.2500 +	  ;;
  1.2501 +	esac
  1.2502 +	symtab_cflags=
  1.2503 +	for arg in $LTCFLAGS; do
  1.2504 +	  case $arg in
  1.2505 +	  -pie | -fpie | -fPIE) ;;
  1.2506 +	  *) symtab_cflags="$symtab_cflags $arg" ;;
  1.2507 +	  esac
  1.2508 +	done
  1.2509 +
  1.2510 +	# Now compile the dynamic symbol file.
  1.2511 +	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  1.2512 +
  1.2513 +	# Clean up the generated files.
  1.2514 +	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
  1.2515 +
  1.2516 +	# Transform the symbol file into the correct name.
  1.2517 +	symfileobj="$output_objdir/${my_outputname}S.$objext"
  1.2518 +	case $host in
  1.2519 +	*cygwin* | *mingw* | *cegcc* )
  1.2520 +	  if test -f "$output_objdir/$my_outputname.def"; then
  1.2521 +	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  1.2522 +	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  1.2523 +	  else
  1.2524 +	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  1.2525 +	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  1.2526 +	  fi
  1.2527 +	  ;;
  1.2528 +	*)
  1.2529 +	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  1.2530 +	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  1.2531 +	  ;;
  1.2532 +	esac
  1.2533 +	;;
  1.2534 +      *)
  1.2535 +	func_fatal_error "unknown suffix for \`$my_dlsyms'"
  1.2536 +	;;
  1.2537 +      esac
  1.2538 +    else
  1.2539 +      # We keep going just in case the user didn't refer to
  1.2540 +      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  1.2541 +      # really was required.
  1.2542 +
  1.2543 +      # Nullify the symbol file.
  1.2544 +      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  1.2545 +      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  1.2546 +    fi
  1.2547 +}
  1.2548 +
  1.2549 +# func_win32_libid arg
  1.2550 +# return the library type of file 'arg'
  1.2551 +#
  1.2552 +# Need a lot of goo to handle *both* DLLs and import libs
  1.2553 +# Has to be a shell function in order to 'eat' the argument
  1.2554 +# that is supplied when $file_magic_command is called.
  1.2555 +func_win32_libid ()
  1.2556 +{
  1.2557 +  $opt_debug
  1.2558 +  win32_libid_type="unknown"
  1.2559 +  win32_fileres=`file -L $1 2>/dev/null`
  1.2560 +  case $win32_fileres in
  1.2561 +  *ar\ archive\ import\ library*) # definitely import
  1.2562 +    win32_libid_type="x86 archive import"
  1.2563 +    ;;
  1.2564 +  *ar\ archive*) # could be an import, or static
  1.2565 +    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  1.2566 +       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  1.2567 +      win32_nmres=`eval $NM -f posix -A $1 |
  1.2568 +	$SED -n -e '
  1.2569 +	    1,100{
  1.2570 +		/ I /{
  1.2571 +		    s,.*,import,
  1.2572 +		    p
  1.2573 +		    q
  1.2574 +		}
  1.2575 +	    }'`
  1.2576 +      case $win32_nmres in
  1.2577 +      import*)  win32_libid_type="x86 archive import";;
  1.2578 +      *)        win32_libid_type="x86 archive static";;
  1.2579 +      esac
  1.2580 +    fi
  1.2581 +    ;;
  1.2582 +  *DLL*)
  1.2583 +    win32_libid_type="x86 DLL"
  1.2584 +    ;;
  1.2585 +  *executable*) # but shell scripts are "executable" too...
  1.2586 +    case $win32_fileres in
  1.2587 +    *MS\ Windows\ PE\ Intel*)
  1.2588 +      win32_libid_type="x86 DLL"
  1.2589 +      ;;
  1.2590 +    esac
  1.2591 +    ;;
  1.2592 +  esac
  1.2593 +  $ECHO "$win32_libid_type"
  1.2594 +}
  1.2595 +
  1.2596 +
  1.2597 +
  1.2598 +# func_extract_an_archive dir oldlib
  1.2599 +func_extract_an_archive ()
  1.2600 +{
  1.2601 +    $opt_debug
  1.2602 +    f_ex_an_ar_dir="$1"; shift
  1.2603 +    f_ex_an_ar_oldlib="$1"
  1.2604 +    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
  1.2605 +    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  1.2606 +     :
  1.2607 +    else
  1.2608 +      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  1.2609 +    fi
  1.2610 +}
  1.2611 +
  1.2612 +
  1.2613 +# func_extract_archives gentop oldlib ...
  1.2614 +func_extract_archives ()
  1.2615 +{
  1.2616 +    $opt_debug
  1.2617 +    my_gentop="$1"; shift
  1.2618 +    my_oldlibs=${1+"$@"}
  1.2619 +    my_oldobjs=""
  1.2620 +    my_xlib=""
  1.2621 +    my_xabs=""
  1.2622 +    my_xdir=""
  1.2623 +
  1.2624 +    for my_xlib in $my_oldlibs; do
  1.2625 +      # Extract the objects.
  1.2626 +      case $my_xlib in
  1.2627 +	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  1.2628 +	*) my_xabs=`pwd`"/$my_xlib" ;;
  1.2629 +      esac
  1.2630 +      func_basename "$my_xlib"
  1.2631 +      my_xlib="$func_basename_result"
  1.2632 +      my_xlib_u=$my_xlib
  1.2633 +      while :; do
  1.2634 +        case " $extracted_archives " in
  1.2635 +	*" $my_xlib_u "*)
  1.2636 +	  func_arith $extracted_serial + 1
  1.2637 +	  extracted_serial=$func_arith_result
  1.2638 +	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
  1.2639 +	*) break ;;
  1.2640 +	esac
  1.2641 +      done
  1.2642 +      extracted_archives="$extracted_archives $my_xlib_u"
  1.2643 +      my_xdir="$my_gentop/$my_xlib_u"
  1.2644 +
  1.2645 +      func_mkdir_p "$my_xdir"
  1.2646 +
  1.2647 +      case $host in
  1.2648 +      *-darwin*)
  1.2649 +	func_verbose "Extracting $my_xabs"
  1.2650 +	# Do not bother doing anything if just a dry run
  1.2651 +	$opt_dry_run || {
  1.2652 +	  darwin_orig_dir=`pwd`
  1.2653 +	  cd $my_xdir || exit $?
  1.2654 +	  darwin_archive=$my_xabs
  1.2655 +	  darwin_curdir=`pwd`
  1.2656 +	  darwin_base_archive=`basename "$darwin_archive"`
  1.2657 +	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  1.2658 +	  if test -n "$darwin_arches"; then
  1.2659 +	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  1.2660 +	    darwin_arch=
  1.2661 +	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  1.2662 +	    for darwin_arch in  $darwin_arches ; do
  1.2663 +	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  1.2664 +	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  1.2665 +	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  1.2666 +	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  1.2667 +	      cd "$darwin_curdir"
  1.2668 +	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  1.2669 +	    done # $darwin_arches
  1.2670 +            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  1.2671 +	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
  1.2672 +	    darwin_file=
  1.2673 +	    darwin_files=
  1.2674 +	    for darwin_file in $darwin_filelist; do
  1.2675 +	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  1.2676 +	      $LIPO -create -output "$darwin_file" $darwin_files
  1.2677 +	    done # $darwin_filelist
  1.2678 +	    $RM -rf unfat-$$
  1.2679 +	    cd "$darwin_orig_dir"
  1.2680 +	  else
  1.2681 +	    cd $darwin_orig_dir
  1.2682 +	    func_extract_an_archive "$my_xdir" "$my_xabs"
  1.2683 +	  fi # $darwin_arches
  1.2684 +	} # !$opt_dry_run
  1.2685 +	;;
  1.2686 +      *)
  1.2687 +        func_extract_an_archive "$my_xdir" "$my_xabs"
  1.2688 +	;;
  1.2689 +      esac
  1.2690 +      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  1.2691 +    done
  1.2692 +
  1.2693 +    func_extract_archives_result="$my_oldobjs"
  1.2694 +}
  1.2695 +
  1.2696 +
  1.2697 +
  1.2698 +# func_emit_wrapper_part1 [arg=no]
  1.2699 +#
  1.2700 +# Emit the first part of a libtool wrapper script on stdout.
  1.2701 +# For more information, see the description associated with
  1.2702 +# func_emit_wrapper(), below.
  1.2703 +func_emit_wrapper_part1 ()
  1.2704 +{
  1.2705 +	func_emit_wrapper_part1_arg1=no
  1.2706 +	if test -n "$1" ; then
  1.2707 +	  func_emit_wrapper_part1_arg1=$1
  1.2708 +	fi
  1.2709 +
  1.2710 +	$ECHO "\
  1.2711 +#! $SHELL
  1.2712 +
  1.2713 +# $output - temporary wrapper script for $objdir/$outputname
  1.2714 +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1.2715 +#
  1.2716 +# The $output program cannot be directly executed until all the libtool
  1.2717 +# libraries that it depends on are installed.
  1.2718 +#
  1.2719 +# This wrapper script should never be moved out of the build directory.
  1.2720 +# If it is, it will not operate correctly.
  1.2721 +
  1.2722 +# Sed substitution that helps us do robust quoting.  It backslashifies
  1.2723 +# metacharacters that are still active within double-quoted strings.
  1.2724 +Xsed='${SED} -e 1s/^X//'
  1.2725 +sed_quote_subst='$sed_quote_subst'
  1.2726 +
  1.2727 +# Be Bourne compatible
  1.2728 +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  1.2729 +  emulate sh
  1.2730 +  NULLCMD=:
  1.2731 +  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  1.2732 +  # is contrary to our usage.  Disable this feature.
  1.2733 +  alias -g '\${1+\"\$@\"}'='\"\$@\"'
  1.2734 +  setopt NO_GLOB_SUBST
  1.2735 +else
  1.2736 +  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  1.2737 +fi
  1.2738 +BIN_SH=xpg4; export BIN_SH # for Tru64
  1.2739 +DUALCASE=1; export DUALCASE # for MKS sh
  1.2740 +
  1.2741 +# The HP-UX ksh and POSIX shell print the target directory to stdout
  1.2742 +# if CDPATH is set.
  1.2743 +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  1.2744 +
  1.2745 +relink_command=\"$relink_command\"
  1.2746 +
  1.2747 +# This environment variable determines our operation mode.
  1.2748 +if test \"\$libtool_install_magic\" = \"$magic\"; then
  1.2749 +  # install mode needs the following variables:
  1.2750 +  generated_by_libtool_version='$macro_version'
  1.2751 +  notinst_deplibs='$notinst_deplibs'
  1.2752 +else
  1.2753 +  # When we are sourced in execute mode, \$file and \$ECHO are already set.
  1.2754 +  if test \"\$libtool_execute_magic\" != \"$magic\"; then
  1.2755 +    ECHO=\"$qecho\"
  1.2756 +    file=\"\$0\"
  1.2757 +    # Make sure echo works.
  1.2758 +    if test \"X\$1\" = X--no-reexec; then
  1.2759 +      # Discard the --no-reexec flag, and continue.
  1.2760 +      shift
  1.2761 +    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
  1.2762 +      # Yippee, \$ECHO works!
  1.2763 +      :
  1.2764 +    else
  1.2765 +      # Restart under the correct shell, and then maybe \$ECHO will work.
  1.2766 +      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  1.2767 +    fi
  1.2768 +  fi\
  1.2769 +"
  1.2770 +	$ECHO "\
  1.2771 +
  1.2772 +  # Find the directory that this script lives in.
  1.2773 +  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  1.2774 +  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  1.2775 +
  1.2776 +  # Follow symbolic links until we get to the real thisdir.
  1.2777 +  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  1.2778 +  while test -n \"\$file\"; do
  1.2779 +    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  1.2780 +
  1.2781 +    # If there was a directory component, then change thisdir.
  1.2782 +    if test \"x\$destdir\" != \"x\$file\"; then
  1.2783 +      case \"\$destdir\" in
  1.2784 +      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  1.2785 +      *) thisdir=\"\$thisdir/\$destdir\" ;;
  1.2786 +      esac
  1.2787 +    fi
  1.2788 +
  1.2789 +    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  1.2790 +    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  1.2791 +  done
  1.2792 +"
  1.2793 +}
  1.2794 +# end: func_emit_wrapper_part1
  1.2795 +
  1.2796 +# func_emit_wrapper_part2 [arg=no]
  1.2797 +#
  1.2798 +# Emit the second part of a libtool wrapper script on stdout.
  1.2799 +# For more information, see the description associated with
  1.2800 +# func_emit_wrapper(), below.
  1.2801 +func_emit_wrapper_part2 ()
  1.2802 +{
  1.2803 +	func_emit_wrapper_part2_arg1=no
  1.2804 +	if test -n "$1" ; then
  1.2805 +	  func_emit_wrapper_part2_arg1=$1
  1.2806 +	fi
  1.2807 +
  1.2808 +	$ECHO "\
  1.2809 +
  1.2810 +  # Usually 'no', except on cygwin/mingw when embedded into
  1.2811 +  # the cwrapper.
  1.2812 +  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
  1.2813 +  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  1.2814 +    # special case for '.'
  1.2815 +    if test \"\$thisdir\" = \".\"; then
  1.2816 +      thisdir=\`pwd\`
  1.2817 +    fi
  1.2818 +    # remove .libs from thisdir
  1.2819 +    case \"\$thisdir\" in
  1.2820 +    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
  1.2821 +    $objdir )   thisdir=. ;;
  1.2822 +    esac
  1.2823 +  fi
  1.2824 +
  1.2825 +  # Try to get the absolute directory name.
  1.2826 +  absdir=\`cd \"\$thisdir\" && pwd\`
  1.2827 +  test -n \"\$absdir\" && thisdir=\"\$absdir\"
  1.2828 +"
  1.2829 +
  1.2830 +	if test "$fast_install" = yes; then
  1.2831 +	  $ECHO "\
  1.2832 +  program=lt-'$outputname'$exeext
  1.2833 +  progdir=\"\$thisdir/$objdir\"
  1.2834 +
  1.2835 +  if test ! -f \"\$progdir/\$program\" ||
  1.2836 +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  1.2837 +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  1.2838 +
  1.2839 +    file=\"\$\$-\$program\"
  1.2840 +
  1.2841 +    if test ! -d \"\$progdir\"; then
  1.2842 +      $MKDIR \"\$progdir\"
  1.2843 +    else
  1.2844 +      $RM \"\$progdir/\$file\"
  1.2845 +    fi"
  1.2846 +
  1.2847 +	  $ECHO "\
  1.2848 +
  1.2849 +    # relink executable if necessary
  1.2850 +    if test -n \"\$relink_command\"; then
  1.2851 +      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  1.2852 +      else
  1.2853 +	$ECHO \"\$relink_command_output\" >&2
  1.2854 +	$RM \"\$progdir/\$file\"
  1.2855 +	exit 1
  1.2856 +      fi
  1.2857 +    fi
  1.2858 +
  1.2859 +    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  1.2860 +    { $RM \"\$progdir/\$program\";
  1.2861 +      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  1.2862 +    $RM \"\$progdir/\$file\"
  1.2863 +  fi"
  1.2864 +	else
  1.2865 +	  $ECHO "\
  1.2866 +  program='$outputname'
  1.2867 +  progdir=\"\$thisdir/$objdir\"
  1.2868 +"
  1.2869 +	fi
  1.2870 +
  1.2871 +	$ECHO "\
  1.2872 +
  1.2873 +  if test -f \"\$progdir/\$program\"; then"
  1.2874 +
  1.2875 +	# Export our shlibpath_var if we have one.
  1.2876 +	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1.2877 +	  $ECHO "\
  1.2878 +    # Add our own library path to $shlibpath_var
  1.2879 +    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  1.2880 +
  1.2881 +    # Some systems cannot cope with colon-terminated $shlibpath_var
  1.2882 +    # The second colon is a workaround for a bug in BeOS R4 sed
  1.2883 +    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  1.2884 +
  1.2885 +    export $shlibpath_var
  1.2886 +"
  1.2887 +	fi
  1.2888 +
  1.2889 +	# fixup the dll searchpath if we need to.
  1.2890 +	if test -n "$dllsearchpath"; then
  1.2891 +	  $ECHO "\
  1.2892 +    # Add the dll search path components to the executable PATH
  1.2893 +    PATH=$dllsearchpath:\$PATH
  1.2894 +"
  1.2895 +	fi
  1.2896 +
  1.2897 +	$ECHO "\
  1.2898 +    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  1.2899 +      # Run the actual program with our arguments.
  1.2900 +"
  1.2901 +	case $host in
  1.2902 +	# Backslashes separate directories on plain windows
  1.2903 +	*-*-mingw | *-*-os2* | *-cegcc*)
  1.2904 +	  $ECHO "\
  1.2905 +      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  1.2906 +"
  1.2907 +	  ;;
  1.2908 +
  1.2909 +	*)
  1.2910 +	  $ECHO "\
  1.2911 +      exec \"\$progdir/\$program\" \${1+\"\$@\"}
  1.2912 +"
  1.2913 +	  ;;
  1.2914 +	esac
  1.2915 +	$ECHO "\
  1.2916 +      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  1.2917 +      exit 1
  1.2918 +    fi
  1.2919 +  else
  1.2920 +    # The program doesn't exist.
  1.2921 +    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  1.2922 +    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  1.2923 +    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  1.2924 +    exit 1
  1.2925 +  fi
  1.2926 +fi\
  1.2927 +"
  1.2928 +}
  1.2929 +# end: func_emit_wrapper_part2
  1.2930 +
  1.2931 +
  1.2932 +# func_emit_wrapper [arg=no]
  1.2933 +#
  1.2934 +# Emit a libtool wrapper script on stdout.
  1.2935 +# Don't directly open a file because we may want to
  1.2936 +# incorporate the script contents within a cygwin/mingw
  1.2937 +# wrapper executable.  Must ONLY be called from within
  1.2938 +# func_mode_link because it depends on a number of variables
  1.2939 +# set therein.
  1.2940 +#
  1.2941 +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  1.2942 +# variable will take.  If 'yes', then the emitted script
  1.2943 +# will assume that the directory in which it is stored is
  1.2944 +# the $objdir directory.  This is a cygwin/mingw-specific
  1.2945 +# behavior.
  1.2946 +func_emit_wrapper ()
  1.2947 +{
  1.2948 +	func_emit_wrapper_arg1=no
  1.2949 +	if test -n "$1" ; then
  1.2950 +	  func_emit_wrapper_arg1=$1
  1.2951 +	fi
  1.2952 +
  1.2953 +	# split this up so that func_emit_cwrapperexe_src
  1.2954 +	# can call each part independently.
  1.2955 +	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
  1.2956 +	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
  1.2957 +}
  1.2958 +
  1.2959 +
  1.2960 +# func_to_host_path arg
  1.2961 +#
  1.2962 +# Convert paths to host format when used with build tools.
  1.2963 +# Intended for use with "native" mingw (where libtool itself
  1.2964 +# is running under the msys shell), or in the following cross-
  1.2965 +# build environments:
  1.2966 +#    $build          $host
  1.2967 +#    mingw (msys)    mingw  [e.g. native]
  1.2968 +#    cygwin          mingw
  1.2969 +#    *nix + wine     mingw
  1.2970 +# where wine is equipped with the `winepath' executable.
  1.2971 +# In the native mingw case, the (msys) shell automatically
  1.2972 +# converts paths for any non-msys applications it launches,
  1.2973 +# but that facility isn't available from inside the cwrapper.
  1.2974 +# Similar accommodations are necessary for $host mingw and
  1.2975 +# $build cygwin.  Calling this function does no harm for other
  1.2976 +# $host/$build combinations not listed above.
  1.2977 +#
  1.2978 +# ARG is the path (on $build) that should be converted to
  1.2979 +# the proper representation for $host. The result is stored
  1.2980 +# in $func_to_host_path_result.
  1.2981 +func_to_host_path ()
  1.2982 +{
  1.2983 +  func_to_host_path_result="$1"
  1.2984 +  if test -n "$1" ; then
  1.2985 +    case $host in
  1.2986 +      *mingw* )
  1.2987 +        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  1.2988 +        case $build in
  1.2989 +          *mingw* ) # actually, msys
  1.2990 +            # awkward: cmd appends spaces to result
  1.2991 +            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  1.2992 +            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
  1.2993 +              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  1.2994 +            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  1.2995 +              $SED -e "$lt_sed_naive_backslashify"`
  1.2996 +            ;;
  1.2997 +          *cygwin* )
  1.2998 +            func_to_host_path_tmp1=`cygpath -w "$1"`
  1.2999 +            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  1.3000 +              $SED -e "$lt_sed_naive_backslashify"`
  1.3001 +            ;;
  1.3002 +          * )
  1.3003 +            # Unfortunately, winepath does not exit with a non-zero
  1.3004 +            # error code, so we are forced to check the contents of
  1.3005 +            # stdout. On the other hand, if the command is not
  1.3006 +            # found, the shell will set an exit code of 127 and print
  1.3007 +            # *an error message* to stdout. So we must check for both
  1.3008 +            # error code of zero AND non-empty stdout, which explains
  1.3009 +            # the odd construction:
  1.3010 +            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
  1.3011 +            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
  1.3012 +              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  1.3013 +                $SED -e "$lt_sed_naive_backslashify"`
  1.3014 +            else
  1.3015 +              # Allow warning below.
  1.3016 +              func_to_host_path_result=""
  1.3017 +            fi
  1.3018 +            ;;
  1.3019 +        esac
  1.3020 +        if test -z "$func_to_host_path_result" ; then
  1.3021 +          func_error "Could not determine host path corresponding to"
  1.3022 +          func_error "  '$1'"
  1.3023 +          func_error "Continuing, but uninstalled executables may not work."
  1.3024 +          # Fallback:
  1.3025 +          func_to_host_path_result="$1"
  1.3026 +        fi
  1.3027 +        ;;
  1.3028 +    esac
  1.3029 +  fi
  1.3030 +}
  1.3031 +# end: func_to_host_path
  1.3032 +
  1.3033 +# func_to_host_pathlist arg
  1.3034 +#
  1.3035 +# Convert pathlists to host format when used with build tools.
  1.3036 +# See func_to_host_path(), above. This function supports the
  1.3037 +# following $build/$host combinations (but does no harm for
  1.3038 +# combinations not listed here):
  1.3039 +#    $build          $host
  1.3040 +#    mingw (msys)    mingw  [e.g. native]
  1.3041 +#    cygwin          mingw
  1.3042 +#    *nix + wine     mingw
  1.3043 +#
  1.3044 +# Path separators are also converted from $build format to
  1.3045 +# $host format. If ARG begins or ends with a path separator
  1.3046 +# character, it is preserved (but converted to $host format)
  1.3047 +# on output.
  1.3048 +#
  1.3049 +# ARG is a pathlist (on $build) that should be converted to
  1.3050 +# the proper representation on $host. The result is stored
  1.3051 +# in $func_to_host_pathlist_result.
  1.3052 +func_to_host_pathlist ()
  1.3053 +{
  1.3054 +  func_to_host_pathlist_result="$1"
  1.3055 +  if test -n "$1" ; then
  1.3056 +    case $host in
  1.3057 +      *mingw* )
  1.3058 +        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  1.3059 +        # Remove leading and trailing path separator characters from
  1.3060 +        # ARG. msys behavior is inconsistent here, cygpath turns them
  1.3061 +        # into '.;' and ';.', and winepath ignores them completely.
  1.3062 +        func_to_host_pathlist_tmp2="$1"
  1.3063 +        # Once set for this call, this variable should not be
  1.3064 +        # reassigned. It is used in tha fallback case.
  1.3065 +        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
  1.3066 +          $SED -e 's|^:*||' -e 's|:*$||'`
  1.3067 +        case $build in
  1.3068 +          *mingw* ) # Actually, msys.
  1.3069 +            # Awkward: cmd appends spaces to result.
  1.3070 +            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  1.3071 +            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
  1.3072 +              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  1.3073 +            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  1.3074 +              $SED -e "$lt_sed_naive_backslashify"`
  1.3075 +            ;;
  1.3076 +          *cygwin* )
  1.3077 +            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
  1.3078 +            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  1.3079 +              $SED -e "$lt_sed_naive_backslashify"`
  1.3080 +            ;;
  1.3081 +          * )
  1.3082 +            # unfortunately, winepath doesn't convert pathlists
  1.3083 +            func_to_host_pathlist_result=""
  1.3084 +            func_to_host_pathlist_oldIFS=$IFS
  1.3085 +            IFS=:
  1.3086 +            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
  1.3087 +              IFS=$func_to_host_pathlist_oldIFS
  1.3088 +              if test -n "$func_to_host_pathlist_f" ; then
  1.3089 +                func_to_host_path "$func_to_host_pathlist_f"
  1.3090 +                if test -n "$func_to_host_path_result" ; then
  1.3091 +                  if test -z "$func_to_host_pathlist_result" ; then
  1.3092 +                    func_to_host_pathlist_result="$func_to_host_path_result"
  1.3093 +                  else
  1.3094 +                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
  1.3095 +                  fi
  1.3096 +                fi
  1.3097 +              fi
  1.3098 +              IFS=:
  1.3099 +            done
  1.3100 +            IFS=$func_to_host_pathlist_oldIFS
  1.3101 +            ;;
  1.3102 +        esac
  1.3103 +        if test -z "$func_to_host_pathlist_result" ; then
  1.3104 +          func_error "Could not determine the host path(s) corresponding to"
  1.3105 +          func_error "  '$1'"
  1.3106 +          func_error "Continuing, but uninstalled executables may not work."
  1.3107 +          # Fallback. This may break if $1 contains DOS-style drive
  1.3108 +          # specifications. The fix is not to complicate the expression
  1.3109 +          # below, but for the user to provide a working wine installation
  1.3110 +          # with winepath so that path translation in the cross-to-mingw
  1.3111 +          # case works properly.
  1.3112 +          lt_replace_pathsep_nix_to_dos="s|:|;|g"
  1.3113 +          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
  1.3114 +            $SED -e "$lt_replace_pathsep_nix_to_dos"`
  1.3115 +        fi
  1.3116 +        # Now, add the leading and trailing path separators back
  1.3117 +        case "$1" in
  1.3118 +          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
  1.3119 +            ;;
  1.3120 +        esac
  1.3121 +        case "$1" in
  1.3122 +          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
  1.3123 +            ;;
  1.3124 +        esac
  1.3125 +        ;;
  1.3126 +    esac
  1.3127 +  fi
  1.3128 +}
  1.3129 +# end: func_to_host_pathlist
  1.3130 +
  1.3131 +# func_emit_cwrapperexe_src
  1.3132 +# emit the source code for a wrapper executable on stdout
  1.3133 +# Must ONLY be called from within func_mode_link because
  1.3134 +# it depends on a number of variable set therein.
  1.3135 +func_emit_cwrapperexe_src ()
  1.3136 +{
  1.3137 +	cat <<EOF
  1.3138 +
  1.3139 +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  1.3140 +   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1.3141 +
  1.3142 +   The $output program cannot be directly executed until all the libtool
  1.3143 +   libraries that it depends on are installed.
  1.3144 +
  1.3145 +   This wrapper executable should never be moved out of the build directory.
  1.3146 +   If it is, it will not operate correctly.
  1.3147 +
  1.3148 +   Currently, it simply execs the wrapper *script* "$SHELL $output",
  1.3149 +   but could eventually absorb all of the scripts functionality and
  1.3150 +   exec $objdir/$outputname directly.
  1.3151 +*/
  1.3152 +EOF
  1.3153 +	    cat <<"EOF"
  1.3154 +#include <stdio.h>
  1.3155 +#include <stdlib.h>
  1.3156 +#ifdef _MSC_VER
  1.3157 +# include <direct.h>
  1.3158 +# include <process.h>
  1.3159 +# include <io.h>
  1.3160 +# define setmode _setmode
  1.3161 +#else
  1.3162 +# include <unistd.h>
  1.3163 +# include <stdint.h>
  1.3164 +# ifdef __CYGWIN__
  1.3165 +#  include <io.h>
  1.3166 +#  define HAVE_SETENV
  1.3167 +#  ifdef __STRICT_ANSI__
  1.3168 +char *realpath (const char *, char *);
  1.3169 +int putenv (char *);
  1.3170 +int setenv (const char *, const char *, int);
  1.3171 +#  endif
  1.3172 +# endif
  1.3173 +#endif
  1.3174 +#include <malloc.h>
  1.3175 +#include <stdarg.h>
  1.3176 +#include <assert.h>
  1.3177 +#include <string.h>
  1.3178 +#include <ctype.h>
  1.3179 +#include <errno.h>
  1.3180 +#include <fcntl.h>
  1.3181 +#include <sys/stat.h>
  1.3182 +
  1.3183 +#if defined(PATH_MAX)
  1.3184 +# define LT_PATHMAX PATH_MAX
  1.3185 +#elif defined(MAXPATHLEN)
  1.3186 +# define LT_PATHMAX MAXPATHLEN
  1.3187 +#else
  1.3188 +# define LT_PATHMAX 1024
  1.3189 +#endif
  1.3190 +
  1.3191 +#ifndef S_IXOTH
  1.3192 +# define S_IXOTH 0
  1.3193 +#endif
  1.3194 +#ifndef S_IXGRP
  1.3195 +# define S_IXGRP 0
  1.3196 +#endif
  1.3197 +
  1.3198 +#ifdef _MSC_VER
  1.3199 +# define S_IXUSR _S_IEXEC
  1.3200 +# define stat _stat
  1.3201 +# ifndef _INTPTR_T_DEFINED
  1.3202 +#  define intptr_t int
  1.3203 +# endif
  1.3204 +#endif
  1.3205 +
  1.3206 +#ifndef DIR_SEPARATOR
  1.3207 +# define DIR_SEPARATOR '/'
  1.3208 +# define PATH_SEPARATOR ':'
  1.3209 +#endif
  1.3210 +
  1.3211 +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  1.3212 +  defined (__OS2__)
  1.3213 +# define HAVE_DOS_BASED_FILE_SYSTEM
  1.3214 +# define FOPEN_WB "wb"
  1.3215 +# ifndef DIR_SEPARATOR_2
  1.3216 +#  define DIR_SEPARATOR_2 '\\'
  1.3217 +# endif
  1.3218 +# ifndef PATH_SEPARATOR_2
  1.3219 +#  define PATH_SEPARATOR_2 ';'
  1.3220 +# endif
  1.3221 +#endif
  1.3222 +
  1.3223 +#ifndef DIR_SEPARATOR_2
  1.3224 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  1.3225 +#else /* DIR_SEPARATOR_2 */
  1.3226 +# define IS_DIR_SEPARATOR(ch) \
  1.3227 +	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  1.3228 +#endif /* DIR_SEPARATOR_2 */
  1.3229 +
  1.3230 +#ifndef PATH_SEPARATOR_2
  1.3231 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  1.3232 +#else /* PATH_SEPARATOR_2 */
  1.3233 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  1.3234 +#endif /* PATH_SEPARATOR_2 */
  1.3235 +
  1.3236 +#ifdef __CYGWIN__
  1.3237 +# define FOPEN_WB "wb"
  1.3238 +#endif
  1.3239 +
  1.3240 +#ifndef FOPEN_WB
  1.3241 +# define FOPEN_WB "w"
  1.3242 +#endif
  1.3243 +#ifndef _O_BINARY
  1.3244 +# define _O_BINARY 0
  1.3245 +#endif
  1.3246 +
  1.3247 +#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  1.3248 +#define XFREE(stale) do { \
  1.3249 +  if (stale) { free ((void *) stale); stale = 0; } \
  1.3250 +} while (0)
  1.3251 +
  1.3252 +#undef LTWRAPPER_DEBUGPRINTF
  1.3253 +#if defined DEBUGWRAPPER
  1.3254 +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
  1.3255 +static void
  1.3256 +ltwrapper_debugprintf (const char *fmt, ...)
  1.3257 +{
  1.3258 +    va_list args;
  1.3259 +    va_start (args, fmt);
  1.3260 +    (void) vfprintf (stderr, fmt, args);
  1.3261 +    va_end (args);
  1.3262 +}
  1.3263 +#else
  1.3264 +# define LTWRAPPER_DEBUGPRINTF(args)
  1.3265 +#endif
  1.3266 +
  1.3267 +const char *program_name = NULL;
  1.3268 +
  1.3269 +void *xmalloc (size_t num);
  1.3270 +char *xstrdup (const char *string);
  1.3271 +const char *base_name (const char *name);
  1.3272 +char *find_executable (const char *wrapper);
  1.3273 +char *chase_symlinks (const char *pathspec);
  1.3274 +int make_executable (const char *path);
  1.3275 +int check_executable (const char *path);
  1.3276 +char *strendzap (char *str, const char *pat);
  1.3277 +void lt_fatal (const char *message, ...);
  1.3278 +void lt_setenv (const char *name, const char *value);
  1.3279 +char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  1.3280 +void lt_opt_process_env_set (const char *arg);
  1.3281 +void lt_opt_process_env_prepend (const char *arg);
  1.3282 +void lt_opt_process_env_append (const char *arg);
  1.3283 +int lt_split_name_value (const char *arg, char** name, char** value);
  1.3284 +void lt_update_exe_path (const char *name, const char *value);
  1.3285 +void lt_update_lib_path (const char *name, const char *value);
  1.3286 +
  1.3287 +static const char *script_text_part1 =
  1.3288 +EOF
  1.3289 +
  1.3290 +	    func_emit_wrapper_part1 yes |
  1.3291 +	        $SED -e 's/\([\\"]\)/\\\1/g' \
  1.3292 +	             -e 's/^/  "/' -e 's/$/\\n"/'
  1.3293 +	    echo ";"
  1.3294 +	    cat <<EOF
  1.3295 +
  1.3296 +static const char *script_text_part2 =
  1.3297 +EOF
  1.3298 +	    func_emit_wrapper_part2 yes |
  1.3299 +	        $SED -e 's/\([\\"]\)/\\\1/g' \
  1.3300 +	             -e 's/^/  "/' -e 's/$/\\n"/'
  1.3301 +	    echo ";"
  1.3302 +
  1.3303 +	    cat <<EOF
  1.3304 +const char * MAGIC_EXE = "$magic_exe";
  1.3305 +const char * LIB_PATH_VARNAME = "$shlibpath_var";
  1.3306 +EOF
  1.3307 +
  1.3308 +	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  1.3309 +              func_to_host_pathlist "$temp_rpath"
  1.3310 +	      cat <<EOF
  1.3311 +const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
  1.3312 +EOF
  1.3313 +	    else
  1.3314 +	      cat <<"EOF"
  1.3315 +const char * LIB_PATH_VALUE   = "";
  1.3316 +EOF
  1.3317 +	    fi
  1.3318 +
  1.3319 +	    if test -n "$dllsearchpath"; then
  1.3320 +              func_to_host_pathlist "$dllsearchpath:"
  1.3321 +	      cat <<EOF
  1.3322 +const char * EXE_PATH_VARNAME = "PATH";
  1.3323 +const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
  1.3324 +EOF
  1.3325 +	    else
  1.3326 +	      cat <<"EOF"
  1.3327 +const char * EXE_PATH_VARNAME = "";
  1.3328 +const char * EXE_PATH_VALUE   = "";
  1.3329 +EOF
  1.3330 +	    fi
  1.3331 +
  1.3332 +	    if test "$fast_install" = yes; then
  1.3333 +	      cat <<EOF
  1.3334 +const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  1.3335 +EOF
  1.3336 +	    else
  1.3337 +	      cat <<EOF
  1.3338 +const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  1.3339 +EOF
  1.3340 +	    fi
  1.3341 +
  1.3342 +
  1.3343 +	    cat <<"EOF"
  1.3344 +
  1.3345 +#define LTWRAPPER_OPTION_PREFIX         "--lt-"
  1.3346 +#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
  1.3347 +
  1.3348 +static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
  1.3349 +static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  1.3350 +
  1.3351 +static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
  1.3352 +
  1.3353 +static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
  1.3354 +static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
  1.3355 +  /* argument is putenv-style "foo=bar", value of foo is set to bar */
  1.3356 +
  1.3357 +static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
  1.3358 +static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
  1.3359 +  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
  1.3360 +
  1.3361 +static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
  1.3362 +static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
  1.3363 +  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
  1.3364 +
  1.3365 +int
  1.3366 +main (int argc, char *argv[])
  1.3367 +{
  1.3368 +  char **newargz;
  1.3369 +  int  newargc;
  1.3370 +  char *tmp_pathspec;
  1.3371 +  char *actual_cwrapper_path;
  1.3372 +  char *actual_cwrapper_name;
  1.3373 +  char *target_name;
  1.3374 +  char *lt_argv_zero;
  1.3375 +  intptr_t rval = 127;
  1.3376 +
  1.3377 +  int i;
  1.3378 +
  1.3379 +  program_name = (char *) xstrdup (base_name (argv[0]));
  1.3380 +  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
  1.3381 +  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
  1.3382 +
  1.3383 +  /* very simple arg parsing; don't want to rely on getopt */
  1.3384 +  for (i = 1; i < argc; i++)
  1.3385 +    {
  1.3386 +      if (strcmp (argv[i], dumpscript_opt) == 0)
  1.3387 +	{
  1.3388 +EOF
  1.3389 +	    case "$host" in
  1.3390 +	      *mingw* | *cygwin* )
  1.3391 +		# make stdout use "unix" line endings
  1.3392 +		echo "          setmode(1,_O_BINARY);"
  1.3393 +		;;
  1.3394 +	      esac
  1.3395 +
  1.3396 +	    cat <<"EOF"
  1.3397 +	  printf ("%s", script_text_part1);
  1.3398 +	  printf ("%s", script_text_part2);
  1.3399 +	  return 0;
  1.3400 +	}
  1.3401 +    }
  1.3402 +
  1.3403 +  newargz = XMALLOC (char *, argc + 1);
  1.3404 +  tmp_pathspec = find_executable (argv[0]);
  1.3405 +  if (tmp_pathspec == NULL)
  1.3406 +    lt_fatal ("Couldn't find %s", argv[0]);
  1.3407 +  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
  1.3408 +			  tmp_pathspec));
  1.3409 +
  1.3410 +  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  1.3411 +  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
  1.3412 +			  actual_cwrapper_path));
  1.3413 +  XFREE (tmp_pathspec);
  1.3414 +
  1.3415 +  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
  1.3416 +  strendzap (actual_cwrapper_path, actual_cwrapper_name);
  1.3417 +
  1.3418 +  /* wrapper name transforms */
  1.3419 +  strendzap (actual_cwrapper_name, ".exe");
  1.3420 +  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  1.3421 +  XFREE (actual_cwrapper_name);
  1.3422 +  actual_cwrapper_name = tmp_pathspec;
  1.3423 +  tmp_pathspec = 0;
  1.3424 +
  1.3425 +  /* target_name transforms -- use actual target program name; might have lt- prefix */
  1.3426 +  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  1.3427 +  strendzap (target_name, ".exe");
  1.3428 +  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  1.3429 +  XFREE (target_name);
  1.3430 +  target_name = tmp_pathspec;
  1.3431 +  tmp_pathspec = 0;
  1.3432 +
  1.3433 +  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
  1.3434 +			  target_name));
  1.3435 +EOF
  1.3436 +
  1.3437 +	    cat <<EOF
  1.3438 +  newargz[0] =
  1.3439 +    XMALLOC (char, (strlen (actual_cwrapper_path) +
  1.3440 +		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  1.3441 +  strcpy (newargz[0], actual_cwrapper_path);
  1.3442 +  strcat (newargz[0], "$objdir");
  1.3443 +  strcat (newargz[0], "/");
  1.3444 +EOF
  1.3445 +
  1.3446 +	    cat <<"EOF"
  1.3447 +  /* stop here, and copy so we don't have to do this twice */
  1.3448 +  tmp_pathspec = xstrdup (newargz[0]);
  1.3449 +
  1.3450 +  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  1.3451 +  strcat (newargz[0], actual_cwrapper_name);
  1.3452 +
  1.3453 +  /* DO want the lt- prefix here if it exists, so use target_name */
  1.3454 +  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  1.3455 +  XFREE (tmp_pathspec);
  1.3456 +  tmp_pathspec = NULL;
  1.3457 +EOF
  1.3458 +
  1.3459 +	    case $host_os in
  1.3460 +	      mingw*)
  1.3461 +	    cat <<"EOF"
  1.3462 +  {
  1.3463 +    char* p;
  1.3464 +    while ((p = strchr (newargz[0], '\\')) != NULL)
  1.3465 +      {
  1.3466 +	*p = '/';
  1.3467 +      }
  1.3468 +    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  1.3469 +      {
  1.3470 +	*p = '/';
  1.3471 +      }
  1.3472 +  }
  1.3473 +EOF
  1.3474 +	    ;;
  1.3475 +	    esac
  1.3476 +
  1.3477 +	    cat <<"EOF"
  1.3478 +  XFREE (target_name);
  1.3479 +  XFREE (actual_cwrapper_path);
  1.3480 +  XFREE (actual_cwrapper_name);
  1.3481 +
  1.3482 +  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  1.3483 +  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
  1.3484 +  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  1.3485 +  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  1.3486 +
  1.3487 +  newargc=0;
  1.3488 +  for (i = 1; i < argc; i++)
  1.3489 +    {
  1.3490 +      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
  1.3491 +        {
  1.3492 +          if (argv[i][env_set_opt_len] == '=')
  1.3493 +            {
  1.3494 +              const char *p = argv[i] + env_set_opt_len + 1;
  1.3495 +              lt_opt_process_env_set (p);
  1.3496 +            }
  1.3497 +          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
  1.3498 +            {
  1.3499 +              lt_opt_process_env_set (argv[++i]); /* don't copy */
  1.3500 +            }
  1.3501 +          else
  1.3502 +            lt_fatal ("%s missing required argument", env_set_opt);
  1.3503 +          continue;
  1.3504 +        }
  1.3505 +      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
  1.3506 +        {
  1.3507 +          if (argv[i][env_prepend_opt_len] == '=')
  1.3508 +            {
  1.3509 +              const char *p = argv[i] + env_prepend_opt_len + 1;
  1.3510 +              lt_opt_process_env_prepend (p);
  1.3511 +            }
  1.3512 +          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
  1.3513 +            {
  1.3514 +              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
  1.3515 +            }
  1.3516 +          else
  1.3517 +            lt_fatal ("%s missing required argument", env_prepend_opt);
  1.3518 +          continue;
  1.3519 +        }
  1.3520 +      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
  1.3521 +        {
  1.3522 +          if (argv[i][env_append_opt_len] == '=')
  1.3523 +            {
  1.3524 +              const char *p = argv[i] + env_append_opt_len + 1;
  1.3525 +              lt_opt_process_env_append (p);
  1.3526 +            }
  1.3527 +          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
  1.3528 +            {
  1.3529 +              lt_opt_process_env_append (argv[++i]); /* don't copy */
  1.3530 +            }
  1.3531 +          else
  1.3532 +            lt_fatal ("%s missing required argument", env_append_opt);
  1.3533 +          continue;
  1.3534 +        }
  1.3535 +      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
  1.3536 +        {
  1.3537 +          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  1.3538 +             namespace, but it is not one of the ones we know about and
  1.3539 +             have already dealt with, above (inluding dump-script), then
  1.3540 +             report an error. Otherwise, targets might begin to believe
  1.3541 +             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  1.3542 +             namespace. The first time any user complains about this, we'll
  1.3543 +             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  1.3544 +             or a configure.ac-settable value.
  1.3545 +           */
  1.3546 +          lt_fatal ("Unrecognized option in %s namespace: '%s'",
  1.3547 +                    ltwrapper_option_prefix, argv[i]);
  1.3548 +        }
  1.3549 +      /* otherwise ... */
  1.3550 +      newargz[++newargc] = xstrdup (argv[i]);
  1.3551 +    }
  1.3552 +  newargz[++newargc] = NULL;
  1.3553 +
  1.3554 +  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
  1.3555 +  for (i = 0; i < newargc; i++)
  1.3556 +    {
  1.3557 +      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
  1.3558 +    }
  1.3559 +
  1.3560 +EOF
  1.3561 +
  1.3562 +	    case $host_os in
  1.3563 +	      mingw*)
  1.3564 +		cat <<"EOF"
  1.3565 +  /* execv doesn't actually work on mingw as expected on unix */
  1.3566 +  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  1.3567 +  if (rval == -1)
  1.3568 +    {
  1.3569 +      /* failed to start process */
  1.3570 +      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
  1.3571 +      return 127;
  1.3572 +    }
  1.3573 +  return rval;
  1.3574 +EOF
  1.3575 +		;;
  1.3576 +	      *)
  1.3577 +		cat <<"EOF"
  1.3578 +  execv (lt_argv_zero, newargz);
  1.3579 +  return rval; /* =127, but avoids unused variable warning */
  1.3580 +EOF
  1.3581 +		;;
  1.3582 +	    esac
  1.3583 +
  1.3584 +	    cat <<"EOF"
  1.3585 +}
  1.3586 +
  1.3587 +void *
  1.3588 +xmalloc (size_t num)
  1.3589 +{
  1.3590 +  void *p = (void *) malloc (num);
  1.3591 +  if (!p)
  1.3592 +    lt_fatal ("Memory exhausted");
  1.3593 +
  1.3594 +  return p;
  1.3595 +}
  1.3596 +
  1.3597 +char *
  1.3598 +xstrdup (const char *string)
  1.3599 +{
  1.3600 +  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  1.3601 +			  string) : NULL;
  1.3602 +}
  1.3603 +
  1.3604 +const char *
  1.3605 +base_name (const char *name)
  1.3606 +{
  1.3607 +  const char *base;
  1.3608 +
  1.3609 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3610 +  /* Skip over the disk name in MSDOS pathnames. */
  1.3611 +  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  1.3612 +    name += 2;
  1.3613 +#endif
  1.3614 +
  1.3615 +  for (base = name; *name; name++)
  1.3616 +    if (IS_DIR_SEPARATOR (*name))
  1.3617 +      base = name + 1;
  1.3618 +  return base;
  1.3619 +}
  1.3620 +
  1.3621 +int
  1.3622 +check_executable (const char *path)
  1.3623 +{
  1.3624 +  struct stat st;
  1.3625 +
  1.3626 +  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
  1.3627 +			  path ? (*path ? path : "EMPTY!") : "NULL!"));
  1.3628 +  if ((!path) || (!*path))
  1.3629 +    return 0;
  1.3630 +
  1.3631 +  if ((stat (path, &st) >= 0)
  1.3632 +      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  1.3633 +    return 1;
  1.3634 +  else
  1.3635 +    return 0;
  1.3636 +}
  1.3637 +
  1.3638 +int
  1.3639 +make_executable (const char *path)
  1.3640 +{
  1.3641 +  int rval = 0;
  1.3642 +  struct stat st;
  1.3643 +
  1.3644 +  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
  1.3645 +			  path ? (*path ? path : "EMPTY!") : "NULL!"));
  1.3646 +  if ((!path) || (!*path))
  1.3647 +    return 0;
  1.3648 +
  1.3649 +  if (stat (path, &st) >= 0)
  1.3650 +    {
  1.3651 +      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  1.3652 +    }
  1.3653 +  return rval;
  1.3654 +}
  1.3655 +
  1.3656 +/* Searches for the full path of the wrapper.  Returns
  1.3657 +   newly allocated full path name if found, NULL otherwise
  1.3658 +   Does not chase symlinks, even on platforms that support them.
  1.3659 +*/
  1.3660 +char *
  1.3661 +find_executable (const char *wrapper)
  1.3662 +{
  1.3663 +  int has_slash = 0;
  1.3664 +  const char *p;
  1.3665 +  const char *p_next;
  1.3666 +  /* static buffer for getcwd */
  1.3667 +  char tmp[LT_PATHMAX + 1];
  1.3668 +  int tmp_len;
  1.3669 +  char *concat_name;
  1.3670 +
  1.3671 +  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
  1.3672 +			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
  1.3673 +
  1.3674 +  if ((wrapper == NULL) || (*wrapper == '\0'))
  1.3675 +    return NULL;
  1.3676 +
  1.3677 +  /* Absolute path? */
  1.3678 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3679 +  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  1.3680 +    {
  1.3681 +      concat_name = xstrdup (wrapper);
  1.3682 +      if (check_executable (concat_name))
  1.3683 +	return concat_name;
  1.3684 +      XFREE (concat_name);
  1.3685 +    }
  1.3686 +  else
  1.3687 +    {
  1.3688 +#endif
  1.3689 +      if (IS_DIR_SEPARATOR (wrapper[0]))
  1.3690 +	{
  1.3691 +	  concat_name = xstrdup (wrapper);
  1.3692 +	  if (check_executable (concat_name))
  1.3693 +	    return concat_name;
  1.3694 +	  XFREE (concat_name);
  1.3695 +	}
  1.3696 +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3697 +    }
  1.3698 +#endif
  1.3699 +
  1.3700 +  for (p = wrapper; *p; p++)
  1.3701 +    if (*p == '/')
  1.3702 +      {
  1.3703 +	has_slash = 1;
  1.3704 +	break;
  1.3705 +      }
  1.3706 +  if (!has_slash)
  1.3707 +    {
  1.3708 +      /* no slashes; search PATH */
  1.3709 +      const char *path = getenv ("PATH");
  1.3710 +      if (path != NULL)
  1.3711 +	{
  1.3712 +	  for (p = path; *p; p = p_next)
  1.3713 +	    {
  1.3714 +	      const char *q;
  1.3715 +	      size_t p_len;
  1.3716 +	      for (q = p; *q; q++)
  1.3717 +		if (IS_PATH_SEPARATOR (*q))
  1.3718 +		  break;
  1.3719 +	      p_len = q - p;
  1.3720 +	      p_next = (*q == '\0' ? q : q + 1);
  1.3721 +	      if (p_len == 0)
  1.3722 +		{
  1.3723 +		  /* empty path: current directory */
  1.3724 +		  if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.3725 +		    lt_fatal ("getcwd failed");
  1.3726 +		  tmp_len = strlen (tmp);
  1.3727 +		  concat_name =
  1.3728 +		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  1.3729 +		  memcpy (concat_name, tmp, tmp_len);
  1.3730 +		  concat_name[tmp_len] = '/';
  1.3731 +		  strcpy (concat_name + tmp_len + 1, wrapper);
  1.3732 +		}
  1.3733 +	      else
  1.3734 +		{
  1.3735 +		  concat_name =
  1.3736 +		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  1.3737 +		  memcpy (concat_name, p, p_len);
  1.3738 +		  concat_name[p_len] = '/';
  1.3739 +		  strcpy (concat_name + p_len + 1, wrapper);
  1.3740 +		}
  1.3741 +	      if (check_executable (concat_name))
  1.3742 +		return concat_name;
  1.3743 +	      XFREE (concat_name);
  1.3744 +	    }
  1.3745 +	}
  1.3746 +      /* not found in PATH; assume curdir */
  1.3747 +    }
  1.3748 +  /* Relative path | not found in path: prepend cwd */
  1.3749 +  if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.3750 +    lt_fatal ("getcwd failed");
  1.3751 +  tmp_len = strlen (tmp);
  1.3752 +  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  1.3753 +  memcpy (concat_name, tmp, tmp_len);
  1.3754 +  concat_name[tmp_len] = '/';
  1.3755 +  strcpy (concat_name + tmp_len + 1, wrapper);
  1.3756 +
  1.3757 +  if (check_executable (concat_name))
  1.3758 +    return concat_name;
  1.3759 +  XFREE (concat_name);
  1.3760 +  return NULL;
  1.3761 +}
  1.3762 +
  1.3763 +char *
  1.3764 +chase_symlinks (const char *pathspec)
  1.3765 +{
  1.3766 +#ifndef S_ISLNK
  1.3767 +  return xstrdup (pathspec);
  1.3768 +#else
  1.3769 +  char buf[LT_PATHMAX];
  1.3770 +  struct stat s;
  1.3771 +  char *tmp_pathspec = xstrdup (pathspec);
  1.3772 +  char *p;
  1.3773 +  int has_symlinks = 0;
  1.3774 +  while (strlen (tmp_pathspec) && !has_symlinks)
  1.3775 +    {
  1.3776 +      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
  1.3777 +			      tmp_pathspec));
  1.3778 +      if (lstat (tmp_pathspec, &s) == 0)
  1.3779 +	{
  1.3780 +	  if (S_ISLNK (s.st_mode) != 0)
  1.3781 +	    {
  1.3782 +	      has_symlinks = 1;
  1.3783 +	      break;
  1.3784 +	    }
  1.3785 +
  1.3786 +	  /* search backwards for last DIR_SEPARATOR */
  1.3787 +	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  1.3788 +	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  1.3789 +	    p--;
  1.3790 +	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  1.3791 +	    {
  1.3792 +	      /* no more DIR_SEPARATORS left */
  1.3793 +	      break;
  1.3794 +	    }
  1.3795 +	  *p = '\0';
  1.3796 +	}
  1.3797 +      else
  1.3798 +	{
  1.3799 +	  char *errstr = strerror (errno);
  1.3800 +	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
  1.3801 +	}
  1.3802 +    }
  1.3803 +  XFREE (tmp_pathspec);
  1.3804 +
  1.3805 +  if (!has_symlinks)
  1.3806 +    {
  1.3807 +      return xstrdup (pathspec);
  1.3808 +    }
  1.3809 +
  1.3810 +  tmp_pathspec = realpath (pathspec, buf);
  1.3811 +  if (tmp_pathspec == 0)
  1.3812 +    {
  1.3813 +      lt_fatal ("Could not follow symlinks for %s", pathspec);
  1.3814 +    }
  1.3815 +  return xstrdup (tmp_pathspec);
  1.3816 +#endif
  1.3817 +}
  1.3818 +
  1.3819 +char *
  1.3820 +strendzap (char *str, const char *pat)
  1.3821 +{
  1.3822 +  size_t len, patlen;
  1.3823 +
  1.3824 +  assert (str != NULL);
  1.3825 +  assert (pat != NULL);
  1.3826 +
  1.3827 +  len = strlen (str);
  1.3828 +  patlen = strlen (pat);
  1.3829 +
  1.3830 +  if (patlen <= len)
  1.3831 +    {
  1.3832 +      str += len - patlen;
  1.3833 +      if (strcmp (str, pat) == 0)
  1.3834 +	*str = '\0';
  1.3835 +    }
  1.3836 +  return str;
  1.3837 +}
  1.3838 +
  1.3839 +static void
  1.3840 +lt_error_core (int exit_status, const char *mode,
  1.3841 +	       const char *message, va_list ap)
  1.3842 +{
  1.3843 +  fprintf (stderr, "%s: %s: ", program_name, mode);
  1.3844 +  vfprintf (stderr, message, ap);
  1.3845 +  fprintf (stderr, ".\n");
  1.3846 +
  1.3847 +  if (exit_status >= 0)
  1.3848 +    exit (exit_status);
  1.3849 +}
  1.3850 +
  1.3851 +void
  1.3852 +lt_fatal (const char *message, ...)
  1.3853 +{
  1.3854 +  va_list ap;
  1.3855 +  va_start (ap, message);
  1.3856 +  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  1.3857 +  va_end (ap);
  1.3858 +}
  1.3859 +
  1.3860 +void
  1.3861 +lt_setenv (const char *name, const char *value)
  1.3862 +{
  1.3863 +  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
  1.3864 +                          (name ? name : "<NULL>"),
  1.3865 +                          (value ? value : "<NULL>")));
  1.3866 +  {
  1.3867 +#ifdef HAVE_SETENV
  1.3868 +    /* always make a copy, for consistency with !HAVE_SETENV */
  1.3869 +    char *str = xstrdup (value);
  1.3870 +    setenv (name, str, 1);
  1.3871 +#else
  1.3872 +    int len = strlen (name) + 1 + strlen (value) + 1;
  1.3873 +    char *str = XMALLOC (char, len);
  1.3874 +    sprintf (str, "%s=%s", name, value);
  1.3875 +    if (putenv (str) != EXIT_SUCCESS)
  1.3876 +      {
  1.3877 +        XFREE (str);
  1.3878 +      }
  1.3879 +#endif
  1.3880 +  }
  1.3881 +}
  1.3882 +
  1.3883 +char *
  1.3884 +lt_extend_str (const char *orig_value, const char *add, int to_end)
  1.3885 +{
  1.3886 +  char *new_value;
  1.3887 +  if (orig_value && *orig_value)
  1.3888 +    {
  1.3889 +      int orig_value_len = strlen (orig_value);
  1.3890 +      int add_len = strlen (add);
  1.3891 +      new_value = XMALLOC (char, add_len + orig_value_len + 1);
  1.3892 +      if (to_end)
  1.3893 +        {
  1.3894 +          strcpy (new_value, orig_value);
  1.3895 +          strcpy (new_value + orig_value_len, add);
  1.3896 +        }
  1.3897 +      else
  1.3898 +        {
  1.3899 +          strcpy (new_value, add);
  1.3900 +          strcpy (new_value + add_len, orig_value);
  1.3901 +        }
  1.3902 +    }
  1.3903 +  else
  1.3904 +    {
  1.3905 +      new_value = xstrdup (add);
  1.3906 +    }
  1.3907 +  return new_value;
  1.3908 +}
  1.3909 +
  1.3910 +int
  1.3911 +lt_split_name_value (const char *arg, char** name, char** value)
  1.3912 +{
  1.3913 +  const char *p;
  1.3914 +  int len;
  1.3915 +  if (!arg || !*arg)
  1.3916 +    return 1;
  1.3917 +
  1.3918 +  p = strchr (arg, (int)'=');
  1.3919 +
  1.3920 +  if (!p)
  1.3921 +    return 1;
  1.3922 +
  1.3923 +  *value = xstrdup (++p);
  1.3924 +
  1.3925 +  len = strlen (arg) - strlen (*value);
  1.3926 +  *name = XMALLOC (char, len);
  1.3927 +  strncpy (*name, arg, len-1);
  1.3928 +  (*name)[len - 1] = '\0';
  1.3929 +
  1.3930 +  return 0;
  1.3931 +}
  1.3932 +
  1.3933 +void
  1.3934 +lt_opt_process_env_set (const char *arg)
  1.3935 +{
  1.3936 +  char *name = NULL;
  1.3937 +  char *value = NULL;
  1.3938 +
  1.3939 +  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3940 +    {
  1.3941 +      XFREE (name);
  1.3942 +      XFREE (value);
  1.3943 +      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
  1.3944 +    }
  1.3945 +
  1.3946 +  lt_setenv (name, value);
  1.3947 +  XFREE (name);
  1.3948 +  XFREE (value);
  1.3949 +}
  1.3950 +
  1.3951 +void
  1.3952 +lt_opt_process_env_prepend (const char *arg)
  1.3953 +{
  1.3954 +  char *name = NULL;
  1.3955 +  char *value = NULL;
  1.3956 +  char *new_value = NULL;
  1.3957 +
  1.3958 +  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3959 +    {
  1.3960 +      XFREE (name);
  1.3961 +      XFREE (value);
  1.3962 +      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
  1.3963 +    }
  1.3964 +
  1.3965 +  new_value = lt_extend_str (getenv (name), value, 0);
  1.3966 +  lt_setenv (name, new_value);
  1.3967 +  XFREE (new_value);
  1.3968 +  XFREE (name);
  1.3969 +  XFREE (value);
  1.3970 +}
  1.3971 +
  1.3972 +void
  1.3973 +lt_opt_process_env_append (const char *arg)
  1.3974 +{
  1.3975 +  char *name = NULL;
  1.3976 +  char *value = NULL;
  1.3977 +  char *new_value = NULL;
  1.3978 +
  1.3979 +  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3980 +    {
  1.3981 +      XFREE (name);
  1.3982 +      XFREE (value);
  1.3983 +      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
  1.3984 +    }
  1.3985 +
  1.3986 +  new_value = lt_extend_str (getenv (name), value, 1);
  1.3987 +  lt_setenv (name, new_value);
  1.3988 +  XFREE (new_value);
  1.3989 +  XFREE (name);
  1.3990 +  XFREE (value);
  1.3991 +}
  1.3992 +
  1.3993 +void
  1.3994 +lt_update_exe_path (const char *name, const char *value)
  1.3995 +{
  1.3996 +  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  1.3997 +                          (name ? name : "<NULL>"),
  1.3998 +                          (value ? value : "<NULL>")));
  1.3999 +
  1.4000 +  if (name && *name && value && *value)
  1.4001 +    {
  1.4002 +      char *new_value = lt_extend_str (getenv (name), value, 0);
  1.4003 +      /* some systems can't cope with a ':'-terminated path #' */
  1.4004 +      int len = strlen (new_value);
  1.4005 +      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  1.4006 +        {
  1.4007 +          new_value[len-1] = '\0';
  1.4008 +        }
  1.4009 +      lt_setenv (name, new_value);
  1.4010 +      XFREE (new_value);
  1.4011 +    }
  1.4012 +}
  1.4013 +
  1.4014 +void
  1.4015 +lt_update_lib_path (const char *name, const char *value)
  1.4016 +{
  1.4017 +  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  1.4018 +                          (name ? name : "<NULL>"),
  1.4019 +                          (value ? value : "<NULL>")));
  1.4020 +
  1.4021 +  if (name && *name && value && *value)
  1.4022 +    {
  1.4023 +      char *new_value = lt_extend_str (getenv (name), value, 0);
  1.4024 +      lt_setenv (name, new_value);
  1.4025 +      XFREE (new_value);
  1.4026 +    }
  1.4027 +}
  1.4028 +
  1.4029 +
  1.4030 +EOF
  1.4031 +}
  1.4032 +# end: func_emit_cwrapperexe_src
  1.4033 +
  1.4034 +# func_mode_link arg...
  1.4035 +func_mode_link ()
  1.4036 +{
  1.4037 +    $opt_debug
  1.4038 +    case $host in
  1.4039 +    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.4040 +      # It is impossible to link a dll without this setting, and
  1.4041 +      # we shouldn't force the makefile maintainer to figure out
  1.4042 +      # which system we are compiling for in order to pass an extra
  1.4043 +      # flag for every libtool invocation.
  1.4044 +      # allow_undefined=no
  1.4045 +
  1.4046 +      # FIXME: Unfortunately, there are problems with the above when trying
  1.4047 +      # to make a dll which has undefined symbols, in which case not
  1.4048 +      # even a static library is built.  For now, we need to specify
  1.4049 +      # -no-undefined on the libtool link line when we can be certain
  1.4050 +      # that all symbols are satisfied, otherwise we get a static library.
  1.4051 +      allow_undefined=yes
  1.4052 +      ;;
  1.4053 +    *)
  1.4054 +      allow_undefined=yes
  1.4055 +      ;;
  1.4056 +    esac
  1.4057 +    libtool_args=$nonopt
  1.4058 +    base_compile="$nonopt $@"
  1.4059 +    compile_command=$nonopt
  1.4060 +    finalize_command=$nonopt
  1.4061 +
  1.4062 +    compile_rpath=
  1.4063 +    finalize_rpath=
  1.4064 +    compile_shlibpath=
  1.4065 +    finalize_shlibpath=
  1.4066 +    convenience=
  1.4067 +    old_convenience=
  1.4068 +    deplibs=
  1.4069 +    old_deplibs=
  1.4070 +    compiler_flags=
  1.4071 +    linker_flags=
  1.4072 +    dllsearchpath=
  1.4073 +    lib_search_path=`pwd`
  1.4074 +    inst_prefix_dir=
  1.4075 +    new_inherited_linker_flags=
  1.4076 +
  1.4077 +    avoid_version=no
  1.4078 +    dlfiles=
  1.4079 +    dlprefiles=
  1.4080 +    dlself=no
  1.4081 +    export_dynamic=no
  1.4082 +    export_symbols=
  1.4083 +    export_symbols_regex=
  1.4084 +    generated=
  1.4085 +    libobjs=
  1.4086 +    ltlibs=
  1.4087 +    module=no
  1.4088 +    no_install=no
  1.4089 +    objs=
  1.4090 +    non_pic_objects=
  1.4091 +    precious_files_regex=
  1.4092 +    prefer_static_libs=no
  1.4093 +    preload=no
  1.4094 +    prev=
  1.4095 +    prevarg=
  1.4096 +    release=
  1.4097 +    rpath=
  1.4098 +    xrpath=
  1.4099 +    perm_rpath=
  1.4100 +    temp_rpath=
  1.4101 +    thread_safe=no
  1.4102 +    vinfo=
  1.4103 +    vinfo_number=no
  1.4104 +    weak_libs=
  1.4105 +    single_module="${wl}-single_module"
  1.4106 +    func_infer_tag $base_compile
  1.4107 +
  1.4108 +    # We need to know -static, to get the right output filenames.
  1.4109 +    for arg
  1.4110 +    do
  1.4111 +      case $arg in
  1.4112 +      -shared)
  1.4113 +	test "$build_libtool_libs" != yes && \
  1.4114 +	  func_fatal_configuration "can not build a shared library"
  1.4115 +	build_old_libs=no
  1.4116 +	break
  1.4117 +	;;
  1.4118 +      -all-static | -static | -static-libtool-libs)
  1.4119 +	case $arg in
  1.4120 +	-all-static)
  1.4121 +	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1.4122 +	    func_warning "complete static linking is impossible in this configuration"
  1.4123 +	  fi
  1.4124 +	  if test -n "$link_static_flag"; then
  1.4125 +	    dlopen_self=$dlopen_self_static
  1.4126 +	  fi
  1.4127 +	  prefer_static_libs=yes
  1.4128 +	  ;;
  1.4129 +	-static)
  1.4130 +	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1.4131 +	    dlopen_self=$dlopen_self_static
  1.4132 +	  fi
  1.4133 +	  prefer_static_libs=built
  1.4134 +	  ;;
  1.4135 +	-static-libtool-libs)
  1.4136 +	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1.4137 +	    dlopen_self=$dlopen_self_static
  1.4138 +	  fi
  1.4139 +	  prefer_static_libs=yes
  1.4140 +	  ;;
  1.4141 +	esac
  1.4142 +	build_libtool_libs=no
  1.4143 +	build_old_libs=yes
  1.4144 +	break
  1.4145 +	;;
  1.4146 +      esac
  1.4147 +    done
  1.4148 +
  1.4149 +    # See if our shared archives depend on static archives.
  1.4150 +    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1.4151 +
  1.4152 +    # Go through the arguments, transforming them on the way.
  1.4153 +    while test "$#" -gt 0; do
  1.4154 +      arg="$1"
  1.4155 +      shift
  1.4156 +      func_quote_for_eval "$arg"
  1.4157 +      qarg=$func_quote_for_eval_unquoted_result
  1.4158 +      func_append libtool_args " $func_quote_for_eval_result"
  1.4159 +
  1.4160 +      # If the previous option needs an argument, assign it.
  1.4161 +      if test -n "$prev"; then
  1.4162 +	case $prev in
  1.4163 +	output)
  1.4164 +	  func_append compile_command " @OUTPUT@"
  1.4165 +	  func_append finalize_command " @OUTPUT@"
  1.4166 +	  ;;
  1.4167 +	esac
  1.4168 +
  1.4169 +	case $prev in
  1.4170 +	dlfiles|dlprefiles)
  1.4171 +	  if test "$preload" = no; then
  1.4172 +	    # Add the symbol object into the linking commands.
  1.4173 +	    func_append compile_command " @SYMFILE@"
  1.4174 +	    func_append finalize_command " @SYMFILE@"
  1.4175 +	    preload=yes
  1.4176 +	  fi
  1.4177 +	  case $arg in
  1.4178 +	  *.la | *.lo) ;;  # We handle these cases below.
  1.4179 +	  force)
  1.4180 +	    if test "$dlself" = no; then
  1.4181 +	      dlself=needless
  1.4182 +	      export_dynamic=yes
  1.4183 +	    fi
  1.4184 +	    prev=
  1.4185 +	    continue
  1.4186 +	    ;;
  1.4187 +	  self)
  1.4188 +	    if test "$prev" = dlprefiles; then
  1.4189 +	      dlself=yes
  1.4190 +	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1.4191 +	      dlself=yes
  1.4192 +	    else
  1.4193 +	      dlself=needless
  1.4194 +	      export_dynamic=yes
  1.4195 +	    fi
  1.4196 +	    prev=
  1.4197 +	    continue
  1.4198 +	    ;;
  1.4199 +	  *)
  1.4200 +	    if test "$prev" = dlfiles; then
  1.4201 +	      dlfiles="$dlfiles $arg"
  1.4202 +	    else
  1.4203 +	      dlprefiles="$dlprefiles $arg"
  1.4204 +	    fi
  1.4205 +	    prev=
  1.4206 +	    continue
  1.4207 +	    ;;
  1.4208 +	  esac
  1.4209 +	  ;;
  1.4210 +	expsyms)
  1.4211 +	  export_symbols="$arg"
  1.4212 +	  test -f "$arg" \
  1.4213 +	    || func_fatal_error "symbol file \`$arg' does not exist"
  1.4214 +	  prev=
  1.4215 +	  continue
  1.4216 +	  ;;
  1.4217 +	expsyms_regex)
  1.4218 +	  export_symbols_regex="$arg"
  1.4219 +	  prev=
  1.4220 +	  continue
  1.4221 +	  ;;
  1.4222 +	framework)
  1.4223 +	  case $host in
  1.4224 +	    *-*-darwin*)
  1.4225 +	      case "$deplibs " in
  1.4226 +		*" $qarg.ltframework "*) ;;
  1.4227 +		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
  1.4228 +		   ;;
  1.4229 +	      esac
  1.4230 +	      ;;
  1.4231 +	  esac
  1.4232 +	  prev=
  1.4233 +	  continue
  1.4234 +	  ;;
  1.4235 +	inst_prefix)
  1.4236 +	  inst_prefix_dir="$arg"
  1.4237 +	  prev=
  1.4238 +	  continue
  1.4239 +	  ;;
  1.4240 +	objectlist)
  1.4241 +	  if test -f "$arg"; then
  1.4242 +	    save_arg=$arg
  1.4243 +	    moreargs=
  1.4244 +	    for fil in `cat "$save_arg"`
  1.4245 +	    do
  1.4246 +#	      moreargs="$moreargs $fil"
  1.4247 +	      arg=$fil
  1.4248 +	      # A libtool-controlled object.
  1.4249 +
  1.4250 +	      # Check to see that this really is a libtool object.
  1.4251 +	      if func_lalib_unsafe_p "$arg"; then
  1.4252 +		pic_object=
  1.4253 +		non_pic_object=
  1.4254 +
  1.4255 +		# Read the .lo file
  1.4256 +		func_source "$arg"
  1.4257 +
  1.4258 +		if test -z "$pic_object" ||
  1.4259 +		   test -z "$non_pic_object" ||
  1.4260 +		   test "$pic_object" = none &&
  1.4261 +		   test "$non_pic_object" = none; then
  1.4262 +		  func_fatal_error "cannot find name of object for \`$arg'"
  1.4263 +		fi
  1.4264 +
  1.4265 +		# Extract subdirectory from the argument.
  1.4266 +		func_dirname "$arg" "/" ""
  1.4267 +		xdir="$func_dirname_result"
  1.4268 +
  1.4269 +		if test "$pic_object" != none; then
  1.4270 +		  # Prepend the subdirectory the object is found in.
  1.4271 +		  pic_object="$xdir$pic_object"
  1.4272 +
  1.4273 +		  if test "$prev" = dlfiles; then
  1.4274 +		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.4275 +		      dlfiles="$dlfiles $pic_object"
  1.4276 +		      prev=
  1.4277 +		      continue
  1.4278 +		    else
  1.4279 +		      # If libtool objects are unsupported, then we need to preload.
  1.4280 +		      prev=dlprefiles
  1.4281 +		    fi
  1.4282 +		  fi
  1.4283 +
  1.4284 +		  # CHECK ME:  I think I busted this.  -Ossama
  1.4285 +		  if test "$prev" = dlprefiles; then
  1.4286 +		    # Preload the old-style object.
  1.4287 +		    dlprefiles="$dlprefiles $pic_object"
  1.4288 +		    prev=
  1.4289 +		  fi
  1.4290 +
  1.4291 +		  # A PIC object.
  1.4292 +		  func_append libobjs " $pic_object"
  1.4293 +		  arg="$pic_object"
  1.4294 +		fi
  1.4295 +
  1.4296 +		# Non-PIC object.
  1.4297 +		if test "$non_pic_object" != none; then
  1.4298 +		  # Prepend the subdirectory the object is found in.
  1.4299 +		  non_pic_object="$xdir$non_pic_object"
  1.4300 +
  1.4301 +		  # A standard non-PIC object
  1.4302 +		  func_append non_pic_objects " $non_pic_object"
  1.4303 +		  if test -z "$pic_object" || test "$pic_object" = none ; then
  1.4304 +		    arg="$non_pic_object"
  1.4305 +		  fi
  1.4306 +		else
  1.4307 +		  # If the PIC object exists, use it instead.
  1.4308 +		  # $xdir was prepended to $pic_object above.
  1.4309 +		  non_pic_object="$pic_object"
  1.4310 +		  func_append non_pic_objects " $non_pic_object"
  1.4311 +		fi
  1.4312 +	      else
  1.4313 +		# Only an error if not doing a dry-run.
  1.4314 +		if $opt_dry_run; then
  1.4315 +		  # Extract subdirectory from the argument.
  1.4316 +		  func_dirname "$arg" "/" ""
  1.4317 +		  xdir="$func_dirname_result"
  1.4318 +
  1.4319 +		  func_lo2o "$arg"
  1.4320 +		  pic_object=$xdir$objdir/$func_lo2o_result
  1.4321 +		  non_pic_object=$xdir$func_lo2o_result
  1.4322 +		  func_append libobjs " $pic_object"
  1.4323 +		  func_append non_pic_objects " $non_pic_object"
  1.4324 +	        else
  1.4325 +		  func_fatal_error "\`$arg' is not a valid libtool object"
  1.4326 +		fi
  1.4327 +	      fi
  1.4328 +	    done
  1.4329 +	  else
  1.4330 +	    func_fatal_error "link input file \`$arg' does not exist"
  1.4331 +	  fi
  1.4332 +	  arg=$save_arg
  1.4333 +	  prev=
  1.4334 +	  continue
  1.4335 +	  ;;
  1.4336 +	precious_regex)
  1.4337 +	  precious_files_regex="$arg"
  1.4338 +	  prev=
  1.4339 +	  continue
  1.4340 +	  ;;
  1.4341 +	release)
  1.4342 +	  release="-$arg"
  1.4343 +	  prev=
  1.4344 +	  continue
  1.4345 +	  ;;
  1.4346 +	rpath | xrpath)
  1.4347 +	  # We need an absolute path.
  1.4348 +	  case $arg in
  1.4349 +	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4350 +	  *)
  1.4351 +	    func_fatal_error "only absolute run-paths are allowed"
  1.4352 +	    ;;
  1.4353 +	  esac
  1.4354 +	  if test "$prev" = rpath; then
  1.4355 +	    case "$rpath " in
  1.4356 +	    *" $arg "*) ;;
  1.4357 +	    *) rpath="$rpath $arg" ;;
  1.4358 +	    esac
  1.4359 +	  else
  1.4360 +	    case "$xrpath " in
  1.4361 +	    *" $arg "*) ;;
  1.4362 +	    *) xrpath="$xrpath $arg" ;;
  1.4363 +	    esac
  1.4364 +	  fi
  1.4365 +	  prev=
  1.4366 +	  continue
  1.4367 +	  ;;
  1.4368 +	shrext)
  1.4369 +	  shrext_cmds="$arg"
  1.4370 +	  prev=
  1.4371 +	  continue
  1.4372 +	  ;;
  1.4373 +	weak)
  1.4374 +	  weak_libs="$weak_libs $arg"
  1.4375 +	  prev=
  1.4376 +	  continue
  1.4377 +	  ;;
  1.4378 +	xcclinker)
  1.4379 +	  linker_flags="$linker_flags $qarg"
  1.4380 +	  compiler_flags="$compiler_flags $qarg"
  1.4381 +	  prev=
  1.4382 +	  func_append compile_command " $qarg"
  1.4383 +	  func_append finalize_command " $qarg"
  1.4384 +	  continue
  1.4385 +	  ;;
  1.4386 +	xcompiler)
  1.4387 +	  compiler_flags="$compiler_flags $qarg"
  1.4388 +	  prev=
  1.4389 +	  func_append compile_command " $qarg"
  1.4390 +	  func_append finalize_command " $qarg"
  1.4391 +	  continue
  1.4392 +	  ;;
  1.4393 +	xlinker)
  1.4394 +	  linker_flags="$linker_flags $qarg"
  1.4395 +	  compiler_flags="$compiler_flags $wl$qarg"
  1.4396 +	  prev=
  1.4397 +	  func_append compile_command " $wl$qarg"
  1.4398 +	  func_append finalize_command " $wl$qarg"
  1.4399 +	  continue
  1.4400 +	  ;;
  1.4401 +	*)
  1.4402 +	  eval "$prev=\"\$arg\""
  1.4403 +	  prev=
  1.4404 +	  continue
  1.4405 +	  ;;
  1.4406 +	esac
  1.4407 +      fi # test -n "$prev"
  1.4408 +
  1.4409 +      prevarg="$arg"
  1.4410 +
  1.4411 +      case $arg in
  1.4412 +      -all-static)
  1.4413 +	if test -n "$link_static_flag"; then
  1.4414 +	  # See comment for -static flag below, for more details.
  1.4415 +	  func_append compile_command " $link_static_flag"
  1.4416 +	  func_append finalize_command " $link_static_flag"
  1.4417 +	fi
  1.4418 +	continue
  1.4419 +	;;
  1.4420 +
  1.4421 +      -allow-undefined)
  1.4422 +	# FIXME: remove this flag sometime in the future.
  1.4423 +	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
  1.4424 +	;;
  1.4425 +
  1.4426 +      -avoid-version)
  1.4427 +	avoid_version=yes
  1.4428 +	continue
  1.4429 +	;;
  1.4430 +
  1.4431 +      -dlopen)
  1.4432 +	prev=dlfiles
  1.4433 +	continue
  1.4434 +	;;
  1.4435 +
  1.4436 +      -dlpreopen)
  1.4437 +	prev=dlprefiles
  1.4438 +	continue
  1.4439 +	;;
  1.4440 +
  1.4441 +      -export-dynamic)
  1.4442 +	export_dynamic=yes
  1.4443 +	continue
  1.4444 +	;;
  1.4445 +
  1.4446 +      -export-symbols | -export-symbols-regex)
  1.4447 +	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1.4448 +	  func_fatal_error "more than one -exported-symbols argument is not allowed"
  1.4449 +	fi
  1.4450 +	if test "X$arg" = "X-export-symbols"; then
  1.4451 +	  prev=expsyms
  1.4452 +	else
  1.4453 +	  prev=expsyms_regex
  1.4454 +	fi
  1.4455 +	continue
  1.4456 +	;;
  1.4457 +
  1.4458 +      -framework)
  1.4459 +	prev=framework
  1.4460 +	continue
  1.4461 +	;;
  1.4462 +
  1.4463 +      -inst-prefix-dir)
  1.4464 +	prev=inst_prefix
  1.4465 +	continue
  1.4466 +	;;
  1.4467 +
  1.4468 +      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1.4469 +      # so, if we see these flags be careful not to treat them like -L
  1.4470 +      -L[A-Z][A-Z]*:*)
  1.4471 +	case $with_gcc/$host in
  1.4472 +	no/*-*-irix* | /*-*-irix*)
  1.4473 +	  func_append compile_command " $arg"
  1.4474 +	  func_append finalize_command " $arg"
  1.4475 +	  ;;
  1.4476 +	esac
  1.4477 +	continue
  1.4478 +	;;
  1.4479 +
  1.4480 +      -L*)
  1.4481 +	func_stripname '-L' '' "$arg"
  1.4482 +	dir=$func_stripname_result
  1.4483 +	if test -z "$dir"; then
  1.4484 +	  if test "$#" -gt 0; then
  1.4485 +	    func_fatal_error "require no space between \`-L' and \`$1'"
  1.4486 +	  else
  1.4487 +	    func_fatal_error "need path for \`-L' option"
  1.4488 +	  fi
  1.4489 +	fi
  1.4490 +	# We need an absolute path.
  1.4491 +	case $dir in
  1.4492 +	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4493 +	*)
  1.4494 +	  absdir=`cd "$dir" && pwd`
  1.4495 +	  test -z "$absdir" && \
  1.4496 +	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
  1.4497 +	  dir="$absdir"
  1.4498 +	  ;;
  1.4499 +	esac
  1.4500 +	case "$deplibs " in
  1.4501 +	*" -L$dir "*) ;;
  1.4502 +	*)
  1.4503 +	  deplibs="$deplibs -L$dir"
  1.4504 +	  lib_search_path="$lib_search_path $dir"
  1.4505 +	  ;;
  1.4506 +	esac
  1.4507 +	case $host in
  1.4508 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.4509 +	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  1.4510 +	  case :$dllsearchpath: in
  1.4511 +	  *":$dir:"*) ;;
  1.4512 +	  ::) dllsearchpath=$dir;;
  1.4513 +	  *) dllsearchpath="$dllsearchpath:$dir";;
  1.4514 +	  esac
  1.4515 +	  case :$dllsearchpath: in
  1.4516 +	  *":$testbindir:"*) ;;
  1.4517 +	  ::) dllsearchpath=$testbindir;;
  1.4518 +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.4519 +	  esac
  1.4520 +	  ;;
  1.4521 +	esac
  1.4522 +	continue
  1.4523 +	;;
  1.4524 +
  1.4525 +      -l*)
  1.4526 +	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1.4527 +	  case $host in
  1.4528 +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
  1.4529 +	    # These systems don't actually have a C or math library (as such)
  1.4530 +	    continue
  1.4531 +	    ;;
  1.4532 +	  *-*-os2*)
  1.4533 +	    # These systems don't actually have a C library (as such)
  1.4534 +	    test "X$arg" = "X-lc" && continue
  1.4535 +	    ;;
  1.4536 +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.4537 +	    # Do not include libc due to us having libc/libc_r.
  1.4538 +	    test "X$arg" = "X-lc" && continue
  1.4539 +	    ;;
  1.4540 +	  *-*-rhapsody* | *-*-darwin1.[012])
  1.4541 +	    # Rhapsody C and math libraries are in the System framework
  1.4542 +	    deplibs="$deplibs System.ltframework"
  1.4543 +	    continue
  1.4544 +	    ;;
  1.4545 +	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.4546 +	    # Causes problems with __ctype
  1.4547 +	    test "X$arg" = "X-lc" && continue
  1.4548 +	    ;;
  1.4549 +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.4550 +	    # Compiler inserts libc in the correct place for threads to work
  1.4551 +	    test "X$arg" = "X-lc" && continue
  1.4552 +	    ;;
  1.4553 +	  esac
  1.4554 +	elif test "X$arg" = "X-lc_r"; then
  1.4555 +	 case $host in
  1.4556 +	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.4557 +	   # Do not include libc_r directly, use -pthread flag.
  1.4558 +	   continue
  1.4559 +	   ;;
  1.4560 +	 esac
  1.4561 +	fi
  1.4562 +	deplibs="$deplibs $arg"
  1.4563 +	continue
  1.4564 +	;;
  1.4565 +
  1.4566 +      -module)
  1.4567 +	module=yes
  1.4568 +	continue
  1.4569 +	;;
  1.4570 +
  1.4571 +      # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1.4572 +      # classes, name mangling, and exception handling.
  1.4573 +      # Darwin uses the -arch flag to determine output architecture.
  1.4574 +      -model|-arch|-isysroot)
  1.4575 +	compiler_flags="$compiler_flags $arg"
  1.4576 +	func_append compile_command " $arg"
  1.4577 +	func_append finalize_command " $arg"
  1.4578 +	prev=xcompiler
  1.4579 +	continue
  1.4580 +	;;
  1.4581 +
  1.4582 +      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  1.4583 +	compiler_flags="$compiler_flags $arg"
  1.4584 +	func_append compile_command " $arg"
  1.4585 +	func_append finalize_command " $arg"
  1.4586 +	case "$new_inherited_linker_flags " in
  1.4587 +	    *" $arg "*) ;;
  1.4588 +	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
  1.4589 +	esac
  1.4590 +	continue
  1.4591 +	;;
  1.4592 +
  1.4593 +      -multi_module)
  1.4594 +	single_module="${wl}-multi_module"
  1.4595 +	continue
  1.4596 +	;;
  1.4597 +
  1.4598 +      -no-fast-install)
  1.4599 +	fast_install=no
  1.4600 +	continue
  1.4601 +	;;
  1.4602 +
  1.4603 +      -no-install)
  1.4604 +	case $host in
  1.4605 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  1.4606 +	  # The PATH hackery in wrapper scripts is required on Windows
  1.4607 +	  # and Darwin in order for the loader to find any dlls it needs.
  1.4608 +	  func_warning "\`-no-install' is ignored for $host"
  1.4609 +	  func_warning "assuming \`-no-fast-install' instead"
  1.4610 +	  fast_install=no
  1.4611 +	  ;;
  1.4612 +	*) no_install=yes ;;
  1.4613 +	esac
  1.4614 +	continue
  1.4615 +	;;
  1.4616 +
  1.4617 +      -no-undefined)
  1.4618 +	allow_undefined=no
  1.4619 +	continue
  1.4620 +	;;
  1.4621 +
  1.4622 +      -objectlist)
  1.4623 +	prev=objectlist
  1.4624 +	continue
  1.4625 +	;;
  1.4626 +
  1.4627 +      -o) prev=output ;;
  1.4628 +
  1.4629 +      -precious-files-regex)
  1.4630 +	prev=precious_regex
  1.4631 +	continue
  1.4632 +	;;
  1.4633 +
  1.4634 +      -release)
  1.4635 +	prev=release
  1.4636 +	continue
  1.4637 +	;;
  1.4638 +
  1.4639 +      -rpath)
  1.4640 +	prev=rpath
  1.4641 +	continue
  1.4642 +	;;
  1.4643 +
  1.4644 +      -R)
  1.4645 +	prev=xrpath
  1.4646 +	continue
  1.4647 +	;;
  1.4648 +
  1.4649 +      -R*)
  1.4650 +	func_stripname '-R' '' "$arg"
  1.4651 +	dir=$func_stripname_result
  1.4652 +	# We need an absolute path.
  1.4653 +	case $dir in
  1.4654 +	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4655 +	*)
  1.4656 +	  func_fatal_error "only absolute run-paths are allowed"
  1.4657 +	  ;;
  1.4658 +	esac
  1.4659 +	case "$xrpath " in
  1.4660 +	*" $dir "*) ;;
  1.4661 +	*) xrpath="$xrpath $dir" ;;
  1.4662 +	esac
  1.4663 +	continue
  1.4664 +	;;
  1.4665 +
  1.4666 +      -shared)
  1.4667 +	# The effects of -shared are defined in a previous loop.
  1.4668 +	continue
  1.4669 +	;;
  1.4670 +
  1.4671 +      -shrext)
  1.4672 +	prev=shrext
  1.4673 +	continue
  1.4674 +	;;
  1.4675 +
  1.4676 +      -static | -static-libtool-libs)
  1.4677 +	# The effects of -static are defined in a previous loop.
  1.4678 +	# We used to do the same as -all-static on platforms that
  1.4679 +	# didn't have a PIC flag, but the assumption that the effects
  1.4680 +	# would be equivalent was wrong.  It would break on at least
  1.4681 +	# Digital Unix and AIX.
  1.4682 +	continue
  1.4683 +	;;
  1.4684 +
  1.4685 +      -thread-safe)
  1.4686 +	thread_safe=yes
  1.4687 +	continue
  1.4688 +	;;
  1.4689 +
  1.4690 +      -version-info)
  1.4691 +	prev=vinfo
  1.4692 +	continue
  1.4693 +	;;
  1.4694 +
  1.4695 +      -version-number)
  1.4696 +	prev=vinfo
  1.4697 +	vinfo_number=yes
  1.4698 +	continue
  1.4699 +	;;
  1.4700 +
  1.4701 +      -weak)
  1.4702 +        prev=weak
  1.4703 +	continue
  1.4704 +	;;
  1.4705 +
  1.4706 +      -Wc,*)
  1.4707 +	func_stripname '-Wc,' '' "$arg"
  1.4708 +	args=$func_stripname_result
  1.4709 +	arg=
  1.4710 +	save_ifs="$IFS"; IFS=','
  1.4711 +	for flag in $args; do
  1.4712 +	  IFS="$save_ifs"
  1.4713 +          func_quote_for_eval "$flag"
  1.4714 +	  arg="$arg $wl$func_quote_for_eval_result"
  1.4715 +	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
  1.4716 +	done
  1.4717 +	IFS="$save_ifs"
  1.4718 +	func_stripname ' ' '' "$arg"
  1.4719 +	arg=$func_stripname_result
  1.4720 +	;;
  1.4721 +
  1.4722 +      -Wl,*)
  1.4723 +	func_stripname '-Wl,' '' "$arg"
  1.4724 +	args=$func_stripname_result
  1.4725 +	arg=
  1.4726 +	save_ifs="$IFS"; IFS=','
  1.4727 +	for flag in $args; do
  1.4728 +	  IFS="$save_ifs"
  1.4729 +          func_quote_for_eval "$flag"
  1.4730 +	  arg="$arg $wl$func_quote_for_eval_result"
  1.4731 +	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
  1.4732 +	  linker_flags="$linker_flags $func_quote_for_eval_result"
  1.4733 +	done
  1.4734 +	IFS="$save_ifs"
  1.4735 +	func_stripname ' ' '' "$arg"
  1.4736 +	arg=$func_stripname_result
  1.4737 +	;;
  1.4738 +
  1.4739 +      -Xcompiler)
  1.4740 +	prev=xcompiler
  1.4741 +	continue
  1.4742 +	;;
  1.4743 +
  1.4744 +      -Xlinker)
  1.4745 +	prev=xlinker
  1.4746 +	continue
  1.4747 +	;;
  1.4748 +
  1.4749 +      -XCClinker)
  1.4750 +	prev=xcclinker
  1.4751 +	continue
  1.4752 +	;;
  1.4753 +
  1.4754 +      # -msg_* for osf cc
  1.4755 +      -msg_*)
  1.4756 +	func_quote_for_eval "$arg"
  1.4757 +	arg="$func_quote_for_eval_result"
  1.4758 +	;;
  1.4759 +
  1.4760 +      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1.4761 +      # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1.4762 +      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1.4763 +      # +DA*, +DD* enable 64-bit mode on the HP compiler
  1.4764 +      # -q* pass through compiler args for the IBM compiler
  1.4765 +      # -m*, -t[45]*, -txscale* pass through architecture-specific
  1.4766 +      # compiler args for GCC
  1.4767 +      # -F/path gives path to uninstalled frameworks, gcc on darwin
  1.4768 +      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  1.4769 +      # @file GCC response files
  1.4770 +      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  1.4771 +      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  1.4772 +        func_quote_for_eval "$arg"
  1.4773 +	arg="$func_quote_for_eval_result"
  1.4774 +        func_append compile_command " $arg"
  1.4775 +        func_append finalize_command " $arg"
  1.4776 +        compiler_flags="$compiler_flags $arg"
  1.4777 +        continue
  1.4778 +        ;;
  1.4779 +
  1.4780 +      # Some other compiler flag.
  1.4781 +      -* | +*)
  1.4782 +        func_quote_for_eval "$arg"
  1.4783 +	arg="$func_quote_for_eval_result"
  1.4784 +	;;
  1.4785 +
  1.4786 +      *.$objext)
  1.4787 +	# A standard object.
  1.4788 +	objs="$objs $arg"
  1.4789 +	;;
  1.4790 +
  1.4791 +      *.lo)
  1.4792 +	# A libtool-controlled object.
  1.4793 +
  1.4794 +	# Check to see that this really is a libtool object.
  1.4795 +	if func_lalib_unsafe_p "$arg"; then
  1.4796 +	  pic_object=
  1.4797 +	  non_pic_object=
  1.4798 +
  1.4799 +	  # Read the .lo file
  1.4800 +	  func_source "$arg"
  1.4801 +
  1.4802 +	  if test -z "$pic_object" ||
  1.4803 +	     test -z "$non_pic_object" ||
  1.4804 +	     test "$pic_object" = none &&
  1.4805 +	     test "$non_pic_object" = none; then
  1.4806 +	    func_fatal_error "cannot find name of object for \`$arg'"
  1.4807 +	  fi
  1.4808 +
  1.4809 +	  # Extract subdirectory from the argument.
  1.4810 +	  func_dirname "$arg" "/" ""
  1.4811 +	  xdir="$func_dirname_result"
  1.4812 +
  1.4813 +	  if test "$pic_object" != none; then
  1.4814 +	    # Prepend the subdirectory the object is found in.
  1.4815 +	    pic_object="$xdir$pic_object"
  1.4816 +
  1.4817 +	    if test "$prev" = dlfiles; then
  1.4818 +	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.4819 +		dlfiles="$dlfiles $pic_object"
  1.4820 +		prev=
  1.4821 +		continue
  1.4822 +	      else
  1.4823 +		# If libtool objects are unsupported, then we need to preload.
  1.4824 +		prev=dlprefiles
  1.4825 +	      fi
  1.4826 +	    fi
  1.4827 +
  1.4828 +	    # CHECK ME:  I think I busted this.  -Ossama
  1.4829 +	    if test "$prev" = dlprefiles; then
  1.4830 +	      # Preload the old-style object.
  1.4831 +	      dlprefiles="$dlprefiles $pic_object"
  1.4832 +	      prev=
  1.4833 +	    fi
  1.4834 +
  1.4835 +	    # A PIC object.
  1.4836 +	    func_append libobjs " $pic_object"
  1.4837 +	    arg="$pic_object"
  1.4838 +	  fi
  1.4839 +
  1.4840 +	  # Non-PIC object.
  1.4841 +	  if test "$non_pic_object" != none; then
  1.4842 +	    # Prepend the subdirectory the object is found in.
  1.4843 +	    non_pic_object="$xdir$non_pic_object"
  1.4844 +
  1.4845 +	    # A standard non-PIC object
  1.4846 +	    func_append non_pic_objects " $non_pic_object"
  1.4847 +	    if test -z "$pic_object" || test "$pic_object" = none ; then
  1.4848 +	      arg="$non_pic_object"
  1.4849 +	    fi
  1.4850 +	  else
  1.4851 +	    # If the PIC object exists, use it instead.
  1.4852 +	    # $xdir was prepended to $pic_object above.
  1.4853 +	    non_pic_object="$pic_object"
  1.4854 +	    func_append non_pic_objects " $non_pic_object"
  1.4855 +	  fi
  1.4856 +	else
  1.4857 +	  # Only an error if not doing a dry-run.
  1.4858 +	  if $opt_dry_run; then
  1.4859 +	    # Extract subdirectory from the argument.
  1.4860 +	    func_dirname "$arg" "/" ""
  1.4861 +	    xdir="$func_dirname_result"
  1.4862 +
  1.4863 +	    func_lo2o "$arg"
  1.4864 +	    pic_object=$xdir$objdir/$func_lo2o_result
  1.4865 +	    non_pic_object=$xdir$func_lo2o_result
  1.4866 +	    func_append libobjs " $pic_object"
  1.4867 +	    func_append non_pic_objects " $non_pic_object"
  1.4868 +	  else
  1.4869 +	    func_fatal_error "\`$arg' is not a valid libtool object"
  1.4870 +	  fi
  1.4871 +	fi
  1.4872 +	;;
  1.4873 +
  1.4874 +      *.$libext)
  1.4875 +	# An archive.
  1.4876 +	deplibs="$deplibs $arg"
  1.4877 +	old_deplibs="$old_deplibs $arg"
  1.4878 +	continue
  1.4879 +	;;
  1.4880 +
  1.4881 +      *.la)
  1.4882 +	# A libtool-controlled library.
  1.4883 +
  1.4884 +	if test "$prev" = dlfiles; then
  1.4885 +	  # This library was specified with -dlopen.
  1.4886 +	  dlfiles="$dlfiles $arg"
  1.4887 +	  prev=
  1.4888 +	elif test "$prev" = dlprefiles; then
  1.4889 +	  # The library was specified with -dlpreopen.
  1.4890 +	  dlprefiles="$dlprefiles $arg"
  1.4891 +	  prev=
  1.4892 +	else
  1.4893 +	  deplibs="$deplibs $arg"
  1.4894 +	fi
  1.4895 +	continue
  1.4896 +	;;
  1.4897 +
  1.4898 +      # Some other compiler argument.
  1.4899 +      *)
  1.4900 +	# Unknown arguments in both finalize_command and compile_command need
  1.4901 +	# to be aesthetically quoted because they are evaled later.
  1.4902 +	func_quote_for_eval "$arg"
  1.4903 +	arg="$func_quote_for_eval_result"
  1.4904 +	;;
  1.4905 +      esac # arg
  1.4906 +
  1.4907 +      # Now actually substitute the argument into the commands.
  1.4908 +      if test -n "$arg"; then
  1.4909 +	func_append compile_command " $arg"
  1.4910 +	func_append finalize_command " $arg"
  1.4911 +      fi
  1.4912 +    done # argument parsing loop
  1.4913 +
  1.4914 +    test -n "$prev" && \
  1.4915 +      func_fatal_help "the \`$prevarg' option requires an argument"
  1.4916 +
  1.4917 +    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1.4918 +      eval arg=\"$export_dynamic_flag_spec\"
  1.4919 +      func_append compile_command " $arg"
  1.4920 +      func_append finalize_command " $arg"
  1.4921 +    fi
  1.4922 +
  1.4923 +    oldlibs=
  1.4924 +    # calculate the name of the file, without its directory
  1.4925 +    func_basename "$output"
  1.4926 +    outputname="$func_basename_result"
  1.4927 +    libobjs_save="$libobjs"
  1.4928 +
  1.4929 +    if test -n "$shlibpath_var"; then
  1.4930 +      # get the directories listed in $shlibpath_var
  1.4931 +      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1.4932 +    else
  1.4933 +      shlib_search_path=
  1.4934 +    fi
  1.4935 +    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1.4936 +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1.4937 +
  1.4938 +    func_dirname "$output" "/" ""
  1.4939 +    output_objdir="$func_dirname_result$objdir"
  1.4940 +    # Create the object directory.
  1.4941 +    func_mkdir_p "$output_objdir"
  1.4942 +
  1.4943 +    # Determine the type of output
  1.4944 +    case $output in
  1.4945 +    "")
  1.4946 +      func_fatal_help "you must specify an output file"
  1.4947 +      ;;
  1.4948 +    *.$libext) linkmode=oldlib ;;
  1.4949 +    *.lo | *.$objext) linkmode=obj ;;
  1.4950 +    *.la) linkmode=lib ;;
  1.4951 +    *) linkmode=prog ;; # Anything else should be a program.
  1.4952 +    esac
  1.4953 +
  1.4954 +    specialdeplibs=
  1.4955 +
  1.4956 +    libs=
  1.4957 +    # Find all interdependent deplibs by searching for libraries
  1.4958 +    # that are linked more than once (e.g. -la -lb -la)
  1.4959 +    for deplib in $deplibs; do
  1.4960 +      if $opt_duplicate_deps ; then
  1.4961 +	case "$libs " in
  1.4962 +	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.4963 +	esac
  1.4964 +      fi
  1.4965 +      libs="$libs $deplib"
  1.4966 +    done
  1.4967 +
  1.4968 +    if test "$linkmode" = lib; then
  1.4969 +      libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1.4970 +
  1.4971 +      # Compute libraries that are listed more than once in $predeps
  1.4972 +      # $postdeps and mark them as special (i.e., whose duplicates are
  1.4973 +      # not to be eliminated).
  1.4974 +      pre_post_deps=
  1.4975 +      if $opt_duplicate_compiler_generated_deps; then
  1.4976 +	for pre_post_dep in $predeps $postdeps; do
  1.4977 +	  case "$pre_post_deps " in
  1.4978 +	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1.4979 +	  esac
  1.4980 +	  pre_post_deps="$pre_post_deps $pre_post_dep"
  1.4981 +	done
  1.4982 +      fi
  1.4983 +      pre_post_deps=
  1.4984 +    fi
  1.4985 +
  1.4986 +    deplibs=
  1.4987 +    newdependency_libs=
  1.4988 +    newlib_search_path=
  1.4989 +    need_relink=no # whether we're linking any uninstalled libtool libraries
  1.4990 +    notinst_deplibs= # not-installed libtool libraries
  1.4991 +    notinst_path= # paths that contain not-installed libtool libraries
  1.4992 +
  1.4993 +    case $linkmode in
  1.4994 +    lib)
  1.4995 +	passes="conv dlpreopen link"
  1.4996 +	for file in $dlfiles $dlprefiles; do
  1.4997 +	  case $file in
  1.4998 +	  *.la) ;;
  1.4999 +	  *)
  1.5000 +	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
  1.5001 +	    ;;
  1.5002 +	  esac
  1.5003 +	done
  1.5004 +	;;
  1.5005 +    prog)
  1.5006 +	compile_deplibs=
  1.5007 +	finalize_deplibs=
  1.5008 +	alldeplibs=no
  1.5009 +	newdlfiles=
  1.5010 +	newdlprefiles=
  1.5011 +	passes="conv scan dlopen dlpreopen link"
  1.5012 +	;;
  1.5013 +    *)  passes="conv"
  1.5014 +	;;
  1.5015 +    esac
  1.5016 +
  1.5017 +    for pass in $passes; do
  1.5018 +      # The preopen pass in lib mode reverses $deplibs; put it back here
  1.5019 +      # so that -L comes before libs that need it for instance...
  1.5020 +      if test "$linkmode,$pass" = "lib,link"; then
  1.5021 +	## FIXME: Find the place where the list is rebuilt in the wrong
  1.5022 +	##        order, and fix it there properly
  1.5023 +        tmp_deplibs=
  1.5024 +	for deplib in $deplibs; do
  1.5025 +	  tmp_deplibs="$deplib $tmp_deplibs"
  1.5026 +	done
  1.5027 +	deplibs="$tmp_deplibs"
  1.5028 +      fi
  1.5029 +
  1.5030 +      if test "$linkmode,$pass" = "lib,link" ||
  1.5031 +	 test "$linkmode,$pass" = "prog,scan"; then
  1.5032 +	libs="$deplibs"
  1.5033 +	deplibs=
  1.5034 +      fi
  1.5035 +      if test "$linkmode" = prog; then
  1.5036 +	case $pass in
  1.5037 +	dlopen) libs="$dlfiles" ;;
  1.5038 +	dlpreopen) libs="$dlprefiles" ;;
  1.5039 +	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1.5040 +	esac
  1.5041 +      fi
  1.5042 +      if test "$linkmode,$pass" = "lib,dlpreopen"; then
  1.5043 +	# Collect and forward deplibs of preopened libtool libs
  1.5044 +	for lib in $dlprefiles; do
  1.5045 +	  # Ignore non-libtool-libs
  1.5046 +	  dependency_libs=
  1.5047 +	  case $lib in
  1.5048 +	  *.la)	func_source "$lib" ;;
  1.5049 +	  esac
  1.5050 +
  1.5051 +	  # Collect preopened libtool deplibs, except any this library
  1.5052 +	  # has declared as weak libs
  1.5053 +	  for deplib in $dependency_libs; do
  1.5054 +            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
  1.5055 +	    case " $weak_libs " in
  1.5056 +	    *" $deplib_base "*) ;;
  1.5057 +	    *) deplibs="$deplibs $deplib" ;;
  1.5058 +	    esac
  1.5059 +	  done
  1.5060 +	done
  1.5061 +	libs="$dlprefiles"
  1.5062 +      fi
  1.5063 +      if test "$pass" = dlopen; then
  1.5064 +	# Collect dlpreopened libraries
  1.5065 +	save_deplibs="$deplibs"
  1.5066 +	deplibs=
  1.5067 +      fi
  1.5068 +
  1.5069 +      for deplib in $libs; do
  1.5070 +	lib=
  1.5071 +	found=no
  1.5072 +	case $deplib in
  1.5073 +	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  1.5074 +	  if test "$linkmode,$pass" = "prog,link"; then
  1.5075 +	    compile_deplibs="$deplib $compile_deplibs"
  1.5076 +	    finalize_deplibs="$deplib $finalize_deplibs"
  1.5077 +	  else
  1.5078 +	    compiler_flags="$compiler_flags $deplib"
  1.5079 +	    if test "$linkmode" = lib ; then
  1.5080 +		case "$new_inherited_linker_flags " in
  1.5081 +		    *" $deplib "*) ;;
  1.5082 +		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  1.5083 +		esac
  1.5084 +	    fi
  1.5085 +	  fi
  1.5086 +	  continue
  1.5087 +	  ;;
  1.5088 +	-l*)
  1.5089 +	  if test "$linkmode" != lib && test "$linkmode" != prog; then
  1.5090 +	    func_warning "\`-l' is ignored for archives/objects"
  1.5091 +	    continue
  1.5092 +	  fi
  1.5093 +	  func_stripname '-l' '' "$deplib"
  1.5094 +	  name=$func_stripname_result
  1.5095 +	  if test "$linkmode" = lib; then
  1.5096 +	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  1.5097 +	  else
  1.5098 +	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  1.5099 +	  fi
  1.5100 +	  for searchdir in $searchdirs; do
  1.5101 +	    for search_ext in .la $std_shrext .so .a; do
  1.5102 +	      # Search the libtool library
  1.5103 +	      lib="$searchdir/lib${name}${search_ext}"
  1.5104 +	      if test -f "$lib"; then
  1.5105 +		if test "$search_ext" = ".la"; then
  1.5106 +		  found=yes
  1.5107 +		else
  1.5108 +		  found=no
  1.5109 +		fi
  1.5110 +		break 2
  1.5111 +	      fi
  1.5112 +	    done
  1.5113 +	  done
  1.5114 +	  if test "$found" != yes; then
  1.5115 +	    # deplib doesn't seem to be a libtool library
  1.5116 +	    if test "$linkmode,$pass" = "prog,link"; then
  1.5117 +	      compile_deplibs="$deplib $compile_deplibs"
  1.5118 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5119 +	    else
  1.5120 +	      deplibs="$deplib $deplibs"
  1.5121 +	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.5122 +	    fi
  1.5123 +	    continue
  1.5124 +	  else # deplib is a libtool library
  1.5125 +	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1.5126 +	    # We need to do some special things here, and not later.
  1.5127 +	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.5128 +	      case " $predeps $postdeps " in
  1.5129 +	      *" $deplib "*)
  1.5130 +		if func_lalib_p "$lib"; then
  1.5131 +		  library_names=
  1.5132 +		  old_library=
  1.5133 +		  func_source "$lib"
  1.5134 +		  for l in $old_library $library_names; do
  1.5135 +		    ll="$l"
  1.5136 +		  done
  1.5137 +		  if test "X$ll" = "X$old_library" ; then # only static version available
  1.5138 +		    found=no
  1.5139 +		    func_dirname "$lib" "" "."
  1.5140 +		    ladir="$func_dirname_result"
  1.5141 +		    lib=$ladir/$old_library
  1.5142 +		    if test "$linkmode,$pass" = "prog,link"; then
  1.5143 +		      compile_deplibs="$deplib $compile_deplibs"
  1.5144 +		      finalize_deplibs="$deplib $finalize_deplibs"
  1.5145 +		    else
  1.5146 +		      deplibs="$deplib $deplibs"
  1.5147 +		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.5148 +		    fi
  1.5149 +		    continue
  1.5150 +		  fi
  1.5151 +		fi
  1.5152 +		;;
  1.5153 +	      *) ;;
  1.5154 +	      esac
  1.5155 +	    fi
  1.5156 +	  fi
  1.5157 +	  ;; # -l
  1.5158 +	*.ltframework)
  1.5159 +	  if test "$linkmode,$pass" = "prog,link"; then
  1.5160 +	    compile_deplibs="$deplib $compile_deplibs"
  1.5161 +	    finalize_deplibs="$deplib $finalize_deplibs"
  1.5162 +	  else
  1.5163 +	    deplibs="$deplib $deplibs"
  1.5164 +	    if test "$linkmode" = lib ; then
  1.5165 +		case "$new_inherited_linker_flags " in
  1.5166 +		    *" $deplib "*) ;;
  1.5167 +		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  1.5168 +		esac
  1.5169 +	    fi
  1.5170 +	  fi
  1.5171 +	  continue
  1.5172 +	  ;;
  1.5173 +	-L*)
  1.5174 +	  case $linkmode in
  1.5175 +	  lib)
  1.5176 +	    deplibs="$deplib $deplibs"
  1.5177 +	    test "$pass" = conv && continue
  1.5178 +	    newdependency_libs="$deplib $newdependency_libs"
  1.5179 +	    func_stripname '-L' '' "$deplib"
  1.5180 +	    newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5181 +	    ;;
  1.5182 +	  prog)
  1.5183 +	    if test "$pass" = conv; then
  1.5184 +	      deplibs="$deplib $deplibs"
  1.5185 +	      continue
  1.5186 +	    fi
  1.5187 +	    if test "$pass" = scan; then
  1.5188 +	      deplibs="$deplib $deplibs"
  1.5189 +	    else
  1.5190 +	      compile_deplibs="$deplib $compile_deplibs"
  1.5191 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5192 +	    fi
  1.5193 +	    func_stripname '-L' '' "$deplib"
  1.5194 +	    newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5195 +	    ;;
  1.5196 +	  *)
  1.5197 +	    func_warning "\`-L' is ignored for archives/objects"
  1.5198 +	    ;;
  1.5199 +	  esac # linkmode
  1.5200 +	  continue
  1.5201 +	  ;; # -L
  1.5202 +	-R*)
  1.5203 +	  if test "$pass" = link; then
  1.5204 +	    func_stripname '-R' '' "$deplib"
  1.5205 +	    dir=$func_stripname_result
  1.5206 +	    # Make sure the xrpath contains only unique directories.
  1.5207 +	    case "$xrpath " in
  1.5208 +	    *" $dir "*) ;;
  1.5209 +	    *) xrpath="$xrpath $dir" ;;
  1.5210 +	    esac
  1.5211 +	  fi
  1.5212 +	  deplibs="$deplib $deplibs"
  1.5213 +	  continue
  1.5214 +	  ;;
  1.5215 +	*.la) lib="$deplib" ;;
  1.5216 +	*.$libext)
  1.5217 +	  if test "$pass" = conv; then
  1.5218 +	    deplibs="$deplib $deplibs"
  1.5219 +	    continue
  1.5220 +	  fi
  1.5221 +	  case $linkmode in
  1.5222 +	  lib)
  1.5223 +	    # Linking convenience modules into shared libraries is allowed,
  1.5224 +	    # but linking other static libraries is non-portable.
  1.5225 +	    case " $dlpreconveniencelibs " in
  1.5226 +	    *" $deplib "*) ;;
  1.5227 +	    *)
  1.5228 +	      valid_a_lib=no
  1.5229 +	      case $deplibs_check_method in
  1.5230 +		match_pattern*)
  1.5231 +		  set dummy $deplibs_check_method; shift
  1.5232 +		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.5233 +		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
  1.5234 +		    | $EGREP "$match_pattern_regex" > /dev/null; then
  1.5235 +		    valid_a_lib=yes
  1.5236 +		  fi
  1.5237 +		;;
  1.5238 +		pass_all)
  1.5239 +		  valid_a_lib=yes
  1.5240 +		;;
  1.5241 +	      esac
  1.5242 +	      if test "$valid_a_lib" != yes; then
  1.5243 +		$ECHO
  1.5244 +		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
  1.5245 +		$ECHO "*** I have the capability to make that library automatically link in when"
  1.5246 +		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.5247 +		$ECHO "*** shared version of the library, which you do not appear to have"
  1.5248 +		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
  1.5249 +		$ECHO "*** that it is just a static archive that I should not use here."
  1.5250 +	      else
  1.5251 +		$ECHO
  1.5252 +		$ECHO "*** Warning: Linking the shared library $output against the"
  1.5253 +		$ECHO "*** static library $deplib is not portable!"
  1.5254 +		deplibs="$deplib $deplibs"
  1.5255 +	      fi
  1.5256 +	      ;;
  1.5257 +	    esac
  1.5258 +	    continue
  1.5259 +	    ;;
  1.5260 +	  prog)
  1.5261 +	    if test "$pass" != link; then
  1.5262 +	      deplibs="$deplib $deplibs"
  1.5263 +	    else
  1.5264 +	      compile_deplibs="$deplib $compile_deplibs"
  1.5265 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5266 +	    fi
  1.5267 +	    continue
  1.5268 +	    ;;
  1.5269 +	  esac # linkmode
  1.5270 +	  ;; # *.$libext
  1.5271 +	*.lo | *.$objext)
  1.5272 +	  if test "$pass" = conv; then
  1.5273 +	    deplibs="$deplib $deplibs"
  1.5274 +	  elif test "$linkmode" = prog; then
  1.5275 +	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1.5276 +	      # If there is no dlopen support or we're linking statically,
  1.5277 +	      # we need to preload.
  1.5278 +	      newdlprefiles="$newdlprefiles $deplib"
  1.5279 +	      compile_deplibs="$deplib $compile_deplibs"
  1.5280 +	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5281 +	    else
  1.5282 +	      newdlfiles="$newdlfiles $deplib"
  1.5283 +	    fi
  1.5284 +	  fi
  1.5285 +	  continue
  1.5286 +	  ;;
  1.5287 +	%DEPLIBS%)
  1.5288 +	  alldeplibs=yes
  1.5289 +	  continue
  1.5290 +	  ;;
  1.5291 +	esac # case $deplib
  1.5292 +
  1.5293 +	if test "$found" = yes || test -f "$lib"; then :
  1.5294 +	else
  1.5295 +	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
  1.5296 +	fi
  1.5297 +
  1.5298 +	# Check to see that this really is a libtool archive.
  1.5299 +	func_lalib_unsafe_p "$lib" \
  1.5300 +	  || func_fatal_error "\`$lib' is not a valid libtool archive"
  1.5301 +
  1.5302 +	func_dirname "$lib" "" "."
  1.5303 +	ladir="$func_dirname_result"
  1.5304 +
  1.5305 +	dlname=
  1.5306 +	dlopen=
  1.5307 +	dlpreopen=
  1.5308 +	libdir=
  1.5309 +	library_names=
  1.5310 +	old_library=
  1.5311 +	inherited_linker_flags=
  1.5312 +	# If the library was installed with an old release of libtool,
  1.5313 +	# it will not redefine variables installed, or shouldnotlink
  1.5314 +	installed=yes
  1.5315 +	shouldnotlink=no
  1.5316 +	avoidtemprpath=
  1.5317 +
  1.5318 +
  1.5319 +	# Read the .la file
  1.5320 +	func_source "$lib"
  1.5321 +
  1.5322 +	# Convert "-framework foo" to "foo.ltframework"
  1.5323 +	if test -n "$inherited_linker_flags"; then
  1.5324 +	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
  1.5325 +	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  1.5326 +	    case " $new_inherited_linker_flags " in
  1.5327 +	      *" $tmp_inherited_linker_flag "*) ;;
  1.5328 +	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
  1.5329 +	    esac
  1.5330 +	  done
  1.5331 +	fi
  1.5332 +	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.5333 +	if test "$linkmode,$pass" = "lib,link" ||
  1.5334 +	   test "$linkmode,$pass" = "prog,scan" ||
  1.5335 +	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  1.5336 +	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1.5337 +	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1.5338 +	fi
  1.5339 +
  1.5340 +	if test "$pass" = conv; then
  1.5341 +	  # Only check for convenience libraries
  1.5342 +	  deplibs="$lib $deplibs"
  1.5343 +	  if test -z "$libdir"; then
  1.5344 +	    if test -z "$old_library"; then
  1.5345 +	      func_fatal_error "cannot find name of link library for \`$lib'"
  1.5346 +	    fi
  1.5347 +	    # It is a libtool convenience library, so add in its objects.
  1.5348 +	    convenience="$convenience $ladir/$objdir/$old_library"
  1.5349 +	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1.5350 +	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  1.5351 +	    func_fatal_error "\`$lib' is not a convenience library"
  1.5352 +	  fi
  1.5353 +	  tmp_libs=
  1.5354 +	  for deplib in $dependency_libs; do
  1.5355 +	    deplibs="$deplib $deplibs"
  1.5356 +	    if $opt_duplicate_deps ; then
  1.5357 +	      case "$tmp_libs " in
  1.5358 +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5359 +	      esac
  1.5360 +	    fi
  1.5361 +	    tmp_libs="$tmp_libs $deplib"
  1.5362 +	  done
  1.5363 +	  continue
  1.5364 +	fi # $pass = conv
  1.5365 +
  1.5366 +
  1.5367 +	# Get the name of the library we link against.
  1.5368 +	linklib=
  1.5369 +	for l in $old_library $library_names; do
  1.5370 +	  linklib="$l"
  1.5371 +	done
  1.5372 +	if test -z "$linklib"; then
  1.5373 +	  func_fatal_error "cannot find name of link library for \`$lib'"
  1.5374 +	fi
  1.5375 +
  1.5376 +	# This library was specified with -dlopen.
  1.5377 +	if test "$pass" = dlopen; then
  1.5378 +	  if test -z "$libdir"; then
  1.5379 +	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
  1.5380 +	  fi
  1.5381 +	  if test -z "$dlname" ||
  1.5382 +	     test "$dlopen_support" != yes ||
  1.5383 +	     test "$build_libtool_libs" = no; then
  1.5384 +	    # If there is no dlname, no dlopen support or we're linking
  1.5385 +	    # statically, we need to preload.  We also need to preload any
  1.5386 +	    # dependent libraries so libltdl's deplib preloader doesn't
  1.5387 +	    # bomb out in the load deplibs phase.
  1.5388 +	    dlprefiles="$dlprefiles $lib $dependency_libs"
  1.5389 +	  else
  1.5390 +	    newdlfiles="$newdlfiles $lib"
  1.5391 +	  fi
  1.5392 +	  continue
  1.5393 +	fi # $pass = dlopen
  1.5394 +
  1.5395 +	# We need an absolute path.
  1.5396 +	case $ladir in
  1.5397 +	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1.5398 +	*)
  1.5399 +	  abs_ladir=`cd "$ladir" && pwd`
  1.5400 +	  if test -z "$abs_ladir"; then
  1.5401 +	    func_warning "cannot determine absolute directory name of \`$ladir'"
  1.5402 +	    func_warning "passing it literally to the linker, although it might fail"
  1.5403 +	    abs_ladir="$ladir"
  1.5404 +	  fi
  1.5405 +	  ;;
  1.5406 +	esac
  1.5407 +	func_basename "$lib"
  1.5408 +	laname="$func_basename_result"
  1.5409 +
  1.5410 +	# Find the relevant object directory and library name.
  1.5411 +	if test "X$installed" = Xyes; then
  1.5412 +	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.5413 +	    func_warning "library \`$lib' was moved."
  1.5414 +	    dir="$ladir"
  1.5415 +	    absdir="$abs_ladir"
  1.5416 +	    libdir="$abs_ladir"
  1.5417 +	  else
  1.5418 +	    dir="$libdir"
  1.5419 +	    absdir="$libdir"
  1.5420 +	  fi
  1.5421 +	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  1.5422 +	else
  1.5423 +	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.5424 +	    dir="$ladir"
  1.5425 +	    absdir="$abs_ladir"
  1.5426 +	    # Remove this search path later
  1.5427 +	    notinst_path="$notinst_path $abs_ladir"
  1.5428 +	  else
  1.5429 +	    dir="$ladir/$objdir"
  1.5430 +	    absdir="$abs_ladir/$objdir"
  1.5431 +	    # Remove this search path later
  1.5432 +	    notinst_path="$notinst_path $abs_ladir"
  1.5433 +	  fi
  1.5434 +	fi # $installed = yes
  1.5435 +	func_stripname 'lib' '.la' "$laname"
  1.5436 +	name=$func_stripname_result
  1.5437 +
  1.5438 +	# This library was specified with -dlpreopen.
  1.5439 +	if test "$pass" = dlpreopen; then
  1.5440 +	  if test -z "$libdir" && test "$linkmode" = prog; then
  1.5441 +	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
  1.5442 +	  fi
  1.5443 +	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  1.5444 +	  # are required to link).
  1.5445 +	  if test -n "$old_library"; then
  1.5446 +	    newdlprefiles="$newdlprefiles $dir/$old_library"
  1.5447 +	    # Keep a list of preopened convenience libraries to check
  1.5448 +	    # that they are being used correctly in the link pass.
  1.5449 +	    test -z "$libdir" && \
  1.5450 +		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
  1.5451 +	  # Otherwise, use the dlname, so that lt_dlopen finds it.
  1.5452 +	  elif test -n "$dlname"; then
  1.5453 +	    newdlprefiles="$newdlprefiles $dir/$dlname"
  1.5454 +	  else
  1.5455 +	    newdlprefiles="$newdlprefiles $dir/$linklib"
  1.5456 +	  fi
  1.5457 +	fi # $pass = dlpreopen
  1.5458 +
  1.5459 +	if test -z "$libdir"; then
  1.5460 +	  # Link the convenience library
  1.5461 +	  if test "$linkmode" = lib; then
  1.5462 +	    deplibs="$dir/$old_library $deplibs"
  1.5463 +	  elif test "$linkmode,$pass" = "prog,link"; then
  1.5464 +	    compile_deplibs="$dir/$old_library $compile_deplibs"
  1.5465 +	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1.5466 +	  else
  1.5467 +	    deplibs="$lib $deplibs" # used for prog,scan pass
  1.5468 +	  fi
  1.5469 +	  continue
  1.5470 +	fi
  1.5471 +
  1.5472 +
  1.5473 +	if test "$linkmode" = prog && test "$pass" != link; then
  1.5474 +	  newlib_search_path="$newlib_search_path $ladir"
  1.5475 +	  deplibs="$lib $deplibs"
  1.5476 +
  1.5477 +	  linkalldeplibs=no
  1.5478 +	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1.5479 +	     test "$build_libtool_libs" = no; then
  1.5480 +	    linkalldeplibs=yes
  1.5481 +	  fi
  1.5482 +
  1.5483 +	  tmp_libs=
  1.5484 +	  for deplib in $dependency_libs; do
  1.5485 +	    case $deplib in
  1.5486 +	    -L*) func_stripname '-L' '' "$deplib"
  1.5487 +	         newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5488 +		 ;;
  1.5489 +	    esac
  1.5490 +	    # Need to link against all dependency_libs?
  1.5491 +	    if test "$linkalldeplibs" = yes; then
  1.5492 +	      deplibs="$deplib $deplibs"
  1.5493 +	    else
  1.5494 +	      # Need to hardcode shared library paths
  1.5495 +	      # or/and link against static libraries
  1.5496 +	      newdependency_libs="$deplib $newdependency_libs"
  1.5497 +	    fi
  1.5498 +	    if $opt_duplicate_deps ; then
  1.5499 +	      case "$tmp_libs " in
  1.5500 +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5501 +	      esac
  1.5502 +	    fi
  1.5503 +	    tmp_libs="$tmp_libs $deplib"
  1.5504 +	  done # for deplib
  1.5505 +	  continue
  1.5506 +	fi # $linkmode = prog...
  1.5507 +
  1.5508 +	if test "$linkmode,$pass" = "prog,link"; then
  1.5509 +	  if test -n "$library_names" &&
  1.5510 +	     { { test "$prefer_static_libs" = no ||
  1.5511 +	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
  1.5512 +	       test -z "$old_library"; }; then
  1.5513 +	    # We need to hardcode the library path
  1.5514 +	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  1.5515 +	      # Make sure the rpath contains only unique directories.
  1.5516 +	      case "$temp_rpath:" in
  1.5517 +	      *"$absdir:"*) ;;
  1.5518 +	      *) temp_rpath="$temp_rpath$absdir:" ;;
  1.5519 +	      esac
  1.5520 +	    fi
  1.5521 +
  1.5522 +	    # Hardcode the library path.
  1.5523 +	    # Skip directories that are in the system default run-time
  1.5524 +	    # search path.
  1.5525 +	    case " $sys_lib_dlsearch_path " in
  1.5526 +	    *" $absdir "*) ;;
  1.5527 +	    *)
  1.5528 +	      case "$compile_rpath " in
  1.5529 +	      *" $absdir "*) ;;
  1.5530 +	      *) compile_rpath="$compile_rpath $absdir"
  1.5531 +	      esac
  1.5532 +	      ;;
  1.5533 +	    esac
  1.5534 +	    case " $sys_lib_dlsearch_path " in
  1.5535 +	    *" $libdir "*) ;;
  1.5536 +	    *)
  1.5537 +	      case "$finalize_rpath " in
  1.5538 +	      *" $libdir "*) ;;
  1.5539 +	      *) finalize_rpath="$finalize_rpath $libdir"
  1.5540 +	      esac
  1.5541 +	      ;;
  1.5542 +	    esac
  1.5543 +	  fi # $linkmode,$pass = prog,link...
  1.5544 +
  1.5545 +	  if test "$alldeplibs" = yes &&
  1.5546 +	     { test "$deplibs_check_method" = pass_all ||
  1.5547 +	       { test "$build_libtool_libs" = yes &&
  1.5548 +		 test -n "$library_names"; }; }; then
  1.5549 +	    # We only need to search for static libraries
  1.5550 +	    continue
  1.5551 +	  fi
  1.5552 +	fi
  1.5553 +
  1.5554 +	link_static=no # Whether the deplib will be linked statically
  1.5555 +	use_static_libs=$prefer_static_libs
  1.5556 +	if test "$use_static_libs" = built && test "$installed" = yes; then
  1.5557 +	  use_static_libs=no
  1.5558 +	fi
  1.5559 +	if test -n "$library_names" &&
  1.5560 +	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
  1.5561 +	  case $host in
  1.5562 +	  *cygwin* | *mingw* | *cegcc*)
  1.5563 +	      # No point in relinking DLLs because paths are not encoded
  1.5564 +	      notinst_deplibs="$notinst_deplibs $lib"
  1.5565 +	      need_relink=no
  1.5566 +	    ;;
  1.5567 +	  *)
  1.5568 +	    if test "$installed" = no; then
  1.5569 +	      notinst_deplibs="$notinst_deplibs $lib"
  1.5570 +	      need_relink=yes
  1.5571 +	    fi
  1.5572 +	    ;;
  1.5573 +	  esac
  1.5574 +	  # This is a shared library
  1.5575 +
  1.5576 +	  # Warn about portability, can't link against -module's on some
  1.5577 +	  # systems (darwin).  Don't bleat about dlopened modules though!
  1.5578 +	  dlopenmodule=""
  1.5579 +	  for dlpremoduletest in $dlprefiles; do
  1.5580 +	    if test "X$dlpremoduletest" = "X$lib"; then
  1.5581 +	      dlopenmodule="$dlpremoduletest"
  1.5582 +	      break
  1.5583 +	    fi
  1.5584 +	  done
  1.5585 +	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  1.5586 +	    $ECHO
  1.5587 +	    if test "$linkmode" = prog; then
  1.5588 +	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
  1.5589 +	    else
  1.5590 +	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  1.5591 +	    fi
  1.5592 +	    $ECHO "*** $linklib is not portable!"
  1.5593 +	  fi
  1.5594 +	  if test "$linkmode" = lib &&
  1.5595 +	     test "$hardcode_into_libs" = yes; then
  1.5596 +	    # Hardcode the library path.
  1.5597 +	    # Skip directories that are in the system default run-time
  1.5598 +	    # search path.
  1.5599 +	    case " $sys_lib_dlsearch_path " in
  1.5600 +	    *" $absdir "*) ;;
  1.5601 +	    *)
  1.5602 +	      case "$compile_rpath " in
  1.5603 +	      *" $absdir "*) ;;
  1.5604 +	      *) compile_rpath="$compile_rpath $absdir"
  1.5605 +	      esac
  1.5606 +	      ;;
  1.5607 +	    esac
  1.5608 +	    case " $sys_lib_dlsearch_path " in
  1.5609 +	    *" $libdir "*) ;;
  1.5610 +	    *)
  1.5611 +	      case "$finalize_rpath " in
  1.5612 +	      *" $libdir "*) ;;
  1.5613 +	      *) finalize_rpath="$finalize_rpath $libdir"
  1.5614 +	      esac
  1.5615 +	      ;;
  1.5616 +	    esac
  1.5617 +	  fi
  1.5618 +
  1.5619 +	  if test -n "$old_archive_from_expsyms_cmds"; then
  1.5620 +	    # figure out the soname
  1.5621 +	    set dummy $library_names
  1.5622 +	    shift
  1.5623 +	    realname="$1"
  1.5624 +	    shift
  1.5625 +	    libname=`eval "\\$ECHO \"$libname_spec\""`
  1.5626 +	    # use dlname if we got it. it's perfectly good, no?
  1.5627 +	    if test -n "$dlname"; then
  1.5628 +	      soname="$dlname"
  1.5629 +	    elif test -n "$soname_spec"; then
  1.5630 +	      # bleh windows
  1.5631 +	      case $host in
  1.5632 +	      *cygwin* | mingw* | *cegcc*)
  1.5633 +	        func_arith $current - $age
  1.5634 +		major=$func_arith_result
  1.5635 +		versuffix="-$major"
  1.5636 +		;;
  1.5637 +	      esac
  1.5638 +	      eval soname=\"$soname_spec\"
  1.5639 +	    else
  1.5640 +	      soname="$realname"
  1.5641 +	    fi
  1.5642 +
  1.5643 +	    # Make a new name for the extract_expsyms_cmds to use
  1.5644 +	    soroot="$soname"
  1.5645 +	    func_basename "$soroot"
  1.5646 +	    soname="$func_basename_result"
  1.5647 +	    func_stripname 'lib' '.dll' "$soname"
  1.5648 +	    newlib=libimp-$func_stripname_result.a
  1.5649 +
  1.5650 +	    # If the library has no export list, then create one now
  1.5651 +	    if test -f "$output_objdir/$soname-def"; then :
  1.5652 +	    else
  1.5653 +	      func_verbose "extracting exported symbol list from \`$soname'"
  1.5654 +	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  1.5655 +	    fi
  1.5656 +
  1.5657 +	    # Create $newlib
  1.5658 +	    if test -f "$output_objdir/$newlib"; then :; else
  1.5659 +	      func_verbose "generating import library for \`$soname'"
  1.5660 +	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  1.5661 +	    fi
  1.5662 +	    # make sure the library variables are pointing to the new library
  1.5663 +	    dir=$output_objdir
  1.5664 +	    linklib=$newlib
  1.5665 +	  fi # test -n "$old_archive_from_expsyms_cmds"
  1.5666 +
  1.5667 +	  if test "$linkmode" = prog || test "$mode" != relink; then
  1.5668 +	    add_shlibpath=
  1.5669 +	    add_dir=
  1.5670 +	    add=
  1.5671 +	    lib_linked=yes
  1.5672 +	    case $hardcode_action in
  1.5673 +	    immediate | unsupported)
  1.5674 +	      if test "$hardcode_direct" = no; then
  1.5675 +		add="$dir/$linklib"
  1.5676 +		case $host in
  1.5677 +		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  1.5678 +		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  1.5679 +		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  1.5680 +		    *-*-unixware7*) add_dir="-L$dir" ;;
  1.5681 +		  *-*-darwin* )
  1.5682 +		    # if the lib is a (non-dlopened) module then we can not
  1.5683 +		    # link against it, someone is ignoring the earlier warnings
  1.5684 +		    if /usr/bin/file -L $add 2> /dev/null |
  1.5685 +			 $GREP ": [^:]* bundle" >/dev/null ; then
  1.5686 +		      if test "X$dlopenmodule" != "X$lib"; then
  1.5687 +			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
  1.5688 +			if test -z "$old_library" ; then
  1.5689 +			  $ECHO
  1.5690 +			  $ECHO "*** And there doesn't seem to be a static archive available"
  1.5691 +			  $ECHO "*** The link will probably fail, sorry"
  1.5692 +			else
  1.5693 +			  add="$dir/$old_library"
  1.5694 +			fi
  1.5695 +		      elif test -n "$old_library"; then
  1.5696 +			add="$dir/$old_library"
  1.5697 +		      fi
  1.5698 +		    fi
  1.5699 +		esac
  1.5700 +	      elif test "$hardcode_minus_L" = no; then
  1.5701 +		case $host in
  1.5702 +		*-*-sunos*) add_shlibpath="$dir" ;;
  1.5703 +		esac
  1.5704 +		add_dir="-L$dir"
  1.5705 +		add="-l$name"
  1.5706 +	      elif test "$hardcode_shlibpath_var" = no; then
  1.5707 +		add_shlibpath="$dir"
  1.5708 +		add="-l$name"
  1.5709 +	      else
  1.5710 +		lib_linked=no
  1.5711 +	      fi
  1.5712 +	      ;;
  1.5713 +	    relink)
  1.5714 +	      if test "$hardcode_direct" = yes &&
  1.5715 +	         test "$hardcode_direct_absolute" = no; then
  1.5716 +		add="$dir/$linklib"
  1.5717 +	      elif test "$hardcode_minus_L" = yes; then
  1.5718 +		add_dir="-L$dir"
  1.5719 +		# Try looking first in the location we're being installed to.
  1.5720 +		if test -n "$inst_prefix_dir"; then
  1.5721 +		  case $libdir in
  1.5722 +		    [\\/]*)
  1.5723 +		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.5724 +		      ;;
  1.5725 +		  esac
  1.5726 +		fi
  1.5727 +		add="-l$name"
  1.5728 +	      elif test "$hardcode_shlibpath_var" = yes; then
  1.5729 +		add_shlibpath="$dir"
  1.5730 +		add="-l$name"
  1.5731 +	      else
  1.5732 +		lib_linked=no
  1.5733 +	      fi
  1.5734 +	      ;;
  1.5735 +	    *) lib_linked=no ;;
  1.5736 +	    esac
  1.5737 +
  1.5738 +	    if test "$lib_linked" != yes; then
  1.5739 +	      func_fatal_configuration "unsupported hardcode properties"
  1.5740 +	    fi
  1.5741 +
  1.5742 +	    if test -n "$add_shlibpath"; then
  1.5743 +	      case :$compile_shlibpath: in
  1.5744 +	      *":$add_shlibpath:"*) ;;
  1.5745 +	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1.5746 +	      esac
  1.5747 +	    fi
  1.5748 +	    if test "$linkmode" = prog; then
  1.5749 +	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  1.5750 +	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
  1.5751 +	    else
  1.5752 +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.5753 +	      test -n "$add" && deplibs="$add $deplibs"
  1.5754 +	      if test "$hardcode_direct" != yes &&
  1.5755 +		 test "$hardcode_minus_L" != yes &&
  1.5756 +		 test "$hardcode_shlibpath_var" = yes; then
  1.5757 +		case :$finalize_shlibpath: in
  1.5758 +		*":$libdir:"*) ;;
  1.5759 +		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.5760 +		esac
  1.5761 +	      fi
  1.5762 +	    fi
  1.5763 +	  fi
  1.5764 +
  1.5765 +	  if test "$linkmode" = prog || test "$mode" = relink; then
  1.5766 +	    add_shlibpath=
  1.5767 +	    add_dir=
  1.5768 +	    add=
  1.5769 +	    # Finalize command for both is simple: just hardcode it.
  1.5770 +	    if test "$hardcode_direct" = yes &&
  1.5771 +	       test "$hardcode_direct_absolute" = no; then
  1.5772 +	      add="$libdir/$linklib"
  1.5773 +	    elif test "$hardcode_minus_L" = yes; then
  1.5774 +	      add_dir="-L$libdir"
  1.5775 +	      add="-l$name"
  1.5776 +	    elif test "$hardcode_shlibpath_var" = yes; then
  1.5777 +	      case :$finalize_shlibpath: in
  1.5778 +	      *":$libdir:"*) ;;
  1.5779 +	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.5780 +	      esac
  1.5781 +	      add="-l$name"
  1.5782 +	    elif test "$hardcode_automatic" = yes; then
  1.5783 +	      if test -n "$inst_prefix_dir" &&
  1.5784 +		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
  1.5785 +		add="$inst_prefix_dir$libdir/$linklib"
  1.5786 +	      else
  1.5787 +		add="$libdir/$linklib"
  1.5788 +	      fi
  1.5789 +	    else
  1.5790 +	      # We cannot seem to hardcode it, guess we'll fake it.
  1.5791 +	      add_dir="-L$libdir"
  1.5792 +	      # Try looking first in the location we're being installed to.
  1.5793 +	      if test -n "$inst_prefix_dir"; then
  1.5794 +		case $libdir in
  1.5795 +		  [\\/]*)
  1.5796 +		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.5797 +		    ;;
  1.5798 +		esac
  1.5799 +	      fi
  1.5800 +	      add="-l$name"
  1.5801 +	    fi
  1.5802 +
  1.5803 +	    if test "$linkmode" = prog; then
  1.5804 +	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  1.5805 +	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  1.5806 +	    else
  1.5807 +	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.5808 +	      test -n "$add" && deplibs="$add $deplibs"
  1.5809 +	    fi
  1.5810 +	  fi
  1.5811 +	elif test "$linkmode" = prog; then
  1.5812 +	  # Here we assume that one of hardcode_direct or hardcode_minus_L
  1.5813 +	  # is not unsupported.  This is valid on all known static and
  1.5814 +	  # shared platforms.
  1.5815 +	  if test "$hardcode_direct" != unsupported; then
  1.5816 +	    test -n "$old_library" && linklib="$old_library"
  1.5817 +	    compile_deplibs="$dir/$linklib $compile_deplibs"
  1.5818 +	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
  1.5819 +	  else
  1.5820 +	    compile_deplibs="-l$name -L$dir $compile_deplibs"
  1.5821 +	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  1.5822 +	  fi
  1.5823 +	elif test "$build_libtool_libs" = yes; then
  1.5824 +	  # Not a shared library
  1.5825 +	  if test "$deplibs_check_method" != pass_all; then
  1.5826 +	    # We're trying link a shared library against a static one
  1.5827 +	    # but the system doesn't support it.
  1.5828 +
  1.5829 +	    # Just print a warning and add the library to dependency_libs so
  1.5830 +	    # that the program can be linked against the static library.
  1.5831 +	    $ECHO
  1.5832 +	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
  1.5833 +	    $ECHO "*** I have the capability to make that library automatically link in when"
  1.5834 +	    $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.5835 +	    $ECHO "*** shared version of the library, which you do not appear to have."
  1.5836 +	    if test "$module" = yes; then
  1.5837 +	      $ECHO "*** But as you try to build a module library, libtool will still create "
  1.5838 +	      $ECHO "*** a static module, that should work as long as the dlopening application"
  1.5839 +	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
  1.5840 +	      if test -z "$global_symbol_pipe"; then
  1.5841 +		$ECHO
  1.5842 +		$ECHO "*** However, this would only work if libtool was able to extract symbol"
  1.5843 +		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.5844 +		$ECHO "*** not find such a program.  So, this module is probably useless."
  1.5845 +		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  1.5846 +	      fi
  1.5847 +	      if test "$build_old_libs" = no; then
  1.5848 +		build_libtool_libs=module
  1.5849 +		build_old_libs=yes
  1.5850 +	      else
  1.5851 +		build_libtool_libs=no
  1.5852 +	      fi
  1.5853 +	    fi
  1.5854 +	  else
  1.5855 +	    deplibs="$dir/$old_library $deplibs"
  1.5856 +	    link_static=yes
  1.5857 +	  fi
  1.5858 +	fi # link shared/static library?
  1.5859 +
  1.5860 +	if test "$linkmode" = lib; then
  1.5861 +	  if test -n "$dependency_libs" &&
  1.5862 +	     { test "$hardcode_into_libs" != yes ||
  1.5863 +	       test "$build_old_libs" = yes ||
  1.5864 +	       test "$link_static" = yes; }; then
  1.5865 +	    # Extract -R from dependency_libs
  1.5866 +	    temp_deplibs=
  1.5867 +	    for libdir in $dependency_libs; do
  1.5868 +	      case $libdir in
  1.5869 +	      -R*) func_stripname '-R' '' "$libdir"
  1.5870 +	           temp_xrpath=$func_stripname_result
  1.5871 +		   case " $xrpath " in
  1.5872 +		   *" $temp_xrpath "*) ;;
  1.5873 +		   *) xrpath="$xrpath $temp_xrpath";;
  1.5874 +		   esac;;
  1.5875 +	      *) temp_deplibs="$temp_deplibs $libdir";;
  1.5876 +	      esac
  1.5877 +	    done
  1.5878 +	    dependency_libs="$temp_deplibs"
  1.5879 +	  fi
  1.5880 +
  1.5881 +	  newlib_search_path="$newlib_search_path $absdir"
  1.5882 +	  # Link against this library
  1.5883 +	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  1.5884 +	  # ... and its dependency_libs
  1.5885 +	  tmp_libs=
  1.5886 +	  for deplib in $dependency_libs; do
  1.5887 +	    newdependency_libs="$deplib $newdependency_libs"
  1.5888 +	    if $opt_duplicate_deps ; then
  1.5889 +	      case "$tmp_libs " in
  1.5890 +	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5891 +	      esac
  1.5892 +	    fi
  1.5893 +	    tmp_libs="$tmp_libs $deplib"
  1.5894 +	  done
  1.5895 +
  1.5896 +	  if test "$link_all_deplibs" != no; then
  1.5897 +	    # Add the search paths of all dependency libraries
  1.5898 +	    for deplib in $dependency_libs; do
  1.5899 +	      case $deplib in
  1.5900 +	      -L*) path="$deplib" ;;
  1.5901 +	      *.la)
  1.5902 +	        func_dirname "$deplib" "" "."
  1.5903 +		dir="$func_dirname_result"
  1.5904 +		# We need an absolute path.
  1.5905 +		case $dir in
  1.5906 +		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1.5907 +		*)
  1.5908 +		  absdir=`cd "$dir" && pwd`
  1.5909 +		  if test -z "$absdir"; then
  1.5910 +		    func_warning "cannot determine absolute directory name of \`$dir'"
  1.5911 +		    absdir="$dir"
  1.5912 +		  fi
  1.5913 +		  ;;
  1.5914 +		esac
  1.5915 +		if $GREP "^installed=no" $deplib > /dev/null; then
  1.5916 +		case $host in
  1.5917 +		*-*-darwin*)
  1.5918 +		  depdepl=
  1.5919 +		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  1.5920 +		  if test -n "$deplibrary_names" ; then
  1.5921 +		    for tmp in $deplibrary_names ; do
  1.5922 +		      depdepl=$tmp
  1.5923 +		    done
  1.5924 +		    if test -f "$absdir/$objdir/$depdepl" ; then
  1.5925 +		      depdepl="$absdir/$objdir/$depdepl"
  1.5926 +		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  1.5927 +                      if test -z "$darwin_install_name"; then
  1.5928 +                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
  1.5929 +                      fi
  1.5930 +		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  1.5931 +		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
  1.5932 +		      path=
  1.5933 +		    fi
  1.5934 +		  fi
  1.5935 +		  ;;
  1.5936 +		*)
  1.5937 +		  path="-L$absdir/$objdir"
  1.5938 +		  ;;
  1.5939 +		esac
  1.5940 +		else
  1.5941 +		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.5942 +		  test -z "$libdir" && \
  1.5943 +		    func_fatal_error "\`$deplib' is not a valid libtool archive"
  1.5944 +		  test "$absdir" != "$libdir" && \
  1.5945 +		    func_warning "\`$deplib' seems to be moved"
  1.5946 +
  1.5947 +		  path="-L$absdir"
  1.5948 +		fi
  1.5949 +		;;
  1.5950 +	      esac
  1.5951 +	      case " $deplibs " in
  1.5952 +	      *" $path "*) ;;
  1.5953 +	      *) deplibs="$path $deplibs" ;;
  1.5954 +	      esac
  1.5955 +	    done
  1.5956 +	  fi # link_all_deplibs != no
  1.5957 +	fi # linkmode = lib
  1.5958 +      done # for deplib in $libs
  1.5959 +      if test "$pass" = link; then
  1.5960 +	if test "$linkmode" = "prog"; then
  1.5961 +	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  1.5962 +	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  1.5963 +	else
  1.5964 +	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.5965 +	fi
  1.5966 +      fi
  1.5967 +      dependency_libs="$newdependency_libs"
  1.5968 +      if test "$pass" = dlpreopen; then
  1.5969 +	# Link the dlpreopened libraries before other libraries
  1.5970 +	for deplib in $save_deplibs; do
  1.5971 +	  deplibs="$deplib $deplibs"
  1.5972 +	done
  1.5973 +      fi
  1.5974 +      if test "$pass" != dlopen; then
  1.5975 +	if test "$pass" != conv; then
  1.5976 +	  # Make sure lib_search_path contains only unique directories.
  1.5977 +	  lib_search_path=
  1.5978 +	  for dir in $newlib_search_path; do
  1.5979 +	    case "$lib_search_path " in
  1.5980 +	    *" $dir "*) ;;
  1.5981 +	    *) lib_search_path="$lib_search_path $dir" ;;
  1.5982 +	    esac
  1.5983 +	  done
  1.5984 +	  newlib_search_path=
  1.5985 +	fi
  1.5986 +
  1.5987 +	if test "$linkmode,$pass" != "prog,link"; then
  1.5988 +	  vars="deplibs"
  1.5989 +	else
  1.5990 +	  vars="compile_deplibs finalize_deplibs"
  1.5991 +	fi
  1.5992 +	for var in $vars dependency_libs; do
  1.5993 +	  # Add libraries to $var in reverse order
  1.5994 +	  eval tmp_libs=\"\$$var\"
  1.5995 +	  new_libs=
  1.5996 +	  for deplib in $tmp_libs; do
  1.5997 +	    # FIXME: Pedantically, this is the right thing to do, so
  1.5998 +	    #        that some nasty dependency loop isn't accidentally
  1.5999 +	    #        broken:
  1.6000 +	    #new_libs="$deplib $new_libs"
  1.6001 +	    # Pragmatically, this seems to cause very few problems in
  1.6002 +	    # practice:
  1.6003 +	    case $deplib in
  1.6004 +	    -L*) new_libs="$deplib $new_libs" ;;
  1.6005 +	    -R*) ;;
  1.6006 +	    *)
  1.6007 +	      # And here is the reason: when a library appears more
  1.6008 +	      # than once as an explicit dependence of a library, or
  1.6009 +	      # is implicitly linked in more than once by the
  1.6010 +	      # compiler, it is considered special, and multiple
  1.6011 +	      # occurrences thereof are not removed.  Compare this
  1.6012 +	      # with having the same library being listed as a
  1.6013 +	      # dependency of multiple other libraries: in this case,
  1.6014 +	      # we know (pedantically, we assume) the library does not
  1.6015 +	      # need to be listed more than once, so we keep only the
  1.6016 +	      # last copy.  This is not always right, but it is rare
  1.6017 +	      # enough that we require users that really mean to play
  1.6018 +	      # such unportable linking tricks to link the library
  1.6019 +	      # using -Wl,-lname, so that libtool does not consider it
  1.6020 +	      # for duplicate removal.
  1.6021 +	      case " $specialdeplibs " in
  1.6022 +	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
  1.6023 +	      *)
  1.6024 +		case " $new_libs " in
  1.6025 +		*" $deplib "*) ;;
  1.6026 +		*) new_libs="$deplib $new_libs" ;;
  1.6027 +		esac
  1.6028 +		;;
  1.6029 +	      esac
  1.6030 +	      ;;
  1.6031 +	    esac
  1.6032 +	  done
  1.6033 +	  tmp_libs=
  1.6034 +	  for deplib in $new_libs; do
  1.6035 +	    case $deplib in
  1.6036 +	    -L*)
  1.6037 +	      case " $tmp_libs " in
  1.6038 +	      *" $deplib "*) ;;
  1.6039 +	      *) tmp_libs="$tmp_libs $deplib" ;;
  1.6040 +	      esac
  1.6041 +	      ;;
  1.6042 +	    *) tmp_libs="$tmp_libs $deplib" ;;
  1.6043 +	    esac
  1.6044 +	  done
  1.6045 +	  eval $var=\"$tmp_libs\"
  1.6046 +	done # for var
  1.6047 +      fi
  1.6048 +      # Last step: remove runtime libs from dependency_libs
  1.6049 +      # (they stay in deplibs)
  1.6050 +      tmp_libs=
  1.6051 +      for i in $dependency_libs ; do
  1.6052 +	case " $predeps $postdeps $compiler_lib_search_path " in
  1.6053 +	*" $i "*)
  1.6054 +	  i=""
  1.6055 +	  ;;
  1.6056 +	esac
  1.6057 +	if test -n "$i" ; then
  1.6058 +	  tmp_libs="$tmp_libs $i"
  1.6059 +	fi
  1.6060 +      done
  1.6061 +      dependency_libs=$tmp_libs
  1.6062 +    done # for pass
  1.6063 +    if test "$linkmode" = prog; then
  1.6064 +      dlfiles="$newdlfiles"
  1.6065 +    fi
  1.6066 +    if test "$linkmode" = prog || test "$linkmode" = lib; then
  1.6067 +      dlprefiles="$newdlprefiles"
  1.6068 +    fi
  1.6069 +
  1.6070 +    case $linkmode in
  1.6071 +    oldlib)
  1.6072 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.6073 +	func_warning "\`-dlopen' is ignored for archives"
  1.6074 +      fi
  1.6075 +
  1.6076 +      case " $deplibs" in
  1.6077 +      *\ -l* | *\ -L*)
  1.6078 +	func_warning "\`-l' and \`-L' are ignored for archives" ;;
  1.6079 +      esac
  1.6080 +
  1.6081 +      test -n "$rpath" && \
  1.6082 +	func_warning "\`-rpath' is ignored for archives"
  1.6083 +
  1.6084 +      test -n "$xrpath" && \
  1.6085 +	func_warning "\`-R' is ignored for archives"
  1.6086 +
  1.6087 +      test -n "$vinfo" && \
  1.6088 +	func_warning "\`-version-info/-version-number' is ignored for archives"
  1.6089 +
  1.6090 +      test -n "$release" && \
  1.6091 +	func_warning "\`-release' is ignored for archives"
  1.6092 +
  1.6093 +      test -n "$export_symbols$export_symbols_regex" && \
  1.6094 +	func_warning "\`-export-symbols' is ignored for archives"
  1.6095 +
  1.6096 +      # Now set the variables for building old libraries.
  1.6097 +      build_libtool_libs=no
  1.6098 +      oldlibs="$output"
  1.6099 +      objs="$objs$old_deplibs"
  1.6100 +      ;;
  1.6101 +
  1.6102 +    lib)
  1.6103 +      # Make sure we only generate libraries of the form `libNAME.la'.
  1.6104 +      case $outputname in
  1.6105 +      lib*)
  1.6106 +	func_stripname 'lib' '.la' "$outputname"
  1.6107 +	name=$func_stripname_result
  1.6108 +	eval shared_ext=\"$shrext_cmds\"
  1.6109 +	eval libname=\"$libname_spec\"
  1.6110 +	;;
  1.6111 +      *)
  1.6112 +	test "$module" = no && \
  1.6113 +	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
  1.6114 +
  1.6115 +	if test "$need_lib_prefix" != no; then
  1.6116 +	  # Add the "lib" prefix for modules if required
  1.6117 +	  func_stripname '' '.la' "$outputname"
  1.6118 +	  name=$func_stripname_result
  1.6119 +	  eval shared_ext=\"$shrext_cmds\"
  1.6120 +	  eval libname=\"$libname_spec\"
  1.6121 +	else
  1.6122 +	  func_stripname '' '.la' "$outputname"
  1.6123 +	  libname=$func_stripname_result
  1.6124 +	fi
  1.6125 +	;;
  1.6126 +      esac
  1.6127 +
  1.6128 +      if test -n "$objs"; then
  1.6129 +	if test "$deplibs_check_method" != pass_all; then
  1.6130 +	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
  1.6131 +	else
  1.6132 +	  $ECHO
  1.6133 +	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  1.6134 +	  $ECHO "*** objects $objs is not portable!"
  1.6135 +	  libobjs="$libobjs $objs"
  1.6136 +	fi
  1.6137 +      fi
  1.6138 +
  1.6139 +      test "$dlself" != no && \
  1.6140 +	func_warning "\`-dlopen self' is ignored for libtool libraries"
  1.6141 +
  1.6142 +      set dummy $rpath
  1.6143 +      shift
  1.6144 +      test "$#" -gt 1 && \
  1.6145 +	func_warning "ignoring multiple \`-rpath's for a libtool library"
  1.6146 +
  1.6147 +      install_libdir="$1"
  1.6148 +
  1.6149 +      oldlibs=
  1.6150 +      if test -z "$rpath"; then
  1.6151 +	if test "$build_libtool_libs" = yes; then
  1.6152 +	  # Building a libtool convenience library.
  1.6153 +	  # Some compilers have problems with a `.al' extension so
  1.6154 +	  # convenience libraries should have the same extension an
  1.6155 +	  # archive normally would.
  1.6156 +	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1.6157 +	  build_libtool_libs=convenience
  1.6158 +	  build_old_libs=yes
  1.6159 +	fi
  1.6160 +
  1.6161 +	test -n "$vinfo" && \
  1.6162 +	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
  1.6163 +
  1.6164 +	test -n "$release" && \
  1.6165 +	  func_warning "\`-release' is ignored for convenience libraries"
  1.6166 +      else
  1.6167 +
  1.6168 +	# Parse the version information argument.
  1.6169 +	save_ifs="$IFS"; IFS=':'
  1.6170 +	set dummy $vinfo 0 0 0
  1.6171 +	shift
  1.6172 +	IFS="$save_ifs"
  1.6173 +
  1.6174 +	test -n "$7" && \
  1.6175 +	  func_fatal_help "too many parameters to \`-version-info'"
  1.6176 +
  1.6177 +	# convert absolute version numbers to libtool ages
  1.6178 +	# this retains compatibility with .la files and attempts
  1.6179 +	# to make the code below a bit more comprehensible
  1.6180 +
  1.6181 +	case $vinfo_number in
  1.6182 +	yes)
  1.6183 +	  number_major="$1"
  1.6184 +	  number_minor="$2"
  1.6185 +	  number_revision="$3"
  1.6186 +	  #
  1.6187 +	  # There are really only two kinds -- those that
  1.6188 +	  # use the current revision as the major version
  1.6189 +	  # and those that subtract age and use age as
  1.6190 +	  # a minor version.  But, then there is irix
  1.6191 +	  # which has an extra 1 added just for fun
  1.6192 +	  #
  1.6193 +	  case $version_type in
  1.6194 +	  darwin|linux|osf|windows|none)
  1.6195 +	    func_arith $number_major + $number_minor
  1.6196 +	    current=$func_arith_result
  1.6197 +	    age="$number_minor"
  1.6198 +	    revision="$number_revision"
  1.6199 +	    ;;
  1.6200 +	  freebsd-aout|freebsd-elf|sunos)
  1.6201 +	    current="$number_major"
  1.6202 +	    revision="$number_minor"
  1.6203 +	    age="0"
  1.6204 +	    ;;
  1.6205 +	  irix|nonstopux)
  1.6206 +	    func_arith $number_major + $number_minor
  1.6207 +	    current=$func_arith_result
  1.6208 +	    age="$number_minor"
  1.6209 +	    revision="$number_minor"
  1.6210 +	    lt_irix_increment=no
  1.6211 +	    ;;
  1.6212 +	  esac
  1.6213 +	  ;;
  1.6214 +	no)
  1.6215 +	  current="$1"
  1.6216 +	  revision="$2"
  1.6217 +	  age="$3"
  1.6218 +	  ;;
  1.6219 +	esac
  1.6220 +
  1.6221 +	# Check that each of the things are valid numbers.
  1.6222 +	case $current in
  1.6223 +	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]) ;;
  1.6224 +	*)
  1.6225 +	  func_error "CURRENT \`$current' must be a nonnegative integer"
  1.6226 +	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6227 +	  ;;
  1.6228 +	esac
  1.6229 +
  1.6230 +	case $revision in
  1.6231 +	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]) ;;
  1.6232 +	*)
  1.6233 +	  func_error "REVISION \`$revision' must be a nonnegative integer"
  1.6234 +	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6235 +	  ;;
  1.6236 +	esac
  1.6237 +
  1.6238 +	case $age in
  1.6239 +	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]) ;;
  1.6240 +	*)
  1.6241 +	  func_error "AGE \`$age' must be a nonnegative integer"
  1.6242 +	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6243 +	  ;;
  1.6244 +	esac
  1.6245 +
  1.6246 +	if test "$age" -gt "$current"; then
  1.6247 +	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
  1.6248 +	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6249 +	fi
  1.6250 +
  1.6251 +	# Calculate the version variables.
  1.6252 +	major=
  1.6253 +	versuffix=
  1.6254 +	verstring=
  1.6255 +	case $version_type in
  1.6256 +	none) ;;
  1.6257 +
  1.6258 +	darwin)
  1.6259 +	  # Like Linux, but with the current version available in
  1.6260 +	  # verstring for coding it into the library header
  1.6261 +	  func_arith $current - $age
  1.6262 +	  major=.$func_arith_result
  1.6263 +	  versuffix="$major.$age.$revision"
  1.6264 +	  # Darwin ld doesn't like 0 for these options...
  1.6265 +	  func_arith $current + 1
  1.6266 +	  minor_current=$func_arith_result
  1.6267 +	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  1.6268 +	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  1.6269 +	  ;;
  1.6270 +
  1.6271 +	freebsd-aout)
  1.6272 +	  major=".$current"
  1.6273 +	  versuffix=".$current.$revision";
  1.6274 +	  ;;
  1.6275 +
  1.6276 +	freebsd-elf)
  1.6277 +	  major=".$current"
  1.6278 +	  versuffix=".$current"
  1.6279 +	  ;;
  1.6280 +
  1.6281 +	irix | nonstopux)
  1.6282 +	  if test "X$lt_irix_increment" = "Xno"; then
  1.6283 +	    func_arith $current - $age
  1.6284 +	  else
  1.6285 +	    func_arith $current - $age + 1
  1.6286 +	  fi
  1.6287 +	  major=$func_arith_result
  1.6288 +
  1.6289 +	  case $version_type in
  1.6290 +	    nonstopux) verstring_prefix=nonstopux ;;
  1.6291 +	    *)         verstring_prefix=sgi ;;
  1.6292 +	  esac
  1.6293 +	  verstring="$verstring_prefix$major.$revision"
  1.6294 +
  1.6295 +	  # Add in all the interfaces that we are compatible with.
  1.6296 +	  loop=$revision
  1.6297 +	  while test "$loop" -ne 0; do
  1.6298 +	    func_arith $revision - $loop
  1.6299 +	    iface=$func_arith_result
  1.6300 +	    func_arith $loop - 1
  1.6301 +	    loop=$func_arith_result
  1.6302 +	    verstring="$verstring_prefix$major.$iface:$verstring"
  1.6303 +	  done
  1.6304 +
  1.6305 +	  # Before this point, $major must not contain `.'.
  1.6306 +	  major=.$major
  1.6307 +	  versuffix="$major.$revision"
  1.6308 +	  ;;
  1.6309 +
  1.6310 +	linux)
  1.6311 +	  func_arith $current - $age
  1.6312 +	  major=.$func_arith_result
  1.6313 +	  versuffix="$major.$age.$revision"
  1.6314 +	  ;;
  1.6315 +
  1.6316 +	osf)
  1.6317 +	  func_arith $current - $age
  1.6318 +	  major=.$func_arith_result
  1.6319 +	  versuffix=".$current.$age.$revision"
  1.6320 +	  verstring="$current.$age.$revision"
  1.6321 +
  1.6322 +	  # Add in all the interfaces that we are compatible with.
  1.6323 +	  loop=$age
  1.6324 +	  while test "$loop" -ne 0; do
  1.6325 +	    func_arith $current - $loop
  1.6326 +	    iface=$func_arith_result
  1.6327 +	    func_arith $loop - 1
  1.6328 +	    loop=$func_arith_result
  1.6329 +	    verstring="$verstring:${iface}.0"
  1.6330 +	  done
  1.6331 +
  1.6332 +	  # Make executables depend on our current version.
  1.6333 +	  verstring="$verstring:${current}.0"
  1.6334 +	  ;;
  1.6335 +
  1.6336 +	qnx)
  1.6337 +	  major=".$current"
  1.6338 +	  versuffix=".$current"
  1.6339 +	  ;;
  1.6340 +
  1.6341 +	sunos)
  1.6342 +	  major=".$current"
  1.6343 +	  versuffix=".$current.$revision"
  1.6344 +	  ;;
  1.6345 +
  1.6346 +	windows)
  1.6347 +	  # Use '-' rather than '.', since we only want one
  1.6348 +	  # extension on DOS 8.3 filesystems.
  1.6349 +	  func_arith $current - $age
  1.6350 +	  major=$func_arith_result
  1.6351 +	  versuffix="-$major"
  1.6352 +	  ;;
  1.6353 +
  1.6354 +	*)
  1.6355 +	  func_fatal_configuration "unknown library version type \`$version_type'"
  1.6356 +	  ;;
  1.6357 +	esac
  1.6358 +
  1.6359 +	# Clear the version info if we defaulted, and they specified a release.
  1.6360 +	if test -z "$vinfo" && test -n "$release"; then
  1.6361 +	  major=
  1.6362 +	  case $version_type in
  1.6363 +	  darwin)
  1.6364 +	    # we can't check for "0.0" in archive_cmds due to quoting
  1.6365 +	    # problems, so we reset it completely
  1.6366 +	    verstring=
  1.6367 +	    ;;
  1.6368 +	  *)
  1.6369 +	    verstring="0.0"
  1.6370 +	    ;;
  1.6371 +	  esac
  1.6372 +	  if test "$need_version" = no; then
  1.6373 +	    versuffix=
  1.6374 +	  else
  1.6375 +	    versuffix=".0.0"
  1.6376 +	  fi
  1.6377 +	fi
  1.6378 +
  1.6379 +	# Remove version info from name if versioning should be avoided
  1.6380 +	if test "$avoid_version" = yes && test "$need_version" = no; then
  1.6381 +	  major=
  1.6382 +	  versuffix=
  1.6383 +	  verstring=""
  1.6384 +	fi
  1.6385 +
  1.6386 +	# Check to see if the archive will have undefined symbols.
  1.6387 +	if test "$allow_undefined" = yes; then
  1.6388 +	  if test "$allow_undefined_flag" = unsupported; then
  1.6389 +	    func_warning "undefined symbols not allowed in $host shared libraries"
  1.6390 +	    build_libtool_libs=no
  1.6391 +	    build_old_libs=yes
  1.6392 +	  fi
  1.6393 +	else
  1.6394 +	  # Don't allow undefined symbols.
  1.6395 +	  allow_undefined_flag="$no_undefined_flag"
  1.6396 +	fi
  1.6397 +
  1.6398 +      fi
  1.6399 +
  1.6400 +      func_generate_dlsyms "$libname" "$libname" "yes"
  1.6401 +      libobjs="$libobjs $symfileobj"
  1.6402 +      test "X$libobjs" = "X " && libobjs=
  1.6403 +
  1.6404 +      if test "$mode" != relink; then
  1.6405 +	# Remove our outputs, but don't remove object files since they
  1.6406 +	# may have been created when compiling PIC objects.
  1.6407 +	removelist=
  1.6408 +	tempremovelist=`$ECHO "$output_objdir/*"`
  1.6409 +	for p in $tempremovelist; do
  1.6410 +	  case $p in
  1.6411 +	    *.$objext | *.gcno)
  1.6412 +	       ;;
  1.6413 +	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  1.6414 +	       if test "X$precious_files_regex" != "X"; then
  1.6415 +		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  1.6416 +		 then
  1.6417 +		   continue
  1.6418 +		 fi
  1.6419 +	       fi
  1.6420 +	       removelist="$removelist $p"
  1.6421 +	       ;;
  1.6422 +	    *) ;;
  1.6423 +	  esac
  1.6424 +	done
  1.6425 +	test -n "$removelist" && \
  1.6426 +	  func_show_eval "${RM}r \$removelist"
  1.6427 +      fi
  1.6428 +
  1.6429 +      # Now set the variables for building old libraries.
  1.6430 +      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1.6431 +	oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1.6432 +
  1.6433 +	# Transform .lo files to .o files.
  1.6434 +	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1.6435 +      fi
  1.6436 +
  1.6437 +      # Eliminate all temporary directories.
  1.6438 +      #for path in $notinst_path; do
  1.6439 +      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
  1.6440 +      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
  1.6441 +      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
  1.6442 +      #done
  1.6443 +
  1.6444 +      if test -n "$xrpath"; then
  1.6445 +	# If the user specified any rpath flags, then add them.
  1.6446 +	temp_xrpath=
  1.6447 +	for libdir in $xrpath; do
  1.6448 +	  temp_xrpath="$temp_xrpath -R$libdir"
  1.6449 +	  case "$finalize_rpath " in
  1.6450 +	  *" $libdir "*) ;;
  1.6451 +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.6452 +	  esac
  1.6453 +	done
  1.6454 +	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  1.6455 +	  dependency_libs="$temp_xrpath $dependency_libs"
  1.6456 +	fi
  1.6457 +      fi
  1.6458 +
  1.6459 +      # Make sure dlfiles contains only unique files that won't be dlpreopened
  1.6460 +      old_dlfiles="$dlfiles"
  1.6461 +      dlfiles=
  1.6462 +      for lib in $old_dlfiles; do
  1.6463 +	case " $dlprefiles $dlfiles " in
  1.6464 +	*" $lib "*) ;;
  1.6465 +	*) dlfiles="$dlfiles $lib" ;;
  1.6466 +	esac
  1.6467 +      done
  1.6468 +
  1.6469 +      # Make sure dlprefiles contains only unique files
  1.6470 +      old_dlprefiles="$dlprefiles"
  1.6471 +      dlprefiles=
  1.6472 +      for lib in $old_dlprefiles; do
  1.6473 +	case "$dlprefiles " in
  1.6474 +	*" $lib "*) ;;
  1.6475 +	*) dlprefiles="$dlprefiles $lib" ;;
  1.6476 +	esac
  1.6477 +      done
  1.6478 +
  1.6479 +      if test "$build_libtool_libs" = yes; then
  1.6480 +	if test -n "$rpath"; then
  1.6481 +	  case $host in
  1.6482 +	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
  1.6483 +	    # these systems don't actually have a c library (as such)!
  1.6484 +	    ;;
  1.6485 +	  *-*-rhapsody* | *-*-darwin1.[012])
  1.6486 +	    # Rhapsody C library is in the System framework
  1.6487 +	    deplibs="$deplibs System.ltframework"
  1.6488 +	    ;;
  1.6489 +	  *-*-netbsd*)
  1.6490 +	    # Don't link with libc until the a.out ld.so is fixed.
  1.6491 +	    ;;
  1.6492 +	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.6493 +	    # Do not include libc due to us having libc/libc_r.
  1.6494 +	    ;;
  1.6495 +	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.6496 +	    # Causes problems with __ctype
  1.6497 +	    ;;
  1.6498 +	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.6499 +	    # Compiler inserts libc in the correct place for threads to work
  1.6500 +	    ;;
  1.6501 +	  *)
  1.6502 +	    # Add libc to deplibs on all other systems if necessary.
  1.6503 +	    if test "$build_libtool_need_lc" = "yes"; then
  1.6504 +	      deplibs="$deplibs -lc"
  1.6505 +	    fi
  1.6506 +	    ;;
  1.6507 +	  esac
  1.6508 +	fi
  1.6509 +
  1.6510 +	# Transform deplibs into only deplibs that can be linked in shared.
  1.6511 +	name_save=$name
  1.6512 +	libname_save=$libname
  1.6513 +	release_save=$release
  1.6514 +	versuffix_save=$versuffix
  1.6515 +	major_save=$major
  1.6516 +	# I'm not sure if I'm treating the release correctly.  I think
  1.6517 +	# release should show up in the -l (ie -lgmp5) so we don't want to
  1.6518 +	# add it in twice.  Is that correct?
  1.6519 +	release=""
  1.6520 +	versuffix=""
  1.6521 +	major=""
  1.6522 +	newdeplibs=
  1.6523 +	droppeddeps=no
  1.6524 +	case $deplibs_check_method in
  1.6525 +	pass_all)
  1.6526 +	  # Don't check for shared/static.  Everything works.
  1.6527 +	  # This might be a little naive.  We might want to check
  1.6528 +	  # whether the library exists or not.  But this is on
  1.6529 +	  # osf3 & osf4 and I'm not really sure... Just
  1.6530 +	  # implementing what was already the behavior.
  1.6531 +	  newdeplibs=$deplibs
  1.6532 +	  ;;
  1.6533 +	test_compile)
  1.6534 +	  # This code stresses the "libraries are programs" paradigm to its
  1.6535 +	  # limits. Maybe even breaks it.  We compile a program, linking it
  1.6536 +	  # against the deplibs as a proxy for the library.  Then we can check
  1.6537 +	  # whether they linked in statically or dynamically with ldd.
  1.6538 +	  $opt_dry_run || $RM conftest.c
  1.6539 +	  cat > conftest.c <<EOF
  1.6540 +	  int main() { return 0; }
  1.6541 +EOF
  1.6542 +	  $opt_dry_run || $RM conftest
  1.6543 +	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  1.6544 +	    ldd_output=`ldd conftest`
  1.6545 +	    for i in $deplibs; do
  1.6546 +	      case $i in
  1.6547 +	      -l*)
  1.6548 +		func_stripname -l '' "$i"
  1.6549 +		name=$func_stripname_result
  1.6550 +		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6551 +		  case " $predeps $postdeps " in
  1.6552 +		  *" $i "*)
  1.6553 +		    newdeplibs="$newdeplibs $i"
  1.6554 +		    i=""
  1.6555 +		    ;;
  1.6556 +		  esac
  1.6557 +		fi
  1.6558 +		if test -n "$i" ; then
  1.6559 +		  libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6560 +		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  1.6561 +		  set dummy $deplib_matches; shift
  1.6562 +		  deplib_match=$1
  1.6563 +		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.6564 +		    newdeplibs="$newdeplibs $i"
  1.6565 +		  else
  1.6566 +		    droppeddeps=yes
  1.6567 +		    $ECHO
  1.6568 +		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  1.6569 +		    $ECHO "*** I have the capability to make that library automatically link in when"
  1.6570 +		    $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6571 +		    $ECHO "*** shared version of the library, which I believe you do not have"
  1.6572 +		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
  1.6573 +		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
  1.6574 +		  fi
  1.6575 +		fi
  1.6576 +		;;
  1.6577 +	      *)
  1.6578 +		newdeplibs="$newdeplibs $i"
  1.6579 +		;;
  1.6580 +	      esac
  1.6581 +	    done
  1.6582 +	  else
  1.6583 +	    # Error occurred in the first compile.  Let's try to salvage
  1.6584 +	    # the situation: Compile a separate program for each library.
  1.6585 +	    for i in $deplibs; do
  1.6586 +	      case $i in
  1.6587 +	      -l*)
  1.6588 +		func_stripname -l '' "$i"
  1.6589 +		name=$func_stripname_result
  1.6590 +		$opt_dry_run || $RM conftest
  1.6591 +		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  1.6592 +		  ldd_output=`ldd conftest`
  1.6593 +		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6594 +		    case " $predeps $postdeps " in
  1.6595 +		    *" $i "*)
  1.6596 +		      newdeplibs="$newdeplibs $i"
  1.6597 +		      i=""
  1.6598 +		      ;;
  1.6599 +		    esac
  1.6600 +		  fi
  1.6601 +		  if test -n "$i" ; then
  1.6602 +		    libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6603 +		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  1.6604 +		    set dummy $deplib_matches; shift
  1.6605 +		    deplib_match=$1
  1.6606 +		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.6607 +		      newdeplibs="$newdeplibs $i"
  1.6608 +		    else
  1.6609 +		      droppeddeps=yes
  1.6610 +		      $ECHO
  1.6611 +		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  1.6612 +		      $ECHO "*** I have the capability to make that library automatically link in when"
  1.6613 +		      $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6614 +		      $ECHO "*** shared version of the library, which you do not appear to have"
  1.6615 +		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
  1.6616 +		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
  1.6617 +		    fi
  1.6618 +		  fi
  1.6619 +		else
  1.6620 +		  droppeddeps=yes
  1.6621 +		  $ECHO
  1.6622 +		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
  1.6623 +		  $ECHO "*** make it link in!  You will probably need to install it or some"
  1.6624 +		  $ECHO "*** library that it depends on before this library will be fully"
  1.6625 +		  $ECHO "*** functional.  Installing it before continuing would be even better."
  1.6626 +		fi
  1.6627 +		;;
  1.6628 +	      *)
  1.6629 +		newdeplibs="$newdeplibs $i"
  1.6630 +		;;
  1.6631 +	      esac
  1.6632 +	    done
  1.6633 +	  fi
  1.6634 +	  ;;
  1.6635 +	file_magic*)
  1.6636 +	  set dummy $deplibs_check_method; shift
  1.6637 +	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.6638 +	  for a_deplib in $deplibs; do
  1.6639 +	    case $a_deplib in
  1.6640 +	    -l*)
  1.6641 +	      func_stripname -l '' "$a_deplib"
  1.6642 +	      name=$func_stripname_result
  1.6643 +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6644 +		case " $predeps $postdeps " in
  1.6645 +		*" $a_deplib "*)
  1.6646 +		  newdeplibs="$newdeplibs $a_deplib"
  1.6647 +		  a_deplib=""
  1.6648 +		  ;;
  1.6649 +		esac
  1.6650 +	      fi
  1.6651 +	      if test -n "$a_deplib" ; then
  1.6652 +		libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6653 +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.6654 +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.6655 +		  for potent_lib in $potential_libs; do
  1.6656 +		      # Follow soft links.
  1.6657 +		      if ls -lLd "$potent_lib" 2>/dev/null |
  1.6658 +			 $GREP " -> " >/dev/null; then
  1.6659 +			continue
  1.6660 +		      fi
  1.6661 +		      # The statement above tries to avoid entering an
  1.6662 +		      # endless loop below, in case of cyclic links.
  1.6663 +		      # We might still enter an endless loop, since a link
  1.6664 +		      # loop can be closed while we follow links,
  1.6665 +		      # but so what?
  1.6666 +		      potlib="$potent_lib"
  1.6667 +		      while test -h "$potlib" 2>/dev/null; do
  1.6668 +			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  1.6669 +			case $potliblink in
  1.6670 +			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1.6671 +			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1.6672 +			esac
  1.6673 +		      done
  1.6674 +		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  1.6675 +			 $SED -e 10q |
  1.6676 +			 $EGREP "$file_magic_regex" > /dev/null; then
  1.6677 +			newdeplibs="$newdeplibs $a_deplib"
  1.6678 +			a_deplib=""
  1.6679 +			break 2
  1.6680 +		      fi
  1.6681 +		  done
  1.6682 +		done
  1.6683 +	      fi
  1.6684 +	      if test -n "$a_deplib" ; then
  1.6685 +		droppeddeps=yes
  1.6686 +		$ECHO
  1.6687 +		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  1.6688 +		$ECHO "*** I have the capability to make that library automatically link in when"
  1.6689 +		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6690 +		$ECHO "*** shared version of the library, which you do not appear to have"
  1.6691 +		$ECHO "*** because I did check the linker path looking for a file starting"
  1.6692 +		if test -z "$potlib" ; then
  1.6693 +		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  1.6694 +		else
  1.6695 +		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  1.6696 +		  $ECHO "*** using a file magic. Last file checked: $potlib"
  1.6697 +		fi
  1.6698 +	      fi
  1.6699 +	      ;;
  1.6700 +	    *)
  1.6701 +	      # Add a -L argument.
  1.6702 +	      newdeplibs="$newdeplibs $a_deplib"
  1.6703 +	      ;;
  1.6704 +	    esac
  1.6705 +	  done # Gone through all deplibs.
  1.6706 +	  ;;
  1.6707 +	match_pattern*)
  1.6708 +	  set dummy $deplibs_check_method; shift
  1.6709 +	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.6710 +	  for a_deplib in $deplibs; do
  1.6711 +	    case $a_deplib in
  1.6712 +	    -l*)
  1.6713 +	      func_stripname -l '' "$a_deplib"
  1.6714 +	      name=$func_stripname_result
  1.6715 +	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6716 +		case " $predeps $postdeps " in
  1.6717 +		*" $a_deplib "*)
  1.6718 +		  newdeplibs="$newdeplibs $a_deplib"
  1.6719 +		  a_deplib=""
  1.6720 +		  ;;
  1.6721 +		esac
  1.6722 +	      fi
  1.6723 +	      if test -n "$a_deplib" ; then
  1.6724 +		libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6725 +		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.6726 +		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.6727 +		  for potent_lib in $potential_libs; do
  1.6728 +		    potlib="$potent_lib" # see symlink-check above in file_magic test
  1.6729 +		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
  1.6730 +		       $EGREP "$match_pattern_regex" > /dev/null; then
  1.6731 +		      newdeplibs="$newdeplibs $a_deplib"
  1.6732 +		      a_deplib=""
  1.6733 +		      break 2
  1.6734 +		    fi
  1.6735 +		  done
  1.6736 +		done
  1.6737 +	      fi
  1.6738 +	      if test -n "$a_deplib" ; then
  1.6739 +		droppeddeps=yes
  1.6740 +		$ECHO
  1.6741 +		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  1.6742 +		$ECHO "*** I have the capability to make that library automatically link in when"
  1.6743 +		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6744 +		$ECHO "*** shared version of the library, which you do not appear to have"
  1.6745 +		$ECHO "*** because I did check the linker path looking for a file starting"
  1.6746 +		if test -z "$potlib" ; then
  1.6747 +		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  1.6748 +		else
  1.6749 +		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  1.6750 +		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
  1.6751 +		fi
  1.6752 +	      fi
  1.6753 +	      ;;
  1.6754 +	    *)
  1.6755 +	      # Add a -L argument.
  1.6756 +	      newdeplibs="$newdeplibs $a_deplib"
  1.6757 +	      ;;
  1.6758 +	    esac
  1.6759 +	  done # Gone through all deplibs.
  1.6760 +	  ;;
  1.6761 +	none | unknown | *)
  1.6762 +	  newdeplibs=""
  1.6763 +	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
  1.6764 +	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
  1.6765 +	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6766 +	    for i in $predeps $postdeps ; do
  1.6767 +	      # can't use Xsed below, because $i might contain '/'
  1.6768 +	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
  1.6769 +	    done
  1.6770 +	  fi
  1.6771 +	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
  1.6772 +	     $GREP . >/dev/null; then
  1.6773 +	    $ECHO
  1.6774 +	    if test "X$deplibs_check_method" = "Xnone"; then
  1.6775 +	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
  1.6776 +	    else
  1.6777 +	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
  1.6778 +	    fi
  1.6779 +	    $ECHO "*** All declared inter-library dependencies are being dropped."
  1.6780 +	    droppeddeps=yes
  1.6781 +	  fi
  1.6782 +	  ;;
  1.6783 +	esac
  1.6784 +	versuffix=$versuffix_save
  1.6785 +	major=$major_save
  1.6786 +	release=$release_save
  1.6787 +	libname=$libname_save
  1.6788 +	name=$name_save
  1.6789 +
  1.6790 +	case $host in
  1.6791 +	*-*-rhapsody* | *-*-darwin1.[012])
  1.6792 +	  # On Rhapsody replace the C library with the System framework
  1.6793 +	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.6794 +	  ;;
  1.6795 +	esac
  1.6796 +
  1.6797 +	if test "$droppeddeps" = yes; then
  1.6798 +	  if test "$module" = yes; then
  1.6799 +	    $ECHO
  1.6800 +	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
  1.6801 +	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
  1.6802 +	    $ECHO "*** a static module, that should work as long as the dlopening"
  1.6803 +	    $ECHO "*** application is linked with the -dlopen flag."
  1.6804 +	    if test -z "$global_symbol_pipe"; then
  1.6805 +	      $ECHO
  1.6806 +	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
  1.6807 +	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.6808 +	      $ECHO "*** not find such a program.  So, this module is probably useless."
  1.6809 +	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  1.6810 +	    fi
  1.6811 +	    if test "$build_old_libs" = no; then
  1.6812 +	      oldlibs="$output_objdir/$libname.$libext"
  1.6813 +	      build_libtool_libs=module
  1.6814 +	      build_old_libs=yes
  1.6815 +	    else
  1.6816 +	      build_libtool_libs=no
  1.6817 +	    fi
  1.6818 +	  else
  1.6819 +	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
  1.6820 +	    $ECHO "*** automatically added whenever a program is linked with this library"
  1.6821 +	    $ECHO "*** or is declared to -dlopen it."
  1.6822 +
  1.6823 +	    if test "$allow_undefined" = no; then
  1.6824 +	      $ECHO
  1.6825 +	      $ECHO "*** Since this library must not contain undefined symbols,"
  1.6826 +	      $ECHO "*** because either the platform does not support them or"
  1.6827 +	      $ECHO "*** it was explicitly requested with -no-undefined,"
  1.6828 +	      $ECHO "*** libtool will only create a static version of it."
  1.6829 +	      if test "$build_old_libs" = no; then
  1.6830 +		oldlibs="$output_objdir/$libname.$libext"
  1.6831 +		build_libtool_libs=module
  1.6832 +		build_old_libs=yes
  1.6833 +	      else
  1.6834 +		build_libtool_libs=no
  1.6835 +	      fi
  1.6836 +	    fi
  1.6837 +	  fi
  1.6838 +	fi
  1.6839 +	# Done checking deplibs!
  1.6840 +	deplibs=$newdeplibs
  1.6841 +      fi
  1.6842 +      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  1.6843 +      case $host in
  1.6844 +	*-*-darwin*)
  1.6845 +	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6846 +	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6847 +	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6848 +	  ;;
  1.6849 +      esac
  1.6850 +
  1.6851 +      # move library search paths that coincide with paths to not yet
  1.6852 +      # installed libraries to the beginning of the library search list
  1.6853 +      new_libs=
  1.6854 +      for path in $notinst_path; do
  1.6855 +	case " $new_libs " in
  1.6856 +	*" -L$path/$objdir "*) ;;
  1.6857 +	*)
  1.6858 +	  case " $deplibs " in
  1.6859 +	  *" -L$path/$objdir "*)
  1.6860 +	    new_libs="$new_libs -L$path/$objdir" ;;
  1.6861 +	  esac
  1.6862 +	  ;;
  1.6863 +	esac
  1.6864 +      done
  1.6865 +      for deplib in $deplibs; do
  1.6866 +	case $deplib in
  1.6867 +	-L*)
  1.6868 +	  case " $new_libs " in
  1.6869 +	  *" $deplib "*) ;;
  1.6870 +	  *) new_libs="$new_libs $deplib" ;;
  1.6871 +	  esac
  1.6872 +	  ;;
  1.6873 +	*) new_libs="$new_libs $deplib" ;;
  1.6874 +	esac
  1.6875 +      done
  1.6876 +      deplibs="$new_libs"
  1.6877 +
  1.6878 +      # All the library-specific variables (install_libdir is set above).
  1.6879 +      library_names=
  1.6880 +      old_library=
  1.6881 +      dlname=
  1.6882 +
  1.6883 +      # Test again, we may have decided not to build it any more
  1.6884 +      if test "$build_libtool_libs" = yes; then
  1.6885 +	if test "$hardcode_into_libs" = yes; then
  1.6886 +	  # Hardcode the library paths
  1.6887 +	  hardcode_libdirs=
  1.6888 +	  dep_rpath=
  1.6889 +	  rpath="$finalize_rpath"
  1.6890 +	  test "$mode" != relink && rpath="$compile_rpath$rpath"
  1.6891 +	  for libdir in $rpath; do
  1.6892 +	    if test -n "$hardcode_libdir_flag_spec"; then
  1.6893 +	      if test -n "$hardcode_libdir_separator"; then
  1.6894 +		if test -z "$hardcode_libdirs"; then
  1.6895 +		  hardcode_libdirs="$libdir"
  1.6896 +		else
  1.6897 +		  # Just accumulate the unique libdirs.
  1.6898 +		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.6899 +		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.6900 +		    ;;
  1.6901 +		  *)
  1.6902 +		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.6903 +		    ;;
  1.6904 +		  esac
  1.6905 +		fi
  1.6906 +	      else
  1.6907 +		eval flag=\"$hardcode_libdir_flag_spec\"
  1.6908 +		dep_rpath="$dep_rpath $flag"
  1.6909 +	      fi
  1.6910 +	    elif test -n "$runpath_var"; then
  1.6911 +	      case "$perm_rpath " in
  1.6912 +	      *" $libdir "*) ;;
  1.6913 +	      *) perm_rpath="$perm_rpath $libdir" ;;
  1.6914 +	      esac
  1.6915 +	    fi
  1.6916 +	  done
  1.6917 +	  # Substitute the hardcoded libdirs into the rpath.
  1.6918 +	  if test -n "$hardcode_libdir_separator" &&
  1.6919 +	     test -n "$hardcode_libdirs"; then
  1.6920 +	    libdir="$hardcode_libdirs"
  1.6921 +	    if test -n "$hardcode_libdir_flag_spec_ld"; then
  1.6922 +	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  1.6923 +	    else
  1.6924 +	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  1.6925 +	    fi
  1.6926 +	  fi
  1.6927 +	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
  1.6928 +	    # We should set the runpath_var.
  1.6929 +	    rpath=
  1.6930 +	    for dir in $perm_rpath; do
  1.6931 +	      rpath="$rpath$dir:"
  1.6932 +	    done
  1.6933 +	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  1.6934 +	  fi
  1.6935 +	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  1.6936 +	fi
  1.6937 +
  1.6938 +	shlibpath="$finalize_shlibpath"
  1.6939 +	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  1.6940 +	if test -n "$shlibpath"; then
  1.6941 +	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  1.6942 +	fi
  1.6943 +
  1.6944 +	# Get the real and link names of the library.
  1.6945 +	eval shared_ext=\"$shrext_cmds\"
  1.6946 +	eval library_names=\"$library_names_spec\"
  1.6947 +	set dummy $library_names
  1.6948 +	shift
  1.6949 +	realname="$1"
  1.6950 +	shift
  1.6951 +
  1.6952 +	if test -n "$soname_spec"; then
  1.6953 +	  eval soname=\"$soname_spec\"
  1.6954 +	else
  1.6955 +	  soname="$realname"
  1.6956 +	fi
  1.6957 +	if test -z "$dlname"; then
  1.6958 +	  dlname=$soname
  1.6959 +	fi
  1.6960 +
  1.6961 +	lib="$output_objdir/$realname"
  1.6962 +	linknames=
  1.6963 +	for link
  1.6964 +	do
  1.6965 +	  linknames="$linknames $link"
  1.6966 +	done
  1.6967 +
  1.6968 +	# Use standard objects if they are pic
  1.6969 +	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.6970 +	test "X$libobjs" = "X " && libobjs=
  1.6971 +
  1.6972 +	delfiles=
  1.6973 +	if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.6974 +	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  1.6975 +	  export_symbols="$output_objdir/$libname.uexp"
  1.6976 +	  delfiles="$delfiles $export_symbols"
  1.6977 +	fi
  1.6978 +
  1.6979 +	orig_export_symbols=
  1.6980 +	case $host_os in
  1.6981 +	cygwin* | mingw* | cegcc*)
  1.6982 +	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  1.6983 +	    # exporting using user supplied symfile
  1.6984 +	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  1.6985 +	      # and it's NOT already a .def file. Must figure out
  1.6986 +	      # which of the given symbols are data symbols and tag
  1.6987 +	      # them as such. So, trigger use of export_symbols_cmds.
  1.6988 +	      # export_symbols gets reassigned inside the "prepare
  1.6989 +	      # the list of exported symbols" if statement, so the
  1.6990 +	      # include_expsyms logic still works.
  1.6991 +	      orig_export_symbols="$export_symbols"
  1.6992 +	      export_symbols=
  1.6993 +	      always_export_symbols=yes
  1.6994 +	    fi
  1.6995 +	  fi
  1.6996 +	  ;;
  1.6997 +	esac
  1.6998 +
  1.6999 +	# Prepare the list of exported symbols
  1.7000 +	if test -z "$export_symbols"; then
  1.7001 +	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  1.7002 +	    func_verbose "generating symbol list for \`$libname.la'"
  1.7003 +	    export_symbols="$output_objdir/$libname.exp"
  1.7004 +	    $opt_dry_run || $RM $export_symbols
  1.7005 +	    cmds=$export_symbols_cmds
  1.7006 +	    save_ifs="$IFS"; IFS='~'
  1.7007 +	    for cmd in $cmds; do
  1.7008 +	      IFS="$save_ifs"
  1.7009 +	      eval cmd=\"$cmd\"
  1.7010 +	      func_len " $cmd"
  1.7011 +	      len=$func_len_result
  1.7012 +	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7013 +		func_show_eval "$cmd" 'exit $?'
  1.7014 +		skipped_export=false
  1.7015 +	      else
  1.7016 +		# The command line is too long to execute in one step.
  1.7017 +		func_verbose "using reloadable object file for export list..."
  1.7018 +		skipped_export=:
  1.7019 +		# Break out early, otherwise skipped_export may be
  1.7020 +		# set to false by a later but shorter cmd.
  1.7021 +		break
  1.7022 +	      fi
  1.7023 +	    done
  1.7024 +	    IFS="$save_ifs"
  1.7025 +	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  1.7026 +	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1.7027 +	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  1.7028 +	    fi
  1.7029 +	  fi
  1.7030 +	fi
  1.7031 +
  1.7032 +	if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.7033 +	  tmp_export_symbols="$export_symbols"
  1.7034 +	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  1.7035 +	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  1.7036 +	fi
  1.7037 +
  1.7038 +	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  1.7039 +	  # The given exports_symbols file has to be filtered, so filter it.
  1.7040 +	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  1.7041 +	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
  1.7042 +	  # 's' commands which not all seds can handle. GNU sed should be fine
  1.7043 +	  # though. Also, the filter scales superlinearly with the number of
  1.7044 +	  # global variables. join(1) would be nice here, but unfortunately
  1.7045 +	  # isn't a blessed tool.
  1.7046 +	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  1.7047 +	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  1.7048 +	  export_symbols=$output_objdir/$libname.def
  1.7049 +	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  1.7050 +	fi
  1.7051 +
  1.7052 +	tmp_deplibs=
  1.7053 +	for test_deplib in $deplibs; do
  1.7054 +	  case " $convenience " in
  1.7055 +	  *" $test_deplib "*) ;;
  1.7056 +	  *)
  1.7057 +	    tmp_deplibs="$tmp_deplibs $test_deplib"
  1.7058 +	    ;;
  1.7059 +	  esac
  1.7060 +	done
  1.7061 +	deplibs="$tmp_deplibs"
  1.7062 +
  1.7063 +	if test -n "$convenience"; then
  1.7064 +	  if test -n "$whole_archive_flag_spec" &&
  1.7065 +	    test "$compiler_needs_object" = yes &&
  1.7066 +	    test -z "$libobjs"; then
  1.7067 +	    # extract the archives, so we have objects to list.
  1.7068 +	    # TODO: could optimize this to just extract one archive.
  1.7069 +	    whole_archive_flag_spec=
  1.7070 +	  fi
  1.7071 +	  if test -n "$whole_archive_flag_spec"; then
  1.7072 +	    save_libobjs=$libobjs
  1.7073 +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.7074 +	    test "X$libobjs" = "X " && libobjs=
  1.7075 +	  else
  1.7076 +	    gentop="$output_objdir/${outputname}x"
  1.7077 +	    generated="$generated $gentop"
  1.7078 +
  1.7079 +	    func_extract_archives $gentop $convenience
  1.7080 +	    libobjs="$libobjs $func_extract_archives_result"
  1.7081 +	    test "X$libobjs" = "X " && libobjs=
  1.7082 +	  fi
  1.7083 +	fi
  1.7084 +
  1.7085 +	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  1.7086 +	  eval flag=\"$thread_safe_flag_spec\"
  1.7087 +	  linker_flags="$linker_flags $flag"
  1.7088 +	fi
  1.7089 +
  1.7090 +	# Make a backup of the uninstalled library when relinking
  1.7091 +	if test "$mode" = relink; then
  1.7092 +	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  1.7093 +	fi
  1.7094 +
  1.7095 +	# Do each of the archive commands.
  1.7096 +	if test "$module" = yes && test -n "$module_cmds" ; then
  1.7097 +	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.7098 +	    eval test_cmds=\"$module_expsym_cmds\"
  1.7099 +	    cmds=$module_expsym_cmds
  1.7100 +	  else
  1.7101 +	    eval test_cmds=\"$module_cmds\"
  1.7102 +	    cmds=$module_cmds
  1.7103 +	  fi
  1.7104 +	else
  1.7105 +	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.7106 +	    eval test_cmds=\"$archive_expsym_cmds\"
  1.7107 +	    cmds=$archive_expsym_cmds
  1.7108 +	  else
  1.7109 +	    eval test_cmds=\"$archive_cmds\"
  1.7110 +	    cmds=$archive_cmds
  1.7111 +	  fi
  1.7112 +	fi
  1.7113 +
  1.7114 +	if test "X$skipped_export" != "X:" &&
  1.7115 +	   func_len " $test_cmds" &&
  1.7116 +	   len=$func_len_result &&
  1.7117 +	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7118 +	  :
  1.7119 +	else
  1.7120 +	  # The command line is too long to link in one step, link piecewise
  1.7121 +	  # or, if using GNU ld and skipped_export is not :, use a linker
  1.7122 +	  # script.
  1.7123 +
  1.7124 +	  # Save the value of $output and $libobjs because we want to
  1.7125 +	  # use them later.  If we have whole_archive_flag_spec, we
  1.7126 +	  # want to use save_libobjs as it was before
  1.7127 +	  # whole_archive_flag_spec was expanded, because we can't
  1.7128 +	  # assume the linker understands whole_archive_flag_spec.
  1.7129 +	  # This may have to be revisited, in case too many
  1.7130 +	  # convenience libraries get linked in and end up exceeding
  1.7131 +	  # the spec.
  1.7132 +	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  1.7133 +	    save_libobjs=$libobjs
  1.7134 +	  fi
  1.7135 +	  save_output=$output
  1.7136 +	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
  1.7137 +
  1.7138 +	  # Clear the reloadable object creation command queue and
  1.7139 +	  # initialize k to one.
  1.7140 +	  test_cmds=
  1.7141 +	  concat_cmds=
  1.7142 +	  objlist=
  1.7143 +	  last_robj=
  1.7144 +	  k=1
  1.7145 +
  1.7146 +	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  1.7147 +	    output=${output_objdir}/${output_la}.lnkscript
  1.7148 +	    func_verbose "creating GNU ld script: $output"
  1.7149 +	    $ECHO 'INPUT (' > $output
  1.7150 +	    for obj in $save_libobjs
  1.7151 +	    do
  1.7152 +	      $ECHO "$obj" >> $output
  1.7153 +	    done
  1.7154 +	    $ECHO ')' >> $output
  1.7155 +	    delfiles="$delfiles $output"
  1.7156 +	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  1.7157 +	    output=${output_objdir}/${output_la}.lnk
  1.7158 +	    func_verbose "creating linker input file list: $output"
  1.7159 +	    : > $output
  1.7160 +	    set x $save_libobjs
  1.7161 +	    shift
  1.7162 +	    firstobj=
  1.7163 +	    if test "$compiler_needs_object" = yes; then
  1.7164 +	      firstobj="$1 "
  1.7165 +	      shift
  1.7166 +	    fi
  1.7167 +	    for obj
  1.7168 +	    do
  1.7169 +	      $ECHO "$obj" >> $output
  1.7170 +	    done
  1.7171 +	    delfiles="$delfiles $output"
  1.7172 +	    output=$firstobj\"$file_list_spec$output\"
  1.7173 +	  else
  1.7174 +	    if test -n "$save_libobjs"; then
  1.7175 +	      func_verbose "creating reloadable object files..."
  1.7176 +	      output=$output_objdir/$output_la-${k}.$objext
  1.7177 +	      eval test_cmds=\"$reload_cmds\"
  1.7178 +	      func_len " $test_cmds"
  1.7179 +	      len0=$func_len_result
  1.7180 +	      len=$len0
  1.7181 +
  1.7182 +	      # Loop over the list of objects to be linked.
  1.7183 +	      for obj in $save_libobjs
  1.7184 +	      do
  1.7185 +		func_len " $obj"
  1.7186 +		func_arith $len + $func_len_result
  1.7187 +		len=$func_arith_result
  1.7188 +		if test "X$objlist" = X ||
  1.7189 +		   test "$len" -lt "$max_cmd_len"; then
  1.7190 +		  func_append objlist " $obj"
  1.7191 +		else
  1.7192 +		  # The command $test_cmds is almost too long, add a
  1.7193 +		  # command to the queue.
  1.7194 +		  if test "$k" -eq 1 ; then
  1.7195 +		    # The first file doesn't have a previous command to add.
  1.7196 +		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  1.7197 +		  else
  1.7198 +		    # All subsequent reloadable object files will link in
  1.7199 +		    # the last one created.
  1.7200 +		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
  1.7201 +		  fi
  1.7202 +		  last_robj=$output_objdir/$output_la-${k}.$objext
  1.7203 +		  func_arith $k + 1
  1.7204 +		  k=$func_arith_result
  1.7205 +		  output=$output_objdir/$output_la-${k}.$objext
  1.7206 +		  objlist=$obj
  1.7207 +		  func_len " $last_robj"
  1.7208 +		  func_arith $len0 + $func_len_result
  1.7209 +		  len=$func_arith_result
  1.7210 +		fi
  1.7211 +	      done
  1.7212 +	      # Handle the remaining objects by creating one last
  1.7213 +	      # reloadable object file.  All subsequent reloadable object
  1.7214 +	      # files will link in the last one created.
  1.7215 +	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.7216 +	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  1.7217 +	      if test -n "$last_robj"; then
  1.7218 +	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
  1.7219 +	      fi
  1.7220 +	      delfiles="$delfiles $output"
  1.7221 +
  1.7222 +	    else
  1.7223 +	      output=
  1.7224 +	    fi
  1.7225 +
  1.7226 +	    if ${skipped_export-false}; then
  1.7227 +	      func_verbose "generating symbol list for \`$libname.la'"
  1.7228 +	      export_symbols="$output_objdir/$libname.exp"
  1.7229 +	      $opt_dry_run || $RM $export_symbols
  1.7230 +	      libobjs=$output
  1.7231 +	      # Append the command to create the export file.
  1.7232 +	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.7233 +	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  1.7234 +	      if test -n "$last_robj"; then
  1.7235 +		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  1.7236 +	      fi
  1.7237 +	    fi
  1.7238 +
  1.7239 +	    test -n "$save_libobjs" &&
  1.7240 +	      func_verbose "creating a temporary reloadable object file: $output"
  1.7241 +
  1.7242 +	    # Loop through the commands generated above and execute them.
  1.7243 +	    save_ifs="$IFS"; IFS='~'
  1.7244 +	    for cmd in $concat_cmds; do
  1.7245 +	      IFS="$save_ifs"
  1.7246 +	      $opt_silent || {
  1.7247 +		  func_quote_for_expand "$cmd"
  1.7248 +		  eval "func_echo $func_quote_for_expand_result"
  1.7249 +	      }
  1.7250 +	      $opt_dry_run || eval "$cmd" || {
  1.7251 +		lt_exit=$?
  1.7252 +
  1.7253 +		# Restore the uninstalled library and exit
  1.7254 +		if test "$mode" = relink; then
  1.7255 +		  ( cd "$output_objdir" && \
  1.7256 +		    $RM "${realname}T" && \
  1.7257 +		    $MV "${realname}U" "$realname" )
  1.7258 +		fi
  1.7259 +
  1.7260 +		exit $lt_exit
  1.7261 +	      }
  1.7262 +	    done
  1.7263 +	    IFS="$save_ifs"
  1.7264 +
  1.7265 +	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  1.7266 +	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1.7267 +	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  1.7268 +	    fi
  1.7269 +	  fi
  1.7270 +
  1.7271 +          if ${skipped_export-false}; then
  1.7272 +	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.7273 +	      tmp_export_symbols="$export_symbols"
  1.7274 +	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  1.7275 +	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  1.7276 +	    fi
  1.7277 +
  1.7278 +	    if test -n "$orig_export_symbols"; then
  1.7279 +	      # The given exports_symbols file has to be filtered, so filter it.
  1.7280 +	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  1.7281 +	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
  1.7282 +	      # 's' commands which not all seds can handle. GNU sed should be fine
  1.7283 +	      # though. Also, the filter scales superlinearly with the number of
  1.7284 +	      # global variables. join(1) would be nice here, but unfortunately
  1.7285 +	      # isn't a blessed tool.
  1.7286 +	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  1.7287 +	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  1.7288 +	      export_symbols=$output_objdir/$libname.def
  1.7289 +	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  1.7290 +	    fi
  1.7291 +	  fi
  1.7292 +
  1.7293 +	  libobjs=$output
  1.7294 +	  # Restore the value of output.
  1.7295 +	  output=$save_output
  1.7296 +
  1.7297 +	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  1.7298 +	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.7299 +	    test "X$libobjs" = "X " && libobjs=
  1.7300 +	  fi
  1.7301 +	  # Expand the library linking commands again to reset the
  1.7302 +	  # value of $libobjs for piecewise linking.
  1.7303 +
  1.7304 +	  # Do each of the archive commands.
  1.7305 +	  if test "$module" = yes && test -n "$module_cmds" ; then
  1.7306 +	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.7307 +	      cmds=$module_expsym_cmds
  1.7308 +	    else
  1.7309 +	      cmds=$module_cmds
  1.7310 +	    fi
  1.7311 +	  else
  1.7312 +	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.7313 +	      cmds=$archive_expsym_cmds
  1.7314 +	    else
  1.7315 +	      cmds=$archive_cmds
  1.7316 +	    fi
  1.7317 +	  fi
  1.7318 +	fi
  1.7319 +
  1.7320 +	if test -n "$delfiles"; then
  1.7321 +	  # Append the command to remove temporary files to $cmds.
  1.7322 +	  eval cmds=\"\$cmds~\$RM $delfiles\"
  1.7323 +	fi
  1.7324 +
  1.7325 +	# Add any objects from preloaded convenience libraries
  1.7326 +	if test -n "$dlprefiles"; then
  1.7327 +	  gentop="$output_objdir/${outputname}x"
  1.7328 +	  generated="$generated $gentop"
  1.7329 +
  1.7330 +	  func_extract_archives $gentop $dlprefiles
  1.7331 +	  libobjs="$libobjs $func_extract_archives_result"
  1.7332 +	  test "X$libobjs" = "X " && libobjs=
  1.7333 +	fi
  1.7334 +
  1.7335 +	save_ifs="$IFS"; IFS='~'
  1.7336 +	for cmd in $cmds; do
  1.7337 +	  IFS="$save_ifs"
  1.7338 +	  eval cmd=\"$cmd\"
  1.7339 +	  $opt_silent || {
  1.7340 +	    func_quote_for_expand "$cmd"
  1.7341 +	    eval "func_echo $func_quote_for_expand_result"
  1.7342 +	  }
  1.7343 +	  $opt_dry_run || eval "$cmd" || {
  1.7344 +	    lt_exit=$?
  1.7345 +
  1.7346 +	    # Restore the uninstalled library and exit
  1.7347 +	    if test "$mode" = relink; then
  1.7348 +	      ( cd "$output_objdir" && \
  1.7349 +	        $RM "${realname}T" && \
  1.7350 +		$MV "${realname}U" "$realname" )
  1.7351 +	    fi
  1.7352 +
  1.7353 +	    exit $lt_exit
  1.7354 +	  }
  1.7355 +	done
  1.7356 +	IFS="$save_ifs"
  1.7357 +
  1.7358 +	# Restore the uninstalled library and exit
  1.7359 +	if test "$mode" = relink; then
  1.7360 +	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  1.7361 +
  1.7362 +	  if test -n "$convenience"; then
  1.7363 +	    if test -z "$whole_archive_flag_spec"; then
  1.7364 +	      func_show_eval '${RM}r "$gentop"'
  1.7365 +	    fi
  1.7366 +	  fi
  1.7367 +
  1.7368 +	  exit $EXIT_SUCCESS
  1.7369 +	fi
  1.7370 +
  1.7371 +	# Create links to the real library.
  1.7372 +	for linkname in $linknames; do
  1.7373 +	  if test "$realname" != "$linkname"; then
  1.7374 +	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  1.7375 +	  fi
  1.7376 +	done
  1.7377 +
  1.7378 +	# If -module or -export-dynamic was specified, set the dlname.
  1.7379 +	if test "$module" = yes || test "$export_dynamic" = yes; then
  1.7380 +	  # On all known operating systems, these are identical.
  1.7381 +	  dlname="$soname"
  1.7382 +	fi
  1.7383 +      fi
  1.7384 +      ;;
  1.7385 +
  1.7386 +    obj)
  1.7387 +      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.7388 +	func_warning "\`-dlopen' is ignored for objects"
  1.7389 +      fi
  1.7390 +
  1.7391 +      case " $deplibs" in
  1.7392 +      *\ -l* | *\ -L*)
  1.7393 +	func_warning "\`-l' and \`-L' are ignored for objects" ;;
  1.7394 +      esac
  1.7395 +
  1.7396 +      test -n "$rpath" && \
  1.7397 +	func_warning "\`-rpath' is ignored for objects"
  1.7398 +
  1.7399 +      test -n "$xrpath" && \
  1.7400 +	func_warning "\`-R' is ignored for objects"
  1.7401 +
  1.7402 +      test -n "$vinfo" && \
  1.7403 +	func_warning "\`-version-info' is ignored for objects"
  1.7404 +
  1.7405 +      test -n "$release" && \
  1.7406 +	func_warning "\`-release' is ignored for objects"
  1.7407 +
  1.7408 +      case $output in
  1.7409 +      *.lo)
  1.7410 +	test -n "$objs$old_deplibs" && \
  1.7411 +	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
  1.7412 +
  1.7413 +	libobj=$output
  1.7414 +	func_lo2o "$libobj"
  1.7415 +	obj=$func_lo2o_result
  1.7416 +	;;
  1.7417 +      *)
  1.7418 +	libobj=
  1.7419 +	obj="$output"
  1.7420 +	;;
  1.7421 +      esac
  1.7422 +
  1.7423 +      # Delete the old objects.
  1.7424 +      $opt_dry_run || $RM $obj $libobj
  1.7425 +
  1.7426 +      # Objects from convenience libraries.  This assumes
  1.7427 +      # single-version convenience libraries.  Whenever we create
  1.7428 +      # different ones for PIC/non-PIC, this we'll have to duplicate
  1.7429 +      # the extraction.
  1.7430 +      reload_conv_objs=
  1.7431 +      gentop=
  1.7432 +      # reload_cmds runs $LD directly, so let us get rid of
  1.7433 +      # -Wl from whole_archive_flag_spec and hope we can get by with
  1.7434 +      # turning comma into space..
  1.7435 +      wl=
  1.7436 +
  1.7437 +      if test -n "$convenience"; then
  1.7438 +	if test -n "$whole_archive_flag_spec"; then
  1.7439 +	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  1.7440 +	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  1.7441 +	else
  1.7442 +	  gentop="$output_objdir/${obj}x"
  1.7443 +	  generated="$generated $gentop"
  1.7444 +
  1.7445 +	  func_extract_archives $gentop $convenience
  1.7446 +	  reload_conv_objs="$reload_objs $func_extract_archives_result"
  1.7447 +	fi
  1.7448 +      fi
  1.7449 +
  1.7450 +      # Create the old-style object.
  1.7451 +      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
  1.7452 +
  1.7453 +      output="$obj"
  1.7454 +      func_execute_cmds "$reload_cmds" 'exit $?'
  1.7455 +
  1.7456 +      # Exit if we aren't doing a library object file.
  1.7457 +      if test -z "$libobj"; then
  1.7458 +	if test -n "$gentop"; then
  1.7459 +	  func_show_eval '${RM}r "$gentop"'
  1.7460 +	fi
  1.7461 +
  1.7462 +	exit $EXIT_SUCCESS
  1.7463 +      fi
  1.7464 +
  1.7465 +      if test "$build_libtool_libs" != yes; then
  1.7466 +	if test -n "$gentop"; then
  1.7467 +	  func_show_eval '${RM}r "$gentop"'
  1.7468 +	fi
  1.7469 +
  1.7470 +	# Create an invalid libtool object if no PIC, so that we don't
  1.7471 +	# accidentally link it into a program.
  1.7472 +	# $show "echo timestamp > $libobj"
  1.7473 +	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  1.7474 +	exit $EXIT_SUCCESS
  1.7475 +      fi
  1.7476 +
  1.7477 +      if test -n "$pic_flag" || test "$pic_mode" != default; then
  1.7478 +	# Only do commands if we really have different PIC objects.
  1.7479 +	reload_objs="$libobjs $reload_conv_objs"
  1.7480 +	output="$libobj"
  1.7481 +	func_execute_cmds "$reload_cmds" 'exit $?'
  1.7482 +      fi
  1.7483 +
  1.7484 +      if test -n "$gentop"; then
  1.7485 +	func_show_eval '${RM}r "$gentop"'
  1.7486 +      fi
  1.7487 +
  1.7488 +      exit $EXIT_SUCCESS
  1.7489 +      ;;
  1.7490 +
  1.7491 +    prog)
  1.7492 +      case $host in
  1.7493 +	*cygwin*) func_stripname '' '.exe' "$output"
  1.7494 +	          output=$func_stripname_result.exe;;
  1.7495 +      esac
  1.7496 +      test -n "$vinfo" && \
  1.7497 +	func_warning "\`-version-info' is ignored for programs"
  1.7498 +
  1.7499 +      test -n "$release" && \
  1.7500 +	func_warning "\`-release' is ignored for programs"
  1.7501 +
  1.7502 +      test "$preload" = yes \
  1.7503 +        && test "$dlopen_support" = unknown \
  1.7504 +	&& test "$dlopen_self" = unknown \
  1.7505 +	&& test "$dlopen_self_static" = unknown && \
  1.7506 +	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  1.7507 +
  1.7508 +      case $host in
  1.7509 +      *-*-rhapsody* | *-*-darwin1.[012])
  1.7510 +	# On Rhapsody replace the C library is the System framework
  1.7511 +	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.7512 +	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.7513 +	;;
  1.7514 +      esac
  1.7515 +
  1.7516 +      case $host in
  1.7517 +      *-*-darwin*)
  1.7518 +	# Don't allow lazy linking, it breaks C++ global constructors
  1.7519 +	# But is supposedly fixed on 10.4 or later (yay!).
  1.7520 +	if test "$tagname" = CXX ; then
  1.7521 +	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  1.7522 +	    10.[0123])
  1.7523 +	      compile_command="$compile_command ${wl}-bind_at_load"
  1.7524 +	      finalize_command="$finalize_command ${wl}-bind_at_load"
  1.7525 +	    ;;
  1.7526 +	  esac
  1.7527 +	fi
  1.7528 +	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
  1.7529 +	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.7530 +	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.7531 +	;;
  1.7532 +      esac
  1.7533 +
  1.7534 +
  1.7535 +      # move library search paths that coincide with paths to not yet
  1.7536 +      # installed libraries to the beginning of the library search list
  1.7537 +      new_libs=
  1.7538 +      for path in $notinst_path; do
  1.7539 +	case " $new_libs " in
  1.7540 +	*" -L$path/$objdir "*) ;;
  1.7541 +	*)
  1.7542 +	  case " $compile_deplibs " in
  1.7543 +	  *" -L$path/$objdir "*)
  1.7544 +	    new_libs="$new_libs -L$path/$objdir" ;;
  1.7545 +	  esac
  1.7546 +	  ;;
  1.7547 +	esac
  1.7548 +      done
  1.7549 +      for deplib in $compile_deplibs; do
  1.7550 +	case $deplib in
  1.7551 +	-L*)
  1.7552 +	  case " $new_libs " in
  1.7553 +	  *" $deplib "*) ;;
  1.7554 +	  *) new_libs="$new_libs $deplib" ;;
  1.7555 +	  esac
  1.7556 +	  ;;
  1.7557 +	*) new_libs="$new_libs $deplib" ;;
  1.7558 +	esac
  1.7559 +      done
  1.7560 +      compile_deplibs="$new_libs"
  1.7561 +
  1.7562 +
  1.7563 +      compile_command="$compile_command $compile_deplibs"
  1.7564 +      finalize_command="$finalize_command $finalize_deplibs"
  1.7565 +
  1.7566 +      if test -n "$rpath$xrpath"; then
  1.7567 +	# If the user specified any rpath flags, then add them.
  1.7568 +	for libdir in $rpath $xrpath; do
  1.7569 +	  # This is the magic to use -rpath.
  1.7570 +	  case "$finalize_rpath " in
  1.7571 +	  *" $libdir "*) ;;
  1.7572 +	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.7573 +	  esac
  1.7574 +	done
  1.7575 +      fi
  1.7576 +
  1.7577 +      # Now hardcode the library paths
  1.7578 +      rpath=
  1.7579 +      hardcode_libdirs=
  1.7580 +      for libdir in $compile_rpath $finalize_rpath; do
  1.7581 +	if test -n "$hardcode_libdir_flag_spec"; then
  1.7582 +	  if test -n "$hardcode_libdir_separator"; then
  1.7583 +	    if test -z "$hardcode_libdirs"; then
  1.7584 +	      hardcode_libdirs="$libdir"
  1.7585 +	    else
  1.7586 +	      # Just accumulate the unique libdirs.
  1.7587 +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.7588 +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.7589 +		;;
  1.7590 +	      *)
  1.7591 +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.7592 +		;;
  1.7593 +	      esac
  1.7594 +	    fi
  1.7595 +	  else
  1.7596 +	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.7597 +	    rpath="$rpath $flag"
  1.7598 +	  fi
  1.7599 +	elif test -n "$runpath_var"; then
  1.7600 +	  case "$perm_rpath " in
  1.7601 +	  *" $libdir "*) ;;
  1.7602 +	  *) perm_rpath="$perm_rpath $libdir" ;;
  1.7603 +	  esac
  1.7604 +	fi
  1.7605 +	case $host in
  1.7606 +	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.7607 +	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  1.7608 +	  case :$dllsearchpath: in
  1.7609 +	  *":$libdir:"*) ;;
  1.7610 +	  ::) dllsearchpath=$libdir;;
  1.7611 +	  *) dllsearchpath="$dllsearchpath:$libdir";;
  1.7612 +	  esac
  1.7613 +	  case :$dllsearchpath: in
  1.7614 +	  *":$testbindir:"*) ;;
  1.7615 +	  ::) dllsearchpath=$testbindir;;
  1.7616 +	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.7617 +	  esac
  1.7618 +	  ;;
  1.7619 +	esac
  1.7620 +      done
  1.7621 +      # Substitute the hardcoded libdirs into the rpath.
  1.7622 +      if test -n "$hardcode_libdir_separator" &&
  1.7623 +	 test -n "$hardcode_libdirs"; then
  1.7624 +	libdir="$hardcode_libdirs"
  1.7625 +	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.7626 +      fi
  1.7627 +      compile_rpath="$rpath"
  1.7628 +
  1.7629 +      rpath=
  1.7630 +      hardcode_libdirs=
  1.7631 +      for libdir in $finalize_rpath; do
  1.7632 +	if test -n "$hardcode_libdir_flag_spec"; then
  1.7633 +	  if test -n "$hardcode_libdir_separator"; then
  1.7634 +	    if test -z "$hardcode_libdirs"; then
  1.7635 +	      hardcode_libdirs="$libdir"
  1.7636 +	    else
  1.7637 +	      # Just accumulate the unique libdirs.
  1.7638 +	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.7639 +	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.7640 +		;;
  1.7641 +	      *)
  1.7642 +		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.7643 +		;;
  1.7644 +	      esac
  1.7645 +	    fi
  1.7646 +	  else
  1.7647 +	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.7648 +	    rpath="$rpath $flag"
  1.7649 +	  fi
  1.7650 +	elif test -n "$runpath_var"; then
  1.7651 +	  case "$finalize_perm_rpath " in
  1.7652 +	  *" $libdir "*) ;;
  1.7653 +	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  1.7654 +	  esac
  1.7655 +	fi
  1.7656 +      done
  1.7657 +      # Substitute the hardcoded libdirs into the rpath.
  1.7658 +      if test -n "$hardcode_libdir_separator" &&
  1.7659 +	 test -n "$hardcode_libdirs"; then
  1.7660 +	libdir="$hardcode_libdirs"
  1.7661 +	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.7662 +      fi
  1.7663 +      finalize_rpath="$rpath"
  1.7664 +
  1.7665 +      if test -n "$libobjs" && test "$build_old_libs" = yes; then
  1.7666 +	# Transform all the library objects into standard objects.
  1.7667 +	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.7668 +	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.7669 +      fi
  1.7670 +
  1.7671 +      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  1.7672 +
  1.7673 +      # template prelinking step
  1.7674 +      if test -n "$prelink_cmds"; then
  1.7675 +	func_execute_cmds "$prelink_cmds" 'exit $?'
  1.7676 +      fi
  1.7677 +
  1.7678 +      wrappers_required=yes
  1.7679 +      case $host in
  1.7680 +      *cygwin* | *mingw* )
  1.7681 +        if test "$build_libtool_libs" != yes; then
  1.7682 +          wrappers_required=no
  1.7683 +        fi
  1.7684 +        ;;
  1.7685 +      *cegcc)
  1.7686 +        # Disable wrappers for cegcc, we are cross compiling anyway.
  1.7687 +        wrappers_required=no
  1.7688 +        ;;
  1.7689 +      *)
  1.7690 +        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  1.7691 +          wrappers_required=no
  1.7692 +        fi
  1.7693 +        ;;
  1.7694 +      esac
  1.7695 +      if test "$wrappers_required" = no; then
  1.7696 +	# Replace the output file specification.
  1.7697 +	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.7698 +	link_command="$compile_command$compile_rpath"
  1.7699 +
  1.7700 +	# We have no uninstalled library dependencies, so finalize right now.
  1.7701 +	exit_status=0
  1.7702 +	func_show_eval "$link_command" 'exit_status=$?'
  1.7703 +
  1.7704 +	# Delete the generated files.
  1.7705 +	if test -f "$output_objdir/${outputname}S.${objext}"; then
  1.7706 +	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  1.7707 +	fi
  1.7708 +
  1.7709 +	exit $exit_status
  1.7710 +      fi
  1.7711 +
  1.7712 +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  1.7713 +	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  1.7714 +      fi
  1.7715 +      if test -n "$finalize_shlibpath"; then
  1.7716 +	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  1.7717 +      fi
  1.7718 +
  1.7719 +      compile_var=
  1.7720 +      finalize_var=
  1.7721 +      if test -n "$runpath_var"; then
  1.7722 +	if test -n "$perm_rpath"; then
  1.7723 +	  # We should set the runpath_var.
  1.7724 +	  rpath=
  1.7725 +	  for dir in $perm_rpath; do
  1.7726 +	    rpath="$rpath$dir:"
  1.7727 +	  done
  1.7728 +	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.7729 +	fi
  1.7730 +	if test -n "$finalize_perm_rpath"; then
  1.7731 +	  # We should set the runpath_var.
  1.7732 +	  rpath=
  1.7733 +	  for dir in $finalize_perm_rpath; do
  1.7734 +	    rpath="$rpath$dir:"
  1.7735 +	  done
  1.7736 +	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.7737 +	fi
  1.7738 +      fi
  1.7739 +
  1.7740 +      if test "$no_install" = yes; then
  1.7741 +	# We don't need to create a wrapper script.
  1.7742 +	link_command="$compile_var$compile_command$compile_rpath"
  1.7743 +	# Replace the output file specification.
  1.7744 +	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.7745 +	# Delete the old output file.
  1.7746 +	$opt_dry_run || $RM $output
  1.7747 +	# Link the executable and exit
  1.7748 +	func_show_eval "$link_command" 'exit $?'
  1.7749 +	exit $EXIT_SUCCESS
  1.7750 +      fi
  1.7751 +
  1.7752 +      if test "$hardcode_action" = relink; then
  1.7753 +	# Fast installation is not supported
  1.7754 +	link_command="$compile_var$compile_command$compile_rpath"
  1.7755 +	relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.7756 +
  1.7757 +	func_warning "this platform does not like uninstalled shared libraries"
  1.7758 +	func_warning "\`$output' will be relinked during installation"
  1.7759 +      else
  1.7760 +	if test "$fast_install" != no; then
  1.7761 +	  link_command="$finalize_var$compile_command$finalize_rpath"
  1.7762 +	  if test "$fast_install" = yes; then
  1.7763 +	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  1.7764 +	  else
  1.7765 +	    # fast_install is set to needless
  1.7766 +	    relink_command=
  1.7767 +	  fi
  1.7768 +	else
  1.7769 +	  link_command="$compile_var$compile_command$compile_rpath"
  1.7770 +	  relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.7771 +	fi
  1.7772 +      fi
  1.7773 +
  1.7774 +      # Replace the output file specification.
  1.7775 +      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  1.7776 +
  1.7777 +      # Delete the old output files.
  1.7778 +      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  1.7779 +
  1.7780 +      func_show_eval "$link_command" 'exit $?'
  1.7781 +
  1.7782 +      # Now create the wrapper script.
  1.7783 +      func_verbose "creating $output"
  1.7784 +
  1.7785 +      # Quote the relink command for shipping.
  1.7786 +      if test -n "$relink_command"; then
  1.7787 +	# Preserve any variables that may affect compiler behavior
  1.7788 +	for var in $variables_saved_for_relink; do
  1.7789 +	  if eval test -z \"\${$var+set}\"; then
  1.7790 +	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  1.7791 +	  elif eval var_value=\$$var; test -z "$var_value"; then
  1.7792 +	    relink_command="$var=; export $var; $relink_command"
  1.7793 +	  else
  1.7794 +	    func_quote_for_eval "$var_value"
  1.7795 +	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  1.7796 +	  fi
  1.7797 +	done
  1.7798 +	relink_command="(cd `pwd`; $relink_command)"
  1.7799 +	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.7800 +      fi
  1.7801 +
  1.7802 +      # Quote $ECHO for shipping.
  1.7803 +      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
  1.7804 +	case $progpath in
  1.7805 +	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  1.7806 +	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  1.7807 +	esac
  1.7808 +	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
  1.7809 +      else
  1.7810 +	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
  1.7811 +      fi
  1.7812 +
  1.7813 +      # Only actually do things if not in dry run mode.
  1.7814 +      $opt_dry_run || {
  1.7815 +	# win32 will think the script is a binary if it has
  1.7816 +	# a .exe suffix, so we strip it off here.
  1.7817 +	case $output in
  1.7818 +	  *.exe) func_stripname '' '.exe' "$output"
  1.7819 +	         output=$func_stripname_result ;;
  1.7820 +	esac
  1.7821 +	# test for cygwin because mv fails w/o .exe extensions
  1.7822 +	case $host in
  1.7823 +	  *cygwin*)
  1.7824 +	    exeext=.exe
  1.7825 +	    func_stripname '' '.exe' "$outputname"
  1.7826 +	    outputname=$func_stripname_result ;;
  1.7827 +	  *) exeext= ;;
  1.7828 +	esac
  1.7829 +	case $host in
  1.7830 +	  *cygwin* | *mingw* )
  1.7831 +	    func_dirname_and_basename "$output" "" "."
  1.7832 +	    output_name=$func_basename_result
  1.7833 +	    output_path=$func_dirname_result
  1.7834 +	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
  1.7835 +	    cwrapper="$output_path/$output_name.exe"
  1.7836 +	    $RM $cwrappersource $cwrapper
  1.7837 +	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  1.7838 +
  1.7839 +	    func_emit_cwrapperexe_src > $cwrappersource
  1.7840 +
  1.7841 +	    # The wrapper executable is built using the $host compiler,
  1.7842 +	    # because it contains $host paths and files. If cross-
  1.7843 +	    # compiling, it, like the target executable, must be
  1.7844 +	    # executed on the $host or under an emulation environment.
  1.7845 +	    $opt_dry_run || {
  1.7846 +	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  1.7847 +	      $STRIP $cwrapper
  1.7848 +	    }
  1.7849 +
  1.7850 +	    # Now, create the wrapper script for func_source use:
  1.7851 +	    func_ltwrapper_scriptname $cwrapper
  1.7852 +	    $RM $func_ltwrapper_scriptname_result
  1.7853 +	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  1.7854 +	    $opt_dry_run || {
  1.7855 +	      # note: this script will not be executed, so do not chmod.
  1.7856 +	      if test "x$build" = "x$host" ; then
  1.7857 +		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  1.7858 +	      else
  1.7859 +		func_emit_wrapper no > $func_ltwrapper_scriptname_result
  1.7860 +	      fi
  1.7861 +	    }
  1.7862 +	  ;;
  1.7863 +	  * )
  1.7864 +	    $RM $output
  1.7865 +	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  1.7866 +
  1.7867 +	    func_emit_wrapper no > $output
  1.7868 +	    chmod +x $output
  1.7869 +	  ;;
  1.7870 +	esac
  1.7871 +      }
  1.7872 +      exit $EXIT_SUCCESS
  1.7873 +      ;;
  1.7874 +    esac
  1.7875 +
  1.7876 +    # See if we need to build an old-fashioned archive.
  1.7877 +    for oldlib in $oldlibs; do
  1.7878 +
  1.7879 +      if test "$build_libtool_libs" = convenience; then
  1.7880 +	oldobjs="$libobjs_save $symfileobj"
  1.7881 +	addlibs="$convenience"
  1.7882 +	build_libtool_libs=no
  1.7883 +      else
  1.7884 +	if test "$build_libtool_libs" = module; then
  1.7885 +	  oldobjs="$libobjs_save"
  1.7886 +	  build_libtool_libs=no
  1.7887 +	else
  1.7888 +	  oldobjs="$old_deplibs $non_pic_objects"
  1.7889 +	  if test "$preload" = yes && test -f "$symfileobj"; then
  1.7890 +	    oldobjs="$oldobjs $symfileobj"
  1.7891 +	  fi
  1.7892 +	fi
  1.7893 +	addlibs="$old_convenience"
  1.7894 +      fi
  1.7895 +
  1.7896 +      if test -n "$addlibs"; then
  1.7897 +	gentop="$output_objdir/${outputname}x"
  1.7898 +	generated="$generated $gentop"
  1.7899 +
  1.7900 +	func_extract_archives $gentop $addlibs
  1.7901 +	oldobjs="$oldobjs $func_extract_archives_result"
  1.7902 +      fi
  1.7903 +
  1.7904 +      # Do each command in the archive commands.
  1.7905 +      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  1.7906 +	cmds=$old_archive_from_new_cmds
  1.7907 +      else
  1.7908 +
  1.7909 +	# Add any objects from preloaded convenience libraries
  1.7910 +	if test -n "$dlprefiles"; then
  1.7911 +	  gentop="$output_objdir/${outputname}x"
  1.7912 +	  generated="$generated $gentop"
  1.7913 +
  1.7914 +	  func_extract_archives $gentop $dlprefiles
  1.7915 +	  oldobjs="$oldobjs $func_extract_archives_result"
  1.7916 +	fi
  1.7917 +
  1.7918 +	# POSIX demands no paths to be encoded in archives.  We have
  1.7919 +	# to avoid creating archives with duplicate basenames if we
  1.7920 +	# might have to extract them afterwards, e.g., when creating a
  1.7921 +	# static archive out of a convenience library, or when linking
  1.7922 +	# the entirety of a libtool archive into another (currently
  1.7923 +	# not supported by libtool).
  1.7924 +	if (for obj in $oldobjs
  1.7925 +	    do
  1.7926 +	      func_basename "$obj"
  1.7927 +	      $ECHO "$func_basename_result"
  1.7928 +	    done | sort | sort -uc >/dev/null 2>&1); then
  1.7929 +	  :
  1.7930 +	else
  1.7931 +	  $ECHO "copying selected object files to avoid basename conflicts..."
  1.7932 +	  gentop="$output_objdir/${outputname}x"
  1.7933 +	  generated="$generated $gentop"
  1.7934 +	  func_mkdir_p "$gentop"
  1.7935 +	  save_oldobjs=$oldobjs
  1.7936 +	  oldobjs=
  1.7937 +	  counter=1
  1.7938 +	  for obj in $save_oldobjs
  1.7939 +	  do
  1.7940 +	    func_basename "$obj"
  1.7941 +	    objbase="$func_basename_result"
  1.7942 +	    case " $oldobjs " in
  1.7943 +	    " ") oldobjs=$obj ;;
  1.7944 +	    *[\ /]"$objbase "*)
  1.7945 +	      while :; do
  1.7946 +		# Make sure we don't pick an alternate name that also
  1.7947 +		# overlaps.
  1.7948 +		newobj=lt$counter-$objbase
  1.7949 +		func_arith $counter + 1
  1.7950 +		counter=$func_arith_result
  1.7951 +		case " $oldobjs " in
  1.7952 +		*[\ /]"$newobj "*) ;;
  1.7953 +		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
  1.7954 +		esac
  1.7955 +	      done
  1.7956 +	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  1.7957 +	      oldobjs="$oldobjs $gentop/$newobj"
  1.7958 +	      ;;
  1.7959 +	    *) oldobjs="$oldobjs $obj" ;;
  1.7960 +	    esac
  1.7961 +	  done
  1.7962 +	fi
  1.7963 +	eval cmds=\"$old_archive_cmds\"
  1.7964 +
  1.7965 +	func_len " $cmds"
  1.7966 +	len=$func_len_result
  1.7967 +	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7968 +	  cmds=$old_archive_cmds
  1.7969 +	else
  1.7970 +	  # the command line is too long to link in one step, link in parts
  1.7971 +	  func_verbose "using piecewise archive linking..."
  1.7972 +	  save_RANLIB=$RANLIB
  1.7973 +	  RANLIB=:
  1.7974 +	  objlist=
  1.7975 +	  concat_cmds=
  1.7976 +	  save_oldobjs=$oldobjs
  1.7977 +	  oldobjs=
  1.7978 +	  # Is there a better way of finding the last object in the list?
  1.7979 +	  for obj in $save_oldobjs
  1.7980 +	  do
  1.7981 +	    last_oldobj=$obj
  1.7982 +	  done
  1.7983 +	  eval test_cmds=\"$old_archive_cmds\"
  1.7984 +	  func_len " $test_cmds"
  1.7985 +	  len0=$func_len_result
  1.7986 +	  len=$len0
  1.7987 +	  for obj in $save_oldobjs
  1.7988 +	  do
  1.7989 +	    func_len " $obj"
  1.7990 +	    func_arith $len + $func_len_result
  1.7991 +	    len=$func_arith_result
  1.7992 +	    func_append objlist " $obj"
  1.7993 +	    if test "$len" -lt "$max_cmd_len"; then
  1.7994 +	      :
  1.7995 +	    else
  1.7996 +	      # the above command should be used before it gets too long
  1.7997 +	      oldobjs=$objlist
  1.7998 +	      if test "$obj" = "$last_oldobj" ; then
  1.7999 +		RANLIB=$save_RANLIB
  1.8000 +	      fi
  1.8001 +	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.8002 +	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  1.8003 +	      objlist=
  1.8004 +	      len=$len0
  1.8005 +	    fi
  1.8006 +	  done
  1.8007 +	  RANLIB=$save_RANLIB
  1.8008 +	  oldobjs=$objlist
  1.8009 +	  if test "X$oldobjs" = "X" ; then
  1.8010 +	    eval cmds=\"\$concat_cmds\"
  1.8011 +	  else
  1.8012 +	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  1.8013 +	  fi
  1.8014 +	fi
  1.8015 +      fi
  1.8016 +      func_execute_cmds "$cmds" 'exit $?'
  1.8017 +    done
  1.8018 +
  1.8019 +    test -n "$generated" && \
  1.8020 +      func_show_eval "${RM}r$generated"
  1.8021 +
  1.8022 +    # Now create the libtool archive.
  1.8023 +    case $output in
  1.8024 +    *.la)
  1.8025 +      old_library=
  1.8026 +      test "$build_old_libs" = yes && old_library="$libname.$libext"
  1.8027 +      func_verbose "creating $output"
  1.8028 +
  1.8029 +      # Preserve any variables that may affect compiler behavior
  1.8030 +      for var in $variables_saved_for_relink; do
  1.8031 +	if eval test -z \"\${$var+set}\"; then
  1.8032 +	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  1.8033 +	elif eval var_value=\$$var; test -z "$var_value"; then
  1.8034 +	  relink_command="$var=; export $var; $relink_command"
  1.8035 +	else
  1.8036 +	  func_quote_for_eval "$var_value"
  1.8037 +	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  1.8038 +	fi
  1.8039 +      done
  1.8040 +      # Quote the link command for shipping.
  1.8041 +      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  1.8042 +      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.8043 +      if test "$hardcode_automatic" = yes ; then
  1.8044 +	relink_command=
  1.8045 +      fi
  1.8046 +
  1.8047 +      # Only create the output if not a dry run.
  1.8048 +      $opt_dry_run || {
  1.8049 +	for installed in no yes; do
  1.8050 +	  if test "$installed" = yes; then
  1.8051 +	    if test -z "$install_libdir"; then
  1.8052 +	      break
  1.8053 +	    fi
  1.8054 +	    output="$output_objdir/$outputname"i
  1.8055 +	    # Replace all uninstalled libtool libraries with the installed ones
  1.8056 +	    newdependency_libs=
  1.8057 +	    for deplib in $dependency_libs; do
  1.8058 +	      case $deplib in
  1.8059 +	      *.la)
  1.8060 +		func_basename "$deplib"
  1.8061 +		name="$func_basename_result"
  1.8062 +		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.8063 +		test -z "$libdir" && \
  1.8064 +		  func_fatal_error "\`$deplib' is not a valid libtool archive"
  1.8065 +		newdependency_libs="$newdependency_libs $libdir/$name"
  1.8066 +		;;
  1.8067 +	      *) newdependency_libs="$newdependency_libs $deplib" ;;
  1.8068 +	      esac
  1.8069 +	    done
  1.8070 +	    dependency_libs="$newdependency_libs"
  1.8071 +	    newdlfiles=
  1.8072 +
  1.8073 +	    for lib in $dlfiles; do
  1.8074 +	      case $lib in
  1.8075 +	      *.la)
  1.8076 +	        func_basename "$lib"
  1.8077 +		name="$func_basename_result"
  1.8078 +		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  1.8079 +		test -z "$libdir" && \
  1.8080 +		  func_fatal_error "\`$lib' is not a valid libtool archive"
  1.8081 +		newdlfiles="$newdlfiles $libdir/$name"
  1.8082 +		;;
  1.8083 +	      *) newdlfiles="$newdlfiles $lib" ;;
  1.8084 +	      esac
  1.8085 +	    done
  1.8086 +	    dlfiles="$newdlfiles"
  1.8087 +	    newdlprefiles=
  1.8088 +	    for lib in $dlprefiles; do
  1.8089 +	      case $lib in
  1.8090 +	      *.la)
  1.8091 +		# Only pass preopened files to the pseudo-archive (for
  1.8092 +		# eventual linking with the app. that links it) if we
  1.8093 +		# didn't already link the preopened objects directly into
  1.8094 +		# the library:
  1.8095 +		func_basename "$lib"
  1.8096 +		name="$func_basename_result"
  1.8097 +		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  1.8098 +		test -z "$libdir" && \
  1.8099 +		  func_fatal_error "\`$lib' is not a valid libtool archive"
  1.8100 +		newdlprefiles="$newdlprefiles $libdir/$name"
  1.8101 +		;;
  1.8102 +	      esac
  1.8103 +	    done
  1.8104 +	    dlprefiles="$newdlprefiles"
  1.8105 +	  else
  1.8106 +	    newdlfiles=
  1.8107 +	    for lib in $dlfiles; do
  1.8108 +	      case $lib in
  1.8109 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  1.8110 +		*) abs=`pwd`"/$lib" ;;
  1.8111 +	      esac
  1.8112 +	      newdlfiles="$newdlfiles $abs"
  1.8113 +	    done
  1.8114 +	    dlfiles="$newdlfiles"
  1.8115 +	    newdlprefiles=
  1.8116 +	    for lib in $dlprefiles; do
  1.8117 +	      case $lib in
  1.8118 +		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  1.8119 +		*) abs=`pwd`"/$lib" ;;
  1.8120 +	      esac
  1.8121 +	      newdlprefiles="$newdlprefiles $abs"
  1.8122 +	    done
  1.8123 +	    dlprefiles="$newdlprefiles"
  1.8124 +	  fi
  1.8125 +	  $RM $output
  1.8126 +	  # place dlname in correct position for cygwin
  1.8127 +	  tdlname=$dlname
  1.8128 +	  case $host,$output,$installed,$module,$dlname in
  1.8129 +	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  1.8130 +	  esac
  1.8131 +	  $ECHO > $output "\
  1.8132 +# $outputname - a libtool library file
  1.8133 +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1.8134 +#
  1.8135 +# Please DO NOT delete this file!
  1.8136 +# It is necessary for linking the library.
  1.8137 +
  1.8138 +# The name that we can dlopen(3).
  1.8139 +dlname='$tdlname'
  1.8140 +
  1.8141 +# Names of this library.
  1.8142 +library_names='$library_names'
  1.8143 +
  1.8144 +# The name of the static archive.
  1.8145 +old_library='$old_library'
  1.8146 +
  1.8147 +# Linker flags that can not go in dependency_libs.
  1.8148 +inherited_linker_flags='$new_inherited_linker_flags'
  1.8149 +
  1.8150 +# Libraries that this one depends upon.
  1.8151 +dependency_libs='$dependency_libs'
  1.8152 +
  1.8153 +# Names of additional weak libraries provided by this library
  1.8154 +weak_library_names='$weak_libs'
  1.8155 +
  1.8156 +# Version information for $libname.
  1.8157 +current=$current
  1.8158 +age=$age
  1.8159 +revision=$revision
  1.8160 +
  1.8161 +# Is this an already installed library?
  1.8162 +installed=$installed
  1.8163 +
  1.8164 +# Should we warn about portability when linking against -modules?
  1.8165 +shouldnotlink=$module
  1.8166 +
  1.8167 +# Files to dlopen/dlpreopen
  1.8168 +dlopen='$dlfiles'
  1.8169 +dlpreopen='$dlprefiles'
  1.8170 +
  1.8171 +# Directory that this library needs to be installed in:
  1.8172 +libdir='$install_libdir'"
  1.8173 +	  if test "$installed" = no && test "$need_relink" = yes; then
  1.8174 +	    $ECHO >> $output "\
  1.8175 +relink_command=\"$relink_command\""
  1.8176 +	  fi
  1.8177 +	done
  1.8178 +      }
  1.8179 +
  1.8180 +      # Do a symbolic link so that the libtool archive can be found in
  1.8181 +      # LD_LIBRARY_PATH before the program is installed.
  1.8182 +      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  1.8183 +      ;;
  1.8184 +    esac
  1.8185 +    exit $EXIT_SUCCESS
  1.8186 +}
  1.8187 +
  1.8188 +{ test "$mode" = link || test "$mode" = relink; } &&
  1.8189 +    func_mode_link ${1+"$@"}
  1.8190 +
  1.8191 +
  1.8192 +# func_mode_uninstall arg...
  1.8193 +func_mode_uninstall ()
  1.8194 +{
  1.8195 +    $opt_debug
  1.8196 +    RM="$nonopt"
  1.8197 +    files=
  1.8198 +    rmforce=
  1.8199 +    exit_status=0
  1.8200 +
  1.8201 +    # This variable tells wrapper scripts just to set variables rather
  1.8202 +    # than running their programs.
  1.8203 +    libtool_install_magic="$magic"
  1.8204 +
  1.8205 +    for arg
  1.8206 +    do
  1.8207 +      case $arg in
  1.8208 +      -f) RM="$RM $arg"; rmforce=yes ;;
  1.8209 +      -*) RM="$RM $arg" ;;
  1.8210 +      *) files="$files $arg" ;;
  1.8211 +      esac
  1.8212 +    done
  1.8213 +
  1.8214 +    test -z "$RM" && \
  1.8215 +      func_fatal_help "you must specify an RM program"
  1.8216 +
  1.8217 +    rmdirs=
  1.8218 +
  1.8219 +    origobjdir="$objdir"
  1.8220 +    for file in $files; do
  1.8221 +      func_dirname "$file" "" "."
  1.8222 +      dir="$func_dirname_result"
  1.8223 +      if test "X$dir" = X.; then
  1.8224 +	objdir="$origobjdir"
  1.8225 +      else
  1.8226 +	objdir="$dir/$origobjdir"
  1.8227 +      fi
  1.8228 +      func_basename "$file"
  1.8229 +      name="$func_basename_result"
  1.8230 +      test "$mode" = uninstall && objdir="$dir"
  1.8231 +
  1.8232 +      # Remember objdir for removal later, being careful to avoid duplicates
  1.8233 +      if test "$mode" = clean; then
  1.8234 +	case " $rmdirs " in
  1.8235 +	  *" $objdir "*) ;;
  1.8236 +	  *) rmdirs="$rmdirs $objdir" ;;
  1.8237 +	esac
  1.8238 +      fi
  1.8239 +
  1.8240 +      # Don't error if the file doesn't exist and rm -f was used.
  1.8241 +      if { test -L "$file"; } >/dev/null 2>&1 ||
  1.8242 +	 { test -h "$file"; } >/dev/null 2>&1 ||
  1.8243 +	 test -f "$file"; then
  1.8244 +	:
  1.8245 +      elif test -d "$file"; then
  1.8246 +	exit_status=1
  1.8247 +	continue
  1.8248 +      elif test "$rmforce" = yes; then
  1.8249 +	continue
  1.8250 +      fi
  1.8251 +
  1.8252 +      rmfiles="$file"
  1.8253 +
  1.8254 +      case $name in
  1.8255 +      *.la)
  1.8256 +	# Possibly a libtool archive, so verify it.
  1.8257 +	if func_lalib_p "$file"; then
  1.8258 +	  func_source $dir/$name
  1.8259 +
  1.8260 +	  # Delete the libtool libraries and symlinks.
  1.8261 +	  for n in $library_names; do
  1.8262 +	    rmfiles="$rmfiles $objdir/$n"
  1.8263 +	  done
  1.8264 +	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  1.8265 +
  1.8266 +	  case "$mode" in
  1.8267 +	  clean)
  1.8268 +	    case "  $library_names " in
  1.8269 +	    # "  " in the beginning catches empty $dlname
  1.8270 +	    *" $dlname "*) ;;
  1.8271 +	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
  1.8272 +	    esac
  1.8273 +	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  1.8274 +	    ;;
  1.8275 +	  uninstall)
  1.8276 +	    if test -n "$library_names"; then
  1.8277 +	      # Do each command in the postuninstall commands.
  1.8278 +	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  1.8279 +	    fi
  1.8280 +
  1.8281 +	    if test -n "$old_library"; then
  1.8282 +	      # Do each command in the old_postuninstall commands.
  1.8283 +	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  1.8284 +	    fi
  1.8285 +	    # FIXME: should reinstall the best remaining shared library.
  1.8286 +	    ;;
  1.8287 +	  esac
  1.8288 +	fi
  1.8289 +	;;
  1.8290 +
  1.8291 +      *.lo)
  1.8292 +	# Possibly a libtool object, so verify it.
  1.8293 +	if func_lalib_p "$file"; then
  1.8294 +
  1.8295 +	  # Read the .lo file
  1.8296 +	  func_source $dir/$name
  1.8297 +
  1.8298 +	  # Add PIC object to the list of files to remove.
  1.8299 +	  if test -n "$pic_object" &&
  1.8300 +	     test "$pic_object" != none; then
  1.8301 +	    rmfiles="$rmfiles $dir/$pic_object"
  1.8302 +	  fi
  1.8303 +
  1.8304 +	  # Add non-PIC object to the list of files to remove.
  1.8305 +	  if test -n "$non_pic_object" &&
  1.8306 +	     test "$non_pic_object" != none; then
  1.8307 +	    rmfiles="$rmfiles $dir/$non_pic_object"
  1.8308 +	  fi
  1.8309 +	fi
  1.8310 +	;;
  1.8311 +
  1.8312 +      *)
  1.8313 +	if test "$mode" = clean ; then
  1.8314 +	  noexename=$name
  1.8315 +	  case $file in
  1.8316 +	  *.exe)
  1.8317 +	    func_stripname '' '.exe' "$file"
  1.8318 +	    file=$func_stripname_result
  1.8319 +	    func_stripname '' '.exe' "$name"
  1.8320 +	    noexename=$func_stripname_result
  1.8321 +	    # $file with .exe has already been added to rmfiles,
  1.8322 +	    # add $file without .exe
  1.8323 +	    rmfiles="$rmfiles $file"
  1.8324 +	    ;;
  1.8325 +	  esac
  1.8326 +	  # Do a test to see if this is a libtool program.
  1.8327 +	  if func_ltwrapper_p "$file"; then
  1.8328 +	    if func_ltwrapper_executable_p "$file"; then
  1.8329 +	      func_ltwrapper_scriptname "$file"
  1.8330 +	      relink_command=
  1.8331 +	      func_source $func_ltwrapper_scriptname_result
  1.8332 +	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
  1.8333 +	    else
  1.8334 +	      relink_command=
  1.8335 +	      func_source $dir/$noexename
  1.8336 +	    fi
  1.8337 +
  1.8338 +	    # note $name still contains .exe if it was in $file originally
  1.8339 +	    # as does the version of $file that was added into $rmfiles
  1.8340 +	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  1.8341 +	    if test "$fast_install" = yes && test -n "$relink_command"; then
  1.8342 +	      rmfiles="$rmfiles $objdir/lt-$name"
  1.8343 +	    fi
  1.8344 +	    if test "X$noexename" != "X$name" ; then
  1.8345 +	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  1.8346 +	    fi
  1.8347 +	  fi
  1.8348 +	fi
  1.8349 +	;;
  1.8350 +      esac
  1.8351 +      func_show_eval "$RM $rmfiles" 'exit_status=1'
  1.8352 +    done
  1.8353 +    objdir="$origobjdir"
  1.8354 +
  1.8355 +    # Try to remove the ${objdir}s in the directories where we deleted files
  1.8356 +    for dir in $rmdirs; do
  1.8357 +      if test -d "$dir"; then
  1.8358 +	func_show_eval "rmdir $dir >/dev/null 2>&1"
  1.8359 +      fi
  1.8360 +    done
  1.8361 +
  1.8362 +    exit $exit_status
  1.8363 +}
  1.8364 +
  1.8365 +{ test "$mode" = uninstall || test "$mode" = clean; } &&
  1.8366 +    func_mode_uninstall ${1+"$@"}
  1.8367 +
  1.8368 +test -z "$mode" && {
  1.8369 +  help="$generic_help"
  1.8370 +  func_fatal_help "you must specify a MODE"
  1.8371 +}
  1.8372 +
  1.8373 +test -z "$exec_cmd" && \
  1.8374 +  func_fatal_help "invalid operation mode \`$mode'"
  1.8375 +
  1.8376 +if test -n "$exec_cmd"; then
  1.8377 +  eval exec "$exec_cmd"
  1.8378 +  exit $EXIT_FAILURE
  1.8379 +fi
  1.8380 +
  1.8381 +exit $exit_status
  1.8382 +
  1.8383 +
  1.8384 +# The TAGs below are defined such that we never get into a situation
  1.8385 +# in which we disable both kinds of libraries.  Given conflicting
  1.8386 +# choices, we go for a static library, that is the most portable,
  1.8387 +# since we can't tell whether shared libraries were disabled because
  1.8388 +# the user asked for that or because the platform doesn't support
  1.8389 +# them.  This is particularly important on AIX, because we don't
  1.8390 +# support having both static and shared libraries enabled at the same
  1.8391 +# time on that platform, so we default to a shared-only configuration.
  1.8392 +# If a disable-shared tag is given, we'll fallback to a static-only
  1.8393 +# configuration.  But we'll never go from static-only to shared-only.
  1.8394 +
  1.8395 +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  1.8396 +build_libtool_libs=no
  1.8397 +build_old_libs=yes
  1.8398 +# ### END LIBTOOL TAG CONFIG: disable-shared
  1.8399 +
  1.8400 +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
  1.8401 +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  1.8402 +# ### END LIBTOOL TAG CONFIG: disable-static
  1.8403 +
  1.8404 +# Local Variables:
  1.8405 +# mode:shell-script
  1.8406 +# sh-indentation:2
  1.8407 +# End:
  1.8408 +# vi:sw=2
  1.8409 +

mercurial