DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3] mk: allow updates to build config on make install
Date: Tue, 10 Jun 2014 15:51:33 +0200	[thread overview]
Message-ID: <1402408293-19426-1-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <537B3E91.4030400@6wind.com>

From: Bruce Richardson <bruce.richardson@intel.com>

When running "make config", an additional config.orig file is also
generated, which is intended to hold the original, clean configuration
from the template.
When running make install, we first check if there is no existing
.config file, and run make config if not. If there is a file, we then
check if it's unmodified, in which case we regenerate a new .config to
take account of any possible updates to the template. Finally, in the
case where there is an existing .config file, and it HAS been modified,
we then do a check to see if the template has had further updates, and
throw an error if so. If no updates, we continue with the build using
the existing, user-modified config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.sdkconfig.mk  |  1 +
 mk/rte.sdkinstall.mk | 13 +++++++++++++
 2 files changed, 14 insertions(+)

changes in v3:
- typos commented by Olivier
- compatibility with old builds without .orig
- prefix and suffix in tmp path
- remove tmp directory if no conflict

diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index d0692e7..3124dce 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -74,6 +74,7 @@ $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE
 		-o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \
 		if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \
 			cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \
+			cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \
 		fi ; \
 		rm -f $(RTE_OUTPUT)/.config_tmp ; \
 	else \
diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk
index 24b60cf..28eb662 100644
--- a/mk/rte.sdkinstall.mk
+++ b/mk/rte.sdkinstall.mk
@@ -58,6 +58,19 @@ install: $(INSTALL_TARGETS)
 	@echo ================== Installing $*
 	$(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \
 		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
+	elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \
+		$(MAKE) config T=$* O=$(BUILD_DIR)/$*; \
+	else \
+		if [ -f $(BUILD_DIR)/$*/.config.orig ] ; then \
+			tmp_build=/tmp/dpdk-$*-$$$$; \
+			$(MAKE) config T=$* O=$$(tmp_build); \
+			if ! cmp -s $(BUILD_DIR)/$*/.config.orig $$(tmp_build)/.config ; then \
+				echo "Conflict: local config and template config have both changed"; \
+				exit 1; \
+			fi; \
+			rm -rf $$(tmp_build); \
+		fi; \
+		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)/$*
 
-- 
2.0.0

  reply	other threads:[~2014-06-10 13:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 10:22 [dpdk-dev] [PATCH] " Bruce Richardson
2014-05-14 10:33 ` Thomas Monjalon
2014-05-14 10:51   ` Richardson, Bruce
2014-05-14 11:55     ` Thomas Monjalon
2014-05-14 12:33       ` Richardson, Bruce
2014-05-14 12:54         ` Thomas Monjalon
2014-05-14 12:57           ` Richardson, Bruce
2014-05-14 15:55 ` [dpdk-dev] [PATCH v2] " Bruce Richardson
2014-05-20 11:37   ` Olivier MATZ
2014-06-10 13:51     ` Thomas Monjalon [this message]
2014-06-10 16:02       ` [dpdk-dev] [PATCH v3] " Olivier MATZ
2014-06-10 16:29         ` Richardson, Bruce
2014-06-10 16:38           ` [dpdk-dev] [PATCH v4] " Thomas Monjalon
2014-06-10 18:43             ` Richardson, Bruce
2014-06-11  9:54               ` Thomas Monjalon

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=1402408293-19426-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).