Introduce support for host config cache

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>
This commit is contained in:
Thomas Petazzoni 2010-06-20 15:08:15 +02:00
parent 0ab16a01bb
commit 26082e79af
2 changed files with 5 additions and 4 deletions

View File

@ -441,12 +441,12 @@ show-targets:
@echo $(TARGETS) @echo $(TARGETS)
ifeq ($(BR2_CONFIG_CACHE),y) ifeq ($(BR2_CONFIG_CACHE),y)
# drop configure cache if configuration is changed # drop configure caches if configuration is changed
$(BUILD_DIR)/tgt-config.cache: $(CONFIG_DIR)/.config $(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache: $(CONFIG_DIR)/.config
rm -f $@ rm -f $@
touch $@ touch $@
$(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache $(BASE_TARGETS): | $(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache
endif endif
else # ifeq ($(BR2_HAVE_DOT_CONFIG),y) 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 rm -rf $(CONFIG_DIR)/.config $(CONFIG_DIR)/.config.old $(CONFIG_DIR)/.config.cmd $(CONFIG_DIR)/.auto.deps
flush: flush:
rm -f $(BUILD_DIR)/tgt-config.cache rm -f $(BUILD_DIR)/tgt-config.cache $(BUILD_DIR)/host-config.cache
%_defconfig: $(TOPDIR)/configs/%_defconfig %_defconfig: $(TOPDIR)/configs/%_defconfig
cp $^ $(CONFIG_DIR)/.config cp $^ $(CONFIG_DIR)/.config

View File

@ -117,6 +117,7 @@ define $(2)_CONFIGURE_CMDS
LDFLAGS="$$(HOST_LDFLAGS)" \ LDFLAGS="$$(HOST_LDFLAGS)" \
$$($$(PKG)_CONF_ENV) \ $$($$(PKG)_CONF_ENV) \
./configure \ ./configure \
$$(if $$(filter YES,$$($$(PKG)_USE_CONFIG_CACHE)),--cache-file="$(BUILD_DIR)/host-config.cache",) \
--prefix="$$(HOST_DIR)/usr" \ --prefix="$$(HOST_DIR)/usr" \
--sysconfdir="$$(HOST_DIR)/etc" \ --sysconfdir="$$(HOST_DIR)/etc" \
$$($$(PKG)_CONF_OPT) \ $$($$(PKG)_CONF_OPT) \