Blame ltmain.sh

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