summaryrefslogtreecommitdiff
path: root/libc/option-groups.mak
diff options
context:
space:
mode:
Diffstat (limited to 'libc/option-groups.mak')
-rw-r--r--libc/option-groups.mak10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/option-groups.mak b/libc/option-groups.mak
index 2ade410a7..7d9f9a43e 100644
--- a/libc/option-groups.mak
+++ b/libc/option-groups.mak
@@ -15,6 +15,16 @@ include $(firstword $(..) ../)option-groups.defaults
# defaults from option-groups.defaults.
-include $(option_group_config_file)
+# $(call option-disabled, VAR) is 'y' if VAR is not 'y', or 'n' otherwise.
+# VAR should be a variable name, not a variable reference; this is
+# less general, but more terse for the intended use.
+# You can use it to add a file to a list if an option group is
+# disabled, like this:
+# routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += ...
+define option-disabled
+$(firstword $(subst y,n,$(filter y,$($(strip $(1))))) y)
+endef
+
# Establish 'routines-y', etc. as simply-expanded variables.
aux-y :=
extra-libs-others-y :=