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 Pavel Roskin <proski@gnu.org>
+
+ * 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 <tim.van.holder@pandora.be>
* acgeneral.m4 (_AC_OUTPUT_SUBDIRS): Quote $ac_sub_srcdir in case
# 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])])
])])])
_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
])])])
_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
])])])
_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.
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
])
# 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])])
])])])
_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
])])])
_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
])])])
_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.
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
])
[ \(.\)$], [\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...)
# ---------------------------
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.
[ \(.\)$], [\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...)
# ---------------------------
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.