summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-06-08 13:54:10 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2010-06-22 21:20:27 +0200
commit0802370746a91943ec44cbd67363525f72c873e4 (patch)
tree5c65124ff6d8e9ba5a7d3b244b30db316a7aab7e
parentdc4d5647a528b366d88d4c6f94405c12a1aa0ebf (diff)
downloadbuildroot-novena-0802370746a91943ec44cbd67363525f72c873e4.tar.gz
buildroot-novena-0802370746a91943ec44cbd67363525f72c873e4.zip
Add generic functions to enable/set/disable options in kconfig files
The KCONFIG_ENABLE_OPT, KCONFIG_SET_OPT and KCONFIG_DISABLE_OPT are new make functions to respectively enable, set and disable options in Kconfig-like files (as used by the kernel, uClibc or Busybox). They can be used as follows : $(call KCONFIG_ENABLE_OPT,CONFIG_FOOBAR,/path/to/.config) $(call KCONFIG_SET_OPT,CONFIG_BARFOO,foobar,/path/to/.config) $(call KCONFIG_DISABLE_OPT,CONFIG_FARBOO,/path/to/.config) Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/Makefile.package.in15
1 files changed, 15 insertions, 0 deletions
diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index cdf49f8fe..b702c4988 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -40,6 +40,21 @@ UPPERCASE = $(strip $(eval __tmp := $1) \
$(__tmp)))) \
$(__tmp))
+define KCONFIG_ENABLE_OPT
+ $(SED) "/$(1)/d" $(2)
+ echo "$(1)=y" >> $(2)
+endef
+
+define KCONFIG_SET_OPT
+ $(SED) "/$(1)/d" $(3)
+ echo "$(1)=$(2)" >> $(3)
+endef
+
+define KCONFIG_DISABLE_OPT
+ $(SED) "/$(1)/d" $(2)
+ echo "# $(1) is not set" >> $(2)
+endef
+
# Define extrators for different archive suffixes
INFLATE.bz2 = $(BZCAT)
INFLATE.gz = $(ZCAT)