From patchwork Tue Feb 4 16:58:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1233459 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=none (p=none dis=none) header.from=mind.be Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mind.be header.i=@mind.be header.a=rsa-sha256 header.s=google header.b=MulyP5hj; 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 48BrX91R0bz9sWc for ; Wed, 5 Feb 2020 03:59:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E9BDE81B79; Tue, 4 Feb 2020 16:59:33 +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 BeY2NQ2UYnCX; Tue, 4 Feb 2020 16:59:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A2E55813FC; Tue, 4 Feb 2020 16:59:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id CC09F1BF271 for ; Tue, 4 Feb 2020 16:59:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C5B7285AA0 for ; Tue, 4 Feb 2020 16:59:29 +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 vpYzSDI70utg for ; Tue, 4 Feb 2020 16:59:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7737081C82 for ; Tue, 4 Feb 2020 16:59:27 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y11so23995867wrt.6 for ; Tue, 04 Feb 2020 08:59:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8H1cy3kMXza1oLxuxQUyVJTU/lDZrTJv0C2bUTVc7Kk=; b=MulyP5hj2g33GJtdNZ0vokn3U+8uwLatWNfSiPIkYUv3ctMHOjil/14jKRNTP+OL2l qZq9UGgDy5hcHcMWzxhjqpmKfan9nzPcH7BmgqLkUEpDEJo9bTAqyUwlrqylrBJ5I+e3 1zDehX9Yl7Gmm4a4veFmGbyBcGiYPgbU1WXINJUZ0LwKf24cboP+bV1UsLoAOl/SeC9D 1a6nOc/UTHgcqIlPc+0h0bxAdlAuFNMQW1BXKf8cJUVMq61xJ8zg/CbEao16lKd9h2pm ujT49RzYw8nWRCEUZFeawxww1bYbhurAKv7zRhoitYepyIrIk7g0Zc/GHGN5zQmw2hW1 0TAg== 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:mime-version:content-transfer-encoding; bh=8H1cy3kMXza1oLxuxQUyVJTU/lDZrTJv0C2bUTVc7Kk=; b=YymM7Bc2VsxmBqYgCdU5vkmfYVC2ZYz0yKm6Z29/W9YN816NqA6A1nARDOFUA4WUct kRHaldfIxSjBNiyhvJQIjaY464DZ/RaEhZ55xJBmwMlbIlTFDFDQnbOtwybHdb+EABf1 aZswKKb/BeMeKkbwN83x1pOZ1dma6rLoj6EUdI+XY7UkXkWx4TvbpDv0sxHVeARiOdoz qp5SgJl5FVHPD4DrNSWJBeaz+kYrrrqP0QhB6Kj/z6RYkkLinx7I4EVB2XtEDS11FY8x 05e+Vgj59yky3at2PybL0T2IWZp7zmaNWRtFPJ4cv1jY/lieSguqSrZc2TVYpXtXW4OB 8vYQ== X-Gm-Message-State: APjAAAUJppGW4K2nfLONk9JCxptmsEDc0LrI+Wa9jpFN3xYq4rYv0zhc KNuhC53Z9lEeABSLY5iXIiIoEvQAlwY= X-Google-Smtp-Source: APXvYqwWVRaLTwISgMyp1ko1GHnKhtNW9ULjX+zDzAQji3lxRCBcX/UfX1XXj5pubDqMyQdZGq736g== X-Received: by 2002:adf:b310:: with SMTP id j16mr23231788wrd.361.1580835565554; Tue, 04 Feb 2020 08:59:25 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:c6df:61c8:f82e:fd3c]) by smtp.gmail.com with ESMTPSA id q1sm24868558wrw.5.2020.02.04.08.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 08:59:25 -0800 (PST) From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Tue, 4 Feb 2020 17:58:52 +0100 Message-Id: <20200204165852.1819360-3-arnout@mind.be> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200204165852.1819360-1-arnout@mind.be> References: <20200204165852.1819360-1-arnout@mind.be> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] package/pkg-meson.mk: explicitly specify pkg-config settings 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: Adam Duskett Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" meson is able to distinguish between host (= native) and target (= cross) compilation. It will explicitly pass different options to pkg-config to distinguish them. Therefore, we don't need to use the pkg-config wrapper when using meson, and can instead pass the pkg-config settings through the cross-compilation.conf. This is important because in some situations (e.g. for the Python configuration), meson sets the PKG_CONFIG_LIBDIR variable to a different value before calling pkg-config. Relying on our wrapper script doesn't work in that case (except if the script would unconditionally set PKG_CONFIG_LIBDIR, which it doesn't do at the moment). Add the sys_root and pkg_config_lib settings to cross-compilation.conf and use pkgconf directly instead of the wrapper. Note that this requires us to substitute STAGING_DIR as well, with an absolute path. This is not a big deal since cross-compilation.conf is regenerated for every package. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- package/meson/cross-compilation.conf.in | 4 +++- package/pkg-meson.mk | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package/meson/cross-compilation.conf.in b/package/meson/cross-compilation.conf.in index fc8e27f7eb..369e225b3e 100644 --- a/package/meson/cross-compilation.conf.in +++ b/package/meson/cross-compilation.conf.in @@ -8,7 +8,7 @@ c = '@TARGET_CROSS@gcc' cpp = '@TARGET_CROSS@g++' ar = '@TARGET_CROSS@ar' strip = '@TARGET_CROSS@strip' -pkgconfig = '@HOST_DIR@/usr/bin/pkg-config' +pkgconfig = '@HOST_DIR@/bin/pkgconf' [properties] needs_exe_wrapper = true @@ -16,6 +16,8 @@ c_args = [@TARGET_CFLAGS@] c_link_args = [@TARGET_LDFLAGS@] cpp_args = [@TARGET_CXXFLAGS@] cpp_link_args = [@TARGET_LDFLAGS@] +sys_root = '@STAGING_DIR@' +pkg_config_libdir = '@STAGING_DIR@/usr/lib/pkgconfig:@STAGING_DIR@/usr/share/pkgconfig' [host_machine] system = 'linux' diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk index f1a3a69129..6bed2c26d2 100644 --- a/package/pkg-meson.mk +++ b/package/pkg-meson.mk @@ -79,6 +79,7 @@ define $(2)_CONFIGURE_CMDS -e "s%@TARGET_LDFLAGS@%$$(call meson-format-flags,$$($(2)_LDFLAGS))%g" \ -e "s%@TARGET_CXXFLAGS@%$$(call meson-format-flags,$$($(2)_CXXFLAGS))%g" \ -e "s%@HOST_DIR@%$$(HOST_DIR)%g" \ + -e "s%@STAGING_DIR@%$$(STAGING_DIR)%g" \ $$(foreach x,$$($(2)_MESON_EXTRA_BINARIES), \ -e "/^\[binaries\]$$$$/s:$$$$:\n$$(x):" \ ) \ @@ -196,6 +197,7 @@ define PKG_MESON_INSTALL_CROSS_CONF -e "s%@TARGET_LDFLAGS@%$(call meson-format-flags,$(TARGET_LDFLAGS))@PKG_TARGET_CFLAGS@%g" \ -e "s%@TARGET_CXXFLAGS@%$(call meson-format-flags,$(TARGET_CXXFLAGS))@PKG_TARGET_CFLAGS@%g" \ -e "s%@HOST_DIR@%$(HOST_DIR)%g" \ + -e "s%@STAGING_DIR@%$$(STAGING_DIR)%g" \ $(HOST_MESON_PKGDIR)/cross-compilation.conf.in \ > $(HOST_DIR)/etc/meson/cross-compilation.conf.in sed -e "s%@PKG_TARGET_CFLAGS@%%g" \