From: Pavel Roskin Date: Wed, 17 Jan 2001 15:23:31 +0000 (+0000) Subject: * m4sugar.m4 (m4_normalize): New macro - superposition of X-Git-Tag: autoconf-2.50~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23ef1d703aea283ad36678d6d20bf5ea810e1284;p=thirdparty%2Fautoconf.git * m4sugar.m4 (m4_normalize): New macro - superposition of m4_flatten and m4_strip. (m4_join): Use m4_normalize. * acgeneral.m4 (AC_FOREACH): Use m4_normalize. (AC_CONFIG_HEADERS): Normalize the first argument. (AC_CONFIG_LINKS): Likewise. (AC_CONFIG_SUBDIRS): Likewise. --- diff --git a/ChangeLog b/ChangeLog index c785a4445..d006581e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-01-17 Pavel Roskin + + * m4sugar.m4 (m4_normalize): New macro - superposition of + m4_flatten and m4_strip. + (m4_join): Use m4_normalize. + * acgeneral.m4 (AC_FOREACH): Use m4_normalize. + (AC_CONFIG_HEADERS): Normalize the first argument. + (AC_CONFIG_LINKS): Likewise. + (AC_CONFIG_SUBDIRS): Likewise. + 2001-01-17 Tim Van Holder * acgeneral.m4 (_AC_OUTPUT_SUBDIRS): Quote $ac_sub_srcdir in case diff --git a/acgeneral.m4 b/acgeneral.m4 index e6922679a..b74943e69 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -503,7 +503,7 @@ m4_define([AC_TR_SH], # ive ], [-Var-])end # => -active--b--active-end m4_define([AC_FOREACH], -[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])]) +[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) @@ -3589,7 +3589,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_headers="$ac_config_headers $1" +ac_config_headers="$ac_config_headers m4_normalize([$1])" ])dnl # Initialize to empty. It is much easier and uniform to have a config @@ -3626,7 +3626,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_links="$ac_config_links $1" +ac_config_links="$ac_config_links m4_normalize([$1])" ])dnl @@ -3697,7 +3697,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_files="$ac_config_files $1" +ac_config_files="$ac_config_files m4_normalize([$1])" ])dnl # Initialize the lists. @@ -3723,7 +3723,8 @@ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl m4_append([_AC_LIST_SUBDIRS], [ $1])dnl AS_LITERAL_IF([$1], [], [AC_DIAGNOSE(syntax, [$0: you should use literals])]) -m4_divert_text([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"]) +m4_divert_text([DEFAULTS], + [ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"]) AC_SUBST(subdirs, "$subdirs $1")dnl ]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index e6922679a..b74943e69 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -503,7 +503,7 @@ m4_define([AC_TR_SH], # ive ], [-Var-])end # => -active--b--active-end m4_define([AC_FOREACH], -[m4_foreach([$1], m4_split(m4_strip(m4_flatten([$2]))), [$3])]) +[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) @@ -3589,7 +3589,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_headers="$ac_config_headers $1" +ac_config_headers="$ac_config_headers m4_normalize([$1])" ])dnl # Initialize to empty. It is much easier and uniform to have a config @@ -3626,7 +3626,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_links="$ac_config_links $1" +ac_config_links="$ac_config_links m4_normalize([$1])" ])dnl @@ -3697,7 +3697,7 @@ m4_ifval([$2], [AC_FOREACH([AC_File], [$1], ])])]) _AC_CONFIG_COMMANDS_INIT([$3]) m4_divert_pop()dnl -ac_config_files="$ac_config_files $1" +ac_config_files="$ac_config_files m4_normalize([$1])" ])dnl # Initialize the lists. @@ -3723,7 +3723,8 @@ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl m4_append([_AC_LIST_SUBDIRS], [ $1])dnl AS_LITERAL_IF([$1], [], [AC_DIAGNOSE(syntax, [$0: you should use literals])]) -m4_divert_text([DEFAULTS], [ac_subdirs_all="$ac_subdirs_all $1"]) +m4_divert_text([DEFAULTS], + [ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"]) AC_SUBST(subdirs, "$subdirs $1")dnl ]) diff --git a/lib/m4sugar/m4sugar.m4 b/lib/m4sugar/m4sugar.m4 index 35825c7c2..5375f4967 100644 --- a/lib/m4sugar/m4sugar.m4 +++ b/lib/m4sugar/m4sugar.m4 @@ -1377,6 +1377,22 @@ m4_define([m4_strip], [ \(.\)$], [\1])]) +# m4_normalize(STRING) +# -------------------- +# Apply m4_flatten and m4_strip to STRING. +# +# The argument is quoted, so that the macro is robust to active symbols: +# +# m4_define(active, ACTIVE) +# m4_normalize([ act\ +# ive +# active ])end +# => active activeend + +m4_define([m4_normalize], +[m4_strip(m4_flatten([$1]))]) + + # m4_join(SEP, ARG1, ARG2...) # --------------------------- @@ -1495,7 +1511,7 @@ m4_Prefix1[]dnl m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)), 1, [m4_define([m4_Cursor], m4_len(m4_Prefix)) m4_Prefix])[]dnl -m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))), +m4_foreach_quoted([m4_Word], (m4_split(m4_normalize([$1]))), [m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl dnl New line if too long, else insert a space unless it is the first dnl of the words. diff --git a/m4sugar.m4 b/m4sugar.m4 index 35825c7c2..5375f4967 100644 --- a/m4sugar.m4 +++ b/m4sugar.m4 @@ -1377,6 +1377,22 @@ m4_define([m4_strip], [ \(.\)$], [\1])]) +# m4_normalize(STRING) +# -------------------- +# Apply m4_flatten and m4_strip to STRING. +# +# The argument is quoted, so that the macro is robust to active symbols: +# +# m4_define(active, ACTIVE) +# m4_normalize([ act\ +# ive +# active ])end +# => active activeend + +m4_define([m4_normalize], +[m4_strip(m4_flatten([$1]))]) + + # m4_join(SEP, ARG1, ARG2...) # --------------------------- @@ -1495,7 +1511,7 @@ m4_Prefix1[]dnl m4_if(m4_eval(m4_Cursor > m4_len(m4_Prefix)), 1, [m4_define([m4_Cursor], m4_len(m4_Prefix)) m4_Prefix])[]dnl -m4_foreach_quoted([m4_Word], (m4_split(m4_strip(m4_flatten([$1])))), +m4_foreach_quoted([m4_Word], (m4_split(m4_normalize([$1]))), [m4_define([m4_Cursor], m4_eval(m4_Cursor + len(m4_Word) + 1))dnl dnl New line if too long, else insert a space unless it is the first dnl of the words.