Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC PATCH v3 08/10] external-toolchain: check if a buildroot SDK has already been relocated
Date: Thu, 23 Mar 2017 08:54:51 +0100	[thread overview]
Message-ID: <1490255693-9134-9-git-send-email-wg@grandegger.com> (raw)
In-Reply-To: <1490255693-9134-1-git-send-email-wg@grandegger.com>

The location of the buildroot SDK is stored in the file "sdk-location"
in "usr/share/buildroot". If it's content does not match the current
SDK location, ask the user to run the script "relocate-sdk.sh" in the
top directory once.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 toolchain/helpers.mk                                   | 15 +++++++++++++++
 toolchain/toolchain-external/pkg-toolchain-external.mk |  1 +
 2 files changed, 16 insertions(+)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 2f73ebb..5f6e3e0 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -394,3 +394,18 @@ check_toolchain_ssp = \
 gen_gdbinit_file = \
 	mkdir -p $(STAGING_DIR)/usr/share/buildroot/ ; \
 	echo "set sysroot $(STAGING_DIR)" > $(STAGING_DIR)/usr/share/buildroot/gdbinit
+
+#
+# Check if it's a buildroot toolchain and if it's already relocatable by
+# reading and testing the toolchain location file
+#
+# $1: toolchain installation directory
+#
+check_buildroot_sdk_relocated = \
+	if [ -r $(1)/share/buildroot/sdk-location ]; then \
+		sdkroot=`dirname "$(1)"`; \
+		if [ "`cat $(1)/share/buildroot/sdk-location`" != "$${sdkroot}" ]; then \
+			echo "Please relocate the buildroot SDK by executing \"$${sdkroot}/relocate-sdk.sh\" once!" ; \
+			exit 1 ; \
+		fi \
+	fi
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 11a1bf5..b9ffa80 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -543,6 +543,7 @@ endif
 # matches the configuration provided in Buildroot: ABI, C++ support,
 # kernel headers version, type of C library and all C library features.
 define $(2)_CONFIGURE_CMDS
+	$$(Q)$$(call check_buildroot_sdk_relocated,$$(TOOLCHAIN_EXTERNAL_INSTALL_DIR))
 	$$(Q)$$(call check_cross_compiler_exists,$$(TOOLCHAIN_EXTERNAL_CC))
 	$$(Q)$$(call check_unusable_toolchain,$$(TOOLCHAIN_EXTERNAL_CC))
 	$$(Q)SYSROOT_DIR="$$(call toolchain_find_sysroot,$$(TOOLCHAIN_EXTERNAL_CC))" ; \
-- 
1.9.1

  parent reply	other threads:[~2017-03-23  7:54 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  7:54 [Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 01/10] package/patchelf: use most recent version as a base for rpath sanitation Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 02/10] package/patchelf: add patch for rpath sanitation under a root directory Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 03/10] support/scripts: add fix-rpath script to sanitize the rpath Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 04/10] core: sanitize RPATH in host tree at the very end of the build Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 05/10] core: sanitize RPATH in target tree at the end of the target finalization Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 06/10] support/scripts: add reloacte-sdk.sh script for SDK relocation Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 07/10] core: install relocation script and location at the end of the build Wolfgang Grandegger
2017-03-23  7:54 ` Wolfgang Grandegger [this message]
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 09/10] support/scripts: check-host-rpath now handles $ORIGIN as well Wolfgang Grandegger
2017-03-23  7:54 ` [Buildroot] [RFC PATCH v3 10/10] package/qt5base: provide "qt.conf" to make "qmake" relocatable Wolfgang Grandegger
2017-04-12 13:59 ` [Buildroot] [RFC PATCH v3 00/10] Make the SDK relocatable Arnout Vandecappelle
2017-04-27  9:37   ` Wolfgang Grandegger
2017-06-21  7:59     ` Wolfgang Grandegger
2017-06-21 21:03       ` Arnout Vandecappelle
2017-06-21 21:06         ` Arnout Vandecappelle
2017-06-27 10:54           ` Wolfgang Grandegger
2017-06-27 22:41             ` Arnout Vandecappelle
2017-06-28  6:51               ` Wolfgang Grandegger
2017-06-28 10:44                 ` Arnout Vandecappelle
2017-06-28 10:59                   ` Wolfgang Grandegger
2017-06-22  6:37         ` Wolfgang Grandegger
2017-06-27 22:47           ` Arnout Vandecappelle
2017-06-28  6:40             ` Peter Korsgaard
2017-06-28  6:45             ` Wolfgang Grandegger
2017-06-28 10:41               ` Arnout Vandecappelle
2017-06-28 10:57                 ` Wolfgang Grandegger
2017-06-28 11:16                   ` Arnout Vandecappelle
2017-06-28 12:36                     ` Wolfgang Grandegger
2017-06-28 19:33                       ` Arnout Vandecappelle
2017-06-29  6:13                         ` Wolfgang Grandegger
2017-06-29  8:02                           ` Wolfgang Grandegger
2017-06-30  8:50                             ` Wolfgang Grandegger
2017-06-30  9:14                               ` Wolfgang Grandegger
2017-06-30 10:25                                 ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490255693-9134-9-git-send-email-wg@grandegger.com \
    --to=wg@grandegger.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox