From patchwork Sun Feb 3 13:40:06 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: 217756 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 EFE2B2C0090 for ; Mon, 4 Feb 2013 00:41:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8C833310AD; Sun, 3 Feb 2013 13:41:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wd9odTv+Zian; Sun, 3 Feb 2013 13:41:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CF8D73102D; Sun, 3 Feb 2013 13:40:45 +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 5087C8F753 for ; Sun, 3 Feb 2013 13:40:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1921384C64 for ; Sun, 3 Feb 2013 13:40:26 +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 YUGQrCC1PlSR for ; Sun, 3 Feb 2013 13:40:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by whitealder.osuosl.org (Postfix) with ESMTPS id 19B6C816D1 for ; Sun, 3 Feb 2013 13:40:23 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id x48so4129962wey.37 for ; Sun, 03 Feb 2013 05:40:22 -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=ccJX+amJT7GRVWtC39p9bvfYHEC9RT7vvyYUDb4eUCg=; b=basl5xImUXoPYJeNSpuMOjEzEkMHhDeYB02AYExFdPL0G7rinlNycvwZrdm7Ii9Y4l ku5RMN3BZTMrZFs9JMROSPFzJEMLwz8jxA4UzK/4U+HZhARbIoje2o1y6727PEgPFqNm J4PgznJuvnqxyHeU6wxx/z5Cnc6TGwJ8ZenS7eEFWDtH+9sJSs5nzfTRaCWawC9r3tyf lJ1+kRQ2TGHn1jRpWKA5puAfl4FBsNzI3whyRFHoEjsUeno/okzF1FbtCkttbKvSqaXq V3wHg8uss1oAbPj+ttjhuQ6wmjf2k9oeuoHWYjzXBsQ6TzvbXwmBvYvMihA8Z8xkGvg2 PuNQ== X-Received: by 10.180.86.36 with SMTP id m4mr5858322wiz.5.1359898822170; Sun, 03 Feb 2013 05:40:22 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-39-23.w90-32.abo.wanadoo.fr. [90.32.22.23]) by mx.google.com with ESMTPS id cu7sm14460785wib.8.2013.02.03.05.40.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 Feb 2013 05:40:21 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 3 Feb 2013 14:40:06 +0100 Message-Id: <0596edb23d8a2b7e04bad60e43e9f7295b9a152d.1359898663.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: "Yann E. MORIN" Subject: [Buildroot] =?utf-8?q?=5BPATCH_6/7=5D_package/dtc=3A_new_package?= 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 a071a5f..f4a331c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -443,6 +443,7 @@ endmenu menu "Hardware handling" source "package/ccid/Config.in" +source "package/dtc/Config.in" source "package/imx-lib/Config.in" source "package/lcdapi/Config.in" source "package/libaio/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))