ソースを参照

package/pkg-generic.mk: add variable to skip ccache dependency

As more and more packages are required to build the host ccache package
and therefore they has to be filtered out for ccache dependency the list
growed up.

By adding the variable <PKG>_ADD_CCACHE_DEPENDENCY with the default
value to 'yes' we can remove that dependency for each package that is
needed by ccache by setting the value to 'no'. This can be done  in the
package makefile instead of tracking the list in the core pkg-generic.mk file.

This behavior is similar to the skeleton and toolchain dependency.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
[Arnout: move the BR2_CCACHE condition to the dependency itself]
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Heiko Thiery 1 年間 前
コミット
23c21c6f29

+ 3 - 0
package/blake3/blake3.mk

@@ -10,6 +10,9 @@ BLAKE3_SUBDIR = c
 BLAKE3_LICENSE = Apache-2.0, CC0-1.0
 BLAKE3_LICENSE_FILES = LICENSE
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_BLAKE3_ADD_CCACHE_DEPENDENCY = NO
+
 # We may be a ccache dependency, so we can't use ccache; reset the
 # options set by the cmake infra.
 HOST_BLAKE3_CONF_OPTS += \

+ 4 - 0
package/ccache/ccache.mk

@@ -9,6 +9,10 @@ CCACHE_SITE = https://github.com/ccache/ccache/releases/download/v$(CCACHE_VERSI
 CCACHE_SOURCE = ccache-$(CCACHE_VERSION).tar.xz
 CCACHE_LICENSE = GPL-3.0+, others
 CCACHE_LICENSE_FILES = LICENSE.adoc GPL-3.0.txt
+
+# Do not add a recursive dependency to its own
+HOST_CCACHE_ADD_CCACHE_DEPENDENCY = NO
+
 HOST_CCACHE_DEPENDENCIES = host-hiredis host-zstd host-xxhash host-blake3
 
 # We are ccache, so we can't use ccache

+ 3 - 0
package/cmake/cmake.mk

@@ -14,6 +14,9 @@ CMAKE_CPE_ID_VALID = YES
 # Tool download MITM attack warning if using npm package to install cmake
 CMAKE_IGNORE_CVES = CVE-2016-10642
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_CMAKE_ADD_CCACHE_DEPENDENCY = NO
+
 # CMake is a particular package:
 # * CMake can be built using the generic infrastructure or the cmake one.
 #   Since Buildroot has no requirement regarding the host system cmake

+ 3 - 0
package/fakedate/fakedate.mk

@@ -7,6 +7,9 @@
 # source included in buildroot
 HOST_FAKEDATE_LICENSE = GPL-2.0+
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_FAKEDATE_ADD_CCACHE_DEPENDENCY = NO
+
 define HOST_FAKEDATE_INSTALL_CMDS
 	$(INSTALL) -D -m 755 package/fakedate/fakedate $(HOST_DIR)/bin/date
 endef

+ 3 - 0
package/hiredis/hiredis.mk

@@ -12,6 +12,9 @@ HIREDIS_LICENSE_FILES = COPYING
 HIREDIS_CPE_ID_VENDOR = redislabs
 HIREDIS_INSTALL_STAGING = YES
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_HIREDIS_ADD_CCACHE_DEPENDENCY = NO
+
 HIREDIS_CONF_OPTS = -DENABLE_NUGET=OFF -DDISABLE_TESTS=ON
 HOST_HIREDIS_CONF_OPTS = -DENABLE_NUGET=OFF -DDISABLE_TESTS=ON -DENABLE_SSL=OFF
 

+ 3 - 0
package/lzip/lzip.mk

@@ -9,6 +9,9 @@ LZIP_SITE = http://download.savannah.gnu.org/releases/lzip
 LZIP_LICENSE = GPL-2.0+
 LZIP_LICENSE_FILES = COPYING
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_LZIP_ADD_CCACHE_DEPENDENCY = NO
+
 define LZIP_CONFIGURE_CMDS
 	(cd $(@D); $(TARGET_MAKE_ENV) ./configure --prefix=/usr \
 		$(TARGET_CONFIGURE_OPTS) )

+ 5 - 6
package/pkg-generic.mk

@@ -761,6 +761,7 @@ endif # ifeq ($$($(2)_CPE_ID_VALID),YES)
 # Similarly for the skeleton.
 $(2)_ADD_TOOLCHAIN_DEPENDENCY	?= YES
 $(2)_ADD_SKELETON_DEPENDENCY	?= YES
+$(2)_ADD_CCACHE_DEPENDENCY	?= YES
 
 
 ifeq ($(4),target)
@@ -772,6 +773,10 @@ $(2)_DEPENDENCIES += toolchain
 endif
 endif
 
+ifeq ($$(BR2_CCACHE):$$($(2)_ADD_CCACHE_DEPENDENCY),y:YES)
+$(2)_DEPENDENCIES += host-ccache
+endif
+
 ifneq ($(1),host-skeleton)
 $(2)_DEPENDENCIES += host-skeleton
 endif
@@ -792,12 +797,6 @@ $(2)_EXTRACT_DEPENDENCIES += \
 		$$(call extractor-pkg-dependency,$$(notdir $$(dl))))
 endif
 
-ifeq ($$(BR2_CCACHE),y)
-ifeq ($$(filter host-tar host-skeleton host-xz host-lzip host-fakedate host-ccache host-cmake host-hiredis host-pkgconf host-zstd host-xxhash host-blake3,$(1)),)
-$(2)_DEPENDENCIES += host-ccache
-endif
-endif
-
 ifeq ($$(BR2_REPRODUCIBLE),y)
 ifeq ($$(filter host-skeleton host-fakedate,$(1)),)
 $(2)_DEPENDENCIES += host-fakedate

+ 3 - 0
package/pkgconf/pkgconf.mk

@@ -11,6 +11,9 @@ PKGCONF_LICENSE = pkgconf license
 PKGCONF_LICENSE_FILES = COPYING
 PKGCONF_CPE_ID_VENDOR = pkgconf
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_PKGCONF_ADD_CCACHE_DEPENDENCY = NO
+
 # We are a ccache dependency, so we can't use ccache
 HOST_PKGCONF_CONF_ENV = \
 	CC="$(HOSTCC_NOCCACHE)" \

+ 3 - 0
package/skeleton/skeleton.mk

@@ -11,6 +11,9 @@
 SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO
 SKELETON_ADD_SKELETON_DEPENDENCY = NO
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_SKELETON_ADD_CCACHE_DEPENDENCY = NO
+
 # Although the $(HOST_DIR)/usr symlink is mostly for backward compatibility,
 # there are weird packages that still require it (see host-systemd, and
 # commit 35c11a027c88).

+ 3 - 0
package/tar/tar.mk

@@ -13,6 +13,9 @@ TAR_CPE_ID_VENDOR = gnu
 TAR_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
 TAR_CONF_ENV = LIBS=$(TARGET_NLS_LIBS)
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_TAR_ADD_CCACHE_DEPENDENCY = NO
+
 # busybox installs in /bin, so we need tar to install as well in /bin
 # so that we don't end up with two different tar
 #

+ 3 - 0
package/xxhash/xxhash.mk

@@ -10,6 +10,9 @@ XXHASH_LICENSE = BSD-2-Clause (library), GPL-2.0+ (xxhsum)
 XXHASH_LICENSE_FILES = LICENSE cli/COPYING
 XXHASH_INSTALL_STAGING = YES
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_XXHASH_ADD_CCACHE_DEPENDENCY = NO
+
 XXHASH_TARGETS = xxhsum libxxhash.pc
 XXHASH_INSTALL_TARGETS = \
 	install_libxxhash.includes \

+ 3 - 0
package/xz/xz.mk

@@ -13,6 +13,9 @@ XZ_LICENSE = Public Domain, BSD-0-Clause, GPL-2.0+, GPL-3.0+, LGPL-2.1+
 XZ_LICENSE_FILES = COPYING COPYING.0BSD COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1
 XZ_CPE_ID_VENDOR = tukaani
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_XZ_ADD_CCACHE_DEPENDENCY = NO
+
 XZ_CONF_OPTS = \
 	--enable-encoders=lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv \
 	--enable-decoders=lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv \

+ 3 - 0
package/zstd/zstd.mk

@@ -12,6 +12,9 @@ ZSTD_LICENSE_FILES = LICENSE COPYING
 ZSTD_CPE_ID_VENDOR = facebook
 ZSTD_CPE_ID_PRODUCT = zstandard
 
+# The package is a dependency to ccache so ccache cannot be a dependency
+HOST_ZSTD_ADD_CCACHE_DEPENDENCY = NO
+
 ZSTD_OPTS += PREFIX=/usr
 ZSTD_OPTS += ZSTD_LEGACY_SUPPORT=0
 ifeq ($(BR2_PACKAGE_ZLIB),y)