From patchwork Wed Nov 28 23:54:01 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: 202586 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 C93A02C0080 for ; Thu, 29 Nov 2012 10:56:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 768C5A01F8; Wed, 28 Nov 2012 23:56:52 +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 jkLqfHdoOAP9; Wed, 28 Nov 2012 23:56:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id CE0B4A0214; Wed, 28 Nov 2012 23:56:01 +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 230EA8F74A for ; Wed, 28 Nov 2012 23:55:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0C5FF8AA95 for ; Wed, 28 Nov 2012 23:55:34 +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 EJK7V2thu7Bh for ; Wed, 28 Nov 2012 23:55:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 72ECD8A9BE for ; Wed, 28 Nov 2012 23:55:12 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id hm2so4574053wib.10 for ; Wed, 28 Nov 2012 15:55:10 -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=0NWG0ZysCZA+/kyoZbvbzFviIJOqg+6oV/WBjRRODMs=; b=Wh0ilUZiGOwE88N0cU1sqZAGKI810IAhDMQ2WPdExmQvkKTV6sTL0qhSZxynVwgD1Z P3QwDMX3WI66egZHDuxRrX7oOJbiHIk9y0q/XUTlvgc3Bbpg5lkWFt2qavTGSDNMZ+X9 ZYTjmOHH+ZUMvFyzBGOOHWX5QRuTlHjB6Ai2RycpQWVp+5hqrGbP13fCd0TvR9CwuLZz sA5+AkkWaI7B6Ns+TiuH33mLfs3GjG0GNRtD4jRwrYP/lm30t8/IVfiCNADIaij/hvaS owhnXv3AfZttubeOS6NRewsINMaFycjWWJShTjyVGMsSUQRMsFrRAuG2vahpdcwPitLO zibQ== Received: by 10.216.204.17 with SMTP id g17mr7791238weo.147.1354146910630; Wed, 28 Nov 2012 15:55:10 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-141-45.w90-32.abo.wanadoo.fr. [90.32.252.45]) by mx.google.com with ESMTPS id i6sm9076156wix.5.2012.11.28.15.55.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 15:55:10 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Thu, 29 Nov 2012 00:54:01 +0100 Message-Id: <1354146890-27380-3-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1354146890-27380-1-git-send-email-yann.morin.1998@free.fr> References: <1354146890-27380-1-git-send-email-yann.morin.1998@free.fr> MIME-Version: 1.0 Cc: "Yann E. MORIN" Subject: [Buildroot] =?utf-8?q?=5BPATCH_02/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 5d9783a..738ffd5 100644 --- a/package/Config.in +++ b/package/Config.in @@ -405,6 +405,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))