From patchwork Tue Oct 1 12:41:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preston X-Patchwork-Id: 1169886 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.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=codethink.co.uk Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jJn41j1mz9s7T for ; Tue, 1 Oct 2019 22:42:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8E3CF83F07; Tue, 1 Oct 2019 12:41:58 +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 JMjWfp1H_S0Q; Tue, 1 Oct 2019 12:41:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id EFD8A85C37; Tue, 1 Oct 2019 12:41:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C80031BF348 for ; Tue, 1 Oct 2019 12:41:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B1A8020533 for ; Tue, 1 Oct 2019 12:41:56 +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 HZyzt2qQ5ODS for ; Tue, 1 Oct 2019 12:41:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from imap1.codethink.co.uk (imap1.codethink.co.uk [176.9.8.82]) by silver.osuosl.org (Postfix) with ESMTPS id B17A8203DE for ; Tue, 1 Oct 2019 12:41:40 +0000 (UTC) Received: from [167.98.27.226] (helo=ts007-build.ts007.codethink.co.uk) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1iFHTG-0005HX-Cp; Tue, 01 Oct 2019 13:41:38 +0100 From: Thomas Preston To: buildroot@buildroot.org, michael.drake@codethink.co.uk Date: Tue, 1 Oct 2019 13:41:32 +0100 Message-Id: <20191001124132.107700-3-thomas.preston@codethink.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191001124132.107700-1-thomas.preston@codethink.co.uk> References: <20191001124132.107700-1-thomas.preston@codethink.co.uk> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 3/3] pkgconf: Configure using pkgconf-personality 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: Thomas Preston Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The correct way to configure pkgconf when cross-compiling is to use pkgconf-personality, rather than using environment variables. The personality is selected with a symbolic link mechanism, which we now use in the pkg-config wrapper script. Signed-off-by: Thomas Preston --- package/pkgconf/pkg-config.in | 11 +---------- package/pkgconf/pkgconf.mk | 12 +++++++++++- package/pkgconf/target.personality | 5 +++++ 3 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 package/pkgconf/target.personality diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 894069c492..51db4d87e1 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,12 +1,3 @@ #!/bin/sh PKGCONFDIR=$(dirname $0) -DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib -DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/include -DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig -DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ - -PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH}} \ - PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-${DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH}} \ - PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} \ - PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} \ - exec ${PKGCONFDIR}/pkgconf @STATIC@ "$@" +exec ${PKGCONFDIR}/@GNU_TARGET_NAME@-pkg-config @STATIC@ "$@" diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk index 1851ecfca4..66bc61d797 100644 --- a/package/pkgconf/pkgconf.mk +++ b/package/pkgconf/pkgconf.mk @@ -11,15 +11,25 @@ PKGCONF_LICENSE = pkgconf license PKGCONF_LICENSE_FILES = COPYING PKG_CONFIG_HOST_BINARY = $(HOST_DIR)/bin/pkg-config +PKG_CONFIG_HOST_PERSONALITYD = $(HOST_DIR)/usr/share/pkgconfig/personality.d define PKGCONF_LINK_PKGCONFIG ln -sf pkgconf $(TARGET_DIR)/usr/bin/pkg-config endef define HOST_PKGCONF_INSTALL_WRAPPER + $(INSTALL) -m 0775 -D package/pkgconf/target.personality \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + $(SED) 's,@STAGING_DIR@,$(STAGING_DIR),g' \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + $(SED) 's,@GNU_TARGET_NAME@,$(GNU_TARGET_NAME),g' \ + $(PKG_CONFIG_HOST_PERSONALITYD)/$(GNU_TARGET_NAME).personality + ln -sf $(HOST_DIR)/bin/pkgconf \ + $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-pkg-config + $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/bin/pkg-config - $(SED) 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),g' \ + $(SED) 's,@GNU_TARGET_NAME@,$(GNU_TARGET_NAME),g' \ $(HOST_DIR)/bin/pkg-config endef diff --git a/package/pkgconf/target.personality b/package/pkgconf/target.personality new file mode 100644 index 0000000000..cee4d236c4 --- /dev/null +++ b/package/pkgconf/target.personality @@ -0,0 +1,5 @@ +Triplet: @GNU_TARGET_NAME@ +SysrootDir: @STAGING_DIR@ +DefaultSearchPaths: @STAGING_DIR@/usr/lib/pkgconfig:@STAGING_DIR@/usr/share/pkgconfig +SystemIncludePaths: @STAGING_DIR@/usr/include +SystemLibraryPaths: @STAGING_DIR@/usr/lib