Blame ltmain.sh

Packit Service 688f9c
#! /bin/sh
Packit Service 688f9c
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
Packit Service 688f9c
##               by inline-source v2014-01-03.01
Packit 874993
Packit Service 688f9c
# libtool (GNU libtool) 2.4.6
Packit Service 688f9c
# Provide generalized library-building support services.
Packit 874993
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
Packit 874993
Packit Service 688f9c
# Copyright (C) 1996-2015 Free Software Foundation, Inc.
Packit 874993
# This is free software; see the source for copying conditions.  There is NO
Packit 874993
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit 874993
Packit 874993
# GNU Libtool is free software; you can redistribute it and/or modify
Packit 874993
# it under the terms of the GNU General Public License as published by
Packit 874993
# the Free Software Foundation; either version 2 of the License, or
Packit 874993
# (at your option) any later version.
Packit 874993
#
Packit 874993
# As a special exception to the GNU General Public License,
Packit 874993
# if you distribute this file as part of a program or library that
Packit 874993
# is built using GNU Libtool, you may include this file under the
Packit 874993
# same distribution terms that you use for the rest of that program.
Packit 874993
#
Packit 874993
# GNU Libtool is distributed in the hope that it will be useful, but
Packit 874993
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 874993
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 874993
# General Public License for more details.
Packit 874993
#
Packit 874993
# You should have received a copy of the GNU General Public License
Packit Service 688f9c
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 874993
Packit 874993
Packit 874993
PROGRAM=libtool
Packit 874993
PACKAGE=libtool
Packit Service 688f9c
VERSION=2.4.6
Packit Service 688f9c
package_revision=2.4.6
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
## Usage. ##
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
Packit Service 688f9c
# Run './libtool --help' for help with using this script from the
Packit Service 688f9c
# command line.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ------------------------------- ##
Packit Service 688f9c
## User overridable command paths. ##
Packit Service 688f9c
## ------------------------------- ##
Packit Service 688f9c
Packit Service 688f9c
# After configure completes, it has a better idea of some of the
Packit Service 688f9c
# shell tools we need than the defaults used by the functions shared
Packit Service 688f9c
# with bootstrap, so set those here where they can still be over-
Packit Service 688f9c
# ridden by the user, but otherwise take precedence.
Packit Service 688f9c
Packit Service 688f9c
: ${AUTOCONF="autoconf"}
Packit Service 688f9c
: ${AUTOMAKE="automake"}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## -------------------------- ##
Packit Service 688f9c
## Source external libraries. ##
Packit Service 688f9c
## -------------------------- ##
Packit Service 688f9c
Packit Service 688f9c
# Much of our low-level functionality needs to be sourced from external
Packit Service 688f9c
# libraries, which are installed to $pkgauxdir.
Packit Service 688f9c
Packit Service 688f9c
# Set a version string for this script.
Packit Service 688f9c
scriptversion=2015-01-20.17; # UTC
Packit Service 688f9c
Packit Service 688f9c
# General shell script boiler plate, and helper functions.
Packit Service 688f9c
# Written by Gary V. Vaughan, 2004
Packit Service 688f9c
Packit Service 688f9c
# Copyright (C) 2004-2015 Free Software Foundation, Inc.
Packit Service 688f9c
# This is free software; see the source for copying conditions.  There is NO
Packit Service 688f9c
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 688f9c
Packit Service 688f9c
# This program is free software; you can redistribute it and/or modify
Packit Service 688f9c
# it under the terms of the GNU General Public License as published by
Packit Service 688f9c
# the Free Software Foundation; either version 3 of the License, or
Packit Service 688f9c
# (at your option) any later version.
Packit Service 688f9c
Packit Service 688f9c
# As a special exception to the GNU General Public License, if you distribute
Packit Service 688f9c
# this file as part of a program or library that is built using GNU Libtool,
Packit Service 688f9c
# you may include this file under the same distribution terms that you use
Packit Service 688f9c
# for the rest of that program.
Packit Service 688f9c
Packit Service 688f9c
# This program is distributed in the hope that it will be useful,
Packit Service 688f9c
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 688f9c
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
Packit Service 688f9c
# General Public License for more details.
Packit Service 688f9c
Packit Service 688f9c
# You should have received a copy of the GNU General Public License
Packit Service 688f9c
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Packit Service 688f9c
Packit Service 688f9c
# Please report bugs or propose patches to gary@gnu.org.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
## Usage. ##
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
Packit Service 688f9c
# Evaluate this file near the top of your script to gain access to
Packit Service 688f9c
# the functions and variables defined here:
Packit Service 688f9c
#
Packit Service 688f9c
#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
Packit Service 688f9c
#
Packit Service 688f9c
# If you need to override any of the default environment variable
Packit Service 688f9c
# settings, do that before evaluating this file.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## -------------------- ##
Packit Service 688f9c
## Shell normalisation. ##
Packit Service 688f9c
## -------------------- ##
Packit Service 688f9c
Packit Service 688f9c
# Some shells need a little help to be as Bourne compatible as possible.
Packit Service 688f9c
# Before doing anything else, make sure all that help has been provided!
Packit Service 688f9c
Packit Service 688f9c
DUALCASE=1; export DUALCASE # for MKS sh
Packit Service 688f9c
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
Packit 874993
  emulate sh
Packit 874993
  NULLCMD=:
Packit Service 688f9c
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
Packit 874993
  # is contrary to our usage.  Disable this feature.
Packit 874993
  alias -g '${1+"$@"}'='"$@"'
Packit 874993
  setopt NO_GLOB_SUBST
Packit 874993
else
Packit Service 688f9c
  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
Packit 874993
fi
Packit 874993
Packit Service 688f9c
# NLS nuisances: We save the old values in case they are required later.
Packit Service 688f9c
_G_user_locale=
Packit Service 688f9c
_G_safe_locale=
Packit Service 688f9c
for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
Packit 874993
do
Packit Service 688f9c
  eval "if test set = \"\${$_G_var+set}\"; then
Packit Service 688f9c
          save_$_G_var=\$$_G_var
Packit Service 688f9c
          $_G_var=C
Packit Service 688f9c
	  export $_G_var
Packit Service 688f9c
	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
Packit Service 688f9c
	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
Packit 874993
	fi"
Packit 874993
done
Packit 874993
Packit Service 688f9c
# CDPATH.
Packit Service 688f9c
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
Packit 874993
Packit Service 688f9c
# Make sure IFS has a sensible default
Packit Service 688f9c
sp=' '
Packit Service 688f9c
nl='
Packit Service 688f9c
'
Packit Service 688f9c
IFS="$sp	$nl"
Packit Service 688f9c
Packit Service 688f9c
# There are apparently some retarded systems that use ';' as a PATH separator!
Packit Service 688f9c
if test "${PATH_SEPARATOR+set}" != set; then
Packit Service 688f9c
  PATH_SEPARATOR=:
Packit Service 688f9c
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
Packit Service 688f9c
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
Packit Service 688f9c
      PATH_SEPARATOR=';'
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit 874993
Packit 874993
Packit 874993
Packit Service 688f9c
## ------------------------- ##
Packit Service 688f9c
## Locate command utilities. ##
Packit Service 688f9c
## ------------------------- ##
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_executable_p FILE
Packit Service 688f9c
# ----------------------
Packit Service 688f9c
# Check that FILE is an executable regular file.
Packit Service 688f9c
func_executable_p ()
Packit Service 688f9c
{
Packit Service 688f9c
    test -f "$1" && test -x "$1"
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
Packit Service 688f9c
# --------------------------------------------
Packit Service 688f9c
# Search for either a program that responds to --version with output
Packit Service 688f9c
# containing "GNU", or else returned by CHECK_FUNC otherwise, by
Packit Service 688f9c
# trying all the directories in PATH with each of the elements of
Packit Service 688f9c
# PROGS_LIST.
Packit Service 688f9c
#
Packit Service 688f9c
# CHECK_FUNC should accept the path to a candidate program, and
Packit Service 688f9c
# set $func_check_prog_result if it truncates its output less than
Packit Service 688f9c
# $_G_path_prog_max characters.
Packit Service 688f9c
func_path_progs ()
Packit Service 688f9c
{
Packit Service 688f9c
    _G_progs_list=$1
Packit Service 688f9c
    _G_check_func=$2
Packit Service 688f9c
    _G_PATH=${3-"$PATH"}
Packit Service 688f9c
Packit Service 688f9c
    _G_path_prog_max=0
Packit Service 688f9c
    _G_path_prog_found=false
Packit Service 688f9c
    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
Packit Service 688f9c
    for _G_dir in $_G_PATH; do
Packit Service 688f9c
      IFS=$_G_save_IFS
Packit Service 688f9c
      test -z "$_G_dir" && _G_dir=.
Packit Service 688f9c
      for _G_prog_name in $_G_progs_list; do
Packit Service 688f9c
        for _exeext in '' .EXE; do
Packit Service 688f9c
          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
Packit Service 688f9c
          func_executable_p "$_G_path_prog" || continue
Packit Service 688f9c
          case `"$_G_path_prog" --version 2>&1` in
Packit Service 688f9c
            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
Packit Service 688f9c
            *)     $_G_check_func $_G_path_prog
Packit Service 688f9c
		   func_path_progs_result=$func_check_prog_result
Packit Service 688f9c
		   ;;
Packit Service 688f9c
          esac
Packit Service 688f9c
          $_G_path_prog_found && break 3
Packit Service 688f9c
        done
Packit Service 688f9c
      done
Packit Service 688f9c
    done
Packit Service 688f9c
    IFS=$_G_save_IFS
Packit Service 688f9c
    test -z "$func_path_progs_result" && {
Packit Service 688f9c
      echo "no acceptable sed could be found in \$PATH" >&2
Packit Service 688f9c
      exit 1
Packit Service 688f9c
    }
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# We want to be able to use the functions in this file before configure
Packit Service 688f9c
# has figured out where the best binaries are kept, which means we have
Packit Service 688f9c
# to search for them ourselves - except when the results are already set
Packit Service 688f9c
# where we skip the searches.
Packit Service 688f9c
Packit Service 688f9c
# Unless the user overrides by setting SED, search the path for either GNU
Packit Service 688f9c
# sed, or the sed that truncates its output the least.
Packit Service 688f9c
test -z "$SED" && {
Packit Service 688f9c
  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
Packit Service 688f9c
  for _G_i in 1 2 3 4 5 6 7; do
Packit Service 688f9c
    _G_sed_script=$_G_sed_script$nl$_G_sed_script
Packit Service 688f9c
  done
Packit Service 688f9c
  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
Packit Service 688f9c
  _G_sed_script=
Packit Service 688f9c
Packit Service 688f9c
  func_check_prog_sed ()
Packit Service 688f9c
  {
Packit Service 688f9c
    _G_path_prog=$1
Packit Service 688f9c
Packit Service 688f9c
    _G_count=0
Packit Service 688f9c
    printf 0123456789 >conftest.in
Packit Service 688f9c
    while :
Packit Service 688f9c
    do
Packit Service 688f9c
      cat conftest.in conftest.in >conftest.tmp
Packit Service 688f9c
      mv conftest.tmp conftest.in
Packit Service 688f9c
      cp conftest.in conftest.nl
Packit Service 688f9c
      echo '' >> conftest.nl
Packit Service 688f9c
      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
Packit Service 688f9c
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
Packit Service 688f9c
      _G_count=`expr $_G_count + 1`
Packit Service 688f9c
      if test "$_G_count" -gt "$_G_path_prog_max"; then
Packit Service 688f9c
        # Best one so far, save it but keep looking for a better one
Packit Service 688f9c
        func_check_prog_result=$_G_path_prog
Packit Service 688f9c
        _G_path_prog_max=$_G_count
Packit Service 688f9c
      fi
Packit Service 688f9c
      # 10*(2^10) chars as input seems more than enough
Packit Service 688f9c
      test 10 -lt "$_G_count" && break
Packit Service 688f9c
    done
Packit Service 688f9c
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
Packit Service 688f9c
  }
Packit Service 688f9c
Packit Service 688f9c
  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
Packit Service 688f9c
  rm -f conftest.sed
Packit Service 688f9c
  SED=$func_path_progs_result
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# Unless the user overrides by setting GREP, search the path for either GNU
Packit Service 688f9c
# grep, or the grep that truncates its output the least.
Packit Service 688f9c
test -z "$GREP" && {
Packit Service 688f9c
  func_check_prog_grep ()
Packit Service 688f9c
  {
Packit Service 688f9c
    _G_path_prog=$1
Packit Service 688f9c
Packit Service 688f9c
    _G_count=0
Packit Service 688f9c
    _G_path_prog_max=0
Packit Service 688f9c
    printf 0123456789 >conftest.in
Packit Service 688f9c
    while :
Packit Service 688f9c
    do
Packit Service 688f9c
      cat conftest.in conftest.in >conftest.tmp
Packit Service 688f9c
      mv conftest.tmp conftest.in
Packit Service 688f9c
      cp conftest.in conftest.nl
Packit Service 688f9c
      echo 'GREP' >> conftest.nl
Packit Service 688f9c
      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
Packit Service 688f9c
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
Packit Service 688f9c
      _G_count=`expr $_G_count + 1`
Packit Service 688f9c
      if test "$_G_count" -gt "$_G_path_prog_max"; then
Packit Service 688f9c
        # Best one so far, save it but keep looking for a better one
Packit Service 688f9c
        func_check_prog_result=$_G_path_prog
Packit Service 688f9c
        _G_path_prog_max=$_G_count
Packit Service 688f9c
      fi
Packit Service 688f9c
      # 10*(2^10) chars as input seems more than enough
Packit Service 688f9c
      test 10 -lt "$_G_count" && break
Packit Service 688f9c
    done
Packit Service 688f9c
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
Packit Service 688f9c
  }
Packit Service 688f9c
Packit Service 688f9c
  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
Packit Service 688f9c
  GREP=$func_path_progs_result
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ------------------------------- ##
Packit Service 688f9c
## User overridable command paths. ##
Packit Service 688f9c
## ------------------------------- ##
Packit Service 688f9c
Packit Service 688f9c
# All uppercase variable names are used for environment variables.  These
Packit Service 688f9c
# variables can be overridden by the user before calling a script that
Packit Service 688f9c
# uses them if a suitable command of that name is not already available
Packit Service 688f9c
# in the command search PATH.
Packit 874993
Packit 874993
: ${CP="cp -f"}
Packit Service 688f9c
: ${ECHO="printf %s\n"}
Packit Service 688f9c
: ${EGREP="$GREP -E"}
Packit Service 688f9c
: ${FGREP="$GREP -F"}
Packit Service 688f9c
: ${LN_S="ln -s"}
Packit 874993
: ${MAKE="make"}
Packit 874993
: ${MKDIR="mkdir"}
Packit 874993
: ${MV="mv -f"}
Packit 874993
: ${RM="rm -f"}
Packit 874993
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
Packit 874993
Packit 874993
Packit Service 688f9c
## -------------------- ##
Packit Service 688f9c
## Useful sed snippets. ##
Packit Service 688f9c
## -------------------- ##
Packit 874993
Packit Service 688f9c
sed_dirname='s|/[^/]*$||'
Packit Service 688f9c
sed_basename='s|^.*/||'
Packit 874993
Packit Service 688f9c
# Sed substitution that helps us do robust quoting.  It backslashifies
Packit Service 688f9c
# metacharacters that are still active within double-quoted strings.
Packit Service 688f9c
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
Packit 874993
Packit Service 688f9c
# Same as above, but do not quote variable references.
Packit Service 688f9c
sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
Packit 874993
Packit Service 688f9c
# Sed substitution that turns a string into a regex matching for the
Packit Service 688f9c
# string literally.
Packit Service 688f9c
sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
Packit 874993
Packit Service 688f9c
# Sed substitution that converts a w32 file name or path
Packit Service 688f9c
# that contains forward slashes, into one that contains
Packit Service 688f9c
# (escaped) backslashes.  A very naive implementation.
Packit Service 688f9c
sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
Packit Service 688f9c
Packit Service 688f9c
# Re-'\' parameter expansions in output of sed_double_quote_subst that
Packit Service 688f9c
# were '\'-ed in input to the same.  If an odd number of '\' preceded a
Packit Service 688f9c
# '$' in input to sed_double_quote_subst, that '$' was protected from
Packit Service 688f9c
# expansion.  Since each input '\' is now two '\'s, look for any number
Packit Service 688f9c
# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
Packit Service 688f9c
_G_bs='\\'
Packit Service 688f9c
_G_bs2='\\\\'
Packit Service 688f9c
_G_bs4='\\\\\\\\'
Packit Service 688f9c
_G_dollar='\$'
Packit Service 688f9c
sed_double_backslash="\
Packit Service 688f9c
  s/$_G_bs4/&\\
Packit Service 688f9c
/g
Packit Service 688f9c
  s/^$_G_bs2$_G_dollar/$_G_bs&/
Packit Service 688f9c
  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
Packit Service 688f9c
  s/\n//g"
Packit 874993
Packit 874993
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
## Global variables. ##
Packit Service 688f9c
## ----------------- ##
Packit 874993
Packit Service 688f9c
# Except for the global variables explicitly listed below, the following
Packit Service 688f9c
# functions in the '^func_' namespace, and the '^require_' namespace
Packit Service 688f9c
# variables initialised in the 'Resource management' section, sourcing
Packit Service 688f9c
# this file will not pollute your global namespace with anything
Packit Service 688f9c
# else. There's no portable way to scope variables in Bourne shell
Packit Service 688f9c
# though, so actually running these functions will sometimes place
Packit Service 688f9c
# results into a variable named after the function, and often use
Packit Service 688f9c
# temporary variables in the '^_G_' namespace. If you are careful to
Packit Service 688f9c
# avoid using those namespaces casually in your sourcing script, things
Packit Service 688f9c
# should continue to work as you expect. And, of course, you can freely
Packit Service 688f9c
# overwrite any of the functions or variables defined here before
Packit Service 688f9c
# calling anything to customize them.
Packit 874993
Packit Service 688f9c
EXIT_SUCCESS=0
Packit Service 688f9c
EXIT_FAILURE=1
Packit Service 688f9c
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
Packit Service 688f9c
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
Packit 874993
Packit Service 688f9c
# Allow overriding, eg assuming that you follow the convention of
Packit Service 688f9c
# putting '$debug_cmd' at the start of all your functions, you can get
Packit Service 688f9c
# bash to show function call trace with:
Packit Service 688f9c
#
Packit Service 688f9c
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
Packit Service 688f9c
debug_cmd=${debug_cmd-":"}
Packit Service 688f9c
exit_cmd=:
Packit 874993
Packit Service 688f9c
# By convention, finish your script with:
Packit Service 688f9c
#
Packit Service 688f9c
#    exit $exit_status
Packit Service 688f9c
#
Packit Service 688f9c
# so that you can set exit_status to non-zero if you want to indicate
Packit Service 688f9c
# something went wrong during execution without actually bailing out at
Packit Service 688f9c
# the point of failure.
Packit Service 688f9c
exit_status=$EXIT_SUCCESS
Packit 874993
Packit Service 688f9c
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
Packit Service 688f9c
# is ksh but when the shell is invoked as "sh" and the current value of
Packit Service 688f9c
# the _XPG environment variable is not equal to 1 (one), the special
Packit Service 688f9c
# positional parameter $0, within a function call, is the name of the
Packit Service 688f9c
# function.
Packit Service 688f9c
progpath=$0
Packit 874993
Packit Service 688f9c
# The name of this program.
Packit Service 688f9c
progname=`$ECHO "$progpath" |$SED "$sed_basename"`
Packit 874993
Packit Service 688f9c
# Make sure we have an absolute progpath for reexecution:
Packit 874993
case $progpath in
Packit 874993
  [\\/]*|[A-Za-z]:\\*) ;;
Packit 874993
  *[\\/]*)
Packit Service 688f9c
     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
Packit 874993
     progdir=`cd "$progdir" && pwd`
Packit Service 688f9c
     progpath=$progdir/$progname
Packit 874993
     ;;
Packit 874993
  *)
Packit Service 688f9c
     _G_IFS=$IFS
Packit 874993
     IFS=${PATH_SEPARATOR-:}
Packit 874993
     for progdir in $PATH; do
Packit Service 688f9c
       IFS=$_G_IFS
Packit 874993
       test -x "$progdir/$progname" && break
Packit 874993
     done
Packit Service 688f9c
     IFS=$_G_IFS
Packit 874993
     test -n "$progdir" || progdir=`pwd`
Packit Service 688f9c
     progpath=$progdir/$progname
Packit 874993
     ;;
Packit 874993
esac
Packit 874993
Packit 874993
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
## Standard options. ##
Packit Service 688f9c
## ----------------- ##
Packit 874993
Packit Service 688f9c
# The following options affect the operation of the functions defined
Packit Service 688f9c
# below, and should be set appropriately depending on run-time para-
Packit Service 688f9c
# meters passed on the command line.
Packit 874993
Packit 874993
opt_dry_run=false
Packit 874993
opt_quiet=false
Packit 874993
opt_verbose=false
Packit 874993
Packit Service 688f9c
# Categories 'all' and 'none' are always available.  Append any others
Packit Service 688f9c
# you will pass as the first argument to func_warning from your own
Packit Service 688f9c
# code.
Packit Service 688f9c
warning_categories=
Packit 874993
Packit Service 688f9c
# By default, display warnings according to 'opt_warning_types'.  Set
Packit Service 688f9c
# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
Packit Service 688f9c
# treat the next displayed warning as a fatal error.
Packit Service 688f9c
warning_func=func_warn_and_continue
Packit 874993
Packit Service 688f9c
# Set to 'all' to display all warnings, 'none' to suppress all
Packit Service 688f9c
# warnings, or a space delimited list of some subset of
Packit Service 688f9c
# 'warning_categories' to display only the listed warnings.
Packit Service 688f9c
opt_warning_types=all
Packit 874993
Packit 874993
Packit Service 688f9c
## -------------------- ##
Packit Service 688f9c
## Resource management. ##
Packit Service 688f9c
## -------------------- ##
Packit 874993
Packit Service 688f9c
# This section contains definitions for functions that each ensure a
Packit Service 688f9c
# particular resource (a file, or a non-empty configuration variable for
Packit Service 688f9c
# example) is available, and if appropriate to extract default values
Packit Service 688f9c
# from pertinent package files. Call them using their associated
Packit Service 688f9c
# 'require_*' variable to ensure that they are executed, at most, once.
Packit Service 688f9c
#
Packit Service 688f9c
# It's entirely deliberate that calling these functions can set
Packit Service 688f9c
# variables that don't obey the namespace limitations obeyed by the rest
Packit Service 688f9c
# of this file, in order that that they be as useful as possible to
Packit Service 688f9c
# callers.
Packit 874993
Packit 874993
Packit Service 688f9c
# require_term_colors
Packit Service 688f9c
# -------------------
Packit Service 688f9c
# Allow display of bold text on terminals that support it.
Packit Service 688f9c
require_term_colors=func_require_term_colors
Packit Service 688f9c
func_require_term_colors ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    test -t 1 && {
Packit Service 688f9c
      # COLORTERM and USE_ANSI_COLORS environment variables take
Packit Service 688f9c
      # precedence, because most terminfo databases neglect to describe
Packit Service 688f9c
      # whether color sequences are supported.
Packit Service 688f9c
      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
Packit Service 688f9c
Packit Service 688f9c
      if test 1 = "$USE_ANSI_COLORS"; then
Packit Service 688f9c
        # Standard ANSI escape sequences
Packit Service 688f9c
        tc_reset='?[0m'
Packit Service 688f9c
        tc_bold='?[1m';   tc_standout='?[7m'
Packit Service 688f9c
        tc_red='?[31m';   tc_green='?[32m'
Packit Service 688f9c
        tc_blue='?[34m';  tc_cyan='?[36m'
Packit Service 688f9c
      else
Packit Service 688f9c
        # Otherwise trust the terminfo database after all.
Packit Service 688f9c
        test -n "`tput sgr0 2>/dev/null`" && {
Packit Service 688f9c
          tc_reset=`tput sgr0`
Packit Service 688f9c
          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
Packit Service 688f9c
          tc_standout=$tc_bold
Packit Service 688f9c
          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
Packit Service 688f9c
          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
Packit Service 688f9c
          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
Packit Service 688f9c
          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
Packit Service 688f9c
          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
Packit Service 688f9c
        }
Packit Service 688f9c
      fi
Packit Service 688f9c
    }
Packit 874993
Packit Service 688f9c
    require_term_colors=:
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
## Function library. ##
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
Packit Service 688f9c
# This section contains a variety of useful functions to call in your
Packit Service 688f9c
# scripts. Take note of the portable wrappers for features provided by
Packit Service 688f9c
# some modern shells, which will fall back to slower equivalents on
Packit Service 688f9c
# less featureful shells.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_append VAR VALUE
Packit Service 688f9c
# ---------------------
Packit Service 688f9c
# Append VALUE onto the existing contents of VAR.
Packit Service 688f9c
Packit Service 688f9c
  # We should try to minimise forks, especially on Windows where they are
Packit Service 688f9c
  # unreasonably slow, so skip the feature probes when bash or zsh are
Packit Service 688f9c
  # being used:
Packit Service 688f9c
  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
Packit Service 688f9c
    : ${_G_HAVE_ARITH_OP="yes"}
Packit Service 688f9c
    : ${_G_HAVE_XSI_OPS="yes"}
Packit Service 688f9c
    # The += operator was introduced in bash 3.1
Packit Service 688f9c
    case $BASH_VERSION in
Packit Service 688f9c
      [12].* | 3.0 | 3.0*) ;;
Packit Service 688f9c
      *)
Packit Service 688f9c
        : ${_G_HAVE_PLUSEQ_OP="yes"}
Packit Service 688f9c
        ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
  fi
Packit Service 688f9c
Packit Service 688f9c
  # _G_HAVE_PLUSEQ_OP
Packit Service 688f9c
  # Can be empty, in which case the shell is probed, "yes" if += is
Packit Service 688f9c
  # useable or anything else if it does not work.
Packit Service 688f9c
  test -z "$_G_HAVE_PLUSEQ_OP" \
Packit Service 688f9c
    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
Packit Service 688f9c
    && _G_HAVE_PLUSEQ_OP=yes
Packit Service 688f9c
Packit Service 688f9c
if test yes = "$_G_HAVE_PLUSEQ_OP"
Packit Service 688f9c
then
Packit Service 688f9c
  # This is an XSI compatible shell, allowing a faster implementation...
Packit Service 688f9c
  eval 'func_append ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    eval "$1+=\$2"
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  # ...otherwise fall back to using expr, which is often a shell builtin.
Packit Service 688f9c
  func_append ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    eval "$1=\$$1\$2"
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_append_quoted VAR VALUE
Packit Service 688f9c
# ----------------------------
Packit Service 688f9c
# Quote VALUE and append to the end of shell variable VAR, separated
Packit Service 688f9c
# by a space.
Packit Service 688f9c
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
Packit Service 688f9c
  eval 'func_append_quoted ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_quote_for_eval "$2"
Packit Service 688f9c
    eval "$1+=\\ \$func_quote_for_eval_result"
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  func_append_quoted ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_quote_for_eval "$2"
Packit Service 688f9c
    eval "$1=\$$1\\ \$func_quote_for_eval_result"
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_append_uniq VAR VALUE
Packit Service 688f9c
# --------------------------
Packit Service 688f9c
# Append unique VALUE onto the existing contents of VAR, assuming
Packit Service 688f9c
# entries are delimited by the first character of VALUE.  For example:
Packit Service 688f9c
#
Packit Service 688f9c
#   func_append_uniq options " --another-option option-argument"
Packit Service 688f9c
#
Packit Service 688f9c
# will only append to $options if " --another-option option-argument "
Packit Service 688f9c
# is not already present somewhere in $options already (note spaces at
Packit Service 688f9c
# each end implied by leading space in second argument).
Packit Service 688f9c
func_append_uniq ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    eval _G_current_value='`$ECHO $'$1'`'
Packit Service 688f9c
    _G_delim=`expr "$2" : '\(.\)'`
Packit Service 688f9c
Packit Service 688f9c
    case $_G_delim$_G_current_value$_G_delim in
Packit Service 688f9c
      *"$2$_G_delim"*) ;;
Packit Service 688f9c
      *) func_append "$@" ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_arith TERM...
Packit Service 688f9c
# ------------------
Packit Service 688f9c
# Set func_arith_result to the result of evaluating TERMs.
Packit Service 688f9c
  test -z "$_G_HAVE_ARITH_OP" \
Packit Service 688f9c
    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
Packit Service 688f9c
    && _G_HAVE_ARITH_OP=yes
Packit Service 688f9c
Packit Service 688f9c
if test yes = "$_G_HAVE_ARITH_OP"; then
Packit Service 688f9c
  eval 'func_arith ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_arith_result=$(( $* ))
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  func_arith ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_arith_result=`expr "$@"`
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_basename FILE
Packit Service 688f9c
# ------------------
Packit Service 688f9c
# Set func_basename_result to FILE with everything up to and including
Packit Service 688f9c
# the last / stripped.
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"; then
Packit Service 688f9c
  # If this shell supports suffix pattern removal, then use it to avoid
Packit Service 688f9c
  # forking. Hide the definitions single quotes in case the shell chokes
Packit Service 688f9c
  # on unsupported syntax...
Packit Service 688f9c
  _b='func_basename_result=${1##*/}'
Packit Service 688f9c
  _d='case $1 in
Packit Service 688f9c
        */*) func_dirname_result=${1%/*}$2 ;;
Packit Service 688f9c
        *  ) func_dirname_result=$3        ;;
Packit Service 688f9c
      esac'
Packit Service 688f9c
Packit Service 688f9c
else
Packit Service 688f9c
  # ...otherwise fall back to using sed.
Packit Service 688f9c
  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
Packit Service 688f9c
  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
Packit Service 688f9c
      if test "X$func_dirname_result" = "X$1"; then
Packit Service 688f9c
        func_dirname_result=$3
Packit Service 688f9c
      else
Packit Service 688f9c
        func_append func_dirname_result "$2"
Packit Service 688f9c
      fi'
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
eval 'func_basename ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    '"$_b"'
Packit Service 688f9c
}'
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_dirname FILE APPEND NONDIR_REPLACEMENT
Packit Service 688f9c
# -------------------------------------------
Packit Service 688f9c
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
Packit Service 688f9c
# otherwise set result to NONDIR_REPLACEMENT.
Packit Service 688f9c
eval 'func_dirname ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    '"$_d"'
Packit Service 688f9c
}'
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
Packit Service 688f9c
# --------------------------------------------------------
Packit Service 688f9c
# Perform func_basename and func_dirname in a single function
Packit Service 688f9c
# call:
Packit Service 688f9c
#   dirname:  Compute the dirname of FILE.  If nonempty,
Packit Service 688f9c
#             add APPEND to the result, otherwise set result
Packit Service 688f9c
#             to NONDIR_REPLACEMENT.
Packit Service 688f9c
#             value returned in "$func_dirname_result"
Packit Service 688f9c
#   basename: Compute filename of FILE.
Packit Service 688f9c
#             value retuned in "$func_basename_result"
Packit Service 688f9c
# For efficiency, we do not delegate to the functions above but instead
Packit Service 688f9c
# duplicate the functionality here.
Packit Service 688f9c
eval 'func_dirname_and_basename ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    '"$_b"'
Packit Service 688f9c
    '"$_d"'
Packit Service 688f9c
}'
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_echo ARG...
Packit Service 688f9c
# ----------------
Packit Service 688f9c
# Echo program name prefixed message.
Packit Service 688f9c
func_echo ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    _G_message=$*
Packit Service 688f9c
Packit Service 688f9c
    func_echo_IFS=$IFS
Packit Service 688f9c
    IFS=$nl
Packit Service 688f9c
    for _G_line in $_G_message; do
Packit Service 688f9c
      IFS=$func_echo_IFS
Packit Service 688f9c
      $ECHO "$progname: $_G_line"
Packit Service 688f9c
    done
Packit Service 688f9c
    IFS=$func_echo_IFS
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_echo_all ARG...
Packit Service 688f9c
# --------------------
Packit Service 688f9c
# Invoke $ECHO with all args, space-separated.
Packit Service 688f9c
func_echo_all ()
Packit Service 688f9c
{
Packit Service 688f9c
    $ECHO "$*"
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_echo_infix_1 INFIX ARG...
Packit Service 688f9c
# ------------------------------
Packit Service 688f9c
# Echo program name, followed by INFIX on the first line, with any
Packit Service 688f9c
# additional lines not showing INFIX.
Packit Service 688f9c
func_echo_infix_1 ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $require_term_colors
Packit Service 688f9c
Packit Service 688f9c
    _G_infix=$1; shift
Packit Service 688f9c
    _G_indent=$_G_infix
Packit Service 688f9c
    _G_prefix="$progname: $_G_infix: "
Packit Service 688f9c
    _G_message=$*
Packit Service 688f9c
Packit Service 688f9c
    # Strip color escape sequences before counting printable length
Packit Service 688f9c
    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
Packit Service 688f9c
    do
Packit Service 688f9c
      test -n "$_G_tc" && {
Packit Service 688f9c
        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
Packit Service 688f9c
        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
Packit Service 688f9c
      }
Packit Service 688f9c
    done
Packit Service 688f9c
    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
Packit Service 688f9c
Packit Service 688f9c
    func_echo_infix_1_IFS=$IFS
Packit Service 688f9c
    IFS=$nl
Packit Service 688f9c
    for _G_line in $_G_message; do
Packit Service 688f9c
      IFS=$func_echo_infix_1_IFS
Packit Service 688f9c
      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
Packit Service 688f9c
      _G_prefix=$_G_indent
Packit Service 688f9c
    done
Packit Service 688f9c
    IFS=$func_echo_infix_1_IFS
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_error ARG...
Packit Service 688f9c
# -----------------
Packit Service 688f9c
# Echo program name prefixed message to standard error.
Packit Service 688f9c
func_error ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $require_term_colors
Packit Service 688f9c
Packit Service 688f9c
    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_fatal_error ARG...
Packit Service 688f9c
# -----------------------
Packit Service 688f9c
# Echo program name prefixed message to standard error, and exit.
Packit Service 688f9c
func_fatal_error ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_error "$*"
Packit Service 688f9c
    exit $EXIT_FAILURE
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_grep EXPRESSION FILENAME
Packit Service 688f9c
# -----------------------------
Packit 874993
# Check whether EXPRESSION matches any line of FILENAME, without output.
Packit 874993
func_grep ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit 874993
    $GREP "$1" "$2" >/dev/null 2>&1
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_len STRING
Packit Service 688f9c
# ---------------
Packit Service 688f9c
# Set func_len_result to the length of STRING. STRING may not
Packit Service 688f9c
# start with a hyphen.
Packit Service 688f9c
  test -z "$_G_HAVE_XSI_OPS" \
Packit Service 688f9c
    && (eval 'x=a/b/c;
Packit Service 688f9c
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
Packit Service 688f9c
    && _G_HAVE_XSI_OPS=yes
Packit Service 688f9c
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"; then
Packit Service 688f9c
  eval 'func_len ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_len_result=${#1}
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  func_len ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_mkdir_p DIRECTORY-PATH
Packit Service 688f9c
# ---------------------------
Packit 874993
# Make sure the entire path to DIRECTORY-PATH is available.
Packit 874993
func_mkdir_p ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    _G_directory_path=$1
Packit Service 688f9c
    _G_dir_list=
Packit 874993
Packit Service 688f9c
    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
Packit 874993
Packit Service 688f9c
      # Protect directory names starting with '-'
Packit Service 688f9c
      case $_G_directory_path in
Packit Service 688f9c
        -*) _G_directory_path=./$_G_directory_path ;;
Packit 874993
      esac
Packit 874993
Packit 874993
      # While some portion of DIR does not yet exist...
Packit Service 688f9c
      while test ! -d "$_G_directory_path"; do
Packit 874993
        # ...make a list in topmost first order.  Use a colon delimited
Packit 874993
	# list incase some portion of path contains whitespace.
Packit Service 688f9c
        _G_dir_list=$_G_directory_path:$_G_dir_list
Packit 874993
Packit 874993
        # If the last portion added has no slash in it, the list is done
Packit Service 688f9c
        case $_G_directory_path in */*) ;; *) break ;; esac
Packit 874993
Packit 874993
        # ...otherwise throw away the child directory and loop
Packit Service 688f9c
        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
Packit 874993
      done
Packit Service 688f9c
      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
Packit 874993
Packit Service 688f9c
      func_mkdir_p_IFS=$IFS; IFS=:
Packit Service 688f9c
      for _G_dir in $_G_dir_list; do
Packit Service 688f9c
	IFS=$func_mkdir_p_IFS
Packit Service 688f9c
        # mkdir can fail with a 'File exist' error if two processes
Packit 874993
        # try to create one of the directories concurrently.  Don't
Packit 874993
        # stop in that case!
Packit Service 688f9c
        $MKDIR "$_G_dir" 2>/dev/null || :
Packit 874993
      done
Packit Service 688f9c
      IFS=$func_mkdir_p_IFS
Packit 874993
Packit 874993
      # Bail out if we (or some other process) failed to create a directory.
Packit Service 688f9c
      test -d "$_G_directory_path" || \
Packit Service 688f9c
        func_fatal_error "Failed to create '$1'"
Packit 874993
    fi
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_mktempdir [BASENAME]
Packit Service 688f9c
# -------------------------
Packit 874993
# Make a temporary directory that won't clash with other running
Packit 874993
# libtool processes, and avoids race conditions if possible.  If
Packit Service 688f9c
# given, BASENAME is the basename for that directory.
Packit 874993
func_mktempdir ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    _G_template=${TMPDIR-/tmp}/${1-$progname}
Packit 874993
Packit Service 688f9c
    if test : = "$opt_dry_run"; then
Packit 874993
      # Return a directory name, but don't create it in dry-run mode
Packit Service 688f9c
      _G_tmpdir=$_G_template-$$
Packit 874993
    else
Packit 874993
Packit 874993
      # If mktemp works, use that first and foremost
Packit Service 688f9c
      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
Packit 874993
Packit Service 688f9c
      if test ! -d "$_G_tmpdir"; then
Packit 874993
        # Failing that, at least try and use $RANDOM to avoid a race
Packit Service 688f9c
        _G_tmpdir=$_G_template-${RANDOM-0}$$
Packit 874993
Packit Service 688f9c
        func_mktempdir_umask=`umask`
Packit 874993
        umask 0077
Packit Service 688f9c
        $MKDIR "$_G_tmpdir"
Packit Service 688f9c
        umask $func_mktempdir_umask
Packit 874993
      fi
Packit 874993
Packit 874993
      # If we're not in dry-run mode, bomb out on failure
Packit Service 688f9c
      test -d "$_G_tmpdir" || \
Packit Service 688f9c
        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
Packit 874993
    fi
Packit 874993
Packit Service 688f9c
    $ECHO "$_G_tmpdir"
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_normal_abspath PATH
Packit Service 688f9c
# ------------------------
Packit Service 688f9c
# Remove doubled-up and trailing slashes, "." path components,
Packit Service 688f9c
# and cancel out any ".." path components in PATH after making
Packit Service 688f9c
# it an absolute path.
Packit Service 688f9c
func_normal_abspath ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    # These SED scripts presuppose an absolute path with a trailing slash.
Packit Service 688f9c
    _G_pathcar='s|^/\([^/]*\).*$|\1|'
Packit Service 688f9c
    _G_pathcdr='s|^/[^/]*||'
Packit Service 688f9c
    _G_removedotparts=':dotsl
Packit Service 688f9c
		s|/\./|/|g
Packit Service 688f9c
		t dotsl
Packit Service 688f9c
		s|/\.$|/|'
Packit Service 688f9c
    _G_collapseslashes='s|/\{1,\}|/|g'
Packit Service 688f9c
    _G_finalslash='s|/*$|/|'
Packit Service 688f9c
Packit Service 688f9c
    # Start from root dir and reassemble the path.
Packit Service 688f9c
    func_normal_abspath_result=
Packit Service 688f9c
    func_normal_abspath_tpath=$1
Packit Service 688f9c
    func_normal_abspath_altnamespace=
Packit Service 688f9c
    case $func_normal_abspath_tpath in
Packit Service 688f9c
      "")
Packit Service 688f9c
        # Empty path, that just means $cwd.
Packit Service 688f9c
        func_stripname '' '/' "`pwd`"
Packit Service 688f9c
        func_normal_abspath_result=$func_stripname_result
Packit Service 688f9c
        return
Packit Service 688f9c
        ;;
Packit Service 688f9c
      # The next three entries are used to spot a run of precisely
Packit Service 688f9c
      # two leading slashes without using negated character classes;
Packit Service 688f9c
      # we take advantage of case's first-match behaviour.
Packit Service 688f9c
      ///*)
Packit Service 688f9c
        # Unusual form of absolute path, do nothing.
Packit Service 688f9c
        ;;
Packit Service 688f9c
      //*)
Packit Service 688f9c
        # Not necessarily an ordinary path; POSIX reserves leading '//'
Packit Service 688f9c
        # and for example Cygwin uses it to access remote file shares
Packit Service 688f9c
        # over CIFS/SMB, so we conserve a leading double slash if found.
Packit Service 688f9c
        func_normal_abspath_altnamespace=/
Packit Service 688f9c
        ;;
Packit Service 688f9c
      /*)
Packit Service 688f9c
        # Absolute path, do nothing.
Packit 874993
        ;;
Packit 874993
      *)
Packit Service 688f9c
        # Relative path, prepend $cwd.
Packit Service 688f9c
        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
Packit Service 688f9c
        ;;
Packit 874993
    esac
Packit Service 688f9c
Packit Service 688f9c
    # Cancel out all the simple stuff to save iterations.  We also want
Packit Service 688f9c
    # the path to end with a slash for ease of parsing, so make sure
Packit Service 688f9c
    # there is one (and only one) here.
Packit Service 688f9c
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit Service 688f9c
          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
Packit Service 688f9c
    while :; do
Packit Service 688f9c
      # Processed it all yet?
Packit Service 688f9c
      if test / = "$func_normal_abspath_tpath"; then
Packit Service 688f9c
        # If we ascended to the root using ".." the result may be empty now.
Packit Service 688f9c
        if test -z "$func_normal_abspath_result"; then
Packit Service 688f9c
          func_normal_abspath_result=/
Packit Service 688f9c
        fi
Packit Service 688f9c
        break
Packit Service 688f9c
      fi
Packit Service 688f9c
      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit Service 688f9c
          -e "$_G_pathcar"`
Packit Service 688f9c
      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
Packit Service 688f9c
          -e "$_G_pathcdr"`
Packit Service 688f9c
      # Figure out what to do with it
Packit Service 688f9c
      case $func_normal_abspath_tcomponent in
Packit Service 688f9c
        "")
Packit Service 688f9c
          # Trailing empty path component, ignore it.
Packit Service 688f9c
          ;;
Packit Service 688f9c
        ..)
Packit Service 688f9c
          # Parent dir; strip last assembled component from result.
Packit Service 688f9c
          func_dirname "$func_normal_abspath_result"
Packit Service 688f9c
          func_normal_abspath_result=$func_dirname_result
Packit Service 688f9c
          ;;
Packit Service 688f9c
        *)
Packit Service 688f9c
          # Actual path component, append it.
Packit Service 688f9c
          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
Packit Service 688f9c
          ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
    done
Packit Service 688f9c
    # Restore leading double-slash if one was found on entry.
Packit Service 688f9c
    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_notquiet ARG...
Packit Service 688f9c
# --------------------
Packit Service 688f9c
# Echo program name prefixed message only when not in quiet mode.
Packit Service 688f9c
func_notquiet ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $opt_quiet || func_echo ${1+"$@"}
Packit Service 688f9c
Packit Service 688f9c
    # A bug in bash halts the script if the last line of a function
Packit Service 688f9c
    # fails when set -e is in force, so we need another command to
Packit Service 688f9c
    # work around that:
Packit Service 688f9c
    :
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_relative_path SRCDIR DSTDIR
Packit Service 688f9c
# --------------------------------
Packit Service 688f9c
# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
Packit Service 688f9c
func_relative_path ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_relative_path_result=
Packit Service 688f9c
    func_normal_abspath "$1"
Packit Service 688f9c
    func_relative_path_tlibdir=$func_normal_abspath_result
Packit Service 688f9c
    func_normal_abspath "$2"
Packit Service 688f9c
    func_relative_path_tbindir=$func_normal_abspath_result
Packit Service 688f9c
Packit Service 688f9c
    # Ascend the tree starting from libdir
Packit Service 688f9c
    while :; do
Packit Service 688f9c
      # check if we have found a prefix of bindir
Packit Service 688f9c
      case $func_relative_path_tbindir in
Packit Service 688f9c
        $func_relative_path_tlibdir)
Packit Service 688f9c
          # found an exact match
Packit Service 688f9c
          func_relative_path_tcancelled=
Packit Service 688f9c
          break
Packit Service 688f9c
          ;;
Packit Service 688f9c
        $func_relative_path_tlibdir*)
Packit Service 688f9c
          # found a matching prefix
Packit Service 688f9c
          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
Packit Service 688f9c
          func_relative_path_tcancelled=$func_stripname_result
Packit Service 688f9c
          if test -z "$func_relative_path_result"; then
Packit Service 688f9c
            func_relative_path_result=.
Packit Service 688f9c
          fi
Packit Service 688f9c
          break
Packit Service 688f9c
          ;;
Packit Service 688f9c
        *)
Packit Service 688f9c
          func_dirname $func_relative_path_tlibdir
Packit Service 688f9c
          func_relative_path_tlibdir=$func_dirname_result
Packit Service 688f9c
          if test -z "$func_relative_path_tlibdir"; then
Packit Service 688f9c
            # Have to descend all the way to the root!
Packit Service 688f9c
            func_relative_path_result=../$func_relative_path_result
Packit Service 688f9c
            func_relative_path_tcancelled=$func_relative_path_tbindir
Packit Service 688f9c
            break
Packit Service 688f9c
          fi
Packit Service 688f9c
          func_relative_path_result=../$func_relative_path_result
Packit Service 688f9c
          ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
    done
Packit Service 688f9c
Packit Service 688f9c
    # Now calculate path; take care to avoid doubling-up slashes.
Packit Service 688f9c
    func_stripname '' '/' "$func_relative_path_result"
Packit Service 688f9c
    func_relative_path_result=$func_stripname_result
Packit Service 688f9c
    func_stripname '/' '/' "$func_relative_path_tcancelled"
Packit Service 688f9c
    if test -n "$func_stripname_result"; then
Packit Service 688f9c
      func_append func_relative_path_result "/$func_stripname_result"
Packit Service 688f9c
    fi
Packit Service 688f9c
Packit Service 688f9c
    # Normalisation. If bindir is libdir, return '.' else relative path.
Packit Service 688f9c
    if test -n "$func_relative_path_result"; then
Packit Service 688f9c
      func_stripname './' '' "$func_relative_path_result"
Packit Service 688f9c
      func_relative_path_result=$func_stripname_result
Packit Service 688f9c
    fi
Packit Service 688f9c
Packit Service 688f9c
    test -n "$func_relative_path_result" || func_relative_path_result=.
Packit Service 688f9c
Packit Service 688f9c
    :
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_quote_for_eval ARG...
Packit Service 688f9c
# --------------------------
Packit Service 688f9c
# Aesthetically quote ARGs to be evaled later.
Packit Service 688f9c
# This function returns two values:
Packit Service 688f9c
#   i) func_quote_for_eval_result
Packit Service 688f9c
#      double-quoted, suitable for a subsequent eval
Packit Service 688f9c
#  ii) func_quote_for_eval_unquoted_result
Packit Service 688f9c
#      has all characters that are still active within double
Packit Service 688f9c
#      quotes backslashified.
Packit Service 688f9c
func_quote_for_eval ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_quote_for_eval_unquoted_result=
Packit Service 688f9c
    func_quote_for_eval_result=
Packit Service 688f9c
    while test 0 -lt $#; do
Packit Service 688f9c
      case $1 in
Packit Service 688f9c
        *[\\\`\"\$]*)
Packit Service 688f9c
	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
Packit Service 688f9c
        *)
Packit Service 688f9c
          _G_unquoted_arg=$1 ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
      if test -n "$func_quote_for_eval_unquoted_result"; then
Packit Service 688f9c
	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
Packit Service 688f9c
      else
Packit Service 688f9c
        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
Packit Service 688f9c
      fi
Packit Service 688f9c
Packit Service 688f9c
      case $_G_unquoted_arg in
Packit Service 688f9c
        # Double-quote args containing shell metacharacters to delay
Packit Service 688f9c
        # word splitting, command substitution and variable expansion
Packit Service 688f9c
        # for a subsequent eval.
Packit Service 688f9c
        # Many Bourne shells cannot handle close brackets correctly
Packit Service 688f9c
        # in scan sets, so we specify it separately.
Packit Service 688f9c
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit Service 688f9c
          _G_quoted_arg=\"$_G_unquoted_arg\"
Packit Service 688f9c
          ;;
Packit Service 688f9c
        *)
Packit Service 688f9c
          _G_quoted_arg=$_G_unquoted_arg
Packit Service 688f9c
	  ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
Packit Service 688f9c
      if test -n "$func_quote_for_eval_result"; then
Packit Service 688f9c
	func_append func_quote_for_eval_result " $_G_quoted_arg"
Packit Service 688f9c
      else
Packit Service 688f9c
        func_append func_quote_for_eval_result "$_G_quoted_arg"
Packit Service 688f9c
      fi
Packit Service 688f9c
      shift
Packit Service 688f9c
    done
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_quote_for_expand ARG
Packit Service 688f9c
# -------------------------
Packit 874993
# Aesthetically quote ARG to be evaled later; same as above,
Packit 874993
# but do not quote variable references.
Packit 874993
func_quote_for_expand ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit 874993
    case $1 in
Packit 874993
      *[\\\`\"]*)
Packit Service 688f9c
	_G_arg=`$ECHO "$1" | $SED \
Packit Service 688f9c
	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
Packit 874993
      *)
Packit Service 688f9c
        _G_arg=$1 ;;
Packit 874993
    esac
Packit 874993
Packit Service 688f9c
    case $_G_arg in
Packit 874993
      # Double-quote args containing shell metacharacters to delay
Packit 874993
      # word splitting and command substitution for a subsequent eval.
Packit 874993
      # Many Bourne shells cannot handle close brackets correctly
Packit 874993
      # in scan sets, so we specify it separately.
Packit 874993
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
Packit Service 688f9c
        _G_arg=\"$_G_arg\"
Packit 874993
        ;;
Packit 874993
    esac
Packit 874993
Packit Service 688f9c
    func_quote_for_expand_result=$_G_arg
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_stripname PREFIX SUFFIX NAME
Packit Service 688f9c
# ---------------------------------
Packit Service 688f9c
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
Packit Service 688f9c
# PREFIX and SUFFIX must not contain globbing or regex special
Packit Service 688f9c
# characters, hashes, percent signs, but SUFFIX may contain a leading
Packit Service 688f9c
# dot (in which case that matches only a dot).
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"; then
Packit Service 688f9c
  eval 'func_stripname ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
Packit Service 688f9c
    # positional parameters, so assign one to ordinary variable first.
Packit Service 688f9c
    func_stripname_result=$3
Packit Service 688f9c
    func_stripname_result=${func_stripname_result#"$1"}
Packit Service 688f9c
    func_stripname_result=${func_stripname_result%"$2"}
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  func_stripname ()
Packit Service 688f9c
  {
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    case $2 in
Packit Service 688f9c
      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
Packit Service 688f9c
      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
Packit Service 688f9c
    esac
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_show_eval CMD [FAIL_EXP]
Packit Service 688f9c
# -----------------------------
Packit Service 688f9c
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
Packit Service 688f9c
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit Service 688f9c
# is given, then evaluate it.
Packit Service 688f9c
func_show_eval ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    _G_cmd=$1
Packit Service 688f9c
    _G_fail_exp=${2-':'}
Packit Service 688f9c
Packit Service 688f9c
    func_quote_for_expand "$_G_cmd"
Packit Service 688f9c
    eval "func_notquiet $func_quote_for_expand_result"
Packit Service 688f9c
Packit Service 688f9c
    $opt_dry_run || {
Packit Service 688f9c
      eval "$_G_cmd"
Packit Service 688f9c
      _G_status=$?
Packit Service 688f9c
      if test 0 -ne "$_G_status"; then
Packit Service 688f9c
	eval "(exit $_G_status); $_G_fail_exp"
Packit Service 688f9c
      fi
Packit Service 688f9c
    }
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_show_eval_locale CMD [FAIL_EXP]
Packit Service 688f9c
# ------------------------------------
Packit Service 688f9c
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
Packit Service 688f9c
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
Packit Service 688f9c
# is given, then evaluate it.  Use the saved locale for evaluation.
Packit Service 688f9c
func_show_eval_locale ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    _G_cmd=$1
Packit Service 688f9c
    _G_fail_exp=${2-':'}
Packit Service 688f9c
Packit Service 688f9c
    $opt_quiet || {
Packit Service 688f9c
      func_quote_for_expand "$_G_cmd"
Packit Service 688f9c
      eval "func_echo $func_quote_for_expand_result"
Packit Service 688f9c
    }
Packit Service 688f9c
Packit Service 688f9c
    $opt_dry_run || {
Packit Service 688f9c
      eval "$_G_user_locale
Packit Service 688f9c
	    $_G_cmd"
Packit Service 688f9c
      _G_status=$?
Packit Service 688f9c
      eval "$_G_safe_locale"
Packit Service 688f9c
      if test 0 -ne "$_G_status"; then
Packit Service 688f9c
	eval "(exit $_G_status); $_G_fail_exp"
Packit Service 688f9c
      fi
Packit Service 688f9c
    }
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_tr_sh
Packit Service 688f9c
# ----------
Packit Service 688f9c
# Turn $1 into a string suitable for a shell variable name.
Packit Service 688f9c
# Result is stored in $func_tr_sh_result.  All characters
Packit Service 688f9c
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
Packit Service 688f9c
# if $1 begins with a digit, a '_' is prepended as well.
Packit Service 688f9c
func_tr_sh ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    case $1 in
Packit Service 688f9c
    [0-9]* | *[!a-zA-Z0-9_]*)
Packit Service 688f9c
      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
Packit Service 688f9c
      ;;
Packit Service 688f9c
    * )
Packit Service 688f9c
      func_tr_sh_result=$1
Packit Service 688f9c
      ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_verbose ARG...
Packit Service 688f9c
# -------------------
Packit Service 688f9c
# Echo program name prefixed message in verbose mode only.
Packit Service 688f9c
func_verbose ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $opt_verbose && func_echo "$*"
Packit Service 688f9c
Packit Service 688f9c
    :
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_warn_and_continue ARG...
Packit Service 688f9c
# -----------------------------
Packit Service 688f9c
# Echo program name prefixed warning message to standard error.
Packit Service 688f9c
func_warn_and_continue ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $require_term_colors
Packit Service 688f9c
Packit Service 688f9c
    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_warning CATEGORY ARG...
Packit Service 688f9c
# ----------------------------
Packit Service 688f9c
# Echo program name prefixed warning message to standard error. Warning
Packit Service 688f9c
# messages can be filtered according to CATEGORY, where this function
Packit Service 688f9c
# elides messages where CATEGORY is not listed in the global variable
Packit Service 688f9c
# 'opt_warning_types'.
Packit Service 688f9c
func_warning ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    # CATEGORY must be in the warning_categories list!
Packit Service 688f9c
    case " $warning_categories " in
Packit Service 688f9c
      *" $1 "*) ;;
Packit Service 688f9c
      *) func_internal_error "invalid warning category '$1'" ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
Packit Service 688f9c
    _G_category=$1
Packit Service 688f9c
    shift
Packit Service 688f9c
Packit Service 688f9c
    case " $opt_warning_types " in
Packit Service 688f9c
      *" $_G_category "*) $warning_func ${1+"$@"} ;;
Packit Service 688f9c
    esac
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_sort_ver VER1 VER2
Packit Service 688f9c
# -----------------------
Packit Service 688f9c
# 'sort -V' is not generally available.
Packit Service 688f9c
# Note this deviates from the version comparison in automake
Packit Service 688f9c
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
Packit Service 688f9c
# but this should suffice as we won't be specifying old
Packit Service 688f9c
# version formats or redundant trailing .0 in bootstrap.conf.
Packit Service 688f9c
# If we did want full compatibility then we should probably
Packit Service 688f9c
# use m4_version_compare from autoconf.
Packit Service 688f9c
func_sort_ver ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    printf '%s\n%s\n' "$1" "$2" \
Packit Service 688f9c
      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
# func_lt_ver PREV CURR
Packit Service 688f9c
# ---------------------
Packit Service 688f9c
# Return true if PREV and CURR are in the correct order according to
Packit Service 688f9c
# func_sort_ver, otherwise false.  Use it like this:
Packit Service 688f9c
#
Packit Service 688f9c
#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
Packit Service 688f9c
func_lt_ver ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# Local variables:
Packit Service 688f9c
# mode: shell-script
Packit Service 688f9c
# sh-indentation: 2
Packit Service 688f9c
# eval: (add-hook 'before-save-hook 'time-stamp)
Packit Service 688f9c
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
Packit Service 688f9c
# time-stamp-time-zone: "UTC"
Packit Service 688f9c
# End:
Packit Service 688f9c
#! /bin/sh
Packit Service 688f9c
Packit Service 688f9c
# Set a version string for this script.
Packit Service 688f9c
scriptversion=2014-01-07.03; # UTC
Packit Service 688f9c
Packit Service 688f9c
# A portable, pluggable option parser for Bourne shell.
Packit Service 688f9c
# Written by Gary V. Vaughan, 2010
Packit Service 688f9c
Packit Service 688f9c
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
Packit Service 688f9c
# This is free software; see the source for copying conditions.  There is NO
Packit Service 688f9c
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 688f9c
Packit Service 688f9c
# This program is free software: you can redistribute it and/or modify
Packit Service 688f9c
# it under the terms of the GNU General Public License as published by
Packit Service 688f9c
# the Free Software Foundation, either version 3 of the License, or
Packit Service 688f9c
# (at your option) any later version.
Packit Service 688f9c
Packit Service 688f9c
# This program is distributed in the hope that it will be useful,
Packit Service 688f9c
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 688f9c
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 688f9c
# GNU General Public License for more details.
Packit Service 688f9c
Packit Service 688f9c
# You should have received a copy of the GNU General Public License
Packit Service 688f9c
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 688f9c
Packit Service 688f9c
# Please report bugs or propose patches to gary@gnu.org.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
## Usage. ##
Packit Service 688f9c
## ------ ##
Packit Service 688f9c
Packit Service 688f9c
# This file is a library for parsing options in your shell scripts along
Packit Service 688f9c
# with assorted other useful supporting features that you can make use
Packit Service 688f9c
# of too.
Packit Service 688f9c
#
Packit Service 688f9c
# For the simplest scripts you might need only:
Packit Service 688f9c
#
Packit Service 688f9c
#   #!/bin/sh
Packit Service 688f9c
#   . relative/path/to/funclib.sh
Packit Service 688f9c
#   . relative/path/to/options-parser
Packit Service 688f9c
#   scriptversion=1.0
Packit Service 688f9c
#   func_options ${1+"$@"}
Packit Service 688f9c
#   eval set dummy "$func_options_result"; shift
Packit Service 688f9c
#   ...rest of your script...
Packit Service 688f9c
#
Packit Service 688f9c
# In order for the '--version' option to work, you will need to have a
Packit Service 688f9c
# suitably formatted comment like the one at the top of this file
Packit Service 688f9c
# starting with '# Written by ' and ending with '# warranty; '.
Packit Service 688f9c
#
Packit Service 688f9c
# For '-h' and '--help' to work, you will also need a one line
Packit Service 688f9c
# description of your script's purpose in a comment directly above the
Packit Service 688f9c
# '# Written by ' line, like the one at the top of this file.
Packit Service 688f9c
#
Packit Service 688f9c
# The default options also support '--debug', which will turn on shell
Packit Service 688f9c
# execution tracing (see the comment above debug_cmd below for another
Packit Service 688f9c
# use), and '--verbose' and the func_verbose function to allow your script
Packit Service 688f9c
# to display verbose messages only when your user has specified
Packit Service 688f9c
# '--verbose'.
Packit Service 688f9c
#
Packit Service 688f9c
# After sourcing this file, you can plug processing for additional
Packit Service 688f9c
# options by amending the variables from the 'Configuration' section
Packit Service 688f9c
# below, and following the instructions in the 'Option parsing'
Packit Service 688f9c
# section further down.
Packit Service 688f9c
Packit Service 688f9c
## -------------- ##
Packit Service 688f9c
## Configuration. ##
Packit Service 688f9c
## -------------- ##
Packit Service 688f9c
Packit Service 688f9c
# You should override these variables in your script after sourcing this
Packit Service 688f9c
# file so that they reflect the customisations you have added to the
Packit Service 688f9c
# option parser.
Packit Service 688f9c
Packit Service 688f9c
# The usage line for option parsing errors and the start of '-h' and
Packit Service 688f9c
# '--help' output messages. You can embed shell variables for delayed
Packit Service 688f9c
# expansion at the time the message is displayed, but you will need to
Packit Service 688f9c
# quote other shell meta-characters carefully to prevent them being
Packit Service 688f9c
# expanded when the contents are evaled.
Packit Service 688f9c
usage='$progpath [OPTION]...'
Packit Service 688f9c
Packit Service 688f9c
# Short help message in response to '-h' and '--help'.  Add to this or
Packit Service 688f9c
# override it after sourcing this library to reflect the full set of
Packit Service 688f9c
# options your script accepts.
Packit Service 688f9c
usage_message="\
Packit Service 688f9c
       --debug        enable verbose shell tracing
Packit Service 688f9c
   -W, --warnings=CATEGORY
Packit Service 688f9c
                      report the warnings falling in CATEGORY [all]
Packit Service 688f9c
   -v, --verbose      verbosely report processing
Packit Service 688f9c
       --version      print version information and exit
Packit Service 688f9c
   -h, --help         print short or long help message and exit
Packit Service 688f9c
"
Packit Service 688f9c
Packit Service 688f9c
# Additional text appended to 'usage_message' in response to '--help'.
Packit Service 688f9c
long_help_message="
Packit Service 688f9c
Warning categories include:
Packit Service 688f9c
       'all'          show all warnings
Packit Service 688f9c
       'none'         turn off all the warnings
Packit Service 688f9c
       'error'        warnings are treated as fatal errors"
Packit Service 688f9c
Packit Service 688f9c
# Help message printed before fatal option parsing errors.
Packit Service 688f9c
fatal_help="Try '\$progname --help' for more information."
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ------------------------- ##
Packit Service 688f9c
## Hook function management. ##
Packit Service 688f9c
## ------------------------- ##
Packit Service 688f9c
Packit Service 688f9c
# This section contains functions for adding, removing, and running hooks
Packit Service 688f9c
# to the main code.  A hook is just a named list of of function, that can
Packit Service 688f9c
# be run in order later on.
Packit Service 688f9c
Packit Service 688f9c
# func_hookable FUNC_NAME
Packit Service 688f9c
# -----------------------
Packit Service 688f9c
# Declare that FUNC_NAME will run hooks added with
Packit Service 688f9c
# 'func_add_hook FUNC_NAME ...'.
Packit Service 688f9c
func_hookable ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_append hookable_fns " $1"
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_add_hook FUNC_NAME HOOK_FUNC
Packit Service 688f9c
# ---------------------------------
Packit Service 688f9c
# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
Packit Service 688f9c
# first have been declared "hookable" by a call to 'func_hookable'.
Packit Service 688f9c
func_add_hook ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    case " $hookable_fns " in
Packit Service 688f9c
      *" $1 "*) ;;
Packit Service 688f9c
      *) func_fatal_error "'$1' does not accept hook functions." ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
Packit Service 688f9c
    eval func_append ${1}_hooks '" $2"'
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_remove_hook FUNC_NAME HOOK_FUNC
Packit Service 688f9c
# ------------------------------------
Packit Service 688f9c
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
Packit Service 688f9c
func_remove_hook ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_run_hooks FUNC_NAME [ARG]...
Packit Service 688f9c
# ---------------------------------
Packit Service 688f9c
# Run all hook functions registered to FUNC_NAME.
Packit Service 688f9c
# It is assumed that the list of hook functions contains nothing more
Packit Service 688f9c
# than a whitespace-delimited list of legal shell function names, and
Packit Service 688f9c
# no effort is wasted trying to catch shell meta-characters or preserve
Packit Service 688f9c
# whitespace.
Packit Service 688f9c
func_run_hooks ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    case " $hookable_fns " in
Packit Service 688f9c
      *" $1 "*) ;;
Packit Service 688f9c
      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
Packit Service 688f9c
    eval _G_hook_fns=\$$1_hooks; shift
Packit Service 688f9c
Packit Service 688f9c
    for _G_hook in $_G_hook_fns; do
Packit Service 688f9c
      eval $_G_hook '"$@"'
Packit Service 688f9c
Packit Service 688f9c
      # store returned options list back into positional
Packit Service 688f9c
      # parameters for next 'cmd' execution.
Packit Service 688f9c
      eval _G_hook_result=\$${_G_hook}_result
Packit Service 688f9c
      eval set dummy "$_G_hook_result"; shift
Packit Service 688f9c
    done
Packit Service 688f9c
Packit Service 688f9c
    func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
    func_run_hooks_result=$func_quote_for_eval_result
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## --------------- ##
Packit Service 688f9c
## Option parsing. ##
Packit Service 688f9c
## --------------- ##
Packit Service 688f9c
Packit Service 688f9c
# In order to add your own option parsing hooks, you must accept the
Packit Service 688f9c
# full positional parameter list in your hook function, remove any
Packit Service 688f9c
# options that you action, and then pass back the remaining unprocessed
Packit Service 688f9c
# options in '<hooked_function_name>_result', escaped suitably for
Packit Service 688f9c
# 'eval'.  Like this:
Packit Service 688f9c
#
Packit Service 688f9c
#    my_options_prep ()
Packit Service 688f9c
#    {
Packit Service 688f9c
#        $debug_cmd
Packit Service 688f9c
#
Packit Service 688f9c
#        # Extend the existing usage message.
Packit Service 688f9c
#        usage_message=$usage_message'
Packit Service 688f9c
#      -s, --silent       don'\''t print informational messages
Packit Service 688f9c
#    '
Packit Service 688f9c
#
Packit Service 688f9c
#        func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
#        my_options_prep_result=$func_quote_for_eval_result
Packit Service 688f9c
#    }
Packit Service 688f9c
#    func_add_hook func_options_prep my_options_prep
Packit Service 688f9c
#
Packit Service 688f9c
#
Packit Service 688f9c
#    my_silent_option ()
Packit Service 688f9c
#    {
Packit Service 688f9c
#        $debug_cmd
Packit Service 688f9c
#
Packit Service 688f9c
#        # Note that for efficiency, we parse as many options as we can
Packit Service 688f9c
#        # recognise in a loop before passing the remainder back to the
Packit Service 688f9c
#        # caller on the first unrecognised argument we encounter.
Packit Service 688f9c
#        while test $# -gt 0; do
Packit Service 688f9c
#          opt=$1; shift
Packit Service 688f9c
#          case $opt in
Packit Service 688f9c
#            --silent|-s) opt_silent=: ;;
Packit Service 688f9c
#            # Separate non-argument short options:
Packit Service 688f9c
#            -s*)         func_split_short_opt "$_G_opt"
Packit Service 688f9c
#                         set dummy "$func_split_short_opt_name" \
Packit Service 688f9c
#                             "-$func_split_short_opt_arg" ${1+"$@"}
Packit Service 688f9c
#                         shift
Packit Service 688f9c
#                         ;;
Packit Service 688f9c
#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
Packit Service 688f9c
#          esac
Packit Service 688f9c
#        done
Packit Service 688f9c
#
Packit Service 688f9c
#        func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
#        my_silent_option_result=$func_quote_for_eval_result
Packit Service 688f9c
#    }
Packit Service 688f9c
#    func_add_hook func_parse_options my_silent_option
Packit Service 688f9c
#
Packit Service 688f9c
#
Packit Service 688f9c
#    my_option_validation ()
Packit Service 688f9c
#    {
Packit Service 688f9c
#        $debug_cmd
Packit Service 688f9c
#
Packit Service 688f9c
#        $opt_silent && $opt_verbose && func_fatal_help "\
Packit Service 688f9c
#    '--silent' and '--verbose' options are mutually exclusive."
Packit Service 688f9c
#
Packit Service 688f9c
#        func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
#        my_option_validation_result=$func_quote_for_eval_result
Packit Service 688f9c
#    }
Packit Service 688f9c
#    func_add_hook func_validate_options my_option_validation
Packit Service 688f9c
#
Packit Service 688f9c
# You'll alse need to manually amend $usage_message to reflect the extra
Packit Service 688f9c
# options you parse.  It's preferable to append if you can, so that
Packit Service 688f9c
# multiple option parsing hooks can be added safely.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_options [ARG]...
Packit Service 688f9c
# ---------------------
Packit Service 688f9c
# All the functions called inside func_options are hookable. See the
Packit Service 688f9c
# individual implementations for details.
Packit Service 688f9c
func_hookable func_options
Packit Service 688f9c
func_options ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    func_options_prep ${1+"$@"}
Packit Service 688f9c
    eval func_parse_options \
Packit Service 688f9c
        ${func_options_prep_result+"$func_options_prep_result"}
Packit Service 688f9c
    eval func_validate_options \
Packit Service 688f9c
        ${func_parse_options_result+"$func_parse_options_result"}
Packit 874993
Packit Service 688f9c
    eval func_run_hooks func_options \
Packit Service 688f9c
        ${func_validate_options_result+"$func_validate_options_result"}
Packit Service 688f9c
Packit Service 688f9c
    # save modified positional parameters for caller
Packit Service 688f9c
    func_options_result=$func_run_hooks_result
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_options_prep [ARG]...
Packit Service 688f9c
# --------------------------
Packit Service 688f9c
# All initialisations required before starting the option parse loop.
Packit Service 688f9c
# Note that when calling hook functions, we pass through the list of
Packit Service 688f9c
# positional parameters.  If a hook function modifies that list, and
Packit Service 688f9c
# needs to propogate that back to rest of this script, then the complete
Packit Service 688f9c
# modified list must be put in 'func_run_hooks_result' before
Packit Service 688f9c
# returning.
Packit Service 688f9c
func_hookable func_options_prep
Packit Service 688f9c
func_options_prep ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    # Option defaults:
Packit Service 688f9c
    opt_verbose=false
Packit Service 688f9c
    opt_warning_types=
Packit 874993
Packit Service 688f9c
    func_run_hooks func_options_prep ${1+"$@"}
Packit Service 688f9c
Packit Service 688f9c
    # save modified positional parameters for caller
Packit Service 688f9c
    func_options_prep_result=$func_run_hooks_result
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
# func_parse_options [ARG]...
Packit Service 688f9c
# ---------------------------
Packit Service 688f9c
# The main option parsing loop.
Packit Service 688f9c
func_hookable func_parse_options
Packit Service 688f9c
func_parse_options ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_parse_options_result=
Packit Service 688f9c
Packit Service 688f9c
    # this just eases exit handling
Packit Service 688f9c
    while test $# -gt 0; do
Packit Service 688f9c
      # Defer to hook functions for initial option parsing, so they
Packit Service 688f9c
      # get priority in the event of reusing an option name.
Packit Service 688f9c
      func_run_hooks func_parse_options ${1+"$@"}
Packit Service 688f9c
Packit Service 688f9c
      # Adjust func_parse_options positional parameters to match
Packit Service 688f9c
      eval set dummy "$func_run_hooks_result"; shift
Packit Service 688f9c
Packit Service 688f9c
      # Break out of the loop if we already parsed every option.
Packit Service 688f9c
      test $# -gt 0 || break
Packit Service 688f9c
Packit Service 688f9c
      _G_opt=$1
Packit Service 688f9c
      shift
Packit Service 688f9c
      case $_G_opt in
Packit Service 688f9c
        --debug|-x)   debug_cmd='set -x'
Packit Service 688f9c
                      func_echo "enabling shell trace mode"
Packit Service 688f9c
                      $debug_cmd
Packit Service 688f9c
                      ;;
Packit Service 688f9c
Packit Service 688f9c
        --no-warnings|--no-warning|--no-warn)
Packit Service 688f9c
                      set dummy --warnings none ${1+"$@"}
Packit Service 688f9c
                      shift
Packit Service 688f9c
		      ;;
Packit Service 688f9c
Packit Service 688f9c
        --warnings|--warning|-W)
Packit Service 688f9c
                      test $# = 0 && func_missing_arg $_G_opt && break
Packit Service 688f9c
                      case " $warning_categories $1" in
Packit Service 688f9c
                        *" $1 "*)
Packit Service 688f9c
                          # trailing space prevents matching last $1 above
Packit Service 688f9c
                          func_append_uniq opt_warning_types " $1"
Packit Service 688f9c
                          ;;
Packit Service 688f9c
                        *all)
Packit Service 688f9c
                          opt_warning_types=$warning_categories
Packit Service 688f9c
                          ;;
Packit Service 688f9c
                        *none)
Packit Service 688f9c
                          opt_warning_types=none
Packit Service 688f9c
                          warning_func=:
Packit Service 688f9c
                          ;;
Packit Service 688f9c
                        *error)
Packit Service 688f9c
                          opt_warning_types=$warning_categories
Packit Service 688f9c
                          warning_func=func_fatal_error
Packit Service 688f9c
                          ;;
Packit Service 688f9c
                        *)
Packit Service 688f9c
                          func_fatal_error \
Packit Service 688f9c
                             "unsupported warning category: '$1'"
Packit Service 688f9c
                          ;;
Packit Service 688f9c
                      esac
Packit Service 688f9c
                      shift
Packit Service 688f9c
                      ;;
Packit Service 688f9c
Packit Service 688f9c
        --verbose|-v) opt_verbose=: ;;
Packit Service 688f9c
        --version)    func_version ;;
Packit Service 688f9c
        -\?|-h)       func_usage ;;
Packit Service 688f9c
        --help)       func_help ;;
Packit Service 688f9c
Packit Service 688f9c
	# Separate optargs to long options (plugins may need this):
Packit Service 688f9c
	--*=*)        func_split_equals "$_G_opt"
Packit Service 688f9c
	              set dummy "$func_split_equals_lhs" \
Packit Service 688f9c
                          "$func_split_equals_rhs" ${1+"$@"}
Packit Service 688f9c
                      shift
Packit Service 688f9c
                      ;;
Packit Service 688f9c
Packit Service 688f9c
       # Separate optargs to short options:
Packit Service 688f9c
        -W*)
Packit Service 688f9c
                      func_split_short_opt "$_G_opt"
Packit Service 688f9c
                      set dummy "$func_split_short_opt_name" \
Packit Service 688f9c
                          "$func_split_short_opt_arg" ${1+"$@"}
Packit Service 688f9c
                      shift
Packit Service 688f9c
                      ;;
Packit Service 688f9c
Packit Service 688f9c
        # Separate non-argument short options:
Packit Service 688f9c
        -\?*|-h*|-v*|-x*)
Packit Service 688f9c
                      func_split_short_opt "$_G_opt"
Packit Service 688f9c
                      set dummy "$func_split_short_opt_name" \
Packit Service 688f9c
                          "-$func_split_short_opt_arg" ${1+"$@"}
Packit Service 688f9c
                      shift
Packit Service 688f9c
                      ;;
Packit Service 688f9c
Packit Service 688f9c
        --)           break ;;
Packit Service 688f9c
        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
Packit Service 688f9c
        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
    done
Packit Service 688f9c
Packit Service 688f9c
    # save modified positional parameters for caller
Packit Service 688f9c
    func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
    func_parse_options_result=$func_quote_for_eval_result
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_validate_options [ARG]...
Packit Service 688f9c
# ------------------------------
Packit Service 688f9c
# Perform any sanity checks on option settings and/or unconsumed
Packit Service 688f9c
# arguments.
Packit Service 688f9c
func_hookable func_validate_options
Packit Service 688f9c
func_validate_options ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    # Display all warnings if -W was not given.
Packit Service 688f9c
    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
Packit Service 688f9c
Packit Service 688f9c
    func_run_hooks func_validate_options ${1+"$@"}
Packit Service 688f9c
Packit Service 688f9c
    # Bail if the options were screwed!
Packit Service 688f9c
    $exit_cmd $EXIT_FAILURE
Packit Service 688f9c
Packit Service 688f9c
    # save modified positional parameters for caller
Packit Service 688f9c
    func_validate_options_result=$func_run_hooks_result
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
## Helper functions. ##
Packit Service 688f9c
## ----------------- ##
Packit Service 688f9c
Packit Service 688f9c
# This section contains the helper functions used by the rest of the
Packit Service 688f9c
# hookable option parser framework in ascii-betical order.
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_fatal_help ARG...
Packit Service 688f9c
# ----------------------
Packit Service 688f9c
# Echo program name prefixed message to standard error, followed by
Packit Service 688f9c
# a help hint, and exit.
Packit Service 688f9c
func_fatal_help ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    eval \$ECHO \""Usage: $usage"\"
Packit Service 688f9c
    eval \$ECHO \""$fatal_help"\"
Packit Service 688f9c
    func_error ${1+"$@"}
Packit Service 688f9c
    exit $EXIT_FAILURE
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
# func_help
Packit Service 688f9c
# ---------
Packit Service 688f9c
# Echo long help message to standard output and exit.
Packit 874993
func_help ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_usage_message
Packit Service 688f9c
    $ECHO "$long_help_message"
Packit Service 688f9c
    exit 0
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
# func_missing_arg ARGNAME
Packit Service 688f9c
# ------------------------
Packit 874993
# Echo program name prefixed message to standard error and set global
Packit 874993
# exit_cmd.
Packit 874993
func_missing_arg ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    func_error "Missing argument for '$1'."
Packit 874993
    exit_cmd=exit
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_split_equals STRING
Packit Service 688f9c
# ------------------------
Packit Service 688f9c
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
Packit Service 688f9c
# splitting STRING at the '=' sign.
Packit Service 688f9c
test -z "$_G_HAVE_XSI_OPS" \
Packit Service 688f9c
    && (eval 'x=a/b/c;
Packit Service 688f9c
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
Packit Service 688f9c
    && _G_HAVE_XSI_OPS=yes
Packit Service 688f9c
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"
Packit Service 688f9c
then
Packit Service 688f9c
  # This is an XSI compatible shell, allowing a faster implementation...
Packit Service 688f9c
  eval 'func_split_equals ()
Packit Service 688f9c
  {
Packit Service 688f9c
      $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
      func_split_equals_lhs=${1%%=*}
Packit Service 688f9c
      func_split_equals_rhs=${1#*=}
Packit Service 688f9c
      test "x$func_split_equals_lhs" = "x$1" \
Packit Service 688f9c
        && func_split_equals_rhs=
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  # ...otherwise fall back to using expr, which is often a shell builtin.
Packit Service 688f9c
  func_split_equals ()
Packit Service 688f9c
  {
Packit Service 688f9c
      $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
Packit Service 688f9c
      func_split_equals_rhs=
Packit Service 688f9c
      test "x$func_split_equals_lhs" = "x$1" \
Packit Service 688f9c
        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
Packit Service 688f9c
  }
Packit Service 688f9c
fi #func_split_equals
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_split_short_opt SHORTOPT
Packit Service 688f9c
# -----------------------------
Packit 874993
# Set func_split_short_opt_name and func_split_short_opt_arg shell
Packit 874993
# variables after splitting SHORTOPT after the 2nd character.
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"
Packit Service 688f9c
then
Packit Service 688f9c
  # This is an XSI compatible shell, allowing a faster implementation...
Packit Service 688f9c
  eval 'func_split_short_opt ()
Packit Service 688f9c
  {
Packit Service 688f9c
      $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
      func_split_short_opt_arg=${1#??}
Packit Service 688f9c
      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  # ...otherwise fall back to using expr, which is often a shell builtin.
Packit Service 688f9c
  func_split_short_opt ()
Packit Service 688f9c
  {
Packit Service 688f9c
      $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
Packit Service 688f9c
      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
Packit Service 688f9c
  }
Packit Service 688f9c
fi #func_split_short_opt
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# func_usage
Packit Service 688f9c
# ----------
Packit Service 688f9c
# Echo short help message to standard output and exit.
Packit Service 688f9c
func_usage ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    func_usage_message
Packit Service 688f9c
    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
Packit Service 688f9c
    exit 0
Packit Service 688f9c
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_usage_message
Packit Service 688f9c
# ------------------
Packit Service 688f9c
# Echo short help message to standard output.
Packit Service 688f9c
func_usage_message ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    eval \$ECHO \""Usage: $usage"\"
Packit Service 688f9c
    echo
Packit Service 688f9c
    $SED -n 's|^# ||
Packit Service 688f9c
        /^Written by/{
Packit Service 688f9c
          x;p;x
Packit Service 688f9c
        }
Packit Service 688f9c
	h
Packit Service 688f9c
	/^Written by/q' < "$progpath"
Packit Service 688f9c
    echo
Packit Service 688f9c
    eval \$ECHO \""$usage_message"\"
Packit Service 688f9c
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_version
Packit Service 688f9c
# ------------
Packit Service 688f9c
# Echo version message to standard output and exit.
Packit Service 688f9c
func_version ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    printf '%s\n' "$progname $scriptversion"
Packit Service 688f9c
    $SED -n '
Packit Service 688f9c
        /(C)/!b go
Packit Service 688f9c
        :more
Packit Service 688f9c
        /\./!{
Packit Service 688f9c
          N
Packit Service 688f9c
          s|\n# | |
Packit Service 688f9c
          b more
Packit Service 688f9c
        }
Packit Service 688f9c
        :go
Packit Service 688f9c
        /^# Written by /,/# warranty; / {
Packit Service 688f9c
          s|^# ||
Packit Service 688f9c
          s|^# *$||
Packit Service 688f9c
          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
Packit Service 688f9c
          p
Packit Service 688f9c
        }
Packit Service 688f9c
        /^# Written by / {
Packit Service 688f9c
          s|^# ||
Packit Service 688f9c
          p
Packit Service 688f9c
        }
Packit Service 688f9c
        /^warranty; /q' < "$progpath"
Packit 874993
Packit Service 688f9c
    exit $?
Packit Service 688f9c
}
Packit 874993
Packit 874993
Packit Service 688f9c
# Local variables:
Packit Service 688f9c
# mode: shell-script
Packit Service 688f9c
# sh-indentation: 2
Packit Service 688f9c
# eval: (add-hook 'before-save-hook 'time-stamp)
Packit Service 688f9c
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
Packit Service 688f9c
# time-stamp-time-zone: "UTC"
Packit Service 688f9c
# End:
Packit 874993
Packit Service 688f9c
# Set a version string.
Packit Service 688f9c
scriptversion='(GNU libtool) 2.4.6'
Packit 874993
Packit 874993
Packit Service 688f9c
# func_echo ARG...
Packit Service 688f9c
# ----------------
Packit Service 688f9c
# Libtool also displays the current mode in messages, so override
Packit Service 688f9c
# funclib.sh func_echo with this custom definition.
Packit Service 688f9c
func_echo ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    _G_message=$*
Packit Service 688f9c
Packit Service 688f9c
    func_echo_IFS=$IFS
Packit Service 688f9c
    IFS=$nl
Packit Service 688f9c
    for _G_line in $_G_message; do
Packit Service 688f9c
      IFS=$func_echo_IFS
Packit Service 688f9c
      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
Packit Service 688f9c
    done
Packit Service 688f9c
    IFS=$func_echo_IFS
Packit Service 688f9c
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_warning ARG...
Packit Service 688f9c
# -------------------
Packit Service 688f9c
# Libtool warnings are not categorized, so override funclib.sh
Packit Service 688f9c
# func_warning with this simpler definition.
Packit Service 688f9c
func_warning ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    $warning_func ${1+"$@"}
Packit Service 688f9c
}
Packit Service 688f9c
Packit 874993
Packit Service 688f9c
## ---------------- ##
Packit Service 688f9c
## Options parsing. ##
Packit Service 688f9c
## ---------------- ##
Packit Service 688f9c
Packit Service 688f9c
# Hook in the functions to make sure our own options are parsed during
Packit Service 688f9c
# the option parsing loop.
Packit Service 688f9c
Packit Service 688f9c
usage='$progpath [OPTION]... [MODE-ARG]...'
Packit Service 688f9c
Packit Service 688f9c
# Short help message in response to '-h'.
Packit Service 688f9c
usage_message="Options:
Packit Service 688f9c
       --config             show all configuration variables
Packit Service 688f9c
       --debug              enable verbose shell tracing
Packit Service 688f9c
   -n, --dry-run            display commands without modifying any files
Packit Service 688f9c
       --features           display basic configuration information and exit
Packit Service 688f9c
       --mode=MODE          use operation mode MODE
Packit Service 688f9c
       --no-warnings        equivalent to '-Wnone'
Packit Service 688f9c
       --preserve-dup-deps  don't remove duplicate dependency libraries
Packit Service 688f9c
       --quiet, --silent    don't print informational messages
Packit Service 688f9c
       --tag=TAG            use configuration variables from tag TAG
Packit Service 688f9c
   -v, --verbose            print more informational messages than default
Packit Service 688f9c
       --version            print version information
Packit Service 688f9c
   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
Packit Service 688f9c
   -h, --help, --help-all   print short, long, or detailed help message
Packit Service 688f9c
"
Packit 874993
Packit Service 688f9c
# Additional text appended to 'usage_message' in response to '--help'.
Packit Service 688f9c
func_help ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
    func_usage_message
Packit Service 688f9c
    $ECHO "$long_help_message
Packit Service 688f9c
Packit Service 688f9c
MODE must be one of the following:
Packit Service 688f9c
Packit Service 688f9c
       clean           remove files from the build directory
Packit Service 688f9c
       compile         compile a source file into a libtool object
Packit Service 688f9c
       execute         automatically set library path, then run a program
Packit Service 688f9c
       finish          complete the installation of libtool libraries
Packit Service 688f9c
       install         install libraries or executables
Packit Service 688f9c
       link            create a library or an executable
Packit Service 688f9c
       uninstall       remove libraries from an installed directory
Packit Service 688f9c
Packit Service 688f9c
MODE-ARGS vary depending on the MODE.  When passed as first option,
Packit Service 688f9c
'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
Packit Service 688f9c
Try '$progname --help --mode=MODE' for a more detailed description of MODE.
Packit Service 688f9c
Packit Service 688f9c
When reporting a bug, please describe a test case to reproduce it and
Packit Service 688f9c
include the following information:
Packit Service 688f9c
Packit Service 688f9c
       host-triplet:   $host
Packit Service 688f9c
       shell:          $SHELL
Packit Service 688f9c
       compiler:       $LTCC
Packit Service 688f9c
       compiler flags: $LTCFLAGS
Packit Service 688f9c
       linker:         $LD (gnu? $with_gnu_ld)
Packit Service 688f9c
       version:        $progname (GNU libtool) 2.4.6
Packit Service 688f9c
       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
Packit Service 688f9c
       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Packit Service 688f9c
Packit Service 688f9c
Report bugs to <bug-libtool@gnu.org>.
Packit Service 688f9c
GNU libtool home page: <http://www.gnu.org/software/libtool/>.
Packit Service 688f9c
General help using GNU software: <http://www.gnu.org/gethelp/>."
Packit Service 688f9c
    exit 0
Packit Service 688f9c
}
Packit 874993
Packit 874993
Packit Service 688f9c
# func_lo2o OBJECT-NAME
Packit Service 688f9c
# ---------------------
Packit Service 688f9c
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
Packit Service 688f9c
# object suffix.
Packit 874993
Packit Service 688f9c
lo2o=s/\\.lo\$/.$objext/
Packit Service 688f9c
o2lo=s/\\.$objext\$/.lo/
Packit 874993
Packit Service 688f9c
if test yes = "$_G_HAVE_XSI_OPS"; then
Packit Service 688f9c
  eval 'func_lo2o ()
Packit Service 688f9c
  {
Packit Service 688f9c
    case $1 in
Packit Service 688f9c
      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
Packit Service 688f9c
      *   ) func_lo2o_result=$1               ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
  }'
Packit Service 688f9c
Packit Service 688f9c
  # func_xform LIBOBJ-OR-SOURCE
Packit Service 688f9c
  # ---------------------------
Packit Service 688f9c
  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
Packit Service 688f9c
  # suffix to a '.lo' libtool-object suffix.
Packit Service 688f9c
  eval 'func_xform ()
Packit Service 688f9c
  {
Packit Service 688f9c
    func_xform_result=${1%.*}.lo
Packit Service 688f9c
  }'
Packit Service 688f9c
else
Packit Service 688f9c
  # ...otherwise fall back to using sed.
Packit Service 688f9c
  func_lo2o ()
Packit Service 688f9c
  {
Packit Service 688f9c
    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
Packit Service 688f9c
  }
Packit Service 688f9c
Packit Service 688f9c
  func_xform ()
Packit Service 688f9c
  {
Packit Service 688f9c
    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
Packit Service 688f9c
  }
Packit Service 688f9c
fi
Packit 874993
Packit 874993
Packit Service 688f9c
# func_fatal_configuration ARG...
Packit Service 688f9c
# -------------------------------
Packit 874993
# Echo program name prefixed message to standard error, followed by
Packit 874993
# a configuration failure hint, and exit.
Packit 874993
func_fatal_configuration ()
Packit 874993
{
Packit Service 688f9c
    func__fatal_error ${1+"$@"} \
Packit Service 688f9c
      "See the $PACKAGE documentation for more information." \
Packit Service 688f9c
      "Fatal configuration error."
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
# func_config
Packit Service 688f9c
# -----------
Packit 874993
# Display the configuration for all the tags in this script.
Packit 874993
func_config ()
Packit 874993
{
Packit 874993
    re_begincf='^# ### BEGIN LIBTOOL'
Packit 874993
    re_endcf='^# ### END LIBTOOL'
Packit 874993
Packit 874993
    # Default configuration.
Packit 874993
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
Packit 874993
Packit 874993
    # Now print the configurations for the tags.
Packit 874993
    for tagname in $taglist; do
Packit 874993
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
Packit 874993
    done
Packit 874993
Packit 874993
    exit $?
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit 874993
# func_features
Packit Service 688f9c
# -------------
Packit 874993
# Display the features supported by this script.
Packit 874993
func_features ()
Packit 874993
{
Packit 874993
    echo "host: $host"
Packit Service 688f9c
    if test yes = "$build_libtool_libs"; then
Packit 874993
      echo "enable shared libraries"
Packit 874993
    else
Packit 874993
      echo "disable shared libraries"
Packit 874993
    fi
Packit Service 688f9c
    if test yes = "$build_old_libs"; then
Packit 874993
      echo "enable static libraries"
Packit 874993
    else
Packit 874993
      echo "disable static libraries"
Packit 874993
    fi
Packit 874993
Packit 874993
    exit $?
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit Service 688f9c
# func_enable_tag TAGNAME
Packit Service 688f9c
# -----------------------
Packit 874993
# Verify that TAGNAME is valid, and either flag an error and exit, or
Packit 874993
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
Packit 874993
# variable here.
Packit 874993
func_enable_tag ()
Packit 874993
{
Packit Service 688f9c
    # Global variable:
Packit Service 688f9c
    tagname=$1
Packit 874993
Packit Service 688f9c
    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
Packit Service 688f9c
    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
Packit Service 688f9c
    sed_extractcf=/$re_begincf/,/$re_endcf/p
Packit 874993
Packit Service 688f9c
    # Validate tagname.
Packit Service 688f9c
    case $tagname in
Packit Service 688f9c
      *[!-_A-Za-z0-9,/]*)
Packit Service 688f9c
        func_fatal_error "invalid tag name: $tagname"
Packit Service 688f9c
        ;;
Packit Service 688f9c
    esac
Packit 874993
Packit Service 688f9c
    # Don't test for the "default" C tag, as we know it's
Packit Service 688f9c
    # there but not specially marked.
Packit Service 688f9c
    case $tagname in
Packit Service 688f9c
        CC) ;;
Packit 874993
    *)
Packit Service 688f9c
        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
Packit Service 688f9c
	  taglist="$taglist $tagname"
Packit Service 688f9c
Packit Service 688f9c
	  # Evaluate the configuration.  Be careful to quote the path
Packit Service 688f9c
	  # and the sed script, to avoid splitting on whitespace, but
Packit Service 688f9c
	  # also don't use non-portable quotes within backquotes within
Packit Service 688f9c
	  # quotes we have to do it in 2 steps:
Packit Service 688f9c
	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
Packit Service 688f9c
	  eval "$extractedcf"
Packit Service 688f9c
        else
Packit Service 688f9c
	  func_error "ignoring unknown tag $tagname"
Packit Service 688f9c
        fi
Packit Service 688f9c
        ;;
Packit Service 688f9c
    esac
Packit 874993
}
Packit 874993
Packit Service 688f9c
Packit 874993
# func_check_version_match
Packit Service 688f9c
# ------------------------
Packit 874993
# Ensure that we are using m4 macros, and libtool script from the same
Packit 874993
# release of libtool.
Packit 874993
func_check_version_match ()
Packit 874993
{
Packit Service 688f9c
    if test "$package_revision" != "$macro_revision"; then
Packit Service 688f9c
      if test "$VERSION" != "$macro_version"; then
Packit Service 688f9c
        if test -z "$macro_version"; then
Packit Service 688f9c
          cat >&2 <<_LT_EOF
Packit 874993
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit 874993
$progname: definition of this LT_INIT comes from an older release.
Packit 874993
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit 874993
$progname: and run autoconf again.
Packit 874993
_LT_EOF
Packit Service 688f9c
        else
Packit Service 688f9c
          cat >&2 <<_LT_EOF
Packit 874993
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
Packit 874993
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
Packit 874993
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
Packit 874993
$progname: and run autoconf again.
Packit 874993
_LT_EOF
Packit Service 688f9c
        fi
Packit Service 688f9c
      else
Packit Service 688f9c
        cat >&2 <<_LT_EOF
Packit 874993
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
Packit 874993
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
Packit 874993
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
Packit 874993
$progname: of $PACKAGE $VERSION and run autoconf again.
Packit 874993
_LT_EOF
Packit Service 688f9c
      fi
Packit 874993
Packit Service 688f9c
      exit $EXIT_MISMATCH
Packit Service 688f9c
    fi
Packit 874993
}
Packit 874993
Packit 874993
Packit Service 688f9c
# libtool_options_prep [ARG]...
Packit Service 688f9c
# -----------------------------
Packit Service 688f9c
# Preparation for options parsed by libtool.
Packit Service 688f9c
libtool_options_prep ()
Packit Service 688f9c
{
Packit Service 688f9c
    $debug_mode
Packit 874993
Packit Service 688f9c
    # Option defaults:
Packit Service 688f9c
    opt_config=false
Packit Service 688f9c
    opt_dlopen=
Packit Service 688f9c
    opt_dry_run=false
Packit Service 688f9c
    opt_help=false
Packit Service 688f9c
    opt_mode=
Packit Service 688f9c
    opt_preserve_dup_deps=false
Packit Service 688f9c
    opt_quiet=false
Packit 874993
Packit Service 688f9c
    nonopt=
Packit Service 688f9c
    preserve_args=
Packit 874993
Packit Service 688f9c
    # Shorthand for --mode=foo, only valid as the first argument
Packit Service 688f9c
    case $1 in
Packit Service 688f9c
    clean|clea|cle|cl)
Packit Service 688f9c
      shift; set dummy --mode clean ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    compile|compil|compi|comp|com|co|c)
Packit Service 688f9c
      shift; set dummy --mode compile ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    execute|execut|execu|exec|exe|ex|e)
Packit Service 688f9c
      shift; set dummy --mode execute ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    finish|finis|fini|fin|fi|f)
Packit Service 688f9c
      shift; set dummy --mode finish ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    install|instal|insta|inst|ins|in|i)
Packit Service 688f9c
      shift; set dummy --mode install ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    link|lin|li|l)
Packit Service 688f9c
      shift; set dummy --mode link ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
Packit Service 688f9c
      shift; set dummy --mode uninstall ${1+"$@"}; shift
Packit Service 688f9c
      ;;
Packit Service 688f9c
    esac
Packit Service 688f9c
Packit Service 688f9c
    # Pass back the list of options.
Packit Service 688f9c
    func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
    libtool_options_prep_result=$func_quote_for_eval_result
Packit Service 688f9c
}
Packit Service 688f9c
func_add_hook func_options_prep libtool_options_prep
Packit 874993
Packit 874993
Packit Service 688f9c
# libtool_parse_options [ARG]...
Packit Service 688f9c
# ---------------------------------
Packit Service 688f9c
# Provide handling for libtool specific options.
Packit Service 688f9c
libtool_parse_options ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit 874993
Packit Service 688f9c
    # Perform our own loop to consume as many options as possible in
Packit Service 688f9c
    # each iteration.
Packit Service 688f9c
    while test $# -gt 0; do
Packit Service 688f9c
      _G_opt=$1
Packit Service 688f9c
      shift
Packit Service 688f9c
      case $_G_opt in
Packit Service 688f9c
        --dry-run|--dryrun|-n)
Packit Service 688f9c
                        opt_dry_run=:
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --config)       func_config ;;
Packit Service 688f9c
Packit Service 688f9c
        --dlopen|-dlopen)
Packit Service 688f9c
                        opt_dlopen="${opt_dlopen+$opt_dlopen
Packit Service 688f9c
}$1"
Packit Service 688f9c
                        shift
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --preserve-dup-deps)
Packit Service 688f9c
                        opt_preserve_dup_deps=: ;;
Packit Service 688f9c
Packit Service 688f9c
        --features)     func_features ;;
Packit Service 688f9c
Packit Service 688f9c
        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
Packit Service 688f9c
Packit Service 688f9c
        --help)         opt_help=: ;;
Packit Service 688f9c
Packit Service 688f9c
        --help-all)     opt_help=': help-all' ;;
Packit Service 688f9c
Packit Service 688f9c
        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
Packit Service 688f9c
                        opt_mode=$1
Packit Service 688f9c
                        case $1 in
Packit Service 688f9c
                          # Valid mode arguments:
Packit Service 688f9c
                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
Packit Service 688f9c
Packit Service 688f9c
                          # Catch anything else as an error
Packit Service 688f9c
                          *) func_error "invalid argument for $_G_opt"
Packit Service 688f9c
                             exit_cmd=exit
Packit Service 688f9c
                             break
Packit Service 688f9c
                             ;;
Packit Service 688f9c
                        esac
Packit Service 688f9c
                        shift
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --no-silent|--no-quiet)
Packit Service 688f9c
                        opt_quiet=false
Packit Service 688f9c
                        func_append preserve_args " $_G_opt"
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --no-warnings|--no-warning|--no-warn)
Packit Service 688f9c
                        opt_warning=false
Packit Service 688f9c
                        func_append preserve_args " $_G_opt"
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --no-verbose)
Packit Service 688f9c
                        opt_verbose=false
Packit Service 688f9c
                        func_append preserve_args " $_G_opt"
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --silent|--quiet)
Packit Service 688f9c
                        opt_quiet=:
Packit Service 688f9c
                        opt_verbose=false
Packit Service 688f9c
                        func_append preserve_args " $_G_opt"
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
Packit Service 688f9c
                        opt_tag=$1
Packit Service 688f9c
                        func_append preserve_args " $_G_opt $1"
Packit Service 688f9c
                        func_enable_tag "$1"
Packit Service 688f9c
                        shift
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
        --verbose|-v)   opt_quiet=false
Packit Service 688f9c
                        opt_verbose=:
Packit Service 688f9c
                        func_append preserve_args " $_G_opt"
Packit Service 688f9c
                        ;;
Packit Service 688f9c
Packit Service 688f9c
	# An option not handled by this hook function:
Packit Service 688f9c
        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
Packit Service 688f9c
      esac
Packit Service 688f9c
    done
Packit 874993
Packit 874993
Packit Service 688f9c
    # save modified positional parameters for caller
Packit Service 688f9c
    func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
    libtool_parse_options_result=$func_quote_for_eval_result
Packit Service 688f9c
}
Packit Service 688f9c
func_add_hook func_parse_options libtool_parse_options
Packit 874993
Packit 874993
Packit 874993
Packit Service 688f9c
# libtool_validate_options [ARG]...
Packit Service 688f9c
# ---------------------------------
Packit Service 688f9c
# Perform any sanity checks on option settings and/or unconsumed
Packit Service 688f9c
# arguments.
Packit Service 688f9c
libtool_validate_options ()
Packit Service 688f9c
{
Packit Service 688f9c
    # save first non-option argument
Packit Service 688f9c
    if test 0 -lt $#; then
Packit Service 688f9c
      nonopt=$1
Packit Service 688f9c
      shift
Packit 874993
    fi
Packit 874993
Packit Service 688f9c
    # preserve --debug
Packit Service 688f9c
    test : = "$debug_cmd" || func_append preserve_args " --debug"
Packit 874993
Packit Service 688f9c
    case $host in
Packit Service 688f9c
      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
Packit Service 688f9c
      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
Packit Service 688f9c
      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
Packit Service 688f9c
        # don't eliminate duplications in $postdeps and $predeps
Packit Service 688f9c
        opt_duplicate_compiler_generated_deps=:
Packit Service 688f9c
        ;;
Packit Service 688f9c
      *)
Packit Service 688f9c
        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
Packit Service 688f9c
        ;;
Packit Service 688f9c
    esac
Packit 874993
Packit Service 688f9c
    $opt_help || {
Packit Service 688f9c
      # Sanity checks first:
Packit Service 688f9c
      func_check_version_match
Packit 874993
Packit Service 688f9c
      test yes != "$build_libtool_libs" \
Packit Service 688f9c
        && test yes != "$build_old_libs" \
Packit Service 688f9c
        && func_fatal_configuration "not configured to build any kind of library"
Packit 874993
Packit Service 688f9c
      # Darwin sucks
Packit Service 688f9c
      eval std_shrext=\"$shrext_cmds\"
Packit Service 688f9c
Packit Service 688f9c
      # Only execute mode is allowed to have -dlopen flags.
Packit Service 688f9c
      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
Packit Service 688f9c
        func_error "unrecognized option '-dlopen'"
Packit Service 688f9c
        $ECHO "$help" 1>&2
Packit Service 688f9c
        exit $EXIT_FAILURE
Packit Service 688f9c
      fi
Packit Service 688f9c
Packit Service 688f9c
      # Change the help message to a mode-specific one.
Packit Service 688f9c
      generic_help=$help
Packit Service 688f9c
      help="Try '$progname --help --mode=$opt_mode' for more information."
Packit Service 688f9c
    }
Packit Service 688f9c
Packit Service 688f9c
    # Pass back the unparsed argument list
Packit Service 688f9c
    func_quote_for_eval ${1+"$@"}
Packit Service 688f9c
    libtool_validate_options_result=$func_quote_for_eval_result
Packit 874993
}
Packit Service 688f9c
func_add_hook func_validate_options libtool_validate_options
Packit Service 688f9c
Packit 874993
Packit Service 688f9c
# Process options as early as possible so that --help and --version
Packit Service 688f9c
# can return quickly.
Packit Service 688f9c
func_options ${1+"$@"}
Packit Service 688f9c
eval set dummy "$func_options_result"; shift
Packit 874993
Packit 874993
Packit 874993
Packit 874993
## ----------- ##
Packit 874993
##    Main.    ##
Packit 874993
## ----------- ##
Packit 874993
Packit Service 688f9c
magic='%%%MAGIC variable%%%'
Packit Service 688f9c
magic_exe='%%%MAGIC EXE variable%%%'
Packit Service 688f9c
Packit Service 688f9c
# Global variables.
Packit Service 688f9c
extracted_archives=
Packit Service 688f9c
extracted_serial=0
Packit Service 688f9c
Packit Service 688f9c
# If this variable is set in any of the actions, the command in it
Packit Service 688f9c
# will be execed at the end.  This prevents here-documents from being
Packit Service 688f9c
# left over by shells.
Packit Service 688f9c
exec_cmd=
Packit Service 688f9c
Packit Service 688f9c
Packit Service 688f9c
# A function that is used when there is no print builtin or printf.
Packit Service 688f9c
func_fallback_echo ()
Packit Service 688f9c
{
Packit Service 688f9c
  eval 'cat <<_LTECHO_EOF
Packit Service 688f9c
$1
Packit Service 688f9c
_LTECHO_EOF'
Packit Service 688f9c
}
Packit Service 688f9c
Packit Service 688f9c
# func_generated_by_libtool
Packit Service 688f9c
# True iff stdin has been generated by Libtool. This function is only
Packit Service 688f9c
# a basic sanity check; it will hardly flush out determined imposters.
Packit Service 688f9c
func_generated_by_libtool_p ()
Packit Service 688f9c
{
Packit Service 688f9c
  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
Packit Service 688f9c
}
Packit Service 688f9c
Packit 874993
# func_lalib_p file
Packit Service 688f9c
# True iff FILE is a libtool '.la' library or '.lo' object file.
Packit 874993
# This function is only a basic sanity check; it will hardly flush out
Packit 874993
# determined imposters.
Packit 874993
func_lalib_p ()
Packit 874993
{
Packit 874993
    test -f "$1" &&
Packit Service 688f9c
      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
Packit 874993
}
Packit 874993
Packit 874993
# func_lalib_unsafe_p file
Packit Service 688f9c
# True iff FILE is a libtool '.la' library or '.lo' object file.
Packit 874993
# This function implements the same check as func_lalib_p without
Packit 874993
# resorting to external programs.  To this end, it redirects stdin and
Packit 874993
# closes it afterwards, without saving the original file descriptor.
Packit 874993
# As a safety measure, use it only where a negative result would be
Packit Service 688f9c
# fatal anyway.  Works if 'file' does not exist.
Packit 874993
func_lalib_unsafe_p ()
Packit 874993
{
Packit 874993
    lalib_p=no
Packit 874993
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
Packit 874993
	for lalib_p_l in 1 2 3 4
Packit 874993
	do
Packit 874993
	    read lalib_p_line
Packit Service 688f9c
	    case $lalib_p_line in
Packit 874993
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
Packit 874993
	    esac
Packit 874993
	done
Packit 874993
	exec 0<&5 5<&-
Packit 874993
    fi
Packit Service 688f9c
    test yes = "$lalib_p"
Packit 874993
}
Packit 874993
Packit 874993
# func_ltwrapper_script_p file
Packit 874993
# True iff FILE is a libtool wrapper script
Packit 874993
# This function is only a basic sanity check; it will hardly flush out
Packit 874993
# determined imposters.
Packit 874993
func_ltwrapper_script_p ()
Packit 874993
{
Packit Service 688f9c
    test -f "$1" &&
Packit Service 688f9c
      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
Packit 874993
}
Packit 874993
Packit 874993
# func_ltwrapper_executable_p file
Packit 874993
# True iff FILE is a libtool wrapper executable
Packit 874993
# This function is only a basic sanity check; it will hardly flush out
Packit 874993
# determined imposters.
Packit 874993
func_ltwrapper_executable_p ()
Packit 874993
{
Packit 874993
    func_ltwrapper_exec_suffix=
Packit 874993
    case $1 in
Packit 874993
    *.exe) ;;
Packit 874993
    *) func_ltwrapper_exec_suffix=.exe ;;
Packit 874993
    esac
Packit 874993
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
Packit 874993
}
Packit 874993
Packit 874993
# func_ltwrapper_scriptname file
Packit 874993
# Assumes file is an ltwrapper_executable
Packit 874993
# uses $file to determine the appropriate filename for a
Packit 874993
# temporary ltwrapper_script.
Packit 874993
func_ltwrapper_scriptname ()
Packit 874993
{
Packit 874993
    func_dirname_and_basename "$1" "" "."
Packit 874993
    func_stripname '' '.exe' "$func_basename_result"
Packit Service 688f9c
    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
Packit 874993
}
Packit 874993
Packit 874993
# func_ltwrapper_p file
Packit 874993
# True iff FILE is a libtool wrapper script or wrapper executable
Packit 874993
# This function is only a basic sanity check; it will hardly flush out
Packit 874993
# determined imposters.
Packit 874993
func_ltwrapper_p ()
Packit 874993
{
Packit 874993
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
# func_execute_cmds commands fail_cmd
Packit 874993
# Execute tilde-delimited COMMANDS.
Packit 874993
# If FAIL_CMD is given, eval that upon failure.
Packit 874993
# FAIL_CMD may read-access the current command in variable CMD!
Packit 874993
func_execute_cmds ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit 874993
    save_ifs=$IFS; IFS='~'
Packit 874993
    for cmd in $1; do
Packit Service 688f9c
      IFS=$sp$nl
Packit 874993
      eval cmd=\"$cmd\"
Packit Service 688f9c
      IFS=$save_ifs
Packit 874993
      func_show_eval "$cmd" "${2-:}"
Packit 874993
    done
Packit 874993
    IFS=$save_ifs
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
# func_source file
Packit 874993
# Source FILE, adding directory component if necessary.
Packit 874993
# Note that it is not necessary on cygwin/mingw to append a dot to
Packit 874993
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
Packit 874993
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
Packit Service 688f9c
# 'FILE.' does not work on cygwin managed mounts.
Packit 874993
func_source ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit 874993
    case $1 in
Packit 874993
    */* | *\\*)	. "$1" ;;
Packit 874993
    *)		. "./$1" ;;
Packit 874993
    esac
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
# func_resolve_sysroot PATH
Packit 874993
# Replace a leading = in PATH with a sysroot.  Store the result into
Packit 874993
# func_resolve_sysroot_result
Packit 874993
func_resolve_sysroot ()
Packit 874993
{
Packit 874993
  func_resolve_sysroot_result=$1
Packit 874993
  case $func_resolve_sysroot_result in
Packit 874993
  =*)
Packit 874993
    func_stripname '=' '' "$func_resolve_sysroot_result"
Packit 874993
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
Packit 874993
    ;;
Packit 874993
  esac
Packit 874993
}
Packit 874993
Packit 874993
# func_replace_sysroot PATH
Packit 874993
# If PATH begins with the sysroot, replace it with = and
Packit 874993
# store the result into func_replace_sysroot_result.
Packit 874993
func_replace_sysroot ()
Packit 874993
{
Packit Service 688f9c
  case $lt_sysroot:$1 in
Packit 874993
  ?*:"$lt_sysroot"*)
Packit 874993
    func_stripname "$lt_sysroot" '' "$1"
Packit Service 688f9c
    func_replace_sysroot_result='='$func_stripname_result
Packit 874993
    ;;
Packit 874993
  *)
Packit 874993
    # Including no sysroot.
Packit 874993
    func_replace_sysroot_result=$1
Packit 874993
    ;;
Packit 874993
  esac
Packit 874993
}
Packit 874993
Packit 874993
# func_infer_tag arg
Packit 874993
# Infer tagged configuration to use if any are available and
Packit 874993
# if one wasn't chosen via the "--tag" command line option.
Packit 874993
# Only attempt this if the compiler in the base compile
Packit 874993
# command doesn't match the default compiler.
Packit 874993
# arg is usually of the form 'gcc ...'
Packit 874993
func_infer_tag ()
Packit 874993
{
Packit Service 688f9c
    $debug_cmd
Packit Service 688f9c
Packit 874993
    if test -n "$available_tags" && test -z "$tagname"; then
Packit 874993
      CC_quoted=
Packit 874993
      for arg in $CC; do
Packit 874993
	func_append_quoted CC_quoted "$arg"
Packit 874993
      done
Packit 874993
      CC_expanded=`func_echo_all $CC`
Packit 874993
      CC_quoted_expanded=`func_echo_all $CC_quoted`
Packit 874993
      case $@ in
Packit 874993
      # Blanks in the command may have been stripped by the calling shell,
Packit 874993
      # but not from the CC environment variable when configure was run.
Packit 874993
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
Packit 874993
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
Packit 874993
      # Blanks at the start of $base_compile will cause this to fail
Packit 874993
      # if we don't check for them as well.
Packit 874993
      *)
Packit 874993
	for z in $available_tags; do
Packit 874993
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
Packit 874993
	    # Evaluate the configuration.
Packit Service 688f9c
	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
Packit 874993
	    CC_quoted=
Packit 874993
	    for arg in $CC; do
Packit 874993
	      # Double-quote args containing other shell metacharacters.
Packit 874993
	      func_append_quoted CC_quoted "$arg"
Packit 874993
	    done
Packit 874993
	    CC_expanded=`func_echo_all $CC`
Packit 874993
	    CC_quoted_expanded=`func_echo_all $CC_quoted`
Packit 874993
	    case "$@ " in
Packit 874993
	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
Packit 874993
	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
Packit 874993
	      # The compiler in the base compile command matches
Packit 874993
	      # the one in the tagged configuration.
Packit 874993
	      # Assume this is the tagged configuration we want.
Packit 874993
	      tagname=$z
Packit 874993
	      break
Packit 874993
	      ;;
Packit 874993
	    esac
Packit 874993
	  fi
Packit 874993
	done
Packit 874993
	# If $tagname still isn't set, then no tagged configuration
Packit 874993
	# was found and let the user know that the "--tag" command
Packit 874993
	# line option must be used.
Packit 874993
	if test -z "$tagname"; then
Packit 874993
	  func_echo "unable to infer tagged configuration"
Packit Service 688f9c
	  func_fatal_error "specify a tag with '--tag'"
Packit 874993
#	else
Packit 874993
#	  func_verbose "using $tagname tagged configuration"
Packit 874993
	fi
Packit 874993
	;;
Packit 874993
      esac
Packit 874993
    fi
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
Packit 874993
# func_write_libtool_object output_name pic_name nonpic_name
Packit 874993
# Create a libtool object file (analogous to a ".la" file),
Packit 874993
# but don't create it if we're doing a dry run.
Packit 874993
func_write_libtool_object ()
Packit 874993
{
Packit Service 688f9c
    write_libobj=$1
Packit Service 688f9c
    if test yes = "$build_libtool_libs"; then
Packit Service 688f9c
      write_lobj=\'$2\'
Packit 874993
    else
Packit 874993
      write_lobj=none
Packit 874993
    fi
Packit 874993
Packit Service 688f9c
    if test yes = "$build_old_libs"; then
Packit Service 688f9c
      write_oldobj=\'$3\'
Packit 874993
    else
Packit 874993
      write_oldobj=none
Packit 874993
    fi
Packit 874993
Packit 874993
    $opt_dry_run || {
Packit 874993
      cat >${write_libobj}T <
Packit 874993
# $write_libobj - a libtool object file
Packit Service 688f9c
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
Packit 874993
#
Packit 874993
# Please DO NOT delete this file!
Packit 874993
# It is necessary for linking the library.
Packit 874993
Packit 874993
# Name of the PIC object.
Packit 874993
pic_object=$write_lobj
Packit 874993
Packit 874993
# Name of the non-PIC object
Packit 874993
non_pic_object=$write_oldobj
Packit 874993
Packit 874993
EOF
Packit Service 688f9c
      $MV "${write_libobj}T" "$write_libobj"
Packit 874993
    }
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
##################################################
Packit 874993
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
Packit 874993
##################################################
Packit 874993
Packit 874993
# func_convert_core_file_wine_to_w32 ARG
Packit 874993
# Helper function used by file name conversion functions when $build is *nix,
Packit 874993
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
Packit 874993
# correctly configured wine environment available, with the winepath program
Packit 874993
# in $build's $PATH.
Packit 874993
#
Packit 874993
# ARG is the $build file name to be converted to w32 format.
Packit 874993
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
Packit 874993
# be empty on error (or when ARG is empty)
Packit 874993
func_convert_core_file_wine_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_convert_core_file_wine_to_w32_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # Unfortunately, winepath does not exit with a non-zero error code, so we
Packit 874993
    # are forced to check the contents of stdout. On the other hand, if the
Packit 874993
    # command is not found, the shell will set an exit code of 127 and print
Packit 874993
    # *an error message* to stdout. So we must check for both error code of
Packit 874993
    # zero AND non-empty stdout, which explains the odd construction:
Packit 874993
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
Packit Service 688f9c
    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
Packit 874993
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
Packit Service 688f9c
        $SED -e "$sed_naive_backslashify"`
Packit 874993
    else
Packit 874993
      func_convert_core_file_wine_to_w32_result=
Packit 874993
    fi
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end: func_convert_core_file_wine_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_core_path_wine_to_w32 ARG
Packit 874993
# Helper function used by path conversion functions when $build is *nix, and
Packit 874993
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
Packit 874993
# configured wine environment available, with the winepath program in $build's
Packit 874993
# $PATH. Assumes ARG has no leading or trailing path separator characters.
Packit 874993
#
Packit 874993
# ARG is path to be converted from $build format to win32.
Packit 874993
# Result is available in $func_convert_core_path_wine_to_w32_result.
Packit 874993
# Unconvertible file (directory) names in ARG are skipped; if no directory names
Packit 874993
# are convertible, then the result may be empty.
Packit 874993
func_convert_core_path_wine_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  # unfortunately, winepath doesn't convert paths, only file names
Packit Service 688f9c
  func_convert_core_path_wine_to_w32_result=
Packit 874993
  if test -n "$1"; then
Packit 874993
    oldIFS=$IFS
Packit 874993
    IFS=:
Packit 874993
    for func_convert_core_path_wine_to_w32_f in $1; do
Packit 874993
      IFS=$oldIFS
Packit 874993
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
Packit Service 688f9c
      if test -n "$func_convert_core_file_wine_to_w32_result"; then
Packit 874993
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
Packit Service 688f9c
          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
Packit 874993
        else
Packit 874993
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
Packit 874993
        fi
Packit 874993
      fi
Packit 874993
    done
Packit 874993
    IFS=$oldIFS
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end: func_convert_core_path_wine_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_cygpath ARGS...
Packit 874993
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
Packit 874993
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
Packit 874993
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
Packit 874993
# (2), returns the Cygwin file name or path in func_cygpath_result (input
Packit 874993
# file name or path is assumed to be in w32 format, as previously converted
Packit 874993
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
Packit 874993
# or path in func_cygpath_result (input file name or path is assumed to be in
Packit 874993
# Cygwin format). Returns an empty string on error.
Packit 874993
#
Packit 874993
# ARGS are passed to cygpath, with the last one being the file name or path to
Packit 874993
# be converted.
Packit 874993
#
Packit 874993
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
Packit 874993
# environment variable; do not put it in $PATH.
Packit 874993
func_cygpath ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
Packit 874993
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
Packit 874993
    if test "$?" -ne 0; then
Packit 874993
      # on failure, ensure result is empty
Packit 874993
      func_cygpath_result=
Packit 874993
    fi
Packit 874993
  else
Packit 874993
    func_cygpath_result=
Packit Service 688f9c
    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
Packit 874993
  fi
Packit 874993
}
Packit 874993
#end: func_cygpath
Packit 874993
Packit 874993
Packit 874993
# func_convert_core_msys_to_w32 ARG
Packit 874993
# Convert file name or path ARG from MSYS format to w32 format.  Return
Packit 874993
# result in func_convert_core_msys_to_w32_result.
Packit 874993
func_convert_core_msys_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  # awkward: cmd appends spaces to result
Packit 874993
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
Packit Service 688f9c
    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
Packit 874993
}
Packit 874993
#end: func_convert_core_msys_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_check ARG1 ARG2
Packit 874993
# Verify that ARG1 (a file name in $build format) was converted to $host
Packit 874993
# format in ARG2. Otherwise, emit an error message, but continue (resetting
Packit 874993
# func_to_host_file_result to ARG1).
Packit 874993
func_convert_file_check ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  if test -z "$2" && test -n "$1"; then
Packit 874993
    func_error "Could not determine host file name corresponding to"
Packit Service 688f9c
    func_error "  '$1'"
Packit 874993
    func_error "Continuing, but uninstalled executables may not work."
Packit 874993
    # Fallback:
Packit Service 688f9c
    func_to_host_file_result=$1
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_file_check
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
Packit 874993
# Verify that FROM_PATH (a path in $build format) was converted to $host
Packit 874993
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
Packit 874993
# func_to_host_file_result to a simplistic fallback value (see below).
Packit 874993
func_convert_path_check ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  if test -z "$4" && test -n "$3"; then
Packit 874993
    func_error "Could not determine the host path corresponding to"
Packit Service 688f9c
    func_error "  '$3'"
Packit 874993
    func_error "Continuing, but uninstalled executables may not work."
Packit 874993
    # Fallback.  This is a deliberately simplistic "conversion" and
Packit 874993
    # should not be "improved".  See libtool.info.
Packit 874993
    if test "x$1" != "x$2"; then
Packit 874993
      lt_replace_pathsep_chars="s|$1|$2|g"
Packit 874993
      func_to_host_path_result=`echo "$3" |
Packit 874993
        $SED -e "$lt_replace_pathsep_chars"`
Packit 874993
    else
Packit Service 688f9c
      func_to_host_path_result=$3
Packit 874993
    fi
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_path_check
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
Packit 874993
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
Packit 874993
# and appending REPL if ORIG matches BACKPAT.
Packit 874993
func_convert_path_front_back_pathsep ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  case $4 in
Packit Service 688f9c
  $1 ) func_to_host_path_result=$3$func_to_host_path_result
Packit 874993
    ;;
Packit 874993
  esac
Packit 874993
  case $4 in
Packit 874993
  $2 ) func_append func_to_host_path_result "$3"
Packit 874993
    ;;
Packit 874993
  esac
Packit 874993
}
Packit 874993
# end func_convert_path_front_back_pathsep
Packit 874993
Packit 874993
Packit 874993
##################################################
Packit 874993
# $build to $host FILE NAME CONVERSION FUNCTIONS #
Packit 874993
##################################################
Packit Service 688f9c
# invoked via '$to_host_file_cmd ARG'
Packit 874993
#
Packit 874993
# In each case, ARG is the path to be converted from $build to $host format.
Packit 874993
# Result will be available in $func_to_host_file_result.
Packit 874993
Packit 874993
Packit 874993
# func_to_host_file ARG
Packit 874993
# Converts the file name ARG from $build format to $host format. Return result
Packit 874993
# in func_to_host_file_result.
Packit 874993
func_to_host_file ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  $to_host_file_cmd "$1"
Packit 874993
}
Packit 874993
# end func_to_host_file
Packit 874993
Packit 874993
Packit 874993
# func_to_tool_file ARG LAZY
Packit 874993
# converts the file name ARG from $build format to toolchain format. Return
Packit 874993
# result in func_to_tool_file_result.  If the conversion in use is listed
Packit 874993
# in (the comma separated) LAZY, no conversion takes place.
Packit 874993
func_to_tool_file ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  case ,$2, in
Packit 874993
    *,"$to_tool_file_cmd",*)
Packit 874993
      func_to_tool_file_result=$1
Packit 874993
      ;;
Packit 874993
    *)
Packit 874993
      $to_tool_file_cmd "$1"
Packit 874993
      func_to_tool_file_result=$func_to_host_file_result
Packit 874993
      ;;
Packit 874993
  esac
Packit 874993
}
Packit 874993
# end func_to_tool_file
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_noop ARG
Packit 874993
# Copy ARG to func_to_host_file_result.
Packit 874993
func_convert_file_noop ()
Packit 874993
{
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
}
Packit 874993
# end func_convert_file_noop
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_msys_to_w32 ARG
Packit 874993
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
Packit 874993
# conversion to w32 is not available inside the cwrapper.  Returns result in
Packit 874993
# func_to_host_file_result.
Packit 874993
func_convert_file_msys_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    func_convert_core_msys_to_w32 "$1"
Packit Service 688f9c
    func_to_host_file_result=$func_convert_core_msys_to_w32_result
Packit 874993
  fi
Packit 874993
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit 874993
}
Packit 874993
# end func_convert_file_msys_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_cygwin_to_w32 ARG
Packit 874993
# Convert file name ARG from Cygwin to w32 format.  Returns result in
Packit 874993
# func_to_host_file_result.
Packit 874993
func_convert_file_cygwin_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
Packit 874993
    # LT_CYGPATH in this case.
Packit 874993
    func_to_host_file_result=`cygpath -m "$1"`
Packit 874993
  fi
Packit 874993
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit 874993
}
Packit 874993
# end func_convert_file_cygwin_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_nix_to_w32 ARG
Packit 874993
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
Packit 874993
# and a working winepath. Returns result in func_to_host_file_result.
Packit 874993
func_convert_file_nix_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    func_convert_core_file_wine_to_w32 "$1"
Packit Service 688f9c
    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
Packit 874993
  fi
Packit 874993
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit 874993
}
Packit 874993
# end func_convert_file_nix_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_msys_to_cygwin ARG
Packit 874993
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
Packit 874993
# Returns result in func_to_host_file_result.
Packit 874993
func_convert_file_msys_to_cygwin ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    func_convert_core_msys_to_w32 "$1"
Packit 874993
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
Packit Service 688f9c
    func_to_host_file_result=$func_cygpath_result
Packit 874993
  fi
Packit 874993
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit 874993
}
Packit 874993
# end func_convert_file_msys_to_cygwin
Packit 874993
Packit 874993
Packit 874993
# func_convert_file_nix_to_cygwin ARG
Packit 874993
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
Packit 874993
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
Packit 874993
# in func_to_host_file_result.
Packit 874993
func_convert_file_nix_to_cygwin ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_file_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
Packit 874993
    func_convert_core_file_wine_to_w32 "$1"
Packit 874993
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
Packit Service 688f9c
    func_to_host_file_result=$func_cygpath_result
Packit 874993
  fi
Packit 874993
  func_convert_file_check "$1" "$func_to_host_file_result"
Packit 874993
}
Packit 874993
# end func_convert_file_nix_to_cygwin
Packit 874993
Packit 874993
Packit 874993
#############################################
Packit 874993
# $build to $host PATH CONVERSION FUNCTIONS #
Packit 874993
#############################################
Packit Service 688f9c
# invoked via '$to_host_path_cmd ARG'
Packit 874993
#
Packit 874993
# In each case, ARG is the path to be converted from $build to $host format.
Packit 874993
# The result will be available in $func_to_host_path_result.
Packit 874993
#
Packit 874993
# Path separators are also converted from $build format to $host format.  If
Packit 874993
# ARG begins or ends with a path separator character, it is preserved (but
Packit 874993
# converted to $host format) on output.
Packit 874993
#
Packit 874993
# All path conversion functions are named using the following convention:
Packit 874993
#   file name conversion function    : func_convert_file_X_to_Y ()
Packit 874993
#   path conversion function         : func_convert_path_X_to_Y ()
Packit 874993
# where, for any given $build/$host combination the 'X_to_Y' value is the
Packit 874993
# same.  If conversion functions are added for new $build/$host combinations,
Packit 874993
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
Packit 874993
# will break.
Packit 874993
Packit 874993
Packit 874993
# func_init_to_host_path_cmd
Packit 874993
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
Packit 874993
# appropriate value, based on the value of $to_host_file_cmd.
Packit 874993
to_host_path_cmd=
Packit 874993
func_init_to_host_path_cmd ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  if test -z "$to_host_path_cmd"; then
Packit 874993
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
Packit Service 688f9c
    to_host_path_cmd=func_convert_path_$func_stripname_result
Packit 874993
  fi
Packit 874993
}
Packit 874993
Packit 874993
Packit 874993
# func_to_host_path ARG
Packit 874993
# Converts the path ARG from $build format to $host format. Return result
Packit 874993
# in func_to_host_path_result.
Packit 874993
func_to_host_path ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit 874993
  func_init_to_host_path_cmd
Packit 874993
  $to_host_path_cmd "$1"
Packit 874993
}
Packit 874993
# end func_to_host_path
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_noop ARG
Packit 874993
# Copy ARG to func_to_host_path_result.
Packit 874993
func_convert_path_noop ()
Packit 874993
{
Packit Service 688f9c
  func_to_host_path_result=$1
Packit 874993
}
Packit 874993
# end func_convert_path_noop
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_msys_to_w32 ARG
Packit 874993
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
Packit 874993
# conversion to w32 is not available inside the cwrapper.  Returns result in
Packit 874993
# func_to_host_path_result.
Packit 874993
func_convert_path_msys_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_path_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # Remove leading and trailing path separator characters from ARG.  MSYS
Packit 874993
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
Packit 874993
    # and winepath ignores them completely.
Packit 874993
    func_stripname : : "$1"
Packit 874993
    func_to_host_path_tmp1=$func_stripname_result
Packit 874993
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
Packit Service 688f9c
    func_to_host_path_result=$func_convert_core_msys_to_w32_result
Packit 874993
    func_convert_path_check : ";" \
Packit 874993
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit 874993
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_path_msys_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_cygwin_to_w32 ARG
Packit 874993
# Convert path ARG from Cygwin to w32 format.  Returns result in
Packit 874993
# func_to_host_file_result.
Packit 874993
func_convert_path_cygwin_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_path_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # See func_convert_path_msys_to_w32:
Packit 874993
    func_stripname : : "$1"
Packit 874993
    func_to_host_path_tmp1=$func_stripname_result
Packit 874993
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
Packit 874993
    func_convert_path_check : ";" \
Packit 874993
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit 874993
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_path_cygwin_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_nix_to_w32 ARG
Packit 874993
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
Packit 874993
# a working winepath.  Returns result in func_to_host_file_result.
Packit 874993
func_convert_path_nix_to_w32 ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_path_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # See func_convert_path_msys_to_w32:
Packit 874993
    func_stripname : : "$1"
Packit 874993
    func_to_host_path_tmp1=$func_stripname_result
Packit 874993
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
Packit Service 688f9c
    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
Packit 874993
    func_convert_path_check : ";" \
Packit 874993
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit 874993
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_path_nix_to_w32
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_msys_to_cygwin ARG
Packit 874993
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
Packit 874993
# Returns result in func_to_host_file_result.
Packit 874993
func_convert_path_msys_to_cygwin ()
Packit 874993
{
Packit Service 688f9c
  $debug_cmd
Packit Service 688f9c
Packit Service 688f9c
  func_to_host_path_result=$1
Packit 874993
  if test -n "$1"; then
Packit 874993
    # See func_convert_path_msys_to_w32:
Packit 874993
    func_stripname : : "$1"
Packit 874993
    func_to_host_path_tmp1=$func_stripname_result
Packit 874993
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
Packit 874993
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
Packit Service 688f9c
    func_to_host_path_result=$func_cygpath_result
Packit 874993
    func_convert_path_check : : \
Packit 874993
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
Packit 874993
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
Packit 874993
  fi
Packit 874993
}
Packit 874993
# end func_convert_path_msys_to_cygwin
Packit 874993
Packit 874993
Packit 874993
# func_convert_path_nix_to_cygwin ARG
Packit 874993
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
Packit