Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Viktorin <viktorin@rehivetech.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v1 1/2] pkg-utils: Define KCONFIG_ASSERT_OPT macro
Date: Wed, 19 Aug 2015 15:14:35 +0200	[thread overview]
Message-ID: <1439990076-10412-2-git-send-email-viktorin@rehivetech.com> (raw)
In-Reply-To: <1439990076-10412-1-git-send-email-viktorin@rehivetech.com>

The macro can be used (eg. in packages) to assure that
a certain option in the Linux/BusyBox/...'s .config is
set to the given value.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
---
 package/pkg-utils.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 44bd2c9..1e34864 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -63,6 +63,11 @@ define KCONFIG_DISABLE_OPT # (option, file)
 	echo '# $(1) is not set' >> $(2)
 endef
 
+define KCONFIG_ASSERT_OPT # (option, value, file)
+	grep "\\<$(1)\\>=$(2)" $(3) > /dev/null \
+		|| (echo "KCONFIG_ASSERT_OPT($(1),$(2),$(3)) has failed" >&2; exit 1)
+endef
+
 # Helper functions to determine the name of a package and its
 # directory from its makefile directory, using the $(MAKEFILE_LIST)
 # variable provided by make. This is used by the *-package macros to
-- 
2.5.0

  reply	other threads:[~2015-08-19 13:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-17 16:50 [Buildroot] xtables-addons does not build for arm kernel 4.1.4 Jan Viktorin
2015-08-17 21:52 ` Peter Korsgaard
2015-08-17 22:35   ` Jan Viktorin
2015-08-19 13:14   ` [Buildroot] [PATCH v1 0/2] Checking whether a certain CONFIG_* is set Jan Viktorin
2015-08-19 13:14     ` Jan Viktorin [this message]
2015-08-19 19:16       ` [Buildroot] [PATCH v1 1/2] pkg-utils: Define KCONFIG_ASSERT_OPT macro Yann E. MORIN
2015-08-19 13:14     ` [Buildroot] [PATCH v1 2/2] xtables-addons: test CONFIG_MODULES=y in the kernel Jan Viktorin
2015-08-19 17:46     ` [Buildroot] [PATCH v1 0/2] Checking whether a certain CONFIG_* is set Thomas Petazzoni
2015-08-19 19:05       ` Yann E. MORIN
2015-08-19 19:08         ` Thomas Petazzoni
2015-08-19 19:21           ` Yann E. MORIN
2015-08-19 20:23             ` Thomas Petazzoni
2015-08-19 21:05         ` Peter Korsgaard
2015-08-21 13:22           ` Yann E. MORIN
2015-08-21 13:41             ` Jeremy Rosen
2015-08-21 20:28             ` Peter Korsgaard
2015-08-21 21:05               ` Yann E. MORIN
2015-08-21 22:17                 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439990076-10412-2-git-send-email-viktorin@rehivetech.com \
    --to=viktorin@rehivetech.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox