Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved
@ 2010-03-24 22:42 Yann E. MORIN
  2010-03-25 22:12 ` Thomas Petazzoni
  2010-03-31  8:50 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2010-03-24 22:42 UTC (permalink / raw)
  To: buildroot

From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>

Sysrooted toolchain can be relocated. In this case, the sysroot is no
longer located at the place it was configured at.

Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
---

 toolchain/external-toolchain/ext-tool.mk |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 1f5aa19..80bdae6 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -205,7 +205,14 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
 EXTERNAL_LIBS+=libstdc++.so
 endif
 
-SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=)
+# This dance is needed because the toolchain may have been relocated, so the
+# configured paths may no longer match; fortunately, the sysroot moves along
+# the toolchain, so is always at the same place relative to the toolchain's
+# current location.
+CFG_PREFIX_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--prefix=" | cut -f2 -d=)
+CFG_SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot=" | cut -f2 -d=)
+REL_SYSROOT_DIR=$(shell echo "$(CFG_SYSROOT_DIR)" |sed -r -e 's:^$(CFG_PREFIX_DIR)::;')
+SYSROOT_DIR=$(TOOLCHAIN_EXTERNAL_PATH)/$(REL_SYSROOT_DIR)
 
 $(STAMP_DIR)/ext-toolchain-installed:
 	@echo "Checking external toolchain settings"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved
  2010-03-24 22:42 [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved Yann E. MORIN
@ 2010-03-25 22:12 ` Thomas Petazzoni
  2010-03-31  8:50 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2010-03-25 22:12 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 24 Mar 2010 23:42:42 +0100
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> wrote:

> Sysrooted toolchain can be relocated. In this case, the sysroot is no
> longer located at the place it was configured at.
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>

Something like this was definitely needed. I had another implementation
in mind, but yours is nice and simple. Thanks!

Acked-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved
  2010-03-24 22:42 [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved Yann E. MORIN
  2010-03-25 22:12 ` Thomas Petazzoni
@ 2010-03-31  8:50 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2010-03-31  8:50 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@anciens.enib.fr> writes:

 Yann> From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
 Yann> Sysrooted toolchain can be relocated. In this case, the sysroot is no
 Yann> longer located at the place it was configured at.

 Yann> Signed-off-by: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-31  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 22:42 [Buildroot] [PATCH] external toolchain: fix sysroot location if the toolchain was moved Yann E. MORIN
2010-03-25 22:12 ` Thomas Petazzoni
2010-03-31  8:50 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox