From patchwork Tue Mar 10 12:44:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 1252135 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=metanate.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=metanate.com header.i=@metanate.com header.a=rsa-sha256 header.s=stronger header.b=WBc+BH4j; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48cFDv61Khz9sVG for ; Tue, 10 Mar 2020 23:45:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B8AC4885E5; Tue, 10 Mar 2020 12:45:30 +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 MZKdTr0hiG4z; Tue, 10 Mar 2020 12:45:29 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 85ABE885D6; Tue, 10 Mar 2020 12:45:29 +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 98A661BF29F for ; Tue, 10 Mar 2020 12:45:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8FFD886191 for ; Tue, 10 Mar 2020 12:45:26 +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 b8fIk8f3rlU7 for ; Tue, 10 Mar 2020 12:45:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from metanate.com (dougal.metanate.com [90.155.101.14]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 806278618F for ; Tue, 10 Mar 2020 12:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Reply-To: Content-ID:Content-Description; bh=puj0EzAPCSEu4zmMHb+AO30/eWU4y6IUwNfBgvYAeDo=; b=WBc+BH4jloYhf1pGAXAJ+BWpJY zrFBCYU283f+Z2douILhr2RmZiNe74DOZ4zoKDKFt5jabJ92f4uXG+Zmj659kUpXDz+lV7GD2/6Jd 7PczsvxHeDbEpYKVV2y86oA2gVF8WQanHOPU7CEdoZoEHZcVSwS5A6yBUchB21iGvtSKE5Gji4OE0 r4ajRcty2OtwmtQQlxsk7KgLtOqCz5L5E8sCJ9U3ahQIEz35AFS5VFVOH1n6usmBeXMIGtOqzyGXg OUAinrCqA7GOymN+LlR83HaWSEF5aVTKT9iNOj8H1ohlnoMU9KP5LJx1dEc7steUcb4jm+AKsR784 2dRcIvqg==; Received: from johnkeeping.plus.com ([81.174.171.191] helo=donbot.metanate.com) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jBeG9-0003z9-S3; Tue, 10 Mar 2020 12:45:22 +0000 From: John Keeping To: buildroot@buildroot.org Date: Tue, 10 Mar 2020 12:44:58 +0000 Message-Id: <20200310124459.908611-2-john@metanate.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310124459.908611-1-john@metanate.com> References: <20200310124459.908611-1-john@metanate.com> MIME-Version: 1.0 X-Authenticated: YES Subject: [Buildroot] [PATCH 1/2] package/pkg-meson.mk: add FOO_MESON_EXTRA_PROPERTIES 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 , John Keeping , Fabrice Fontaine , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" With autoconf packages, we often specify ac_cv_func_... cached values to avoid runtime checks during configure. With meson the equivalent is setting properties in cross-compilation.conf which we cannot do in Buildroot at the moment. For example, libglib2 used to set ac_cv_func_printf_unix98 and ac_cv_func_vsnprintf_c99 so that the system printf could be used, but with the conversion to meson these checks fail and the gnulib fallback is used. Add infrastructure in the same way as FOO_MESON_EXTRA_BINARIES to allow per-package modification to the cross-compilation properties. Signed-off-by: John Keeping Reviewed-by: Peter Seiderer --- docs/manual/adding-packages-meson.txt | 8 ++++++++ package/pkg-meson.mk | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt index e84bf7f60a..c28828243c 100644 --- a/docs/manual/adding-packages-meson.txt +++ b/docs/manual/adding-packages-meson.txt @@ -116,6 +116,14 @@ will therefore only use a few of them. single quotes. By default, empty. Note that Buildroot already sets the correct values for +c+, +cpp+, +ar+, +strip+, and +pkgconfig+. +* +FOO_MESON_EXTRA_PROPERTIES+, to specify a space-separated list of + properties to add to the `[properties]` section of the meson + `cross-compilation.conf` configuration file. The format is + `property-name='value'`, with no space around the +=+ sign, and with the + value between single quotes. By default, empty. Note that Buildroot + already sets values for +needs_exe_wrapper+, +c_args+, +c_link_args+, + +cpp_args+, +cpp_link_args+, +sys_root+, and +pkg_config_libdir+. + * +FOO_NINJA_ENV+, to specify additional environment variables to pass to +ninja+, meson companion tool in charge of the build operations. By default, empty. diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index 6ac3f79fe9..4df1326cad 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -80,6 +80,10 @@ define $(2)_CONFIGURE_CMDS $$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \ s:$$$$:\n$$(x): ; \ ) }" \ + -e "/^\[properties\]$$$$/ { \ + $$(foreach x,$$($(2)_MESON_EXTRA_PROPERTIES), \ + s:$$$$:\n$$(x): ; \ + ) }" \ package/meson/cross-compilation.conf.in \ > $$($$(PKG)_SRCDIR)/build/cross-compilation.conf PATH=$$(BR_PATH) $$($$(PKG)_CONF_ENV) $$(MESON) \