diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-27 19:41:11 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-27 19:41:11 +0000 |
commit | 13ef345ce8ccb8d135659bf341c12ad39a688708 (patch) | |
tree | 77d344493fe6f30fe2161bce74dd9b92cf33f14b /m4/fp_capitalize_yes_no.m4 | |
parent | 02372be119bd1a4e7099d2c7d5bb3de096e99409 (diff) | |
download | haskell-13ef345ce8ccb8d135659bf341c12ad39a688708.tar.gz |
Factor our `FP_CAPITALIZE_YES_NO`
This deduplicates converting from yes/no to YES/NO in the configure
scripts while also making it safer.
Diffstat (limited to 'm4/fp_capitalize_yes_no.m4')
-rw-r--r-- | m4/fp_capitalize_yes_no.m4 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/m4/fp_capitalize_yes_no.m4 b/m4/fp_capitalize_yes_no.m4 new file mode 100644 index 0000000000..195729f5d0 --- /dev/null +++ b/m4/fp_capitalize_yes_no.m4 @@ -0,0 +1,13 @@ +# FP_CAPITALIZE_YES_NO(scrutinee, out_var) +# --------------------------------------------------- +# Helper for converting a yes/no to a YES/NO. +# +# $1 = shell expression evaluating to yes/no. +# $2 = name of variable to set wit YES/NO. +AC_DEFUN([FP_CAPITALIZE_YES_NO], +[AS_CASE( + [x$1], + [x"yes"], [$2=YES], + [x"no"], [$2=NO], + [AC_MSG_ERROR([invalid value:] $1 [is not "yes" or "no"])]) +]) |