mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-17 14:01:27 +08:00
Optimize AS_BOX.
* lib/m4sugar/m4sh.m4 (AS_BOX): Use less m4 time. (_AS_BOX_LITERAL): Use fewer forks in the common case. * doc/autoconf.texi (Common Shell Constructs) <AS_BOX>: Document the macro. * NEWS: Mention it. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
73720645e9
commit
64954f9188
@ -1,5 +1,12 @@
|
||||
2010-07-02 Eric Blake <eblake@redhat.com>
|
||||
|
||||
Optimize AS_BOX.
|
||||
* lib/m4sugar/m4sh.m4 (AS_BOX): Use less m4 time.
|
||||
(_AS_BOX_LITERAL): Use fewer forks in the common case.
|
||||
* doc/autoconf.texi (Common Shell Constructs) <AS_BOX>: Document
|
||||
the macro.
|
||||
* NEWS: Mention it.
|
||||
|
||||
Use new AS_LITERAL_IF argument when appropriate.
|
||||
* lib/m4sugar/m4sh.m4 (AS_VAR_SET): Reduce m4 overhead.
|
||||
(AS_VAR_IF, AS_VAR_TEST_SET): Provide shorter variant for simple
|
||||
|
4
NEWS
4
NEWS
@ -43,6 +43,10 @@ GNU Autoconf NEWS - User visible changes.
|
||||
Furthermore, a new macro, AS_LITERAL_WORD_IF, adds an additional
|
||||
level of checking that no whitespace occurs in literals.
|
||||
|
||||
** The following macros are now documented:
|
||||
AS_BOX
|
||||
|
||||
|
||||
* Major changes in Autoconf 2.65 (2009-11-21) [stable]
|
||||
Released by Eric Blake, based on git versions 2.64.*.
|
||||
|
||||
|
@ -13086,6 +13086,17 @@ if @code{$file} is @samp{/one/two/three}, the command
|
||||
@end defmac
|
||||
@end ignore
|
||||
|
||||
@defmac AS_BOX (@var{text}, @dvar{char, -})
|
||||
@asindex{BOX}
|
||||
Expand into shell code that will output @var{text} surrounded by a box
|
||||
with @var{char} in the top and bottom border. @var{text} should not
|
||||
contain a newline, but may contain shell expansions valid for unquoted
|
||||
here-documents. @var{char} defaults to @samp{-}, but can be any
|
||||
character except @samp{/}, @samp{'}, @samp{"}, @samp{\},
|
||||
@samp{&}, or @samp{`}. This is useful for outputting a comment box into
|
||||
log files to separate distinct phases of script operation.
|
||||
@end defmac
|
||||
|
||||
@defmac AS_CASE (@var{word}, @ovar{pattern1}, @ovar{if-matched1}, @
|
||||
@dots{}, @ovar{default})
|
||||
@asindex{CASE}
|
||||
|
@ -1377,17 +1377,17 @@ as_executable_p=$as_test_x
|
||||
# Output MESSAGE, a single line text, framed with FRAME-CHARACTER (which
|
||||
# must not be `/').
|
||||
m4_define([AS_BOX],
|
||||
[AS_LITERAL_IF([$1],
|
||||
[_AS_BOX_LITERAL($@)],
|
||||
[_AS_BOX_INDIR($@)])])
|
||||
[_$0(m4_expand([$1]), [$2])])
|
||||
|
||||
m4_define([_AS_BOX],
|
||||
[m4_if(m4_index(m4_translit([[$1]], [`\"], [$$$]), [$]),
|
||||
[-1], [$0_LITERAL], [$0_INDIR])($@)])
|
||||
|
||||
|
||||
# _AS_BOX_LITERAL(MESSAGE, [FRAME-CHARACTER = `-'])
|
||||
# -------------------------------------------------
|
||||
m4_define([_AS_BOX_LITERAL],
|
||||
[cat <<\_ASBOX
|
||||
m4_text_box($@)
|
||||
_ASBOX])
|
||||
[AS_ECHO(["_AS_ESCAPE(m4_expand([m4_text_box($@)]), [`], [\"$])"])])
|
||||
|
||||
|
||||
# _AS_BOX_INDIR(MESSAGE, [FRAME-CHARACTER = `-'])
|
||||
|
Loading…
Reference in New Issue
Block a user