From patchwork Sun Jul 12 16:26:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 494138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 9184D1402B6 for ; Mon, 13 Jul 2015 02:27:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=nA1JnIN1; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9455C3331C; Sun, 12 Jul 2015 16:27:06 +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 k0llaVf7lnVV; Sun, 12 Jul 2015 16:26:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 28C4E332E0; Sun, 12 Jul 2015 16:26:52 +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 95F851C226F for ; Sun, 12 Jul 2015 16:26:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8D48C332E1 for ; Sun, 12 Jul 2015 16:26:47 +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 7+-vuq1CiV1Z for ; Sun, 12 Jul 2015 16:26:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by silver.osuosl.org (Postfix) with ESMTPS id 35498332D8 for ; Sun, 12 Jul 2015 16:26:45 +0000 (UTC) Received: by wgkl9 with SMTP id l9so9773812wgk.1 for ; Sun, 12 Jul 2015 09:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xUSSTRJaJP9eyNyBtrlOz2L1kODg8f9ifrtJ/7a6zb8=; b=nA1JnIN1AzDtMjhRkWggTYLKYrW1KyBQMrFay3Fc+JNQniepCpqi60RnZoCvgud4MU 1G2ryt85DsgmxJvUNvGNybWVuuelkw45sjU4VY5vwd5NaRWn9H+0L6/dE5B/ADbbgLT1 L59qYtr3aOe3em07fhTVfKAYNl/2AVyqY9UEK2Lx4ZALcZwM5DouJYqNTx7fBCHlv9+L NZu72WNXAA3rcoqte7TrJlaB66O44UFtrVQFZcxzoKct+RiIbXoqXOVTl3DIl6f4UadJ TjrR1O64ROEt2HmMjmuFAhjXWlhappaNDyoBwrr/tlnBq11+LUjpHWSHASaVgzOcGU2N yM0w== X-Received: by 10.180.87.230 with SMTP id bb6mr14699910wib.36.1436718403600; Sun, 12 Jul 2015 09:26:43 -0700 (PDT) Received: from bobook.localdomain (AToulouse-657-1-1031-128.w92-134.abo.wanadoo.fr. [92.134.9.128]) by smtp.gmail.com with ESMTPSA id q4sm24126215wja.24.2015.07.12.09.26.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Jul 2015 09:26:42 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.org Date: Sun, 12 Jul 2015 18:26:30 +0200 Message-Id: <1436718395-10536-2-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436718395-10536-1-git-send-email-s.martin49@gmail.com> References: <1436718395-10536-1-git-send-email-s.martin49@gmail.com> Subject: [Buildroot] [PATCH 1/6] package/pkg-utils.mk: add relative-path utility function X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new helper computes relative path between 2 paths. This helper will be useful later when fixing the RPATH valuel. Signed-off-by: Samuel Martin --- package/pkg-utils.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 44bd2c9..442c528 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -42,6 +42,18 @@ $(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM # slashes, colons (OK in filenames but not in rules), and spaces. sanitize = $(subst $(space),_,$(subst :,_,$(subst /,_,$(strip $(1))))) +# Return a relative filepath to path from a start directory. +# This is a path computation: the filesystem is not accessed to confirm +# the existence or nature of path or start. +# $1: path +# $2: start +relative-path = $(strip \ + $(subst //,/,\ + $(eval __r :=) \ + $(foreach p,$(subst /, ,$(1)),$(eval __r := $(__r)../)) \ + $(__r)$(subst /%,%,$(2)))) + + # # Manipulation of .config files based on the Kconfig # infrastructure. Used by the BusyBox package, the Linux kernel