"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ltmain.sh" between
wayland-1.17.0.tar.xz and wayland-1.18.0.tar.xz

About: Wayland is a computer display server protocol for a compositor to talk to its clients and a library for Linux implementing that protocol.

ltmain.sh  (wayland-1.17.0.tar.xz):ltmain.sh  (wayland-1.18.0.tar.xz)
#! /bin/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 v2014-01-03.01 ## by inline-source v2018-07-24.06
# libtool (GNU libtool) 2.4.6 # libtool (GNU libtool) 2.4.6.42-b88ce
# 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-2015 Free Software Foundation, Inc. # Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO # This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# 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.6 VERSION=2.4.6.42-b88ce
package_revision=2.4.6 package_revision=2.4.6.42
## ------ ## ## ------ ##
## 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=2015-01-20.17; # UTC scriptversion=2018-07-24.06; # 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
# Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software. There is NO warranty; not even for
# This is free software; see the source for copying conditions. There is NO # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# Copyright (C) 2004-2018 Bootstrap Authors
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # This file is dual licensed under the terms of the MIT license
# the Free Software Foundation; either version 3 of the License, or # <https://opensource.org/license/MIT>, and GPL version 3 or later
# (at your option) any later version. # <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
# As a special exception to the GNU General Public License, if you distribute # the files within it. See the URLs above, or the file `LICENSE`
# this file as part of a program or library that is built using GNU Libtool, # included in the Bootstrap distribution for the full license texts.
# 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 gary@gnu.org. # Please report bugs or propose patches to:
# <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 137 skipping to change at line 128
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
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# 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 separator! # There are apparently some retarded systems that use ';' as a PATH separator!
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 251 skipping to change at line 258
# 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 286 skipping to change at line 293
# 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 562 skipping to change at line 569
# 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_for_eval "$2" func_quote_arg pretty "$2"
eval "$1+=\\ \$func_quote_for_eval_result" eval "$1+=\\ \$func_quote_arg_result"
}' }'
else else
func_append_quoted () func_append_quoted ()
{ {
$debug_cmd $debug_cmd
func_quote_for_eval "$2" func_quote_arg pretty "$2"
eval "$1=\$$1\\ \$func_quote_for_eval_result" eval "$1=\$$1\\ \$func_quote_arg_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 1055 skipping to change at line 1062
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_for_eval ARG... # func_quote_portable EVAL ARG
# -------------------------- # ----------------------------
# Aesthetically quote ARGs to be evaled later. # Internal function to portably implement func_quote_arg. Note that we still
# 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 func_quote_portable ()
# ii) func_quote_for_eval_unquoted_result
# has all characters that are still active within double
# quotes backslashified.
func_quote_for_eval ()
{ {
$debug_cmd $debug_cmd
func_quote_for_eval_unquoted_result= func_quote_portable_result=$2
func_quote_for_eval_result=
while test 0 -lt $#; do # one-time-loop (easy break)
case $1 in while true
*[\\\`\"\$]*) do
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; if $1; then
*) func_quote_portable_result=`$ECHO "$2" | $SED \
_G_unquoted_arg=$1 ;; -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
esac break
if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else
func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
fi fi
case $_G_unquoted_arg in # Quote for eval.
# Double-quote args containing shell metacharacters to delay case $func_quote_portable_result in
# word splitting, command substitution and variable expansion *[\\\`\"\$]*)
# for a subsequent eval. case $func_quote_portable_result in
# Many Bourne shells cannot handle close brackets correctly *[\[\*\?]*)
# in scan sets, so we specify it separately. func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | $SED "$sed_quote_subst"`
_G_quoted_arg=\"$_G_unquoted_arg\" break
;;
esac
func_quote_portable_old_IFS=$IFS
for _G_char in '\' '`' '"' '$'
do
# STATE($1) PREV($2) SEPARATOR($3)
set start "" ""
func_quote_portable_result=dummy"$_G_char$func_quote_portable_result
$_G_char"dummy
IFS=$_G_char
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
if test -n "$func_quote_for_eval_result"; then
func_append func_quote_for_eval_result " $_G_quoted_arg"
else
func_append func_quote_for_eval_result "$_G_quoted_arg"
fi
shift
done done
func_quote_portable_unquoted_result=$func_quote_portable_result
case $func_quote_portable_result in
# double-quote args containing shell metacharacters to delay
# word splitting, command substitution and variable expansion
# for a subsequent eval.
# many bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
func_quote_portable_result=\"$func_quote_portable_result\"
;;
esac
} }
# func_quote_for_expand ARG # func_quotefast_eval ARG
# ------------------------- # -----------------------
# Aesthetically quote ARG to be evaled later; same as above, # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
# 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
case $1 in # func_quote_arg MODEs ARG
*[\\\`\"]*) # ------------------------
_G_arg=`$ECHO "$1" | $SED \ # Quote one ARG to be evaled later. MODEs argument may contain zero or more
-e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; # specifiers listed below separated by ',' character. This function returns two
*) # values:
_G_arg=$1 ;; # 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 might
# be used later in func_quote to get output like: 'echo "a b"' instead
# of 'echo a\ b'. This is slower than default on some shells.
# 'unquoted'
# - produce also $func_quote_arg_unquoted_result which does not contain
# 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 $_G_arg in case ,$1, in
# Double-quote args containing shell metacharacters to delay *,pretty,*|*,expand,*|*,unquoted,*)
# word splitting and command substitution for a subsequent eval. func_quote_portable $_G_quote_expand "$2"
# Many Bourne shells cannot handle close brackets correctly func_quote_arg_result=$func_quote_portable_result
# in scan sets, so we specify it separately. func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") ;;
_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_for_expand_result=$_G_arg # func_quote MODEs ARGs...
# ------------------------
# 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 1176 skipping to change at line 1295
# 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_for_expand "$_G_cmd" func_quote_arg pretty,expand "$_G_cmd"
eval "func_notquiet $func_quote_for_expand_result" eval "func_notquiet $func_quote_arg_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 1201 skipping to change at line 1320
# 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_for_expand "$_G_cmd" func_quote_arg expand,pretty "$_G_cmd"
eval "func_echo $func_quote_for_expand_result" eval "func_echo $func_quote_arg_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 1323 skipping to change at line 1442
# 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
# Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software. There is NO warranty; not even for
# This is free software; see the source for copying conditions. There is NO # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
# Copyright (C) 2010-2018 Bootstrap Authors
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # This file is dual licensed under the terms of the MIT license
# the Free Software Foundation, either version 3 of the License, or # <https://opensource.org/license/MIT>, and GPL version 3 or later
# (at your option) any later version. # <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
# This program is distributed in the hope that it will be useful, # the files within it. See the URLs above, or the file `LICENSE`
# but WITHOUT ANY WARRANTY; without even the implied warranty of # included in the Bootstrap distribution for the full license texts.
# 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 # Please report bugs or propose patches to:
# along with this program. If not, see <http://www.gnu.org/licenses/>. # <https://github.com/gnulib-modules/bootstrap/issues>
# Please report bugs or propose patches to gary@gnu.org. # Set a version string for this script.
scriptversion=2018-07-24.06; # UTC
## ------ ## ## ------ ##
## 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 1368 skipping to change at line 1483
# #!/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 '# warranty; '. # starting with '# Written by ' and ending with '# Copyright'.
# #
# 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 processing for additional # After sourcing this file, you can plug in 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 1427 skipping to change at line 1542
'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
# to the main code. A hook is just a named list of of function, that can # in the main code. A hook is just a list of function names that can be
# be run in order later on. # 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 1459 skipping to change at line 1574
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 functions called by FUNC_NAME. # Remove HOOK_FUNC from the list of hook functions to be called by
# 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 is assumed that the list of hook functions contains nothing more # It's 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
case " $hookable_fns " in case " $hookable_fns " in
*" $1 "*) ;; *" $1 "*) ;;
*) func_fatal_error "'$1' does not support hook funcions.n" ;; *) func_fatal_error "'$1' does not support hook functions." ;;
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
eval $_G_hook '"$@"' func_unset "${_G_hook}_result"
eval $_G_hook '${1+"$@"}'
# store returned options list back into positional func_propagate_result $_G_hook func_run_hooks
# parameters for next 'cmd' execution. if $func_propagate_result_result; then
eval _G_hook_result=\$${_G_hook}_result eval set dummy "$func_run_hooks_result"; shift
eval set dummy "$_G_hook_result"; shift fi
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 in your hook function, remove any # full positional parameter list from your hook function. You may remove
# options that you action, and then pass back the remaining unprocessed # or edit any options that you action, and then pass back the remaining
# options in '<hooked_function_name>_result', escaped suitably for # unprocessed options in '<hooked_function_name>_result', escaped
# 'eval'. Like this: # suitably for 'eval'.
#
# 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
# func_quote_for_eval ${1+"$@"} # # my_options_prep_result variable intact.
# 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
# #
# # Note that for efficiency, we parse as many options as we can # args_changed=false
#
# # 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=:
# ;; # ;;
# *) set dummy "$_G_opt" "$*"; shift; break ;; # *) # Make sure the first unrecognised option "$_G_opt"
# # 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
# #
# func_quote_for_eval ${1+"$@"} # # Only call 'func_quote' here if we processed at least one argument.
# 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 alse need to manually amend $usage_message to reflect the extra # You'll also 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
func_options_prep ${1+"$@"} _G_options_quoted=false
eval func_parse_options \
${func_options_prep_result+"$func_options_prep_result"}
eval func_validate_options \
${func_parse_options_result+"$func_parse_options_result"}
eval func_run_hooks func_options \ for my_func in options_prep parse_options validate_options options_finish
${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
# save modified positional parameters for caller $_G_options_quoted || {
func_options_result=$func_run_hooks_result # As we (func_options) are top-level options-parser function and
# 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 propogate that back to rest of this script, then the complete # needs to propagate that back to rest of this script, then the complete
# modified list must be put in 'func_run_hooks_result' before # modified list must be put in 'func_run_hooks_result' before returning.
# 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
func_parse_options_result= _G_parse_options_requote=false
# 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
# Adjust func_parse_options positional parameters to match if $func_propagate_result_result; then
eval set dummy "$func_run_hooks_result"; shift eval set dummy "$func_parse_options_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" func_echo "enabling shell trace mode" >&2
$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)
test $# = 0 && func_missing_arg $_G_opt && break if test $# = 0 && func_missing_arg $_G_opt; then
_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 1700 skipping to change at line 1873
;; ;;
# 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
;; ;;
--) break ;; --) _G_parse_options_requote=: ; break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; *) set dummy "$_G_opt" ${1+"$@"}; shift
_G_match_parse_options=false
break
;;
esac esac
if $_G_match_parse_options; then
_G_parse_options_requote=:
fi
done done
# save modified positional parameters for caller if $_G_parse_options_requote; then
func_quote_for_eval ${1+"$@"} # save modified positional parameters for caller
func_parse_options_result=$func_quote_for_eval_result func_quote eval ${1+"$@"}
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 1779 skipping to change at line 1959
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 after # Set func_split_equals_lhs and func_split_equals_rhs shell variables
# splitting STRING at the '=' sign. # after 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#*=}
test "x$func_split_equals_lhs" = "x$1" \ if test "x$func_split_equals_lhs" = "x$1"; then
&& 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" \
skipping to change at line 1870 skipping to change at line 2051
} }
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 '
/(C)/!b go /^# Written by /!b
:more s|^# ||; p; n
/\./!{
N :fwd2blnk
s|\n# | | /./ {
b more n
} b fwd2blnk
:go
/^# Written by /,/# warranty; / {
s|^# ||
s|^# *$||
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
p
} }
/^# Written by / { p; n
s|^# ||
p :holdwrnt
s|^# ||
s|^# *$||
/^Copyright /!{
/./H
n
b holdwrnt
} }
/^warranty; /q' < "$progpath"
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
G
s|\(\n\)\n*|\1|g
p; 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: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-pattern: "30/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.6' scriptversion='(GNU libtool) 2.4.6.42-b88ce'
# 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 1996 skipping to change at line 2190
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 (GNU libtool) 2.4.6 version: $progname (GNU libtool) 2.4.6.42-b88ce
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/software/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
# --------------------- # ---------------------
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
# object suffix. # object suffix.
lo2o=s/\\.lo\$/.$objext/ lo2o=s/\\.lo\$/.$objext/
skipping to change at line 2050 skipping to change at line 2244
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 2191 skipping to change at line 2385
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=:
# 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 2214 skipping to change at line 2410
;; ;;
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
# Pass back the list of options. if $_G_rc_lt_options_prep; then
func_quote_for_eval ${1+"$@"} # Pass back the list of options.
libtool_options_prep_result=$func_quote_for_eval_result func_quote eval ${1+"$@"}
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 2306 skipping to change at line 2510
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; break ;; *) set dummy "$_G_opt" ${1+"$@"} ; shift
_G_match_lt_parse_options=false
break
;;
esac esac
$_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done done
# save modified positional parameters for caller if $_G_rc_lt_parse_options; then
func_quote_for_eval ${1+"$@"} # save modified positional parameters for caller
libtool_parse_options_result=$func_quote_for_eval_result func_quote eval ${1+"$@"}
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 2368 skipping to change at line 2578
$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_for_eval ${1+"$@"} func_quote eval ${1+"$@"}
libtool_validate_options_result=$func_quote_for_eval_result libtool_validate_options_result=$func_quote_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 3299 skipping to change at line 3509
continue continue
;; ;;
-prefer-non-pic) -prefer-non-pic)
pic_mode=no pic_mode=no
continue continue
;; ;;
esac esac
done done
func_quote_for_eval "$libobj" func_quote_arg pretty "$libobj"
test "X$libobj" != "X$func_quote_for_eval_result" \ test "X$libobj" != "X$func_quote_arg_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special chara cters." && func_warning "libobj name '$libobj' may not contain shell special chara cters."
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 3373 skipping to change at line 3583
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_for_eval "$srcfile" func_quote_arg pretty "$srcfile"
qsrcfile=$func_quote_for_eval_result qsrcfile=$func_quote_arg_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 3974 skipping to change at line 4184
{ {
$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_for_eval "$nonopt" func_quote_arg pretty "$nonopt"
install_prog="$func_quote_for_eval_result " install_prog="$func_quote_arg_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 program. # The real first argument should be the name of the installation program.
# Aesthetically quote it. # Aesthetically quote it.
func_quote_for_eval "$arg" func_quote_arg pretty "$arg"
func_append install_prog "$func_quote_for_eval_result" func_append install_prog "$func_quote_arg_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 4043 skipping to change at line 4253
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_for_eval "$arg" func_quote_arg pretty "$arg"
func_append install_prog " $func_quote_for_eval_result" func_append install_prog " $func_quote_arg_result"
if test -n "$arg2"; then if test -n "$arg2"; then
func_quote_for_eval "$arg2" func_quote_arg pretty "$arg2"
fi fi
func_append install_shared_prog " $func_quote_for_eval_result" func_append install_shared_prog " $func_quote_arg_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_for_eval "$install_override_mode" func_quote_arg pretty "$install_override_mode"
func_append install_shared_prog " -m $func_quote_for_eval_result" func_append install_shared_prog " -m $func_quote_arg_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 4356 skipping to change at line 4566
$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@%'"$out putname"'%g'` relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$out putname"'%g'`
$opt_quiet || { $opt_quiet || {
func_quote_for_expand "$relink_command" func_quote_arg expand,pretty "$relink_command"
eval "func_echo $func_quote_for_expand_result" eval "func_echo $func_quote_arg_result"
} }
if eval "$relink_command"; then : if eval "$relink_command"; then :
else else
func_error "error: relink '$file' with the above command before installing it" func_error "error: relink '$file' with the above command before 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 5132 skipping to change at line 5342
# 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\""
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` func_quote_arg pretty "$ECHO"
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 6483 skipping to change at line 6694
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_for_eval "$arg" func_quote_arg pretty,unquoted "$arg"
qarg=$func_quote_for_eval_unquoted_result qarg=$func_quote_arg_unquoted_result
func_append libtool_args " $func_quote_for_eval_result" func_append libtool_args " $func_quote_arg_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 7083 skipping to change at line 7294
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_for_eval "$flag" func_quote_arg pretty "$flag"
func_append arg " $func_quote_for_eval_result" func_append arg " $func_quote_arg_result"
func_append compiler_flags " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_arg_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_for_eval "$flag" func_quote_arg pretty "$flag"
func_append arg " $wl$func_quote_for_eval_result" func_append arg " $wl$func_quote_arg_result"
func_append compiler_flags " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_arg_result"
func_append linker_flags " $func_quote_for_eval_result" func_append linker_flags " $func_quote_arg_result"
done done
IFS=$save_ifs IFS=$save_ifs
func_stripname ' ' '' "$arg" func_stripname ' ' '' "$arg"
arg=$func_stripname_result arg=$func_stripname_result
;; ;;
-Xcompiler) -Xcompiler)
prev=xcompiler prev=xcompiler
continue continue
;; ;;
skipping to change at line 7126 skipping to change at line 7337
continue continue
;; ;;
-XCClinker) -XCClinker)
prev=xcclinker prev=xcclinker
continue continue
;; ;;
# -msg_* for osf cc # -msg_* for osf cc
-msg_*) -msg_*)
func_quote_for_eval "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_arg_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 optimizati on # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimizati on
# -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
# -fuse-ld=* Linker select flags for GCC
-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=*|--sysroot=*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-specs=*) -specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_arg_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_for_eval "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_arg_result
fi fi
;; ;;
# Some other compiler flag. # Some other compiler flag.
-* | +*) -* | +*)
func_quote_for_eval "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_arg_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 7300 skipping to change at line 7513
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 need # Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later. # to be aesthetically quoted because they are evaled later.
func_quote_for_eval "$arg" func_quote_arg pretty "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_arg_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 9804 skipping to change at line 10017
} }
test -n "$save_libobjs" && test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $output" func_verbose "creating a temporary reloadable object file: $output"
# 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_for_expand "$cmd" func_quote_arg expand,pretty "$cmd"
eval "func_echo $func_quote_for_expand_result" eval "func_echo $func_quote_arg_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 9898 skipping to change at line 10111
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_for_expand "$cmd" func_quote_arg expand,pretty "$cmd"
eval "func_echo $func_quote_for_expand_result" eval "func_echo $func_quote_arg_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 10371 skipping to change at line 10584
# 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 || { $va r=; export $var; }; }; $relink_command" relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $va r=; 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_for_eval "$var_value" func_quote_arg pretty "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relin relink_command="$var=$func_quote_arg_result; export $var; $relink_com
k_command" mand"
fi fi
done done
relink_command="(cd `pwd`; $relink_command)" func_quote eval cd "`pwd`"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
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 10616 skipping to change at line 10830
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_for_eval "$var_value" func_quote_arg pretty,unquoted "$var_value"
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_ relink_command="$var=$func_quote_arg_unquoted_result; export $var; $rel
command" ink_command"
fi fi
done done
# Quote the link command for shipping. # Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=reli func_quote eval cd "`pwd`"
nk $libtool_args @inst_prefix_dir@)" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args -
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` -mode=relink $libtool_args @inst_prefix_dir@)"
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. 111 change blocks. 
274 lines changed or deleted 491 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)