From patchwork Tue Mar 14 18:30:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 738868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vjNct6GY0z9s1h for ; Wed, 15 Mar 2017 05:32:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uGScG9sI"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6DA59888CC; Tue, 14 Mar 2017 18:31:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LWCbVTKy4szZ; Tue, 14 Mar 2017 18:31:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id ADA5E88901; Tue, 14 Mar 2017 18:31:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 254851BFCC3 for ; Tue, 14 Mar 2017 18:31:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 203BE898DD for ; Tue, 14 Mar 2017 18:31:36 +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 4s4eltNwpmoX for ; Tue, 14 Mar 2017 18:31:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 99095898D9 for ; Tue, 14 Mar 2017 18:31:35 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id 77so25658041pgc.0 for ; Tue, 14 Mar 2017 11:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1Y48VlAu0tduJbHqk8CveICCOxia4HnRfkPzz+Cx1bw=; b=uGScG9sIrWd4oMfLqZTiM4rPBbiJrDqmR9RVYryiujaJ0ItXaPFylPCEa72k0dbhDq TUbYrDMmZVnvuWMcoGP31rzv8nr8EgDTSCBMiVg25CYWHxNNijTT+ksNhpSGZJdmAXNi CcrTo7s0HfvACQIzkXWzZbhe14oLMMKItdUOrGT3K2HeCjpCTbAAJgjEosmLuLXjlRGJ 6alkdbRb1veZOkl5QlAz5LOArJvuzPOL/uvfjGZK0vwklrOJo59X0JF7Nad/9/7dM0iY nrJwJX4siIqhO4O68MPjIuKW0XzEnxDzficPO2UlucO7P86P2d95Obm41VWOjvY0ivbh igVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1Y48VlAu0tduJbHqk8CveICCOxia4HnRfkPzz+Cx1bw=; b=JfzbalARyTtUAb7li+DloluMaSQDea2TE5B1E5X4p2kBo49HC1/+Z/Tb0wP13Tfh+x EeftEt7a8VVV7a/TAWNsgP/V227OSGH4k1IluSdDavlt+BWzKcGsJwAqCt35eylFysH7 yOvx8aTVrFm3NU/IIf1Lu4KnkOXmpmy3Dx8CMJQI2PBMvBRHdzQMuTJz0lACMP3RRJbi CHd0jHE0c4v6iXkA0OEl+Y8x6lqMlguh6AQIo4QuPl5IKFtwme1CrpaMiTmO/YyMAijb z3ZwAYewA3srRAdF2asMapb5tbQxhmcIcJ8HmvTxiCBXG+bFoD8CZOlhrO7y4Zec6m3O eYPQ== X-Gm-Message-State: AMke39mz8AmjgRTB9ky2ArBwNdmKYQzZUmFQCEpl7eE92R6muXwKr9fMAA8TSCS9Li56UQ== X-Received: by 10.98.88.133 with SMTP id m127mr46062314pfb.155.1489516295286; Tue, 14 Mar 2017 11:31:35 -0700 (PDT) Received: from octofox.metropolis (corp.Cadence.COM. [158.140.1.28]) by smtp.gmail.com with ESMTPSA id e13sm40192470pgn.38.2017.03.14.11.31.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Mar 2017 11:31:34 -0700 (PDT) From: Max Filippov To: buildroot@uclibc.org Date: Tue, 14 Mar 2017 11:30:41 -0700 Message-Id: <1489516252-3803-13-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489516252-3803-1-git-send-email-jcmvbkbc@gmail.com> References: <1489516252-3803-1-git-send-email-jcmvbkbc@gmail.com> Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 12/23] arch/xtensa: add macros to generate hooks X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Yann E. MORIN" These macro generators, one for the target variant, one for the host variant, work like the package macro generators, and generate a post-extract hook. Packages that need the Xtensa overlay can then: - define _ARC_XTENSA_OVERLAY_COMPONENT - $(eval ...) the appropriate macro (target or host). This will allow to keep consistency across all packages that need that overlay, to avoid them diverging again in the future should we need to change the way we handle the Xtensa overlay (like, allowing it to be downloaded). Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Signed-off-by: Max Filippov --- arch/arch.mk.xtensa | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arch.mk.xtensa b/arch/arch.mk.xtensa index 2843333..0377ceb 100644 --- a/arch/arch.mk.xtensa +++ b/arch/arch.mk.xtensa @@ -26,3 +26,33 @@ ARCH_XTENSA_OVERLAY_TAR = $(call qstrip,$(BR2_XTENSA_OVERLAY_DIR))/xtensa_$(ARCH define arch-xtensa-overlay-extract tar xf $(ARCH_XTENSA_OVERLAY_TAR) -C $(1) --strip-components=1 $(2) endef + +################################################################################ +# arch-xtensa-overlay-inner -- generates the make targets needed to extract +# the xtensa overlay +# +# argument 1 is the uppercase package name, including a HOST_ prefix +# for host packages +# +# Packages that call that macro shall define FOO_ARCH_XTENSA_OVERLAY_COMPONENT +# and set it to one of the component to extract, one of: binutils, gcc, gdb. +# +################################################################################ +define arch-xtensa-overlay-inner + +ifneq ($$(ARCH_XTENSA_CORE_NAME),) + +define $(1)_XTENSA_OVERLAY_EXTRACT + $$(call arch-xtensa-overlay-extract,$$(@D),$$($(1)_ARCH_XTENSA_OVERLAY_COMPONENT)) +endef +$(1)_POST_EXTRACT_HOOKS += $(1)_XTENSA_OVERLAY_EXTRACT + +endif # ARCH_XTENSA_CORE_NAME != "" + +endef # arch-xtensa-overlay-inner + +################################################################################ +# arch-xtensa-overlay -- the target generator macro for the Xtensa overlay +################################################################################ +arch-xtensa-overlay = $(call arch-xtensa-overlay-inner,$(call UPPERCASE,$(pkgname))) +host-arch-xtensa-overlay = $(call arch-xtensa-overlay-inner,HOST_$(call UPPERCASE,$(pkgname)))