From patchwork Tue Jun 11 20:55:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1114211 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f12+dSt2"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Nj2d5txyz9s00 for ; Wed, 12 Jun 2019 06:55:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 141C9204F7; Tue, 11 Jun 2019 20:55:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V76s7r9jdzK0; Tue, 11 Jun 2019 20:55:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D01EB204F0; Tue, 11 Jun 2019 20:55:49 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 74E1C1BF37A for ; Tue, 11 Jun 2019 20:55:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 70F1D84AD2 for ; Tue, 11 Jun 2019 20:55:48 +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 xwpIk2ZlJIuZ for ; Tue, 11 Jun 2019 20:55:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B1948834D0 for ; Tue, 11 Jun 2019 20:55:47 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id e16so14559312wrn.1 for ; Tue, 11 Jun 2019 13:55:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ch64XQy5TBWkFir3BalmeKueOMk11auTtogpmIbgTAQ=; b=f12+dSt2MA1oMf1EsXxqCJzag3fLQ+g/982cEWG58os291D3pGz1wZ53wVUdp6IKkH bC9LOkjBI/V2Nx4TgVC+csYapE130sE+0gGCDSNKOoVcCMljqYgilnyzO8FTPipksicy HjUlzcd/EZLPoa19SHiuRy3f9TXor8dwr/ng61pq17xLkc7r3j+oHJhxC7+HG33dmZ6V Au8ePn+Ts14E+TY+QeOQGvHZd9LyUIX1yCvvZ40YXoEVe5MZrO0YVC/p46qHjg3jnZUe VlJMNGbrUPCpwb9+TzDFPlpRQ3cRUXYdrG2c/WVFiiGkAE8azJytwtrcTA+7aKi7bY4R k8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ch64XQy5TBWkFir3BalmeKueOMk11auTtogpmIbgTAQ=; b=fs11OnqfAOOnkx3OQmDUpyBUBZqTmunAgDfUIDodiIeFMFq+zMMAGg1R88Q4GlElhN gjQxBuoeSClEFLRUZw17GSyM5T4DugJIYXp0ZOXhdRN0MpCnYOZy09/HTAaA0QD7ZJgi iSIVPXdFp30FBNBzK2jBs4Bprb3v/4/snrTsb/JvJ+fVZuBnsjnUyYtiRoXHXoQpjJMY dSKRq1nBkhvNWoJs58dtfQvkIMHAWSBKTQrZh9X2X79uV+XX1j4SniL6BnpsSBYPukl1 zwxMUxvCmunw9noSWiBEii5HnFITy8xw7Z2VEEcTsGfWJOvEo6iCGwMW8B3hOWTqR2Gq WnSA== X-Gm-Message-State: APjAAAVRVueAYJgd+9QHWtMufPmmPVC1RSPjh7eAjk3+lZFWpWmh0Kkp F6SzPL0coHCXpONafaWZLssYgW8D X-Google-Smtp-Source: APXvYqw82S+ILsr5+h3CskybY78U6Q86dmpYKZHwygKDgJ0Nx+WyMSiROmXGgb17dYdYQZII0RV8Ew== X-Received: by 2002:a5d:488a:: with SMTP id g10mr50964877wrq.344.1560286545746; Tue, 11 Jun 2019 13:55:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:cb19:829a:2800:c90f:8064:4fcd:f0ef]) by smtp.gmail.com with ESMTPSA id x129sm5708245wmg.44.2019.06.11.13.55.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 11 Jun 2019 13:55:45 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Tue, 11 Jun 2019 22:55:43 +0200 Message-Id: <4a99ac5f8c5f10cfc9bb20b33423aceca4773fa0.1560286529.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] infra/pkg-meson: allow packages to expand their CFLAGS/CXXFLAGS/LDFLAGS X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , Adam Duskett , "Yann E. MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Some packages will want to pass extra CFLAGS, CXXFLAGS, or LDFLAGS. For example, they may want/have to pass $(TARGET_NLS_LIBS), like libglib2 when the toolchain is based on musl or uClibc (because meson does not have all the necessary infra internally to properly and reliably detect the presence of, or need for linking with, -lintl. Signed-off-by: Yann E. MORIN Cc: Adam Duskett Cc: Eric Le Bihan Acked-by: Adam Duskett --- package/pkg-meson.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index 886fcf7205..8512a3559d 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -49,6 +49,10 @@ $(2)_CONF_ENV ?= $(2)_CONF_OPTS ?= $(2)_NINJA_ENV ?= +$(2)_CFLAGS ?= $$(TARGET_CFLAGS) +$(2)_LDFLAGS ?= $$(TARGET_LDFLAGS) +$(2)_CXXFLAGS ?= $$(TARGET_CXXFLAGS) + # # Configure step. Only define it if not already defined by the package # .mk file. And take care of the differences between host and target @@ -67,9 +71,9 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_ARCH@%$$(HOST_MESON_TARGET_CPU_FAMILY)%g" \ -e "s%@TARGET_CPU@%$$(GCC_TARGET_CPU)%g" \ -e "s%@TARGET_ENDIAN@%$$(call LOWERCASE,$$(BR2_ENDIAN))%g" \ - -e "s%@TARGET_CFLAGS@%$$(HOST_MESON_SED_CFLAGS)%g" \ - -e "s%@TARGET_LDFLAGS@%$$(HOST_MESON_SED_LDFLAGS)%g" \ - -e "s%@TARGET_CXXFLAGS@%$$(HOST_MESON_SED_CXXFLAGS)%g" \ + -e "s%@TARGET_CFLAGS@%$$(if $$($(2)_CFLAGS),`printf '"%s"$$(comma) ' $$($(2)_CFLAGS)`)%g" \ + -e "s%@TARGET_LDFLAGS@%$$(if $$($(2)_LDFLAGS),`printf '"%s"$$(comma) ' $$($(2)_LDFLAGS)`)%g" \ + -e "s%@TARGET_CXXFLAGS@%$$(if $$($(2)_CXXFLAGS),`printf '"%s"$$(comma) ' $$($(2)_CXXFLAGS)`)%g" \ -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \ package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf