From patchwork Sat Feb 9 18:09:44 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: 219421 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 A2A5C2C0089 for ; Sun, 10 Feb 2013 05:11:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 26FF7103AD3; Sat, 9 Feb 2013 18:11:43 +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 6agpFkrX92gT; Sat, 9 Feb 2013 18:11:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 087681007A2; Sat, 9 Feb 2013 18:10:04 +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 613C08F75B for ; Sat, 9 Feb 2013 18:10:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DB5BE87F73 for ; Sat, 9 Feb 2013 18:10:12 +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 QECQNYddbKF9 for ; Sat, 9 Feb 2013 18:10:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6150088305 for ; Sat, 9 Feb 2013 18:10:01 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id hi8so1911777wib.7 for ; Sat, 09 Feb 2013 10:09:59 -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=8Yvhl0Ea7eE2Iq+eOW0B5WB7tQCodZV8Oh5S/kJtvhQ=; b=nY8AfHIQ+64kxMxaWhjfEoFoHR9H268LV30dmO2PgXVT80lDaMC3QPUBZJ8sFYctYX bNEgS6QjUrbIM5pDuQM2ey2po4nVy3wSHDH/oETQ/3qKl2zaVaqdCkTZ/0NiE4ZvW+Xv q9pXY1qfxedbeo2JSSXnJkD8H4htbUYkzjyIMLegmN59KCV6yqwFXmj59wAcw5vf2jYP +DvXH8id4pCeqzi0pUwu5EgtzyFjEdwilcWdGyxjky8V7ho2lvbcSQurA4PPMGYRKsld hJhufHAn2mIjxE0laZTJnhD6OrY4y4Xts9bPjGr0w/eJQ8QHepldZAtiznDjMCUfF/+C G68A== X-Received: by 10.194.86.38 with SMTP id m6mr80834wjz.13.1360433399610; Sat, 09 Feb 2013 10:09:59 -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.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Feb 2013 10:09:58 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sat, 9 Feb 2013 19:09:44 +0100 Message-Id: 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_5/6=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. Signed-off-by: "Yann E. MORIN" Cc: Arnout Vandecappelle --- 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 | 28 +++++++++++++++++++++++ package/dtc/dtc-separate-lib-install.patch | 28 +++++++++++++++++++++++ package/dtc/dtc.mk | 33 ++++++++++++++++++++++++++++ 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 21927ed..ee64241 100644 --- a/package/Config.in +++ b/package/Config.in @@ -442,6 +442,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..3ce699b --- /dev/null +++ b/package/dtc/dtc-extra_cflags.patch @@ -0,0 +1,28 @@ +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) + +Signed-off-by: "Yann E. MORIN" +Cc: Arnout Vandecappelle + +--- +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,8 @@ + 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 ++CFLAGS += -fPIC $(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..f05b09d --- /dev/null +++ b/package/dtc/dtc.mk @@ -0,0 +1,33 @@ +############################################################# +# +# 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) \ + $(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))