From patchwork Fri Jul 19 11:46:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 260246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 61C682C008A for ; Fri, 19 Jul 2013 21:47:03 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 098FA26DC5; Fri, 19 Jul 2013 11:47:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cj6ReISict3E; Fri, 19 Jul 2013 11:47:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E802F273A1; Fri, 19 Jul 2013 11:47:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4DB701C4584 for ; Fri, 19 Jul 2013 11:47:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 26F9D8B83E for ; Fri, 19 Jul 2013 11:47:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Fmh+oIXv-7Mj for ; Fri, 19 Jul 2013 11:46:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by whitealder.osuosl.org (Postfix) with ESMTPS id 33D018B7D3 for ; Fri, 19 Jul 2013 11:46:59 +0000 (UTC) Received: by mail-ea0-f182.google.com with SMTP id d10so2343541eaj.27 for ; Fri, 19 Jul 2013 04:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to; bh=OVoROrQwy6BYzF3otmOhrT2ESzqhuhZcuqSy19go0EE=; b=0rqeKrXnCnotucuk8SrTLGHBDqLTbuJLex0AA+f3nCjQvq/SPpwZDBY7p2tvhHAw/k Hn2LoLB/axXRbNA2bVM8DpLj1/kolzDijDB92kKduOfbHUCGnyzwF0/T0e9lyuQIc05c MBT6XCE8kkf2pPJxKW128jdQRjdOxq3GGGZQpdD0q5bgCdbheNa+2ji19UuzVGzhKjiP nMJvpppuwhi+JHxCyHZSUvq9MdZNUWIYHlvjdUUKwI2wN542ZKAQM4EIscnexzuezky1 WE8Wf0eIYykIaLD3fcNd/vVuOj5W2D/9xR8/Z7rqtrsDBx78BHI7CmbetVcbuYNxmYmx 90ug== X-Received: by 10.15.100.195 with SMTP id bn43mr15133200eeb.153.1374234417475; Fri, 19 Jul 2013 04:46:57 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id p49sm26859200eeu.2.2013.07.19.04.46.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Jul 2013 04:46:56 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 30d579ff97c4fb7e76b35ab5eb7c88a46f7ede19 Message-Id: <30d579ff97c4fb7e76b3.1374234389@BEANTN0L019720> User-Agent: Mercurial-patchbomb/2.2.2 Date: Fri, 19 Jul 2013 13:46:29 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH] xzcat: treat as host prerequisite and build if needed X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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 --- support/dependencies/check-host-xzcat.mk | 7 +++++++ support/dependencies/check-host-xzcat.sh | 14 ++++++++++++++ support/dependencies/dependencies.mk | 4 +++- 3 files changed, 24 insertions(+), 1 deletions(-) diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk new file mode 100644 --- /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 --- /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 diff --git a/support/dependencies/dependencies.mk b/support/dependencies/dependencies.mk --- a/support/dependencies/dependencies.mk +++ b/support/dependencies/dependencies.mk @@ -20,9 +20,11 @@ ifeq ($(BR2_STRIP_sstrip),y) DEPENDENCIES_HOST_PREREQ+=host-sstrip endif +# Filter out XZCAT from download tools as this is already handled as host +# prerequisite and will be built if needed. core-dependencies: @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \ - DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \ + DL_TOOLS="$(sort $(filter-out $(XZCAT),$(DL_TOOLS_DEPENDENCIES)))" \ $(TOPDIR)/support/dependencies/dependencies.sh dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ)