From patchwork Fri Dec 1 20:53:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRMw144lz9sNd for ; Sat, 2 Dec 2017 07:54:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 363D930BDD; Fri, 1 Dec 2017 20:54:16 +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 wCoOgEPncFr9; Fri, 1 Dec 2017 20:54:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0442A2FF19; Fri, 1 Dec 2017 20:54:15 +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 855501C436D for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7F81289BB6 for ; Fri, 1 Dec 2017 20:54:13 +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 8pm6CFIBshcu for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 2F9818978A for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 22B1A206EF; Fri, 1 Dec 2017 21:54:10 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id EA5B520396; Fri, 1 Dec 2017 21:53:59 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:38 +0100 Message-Id: <20171201205352.24287-2-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 01/15] pkgconf: use relative path to STAGING_DIR instead of absolute path X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The pkg-config wrapper script is currently generated with absolute paths to $(STAGING_DIR). However, this will not work properly with per-package SDK, and each package will be built with a different STAGING_DIR value. In order to fix this, we adjust how the pkg-config wrapper script is generated, so that it uses a relative path to itself: the sysroot (i.e STAGING_DIR) is always located in $(path of pkg-config)/../$(STAGING_SUBDIR). This change is independent from the per-package SDK work, and could be applied independently from it. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - As suggested by Arnout, simplify the generation of the pkg-config script by doing only a replacement on @STAGING_SUBDIR@, the rest being encoded inside the pkg-config script. --- package/pkgconf/pkg-config.in | 5 ++++- package/pkgconf/pkgconf.mk | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 4dec48789a..b9ce0935cc 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,2 +1,5 @@ #!/bin/sh -PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf @STATIC@ $@ +PKGCONFDIR=$(dirname $0) +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_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} ${PKGCONFDIR}/pkgconf @STATIC@ $@ diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk index cc190d26da..00b2d017ee 100644 --- a/package/pkgconf/pkgconf.mk +++ b/package/pkgconf/pkgconf.mk @@ -19,8 +19,7 @@ endef define HOST_PKGCONF_INSTALL_WRAPPER $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/bin/pkg-config - $(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \ - -e 's,@STAGING_DIR@,$(STAGING_DIR),' \ + $(SED) 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),g' \ $(HOST_DIR)/bin/pkg-config endef