Introduce support for host config cache
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 20 Jun 2010 13:08:15 +0000 (15:08 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 7 Jul 2010 06:14:41 +0000 (08:14 +0200)
We now have for quite some time a configuration cache used to speed-up
the execution of ./configure scripts when compiling programs for the
target. This commit introduces a similar concept when Buildroot
compiles programs for the host.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile
package/Makefile.autotools.in

index df276c11bbef3cef67ac7f7706f8918f0a7714b7..d6bcb36f01f5b012e53e564dd231a370187fb02a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -441,12 +441,12 @@ show-targets:
        @echo $(TARGETS)
 
 ifeq ($(BR2_CONFIG_CACHE),y)
-# drop configure cache if configuration is changed
-$(BUILD_DIR)/tgt-config.cache: $(CONFIG_DIR)/.config
+# drop configure caches if configuration is changed
+$(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache: $(CONFIG_DIR)/.config
        rm -f $@
        touch $@
 
-$(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache
+$(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache
 endif
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
@@ -580,7 +580,7 @@ endif
        rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.config.cmd $(CONFIG_DIR)/.auto.deps
 
 flush:
-       rm -f $(BUILD_DIR)/tgt-config.cache
+       rm -f $(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache
 
 %_defconfig: $(TOPDIR)/configs/%_defconfig
        cp $^ $(CONFIG_DIR)/.config
index 318bd714ae3c9ef63b1426944d2323a1683d3833..337aee4883e540fe824d8aab2aceaf813563c760 100644 (file)
@@ -117,6 +117,7 @@ define $(2)_CONFIGURE_CMDS
                LDFLAGS="$$(HOST_LDFLAGS)" \
                 $$($$(PKG)_CONF_ENV) \
                ./configure \
+               $$(if $$(filter YES,$$($$(PKG)_USE_CONFIG_CACHE)),--cache-file="$(BUILD_DIR)/host-config.cache",) \
                --prefix="$$(HOST_DIR)/usr" \
                --sysconfdir="$$(HOST_DIR)/etc" \
                $$($$(PKG)_CONF_OPT) \