Blame ltmain.sh

Packit e67170
Packit e67170
# libtool (GNU libtool) 2.4.2
Packit e67170
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
Packit e67170
Packit e67170
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
Packit e67170
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Packit e67170
# This is free software; see the source for copying conditions.  There is NO
Packit e67170
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit e67170
Packit e67170
# GNU Libtool is free software; you can redistribute it and/or modify
Packit e67170
# it under the terms of the GNU General Public License as published by
Packit e67170
# the Free Software Foundation; either version 2 of the License, or
Packit e67170
# (at your option) any later version.
Packit e67170
#
Packit e67170
# As a special exception to the GNU General Public License,
Packit e67170
# if you distribute this file as part of a program or library that
Packit e67170
# is built using GNU Libtool, you may include this file under the
Packit e67170
# same distribution terms that you use for the rest of that program.
Packit e67170
#
Packit e67170
# GNU Libtool is distributed in the hope that it will be useful, but
Packit e67170
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit e67170
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit e67170
# General Public License for more details.
Packit e67170
#
Packit e67170
# You should have received a copy of the GNU General Public License
Packit e67170
# along with GNU Libtool; see the file COPYING.  If not, a copy
Packit e67170
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
Packit e67170
# or obtained by writing to the Free Software Foundation, Inc.,
Packit e67170
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Packit e67170
Packit e67170
# Usage: $progname [OPTION]... [MODE-ARG]...
Packit e67170
#
Packit e67170
# Provide generalized library-building support services.
Packit e67170
#
Packit e67170
#       --config             show all configuration variables
Packit e67170
#       --debug              enable verbose shell tracing
Packit e67170
#   -n, --dry-run            display commands without modifying any files
Packit e67170
#       --features           display basic configuration information and exit
Packit e67170
#       --mode=MODE          use operation mode MODE
Packit e67170
#       --preserve-dup-deps  don't remove duplicate dependency libraries
Packit e67170
#       --quiet, --silent    don't print informational messages
Packit e67170
#       --no-quiet, --no-silent
Packit e67170
#                            print informational messages (default)
Packit e67170
#       --no-warn            don't display warning messages
Packit e67170
#       --tag=TAG            use configuration variables from tag TAG
Packit e67170
#   -v, --verbose            print more informational messages than default
Packit e67170
#       --no-verbose         don't print the extra informational messages
Packit e67170
#       --version            print version information
Packit e67170
#   -h, --help, --help-all   print short, long, or detailed help message
Packit e67170
#
Packit e67170
# MODE must be one of the following:
Packit e67170
#
Packit e67170
#         clean              remove files from the build directory
Packit e67170
#         compile            compile a source file into a libtool object
Packit e67170
#         execute            automatically set library path, then run a program
Packit e67170
#         finish             complete the installation of libtool libraries
Packit e67170
#         install            install libraries or executables
Packit e67170
#         link               create a library or an executable
Packit e67170
#         uninstall          remove libraries from an installed directory
Packit e67170
#
Packit e67170
# MODE-ARGS vary depending on the MODE.  When passed as first option,
Packit e67170
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
Packit e67170
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
Packit e67170
#
Packit e67170
# When reporting a bug, please describe a test case to reproduce it and
Packit e67170
# include the following information:
Packit e67170
#
Packit e67170
#         host-triplet:	$host
Packit e67170
#         shell:		$SHELL
Packit e67170
#         compiler:		$LTCC
Packit e67170
#         compiler flags:		$LTCFLAGS
Packit e67170
#         linker:		$LD (gnu? $with_gnu_ld)
Packit e67170
#         $progname:	(GNU libtool) 2.4.2
Packit e67170
#         automake:	$automake_version
Packit e67170
#         autoconf:	$autoconf_version
Packit e67170
#
Packit e67170
# Report bugs to <bug-libtool@gnu.org>.
Packit e67170
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
Packit e67170
# General help using GNU software: <http://www.gnu.org/gethelp/>.
Packit e67170
Packit e67170
PROGRAM=libtool
Packit e67170
PACKAGE=libtool
Packit e67170
VERSION=2.4.2
Packit e67170
TIMESTAMP=""
Packit e67170
package_revision=1.3337
Packit e67170
Packit e67170
# Be Bourne compatible
Packit e67170
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
Packit e67170
  emulate sh
Packit e67170
  NULLCMD=:
Packit e67170
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
Packit e67170
  # is contrary to our usage.  Disable this feature.
Packit e67170
  alias -g '${1+"$@"}'='"$@"'
Packit e67170
  setopt NO_GLOB_SUBST
Packit e67170
else
Packit e67170
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
Packit e67170
fi
Packit e67170
BIN_SH=xpg4; export BIN_SH # for Tru64
Packit e67170
DUALCASE=1; export DUALCASE # for MKS sh
Packit e67170
Packit e67170
# A function that is used when there is no print builtin or printf.
Packit e67170
func_fallback_echo ()
Packit e67170
{
Packit e67170
  eval 'cat <<_LTECHO_EOF
Packit e67170
$1
Packit e67170
_LTECHO_EOF'
Packit e67170
}
Packit e67170
Packit e67170
# NLS nuisances: We save the old values to restore during execute mode.
Packit e67170
lt_user_locale=
Packit e67170
lt_safe_locale=
Packit e67170
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit e67170
do
Packit e67170
  eval "if test \"\${$lt_var+set}\" = set; then
Packit e67170
          save_$lt_var=\$$lt_var
Packit e67170
          $lt_var=C
Packit e67170
	  export $lt_var
Packit e67170
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
Packit e67170
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
Packit e67170
	fi"
Packit e67170
done
Packit e67170
LC_ALL=C
Packit e67170
LANGUAGE=C
Packit e67170
export LANGUAGE LC_ALL
Packit e67170
Packit e67170
$lt_unset CDPATH
Packit e67170
Packit e67170
Packit e67170
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
Packit e67170
# is ksh but when the shell is invoked as "sh" and the current value of
Packit e67170
# the _XPG environment variable is not equal to 1 (one), the special
Packit e67170
# positional parameter $0, within a function call, is the name of the
Packit e67170
# function.
Packit e67170
progpath="$0"
Packit e67170
Packit e67170
Packit e67170
Packit e67170
: ${CP="cp -f"}
Packit e67170
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
Packit e67170
: ${MAKE="make"}
Packit e67170
: ${MKDIR="mkdir"}
Packit e67170
: ${MV="mv -f"}
Packit e67170
: ${RM="rm -f"}
Packit e67170
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
Packit e67170
: ${Xsed="$SED -e 1s/^X//"}
Packit e67170
Packit e67170
# Global variables:
Packit e67170
EXIT_SUCCESS=0
Packit e67170
EXIT_FAILURE=1
Packit e67170
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
Packit e67170
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
Packit e67170
Packit e67170
exit_status=$EXIT_SUCCESS
Packit e67170
Packit e67170
# Make sure IFS has a sensible default
Packit e67170
lt_nl='
Packit e67170
'
Packit e67170
IFS=" 	$lt_nl"
Packit e67170
Packit e67170
dirname="s,/[^/]*$,,"
Packit e67170
basename="s,^.*/,,"
Packit e67170
Packit e67170
# func_dirname file append nondir_replacement
Packit e67170
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
Packit e67170
# otherwise set result to NONDIR_REPLACEMENT.
Packit e67170
func_dirname ()
Packit e67170
{
Packit e67170
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
Packit e67170
    if test "X$func_dirname_result" = "X${1}"; then
Packit e67170
      func_dirname_result="${3}"
Packit e67170
    else
Packit e67170
      func_dirname_result="$func_dirname_result${2}"
Packit e67170
    fi
Packit e67170
} # func_dirname may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_basename file
Packit e67170
func_basename ()
Packit e67170
{
Packit e67170
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
Packit e67170
} # func_basename may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_dirname_and_basename file append nondir_replacement
Packit e67170
# perform func_basename and func_dirname in a single function
Packit e67170
# call:
Packit e67170
#   dirname:  Compute the dirname of FILE.  If nonempty,
Packit e67170
#             add APPEND to the result, otherwise set result
Packit e67170
#             to NONDIR_REPLACEMENT.
Packit e67170
#             value returned in "$func_dirname_result"
Packit e67170
#   basename: Compute filename of FILE.
Packit e67170
#             value retuned in "$func_basename_result"
Packit e67170
# Implementation must be kept synchronized with func_dirname
Packit e67170
# and func_basename. For efficiency, we do not delegate to
Packit e67170
# those functions but instead duplicate the functionality here.
Packit e67170
func_dirname_and_basename ()
Packit e67170
{
Packit e67170
    # Extract subdirectory from the argument.
Packit e67170
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
Packit e67170
    if test "X$func_dirname_result" = "X${1}"; then
Packit e67170
      func_dirname_result="${3}"
Packit e67170
    else
Packit e67170
      func_dirname_result="$func_dirname_result${2}"
Packit e67170
    fi
Packit e67170
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
Packit e67170
} # func_dirname_and_basename may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_stripname prefix suffix name
Packit e67170
# strip PREFIX and SUFFIX off of NAME.
Packit e67170
# PREFIX and SUFFIX must not contain globbing or regex special
Packit e67170
# characters, hashes, percent signs, but SUFFIX may contain a leading
Packit e67170
# dot (in which case that matches only a dot).
Packit e67170
# func_strip_suffix prefix name
Packit e67170
func_stripname ()
Packit e67170
{
Packit e67170
    case ${2} in
Packit e67170
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
Packit e67170
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
Packit e67170
    esac
Packit e67170
} # func_stripname may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# These SED scripts presuppose an absolute path with a trailing slash.
Packit e67170
pathcar='s,^/\([^/]*\).*$,\1,'
Packit e67170
pathcdr='s,^/[^/]*,,'
Packit e67170
removedotparts=':dotsl
Packit e67170
		s@/\./@/@g
Packit e67170
		t dotsl
Packit e67170
		s,/\.$,/,'
Packit e67170
collapseslashes='s@/\{1,\}@/@g'
Packit e67170
finalslash='s,/*$,/,'
Packit e67170
Packit e67170
# func_normal_abspath PATH
Packit e67170
# Remove doubled-up and trailing slashes, "." path components,
Packit e67170
# and cancel out any ".." path components in PATH after making
Packit e67170
# it an absolute path.
Packit e67170
#             value returned in "$func_normal_abspath_result"
Packit e67170
func_normal_abspath ()
Packit e67170
{
Packit e67170
  # Start from root dir and reassemble the path.
Packit e67170
  func_normal_abspath_result=
Packit e67170
  func_normal_abspath_tpath=$1
Packit e67170
  func_normal_abspath_altnamespace=
Packit e67170
  case $func_normal_abspath_tpath in
Packit e67170
    "")
Packit e67170
      # Empty path, that just means $cwd.
Packit e67170
      func_stripname '' '/' "`pwd`"
Packit e67170
      func_normal_abspath_result=$func_stripname_result
Packit e67170
      return
Packit e67170
    ;;
Packit e67170
    # The next three entries are used to spot a run of precisely
Packit e67170
    # two leading slashes without using negated character classes;
Packit e67170
    # we take advantage of case's first-match behaviour.
Packit e67170
    ///*)
Packit e67170
      # Unusual form of absolute path, do nothing.
Packit e67170
    ;;
Packit e67170
    //*)
Packit e67170
      # Not necessarily an ordinary path; POSIX reserves leading '//'
Packit e67170
      # and for example Cygwin uses it to access remote file shares
Packit e67170
      # over CIFS/SMB, so we conserve a leading double slash if found.
Packit e67170
      func_normal_abspath_altnamespace=/
Packit e67170
    ;;
Packit e67170
    /*)
Packit e67170
      # Absolute path, do nothing.
Packit e67170
    ;;
Packit e67170
    *)
Packit e67170
      # Relative path, prepend $cwd.
Packit e67170
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
  # Cancel out all the simple stuff to save iterations.  We also want
Packit e67170
  # the path to end with a slash for ease of parsing, so make sure
Packit e67170
  # there is one (and only one) here.
Packit e67170
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit e67170
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
Packit e67170
  while :; do
Packit e67170
    # Processed it all yet?
Packit e67170
    if test "$func_normal_abspath_tpath" = / ; then
Packit e67170
      # If we ascended to the root using ".." the result may be empty now.
Packit e67170
      if test -z "$func_normal_abspath_result" ; then
Packit e67170
        func_normal_abspath_result=/
Packit e67170
      fi
Packit e67170
      break
Packit e67170
    fi
Packit e67170
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit e67170
        -e "$pathcar"`
Packit e67170
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit e67170
        -e "$pathcdr"`
Packit e67170
    # Figure out what to do with it
Packit e67170
    case $func_normal_abspath_tcomponent in
Packit e67170
      "")
Packit e67170
        # Trailing empty path component, ignore it.
Packit e67170
      ;;
Packit e67170
      ..)
Packit e67170
        # Parent dir; strip last assembled component from result.
Packit e67170
        func_dirname "$func_normal_abspath_result"
Packit e67170
        func_normal_abspath_result=$func_dirname_result
Packit e67170
      ;;
Packit e67170
      *)
Packit e67170
        # Actual path component, append it.
Packit e67170
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
  done
Packit e67170
  # Restore leading double-slash if one was found on entry.
Packit e67170
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
Packit e67170
}
Packit e67170
Packit e67170
# func_relative_path SRCDIR DSTDIR
Packit e67170
# generates a relative path from SRCDIR to DSTDIR, with a trailing
Packit e67170
# slash if non-empty, suitable for immediately appending a filename
Packit e67170
# without needing to append a separator.
Packit e67170
#             value returned in "$func_relative_path_result"
Packit e67170
func_relative_path ()
Packit e67170
{
Packit e67170
  func_relative_path_result=
Packit e67170
  func_normal_abspath "$1"
Packit e67170
  func_relative_path_tlibdir=$func_normal_abspath_result
Packit e67170
  func_normal_abspath "$2"
Packit e67170
  func_relative_path_tbindir=$func_normal_abspath_result
Packit e67170
Packit e67170
  # Ascend the tree starting from libdir
Packit e67170
  while :; do
Packit e67170
    # check if we have found a prefix of bindir
Packit e67170
    case $func_relative_path_tbindir in
Packit e67170
      $func_relative_path_tlibdir)
Packit e67170
        # found an exact match
Packit e67170
        func_relative_path_tcancelled=
Packit e67170
        break
Packit e67170
        ;;
Packit e67170
      $func_relative_path_tlibdir*)
Packit e67170
        # found a matching prefix
Packit e67170
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
Packit e67170
        func_relative_path_tcancelled=$func_stripname_result
Packit e67170
        if test -z "$func_relative_path_result"; then
Packit e67170
          func_relative_path_result=.
Packit e67170
        fi
Packit e67170
        break
Packit e67170
        ;;
Packit e67170
      *)
Packit e67170
        func_dirname $func_relative_path_tlibdir
Packit e67170
        func_relative_path_tlibdir=${func_dirname_result}
Packit e67170
        if test "x$func_relative_path_tlibdir" = x ; then
Packit e67170
          # Have to descend all the way to the root!
Packit e67170
          func_relative_path_result=../$func_relative_path_result
Packit e67170
          func_relative_path_tcancelled=$func_relative_path_tbindir
Packit e67170
          break
Packit e67170
        fi
Packit e67170
        func_relative_path_result=../$func_relative_path_result
Packit e67170
        ;;
Packit e67170
    esac
Packit e67170
  done
Packit e67170
Packit e67170
  # Now calculate path; take care to avoid doubling-up slashes.
Packit e67170
  func_stripname '' '/' "$func_relative_path_result"
Packit e67170
  func_relative_path_result=$func_stripname_result
Packit e67170
  func_stripname '/' '/' "$func_relative_path_tcancelled"
Packit e67170
  if test "x$func_stripname_result" != x ; then
Packit e67170
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
Packit e67170
  fi
Packit e67170
Packit e67170
  # Normalisation. If bindir is libdir, return empty string,
Packit e67170
  # else relative path ending with a slash; either way, target
Packit e67170
  # file name can be directly appended.
Packit e67170
  if test ! -z "$func_relative_path_result"; then
Packit e67170
    func_stripname './' '' "$func_relative_path_result/"
Packit e67170
    func_relative_path_result=$func_stripname_result
Packit e67170
  fi
Packit e67170
}
Packit e67170
Packit e67170
# The name of this program:
Packit e67170
func_dirname_and_basename "$progpath"
Packit e67170
progname=$func_basename_result
Packit e67170
Packit e67170
# Make sure we have an absolute path for reexecution:
Packit e67170
case $progpath in
Packit e67170
  [\\/]*|[A-Za-z]:\\*) ;;
Packit e67170
  *[\\/]*)
Packit e67170
     progdir=$func_dirname_result
Packit e67170
     progdir=`cd "$progdir" && pwd`
Packit e67170
     progpath="$progdir/$progname"
Packit e67170
     ;;
Packit e67170
  *)
Packit e67170
     save_IFS="$IFS"
Packit e67170
     IFS=${PATH_SEPARATOR-:}
Packit e67170
     for progdir in $PATH; do
Packit e67170
       IFS="$save_IFS"
Packit e67170
       test -x "$progdir/$progname" && break
Packit e67170
     done
Packit e67170
     IFS="$save_IFS"
Packit e67170
     test -n "$progdir" || progdir=`pwd`
Packit e67170
     progpath="$progdir/$progname"
Packit e67170
     ;;
Packit e67170
esac
Packit e67170
Packit e67170
# Sed substitution that helps us do robust quoting.  It backslashifies
Packit e67170
# metacharacters that are still active within double-quoted strings.
Packit e67170
Xsed="${SED}"' -e 1s/^X//'
Packit e67170
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
Packit e67170
Packit e67170
# Same as above, but do not quote variable references.
Packit e67170
double_quote_subst='s/\(["`\\]\)/\\\1/g'
Packit e67170
Packit e67170
# Sed substitution that turns a string into a regex matching for the
Packit e67170
# string literally.
Packit e67170
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
Packit e67170
Packit e67170
# Sed substitution that converts a w32 file name or path
Packit e67170
# which contains forward slashes, into one that contains
Packit e67170
# (escaped) backslashes.  A very naive implementation.
Packit e67170
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
Packit e67170
Packit e67170
# Re-`\' parameter expansions in output of double_quote_subst that were
Packit e67170
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
Packit e67170
# in input to double_quote_subst, that '$' was protected from expansion.
Packit e67170
# Since each input `\' is now two `\'s, look for any number of runs of
Packit e67170
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
Packit e67170
bs='\\'
Packit e67170
bs2='\\\\'
Packit e67170
bs4='\\\\\\\\'
Packit e67170
dollar='\$'
Packit e67170
sed_double_backslash="\
Packit e67170
  s/$bs4/&\\
Packit e67170
/g
Packit e67170
  s/^$bs2$dollar/$bs&/
Packit e67170
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
Packit e67170
  s/\n//g"
Packit e67170
Packit e67170
# Standard options:
Packit e67170
opt_dry_run=false
Packit e67170
opt_help=false
Packit e67170
opt_quiet=false
Packit e67170
opt_verbose=false
Packit e67170
opt_warning=:
Packit e67170
Packit e67170
# func_echo arg...
Packit e67170
# Echo program name prefixed message, along with the current mode
Packit e67170
# name if it has been set yet.
Packit e67170
func_echo ()
Packit e67170
{
Packit e67170
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
Packit e67170
}
Packit e67170
Packit e67170
# func_verbose arg...
Packit e67170
# Echo program name prefixed message in verbose mode only.
Packit e67170
func_verbose ()
Packit e67170
{
Packit e67170
    $opt_verbose && func_echo ${1+"$@"}
Packit e67170
Packit e67170
    # A bug in bash halts the script if the last line of a function
Packit e67170
    # fails when set -e is in force, so we need another command to
Packit e67170
    # work around that:
Packit e67170
    :
Packit e67170
}
Packit e67170
Packit e67170
# func_echo_all arg...
Packit e67170
# Invoke $ECHO with all args, space-separated.
Packit e67170
func_echo_all ()
Packit e67170
{
Packit e67170
    $ECHO "$*"
Packit e67170
}
Packit e67170
Packit e67170
# func_error arg...
Packit e67170
# Echo program name prefixed message to standard error.
Packit e67170
func_error ()
Packit e67170
{
Packit e67170
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
Packit e67170
}
Packit e67170
Packit e67170
# func_warning arg...
Packit e67170
# Echo program name prefixed warning message to standard error.
Packit e67170
func_warning ()
Packit e67170
{
Packit e67170
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
Packit e67170
Packit e67170
    # bash bug again:
Packit e67170
    :
Packit e67170
}
Packit e67170
Packit e67170
# func_fatal_error arg...
Packit e67170
# Echo program name prefixed message to standard error, and exit.
Packit e67170
func_fatal_error ()
Packit e67170
{
Packit e67170
    func_error ${1+"$@"}
Packit e67170
    exit $EXIT_FAILURE
Packit e67170
}
Packit e67170
Packit e67170
# func_fatal_help arg...
Packit e67170
# Echo program name prefixed message to standard error, followed by
Packit e67170
# a help hint, and exit.
Packit e67170
func_fatal_help ()
Packit e67170
{
Packit e67170
    func_error ${1+"$@"}
Packit e67170
    func_fatal_error "$help"
Packit e67170
}
Packit e67170
help="Try \`$progname --help' for more information."  ## default
Packit e67170
Packit e67170
Packit e67170
# func_grep expression filename
Packit e67170
# Check whether EXPRESSION matches any line of FILENAME, without output.
Packit e67170
func_grep ()
Packit e67170
{
Packit e67170
    $GREP "$1" "$2" >/dev/null 2>&1
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_mkdir_p directory-path
Packit e67170
# Make sure the entire path to DIRECTORY-PATH is available.
Packit e67170
func_mkdir_p ()
Packit e67170
{
Packit e67170
    my_directory_path="$1"
Packit e67170
    my_dir_list=
Packit e67170
Packit e67170
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
Packit e67170
Packit e67170
      # Protect directory names starting with `-'
Packit e67170
      case $my_directory_path in
Packit e67170
        -*) my_directory_path="./$my_directory_path" ;;
Packit e67170
      esac
Packit e67170
Packit e67170
      # While some portion of DIR does not yet exist...
Packit e67170
      while test ! -d "$my_directory_path"; do
Packit e67170
        # ...make a list in topmost first order.  Use a colon delimited
Packit e67170
	# list incase some portion of path contains whitespace.
Packit e67170
        my_dir_list="$my_directory_path:$my_dir_list"
Packit e67170
Packit e67170
        # If the last portion added has no slash in it, the list is done
Packit e67170
        case $my_directory_path in */*) ;; *) break ;; esac
Packit e67170
Packit e67170
        # ...otherwise throw away the child directory and loop
Packit e67170
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
Packit e67170
      done
Packit e67170
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
Packit e67170
Packit e67170
      save_mkdir_p_IFS="$IFS"; IFS=':'
Packit e67170
      for my_dir in $my_dir_list; do
Packit e67170
	IFS="$save_mkdir_p_IFS"
Packit e67170
        # mkdir can fail with a `File exist' error if two processes
Packit e67170
        # try to create one of the directories concurrently.  Don't
Packit e67170
        # stop in that case!
Packit e67170
        $MKDIR "$my_dir" 2>/dev/null || :
Packit e67170
      done
Packit e67170
      IFS="$save_mkdir_p_IFS"
Packit e67170
Packit e67170
      # Bail out if we (or some other process) failed to create a directory.
Packit e67170
      test -d "$my_directory_path" || \
Packit e67170
        func_fatal_error "Failed to create \`$1'"
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_mktempdir [string]
Packit e67170
# Make a temporary directory that won't clash with other running
Packit e67170
# libtool processes, and avoids race conditions if possible.  If
Packit e67170
# given, STRING is the basename for that directory.
Packit e67170
func_mktempdir ()
Packit e67170
{
Packit e67170
    my_template="${TMPDIR-/tmp}/${1-$progname}"
Packit e67170
Packit e67170
    if test "$opt_dry_run" = ":"; then
Packit e67170
      # Return a directory name, but don't create it in dry-run mode
Packit e67170
      my_tmpdir="${my_template}-$$"
Packit e67170
    else
Packit e67170
Packit e67170
      # If mktemp works, use that first and foremost
Packit e67170
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
Packit e67170
Packit e67170
      if test ! -d "$my_tmpdir"; then
Packit e67170
        # Failing that, at least try and use $RANDOM to avoid a race
Packit e67170
        my_tmpdir="${my_template}-${RANDOM-0}$$"
Packit e67170
Packit e67170
        save_mktempdir_umask=`umask`
Packit e67170
        umask 0077
Packit e67170
        $MKDIR "$my_tmpdir"
Packit e67170
        umask $save_mktempdir_umask
Packit e67170
      fi
Packit e67170
Packit e67170
      # If we're not in dry-run mode, bomb out on failure
Packit e67170
      test -d "$my_tmpdir" || \
Packit e67170
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
Packit e67170
    fi
Packit e67170
Packit e67170
    $ECHO "$my_tmpdir"
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_quote_for_eval arg
Packit e67170
# Aesthetically quote ARG to be evaled later.
Packit e67170
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
Packit e67170
# is double-quoted, suitable for a subsequent eval, whereas
Packit e67170
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
Packit e67170
# which are still active within double quotes backslashified.
Packit e67170
func_quote_for_eval ()
Packit e67170
{
Packit e67170
    case $1 in
Packit e67170
      *[\\\`\"\$]*)
Packit e67170
	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
Packit e67170
      *)
Packit e67170
        func_quote_for_eval_unquoted_result="$1" ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    case $func_quote_for_eval_unquoted_result in
Packit e67170
      # Double-quote args containing shell metacharacters to delay
Packit e67170
      # word splitting, command substitution and and variable
Packit e67170
      # expansion for a subsequent eval.
Packit e67170
      # Many Bourne shells cannot handle close brackets correctly
Packit e67170
      # in scan sets, so we specify it separately.
Packit e67170
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit e67170
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
Packit e67170
        ;;
Packit e67170
      *)
Packit e67170
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
Packit e67170
    esac
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_quote_for_expand arg
Packit e67170
# Aesthetically quote ARG to be evaled later; same as above,
Packit e67170
# but do not quote variable references.
Packit e67170
func_quote_for_expand ()
Packit e67170
{
Packit e67170
    case $1 in
Packit e67170
      *[\\\`\"]*)
Packit e67170
	my_arg=`$ECHO "$1" | $SED \
Packit e67170
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
Packit e67170
      *)
Packit e67170
        my_arg="$1" ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    case $my_arg in
Packit e67170
      # Double-quote args containing shell metacharacters to delay
Packit e67170
      # word splitting and command substitution for a subsequent eval.
Packit e67170
      # Many Bourne shells cannot handle close brackets correctly
Packit e67170
      # in scan sets, so we specify it separately.
Packit e67170
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit e67170
        my_arg="\"$my_arg\""
Packit e67170
        ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    func_quote_for_expand_result="$my_arg"
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_show_eval cmd [fail_exp]
Packit e67170
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
Packit e67170
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit e67170
# is given, then evaluate it.
Packit e67170
func_show_eval ()
Packit e67170
{
Packit e67170
    my_cmd="$1"
Packit e67170
    my_fail_exp="${2-:}"
Packit e67170
Packit e67170
    ${opt_silent-false} || {
Packit e67170
      func_quote_for_expand "$my_cmd"
Packit e67170
      eval "func_echo $func_quote_for_expand_result"
Packit e67170
    }
Packit e67170
Packit e67170
    if ${opt_dry_run-false}; then :; else
Packit e67170
      eval "$my_cmd"
Packit e67170
      my_status=$?
Packit e67170
      if test "$my_status" -eq 0; then :; else
Packit e67170
	eval "(exit $my_status); $my_fail_exp"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_show_eval_locale cmd [fail_exp]
Packit e67170
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
Packit e67170
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit e67170
# is given, then evaluate it.  Use the saved locale for evaluation.
Packit e67170
func_show_eval_locale ()
Packit e67170
{
Packit e67170
    my_cmd="$1"
Packit e67170
    my_fail_exp="${2-:}"
Packit e67170
Packit e67170
    ${opt_silent-false} || {
Packit e67170
      func_quote_for_expand "$my_cmd"
Packit e67170
      eval "func_echo $func_quote_for_expand_result"
Packit e67170
    }
Packit e67170
Packit e67170
    if ${opt_dry_run-false}; then :; else
Packit e67170
      eval "$lt_user_locale
Packit e67170
	    $my_cmd"
Packit e67170
      my_status=$?
Packit e67170
      eval "$lt_safe_locale"
Packit e67170
      if test "$my_status" -eq 0; then :; else
Packit e67170
	eval "(exit $my_status); $my_fail_exp"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
# func_tr_sh
Packit e67170
# Turn $1 into a string suitable for a shell variable name.
Packit e67170
# Result is stored in $func_tr_sh_result.  All characters
Packit e67170
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
Packit e67170
# if $1 begins with a digit, a '_' is prepended as well.
Packit e67170
func_tr_sh ()
Packit e67170
{
Packit e67170
  case $1 in
Packit e67170
  [0-9]* | *[!a-zA-Z0-9_]*)
Packit e67170
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
Packit e67170
    ;;
Packit e67170
  * )
Packit e67170
    func_tr_sh_result=$1
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_version
Packit e67170
# Echo version message to standard output and exit.
Packit e67170
func_version ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
Packit e67170
    $SED -n '/(C)/!b go
Packit e67170
	:more
Packit e67170
	/\./!{
Packit e67170
	  N
Packit e67170
	  s/\n# / /
Packit e67170
	  b more
Packit e67170
	}
Packit e67170
	:go
Packit e67170
	/^# '$PROGRAM' (GNU /,/# warranty; / {
Packit e67170
        s/^# //
Packit e67170
	s/^# *$//
Packit e67170
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
Packit e67170
        p
Packit e67170
     }' < "$progpath"
Packit e67170
     exit $?
Packit e67170
}
Packit e67170
Packit e67170
# func_usage
Packit e67170
# Echo short help message to standard output and exit.
Packit e67170
func_usage ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
Packit e67170
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
Packit e67170
        s/^# //
Packit e67170
	s/^# *$//
Packit e67170
	s/\$progname/'$progname'/
Packit e67170
	p
Packit e67170
    }' < "$progpath"
Packit e67170
    echo
Packit e67170
    $ECHO "run \`$progname --help | more' for full usage"
Packit e67170
    exit $?
Packit e67170
}
Packit e67170
Packit e67170
# func_help [NOEXIT]
Packit e67170
# Echo long help message to standard output and exit,
Packit e67170
# unless 'noexit' is passed as argument.
Packit e67170
func_help ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
Packit e67170
    $SED -n '/^# Usage:/,/# Report bugs to/ {
Packit e67170
	:print
Packit e67170
        s/^# //
Packit e67170
	s/^# *$//
Packit e67170
	s*\$progname*'$progname'*
Packit e67170
	s*\$host*'"$host"'*
Packit e67170
	s*\$SHELL*'"$SHELL"'*
Packit e67170
	s*\$LTCC*'"$LTCC"'*
Packit e67170
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
Packit e67170
	s*\$LD*'"$LD"'*
Packit e67170
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
Packit e67170
	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
Packit e67170
	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
Packit e67170
	p
Packit e67170
	d
Packit e67170
     }
Packit e67170
     /^# .* home page:/b print
Packit e67170
     /^# General help using/b print
Packit e67170
     ' < "$progpath"
Packit e67170
    ret=$?
Packit e67170
    if test -z "$1"; then
Packit e67170
      exit $ret
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
# func_missing_arg argname
Packit e67170
# Echo program name prefixed message to standard error and set global
Packit e67170
# exit_cmd.
Packit e67170
func_missing_arg ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
Packit e67170
    func_error "missing argument for $1."
Packit e67170
    exit_cmd=exit
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_split_short_opt shortopt
Packit e67170
# Set func_split_short_opt_name and func_split_short_opt_arg shell
Packit e67170
# variables after splitting SHORTOPT after the 2nd character.
Packit e67170
func_split_short_opt ()
Packit e67170
{
Packit e67170
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
Packit e67170
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
Packit e67170
Packit e67170
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
Packit e67170
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
Packit e67170
} # func_split_short_opt may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_split_long_opt longopt
Packit e67170
# Set func_split_long_opt_name and func_split_long_opt_arg shell
Packit e67170
# variables after splitting LONGOPT at the `=' sign.
Packit e67170
func_split_long_opt ()
Packit e67170
{
Packit e67170
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
Packit e67170
    my_sed_long_arg='1s/^--[^=]*=//'
Packit e67170
Packit e67170
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
Packit e67170
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
Packit e67170
} # func_split_long_opt may be replaced by extended shell implementation
Packit e67170
Packit e67170
exit_cmd=:
Packit e67170
Packit e67170
Packit e67170
Packit e67170
Packit e67170
Packit e67170
magic="%%%MAGIC variable%%%"
Packit e67170
magic_exe="%%%MAGIC EXE variable%%%"
Packit e67170
Packit e67170
# Global variables.
Packit e67170
nonopt=
Packit e67170
preserve_args=
Packit e67170
lo2o="s/\\.lo\$/.${objext}/"
Packit e67170
o2lo="s/\\.${objext}\$/.lo/"
Packit e67170
extracted_archives=
Packit e67170
extracted_serial=0
Packit e67170
Packit e67170
# If this variable is set in any of the actions, the command in it
Packit e67170
# will be execed at the end.  This prevents here-documents from being
Packit e67170
# left over by shells.
Packit e67170
exec_cmd=
Packit e67170
Packit e67170
# func_append var value
Packit e67170
# Append VALUE to the end of shell variable VAR.
Packit e67170
func_append ()
Packit e67170
{
Packit e67170
    eval "${1}=\$${1}\${2}"
Packit e67170
} # func_append may be replaced by extended shell implementation
Packit e67170
Packit e67170
# func_append_quoted var value
Packit e67170
# Quote VALUE and append to the end of shell variable VAR, separated
Packit e67170
# by a space.
Packit e67170
func_append_quoted ()
Packit e67170
{
Packit e67170
    func_quote_for_eval "${2}"
Packit e67170
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
Packit e67170
} # func_append_quoted may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_arith arithmetic-term...
Packit e67170
func_arith ()
Packit e67170
{
Packit e67170
    func_arith_result=`expr "${@}"`
Packit e67170
} # func_arith may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_len string
Packit e67170
# STRING may not start with a hyphen.
Packit e67170
func_len ()
Packit e67170
{
Packit e67170
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
Packit e67170
} # func_len may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_lo2o object
Packit e67170
func_lo2o ()
Packit e67170
{
Packit e67170
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
Packit e67170
} # func_lo2o may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_xform libobj-or-source
Packit e67170
func_xform ()
Packit e67170
{
Packit e67170
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
Packit e67170
} # func_xform may be replaced by extended shell implementation
Packit e67170
Packit e67170
Packit e67170
# func_fatal_configuration arg...
Packit e67170
# Echo program name prefixed message to standard error, followed by
Packit e67170
# a configuration failure hint, and exit.
Packit e67170
func_fatal_configuration ()
Packit e67170
{
Packit e67170
    func_error ${1+"$@"}
Packit e67170
    func_error "See the $PACKAGE documentation for more information."
Packit e67170
    func_fatal_error "Fatal configuration error."
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_config
Packit e67170
# Display the configuration for all the tags in this script.
Packit e67170
func_config ()
Packit e67170
{
Packit e67170
    re_begincf='^# ### BEGIN LIBTOOL'
Packit e67170
    re_endcf='^# ### END LIBTOOL'
Packit e67170
Packit e67170
    # Default configuration.
Packit e67170
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
Packit e67170
Packit e67170
    # Now print the configurations for the tags.
Packit e67170
    for tagname in $taglist; do
Packit e67170
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
Packit e67170
    done
Packit e67170
Packit e67170
    exit $?
Packit e67170
}
Packit e67170
Packit e67170
# func_features
Packit e67170
# Display the features supported by this script.
Packit e67170
func_features ()
Packit e67170
{
Packit e67170
    echo "host: $host"
Packit e67170
    if test "$build_libtool_libs" = yes; then
Packit e67170
      echo "enable shared libraries"
Packit e67170
    else
Packit e67170
      echo "disable shared libraries"
Packit e67170
    fi
Packit e67170
    if test "$build_old_libs" = yes; then
Packit e67170
      echo "enable static libraries"
Packit e67170
    else
Packit e67170
      echo "disable static libraries"
Packit e67170
    fi
Packit e67170
Packit e67170
    exit $?
Packit e67170
}
Packit e67170
Packit e67170
# func_enable_tag tagname
Packit e67170
# Verify that TAGNAME is valid, and either flag an error and exit, or
Packit e67170
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
Packit e67170
# variable here.
Packit e67170
func_enable_tag ()
Packit e67170
{
Packit e67170
  # Global variable:
Packit e67170
  tagname="$1"
Packit e67170
Packit e67170
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
Packit e67170
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
Packit e67170
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
Packit e67170
Packit e67170
  # Validate tagname.
Packit e67170
  case $tagname in
Packit e67170
    *[!-_A-Za-z0-9,/]*)
Packit e67170
      func_fatal_error "invalid tag name: $tagname"
Packit e67170
      ;;
Packit e67170
  esac
Packit e67170
Packit e67170
  # Don't test for the "default" C tag, as we know it's
Packit e67170
  # there but not specially marked.
Packit e67170
  case $tagname in
Packit e67170
    CC) ;;
Packit e67170
    *)
Packit e67170
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
Packit e67170
	taglist="$taglist $tagname"
Packit e67170
Packit e67170
	# Evaluate the configuration.  Be careful to quote the path
Packit e67170
	# and the sed script, to avoid splitting on whitespace, but
Packit e67170
	# also don't use non-portable quotes within backquotes within
Packit e67170
	# quotes we have to do it in 2 steps:
Packit e67170
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
Packit e67170
	eval "$extractedcf"
Packit e67170
      else
Packit e67170
	func_error "ignoring unknown tag $tagname"
Packit e67170
      fi
Packit e67170
      ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
Packit e67170
# func_check_version_match
Packit e67170
# Ensure that we are using m4 macros, and libtool script from the same
Packit e67170
# release of libtool.
Packit e67170
func_check_version_match ()
Packit e67170
{
Packit e67170
  if test "$package_revision" != "$macro_revision"; then
Packit e67170
    if test "$VERSION" != "$macro_version"; then
Packit e67170
      if test -z "$macro_version"; then
Packit e67170
        cat >&2 <<_LT_EOF
Packit e67170
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit e67170
$progname: definition of this LT_INIT comes from an older release.
Packit e67170
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit e67170
$progname: and run autoconf again.
Packit e67170
_LT_EOF
Packit e67170
      else
Packit e67170
        cat >&2 <<_LT_EOF
Packit e67170
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit e67170
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
Packit e67170
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit e67170
$progname: and run autoconf again.
Packit e67170
_LT_EOF
Packit e67170
      fi
Packit e67170
    else
Packit e67170
      cat >&2 <<_LT_EOF
Packit e67170
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
Packit e67170
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
Packit e67170
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
Packit e67170
$progname: of $PACKAGE $VERSION and run autoconf again.
Packit e67170
_LT_EOF
Packit e67170
    fi
Packit e67170
Packit e67170
    exit $EXIT_MISMATCH
Packit e67170
  fi
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# Shorthand for --mode=foo, only valid as the first argument
Packit e67170
case $1 in
Packit e67170
clean|clea|cle|cl)
Packit e67170
  shift; set dummy --mode clean ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
compile|compil|compi|comp|com|co|c)
Packit e67170
  shift; set dummy --mode compile ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
execute|execut|execu|exec|exe|ex|e)
Packit e67170
  shift; set dummy --mode execute ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
finish|finis|fini|fin|fi|f)
Packit e67170
  shift; set dummy --mode finish ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
install|instal|insta|inst|ins|in|i)
Packit e67170
  shift; set dummy --mode install ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
link|lin|li|l)
Packit e67170
  shift; set dummy --mode link ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
Packit e67170
  shift; set dummy --mode uninstall ${1+"$@"}; shift
Packit e67170
  ;;
Packit e67170
esac
Packit e67170
Packit e67170
Packit e67170
Packit e67170
# Option defaults:
Packit e67170
opt_debug=:
Packit e67170
opt_dry_run=false
Packit e67170
opt_config=false
Packit e67170
opt_preserve_dup_deps=false
Packit e67170
opt_features=false
Packit e67170
opt_finish=false
Packit e67170
opt_help=false
Packit e67170
opt_help_all=false
Packit e67170
opt_silent=:
Packit e67170
opt_warning=:
Packit e67170
opt_verbose=:
Packit e67170
opt_silent=false
Packit e67170
opt_verbose=false
Packit e67170
Packit e67170
Packit e67170
# Parse options once, thoroughly.  This comes as soon as possible in the
Packit e67170
# script to make things like `--version' happen as quickly as we can.
Packit e67170
{
Packit e67170
  # this just eases exit handling
Packit e67170
  while test $# -gt 0; do
Packit e67170
    opt="$1"
Packit e67170
    shift
Packit e67170
    case $opt in
Packit e67170
      --debug|-x)	opt_debug='set -x'
Packit e67170
			func_echo "enabling shell trace mode"
Packit e67170
			$opt_debug
Packit e67170
			;;
Packit e67170
      --dry-run|--dryrun|-n)
Packit e67170
			opt_dry_run=:
Packit e67170
			;;
Packit e67170
      --config)
Packit e67170
			opt_config=:
Packit e67170
func_config
Packit e67170
			;;
Packit e67170
      --dlopen|-dlopen)
Packit e67170
			optarg="$1"
Packit e67170
			opt_dlopen="${opt_dlopen+$opt_dlopen
Packit e67170
}$optarg"
Packit e67170
			shift
Packit e67170
			;;
Packit e67170
      --preserve-dup-deps)
Packit e67170
			opt_preserve_dup_deps=:
Packit e67170
			;;
Packit e67170
      --features)
Packit e67170
			opt_features=:
Packit e67170
func_features
Packit e67170
			;;
Packit e67170
      --finish)
Packit e67170
			opt_finish=:
Packit e67170
set dummy --mode finish ${1+"$@"}; shift
Packit e67170
			;;
Packit e67170
      --help)
Packit e67170
			opt_help=:
Packit e67170
			;;
Packit e67170
      --help-all)
Packit e67170
			opt_help_all=:
Packit e67170
opt_help=': help-all'
Packit e67170
			;;
Packit e67170
      --mode)
Packit e67170
			test $# = 0 && func_missing_arg $opt && break
Packit e67170
			optarg="$1"
Packit e67170
			opt_mode="$optarg"
Packit e67170
case $optarg in
Packit e67170
  # Valid mode arguments:
Packit e67170
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
Packit e67170
Packit e67170
  # Catch anything else as an error
Packit e67170
  *) func_error "invalid argument for $opt"
Packit e67170
     exit_cmd=exit
Packit e67170
     break
Packit e67170
     ;;
Packit e67170
esac
Packit e67170
			shift
Packit e67170
			;;
Packit e67170
      --no-silent|--no-quiet)
Packit e67170
			opt_silent=false
Packit e67170
func_append preserve_args " $opt"
Packit e67170
			;;
Packit e67170
      --no-warning|--no-warn)
Packit e67170
			opt_warning=false
Packit e67170
func_append preserve_args " $opt"
Packit e67170
			;;
Packit e67170
      --no-verbose)
Packit e67170
			opt_verbose=false
Packit e67170
func_append preserve_args " $opt"
Packit e67170
			;;
Packit e67170
      --silent|--quiet)
Packit e67170
			opt_silent=:
Packit e67170
func_append preserve_args " $opt"
Packit e67170
        opt_verbose=false
Packit e67170
			;;
Packit e67170
      --verbose|-v)
Packit e67170
			opt_verbose=:
Packit e67170
func_append preserve_args " $opt"
Packit e67170
opt_silent=false
Packit e67170
			;;
Packit e67170
      --tag)
Packit e67170
			test $# = 0 && func_missing_arg $opt && break
Packit e67170
			optarg="$1"
Packit e67170
			opt_tag="$optarg"
Packit e67170
func_append preserve_args " $opt $optarg"
Packit e67170
func_enable_tag "$optarg"
Packit e67170
			shift
Packit e67170
			;;
Packit e67170
Packit e67170
      -\?|-h)		func_usage				;;
Packit e67170
      --help)		func_help				;;
Packit e67170
      --version)	func_version				;;
Packit e67170
Packit e67170
      # Separate optargs to long options:
Packit e67170
      --*=*)
Packit e67170
			func_split_long_opt "$opt"
Packit e67170
			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
Packit e67170
			shift
Packit e67170
			;;
Packit e67170
Packit e67170
      # Separate non-argument short options:
Packit e67170
      -\?*|-h*|-n*|-v*)
Packit e67170
			func_split_short_opt "$opt"
Packit e67170
			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
Packit e67170
			shift
Packit e67170
			;;
Packit e67170
Packit e67170
      --)		break					;;
Packit e67170
      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
Packit e67170
      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
Packit e67170
    esac
Packit e67170
  done
Packit e67170
Packit e67170
  # Validate options:
Packit e67170
Packit e67170
  # save first non-option argument
Packit e67170
  if test "$#" -gt 0; then
Packit e67170
    nonopt="$opt"
Packit e67170
    shift
Packit e67170
  fi
Packit e67170
Packit e67170
  # preserve --debug
Packit e67170
  test "$opt_debug" = : || func_append preserve_args " --debug"
Packit e67170
Packit e67170
  case $host in
Packit e67170
    *cygwin* | *mingw* | *pw32* | *cegcc*)
Packit e67170
      # don't eliminate duplications in $postdeps and $predeps
Packit e67170
      opt_duplicate_compiler_generated_deps=:
Packit e67170
      ;;
Packit e67170
    *)
Packit e67170
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
Packit e67170
      ;;
Packit e67170
  esac
Packit e67170
Packit e67170
  $opt_help || {
Packit e67170
    # Sanity checks first:
Packit e67170
    func_check_version_match
Packit e67170
Packit e67170
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
Packit e67170
      func_fatal_configuration "not configured to build any kind of library"
Packit e67170
    fi
Packit e67170
Packit e67170
    # Darwin sucks
Packit e67170
    eval std_shrext=\"$shrext_cmds\"
Packit e67170
Packit e67170
    # Only execute mode is allowed to have -dlopen flags.
Packit e67170
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
Packit e67170
      func_error "unrecognized option \`-dlopen'"
Packit e67170
      $ECHO "$help" 1>&2
Packit e67170
      exit $EXIT_FAILURE
Packit e67170
    fi
Packit e67170
Packit e67170
    # Change the help message to a mode-specific one.
Packit e67170
    generic_help="$help"
Packit e67170
    help="Try \`$progname --help --mode=$opt_mode' for more information."
Packit e67170
  }
Packit e67170
Packit e67170
Packit e67170
  # Bail if the options were screwed
Packit e67170
  $exit_cmd $EXIT_FAILURE
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
Packit e67170
Packit e67170
## ----------- ##
Packit e67170
##    Main.    ##
Packit e67170
## ----------- ##
Packit e67170
Packit e67170
# func_lalib_p file
Packit e67170
# True iff FILE is a libtool `.la' library or `.lo' object file.
Packit e67170
# This function is only a basic sanity check; it will hardly flush out
Packit e67170
# determined imposters.
Packit e67170
func_lalib_p ()
Packit e67170
{
Packit e67170
    test -f "$1" &&
Packit e67170
      $SED -e 4q "$1" 2>/dev/null \
Packit e67170
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
Packit e67170
}
Packit e67170
Packit e67170
# func_lalib_unsafe_p file
Packit e67170
# True iff FILE is a libtool `.la' library or `.lo' object file.
Packit e67170
# This function implements the same check as func_lalib_p without
Packit e67170
# resorting to external programs.  To this end, it redirects stdin and
Packit e67170
# closes it afterwards, without saving the original file descriptor.
Packit e67170
# As a safety measure, use it only where a negative result would be
Packit e67170
# fatal anyway.  Works if `file' does not exist.
Packit e67170
func_lalib_unsafe_p ()
Packit e67170
{
Packit e67170
    lalib_p=no
Packit e67170
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
Packit e67170
	for lalib_p_l in 1 2 3 4
Packit e67170
	do
Packit e67170
	    read lalib_p_line
Packit e67170
	    case "$lalib_p_line" in
Packit e67170
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
Packit e67170
	    esac
Packit e67170
	done
Packit e67170
	exec 0<&5 5<&-
Packit e67170
    fi
Packit e67170
    test "$lalib_p" = yes
Packit e67170
}
Packit e67170
Packit e67170
# func_ltwrapper_script_p file
Packit e67170
# True iff FILE is a libtool wrapper script
Packit e67170
# This function is only a basic sanity check; it will hardly flush out
Packit e67170
# determined imposters.
Packit e67170
func_ltwrapper_script_p ()
Packit e67170
{
Packit e67170
    func_lalib_p "$1"
Packit e67170
}
Packit e67170
Packit e67170
# func_ltwrapper_executable_p file
Packit e67170
# True iff FILE is a libtool wrapper executable
Packit e67170
# This function is only a basic sanity check; it will hardly flush out
Packit e67170
# determined imposters.
Packit e67170
func_ltwrapper_executable_p ()
Packit e67170
{
Packit e67170
    func_ltwrapper_exec_suffix=
Packit e67170
    case $1 in
Packit e67170
    *.exe) ;;
Packit e67170
    *) func_ltwrapper_exec_suffix=.exe ;;
Packit e67170
    esac
Packit e67170
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
Packit e67170
}
Packit e67170
Packit e67170
# func_ltwrapper_scriptname file
Packit e67170
# Assumes file is an ltwrapper_executable
Packit e67170
# uses $file to determine the appropriate filename for a
Packit e67170
# temporary ltwrapper_script.
Packit e67170
func_ltwrapper_scriptname ()
Packit e67170
{
Packit e67170
    func_dirname_and_basename "$1" "" "."
Packit e67170
    func_stripname '' '.exe' "$func_basename_result"
Packit e67170
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
Packit e67170
}
Packit e67170
Packit e67170
# func_ltwrapper_p file
Packit e67170
# True iff FILE is a libtool wrapper script or wrapper executable
Packit e67170
# This function is only a basic sanity check; it will hardly flush out
Packit e67170
# determined imposters.
Packit e67170
func_ltwrapper_p ()
Packit e67170
{
Packit e67170
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_execute_cmds commands fail_cmd
Packit e67170
# Execute tilde-delimited COMMANDS.
Packit e67170
# If FAIL_CMD is given, eval that upon failure.
Packit e67170
# FAIL_CMD may read-access the current command in variable CMD!
Packit e67170
func_execute_cmds ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    save_ifs=$IFS; IFS='~'
Packit e67170
    for cmd in $1; do
Packit e67170
      IFS=$save_ifs
Packit e67170
      eval cmd=\"$cmd\"
Packit e67170
      func_show_eval "$cmd" "${2-:}"
Packit e67170
    done
Packit e67170
    IFS=$save_ifs
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_source file
Packit e67170
# Source FILE, adding directory component if necessary.
Packit e67170
# Note that it is not necessary on cygwin/mingw to append a dot to
Packit e67170
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
Packit e67170
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
Packit e67170
# `FILE.' does not work on cygwin managed mounts.
Packit e67170
func_source ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    case $1 in
Packit e67170
    */* | *\\*)	. "$1" ;;
Packit e67170
    *)		. "./$1" ;;
Packit e67170
    esac
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_resolve_sysroot PATH
Packit e67170
# Replace a leading = in PATH with a sysroot.  Store the result into
Packit e67170
# func_resolve_sysroot_result
Packit e67170
func_resolve_sysroot ()
Packit e67170
{
Packit e67170
  func_resolve_sysroot_result=$1
Packit e67170
  case $func_resolve_sysroot_result in
Packit e67170
  =*)
Packit e67170
    func_stripname '=' '' "$func_resolve_sysroot_result"
Packit e67170
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
Packit e67170
# func_replace_sysroot PATH
Packit e67170
# If PATH begins with the sysroot, replace it with = and
Packit e67170
# store the result into func_replace_sysroot_result.
Packit e67170
func_replace_sysroot ()
Packit e67170
{
Packit e67170
  case "$lt_sysroot:$1" in
Packit e67170
  ?*:"$lt_sysroot"*)
Packit e67170
    func_stripname "$lt_sysroot" '' "$1"
Packit e67170
    func_replace_sysroot_result="=$func_stripname_result"
Packit e67170
    ;;
Packit e67170
  *)
Packit e67170
    # Including no sysroot.
Packit e67170
    func_replace_sysroot_result=$1
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
Packit e67170
# func_infer_tag arg
Packit e67170
# Infer tagged configuration to use if any are available and
Packit e67170
# if one wasn't chosen via the "--tag" command line option.
Packit e67170
# Only attempt this if the compiler in the base compile
Packit e67170
# command doesn't match the default compiler.
Packit e67170
# arg is usually of the form 'gcc ...'
Packit e67170
func_infer_tag ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    if test -n "$available_tags" && test -z "$tagname"; then
Packit e67170
      CC_quoted=
Packit e67170
      for arg in $CC; do
Packit e67170
	func_append_quoted CC_quoted "$arg"
Packit e67170
      done
Packit e67170
      CC_expanded=`func_echo_all $CC`
Packit e67170
      CC_quoted_expanded=`func_echo_all $CC_quoted`
Packit e67170
      case $@ in
Packit e67170
      # Blanks in the command may have been stripped by the calling shell,
Packit e67170
      # but not from the CC environment variable when configure was run.
Packit e67170
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
Packit e67170
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
Packit e67170
      # Blanks at the start of $base_compile will cause this to fail
Packit e67170
      # if we don't check for them as well.
Packit e67170
      *)
Packit e67170
	for z in $available_tags; do
Packit e67170
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
Packit e67170
	    # Evaluate the configuration.
Packit e67170
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
Packit e67170
	    CC_quoted=
Packit e67170
	    for arg in $CC; do
Packit e67170
	      # Double-quote args containing other shell metacharacters.
Packit e67170
	      func_append_quoted CC_quoted "$arg"
Packit e67170
	    done
Packit e67170
	    CC_expanded=`func_echo_all $CC`
Packit e67170
	    CC_quoted_expanded=`func_echo_all $CC_quoted`
Packit e67170
	    case "$@ " in
Packit e67170
	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
Packit e67170
	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
Packit e67170
	      # The compiler in the base compile command matches
Packit e67170
	      # the one in the tagged configuration.
Packit e67170
	      # Assume this is the tagged configuration we want.
Packit e67170
	      tagname=$z
Packit e67170
	      break
Packit e67170
	      ;;
Packit e67170
	    esac
Packit e67170
	  fi
Packit e67170
	done
Packit e67170
	# If $tagname still isn't set, then no tagged configuration
Packit e67170
	# was found and let the user know that the "--tag" command
Packit e67170
	# line option must be used.
Packit e67170
	if test -z "$tagname"; then
Packit e67170
	  func_echo "unable to infer tagged configuration"
Packit e67170
	  func_fatal_error "specify a tag with \`--tag'"
Packit e67170
#	else
Packit e67170
#	  func_verbose "using $tagname tagged configuration"
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
Packit e67170
# func_write_libtool_object output_name pic_name nonpic_name
Packit e67170
# Create a libtool object file (analogous to a ".la" file),
Packit e67170
# but don't create it if we're doing a dry run.
Packit e67170
func_write_libtool_object ()
Packit e67170
{
Packit e67170
    write_libobj=${1}
Packit e67170
    if test "$build_libtool_libs" = yes; then
Packit e67170
      write_lobj=\'${2}\'
Packit e67170
    else
Packit e67170
      write_lobj=none
Packit e67170
    fi
Packit e67170
Packit e67170
    if test "$build_old_libs" = yes; then
Packit e67170
      write_oldobj=\'${3}\'
Packit e67170
    else
Packit e67170
      write_oldobj=none
Packit e67170
    fi
Packit e67170
Packit e67170
    $opt_dry_run || {
Packit e67170
      cat >${write_libobj}T <
Packit e67170
# $write_libobj - a libtool object file
Packit e67170
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
Packit e67170
#
Packit e67170
# Please DO NOT delete this file!
Packit e67170
# It is necessary for linking the library.
Packit e67170
Packit e67170
# Name of the PIC object.
Packit e67170
pic_object=$write_lobj
Packit e67170
Packit e67170
# Name of the non-PIC object
Packit e67170
non_pic_object=$write_oldobj
Packit e67170
Packit e67170
EOF
Packit e67170
      $MV "${write_libobj}T" "${write_libobj}"
Packit e67170
    }
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
##################################################
Packit e67170
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
Packit e67170
##################################################
Packit e67170
Packit e67170
# func_convert_core_file_wine_to_w32 ARG
Packit e67170
# Helper function used by file name conversion functions when $build is *nix,
Packit e67170
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
Packit e67170
# correctly configured wine environment available, with the winepath program
Packit e67170
# in $build's $PATH.
Packit e67170
#
Packit e67170
# ARG is the $build file name to be converted to w32 format.
Packit e67170
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
Packit e67170
# be empty on error (or when ARG is empty)
Packit e67170
func_convert_core_file_wine_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_convert_core_file_wine_to_w32_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # Unfortunately, winepath does not exit with a non-zero error code, so we
Packit e67170
    # are forced to check the contents of stdout. On the other hand, if the
Packit e67170
    # command is not found, the shell will set an exit code of 127 and print
Packit e67170
    # *an error message* to stdout. So we must check for both error code of
Packit e67170
    # zero AND non-empty stdout, which explains the odd construction:
Packit e67170
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
Packit e67170
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
Packit e67170
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
Packit e67170
        $SED -e "$lt_sed_naive_backslashify"`
Packit e67170
    else
Packit e67170
      func_convert_core_file_wine_to_w32_result=
Packit e67170
    fi
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end: func_convert_core_file_wine_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_core_path_wine_to_w32 ARG
Packit e67170
# Helper function used by path conversion functions when $build is *nix, and
Packit e67170
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
Packit e67170
# configured wine environment available, with the winepath program in $build's
Packit e67170
# $PATH. Assumes ARG has no leading or trailing path separator characters.
Packit e67170
#
Packit e67170
# ARG is path to be converted from $build format to win32.
Packit e67170
# Result is available in $func_convert_core_path_wine_to_w32_result.
Packit e67170
# Unconvertible file (directory) names in ARG are skipped; if no directory names
Packit e67170
# are convertible, then the result may be empty.
Packit e67170
func_convert_core_path_wine_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  # unfortunately, winepath doesn't convert paths, only file names
Packit e67170
  func_convert_core_path_wine_to_w32_result=""
Packit e67170
  if test -n "$1"; then
Packit e67170
    oldIFS=$IFS
Packit e67170
    IFS=:
Packit e67170
    for func_convert_core_path_wine_to_w32_f in $1; do
Packit e67170
      IFS=$oldIFS
Packit e67170
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
Packit e67170
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
Packit e67170
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
Packit e67170
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
Packit e67170
        else
Packit e67170
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
Packit e67170
        fi
Packit e67170
      fi
Packit e67170
    done
Packit e67170
    IFS=$oldIFS
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end: func_convert_core_path_wine_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_cygpath ARGS...
Packit e67170
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
Packit e67170
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
Packit e67170
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
Packit e67170
# (2), returns the Cygwin file name or path in func_cygpath_result (input
Packit e67170
# file name or path is assumed to be in w32 format, as previously converted
Packit e67170
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
Packit e67170
# or path in func_cygpath_result (input file name or path is assumed to be in
Packit e67170
# Cygwin format). Returns an empty string on error.
Packit e67170
#
Packit e67170
# ARGS are passed to cygpath, with the last one being the file name or path to
Packit e67170
# be converted.
Packit e67170
#
Packit e67170
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
Packit e67170
# environment variable; do not put it in $PATH.
Packit e67170
func_cygpath ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
Packit e67170
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
Packit e67170
    if test "$?" -ne 0; then
Packit e67170
      # on failure, ensure result is empty
Packit e67170
      func_cygpath_result=
Packit e67170
    fi
Packit e67170
  else
Packit e67170
    func_cygpath_result=
Packit e67170
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
Packit e67170
  fi
Packit e67170
}
Packit e67170
#end: func_cygpath
Packit e67170
Packit e67170
Packit e67170
# func_convert_core_msys_to_w32 ARG
Packit e67170
# Convert file name or path ARG from MSYS format to w32 format.  Return
Packit e67170
# result in func_convert_core_msys_to_w32_result.
Packit e67170
func_convert_core_msys_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  # awkward: cmd appends spaces to result
Packit e67170
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
Packit e67170
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
Packit e67170
}
Packit e67170
#end: func_convert_core_msys_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_check ARG1 ARG2
Packit e67170
# Verify that ARG1 (a file name in $build format) was converted to $host
Packit e67170
# format in ARG2. Otherwise, emit an error message, but continue (resetting
Packit e67170
# func_to_host_file_result to ARG1).
Packit e67170
func_convert_file_check ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  if test -z "$2" && test -n "$1" ; then
Packit e67170
    func_error "Could not determine host file name corresponding to"
Packit e67170
    func_error "  \`$1'"
Packit e67170
    func_error "Continuing, but uninstalled executables may not work."
Packit e67170
    # Fallback:
Packit e67170
    func_to_host_file_result="$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_file_check
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
Packit e67170
# Verify that FROM_PATH (a path in $build format) was converted to $host
Packit e67170
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
Packit e67170
# func_to_host_file_result to a simplistic fallback value (see below).
Packit e67170
func_convert_path_check ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  if test -z "$4" && test -n "$3"; then
Packit e67170
    func_error "Could not determine the host path corresponding to"
Packit e67170
    func_error "  \`$3'"
Packit e67170
    func_error "Continuing, but uninstalled executables may not work."
Packit e67170
    # Fallback.  This is a deliberately simplistic "conversion" and
Packit e67170
    # should not be "improved".  See libtool.info.
Packit e67170
    if test "x$1" != "x$2"; then
Packit e67170
      lt_replace_pathsep_chars="s|$1|$2|g"
Packit e67170
      func_to_host_path_result=`echo "$3" |
Packit e67170
        $SED -e "$lt_replace_pathsep_chars"`
Packit e67170
    else
Packit e67170
      func_to_host_path_result="$3"
Packit e67170
    fi
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_check
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
Packit e67170
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
Packit e67170
# and appending REPL if ORIG matches BACKPAT.
Packit e67170
func_convert_path_front_back_pathsep ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  case $4 in
Packit e67170
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
  case $4 in
Packit e67170
  $2 ) func_append func_to_host_path_result "$3"
Packit e67170
    ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
# end func_convert_path_front_back_pathsep
Packit e67170
Packit e67170
Packit e67170
##################################################
Packit e67170
# $build to $host FILE NAME CONVERSION FUNCTIONS #
Packit e67170
##################################################
Packit e67170
# invoked via `$to_host_file_cmd ARG'
Packit e67170
#
Packit e67170
# In each case, ARG is the path to be converted from $build to $host format.
Packit e67170
# Result will be available in $func_to_host_file_result.
Packit e67170
Packit e67170
Packit e67170
# func_to_host_file ARG
Packit e67170
# Converts the file name ARG from $build format to $host format. Return result
Packit e67170
# in func_to_host_file_result.
Packit e67170
func_to_host_file ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  $to_host_file_cmd "$1"
Packit e67170
}
Packit e67170
# end func_to_host_file
Packit e67170
Packit e67170
Packit e67170
# func_to_tool_file ARG LAZY
Packit e67170
# converts the file name ARG from $build format to toolchain format. Return
Packit e67170
# result in func_to_tool_file_result.  If the conversion in use is listed
Packit e67170
# in (the comma separated) LAZY, no conversion takes place.
Packit e67170
func_to_tool_file ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  case ,$2, in
Packit e67170
    *,"$to_tool_file_cmd",*)
Packit e67170
      func_to_tool_file_result=$1
Packit e67170
      ;;
Packit e67170
    *)
Packit e67170
      $to_tool_file_cmd "$1"
Packit e67170
      func_to_tool_file_result=$func_to_host_file_result
Packit e67170
      ;;
Packit e67170
  esac
Packit e67170
}
Packit e67170
# end func_to_tool_file
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_noop ARG
Packit e67170
# Copy ARG to func_to_host_file_result.
Packit e67170
func_convert_file_noop ()
Packit e67170
{
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
}
Packit e67170
# end func_convert_file_noop
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_msys_to_w32 ARG
Packit e67170
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
Packit e67170
# conversion to w32 is not available inside the cwrapper.  Returns result in
Packit e67170
# func_to_host_file_result.
Packit e67170
func_convert_file_msys_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    func_convert_core_msys_to_w32 "$1"
Packit e67170
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
Packit e67170
  fi
Packit e67170
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit e67170
}
Packit e67170
# end func_convert_file_msys_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_cygwin_to_w32 ARG
Packit e67170
# Convert file name ARG from Cygwin to w32 format.  Returns result in
Packit e67170
# func_to_host_file_result.
Packit e67170
func_convert_file_cygwin_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
Packit e67170
    # LT_CYGPATH in this case.
Packit e67170
    func_to_host_file_result=`cygpath -m "$1"`
Packit e67170
  fi
Packit e67170
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit e67170
}
Packit e67170
# end func_convert_file_cygwin_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_nix_to_w32 ARG
Packit e67170
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
Packit e67170
# and a working winepath. Returns result in func_to_host_file_result.
Packit e67170
func_convert_file_nix_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    func_convert_core_file_wine_to_w32 "$1"
Packit e67170
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
Packit e67170
  fi
Packit e67170
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit e67170
}
Packit e67170
# end func_convert_file_nix_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_msys_to_cygwin ARG
Packit e67170
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
Packit e67170
# Returns result in func_to_host_file_result.
Packit e67170
func_convert_file_msys_to_cygwin ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    func_convert_core_msys_to_w32 "$1"
Packit e67170
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
Packit e67170
    func_to_host_file_result="$func_cygpath_result"
Packit e67170
  fi
Packit e67170
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit e67170
}
Packit e67170
# end func_convert_file_msys_to_cygwin
Packit e67170
Packit e67170
Packit e67170
# func_convert_file_nix_to_cygwin ARG
Packit e67170
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
Packit e67170
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
Packit e67170
# in func_to_host_file_result.
Packit e67170
func_convert_file_nix_to_cygwin ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_file_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
Packit e67170
    func_convert_core_file_wine_to_w32 "$1"
Packit e67170
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
Packit e67170
    func_to_host_file_result="$func_cygpath_result"
Packit e67170
  fi
Packit e67170
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit e67170
}
Packit e67170
# end func_convert_file_nix_to_cygwin
Packit e67170
Packit e67170
Packit e67170
#############################################
Packit e67170
# $build to $host PATH CONVERSION FUNCTIONS #
Packit e67170
#############################################
Packit e67170
# invoked via `$to_host_path_cmd ARG'
Packit e67170
#
Packit e67170
# In each case, ARG is the path to be converted from $build to $host format.
Packit e67170
# The result will be available in $func_to_host_path_result.
Packit e67170
#
Packit e67170
# Path separators are also converted from $build format to $host format.  If
Packit e67170
# ARG begins or ends with a path separator character, it is preserved (but
Packit e67170
# converted to $host format) on output.
Packit e67170
#
Packit e67170
# All path conversion functions are named using the following convention:
Packit e67170
#   file name conversion function    : func_convert_file_X_to_Y ()
Packit e67170
#   path conversion function         : func_convert_path_X_to_Y ()
Packit e67170
# where, for any given $build/$host combination the 'X_to_Y' value is the
Packit e67170
# same.  If conversion functions are added for new $build/$host combinations,
Packit e67170
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
Packit e67170
# will break.
Packit e67170
Packit e67170
Packit e67170
# func_init_to_host_path_cmd
Packit e67170
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
Packit e67170
# appropriate value, based on the value of $to_host_file_cmd.
Packit e67170
to_host_path_cmd=
Packit e67170
func_init_to_host_path_cmd ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  if test -z "$to_host_path_cmd"; then
Packit e67170
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
Packit e67170
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
Packit e67170
  fi
Packit e67170
}
Packit e67170
Packit e67170
Packit e67170
# func_to_host_path ARG
Packit e67170
# Converts the path ARG from $build format to $host format. Return result
Packit e67170
# in func_to_host_path_result.
Packit e67170
func_to_host_path ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_init_to_host_path_cmd
Packit e67170
  $to_host_path_cmd "$1"
Packit e67170
}
Packit e67170
# end func_to_host_path
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_noop ARG
Packit e67170
# Copy ARG to func_to_host_path_result.
Packit e67170
func_convert_path_noop ()
Packit e67170
{
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
}
Packit e67170
# end func_convert_path_noop
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_msys_to_w32 ARG
Packit e67170
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
Packit e67170
# conversion to w32 is not available inside the cwrapper.  Returns result in
Packit e67170
# func_to_host_path_result.
Packit e67170
func_convert_path_msys_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # Remove leading and trailing path separator characters from ARG.  MSYS
Packit e67170
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
Packit e67170
    # and winepath ignores them completely.
Packit e67170
    func_stripname : : "$1"
Packit e67170
    func_to_host_path_tmp1=$func_stripname_result
Packit e67170
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
Packit e67170
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
Packit e67170
    func_convert_path_check : ";" \
Packit e67170
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit e67170
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_msys_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_cygwin_to_w32 ARG
Packit e67170
# Convert path ARG from Cygwin to w32 format.  Returns result in
Packit e67170
# func_to_host_file_result.
Packit e67170
func_convert_path_cygwin_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # See func_convert_path_msys_to_w32:
Packit e67170
    func_stripname : : "$1"
Packit e67170
    func_to_host_path_tmp1=$func_stripname_result
Packit e67170
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
Packit e67170
    func_convert_path_check : ";" \
Packit e67170
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit e67170
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_cygwin_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_nix_to_w32 ARG
Packit e67170
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
Packit e67170
# a working winepath.  Returns result in func_to_host_file_result.
Packit e67170
func_convert_path_nix_to_w32 ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # See func_convert_path_msys_to_w32:
Packit e67170
    func_stripname : : "$1"
Packit e67170
    func_to_host_path_tmp1=$func_stripname_result
Packit e67170
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
Packit e67170
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
Packit e67170
    func_convert_path_check : ";" \
Packit e67170
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit e67170
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_nix_to_w32
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_msys_to_cygwin ARG
Packit e67170
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
Packit e67170
# Returns result in func_to_host_file_result.
Packit e67170
func_convert_path_msys_to_cygwin ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # See func_convert_path_msys_to_w32:
Packit e67170
    func_stripname : : "$1"
Packit e67170
    func_to_host_path_tmp1=$func_stripname_result
Packit e67170
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
Packit e67170
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
Packit e67170
    func_to_host_path_result="$func_cygpath_result"
Packit e67170
    func_convert_path_check : : \
Packit e67170
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit e67170
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_msys_to_cygwin
Packit e67170
Packit e67170
Packit e67170
# func_convert_path_nix_to_cygwin ARG
Packit e67170
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
Packit e67170
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
Packit e67170
# func_to_host_file_result.
Packit e67170
func_convert_path_nix_to_cygwin ()
Packit e67170
{
Packit e67170
  $opt_debug
Packit e67170
  func_to_host_path_result="$1"
Packit e67170
  if test -n "$1"; then
Packit e67170
    # Remove leading and trailing path separator characters from
Packit e67170
    # ARG. msys behavior is inconsistent here, cygpath turns them
Packit e67170
    # into '.;' and ';.', and winepath ignores them completely.
Packit e67170
    func_stripname : : "$1"
Packit e67170
    func_to_host_path_tmp1=$func_stripname_result
Packit e67170
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
Packit e67170
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
Packit e67170
    func_to_host_path_result="$func_cygpath_result"
Packit e67170
    func_convert_path_check : : \
Packit e67170
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit e67170
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
Packit e67170
  fi
Packit e67170
}
Packit e67170
# end func_convert_path_nix_to_cygwin
Packit e67170
Packit e67170
Packit e67170
# func_mode_compile arg...
Packit e67170
func_mode_compile ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    # Get the compilation command and the source file.
Packit e67170
    base_compile=
Packit e67170
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
Packit e67170
    suppress_opt=yes
Packit e67170
    suppress_output=
Packit e67170
    arg_mode=normal
Packit e67170
    libobj=
Packit e67170
    later=
Packit e67170
    pie_flag=
Packit e67170
Packit e67170
    for arg
Packit e67170
    do
Packit e67170
      case $arg_mode in
Packit e67170
      arg  )
Packit e67170
	# do not "continue".  Instead, add this to base_compile
Packit e67170
	lastarg="$arg"
Packit e67170
	arg_mode=normal
Packit e67170
	;;
Packit e67170
Packit e67170
      target )
Packit e67170
	libobj="$arg"
Packit e67170
	arg_mode=normal
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
Packit e67170
      normal )
Packit e67170
	# Accept any command-line options.
Packit e67170
	case $arg in
Packit e67170
	-o)
Packit e67170
	  test -n "$libobj" && \
Packit e67170
	    func_fatal_error "you cannot specify \`-o' more than once"
Packit e67170
	  arg_mode=target
Packit e67170
	  continue
Packit e67170
	  ;;
Packit e67170
Packit e67170
	-pie | -fpie | -fPIE)
Packit e67170
          func_append pie_flag " $arg"
Packit e67170
	  continue
Packit e67170
	  ;;
Packit e67170
Packit e67170
	-shared | -static | -prefer-pic | -prefer-non-pic)
Packit e67170
	  func_append later " $arg"
Packit e67170
	  continue
Packit e67170
	  ;;
Packit e67170
Packit e67170
	-no-suppress)
Packit e67170
	  suppress_opt=no
Packit e67170
	  continue
Packit e67170
	  ;;
Packit e67170
Packit e67170
	-Xcompiler)
Packit e67170
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
Packit e67170
	  continue      #  The current "srcfile" will either be retained or
Packit e67170
	  ;;            #  replaced later.  I would guess that would be a bug.
Packit e67170
Packit e67170
	-Wc,*)
Packit e67170
	  func_stripname '-Wc,' '' "$arg"
Packit e67170
	  args=$func_stripname_result
Packit e67170
	  lastarg=
Packit e67170
	  save_ifs="$IFS"; IFS=','
Packit e67170
	  for arg in $args; do
Packit e67170
	    IFS="$save_ifs"
Packit e67170
	    func_append_quoted lastarg "$arg"
Packit e67170
	  done
Packit e67170
	  IFS="$save_ifs"
Packit e67170
	  func_stripname ' ' '' "$lastarg"
Packit e67170
	  lastarg=$func_stripname_result
Packit e67170
Packit e67170
	  # Add the arguments to base_compile.
Packit e67170
	  func_append base_compile " $lastarg"
Packit e67170
	  continue
Packit e67170
	  ;;
Packit e67170
Packit e67170
	*)
Packit e67170
	  # Accept the current argument as the source file.
Packit e67170
	  # The previous "srcfile" becomes the current argument.
Packit e67170
	  #
Packit e67170
	  lastarg="$srcfile"
Packit e67170
	  srcfile="$arg"
Packit e67170
	  ;;
Packit e67170
	esac  #  case $arg
Packit e67170
	;;
Packit e67170
      esac    #  case $arg_mode
Packit e67170
Packit e67170
      # Aesthetically quote the previous argument.
Packit e67170
      func_append_quoted base_compile "$lastarg"
Packit e67170
    done # for arg
Packit e67170
Packit e67170
    case $arg_mode in
Packit e67170
    arg)
Packit e67170
      func_fatal_error "you must specify an argument for -Xcompile"
Packit e67170
      ;;
Packit e67170
    target)
Packit e67170
      func_fatal_error "you must specify a target with \`-o'"
Packit e67170
      ;;
Packit e67170
    *)
Packit e67170
      # Get the name of the library object.
Packit e67170
      test -z "$libobj" && {
Packit e67170
	func_basename "$srcfile"
Packit e67170
	libobj="$func_basename_result"
Packit e67170
      }
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    # Recognize several different file suffixes.
Packit e67170
    # If the user specifies -o file.o, it is replaced with file.lo
Packit e67170
    case $libobj in
Packit e67170
    *.[cCFSifmso] | \
Packit e67170
    *.ada | *.adb | *.ads | *.asm | \
Packit e67170
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
Packit e67170
    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
Packit e67170
      func_xform "$libobj"
Packit e67170
      libobj=$func_xform_result
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    case $libobj in
Packit e67170
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
Packit e67170
    *)
Packit e67170
      func_fatal_error "cannot determine name of library object from \`$libobj'"
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    func_infer_tag $base_compile
Packit e67170
Packit e67170
    for arg in $later; do
Packit e67170
      case $arg in
Packit e67170
      -shared)
Packit e67170
	test "$build_libtool_libs" != yes && \
Packit e67170
	  func_fatal_configuration "can not build a shared library"
Packit e67170
	build_old_libs=no
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
Packit e67170
      -static)
Packit e67170
	build_libtool_libs=no
Packit e67170
	build_old_libs=yes
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
Packit e67170
      -prefer-pic)
Packit e67170
	pic_mode=yes
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
Packit e67170
      -prefer-non-pic)
Packit e67170
	pic_mode=no
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
    done
Packit e67170
Packit e67170
    func_quote_for_eval "$libobj"
Packit e67170
    test "X$libobj" != "X$func_quote_for_eval_result" \
Packit e67170
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
Packit e67170
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
Packit e67170
    func_dirname_and_basename "$obj" "/" ""
Packit e67170
    objname="$func_basename_result"
Packit e67170
    xdir="$func_dirname_result"
Packit e67170
    lobj=${xdir}$objdir/$objname
Packit e67170
Packit e67170
    test -z "$base_compile" && \
Packit e67170
      func_fatal_help "you must specify a compilation command"
Packit e67170
Packit e67170
    # Delete any leftover library objects.
Packit e67170
    if test "$build_old_libs" = yes; then
Packit e67170
      removelist="$obj $lobj $libobj ${libobj}T"
Packit e67170
    else
Packit e67170
      removelist="$lobj $libobj ${libobj}T"
Packit e67170
    fi
Packit e67170
Packit e67170
    # On Cygwin there's no "real" PIC flag so we must build both object types
Packit e67170
    case $host_os in
Packit e67170
    cygwin* | mingw* | pw32* | os2* | cegcc*)
Packit e67170
      pic_mode=default
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
Packit e67170
      # non-PIC code in shared libraries is not supported
Packit e67170
      pic_mode=default
Packit e67170
    fi
Packit e67170
Packit e67170
    # Calculate the filename of the output object if compiler does
Packit e67170
    # not support -o with -c
Packit e67170
    if test "$compiler_c_o" = no; then
Packit e67170
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
Packit e67170
      lockfile="$output_obj.lock"
Packit e67170
    else
Packit e67170
      output_obj=
Packit e67170
      need_locks=no
Packit e67170
      lockfile=
Packit e67170
    fi
Packit e67170
Packit e67170
    # Lock this critical section if it is needed
Packit e67170
    # We use this script file to make the link, it avoids creating a new file
Packit e67170
    if test "$need_locks" = yes; then
Packit e67170
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
Packit e67170
	func_echo "Waiting for $lockfile to be removed"
Packit e67170
	sleep 2
Packit e67170
      done
Packit e67170
    elif test "$need_locks" = warn; then
Packit e67170
      if test -f "$lockfile"; then
Packit e67170
	$ECHO "\
Packit e67170
*** ERROR, $lockfile exists and contains:
Packit e67170
`cat $lockfile 2>/dev/null`
Packit e67170
Packit e67170
This indicates that another process is trying to use the same
Packit e67170
temporary object file, and libtool could not work around it because
Packit e67170
your compiler does not support \`-c' and \`-o' together.  If you
Packit e67170
repeat this compilation, it may succeed, by chance, but you had better
Packit e67170
avoid parallel builds (make -j) in this platform, or get a better
Packit e67170
compiler."
Packit e67170
Packit e67170
	$opt_dry_run || $RM $removelist
Packit e67170
	exit $EXIT_FAILURE
Packit e67170
      fi
Packit e67170
      func_append removelist " $output_obj"
Packit e67170
      $ECHO "$srcfile" > "$lockfile"
Packit e67170
    fi
Packit e67170
Packit e67170
    $opt_dry_run || $RM $removelist
Packit e67170
    func_append removelist " $lockfile"
Packit e67170
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
Packit e67170
Packit e67170
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
Packit e67170
    srcfile=$func_to_tool_file_result
Packit e67170
    func_quote_for_eval "$srcfile"
Packit e67170
    qsrcfile=$func_quote_for_eval_result
Packit e67170
Packit e67170
    # Only build a PIC object if we are building libtool libraries.
Packit e67170
    if test "$build_libtool_libs" = yes; then
Packit e67170
      # Without this assignment, base_compile gets emptied.
Packit e67170
      fbsd_hideous_sh_bug=$base_compile
Packit e67170
Packit e67170
      if test "$pic_mode" != no; then
Packit e67170
	command="$base_compile $qsrcfile $pic_flag"
Packit e67170
      else
Packit e67170
	# Don't build PIC code
Packit e67170
	command="$base_compile $qsrcfile"
Packit e67170
      fi
Packit e67170
Packit e67170
      func_mkdir_p "$xdir$objdir"
Packit e67170
Packit e67170
      if test -z "$output_obj"; then
Packit e67170
	# Place PIC objects in $objdir
Packit e67170
	func_append command " -o $lobj"
Packit e67170
      fi
Packit e67170
Packit e67170
      func_show_eval_locale "$command"	\
Packit e67170
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
Packit e67170
Packit e67170
      if test "$need_locks" = warn &&
Packit e67170
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit e67170
	$ECHO "\
Packit e67170
*** ERROR, $lockfile contains:
Packit e67170
`cat $lockfile 2>/dev/null`
Packit e67170
Packit e67170
but it should contain:
Packit e67170
$srcfile
Packit e67170
Packit e67170
This indicates that another process is trying to use the same
Packit e67170
temporary object file, and libtool could not work around it because
Packit e67170
your compiler does not support \`-c' and \`-o' together.  If you
Packit e67170
repeat this compilation, it may succeed, by chance, but you had better
Packit e67170
avoid parallel builds (make -j) in this platform, or get a better
Packit e67170
compiler."
Packit e67170
Packit e67170
	$opt_dry_run || $RM $removelist
Packit e67170
	exit $EXIT_FAILURE
Packit e67170
      fi
Packit e67170
Packit e67170
      # Just move the object if needed, then go on to compile the next one
Packit e67170
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
Packit e67170
	func_show_eval '$MV "$output_obj" "$lobj"' \
Packit e67170
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
Packit e67170
      fi
Packit e67170
Packit e67170
      # Allow error messages only from the first compilation.
Packit e67170
      if test "$suppress_opt" = yes; then
Packit e67170
	suppress_output=' >/dev/null 2>&1'
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    # Only build a position-dependent object if we build old libraries.
Packit e67170
    if test "$build_old_libs" = yes; then
Packit e67170
      if test "$pic_mode" != yes; then
Packit e67170
	# Don't build PIC code
Packit e67170
	command="$base_compile $qsrcfile$pie_flag"
Packit e67170
      else
Packit e67170
	command="$base_compile $qsrcfile $pic_flag"
Packit e67170
      fi
Packit e67170
      if test "$compiler_c_o" = yes; then
Packit e67170
	func_append command " -o $obj"
Packit e67170
      fi
Packit e67170
Packit e67170
      # Suppress compiler output if we already did a PIC compilation.
Packit e67170
      func_append command "$suppress_output"
Packit e67170
      func_show_eval_locale "$command" \
Packit e67170
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
Packit e67170
Packit e67170
      if test "$need_locks" = warn &&
Packit e67170
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
Packit e67170
	$ECHO "\
Packit e67170
*** ERROR, $lockfile contains:
Packit e67170
`cat $lockfile 2>/dev/null`
Packit e67170
Packit e67170
but it should contain:
Packit e67170
$srcfile
Packit e67170
Packit e67170
This indicates that another process is trying to use the same
Packit e67170
temporary object file, and libtool could not work around it because
Packit e67170
your compiler does not support \`-c' and \`-o' together.  If you
Packit e67170
repeat this compilation, it may succeed, by chance, but you had better
Packit e67170
avoid parallel builds (make -j) in this platform, or get a better
Packit e67170
compiler."
Packit e67170
Packit e67170
	$opt_dry_run || $RM $removelist
Packit e67170
	exit $EXIT_FAILURE
Packit e67170
      fi
Packit e67170
Packit e67170
      # Just move the object if needed
Packit e67170
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
Packit e67170
	func_show_eval '$MV "$output_obj" "$obj"' \
Packit e67170
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    $opt_dry_run || {
Packit e67170
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
Packit e67170
Packit e67170
      # Unlock the critical section if it was locked
Packit e67170
      if test "$need_locks" != no; then
Packit e67170
	removelist=$lockfile
Packit e67170
        $RM "$lockfile"
Packit e67170
      fi
Packit e67170
    }
Packit e67170
Packit e67170
    exit $EXIT_SUCCESS
Packit e67170
}
Packit e67170
Packit e67170
$opt_help || {
Packit e67170
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
Packit e67170
}
Packit e67170
Packit e67170
func_mode_help ()
Packit e67170
{
Packit e67170
    # We need to display help for each of the modes.
Packit e67170
    case $opt_mode in
Packit e67170
      "")
Packit e67170
        # Generic help is extracted from the usage comments
Packit e67170
        # at the start of this file.
Packit e67170
        func_help
Packit e67170
        ;;
Packit e67170
Packit e67170
      clean)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Packit e67170
Packit e67170
Remove files from the build directory.
Packit e67170
Packit e67170
RM is the name of the program to use to delete files associated with each FILE
Packit e67170
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Packit e67170
to RM.
Packit e67170
Packit e67170
If FILE is a libtool library, object or program, all the files associated
Packit e67170
with it are deleted. Otherwise, only FILE itself is deleted using RM."
Packit e67170
        ;;
Packit e67170
Packit e67170
      compile)
Packit e67170
      $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Packit e67170
Packit e67170
Compile a source file into a libtool library object.
Packit e67170
Packit e67170
This mode accepts the following additional options:
Packit e67170
Packit e67170
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
Packit e67170
  -no-suppress      do not suppress compiler output for multiple passes
Packit e67170
  -prefer-pic       try to build PIC objects only
Packit e67170
  -prefer-non-pic   try to build non-PIC objects only
Packit e67170
  -shared           do not build a \`.o' file suitable for static linking
Packit e67170
  -static           only build a \`.o' file suitable for static linking
Packit e67170
  -Wc,FLAG          pass FLAG directly to the compiler
Packit e67170
Packit e67170
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
Packit e67170
from the given SOURCEFILE.
Packit e67170
Packit e67170
The output file name is determined by removing the directory component from
Packit e67170
SOURCEFILE, then substituting the C source code suffix \`.c' with the
Packit e67170
library object suffix, \`.lo'."
Packit e67170
        ;;
Packit e67170
Packit e67170
      execute)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
Packit e67170
Packit e67170
Automatically set library path, then run a program.
Packit e67170
Packit e67170
This mode accepts the following additional options:
Packit e67170
Packit e67170
  -dlopen FILE      add the directory containing FILE to the library path
Packit e67170
Packit e67170
This mode sets the library path environment variable according to \`-dlopen'
Packit e67170
flags.
Packit e67170
Packit e67170
If any of the ARGS are libtool executable wrappers, then they are translated
Packit e67170
into their corresponding uninstalled binary, and any of their required library
Packit e67170
directories are added to the library path.
Packit e67170
Packit e67170
Then, COMMAND is executed, with ARGS as arguments."
Packit e67170
        ;;
Packit e67170
Packit e67170
      finish)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
Packit e67170
Packit e67170
Complete the installation of libtool libraries.
Packit e67170
Packit e67170
Each LIBDIR is a directory that contains libtool libraries.
Packit e67170
Packit e67170
The commands that this mode executes may require superuser privileges.  Use
Packit e67170
the \`--dry-run' option if you just want to see what would be executed."
Packit e67170
        ;;
Packit e67170
Packit e67170
      install)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
Packit e67170
Packit e67170
Install executables or libraries.
Packit e67170
Packit e67170
INSTALL-COMMAND is the installation command.  The first component should be
Packit e67170
either the \`install' or \`cp' program.
Packit e67170
Packit e67170
The following components of INSTALL-COMMAND are treated specially:
Packit e67170
Packit e67170
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
Packit e67170
Packit e67170
The rest of the components are interpreted as arguments to that command (only
Packit e67170
BSD-compatible install options are recognized)."
Packit e67170
        ;;
Packit e67170
Packit e67170
      link)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
Packit e67170
Packit e67170
Link object files or libraries together to form another library, or to
Packit e67170
create an executable program.
Packit e67170
Packit e67170
LINK-COMMAND is a command using the C compiler that you would use to create
Packit e67170
a program from several object files.
Packit e67170
Packit e67170
The following components of LINK-COMMAND are treated specially:
Packit e67170
Packit e67170
  -all-static       do not do any dynamic linking at all
Packit e67170
  -avoid-version    do not add a version suffix if possible
Packit e67170
  -bindir BINDIR    specify path to binaries directory (for systems where
Packit e67170
                    libraries must be found in the PATH setting at runtime)
Packit e67170
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
Packit e67170
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
Packit e67170
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
Packit e67170
  -export-symbols SYMFILE
Packit e67170
                    try to export only the symbols listed in SYMFILE
Packit e67170
  -export-symbols-regex REGEX
Packit e67170
                    try to export only the symbols matching REGEX
Packit e67170
  -LLIBDIR          search LIBDIR for required installed libraries
Packit e67170
  -lNAME            OUTPUT-FILE requires the installed library libNAME
Packit e67170
  -module           build a library that can dlopened
Packit e67170
  -no-fast-install  disable the fast-install mode
Packit e67170
  -no-install       link a not-installable executable
Packit e67170
  -no-undefined     declare that a library does not refer to external symbols
Packit e67170
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
Packit e67170
  -objectlist FILE  Use a list of object files found in FILE to specify objects
Packit e67170
  -precious-files-regex REGEX
Packit e67170
                    don't remove output files matching REGEX
Packit e67170
  -release RELEASE  specify package release information
Packit e67170
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
Packit e67170
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
Packit e67170
  -shared           only do dynamic linking of libtool libraries
Packit e67170
  -shrext SUFFIX    override the standard shared library file extension
Packit e67170
  -static           do not do any dynamic linking of uninstalled libtool libraries
Packit e67170
  -static-libtool-libs
Packit e67170
                    do not do any dynamic linking of libtool libraries
Packit e67170
  -version-info CURRENT[:REVISION[:AGE]]
Packit e67170
                    specify library version info [each variable defaults to 0]
Packit e67170
  -weak LIBNAME     declare that the target provides the LIBNAME interface
Packit e67170
  -Wc,FLAG
Packit e67170
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
Packit e67170
  -Wl,FLAG
Packit e67170
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
Packit e67170
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
Packit e67170
Packit e67170
All other options (arguments beginning with \`-') are ignored.
Packit e67170
Packit e67170
Every other argument is treated as a filename.  Files ending in \`.la' are
Packit e67170
treated as uninstalled libtool libraries, other files are standard or library
Packit e67170
object files.
Packit e67170
Packit e67170
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
Packit e67170
only library objects (\`.lo' files) may be specified, and \`-rpath' is
Packit e67170
required, except when creating a convenience library.
Packit e67170
Packit e67170
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
Packit e67170
using \`ar' and \`ranlib', or on Windows using \`lib'.
Packit e67170
Packit e67170
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
Packit e67170
is created, otherwise an executable program is created."
Packit e67170
        ;;
Packit e67170
Packit e67170
      uninstall)
Packit e67170
        $ECHO \
Packit e67170
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Packit e67170
Packit e67170
Remove libraries from an installation directory.
Packit e67170
Packit e67170
RM is the name of the program to use to delete files associated with each FILE
Packit e67170
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
Packit e67170
to RM.
Packit e67170
Packit e67170
If FILE is a libtool library, all the files associated with it are deleted.
Packit e67170
Otherwise, only FILE itself is deleted using RM."
Packit e67170
        ;;
Packit e67170
Packit e67170
      *)
Packit e67170
        func_fatal_help "invalid operation mode \`$opt_mode'"
Packit e67170
        ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    echo
Packit e67170
    $ECHO "Try \`$progname --help' for more information about other modes."
Packit e67170
}
Packit e67170
Packit e67170
# Now that we've collected a possible --mode arg, show help if necessary
Packit e67170
if $opt_help; then
Packit e67170
  if test "$opt_help" = :; then
Packit e67170
    func_mode_help
Packit e67170
  else
Packit e67170
    {
Packit e67170
      func_help noexit
Packit e67170
      for opt_mode in compile link execute install finish uninstall clean; do
Packit e67170
	func_mode_help
Packit e67170
      done
Packit e67170
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
Packit e67170
    {
Packit e67170
      func_help noexit
Packit e67170
      for opt_mode in compile link execute install finish uninstall clean; do
Packit e67170
	echo
Packit e67170
	func_mode_help
Packit e67170
      done
Packit e67170
    } |
Packit e67170
    sed '1d
Packit e67170
      /^When reporting/,/^Report/{
Packit e67170
	H
Packit e67170
	d
Packit e67170
      }
Packit e67170
      $x
Packit e67170
      /information about other modes/d
Packit e67170
      /more detailed .*MODE/d
Packit e67170
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
Packit e67170
  fi
Packit e67170
  exit $?
Packit e67170
fi
Packit e67170
Packit e67170
Packit e67170
# func_mode_execute arg...
Packit e67170
func_mode_execute ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    # The first argument is the command name.
Packit e67170
    cmd="$nonopt"
Packit e67170
    test -z "$cmd" && \
Packit e67170
      func_fatal_help "you must specify a COMMAND"
Packit e67170
Packit e67170
    # Handle -dlopen flags immediately.
Packit e67170
    for file in $opt_dlopen; do
Packit e67170
      test -f "$file" \
Packit e67170
	|| func_fatal_help "\`$file' is not a file"
Packit e67170
Packit e67170
      dir=
Packit e67170
      case $file in
Packit e67170
      *.la)
Packit e67170
	func_resolve_sysroot "$file"
Packit e67170
	file=$func_resolve_sysroot_result
Packit e67170
Packit e67170
	# Check to see that this really is a libtool archive.
Packit e67170
	func_lalib_unsafe_p "$file" \
Packit e67170
	  || func_fatal_help "\`$lib' is not a valid libtool archive"
Packit e67170
Packit e67170
	# Read the libtool library.
Packit e67170
	dlname=
Packit e67170
	library_names=
Packit e67170
	func_source "$file"
Packit e67170
Packit e67170
	# Skip this library if it cannot be dlopened.
Packit e67170
	if test -z "$dlname"; then
Packit e67170
	  # Warn if it was a shared library.
Packit e67170
	  test -n "$library_names" && \
Packit e67170
	    func_warning "\`$file' was not linked with \`-export-dynamic'"
Packit e67170
	  continue
Packit e67170
	fi
Packit e67170
Packit e67170
	func_dirname "$file" "" "."
Packit e67170
	dir="$func_dirname_result"
Packit e67170
Packit e67170
	if test -f "$dir/$objdir/$dlname"; then
Packit e67170
	  func_append dir "/$objdir"
Packit e67170
	else
Packit e67170
	  if test ! -f "$dir/$dlname"; then
Packit e67170
	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
Packit e67170
	  fi
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
Packit e67170
      *.lo)
Packit e67170
	# Just add the directory containing the .lo file.
Packit e67170
	func_dirname "$file" "" "."
Packit e67170
	dir="$func_dirname_result"
Packit e67170
	;;
Packit e67170
Packit e67170
      *)
Packit e67170
	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
Packit e67170
      # Get the absolute pathname.
Packit e67170
      absdir=`cd "$dir" && pwd`
Packit e67170
      test -n "$absdir" && dir="$absdir"
Packit e67170
Packit e67170
      # Now add the directory to shlibpath_var.
Packit e67170
      if eval "test -z \"\$$shlibpath_var\""; then
Packit e67170
	eval "$shlibpath_var=\"\$dir\""
Packit e67170
      else
Packit e67170
	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
Packit e67170
      fi
Packit e67170
    done
Packit e67170
Packit e67170
    # This variable tells wrapper scripts just to set shlibpath_var
Packit e67170
    # rather than running their programs.
Packit e67170
    libtool_execute_magic="$magic"
Packit e67170
Packit e67170
    # Check if any of the arguments is a wrapper script.
Packit e67170
    args=
Packit e67170
    for file
Packit e67170
    do
Packit e67170
      case $file in
Packit e67170
      -* | *.la | *.lo ) ;;
Packit e67170
      *)
Packit e67170
	# Do a test to see if this is really a libtool program.
Packit e67170
	if func_ltwrapper_script_p "$file"; then
Packit e67170
	  func_source "$file"
Packit e67170
	  # Transform arg to wrapped name.
Packit e67170
	  file="$progdir/$program"
Packit e67170
	elif func_ltwrapper_executable_p "$file"; then
Packit e67170
	  func_ltwrapper_scriptname "$file"
Packit e67170
	  func_source "$func_ltwrapper_scriptname_result"
Packit e67170
	  # Transform arg to wrapped name.
Packit e67170
	  file="$progdir/$program"
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
      # Quote arguments (to preserve shell metacharacters).
Packit e67170
      func_append_quoted args "$file"
Packit e67170
    done
Packit e67170
Packit e67170
    if test "X$opt_dry_run" = Xfalse; then
Packit e67170
      if test -n "$shlibpath_var"; then
Packit e67170
	# Export the shlibpath_var.
Packit e67170
	eval "export $shlibpath_var"
Packit e67170
      fi
Packit e67170
Packit e67170
      # Restore saved environment variables
Packit e67170
      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit e67170
      do
Packit e67170
	eval "if test \"\${save_$lt_var+set}\" = set; then
Packit e67170
                $lt_var=\$save_$lt_var; export $lt_var
Packit e67170
	      else
Packit e67170
		$lt_unset $lt_var
Packit e67170
	      fi"
Packit e67170
      done
Packit e67170
Packit e67170
      # Now prepare to actually exec the command.
Packit e67170
      exec_cmd="\$cmd$args"
Packit e67170
    else
Packit e67170
      # Display what would be done.
Packit e67170
      if test -n "$shlibpath_var"; then
Packit e67170
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
Packit e67170
	echo "export $shlibpath_var"
Packit e67170
      fi
Packit e67170
      $ECHO "$cmd$args"
Packit e67170
      exit $EXIT_SUCCESS
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
Packit e67170
Packit e67170
Packit e67170
# func_mode_finish arg...
Packit e67170
func_mode_finish ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    libs=
Packit e67170
    libdirs=
Packit e67170
    admincmds=
Packit e67170
Packit e67170
    for opt in "$nonopt" ${1+"$@"}
Packit e67170
    do
Packit e67170
      if test -d "$opt"; then
Packit e67170
	func_append libdirs " $opt"
Packit e67170
Packit e67170
      elif test -f "$opt"; then
Packit e67170
	if func_lalib_unsafe_p "$opt"; then
Packit e67170
	  func_append libs " $opt"
Packit e67170
	else
Packit e67170
	  func_warning "\`$opt' is not a valid libtool archive"
Packit e67170
	fi
Packit e67170
Packit e67170
      else
Packit e67170
	func_fatal_error "invalid argument \`$opt'"
Packit e67170
      fi
Packit e67170
    done
Packit e67170
Packit e67170
    if test -n "$libs"; then
Packit e67170
      if test -n "$lt_sysroot"; then
Packit e67170
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
Packit e67170
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
Packit e67170
      else
Packit e67170
        sysroot_cmd=
Packit e67170
      fi
Packit e67170
Packit e67170
      # Remove sysroot references
Packit e67170
      if $opt_dry_run; then
Packit e67170
        for lib in $libs; do
Packit e67170
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
Packit e67170
        done
Packit e67170
      else
Packit e67170
        tmpdir=`func_mktempdir`
Packit e67170
        for lib in $libs; do
Packit e67170
	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
Packit e67170
	    > $tmpdir/tmp-la
Packit e67170
	  mv -f $tmpdir/tmp-la $lib
Packit e67170
	done
Packit e67170
        ${RM}r "$tmpdir"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
Packit e67170
      for libdir in $libdirs; do
Packit e67170
	if test -n "$finish_cmds"; then
Packit e67170
	  # Do each command in the finish commands.
Packit e67170
	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
Packit e67170
'"$cmd"'"'
Packit e67170
	fi
Packit e67170
	if test -n "$finish_eval"; then
Packit e67170
	  # Do the single finish_eval.
Packit e67170
	  eval cmds=\"$finish_eval\"
Packit e67170
	  $opt_dry_run || eval "$cmds" || func_append admincmds "
Packit e67170
       $cmds"
Packit e67170
	fi
Packit e67170
      done
Packit e67170
    fi
Packit e67170
Packit e67170
    # Exit here if they wanted silent mode.
Packit e67170
    $opt_silent && exit $EXIT_SUCCESS
Packit e67170
Packit e67170
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
Packit e67170
      echo "----------------------------------------------------------------------"
Packit e67170
      echo "Libraries have been installed in:"
Packit e67170
      for libdir in $libdirs; do
Packit e67170
	$ECHO "   $libdir"
Packit e67170
      done
Packit e67170
      echo
Packit e67170
      echo "If you ever happen to want to link against installed libraries"
Packit e67170
      echo "in a given directory, LIBDIR, you must either use libtool, and"
Packit e67170
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
Packit e67170
      echo "flag during linking and do at least one of the following:"
Packit e67170
      if test -n "$shlibpath_var"; then
Packit e67170
	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
Packit e67170
	echo "     during execution"
Packit e67170
      fi
Packit e67170
      if test -n "$runpath_var"; then
Packit e67170
	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
Packit e67170
	echo "     during linking"
Packit e67170
      fi
Packit e67170
      if test -n "$hardcode_libdir_flag_spec"; then
Packit e67170
	libdir=LIBDIR
Packit e67170
	eval flag=\"$hardcode_libdir_flag_spec\"
Packit e67170
Packit e67170
	$ECHO "   - use the \`$flag' linker flag"
Packit e67170
      fi
Packit e67170
      if test -n "$admincmds"; then
Packit e67170
	$ECHO "   - have your system administrator run these commands:$admincmds"
Packit e67170
      fi
Packit e67170
      if test -f /etc/ld.so.conf; then
Packit e67170
	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
Packit e67170
      fi
Packit e67170
      echo
Packit e67170
Packit e67170
      echo "See any operating system documentation about shared libraries for"
Packit e67170
      case $host in
Packit e67170
	solaris2.[6789]|solaris2.1[0-9])
Packit e67170
	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
Packit e67170
	  echo "pages."
Packit e67170
	  ;;
Packit e67170
	*)
Packit e67170
	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
Packit e67170
	  ;;
Packit e67170
      esac
Packit e67170
      echo "----------------------------------------------------------------------"
Packit e67170
    fi
Packit e67170
    exit $EXIT_SUCCESS
Packit e67170
}
Packit e67170
Packit e67170
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
Packit e67170
Packit e67170
Packit e67170
# func_mode_install arg...
Packit e67170
func_mode_install ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    # There may be an optional sh(1) argument at the beginning of
Packit e67170
    # install_prog (especially on Windows NT).
Packit e67170
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
Packit e67170
       # Allow the use of GNU shtool's install command.
Packit e67170
       case $nonopt in *shtool*) :;; *) false;; esac; then
Packit e67170
      # Aesthetically quote it.
Packit e67170
      func_quote_for_eval "$nonopt"
Packit e67170
      install_prog="$func_quote_for_eval_result "
Packit e67170
      arg=$1
Packit e67170
      shift
Packit e67170
    else
Packit e67170
      install_prog=
Packit e67170
      arg=$nonopt
Packit e67170
    fi
Packit e67170
Packit e67170
    # The real first argument should be the name of the installation program.
Packit e67170
    # Aesthetically quote it.
Packit e67170
    func_quote_for_eval "$arg"
Packit e67170
    func_append install_prog "$func_quote_for_eval_result"
Packit e67170
    install_shared_prog=$install_prog
Packit e67170
    case " $install_prog " in
Packit e67170
      *[\\\ /]cp\ *) install_cp=: ;;
Packit e67170
      *) install_cp=false ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    # We need to accept at least all the BSD install flags.
Packit e67170
    dest=
Packit e67170
    files=
Packit e67170
    opts=
Packit e67170
    prev=
Packit e67170
    install_type=
Packit e67170
    isdir=no
Packit e67170
    stripme=
Packit e67170
    no_mode=:
Packit e67170
    for arg
Packit e67170
    do
Packit e67170
      arg2=
Packit e67170
      if test -n "$dest"; then
Packit e67170
	func_append files " $dest"
Packit e67170
	dest=$arg
Packit e67170
	continue
Packit e67170
      fi
Packit e67170
Packit e67170
      case $arg in
Packit e67170
      -d) isdir=yes ;;
Packit e67170
      -f)
Packit e67170
	if $install_cp; then :; else
Packit e67170
	  prev=$arg
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
      -g | -m | -o)
Packit e67170
	prev=$arg
Packit e67170
	;;
Packit e67170
      -s)
Packit e67170
	stripme=" -s"
Packit e67170
	continue
Packit e67170
	;;
Packit e67170
      -*)
Packit e67170
	;;
Packit e67170
      *)
Packit e67170
	# If the previous option needed an argument, then skip it.
Packit e67170
	if test -n "$prev"; then
Packit e67170
	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
Packit e67170
	    arg2=$install_override_mode
Packit e67170
	    no_mode=false
Packit e67170
	  fi
Packit e67170
	  prev=
Packit e67170
	else
Packit e67170
	  dest=$arg
Packit e67170
	  continue
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
Packit e67170
      # Aesthetically quote the argument.
Packit e67170
      func_quote_for_eval "$arg"
Packit e67170
      func_append install_prog " $func_quote_for_eval_result"
Packit e67170
      if test -n "$arg2"; then
Packit e67170
	func_quote_for_eval "$arg2"
Packit e67170
      fi
Packit e67170
      func_append install_shared_prog " $func_quote_for_eval_result"
Packit e67170
    done
Packit e67170
Packit e67170
    test -z "$install_prog" && \
Packit e67170
      func_fatal_help "you must specify an install program"
Packit e67170
Packit e67170
    test -n "$prev" && \
Packit e67170
      func_fatal_help "the \`$prev' option requires an argument"
Packit e67170
Packit e67170
    if test -n "$install_override_mode" && $no_mode; then
Packit e67170
      if $install_cp; then :; else
Packit e67170
	func_quote_for_eval "$install_override_mode"
Packit e67170
	func_append install_shared_prog " -m $func_quote_for_eval_result"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    if test -z "$files"; then
Packit e67170
      if test -z "$dest"; then
Packit e67170
	func_fatal_help "no file or destination specified"
Packit e67170
      else
Packit e67170
	func_fatal_help "you must specify a destination"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    # Strip any trailing slash from the destination.
Packit e67170
    func_stripname '' '/' "$dest"
Packit e67170
    dest=$func_stripname_result
Packit e67170
Packit e67170
    # Check to see that the destination is a directory.
Packit e67170
    test -d "$dest" && isdir=yes
Packit e67170
    if test "$isdir" = yes; then
Packit e67170
      destdir="$dest"
Packit e67170
      destname=
Packit e67170
    else
Packit e67170
      func_dirname_and_basename "$dest" "" "."
Packit e67170
      destdir="$func_dirname_result"
Packit e67170
      destname="$func_basename_result"
Packit e67170
Packit e67170
      # Not a directory, so check to see that there is only one file specified.
Packit e67170
      set dummy $files; shift
Packit e67170
      test "$#" -gt 1 && \
Packit e67170
	func_fatal_help "\`$dest' is not a directory"
Packit e67170
    fi
Packit e67170
    case $destdir in
Packit e67170
    [\\/]* | [A-Za-z]:[\\/]*) ;;
Packit e67170
    *)
Packit e67170
      for file in $files; do
Packit e67170
	case $file in
Packit e67170
	*.lo) ;;
Packit e67170
	*)
Packit e67170
	  func_fatal_help "\`$destdir' must be an absolute directory name"
Packit e67170
	  ;;
Packit e67170
	esac
Packit e67170
      done
Packit e67170
      ;;
Packit e67170
    esac
Packit e67170
Packit e67170
    # This variable tells wrapper scripts just to set variables rather
Packit e67170
    # than running their programs.
Packit e67170
    libtool_install_magic="$magic"
Packit e67170
Packit e67170
    staticlibs=
Packit e67170
    future_libdirs=
Packit e67170
    current_libdirs=
Packit e67170
    for file in $files; do
Packit e67170
Packit e67170
      # Do each installation.
Packit e67170
      case $file in
Packit e67170
      *.$libext)
Packit e67170
	# Do the static libraries later.
Packit e67170
	func_append staticlibs " $file"
Packit e67170
	;;
Packit e67170
Packit e67170
      *.la)
Packit e67170
	func_resolve_sysroot "$file"
Packit e67170
	file=$func_resolve_sysroot_result
Packit e67170
Packit e67170
	# Check to see that this really is a libtool archive.
Packit e67170
	func_lalib_unsafe_p "$file" \
Packit e67170
	  || func_fatal_help "\`$file' is not a valid libtool archive"
Packit e67170
Packit e67170
	library_names=
Packit e67170
	old_library=
Packit e67170
	relink_command=
Packit e67170
	func_source "$file"
Packit e67170
Packit e67170
	# Add the libdir to current_libdirs if it is the destination.
Packit e67170
	if test "X$destdir" = "X$libdir"; then
Packit e67170
	  case "$current_libdirs " in
Packit e67170
	  *" $libdir "*) ;;
Packit e67170
	  *) func_append current_libdirs " $libdir" ;;
Packit e67170
	  esac
Packit e67170
	else
Packit e67170
	  # Note the libdir as a future libdir.
Packit e67170
	  case "$future_libdirs " in
Packit e67170
	  *" $libdir "*) ;;
Packit e67170
	  *) func_append future_libdirs " $libdir" ;;
Packit e67170
	  esac
Packit e67170
	fi
Packit e67170
Packit e67170
	func_dirname "$file" "/" ""
Packit e67170
	dir="$func_dirname_result"
Packit e67170
	func_append dir "$objdir"
Packit e67170
Packit e67170
	if test -n "$relink_command"; then
Packit e67170
	  # Determine the prefix the user has applied to our future dir.
Packit e67170
	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
Packit e67170
Packit e67170
	  # Don't allow the user to place us outside of our expected
Packit e67170
	  # location b/c this prevents finding dependent libraries that
Packit e67170
	  # are installed to the same prefix.
Packit e67170
	  # At present, this check doesn't affect windows .dll's that
Packit e67170
	  # are installed into $libdir/../bin (currently, that works fine)
Packit e67170
	  # but it's something to keep an eye on.
Packit e67170
	  test "$inst_prefix_dir" = "$destdir" && \
Packit e67170
	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
Packit e67170
Packit e67170
	  if test -n "$inst_prefix_dir"; then
Packit e67170
	    # Stick the inst_prefix_dir data into the link command.
Packit e67170
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
Packit e67170
	  else
Packit e67170
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
Packit e67170
	  fi
Packit e67170
Packit e67170
	  func_warning "relinking \`$file'"
Packit e67170
	  func_show_eval "$relink_command" \
Packit e67170
	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
Packit e67170
	fi
Packit e67170
Packit e67170
	# See the names of the shared library.
Packit e67170
	set dummy $library_names; shift
Packit e67170
	if test -n "$1"; then
Packit e67170
	  realname="$1"
Packit e67170
	  shift
Packit e67170
Packit e67170
	  srcname="$realname"
Packit e67170
	  test -n "$relink_command" && srcname="$realname"T
Packit e67170
Packit e67170
	  # Install the shared library and build the symlinks.
Packit e67170
	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
Packit e67170
	      'exit $?'
Packit e67170
	  tstripme="$stripme"
Packit e67170
	  case $host_os in
Packit e67170
	  cygwin* | mingw* | pw32* | cegcc*)
Packit e67170
	    case $realname in
Packit e67170
	    *.dll.a)
Packit e67170
	      tstripme=""
Packit e67170
	      ;;
Packit e67170
	    esac
Packit e67170
	    ;;
Packit e67170
	  esac
Packit e67170
	  if test -n "$tstripme" && test -n "$striplib"; then
Packit e67170
	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
Packit e67170
	  fi
Packit e67170
Packit e67170
	  if test "$#" -gt 0; then
Packit e67170
	    # Delete the old symlinks, and create new ones.
Packit e67170
	    # Try `ln -sf' first, because the `ln' binary might depend on
Packit e67170
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
Packit e67170
	    # so we also need to try rm && ln -s.
Packit e67170
	    for linkname
Packit e67170
	    do
Packit e67170
	      test "$linkname" != "$realname" \
Packit e67170
		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
Packit e67170
	    done
Packit e67170
	  fi
Packit e67170
Packit e67170
	  # Do each command in the postinstall commands.
Packit e67170
	  lib="$destdir/$realname"
Packit e67170
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
Packit e67170
	fi
Packit e67170
Packit e67170
	# Install the pseudo-library for information purposes.
Packit e67170
	func_basename "$file"
Packit e67170
	name="$func_basename_result"
Packit e67170
	instname="$dir/$name"i
Packit e67170
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
Packit e67170
Packit e67170
	# Maybe install the static library, too.
Packit e67170
	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
Packit e67170
	;;
Packit e67170
Packit e67170
      *.lo)
Packit e67170
	# Install (i.e. copy) a libtool object.
Packit e67170
Packit e67170
	# Figure out destination file name, if it wasn't already specified.
Packit e67170
	if test -n "$destname"; then
Packit e67170
	  destfile="$destdir/$destname"
Packit e67170
	else
Packit e67170
	  func_basename "$file"
Packit e67170
	  destfile="$func_basename_result"
Packit e67170
	  destfile="$destdir/$destfile"
Packit e67170
	fi
Packit e67170
Packit e67170
	# Deduce the name of the destination old-style object file.
Packit e67170
	case $destfile in
Packit e67170
	*.lo)
Packit e67170
	  func_lo2o "$destfile"
Packit e67170
	  staticdest=$func_lo2o_result
Packit e67170
	  ;;
Packit e67170
	*.$objext)
Packit e67170
	  staticdest="$destfile"
Packit e67170
	  destfile=
Packit e67170
	  ;;
Packit e67170
	*)
Packit e67170
	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
Packit e67170
	  ;;
Packit e67170
	esac
Packit e67170
Packit e67170
	# Install the libtool object if requested.
Packit e67170
	test -n "$destfile" && \
Packit e67170
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
Packit e67170
Packit e67170
	# Install the old object if enabled.
Packit e67170
	if test "$build_old_libs" = yes; then
Packit e67170
	  # Deduce the name of the old-style object file.
Packit e67170
	  func_lo2o "$file"
Packit e67170
	  staticobj=$func_lo2o_result
Packit e67170
	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
Packit e67170
	fi
Packit e67170
	exit $EXIT_SUCCESS
Packit e67170
	;;
Packit e67170
Packit e67170
      *)
Packit e67170
	# Figure out destination file name, if it wasn't already specified.
Packit e67170
	if test -n "$destname"; then
Packit e67170
	  destfile="$destdir/$destname"
Packit e67170
	else
Packit e67170
	  func_basename "$file"
Packit e67170
	  destfile="$func_basename_result"
Packit e67170
	  destfile="$destdir/$destfile"
Packit e67170
	fi
Packit e67170
Packit e67170
	# If the file is missing, and there is a .exe on the end, strip it
Packit e67170
	# because it is most likely a libtool script we actually want to
Packit e67170
	# install
Packit e67170
	stripped_ext=""
Packit e67170
	case $file in
Packit e67170
	  *.exe)
Packit e67170
	    if test ! -f "$file"; then
Packit e67170
	      func_stripname '' '.exe' "$file"
Packit e67170
	      file=$func_stripname_result
Packit e67170
	      stripped_ext=".exe"
Packit e67170
	    fi
Packit e67170
	    ;;
Packit e67170
	esac
Packit e67170
Packit e67170
	# Do a test to see if this is really a libtool program.
Packit e67170
	case $host in
Packit e67170
	*cygwin* | *mingw*)
Packit e67170
	    if func_ltwrapper_executable_p "$file"; then
Packit e67170
	      func_ltwrapper_scriptname "$file"
Packit e67170
	      wrapper=$func_ltwrapper_scriptname_result
Packit e67170
	    else
Packit e67170
	      func_stripname '' '.exe' "$file"
Packit e67170
	      wrapper=$func_stripname_result
Packit e67170
	    fi
Packit e67170
	    ;;
Packit e67170
	*)
Packit e67170
	    wrapper=$file
Packit e67170
	    ;;
Packit e67170
	esac
Packit e67170
	if func_ltwrapper_script_p "$wrapper"; then
Packit e67170
	  notinst_deplibs=
Packit e67170
	  relink_command=
Packit e67170
Packit e67170
	  func_source "$wrapper"
Packit e67170
Packit e67170
	  # Check the variables that should have been set.
Packit e67170
	  test -z "$generated_by_libtool_version" && \
Packit e67170
	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
Packit e67170
Packit e67170
	  finalize=yes
Packit e67170
	  for lib in $notinst_deplibs; do
Packit e67170
	    # Check to see that each library is installed.
Packit e67170
	    libdir=
Packit e67170
	    if test -f "$lib"; then
Packit e67170
	      func_source "$lib"
Packit e67170
	    fi
Packit e67170
	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
Packit e67170
	    if test -n "$libdir" && test ! -f "$libfile"; then
Packit e67170
	      func_warning "\`$lib' has not been installed in \`$libdir'"
Packit e67170
	      finalize=no
Packit e67170
	    fi
Packit e67170
	  done
Packit e67170
Packit e67170
	  relink_command=
Packit e67170
	  func_source "$wrapper"
Packit e67170
Packit e67170
	  outputname=
Packit e67170
	  if test "$fast_install" = no && test -n "$relink_command"; then
Packit e67170
	    $opt_dry_run || {
Packit e67170
	      if test "$finalize" = yes; then
Packit e67170
	        tmpdir=`func_mktempdir`
Packit e67170
		func_basename "$file$stripped_ext"
Packit e67170
		file="$func_basename_result"
Packit e67170
	        outputname="$tmpdir/$file"
Packit e67170
	        # Replace the output file specification.
Packit e67170
	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
Packit e67170
Packit e67170
	        $opt_silent || {
Packit e67170
	          func_quote_for_expand "$relink_command"
Packit e67170
		  eval "func_echo $func_quote_for_expand_result"
Packit e67170
	        }
Packit e67170
	        if eval "$relink_command"; then :
Packit e67170
	          else
Packit e67170
		  func_error "error: relink \`$file' with the above command before installing it"
Packit e67170
		  $opt_dry_run || ${RM}r "$tmpdir"
Packit e67170
		  continue
Packit e67170
	        fi
Packit e67170
	        file="$outputname"
Packit e67170
	      else
Packit e67170
	        func_warning "cannot relink \`$file'"
Packit e67170
	      fi
Packit e67170
	    }
Packit e67170
	  else
Packit e67170
	    # Install the binary that we compiled earlier.
Packit e67170
	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
Packit e67170
	  fi
Packit e67170
	fi
Packit e67170
Packit e67170
	# remove .exe since cygwin /usr/bin/install will append another
Packit e67170
	# one anyway
Packit e67170
	case $install_prog,$host in
Packit e67170
	*/usr/bin/install*,*cygwin*)
Packit e67170
	  case $file:$destfile in
Packit e67170
	  *.exe:*.exe)
Packit e67170
	    # this is ok
Packit e67170
	    ;;
Packit e67170
	  *.exe:*)
Packit e67170
	    destfile=$destfile.exe
Packit e67170
	    ;;
Packit e67170
	  *:*.exe)
Packit e67170
	    func_stripname '' '.exe' "$destfile"
Packit e67170
	    destfile=$func_stripname_result
Packit e67170
	    ;;
Packit e67170
	  esac
Packit e67170
	  ;;
Packit e67170
	esac
Packit e67170
	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
Packit e67170
	$opt_dry_run || if test -n "$outputname"; then
Packit e67170
	  ${RM}r "$tmpdir"
Packit e67170
	fi
Packit e67170
	;;
Packit e67170
      esac
Packit e67170
    done
Packit e67170
Packit e67170
    for file in $staticlibs; do
Packit e67170
      func_basename "$file"
Packit e67170
      name="$func_basename_result"
Packit e67170
Packit e67170
      # Set up the ranlib parameters.
Packit e67170
      oldlib="$destdir/$name"
Packit e67170
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
Packit e67170
      tool_oldlib=$func_to_tool_file_result
Packit e67170
Packit e67170
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
Packit e67170
Packit e67170
      if test -n "$stripme" && test -n "$old_striplib"; then
Packit e67170
	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
Packit e67170
      fi
Packit e67170
Packit e67170
      # Do each command in the postinstall commands.
Packit e67170
      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
Packit e67170
    done
Packit e67170
Packit e67170
    test -n "$future_libdirs" && \
Packit e67170
      func_warning "remember to run \`$progname --finish$future_libdirs'"
Packit e67170
Packit e67170
    if test -n "$current_libdirs"; then
Packit e67170
      # Maybe just do a dry run.
Packit e67170
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
Packit e67170
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
Packit e67170
    else
Packit e67170
      exit $EXIT_SUCCESS
Packit e67170
    fi
Packit e67170
}
Packit e67170
Packit e67170
test "$opt_mode" = install && func_mode_install ${1+"$@"}
Packit e67170
Packit e67170
Packit e67170
# func_generate_dlsyms outputname originator pic_p
Packit e67170
# Extract symbols from dlprefiles and create ${outputname}S.o with
Packit e67170
# a dlpreopen symbol table.
Packit e67170
func_generate_dlsyms ()
Packit e67170
{
Packit e67170
    $opt_debug
Packit e67170
    my_outputname="$1"
Packit e67170
    my_originator="$2"
Packit e67170
    my_pic_p="${3-no}"
Packit e67170
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
Packit e67170
    my_dlsyms=
Packit e67170
Packit e67170
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
Packit e67170
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
Packit e67170
	my_dlsyms="${my_outputname}S.c"
Packit e67170
      else
Packit e67170
	func_error "not configured to extract global symbols from dlpreopened files"
Packit e67170
      fi
Packit e67170
    fi
Packit e67170
Packit e67170
    if test -n "$my_dlsyms"; then
Packit e67170
      case $my_dlsyms in
Packit e67170
      "") ;;
Packit e67170
      *.c)
Packit e67170
	# Discover the nlist of each of the dlfiles.
Packit e67170
	nlist="$output_objdir/${my_outputname}.nm"
Packit e67170
Packit e67170
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
Packit e67170
Packit e67170
	# Parse the name list into a source file.
Packit e67170
	func_verbose "creating $output_objdir/$my_dlsyms"
Packit e67170
Packit e67170
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
Packit e67170
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
Packit e67170
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
Packit e67170
Packit e67170
#ifdef __cplusplus
Packit e67170
extern \"C\" {
Packit e67170
#endif
Packit e67170
Packit e67170
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
Packit e67170
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
Packit e67170
#endif
Packit e67170
Packit e67170
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
Packit e67170
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
Packit e67170
/* DATA imports from DLLs on WIN32 con't be const, because runtime
Packit e67170
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
Packit e67170
# define LT_DLSYM_CONST
Packit e67170
#elif defined(__osf__)
Packit e67170
/* This system does not cope well with relocations in const data.  */
Packit e67170
# define LT_DLSYM_CONST
Packit e67170
#else
Packit e67170
# define LT_DLSYM_CONST const
Packit e67170
#endif
Packit e67170
Packit e67170
/* External symbol declarations for the compiler. */\
Packit e67170
"