diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 65ab8c63d..00f1cb31d 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -541,7 +541,11 @@ endif # SITE_METHOD # $(firstword) is used here because the extractor can have arguments, like # ZCAT="gzip -d -c", and to check for the dependency we only want 'gzip'. +# Do not add xzcat to the list of required dependencies, as it gets built +# automatically if it isn't found. +ifneq ($(call suitable-extractor,$($(2)_SOURCE)),$(XZCAT)) DL_TOOLS_DEPENDENCIES += $(firstword $(call suitable-extractor,$($(2)_SOURCE))) +endif endif # $(2)_KCONFIG_VAR endef # inner-generic-package diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk new file mode 100644 index 000000000..24286ef5c --- /dev/null +++ b/support/dependencies/check-host-xzcat.mk @@ -0,0 +1,7 @@ +# XZCAT is taken from BR2_XZCAT (defaults to 'xzcat') (see Makefile) +# If it is not present, build our own host-xzcat + +ifeq (,$(call suitable-host-package,xzcat,$(XZCAT))) + DEPENDENCIES_HOST_PREREQ += host-xz + XZCAT = $(HOST_DIR)/usr/bin/xzcat +endif diff --git a/support/dependencies/check-host-xzcat.sh b/support/dependencies/check-host-xzcat.sh new file mode 100755 index 000000000..10f1c4562 --- /dev/null +++ b/support/dependencies/check-host-xzcat.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +candidate="$1" + +xzcat=`which $candidate 2>/dev/null` +if [ ! -x "$xzcat" ]; then + xzcat=`which xzcat 2>/dev/null` + if [ ! -x "$xzcat" ]; then + # echo nothing: no suitable xzcat found + exit 1 + fi +fi + +echo $xzcat