[dpdk-dev] [PATCH v3] mk: allow updates to build config on make install

2014-06-10 Thread Olivier MATZ
Hi Thomas,

On 06/10/2014 03:51 PM, Thomas Monjalon wrote:
> + 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; \

I missed it the first time, but what do you think about using
$(BUILD_DIR)/$*/.config.tmp instead of /tmp/dpdk-$*-$$ ?
I think using /tmp should be avoided when possible as it is a
shared folder.

Regards,
Olivier



[dpdk-dev] [PATCH v3] mk: allow updates to build config on make install

2014-06-10 Thread Richardson, Bruce
Yes, good point. I'll try and redraft a v3 of the patch (thanks Thomas for 
doing a V2), with that in it. I also think if we keep everything in the build 
dir we should not the rm afterwards. [In my previous tests when doing V1 patch, 
I found that deleting the directory each time seemed to slow things down for 
the next run. I'll test if that is still the case when doing V3]

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Olivier MATZ
> Sent: Tuesday, June 10, 2014 9:03 AM
> To: Thomas Monjalon; dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] mk: allow updates to build config on make
> install
> 
> Hi Thomas,
> 
> On 06/10/2014 03:51 PM, Thomas Monjalon wrote:
> > +   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; \
> 
> I missed it the first time, but what do you think about using
> $(BUILD_DIR)/$*/.config.tmp instead of /tmp/dpdk-$*-$$ ?
> I think using /tmp should be avoided when possible as it is a
> shared folder.
> 
> Regards,
> Olivier



[dpdk-dev] [PATCH v3] mk: allow updates to build config on make install

2014-06-10 Thread Thomas Monjalon
From: Bruce Richardson 

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 
Signed-off-by: Thomas Monjalon 
---
 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