From: Eric Blake Date: Tue, 28 Oct 2008 16:28:04 +0000 (-0600) Subject: Allow m4sugar to be used without autom4te, such as in bison. X-Git-Tag: v2.63b~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a951c9da7d85ad896d10d7ac723c958521e2a3a;p=thirdparty%2Fautoconf.git Allow m4sugar to be used without autom4te, such as in bison. * lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that alternate escape sequences can be used. (m4_text_box): Likewise. Don't output quadrigraphs. (m4_qdelta): Delete unused macro. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index d0296c06c..720f4b061 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-28 Eric Blake + + Allow m4sugar to be used without autom4te, such as in bison. + * lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that + alternate escape sequences can be used. + (m4_text_box): Likewise. Don't output quadrigraphs. + (m4_qdelta): Delete unused macro. + 2008-10-28 Paolo Bonzini Add m4_stack_foreach and m4_stack_foreach_lifo. @@ -9,7 +17,7 @@ * tests/m4sugar.at (m4_stack_foreach): New test. 2008-10-28 Paolo Bonzini - + use a shell function for AC_TYPE_INTx_T * lib/autoconf/types.m4 (_AC_TYPE_INT_BODY, _AC_TYPE_UNSIGNED_INT_BODY): New. diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4 index eb5d4260c..a17776c1a 100644 --- a/lib/m4sugar/m4sugar.m4 +++ b/lib/m4sugar/m4sugar.m4 @@ -2232,7 +2232,9 @@ m4_define([m4_append_uniq_w], # FIRST-PREFIX will be left alone on the first line. # # No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX, -# although quadrigraphs are correctly recognized. +# although quadrigraphs are correctly recognized. More precisely, +# you may redefine m4_qlen to recognize whatever escape sequences that +# you will post-process. # # Typical outputs are: # @@ -2311,20 +2313,29 @@ dnl finally, clean up the local variables # ## MESSAGE ## # ## ------- ## # using FRAME-CHARACTER in the border. +# +# Quadrigraphs are correctly recognized. More precisely, you may +# redefine m4_qlen to recognize whatever escape sequences that you +# will post-process. m4_define([m4_text_box], [m4_pushdef([m4_Border], m4_translit(m4_format([%*s], m4_qlen(m4_expand([$1])), []), [ ], m4_default_quoted([$2], [-])))dnl -@%:@@%:@ m4_Border @%:@@%:@ -@%:@@%:@ $1 @%:@@%:@ -@%:@@%:@ m4_Border @%:@@%:@_m4_popdef([m4_Border])dnl -]) +[##] m4_Border [##] +[##] $1 [##] +[##] m4_Border [##]_m4_popdef([m4_Border])]) # m4_qlen(STRING) # --------------- # Expands to the length of STRING after autom4te converts all quadrigraphs. # +# If you use some other means of post-processing m4 output rather than +# autom4te, then you may redefine this macro to recognize whatever +# escape sequences your post-processor will handle. For that matter, +# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't +# do any post-processing. +# # Avoid bpatsubsts for the common case of no quadrigraphs. Cache # results, as configure scripts tend to ask about lengths of common # strings like `/*' and `*/' rather frequently. Minimize the number @@ -2340,15 +2351,6 @@ m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])], [\3]))]))_m4_defn([m4_qlen-$1])]) -# m4_qdelta(STRING) -# ----------------- -# Expands to the net change in the length of STRING from autom4te converting the -# quadrigraphs in STRING. This number is always negative or zero. -m4_define([m4_qdelta], -[m4_eval(m4_qlen([$1]) - m4_len([$1]))]) - - - ## ----------------------- ## ## 13. Number processing. ## ## ----------------------- ##