aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorGravatar Thomas De Schampheleire <patrickdepinguin+buildroot@gmail.com>2013-08-02 11:05:15 +0200
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2013-09-06 23:30:36 +0200
commitd1f325f554cab7912e9221e91aba5b8aa97b1e3c (patch)
tree2432166fbacae86cc78d18a8b782d4680ad69ab1 /support
parentf8d89f051032a8835bdb77edec518e73170006c1 (diff)
downloadbuildroot-d1f325f554cab7912e9221e91aba5b8aa97b1e3c.tar.gz
buildroot-d1f325f554cab7912e9221e91aba5b8aa97b1e3c.tar.bz2
xzcat: treat as host prerequisite and build if needed
If xzcat is not present on the host system, buildroot bails out early asking the developer to install it (xzcat is now a DL_TOOLS_DEPENDENCY) Conversely, when BR2_TARGET_ROOTFS_CPIO_XZ is enabled, then host-xz is a build dependency, and no manual action is required from the developer. Because the second approach is nicer, also build host-xz when xzcat is not available, using the host-prerequisite and suitable-host-pkg mechanisms, already used for tar. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'support')
-rw-r--r--support/dependencies/check-host-xzcat.mk7
-rwxr-xr-xsupport/dependencies/check-host-xzcat.sh14
2 files changed, 21 insertions, 0 deletions
diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk
new file mode 100644
index 0000000000..24286ef5c8
--- /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 0000000000..10f1c4562a
--- /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