]> git.draconx.ca Git - dxcommon.git/blob - m4/utils.m4
DX_C_ALIGNAS: Work around bash-5 parsing bug.
[dxcommon.git] / m4 / utils.m4
1 dnl Copyright © 2015, 2018-2019 Nick Bowler
2 dnl
3 dnl Assorted utility macros.
4 dnl
5 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
6 dnl This is free software: you are free to do what the fuck you want to.
7 dnl There is NO WARRANTY, to the extent permitted by law.
8
9 dnl DX_DO(arg, ...)
10 dnl Expand each argument in sequence, inserting newlines between them.
11 AC_DEFUN([DX_DO], [m4_do([$1], [m4_map_args([m4_newline], m4_shift($@))])])
12
13 dnl DX_VAR_NORMALIZE_SPACE(varname)
14 dnl Trim leading and trailing whitespace from a shell variable, and replace
15 dnl consecutive sequences of internal whitespace with a single space.
16 AC_DEFUN([DX_VAR_NORMALIZE_SPACE], [set -f; set x $$1; shift; $1=$[]* set +f])