From patchwork Sat Feb 9 18:09:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 219422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id CF6882C0089 for ; Sun, 10 Feb 2013 05:12:18 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3C3C91024A6; Sat, 9 Feb 2013 18:12:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QCvbo-DM7BcF; Sat, 9 Feb 2013 18:11:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id A5CCC101DDE; Sat, 9 Feb 2013 18:10:09 +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 5411F8F75B for ; Sat, 9 Feb 2013 18:10:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EAAF084D87 for ; Sat, 9 Feb 2013 18:10:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YCpDXe4Yaf0D for ; Sat, 9 Feb 2013 18:10:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1088F897CB for ; Sat, 9 Feb 2013 18:10:02 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id ez12so1916211wid.0 for ; Sat, 09 Feb 2013 10:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=//S1bwQVpgND9QIItFgS9gpT8G5DRMZ/exZZedPWlNU=; b=baSiNvuoGRj+kJ3yoo1pLUYXP8/pzlueqy4e+3KoqzyVYTBjdUG1L9HoebtSXbCIXN 8I1sv6aSV64YxLuMgjbVEYT3bGmWePjYHJPaWTHfUEo+6Fc1W4OibIf+POpnkRXBm8tr 6QbDIVuH4w0BfoCvgcqOJtqOlQok8vhjYT7ufl7eOdc8+TisbcYdeSjKKIJbLGVrpA3W LNyLV8jLRbOrR0QLtEW89bgZNOjwK2vc1wmC9jJBsAMJRtypxi+sa2vmYImIOB0dzL1x FfUh33ZlY01TebCp1Wtow22V48WKfGE4D7iudcGbR7z3vxiKpWwRw0stX07QIQNETLqB O0Dw== X-Received: by 10.194.83.97 with SMTP id p1mr15939228wjy.17.1360433401170; Sat, 09 Feb 2013 10:10:01 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-68-181.w90-32.abo.wanadoo.fr. [90.32.147.181]) by mx.google.com with ESMTPS id s10sm22424845wiw.4.2013.02.09.10.09.59 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 10:10:00 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sat, 9 Feb 2013 19:09:45 +0100 Message-Id: <6c75f1ead9d7711b6ca83c49e87a0cf705997d57.1360433324.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] =?utf-8?q?=5BPATCH_6/6=5D_package/dtc=3A_add_option_t?= =?utf-8?q?o_install_programs?= 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 By default, we only install the libfdt library. As suggested by Arnout, add an option that also installs the few dtc programs. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle --- dtdiff, a diff for device trees, requires bash. I did not add a 'depends on bash' (or a 'select' either), because requiring bash just for that is a bit far-fetched. Instead, at dtc install time, if bash is selected, dtdiff is installed as usual to the target rootfs; if bash is not selected, dtdiff is removed from the target rootfs. --- package/dtc/Config.in | 28 ++++++++++++++++++++++++++-- package/dtc/dtc.mk | 35 +++++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 8 deletions(-) diff --git a/package/dtc/Config.in b/package/dtc/Config.in index 96225e3..4b10556 100644 --- a/package/dtc/Config.in +++ b/package/dtc/Config.in @@ -1,9 +1,33 @@ config BR2_PACKAGE_DTC - bool "dtc" + bool "dtc (libfdt)" help The Device Tree Compiler, dtc, takes as input a device-tree in a given format and outputs a device-tree in another format. - Note that only the library is installed for now. + Note that only the library is installed. + If you want the programs, say 'y' here, and to "dtc programs", below. http://git.jdl.com/gitweb/?p=dtc.git (no home page) + +if BR2_PACKAGE_DTC + +config BR2_PACKAGE_DTC_PROGRAMS + bool "dtc programs" + help + Say 'y' here if you also want the programs on the target: + - convert-dtsv0 convert from version 0 to version 1 + - dtc the device tree compiler + - dtdiff compare two device trees (needs bash) + - fdtdump print a readable version of a flat device tree + - fdtget read values from device tree + - fdtput write a property value to a device tree + + Note: dtdiff requires bash, so if bash is not selected, dtdiff will + be removed from the target file system. Enable bash if you + need dtdiff on the target. + +comment "dtdiff will not be installed: it requires bash" + depends on BR2_PACKAGE_DTC_PROGRAMS + depends on !BR2_PACKAGE_BASH + +endif diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk index f05b09d..76ff361 100644 --- a/package/dtc/dtc.mk +++ b/package/dtc/dtc.mk @@ -8,26 +8,49 @@ DTC_VERSION = e4b497f367a3b2ae99cc52089a14a221b13a76ef DTC_SITE = git://git.jdl.com/software/dtc.git DTC_LICENSE = GPLv2+/BSD-2c DTC_LICENSE_FILES = README.license GPL -# Note: the dual-license only applies to the library. -# The DT compiler (dtc) is GPLv2+, but we do not install it. DTC_INSTALL_STAGING = YES +define DTC_POST_INSTALL_TARGET_RM_DTDIFF + rm -f $(TARGET_DIR)/usr/bin/dtdiff +endef + +ifeq ($(BR2_PACKAGE_DTC_PROGRAMS),y) + +DTC_LICENSE += (for the library), GPLv2+ (for the executables) +# Use default goal to build everything +DTC_BUILD_GOAL = +DTC_INSTALL_GOAL = install +DTC_CLEAN_GOAL = clean +ifeq ($(BR2_PACKAGE_BASH),) +DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF +endif + +else # $(BR2_PACKAGE_DTC_PROGRAMS) != y + +DTC_BUILD_GOAL = libfdt +# libfdt_install is our own install rule added by our patch +DTC_INSTALL_GOAL = libfdt_install +DTC_CLEAN_GOAL = libfdt_clean + +endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y + define DTC_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) \ - $(MAKE) -C $(@D) PREFIX=/usr libfdt + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) -C $(@D) PREFIX=/usr $(DTC_BUILD_GOAL) endef -# libfdt_install is our own install rule added by our patch +# For staging, only the library is needed define DTC_INSTALL_STAGING_CMDS $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr libfdt_install endef define DTC_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr libfdt_install + $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr $(DTC_INSTALL_GOAL) endef define DTC_CLEAN_CMDS - $(MAKE) -C $(@D) libfdt_clean + $(MAKE) -C $(@D) $(DTC_CLEAN_GOAL) endef $(eval $(generic-package))