build-scripts/ltmain.sh
changeset 6442 2d3caa191dc4
parent 5100 cce11d33d5c6
child 6446 80c98458312e
     1.1 --- a/build-scripts/ltmain.sh	Wed Sep 19 18:08:37 2012 -0700
     1.2 +++ b/build-scripts/ltmain.sh	Thu Sep 20 21:13:10 2012 -0700
     1.3 @@ -1,8407 +1,1 @@
     1.4 -# Generated from ltmain.m4sh.
     1.5 -
     1.6 -# ltmain.sh (GNU libtool) 2.2.6
     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.6
    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.6
    1.80 -TIMESTAMP=""
    1.81 -package_revision=1.3012
    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="/usr/bin/grep -E"}
   1.123 -: ${FGREP="/usr/bin/grep -F"}
   1.124 -: ${GREP="/usr/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="/opt/local/bin/gsed"}
   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 (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/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 -#undef main
  1.3366 -int
  1.3367 -main (int argc, char *argv[])
  1.3368 -{
  1.3369 -  char **newargz;
  1.3370 -  int  newargc;
  1.3371 -  char *tmp_pathspec;
  1.3372 -  char *actual_cwrapper_path;
  1.3373 -  char *actual_cwrapper_name;
  1.3374 -  char *target_name;
  1.3375 -  char *lt_argv_zero;
  1.3376 -  intptr_t rval = 127;
  1.3377 -
  1.3378 -  int i;
  1.3379 -
  1.3380 -  program_name = (char *) xstrdup (base_name (argv[0]));
  1.3381 -  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
  1.3382 -  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
  1.3383 -
  1.3384 -  /* very simple arg parsing; don't want to rely on getopt */
  1.3385 -  for (i = 1; i < argc; i++)
  1.3386 -    {
  1.3387 -      if (strcmp (argv[i], dumpscript_opt) == 0)
  1.3388 -	{
  1.3389 -EOF
  1.3390 -	    case "$host" in
  1.3391 -	      *mingw* | *cygwin* )
  1.3392 -		# make stdout use "unix" line endings
  1.3393 -		echo "          setmode(1,_O_BINARY);"
  1.3394 -		;;
  1.3395 -	      esac
  1.3396 -
  1.3397 -	    cat <<"EOF"
  1.3398 -	  printf ("%s", script_text_part1);
  1.3399 -	  printf ("%s", script_text_part2);
  1.3400 -	  return 0;
  1.3401 -	}
  1.3402 -    }
  1.3403 -
  1.3404 -  newargz = XMALLOC (char *, argc + 1);
  1.3405 -  tmp_pathspec = find_executable (argv[0]);
  1.3406 -  if (tmp_pathspec == NULL)
  1.3407 -    lt_fatal ("Couldn't find %s", argv[0]);
  1.3408 -  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
  1.3409 -			  tmp_pathspec));
  1.3410 -
  1.3411 -  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  1.3412 -  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
  1.3413 -			  actual_cwrapper_path));
  1.3414 -  XFREE (tmp_pathspec);
  1.3415 -
  1.3416 -  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
  1.3417 -  strendzap (actual_cwrapper_path, actual_cwrapper_name);
  1.3418 -
  1.3419 -  /* wrapper name transforms */
  1.3420 -  strendzap (actual_cwrapper_name, ".exe");
  1.3421 -  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  1.3422 -  XFREE (actual_cwrapper_name);
  1.3423 -  actual_cwrapper_name = tmp_pathspec;
  1.3424 -  tmp_pathspec = 0;
  1.3425 -
  1.3426 -  /* target_name transforms -- use actual target program name; might have lt- prefix */
  1.3427 -  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  1.3428 -  strendzap (target_name, ".exe");
  1.3429 -  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  1.3430 -  XFREE (target_name);
  1.3431 -  target_name = tmp_pathspec;
  1.3432 -  tmp_pathspec = 0;
  1.3433 -
  1.3434 -  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
  1.3435 -			  target_name));
  1.3436 -EOF
  1.3437 -
  1.3438 -	    cat <<EOF
  1.3439 -  newargz[0] =
  1.3440 -    XMALLOC (char, (strlen (actual_cwrapper_path) +
  1.3441 -		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  1.3442 -  strcpy (newargz[0], actual_cwrapper_path);
  1.3443 -  strcat (newargz[0], "$objdir");
  1.3444 -  strcat (newargz[0], "/");
  1.3445 -EOF
  1.3446 -
  1.3447 -	    cat <<"EOF"
  1.3448 -  /* stop here, and copy so we don't have to do this twice */
  1.3449 -  tmp_pathspec = xstrdup (newargz[0]);
  1.3450 -
  1.3451 -  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  1.3452 -  strcat (newargz[0], actual_cwrapper_name);
  1.3453 -
  1.3454 -  /* DO want the lt- prefix here if it exists, so use target_name */
  1.3455 -  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  1.3456 -  XFREE (tmp_pathspec);
  1.3457 -  tmp_pathspec = NULL;
  1.3458 -EOF
  1.3459 -
  1.3460 -	    case $host_os in
  1.3461 -	      mingw*)
  1.3462 -	    cat <<"EOF"
  1.3463 -  {
  1.3464 -    char* p;
  1.3465 -    while ((p = strchr (newargz[0], '\\')) != NULL)
  1.3466 -      {
  1.3467 -	*p = '/';
  1.3468 -      }
  1.3469 -    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  1.3470 -      {
  1.3471 -	*p = '/';
  1.3472 -      }
  1.3473 -  }
  1.3474 -EOF
  1.3475 -	    ;;
  1.3476 -	    esac
  1.3477 -
  1.3478 -	    cat <<"EOF"
  1.3479 -  XFREE (target_name);
  1.3480 -  XFREE (actual_cwrapper_path);
  1.3481 -  XFREE (actual_cwrapper_name);
  1.3482 -
  1.3483 -  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  1.3484 -  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
  1.3485 -  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  1.3486 -  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  1.3487 -
  1.3488 -  newargc=0;
  1.3489 -  for (i = 1; i < argc; i++)
  1.3490 -    {
  1.3491 -      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
  1.3492 -        {
  1.3493 -          if (argv[i][env_set_opt_len] == '=')
  1.3494 -            {
  1.3495 -              const char *p = argv[i] + env_set_opt_len + 1;
  1.3496 -              lt_opt_process_env_set (p);
  1.3497 -            }
  1.3498 -          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
  1.3499 -            {
  1.3500 -              lt_opt_process_env_set (argv[++i]); /* don't copy */
  1.3501 -            }
  1.3502 -          else
  1.3503 -            lt_fatal ("%s missing required argument", env_set_opt);
  1.3504 -          continue;
  1.3505 -        }
  1.3506 -      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
  1.3507 -        {
  1.3508 -          if (argv[i][env_prepend_opt_len] == '=')
  1.3509 -            {
  1.3510 -              const char *p = argv[i] + env_prepend_opt_len + 1;
  1.3511 -              lt_opt_process_env_prepend (p);
  1.3512 -            }
  1.3513 -          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
  1.3514 -            {
  1.3515 -              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
  1.3516 -            }
  1.3517 -          else
  1.3518 -            lt_fatal ("%s missing required argument", env_prepend_opt);
  1.3519 -          continue;
  1.3520 -        }
  1.3521 -      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
  1.3522 -        {
  1.3523 -          if (argv[i][env_append_opt_len] == '=')
  1.3524 -            {
  1.3525 -              const char *p = argv[i] + env_append_opt_len + 1;
  1.3526 -              lt_opt_process_env_append (p);
  1.3527 -            }
  1.3528 -          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
  1.3529 -            {
  1.3530 -              lt_opt_process_env_append (argv[++i]); /* don't copy */
  1.3531 -            }
  1.3532 -          else
  1.3533 -            lt_fatal ("%s missing required argument", env_append_opt);
  1.3534 -          continue;
  1.3535 -        }
  1.3536 -      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
  1.3537 -        {
  1.3538 -          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  1.3539 -             namespace, but it is not one of the ones we know about and
  1.3540 -             have already dealt with, above (inluding dump-script), then
  1.3541 -             report an error. Otherwise, targets might begin to believe
  1.3542 -             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  1.3543 -             namespace. The first time any user complains about this, we'll
  1.3544 -             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  1.3545 -             or a configure.ac-settable value.
  1.3546 -           */
  1.3547 -          lt_fatal ("Unrecognized option in %s namespace: '%s'",
  1.3548 -                    ltwrapper_option_prefix, argv[i]);
  1.3549 -        }
  1.3550 -      /* otherwise ... */
  1.3551 -      newargz[++newargc] = xstrdup (argv[i]);
  1.3552 -    }
  1.3553 -  newargz[++newargc] = NULL;
  1.3554 -
  1.3555 -  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
  1.3556 -  for (i = 0; i < newargc; i++)
  1.3557 -    {
  1.3558 -      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
  1.3559 -    }
  1.3560 -
  1.3561 -EOF
  1.3562 -
  1.3563 -	    case $host_os in
  1.3564 -	      mingw*)
  1.3565 -		cat <<"EOF"
  1.3566 -  /* execv doesn't actually work on mingw as expected on unix */
  1.3567 -  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  1.3568 -  if (rval == -1)
  1.3569 -    {
  1.3570 -      /* failed to start process */
  1.3571 -      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
  1.3572 -      return 127;
  1.3573 -    }
  1.3574 -  return rval;
  1.3575 -EOF
  1.3576 -		;;
  1.3577 -	      *)
  1.3578 -		cat <<"EOF"
  1.3579 -  execv (lt_argv_zero, newargz);
  1.3580 -  return rval; /* =127, but avoids unused variable warning */
  1.3581 -EOF
  1.3582 -		;;
  1.3583 -	    esac
  1.3584 -
  1.3585 -	    cat <<"EOF"
  1.3586 -}
  1.3587 -
  1.3588 -void *
  1.3589 -xmalloc (size_t num)
  1.3590 -{
  1.3591 -  void *p = (void *) malloc (num);
  1.3592 -  if (!p)
  1.3593 -    lt_fatal ("Memory exhausted");
  1.3594 -
  1.3595 -  return p;
  1.3596 -}
  1.3597 -
  1.3598 -char *
  1.3599 -xstrdup (const char *string)
  1.3600 -{
  1.3601 -  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  1.3602 -			  string) : NULL;
  1.3603 -}
  1.3604 -
  1.3605 -const char *
  1.3606 -base_name (const char *name)
  1.3607 -{
  1.3608 -  const char *base;
  1.3609 -
  1.3610 -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3611 -  /* Skip over the disk name in MSDOS pathnames. */
  1.3612 -  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  1.3613 -    name += 2;
  1.3614 -#endif
  1.3615 -
  1.3616 -  for (base = name; *name; name++)
  1.3617 -    if (IS_DIR_SEPARATOR (*name))
  1.3618 -      base = name + 1;
  1.3619 -  return base;
  1.3620 -}
  1.3621 -
  1.3622 -int
  1.3623 -check_executable (const char *path)
  1.3624 -{
  1.3625 -  struct stat st;
  1.3626 -
  1.3627 -  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
  1.3628 -			  path ? (*path ? path : "EMPTY!") : "NULL!"));
  1.3629 -  if ((!path) || (!*path))
  1.3630 -    return 0;
  1.3631 -
  1.3632 -  if ((stat (path, &st) >= 0)
  1.3633 -      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  1.3634 -    return 1;
  1.3635 -  else
  1.3636 -    return 0;
  1.3637 -}
  1.3638 -
  1.3639 -int
  1.3640 -make_executable (const char *path)
  1.3641 -{
  1.3642 -  int rval = 0;
  1.3643 -  struct stat st;
  1.3644 -
  1.3645 -  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
  1.3646 -			  path ? (*path ? path : "EMPTY!") : "NULL!"));
  1.3647 -  if ((!path) || (!*path))
  1.3648 -    return 0;
  1.3649 -
  1.3650 -  if (stat (path, &st) >= 0)
  1.3651 -    {
  1.3652 -      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  1.3653 -    }
  1.3654 -  return rval;
  1.3655 -}
  1.3656 -
  1.3657 -/* Searches for the full path of the wrapper.  Returns
  1.3658 -   newly allocated full path name if found, NULL otherwise
  1.3659 -   Does not chase symlinks, even on platforms that support them.
  1.3660 -*/
  1.3661 -char *
  1.3662 -find_executable (const char *wrapper)
  1.3663 -{
  1.3664 -  int has_slash = 0;
  1.3665 -  const char *p;
  1.3666 -  const char *p_next;
  1.3667 -  /* static buffer for getcwd */
  1.3668 -  char tmp[LT_PATHMAX + 1];
  1.3669 -  int tmp_len;
  1.3670 -  char *concat_name;
  1.3671 -
  1.3672 -  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
  1.3673 -			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
  1.3674 -
  1.3675 -  if ((wrapper == NULL) || (*wrapper == '\0'))
  1.3676 -    return NULL;
  1.3677 -
  1.3678 -  /* Absolute path? */
  1.3679 -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3680 -  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  1.3681 -    {
  1.3682 -      concat_name = xstrdup (wrapper);
  1.3683 -      if (check_executable (concat_name))
  1.3684 -	return concat_name;
  1.3685 -      XFREE (concat_name);
  1.3686 -    }
  1.3687 -  else
  1.3688 -    {
  1.3689 -#endif
  1.3690 -      if (IS_DIR_SEPARATOR (wrapper[0]))
  1.3691 -	{
  1.3692 -	  concat_name = xstrdup (wrapper);
  1.3693 -	  if (check_executable (concat_name))
  1.3694 -	    return concat_name;
  1.3695 -	  XFREE (concat_name);
  1.3696 -	}
  1.3697 -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  1.3698 -    }
  1.3699 -#endif
  1.3700 -
  1.3701 -  for (p = wrapper; *p; p++)
  1.3702 -    if (*p == '/')
  1.3703 -      {
  1.3704 -	has_slash = 1;
  1.3705 -	break;
  1.3706 -      }
  1.3707 -  if (!has_slash)
  1.3708 -    {
  1.3709 -      /* no slashes; search PATH */
  1.3710 -      const char *path = getenv ("PATH");
  1.3711 -      if (path != NULL)
  1.3712 -	{
  1.3713 -	  for (p = path; *p; p = p_next)
  1.3714 -	    {
  1.3715 -	      const char *q;
  1.3716 -	      size_t p_len;
  1.3717 -	      for (q = p; *q; q++)
  1.3718 -		if (IS_PATH_SEPARATOR (*q))
  1.3719 -		  break;
  1.3720 -	      p_len = q - p;
  1.3721 -	      p_next = (*q == '\0' ? q : q + 1);
  1.3722 -	      if (p_len == 0)
  1.3723 -		{
  1.3724 -		  /* empty path: current directory */
  1.3725 -		  if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.3726 -		    lt_fatal ("getcwd failed");
  1.3727 -		  tmp_len = strlen (tmp);
  1.3728 -		  concat_name =
  1.3729 -		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  1.3730 -		  memcpy (concat_name, tmp, tmp_len);
  1.3731 -		  concat_name[tmp_len] = '/';
  1.3732 -		  strcpy (concat_name + tmp_len + 1, wrapper);
  1.3733 -		}
  1.3734 -	      else
  1.3735 -		{
  1.3736 -		  concat_name =
  1.3737 -		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  1.3738 -		  memcpy (concat_name, p, p_len);
  1.3739 -		  concat_name[p_len] = '/';
  1.3740 -		  strcpy (concat_name + p_len + 1, wrapper);
  1.3741 -		}
  1.3742 -	      if (check_executable (concat_name))
  1.3743 -		return concat_name;
  1.3744 -	      XFREE (concat_name);
  1.3745 -	    }
  1.3746 -	}
  1.3747 -      /* not found in PATH; assume curdir */
  1.3748 -    }
  1.3749 -  /* Relative path | not found in path: prepend cwd */
  1.3750 -  if (getcwd (tmp, LT_PATHMAX) == NULL)
  1.3751 -    lt_fatal ("getcwd failed");
  1.3752 -  tmp_len = strlen (tmp);
  1.3753 -  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  1.3754 -  memcpy (concat_name, tmp, tmp_len);
  1.3755 -  concat_name[tmp_len] = '/';
  1.3756 -  strcpy (concat_name + tmp_len + 1, wrapper);
  1.3757 -
  1.3758 -  if (check_executable (concat_name))
  1.3759 -    return concat_name;
  1.3760 -  XFREE (concat_name);
  1.3761 -  return NULL;
  1.3762 -}
  1.3763 -
  1.3764 -char *
  1.3765 -chase_symlinks (const char *pathspec)
  1.3766 -{
  1.3767 -#ifndef S_ISLNK
  1.3768 -  return xstrdup (pathspec);
  1.3769 -#else
  1.3770 -  char buf[LT_PATHMAX];
  1.3771 -  struct stat s;
  1.3772 -  char *tmp_pathspec = xstrdup (pathspec);
  1.3773 -  char *p;
  1.3774 -  int has_symlinks = 0;
  1.3775 -  while (strlen (tmp_pathspec) && !has_symlinks)
  1.3776 -    {
  1.3777 -      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
  1.3778 -			      tmp_pathspec));
  1.3779 -      if (lstat (tmp_pathspec, &s) == 0)
  1.3780 -	{
  1.3781 -	  if (S_ISLNK (s.st_mode) != 0)
  1.3782 -	    {
  1.3783 -	      has_symlinks = 1;
  1.3784 -	      break;
  1.3785 -	    }
  1.3786 -
  1.3787 -	  /* search backwards for last DIR_SEPARATOR */
  1.3788 -	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  1.3789 -	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  1.3790 -	    p--;
  1.3791 -	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  1.3792 -	    {
  1.3793 -	      /* no more DIR_SEPARATORS left */
  1.3794 -	      break;
  1.3795 -	    }
  1.3796 -	  *p = '\0';
  1.3797 -	}
  1.3798 -      else
  1.3799 -	{
  1.3800 -	  char *errstr = strerror (errno);
  1.3801 -	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
  1.3802 -	}
  1.3803 -    }
  1.3804 -  XFREE (tmp_pathspec);
  1.3805 -
  1.3806 -  if (!has_symlinks)
  1.3807 -    {
  1.3808 -      return xstrdup (pathspec);
  1.3809 -    }
  1.3810 -
  1.3811 -  tmp_pathspec = realpath (pathspec, buf);
  1.3812 -  if (tmp_pathspec == 0)
  1.3813 -    {
  1.3814 -      lt_fatal ("Could not follow symlinks for %s", pathspec);
  1.3815 -    }
  1.3816 -  return xstrdup (tmp_pathspec);
  1.3817 -#endif
  1.3818 -}
  1.3819 -
  1.3820 -char *
  1.3821 -strendzap (char *str, const char *pat)
  1.3822 -{
  1.3823 -  size_t len, patlen;
  1.3824 -
  1.3825 -  assert (str != NULL);
  1.3826 -  assert (pat != NULL);
  1.3827 -
  1.3828 -  len = strlen (str);
  1.3829 -  patlen = strlen (pat);
  1.3830 -
  1.3831 -  if (patlen <= len)
  1.3832 -    {
  1.3833 -      str += len - patlen;
  1.3834 -      if (strcmp (str, pat) == 0)
  1.3835 -	*str = '\0';
  1.3836 -    }
  1.3837 -  return str;
  1.3838 -}
  1.3839 -
  1.3840 -static void
  1.3841 -lt_error_core (int exit_status, const char *mode,
  1.3842 -	       const char *message, va_list ap)
  1.3843 -{
  1.3844 -  fprintf (stderr, "%s: %s: ", program_name, mode);
  1.3845 -  vfprintf (stderr, message, ap);
  1.3846 -  fprintf (stderr, ".\n");
  1.3847 -
  1.3848 -  if (exit_status >= 0)
  1.3849 -    exit (exit_status);
  1.3850 -}
  1.3851 -
  1.3852 -void
  1.3853 -lt_fatal (const char *message, ...)
  1.3854 -{
  1.3855 -  va_list ap;
  1.3856 -  va_start (ap, message);
  1.3857 -  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  1.3858 -  va_end (ap);
  1.3859 -}
  1.3860 -
  1.3861 -void
  1.3862 -lt_setenv (const char *name, const char *value)
  1.3863 -{
  1.3864 -  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
  1.3865 -                          (name ? name : "<NULL>"),
  1.3866 -                          (value ? value : "<NULL>")));
  1.3867 -  {
  1.3868 -#ifdef HAVE_SETENV
  1.3869 -    /* always make a copy, for consistency with !HAVE_SETENV */
  1.3870 -    char *str = xstrdup (value);
  1.3871 -    setenv (name, str, 1);
  1.3872 -#else
  1.3873 -    int len = strlen (name) + 1 + strlen (value) + 1;
  1.3874 -    char *str = XMALLOC (char, len);
  1.3875 -    sprintf (str, "%s=%s", name, value);
  1.3876 -    if (putenv (str) != EXIT_SUCCESS)
  1.3877 -      {
  1.3878 -        XFREE (str);
  1.3879 -      }
  1.3880 -#endif
  1.3881 -  }
  1.3882 -}
  1.3883 -
  1.3884 -char *
  1.3885 -lt_extend_str (const char *orig_value, const char *add, int to_end)
  1.3886 -{
  1.3887 -  char *new_value;
  1.3888 -  if (orig_value && *orig_value)
  1.3889 -    {
  1.3890 -      int orig_value_len = strlen (orig_value);
  1.3891 -      int add_len = strlen (add);
  1.3892 -      new_value = XMALLOC (char, add_len + orig_value_len + 1);
  1.3893 -      if (to_end)
  1.3894 -        {
  1.3895 -          strcpy (new_value, orig_value);
  1.3896 -          strcpy (new_value + orig_value_len, add);
  1.3897 -        }
  1.3898 -      else
  1.3899 -        {
  1.3900 -          strcpy (new_value, add);
  1.3901 -          strcpy (new_value + add_len, orig_value);
  1.3902 -        }
  1.3903 -    }
  1.3904 -  else
  1.3905 -    {
  1.3906 -      new_value = xstrdup (add);
  1.3907 -    }
  1.3908 -  return new_value;
  1.3909 -}
  1.3910 -
  1.3911 -int
  1.3912 -lt_split_name_value (const char *arg, char** name, char** value)
  1.3913 -{
  1.3914 -  const char *p;
  1.3915 -  int len;
  1.3916 -  if (!arg || !*arg)
  1.3917 -    return 1;
  1.3918 -
  1.3919 -  p = strchr (arg, (int)'=');
  1.3920 -
  1.3921 -  if (!p)
  1.3922 -    return 1;
  1.3923 -
  1.3924 -  *value = xstrdup (++p);
  1.3925 -
  1.3926 -  len = strlen (arg) - strlen (*value);
  1.3927 -  *name = XMALLOC (char, len);
  1.3928 -  strncpy (*name, arg, len-1);
  1.3929 -  (*name)[len - 1] = '\0';
  1.3930 -
  1.3931 -  return 0;
  1.3932 -}
  1.3933 -
  1.3934 -void
  1.3935 -lt_opt_process_env_set (const char *arg)
  1.3936 -{
  1.3937 -  char *name = NULL;
  1.3938 -  char *value = NULL;
  1.3939 -
  1.3940 -  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3941 -    {
  1.3942 -      XFREE (name);
  1.3943 -      XFREE (value);
  1.3944 -      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
  1.3945 -    }
  1.3946 -
  1.3947 -  lt_setenv (name, value);
  1.3948 -  XFREE (name);
  1.3949 -  XFREE (value);
  1.3950 -}
  1.3951 -
  1.3952 -void
  1.3953 -lt_opt_process_env_prepend (const char *arg)
  1.3954 -{
  1.3955 -  char *name = NULL;
  1.3956 -  char *value = NULL;
  1.3957 -  char *new_value = NULL;
  1.3958 -
  1.3959 -  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3960 -    {
  1.3961 -      XFREE (name);
  1.3962 -      XFREE (value);
  1.3963 -      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
  1.3964 -    }
  1.3965 -
  1.3966 -  new_value = lt_extend_str (getenv (name), value, 0);
  1.3967 -  lt_setenv (name, new_value);
  1.3968 -  XFREE (new_value);
  1.3969 -  XFREE (name);
  1.3970 -  XFREE (value);
  1.3971 -}
  1.3972 -
  1.3973 -void
  1.3974 -lt_opt_process_env_append (const char *arg)
  1.3975 -{
  1.3976 -  char *name = NULL;
  1.3977 -  char *value = NULL;
  1.3978 -  char *new_value = NULL;
  1.3979 -
  1.3980 -  if (lt_split_name_value (arg, &name, &value) != 0)
  1.3981 -    {
  1.3982 -      XFREE (name);
  1.3983 -      XFREE (value);
  1.3984 -      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
  1.3985 -    }
  1.3986 -
  1.3987 -  new_value = lt_extend_str (getenv (name), value, 1);
  1.3988 -  lt_setenv (name, new_value);
  1.3989 -  XFREE (new_value);
  1.3990 -  XFREE (name);
  1.3991 -  XFREE (value);
  1.3992 -}
  1.3993 -
  1.3994 -void
  1.3995 -lt_update_exe_path (const char *name, const char *value)
  1.3996 -{
  1.3997 -  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  1.3998 -                          (name ? name : "<NULL>"),
  1.3999 -                          (value ? value : "<NULL>")));
  1.4000 -
  1.4001 -  if (name && *name && value && *value)
  1.4002 -    {
  1.4003 -      char *new_value = lt_extend_str (getenv (name), value, 0);
  1.4004 -      /* some systems can't cope with a ':'-terminated path #' */
  1.4005 -      int len = strlen (new_value);
  1.4006 -      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  1.4007 -        {
  1.4008 -          new_value[len-1] = '\0';
  1.4009 -        }
  1.4010 -      lt_setenv (name, new_value);
  1.4011 -      XFREE (new_value);
  1.4012 -    }
  1.4013 -}
  1.4014 -
  1.4015 -void
  1.4016 -lt_update_lib_path (const char *name, const char *value)
  1.4017 -{
  1.4018 -  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  1.4019 -                          (name ? name : "<NULL>"),
  1.4020 -                          (value ? value : "<NULL>")));
  1.4021 -
  1.4022 -  if (name && *name && value && *value)
  1.4023 -    {
  1.4024 -      char *new_value = lt_extend_str (getenv (name), value, 0);
  1.4025 -      lt_setenv (name, new_value);
  1.4026 -      XFREE (new_value);
  1.4027 -    }
  1.4028 -}
  1.4029 -
  1.4030 -
  1.4031 -EOF
  1.4032 -}
  1.4033 -# end: func_emit_cwrapperexe_src
  1.4034 -
  1.4035 -# func_mode_link arg...
  1.4036 -func_mode_link ()
  1.4037 -{
  1.4038 -    $opt_debug
  1.4039 -    case $host in
  1.4040 -    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.4041 -      # It is impossible to link a dll without this setting, and
  1.4042 -      # we shouldn't force the makefile maintainer to figure out
  1.4043 -      # which system we are compiling for in order to pass an extra
  1.4044 -      # flag for every libtool invocation.
  1.4045 -      # allow_undefined=no
  1.4046 -
  1.4047 -      # FIXME: Unfortunately, there are problems with the above when trying
  1.4048 -      # to make a dll which has undefined symbols, in which case not
  1.4049 -      # even a static library is built.  For now, we need to specify
  1.4050 -      # -no-undefined on the libtool link line when we can be certain
  1.4051 -      # that all symbols are satisfied, otherwise we get a static library.
  1.4052 -      allow_undefined=yes
  1.4053 -      ;;
  1.4054 -    *)
  1.4055 -      allow_undefined=yes
  1.4056 -      ;;
  1.4057 -    esac
  1.4058 -    libtool_args=$nonopt
  1.4059 -    base_compile="$nonopt $@"
  1.4060 -    compile_command=$nonopt
  1.4061 -    finalize_command=$nonopt
  1.4062 -
  1.4063 -    compile_rpath=
  1.4064 -    finalize_rpath=
  1.4065 -    compile_shlibpath=
  1.4066 -    finalize_shlibpath=
  1.4067 -    convenience=
  1.4068 -    old_convenience=
  1.4069 -    deplibs=
  1.4070 -    old_deplibs=
  1.4071 -    compiler_flags=
  1.4072 -    linker_flags=
  1.4073 -    dllsearchpath=
  1.4074 -    lib_search_path=`pwd`
  1.4075 -    inst_prefix_dir=
  1.4076 -    new_inherited_linker_flags=
  1.4077 -
  1.4078 -    avoid_version=no
  1.4079 -    dlfiles=
  1.4080 -    dlprefiles=
  1.4081 -    dlself=no
  1.4082 -    export_dynamic=no
  1.4083 -    export_symbols=
  1.4084 -    export_symbols_regex=
  1.4085 -    generated=
  1.4086 -    libobjs=
  1.4087 -    ltlibs=
  1.4088 -    module=no
  1.4089 -    no_install=no
  1.4090 -    objs=
  1.4091 -    non_pic_objects=
  1.4092 -    precious_files_regex=
  1.4093 -    prefer_static_libs=no
  1.4094 -    preload=no
  1.4095 -    prev=
  1.4096 -    prevarg=
  1.4097 -    release=
  1.4098 -    rpath=
  1.4099 -    xrpath=
  1.4100 -    perm_rpath=
  1.4101 -    temp_rpath=
  1.4102 -    thread_safe=no
  1.4103 -    vinfo=
  1.4104 -    vinfo_number=no
  1.4105 -    weak_libs=
  1.4106 -    single_module="${wl}-single_module"
  1.4107 -    func_infer_tag $base_compile
  1.4108 -
  1.4109 -    # We need to know -static, to get the right output filenames.
  1.4110 -    for arg
  1.4111 -    do
  1.4112 -      case $arg in
  1.4113 -      -shared)
  1.4114 -	test "$build_libtool_libs" != yes && \
  1.4115 -	  func_fatal_configuration "can not build a shared library"
  1.4116 -	build_old_libs=no
  1.4117 -	break
  1.4118 -	;;
  1.4119 -      -all-static | -static | -static-libtool-libs)
  1.4120 -	case $arg in
  1.4121 -	-all-static)
  1.4122 -	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1.4123 -	    func_warning "complete static linking is impossible in this configuration"
  1.4124 -	  fi
  1.4125 -	  if test -n "$link_static_flag"; then
  1.4126 -	    dlopen_self=$dlopen_self_static
  1.4127 -	  fi
  1.4128 -	  prefer_static_libs=yes
  1.4129 -	  ;;
  1.4130 -	-static)
  1.4131 -	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1.4132 -	    dlopen_self=$dlopen_self_static
  1.4133 -	  fi
  1.4134 -	  prefer_static_libs=built
  1.4135 -	  ;;
  1.4136 -	-static-libtool-libs)
  1.4137 -	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1.4138 -	    dlopen_self=$dlopen_self_static
  1.4139 -	  fi
  1.4140 -	  prefer_static_libs=yes
  1.4141 -	  ;;
  1.4142 -	esac
  1.4143 -	build_libtool_libs=no
  1.4144 -	build_old_libs=yes
  1.4145 -	break
  1.4146 -	;;
  1.4147 -      esac
  1.4148 -    done
  1.4149 -
  1.4150 -    # See if our shared archives depend on static archives.
  1.4151 -    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1.4152 -
  1.4153 -    # Go through the arguments, transforming them on the way.
  1.4154 -    while test "$#" -gt 0; do
  1.4155 -      arg="$1"
  1.4156 -      shift
  1.4157 -      func_quote_for_eval "$arg"
  1.4158 -      qarg=$func_quote_for_eval_unquoted_result
  1.4159 -      func_append libtool_args " $func_quote_for_eval_result"
  1.4160 -
  1.4161 -      # If the previous option needs an argument, assign it.
  1.4162 -      if test -n "$prev"; then
  1.4163 -	case $prev in
  1.4164 -	output)
  1.4165 -	  func_append compile_command " @OUTPUT@"
  1.4166 -	  func_append finalize_command " @OUTPUT@"
  1.4167 -	  ;;
  1.4168 -	esac
  1.4169 -
  1.4170 -	case $prev in
  1.4171 -	dlfiles|dlprefiles)
  1.4172 -	  if test "$preload" = no; then
  1.4173 -	    # Add the symbol object into the linking commands.
  1.4174 -	    func_append compile_command " @SYMFILE@"
  1.4175 -	    func_append finalize_command " @SYMFILE@"
  1.4176 -	    preload=yes
  1.4177 -	  fi
  1.4178 -	  case $arg in
  1.4179 -	  *.la | *.lo) ;;  # We handle these cases below.
  1.4180 -	  force)
  1.4181 -	    if test "$dlself" = no; then
  1.4182 -	      dlself=needless
  1.4183 -	      export_dynamic=yes
  1.4184 -	    fi
  1.4185 -	    prev=
  1.4186 -	    continue
  1.4187 -	    ;;
  1.4188 -	  self)
  1.4189 -	    if test "$prev" = dlprefiles; then
  1.4190 -	      dlself=yes
  1.4191 -	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1.4192 -	      dlself=yes
  1.4193 -	    else
  1.4194 -	      dlself=needless
  1.4195 -	      export_dynamic=yes
  1.4196 -	    fi
  1.4197 -	    prev=
  1.4198 -	    continue
  1.4199 -	    ;;
  1.4200 -	  *)
  1.4201 -	    if test "$prev" = dlfiles; then
  1.4202 -	      dlfiles="$dlfiles $arg"
  1.4203 -	    else
  1.4204 -	      dlprefiles="$dlprefiles $arg"
  1.4205 -	    fi
  1.4206 -	    prev=
  1.4207 -	    continue
  1.4208 -	    ;;
  1.4209 -	  esac
  1.4210 -	  ;;
  1.4211 -	expsyms)
  1.4212 -	  export_symbols="$arg"
  1.4213 -	  test -f "$arg" \
  1.4214 -	    || func_fatal_error "symbol file \`$arg' does not exist"
  1.4215 -	  prev=
  1.4216 -	  continue
  1.4217 -	  ;;
  1.4218 -	expsyms_regex)
  1.4219 -	  export_symbols_regex="$arg"
  1.4220 -	  prev=
  1.4221 -	  continue
  1.4222 -	  ;;
  1.4223 -	framework)
  1.4224 -	  case $host in
  1.4225 -	    *-*-darwin*)
  1.4226 -	      case "$deplibs " in
  1.4227 -		*" $qarg.ltframework "*) ;;
  1.4228 -		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
  1.4229 -		   ;;
  1.4230 -	      esac
  1.4231 -	      ;;
  1.4232 -	  esac
  1.4233 -	  prev=
  1.4234 -	  continue
  1.4235 -	  ;;
  1.4236 -	inst_prefix)
  1.4237 -	  inst_prefix_dir="$arg"
  1.4238 -	  prev=
  1.4239 -	  continue
  1.4240 -	  ;;
  1.4241 -	objectlist)
  1.4242 -	  if test -f "$arg"; then
  1.4243 -	    save_arg=$arg
  1.4244 -	    moreargs=
  1.4245 -	    for fil in `cat "$save_arg"`
  1.4246 -	    do
  1.4247 -#	      moreargs="$moreargs $fil"
  1.4248 -	      arg=$fil
  1.4249 -	      # A libtool-controlled object.
  1.4250 -
  1.4251 -	      # Check to see that this really is a libtool object.
  1.4252 -	      if func_lalib_unsafe_p "$arg"; then
  1.4253 -		pic_object=
  1.4254 -		non_pic_object=
  1.4255 -
  1.4256 -		# Read the .lo file
  1.4257 -		func_source "$arg"
  1.4258 -
  1.4259 -		if test -z "$pic_object" ||
  1.4260 -		   test -z "$non_pic_object" ||
  1.4261 -		   test "$pic_object" = none &&
  1.4262 -		   test "$non_pic_object" = none; then
  1.4263 -		  func_fatal_error "cannot find name of object for \`$arg'"
  1.4264 -		fi
  1.4265 -
  1.4266 -		# Extract subdirectory from the argument.
  1.4267 -		func_dirname "$arg" "/" ""
  1.4268 -		xdir="$func_dirname_result"
  1.4269 -
  1.4270 -		if test "$pic_object" != none; then
  1.4271 -		  # Prepend the subdirectory the object is found in.
  1.4272 -		  pic_object="$xdir$pic_object"
  1.4273 -
  1.4274 -		  if test "$prev" = dlfiles; then
  1.4275 -		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.4276 -		      dlfiles="$dlfiles $pic_object"
  1.4277 -		      prev=
  1.4278 -		      continue
  1.4279 -		    else
  1.4280 -		      # If libtool objects are unsupported, then we need to preload.
  1.4281 -		      prev=dlprefiles
  1.4282 -		    fi
  1.4283 -		  fi
  1.4284 -
  1.4285 -		  # CHECK ME:  I think I busted this.  -Ossama
  1.4286 -		  if test "$prev" = dlprefiles; then
  1.4287 -		    # Preload the old-style object.
  1.4288 -		    dlprefiles="$dlprefiles $pic_object"
  1.4289 -		    prev=
  1.4290 -		  fi
  1.4291 -
  1.4292 -		  # A PIC object.
  1.4293 -		  func_append libobjs " $pic_object"
  1.4294 -		  arg="$pic_object"
  1.4295 -		fi
  1.4296 -
  1.4297 -		# Non-PIC object.
  1.4298 -		if test "$non_pic_object" != none; then
  1.4299 -		  # Prepend the subdirectory the object is found in.
  1.4300 -		  non_pic_object="$xdir$non_pic_object"
  1.4301 -
  1.4302 -		  # A standard non-PIC object
  1.4303 -		  func_append non_pic_objects " $non_pic_object"
  1.4304 -		  if test -z "$pic_object" || test "$pic_object" = none ; then
  1.4305 -		    arg="$non_pic_object"
  1.4306 -		  fi
  1.4307 -		else
  1.4308 -		  # If the PIC object exists, use it instead.
  1.4309 -		  # $xdir was prepended to $pic_object above.
  1.4310 -		  non_pic_object="$pic_object"
  1.4311 -		  func_append non_pic_objects " $non_pic_object"
  1.4312 -		fi
  1.4313 -	      else
  1.4314 -		# Only an error if not doing a dry-run.
  1.4315 -		if $opt_dry_run; then
  1.4316 -		  # Extract subdirectory from the argument.
  1.4317 -		  func_dirname "$arg" "/" ""
  1.4318 -		  xdir="$func_dirname_result"
  1.4319 -
  1.4320 -		  func_lo2o "$arg"
  1.4321 -		  pic_object=$xdir$objdir/$func_lo2o_result
  1.4322 -		  non_pic_object=$xdir$func_lo2o_result
  1.4323 -		  func_append libobjs " $pic_object"
  1.4324 -		  func_append non_pic_objects " $non_pic_object"
  1.4325 -	        else
  1.4326 -		  func_fatal_error "\`$arg' is not a valid libtool object"
  1.4327 -		fi
  1.4328 -	      fi
  1.4329 -	    done
  1.4330 -	  else
  1.4331 -	    func_fatal_error "link input file \`$arg' does not exist"
  1.4332 -	  fi
  1.4333 -	  arg=$save_arg
  1.4334 -	  prev=
  1.4335 -	  continue
  1.4336 -	  ;;
  1.4337 -	precious_regex)
  1.4338 -	  precious_files_regex="$arg"
  1.4339 -	  prev=
  1.4340 -	  continue
  1.4341 -	  ;;
  1.4342 -	release)
  1.4343 -	  release="-$arg"
  1.4344 -	  prev=
  1.4345 -	  continue
  1.4346 -	  ;;
  1.4347 -	rpath | xrpath)
  1.4348 -	  # We need an absolute path.
  1.4349 -	  case $arg in
  1.4350 -	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4351 -	  *)
  1.4352 -	    func_fatal_error "only absolute run-paths are allowed"
  1.4353 -	    ;;
  1.4354 -	  esac
  1.4355 -	  if test "$prev" = rpath; then
  1.4356 -	    case "$rpath " in
  1.4357 -	    *" $arg "*) ;;
  1.4358 -	    *) rpath="$rpath $arg" ;;
  1.4359 -	    esac
  1.4360 -	  else
  1.4361 -	    case "$xrpath " in
  1.4362 -	    *" $arg "*) ;;
  1.4363 -	    *) xrpath="$xrpath $arg" ;;
  1.4364 -	    esac
  1.4365 -	  fi
  1.4366 -	  prev=
  1.4367 -	  continue
  1.4368 -	  ;;
  1.4369 -	shrext)
  1.4370 -	  shrext_cmds="$arg"
  1.4371 -	  prev=
  1.4372 -	  continue
  1.4373 -	  ;;
  1.4374 -	weak)
  1.4375 -	  weak_libs="$weak_libs $arg"
  1.4376 -	  prev=
  1.4377 -	  continue
  1.4378 -	  ;;
  1.4379 -	xcclinker)
  1.4380 -	  linker_flags="$linker_flags $qarg"
  1.4381 -	  compiler_flags="$compiler_flags $qarg"
  1.4382 -	  prev=
  1.4383 -	  func_append compile_command " $qarg"
  1.4384 -	  func_append finalize_command " $qarg"
  1.4385 -	  continue
  1.4386 -	  ;;
  1.4387 -	xcompiler)
  1.4388 -	  compiler_flags="$compiler_flags $qarg"
  1.4389 -	  prev=
  1.4390 -	  func_append compile_command " $qarg"
  1.4391 -	  func_append finalize_command " $qarg"
  1.4392 -	  continue
  1.4393 -	  ;;
  1.4394 -	xlinker)
  1.4395 -	  linker_flags="$linker_flags $qarg"
  1.4396 -	  compiler_flags="$compiler_flags $wl$qarg"
  1.4397 -	  prev=
  1.4398 -	  func_append compile_command " $wl$qarg"
  1.4399 -	  func_append finalize_command " $wl$qarg"
  1.4400 -	  continue
  1.4401 -	  ;;
  1.4402 -	*)
  1.4403 -	  eval "$prev=\"\$arg\""
  1.4404 -	  prev=
  1.4405 -	  continue
  1.4406 -	  ;;
  1.4407 -	esac
  1.4408 -      fi # test -n "$prev"
  1.4409 -
  1.4410 -      prevarg="$arg"
  1.4411 -
  1.4412 -      case $arg in
  1.4413 -      -all-static)
  1.4414 -	if test -n "$link_static_flag"; then
  1.4415 -	  # See comment for -static flag below, for more details.
  1.4416 -	  func_append compile_command " $link_static_flag"
  1.4417 -	  func_append finalize_command " $link_static_flag"
  1.4418 -	fi
  1.4419 -	continue
  1.4420 -	;;
  1.4421 -
  1.4422 -      -allow-undefined)
  1.4423 -	# FIXME: remove this flag sometime in the future.
  1.4424 -	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
  1.4425 -	;;
  1.4426 -
  1.4427 -      -avoid-version)
  1.4428 -	avoid_version=yes
  1.4429 -	continue
  1.4430 -	;;
  1.4431 -
  1.4432 -      -dlopen)
  1.4433 -	prev=dlfiles
  1.4434 -	continue
  1.4435 -	;;
  1.4436 -
  1.4437 -      -dlpreopen)
  1.4438 -	prev=dlprefiles
  1.4439 -	continue
  1.4440 -	;;
  1.4441 -
  1.4442 -      -export-dynamic)
  1.4443 -	export_dynamic=yes
  1.4444 -	continue
  1.4445 -	;;
  1.4446 -
  1.4447 -      -export-symbols | -export-symbols-regex)
  1.4448 -	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1.4449 -	  func_fatal_error "more than one -exported-symbols argument is not allowed"
  1.4450 -	fi
  1.4451 -	if test "X$arg" = "X-export-symbols"; then
  1.4452 -	  prev=expsyms
  1.4453 -	else
  1.4454 -	  prev=expsyms_regex
  1.4455 -	fi
  1.4456 -	continue
  1.4457 -	;;
  1.4458 -
  1.4459 -      -framework)
  1.4460 -	prev=framework
  1.4461 -	continue
  1.4462 -	;;
  1.4463 -
  1.4464 -      -inst-prefix-dir)
  1.4465 -	prev=inst_prefix
  1.4466 -	continue
  1.4467 -	;;
  1.4468 -
  1.4469 -      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1.4470 -      # so, if we see these flags be careful not to treat them like -L
  1.4471 -      -L[A-Z][A-Z]*:*)
  1.4472 -	case $with_gcc/$host in
  1.4473 -	no/*-*-irix* | /*-*-irix*)
  1.4474 -	  func_append compile_command " $arg"
  1.4475 -	  func_append finalize_command " $arg"
  1.4476 -	  ;;
  1.4477 -	esac
  1.4478 -	continue
  1.4479 -	;;
  1.4480 -
  1.4481 -      -L*)
  1.4482 -	func_stripname '-L' '' "$arg"
  1.4483 -	dir=$func_stripname_result
  1.4484 -	if test -z "$dir"; then
  1.4485 -	  if test "$#" -gt 0; then
  1.4486 -	    func_fatal_error "require no space between \`-L' and \`$1'"
  1.4487 -	  else
  1.4488 -	    func_fatal_error "need path for \`-L' option"
  1.4489 -	  fi
  1.4490 -	fi
  1.4491 -	# We need an absolute path.
  1.4492 -	case $dir in
  1.4493 -	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4494 -	*)
  1.4495 -	  absdir=`cd "$dir" && pwd`
  1.4496 -	  test -z "$absdir" && \
  1.4497 -	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
  1.4498 -	  dir="$absdir"
  1.4499 -	  ;;
  1.4500 -	esac
  1.4501 -	case "$deplibs " in
  1.4502 -	*" -L$dir "*) ;;
  1.4503 -	*)
  1.4504 -	  deplibs="$deplibs -L$dir"
  1.4505 -	  lib_search_path="$lib_search_path $dir"
  1.4506 -	  ;;
  1.4507 -	esac
  1.4508 -	case $host in
  1.4509 -	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.4510 -	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  1.4511 -	  case :$dllsearchpath: in
  1.4512 -	  *":$dir:"*) ;;
  1.4513 -	  ::) dllsearchpath=$dir;;
  1.4514 -	  *) dllsearchpath="$dllsearchpath:$dir";;
  1.4515 -	  esac
  1.4516 -	  case :$dllsearchpath: in
  1.4517 -	  *":$testbindir:"*) ;;
  1.4518 -	  ::) dllsearchpath=$testbindir;;
  1.4519 -	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.4520 -	  esac
  1.4521 -	  ;;
  1.4522 -	esac
  1.4523 -	continue
  1.4524 -	;;
  1.4525 -
  1.4526 -      -l*)
  1.4527 -	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1.4528 -	  case $host in
  1.4529 -	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
  1.4530 -	    # These systems don't actually have a C or math library (as such)
  1.4531 -	    continue
  1.4532 -	    ;;
  1.4533 -	  *-*-os2*)
  1.4534 -	    # These systems don't actually have a C library (as such)
  1.4535 -	    test "X$arg" = "X-lc" && continue
  1.4536 -	    ;;
  1.4537 -	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.4538 -	    # Do not include libc due to us having libc/libc_r.
  1.4539 -	    test "X$arg" = "X-lc" && continue
  1.4540 -	    ;;
  1.4541 -	  *-*-rhapsody* | *-*-darwin1.[012])
  1.4542 -	    # Rhapsody C and math libraries are in the System framework
  1.4543 -	    deplibs="$deplibs System.ltframework"
  1.4544 -	    continue
  1.4545 -	    ;;
  1.4546 -	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.4547 -	    # Causes problems with __ctype
  1.4548 -	    test "X$arg" = "X-lc" && continue
  1.4549 -	    ;;
  1.4550 -	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.4551 -	    # Compiler inserts libc in the correct place for threads to work
  1.4552 -	    test "X$arg" = "X-lc" && continue
  1.4553 -	    ;;
  1.4554 -	  esac
  1.4555 -	elif test "X$arg" = "X-lc_r"; then
  1.4556 -	 case $host in
  1.4557 -	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.4558 -	   # Do not include libc_r directly, use -pthread flag.
  1.4559 -	   continue
  1.4560 -	   ;;
  1.4561 -	 esac
  1.4562 -	fi
  1.4563 -	deplibs="$deplibs $arg"
  1.4564 -	continue
  1.4565 -	;;
  1.4566 -
  1.4567 -      -module)
  1.4568 -	module=yes
  1.4569 -	continue
  1.4570 -	;;
  1.4571 -
  1.4572 -      # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1.4573 -      # classes, name mangling, and exception handling.
  1.4574 -      # Darwin uses the -arch flag to determine output architecture.
  1.4575 -      -model|-arch|-isysroot)
  1.4576 -	compiler_flags="$compiler_flags $arg"
  1.4577 -	func_append compile_command " $arg"
  1.4578 -	func_append finalize_command " $arg"
  1.4579 -	prev=xcompiler
  1.4580 -	continue
  1.4581 -	;;
  1.4582 -
  1.4583 -      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  1.4584 -	compiler_flags="$compiler_flags $arg"
  1.4585 -	func_append compile_command " $arg"
  1.4586 -	func_append finalize_command " $arg"
  1.4587 -	case "$new_inherited_linker_flags " in
  1.4588 -	    *" $arg "*) ;;
  1.4589 -	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
  1.4590 -	esac
  1.4591 -	continue
  1.4592 -	;;
  1.4593 -
  1.4594 -      -multi_module)
  1.4595 -	single_module="${wl}-multi_module"
  1.4596 -	continue
  1.4597 -	;;
  1.4598 -
  1.4599 -      -no-fast-install)
  1.4600 -	fast_install=no
  1.4601 -	continue
  1.4602 -	;;
  1.4603 -
  1.4604 -      -no-install)
  1.4605 -	case $host in
  1.4606 -	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  1.4607 -	  # The PATH hackery in wrapper scripts is required on Windows
  1.4608 -	  # and Darwin in order for the loader to find any dlls it needs.
  1.4609 -	  func_warning "\`-no-install' is ignored for $host"
  1.4610 -	  func_warning "assuming \`-no-fast-install' instead"
  1.4611 -	  fast_install=no
  1.4612 -	  ;;
  1.4613 -	*) no_install=yes ;;
  1.4614 -	esac
  1.4615 -	continue
  1.4616 -	;;
  1.4617 -
  1.4618 -      -no-undefined)
  1.4619 -	allow_undefined=no
  1.4620 -	continue
  1.4621 -	;;
  1.4622 -
  1.4623 -      -objectlist)
  1.4624 -	prev=objectlist
  1.4625 -	continue
  1.4626 -	;;
  1.4627 -
  1.4628 -      -o) prev=output ;;
  1.4629 -
  1.4630 -      -precious-files-regex)
  1.4631 -	prev=precious_regex
  1.4632 -	continue
  1.4633 -	;;
  1.4634 -
  1.4635 -      -release)
  1.4636 -	prev=release
  1.4637 -	continue
  1.4638 -	;;
  1.4639 -
  1.4640 -      -rpath)
  1.4641 -	prev=rpath
  1.4642 -	continue
  1.4643 -	;;
  1.4644 -
  1.4645 -      -R)
  1.4646 -	prev=xrpath
  1.4647 -	continue
  1.4648 -	;;
  1.4649 -
  1.4650 -      -R*)
  1.4651 -	func_stripname '-R' '' "$arg"
  1.4652 -	dir=$func_stripname_result
  1.4653 -	# We need an absolute path.
  1.4654 -	case $dir in
  1.4655 -	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1.4656 -	*)
  1.4657 -	  func_fatal_error "only absolute run-paths are allowed"
  1.4658 -	  ;;
  1.4659 -	esac
  1.4660 -	case "$xrpath " in
  1.4661 -	*" $dir "*) ;;
  1.4662 -	*) xrpath="$xrpath $dir" ;;
  1.4663 -	esac
  1.4664 -	continue
  1.4665 -	;;
  1.4666 -
  1.4667 -      -shared)
  1.4668 -	# The effects of -shared are defined in a previous loop.
  1.4669 -	continue
  1.4670 -	;;
  1.4671 -
  1.4672 -      -shrext)
  1.4673 -	prev=shrext
  1.4674 -	continue
  1.4675 -	;;
  1.4676 -
  1.4677 -      -static | -static-libtool-libs)
  1.4678 -	# The effects of -static are defined in a previous loop.
  1.4679 -	# We used to do the same as -all-static on platforms that
  1.4680 -	# didn't have a PIC flag, but the assumption that the effects
  1.4681 -	# would be equivalent was wrong.  It would break on at least
  1.4682 -	# Digital Unix and AIX.
  1.4683 -	continue
  1.4684 -	;;
  1.4685 -
  1.4686 -      -thread-safe)
  1.4687 -	thread_safe=yes
  1.4688 -	continue
  1.4689 -	;;
  1.4690 -
  1.4691 -      -version-info)
  1.4692 -	prev=vinfo
  1.4693 -	continue
  1.4694 -	;;
  1.4695 -
  1.4696 -      -version-number)
  1.4697 -	prev=vinfo
  1.4698 -	vinfo_number=yes
  1.4699 -	continue
  1.4700 -	;;
  1.4701 -
  1.4702 -      -weak)
  1.4703 -        prev=weak
  1.4704 -	continue
  1.4705 -	;;
  1.4706 -
  1.4707 -      -Wc,*)
  1.4708 -	func_stripname '-Wc,' '' "$arg"
  1.4709 -	args=$func_stripname_result
  1.4710 -	arg=
  1.4711 -	save_ifs="$IFS"; IFS=','
  1.4712 -	for flag in $args; do
  1.4713 -	  IFS="$save_ifs"
  1.4714 -          func_quote_for_eval "$flag"
  1.4715 -	  arg="$arg $wl$func_quote_for_eval_result"
  1.4716 -	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
  1.4717 -	done
  1.4718 -	IFS="$save_ifs"
  1.4719 -	func_stripname ' ' '' "$arg"
  1.4720 -	arg=$func_stripname_result
  1.4721 -	;;
  1.4722 -
  1.4723 -      -Wl,*)
  1.4724 -	func_stripname '-Wl,' '' "$arg"
  1.4725 -	args=$func_stripname_result
  1.4726 -	arg=
  1.4727 -	save_ifs="$IFS"; IFS=','
  1.4728 -	for flag in $args; do
  1.4729 -	  IFS="$save_ifs"
  1.4730 -          func_quote_for_eval "$flag"
  1.4731 -	  arg="$arg $wl$func_quote_for_eval_result"
  1.4732 -	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
  1.4733 -	  linker_flags="$linker_flags $func_quote_for_eval_result"
  1.4734 -	done
  1.4735 -	IFS="$save_ifs"
  1.4736 -	func_stripname ' ' '' "$arg"
  1.4737 -	arg=$func_stripname_result
  1.4738 -	;;
  1.4739 -
  1.4740 -      -Xcompiler)
  1.4741 -	prev=xcompiler
  1.4742 -	continue
  1.4743 -	;;
  1.4744 -
  1.4745 -      -Xlinker)
  1.4746 -	prev=xlinker
  1.4747 -	continue
  1.4748 -	;;
  1.4749 -
  1.4750 -      -XCClinker)
  1.4751 -	prev=xcclinker
  1.4752 -	continue
  1.4753 -	;;
  1.4754 -
  1.4755 -      # -msg_* for osf cc
  1.4756 -      -msg_*)
  1.4757 -	func_quote_for_eval "$arg"
  1.4758 -	arg="$func_quote_for_eval_result"
  1.4759 -	;;
  1.4760 -
  1.4761 -      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1.4762 -      # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1.4763 -      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1.4764 -      # +DA*, +DD* enable 64-bit mode on the HP compiler
  1.4765 -      # -q* pass through compiler args for the IBM compiler
  1.4766 -      # -m*, -t[45]*, -txscale* pass through architecture-specific
  1.4767 -      # compiler args for GCC
  1.4768 -      # -F/path gives path to uninstalled frameworks, gcc on darwin
  1.4769 -      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  1.4770 -      # @file GCC response files
  1.4771 -      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  1.4772 -      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  1.4773 -        func_quote_for_eval "$arg"
  1.4774 -	arg="$func_quote_for_eval_result"
  1.4775 -        func_append compile_command " $arg"
  1.4776 -        func_append finalize_command " $arg"
  1.4777 -        compiler_flags="$compiler_flags $arg"
  1.4778 -        continue
  1.4779 -        ;;
  1.4780 -
  1.4781 -      # Some other compiler flag.
  1.4782 -      -* | +*)
  1.4783 -        func_quote_for_eval "$arg"
  1.4784 -	arg="$func_quote_for_eval_result"
  1.4785 -	;;
  1.4786 -
  1.4787 -      *.$objext)
  1.4788 -	# A standard object.
  1.4789 -	objs="$objs $arg"
  1.4790 -	;;
  1.4791 -
  1.4792 -      *.lo)
  1.4793 -	# A libtool-controlled object.
  1.4794 -
  1.4795 -	# Check to see that this really is a libtool object.
  1.4796 -	if func_lalib_unsafe_p "$arg"; then
  1.4797 -	  pic_object=
  1.4798 -	  non_pic_object=
  1.4799 -
  1.4800 -	  # Read the .lo file
  1.4801 -	  func_source "$arg"
  1.4802 -
  1.4803 -	  if test -z "$pic_object" ||
  1.4804 -	     test -z "$non_pic_object" ||
  1.4805 -	     test "$pic_object" = none &&
  1.4806 -	     test "$non_pic_object" = none; then
  1.4807 -	    func_fatal_error "cannot find name of object for \`$arg'"
  1.4808 -	  fi
  1.4809 -
  1.4810 -	  # Extract subdirectory from the argument.
  1.4811 -	  func_dirname "$arg" "/" ""
  1.4812 -	  xdir="$func_dirname_result"
  1.4813 -
  1.4814 -	  if test "$pic_object" != none; then
  1.4815 -	    # Prepend the subdirectory the object is found in.
  1.4816 -	    pic_object="$xdir$pic_object"
  1.4817 -
  1.4818 -	    if test "$prev" = dlfiles; then
  1.4819 -	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1.4820 -		dlfiles="$dlfiles $pic_object"
  1.4821 -		prev=
  1.4822 -		continue
  1.4823 -	      else
  1.4824 -		# If libtool objects are unsupported, then we need to preload.
  1.4825 -		prev=dlprefiles
  1.4826 -	      fi
  1.4827 -	    fi
  1.4828 -
  1.4829 -	    # CHECK ME:  I think I busted this.  -Ossama
  1.4830 -	    if test "$prev" = dlprefiles; then
  1.4831 -	      # Preload the old-style object.
  1.4832 -	      dlprefiles="$dlprefiles $pic_object"
  1.4833 -	      prev=
  1.4834 -	    fi
  1.4835 -
  1.4836 -	    # A PIC object.
  1.4837 -	    func_append libobjs " $pic_object"
  1.4838 -	    arg="$pic_object"
  1.4839 -	  fi
  1.4840 -
  1.4841 -	  # Non-PIC object.
  1.4842 -	  if test "$non_pic_object" != none; then
  1.4843 -	    # Prepend the subdirectory the object is found in.
  1.4844 -	    non_pic_object="$xdir$non_pic_object"
  1.4845 -
  1.4846 -	    # A standard non-PIC object
  1.4847 -	    func_append non_pic_objects " $non_pic_object"
  1.4848 -	    if test -z "$pic_object" || test "$pic_object" = none ; then
  1.4849 -	      arg="$non_pic_object"
  1.4850 -	    fi
  1.4851 -	  else
  1.4852 -	    # If the PIC object exists, use it instead.
  1.4853 -	    # $xdir was prepended to $pic_object above.
  1.4854 -	    non_pic_object="$pic_object"
  1.4855 -	    func_append non_pic_objects " $non_pic_object"
  1.4856 -	  fi
  1.4857 -	else
  1.4858 -	  # Only an error if not doing a dry-run.
  1.4859 -	  if $opt_dry_run; then
  1.4860 -	    # Extract subdirectory from the argument.
  1.4861 -	    func_dirname "$arg" "/" ""
  1.4862 -	    xdir="$func_dirname_result"
  1.4863 -
  1.4864 -	    func_lo2o "$arg"
  1.4865 -	    pic_object=$xdir$objdir/$func_lo2o_result
  1.4866 -	    non_pic_object=$xdir$func_lo2o_result
  1.4867 -	    func_append libobjs " $pic_object"
  1.4868 -	    func_append non_pic_objects " $non_pic_object"
  1.4869 -	  else
  1.4870 -	    func_fatal_error "\`$arg' is not a valid libtool object"
  1.4871 -	  fi
  1.4872 -	fi
  1.4873 -	;;
  1.4874 -
  1.4875 -      *.$libext)
  1.4876 -	# An archive.
  1.4877 -	deplibs="$deplibs $arg"
  1.4878 -	old_deplibs="$old_deplibs $arg"
  1.4879 -	continue
  1.4880 -	;;
  1.4881 -
  1.4882 -      *.la)
  1.4883 -	# A libtool-controlled library.
  1.4884 -
  1.4885 -	if test "$prev" = dlfiles; then
  1.4886 -	  # This library was specified with -dlopen.
  1.4887 -	  dlfiles="$dlfiles $arg"
  1.4888 -	  prev=
  1.4889 -	elif test "$prev" = dlprefiles; then
  1.4890 -	  # The library was specified with -dlpreopen.
  1.4891 -	  dlprefiles="$dlprefiles $arg"
  1.4892 -	  prev=
  1.4893 -	else
  1.4894 -	  deplibs="$deplibs $arg"
  1.4895 -	fi
  1.4896 -	continue
  1.4897 -	;;
  1.4898 -
  1.4899 -      # Some other compiler argument.
  1.4900 -      *)
  1.4901 -	# Unknown arguments in both finalize_command and compile_command need
  1.4902 -	# to be aesthetically quoted because they are evaled later.
  1.4903 -	func_quote_for_eval "$arg"
  1.4904 -	arg="$func_quote_for_eval_result"
  1.4905 -	;;
  1.4906 -      esac # arg
  1.4907 -
  1.4908 -      # Now actually substitute the argument into the commands.
  1.4909 -      if test -n "$arg"; then
  1.4910 -	func_append compile_command " $arg"
  1.4911 -	func_append finalize_command " $arg"
  1.4912 -      fi
  1.4913 -    done # argument parsing loop
  1.4914 -
  1.4915 -    test -n "$prev" && \
  1.4916 -      func_fatal_help "the \`$prevarg' option requires an argument"
  1.4917 -
  1.4918 -    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1.4919 -      eval arg=\"$export_dynamic_flag_spec\"
  1.4920 -      func_append compile_command " $arg"
  1.4921 -      func_append finalize_command " $arg"
  1.4922 -    fi
  1.4923 -
  1.4924 -    oldlibs=
  1.4925 -    # calculate the name of the file, without its directory
  1.4926 -    func_basename "$output"
  1.4927 -    outputname="$func_basename_result"
  1.4928 -    libobjs_save="$libobjs"
  1.4929 -
  1.4930 -    if test -n "$shlibpath_var"; then
  1.4931 -      # get the directories listed in $shlibpath_var
  1.4932 -      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1.4933 -    else
  1.4934 -      shlib_search_path=
  1.4935 -    fi
  1.4936 -    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1.4937 -    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1.4938 -
  1.4939 -    func_dirname "$output" "/" ""
  1.4940 -    output_objdir="$func_dirname_result$objdir"
  1.4941 -    # Create the object directory.
  1.4942 -    func_mkdir_p "$output_objdir"
  1.4943 -
  1.4944 -    # Determine the type of output
  1.4945 -    case $output in
  1.4946 -    "")
  1.4947 -      func_fatal_help "you must specify an output file"
  1.4948 -      ;;
  1.4949 -    *.$libext) linkmode=oldlib ;;
  1.4950 -    *.lo | *.$objext) linkmode=obj ;;
  1.4951 -    *.la) linkmode=lib ;;
  1.4952 -    *) linkmode=prog ;; # Anything else should be a program.
  1.4953 -    esac
  1.4954 -
  1.4955 -    specialdeplibs=
  1.4956 -
  1.4957 -    libs=
  1.4958 -    # Find all interdependent deplibs by searching for libraries
  1.4959 -    # that are linked more than once (e.g. -la -lb -la)
  1.4960 -    for deplib in $deplibs; do
  1.4961 -      if $opt_duplicate_deps ; then
  1.4962 -	case "$libs " in
  1.4963 -	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.4964 -	esac
  1.4965 -      fi
  1.4966 -      libs="$libs $deplib"
  1.4967 -    done
  1.4968 -
  1.4969 -    if test "$linkmode" = lib; then
  1.4970 -      libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1.4971 -
  1.4972 -      # Compute libraries that are listed more than once in $predeps
  1.4973 -      # $postdeps and mark them as special (i.e., whose duplicates are
  1.4974 -      # not to be eliminated).
  1.4975 -      pre_post_deps=
  1.4976 -      if $opt_duplicate_compiler_generated_deps; then
  1.4977 -	for pre_post_dep in $predeps $postdeps; do
  1.4978 -	  case "$pre_post_deps " in
  1.4979 -	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1.4980 -	  esac
  1.4981 -	  pre_post_deps="$pre_post_deps $pre_post_dep"
  1.4982 -	done
  1.4983 -      fi
  1.4984 -      pre_post_deps=
  1.4985 -    fi
  1.4986 -
  1.4987 -    deplibs=
  1.4988 -    newdependency_libs=
  1.4989 -    newlib_search_path=
  1.4990 -    need_relink=no # whether we're linking any uninstalled libtool libraries
  1.4991 -    notinst_deplibs= # not-installed libtool libraries
  1.4992 -    notinst_path= # paths that contain not-installed libtool libraries
  1.4993 -
  1.4994 -    case $linkmode in
  1.4995 -    lib)
  1.4996 -	passes="conv dlpreopen link"
  1.4997 -	for file in $dlfiles $dlprefiles; do
  1.4998 -	  case $file in
  1.4999 -	  *.la) ;;
  1.5000 -	  *)
  1.5001 -	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
  1.5002 -	    ;;
  1.5003 -	  esac
  1.5004 -	done
  1.5005 -	;;
  1.5006 -    prog)
  1.5007 -	compile_deplibs=
  1.5008 -	finalize_deplibs=
  1.5009 -	alldeplibs=no
  1.5010 -	newdlfiles=
  1.5011 -	newdlprefiles=
  1.5012 -	passes="conv scan dlopen dlpreopen link"
  1.5013 -	;;
  1.5014 -    *)  passes="conv"
  1.5015 -	;;
  1.5016 -    esac
  1.5017 -
  1.5018 -    for pass in $passes; do
  1.5019 -      # The preopen pass in lib mode reverses $deplibs; put it back here
  1.5020 -      # so that -L comes before libs that need it for instance...
  1.5021 -      if test "$linkmode,$pass" = "lib,link"; then
  1.5022 -	## FIXME: Find the place where the list is rebuilt in the wrong
  1.5023 -	##        order, and fix it there properly
  1.5024 -        tmp_deplibs=
  1.5025 -	for deplib in $deplibs; do
  1.5026 -	  tmp_deplibs="$deplib $tmp_deplibs"
  1.5027 -	done
  1.5028 -	deplibs="$tmp_deplibs"
  1.5029 -      fi
  1.5030 -
  1.5031 -      if test "$linkmode,$pass" = "lib,link" ||
  1.5032 -	 test "$linkmode,$pass" = "prog,scan"; then
  1.5033 -	libs="$deplibs"
  1.5034 -	deplibs=
  1.5035 -      fi
  1.5036 -      if test "$linkmode" = prog; then
  1.5037 -	case $pass in
  1.5038 -	dlopen) libs="$dlfiles" ;;
  1.5039 -	dlpreopen) libs="$dlprefiles" ;;
  1.5040 -	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1.5041 -	esac
  1.5042 -      fi
  1.5043 -      if test "$linkmode,$pass" = "lib,dlpreopen"; then
  1.5044 -	# Collect and forward deplibs of preopened libtool libs
  1.5045 -	for lib in $dlprefiles; do
  1.5046 -	  # Ignore non-libtool-libs
  1.5047 -	  dependency_libs=
  1.5048 -	  case $lib in
  1.5049 -	  *.la)	func_source "$lib" ;;
  1.5050 -	  esac
  1.5051 -
  1.5052 -	  # Collect preopened libtool deplibs, except any this library
  1.5053 -	  # has declared as weak libs
  1.5054 -	  for deplib in $dependency_libs; do
  1.5055 -            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
  1.5056 -	    case " $weak_libs " in
  1.5057 -	    *" $deplib_base "*) ;;
  1.5058 -	    *) deplibs="$deplibs $deplib" ;;
  1.5059 -	    esac
  1.5060 -	  done
  1.5061 -	done
  1.5062 -	libs="$dlprefiles"
  1.5063 -      fi
  1.5064 -      if test "$pass" = dlopen; then
  1.5065 -	# Collect dlpreopened libraries
  1.5066 -	save_deplibs="$deplibs"
  1.5067 -	deplibs=
  1.5068 -      fi
  1.5069 -
  1.5070 -      for deplib in $libs; do
  1.5071 -	lib=
  1.5072 -	found=no
  1.5073 -	case $deplib in
  1.5074 -	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  1.5075 -	  if test "$linkmode,$pass" = "prog,link"; then
  1.5076 -	    compile_deplibs="$deplib $compile_deplibs"
  1.5077 -	    finalize_deplibs="$deplib $finalize_deplibs"
  1.5078 -	  else
  1.5079 -	    compiler_flags="$compiler_flags $deplib"
  1.5080 -	    if test "$linkmode" = lib ; then
  1.5081 -		case "$new_inherited_linker_flags " in
  1.5082 -		    *" $deplib "*) ;;
  1.5083 -		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  1.5084 -		esac
  1.5085 -	    fi
  1.5086 -	  fi
  1.5087 -	  continue
  1.5088 -	  ;;
  1.5089 -	-l*)
  1.5090 -	  if test "$linkmode" != lib && test "$linkmode" != prog; then
  1.5091 -	    func_warning "\`-l' is ignored for archives/objects"
  1.5092 -	    continue
  1.5093 -	  fi
  1.5094 -	  func_stripname '-l' '' "$deplib"
  1.5095 -	  name=$func_stripname_result
  1.5096 -	  if test "$linkmode" = lib; then
  1.5097 -	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  1.5098 -	  else
  1.5099 -	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  1.5100 -	  fi
  1.5101 -	  for searchdir in $searchdirs; do
  1.5102 -	    for search_ext in .la $std_shrext .so .a; do
  1.5103 -	      # Search the libtool library
  1.5104 -	      lib="$searchdir/lib${name}${search_ext}"
  1.5105 -	      if test -f "$lib"; then
  1.5106 -		if test "$search_ext" = ".la"; then
  1.5107 -		  found=yes
  1.5108 -		else
  1.5109 -		  found=no
  1.5110 -		fi
  1.5111 -		break 2
  1.5112 -	      fi
  1.5113 -	    done
  1.5114 -	  done
  1.5115 -	  if test "$found" != yes; then
  1.5116 -	    # deplib doesn't seem to be a libtool library
  1.5117 -	    if test "$linkmode,$pass" = "prog,link"; then
  1.5118 -	      compile_deplibs="$deplib $compile_deplibs"
  1.5119 -	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5120 -	    else
  1.5121 -	      deplibs="$deplib $deplibs"
  1.5122 -	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.5123 -	    fi
  1.5124 -	    continue
  1.5125 -	  else # deplib is a libtool library
  1.5126 -	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1.5127 -	    # We need to do some special things here, and not later.
  1.5128 -	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.5129 -	      case " $predeps $postdeps " in
  1.5130 -	      *" $deplib "*)
  1.5131 -		if func_lalib_p "$lib"; then
  1.5132 -		  library_names=
  1.5133 -		  old_library=
  1.5134 -		  func_source "$lib"
  1.5135 -		  for l in $old_library $library_names; do
  1.5136 -		    ll="$l"
  1.5137 -		  done
  1.5138 -		  if test "X$ll" = "X$old_library" ; then # only static version available
  1.5139 -		    found=no
  1.5140 -		    func_dirname "$lib" "" "."
  1.5141 -		    ladir="$func_dirname_result"
  1.5142 -		    lib=$ladir/$old_library
  1.5143 -		    if test "$linkmode,$pass" = "prog,link"; then
  1.5144 -		      compile_deplibs="$deplib $compile_deplibs"
  1.5145 -		      finalize_deplibs="$deplib $finalize_deplibs"
  1.5146 -		    else
  1.5147 -		      deplibs="$deplib $deplibs"
  1.5148 -		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1.5149 -		    fi
  1.5150 -		    continue
  1.5151 -		  fi
  1.5152 -		fi
  1.5153 -		;;
  1.5154 -	      *) ;;
  1.5155 -	      esac
  1.5156 -	    fi
  1.5157 -	  fi
  1.5158 -	  ;; # -l
  1.5159 -	*.ltframework)
  1.5160 -	  if test "$linkmode,$pass" = "prog,link"; then
  1.5161 -	    compile_deplibs="$deplib $compile_deplibs"
  1.5162 -	    finalize_deplibs="$deplib $finalize_deplibs"
  1.5163 -	  else
  1.5164 -	    deplibs="$deplib $deplibs"
  1.5165 -	    if test "$linkmode" = lib ; then
  1.5166 -		case "$new_inherited_linker_flags " in
  1.5167 -		    *" $deplib "*) ;;
  1.5168 -		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  1.5169 -		esac
  1.5170 -	    fi
  1.5171 -	  fi
  1.5172 -	  continue
  1.5173 -	  ;;
  1.5174 -	-L*)
  1.5175 -	  case $linkmode in
  1.5176 -	  lib)
  1.5177 -	    deplibs="$deplib $deplibs"
  1.5178 -	    test "$pass" = conv && continue
  1.5179 -	    newdependency_libs="$deplib $newdependency_libs"
  1.5180 -	    func_stripname '-L' '' "$deplib"
  1.5181 -	    newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5182 -	    ;;
  1.5183 -	  prog)
  1.5184 -	    if test "$pass" = conv; then
  1.5185 -	      deplibs="$deplib $deplibs"
  1.5186 -	      continue
  1.5187 -	    fi
  1.5188 -	    if test "$pass" = scan; then
  1.5189 -	      deplibs="$deplib $deplibs"
  1.5190 -	    else
  1.5191 -	      compile_deplibs="$deplib $compile_deplibs"
  1.5192 -	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5193 -	    fi
  1.5194 -	    func_stripname '-L' '' "$deplib"
  1.5195 -	    newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5196 -	    ;;
  1.5197 -	  *)
  1.5198 -	    func_warning "\`-L' is ignored for archives/objects"
  1.5199 -	    ;;
  1.5200 -	  esac # linkmode
  1.5201 -	  continue
  1.5202 -	  ;; # -L
  1.5203 -	-R*)
  1.5204 -	  if test "$pass" = link; then
  1.5205 -	    func_stripname '-R' '' "$deplib"
  1.5206 -	    dir=$func_stripname_result
  1.5207 -	    # Make sure the xrpath contains only unique directories.
  1.5208 -	    case "$xrpath " in
  1.5209 -	    *" $dir "*) ;;
  1.5210 -	    *) xrpath="$xrpath $dir" ;;
  1.5211 -	    esac
  1.5212 -	  fi
  1.5213 -	  deplibs="$deplib $deplibs"
  1.5214 -	  continue
  1.5215 -	  ;;
  1.5216 -	*.la) lib="$deplib" ;;
  1.5217 -	*.$libext)
  1.5218 -	  if test "$pass" = conv; then
  1.5219 -	    deplibs="$deplib $deplibs"
  1.5220 -	    continue
  1.5221 -	  fi
  1.5222 -	  case $linkmode in
  1.5223 -	  lib)
  1.5224 -	    # Linking convenience modules into shared libraries is allowed,
  1.5225 -	    # but linking other static libraries is non-portable.
  1.5226 -	    case " $dlpreconveniencelibs " in
  1.5227 -	    *" $deplib "*) ;;
  1.5228 -	    *)
  1.5229 -	      valid_a_lib=no
  1.5230 -	      case $deplibs_check_method in
  1.5231 -		match_pattern*)
  1.5232 -		  set dummy $deplibs_check_method; shift
  1.5233 -		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.5234 -		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
  1.5235 -		    | $EGREP "$match_pattern_regex" > /dev/null; then
  1.5236 -		    valid_a_lib=yes
  1.5237 -		  fi
  1.5238 -		;;
  1.5239 -		pass_all)
  1.5240 -		  valid_a_lib=yes
  1.5241 -		;;
  1.5242 -	      esac
  1.5243 -	      if test "$valid_a_lib" != yes; then
  1.5244 -		$ECHO
  1.5245 -		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
  1.5246 -		$ECHO "*** I have the capability to make that library automatically link in when"
  1.5247 -		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.5248 -		$ECHO "*** shared version of the library, which you do not appear to have"
  1.5249 -		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
  1.5250 -		$ECHO "*** that it is just a static archive that I should not use here."
  1.5251 -	      else
  1.5252 -		$ECHO
  1.5253 -		$ECHO "*** Warning: Linking the shared library $output against the"
  1.5254 -		$ECHO "*** static library $deplib is not portable!"
  1.5255 -		deplibs="$deplib $deplibs"
  1.5256 -	      fi
  1.5257 -	      ;;
  1.5258 -	    esac
  1.5259 -	    continue
  1.5260 -	    ;;
  1.5261 -	  prog)
  1.5262 -	    if test "$pass" != link; then
  1.5263 -	      deplibs="$deplib $deplibs"
  1.5264 -	    else
  1.5265 -	      compile_deplibs="$deplib $compile_deplibs"
  1.5266 -	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5267 -	    fi
  1.5268 -	    continue
  1.5269 -	    ;;
  1.5270 -	  esac # linkmode
  1.5271 -	  ;; # *.$libext
  1.5272 -	*.lo | *.$objext)
  1.5273 -	  if test "$pass" = conv; then
  1.5274 -	    deplibs="$deplib $deplibs"
  1.5275 -	  elif test "$linkmode" = prog; then
  1.5276 -	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  1.5277 -	      # If there is no dlopen support or we're linking statically,
  1.5278 -	      # we need to preload.
  1.5279 -	      newdlprefiles="$newdlprefiles $deplib"
  1.5280 -	      compile_deplibs="$deplib $compile_deplibs"
  1.5281 -	      finalize_deplibs="$deplib $finalize_deplibs"
  1.5282 -	    else
  1.5283 -	      newdlfiles="$newdlfiles $deplib"
  1.5284 -	    fi
  1.5285 -	  fi
  1.5286 -	  continue
  1.5287 -	  ;;
  1.5288 -	%DEPLIBS%)
  1.5289 -	  alldeplibs=yes
  1.5290 -	  continue
  1.5291 -	  ;;
  1.5292 -	esac # case $deplib
  1.5293 -
  1.5294 -	if test "$found" = yes || test -f "$lib"; then :
  1.5295 -	else
  1.5296 -	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
  1.5297 -	fi
  1.5298 -
  1.5299 -	# Check to see that this really is a libtool archive.
  1.5300 -	func_lalib_unsafe_p "$lib" \
  1.5301 -	  || func_fatal_error "\`$lib' is not a valid libtool archive"
  1.5302 -
  1.5303 -	func_dirname "$lib" "" "."
  1.5304 -	ladir="$func_dirname_result"
  1.5305 -
  1.5306 -	dlname=
  1.5307 -	dlopen=
  1.5308 -	dlpreopen=
  1.5309 -	libdir=
  1.5310 -	library_names=
  1.5311 -	old_library=
  1.5312 -	inherited_linker_flags=
  1.5313 -	# If the library was installed with an old release of libtool,
  1.5314 -	# it will not redefine variables installed, or shouldnotlink
  1.5315 -	installed=yes
  1.5316 -	shouldnotlink=no
  1.5317 -	avoidtemprpath=
  1.5318 -
  1.5319 -
  1.5320 -	# Read the .la file
  1.5321 -	func_source "$lib"
  1.5322 -
  1.5323 -	# Convert "-framework foo" to "foo.ltframework"
  1.5324 -	if test -n "$inherited_linker_flags"; then
  1.5325 -	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
  1.5326 -	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  1.5327 -	    case " $new_inherited_linker_flags " in
  1.5328 -	      *" $tmp_inherited_linker_flag "*) ;;
  1.5329 -	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
  1.5330 -	    esac
  1.5331 -	  done
  1.5332 -	fi
  1.5333 -	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.5334 -	if test "$linkmode,$pass" = "lib,link" ||
  1.5335 -	   test "$linkmode,$pass" = "prog,scan" ||
  1.5336 -	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  1.5337 -	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  1.5338 -	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  1.5339 -	fi
  1.5340 -
  1.5341 -	if test "$pass" = conv; then
  1.5342 -	  # Only check for convenience libraries
  1.5343 -	  deplibs="$lib $deplibs"
  1.5344 -	  if test -z "$libdir"; then
  1.5345 -	    if test -z "$old_library"; then
  1.5346 -	      func_fatal_error "cannot find name of link library for \`$lib'"
  1.5347 -	    fi
  1.5348 -	    # It is a libtool convenience library, so add in its objects.
  1.5349 -	    convenience="$convenience $ladir/$objdir/$old_library"
  1.5350 -	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
  1.5351 -	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  1.5352 -	    func_fatal_error "\`$lib' is not a convenience library"
  1.5353 -	  fi
  1.5354 -	  tmp_libs=
  1.5355 -	  for deplib in $dependency_libs; do
  1.5356 -	    deplibs="$deplib $deplibs"
  1.5357 -	    if $opt_duplicate_deps ; then
  1.5358 -	      case "$tmp_libs " in
  1.5359 -	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5360 -	      esac
  1.5361 -	    fi
  1.5362 -	    tmp_libs="$tmp_libs $deplib"
  1.5363 -	  done
  1.5364 -	  continue
  1.5365 -	fi # $pass = conv
  1.5366 -
  1.5367 -
  1.5368 -	# Get the name of the library we link against.
  1.5369 -	linklib=
  1.5370 -	for l in $old_library $library_names; do
  1.5371 -	  linklib="$l"
  1.5372 -	done
  1.5373 -	if test -z "$linklib"; then
  1.5374 -	  func_fatal_error "cannot find name of link library for \`$lib'"
  1.5375 -	fi
  1.5376 -
  1.5377 -	# This library was specified with -dlopen.
  1.5378 -	if test "$pass" = dlopen; then
  1.5379 -	  if test -z "$libdir"; then
  1.5380 -	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
  1.5381 -	  fi
  1.5382 -	  if test -z "$dlname" ||
  1.5383 -	     test "$dlopen_support" != yes ||
  1.5384 -	     test "$build_libtool_libs" = no; then
  1.5385 -	    # If there is no dlname, no dlopen support or we're linking
  1.5386 -	    # statically, we need to preload.  We also need to preload any
  1.5387 -	    # dependent libraries so libltdl's deplib preloader doesn't
  1.5388 -	    # bomb out in the load deplibs phase.
  1.5389 -	    dlprefiles="$dlprefiles $lib $dependency_libs"
  1.5390 -	  else
  1.5391 -	    newdlfiles="$newdlfiles $lib"
  1.5392 -	  fi
  1.5393 -	  continue
  1.5394 -	fi # $pass = dlopen
  1.5395 -
  1.5396 -	# We need an absolute path.
  1.5397 -	case $ladir in
  1.5398 -	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  1.5399 -	*)
  1.5400 -	  abs_ladir=`cd "$ladir" && pwd`
  1.5401 -	  if test -z "$abs_ladir"; then
  1.5402 -	    func_warning "cannot determine absolute directory name of \`$ladir'"
  1.5403 -	    func_warning "passing it literally to the linker, although it might fail"
  1.5404 -	    abs_ladir="$ladir"
  1.5405 -	  fi
  1.5406 -	  ;;
  1.5407 -	esac
  1.5408 -	func_basename "$lib"
  1.5409 -	laname="$func_basename_result"
  1.5410 -
  1.5411 -	# Find the relevant object directory and library name.
  1.5412 -	if test "X$installed" = Xyes; then
  1.5413 -	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.5414 -	    func_warning "library \`$lib' was moved."
  1.5415 -	    dir="$ladir"
  1.5416 -	    absdir="$abs_ladir"
  1.5417 -	    libdir="$abs_ladir"
  1.5418 -	  else
  1.5419 -	    dir="$libdir"
  1.5420 -	    absdir="$libdir"
  1.5421 -	  fi
  1.5422 -	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  1.5423 -	else
  1.5424 -	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  1.5425 -	    dir="$ladir"
  1.5426 -	    absdir="$abs_ladir"
  1.5427 -	    # Remove this search path later
  1.5428 -	    notinst_path="$notinst_path $abs_ladir"
  1.5429 -	  else
  1.5430 -	    dir="$ladir/$objdir"
  1.5431 -	    absdir="$abs_ladir/$objdir"
  1.5432 -	    # Remove this search path later
  1.5433 -	    notinst_path="$notinst_path $abs_ladir"
  1.5434 -	  fi
  1.5435 -	fi # $installed = yes
  1.5436 -	func_stripname 'lib' '.la' "$laname"
  1.5437 -	name=$func_stripname_result
  1.5438 -
  1.5439 -	# This library was specified with -dlpreopen.
  1.5440 -	if test "$pass" = dlpreopen; then
  1.5441 -	  if test -z "$libdir" && test "$linkmode" = prog; then
  1.5442 -	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
  1.5443 -	  fi
  1.5444 -	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  1.5445 -	  # are required to link).
  1.5446 -	  if test -n "$old_library"; then
  1.5447 -	    newdlprefiles="$newdlprefiles $dir/$old_library"
  1.5448 -	    # Keep a list of preopened convenience libraries to check
  1.5449 -	    # that they are being used correctly in the link pass.
  1.5450 -	    test -z "$libdir" && \
  1.5451 -		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
  1.5452 -	  # Otherwise, use the dlname, so that lt_dlopen finds it.
  1.5453 -	  elif test -n "$dlname"; then
  1.5454 -	    newdlprefiles="$newdlprefiles $dir/$dlname"
  1.5455 -	  else
  1.5456 -	    newdlprefiles="$newdlprefiles $dir/$linklib"
  1.5457 -	  fi
  1.5458 -	fi # $pass = dlpreopen
  1.5459 -
  1.5460 -	if test -z "$libdir"; then
  1.5461 -	  # Link the convenience library
  1.5462 -	  if test "$linkmode" = lib; then
  1.5463 -	    deplibs="$dir/$old_library $deplibs"
  1.5464 -	  elif test "$linkmode,$pass" = "prog,link"; then
  1.5465 -	    compile_deplibs="$dir/$old_library $compile_deplibs"
  1.5466 -	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
  1.5467 -	  else
  1.5468 -	    deplibs="$lib $deplibs" # used for prog,scan pass
  1.5469 -	  fi
  1.5470 -	  continue
  1.5471 -	fi
  1.5472 -
  1.5473 -
  1.5474 -	if test "$linkmode" = prog && test "$pass" != link; then
  1.5475 -	  newlib_search_path="$newlib_search_path $ladir"
  1.5476 -	  deplibs="$lib $deplibs"
  1.5477 -
  1.5478 -	  linkalldeplibs=no
  1.5479 -	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
  1.5480 -	     test "$build_libtool_libs" = no; then
  1.5481 -	    linkalldeplibs=yes
  1.5482 -	  fi
  1.5483 -
  1.5484 -	  tmp_libs=
  1.5485 -	  for deplib in $dependency_libs; do
  1.5486 -	    case $deplib in
  1.5487 -	    -L*) func_stripname '-L' '' "$deplib"
  1.5488 -	         newlib_search_path="$newlib_search_path $func_stripname_result"
  1.5489 -		 ;;
  1.5490 -	    esac
  1.5491 -	    # Need to link against all dependency_libs?
  1.5492 -	    if test "$linkalldeplibs" = yes; then
  1.5493 -	      deplibs="$deplib $deplibs"
  1.5494 -	    else
  1.5495 -	      # Need to hardcode shared library paths
  1.5496 -	      # or/and link against static libraries
  1.5497 -	      newdependency_libs="$deplib $newdependency_libs"
  1.5498 -	    fi
  1.5499 -	    if $opt_duplicate_deps ; then
  1.5500 -	      case "$tmp_libs " in
  1.5501 -	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5502 -	      esac
  1.5503 -	    fi
  1.5504 -	    tmp_libs="$tmp_libs $deplib"
  1.5505 -	  done # for deplib
  1.5506 -	  continue
  1.5507 -	fi # $linkmode = prog...
  1.5508 -
  1.5509 -	if test "$linkmode,$pass" = "prog,link"; then
  1.5510 -	  if test -n "$library_names" &&
  1.5511 -	     { { test "$prefer_static_libs" = no ||
  1.5512 -	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
  1.5513 -	       test -z "$old_library"; }; then
  1.5514 -	    # We need to hardcode the library path
  1.5515 -	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  1.5516 -	      # Make sure the rpath contains only unique directories.
  1.5517 -	      case "$temp_rpath:" in
  1.5518 -	      *"$absdir:"*) ;;
  1.5519 -	      *) temp_rpath="$temp_rpath$absdir:" ;;
  1.5520 -	      esac
  1.5521 -	    fi
  1.5522 -
  1.5523 -	    # Hardcode the library path.
  1.5524 -	    # Skip directories that are in the system default run-time
  1.5525 -	    # search path.
  1.5526 -	    case " $sys_lib_dlsearch_path " in
  1.5527 -	    *" $absdir "*) ;;
  1.5528 -	    *)
  1.5529 -	      case "$compile_rpath " in
  1.5530 -	      *" $absdir "*) ;;
  1.5531 -	      *) compile_rpath="$compile_rpath $absdir"
  1.5532 -	      esac
  1.5533 -	      ;;
  1.5534 -	    esac
  1.5535 -	    case " $sys_lib_dlsearch_path " in
  1.5536 -	    *" $libdir "*) ;;
  1.5537 -	    *)
  1.5538 -	      case "$finalize_rpath " in
  1.5539 -	      *" $libdir "*) ;;
  1.5540 -	      *) finalize_rpath="$finalize_rpath $libdir"
  1.5541 -	      esac
  1.5542 -	      ;;
  1.5543 -	    esac
  1.5544 -	  fi # $linkmode,$pass = prog,link...
  1.5545 -
  1.5546 -	  if test "$alldeplibs" = yes &&
  1.5547 -	     { test "$deplibs_check_method" = pass_all ||
  1.5548 -	       { test "$build_libtool_libs" = yes &&
  1.5549 -		 test -n "$library_names"; }; }; then
  1.5550 -	    # We only need to search for static libraries
  1.5551 -	    continue
  1.5552 -	  fi
  1.5553 -	fi
  1.5554 -
  1.5555 -	link_static=no # Whether the deplib will be linked statically
  1.5556 -	use_static_libs=$prefer_static_libs
  1.5557 -	if test "$use_static_libs" = built && test "$installed" = yes; then
  1.5558 -	  use_static_libs=no
  1.5559 -	fi
  1.5560 -	if test -n "$library_names" &&
  1.5561 -	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
  1.5562 -	  case $host in
  1.5563 -	  *cygwin* | *mingw* | *cegcc*)
  1.5564 -	      # No point in relinking DLLs because paths are not encoded
  1.5565 -	      notinst_deplibs="$notinst_deplibs $lib"
  1.5566 -	      need_relink=no
  1.5567 -	    ;;
  1.5568 -	  *)
  1.5569 -	    if test "$installed" = no; then
  1.5570 -	      notinst_deplibs="$notinst_deplibs $lib"
  1.5571 -	      need_relink=yes
  1.5572 -	    fi
  1.5573 -	    ;;
  1.5574 -	  esac
  1.5575 -	  # This is a shared library
  1.5576 -
  1.5577 -	  # Warn about portability, can't link against -module's on some
  1.5578 -	  # systems (darwin).  Don't bleat about dlopened modules though!
  1.5579 -	  dlopenmodule=""
  1.5580 -	  for dlpremoduletest in $dlprefiles; do
  1.5581 -	    if test "X$dlpremoduletest" = "X$lib"; then
  1.5582 -	      dlopenmodule="$dlpremoduletest"
  1.5583 -	      break
  1.5584 -	    fi
  1.5585 -	  done
  1.5586 -	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  1.5587 -	    $ECHO
  1.5588 -	    if test "$linkmode" = prog; then
  1.5589 -	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
  1.5590 -	    else
  1.5591 -	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  1.5592 -	    fi
  1.5593 -	    $ECHO "*** $linklib is not portable!"
  1.5594 -	  fi
  1.5595 -	  if test "$linkmode" = lib &&
  1.5596 -	     test "$hardcode_into_libs" = yes; then
  1.5597 -	    # Hardcode the library path.
  1.5598 -	    # Skip directories that are in the system default run-time
  1.5599 -	    # search path.
  1.5600 -	    case " $sys_lib_dlsearch_path " in
  1.5601 -	    *" $absdir "*) ;;
  1.5602 -	    *)
  1.5603 -	      case "$compile_rpath " in
  1.5604 -	      *" $absdir "*) ;;
  1.5605 -	      *) compile_rpath="$compile_rpath $absdir"
  1.5606 -	      esac
  1.5607 -	      ;;
  1.5608 -	    esac
  1.5609 -	    case " $sys_lib_dlsearch_path " in
  1.5610 -	    *" $libdir "*) ;;
  1.5611 -	    *)
  1.5612 -	      case "$finalize_rpath " in
  1.5613 -	      *" $libdir "*) ;;
  1.5614 -	      *) finalize_rpath="$finalize_rpath $libdir"
  1.5615 -	      esac
  1.5616 -	      ;;
  1.5617 -	    esac
  1.5618 -	  fi
  1.5619 -
  1.5620 -	  if test -n "$old_archive_from_expsyms_cmds"; then
  1.5621 -	    # figure out the soname
  1.5622 -	    set dummy $library_names
  1.5623 -	    shift
  1.5624 -	    realname="$1"
  1.5625 -	    shift
  1.5626 -	    libname=`eval "\\$ECHO \"$libname_spec\""`
  1.5627 -	    # use dlname if we got it. it's perfectly good, no?
  1.5628 -	    if test -n "$dlname"; then
  1.5629 -	      soname="$dlname"
  1.5630 -	    elif test -n "$soname_spec"; then
  1.5631 -	      # bleh windows
  1.5632 -	      case $host in
  1.5633 -	      *cygwin* | mingw* | *cegcc*)
  1.5634 -	        func_arith $current - $age
  1.5635 -		major=$func_arith_result
  1.5636 -		versuffix="-$major"
  1.5637 -		;;
  1.5638 -	      esac
  1.5639 -	      eval soname=\"$soname_spec\"
  1.5640 -	    else
  1.5641 -	      soname="$realname"
  1.5642 -	    fi
  1.5643 -
  1.5644 -	    # Make a new name for the extract_expsyms_cmds to use
  1.5645 -	    soroot="$soname"
  1.5646 -	    func_basename "$soroot"
  1.5647 -	    soname="$func_basename_result"
  1.5648 -	    func_stripname 'lib' '.dll' "$soname"
  1.5649 -	    newlib=libimp-$func_stripname_result.a
  1.5650 -
  1.5651 -	    # If the library has no export list, then create one now
  1.5652 -	    if test -f "$output_objdir/$soname-def"; then :
  1.5653 -	    else
  1.5654 -	      func_verbose "extracting exported symbol list from \`$soname'"
  1.5655 -	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  1.5656 -	    fi
  1.5657 -
  1.5658 -	    # Create $newlib
  1.5659 -	    if test -f "$output_objdir/$newlib"; then :; else
  1.5660 -	      func_verbose "generating import library for \`$soname'"
  1.5661 -	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  1.5662 -	    fi
  1.5663 -	    # make sure the library variables are pointing to the new library
  1.5664 -	    dir=$output_objdir
  1.5665 -	    linklib=$newlib
  1.5666 -	  fi # test -n "$old_archive_from_expsyms_cmds"
  1.5667 -
  1.5668 -	  if test "$linkmode" = prog || test "$mode" != relink; then
  1.5669 -	    add_shlibpath=
  1.5670 -	    add_dir=
  1.5671 -	    add=
  1.5672 -	    lib_linked=yes
  1.5673 -	    case $hardcode_action in
  1.5674 -	    immediate | unsupported)
  1.5675 -	      if test "$hardcode_direct" = no; then
  1.5676 -		add="$dir/$linklib"
  1.5677 -		case $host in
  1.5678 -		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  1.5679 -		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  1.5680 -		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  1.5681 -		    *-*-unixware7*) add_dir="-L$dir" ;;
  1.5682 -		  *-*-darwin* )
  1.5683 -		    # if the lib is a (non-dlopened) module then we can not
  1.5684 -		    # link against it, someone is ignoring the earlier warnings
  1.5685 -		    if /usr/bin/file -L $add 2> /dev/null |
  1.5686 -			 $GREP ": [^:]* bundle" >/dev/null ; then
  1.5687 -		      if test "X$dlopenmodule" != "X$lib"; then
  1.5688 -			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
  1.5689 -			if test -z "$old_library" ; then
  1.5690 -			  $ECHO
  1.5691 -			  $ECHO "*** And there doesn't seem to be a static archive available"
  1.5692 -			  $ECHO "*** The link will probably fail, sorry"
  1.5693 -			else
  1.5694 -			  add="$dir/$old_library"
  1.5695 -			fi
  1.5696 -		      elif test -n "$old_library"; then
  1.5697 -			add="$dir/$old_library"
  1.5698 -		      fi
  1.5699 -		    fi
  1.5700 -		esac
  1.5701 -	      elif test "$hardcode_minus_L" = no; then
  1.5702 -		case $host in
  1.5703 -		*-*-sunos*) add_shlibpath="$dir" ;;
  1.5704 -		esac
  1.5705 -		add_dir="-L$dir"
  1.5706 -		add="-l$name"
  1.5707 -	      elif test "$hardcode_shlibpath_var" = no; then
  1.5708 -		add_shlibpath="$dir"
  1.5709 -		add="-l$name"
  1.5710 -	      else
  1.5711 -		lib_linked=no
  1.5712 -	      fi
  1.5713 -	      ;;
  1.5714 -	    relink)
  1.5715 -	      if test "$hardcode_direct" = yes &&
  1.5716 -	         test "$hardcode_direct_absolute" = no; then
  1.5717 -		add="$dir/$linklib"
  1.5718 -	      elif test "$hardcode_minus_L" = yes; then
  1.5719 -		add_dir="-L$dir"
  1.5720 -		# Try looking first in the location we're being installed to.
  1.5721 -		if test -n "$inst_prefix_dir"; then
  1.5722 -		  case $libdir in
  1.5723 -		    [\\/]*)
  1.5724 -		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.5725 -		      ;;
  1.5726 -		  esac
  1.5727 -		fi
  1.5728 -		add="-l$name"
  1.5729 -	      elif test "$hardcode_shlibpath_var" = yes; then
  1.5730 -		add_shlibpath="$dir"
  1.5731 -		add="-l$name"
  1.5732 -	      else
  1.5733 -		lib_linked=no
  1.5734 -	      fi
  1.5735 -	      ;;
  1.5736 -	    *) lib_linked=no ;;
  1.5737 -	    esac
  1.5738 -
  1.5739 -	    if test "$lib_linked" != yes; then
  1.5740 -	      func_fatal_configuration "unsupported hardcode properties"
  1.5741 -	    fi
  1.5742 -
  1.5743 -	    if test -n "$add_shlibpath"; then
  1.5744 -	      case :$compile_shlibpath: in
  1.5745 -	      *":$add_shlibpath:"*) ;;
  1.5746 -	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  1.5747 -	      esac
  1.5748 -	    fi
  1.5749 -	    if test "$linkmode" = prog; then
  1.5750 -	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  1.5751 -	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
  1.5752 -	    else
  1.5753 -	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.5754 -	      test -n "$add" && deplibs="$add $deplibs"
  1.5755 -	      if test "$hardcode_direct" != yes &&
  1.5756 -		 test "$hardcode_minus_L" != yes &&
  1.5757 -		 test "$hardcode_shlibpath_var" = yes; then
  1.5758 -		case :$finalize_shlibpath: in
  1.5759 -		*":$libdir:"*) ;;
  1.5760 -		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.5761 -		esac
  1.5762 -	      fi
  1.5763 -	    fi
  1.5764 -	  fi
  1.5765 -
  1.5766 -	  if test "$linkmode" = prog || test "$mode" = relink; then
  1.5767 -	    add_shlibpath=
  1.5768 -	    add_dir=
  1.5769 -	    add=
  1.5770 -	    # Finalize command for both is simple: just hardcode it.
  1.5771 -	    if test "$hardcode_direct" = yes &&
  1.5772 -	       test "$hardcode_direct_absolute" = no; then
  1.5773 -	      add="$libdir/$linklib"
  1.5774 -	    elif test "$hardcode_minus_L" = yes; then
  1.5775 -	      add_dir="-L$libdir"
  1.5776 -	      add="-l$name"
  1.5777 -	    elif test "$hardcode_shlibpath_var" = yes; then
  1.5778 -	      case :$finalize_shlibpath: in
  1.5779 -	      *":$libdir:"*) ;;
  1.5780 -	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  1.5781 -	      esac
  1.5782 -	      add="-l$name"
  1.5783 -	    elif test "$hardcode_automatic" = yes; then
  1.5784 -	      if test -n "$inst_prefix_dir" &&
  1.5785 -		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
  1.5786 -		add="$inst_prefix_dir$libdir/$linklib"
  1.5787 -	      else
  1.5788 -		add="$libdir/$linklib"
  1.5789 -	      fi
  1.5790 -	    else
  1.5791 -	      # We cannot seem to hardcode it, guess we'll fake it.
  1.5792 -	      add_dir="-L$libdir"
  1.5793 -	      # Try looking first in the location we're being installed to.
  1.5794 -	      if test -n "$inst_prefix_dir"; then
  1.5795 -		case $libdir in
  1.5796 -		  [\\/]*)
  1.5797 -		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
  1.5798 -		    ;;
  1.5799 -		esac
  1.5800 -	      fi
  1.5801 -	      add="-l$name"
  1.5802 -	    fi
  1.5803 -
  1.5804 -	    if test "$linkmode" = prog; then
  1.5805 -	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  1.5806 -	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  1.5807 -	    else
  1.5808 -	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  1.5809 -	      test -n "$add" && deplibs="$add $deplibs"
  1.5810 -	    fi
  1.5811 -	  fi
  1.5812 -	elif test "$linkmode" = prog; then
  1.5813 -	  # Here we assume that one of hardcode_direct or hardcode_minus_L
  1.5814 -	  # is not unsupported.  This is valid on all known static and
  1.5815 -	  # shared platforms.
  1.5816 -	  if test "$hardcode_direct" != unsupported; then
  1.5817 -	    test -n "$old_library" && linklib="$old_library"
  1.5818 -	    compile_deplibs="$dir/$linklib $compile_deplibs"
  1.5819 -	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
  1.5820 -	  else
  1.5821 -	    compile_deplibs="-l$name -L$dir $compile_deplibs"
  1.5822 -	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  1.5823 -	  fi
  1.5824 -	elif test "$build_libtool_libs" = yes; then
  1.5825 -	  # Not a shared library
  1.5826 -	  if test "$deplibs_check_method" != pass_all; then
  1.5827 -	    # We're trying link a shared library against a static one
  1.5828 -	    # but the system doesn't support it.
  1.5829 -
  1.5830 -	    # Just print a warning and add the library to dependency_libs so
  1.5831 -	    # that the program can be linked against the static library.
  1.5832 -	    $ECHO
  1.5833 -	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
  1.5834 -	    $ECHO "*** I have the capability to make that library automatically link in when"
  1.5835 -	    $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.5836 -	    $ECHO "*** shared version of the library, which you do not appear to have."
  1.5837 -	    if test "$module" = yes; then
  1.5838 -	      $ECHO "*** But as you try to build a module library, libtool will still create "
  1.5839 -	      $ECHO "*** a static module, that should work as long as the dlopening application"
  1.5840 -	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
  1.5841 -	      if test -z "$global_symbol_pipe"; then
  1.5842 -		$ECHO
  1.5843 -		$ECHO "*** However, this would only work if libtool was able to extract symbol"
  1.5844 -		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.5845 -		$ECHO "*** not find such a program.  So, this module is probably useless."
  1.5846 -		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  1.5847 -	      fi
  1.5848 -	      if test "$build_old_libs" = no; then
  1.5849 -		build_libtool_libs=module
  1.5850 -		build_old_libs=yes
  1.5851 -	      else
  1.5852 -		build_libtool_libs=no
  1.5853 -	      fi
  1.5854 -	    fi
  1.5855 -	  else
  1.5856 -	    deplibs="$dir/$old_library $deplibs"
  1.5857 -	    link_static=yes
  1.5858 -	  fi
  1.5859 -	fi # link shared/static library?
  1.5860 -
  1.5861 -	if test "$linkmode" = lib; then
  1.5862 -	  if test -n "$dependency_libs" &&
  1.5863 -	     { test "$hardcode_into_libs" != yes ||
  1.5864 -	       test "$build_old_libs" = yes ||
  1.5865 -	       test "$link_static" = yes; }; then
  1.5866 -	    # Extract -R from dependency_libs
  1.5867 -	    temp_deplibs=
  1.5868 -	    for libdir in $dependency_libs; do
  1.5869 -	      case $libdir in
  1.5870 -	      -R*) func_stripname '-R' '' "$libdir"
  1.5871 -	           temp_xrpath=$func_stripname_result
  1.5872 -		   case " $xrpath " in
  1.5873 -		   *" $temp_xrpath "*) ;;
  1.5874 -		   *) xrpath="$xrpath $temp_xrpath";;
  1.5875 -		   esac;;
  1.5876 -	      *) temp_deplibs="$temp_deplibs $libdir";;
  1.5877 -	      esac
  1.5878 -	    done
  1.5879 -	    dependency_libs="$temp_deplibs"
  1.5880 -	  fi
  1.5881 -
  1.5882 -	  newlib_search_path="$newlib_search_path $absdir"
  1.5883 -	  # Link against this library
  1.5884 -	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  1.5885 -	  # ... and its dependency_libs
  1.5886 -	  tmp_libs=
  1.5887 -	  for deplib in $dependency_libs; do
  1.5888 -	    newdependency_libs="$deplib $newdependency_libs"
  1.5889 -	    if $opt_duplicate_deps ; then
  1.5890 -	      case "$tmp_libs " in
  1.5891 -	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1.5892 -	      esac
  1.5893 -	    fi
  1.5894 -	    tmp_libs="$tmp_libs $deplib"
  1.5895 -	  done
  1.5896 -
  1.5897 -	  if test "$link_all_deplibs" != no; then
  1.5898 -	    # Add the search paths of all dependency libraries
  1.5899 -	    for deplib in $dependency_libs; do
  1.5900 -	      case $deplib in
  1.5901 -	      -L*) path="$deplib" ;;
  1.5902 -	      *.la)
  1.5903 -	        func_dirname "$deplib" "" "."
  1.5904 -		dir="$func_dirname_result"
  1.5905 -		# We need an absolute path.
  1.5906 -		case $dir in
  1.5907 -		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  1.5908 -		*)
  1.5909 -		  absdir=`cd "$dir" && pwd`
  1.5910 -		  if test -z "$absdir"; then
  1.5911 -		    func_warning "cannot determine absolute directory name of \`$dir'"
  1.5912 -		    absdir="$dir"
  1.5913 -		  fi
  1.5914 -		  ;;
  1.5915 -		esac
  1.5916 -		if $GREP "^installed=no" $deplib > /dev/null; then
  1.5917 -		case $host in
  1.5918 -		*-*-darwin*)
  1.5919 -		  depdepl=
  1.5920 -		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  1.5921 -		  if test -n "$deplibrary_names" ; then
  1.5922 -		    for tmp in $deplibrary_names ; do
  1.5923 -		      depdepl=$tmp
  1.5924 -		    done
  1.5925 -		    if test -f "$absdir/$objdir/$depdepl" ; then
  1.5926 -		      depdepl="$absdir/$objdir/$depdepl"
  1.5927 -		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  1.5928 -                      if test -z "$darwin_install_name"; then
  1.5929 -                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
  1.5930 -                      fi
  1.5931 -		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  1.5932 -		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
  1.5933 -		      path=
  1.5934 -		    fi
  1.5935 -		  fi
  1.5936 -		  ;;
  1.5937 -		*)
  1.5938 -		  path="-L$absdir/$objdir"
  1.5939 -		  ;;
  1.5940 -		esac
  1.5941 -		else
  1.5942 -		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.5943 -		  test -z "$libdir" && \
  1.5944 -		    func_fatal_error "\`$deplib' is not a valid libtool archive"
  1.5945 -		  test "$absdir" != "$libdir" && \
  1.5946 -		    func_warning "\`$deplib' seems to be moved"
  1.5947 -
  1.5948 -		  path="-L$absdir"
  1.5949 -		fi
  1.5950 -		;;
  1.5951 -	      esac
  1.5952 -	      case " $deplibs " in
  1.5953 -	      *" $path "*) ;;
  1.5954 -	      *) deplibs="$path $deplibs" ;;
  1.5955 -	      esac
  1.5956 -	    done
  1.5957 -	  fi # link_all_deplibs != no
  1.5958 -	fi # linkmode = lib
  1.5959 -      done # for deplib in $libs
  1.5960 -      if test "$pass" = link; then
  1.5961 -	if test "$linkmode" = "prog"; then
  1.5962 -	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  1.5963 -	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  1.5964 -	else
  1.5965 -	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.5966 -	fi
  1.5967 -      fi
  1.5968 -      dependency_libs="$newdependency_libs"
  1.5969 -      if test "$pass" = dlpreopen; then
  1.5970 -	# Link the dlpreopened libraries before other libraries
  1.5971 -	for deplib in $save_deplibs; do
  1.5972 -	  deplibs="$deplib $deplibs"
  1.5973 -	done
  1.5974 -      fi
  1.5975 -      if test "$pass" != dlopen; then
  1.5976 -	if test "$pass" != conv; then
  1.5977 -	  # Make sure lib_search_path contains only unique directories.
  1.5978 -	  lib_search_path=
  1.5979 -	  for dir in $newlib_search_path; do
  1.5980 -	    case "$lib_search_path " in
  1.5981 -	    *" $dir "*) ;;
  1.5982 -	    *) lib_search_path="$lib_search_path $dir" ;;
  1.5983 -	    esac
  1.5984 -	  done
  1.5985 -	  newlib_search_path=
  1.5986 -	fi
  1.5987 -
  1.5988 -	if test "$linkmode,$pass" != "prog,link"; then
  1.5989 -	  vars="deplibs"
  1.5990 -	else
  1.5991 -	  vars="compile_deplibs finalize_deplibs"
  1.5992 -	fi
  1.5993 -	for var in $vars dependency_libs; do
  1.5994 -	  # Add libraries to $var in reverse order
  1.5995 -	  eval tmp_libs=\"\$$var\"
  1.5996 -	  new_libs=
  1.5997 -	  for deplib in $tmp_libs; do
  1.5998 -	    # FIXME: Pedantically, this is the right thing to do, so
  1.5999 -	    #        that some nasty dependency loop isn't accidentally
  1.6000 -	    #        broken:
  1.6001 -	    #new_libs="$deplib $new_libs"
  1.6002 -	    # Pragmatically, this seems to cause very few problems in
  1.6003 -	    # practice:
  1.6004 -	    case $deplib in
  1.6005 -	    -L*) new_libs="$deplib $new_libs" ;;
  1.6006 -	    -R*) ;;
  1.6007 -	    *)
  1.6008 -	      # And here is the reason: when a library appears more
  1.6009 -	      # than once as an explicit dependence of a library, or
  1.6010 -	      # is implicitly linked in more than once by the
  1.6011 -	      # compiler, it is considered special, and multiple
  1.6012 -	      # occurrences thereof are not removed.  Compare this
  1.6013 -	      # with having the same library being listed as a
  1.6014 -	      # dependency of multiple other libraries: in this case,
  1.6015 -	      # we know (pedantically, we assume) the library does not
  1.6016 -	      # need to be listed more than once, so we keep only the
  1.6017 -	      # last copy.  This is not always right, but it is rare
  1.6018 -	      # enough that we require users that really mean to play
  1.6019 -	      # such unportable linking tricks to link the library
  1.6020 -	      # using -Wl,-lname, so that libtool does not consider it
  1.6021 -	      # for duplicate removal.
  1.6022 -	      case " $specialdeplibs " in
  1.6023 -	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
  1.6024 -	      *)
  1.6025 -		case " $new_libs " in
  1.6026 -		*" $deplib "*) ;;
  1.6027 -		*) new_libs="$deplib $new_libs" ;;
  1.6028 -		esac
  1.6029 -		;;
  1.6030 -	      esac
  1.6031 -	      ;;
  1.6032 -	    esac
  1.6033 -	  done
  1.6034 -	  tmp_libs=
  1.6035 -	  for deplib in $new_libs; do
  1.6036 -	    case $deplib in
  1.6037 -	    -L*)
  1.6038 -	      case " $tmp_libs " in
  1.6039 -	      *" $deplib "*) ;;
  1.6040 -	      *) tmp_libs="$tmp_libs $deplib" ;;
  1.6041 -	      esac
  1.6042 -	      ;;
  1.6043 -	    *) tmp_libs="$tmp_libs $deplib" ;;
  1.6044 -	    esac
  1.6045 -	  done
  1.6046 -	  eval $var=\"$tmp_libs\"
  1.6047 -	done # for var
  1.6048 -      fi
  1.6049 -      # Last step: remove runtime libs from dependency_libs
  1.6050 -      # (they stay in deplibs)
  1.6051 -      tmp_libs=
  1.6052 -      for i in $dependency_libs ; do
  1.6053 -	case " $predeps $postdeps $compiler_lib_search_path " in
  1.6054 -	*" $i "*)
  1.6055 -	  i=""
  1.6056 -	  ;;
  1.6057 -	esac
  1.6058 -	if test -n "$i" ; then
  1.6059 -	  tmp_libs="$tmp_libs $i"
  1.6060 -	fi
  1.6061 -      done
  1.6062 -      dependency_libs=$tmp_libs
  1.6063 -    done # for pass
  1.6064 -    if test "$linkmode" = prog; then
  1.6065 -      dlfiles="$newdlfiles"
  1.6066 -    fi
  1.6067 -    if test "$linkmode" = prog || test "$linkmode" = lib; then
  1.6068 -      dlprefiles="$newdlprefiles"
  1.6069 -    fi
  1.6070 -
  1.6071 -    case $linkmode in
  1.6072 -    oldlib)
  1.6073 -      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.6074 -	func_warning "\`-dlopen' is ignored for archives"
  1.6075 -      fi
  1.6076 -
  1.6077 -      case " $deplibs" in
  1.6078 -      *\ -l* | *\ -L*)
  1.6079 -	func_warning "\`-l' and \`-L' are ignored for archives" ;;
  1.6080 -      esac
  1.6081 -
  1.6082 -      test -n "$rpath" && \
  1.6083 -	func_warning "\`-rpath' is ignored for archives"
  1.6084 -
  1.6085 -      test -n "$xrpath" && \
  1.6086 -	func_warning "\`-R' is ignored for archives"
  1.6087 -
  1.6088 -      test -n "$vinfo" && \
  1.6089 -	func_warning "\`-version-info/-version-number' is ignored for archives"
  1.6090 -
  1.6091 -      test -n "$release" && \
  1.6092 -	func_warning "\`-release' is ignored for archives"
  1.6093 -
  1.6094 -      test -n "$export_symbols$export_symbols_regex" && \
  1.6095 -	func_warning "\`-export-symbols' is ignored for archives"
  1.6096 -
  1.6097 -      # Now set the variables for building old libraries.
  1.6098 -      build_libtool_libs=no
  1.6099 -      oldlibs="$output"
  1.6100 -      objs="$objs$old_deplibs"
  1.6101 -      ;;
  1.6102 -
  1.6103 -    lib)
  1.6104 -      # Make sure we only generate libraries of the form `libNAME.la'.
  1.6105 -      case $outputname in
  1.6106 -      lib*)
  1.6107 -	func_stripname 'lib' '.la' "$outputname"
  1.6108 -	name=$func_stripname_result
  1.6109 -	eval shared_ext=\"$shrext_cmds\"
  1.6110 -	eval libname=\"$libname_spec\"
  1.6111 -	;;
  1.6112 -      *)
  1.6113 -	test "$module" = no && \
  1.6114 -	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
  1.6115 -
  1.6116 -	if test "$need_lib_prefix" != no; then
  1.6117 -	  # Add the "lib" prefix for modules if required
  1.6118 -	  func_stripname '' '.la' "$outputname"
  1.6119 -	  name=$func_stripname_result
  1.6120 -	  eval shared_ext=\"$shrext_cmds\"
  1.6121 -	  eval libname=\"$libname_spec\"
  1.6122 -	else
  1.6123 -	  func_stripname '' '.la' "$outputname"
  1.6124 -	  libname=$func_stripname_result
  1.6125 -	fi
  1.6126 -	;;
  1.6127 -      esac
  1.6128 -
  1.6129 -      if test -n "$objs"; then
  1.6130 -	if test "$deplibs_check_method" != pass_all; then
  1.6131 -	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
  1.6132 -	else
  1.6133 -	  $ECHO
  1.6134 -	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  1.6135 -	  $ECHO "*** objects $objs is not portable!"
  1.6136 -	  libobjs="$libobjs $objs"
  1.6137 -	fi
  1.6138 -      fi
  1.6139 -
  1.6140 -      test "$dlself" != no && \
  1.6141 -	func_warning "\`-dlopen self' is ignored for libtool libraries"
  1.6142 -
  1.6143 -      set dummy $rpath
  1.6144 -      shift
  1.6145 -      test "$#" -gt 1 && \
  1.6146 -	func_warning "ignoring multiple \`-rpath's for a libtool library"
  1.6147 -
  1.6148 -      install_libdir="$1"
  1.6149 -
  1.6150 -      oldlibs=
  1.6151 -      if test -z "$rpath"; then
  1.6152 -	if test "$build_libtool_libs" = yes; then
  1.6153 -	  # Building a libtool convenience library.
  1.6154 -	  # Some compilers have problems with a `.al' extension so
  1.6155 -	  # convenience libraries should have the same extension an
  1.6156 -	  # archive normally would.
  1.6157 -	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1.6158 -	  build_libtool_libs=convenience
  1.6159 -	  build_old_libs=yes
  1.6160 -	fi
  1.6161 -
  1.6162 -	test -n "$vinfo" && \
  1.6163 -	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
  1.6164 -
  1.6165 -	test -n "$release" && \
  1.6166 -	  func_warning "\`-release' is ignored for convenience libraries"
  1.6167 -      else
  1.6168 -
  1.6169 -	# Parse the version information argument.
  1.6170 -	save_ifs="$IFS"; IFS=':'
  1.6171 -	set dummy $vinfo 0 0 0
  1.6172 -	shift
  1.6173 -	IFS="$save_ifs"
  1.6174 -
  1.6175 -	test -n "$7" && \
  1.6176 -	  func_fatal_help "too many parameters to \`-version-info'"
  1.6177 -
  1.6178 -	# convert absolute version numbers to libtool ages
  1.6179 -	# this retains compatibility with .la files and attempts
  1.6180 -	# to make the code below a bit more comprehensible
  1.6181 -
  1.6182 -	case $vinfo_number in
  1.6183 -	yes)
  1.6184 -	  number_major="$1"
  1.6185 -	  number_minor="$2"
  1.6186 -	  number_revision="$3"
  1.6187 -	  #
  1.6188 -	  # There are really only two kinds -- those that
  1.6189 -	  # use the current revision as the major version
  1.6190 -	  # and those that subtract age and use age as
  1.6191 -	  # a minor version.  But, then there is irix
  1.6192 -	  # which has an extra 1 added just for fun
  1.6193 -	  #
  1.6194 -	  case $version_type in
  1.6195 -	  darwin|linux|osf|windows|none)
  1.6196 -	    func_arith $number_major + $number_minor
  1.6197 -	    current=$func_arith_result
  1.6198 -	    age="$number_minor"
  1.6199 -	    revision="$number_revision"
  1.6200 -	    ;;
  1.6201 -	  freebsd-aout|freebsd-elf|sunos)
  1.6202 -	    current="$number_major"
  1.6203 -	    revision="$number_minor"
  1.6204 -	    age="0"
  1.6205 -	    ;;
  1.6206 -	  irix|nonstopux)
  1.6207 -	    func_arith $number_major + $number_minor
  1.6208 -	    current=$func_arith_result
  1.6209 -	    age="$number_minor"
  1.6210 -	    revision="$number_minor"
  1.6211 -	    lt_irix_increment=no
  1.6212 -	    ;;
  1.6213 -	  esac
  1.6214 -	  ;;
  1.6215 -	no)
  1.6216 -	  current="$1"
  1.6217 -	  revision="$2"
  1.6218 -	  age="$3"
  1.6219 -	  ;;
  1.6220 -	esac
  1.6221 -
  1.6222 -	# Check that each of the things are valid numbers.
  1.6223 -	case $current in
  1.6224 -	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.6225 -	*)
  1.6226 -	  func_error "CURRENT \`$current' must be a nonnegative integer"
  1.6227 -	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6228 -	  ;;
  1.6229 -	esac
  1.6230 -
  1.6231 -	case $revision in
  1.6232 -	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.6233 -	*)
  1.6234 -	  func_error "REVISION \`$revision' must be a nonnegative integer"
  1.6235 -	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6236 -	  ;;
  1.6237 -	esac
  1.6238 -
  1.6239 -	case $age in
  1.6240 -	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.6241 -	*)
  1.6242 -	  func_error "AGE \`$age' must be a nonnegative integer"
  1.6243 -	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6244 -	  ;;
  1.6245 -	esac
  1.6246 -
  1.6247 -	if test "$age" -gt "$current"; then
  1.6248 -	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
  1.6249 -	  func_fatal_error "\`$vinfo' is not valid version information"
  1.6250 -	fi
  1.6251 -
  1.6252 -	# Calculate the version variables.
  1.6253 -	major=
  1.6254 -	versuffix=
  1.6255 -	verstring=
  1.6256 -	case $version_type in
  1.6257 -	none) ;;
  1.6258 -
  1.6259 -	darwin)
  1.6260 -	  # Like Linux, but with the current version available in
  1.6261 -	  # verstring for coding it into the library header
  1.6262 -	  func_arith $current - $age
  1.6263 -	  major=.$func_arith_result
  1.6264 -	  versuffix="$major.$age.$revision"
  1.6265 -	  # Darwin ld doesn't like 0 for these options...
  1.6266 -	  func_arith $current + 1
  1.6267 -	  minor_current=$func_arith_result
  1.6268 -	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  1.6269 -	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  1.6270 -	  ;;
  1.6271 -
  1.6272 -	freebsd-aout)
  1.6273 -	  major=".$current"
  1.6274 -	  versuffix=".$current.$revision";
  1.6275 -	  ;;
  1.6276 -
  1.6277 -	freebsd-elf)
  1.6278 -	  major=".$current"
  1.6279 -	  versuffix=".$current"
  1.6280 -	  ;;
  1.6281 -
  1.6282 -	irix | nonstopux)
  1.6283 -	  if test "X$lt_irix_increment" = "Xno"; then
  1.6284 -	    func_arith $current - $age
  1.6285 -	  else
  1.6286 -	    func_arith $current - $age + 1
  1.6287 -	  fi
  1.6288 -	  major=$func_arith_result
  1.6289 -
  1.6290 -	  case $version_type in
  1.6291 -	    nonstopux) verstring_prefix=nonstopux ;;
  1.6292 -	    *)         verstring_prefix=sgi ;;
  1.6293 -	  esac
  1.6294 -	  verstring="$verstring_prefix$major.$revision"
  1.6295 -
  1.6296 -	  # Add in all the interfaces that we are compatible with.
  1.6297 -	  loop=$revision
  1.6298 -	  while test "$loop" -ne 0; do
  1.6299 -	    func_arith $revision - $loop
  1.6300 -	    iface=$func_arith_result
  1.6301 -	    func_arith $loop - 1
  1.6302 -	    loop=$func_arith_result
  1.6303 -	    verstring="$verstring_prefix$major.$iface:$verstring"
  1.6304 -	  done
  1.6305 -
  1.6306 -	  # Before this point, $major must not contain `.'.
  1.6307 -	  major=.$major
  1.6308 -	  versuffix="$major.$revision"
  1.6309 -	  ;;
  1.6310 -
  1.6311 -	linux)
  1.6312 -	  func_arith $current - $age
  1.6313 -	  major=.$func_arith_result
  1.6314 -	  versuffix="$major.$age.$revision"
  1.6315 -	  ;;
  1.6316 -
  1.6317 -	osf)
  1.6318 -	  func_arith $current - $age
  1.6319 -	  major=.$func_arith_result
  1.6320 -	  versuffix=".$current.$age.$revision"
  1.6321 -	  verstring="$current.$age.$revision"
  1.6322 -
  1.6323 -	  # Add in all the interfaces that we are compatible with.
  1.6324 -	  loop=$age
  1.6325 -	  while test "$loop" -ne 0; do
  1.6326 -	    func_arith $current - $loop
  1.6327 -	    iface=$func_arith_result
  1.6328 -	    func_arith $loop - 1
  1.6329 -	    loop=$func_arith_result
  1.6330 -	    verstring="$verstring:${iface}.0"
  1.6331 -	  done
  1.6332 -
  1.6333 -	  # Make executables depend on our current version.
  1.6334 -	  verstring="$verstring:${current}.0"
  1.6335 -	  ;;
  1.6336 -
  1.6337 -	qnx)
  1.6338 -	  major=".$current"
  1.6339 -	  versuffix=".$current"
  1.6340 -	  ;;
  1.6341 -
  1.6342 -	sunos)
  1.6343 -	  major=".$current"
  1.6344 -	  versuffix=".$current.$revision"
  1.6345 -	  ;;
  1.6346 -
  1.6347 -	windows)
  1.6348 -	  # Use '-' rather than '.', since we only want one
  1.6349 -	  # extension on DOS 8.3 filesystems.
  1.6350 -	  func_arith $current - $age
  1.6351 -	  major=$func_arith_result
  1.6352 -	  versuffix="-$major"
  1.6353 -	  ;;
  1.6354 -
  1.6355 -	*)
  1.6356 -	  func_fatal_configuration "unknown library version type \`$version_type'"
  1.6357 -	  ;;
  1.6358 -	esac
  1.6359 -
  1.6360 -	# Clear the version info if we defaulted, and they specified a release.
  1.6361 -	if test -z "$vinfo" && test -n "$release"; then
  1.6362 -	  major=
  1.6363 -	  case $version_type in
  1.6364 -	  darwin)
  1.6365 -	    # we can't check for "0.0" in archive_cmds due to quoting
  1.6366 -	    # problems, so we reset it completely
  1.6367 -	    verstring=
  1.6368 -	    ;;
  1.6369 -	  *)
  1.6370 -	    verstring="0.0"
  1.6371 -	    ;;
  1.6372 -	  esac
  1.6373 -	  if test "$need_version" = no; then
  1.6374 -	    versuffix=
  1.6375 -	  else
  1.6376 -	    versuffix=".0.0"
  1.6377 -	  fi
  1.6378 -	fi
  1.6379 -
  1.6380 -	# Remove version info from name if versioning should be avoided
  1.6381 -	if test "$avoid_version" = yes && test "$need_version" = no; then
  1.6382 -	  major=
  1.6383 -	  versuffix=
  1.6384 -	  verstring=""
  1.6385 -	fi
  1.6386 -
  1.6387 -	# Check to see if the archive will have undefined symbols.
  1.6388 -	if test "$allow_undefined" = yes; then
  1.6389 -	  if test "$allow_undefined_flag" = unsupported; then
  1.6390 -	    func_warning "undefined symbols not allowed in $host shared libraries"
  1.6391 -	    build_libtool_libs=no
  1.6392 -	    build_old_libs=yes
  1.6393 -	  fi
  1.6394 -	else
  1.6395 -	  # Don't allow undefined symbols.
  1.6396 -	  allow_undefined_flag="$no_undefined_flag"
  1.6397 -	fi
  1.6398 -
  1.6399 -      fi
  1.6400 -
  1.6401 -      func_generate_dlsyms "$libname" "$libname" "yes"
  1.6402 -      libobjs="$libobjs $symfileobj"
  1.6403 -      test "X$libobjs" = "X " && libobjs=
  1.6404 -
  1.6405 -      if test "$mode" != relink; then
  1.6406 -	# Remove our outputs, but don't remove object files since they
  1.6407 -	# may have been created when compiling PIC objects.
  1.6408 -	removelist=
  1.6409 -	tempremovelist=`$ECHO "$output_objdir/*"`
  1.6410 -	for p in $tempremovelist; do
  1.6411 -	  case $p in
  1.6412 -	    *.$objext | *.gcno)
  1.6413 -	       ;;
  1.6414 -	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  1.6415 -	       if test "X$precious_files_regex" != "X"; then
  1.6416 -		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  1.6417 -		 then
  1.6418 -		   continue
  1.6419 -		 fi
  1.6420 -	       fi
  1.6421 -	       removelist="$removelist $p"
  1.6422 -	       ;;
  1.6423 -	    *) ;;
  1.6424 -	  esac
  1.6425 -	done
  1.6426 -	test -n "$removelist" && \
  1.6427 -	  func_show_eval "${RM}r \$removelist"
  1.6428 -      fi
  1.6429 -
  1.6430 -      # Now set the variables for building old libraries.
  1.6431 -      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  1.6432 -	oldlibs="$oldlibs $output_objdir/$libname.$libext"
  1.6433 -
  1.6434 -	# Transform .lo files to .o files.
  1.6435 -	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  1.6436 -      fi
  1.6437 -
  1.6438 -      # Eliminate all temporary directories.
  1.6439 -      #for path in $notinst_path; do
  1.6440 -      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
  1.6441 -      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
  1.6442 -      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
  1.6443 -      #done
  1.6444 -
  1.6445 -      if test -n "$xrpath"; then
  1.6446 -	# If the user specified any rpath flags, then add them.
  1.6447 -	temp_xrpath=
  1.6448 -	for libdir in $xrpath; do
  1.6449 -	  temp_xrpath="$temp_xrpath -R$libdir"
  1.6450 -	  case "$finalize_rpath " in
  1.6451 -	  *" $libdir "*) ;;
  1.6452 -	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.6453 -	  esac
  1.6454 -	done
  1.6455 -	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  1.6456 -	  dependency_libs="$temp_xrpath $dependency_libs"
  1.6457 -	fi
  1.6458 -      fi
  1.6459 -
  1.6460 -      # Make sure dlfiles contains only unique files that won't be dlpreopened
  1.6461 -      old_dlfiles="$dlfiles"
  1.6462 -      dlfiles=
  1.6463 -      for lib in $old_dlfiles; do
  1.6464 -	case " $dlprefiles $dlfiles " in
  1.6465 -	*" $lib "*) ;;
  1.6466 -	*) dlfiles="$dlfiles $lib" ;;
  1.6467 -	esac
  1.6468 -      done
  1.6469 -
  1.6470 -      # Make sure dlprefiles contains only unique files
  1.6471 -      old_dlprefiles="$dlprefiles"
  1.6472 -      dlprefiles=
  1.6473 -      for lib in $old_dlprefiles; do
  1.6474 -	case "$dlprefiles " in
  1.6475 -	*" $lib "*) ;;
  1.6476 -	*) dlprefiles="$dlprefiles $lib" ;;
  1.6477 -	esac
  1.6478 -      done
  1.6479 -
  1.6480 -      if test "$build_libtool_libs" = yes; then
  1.6481 -	if test -n "$rpath"; then
  1.6482 -	  case $host in
  1.6483 -	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
  1.6484 -	    # these systems don't actually have a c library (as such)!
  1.6485 -	    ;;
  1.6486 -	  *-*-rhapsody* | *-*-darwin1.[012])
  1.6487 -	    # Rhapsody C library is in the System framework
  1.6488 -	    deplibs="$deplibs System.ltframework"
  1.6489 -	    ;;
  1.6490 -	  *-*-netbsd*)
  1.6491 -	    # Don't link with libc until the a.out ld.so is fixed.
  1.6492 -	    ;;
  1.6493 -	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1.6494 -	    # Do not include libc due to us having libc/libc_r.
  1.6495 -	    ;;
  1.6496 -	  *-*-sco3.2v5* | *-*-sco5v6*)
  1.6497 -	    # Causes problems with __ctype
  1.6498 -	    ;;
  1.6499 -	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1.6500 -	    # Compiler inserts libc in the correct place for threads to work
  1.6501 -	    ;;
  1.6502 -	  *)
  1.6503 -	    # Add libc to deplibs on all other systems if necessary.
  1.6504 -	    if test "$build_libtool_need_lc" = "yes"; then
  1.6505 -	      deplibs="$deplibs -lc"
  1.6506 -	    fi
  1.6507 -	    ;;
  1.6508 -	  esac
  1.6509 -	fi
  1.6510 -
  1.6511 -	# Transform deplibs into only deplibs that can be linked in shared.
  1.6512 -	name_save=$name
  1.6513 -	libname_save=$libname
  1.6514 -	release_save=$release
  1.6515 -	versuffix_save=$versuffix
  1.6516 -	major_save=$major
  1.6517 -	# I'm not sure if I'm treating the release correctly.  I think
  1.6518 -	# release should show up in the -l (ie -lgmp5) so we don't want to
  1.6519 -	# add it in twice.  Is that correct?
  1.6520 -	release=""
  1.6521 -	versuffix=""
  1.6522 -	major=""
  1.6523 -	newdeplibs=
  1.6524 -	droppeddeps=no
  1.6525 -	case $deplibs_check_method in
  1.6526 -	pass_all)
  1.6527 -	  # Don't check for shared/static.  Everything works.
  1.6528 -	  # This might be a little naive.  We might want to check
  1.6529 -	  # whether the library exists or not.  But this is on
  1.6530 -	  # osf3 & osf4 and I'm not really sure... Just
  1.6531 -	  # implementing what was already the behavior.
  1.6532 -	  newdeplibs=$deplibs
  1.6533 -	  ;;
  1.6534 -	test_compile)
  1.6535 -	  # This code stresses the "libraries are programs" paradigm to its
  1.6536 -	  # limits. Maybe even breaks it.  We compile a program, linking it
  1.6537 -	  # against the deplibs as a proxy for the library.  Then we can check
  1.6538 -	  # whether they linked in statically or dynamically with ldd.
  1.6539 -	  $opt_dry_run || $RM conftest.c
  1.6540 -	  cat > conftest.c <<EOF
  1.6541 -	  int main() { return 0; }
  1.6542 -EOF
  1.6543 -	  $opt_dry_run || $RM conftest
  1.6544 -	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  1.6545 -	    ldd_output=`ldd conftest`
  1.6546 -	    for i in $deplibs; do
  1.6547 -	      case $i in
  1.6548 -	      -l*)
  1.6549 -		func_stripname -l '' "$i"
  1.6550 -		name=$func_stripname_result
  1.6551 -		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6552 -		  case " $predeps $postdeps " in
  1.6553 -		  *" $i "*)
  1.6554 -		    newdeplibs="$newdeplibs $i"
  1.6555 -		    i=""
  1.6556 -		    ;;
  1.6557 -		  esac
  1.6558 -		fi
  1.6559 -		if test -n "$i" ; then
  1.6560 -		  libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6561 -		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  1.6562 -		  set dummy $deplib_matches; shift
  1.6563 -		  deplib_match=$1
  1.6564 -		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.6565 -		    newdeplibs="$newdeplibs $i"
  1.6566 -		  else
  1.6567 -		    droppeddeps=yes
  1.6568 -		    $ECHO
  1.6569 -		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  1.6570 -		    $ECHO "*** I have the capability to make that library automatically link in when"
  1.6571 -		    $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6572 -		    $ECHO "*** shared version of the library, which I believe you do not have"
  1.6573 -		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
  1.6574 -		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
  1.6575 -		  fi
  1.6576 -		fi
  1.6577 -		;;
  1.6578 -	      *)
  1.6579 -		newdeplibs="$newdeplibs $i"
  1.6580 -		;;
  1.6581 -	      esac
  1.6582 -	    done
  1.6583 -	  else
  1.6584 -	    # Error occurred in the first compile.  Let's try to salvage
  1.6585 -	    # the situation: Compile a separate program for each library.
  1.6586 -	    for i in $deplibs; do
  1.6587 -	      case $i in
  1.6588 -	      -l*)
  1.6589 -		func_stripname -l '' "$i"
  1.6590 -		name=$func_stripname_result
  1.6591 -		$opt_dry_run || $RM conftest
  1.6592 -		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  1.6593 -		  ldd_output=`ldd conftest`
  1.6594 -		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6595 -		    case " $predeps $postdeps " in
  1.6596 -		    *" $i "*)
  1.6597 -		      newdeplibs="$newdeplibs $i"
  1.6598 -		      i=""
  1.6599 -		      ;;
  1.6600 -		    esac
  1.6601 -		  fi
  1.6602 -		  if test -n "$i" ; then
  1.6603 -		    libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6604 -		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  1.6605 -		    set dummy $deplib_matches; shift
  1.6606 -		    deplib_match=$1
  1.6607 -		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  1.6608 -		      newdeplibs="$newdeplibs $i"
  1.6609 -		    else
  1.6610 -		      droppeddeps=yes
  1.6611 -		      $ECHO
  1.6612 -		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  1.6613 -		      $ECHO "*** I have the capability to make that library automatically link in when"
  1.6614 -		      $ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6615 -		      $ECHO "*** shared version of the library, which you do not appear to have"
  1.6616 -		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
  1.6617 -		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
  1.6618 -		    fi
  1.6619 -		  fi
  1.6620 -		else
  1.6621 -		  droppeddeps=yes
  1.6622 -		  $ECHO
  1.6623 -		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
  1.6624 -		  $ECHO "*** make it link in!  You will probably need to install it or some"
  1.6625 -		  $ECHO "*** library that it depends on before this library will be fully"
  1.6626 -		  $ECHO "*** functional.  Installing it before continuing would be even better."
  1.6627 -		fi
  1.6628 -		;;
  1.6629 -	      *)
  1.6630 -		newdeplibs="$newdeplibs $i"
  1.6631 -		;;
  1.6632 -	      esac
  1.6633 -	    done
  1.6634 -	  fi
  1.6635 -	  ;;
  1.6636 -	file_magic*)
  1.6637 -	  set dummy $deplibs_check_method; shift
  1.6638 -	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.6639 -	  for a_deplib in $deplibs; do
  1.6640 -	    case $a_deplib in
  1.6641 -	    -l*)
  1.6642 -	      func_stripname -l '' "$a_deplib"
  1.6643 -	      name=$func_stripname_result
  1.6644 -	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6645 -		case " $predeps $postdeps " in
  1.6646 -		*" $a_deplib "*)
  1.6647 -		  newdeplibs="$newdeplibs $a_deplib"
  1.6648 -		  a_deplib=""
  1.6649 -		  ;;
  1.6650 -		esac
  1.6651 -	      fi
  1.6652 -	      if test -n "$a_deplib" ; then
  1.6653 -		libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6654 -		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.6655 -		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.6656 -		  for potent_lib in $potential_libs; do
  1.6657 -		      # Follow soft links.
  1.6658 -		      if ls -lLd "$potent_lib" 2>/dev/null |
  1.6659 -			 $GREP " -> " >/dev/null; then
  1.6660 -			continue
  1.6661 -		      fi
  1.6662 -		      # The statement above tries to avoid entering an
  1.6663 -		      # endless loop below, in case of cyclic links.
  1.6664 -		      # We might still enter an endless loop, since a link
  1.6665 -		      # loop can be closed while we follow links,
  1.6666 -		      # but so what?
  1.6667 -		      potlib="$potent_lib"
  1.6668 -		      while test -h "$potlib" 2>/dev/null; do
  1.6669 -			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  1.6670 -			case $potliblink in
  1.6671 -			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  1.6672 -			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  1.6673 -			esac
  1.6674 -		      done
  1.6675 -		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  1.6676 -			 $SED -e 10q |
  1.6677 -			 $EGREP "$file_magic_regex" > /dev/null; then
  1.6678 -			newdeplibs="$newdeplibs $a_deplib"
  1.6679 -			a_deplib=""
  1.6680 -			break 2
  1.6681 -		      fi
  1.6682 -		  done
  1.6683 -		done
  1.6684 -	      fi
  1.6685 -	      if test -n "$a_deplib" ; then
  1.6686 -		droppeddeps=yes
  1.6687 -		$ECHO
  1.6688 -		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  1.6689 -		$ECHO "*** I have the capability to make that library automatically link in when"
  1.6690 -		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6691 -		$ECHO "*** shared version of the library, which you do not appear to have"
  1.6692 -		$ECHO "*** because I did check the linker path looking for a file starting"
  1.6693 -		if test -z "$potlib" ; then
  1.6694 -		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  1.6695 -		else
  1.6696 -		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  1.6697 -		  $ECHO "*** using a file magic. Last file checked: $potlib"
  1.6698 -		fi
  1.6699 -	      fi
  1.6700 -	      ;;
  1.6701 -	    *)
  1.6702 -	      # Add a -L argument.
  1.6703 -	      newdeplibs="$newdeplibs $a_deplib"
  1.6704 -	      ;;
  1.6705 -	    esac
  1.6706 -	  done # Gone through all deplibs.
  1.6707 -	  ;;
  1.6708 -	match_pattern*)
  1.6709 -	  set dummy $deplibs_check_method; shift
  1.6710 -	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  1.6711 -	  for a_deplib in $deplibs; do
  1.6712 -	    case $a_deplib in
  1.6713 -	    -l*)
  1.6714 -	      func_stripname -l '' "$a_deplib"
  1.6715 -	      name=$func_stripname_result
  1.6716 -	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6717 -		case " $predeps $postdeps " in
  1.6718 -		*" $a_deplib "*)
  1.6719 -		  newdeplibs="$newdeplibs $a_deplib"
  1.6720 -		  a_deplib=""
  1.6721 -		  ;;
  1.6722 -		esac
  1.6723 -	      fi
  1.6724 -	      if test -n "$a_deplib" ; then
  1.6725 -		libname=`eval "\\$ECHO \"$libname_spec\""`
  1.6726 -		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1.6727 -		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  1.6728 -		  for potent_lib in $potential_libs; do
  1.6729 -		    potlib="$potent_lib" # see symlink-check above in file_magic test
  1.6730 -		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
  1.6731 -		       $EGREP "$match_pattern_regex" > /dev/null; then
  1.6732 -		      newdeplibs="$newdeplibs $a_deplib"
  1.6733 -		      a_deplib=""
  1.6734 -		      break 2
  1.6735 -		    fi
  1.6736 -		  done
  1.6737 -		done
  1.6738 -	      fi
  1.6739 -	      if test -n "$a_deplib" ; then
  1.6740 -		droppeddeps=yes
  1.6741 -		$ECHO
  1.6742 -		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  1.6743 -		$ECHO "*** I have the capability to make that library automatically link in when"
  1.6744 -		$ECHO "*** you link to this library.  But I can only do this if you have a"
  1.6745 -		$ECHO "*** shared version of the library, which you do not appear to have"
  1.6746 -		$ECHO "*** because I did check the linker path looking for a file starting"
  1.6747 -		if test -z "$potlib" ; then
  1.6748 -		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  1.6749 -		else
  1.6750 -		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  1.6751 -		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
  1.6752 -		fi
  1.6753 -	      fi
  1.6754 -	      ;;
  1.6755 -	    *)
  1.6756 -	      # Add a -L argument.
  1.6757 -	      newdeplibs="$newdeplibs $a_deplib"
  1.6758 -	      ;;
  1.6759 -	    esac
  1.6760 -	  done # Gone through all deplibs.
  1.6761 -	  ;;
  1.6762 -	none | unknown | *)
  1.6763 -	  newdeplibs=""
  1.6764 -	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
  1.6765 -	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
  1.6766 -	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1.6767 -	    for i in $predeps $postdeps ; do
  1.6768 -	      # can't use Xsed below, because $i might contain '/'
  1.6769 -	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
  1.6770 -	    done
  1.6771 -	  fi
  1.6772 -	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
  1.6773 -	     $GREP . >/dev/null; then
  1.6774 -	    $ECHO
  1.6775 -	    if test "X$deplibs_check_method" = "Xnone"; then
  1.6776 -	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
  1.6777 -	    else
  1.6778 -	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
  1.6779 -	    fi
  1.6780 -	    $ECHO "*** All declared inter-library dependencies are being dropped."
  1.6781 -	    droppeddeps=yes
  1.6782 -	  fi
  1.6783 -	  ;;
  1.6784 -	esac
  1.6785 -	versuffix=$versuffix_save
  1.6786 -	major=$major_save
  1.6787 -	release=$release_save
  1.6788 -	libname=$libname_save
  1.6789 -	name=$name_save
  1.6790 -
  1.6791 -	case $host in
  1.6792 -	*-*-rhapsody* | *-*-darwin1.[012])
  1.6793 -	  # On Rhapsody replace the C library with the System framework
  1.6794 -	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.6795 -	  ;;
  1.6796 -	esac
  1.6797 -
  1.6798 -	if test "$droppeddeps" = yes; then
  1.6799 -	  if test "$module" = yes; then
  1.6800 -	    $ECHO
  1.6801 -	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
  1.6802 -	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
  1.6803 -	    $ECHO "*** a static module, that should work as long as the dlopening"
  1.6804 -	    $ECHO "*** application is linked with the -dlopen flag."
  1.6805 -	    if test -z "$global_symbol_pipe"; then
  1.6806 -	      $ECHO
  1.6807 -	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
  1.6808 -	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  1.6809 -	      $ECHO "*** not find such a program.  So, this module is probably useless."
  1.6810 -	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  1.6811 -	    fi
  1.6812 -	    if test "$build_old_libs" = no; then
  1.6813 -	      oldlibs="$output_objdir/$libname.$libext"
  1.6814 -	      build_libtool_libs=module
  1.6815 -	      build_old_libs=yes
  1.6816 -	    else
  1.6817 -	      build_libtool_libs=no
  1.6818 -	    fi
  1.6819 -	  else
  1.6820 -	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
  1.6821 -	    $ECHO "*** automatically added whenever a program is linked with this library"
  1.6822 -	    $ECHO "*** or is declared to -dlopen it."
  1.6823 -
  1.6824 -	    if test "$allow_undefined" = no; then
  1.6825 -	      $ECHO
  1.6826 -	      $ECHO "*** Since this library must not contain undefined symbols,"
  1.6827 -	      $ECHO "*** because either the platform does not support them or"
  1.6828 -	      $ECHO "*** it was explicitly requested with -no-undefined,"
  1.6829 -	      $ECHO "*** libtool will only create a static version of it."
  1.6830 -	      if test "$build_old_libs" = no; then
  1.6831 -		oldlibs="$output_objdir/$libname.$libext"
  1.6832 -		build_libtool_libs=module
  1.6833 -		build_old_libs=yes
  1.6834 -	      else
  1.6835 -		build_libtool_libs=no
  1.6836 -	      fi
  1.6837 -	    fi
  1.6838 -	  fi
  1.6839 -	fi
  1.6840 -	# Done checking deplibs!
  1.6841 -	deplibs=$newdeplibs
  1.6842 -      fi
  1.6843 -      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  1.6844 -      case $host in
  1.6845 -	*-*-darwin*)
  1.6846 -	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6847 -	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6848 -	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.6849 -	  ;;
  1.6850 -      esac
  1.6851 -
  1.6852 -      # move library search paths that coincide with paths to not yet
  1.6853 -      # installed libraries to the beginning of the library search list
  1.6854 -      new_libs=
  1.6855 -      for path in $notinst_path; do
  1.6856 -	case " $new_libs " in
  1.6857 -	*" -L$path/$objdir "*) ;;
  1.6858 -	*)
  1.6859 -	  case " $deplibs " in
  1.6860 -	  *" -L$path/$objdir "*)
  1.6861 -	    new_libs="$new_libs -L$path/$objdir" ;;
  1.6862 -	  esac
  1.6863 -	  ;;
  1.6864 -	esac
  1.6865 -      done
  1.6866 -      for deplib in $deplibs; do
  1.6867 -	case $deplib in
  1.6868 -	-L*)
  1.6869 -	  case " $new_libs " in
  1.6870 -	  *" $deplib "*) ;;
  1.6871 -	  *) new_libs="$new_libs $deplib" ;;
  1.6872 -	  esac
  1.6873 -	  ;;
  1.6874 -	*) new_libs="$new_libs $deplib" ;;
  1.6875 -	esac
  1.6876 -      done
  1.6877 -      deplibs="$new_libs"
  1.6878 -
  1.6879 -      # All the library-specific variables (install_libdir is set above).
  1.6880 -      library_names=
  1.6881 -      old_library=
  1.6882 -      dlname=
  1.6883 -
  1.6884 -      # Test again, we may have decided not to build it any more
  1.6885 -      if test "$build_libtool_libs" = yes; then
  1.6886 -	if test "$hardcode_into_libs" = yes; then
  1.6887 -	  # Hardcode the library paths
  1.6888 -	  hardcode_libdirs=
  1.6889 -	  dep_rpath=
  1.6890 -	  rpath="$finalize_rpath"
  1.6891 -	  test "$mode" != relink && rpath="$compile_rpath$rpath"
  1.6892 -	  for libdir in $rpath; do
  1.6893 -	    if test -n "$hardcode_libdir_flag_spec"; then
  1.6894 -	      if test -n "$hardcode_libdir_separator"; then
  1.6895 -		if test -z "$hardcode_libdirs"; then
  1.6896 -		  hardcode_libdirs="$libdir"
  1.6897 -		else
  1.6898 -		  # Just accumulate the unique libdirs.
  1.6899 -		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.6900 -		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.6901 -		    ;;
  1.6902 -		  *)
  1.6903 -		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.6904 -		    ;;
  1.6905 -		  esac
  1.6906 -		fi
  1.6907 -	      else
  1.6908 -		eval flag=\"$hardcode_libdir_flag_spec\"
  1.6909 -		dep_rpath="$dep_rpath $flag"
  1.6910 -	      fi
  1.6911 -	    elif test -n "$runpath_var"; then
  1.6912 -	      case "$perm_rpath " in
  1.6913 -	      *" $libdir "*) ;;
  1.6914 -	      *) perm_rpath="$perm_rpath $libdir" ;;
  1.6915 -	      esac
  1.6916 -	    fi
  1.6917 -	  done
  1.6918 -	  # Substitute the hardcoded libdirs into the rpath.
  1.6919 -	  if test -n "$hardcode_libdir_separator" &&
  1.6920 -	     test -n "$hardcode_libdirs"; then
  1.6921 -	    libdir="$hardcode_libdirs"
  1.6922 -	    if test -n "$hardcode_libdir_flag_spec_ld"; then
  1.6923 -	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  1.6924 -	    else
  1.6925 -	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  1.6926 -	    fi
  1.6927 -	  fi
  1.6928 -	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
  1.6929 -	    # We should set the runpath_var.
  1.6930 -	    rpath=
  1.6931 -	    for dir in $perm_rpath; do
  1.6932 -	      rpath="$rpath$dir:"
  1.6933 -	    done
  1.6934 -	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  1.6935 -	  fi
  1.6936 -	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  1.6937 -	fi
  1.6938 -
  1.6939 -	shlibpath="$finalize_shlibpath"
  1.6940 -	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  1.6941 -	if test -n "$shlibpath"; then
  1.6942 -	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  1.6943 -	fi
  1.6944 -
  1.6945 -	# Get the real and link names of the library.
  1.6946 -	eval shared_ext=\"$shrext_cmds\"
  1.6947 -	eval library_names=\"$library_names_spec\"
  1.6948 -	set dummy $library_names
  1.6949 -	shift
  1.6950 -	realname="$1"
  1.6951 -	shift
  1.6952 -
  1.6953 -	if test -n "$soname_spec"; then
  1.6954 -	  eval soname=\"$soname_spec\"
  1.6955 -	else
  1.6956 -	  soname="$realname"
  1.6957 -	fi
  1.6958 -	if test -z "$dlname"; then
  1.6959 -	  dlname=$soname
  1.6960 -	fi
  1.6961 -
  1.6962 -	lib="$output_objdir/$realname"
  1.6963 -	linknames=
  1.6964 -	for link
  1.6965 -	do
  1.6966 -	  linknames="$linknames $link"
  1.6967 -	done
  1.6968 -
  1.6969 -	# Use standard objects if they are pic
  1.6970 -	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.6971 -	test "X$libobjs" = "X " && libobjs=
  1.6972 -
  1.6973 -	delfiles=
  1.6974 -	if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.6975 -	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  1.6976 -	  export_symbols="$output_objdir/$libname.uexp"
  1.6977 -	  delfiles="$delfiles $export_symbols"
  1.6978 -	fi
  1.6979 -
  1.6980 -	orig_export_symbols=
  1.6981 -	case $host_os in
  1.6982 -	cygwin* | mingw* | cegcc*)
  1.6983 -	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  1.6984 -	    # exporting using user supplied symfile
  1.6985 -	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  1.6986 -	      # and it's NOT already a .def file. Must figure out
  1.6987 -	      # which of the given symbols are data symbols and tag
  1.6988 -	      # them as such. So, trigger use of export_symbols_cmds.
  1.6989 -	      # export_symbols gets reassigned inside the "prepare
  1.6990 -	      # the list of exported symbols" if statement, so the
  1.6991 -	      # include_expsyms logic still works.
  1.6992 -	      orig_export_symbols="$export_symbols"
  1.6993 -	      export_symbols=
  1.6994 -	      always_export_symbols=yes
  1.6995 -	    fi
  1.6996 -	  fi
  1.6997 -	  ;;
  1.6998 -	esac
  1.6999 -
  1.7000 -	# Prepare the list of exported symbols
  1.7001 -	if test -z "$export_symbols"; then
  1.7002 -	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  1.7003 -	    func_verbose "generating symbol list for \`$libname.la'"
  1.7004 -	    export_symbols="$output_objdir/$libname.exp"
  1.7005 -	    $opt_dry_run || $RM $export_symbols
  1.7006 -	    cmds=$export_symbols_cmds
  1.7007 -	    save_ifs="$IFS"; IFS='~'
  1.7008 -	    for cmd in $cmds; do
  1.7009 -	      IFS="$save_ifs"
  1.7010 -	      eval cmd=\"$cmd\"
  1.7011 -	      func_len " $cmd"
  1.7012 -	      len=$func_len_result
  1.7013 -	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7014 -		func_show_eval "$cmd" 'exit $?'
  1.7015 -		skipped_export=false
  1.7016 -	      else
  1.7017 -		# The command line is too long to execute in one step.
  1.7018 -		func_verbose "using reloadable object file for export list..."
  1.7019 -		skipped_export=:
  1.7020 -		# Break out early, otherwise skipped_export may be
  1.7021 -		# set to false by a later but shorter cmd.
  1.7022 -		break
  1.7023 -	      fi
  1.7024 -	    done
  1.7025 -	    IFS="$save_ifs"
  1.7026 -	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  1.7027 -	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1.7028 -	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  1.7029 -	    fi
  1.7030 -	  fi
  1.7031 -	fi
  1.7032 -
  1.7033 -	if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.7034 -	  tmp_export_symbols="$export_symbols"
  1.7035 -	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  1.7036 -	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  1.7037 -	fi
  1.7038 -
  1.7039 -	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  1.7040 -	  # The given exports_symbols file has to be filtered, so filter it.
  1.7041 -	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  1.7042 -	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
  1.7043 -	  # 's' commands which not all seds can handle. GNU sed should be fine
  1.7044 -	  # though. Also, the filter scales superlinearly with the number of
  1.7045 -	  # global variables. join(1) would be nice here, but unfortunately
  1.7046 -	  # isn't a blessed tool.
  1.7047 -	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  1.7048 -	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  1.7049 -	  export_symbols=$output_objdir/$libname.def
  1.7050 -	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  1.7051 -	fi
  1.7052 -
  1.7053 -	tmp_deplibs=
  1.7054 -	for test_deplib in $deplibs; do
  1.7055 -	  case " $convenience " in
  1.7056 -	  *" $test_deplib "*) ;;
  1.7057 -	  *)
  1.7058 -	    tmp_deplibs="$tmp_deplibs $test_deplib"
  1.7059 -	    ;;
  1.7060 -	  esac
  1.7061 -	done
  1.7062 -	deplibs="$tmp_deplibs"
  1.7063 -
  1.7064 -	if test -n "$convenience"; then
  1.7065 -	  if test -n "$whole_archive_flag_spec" &&
  1.7066 -	    test "$compiler_needs_object" = yes &&
  1.7067 -	    test -z "$libobjs"; then
  1.7068 -	    # extract the archives, so we have objects to list.
  1.7069 -	    # TODO: could optimize this to just extract one archive.
  1.7070 -	    whole_archive_flag_spec=
  1.7071 -	  fi
  1.7072 -	  if test -n "$whole_archive_flag_spec"; then
  1.7073 -	    save_libobjs=$libobjs
  1.7074 -	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.7075 -	    test "X$libobjs" = "X " && libobjs=
  1.7076 -	  else
  1.7077 -	    gentop="$output_objdir/${outputname}x"
  1.7078 -	    generated="$generated $gentop"
  1.7079 -
  1.7080 -	    func_extract_archives $gentop $convenience
  1.7081 -	    libobjs="$libobjs $func_extract_archives_result"
  1.7082 -	    test "X$libobjs" = "X " && libobjs=
  1.7083 -	  fi
  1.7084 -	fi
  1.7085 -
  1.7086 -	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  1.7087 -	  eval flag=\"$thread_safe_flag_spec\"
  1.7088 -	  linker_flags="$linker_flags $flag"
  1.7089 -	fi
  1.7090 -
  1.7091 -	# Make a backup of the uninstalled library when relinking
  1.7092 -	if test "$mode" = relink; then
  1.7093 -	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  1.7094 -	fi
  1.7095 -
  1.7096 -	# Do each of the archive commands.
  1.7097 -	if test "$module" = yes && test -n "$module_cmds" ; then
  1.7098 -	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.7099 -	    eval test_cmds=\"$module_expsym_cmds\"
  1.7100 -	    cmds=$module_expsym_cmds
  1.7101 -	  else
  1.7102 -	    eval test_cmds=\"$module_cmds\"
  1.7103 -	    cmds=$module_cmds
  1.7104 -	  fi
  1.7105 -	else
  1.7106 -	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.7107 -	    eval test_cmds=\"$archive_expsym_cmds\"
  1.7108 -	    cmds=$archive_expsym_cmds
  1.7109 -	  else
  1.7110 -	    eval test_cmds=\"$archive_cmds\"
  1.7111 -	    cmds=$archive_cmds
  1.7112 -	  fi
  1.7113 -	fi
  1.7114 -
  1.7115 -	if test "X$skipped_export" != "X:" &&
  1.7116 -	   func_len " $test_cmds" &&
  1.7117 -	   len=$func_len_result &&
  1.7118 -	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7119 -	  :
  1.7120 -	else
  1.7121 -	  # The command line is too long to link in one step, link piecewise
  1.7122 -	  # or, if using GNU ld and skipped_export is not :, use a linker
  1.7123 -	  # script.
  1.7124 -
  1.7125 -	  # Save the value of $output and $libobjs because we want to
  1.7126 -	  # use them later.  If we have whole_archive_flag_spec, we
  1.7127 -	  # want to use save_libobjs as it was before
  1.7128 -	  # whole_archive_flag_spec was expanded, because we can't
  1.7129 -	  # assume the linker understands whole_archive_flag_spec.
  1.7130 -	  # This may have to be revisited, in case too many
  1.7131 -	  # convenience libraries get linked in and end up exceeding
  1.7132 -	  # the spec.
  1.7133 -	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  1.7134 -	    save_libobjs=$libobjs
  1.7135 -	  fi
  1.7136 -	  save_output=$output
  1.7137 -	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
  1.7138 -
  1.7139 -	  # Clear the reloadable object creation command queue and
  1.7140 -	  # initialize k to one.
  1.7141 -	  test_cmds=
  1.7142 -	  concat_cmds=
  1.7143 -	  objlist=
  1.7144 -	  last_robj=
  1.7145 -	  k=1
  1.7146 -
  1.7147 -	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  1.7148 -	    output=${output_objdir}/${output_la}.lnkscript
  1.7149 -	    func_verbose "creating GNU ld script: $output"
  1.7150 -	    $ECHO 'INPUT (' > $output
  1.7151 -	    for obj in $save_libobjs
  1.7152 -	    do
  1.7153 -	      $ECHO "$obj" >> $output
  1.7154 -	    done
  1.7155 -	    $ECHO ')' >> $output
  1.7156 -	    delfiles="$delfiles $output"
  1.7157 -	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  1.7158 -	    output=${output_objdir}/${output_la}.lnk
  1.7159 -	    func_verbose "creating linker input file list: $output"
  1.7160 -	    : > $output
  1.7161 -	    set x $save_libobjs
  1.7162 -	    shift
  1.7163 -	    firstobj=
  1.7164 -	    if test "$compiler_needs_object" = yes; then
  1.7165 -	      firstobj="$1 "
  1.7166 -	      shift
  1.7167 -	    fi
  1.7168 -	    for obj
  1.7169 -	    do
  1.7170 -	      $ECHO "$obj" >> $output
  1.7171 -	    done
  1.7172 -	    delfiles="$delfiles $output"
  1.7173 -	    output=$firstobj\"$file_list_spec$output\"
  1.7174 -	  else
  1.7175 -	    if test -n "$save_libobjs"; then
  1.7176 -	      func_verbose "creating reloadable object files..."
  1.7177 -	      output=$output_objdir/$output_la-${k}.$objext
  1.7178 -	      eval test_cmds=\"$reload_cmds\"
  1.7179 -	      func_len " $test_cmds"
  1.7180 -	      len0=$func_len_result
  1.7181 -	      len=$len0
  1.7182 -
  1.7183 -	      # Loop over the list of objects to be linked.
  1.7184 -	      for obj in $save_libobjs
  1.7185 -	      do
  1.7186 -		func_len " $obj"
  1.7187 -		func_arith $len + $func_len_result
  1.7188 -		len=$func_arith_result
  1.7189 -		if test "X$objlist" = X ||
  1.7190 -		   test "$len" -lt "$max_cmd_len"; then
  1.7191 -		  func_append objlist " $obj"
  1.7192 -		else
  1.7193 -		  # The command $test_cmds is almost too long, add a
  1.7194 -		  # command to the queue.
  1.7195 -		  if test "$k" -eq 1 ; then
  1.7196 -		    # The first file doesn't have a previous command to add.
  1.7197 -		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  1.7198 -		  else
  1.7199 -		    # All subsequent reloadable object files will link in
  1.7200 -		    # the last one created.
  1.7201 -		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
  1.7202 -		  fi
  1.7203 -		  last_robj=$output_objdir/$output_la-${k}.$objext
  1.7204 -		  func_arith $k + 1
  1.7205 -		  k=$func_arith_result
  1.7206 -		  output=$output_objdir/$output_la-${k}.$objext
  1.7207 -		  objlist=$obj
  1.7208 -		  func_len " $last_robj"
  1.7209 -		  func_arith $len0 + $func_len_result
  1.7210 -		  len=$func_arith_result
  1.7211 -		fi
  1.7212 -	      done
  1.7213 -	      # Handle the remaining objects by creating one last
  1.7214 -	      # reloadable object file.  All subsequent reloadable object
  1.7215 -	      # files will link in the last one created.
  1.7216 -	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.7217 -	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  1.7218 -	      if test -n "$last_robj"; then
  1.7219 -	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
  1.7220 -	      fi
  1.7221 -	      delfiles="$delfiles $output"
  1.7222 -
  1.7223 -	    else
  1.7224 -	      output=
  1.7225 -	    fi
  1.7226 -
  1.7227 -	    if ${skipped_export-false}; then
  1.7228 -	      func_verbose "generating symbol list for \`$libname.la'"
  1.7229 -	      export_symbols="$output_objdir/$libname.exp"
  1.7230 -	      $opt_dry_run || $RM $export_symbols
  1.7231 -	      libobjs=$output
  1.7232 -	      # Append the command to create the export file.
  1.7233 -	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.7234 -	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  1.7235 -	      if test -n "$last_robj"; then
  1.7236 -		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  1.7237 -	      fi
  1.7238 -	    fi
  1.7239 -
  1.7240 -	    test -n "$save_libobjs" &&
  1.7241 -	      func_verbose "creating a temporary reloadable object file: $output"
  1.7242 -
  1.7243 -	    # Loop through the commands generated above and execute them.
  1.7244 -	    save_ifs="$IFS"; IFS='~'
  1.7245 -	    for cmd in $concat_cmds; do
  1.7246 -	      IFS="$save_ifs"
  1.7247 -	      $opt_silent || {
  1.7248 -		  func_quote_for_expand "$cmd"
  1.7249 -		  eval "func_echo $func_quote_for_expand_result"
  1.7250 -	      }
  1.7251 -	      $opt_dry_run || eval "$cmd" || {
  1.7252 -		lt_exit=$?
  1.7253 -
  1.7254 -		# Restore the uninstalled library and exit
  1.7255 -		if test "$mode" = relink; then
  1.7256 -		  ( cd "$output_objdir" && \
  1.7257 -		    $RM "${realname}T" && \
  1.7258 -		    $MV "${realname}U" "$realname" )
  1.7259 -		fi
  1.7260 -
  1.7261 -		exit $lt_exit
  1.7262 -	      }
  1.7263 -	    done
  1.7264 -	    IFS="$save_ifs"
  1.7265 -
  1.7266 -	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  1.7267 -	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  1.7268 -	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  1.7269 -	    fi
  1.7270 -	  fi
  1.7271 -
  1.7272 -          if ${skipped_export-false}; then
  1.7273 -	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  1.7274 -	      tmp_export_symbols="$export_symbols"
  1.7275 -	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  1.7276 -	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  1.7277 -	    fi
  1.7278 -
  1.7279 -	    if test -n "$orig_export_symbols"; then
  1.7280 -	      # The given exports_symbols file has to be filtered, so filter it.
  1.7281 -	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  1.7282 -	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
  1.7283 -	      # 's' commands which not all seds can handle. GNU sed should be fine
  1.7284 -	      # though. Also, the filter scales superlinearly with the number of
  1.7285 -	      # global variables. join(1) would be nice here, but unfortunately
  1.7286 -	      # isn't a blessed tool.
  1.7287 -	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  1.7288 -	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  1.7289 -	      export_symbols=$output_objdir/$libname.def
  1.7290 -	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  1.7291 -	    fi
  1.7292 -	  fi
  1.7293 -
  1.7294 -	  libobjs=$output
  1.7295 -	  # Restore the value of output.
  1.7296 -	  output=$save_output
  1.7297 -
  1.7298 -	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  1.7299 -	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  1.7300 -	    test "X$libobjs" = "X " && libobjs=
  1.7301 -	  fi
  1.7302 -	  # Expand the library linking commands again to reset the
  1.7303 -	  # value of $libobjs for piecewise linking.
  1.7304 -
  1.7305 -	  # Do each of the archive commands.
  1.7306 -	  if test "$module" = yes && test -n "$module_cmds" ; then
  1.7307 -	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  1.7308 -	      cmds=$module_expsym_cmds
  1.7309 -	    else
  1.7310 -	      cmds=$module_cmds
  1.7311 -	    fi
  1.7312 -	  else
  1.7313 -	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  1.7314 -	      cmds=$archive_expsym_cmds
  1.7315 -	    else
  1.7316 -	      cmds=$archive_cmds
  1.7317 -	    fi
  1.7318 -	  fi
  1.7319 -	fi
  1.7320 -
  1.7321 -	if test -n "$delfiles"; then
  1.7322 -	  # Append the command to remove temporary files to $cmds.
  1.7323 -	  eval cmds=\"\$cmds~\$RM $delfiles\"
  1.7324 -	fi
  1.7325 -
  1.7326 -	# Add any objects from preloaded convenience libraries
  1.7327 -	if test -n "$dlprefiles"; then
  1.7328 -	  gentop="$output_objdir/${outputname}x"
  1.7329 -	  generated="$generated $gentop"
  1.7330 -
  1.7331 -	  func_extract_archives $gentop $dlprefiles
  1.7332 -	  libobjs="$libobjs $func_extract_archives_result"
  1.7333 -	  test "X$libobjs" = "X " && libobjs=
  1.7334 -	fi
  1.7335 -
  1.7336 -	save_ifs="$IFS"; IFS='~'
  1.7337 -	for cmd in $cmds; do
  1.7338 -	  IFS="$save_ifs"
  1.7339 -	  eval cmd=\"$cmd\"
  1.7340 -	  $opt_silent || {
  1.7341 -	    func_quote_for_expand "$cmd"
  1.7342 -	    eval "func_echo $func_quote_for_expand_result"
  1.7343 -	  }
  1.7344 -	  $opt_dry_run || eval "$cmd" || {
  1.7345 -	    lt_exit=$?
  1.7346 -
  1.7347 -	    # Restore the uninstalled library and exit
  1.7348 -	    if test "$mode" = relink; then
  1.7349 -	      ( cd "$output_objdir" && \
  1.7350 -	        $RM "${realname}T" && \
  1.7351 -		$MV "${realname}U" "$realname" )
  1.7352 -	    fi
  1.7353 -
  1.7354 -	    exit $lt_exit
  1.7355 -	  }
  1.7356 -	done
  1.7357 -	IFS="$save_ifs"
  1.7358 -
  1.7359 -	# Restore the uninstalled library and exit
  1.7360 -	if test "$mode" = relink; then
  1.7361 -	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  1.7362 -
  1.7363 -	  if test -n "$convenience"; then
  1.7364 -	    if test -z "$whole_archive_flag_spec"; then
  1.7365 -	      func_show_eval '${RM}r "$gentop"'
  1.7366 -	    fi
  1.7367 -	  fi
  1.7368 -
  1.7369 -	  exit $EXIT_SUCCESS
  1.7370 -	fi
  1.7371 -
  1.7372 -	# Create links to the real library.
  1.7373 -	for linkname in $linknames; do
  1.7374 -	  if test "$realname" != "$linkname"; then
  1.7375 -	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  1.7376 -	  fi
  1.7377 -	done
  1.7378 -
  1.7379 -	# If -module or -export-dynamic was specified, set the dlname.
  1.7380 -	if test "$module" = yes || test "$export_dynamic" = yes; then
  1.7381 -	  # On all known operating systems, these are identical.
  1.7382 -	  dlname="$soname"
  1.7383 -	fi
  1.7384 -      fi
  1.7385 -      ;;
  1.7386 -
  1.7387 -    obj)
  1.7388 -      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  1.7389 -	func_warning "\`-dlopen' is ignored for objects"
  1.7390 -      fi
  1.7391 -
  1.7392 -      case " $deplibs" in
  1.7393 -      *\ -l* | *\ -L*)
  1.7394 -	func_warning "\`-l' and \`-L' are ignored for objects" ;;
  1.7395 -      esac
  1.7396 -
  1.7397 -      test -n "$rpath" && \
  1.7398 -	func_warning "\`-rpath' is ignored for objects"
  1.7399 -
  1.7400 -      test -n "$xrpath" && \
  1.7401 -	func_warning "\`-R' is ignored for objects"
  1.7402 -
  1.7403 -      test -n "$vinfo" && \
  1.7404 -	func_warning "\`-version-info' is ignored for objects"
  1.7405 -
  1.7406 -      test -n "$release" && \
  1.7407 -	func_warning "\`-release' is ignored for objects"
  1.7408 -
  1.7409 -      case $output in
  1.7410 -      *.lo)
  1.7411 -	test -n "$objs$old_deplibs" && \
  1.7412 -	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
  1.7413 -
  1.7414 -	libobj=$output
  1.7415 -	func_lo2o "$libobj"
  1.7416 -	obj=$func_lo2o_result
  1.7417 -	;;
  1.7418 -      *)
  1.7419 -	libobj=
  1.7420 -	obj="$output"
  1.7421 -	;;
  1.7422 -      esac
  1.7423 -
  1.7424 -      # Delete the old objects.
  1.7425 -      $opt_dry_run || $RM $obj $libobj
  1.7426 -
  1.7427 -      # Objects from convenience libraries.  This assumes
  1.7428 -      # single-version convenience libraries.  Whenever we create
  1.7429 -      # different ones for PIC/non-PIC, this we'll have to duplicate
  1.7430 -      # the extraction.
  1.7431 -      reload_conv_objs=
  1.7432 -      gentop=
  1.7433 -      # reload_cmds runs $LD directly, so let us get rid of
  1.7434 -      # -Wl from whole_archive_flag_spec and hope we can get by with
  1.7435 -      # turning comma into space..
  1.7436 -      wl=
  1.7437 -
  1.7438 -      if test -n "$convenience"; then
  1.7439 -	if test -n "$whole_archive_flag_spec"; then
  1.7440 -	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  1.7441 -	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  1.7442 -	else
  1.7443 -	  gentop="$output_objdir/${obj}x"
  1.7444 -	  generated="$generated $gentop"
  1.7445 -
  1.7446 -	  func_extract_archives $gentop $convenience
  1.7447 -	  reload_conv_objs="$reload_objs $func_extract_archives_result"
  1.7448 -	fi
  1.7449 -      fi
  1.7450 -
  1.7451 -      # Create the old-style object.
  1.7452 -      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.7453 -
  1.7454 -      output="$obj"
  1.7455 -      func_execute_cmds "$reload_cmds" 'exit $?'
  1.7456 -
  1.7457 -      # Exit if we aren't doing a library object file.
  1.7458 -      if test -z "$libobj"; then
  1.7459 -	if test -n "$gentop"; then
  1.7460 -	  func_show_eval '${RM}r "$gentop"'
  1.7461 -	fi
  1.7462 -
  1.7463 -	exit $EXIT_SUCCESS
  1.7464 -      fi
  1.7465 -
  1.7466 -      if test "$build_libtool_libs" != yes; then
  1.7467 -	if test -n "$gentop"; then
  1.7468 -	  func_show_eval '${RM}r "$gentop"'
  1.7469 -	fi
  1.7470 -
  1.7471 -	# Create an invalid libtool object if no PIC, so that we don't
  1.7472 -	# accidentally link it into a program.
  1.7473 -	# $show "echo timestamp > $libobj"
  1.7474 -	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  1.7475 -	exit $EXIT_SUCCESS
  1.7476 -      fi
  1.7477 -
  1.7478 -      if test -n "$pic_flag" || test "$pic_mode" != default; then
  1.7479 -	# Only do commands if we really have different PIC objects.
  1.7480 -	reload_objs="$libobjs $reload_conv_objs"
  1.7481 -	output="$libobj"
  1.7482 -	func_execute_cmds "$reload_cmds" 'exit $?'
  1.7483 -      fi
  1.7484 -
  1.7485 -      if test -n "$gentop"; then
  1.7486 -	func_show_eval '${RM}r "$gentop"'
  1.7487 -      fi
  1.7488 -
  1.7489 -      exit $EXIT_SUCCESS
  1.7490 -      ;;
  1.7491 -
  1.7492 -    prog)
  1.7493 -      case $host in
  1.7494 -	*cygwin*) func_stripname '' '.exe' "$output"
  1.7495 -	          output=$func_stripname_result.exe;;
  1.7496 -      esac
  1.7497 -      test -n "$vinfo" && \
  1.7498 -	func_warning "\`-version-info' is ignored for programs"
  1.7499 -
  1.7500 -      test -n "$release" && \
  1.7501 -	func_warning "\`-release' is ignored for programs"
  1.7502 -
  1.7503 -      test "$preload" = yes \
  1.7504 -        && test "$dlopen_support" = unknown \
  1.7505 -	&& test "$dlopen_self" = unknown \
  1.7506 -	&& test "$dlopen_self_static" = unknown && \
  1.7507 -	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  1.7508 -
  1.7509 -      case $host in
  1.7510 -      *-*-rhapsody* | *-*-darwin1.[012])
  1.7511 -	# On Rhapsody replace the C library is the System framework
  1.7512 -	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.7513 -	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  1.7514 -	;;
  1.7515 -      esac
  1.7516 -
  1.7517 -      case $host in
  1.7518 -      *-*-darwin*)
  1.7519 -	# Don't allow lazy linking, it breaks C++ global constructors
  1.7520 -	# But is supposedly fixed on 10.4 or later (yay!).
  1.7521 -	if test "$tagname" = CXX ; then
  1.7522 -	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  1.7523 -	    10.[0123])
  1.7524 -	      compile_command="$compile_command ${wl}-bind_at_load"
  1.7525 -	      finalize_command="$finalize_command ${wl}-bind_at_load"
  1.7526 -	    ;;
  1.7527 -	  esac
  1.7528 -	fi
  1.7529 -	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
  1.7530 -	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.7531 -	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  1.7532 -	;;
  1.7533 -      esac
  1.7534 -
  1.7535 -
  1.7536 -      # move library search paths that coincide with paths to not yet
  1.7537 -      # installed libraries to the beginning of the library search list
  1.7538 -      new_libs=
  1.7539 -      for path in $notinst_path; do
  1.7540 -	case " $new_libs " in
  1.7541 -	*" -L$path/$objdir "*) ;;
  1.7542 -	*)
  1.7543 -	  case " $compile_deplibs " in
  1.7544 -	  *" -L$path/$objdir "*)
  1.7545 -	    new_libs="$new_libs -L$path/$objdir" ;;
  1.7546 -	  esac
  1.7547 -	  ;;
  1.7548 -	esac
  1.7549 -      done
  1.7550 -      for deplib in $compile_deplibs; do
  1.7551 -	case $deplib in
  1.7552 -	-L*)
  1.7553 -	  case " $new_libs " in
  1.7554 -	  *" $deplib "*) ;;
  1.7555 -	  *) new_libs="$new_libs $deplib" ;;
  1.7556 -	  esac
  1.7557 -	  ;;
  1.7558 -	*) new_libs="$new_libs $deplib" ;;
  1.7559 -	esac
  1.7560 -      done
  1.7561 -      compile_deplibs="$new_libs"
  1.7562 -
  1.7563 -
  1.7564 -      compile_command="$compile_command $compile_deplibs"
  1.7565 -      finalize_command="$finalize_command $finalize_deplibs"
  1.7566 -
  1.7567 -      if test -n "$rpath$xrpath"; then
  1.7568 -	# If the user specified any rpath flags, then add them.
  1.7569 -	for libdir in $rpath $xrpath; do
  1.7570 -	  # This is the magic to use -rpath.
  1.7571 -	  case "$finalize_rpath " in
  1.7572 -	  *" $libdir "*) ;;
  1.7573 -	  *) finalize_rpath="$finalize_rpath $libdir" ;;
  1.7574 -	  esac
  1.7575 -	done
  1.7576 -      fi
  1.7577 -
  1.7578 -      # Now hardcode the library paths
  1.7579 -      rpath=
  1.7580 -      hardcode_libdirs=
  1.7581 -      for libdir in $compile_rpath $finalize_rpath; do
  1.7582 -	if test -n "$hardcode_libdir_flag_spec"; then
  1.7583 -	  if test -n "$hardcode_libdir_separator"; then
  1.7584 -	    if test -z "$hardcode_libdirs"; then
  1.7585 -	      hardcode_libdirs="$libdir"
  1.7586 -	    else
  1.7587 -	      # Just accumulate the unique libdirs.
  1.7588 -	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.7589 -	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.7590 -		;;
  1.7591 -	      *)
  1.7592 -		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.7593 -		;;
  1.7594 -	      esac
  1.7595 -	    fi
  1.7596 -	  else
  1.7597 -	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.7598 -	    rpath="$rpath $flag"
  1.7599 -	  fi
  1.7600 -	elif test -n "$runpath_var"; then
  1.7601 -	  case "$perm_rpath " in
  1.7602 -	  *" $libdir "*) ;;
  1.7603 -	  *) perm_rpath="$perm_rpath $libdir" ;;
  1.7604 -	  esac
  1.7605 -	fi
  1.7606 -	case $host in
  1.7607 -	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  1.7608 -	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  1.7609 -	  case :$dllsearchpath: in
  1.7610 -	  *":$libdir:"*) ;;
  1.7611 -	  ::) dllsearchpath=$libdir;;
  1.7612 -	  *) dllsearchpath="$dllsearchpath:$libdir";;
  1.7613 -	  esac
  1.7614 -	  case :$dllsearchpath: in
  1.7615 -	  *":$testbindir:"*) ;;
  1.7616 -	  ::) dllsearchpath=$testbindir;;
  1.7617 -	  *) dllsearchpath="$dllsearchpath:$testbindir";;
  1.7618 -	  esac
  1.7619 -	  ;;
  1.7620 -	esac
  1.7621 -      done
  1.7622 -      # Substitute the hardcoded libdirs into the rpath.
  1.7623 -      if test -n "$hardcode_libdir_separator" &&
  1.7624 -	 test -n "$hardcode_libdirs"; then
  1.7625 -	libdir="$hardcode_libdirs"
  1.7626 -	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.7627 -      fi
  1.7628 -      compile_rpath="$rpath"
  1.7629 -
  1.7630 -      rpath=
  1.7631 -      hardcode_libdirs=
  1.7632 -      for libdir in $finalize_rpath; do
  1.7633 -	if test -n "$hardcode_libdir_flag_spec"; then
  1.7634 -	  if test -n "$hardcode_libdir_separator"; then
  1.7635 -	    if test -z "$hardcode_libdirs"; then
  1.7636 -	      hardcode_libdirs="$libdir"
  1.7637 -	    else
  1.7638 -	      # Just accumulate the unique libdirs.
  1.7639 -	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  1.7640 -	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1.7641 -		;;
  1.7642 -	      *)
  1.7643 -		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1.7644 -		;;
  1.7645 -	      esac
  1.7646 -	    fi
  1.7647 -	  else
  1.7648 -	    eval flag=\"$hardcode_libdir_flag_spec\"
  1.7649 -	    rpath="$rpath $flag"
  1.7650 -	  fi
  1.7651 -	elif test -n "$runpath_var"; then
  1.7652 -	  case "$finalize_perm_rpath " in
  1.7653 -	  *" $libdir "*) ;;
  1.7654 -	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  1.7655 -	  esac
  1.7656 -	fi
  1.7657 -      done
  1.7658 -      # Substitute the hardcoded libdirs into the rpath.
  1.7659 -      if test -n "$hardcode_libdir_separator" &&
  1.7660 -	 test -n "$hardcode_libdirs"; then
  1.7661 -	libdir="$hardcode_libdirs"
  1.7662 -	eval rpath=\" $hardcode_libdir_flag_spec\"
  1.7663 -      fi
  1.7664 -      finalize_rpath="$rpath"
  1.7665 -
  1.7666 -      if test -n "$libobjs" && test "$build_old_libs" = yes; then
  1.7667 -	# Transform all the library objects into standard objects.
  1.7668 -	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.7669 -	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  1.7670 -      fi
  1.7671 -
  1.7672 -      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  1.7673 -
  1.7674 -      # template prelinking step
  1.7675 -      if test -n "$prelink_cmds"; then
  1.7676 -	func_execute_cmds "$prelink_cmds" 'exit $?'
  1.7677 -      fi
  1.7678 -
  1.7679 -      wrappers_required=yes
  1.7680 -      case $host in
  1.7681 -      *cygwin* | *mingw* )
  1.7682 -        if test "$build_libtool_libs" != yes; then
  1.7683 -          wrappers_required=no
  1.7684 -        fi
  1.7685 -        ;;
  1.7686 -      *cegcc)
  1.7687 -        # Disable wrappers for cegcc, we are cross compiling anyway.
  1.7688 -        wrappers_required=no
  1.7689 -        ;;
  1.7690 -      *)
  1.7691 -        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  1.7692 -          wrappers_required=no
  1.7693 -        fi
  1.7694 -        ;;
  1.7695 -      esac
  1.7696 -      if test "$wrappers_required" = no; then
  1.7697 -	# Replace the output file specification.
  1.7698 -	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.7699 -	link_command="$compile_command$compile_rpath"
  1.7700 -
  1.7701 -	# We have no uninstalled library dependencies, so finalize right now.
  1.7702 -	exit_status=0
  1.7703 -	func_show_eval "$link_command" 'exit_status=$?'
  1.7704 -
  1.7705 -	# Delete the generated files.
  1.7706 -	if test -f "$output_objdir/${outputname}S.${objext}"; then
  1.7707 -	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  1.7708 -	fi
  1.7709 -
  1.7710 -	exit $exit_status
  1.7711 -      fi
  1.7712 -
  1.7713 -      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  1.7714 -	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  1.7715 -      fi
  1.7716 -      if test -n "$finalize_shlibpath"; then
  1.7717 -	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  1.7718 -      fi
  1.7719 -
  1.7720 -      compile_var=
  1.7721 -      finalize_var=
  1.7722 -      if test -n "$runpath_var"; then
  1.7723 -	if test -n "$perm_rpath"; then
  1.7724 -	  # We should set the runpath_var.
  1.7725 -	  rpath=
  1.7726 -	  for dir in $perm_rpath; do
  1.7727 -	    rpath="$rpath$dir:"
  1.7728 -	  done
  1.7729 -	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.7730 -	fi
  1.7731 -	if test -n "$finalize_perm_rpath"; then
  1.7732 -	  # We should set the runpath_var.
  1.7733 -	  rpath=
  1.7734 -	  for dir in $finalize_perm_rpath; do
  1.7735 -	    rpath="$rpath$dir:"
  1.7736 -	  done
  1.7737 -	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  1.7738 -	fi
  1.7739 -      fi
  1.7740 -
  1.7741 -      if test "$no_install" = yes; then
  1.7742 -	# We don't need to create a wrapper script.
  1.7743 -	link_command="$compile_var$compile_command$compile_rpath"
  1.7744 -	# Replace the output file specification.
  1.7745 -	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  1.7746 -	# Delete the old output file.
  1.7747 -	$opt_dry_run || $RM $output
  1.7748 -	# Link the executable and exit
  1.7749 -	func_show_eval "$link_command" 'exit $?'
  1.7750 -	exit $EXIT_SUCCESS
  1.7751 -      fi
  1.7752 -
  1.7753 -      if test "$hardcode_action" = relink; then
  1.7754 -	# Fast installation is not supported
  1.7755 -	link_command="$compile_var$compile_command$compile_rpath"
  1.7756 -	relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.7757 -
  1.7758 -	func_warning "this platform does not like uninstalled shared libraries"
  1.7759 -	func_warning "\`$output' will be relinked during installation"
  1.7760 -      else
  1.7761 -	if test "$fast_install" != no; then
  1.7762 -	  link_command="$finalize_var$compile_command$finalize_rpath"
  1.7763 -	  if test "$fast_install" = yes; then
  1.7764 -	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  1.7765 -	  else
  1.7766 -	    # fast_install is set to needless
  1.7767 -	    relink_command=
  1.7768 -	  fi
  1.7769 -	else
  1.7770 -	  link_command="$compile_var$compile_command$compile_rpath"
  1.7771 -	  relink_command="$finalize_var$finalize_command$finalize_rpath"
  1.7772 -	fi
  1.7773 -      fi
  1.7774 -
  1.7775 -      # Replace the output file specification.
  1.7776 -      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  1.7777 -
  1.7778 -      # Delete the old output files.
  1.7779 -      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  1.7780 -
  1.7781 -      func_show_eval "$link_command" 'exit $?'
  1.7782 -
  1.7783 -      # Now create the wrapper script.
  1.7784 -      func_verbose "creating $output"
  1.7785 -
  1.7786 -      # Quote the relink command for shipping.
  1.7787 -      if test -n "$relink_command"; then
  1.7788 -	# Preserve any variables that may affect compiler behavior
  1.7789 -	for var in $variables_saved_for_relink; do
  1.7790 -	  if eval test -z \"\${$var+set}\"; then
  1.7791 -	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  1.7792 -	  elif eval var_value=\$$var; test -z "$var_value"; then
  1.7793 -	    relink_command="$var=; export $var; $relink_command"
  1.7794 -	  else
  1.7795 -	    func_quote_for_eval "$var_value"
  1.7796 -	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  1.7797 -	  fi
  1.7798 -	done
  1.7799 -	relink_command="(cd `pwd`; $relink_command)"
  1.7800 -	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.7801 -      fi
  1.7802 -
  1.7803 -      # Quote $ECHO for shipping.
  1.7804 -      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
  1.7805 -	case $progpath in
  1.7806 -	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  1.7807 -	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  1.7808 -	esac
  1.7809 -	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
  1.7810 -      else
  1.7811 -	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
  1.7812 -      fi
  1.7813 -
  1.7814 -      # Only actually do things if not in dry run mode.
  1.7815 -      $opt_dry_run || {
  1.7816 -	# win32 will think the script is a binary if it has
  1.7817 -	# a .exe suffix, so we strip it off here.
  1.7818 -	case $output in
  1.7819 -	  *.exe) func_stripname '' '.exe' "$output"
  1.7820 -	         output=$func_stripname_result ;;
  1.7821 -	esac
  1.7822 -	# test for cygwin because mv fails w/o .exe extensions
  1.7823 -	case $host in
  1.7824 -	  *cygwin*)
  1.7825 -	    exeext=.exe
  1.7826 -	    func_stripname '' '.exe' "$outputname"
  1.7827 -	    outputname=$func_stripname_result ;;
  1.7828 -	  *) exeext= ;;
  1.7829 -	esac
  1.7830 -	case $host in
  1.7831 -	  *cygwin* | *mingw* )
  1.7832 -	    func_dirname_and_basename "$output" "" "."
  1.7833 -	    output_name=$func_basename_result
  1.7834 -	    output_path=$func_dirname_result
  1.7835 -	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
  1.7836 -	    cwrapper="$output_path/$output_name.exe"
  1.7837 -	    $RM $cwrappersource $cwrapper
  1.7838 -	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  1.7839 -
  1.7840 -	    func_emit_cwrapperexe_src > $cwrappersource
  1.7841 -
  1.7842 -	    # The wrapper executable is built using the $host compiler,
  1.7843 -	    # because it contains $host paths and files. If cross-
  1.7844 -	    # compiling, it, like the target executable, must be
  1.7845 -	    # executed on the $host or under an emulation environment.
  1.7846 -	    $opt_dry_run || {
  1.7847 -	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  1.7848 -	      $STRIP $cwrapper
  1.7849 -	    }
  1.7850 -
  1.7851 -	    # Now, create the wrapper script for func_source use:
  1.7852 -	    func_ltwrapper_scriptname $cwrapper
  1.7853 -	    $RM $func_ltwrapper_scriptname_result
  1.7854 -	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  1.7855 -	    $opt_dry_run || {
  1.7856 -	      # note: this script will not be executed, so do not chmod.
  1.7857 -	      if test "x$build" = "x$host" ; then
  1.7858 -		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  1.7859 -	      else
  1.7860 -		func_emit_wrapper no > $func_ltwrapper_scriptname_result
  1.7861 -	      fi
  1.7862 -	    }
  1.7863 -	  ;;
  1.7864 -	  * )
  1.7865 -	    $RM $output
  1.7866 -	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  1.7867 -
  1.7868 -	    func_emit_wrapper no > $output
  1.7869 -	    chmod +x $output
  1.7870 -	  ;;
  1.7871 -	esac
  1.7872 -      }
  1.7873 -      exit $EXIT_SUCCESS
  1.7874 -      ;;
  1.7875 -    esac
  1.7876 -
  1.7877 -    # See if we need to build an old-fashioned archive.
  1.7878 -    for oldlib in $oldlibs; do
  1.7879 -
  1.7880 -      if test "$build_libtool_libs" = convenience; then
  1.7881 -	oldobjs="$libobjs_save $symfileobj"
  1.7882 -	addlibs="$convenience"
  1.7883 -	build_libtool_libs=no
  1.7884 -      else
  1.7885 -	if test "$build_libtool_libs" = module; then
  1.7886 -	  oldobjs="$libobjs_save"
  1.7887 -	  build_libtool_libs=no
  1.7888 -	else
  1.7889 -	  oldobjs="$old_deplibs $non_pic_objects"
  1.7890 -	  if test "$preload" = yes && test -f "$symfileobj"; then
  1.7891 -	    oldobjs="$oldobjs $symfileobj"
  1.7892 -	  fi
  1.7893 -	fi
  1.7894 -	addlibs="$old_convenience"
  1.7895 -      fi
  1.7896 -
  1.7897 -      if test -n "$addlibs"; then
  1.7898 -	gentop="$output_objdir/${outputname}x"
  1.7899 -	generated="$generated $gentop"
  1.7900 -
  1.7901 -	func_extract_archives $gentop $addlibs
  1.7902 -	oldobjs="$oldobjs $func_extract_archives_result"
  1.7903 -      fi
  1.7904 -
  1.7905 -      # Do each command in the archive commands.
  1.7906 -      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  1.7907 -	cmds=$old_archive_from_new_cmds
  1.7908 -      else
  1.7909 -
  1.7910 -	# Add any objects from preloaded convenience libraries
  1.7911 -	if test -n "$dlprefiles"; then
  1.7912 -	  gentop="$output_objdir/${outputname}x"
  1.7913 -	  generated="$generated $gentop"
  1.7914 -
  1.7915 -	  func_extract_archives $gentop $dlprefiles
  1.7916 -	  oldobjs="$oldobjs $func_extract_archives_result"
  1.7917 -	fi
  1.7918 -
  1.7919 -	# POSIX demands no paths to be encoded in archives.  We have
  1.7920 -	# to avoid creating archives with duplicate basenames if we
  1.7921 -	# might have to extract them afterwards, e.g., when creating a
  1.7922 -	# static archive out of a convenience library, or when linking
  1.7923 -	# the entirety of a libtool archive into another (currently
  1.7924 -	# not supported by libtool).
  1.7925 -	if (for obj in $oldobjs
  1.7926 -	    do
  1.7927 -	      func_basename "$obj"
  1.7928 -	      $ECHO "$func_basename_result"
  1.7929 -	    done | sort | sort -uc >/dev/null 2>&1); then
  1.7930 -	  :
  1.7931 -	else
  1.7932 -	  $ECHO "copying selected object files to avoid basename conflicts..."
  1.7933 -	  gentop="$output_objdir/${outputname}x"
  1.7934 -	  generated="$generated $gentop"
  1.7935 -	  func_mkdir_p "$gentop"
  1.7936 -	  save_oldobjs=$oldobjs
  1.7937 -	  oldobjs=
  1.7938 -	  counter=1
  1.7939 -	  for obj in $save_oldobjs
  1.7940 -	  do
  1.7941 -	    func_basename "$obj"
  1.7942 -	    objbase="$func_basename_result"
  1.7943 -	    case " $oldobjs " in
  1.7944 -	    " ") oldobjs=$obj ;;
  1.7945 -	    *[\ /]"$objbase "*)
  1.7946 -	      while :; do
  1.7947 -		# Make sure we don't pick an alternate name that also
  1.7948 -		# overlaps.
  1.7949 -		newobj=lt$counter-$objbase
  1.7950 -		func_arith $counter + 1
  1.7951 -		counter=$func_arith_result
  1.7952 -		case " $oldobjs " in
  1.7953 -		*[\ /]"$newobj "*) ;;
  1.7954 -		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
  1.7955 -		esac
  1.7956 -	      done
  1.7957 -	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  1.7958 -	      oldobjs="$oldobjs $gentop/$newobj"
  1.7959 -	      ;;
  1.7960 -	    *) oldobjs="$oldobjs $obj" ;;
  1.7961 -	    esac
  1.7962 -	  done
  1.7963 -	fi
  1.7964 -	eval cmds=\"$old_archive_cmds\"
  1.7965 -
  1.7966 -	func_len " $cmds"
  1.7967 -	len=$func_len_result
  1.7968 -	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  1.7969 -	  cmds=$old_archive_cmds
  1.7970 -	else
  1.7971 -	  # the command line is too long to link in one step, link in parts
  1.7972 -	  func_verbose "using piecewise archive linking..."
  1.7973 -	  save_RANLIB=$RANLIB
  1.7974 -	  RANLIB=:
  1.7975 -	  objlist=
  1.7976 -	  concat_cmds=
  1.7977 -	  save_oldobjs=$oldobjs
  1.7978 -	  oldobjs=
  1.7979 -	  # Is there a better way of finding the last object in the list?
  1.7980 -	  for obj in $save_oldobjs
  1.7981 -	  do
  1.7982 -	    last_oldobj=$obj
  1.7983 -	  done
  1.7984 -	  eval test_cmds=\"$old_archive_cmds\"
  1.7985 -	  func_len " $test_cmds"
  1.7986 -	  len0=$func_len_result
  1.7987 -	  len=$len0
  1.7988 -	  for obj in $save_oldobjs
  1.7989 -	  do
  1.7990 -	    func_len " $obj"
  1.7991 -	    func_arith $len + $func_len_result
  1.7992 -	    len=$func_arith_result
  1.7993 -	    func_append objlist " $obj"
  1.7994 -	    if test "$len" -lt "$max_cmd_len"; then
  1.7995 -	      :
  1.7996 -	    else
  1.7997 -	      # the above command should be used before it gets too long
  1.7998 -	      oldobjs=$objlist
  1.7999 -	      if test "$obj" = "$last_oldobj" ; then
  1.8000 -		RANLIB=$save_RANLIB
  1.8001 -	      fi
  1.8002 -	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  1.8003 -	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  1.8004 -	      objlist=
  1.8005 -	      len=$len0
  1.8006 -	    fi
  1.8007 -	  done
  1.8008 -	  RANLIB=$save_RANLIB
  1.8009 -	  oldobjs=$objlist
  1.8010 -	  if test "X$oldobjs" = "X" ; then
  1.8011 -	    eval cmds=\"\$concat_cmds\"
  1.8012 -	  else
  1.8013 -	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  1.8014 -	  fi
  1.8015 -	fi
  1.8016 -      fi
  1.8017 -      func_execute_cmds "$cmds" 'exit $?'
  1.8018 -    done
  1.8019 -
  1.8020 -    test -n "$generated" && \
  1.8021 -      func_show_eval "${RM}r$generated"
  1.8022 -
  1.8023 -    # Now create the libtool archive.
  1.8024 -    case $output in
  1.8025 -    *.la)
  1.8026 -      old_library=
  1.8027 -      test "$build_old_libs" = yes && old_library="$libname.$libext"
  1.8028 -      func_verbose "creating $output"
  1.8029 -
  1.8030 -      # Preserve any variables that may affect compiler behavior
  1.8031 -      for var in $variables_saved_for_relink; do
  1.8032 -	if eval test -z \"\${$var+set}\"; then
  1.8033 -	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  1.8034 -	elif eval var_value=\$$var; test -z "$var_value"; then
  1.8035 -	  relink_command="$var=; export $var; $relink_command"
  1.8036 -	else
  1.8037 -	  func_quote_for_eval "$var_value"
  1.8038 -	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  1.8039 -	fi
  1.8040 -      done
  1.8041 -      # Quote the link command for shipping.
  1.8042 -      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  1.8043 -      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  1.8044 -      if test "$hardcode_automatic" = yes ; then
  1.8045 -	relink_command=
  1.8046 -      fi
  1.8047 -
  1.8048 -      # Only create the output if not a dry run.
  1.8049 -      $opt_dry_run || {
  1.8050 -	for installed in no yes; do
  1.8051 -	  if test "$installed" = yes; then
  1.8052 -	    if test -z "$install_libdir"; then
  1.8053 -	      break
  1.8054 -	    fi
  1.8055 -	    output="$output_objdir/$outputname"i
  1.8056 -	    # Replace all uninstalled libtool libraries with the installed ones
  1.8057 -	    newdependency_libs=
  1.8058 -	    for deplib in $dependency_libs; do
  1.8059 -	      case $deplib in
  1.8060 -	      *.la)
  1.8061 -		func_basename "$deplib"
  1.8062 -		name="$func_basename_result"
  1.8063 -		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  1.8064 -		test -z "$libdir" && \
  1.8065 -		  func_fatal_error "\`$deplib' is not a valid libtool archive"
  1.8066 -		newdependency_libs="$newdependency_libs $libdir/$name"
  1.8067 -		;;
  1.8068 -	      *) newdependency_libs="$newdependency_libs $deplib" ;;
  1.8069 -	      esac
  1.8070 -	    done
  1.8071 -	    dependency_libs="$newdependency_libs"
  1.8072 -	    newdlfiles=
  1.8073 -
  1.8074 -	    for lib in $dlfiles; do
  1.8075 -	      case $lib in
  1.8076 -	      *.la)