diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-17 15:11:46 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-07-17 15:11:46 +0200 |
commit | 3c954a94065b3e47329332865f8876bf5a03fd54 (patch) | |
tree | 01a0e22a02c65c5eb7efec7ccf5d6d6d9136594b /build | |
parent | ed089eb92281efc8960d610ed2aea827a01ad14a (diff) |
Add __ifelse__, __foreach__, and __foreach_w__ user-level meta macros
Diffstat (limited to 'build')
-rw-r--r-- | build/meta/common.m4 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build/meta/common.m4 b/build/meta/common.m4 index 4833bf4..b06d272 100644 --- a/build/meta/common.m4 +++ b/build/meta/common.m4 @@ -68,6 +68,23 @@ m4_define([m4_dquote], [m4_changequote([])]) # # +m4_define([__ifelse__], + [m4_equote()m4_ifelse( + [$1], + [$2], + [m4_dquote()$3m4_equote()], + [m4_dquote()$4m4_equote()])[]m4_dquote()]) + +m4_define([__foreach__], + [m4_equote()m4_foreach( + [$1],[$2],[m4_dquote()$3m4_equote()])[]m4_dquote()]) + +m4_define([__foreach_w__], + [m4_equote()m4_foreach_w( + $1,$2,[m4_dquote()$3m4_equote()])[]m4_dquote()]) + +# +# m4_define([__env_impl__], [m4_esyscmd([echo -n $$1])]) m4_define([__env__], [m4_equote()__env_impl__([$1])[]m4_dquote()]) |