From patchwork Sun Dec 9 16:35:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 204752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 8118B2C01FD for ; Mon, 10 Dec 2012 03:41:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 432B4A028F; Sun, 9 Dec 2012 16:41:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KKpv6KuRd3uj; Sun, 9 Dec 2012 16:41:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id C83FEA015E; Sun, 9 Dec 2012 16:37:48 +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 7E4B08F74B for ; Sun, 9 Dec 2012 16:36:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 67B91888C5 for ; Sun, 9 Dec 2012 16:36:29 +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 I0mF9-pHz5M4 for ; Sun, 9 Dec 2012 16:36:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id AD03681BA8 for ; Sun, 9 Dec 2012 16:36:27 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id e12so1029776wge.10 for ; Sun, 09 Dec 2012 08:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=w2yuc2JGLKq9cbmoeWLlX2o3kz2EiIXCC9ZABfyuHOc=; b=x3l150IGnPZynRfYgABDXOerW5/L0syrOeTL+cVM27GsABq6cCplbqWx/PUTpkmhIJ wcmMIbyixgYogdauS6IeBSCinyy/iuh++4yBqFfceeTwCsoLwc+UMoY62AiyKPLZwOkk Q0Zd0MAZhxphh4edDMRpd9fm7v187SIgM4rHYoa5EvC85Ka5Na1EmN558GOtguuefM48 uiVMmRiYm4ivWaQr8Hq4tiha7jlmL1k7dIPrl8ovEDLljA5CtVRT88fhOmNs9vx95fbx KG4iwG7YSmwrC4uvDHhjcvWQcHEutGf/E2RnO9caHlon0KgBh2hBQjEYW16Y3QBaj0qS jHeg== Received: by 10.180.97.137 with SMTP id ea9mr6949610wib.13.1355070987000; Sun, 09 Dec 2012 08:36:27 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-76-30.w90-32.abo.wanadoo.fr. [90.32.155.30]) by mx.google.com with ESMTPS id fv2sm6587947wib.4.2012.12.09.08.36.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 08:36:26 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 9 Dec 2012 17:35:22 +0100 Message-Id: <1355070924-8009-50-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1355070924-8009-1-git-send-email-yann.morin.1998@free.fr> References: <1355070924-8009-1-git-send-email-yann.morin.1998@free.fr> MIME-Version: 1.0 Cc: "Yann E. MORIN" Subject: [Buildroot] =?utf-8?q?=5BPATCH_49/51=5D_package/dtc=3A_new_packag?= =?utf-8?q?e?= 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 dtc is the Device Tree Compiler, and manipulates device trees. Cc: Arnout Vandecappelle Signed-off-by: "Yann E. MORIN" --- Although Arnout suggested to move it out of the libraries sub-menu, I kept it there, as by default, only the library is installed, like it is done for, eg., libcurl. --- package/Config.in | 1 + package/dtc/Config.in | 9 +++++++ package/dtc/dtc-extra_cflags.patch | 27 ++++++++++++++++++++++ package/dtc/dtc-separate-lib-install.patch | 28 +++++++++++++++++++++++ package/dtc/dtc.mk | 34 ++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 0 deletions(-) create mode 100644 package/dtc/Config.in create mode 100644 package/dtc/dtc-extra_cflags.patch create mode 100644 package/dtc/dtc-separate-lib-install.patch create mode 100644 package/dtc/dtc.mk diff --git a/package/Config.in b/package/Config.in index dd4cbda..1a70ab9 100644 --- a/package/Config.in +++ b/package/Config.in @@ -412,6 +412,7 @@ endmenu menu "Hardware handling" source "package/ccid/Config.in" +source "package/dtc/Config.in" source "package/lcdapi/Config.in" source "package/libaio/Config.in" source "package/libraw1394/Config.in" diff --git a/package/dtc/Config.in b/package/dtc/Config.in new file mode 100644 index 0000000..96225e3 --- /dev/null +++ b/package/dtc/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_DTC + bool "dtc" + 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. + + http://git.jdl.com/gitweb/?p=dtc.git (no home page) diff --git a/package/dtc/dtc-extra_cflags.patch b/package/dtc/dtc-extra_cflags.patch new file mode 100644 index 0000000..9d1882b --- /dev/null +++ b/package/dtc/dtc-extra_cflags.patch @@ -0,0 +1,27 @@ +Makefile: append the CFLAGS to existing ones + +Allow the user to pass custom CFLAGS (eg. optimisation flags). + +Do not use EXTRA_CFLAGS, append to existing CFLAGS with += (Arnout) + +Cc: Arnout Vandecappelle +Signed-off-by: "Yann E. MORIN" + +--- +Patch not sent upstream. + +Although not specific to buildroot, I am not sure this is the best +way to handle user-supplied CFLAGS. + +diff -durN dtc-e4b497f367a3b2ae99cc52089a14a221b13a76ef.orig/Makefile dtc-e4b497f367a3b2ae99cc52089a14a221b13a76ef/Makefile +--- dtc-e4b497f367a3b2ae99cc52089a14a221b13a76ef.orig/Makefile 2012-10-22 22:02:47.541240846 +0200 ++++ dtc-e4b497f367a3b2ae99cc52089a14a221b13a76ef/Makefile 2012-10-22 22:03:21.151047833 +0200 +@@ -18,7 +18,7 @@ + CPPFLAGS = -I libfdt -I . + WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \ + -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls +-CFLAGS = -g -Os -fPIC -Werror $(WARNINGS) ++CFLAGS += -g -Os -fPIC -Werror $(WARNINGS) + + BISON = bison + LEX = flex diff --git a/package/dtc/dtc-separate-lib-install.patch b/package/dtc/dtc-separate-lib-install.patch new file mode 100644 index 0000000..c86d587 --- /dev/null +++ b/package/dtc/dtc-separate-lib-install.patch @@ -0,0 +1,28 @@ +Makefile: add a rule to only install libfdt + +Signed-off-by: "Yann E. MORIN" + +--- +Patch not sent upstream. + +It's really specific to buildroot, and is probably not +good (aka generic) enough to be pushed upstream. + +diff --git a/Makefile b/Makefile +index 1169e6c..39e7190 100644 +--- a/Makefile ++++ b/Makefile +@@ -160,10 +160,12 @@ endif + # intermediate target and building them again "for real" + .SECONDARY: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS) + +-install: all $(SCRIPTS) ++install: all $(SCRIPTS) libfdt_install + @$(VECHO) INSTALL + $(INSTALL) -d $(DESTDIR)$(BINDIR) + $(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR) ++ ++libfdt_install: libfdt + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR) + ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname) diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk new file mode 100644 index 0000000..a0e1e35 --- /dev/null +++ b/package/dtc/dtc.mk @@ -0,0 +1,34 @@ +############################################################# +# +# dtc +# +############################################################# + +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_BUILD_CMDS + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + $(MAKE) -C $(@D) PREFIX=/usr libfdt +endef + +# libfdt_install is our own install rule added by our patch +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 +endef + +define DTC_CLEAN_CMDS + $(MAKE) -C $(@D) libfdt_clean +endef + +$(eval $(generic-package))