[Buildroot] [PATCH] crosstool-ng: add dependency to host-lzma if no lzma found

Thomas De Schampheleire patrickdepinguin+buildroot at gmail.com
Fri Oct 7 14:51:48 UTC 2011

Crosstool compilation fails when lzma is not present. If not present on the host
system, we should compile one ourselves.

This patch uses the already existing but seemingly unused check-host-lzma.sh
script in toolchain/dependencies.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>


I think the concept of first checking the host system, and only add a host-foo
dependency if needed is a common one. Therefore, I think we should consider
creating a function for it, something used like:

$(if $(call is-host-package-adequate,foo),,host-foo)

This function would return the path to the existing host package, if any, or
the empty string otherwise. The name for such a function is open for discussion

This mechanism could then be used to check for a recent-enough tar version
(recall from a previous patch series, old tar versions can cause problems when
unpacking archives containing hard-links, if the --strip-components option is

Comments/suggestions are welcome...

diff --git a/package/crosstool-ng/crosstool-ng.mk b/package/crosstool-ng/crosstool-ng.mk
--- a/package/crosstool-ng/crosstool-ng.mk
+++ b/package/crosstool-ng/crosstool-ng.mk
@@ -4,6 +4,6 @@
 CROSSTOOL_NG_MAKE              = $(MAKE1)
-HOST_CROSSTOOL_NG_DEPENDENCIES = host-gawk host-automake $(if $(BR2_CCACHE),host-ccache)
+HOST_CROSSTOOL_NG_DEPENDENCIES = host-gawk host-automake $(if $(BR2_CCACHE),host-ccache) $(if $(shell toolchain/dependencies/check-host-lzma.sh),,host-lzma)
 $(eval $(call AUTOTARGETS,package,crosstool-ng,host))

More information about the buildroot mailing list