package/pkg-generic: handle host-ccache as a regular dependency
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 24 Mar 2018 14:20:06 +0000 (15:20 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 25 Mar 2018 15:49:05 +0000 (17:49 +0200)
This moves the host-ccache dependency handling from
DEPENDENCIES_HOST_PREREQ to a proper package dependency. When
BR2_CCACHE=y, we add host-ccache as a regular dependency of all
packages except:

 - The extractor packages host-tar, host-xz and host-lzip

 - host-ccache itself

 - host-skeleton, because all packages depend on it

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/ccache/ccache.mk
package/pkg-generic.mk
support/dependencies/dependencies.mk

index 552a611f429117b6a8f6eedfdfdc32344d3c5bfa..9a11d46d30c25c0749e1fc47f99c204664516b80 100644 (file)
@@ -21,6 +21,11 @@ CCACHE_LICENSE_FILES = LICENSE.txt GPL-3.0.txt
 # has zero dependency besides the C library.
 HOST_CCACHE_CONF_OPTS += --with-bundled-zlib
 
+# We are ccache, so we can't use ccache
+HOST_CCACHE_CONF_ENV = \
+       CC="$(HOSTCC_NOCCACHE)" \
+       CXX="$(HOSTCXX_NOCCACHE)"
+
 # Patch host-ccache as follows:
 #  - Use BR_CACHE_DIR instead of CCACHE_DIR, because CCACHE_DIR
 #    is already used by autotargets for the ccache package.
index f03f1d930f770bdb2be50998e0584bb163783e07..bc4882235f1d6e936ef1c208a30b4455852d0a7a 100644 (file)
@@ -567,6 +567,12 @@ ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),)
 $(2)_EXTRACT_DEPENDENCIES += $(BR2_LZIP_HOST_DEPENDENCY)
 endif
 
+ifeq ($(BR2_CCACHE),y)
+ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-ccache,$(1)),)
+$(2)_DEPENDENCIES += host-ccache
+endif
+endif
+
 # Eliminate duplicates in dependencies
 $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES))
 $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES))
index 3fc235863c793afcc4c7e8062ab328265c4893d1..bab064319f9ecb46a053438baeeb4463c41b3e65 100644 (file)
@@ -17,10 +17,6 @@ endef
 include support/dependencies/check-host-tar.mk
 -include $(sort $(filter-out %-tar.mk,$(wildcard support/dependencies/check-host-*.mk)))
 
-ifeq ($(BR2_CCACHE),y)
-DEPENDENCIES_HOST_PREREQ += host-ccache
-endif
-
 core-dependencies:
        @MAKE="$(MAKE)" DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \
                $(TOPDIR)/support/dependencies/dependencies.sh