| 1 |
1 |
#! /bin/sh |
| 2 |
2 |
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in |
| 3 |
|
## by inline-source v2014-01-03.01 |
|
3 |
## by inline-source v2016-02-21.11 |
| 4 |
4 |
|
| 5 |
|
# libtool (GNU libtool) 2.4.6 |
|
5 |
# libtool (GNU libtool) 2.4.6.40-6ca5 |
| 6 |
6 |
# Provide generalized library-building support services. |
| 7 |
7 |
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
| 8 |
8 |
|
| 9 |
|
# Copyright (C) 1996-2015 Free Software Foundation, Inc. |
|
9 |
# Copyright (C) 1996-2017 Free Software Foundation, Inc. |
| 10 |
10 |
# This is free software; see the source for copying conditions. There is NO |
| 11 |
11 |
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 |
12 |
|
| … |
| 31 |
31 |
|
| 32 |
32 |
PROGRAM=libtool |
| 33 |
33 |
PACKAGE=libtool |
| 34 |
|
VERSION=2.4.6 |
| 35 |
|
package_revision=2.4.6 |
|
34 |
VERSION=2.4.6.40-6ca5 |
|
35 |
package_revision=2.4.6.40 |
| 36 |
36 |
|
| 37 |
37 |
|
| 38 |
38 |
## ------ ## |
| … |
| 64 |
64 |
# libraries, which are installed to $pkgauxdir. |
| 65 |
65 |
|
| 66 |
66 |
# Set a version string for this script. |
| 67 |
|
scriptversion=2015-01-20.17; # UTC |
|
67 |
scriptversion=2017-04-19.12; # UTC |
| 68 |
68 |
|
| 69 |
69 |
# General shell script boiler plate, and helper functions. |
| 70 |
70 |
# Written by Gary V. Vaughan, 2004 |
| 71 |
71 |
|
| 72 |
|
# Copyright (C) 2004-2015 Free Software Foundation, Inc. |
| 73 |
|
# This is free software; see the source for copying conditions. There is NO |
| 74 |
|
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 75 |
|
|
| 76 |
|
# This program is free software; you can redistribute it and/or modify |
| 77 |
|
# it under the terms of the GNU General Public License as published by |
| 78 |
|
# the Free Software Foundation; either version 3 of the License, or |
| 79 |
|
# (at your option) any later version. |
| 80 |
|
|
| 81 |
|
# As a special exception to the GNU General Public License, if you distribute |
| 82 |
|
# this file as part of a program or library that is built using GNU Libtool, |
| 83 |
|
# you may include this file under the same distribution terms that you use |
| 84 |
|
# for the rest of that program. |
| 85 |
|
|
| 86 |
|
# This program is distributed in the hope that it will be useful, |
| 87 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 88 |
|
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU |
| 89 |
|
# General Public License for more details. |
| 90 |
|
|
| 91 |
|
# You should have received a copy of the GNU General Public License |
| 92 |
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
72 |
# This is free software. There is NO warranty; not even for |
|
73 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
74 |
# |
|
75 |
# Copyright (C) 2004-2017 Bootstrap Authors |
|
76 |
# |
|
77 |
# This file is dual licensed under the terms of the MIT license |
|
78 |
# <https://opensource.org/license/MIT>, and GPL version 3 or later |
|
79 |
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of |
|
80 |
# these licenses when using or redistributing this software or any of |
|
81 |
# the files within it. See the URLs above, or the file `LICENSE` |
|
82 |
# included in the Bootstrap distribution for the full license texts. |
| 93 |
83 |
|
| 94 |
|
# Please report bugs or propose patches to gary@gnu.org. |
|
84 |
# Please report bugs or propose patches to: |
|
85 |
# <https://github.com/gnulib-modules/bootstrap/issues> |
| 95 |
86 |
|
| 96 |
87 |
|
| 97 |
88 |
## ------ ## |
| … |
| 140 |
131 |
fi" |
| 141 |
132 |
done |
| 142 |
133 |
|
| 143 |
|
# CDPATH. |
| 144 |
|
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
| 145 |
|
|
| 146 |
134 |
# Make sure IFS has a sensible default |
| 147 |
135 |
sp=' ' |
| 148 |
136 |
nl=' |
| … |
| 159 |
147 |
fi |
| 160 |
148 |
|
| 161 |
149 |
|
|
150 |
# func_unset VAR |
|
151 |
# -------------- |
|
152 |
# Portably unset VAR. |
|
153 |
# In some shells, an 'unset VAR' statement leaves a non-zero return |
|
154 |
# status if VAR is already unset, which might be problematic if the |
|
155 |
# statement is used at the end of a function (thus poisoning its return |
|
156 |
# value) or when 'set -e' is active (causing even a spurious abort of |
|
157 |
# the script in this case). |
|
158 |
func_unset () |
|
159 |
{ |
|
160 |
{ eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } |
|
161 |
} |
|
162 |
|
|
163 |
|
|
164 |
# Make sure CDPATH doesn't cause `cd` commands to output the target dir. |
|
165 |
func_unset CDPATH |
|
166 |
|
|
167 |
# Make sure ${,E,F}GREP behave sanely. |
|
168 |
func_unset GREP_OPTIONS |
|
169 |
|
| 162 |
170 |
|
| 163 |
171 |
## ------------------------- ## |
| 164 |
172 |
## Locate command utilities. ## |
| … |
| 259 |
267 |
rm -f conftest.in conftest.tmp conftest.nl conftest.out |
| 260 |
268 |
} |
| 261 |
269 |
|
| 262 |
|
func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin |
|
270 |
func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" |
| 263 |
271 |
rm -f conftest.sed |
| 264 |
272 |
SED=$func_path_progs_result |
| 265 |
273 |
} |
| … |
| 295 |
303 |
rm -f conftest.in conftest.tmp conftest.nl conftest.out |
| 296 |
304 |
} |
| 297 |
305 |
|
| 298 |
|
func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin |
|
306 |
func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" |
| 299 |
307 |
GREP=$func_path_progs_result |
| 300 |
308 |
} |
| 301 |
309 |
|
| … |
| 580 |
588 |
{ |
| 581 |
589 |
$debug_cmd |
| 582 |
590 |
|
| 583 |
|
func_quote_for_eval "$2" |
| 584 |
|
eval "$1+=\\ \$func_quote_for_eval_result" |
|
591 |
func_quote_arg pretty "$2" |
|
592 |
eval "$1+=\\ \$func_quote_arg_result" |
| 585 |
593 |
}' |
| 586 |
594 |
else |
| 587 |
595 |
func_append_quoted () |
| 588 |
596 |
{ |
| 589 |
597 |
$debug_cmd |
| 590 |
598 |
|
| 591 |
|
func_quote_for_eval "$2" |
| 592 |
|
eval "$1=\$$1\\ \$func_quote_for_eval_result" |
|
599 |
func_quote_arg pretty "$2" |
|
600 |
eval "$1=\$$1\\ \$func_quote_arg_result" |
| 593 |
601 |
} |
| 594 |
602 |
fi |
| 595 |
603 |
|
| … |
| 1091 |
1099 |
} |
| 1092 |
1100 |
|
| 1093 |
1101 |
|
| 1094 |
|
# func_quote_for_eval ARG... |
| 1095 |
|
# -------------------------- |
| 1096 |
|
# Aesthetically quote ARGs to be evaled later. |
| 1097 |
|
# This function returns two values: |
| 1098 |
|
# i) func_quote_for_eval_result |
| 1099 |
|
# double-quoted, suitable for a subsequent eval |
| 1100 |
|
# ii) func_quote_for_eval_unquoted_result |
| 1101 |
|
# has all characters that are still active within double |
| 1102 |
|
# quotes backslashified. |
| 1103 |
|
func_quote_for_eval () |
|
1102 |
# func_quote_portable EVAL ARG |
|
1103 |
# ---------------------------- |
|
1104 |
# Internal function to portably implement func_quote_arg. Note that we still |
|
1105 |
# keep attention to performance here so we as much as possible try to avoid |
|
1106 |
# calling sed binary (so far O(N) complexity as long as func_append is O(1)). |
|
1107 |
func_quote_portable () |
| 1104 |
1108 |
{ |
| 1105 |
1109 |
$debug_cmd |
| 1106 |
1110 |
|
| 1107 |
|
func_quote_for_eval_unquoted_result= |
| 1108 |
|
func_quote_for_eval_result= |
| 1109 |
|
while test 0 -lt $#; do |
| 1110 |
|
case $1 in |
| 1111 |
|
*[\\\`\"\$]*) |
| 1112 |
|
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; |
| 1113 |
|
*) |
| 1114 |
|
_G_unquoted_arg=$1 ;; |
| 1115 |
|
esac |
| 1116 |
|
if test -n "$func_quote_for_eval_unquoted_result"; then |
| 1117 |
|
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" |
| 1118 |
|
else |
| 1119 |
|
func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" |
|
1111 |
func_quote_portable_result=$2 |
|
1112 |
|
|
1113 |
# one-time-loop (easy break) |
|
1114 |
while true |
|
1115 |
do |
|
1116 |
if $1; then |
|
1117 |
func_quote_portable_result=`$ECHO "$2" | $SED \ |
|
1118 |
-e "$sed_double_quote_subst" -e "$sed_double_backslash"` |
|
1119 |
break |
| 1120 |
1120 |
fi |
| 1121 |
1121 |
|
| 1122 |
|
case $_G_unquoted_arg in |
| 1123 |
|
# Double-quote args containing shell metacharacters to delay |
| 1124 |
|
# word splitting, command substitution and variable expansion |
| 1125 |
|
# for a subsequent eval. |
| 1126 |
|
# Many Bourne shells cannot handle close brackets correctly |
| 1127 |
|
# in scan sets, so we specify it separately. |
| 1128 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 1129 |
|
_G_quoted_arg=\"$_G_unquoted_arg\" |
|
1122 |
# Quote for eval. |
|
1123 |
case $func_quote_portable_result in |
|
1124 |
*[\\\`\"\$]*) |
|
1125 |
case $func_quote_portable_result in |
|
1126 |
*[\[\*\?]*) |
|
1127 |
func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ |
|
1128 |
| $SED "$sed_quote_subst"` |
|
1129 |
break |
|
1130 |
;; |
|
1131 |
esac |
|
1132 |
|
|
1133 |
func_quote_portable_old_IFS=$IFS |
|
1134 |
for _G_char in '\' '`' '"' '$' |
|
1135 |
do |
|
1136 |
# STATE($1) PREV($2) SEPARATOR($3) |
|
1137 |
set start "" "" |
|
1138 |
func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy |
|
1139 |
IFS=$_G_char |
|
1140 |
for _G_part in $func_quote_portable_result |
|
1141 |
do |
|
1142 |
case $1 in |
|
1143 |
quote) |
|
1144 |
func_append func_quote_portable_result "$3$2" |
|
1145 |
set quote "$_G_part" "\\$_G_char" |
|
1146 |
;; |
|
1147 |
start) |
|
1148 |
set first "" "" |
|
1149 |
func_quote_portable_result= |
|
1150 |
;; |
|
1151 |
first) |
|
1152 |
set quote "$_G_part" "" |
|
1153 |
;; |
|
1154 |
esac |
|
1155 |
done |
|
1156 |
done |
|
1157 |
IFS=$func_quote_portable_old_IFS |
| 1130 |
1158 |
;; |
| 1131 |
|
*) |
| 1132 |
|
_G_quoted_arg=$_G_unquoted_arg |
| 1133 |
|
;; |
|
1159 |
*) ;; |
| 1134 |
1160 |
esac |
| 1135 |
|
|
| 1136 |
|
if test -n "$func_quote_for_eval_result"; then |
| 1137 |
|
func_append func_quote_for_eval_result " $_G_quoted_arg" |
| 1138 |
|
else |
| 1139 |
|
func_append func_quote_for_eval_result "$_G_quoted_arg" |
| 1140 |
|
fi |
| 1141 |
|
shift |
|
1161 |
break |
| 1142 |
1162 |
done |
|
1163 |
|
|
1164 |
func_quote_portable_unquoted_result=$func_quote_portable_result |
|
1165 |
case $func_quote_portable_result in |
|
1166 |
# double-quote args containing shell metacharacters to delay |
|
1167 |
# word splitting, command substitution and variable expansion |
|
1168 |
# for a subsequent eval. |
|
1169 |
# many bourne shells cannot handle close brackets correctly |
|
1170 |
# in scan sets, so we specify it separately. |
|
1171 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
|
1172 |
func_quote_portable_result=\"$func_quote_portable_result\" |
|
1173 |
;; |
|
1174 |
esac |
| 1143 |
1175 |
} |
| 1144 |
1176 |
|
| 1145 |
1177 |
|
| 1146 |
|
# func_quote_for_expand ARG |
| 1147 |
|
# ------------------------- |
| 1148 |
|
# Aesthetically quote ARG to be evaled later; same as above, |
| 1149 |
|
# but do not quote variable references. |
| 1150 |
|
func_quote_for_expand () |
| 1151 |
|
{ |
| 1152 |
|
$debug_cmd |
|
1178 |
# func_quotefast_eval ARG |
|
1179 |
# ----------------------- |
|
1180 |
# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', |
|
1181 |
# but optimized for speed. Result is stored in $func_quotefast_eval. |
|
1182 |
if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then |
|
1183 |
printf -v _GL_test_printf_tilde %q '~' |
|
1184 |
if test '\~' = "$_GL_test_printf_tilde"; then |
|
1185 |
func_quotefast_eval () |
|
1186 |
{ |
|
1187 |
printf -v func_quotefast_eval_result %q "$1" |
|
1188 |
} |
|
1189 |
else |
|
1190 |
# Broken older Bash implementations. Make those faster too if possible. |
|
1191 |
func_quotefast_eval () |
|
1192 |
{ |
|
1193 |
case $1 in |
|
1194 |
'~'*) |
|
1195 |
func_quote_portable false "$1" |
|
1196 |
func_quotefast_eval_result=$func_quote_portable_result |
|
1197 |
;; |
|
1198 |
*) |
|
1199 |
printf -v func_quotefast_eval_result %q "$1" |
|
1200 |
;; |
|
1201 |
esac |
|
1202 |
} |
|
1203 |
fi |
|
1204 |
else |
|
1205 |
func_quotefast_eval () |
|
1206 |
{ |
|
1207 |
func_quote_portable false "$1" |
|
1208 |
func_quotefast_eval_result=$func_quote_portable_result |
|
1209 |
} |
|
1210 |
fi |
| 1153 |
1211 |
|
| 1154 |
|
case $1 in |
| 1155 |
|
*[\\\`\"]*) |
| 1156 |
|
_G_arg=`$ECHO "$1" | $SED \ |
| 1157 |
|
-e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; |
| 1158 |
|
*) |
| 1159 |
|
_G_arg=$1 ;; |
|
1212 |
|
|
1213 |
# func_quote_arg MODEs ARG |
|
1214 |
# ------------------------ |
|
1215 |
# Quote one ARG to be evaled later. MODEs argument may contain zero or more |
|
1216 |
# specifiers listed below separated by ',' character. This function returns two |
|
1217 |
# values: |
|
1218 |
# i) func_quote_arg_result |
|
1219 |
# double-quoted (when needed), suitable for a subsequent eval |
|
1220 |
# ii) func_quote_arg_unquoted_result |
|
1221 |
# has all characters that are still active within double |
|
1222 |
# quotes backslashified. Available only if 'unquoted' is specified. |
|
1223 |
# |
|
1224 |
# Available modes: |
|
1225 |
# ---------------- |
|
1226 |
# 'eval' (default) |
|
1227 |
# - escape shell special characters |
|
1228 |
# 'expand' |
|
1229 |
# - the same as 'eval'; but do not quote variable references |
|
1230 |
# 'pretty' |
|
1231 |
# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might |
|
1232 |
# be used later in func_quote to get output like: 'echo "a b"' instead |
|
1233 |
# of 'echo a\ b'. This is slower than default on some shells. |
|
1234 |
# 'unquoted' |
|
1235 |
# - produce also $func_quote_arg_unquoted_result which does not contain |
|
1236 |
# wrapping double-quotes. |
|
1237 |
# |
|
1238 |
# Examples for 'func_quote_arg pretty,unquoted string': |
|
1239 |
# |
|
1240 |
# string | *_result | *_unquoted_result |
|
1241 |
# ------------+-----------------------+------------------- |
|
1242 |
# " | \" | \" |
|
1243 |
# a b | "a b" | a b |
|
1244 |
# "a b" | "\"a b\"" | \"a b\" |
|
1245 |
# * | "*" | * |
|
1246 |
# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" |
|
1247 |
# |
|
1248 |
# Examples for 'func_quote_arg pretty,unquoted,expand string': |
|
1249 |
# |
|
1250 |
# string | *_result | *_unquoted_result |
|
1251 |
# --------------+---------------------+-------------------- |
|
1252 |
# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" |
|
1253 |
func_quote_arg () |
|
1254 |
{ |
|
1255 |
_G_quote_expand=false |
|
1256 |
case ,$1, in |
|
1257 |
*,expand,*) |
|
1258 |
_G_quote_expand=: |
|
1259 |
;; |
| 1160 |
1260 |
esac |
| 1161 |
1261 |
|
| 1162 |
|
case $_G_arg in |
| 1163 |
|
# Double-quote args containing shell metacharacters to delay |
| 1164 |
|
# word splitting and command substitution for a subsequent eval. |
| 1165 |
|
# Many Bourne shells cannot handle close brackets correctly |
| 1166 |
|
# in scan sets, so we specify it separately. |
| 1167 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 1168 |
|
_G_arg=\"$_G_arg\" |
|
1262 |
case ,$1, in |
|
1263 |
*,pretty,*|*,expand,*|*,unquoted,*) |
|
1264 |
func_quote_portable $_G_quote_expand "$2" |
|
1265 |
func_quote_arg_result=$func_quote_portable_result |
|
1266 |
func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result |
|
1267 |
;; |
|
1268 |
*) |
|
1269 |
# Faster quote-for-eval for some shells. |
|
1270 |
func_quotefast_eval "$2" |
|
1271 |
func_quote_arg_result=$func_quotefast_eval_result |
| 1169 |
1272 |
;; |
| 1170 |
1273 |
esac |
|
1274 |
} |
|
1275 |
|
| 1171 |
1276 |
|
| 1172 |
|
func_quote_for_expand_result=$_G_arg |
|
1277 |
# func_quote MODEs ARGs... |
|
1278 |
# ------------------------ |
|
1279 |
# Quote all ARGs to be evaled later and join them into single command. See |
|
1280 |
# func_quote_arg's description for more info. |
|
1281 |
func_quote () |
|
1282 |
{ |
|
1283 |
$debug_cmd |
|
1284 |
_G_func_quote_mode=$1 ; shift |
|
1285 |
func_quote_result= |
|
1286 |
while test 0 -lt $#; do |
|
1287 |
func_quote_arg "$_G_func_quote_mode" "$1" |
|
1288 |
if test -n "$func_quote_result"; then |
|
1289 |
func_append func_quote_result " $func_quote_arg_result" |
|
1290 |
else |
|
1291 |
func_append func_quote_result "$func_quote_arg_result" |
|
1292 |
fi |
|
1293 |
shift |
|
1294 |
done |
| 1173 |
1295 |
} |
| 1174 |
1296 |
|
| 1175 |
1297 |
|
| … |
| 1215 |
1337 |
_G_cmd=$1 |
| 1216 |
1338 |
_G_fail_exp=${2-':'} |
| 1217 |
1339 |
|
| 1218 |
|
func_quote_for_expand "$_G_cmd" |
| 1219 |
|
eval "func_notquiet $func_quote_for_expand_result" |
|
1340 |
func_quote_arg pretty,expand "$_G_cmd" |
|
1341 |
eval "func_notquiet $func_quote_arg_result" |
| 1220 |
1342 |
|
| 1221 |
1343 |
$opt_dry_run || { |
| 1222 |
1344 |
eval "$_G_cmd" |
| … |
| 1241 |
1363 |
_G_fail_exp=${2-':'} |
| 1242 |
1364 |
|
| 1243 |
1365 |
$opt_quiet || { |
| 1244 |
|
func_quote_for_expand "$_G_cmd" |
| 1245 |
|
eval "func_echo $func_quote_for_expand_result" |
|
1366 |
func_quote_arg expand,pretty "$_G_cmd" |
|
1367 |
eval "func_echo $func_quote_arg_result" |
| 1246 |
1368 |
} |
| 1247 |
1369 |
|
| 1248 |
1370 |
$opt_dry_run || { |
| … |
| 1369 |
1491 |
# End: |
| 1370 |
1492 |
#! /bin/sh |
| 1371 |
1493 |
|
| 1372 |
|
# Set a version string for this script. |
| 1373 |
|
scriptversion=2014-01-07.03; # UTC |
| 1374 |
|
|
| 1375 |
1494 |
# A portable, pluggable option parser for Bourne shell. |
| 1376 |
1495 |
# Written by Gary V. Vaughan, 2010 |
| 1377 |
1496 |
|
| 1378 |
|
# Copyright (C) 2010-2015 Free Software Foundation, Inc. |
| 1379 |
|
# This is free software; see the source for copying conditions. There is NO |
| 1380 |
|
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 1381 |
|
|
| 1382 |
|
# This program is free software: you can redistribute it and/or modify |
| 1383 |
|
# it under the terms of the GNU General Public License as published by |
| 1384 |
|
# the Free Software Foundation, either version 3 of the License, or |
| 1385 |
|
# (at your option) any later version. |
| 1386 |
|
|
| 1387 |
|
# This program is distributed in the hope that it will be useful, |
| 1388 |
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1389 |
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 1390 |
|
# GNU General Public License for more details. |
|
1497 |
# This is free software. There is NO warranty; not even for |
|
1498 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
1499 |
# |
|
1500 |
# Copyright (C) 2010-2017 Bootstrap Authors |
|
1501 |
# |
|
1502 |
# This file is dual licensed under the terms of the MIT license |
|
1503 |
# <https://opensource.org/license/MIT>, and GPL version 3 or later |
|
1504 |
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of |
|
1505 |
# these licenses when using or redistributing this software or any of |
|
1506 |
# the files within it. See the URLs above, or the file `LICENSE` |
|
1507 |
# included in the Bootstrap distribution for the full license texts. |
| 1391 |
1508 |
|
| 1392 |
|
# You should have received a copy of the GNU General Public License |
| 1393 |
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
1509 |
# Please report bugs or propose patches to: |
|
1510 |
# <https://github.com/gnulib-modules/bootstrap/issues> |
| 1394 |
1511 |
|
| 1395 |
|
# Please report bugs or propose patches to gary@gnu.org. |
|
1512 |
# Set a version string for this script. |
|
1513 |
scriptversion=2016-03-06.01; # UTC |
| 1396 |
1514 |
|
| 1397 |
1515 |
|
| 1398 |
1516 |
## ------ ## |
| … |
| 1415 |
1533 |
# |
| 1416 |
1534 |
# In order for the '--version' option to work, you will need to have a |
| 1417 |
1535 |
# suitably formatted comment like the one at the top of this file |
| 1418 |
|
# starting with '# Written by ' and ending with '# warranty; '. |
|
1536 |
# starting with '# Written by ' and ending with '# Copyright'. |
| 1419 |
1537 |
# |
| 1420 |
1538 |
# For '-h' and '--help' to work, you will also need a one line |
| 1421 |
1539 |
# description of your script's purpose in a comment directly above the |
| … |
| 1427 |
1545 |
# to display verbose messages only when your user has specified |
| 1428 |
1546 |
# '--verbose'. |
| 1429 |
1547 |
# |
| 1430 |
|
# After sourcing this file, you can plug processing for additional |
|
1548 |
# After sourcing this file, you can plug in processing for additional |
| 1431 |
1549 |
# options by amending the variables from the 'Configuration' section |
| 1432 |
1550 |
# below, and following the instructions in the 'Option parsing' |
| 1433 |
1551 |
# section further down. |
| … |
| 1476 |
1594 |
## ------------------------- ## |
| 1477 |
1595 |
|
| 1478 |
1596 |
# This section contains functions for adding, removing, and running hooks |
| 1479 |
|
# to the main code. A hook is just a named list of of function, that can |
| 1480 |
|
# be run in order later on. |
|
1597 |
# in the main code. A hook is just a list of function names that can be |
|
1598 |
# run in order later on. |
| 1481 |
1599 |
|
| 1482 |
1600 |
# func_hookable FUNC_NAME |
| 1483 |
1601 |
# ----------------------- |
| … |
| 1510 |
1628 |
|
| 1511 |
1629 |
# func_remove_hook FUNC_NAME HOOK_FUNC |
| 1512 |
1630 |
# ------------------------------------ |
| 1513 |
|
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. |
|
1631 |
# Remove HOOK_FUNC from the list of hook functions to be called by |
|
1632 |
# FUNC_NAME. |
| 1514 |
1633 |
func_remove_hook () |
| 1515 |
1634 |
{ |
| 1516 |
1635 |
$debug_cmd |
| … |
| 1519 |
1638 |
} |
| 1520 |
1639 |
|
| 1521 |
1640 |
|
|
1641 |
# func_propagate_result FUNC_NAME_A FUNC_NAME_B |
|
1642 |
# --------------------------------------------- |
|
1643 |
# If the *_result variable of FUNC_NAME_A _is set_, assign its value to |
|
1644 |
# *_result variable of FUNC_NAME_B. |
|
1645 |
func_propagate_result () |
|
1646 |
{ |
|
1647 |
$debug_cmd |
|
1648 |
|
|
1649 |
func_propagate_result_result=: |
|
1650 |
if eval "test \"\${${1}_result+set}\" = set" |
|
1651 |
then |
|
1652 |
eval "${2}_result=\$${1}_result" |
|
1653 |
else |
|
1654 |
func_propagate_result_result=false |
|
1655 |
fi |
|
1656 |
} |
|
1657 |
|
|
1658 |
|
| 1522 |
1659 |
# func_run_hooks FUNC_NAME [ARG]... |
| 1523 |
1660 |
# --------------------------------- |
| 1524 |
1661 |
# Run all hook functions registered to FUNC_NAME. |
| 1525 |
|
# It is assumed that the list of hook functions contains nothing more |
|
1662 |
# It's assumed that the list of hook functions contains nothing more |
| 1526 |
1663 |
# than a whitespace-delimited list of legal shell function names, and |
| 1527 |
1664 |
# no effort is wasted trying to catch shell meta-characters or preserve |
| 1528 |
1665 |
# whitespace. |
| … |
| 1532 |
1669 |
|
| 1533 |
1670 |
case " $hookable_fns " in |
| 1534 |
1671 |
*" $1 "*) ;; |
| 1535 |
|
*) func_fatal_error "'$1' does not support hook funcions.n" ;; |
|
1672 |
*) func_fatal_error "'$1' does not support hook functions." ;; |
| 1536 |
1673 |
esac |
| 1537 |
1674 |
|
| 1538 |
1675 |
eval _G_hook_fns=\$$1_hooks; shift |
| 1539 |
1676 |
|
| 1540 |
1677 |
for _G_hook in $_G_hook_fns; do |
| 1541 |
|
eval $_G_hook '"$@"' |
| 1542 |
|
|
| 1543 |
|
# store returned options list back into positional |
| 1544 |
|
# parameters for next 'cmd' execution. |
| 1545 |
|
eval _G_hook_result=\$${_G_hook}_result |
| 1546 |
|
eval set dummy "$_G_hook_result"; shift |
|
1678 |
func_unset "${_G_hook}_result" |
|
1679 |
eval $_G_hook '${1+"$@"}' |
|
1680 |
func_propagate_result $_G_hook func_run_hooks |
|
1681 |
if $func_propagate_result_result; then |
|
1682 |
eval set dummy "$func_run_hooks_result"; shift |
|
1683 |
fi |
| 1547 |
1684 |
done |
| 1548 |
|
|
| 1549 |
|
func_quote_for_eval ${1+"$@"} |
| 1550 |
|
func_run_hooks_result=$func_quote_for_eval_result |
| 1551 |
1685 |
} |
| 1552 |
1686 |
|
| 1553 |
1687 |
|
| … |
| 1557 |
1691 |
## --------------- ## |
| 1558 |
1692 |
|
| 1559 |
1693 |
# In order to add your own option parsing hooks, you must accept the |
| 1560 |
|
# full positional parameter list in your hook function, remove any |
| 1561 |
|
# options that you action, and then pass back the remaining unprocessed |
| 1562 |
|
# options in '<hooked_function_name>_result', escaped suitably for |
| 1563 |
|
# 'eval'. Like this: |
|
1694 |
# full positional parameter list from your hook function. You may remove |
|
1695 |
# or edit any options that you action, and then pass back the remaining |
|
1696 |
# unprocessed options in '<hooked_function_name>_result', escaped |
|
1697 |
# suitably for 'eval'. |
|
1698 |
# |
|
1699 |
# The '<hooked_function_name>_result' variable is automatically unset |
|
1700 |
# before your hook gets called; for best performance, only set the |
|
1701 |
# *_result variable when necessary (i.e. don't call the 'func_quote' |
|
1702 |
# function unnecessarily because it can be an expensive operation on some |
|
1703 |
# machines). |
|
1704 |
# |
|
1705 |
# Like this: |
| 1564 |
1706 |
# |
| 1565 |
1707 |
# my_options_prep () |
| 1566 |
1708 |
# { |
| … |
| 1570 |
1712 |
# usage_message=$usage_message' |
| 1571 |
1713 |
# -s, --silent don'\''t print informational messages |
| 1572 |
1714 |
# ' |
| 1573 |
|
# |
| 1574 |
|
# func_quote_for_eval ${1+"$@"} |
| 1575 |
|
# my_options_prep_result=$func_quote_for_eval_result |
|
1715 |
# # No change in '$@' (ignored completely by this hook). Leave |
|
1716 |
# # my_options_prep_result variable intact. |
| 1576 |
1717 |
# } |
| 1577 |
1718 |
# func_add_hook func_options_prep my_options_prep |
| 1578 |
1719 |
# |
| … |
| 1581 |
1722 |
# { |
| 1582 |
1723 |
# $debug_cmd |
| 1583 |
1724 |
# |
| 1584 |
|
# # Note that for efficiency, we parse as many options as we can |
|
1725 |
# args_changed=false |
|
1726 |
# |
|
1727 |
# # Note that, for efficiency, we parse as many options as we can |
| 1585 |
1728 |
# # recognise in a loop before passing the remainder back to the |
| 1586 |
1729 |
# # caller on the first unrecognised argument we encounter. |
| 1587 |
1730 |
# while test $# -gt 0; do |
| 1588 |
1731 |
# opt=$1; shift |
| 1589 |
1732 |
# case $opt in |
| 1590 |
|
# --silent|-s) opt_silent=: ;; |
|
1733 |
# --silent|-s) opt_silent=: |
|
1734 |
# args_changed=: |
|
1735 |
# ;; |
| 1591 |
1736 |
# # Separate non-argument short options: |
| 1592 |
1737 |
# -s*) func_split_short_opt "$_G_opt" |
| 1593 |
1738 |
# set dummy "$func_split_short_opt_name" \ |
| 1594 |
1739 |
# "-$func_split_short_opt_arg" ${1+"$@"} |
| 1595 |
1740 |
# shift |
|
1741 |
# args_changed=: |
| 1596 |
1742 |
# ;; |
| 1597 |
|
# *) set dummy "$_G_opt" "$*"; shift; break ;; |
|
1743 |
# *) # Make sure the first unrecognised option "$_G_opt" |
|
1744 |
# # is added back to "$@" in case we need it later, |
|
1745 |
# # if $args_changed was set to 'true'. |
|
1746 |
# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; |
| 1598 |
1747 |
# esac |
| 1599 |
1748 |
# done |
| 1600 |
1749 |
# |
| 1601 |
|
# func_quote_for_eval ${1+"$@"} |
| 1602 |
|
# my_silent_option_result=$func_quote_for_eval_result |
|
1750 |
# # Only call 'func_quote' here if we processed at least one argument. |
|
1751 |
# if $args_changed; then |
|
1752 |
# func_quote eval ${1+"$@"} |
|
1753 |
# my_silent_option_result=$func_quote_result |
|
1754 |
# fi |
| 1603 |
1755 |
# } |
| 1604 |
1756 |
# func_add_hook func_parse_options my_silent_option |
| 1605 |
1757 |
# |
| … |
| 1610 |
1762 |
# |
| 1611 |
1763 |
# $opt_silent && $opt_verbose && func_fatal_help "\ |
| 1612 |
1764 |
# '--silent' and '--verbose' options are mutually exclusive." |
| 1613 |
|
# |
| 1614 |
|
# func_quote_for_eval ${1+"$@"} |
| 1615 |
|
# my_option_validation_result=$func_quote_for_eval_result |
| 1616 |
1765 |
# } |
| 1617 |
1766 |
# func_add_hook func_validate_options my_option_validation |
| 1618 |
1767 |
# |
| 1619 |
|
# You'll alse need to manually amend $usage_message to reflect the extra |
|
1768 |
# You'll also need to manually amend $usage_message to reflect the extra |
| 1620 |
1769 |
# options you parse. It's preferable to append if you can, so that |
| 1621 |
1770 |
# multiple option parsing hooks can be added safely. |
| 1622 |
1771 |
|
| 1623 |
1772 |
|
|
1773 |
# func_options_finish [ARG]... |
|
1774 |
# ---------------------------- |
|
1775 |
# Finishing the option parse loop (call 'func_options' hooks ATM). |
|
1776 |
func_options_finish () |
|
1777 |
{ |
|
1778 |
$debug_cmd |
|
1779 |
|
|
1780 |
func_run_hooks func_options ${1+"$@"} |
|
1781 |
func_propagate_result func_run_hooks func_options_finish |
|
1782 |
} |
|
1783 |
|
|
1784 |
|
| 1624 |
1785 |
# func_options [ARG]... |
| 1625 |
1786 |
# --------------------- |
| 1626 |
1787 |
# All the functions called inside func_options are hookable. See the |
| … |
| 1630 |
1791 |
{ |
| 1631 |
1792 |
$debug_cmd |
| 1632 |
1793 |
|
| 1633 |
|
func_options_prep ${1+"$@"} |
| 1634 |
|
eval func_parse_options \ |
| 1635 |
|
${func_options_prep_result+"$func_options_prep_result"} |
| 1636 |
|
eval func_validate_options \ |
| 1637 |
|
${func_parse_options_result+"$func_parse_options_result"} |
|
1794 |
_G_options_quoted=false |
| 1638 |
1795 |
|
| 1639 |
|
eval func_run_hooks func_options \ |
| 1640 |
|
${func_validate_options_result+"$func_validate_options_result"} |
|
1796 |
for my_func in options_prep parse_options validate_options options_finish |
|
1797 |
do |
|
1798 |
func_unset func_${my_func}_result |
|
1799 |
func_unset func_run_hooks_result |
|
1800 |
eval func_$my_func '${1+"$@"}' |
|
1801 |
func_propagate_result func_$my_func func_options |
|
1802 |
if $func_propagate_result_result; then |
|
1803 |
eval set dummy "$func_options_result"; shift |
|
1804 |
_G_options_quoted=: |
|
1805 |
fi |
|
1806 |
done |
| 1641 |
1807 |
|
| 1642 |
|
# save modified positional parameters for caller |
| 1643 |
|
func_options_result=$func_run_hooks_result |
|
1808 |
$_G_options_quoted || { |
|
1809 |
# As we (func_options) are top-level options-parser function and |
|
1810 |
# nobody quoted "$@" for us yet, we need to do it explicitly for |
|
1811 |
# caller. |
|
1812 |
func_quote eval ${1+"$@"} |
|
1813 |
func_options_result=$func_quote_result |
|
1814 |
} |
| 1644 |
1815 |
} |
| 1645 |
1816 |
|
| 1646 |
1817 |
|
| … |
| 1649 |
1820 |
# All initialisations required before starting the option parse loop. |
| 1650 |
1821 |
# Note that when calling hook functions, we pass through the list of |
| 1651 |
1822 |
# positional parameters. If a hook function modifies that list, and |
| 1652 |
|
# needs to propogate that back to rest of this script, then the complete |
| 1653 |
|
# modified list must be put in 'func_run_hooks_result' before |
| 1654 |
|
# returning. |
|
1823 |
# needs to propagate that back to rest of this script, then the complete |
|
1824 |
# modified list must be put in 'func_run_hooks_result' before returning. |
| 1655 |
1825 |
func_hookable func_options_prep |
| 1656 |
1826 |
func_options_prep () |
| 1657 |
1827 |
{ |
| … |
| 1662 |
1832 |
opt_warning_types= |
| 1663 |
1833 |
|
| 1664 |
1834 |
func_run_hooks func_options_prep ${1+"$@"} |
| 1665 |
|
|
| 1666 |
|
# save modified positional parameters for caller |
| 1667 |
|
func_options_prep_result=$func_run_hooks_result |
|
1835 |
func_propagate_result func_run_hooks func_options_prep |
| 1668 |
1836 |
} |
| 1669 |
1837 |
|
| 1670 |
1838 |
|
| … |
| 1676 |
1844 |
{ |
| 1677 |
1845 |
$debug_cmd |
| 1678 |
1846 |
|
| 1679 |
|
func_parse_options_result= |
| 1680 |
|
|
|
1847 |
_G_parse_options_requote=false |
| 1681 |
1848 |
# this just eases exit handling |
| 1682 |
1849 |
while test $# -gt 0; do |
| 1683 |
1850 |
# Defer to hook functions for initial option parsing, so they |
| 1684 |
1851 |
# get priority in the event of reusing an option name. |
| 1685 |
1852 |
func_run_hooks func_parse_options ${1+"$@"} |
| 1686 |
|
|
| 1687 |
|
# Adjust func_parse_options positional parameters to match |
| 1688 |
|
eval set dummy "$func_run_hooks_result"; shift |
|
1853 |
func_propagate_result func_run_hooks func_parse_options |
|
1854 |
if $func_propagate_result_result; then |
|
1855 |
eval set dummy "$func_parse_options_result"; shift |
|
1856 |
# Even though we may have changed "$@", we passed the "$@" array |
|
1857 |
# down into the hook and it quoted it for us (because we are in |
|
1858 |
# this if-branch). No need to quote it again. |
|
1859 |
_G_parse_options_requote=false |
|
1860 |
fi |
| 1689 |
1861 |
|
| 1690 |
1862 |
# Break out of the loop if we already parsed every option. |
| 1691 |
1863 |
test $# -gt 0 || break |
| 1692 |
1864 |
|
|
1865 |
# We expect that one of the options parsed in this function matches |
|
1866 |
# and thus we remove _G_opt from "$@" and need to re-quote. |
|
1867 |
_G_match_parse_options=: |
| 1693 |
1868 |
_G_opt=$1 |
| 1694 |
1869 |
shift |
| 1695 |
1870 |
case $_G_opt in |
| 1696 |
1871 |
--debug|-x) debug_cmd='set -x' |
| 1697 |
|
func_echo "enabling shell trace mode" |
|
1872 |
func_echo "enabling shell trace mode" >&2 |
| 1698 |
1873 |
$debug_cmd |
| 1699 |
1874 |
;; |
| 1700 |
1875 |
|
| … |
| 1704 |
1879 |
;; |
| 1705 |
1880 |
|
| 1706 |
1881 |
--warnings|--warning|-W) |
| 1707 |
|
test $# = 0 && func_missing_arg $_G_opt && break |
|
1882 |
if test $# = 0 && func_missing_arg $_G_opt; then |
|
1883 |
_G_parse_options_requote=: |
|
1884 |
break |
|
1885 |
fi |
| 1708 |
1886 |
case " $warning_categories $1" in |
| 1709 |
1887 |
*" $1 "*) |
| 1710 |
1888 |
# trailing space prevents matching last $1 above |
| … |
| 1757 |
1935 |
shift |
| 1758 |
1936 |
;; |
| 1759 |
1937 |
|
| 1760 |
|
--) break ;; |
|
1938 |
--) _G_parse_options_requote=: ; break ;; |
| 1761 |
1939 |
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;; |
| 1762 |
|
*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; |
|
1940 |
*) set dummy "$_G_opt" ${1+"$@"}; shift |
|
1941 |
_G_match_parse_options=false |
|
1942 |
break |
|
1943 |
;; |
| 1763 |
1944 |
esac |
|
1945 |
|
|
1946 |
if $_G_match_parse_options; then |
|
1947 |
_G_parse_options_requote=: |
|
1948 |
fi |
| 1764 |
1949 |
done |
| 1765 |
1950 |
|
| 1766 |
|
# save modified positional parameters for caller |
| 1767 |
|
func_quote_for_eval ${1+"$@"} |
| 1768 |
|
func_parse_options_result=$func_quote_for_eval_result |
|
1951 |
if $_G_parse_options_requote; then |
|
1952 |
# save modified positional parameters for caller |
|
1953 |
func_quote eval ${1+"$@"} |
|
1954 |
func_parse_options_result=$func_quote_result |
|
1955 |
fi |
| 1769 |
1956 |
} |
| 1770 |
1957 |
|
| 1771 |
1958 |
|
| … |
| 1782 |
1969 |
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" |
| 1783 |
1970 |
|
| 1784 |
1971 |
func_run_hooks func_validate_options ${1+"$@"} |
|
1972 |
func_propagate_result func_run_hooks func_validate_options |
| 1785 |
1973 |
|
| 1786 |
1974 |
# Bail if the options were screwed! |
| 1787 |
1975 |
$exit_cmd $EXIT_FAILURE |
| 1788 |
|
|
| 1789 |
|
# save modified positional parameters for caller |
| 1790 |
|
func_validate_options_result=$func_run_hooks_result |
| 1791 |
1976 |
} |
| 1792 |
1977 |
|
| 1793 |
1978 |
|
| … |
| 1843 |
2028 |
|
| 1844 |
2029 |
# func_split_equals STRING |
| 1845 |
2030 |
# ------------------------ |
| 1846 |
|
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after |
| 1847 |
|
# splitting STRING at the '=' sign. |
|
2031 |
# Set func_split_equals_lhs and func_split_equals_rhs shell variables |
|
2032 |
# after splitting STRING at the '=' sign. |
| 1848 |
2033 |
test -z "$_G_HAVE_XSI_OPS" \ |
| 1849 |
2034 |
&& (eval 'x=a/b/c; |
| 1850 |
2035 |
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ |
| … |
| 1859 |
2044 |
|
| 1860 |
2045 |
func_split_equals_lhs=${1%%=*} |
| 1861 |
2046 |
func_split_equals_rhs=${1#*=} |
| 1862 |
|
test "x$func_split_equals_lhs" = "x$1" \ |
| 1863 |
|
&& func_split_equals_rhs= |
|
2047 |
if test "x$func_split_equals_lhs" = "x$1"; then |
|
2048 |
func_split_equals_rhs= |
|
2049 |
fi |
| 1864 |
2050 |
}' |
| 1865 |
2051 |
else |
| 1866 |
2052 |
# ...otherwise fall back to using expr, which is often a shell builtin. |
| … |
| 1938 |
2124 |
# func_version |
| 1939 |
2125 |
# ------------ |
| 1940 |
2126 |
# Echo version message to standard output and exit. |
|
2127 |
# The version message is extracted from the calling file's header |
|
2128 |
# comments, with leading '# ' stripped: |
|
2129 |
# 1. First display the progname and version |
|
2130 |
# 2. Followed by the header comment line matching /^# Written by / |
|
2131 |
# 3. Then a blank line followed by the first following line matching |
|
2132 |
# /^# Copyright / |
|
2133 |
# 4. Immediately followed by any lines between the previous matches, |
|
2134 |
# except lines preceding the intervening completely blank line. |
|
2135 |
# For example, see the header comments of this file. |
| 1941 |
2136 |
func_version () |
| 1942 |
2137 |
{ |
| 1943 |
2138 |
$debug_cmd |
| 1944 |
2139 |
|
| 1945 |
2140 |
printf '%s\n' "$progname $scriptversion" |
| 1946 |
2141 |
$SED -n ' |
| 1947 |
|
/(C)/!b go |
| 1948 |
|
:more |
| 1949 |
|
/\./!{ |
| 1950 |
|
N |
| 1951 |
|
s|\n# | | |
| 1952 |
|
b more |
| 1953 |
|
} |
| 1954 |
|
:go |
| 1955 |
|
/^# Written by /,/# warranty; / { |
| 1956 |
|
s|^# || |
| 1957 |
|
s|^# *$|| |
| 1958 |
|
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| |
| 1959 |
|
p |
|
2142 |
/^# Written by /!b |
|
2143 |
s|^# ||; p; n |
|
2144 |
|
|
2145 |
:fwd2blnk |
|
2146 |
/./ { |
|
2147 |
n |
|
2148 |
b fwd2blnk |
| 1960 |
2149 |
} |
| 1961 |
|
/^# Written by / { |
| 1962 |
|
s|^# || |
| 1963 |
|
p |
|
2150 |
p; n |
|
2151 |
|
|
2152 |
:holdwrnt |
|
2153 |
s|^# || |
|
2154 |
s|^# *$|| |
|
2155 |
/^Copyright /!{ |
|
2156 |
/./H |
|
2157 |
n |
|
2158 |
b holdwrnt |
| 1964 |
2159 |
} |
| 1965 |
|
/^warranty; /q' < "$progpath" |
|
2160 |
|
|
2161 |
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| |
|
2162 |
G |
|
2163 |
s|\(\n\)\n*|\1|g |
|
2164 |
p; q' < "$progpath" |
| 1966 |
2165 |
|
| 1967 |
2166 |
exit $? |
| 1968 |
2167 |
} |
| … |
| 1977 |
2176 |
# End: |
| 1978 |
2177 |
|
| 1979 |
2178 |
# Set a version string. |
| 1980 |
|
scriptversion='(GNU libtool) 2.4.6' |
|
2179 |
scriptversion='(GNU libtool) 2.4.6.40-6ca5' |
| 1981 |
2180 |
|
| 1982 |
2181 |
|
| 1983 |
2182 |
# func_echo ARG... |
| … |
| 2068 |
2267 |
compiler: $LTCC |
| 2069 |
2268 |
compiler flags: $LTCFLAGS |
| 2070 |
2269 |
linker: $LD (gnu? $with_gnu_ld) |
| 2071 |
|
version: $progname (GNU libtool) 2.4.6 |
|
2270 |
version: $progname (GNU libtool) 2.4.6.40-6ca5 |
| 2072 |
2271 |
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
| 2073 |
2272 |
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
| 2074 |
2273 |
|
| 2075 |
2274 |
Report bugs to <bug-libtool@gnu.org>. |
| 2076 |
|
GNU libtool home page: <http://www.gnu.org/software/libtool/>. |
|
2275 |
GNU libtool home page: <http://www.gnu.org/s/libtool/>. |
| 2077 |
2276 |
General help using GNU software: <http://www.gnu.org/gethelp/>." |
| 2078 |
2277 |
exit 0 |
| 2079 |
2278 |
} |
| … |
| 2124 |
2323 |
# a configuration failure hint, and exit. |
| 2125 |
2324 |
func_fatal_configuration () |
| 2126 |
2325 |
{ |
| 2127 |
|
func__fatal_error ${1+"$@"} \ |
|
2326 |
func_fatal_error ${1+"$@"} \ |
| 2128 |
2327 |
"See the $PACKAGE documentation for more information." \ |
| 2129 |
2328 |
"Fatal configuration error." |
| 2130 |
2329 |
} |
| … |
| 2270 |
2469 |
nonopt= |
| 2271 |
2470 |
preserve_args= |
| 2272 |
2471 |
|
|
2472 |
_G_rc_lt_options_prep=: |
|
2473 |
|
| 2273 |
2474 |
# Shorthand for --mode=foo, only valid as the first argument |
| 2274 |
2475 |
case $1 in |
| 2275 |
2476 |
clean|clea|cle|cl) |
| … |
| 2293 |
2494 |
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) |
| 2294 |
2495 |
shift; set dummy --mode uninstall ${1+"$@"}; shift |
| 2295 |
2496 |
;; |
|
2497 |
*) |
|
2498 |
_G_rc_lt_options_prep=false |
|
2499 |
;; |
| 2296 |
2500 |
esac |
| 2297 |
2501 |
|
| 2298 |
|
# Pass back the list of options. |
| 2299 |
|
func_quote_for_eval ${1+"$@"} |
| 2300 |
|
libtool_options_prep_result=$func_quote_for_eval_result |
|
2502 |
if $_G_rc_lt_options_prep; then |
|
2503 |
# Pass back the list of options. |
|
2504 |
func_quote eval ${1+"$@"} |
|
2505 |
libtool_options_prep_result=$func_quote_result |
|
2506 |
fi |
| 2301 |
2507 |
} |
| 2302 |
2508 |
func_add_hook func_options_prep libtool_options_prep |
| 2303 |
2509 |
|
| … |
| 2309 |
2515 |
{ |
| 2310 |
2516 |
$debug_cmd |
| 2311 |
2517 |
|
|
2518 |
_G_rc_lt_parse_options=false |
|
2519 |
|
| 2312 |
2520 |
# Perform our own loop to consume as many options as possible in |
| 2313 |
2521 |
# each iteration. |
| 2314 |
2522 |
while test $# -gt 0; do |
|
2523 |
_G_match_lt_parse_options=: |
| 2315 |
2524 |
_G_opt=$1 |
| 2316 |
2525 |
shift |
| 2317 |
2526 |
case $_G_opt in |
| … |
| 2386 |
2595 |
func_append preserve_args " $_G_opt" |
| 2387 |
2596 |
;; |
| 2388 |
2597 |
|
| 2389 |
|
# An option not handled by this hook function: |
| 2390 |
|
*) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; |
|
2598 |
# An option not handled by this hook function: |
|
2599 |
*) set dummy "$_G_opt" ${1+"$@"} ; shift |
|
2600 |
_G_match_lt_parse_options=false |
|
2601 |
break |
|
2602 |
;; |
| 2391 |
2603 |
esac |
|
2604 |
$_G_match_lt_parse_options && _G_rc_lt_parse_options=: |
| 2392 |
2605 |
done |
| 2393 |
2606 |
|
| 2394 |
|
|
| 2395 |
|
# save modified positional parameters for caller |
| 2396 |
|
func_quote_for_eval ${1+"$@"} |
| 2397 |
|
libtool_parse_options_result=$func_quote_for_eval_result |
|
2607 |
if $_G_rc_lt_parse_options; then |
|
2608 |
# save modified positional parameters for caller |
|
2609 |
func_quote eval ${1+"$@"} |
|
2610 |
libtool_parse_options_result=$func_quote_result |
|
2611 |
fi |
| 2398 |
2612 |
} |
| 2399 |
2613 |
func_add_hook func_parse_options libtool_parse_options |
| 2400 |
2614 |
|
| … |
| 2451 |
2665 |
} |
| 2452 |
2666 |
|
| 2453 |
2667 |
# Pass back the unparsed argument list |
| 2454 |
|
func_quote_for_eval ${1+"$@"} |
| 2455 |
|
libtool_validate_options_result=$func_quote_for_eval_result |
|
2668 |
func_quote eval ${1+"$@"} |
|
2669 |
libtool_validate_options_result=$func_quote_result |
| 2456 |
2670 |
} |
| 2457 |
2671 |
func_add_hook func_validate_options libtool_validate_options |
| 2458 |
2672 |
|
| … |
| 3418 |
3632 |
esac |
| 3419 |
3633 |
done |
| 3420 |
3634 |
|
| 3421 |
|
func_quote_for_eval "$libobj" |
| 3422 |
|
test "X$libobj" != "X$func_quote_for_eval_result" \ |
|
3635 |
func_quote_arg pretty "$libobj" |
|
3636 |
test "X$libobj" != "X$func_quote_arg_result" \ |
| 3423 |
3637 |
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
| 3424 |
3638 |
&& func_warning "libobj name '$libobj' may not contain shell special characters." |
| 3425 |
3639 |
func_dirname_and_basename "$obj" "/" "" |
| … |
| 3492 |
3706 |
|
| 3493 |
3707 |
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 |
| 3494 |
3708 |
srcfile=$func_to_tool_file_result |
| 3495 |
|
func_quote_for_eval "$srcfile" |
| 3496 |
|
qsrcfile=$func_quote_for_eval_result |
|
3709 |
func_quote_arg pretty "$srcfile" |
|
3710 |
qsrcfile=$func_quote_arg_result |
| 3497 |
3711 |
|
| 3498 |
3712 |
# Only build a PIC object if we are building libtool libraries. |
| 3499 |
3713 |
if test yes = "$build_libtool_libs"; then |
| … |
| 4096 |
4310 |
case $nonopt in *shtool*) :;; *) false;; esac |
| 4097 |
4311 |
then |
| 4098 |
4312 |
# Aesthetically quote it. |
| 4099 |
|
func_quote_for_eval "$nonopt" |
| 4100 |
|
install_prog="$func_quote_for_eval_result " |
|
4313 |
func_quote_arg pretty "$nonopt" |
|
4314 |
install_prog="$func_quote_arg_result " |
| 4101 |
4315 |
arg=$1 |
| 4102 |
4316 |
shift |
| 4103 |
4317 |
else |
| … |
| 4107 |
4321 |
|
| 4108 |
4322 |
# The real first argument should be the name of the installation program. |
| 4109 |
4323 |
# Aesthetically quote it. |
| 4110 |
|
func_quote_for_eval "$arg" |
| 4111 |
|
func_append install_prog "$func_quote_for_eval_result" |
|
4324 |
func_quote_arg pretty "$arg" |
|
4325 |
func_append install_prog "$func_quote_arg_result" |
| 4112 |
4326 |
install_shared_prog=$install_prog |
| 4113 |
4327 |
case " $install_prog " in |
| 4114 |
4328 |
*[\\\ /]cp\ *) install_cp=: ;; |
| … |
| 4165 |
4379 |
esac |
| 4166 |
4380 |
|
| 4167 |
4381 |
# Aesthetically quote the argument. |
| 4168 |
|
func_quote_for_eval "$arg" |
| 4169 |
|
func_append install_prog " $func_quote_for_eval_result" |
|
4382 |
func_quote_arg pretty "$arg" |
|
4383 |
func_append install_prog " $func_quote_arg_result" |
| 4170 |
4384 |
if test -n "$arg2"; then |
| 4171 |
|
func_quote_for_eval "$arg2" |
|
4385 |
func_quote_arg pretty "$arg2" |
| 4172 |
4386 |
fi |
| 4173 |
|
func_append install_shared_prog " $func_quote_for_eval_result" |
|
4387 |
func_append install_shared_prog " $func_quote_arg_result" |
| 4174 |
4388 |
done |
| 4175 |
4389 |
|
| 4176 |
4390 |
test -z "$install_prog" && \ |
| … |
| 4181 |
4395 |
|
| 4182 |
4396 |
if test -n "$install_override_mode" && $no_mode; then |
| 4183 |
4397 |
if $install_cp; then :; else |
| 4184 |
|
func_quote_for_eval "$install_override_mode" |
| 4185 |
|
func_append install_shared_prog " -m $func_quote_for_eval_result" |
|
4398 |
func_quote_arg pretty "$install_override_mode" |
|
4399 |
func_append install_shared_prog " -m $func_quote_arg_result" |
| 4186 |
4400 |
fi |
| 4187 |
4401 |
fi |
| 4188 |
4402 |
|
| … |
| 4478 |
4692 |
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` |
| 4479 |
4693 |
|
| 4480 |
4694 |
$opt_quiet || { |
| 4481 |
|
func_quote_for_expand "$relink_command" |
| 4482 |
|
eval "func_echo $func_quote_for_expand_result" |
|
4695 |
func_quote_arg expand,pretty "$relink_command" |
|
4696 |
eval "func_echo $func_quote_arg_result" |
| 4483 |
4697 |
} |
| 4484 |
4698 |
if eval "$relink_command"; then : |
| 4485 |
4699 |
else |
| … |
| 5258 |
5472 |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
| 5259 |
5473 |
file=\"\$0\"" |
| 5260 |
5474 |
|
| 5261 |
|
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` |
|
5475 |
func_quote_arg pretty "$ECHO" |
|
5476 |
qECHO=$func_quote_arg_result |
| 5262 |
5477 |
$ECHO "\ |
| 5263 |
5478 |
|
| 5264 |
5479 |
# A function that is used when there is no print builtin or printf. |
| … |
| 5268 |
5483 |
\$1 |
| 5269 |
5484 |
_LTECHO_EOF' |
| 5270 |
5485 |
} |
| 5271 |
|
ECHO=\"$qECHO\" |
|
5486 |
ECHO=$qECHO |
| 5272 |
5487 |
fi |
| 5273 |
5488 |
|
| 5274 |
5489 |
# Very basic option parsing. These options are (a) specific to |
| … |
| 6611 |
6826 |
while test "$#" -gt 0; do |
| 6612 |
6827 |
arg=$1 |
| 6613 |
6828 |
shift |
| 6614 |
|
func_quote_for_eval "$arg" |
| 6615 |
|
qarg=$func_quote_for_eval_unquoted_result |
| 6616 |
|
func_append libtool_args " $func_quote_for_eval_result" |
|
6829 |
func_quote_arg pretty,unquoted "$arg" |
|
6830 |
qarg=$func_quote_arg_unquoted_result |
|
6831 |
func_append libtool_args " $func_quote_arg_result" |
| 6617 |
6832 |
|
| 6618 |
6833 |
# If the previous option needs an argument, assign it. |
| 6619 |
6834 |
if test -n "$prev"; then |
| … |
| 7211 |
7426 |
save_ifs=$IFS; IFS=, |
| 7212 |
7427 |
for flag in $args; do |
| 7213 |
7428 |
IFS=$save_ifs |
| 7214 |
|
func_quote_for_eval "$flag" |
| 7215 |
|
func_append arg " $func_quote_for_eval_result" |
| 7216 |
|
func_append compiler_flags " $func_quote_for_eval_result" |
|
7429 |
func_quote_arg pretty "$flag" |
|
7430 |
func_append arg " $func_quote_arg_result" |
|
7431 |
func_append compiler_flags " $func_quote_arg_result" |
| 7217 |
7432 |
done |
| 7218 |
7433 |
IFS=$save_ifs |
| 7219 |
7434 |
func_stripname ' ' '' "$arg" |
| … |
| 7227 |
7442 |
save_ifs=$IFS; IFS=, |
| 7228 |
7443 |
for flag in $args; do |
| 7229 |
7444 |
IFS=$save_ifs |
| 7230 |
|
func_quote_for_eval "$flag" |
| 7231 |
|
func_append arg " $wl$func_quote_for_eval_result" |
| 7232 |
|
func_append compiler_flags " $wl$func_quote_for_eval_result" |
| 7233 |
|
func_append linker_flags " $func_quote_for_eval_result" |
|
7445 |
func_quote_arg pretty "$flag" |
|
7446 |
func_append arg " $wl$func_quote_arg_result" |
|
7447 |
func_append compiler_flags " $wl$func_quote_arg_result" |
|
7448 |
func_append linker_flags " $func_quote_arg_result" |
| 7234 |
7449 |
done |
| 7235 |
7450 |
IFS=$save_ifs |
| 7236 |
7451 |
func_stripname ' ' '' "$arg" |
| … |
| 7254 |
7469 |
|
| 7255 |
7470 |
# -msg_* for osf cc |
| 7256 |
7471 |
-msg_*) |
| 7257 |
|
func_quote_for_eval "$arg" |
| 7258 |
|
arg=$func_quote_for_eval_result |
|
7472 |
func_quote_arg pretty "$arg" |
|
7473 |
arg=$func_quote_arg_result |
| 7259 |
7474 |
;; |
| 7260 |
7475 |
|
| 7261 |
7476 |
# Flags to be passed through unchanged, with rationale: |
| … |
| 7272 |
7487 |
# -tp=* Portland pgcc target processor selection |
| 7273 |
7488 |
# --sysroot=* for sysroot support |
| 7274 |
7489 |
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization |
|
7490 |
# -specs=* GCC specs files |
| 7275 |
7491 |
# -stdlib=* select c++ std lib with clang |
|
7492 |
# -fsanitize=* Clang/GCC memory and address sanitizer |
|
7493 |
# -fuse-ld=* Linker select flags for GCC |
| 7276 |
7494 |
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ |
| 7277 |
7495 |
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ |
| 7278 |
|
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) |
| 7279 |
|
func_quote_for_eval "$arg" |
| 7280 |
|
arg=$func_quote_for_eval_result |
|
7496 |
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ |
|
7497 |
-specs=*|-fsanitize=*|-fuse-ld=*) |
|
7498 |
func_quote_arg pretty "$arg" |
|
7499 |
arg=$func_quote_arg_result |
| 7281 |
7500 |
func_append compile_command " $arg" |
| 7282 |
7501 |
func_append finalize_command " $arg" |
| 7283 |
7502 |
func_append compiler_flags " $arg" |
| … |
| 7298 |
7517 |
continue |
| 7299 |
7518 |
else |
| 7300 |
7519 |
# Otherwise treat like 'Some other compiler flag' below |
| 7301 |
|
func_quote_for_eval "$arg" |
| 7302 |
|
arg=$func_quote_for_eval_result |
|
7520 |
func_quote_arg pretty "$arg" |
|
7521 |
arg=$func_quote_arg_result |
| 7303 |
7522 |
fi |
| 7304 |
7523 |
;; |
| 7305 |
7524 |
|
| 7306 |
7525 |
# Some other compiler flag. |
| 7307 |
7526 |
-* | +*) |
| 7308 |
|
func_quote_for_eval "$arg" |
| 7309 |
|
arg=$func_quote_for_eval_result |
|
7527 |
func_quote_arg pretty "$arg" |
|
7528 |
arg=$func_quote_arg_result |
| 7310 |
7529 |
;; |
| 7311 |
7530 |
|
| 7312 |
7531 |
*.$objext) |
| … |
| 7426 |
7645 |
*) |
| 7427 |
7646 |
# Unknown arguments in both finalize_command and compile_command need |
| 7428 |
7647 |
# to be aesthetically quoted because they are evaled later. |
| 7429 |
|
func_quote_for_eval "$arg" |
| 7430 |
|
arg=$func_quote_for_eval_result |
|
7648 |
func_quote_arg pretty "$arg" |
|
7649 |
arg=$func_quote_arg_result |
| 7431 |
7650 |
;; |
| 7432 |
7651 |
esac # arg |
| 7433 |
7652 |
|
| … |
| 9933 |
10152 |
for cmd in $concat_cmds; do |
| 9934 |
10153 |
IFS=$save_ifs |
| 9935 |
10154 |
$opt_quiet || { |
| 9936 |
|
func_quote_for_expand "$cmd" |
| 9937 |
|
eval "func_echo $func_quote_for_expand_result" |
|
10155 |
func_quote_arg expand,pretty "$cmd" |
|
10156 |
eval "func_echo $func_quote_arg_result" |
| 9938 |
10157 |
} |
| 9939 |
10158 |
$opt_dry_run || eval "$cmd" || { |
| 9940 |
10159 |
lt_exit=$? |
| … |
| 10027 |
10246 |
eval cmd=\"$cmd\" |
| 10028 |
10247 |
IFS=$save_ifs |
| 10029 |
10248 |
$opt_quiet || { |
| 10030 |
|
func_quote_for_expand "$cmd" |
| 10031 |
|
eval "func_echo $func_quote_for_expand_result" |
|
10249 |
func_quote_arg expand,pretty "$cmd" |
|
10250 |
eval "func_echo $func_quote_arg_result" |
| 10032 |
10251 |
} |
| 10033 |
10252 |
$opt_dry_run || eval "$cmd" || { |
| 10034 |
10253 |
lt_exit=$? |
| … |
| 10502 |
10721 |
elif eval var_value=\$$var; test -z "$var_value"; then |
| 10503 |
10722 |
relink_command="$var=; export $var; $relink_command" |
| 10504 |
10723 |
else |
| 10505 |
|
func_quote_for_eval "$var_value" |
| 10506 |
|
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" |
|
10724 |
func_quote_arg pretty "$var_value" |
|
10725 |
relink_command="$var=$func_quote_arg_result; export $var; $relink_command" |
| 10507 |
10726 |
fi |
| 10508 |
10727 |
done |
| 10509 |
|
relink_command="(cd `pwd`; $relink_command)" |
| 10510 |
|
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` |
|
10728 |
func_quote eval cd "`pwd`" |
|
10729 |
func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" |
|
10730 |
relink_command=$func_quote_arg_unquoted_result |
| 10511 |
10731 |
fi |
| 10512 |
10732 |
|
| 10513 |
10733 |
# Only actually do things if not in dry run mode. |
| … |
| 10747 |
10967 |
elif eval var_value=\$$var; test -z "$var_value"; then |
| 10748 |
10968 |
relink_command="$var=; export $var; $relink_command" |
| 10749 |
10969 |
else |
| 10750 |
|
func_quote_for_eval "$var_value" |
| 10751 |
|
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" |
|
10970 |
func_quote_arg pretty,unquoted "$var_value" |
|
10971 |
relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" |
| 10752 |
10972 |
fi |
| 10753 |
10973 |
done |
| 10754 |
10974 |
# Quote the link command for shipping. |
| 10755 |
|
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" |
| 10756 |
|
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` |
|
10975 |
func_quote eval cd "`pwd`" |
|
10976 |
relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" |
|
10977 |
func_quote_arg pretty,unquoted "$relink_command" |
|
10978 |
relink_command=$func_quote_arg_unquoted_result |
| 10757 |
10979 |
if test yes = "$hardcode_automatic"; then |
| 10758 |
10980 |
relink_command= |
| 10759 |
10981 |
fi |