maint: factor common shell code into build-aux/funclib.sh.
commita73a99b88a93e2880a6ecbfbb76a248be10aa933
authorGary V. Vaughan <gary@gnu.org>
Sun, 7 Oct 2012 11:01:24 +0000 (7 18:01 +0700)
committerGary V. Vaughan <gary@gnu.org>
Fri, 12 Oct 2012 13:18:28 +0000 (12 20:18 +0700)
tree77020752b705f9740fadd3c1ca1af717f19e9d86
parent2a43c87092aff0e133282b089b7cda0c4de17728
maint: factor common shell code into build-aux/funclib.sh.

Moving potentially reusable code into a common file that can
be sourced by clients, and adjusting for impedance mismatch
or necessary renames during integration.
* build-aux/funclib.sh: New file.
* build-aux/options-parser (Shell normalisation)
(User overrideable command paths, Global variables, func_append)
(require_term_colors, func_echo, func_echo_infix_1, func_warn)
(func_error, func_fatal_error, func_quote_for_eval, func_verbose):
Move from here...
* build-aux/funclib.sh (Shell normalisation, User overrideable
command paths, Global variables, func_append)
(require_term_colors, func_echo, func_echo_infix_1)
(func_warn_and_continue, func_error, func_fatal_error)
(func_quote_for_eval, func_verbose): ...to here.
* build-aux/general.m4sh (func_arith, func_basename)
(func_dirname, func_dirname_and_basename, func_echo_all)
(func_grep, func_len, func_mkdir_p, func_mktempdir)
(func_normal_abspath, func_relative_path, func_quote_for_expand)
(func_stripname, func_show_eval, func_tr_sh): Move from here...
* build-aux/funclib.sh(func_arith, func_basename)
(func_dirname, func_dirname_and_basename, func_echo_all)
(func_grep, func_len, func_mkdir_p, func_mktempdir)
(func_normal_abspath, func_relative_path, func_quote_for_expand)
(func_stripname, func_show_eval, func_tr_sh): ...to here.
* bootstrap (usage message): Document `-no-warn' option.
(func_append_u, func_warning): Move from here...
* build-aux/funclib.sh (func_append_uniq, func_warning): ...to
here.
* bootstrap, build-aux/extract-trace: Source build-aux/funclib.sh
before build-aux/options-parser.
* build-aux/options-parser (usage, long_help_message): Set
default values to match what is parsed by the unmodified parser.
* build-aux/extract-trace (usage, long_help_message): Only set
from func_main, so that clients sourcing this file can still use
the correct defaults from build-aux/options-parser.
* bootstrap (bootstrap_options_prep, bootstrap_parse_options):
Move warning option parsing from here...
* build-aux/option-parser (func_options_prep)
(func_parse_options): ...to here, where all clients can benefit.
* Makefile.am (funclib_sh): New macro; path to funclib.sh.
(EXTRA_DIST): Add $(funclib_sh).

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Makefile.am
bootstrap
build-aux/extract-trace
build-aux/funclib.sh [new file with mode: 0644]
build-aux/options-parser
libtoolize.m4sh