ltmain.sh   ltmain.sh 
#! /usr/bin/env sh #! /bin/sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2019-02-19.15 ## by inline-source v2014-01-03.01
# libtool (GNU libtool) 2.4.7 # libtool (GNU libtool) 2.4.6
# Provide generalized library-building support services. # Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # Copyright (C) 1996-2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is N O # This is free software; see the source for copying conditions. There is N O
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS E. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS E.
# GNU Libtool is free software; you can redistribute it and/or modify # GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# As a special exception to the GNU General Public License, # As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that # if you distribute this file as part of a program or library that
skipping to change at line 33 skipping to change at line 33
# GNU Libtool is distributed in the hope that it will be useful, but # GNU Libtool is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of # WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
PROGRAM=libtool PROGRAM=libtool
PACKAGE=libtool PACKAGE=libtool
VERSION="2.4.7 Debian-2.4.7-7build1" VERSION="2.4.6 Debian-2.4.6-2"
package_revision=2.4.7 package_revision=2.4.6
## ------ ## ## ------ ##
## Usage. ## ## Usage. ##
## ------ ## ## ------ ##
# Run './libtool --help' for help with using this script from the # Run './libtool --help' for help with using this script from the
# command line. # command line.
## ------------------------------- ## ## ------------------------------- ##
## User overridable command paths. ## ## User overridable command paths. ##
skipping to change at line 63 skipping to change at line 63
: ${AUTOMAKE="automake"} : ${AUTOMAKE="automake"}
## -------------------------- ## ## -------------------------- ##
## Source external libraries. ## ## Source external libraries. ##
## -------------------------- ## ## -------------------------- ##
# Much of our low-level functionality needs to be sourced from external # Much of our low-level functionality needs to be sourced from external
# libraries, which are installed to $pkgauxdir. # libraries, which are installed to $pkgauxdir.
# Set a version string for this script. # Set a version string for this script.
scriptversion=2019-02-19.15; # UTC scriptversion=2015-01-20.17; # UTC
# General shell script boiler plate, and helper functions. # General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# This is free software. There is NO warranty; not even for # Copyright (C) 2004-2015 Free Software Foundation, Inc.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This is free software; see the source for copying conditions. There is N
# O
# Copyright (C) 2004-2019, 2021 Bootstrap Authors # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS
# E.
# This file is dual licensed under the terms of the MIT license
# <https://opensource.org/license/MIT>, and GPL version 2 or later # This program is free software; you can redistribute it and/or modify
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of # it under the terms of the GNU General Public License as published by
# these licenses when using or redistributing this software or any of # the Free Software Foundation; either version 3 of the License, or
# the files within it. See the URLs above, or the file `LICENSE` # (at your option) any later version.
# included in the Bootstrap distribution for the full license texts.
# As a special exception to the GNU General Public License, if you distribu
te
# this file as part of a program or library that is built using GNU Libtool
,
# you may include this file under the same distribution terms that you use
# for the rest of that program.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please report bugs or propose patches to: # Please report bugs or propose patches to gary@gnu.org.
# <https://github.com/gnulib-modules/bootstrap/issues>
## ------ ## ## ------ ##
## Usage. ## ## Usage. ##
## ------ ## ## ------ ##
# Evaluate this file near the top of your script to gain access to # Evaluate this file near the top of your script to gain access to
# the functions and variables defined here: # the functions and variables defined here:
# #
# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
# #
skipping to change at line 127 skipping to change at line 136
for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do do
eval "if test set = \"\${$_G_var+set}\"; then eval "if test set = \"\${$_G_var+set}\"; then
save_$_G_var=\$$_G_var save_$_G_var=\$$_G_var
$_G_var=C $_G_var=C
export $_G_var export $_G_var
_G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi" fi"
done done
# These NLS vars are set unconditionally (bootstrap issue #24). Unset thos
e # CDPATH.
# in case the environment reset is needed later and the $save_* variant is (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
not
# defined (see the code above).
LC_ALL=C
LANGUAGE=C
export LANGUAGE LC_ALL
# Make sure IFS has a sensible default # Make sure IFS has a sensible default
sp=' ' sp=' '
nl=' nl='
' '
IFS="$sp $nl" IFS="$sp $nl"
# There are apparently some retarded systems that use ';' as a PATH separat or! # There are apparently some retarded systems that use ';' as a PATH separat or!
if test "${PATH_SEPARATOR+set}" != set; then if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=: PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';' PATH_SEPARATOR=';'
} }
fi fi
# func_unset VAR
# --------------
# Portably unset VAR.
# In some shells, an 'unset VAR' statement leaves a non-zero return
# status if VAR is already unset, which might be problematic if the
# statement is used at the end of a function (thus poisoning its return
# value) or when 'set -e' is active (causing even a spurious abort of
# the script in this case).
func_unset ()
{
{ eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
}
# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
func_unset CDPATH
# Make sure ${,E,F}GREP behave sanely.
func_unset GREP_OPTIONS
## ------------------------- ## ## ------------------------- ##
## Locate command utilities. ## ## Locate command utilities. ##
## ------------------------- ## ## ------------------------- ##
# func_executable_p FILE # func_executable_p FILE
# ---------------------- # ----------------------
# Check that FILE is an executable regular file. # Check that FILE is an executable regular file.
func_executable_p () func_executable_p ()
{ {
test -f "$1" && test -x "$1" test -f "$1" && test -x "$1"
skipping to change at line 264 skipping to change at line 251
# Best one so far, save it but keep looking for a better one # Best one so far, save it but keep looking for a better one
func_check_prog_result=$_G_path_prog func_check_prog_result=$_G_path_prog
_G_path_prog_max=$_G_count _G_path_prog_max=$_G_count
fi fi
# 10*(2^10) chars as input seems more than enough # 10*(2^10) chars as input seems more than enough
test 10 -lt "$_G_count" && break test 10 -lt "$_G_count" && break
done done
rm -f conftest.in conftest.tmp conftest.nl conftest.out rm -f conftest.in conftest.tmp conftest.nl conftest.out
} }
func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
rm -f conftest.sed rm -f conftest.sed
SED=$func_path_progs_result SED=$func_path_progs_result
} }
# Unless the user overrides by setting GREP, search the path for either GNU # Unless the user overrides by setting GREP, search the path for either GNU
# grep, or the grep that truncates its output the least. # grep, or the grep that truncates its output the least.
test -z "$GREP" && { test -z "$GREP" && {
func_check_prog_grep () func_check_prog_grep ()
{ {
_G_path_prog=$1 _G_path_prog=$1
skipping to change at line 299 skipping to change at line 286
# Best one so far, save it but keep looking for a better one # Best one so far, save it but keep looking for a better one
func_check_prog_result=$_G_path_prog func_check_prog_result=$_G_path_prog
_G_path_prog_max=$_G_count _G_path_prog_max=$_G_count
fi fi
# 10*(2^10) chars as input seems more than enough # 10*(2^10) chars as input seems more than enough
test 10 -lt "$_G_count" && break test 10 -lt "$_G_count" && break
done done
rm -f conftest.in conftest.tmp conftest.nl conftest.out rm -f conftest.in conftest.tmp conftest.nl conftest.out
} }
func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
GREP=$func_path_progs_result GREP=$func_path_progs_result
} }
## ------------------------------- ## ## ------------------------------- ##
## User overridable command paths. ## ## User overridable command paths. ##
## ------------------------------- ## ## ------------------------------- ##
# All uppercase variable names are used for environment variables. These # All uppercase variable names are used for environment variables. These
# variables can be overridden by the user before calling a script that # variables can be overridden by the user before calling a script that
# uses them if a suitable command of that name is not already available # uses them if a suitable command of that name is not already available
skipping to change at line 362 skipping to change at line 349
_G_bs2='\\\\' _G_bs2='\\\\'
_G_bs4='\\\\\\\\' _G_bs4='\\\\\\\\'
_G_dollar='\$' _G_dollar='\$'
sed_double_backslash="\ sed_double_backslash="\
s/$_G_bs4/&\\ s/$_G_bs4/&\\
/g /g
s/^$_G_bs2$_G_dollar/$_G_bs&/ s/^$_G_bs2$_G_dollar/$_G_bs&/
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
s/\n//g" s/\n//g"
# require_check_ifs_backslash
# ---------------------------
# Check if we can use backslash as IFS='\' separator, and set
# $check_ifs_backshlash_broken to ':' or 'false'.
require_check_ifs_backslash=func_require_check_ifs_backslash
func_require_check_ifs_backslash ()
{
_G_save_IFS=$IFS
IFS='\'
_G_check_ifs_backshlash='a\\b'
for _G_i in $_G_check_ifs_backshlash
do
case $_G_i in
a)
check_ifs_backshlash_broken=false
;;
'')
break
;;
*)
check_ifs_backshlash_broken=:
break
;;
esac
done
IFS=$_G_save_IFS
require_check_ifs_backslash=:
}
## ----------------- ## ## ----------------- ##
## Global variables. ## ## Global variables. ##
## ----------------- ## ## ----------------- ##
# Except for the global variables explicitly listed below, the following # Except for the global variables explicitly listed below, the following
# functions in the '^func_' namespace, and the '^require_' namespace # functions in the '^func_' namespace, and the '^require_' namespace
# variables initialised in the 'Resource management' section, sourcing # variables initialised in the 'Resource management' section, sourcing
# this file will not pollute your global namespace with anything # this file will not pollute your global namespace with anything
# else. There's no portable way to scope variables in Bourne shell # else. There's no portable way to scope variables in Bourne shell
# though, so actually running these functions will sometimes place # though, so actually running these functions will sometimes place
skipping to change at line 417 skipping to change at line 375
EXIT_SUCCESS=0 EXIT_SUCCESS=0
EXIT_FAILURE=1 EXIT_FAILURE=1
EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing . EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing .
EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
# Allow overriding, eg assuming that you follow the convention of # Allow overriding, eg assuming that you follow the convention of
# putting '$debug_cmd' at the start of all your functions, you can get # putting '$debug_cmd' at the start of all your functions, you can get
# bash to show function call trace with: # bash to show function call trace with:
# #
# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"} debug_cmd=${debug_cmd-":"}
exit_cmd=: exit_cmd=:
# By convention, finish your script with: # By convention, finish your script with:
# #
# exit $exit_status # exit $exit_status
# #
# so that you can set exit_status to non-zero if you want to indicate # so that you can set exit_status to non-zero if you want to indicate
# something went wrong during execution without actually bailing out at # something went wrong during execution without actually bailing out at
# the point of failure. # the point of failure.
skipping to change at line 554 skipping to change at line 512
# This section contains a variety of useful functions to call in your # This section contains a variety of useful functions to call in your
# scripts. Take note of the portable wrappers for features provided by # scripts. Take note of the portable wrappers for features provided by
# some modern shells, which will fall back to slower equivalents on # some modern shells, which will fall back to slower equivalents on
# less featureful shells. # less featureful shells.
# func_append VAR VALUE # func_append VAR VALUE
# --------------------- # ---------------------
# Append VALUE onto the existing contents of VAR. # Append VALUE onto the existing contents of VAR.
# We should try to minimise forks, especially on Windows where they are
# unreasonably slow, so skip the feature probes when bash or zsh are
# being used:
if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
: ${_G_HAVE_ARITH_OP="yes"}
: ${_G_HAVE_XSI_OPS="yes"}
# The += operator was introduced in bash 3.1
case $BASH_VERSION in
[12].* | 3.0 | 3.0*) ;;
*)
: ${_G_HAVE_PLUSEQ_OP="yes"}
;;
esac
fi
# _G_HAVE_PLUSEQ_OP # _G_HAVE_PLUSEQ_OP
# Can be empty, in which case the shell is probed, "yes" if += is # Can be empty, in which case the shell is probed, "yes" if += is
# useable or anything else if it does not work. # useable or anything else if it does not work.
if test -z "$_G_HAVE_PLUSEQ_OP" && \ test -z "$_G_HAVE_PLUSEQ_OP" \
__PLUSEQ_TEST="a" && \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
__PLUSEQ_TEST+=" b" 2>/dev/null && \ && _G_HAVE_PLUSEQ_OP=yes
test "a b" = "$__PLUSEQ_TEST"; then
_G_HAVE_PLUSEQ_OP=yes
fi
if test yes = "$_G_HAVE_PLUSEQ_OP" if test yes = "$_G_HAVE_PLUSEQ_OP"
then then
# This is an XSI compatible shell, allowing a faster implementation... # This is an XSI compatible shell, allowing a faster implementation...
eval 'func_append () eval 'func_append ()
{ {
$debug_cmd $debug_cmd
eval "$1+=\$2" eval "$1+=\$2"
}' }'
skipping to change at line 592 skipping to change at line 562
# func_append_quoted VAR VALUE # func_append_quoted VAR VALUE
# ---------------------------- # ----------------------------
# Quote VALUE and append to the end of shell variable VAR, separated # Quote VALUE and append to the end of shell variable VAR, separated
# by a space. # by a space.
if test yes = "$_G_HAVE_PLUSEQ_OP"; then if test yes = "$_G_HAVE_PLUSEQ_OP"; then
eval 'func_append_quoted () eval 'func_append_quoted ()
{ {
$debug_cmd $debug_cmd
func_quote_arg pretty "$2" func_quote_for_eval "$2"
eval "$1+=\\ \$func_quote_arg_result" eval "$1+=\\ \$func_quote_for_eval_result"
}' }'
else else
func_append_quoted () func_append_quoted ()
{ {
$debug_cmd $debug_cmd
func_quote_arg pretty "$2" func_quote_for_eval "$2"
eval "$1=\$$1\\ \$func_quote_arg_result" eval "$1=\$$1\\ \$func_quote_for_eval_result"
} }
fi fi
# func_append_uniq VAR VALUE # func_append_uniq VAR VALUE
# -------------------------- # --------------------------
# Append unique VALUE onto the existing contents of VAR, assuming # Append unique VALUE onto the existing contents of VAR, assuming
# entries are delimited by the first character of VALUE. For example: # entries are delimited by the first character of VALUE. For example:
# #
# func_append_uniq options " --another-option option-argument" # func_append_uniq options " --another-option option-argument"
# #
skipping to change at line 1085 skipping to change at line 1055
if test -n "$func_relative_path_result"; then if test -n "$func_relative_path_result"; then
func_stripname './' '' "$func_relative_path_result" func_stripname './' '' "$func_relative_path_result"
func_relative_path_result=$func_stripname_result func_relative_path_result=$func_stripname_result
fi fi
test -n "$func_relative_path_result" || func_relative_path_result=. test -n "$func_relative_path_result" || func_relative_path_result=.
: :
} }
# func_quote_portable EVAL ARG # func_quote_for_eval ARG...
# ---------------------------- # --------------------------
# Internal function to portably implement func_quote_arg. Note that we sti # Aesthetically quote ARGs to be evaled later.
ll # This function returns two values:
# keep attention to performance here so we as much as possible try to avoid # i) func_quote_for_eval_result
# calling sed binary (so far O(N) complexity as long as func_append is O(1) # double-quoted, suitable for a subsequent eval
). # ii) func_quote_for_eval_unquoted_result
func_quote_portable () # has all characters that are still active within double
# quotes backslashified.
func_quote_for_eval ()
{ {
$debug_cmd $debug_cmd
$require_check_ifs_backslash func_quote_for_eval_unquoted_result=
func_quote_for_eval_result=
func_quote_portable_result=$2 while test 0 -lt $#; do
case $1 in
# one-time-loop (easy break)
while true
do
if $1; then
func_quote_portable_result=`$ECHO "$2" | $SED \
-e "$sed_double_quote_subst" -e "$sed_double_backslash"`
break
fi
# Quote for eval.
case $func_quote_portable_result in
*[\\\`\"\$]*) *[\\\`\"\$]*)
# Fallback to sed for $func_check_bs_ifs_broken=:, or when the st _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
ring *)
# contains the shell wildcard characters. _G_unquoted_arg=$1 ;;
case $check_ifs_backshlash_broken$func_quote_portable_result in esac
:*|*[\[\*\?]*) if test -n "$func_quote_for_eval_unquoted_result"; then
func_quote_portable_result=`$ECHO "$func_quote_portable_resul func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
t" \ else
| $SED "$sed_quote_subst"` func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
break fi
;;
esac
func_quote_portable_old_IFS=$IFS case $_G_unquoted_arg in
for _G_char in '\' '`' '"' '$' # Double-quote args containing shell metacharacters to delay
do # word splitting, command substitution and variable expansion
# STATE($1) PREV($2) SEPARATOR($3) # for a subsequent eval.
set start "" "" # Many Bourne shells cannot handle close brackets correctly
func_quote_portable_result=dummy"$_G_char$func_quote_portable_r # in scan sets, so we specify it separately.
esult$_G_char"dummy *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
IFS=$_G_char _G_quoted_arg=\"$_G_unquoted_arg\"
for _G_part in $func_quote_portable_result
do
case $1 in
quote)
func_append func_quote_portable_result "$3$2"
set quote "$_G_part" "\\$_G_char"
;;
start)
set first "" ""
func_quote_portable_result=
;;
first)
set quote "$_G_part" ""
;;
esac
done
done
IFS=$func_quote_portable_old_IFS
;; ;;
*) ;; *)
_G_quoted_arg=$_G_unquoted_arg
;;
esac esac
break
done
func_quote_portable_unquoted_result=$func_quote_portable_result if test -n "$func_quote_for_eval_result"; then
case $func_quote_portable_result in func_append func_quote_for_eval_result " $_G_quoted_arg"
# double-quote args containing shell metacharacters to delay else
# word splitting, command substitution and variable expansion func_append func_quote_for_eval_result "$_G_quoted_arg"
# for a subsequent eval. fi
# many bourne shells cannot handle close brackets correctly shift
# in scan sets, so we specify it separately. done
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
func_quote_portable_result=\"$func_quote_portable_result\"
;;
esac
} }
# func_quotefast_eval ARG # func_quote_for_expand ARG
# ----------------------- # -------------------------
# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG # Aesthetically quote ARG to be evaled later; same as above,
', # but do not quote variable references.
# but optimized for speed. Result is stored in $func_quotefast_eval. func_quote_for_expand ()
if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then {
printf -v _GL_test_printf_tilde %q '~' $debug_cmd
if test '\~' = "$_GL_test_printf_tilde"; then
func_quotefast_eval ()
{
printf -v func_quotefast_eval_result %q "$1"
}
else
# Broken older Bash implementations. Make those faster too if possible
.
func_quotefast_eval ()
{
case $1 in
'~'*)
func_quote_portable false "$1"
func_quotefast_eval_result=$func_quote_portable_result
;;
*)
printf -v func_quotefast_eval_result %q "$1"
;;
esac
}
fi
else
func_quotefast_eval ()
{
func_quote_portable false "$1"
func_quotefast_eval_result=$func_quote_portable_result
}
fi
# func_quote_arg MODEs ARG case $1 in
# ------------------------ *[\\\`\"]*)
# Quote one ARG to be evaled later. MODEs argument may contain zero or mor _G_arg=`$ECHO "$1" | $SED \
e -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
# specifiers listed below separated by ',' character. This function return *)
s two _G_arg=$1 ;;
# values:
# i) func_quote_arg_result
# double-quoted (when needed), suitable for a subsequent eval
# ii) func_quote_arg_unquoted_result
# has all characters that are still active within double
# quotes backslashified. Available only if 'unquoted' is specified.
#
# Available modes:
# ----------------
# 'eval' (default)
# - escape shell special characters
# 'expand'
# - the same as 'eval'; but do not quote variable references
# 'pretty'
# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This m
ight
# be used later in func_quote to get output like: 'echo "a b"' inst
ead
# of 'echo a\ b'. This is slower than default on some shells.
# 'unquoted'
# - produce also $func_quote_arg_unquoted_result which does not conta
in
# wrapping double-quotes.
#
# Examples for 'func_quote_arg pretty,unquoted string':
#
# string | *_result | *_unquoted_result
# ------------+-----------------------+-------------------
# " | \" | \"
# a b | "a b" | a b
# "a b" | "\"a b\"" | \"a b\"
# * | "*" | *
# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
#
# Examples for 'func_quote_arg pretty,unquoted,expand string':
#
# string | *_result | *_unquoted_result
# --------------+---------------------+--------------------
# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
func_quote_arg ()
{
_G_quote_expand=false
case ,$1, in
*,expand,*)
_G_quote_expand=:
;;
esac esac
case ,$1, in case $_G_arg in
*,pretty,*|*,expand,*|*,unquoted,*) # Double-quote args containing shell metacharacters to delay
func_quote_portable $_G_quote_expand "$2" # word splitting and command substitution for a subsequent eval.
func_quote_arg_result=$func_quote_portable_result # Many Bourne shells cannot handle close brackets correctly
func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result # in scan sets, so we specify it separately.
;; *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
*) _G_arg=\"$_G_arg\"
# Faster quote-for-eval for some shells.
func_quotefast_eval "$2"
func_quote_arg_result=$func_quotefast_eval_result
;; ;;
esac esac
}
# func_quote MODEs ARGs... func_quote_for_expand_result=$_G_arg
# ------------------------
# Quote all ARGs to be evaled later and join them into single command. See
# func_quote_arg's description for more info.
func_quote ()
{
$debug_cmd
_G_func_quote_mode=$1 ; shift
func_quote_result=
while test 0 -lt $#; do
func_quote_arg "$_G_func_quote_mode" "$1"
if test -n "$func_quote_result"; then
func_append func_quote_result " $func_quote_arg_result"
else
func_append func_quote_result "$func_quote_arg_result"
fi
shift
done
} }
# func_stripname PREFIX SUFFIX NAME # func_stripname PREFIX SUFFIX NAME
# --------------------------------- # ---------------------------------
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
# PREFIX and SUFFIX must not contain globbing or regex special # PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading # characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot). # dot (in which case that matches only a dot).
if test yes = "$_G_HAVE_XSI_OPS"; then if test yes = "$_G_HAVE_XSI_OPS"; then
eval 'func_stripname () eval 'func_stripname ()
skipping to change at line 1322 skipping to change at line 1176
# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. # is given, then evaluate it.
func_show_eval () func_show_eval ()
{ {
$debug_cmd $debug_cmd
_G_cmd=$1 _G_cmd=$1
_G_fail_exp=${2-':'} _G_fail_exp=${2-':'}
func_quote_arg pretty,expand "$_G_cmd" func_quote_for_expand "$_G_cmd"
eval "func_notquiet $func_quote_arg_result" eval "func_notquiet $func_quote_for_expand_result"
$opt_dry_run || { $opt_dry_run || {
eval "$_G_cmd" eval "$_G_cmd"
_G_status=$? _G_status=$?
if test 0 -ne "$_G_status"; then if test 0 -ne "$_G_status"; then
eval "(exit $_G_status); $_G_fail_exp" eval "(exit $_G_status); $_G_fail_exp"
fi fi
} }
} }
skipping to change at line 1347 skipping to change at line 1201
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. Use the saved locale for evaluation. # is given, then evaluate it. Use the saved locale for evaluation.
func_show_eval_locale () func_show_eval_locale ()
{ {
$debug_cmd $debug_cmd
_G_cmd=$1 _G_cmd=$1
_G_fail_exp=${2-':'} _G_fail_exp=${2-':'}
$opt_quiet || { $opt_quiet || {
func_quote_arg expand,pretty "$_G_cmd" func_quote_for_expand "$_G_cmd"
eval "func_echo $func_quote_arg_result" eval "func_echo $func_quote_for_expand_result"
} }
$opt_dry_run || { $opt_dry_run || {
eval "$_G_user_locale eval "$_G_user_locale
$_G_cmd" $_G_cmd"
_G_status=$? _G_status=$?
eval "$_G_safe_locale" eval "$_G_safe_locale"
if test 0 -ne "$_G_status"; then if test 0 -ne "$_G_status"; then
eval "(exit $_G_status); $_G_fail_exp" eval "(exit $_G_status); $_G_fail_exp"
fi fi
skipping to change at line 1469 skipping to change at line 1323
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC"
# End: # End:
#! /bin/sh #! /bin/sh
# Set a version string for this script.
scriptversion=2014-01-07.03; # UTC
# A portable, pluggable option parser for Bourne shell. # A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010 # Written by Gary V. Vaughan, 2010
# This is free software. There is NO warranty; not even for # Copyright (C) 2010-2015 Free Software Foundation, Inc.
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This is free software; see the source for copying conditions. There is N
# O
# Copyright (C) 2010-2019, 2021 Bootstrap Authors # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS
# E.
# This file is dual licensed under the terms of the MIT license
# <https://opensource.org/license/MIT>, and GPL version 2 or later
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
# these licenses when using or redistributing this software or any of
# the files within it. See the URLs above, or the file `LICENSE`
# included in the Bootstrap distribution for the full license texts.
# Please report bugs or propose patches to: # This program is free software: you can redistribute it and/or modify
# <https://github.com/gnulib-modules/bootstrap/issues> # it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Set a version string for this script. # This program is distributed in the hope that it will be useful,
scriptversion=2019-02-19.15; # UTC # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please report bugs or propose patches to gary@gnu.org.
## ------ ## ## ------ ##
## Usage. ## ## Usage. ##
## ------ ## ## ------ ##
# This file is a library for parsing options in your shell scripts along # This file is a library for parsing options in your shell scripts along
# with assorted other useful supporting features that you can make use # with assorted other useful supporting features that you can make use
# of too. # of too.
# #
# For the simplest scripts you might need only: # For the simplest scripts you might need only:
skipping to change at line 1510 skipping to change at line 1368
# #!/bin/sh # #!/bin/sh
# . relative/path/to/funclib.sh # . relative/path/to/funclib.sh
# . relative/path/to/options-parser # . relative/path/to/options-parser
# scriptversion=1.0 # scriptversion=1.0
# func_options ${1+"$@"} # func_options ${1+"$@"}
# eval set dummy "$func_options_result"; shift # eval set dummy "$func_options_result"; shift
# ...rest of your script... # ...rest of your script...
# #
# In order for the '--version' option to work, you will need to have a # In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file # suitably formatted comment like the one at the top of this file
# starting with '# Written by ' and ending with '# Copyright'. # starting with '# Written by ' and ending with '# warranty; '.
# #
# For '-h' and '--help' to work, you will also need a one line # For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the # description of your script's purpose in a comment directly above the
# '# Written by ' line, like the one at the top of this file. # '# Written by ' line, like the one at the top of this file.
# #
# The default options also support '--debug', which will turn on shell # The default options also support '--debug', which will turn on shell
# execution tracing (see the comment above debug_cmd below for another # execution tracing (see the comment above debug_cmd below for another
# use), and '--verbose' and the func_verbose function to allow your script # use), and '--verbose' and the func_verbose function to allow your script
# to display verbose messages only when your user has specified # to display verbose messages only when your user has specified
# '--verbose'. # '--verbose'.
# #
# After sourcing this file, you can plug in processing for additional # After sourcing this file, you can plug processing for additional
# options by amending the variables from the 'Configuration' section # options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing' # below, and following the instructions in the 'Option parsing'
# section further down. # section further down.
## -------------- ## ## -------------- ##
## Configuration. ## ## Configuration. ##
## -------------- ## ## -------------- ##
# You should override these variables in your script after sourcing this # You should override these variables in your script after sourcing this
# file so that they reflect the customisations you have added to the # file so that they reflect the customisations you have added to the
skipping to change at line 1569 skipping to change at line 1427
'error' warnings are treated as fatal errors" 'error' warnings are treated as fatal errors"
# Help message printed before fatal option parsing errors. # Help message printed before fatal option parsing errors.
fatal_help="Try '\$progname --help' for more information." fatal_help="Try '\$progname --help' for more information."
## ------------------------- ## ## ------------------------- ##
## Hook function management. ## ## Hook function management. ##
## ------------------------- ## ## ------------------------- ##
# This section contains functions for adding, removing, and running hooks # This section contains functions for adding, removing, and running hooks
# in the main code. A hook is just a list of function names that can be # to the main code. A hook is just a named list of of function, that can
# run in order later on. # be run in order later on.
# func_hookable FUNC_NAME # func_hookable FUNC_NAME
# ----------------------- # -----------------------
# Declare that FUNC_NAME will run hooks added with # Declare that FUNC_NAME will run hooks added with
# 'func_add_hook FUNC_NAME ...'. # 'func_add_hook FUNC_NAME ...'.
func_hookable () func_hookable ()
{ {
$debug_cmd $debug_cmd
func_append hookable_fns " $1" func_append hookable_fns " $1"
skipping to change at line 1601 skipping to change at line 1459
case " $hookable_fns " in case " $hookable_fns " in
*" $1 "*) ;; *" $1 "*) ;;
*) func_fatal_error "'$1' does not accept hook functions." ;; *) func_fatal_error "'$1' does not accept hook functions." ;;
esac esac
eval func_append ${1}_hooks '" $2"' eval func_append ${1}_hooks '" $2"'
} }
# func_remove_hook FUNC_NAME HOOK_FUNC # func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------ # ------------------------------------
# Remove HOOK_FUNC from the list of hook functions to be called by # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
# FUNC_NAME.
func_remove_hook () func_remove_hook ()
{ {
$debug_cmd $debug_cmd
eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
} }
# func_propagate_result FUNC_NAME_A FUNC_NAME_B
# ---------------------------------------------
# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
# *_result variable of FUNC_NAME_B.
func_propagate_result ()
{
$debug_cmd
func_propagate_result_result=:
if eval "test \"\${${1}_result+set}\" = set"
then
eval "${2}_result=\$${1}_result"
else
func_propagate_result_result=false
fi
}
# func_run_hooks FUNC_NAME [ARG]... # func_run_hooks FUNC_NAME [ARG]...
# --------------------------------- # ---------------------------------
# Run all hook functions registered to FUNC_NAME. # Run all hook functions registered to FUNC_NAME.
# It's assumed that the list of hook functions contains nothing more # It is assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and # than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve # no effort is wasted trying to catch shell meta-characters or preserve
# whitespace. # whitespace.
func_run_hooks () func_run_hooks ()
{ {
$debug_cmd $debug_cmd
_G_rc_run_hooks=false
case " $hookable_fns " in case " $hookable_fns " in
*" $1 "*) ;; *" $1 "*) ;;
*) func_fatal_error "'$1' does not support hook functions." ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;;
esac esac
eval _G_hook_fns=\$$1_hooks; shift eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do for _G_hook in $_G_hook_fns; do
func_unset "${_G_hook}_result" eval $_G_hook '"$@"'
eval $_G_hook '${1+"$@"}'
func_propagate_result $_G_hook func_run_hooks # store returned options list back into positional
if $func_propagate_result_result; then # parameters for next 'cmd' execution.
eval set dummy "$func_run_hooks_result"; shift eval _G_hook_result=\$${_G_hook}_result
fi eval set dummy "$_G_hook_result"; shift
done done
func_quote_for_eval ${1+"$@"}
func_run_hooks_result=$func_quote_for_eval_result
} }
## --------------- ## ## --------------- ##
## Option parsing. ## ## Option parsing. ##
## --------------- ## ## --------------- ##
# In order to add your own option parsing hooks, you must accept the # In order to add your own option parsing hooks, you must accept the
# full positional parameter list from your hook function. You may remove # full positional parameter list in your hook function, remove any
# or edit any options that you action, and then pass back the remaining # options that you action, and then pass back the remaining unprocessed
# unprocessed options in '<hooked_function_name>_result', escaped # options in '<hooked_function_name>_result', escaped suitably for
# suitably for 'eval'. # 'eval'. Like this:
#
# The '<hooked_function_name>_result' variable is automatically unset
# before your hook gets called; for best performance, only set the
# *_result variable when necessary (i.e. don't call the 'func_quote'
# function unnecessarily because it can be an expensive operation on some
# machines).
#
# Like this:
# #
# my_options_prep () # my_options_prep ()
# { # {
# $debug_cmd # $debug_cmd
# #
# # Extend the existing usage message. # # Extend the existing usage message.
# usage_message=$usage_message' # usage_message=$usage_message'
# -s, --silent don'\''t print informational messages # -s, --silent don'\''t print informational messages
# ' # '
# # No change in '$@' (ignored completely by this hook). Leave #
# # my_options_prep_result variable intact. # func_quote_for_eval ${1+"$@"}
# my_options_prep_result=$func_quote_for_eval_result
# } # }
# func_add_hook func_options_prep my_options_prep # func_add_hook func_options_prep my_options_prep
# #
# #
# my_silent_option () # my_silent_option ()
# { # {
# $debug_cmd # $debug_cmd
# #
# args_changed=false # # Note that for efficiency, we parse as many options as we can
#
# # Note that, for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the # # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter. # # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do # while test $# -gt 0; do
# opt=$1; shift # opt=$1; shift
# case $opt in # case $opt in
# --silent|-s) opt_silent=: # --silent|-s) opt_silent=: ;;
# args_changed=:
# ;;
# # Separate non-argument short options: # # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt" # -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \ # set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"} # "-$func_split_short_opt_arg" ${1+"$@"}
# shift # shift
# args_changed=:
# ;; # ;;
# *) # Make sure the first unrecognised option "$_G_op # *) set dummy "$_G_opt" "$*"; shift; break ;;
t"
# # is added back to "$@" in case we need it later,
# # if $args_changed was set to 'true'.
# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
# esac # esac
# done # done
# #
# # Only call 'func_quote' here if we processed at least one argumen # func_quote_for_eval ${1+"$@"}
t. # my_silent_option_result=$func_quote_for_eval_result
# if $args_changed; then
# func_quote eval ${1+"$@"}
# my_silent_option_result=$func_quote_result
# fi
# } # }
# func_add_hook func_parse_options my_silent_option # func_add_hook func_parse_options my_silent_option
# #
# #
# my_option_validation () # my_option_validation ()
# { # {
# $debug_cmd # $debug_cmd
# #
# $opt_silent && $opt_verbose && func_fatal_help "\ # $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive." # '--silent' and '--verbose' options are mutually exclusive."
#
# func_quote_for_eval ${1+"$@"}
# my_option_validation_result=$func_quote_for_eval_result
# } # }
# func_add_hook func_validate_options my_option_validation # func_add_hook func_validate_options my_option_validation
# #
# You'll also need to manually amend $usage_message to reflect the extra # You'll alse need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that # options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely. # multiple option parsing hooks can be added safely.
# func_options_finish [ARG]...
# ----------------------------
# Finishing the option parse loop (call 'func_options' hooks ATM).
func_options_finish ()
{
$debug_cmd
func_run_hooks func_options ${1+"$@"}
func_propagate_result func_run_hooks func_options_finish
}
# func_options [ARG]... # func_options [ARG]...
# --------------------- # ---------------------
# All the functions called inside func_options are hookable. See the # All the functions called inside func_options are hookable. See the
# individual implementations for details. # individual implementations for details.
func_hookable func_options func_hookable func_options
func_options () func_options ()
{ {
$debug_cmd $debug_cmd
_G_options_quoted=false func_options_prep ${1+"$@"}
eval func_parse_options \
${func_options_prep_result+"$func_options_prep_result"}
eval func_validate_options \
${func_parse_options_result+"$func_parse_options_result"}
for my_func in options_prep parse_options validate_options options_fini eval func_run_hooks func_options \
sh ${func_validate_options_result+"$func_validate_options_result"}
do
func_unset func_${my_func}_result
func_unset func_run_hooks_result
eval func_$my_func '${1+"$@"}'
func_propagate_result func_$my_func func_options
if $func_propagate_result_result; then
eval set dummy "$func_options_result"; shift
_G_options_quoted=:
fi
done
$_G_options_quoted || { # save modified positional parameters for caller
# As we (func_options) are top-level options-parser function and func_options_result=$func_run_hooks_result
# nobody quoted "$@" for us yet, we need to do it explicitly for
# caller.
func_quote eval ${1+"$@"}
func_options_result=$func_quote_result
}
} }
# func_options_prep [ARG]... # func_options_prep [ARG]...
# -------------------------- # --------------------------
# All initialisations required before starting the option parse loop. # All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of # Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and # positional parameters. If a hook function modifies that list, and
# needs to propagate that back to rest of this script, then the complete # needs to propogate that back to rest of this script, then the complete
# modified list must be put in 'func_run_hooks_result' before returning. # modified list must be put in 'func_run_hooks_result' before
# returning.
func_hookable func_options_prep func_hookable func_options_prep
func_options_prep () func_options_prep ()
{ {
$debug_cmd $debug_cmd
# Option defaults: # Option defaults:
opt_verbose=false opt_verbose=false
opt_warning_types= opt_warning_types=
func_run_hooks func_options_prep ${1+"$@"} func_run_hooks func_options_prep ${1+"$@"}
func_propagate_result func_run_hooks func_options_prep
# save modified positional parameters for caller
func_options_prep_result=$func_run_hooks_result
} }
# func_parse_options [ARG]... # func_parse_options [ARG]...
# --------------------------- # ---------------------------
# The main option parsing loop. # The main option parsing loop.
func_hookable func_parse_options func_hookable func_parse_options
func_parse_options () func_parse_options ()
{ {
$debug_cmd $debug_cmd
_G_parse_options_requote=false func_parse_options_result=
# this just eases exit handling # this just eases exit handling
while test $# -gt 0; do while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they # Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name. # get priority in the event of reusing an option name.
func_run_hooks func_parse_options ${1+"$@"} func_run_hooks func_parse_options ${1+"$@"}
func_propagate_result func_run_hooks func_parse_options
if $func_propagate_result_result; then # Adjust func_parse_options positional parameters to match
eval set dummy "$func_parse_options_result"; shift eval set dummy "$func_run_hooks_result"; shift
# Even though we may have changed "$@", we passed the "$@" array
# down into the hook and it quoted it for us (because we are in
# this if-branch). No need to quote it again.
_G_parse_options_requote=false
fi
# Break out of the loop if we already parsed every option. # Break out of the loop if we already parsed every option.
test $# -gt 0 || break test $# -gt 0 || break
# We expect that one of the options parsed in this function matches
# and thus we remove _G_opt from "$@" and need to re-quote.
_G_match_parse_options=:
_G_opt=$1 _G_opt=$1
shift shift
case $_G_opt in case $_G_opt in
--debug|-x) debug_cmd='set -x' --debug|-x) debug_cmd='set -x'
func_echo "enabling shell trace mode" >&2 func_echo "enabling shell trace mode"
$debug_cmd $debug_cmd
;; ;;
--no-warnings|--no-warning|--no-warn) --no-warnings|--no-warning|--no-warn)
set dummy --warnings none ${1+"$@"} set dummy --warnings none ${1+"$@"}
shift shift
;; ;;
--warnings|--warning|-W) --warnings|--warning|-W)
if test $# = 0 && func_missing_arg $_G_opt; then test $# = 0 && func_missing_arg $_G_opt && break
_G_parse_options_requote=:
break
fi
case " $warning_categories $1" in case " $warning_categories $1" in
*" $1 "*) *" $1 "*)
# trailing space prevents matching last $1 above # trailing space prevents matching last $1 above
func_append_uniq opt_warning_types " $1" func_append_uniq opt_warning_types " $1"
;; ;;
*all) *all)
opt_warning_types=$warning_categories opt_warning_types=$warning_categories
;; ;;
*none) *none)
opt_warning_types=none opt_warning_types=none
skipping to change at line 1902 skipping to change at line 1700
;; ;;
# Separate non-argument short options: # Separate non-argument short options:
-\?*|-h*|-v*|-x*) -\?*|-h*|-v*|-x*)
func_split_short_opt "$_G_opt" func_split_short_opt "$_G_opt"
set dummy "$func_split_short_opt_name" \ set dummy "$func_split_short_opt_name" \
"-$func_split_short_opt_arg" ${1+"$@"} "-$func_split_short_opt_arg" ${1+"$@"}
shift shift
;; ;;
--) _G_parse_options_requote=: ; break ;; --) break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
*) set dummy "$_G_opt" ${1+"$@"}; shift *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
_G_match_parse_options=false
break
;;
esac esac
if $_G_match_parse_options; then
_G_parse_options_requote=:
fi
done done
if $_G_parse_options_requote; then # save modified positional parameters for caller
# save modified positional parameters for caller func_quote_for_eval ${1+"$@"}
func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result
func_parse_options_result=$func_quote_result
fi
} }
# func_validate_options [ARG]... # func_validate_options [ARG]...
# ------------------------------ # ------------------------------
# Perform any sanity checks on option settings and/or unconsumed # Perform any sanity checks on option settings and/or unconsumed
# arguments. # arguments.
func_hookable func_validate_options func_hookable func_validate_options
func_validate_options () func_validate_options ()
{ {
$debug_cmd $debug_cmd
# Display all warnings if -W was not given. # Display all warnings if -W was not given.
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories " test -n "$opt_warning_types" || opt_warning_types=" $warning_categories "
func_run_hooks func_validate_options ${1+"$@"} func_run_hooks func_validate_options ${1+"$@"}
func_propagate_result func_run_hooks func_validate_options
# Bail if the options were screwed! # Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE $exit_cmd $EXIT_FAILURE
# save modified positional parameters for caller
func_validate_options_result=$func_run_hooks_result
} }
## ----------------- ## ## ----------------- ##
## Helper functions. ## ## Helper functions. ##
## ----------------- ## ## ----------------- ##
# This section contains the helper functions used by the rest of the # This section contains the helper functions used by the rest of the
# hookable option parser framework in ascii-betical order. # hookable option parser framework in ascii-betical order.
# func_fatal_help ARG... # func_fatal_help ARG...
skipping to change at line 1988 skipping to change at line 1779
func_missing_arg () func_missing_arg ()
{ {
$debug_cmd $debug_cmd
func_error "Missing argument for '$1'." func_error "Missing argument for '$1'."
exit_cmd=exit exit_cmd=exit
} }
# func_split_equals STRING # func_split_equals STRING
# ------------------------ # ------------------------
# Set func_split_equals_lhs and func_split_equals_rhs shell variables # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
# after splitting STRING at the '=' sign. # splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \ test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c; && (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
&& _G_HAVE_XSI_OPS=yes && _G_HAVE_XSI_OPS=yes
if test yes = "$_G_HAVE_XSI_OPS" if test yes = "$_G_HAVE_XSI_OPS"
then then
# This is an XSI compatible shell, allowing a faster implementation... # This is an XSI compatible shell, allowing a faster implementation...
eval 'func_split_equals () eval 'func_split_equals ()
{ {
$debug_cmd $debug_cmd
func_split_equals_lhs=${1%%=*} func_split_equals_lhs=${1%%=*}
func_split_equals_rhs=${1#*=} func_split_equals_rhs=${1#*=}
if test "x$func_split_equals_lhs" = "x$1"; then test "x$func_split_equals_lhs" = "x$1" \
func_split_equals_rhs= && func_split_equals_rhs=
fi
}' }'
else else
# ...otherwise fall back to using expr, which is often a shell builtin. # ...otherwise fall back to using expr, which is often a shell builtin.
func_split_equals () func_split_equals ()
{ {
$debug_cmd $debug_cmd
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
func_split_equals_rhs= func_split_equals_rhs=
test "x$func_split_equals_lhs=" = "x$1" \ test "x$func_split_equals_lhs" = "x$1" \
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
} }
fi #func_split_equals fi #func_split_equals
# func_split_short_opt SHORTOPT # func_split_short_opt SHORTOPT
# ----------------------------- # -----------------------------
# Set func_split_short_opt_name and func_split_short_opt_arg shell # Set func_split_short_opt_name and func_split_short_opt_arg shell
# variables after splitting SHORTOPT after the 2nd character. # variables after splitting SHORTOPT after the 2nd character.
if test yes = "$_G_HAVE_XSI_OPS" if test yes = "$_G_HAVE_XSI_OPS"
then then
skipping to change at line 2041 skipping to change at line 1831
func_split_short_opt_arg=${1#??} func_split_short_opt_arg=${1#??}
func_split_short_opt_name=${1%"$func_split_short_opt_arg"} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
}' }'
else else
# ...otherwise fall back to using expr, which is often a shell builtin. # ...otherwise fall back to using expr, which is often a shell builtin.
func_split_short_opt () func_split_short_opt ()
{ {
$debug_cmd $debug_cmd
func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
} }
fi #func_split_short_opt fi #func_split_short_opt
# func_usage # func_usage
# ---------- # ----------
# Echo short help message to standard output and exit. # Echo short help message to standard output and exit.
func_usage () func_usage ()
{ {
$debug_cmd $debug_cmd
skipping to change at line 2080 skipping to change at line 1870
} }
h h
/^Written by/q' < "$progpath" /^Written by/q' < "$progpath"
echo echo
eval \$ECHO \""$usage_message"\" eval \$ECHO \""$usage_message"\"
} }
# func_version # func_version
# ------------ # ------------
# Echo version message to standard output and exit. # Echo version message to standard output and exit.
# The version message is extracted from the calling file's header
# comments, with leading '# ' stripped:
# 1. First display the progname and version
# 2. Followed by the header comment line matching /^# Written by /
# 3. Then a blank line followed by the first following line matching
# /^# Copyright /
# 4. Immediately followed by any lines between the previous matches,
# except lines preceding the intervening completely blank line.
# For example, see the header comments of this file.
func_version () func_version ()
{ {
$debug_cmd $debug_cmd
printf '%s\n' "$progname $scriptversion" printf '%s\n' "$progname $scriptversion"
$SED -n ' $SED -n '
/^# Written by /!b /(C)/!b go
s|^# ||; p; n :more
/\./!{
:fwd2blnk N
/./ { s|\n# | |
n b more
b fwd2blnk
} }
p; n :go
/^# Written by /,/# warranty; / {
:holdwrnt s|^# ||
s|^# || s|^# *$||
s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
/^Copyright /!{ p
/./H
n
b holdwrnt
} }
/^# Written by / {
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| s|^# ||
G p
s|\(\n\)\n*|\1|g }
p; q' < "$progpath" /^warranty; /q' < "$progpath"
exit $? exit $?
} }
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script
# sh-indentation: 2 # sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp) # eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC" # time-stamp-time-zone: "UTC"
# End: # End:
# Set a version string. # Set a version string.
scriptversion='(GNU libtool) 2.4.7' scriptversion='(GNU libtool) 2.4.6'
# func_echo ARG... # func_echo ARG...
# ---------------- # ----------------
# Libtool also displays the current mode in messages, so override # Libtool also displays the current mode in messages, so override
# funclib.sh func_echo with this custom definition. # funclib.sh func_echo with this custom definition.
func_echo () func_echo ()
{ {
$debug_cmd $debug_cmd
_G_message=$* _G_message=$*
skipping to change at line 2219 skipping to change at line 1996
Try '$progname --help --mode=MODE' for a more detailed description of MODE. Try '$progname --help --mode=MODE' for a more detailed description of MODE.
When reporting a bug, please describe a test case to reproduce it and When reporting a bug, please describe a test case to reproduce it and
include the following information: include the following information:
host-triplet: $host host-triplet: $host
shell: $SHELL shell: $SHELL
compiler: $LTCC compiler: $LTCC
compiler flags: $LTCFLAGS compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld) linker: $LD (gnu? $with_gnu_ld)
version: $progname $scriptversion Debian-2.4.7-7build1 version: $progname $scriptversion Debian-2.4.6-2
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>. Report bugs to <bug-libtool@gnu.org>.
GNU libtool home page: <http://www.gnu.org/s/libtool/>. GNU libtool home page: <http://www.gnu.org/s/libtool/>.
General help using GNU software: <http://www.gnu.org/gethelp/>." General help using GNU software: <http://www.gnu.org/gethelp/>."
exit 0 exit 0
} }
# func_lo2o OBJECT-NAME # func_lo2o OBJECT-NAME
skipping to change at line 2273 skipping to change at line 2050
func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
} }
fi fi
# func_fatal_configuration ARG... # func_fatal_configuration ARG...
# ------------------------------- # -------------------------------
# Echo program name prefixed message to standard error, followed by # Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit. # a configuration failure hint, and exit.
func_fatal_configuration () func_fatal_configuration ()
{ {
func_fatal_error ${1+"$@"} \ func__fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \ "See the $PACKAGE documentation for more information." \
"Fatal configuration error." "Fatal configuration error."
} }
# func_config # func_config
# ----------- # -----------
# Display the configuration for all the tags in this script. # Display the configuration for all the tags in this script.
func_config () func_config ()
{ {
re_begincf='^# ### BEGIN LIBTOOL' re_begincf='^# ### BEGIN LIBTOOL'
skipping to change at line 2414 skipping to change at line 2191
opt_dlopen= opt_dlopen=
opt_dry_run=false opt_dry_run=false
opt_help=false opt_help=false
opt_mode= opt_mode=
opt_preserve_dup_deps=false opt_preserve_dup_deps=false
opt_quiet=false opt_quiet=false
nonopt= nonopt=
preserve_args= preserve_args=
_G_rc_lt_options_prep=:
_G_rc_lt_options_prep=:
# Shorthand for --mode=foo, only valid as the first argument # Shorthand for --mode=foo, only valid as the first argument
case $1 in case $1 in
clean|clea|cle|cl) clean|clea|cle|cl)
shift; set dummy --mode clean ${1+"$@"}; shift shift; set dummy --mode clean ${1+"$@"}; shift
;; ;;
compile|compil|compi|comp|com|co|c) compile|compil|compi|comp|com|co|c)
shift; set dummy --mode compile ${1+"$@"}; shift shift; set dummy --mode compile ${1+"$@"}; shift
;; ;;
execute|execut|execu|exec|exe|ex|e) execute|execut|execu|exec|exe|ex|e)
shift; set dummy --mode execute ${1+"$@"}; shift shift; set dummy --mode execute ${1+"$@"}; shift
skipping to change at line 2441 skipping to change at line 2214
;; ;;
install|instal|insta|inst|ins|in|i) install|instal|insta|inst|ins|in|i)
shift; set dummy --mode install ${1+"$@"}; shift shift; set dummy --mode install ${1+"$@"}; shift
;; ;;
link|lin|li|l) link|lin|li|l)
shift; set dummy --mode link ${1+"$@"}; shift shift; set dummy --mode link ${1+"$@"}; shift
;; ;;
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift shift; set dummy --mode uninstall ${1+"$@"}; shift
;; ;;
*)
_G_rc_lt_options_prep=false
;;
esac esac
if $_G_rc_lt_options_prep; then # Pass back the list of options.
# Pass back the list of options. func_quote_for_eval ${1+"$@"}
func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result
libtool_options_prep_result=$func_quote_result
fi
} }
func_add_hook func_options_prep libtool_options_prep func_add_hook func_options_prep libtool_options_prep
# libtool_parse_options [ARG]... # libtool_parse_options [ARG]...
# --------------------------------- # ---------------------------------
# Provide handling for libtool specific options. # Provide handling for libtool specific options.
libtool_parse_options () libtool_parse_options ()
{ {
$debug_cmd $debug_cmd
_G_rc_lt_parse_options=false
# Perform our own loop to consume as many options as possible in # Perform our own loop to consume as many options as possible in
# each iteration. # each iteration.
while test $# -gt 0; do while test $# -gt 0; do
_G_match_lt_parse_options=:
_G_opt=$1 _G_opt=$1
shift shift
case $_G_opt in case $_G_opt in
--dry-run|--dryrun|-n) --dry-run|--dryrun|-n)
opt_dry_run=: opt_dry_run=:
;; ;;
--config) func_config ;; --config) func_config ;;
--dlopen|-dlopen) --dlopen|-dlopen)
skipping to change at line 2541 skipping to change at line 2306
func_append preserve_args " $_G_opt $1" func_append preserve_args " $_G_opt $1"
func_enable_tag "$1" func_enable_tag "$1"
shift shift
;; ;;
--verbose|-v) opt_quiet=false --verbose|-v) opt_quiet=false
opt_verbose=: opt_verbose=:
func_append preserve_args " $_G_opt" func_append preserve_args " $_G_opt"
;; ;;
# An option not handled by this hook function: # An option not handled by this hook function:
*) set dummy "$_G_opt" ${1+"$@"} ; shift *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
_G_match_lt_parse_options=false
break
;;
esac esac
$_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done done
if $_G_rc_lt_parse_options; then # save modified positional parameters for caller
# save modified positional parameters for caller func_quote_for_eval ${1+"$@"}
func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result
libtool_parse_options_result=$func_quote_result
fi
} }
func_add_hook func_parse_options libtool_parse_options func_add_hook func_parse_options libtool_parse_options
# libtool_validate_options [ARG]... # libtool_validate_options [ARG]...
# --------------------------------- # ---------------------------------
# Perform any sanity checks on option settings and/or unconsumed # Perform any sanity checks on option settings and/or unconsumed
# arguments. # arguments.
libtool_validate_options () libtool_validate_options ()
{ {
# save first non-option argument # save first non-option argument
skipping to change at line 2609 skipping to change at line 2368
$ECHO "$help" 1>&2 $ECHO "$help" 1>&2
exit $EXIT_FAILURE exit $EXIT_FAILURE
fi fi
# Change the help message to a mode-specific one. # Change the help message to a mode-specific one.
generic_help=$help generic_help=$help
help="Try '$progname --help --mode=$opt_mode' for more information." help="Try '$progname --help --mode=$opt_mode' for more information."
} }
# Pass back the unparsed argument list # Pass back the unparsed argument list
func_quote eval ${1+"$@"} func_quote_for_eval ${1+"$@"}
libtool_validate_options_result=$func_quote_result libtool_validate_options_result=$func_quote_for_eval_result
} }
func_add_hook func_validate_options libtool_validate_options func_add_hook func_validate_options libtool_validate_options
# Process options as early as possible so that --help and --version # Process options as early as possible so that --help and --version
# can return quickly. # can return quickly.
func_options ${1+"$@"} func_options ${1+"$@"}
eval set dummy "$func_options_result"; shift eval set dummy "$func_options_result"; shift
## ----------- ## ## ----------- ##
## Main. ## ## Main. ##
skipping to change at line 3540 skipping to change at line 3299
continue continue
;; ;;
-prefer-non-pic) -prefer-non-pic)
pic_mode=no pic_mode=no
continue continue
;; ;;
esac esac
done done
func_quote_arg pretty "$libobj" func_quote_for_eval "$libobj"
test "X$libobj" != "X$func_quote_arg_result" \ test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters." && func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" "" func_dirname_and_basename "$obj" "/" ""
objname=$func_basename_result objname=$func_basename_result
xdir=$func_dirname_result xdir=$func_dirname_result
lobj=$xdir$objdir/$objname lobj=$xdir$objdir/$objname
test -z "$base_compile" && \ test -z "$base_compile" && \
func_fatal_help "you must specify a compilation command" func_fatal_help "you must specify a compilation command"
skipping to change at line 3614 skipping to change at line 3373
func_append removelist " $output_obj" func_append removelist " $output_obj"
$ECHO "$srcfile" > "$lockfile" $ECHO "$srcfile" > "$lockfile"
fi fi
$opt_dry_run || $RM $removelist $opt_dry_run || $RM $removelist
func_append removelist " $lockfile" func_append removelist " $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result srcfile=$func_to_tool_file_result
func_quote_arg pretty "$srcfile" func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_arg_result qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries. # Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then if test yes = "$build_libtool_libs"; then
# Without this assignment, base_compile gets emptied. # Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile fbsd_hideous_sh_bug=$base_compile
if test no != "$pic_mode"; then if test no != "$pic_mode"; then
command="$base_compile $qsrcfile $pic_flag" command="$base_compile $qsrcfile $pic_flag"
else else
# Don't build PIC code # Don't build PIC code
skipping to change at line 3770 skipping to change at line 3529
Compile a source file into a libtool library object. Compile a source file into a libtool library object.
This mode accepts the following additional options: This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE -o OUTPUT-FILE set the output file name to OUTPUT-FILE
-no-suppress do not suppress compiler output for multiple passes -no-suppress do not suppress compiler output for multiple passes
-prefer-pic try to build PIC objects only -prefer-pic try to build PIC objects only
-prefer-non-pic try to build non-PIC objects only -prefer-non-pic try to build non-PIC objects only
-shared do not build a '.o' file suitable for static linking -shared do not build a '.o' file suitable for static linking
-static only build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking
-Wc,FLAG -Wc,FLAG pass FLAG directly to the compiler
-Xcompiler FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a 'standard' object fil e COMPILE-COMMAND is a command to be used in creating a 'standard' object fil e
from the given SOURCEFILE. from the given SOURCEFILE.
The output file name is determined by removing the directory component from The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix '.c' with the SOURCEFILE, then substituting the C source code suffix '.c' with the
library object suffix, '.lo'." library object suffix, '.lo'."
;; ;;
execute) execute)
skipping to change at line 3877 skipping to change at line 3635
-shared only do dynamic linking of libtool libraries -shared only do dynamic linking of libtool libraries
-shrext SUFFIX override the standard shared library file extension -shrext SUFFIX override the standard shared library file extension
-static do not do any dynamic linking of uninstalled libtool li braries -static do not do any dynamic linking of uninstalled libtool li braries
-static-libtool-libs -static-libtool-libs
do not do any dynamic linking of libtool libraries do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]] -version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0] specify library version info [each variable defaults to 0]
-weak LIBNAME declare that the target provides the LIBNAME interface -weak LIBNAME declare that the target provides the LIBNAME interface
-Wc,FLAG -Wc,FLAG
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
-Wa,FLAG
-Xassembler FLAG pass linker-specific FLAG directly to the assembler
-Wl,FLAG -Wl,FLAG
-Xlinker FLAG pass linker-specific FLAG directly to the linker -Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
All other options (arguments beginning with '-') are ignored. All other options (arguments beginning with '-') are ignored.
Every other argument is treated as a filename. Files ending in '.la' are Every other argument is treated as a filename. Files ending in '.la' are
treated as uninstalled libtool libraries, other files are standard or libra ry treated as uninstalled libtool libraries, other files are standard or libra ry
object files. object files.
skipping to change at line 4218 skipping to change at line 3974
{ {
$debug_cmd $debug_cmd
# There may be an optional sh(1) argument at the beginning of # There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT). # install_prog (especially on Windows NT).
if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
# Allow the use of GNU shtool's install command. # Allow the use of GNU shtool's install command.
case $nonopt in *shtool*) :;; *) false;; esac case $nonopt in *shtool*) :;; *) false;; esac
then then
# Aesthetically quote it. # Aesthetically quote it.
func_quote_arg pretty "$nonopt" func_quote_for_eval "$nonopt"
install_prog="$func_quote_arg_result " install_prog="$func_quote_for_eval_result "
arg=$1 arg=$1
shift shift
else else
install_prog= install_prog=
arg=$nonopt arg=$nonopt
fi fi
# The real first argument should be the name of the installation progra m. # The real first argument should be the name of the installation progra m.
# Aesthetically quote it. # Aesthetically quote it.
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
func_append install_prog "$func_quote_arg_result" func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog install_shared_prog=$install_prog
case " $install_prog " in case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;; *[\\\ /]cp\ *) install_cp=: ;;
*) install_cp=false ;; *) install_cp=false ;;
esac esac
# We need to accept at least all the BSD install flags. # We need to accept at least all the BSD install flags.
dest= dest=
files= files=
opts= opts=
skipping to change at line 4287 skipping to change at line 4043
fi fi
prev= prev=
else else
dest=$arg dest=$arg
continue continue
fi fi
;; ;;
esac esac
# Aesthetically quote the argument. # Aesthetically quote the argument.
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
func_append install_prog " $func_quote_arg_result" func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then if test -n "$arg2"; then
func_quote_arg pretty "$arg2" func_quote_for_eval "$arg2"
fi fi
func_append install_shared_prog " $func_quote_arg_result" func_append install_shared_prog " $func_quote_for_eval_result"
done done
test -z "$install_prog" && \ test -z "$install_prog" && \
func_fatal_help "you must specify an install program" func_fatal_help "you must specify an install program"
test -n "$prev" && \ test -n "$prev" && \
func_fatal_help "the '$prev' option requires an argument" func_fatal_help "the '$prev' option requires an argument"
if test -n "$install_override_mode" && $no_mode; then if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else if $install_cp; then :; else
func_quote_arg pretty "$install_override_mode" func_quote_for_eval "$install_override_mode"
func_append install_shared_prog " -m $func_quote_arg_result" func_append install_shared_prog " -m $func_quote_for_eval_result"
fi fi
fi fi
if test -z "$files"; then if test -z "$files"; then
if test -z "$dest"; then if test -z "$dest"; then
func_fatal_help "no file or destination specified" func_fatal_help "no file or destination specified"
else else
func_fatal_help "you must specify a destination" func_fatal_help "you must specify a destination"
fi fi
fi fi
skipping to change at line 4600 skipping to change at line 4356
$opt_dry_run || { $opt_dry_run || {
if $finalize; then if $finalize; then
tmpdir=`func_mktempdir` tmpdir=`func_mktempdir`
func_basename "$file$stripped_ext" func_basename "$file$stripped_ext"
file=$func_basename_result file=$func_basename_result
outputname=$tmpdir/$file outputname=$tmpdir/$file
# Replace the output file specification. # Replace the output file specification.
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%' "$outputname"'%g'` relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%' "$outputname"'%g'`
$opt_quiet || { $opt_quiet || {
func_quote_arg expand,pretty "$relink_command" func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_arg_result" eval "func_echo $func_quote_for_expand_result"
} }
if eval "$relink_command"; then : if eval "$relink_command"; then :
else else
func_error "error: relink '$file' with the above command b efore installing it" func_error "error: relink '$file' with the above command b efore installing it"
$opt_dry_run || ${RM}r "$tmpdir" $opt_dry_run || ${RM}r "$tmpdir"
continue continue
fi fi
file=$outputname file=$outputname
else else
func_warning "cannot relink '$file'" func_warning "cannot relink '$file'"
skipping to change at line 5376 skipping to change at line 5132
# This environment variable determines our operation mode. # This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variables: # install mode needs the following variables:
generated_by_libtool_version='$macro_version' generated_by_libtool_version='$macro_version'
notinst_deplibs='$notinst_deplibs' notinst_deplibs='$notinst_deplibs'
else else
# When we are sourced in execute mode, \$file and \$ECHO are already set. # When we are sourced in execute mode, \$file and \$ECHO are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\"" file=\"\$0\""
func_quote_arg pretty "$ECHO" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
qECHO=$func_quote_arg_result
$ECHO "\ $ECHO "\
# A function that is used when there is no print builtin or printf. # A function that is used when there is no print builtin or printf.
func_fallback_echo () func_fallback_echo ()
{ {
eval 'cat <<_LTECHO_EOF eval 'cat <<_LTECHO_EOF
\$1 \$1
_LTECHO_EOF' _LTECHO_EOF'
} }
ECHO=$qECHO ECHO=\"$qECHO\"
fi fi
# Very basic option parsing. These options are (a) specific to # Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper # the libtool wrapper, (b) are identical between the wrapper
# /script/ and the wrapper /executable/ that is used only on # /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string "--lt-" # windows platforms, and (c) all begin with the string "--lt-"
# (application programs are unlikely to have options that match # (application programs are unlikely to have options that match
# this pattern). # this pattern).
# #
# There are only two supported options: --lt-debug and # There are only two supported options: --lt-debug and
skipping to change at line 6728 skipping to change at line 6483
esac esac
done done
# See if our shared archives depend on static archives. # See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way. # Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do while test "$#" -gt 0; do
arg=$1 arg=$1
shift shift
func_quote_arg pretty,unquoted "$arg" func_quote_for_eval "$arg"
qarg=$func_quote_arg_unquoted_result qarg=$func_quote_for_eval_unquoted_result
func_append libtool_args " $func_quote_arg_result" func_append libtool_args " $func_quote_for_eval_result"
# If the previous option needs an argument, assign it. # If the previous option needs an argument, assign it.
if test -n "$prev"; then if test -n "$prev"; then
case $prev in case $prev in
output) output)
func_append compile_command " @OUTPUT@" func_append compile_command " @OUTPUT@"
func_append finalize_command " @OUTPUT@" func_append finalize_command " @OUTPUT@"
;; ;;
esac esac
skipping to change at line 6966 skipping to change at line 6721
shrext) shrext)
shrext_cmds=$arg shrext_cmds=$arg
prev= prev=
continue continue
;; ;;
weak) weak)
func_append weak_libs " $arg" func_append weak_libs " $arg"
prev= prev=
continue continue
;; ;;
xassembler)
func_append compiler_flags " -Xassembler $qarg"
prev=
func_append compile_command " -Xassembler $qarg"
func_append finalize_command " -Xassembler $qarg"
continue
;;
xcclinker) xcclinker)
func_append linker_flags " $qarg" func_append linker_flags " $qarg"
func_append compiler_flags " $qarg" func_append compiler_flags " $qarg"
prev= prev=
func_append compile_command " $qarg" func_append compile_command " $qarg"
func_append finalize_command " $qarg" func_append finalize_command " $qarg"
continue continue
;; ;;
xcompiler) xcompiler)
func_append compiler_flags " $qarg" func_append compiler_flags " $qarg"
skipping to change at line 7143 skipping to change at line 6891
if test X-lc = "X$arg" || test X-lm = "X$arg"; then if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*- haiku*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*- haiku*)
# These systems don't actually have a C or math library (as such ) # These systems don't actually have a C or math library (as such )
continue continue
;; ;;
*-*-os2*) *-*-os2*)
# These systems don't actually have a C library (as such) # These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue test X-lc = "X$arg" && continue
;; ;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-m idnightbsd*) *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r. # Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue test X-lc = "X$arg" && continue
;; ;;
*-*-rhapsody* | *-*-darwin1.[012]) *-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework # Rhapsody C and math libraries are in the System framework
func_append deplibs " System.ltframework" func_append deplibs " System.ltframework"
continue continue
;; ;;
*-*-sco3.2v5* | *-*-sco5v6*) *-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype # Causes problems with __ctype
test X-lc = "X$arg" && continue test X-lc = "X$arg" && continue
;; ;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work # Compiler inserts libc in the correct place for threads to work
test X-lc = "X$arg" && continue test X-lc = "X$arg" && continue
;; ;;
esac esac
elif test X-lc_r = "X$arg"; then elif test X-lc_r = "X$arg"; then
case $host in case $host in
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-mi dnightbsd*) *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc_r directly, use -pthread flag. # Do not include libc_r directly, use -pthread flag.
continue continue
;; ;;
esac esac
fi fi
func_append deplibs " $arg" func_append deplibs " $arg"
continue continue
;; ;;
-mllvm) -mllvm)
skipping to change at line 7193 skipping to change at line 6941
# Tru64 UNIX uses -model [arg] to determine the layout of C++ # Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling. # classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture. # Darwin uses the -arch flag to determine output architecture.
-model|-arch|-isysroot|--sysroot) -model|-arch|-isysroot|--sysroot)
func_append compiler_flags " $arg" func_append compiler_flags " $arg"
func_append compile_command " $arg" func_append compile_command " $arg"
func_append finalize_command " $arg" func_append finalize_command " $arg"
prev=xcompiler prev=xcompiler
continue continue
;; ;;
# Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
-pthread) -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
case $host in
*solaris2*) ;;
*)
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
* ) func_append new_inherited_linker_flags " $arg" ;;
esac
;;
esac
continue
;;
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg" func_append compiler_flags " $arg"
func_append compile_command " $arg" func_append compile_command " $arg"
func_append finalize_command " $arg" func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in case "$new_inherited_linker_flags " in
*" $arg "*) ;; *" $arg "*) ;;
* ) func_append new_inherited_linker_flags " $arg" ;; * ) func_append new_inherited_linker_flags " $arg" ;;
esac esac
continue continue
;; ;;
skipping to change at line 7347 skipping to change at line 7083
continue continue
;; ;;
-Wc,*) -Wc,*)
func_stripname '-Wc,' '' "$arg" func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result args=$func_stripname_result
arg= arg=
save_ifs=$IFS; IFS=, save_ifs=$IFS; IFS=,
for flag in $args; do for flag in $args; do
IFS=$save_ifs IFS=$save_ifs
func_quote_arg pretty "$flag" func_quote_for_eval "$flag"
func_append arg " $func_quote_arg_result" func_append arg " $func_quote_for_eval_result"
func_append compiler_flags " $func_quote_arg_result" func_append compiler_flags " $func_quote_for_eval_result"
done done
IFS=$save_ifs IFS=$save_ifs
func_stripname ' ' '' "$arg" func_stripname ' ' '' "$arg"
arg=$func_stripname_result arg=$func_stripname_result
;; ;;
-Wl,*) -Wl,*)
func_stripname '-Wl,' '' "$arg" func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result args=$func_stripname_result
arg= arg=
save_ifs=$IFS; IFS=, save_ifs=$IFS; IFS=,
for flag in $args; do for flag in $args; do
IFS=$save_ifs IFS=$save_ifs
func_quote_arg pretty "$flag" func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_arg_result" func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_arg_result" func_append linker_flags " $func_quote_for_eval_result"
done done
IFS=$save_ifs IFS=$save_ifs
func_stripname ' ' '' "$arg" func_stripname ' ' '' "$arg"
arg=$func_stripname_result arg=$func_stripname_result
;; ;;
-Xassembler)
prev=xassembler
continue
;;
-Xcompiler) -Xcompiler)
prev=xcompiler prev=xcompiler
continue continue
;; ;;
-Xlinker) -Xlinker)
prev=xlinker prev=xlinker
continue continue
;; ;;
-XCClinker) -XCClinker)
prev=xcclinker prev=xcclinker
continue continue
;; ;;
# -msg_* for osf cc # -msg_* for osf cc
-msg_*) -msg_*)
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
arg=$func_quote_arg_result arg=$func_quote_for_eval_result
;; ;;
# Flags to be passed through unchanged, with rationale: # Flags to be passed through unchanged, with rationale:
# -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
# -r[0-9][0-9]* specify processor for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler
# -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
# +DA*, +DD* enable 64-bit mode for the HP compiler # +DA*, +DD* enable 64-bit mode for the HP compiler
# -q* compiler args for the IBM compiler # -q* compiler args for the IBM compiler
# -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
# -F/path path to uninstalled frameworks, gcc on darwin # -F/path path to uninstalled frameworks, gcc on darwin
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
# -fstack-protector* stack protector flags for GCC # -fstack-protector* stack protector flags for GCC
# @file GCC response files # @file GCC response files
# -tp=* Portland pgcc target processor selection # -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support # --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optim ization # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optim ization
# -specs=* GCC specs files # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang # -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer # -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
# -static-* direct GCC to link specific libraries statical
ly
# -fcilkplus Cilk Plus language extension features for C/C+
+
# -Wa,* Pass flags directly to the assembler
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroo t=*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroo t=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdli b=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdli b=*| \
-specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) -specs=*|-fsanitize=*)
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
arg=$func_quote_arg_result arg=$func_quote_for_eval_result
func_append compile_command " $arg" func_append compile_command " $arg"
func_append finalize_command " $arg" func_append finalize_command " $arg"
func_append compiler_flags " $arg" func_append compiler_flags " $arg"
continue continue
;; ;;
-Z*) -Z*)
if test os2 = "`expr $host : '.*\(os2\)'`"; then if test os2 = "`expr $host : '.*\(os2\)'`"; then
# OS/2 uses -Zxxx to specify OS/2-specific options # OS/2 uses -Zxxx to specify OS/2-specific options
compiler_flags="$compiler_flags $arg" compiler_flags="$compiler_flags $arg"
func_append compile_command " $arg" func_append compile_command " $arg"
func_append finalize_command " $arg" func_append finalize_command " $arg"
case $arg in case $arg in
-Zlinker | -Zstack) -Zlinker | -Zstack)
prev=xcompiler prev=xcompiler
;; ;;
esac esac
continue continue
else else
# Otherwise treat like 'Some other compiler flag' below # Otherwise treat like 'Some other compiler flag' below
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
arg=$func_quote_arg_result arg=$func_quote_for_eval_result
fi fi
;; ;;
# Some other compiler flag. # Some other compiler flag.
-* | +*) -* | +*)
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
arg=$func_quote_arg_result arg=$func_quote_for_eval_result
;; ;;
*.$objext) *.$objext)
# A standard object. # A standard object.
func_append objs " $arg" func_append objs " $arg"
;; ;;
*.lo) *.lo)
# A libtool-controlled object. # A libtool-controlled object.
skipping to change at line 7574 skipping to change at line 7301
else else
func_append deplibs " $func_resolve_sysroot_result" func_append deplibs " $func_resolve_sysroot_result"
fi fi
continue continue
;; ;;
# Some other compiler argument. # Some other compiler argument.
*) *)
# Unknown arguments in both finalize_command and compile_command nee d # Unknown arguments in both finalize_command and compile_command nee d
# to be aesthetically quoted because they are evaled later. # to be aesthetically quoted because they are evaled later.
func_quote_arg pretty "$arg" func_quote_for_eval "$arg"
arg=$func_quote_arg_result arg=$func_quote_for_eval_result
;; ;;
esac # arg esac # arg
# Now actually substitute the argument into the commands. # Now actually substitute the argument into the commands.
if test -n "$arg"; then if test -n "$arg"; then
func_append compile_command " $arg" func_append compile_command " $arg"
func_append finalize_command " $arg" func_append finalize_command " $arg"
fi fi
done # argument parsing loop done # argument parsing loop
skipping to change at line 8780 skipping to change at line 8507
esac esac
done done
eval $var=\"$tmp_libs\" eval $var=\"$tmp_libs\"
done # for var done # for var
fi fi
# Add Sun CC postdeps if required: # Add Sun CC postdeps if required:
test CXX = "$tagname" && { test CXX = "$tagname" && {
case $host_os in case $host_os in
linux*) linux*)
case `$CC -V 2>&1 | $SED 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C++ 5.9 *Sun\ C*) # Sun C++ 5.9
func_suncc_cstd_abi func_suncc_cstd_abi
if test no != "$suncc_use_cstd_abi"; then if test no != "$suncc_use_cstd_abi"; then
func_append postdeps ' -library=Cstd -library=Crun' func_append postdeps ' -library=Cstd -library=Crun'
fi fi
;; ;;
esac esac
;; ;;
skipping to change at line 8953 skipping to change at line 8680
number_revision=$3 number_revision=$3
# #
# There are really only two kinds -- those that # There are really only two kinds -- those that
# use the current revision as the major version # use the current revision as the major version
# and those that subtract age and use age as # and those that subtract age and use age as
# a minor version. But, then there is irix # a minor version. But, then there is irix
# that has an extra 1 added just for fun # that has an extra 1 added just for fun
# #
case $version_type in case $version_type in
# correct linux to gnu/linux during the next big refactor # correct linux to gnu/linux during the next big refactor
darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) darwin|freebsd-elf|linux|osf|windows|none)
func_arith $number_major + $number_minor func_arith $number_major + $number_minor
current=$func_arith_result current=$func_arith_result
age=$number_minor age=$number_minor
revision=$number_revision revision=$number_revision
;; ;;
freebsd-aout|qnx|sunos) freebsd-aout|qnx|sunos)
current=$number_major current=$number_major
revision=$number_minor revision=$number_minor
age=0 age=0
;; ;;
skipping to change at line 9047 skipping to change at line 8774
verstring="-compatibility_version $minor_current -current _version $minor_current.$revision" verstring="-compatibility_version $minor_current -current _version $minor_current.$revision"
;; ;;
esac esac
;; ;;
freebsd-aout) freebsd-aout)
major=.$current major=.$current
versuffix=.$current.$revision versuffix=.$current.$revision
;; ;;
freebsd-elf | midnightbsd-elf) freebsd-elf)
func_arith $current - $age func_arith $current - $age
major=.$func_arith_result major=.$func_arith_result
versuffix=$major.$age.$revision versuffix=$major.$age.$revision
;; ;;
irix | nonstopux) irix | nonstopux)
if test no = "$lt_irix_increment"; then if test no = "$lt_irix_increment"; then
func_arith $current - $age func_arith $current - $age
else else
func_arith $current - $age + 1 func_arith $current - $age + 1
skipping to change at line 9273 skipping to change at line 9000
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-ce gcc* | *-*-haiku*) *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-ce gcc* | *-*-haiku*)
# these systems don't actually have a c library (as such)! # these systems don't actually have a c library (as such)!
;; ;;
*-*-rhapsody* | *-*-darwin1.[012]) *-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework # Rhapsody C library is in the System framework
func_append deplibs " System.ltframework" func_append deplibs " System.ltframework"
;; ;;
*-*-netbsd*) *-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed. # Don't link with libc until the a.out ld.so is fixed.
;; ;;
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
# Do not include libc due to us having libc/libc_r. # Do not include libc due to us having libc/libc_r.
;; ;;
*-*-sco3.2v5* | *-*-sco5v6*) *-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype # Causes problems with __ctype
;; ;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work # Compiler inserts libc in the correct place for threads to work
;; ;;
*) *)
# Add libc to deplibs on all other systems if necessary. # Add libc to deplibs on all other systems if necessary.
skipping to change at line 10084 skipping to change at line 9811
} }
test -n "$save_libobjs" && test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $ou tput" func_verbose "creating a temporary reloadable object file: $ou tput"
# Loop through the commands generated above and execute them. # Loop through the commands generated above and execute them.
save_ifs=$IFS; IFS='~' save_ifs=$IFS; IFS='~'
for cmd in $concat_cmds; do for cmd in $concat_cmds; do
IFS=$save_ifs IFS=$save_ifs
$opt_quiet || { $opt_quiet || {
func_quote_arg expand,pretty "$cmd" func_quote_for_expand "$cmd"
eval "func_echo $func_quote_arg_result" eval "func_echo $func_quote_for_expand_result"
} }
$opt_dry_run || eval "$cmd" || { $opt_dry_run || eval "$cmd" || {
lt_exit=$? lt_exit=$?
# Restore the uninstalled library and exit # Restore the uninstalled library and exit
if test relink = "$opt_mode"; then if test relink = "$opt_mode"; then
( cd "$output_objdir" && \ ( cd "$output_objdir" && \
$RM "${realname}T" && \ $RM "${realname}T" && \
$MV "${realname}U" "$realname" ) $MV "${realname}U" "$realname" )
fi fi
skipping to change at line 10178 skipping to change at line 9905
func_append libobjs " $func_extract_archives_result" func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs= test "X$libobjs" = "X " && libobjs=
fi fi
save_ifs=$IFS; IFS='~' save_ifs=$IFS; IFS='~'
for cmd in $cmds; do for cmd in $cmds; do
IFS=$sp$nl IFS=$sp$nl
eval cmd=\"$cmd\" eval cmd=\"$cmd\"
IFS=$save_ifs IFS=$save_ifs
$opt_quiet || { $opt_quiet || {
func_quote_arg expand,pretty "$cmd" func_quote_for_expand "$cmd"
eval "func_echo $func_quote_arg_result" eval "func_echo $func_quote_for_expand_result"
} }
$opt_dry_run || eval "$cmd" || { $opt_dry_run || eval "$cmd" || {
lt_exit=$? lt_exit=$?
# Restore the uninstalled library and exit # Restore the uninstalled library and exit
if test relink = "$opt_mode"; then if test relink = "$opt_mode"; then
( cd "$output_objdir" && \ ( cd "$output_objdir" && \
$RM "${realname}T" && \ $RM "${realname}T" && \
$MV "${realname}U" "$realname" ) $MV "${realname}U" "$realname" )
fi fi
skipping to change at line 10651 skipping to change at line 10378
# Quote the relink command for shipping. # Quote the relink command for shipping.
if test -n "$relink_command"; then if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior # Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command" relink_command="$var=; export $var; $relink_command"
else else
func_quote_arg pretty "$var_value" func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_arg_result; export $var; $relin relink_command="$var=$func_quote_for_eval_result; export $var; $
k_command" relink_command"
fi fi
done done
func_quote eval cd "`pwd`" relink_command="(cd `pwd`; $relink_command)"
func_quote_arg pretty,unquoted "($func_quote_result; $relink_command relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
)"
relink_command=$func_quote_arg_unquoted_result
fi fi
# Only actually do things if not in dry run mode. # Only actually do things if not in dry run mode.
$opt_dry_run || { $opt_dry_run || {
# win32 will think the script is a binary if it has # win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here. # a .exe suffix, so we strip it off here.
case $output in case $output in
*.exe) func_stripname '' '.exe' "$output" *.exe) func_stripname '' '.exe' "$output"
output=$func_stripname_result ;; output=$func_stripname_result ;;
esac esac
skipping to change at line 10897 skipping to change at line 10623
test yes = "$build_old_libs" && old_library=$libname.$libext test yes = "$build_old_libs" && old_library=$libname.$libext
func_verbose "creating $output" func_verbose "creating $output"
# Preserve any variables that may affect compiler behavior # Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command" relink_command="$var=; export $var; $relink_command"
else else
func_quote_arg pretty,unquoted "$var_value" func_quote_for_eval "$var_value"
relink_command="$var=$func_quote_arg_unquoted_result; export $var; relink_command="$var=$func_quote_for_eval_result; export $var; $re
$relink_command" link_command"
fi fi
done done
# Quote the link command for shipping. # Quote the link command for shipping.
func_quote eval cd "`pwd`" relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode
relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_a =relink $libtool_args @inst_prefix_dir@)"
rgs --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
func_quote_arg pretty,unquoted "$relink_command"
relink_command=$func_quote_arg_unquoted_result
if test yes = "$hardcode_automatic"; then if test yes = "$hardcode_automatic"; then
relink_command= relink_command=
fi fi
# Only create the output if not a dry run. # Only create the output if not a dry run.
$opt_dry_run || { $opt_dry_run || {
for installed in no yes; do for installed in no yes; do
if test yes = "$installed"; then if test yes = "$installed"; then
if test -z "$install_libdir"; then if test -z "$install_libdir"; then
break break
 End of changes. 130 change blocks. 
600 lines changed or deleted 310 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/