Skip to contentSkip to conversation

Improve support for custom external toolchains (and related changes)

PATCH Superseded Thomas De Schampheleire 2 participants 9 messages Jun 5, 2012 – Jun 6, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve support for custom external toolchains (and related changes)

The main intention for this patch series is to allow downloading a custom external toolchain. I had previously added this functionality to buildroot (did not make it to mainstream, I should have followed it up better) and have been using it for about a year now.
I have now lined it up with current buildroot, updated based on the comments of ThomasP, and fixed some related problems I found along the way.

Thomas De Schampheleire (6):
pkg-download.mk: allow using localfiles outside of package infrastructure pkg-download.mk: use stripurischeme function in localfiles download method pkg-download.mk: support detection of URI schemes in DOWNLOAD toolchain-external/Config.in: fix indentation
toolchain-external: allow downloading a custom toolchain
toolchain-external: line up comments with reality

 package/pkg-download.mk                  |   15 +++-
 toolchain/toolchain-external/Config.in   |  371 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------
 toolchain/toolchain-external/ext-tool.mk |   19 ++++--
 3 files changed, 215 insertions(+), 190 deletions(-)
#1 lore raw

PATCH 1/1 pkg-download.mk: allow using localfiles outside of package infrastructure

The localfiles download method uses $($(PKG)_SITE))) and $($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only be used for package downloads (through gentargets, autotargets, ...) and not for other downloads like external toolchains.

This patch changes localfiles to allow this, just as the wget and scp download methods already did.
For the version control download methods, nothing changes.

---
 package/pkg-download.mk |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
package/pkg-download.mk +4 -4
@@ -174,16 +174,16 @@ define SHOW_EXTERNAL_DEPS_WGET
 endef
 
 define DOWNLOAD_LOCALFILES
-	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
-		$(LOCALFILES) $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE) $(DL_DIR)
+	test -e $(DL_DIR)/$(2) || \
+		$(LOCALFILES) $(call qstrip,$(subst file://,,$(1))) $(DL_DIR)
 endef
 
 define SOURCE_CHECK_LOCALFILES
-  test -e $(call qstrip,$(subst file://,,$($(PKG)_SITE)))/$($(PKG)_SOURCE)
+  test -e $(call qstrip,$(subst file://,,$(1)))
 endef
 
 define SHOW_EXTERNAL_DEPS_LOCALFILES
-  echo $($(PKG)_SITE)/$($(PKG)_SOURCE)
+  echo $(2)
 endef
 
 ################################################################################
#4 lore raw

PATCH 1/1 pkg-download.mk: use stripurischeme function in localfiles download method

In reply to Thomas De Schampheleire
---
 package/pkg-download.mk |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
package/pkg-download.mk +2 -2
@@ -175,11 +175,11 @@ endef
 
 define DOWNLOAD_LOCALFILES
 	test -e $(DL_DIR)/$(2) || \
-		$(LOCALFILES) $(call qstrip,$(subst file://,,$(1))) $(DL_DIR)
+		$(LOCALFILES) $(call stripurischeme,$(call qstrip,$(1))) $(DL_DIR)
 endef
 
 define SOURCE_CHECK_LOCALFILES
-  test -e $(call qstrip,$(subst file://,,$(1)))
+  test -e $(call stripurischeme,$(call qstrip,$(1)))
 endef
 
 define SHOW_EXTERNAL_DEPS_LOCALFILES
#5 lore raw

PATCH 1/1 pkg-download.mk: support detection of URI schemes in DOWNLOAD

In reply to Thomas De Schampheleire

When using one of the package infrastructures, the DOWNLOAD function uses $(PKG)_SITE_METHOD to determine the appropriate download method, which is autodetected based on the URI if none was explicitly set.

When the DOWNLOAD function is called directly, for example when downloading a toolchain, or from a package that does not use one of the package infrastructures, the SITE_METHOD is not autodetected, and thus the download defaults to wget.

This patch adds URI scheme detection directly to the DOWNLOAD method, in case no SITE_METHOD was detected yet.

---
 package/pkg-download.mk |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
package/pkg-download.mk +6 -1
@@ -211,7 +211,12 @@ define DOWNLOAD_INNER
 		esac ; \
 	fi ; \
 	if test -n "$(1)" ; then \
-		case "$($(PKG)_SITE_METHOD)" in \
+		if test -z "$($(PKG)_SITE_METHOD)" ; then \
+			scheme="$(call geturischeme,$(1))" ; \
+		else \
+			scheme="$($(PKG)_SITE_METHOD)" ; \
+		fi ; \
+		case "$$scheme" in \
 			git) $($(DL_MODE)_GIT) && exit ;; \
 			svn) $($(DL_MODE)_SVN) && exit ;; \
 			bzr) $($(DL_MODE)_BZR) && exit ;; \
#6 lore raw

PATCH 1/1 toolchain-external/Config.in: fix indentation

In reply to Thomas De Schampheleire

Fix the indentation of the external toolchain Config file, where tabs and spaces are mixed as indentation even within the same block.

---
 toolchain/toolchain-external/Config.in |  342 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------
 1 files changed, 171 insertions(+), 171 deletions(-)
toolchain/toolchain-external/Config.in +171 -171
@@ -69,16 +69,16 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.6.1, binutils 2.21.53, glibc
 	  2.13 and gdb 7.2.50, kernel headers 3.0.1. It has support
 	  for the following variants:
-            - ARMv5TE, little endian, soft-float, glibc
-              Select ARM926T, ARM10T, XScale or another ARMv5 core
-              Select BR2_SOFT_FLOAT
-            - ARMv4T, little endian, soft-float, glibc
-              Select ARM720T, ARM920T, ARM922T or another ARMv4 core
-              Select BR2_SOFT_FLOAT
-            - ARMv7-A, Thumb 2, little endian, soft-float, glibc
-              Select Cortex-A8, Cortex-A9 or another ARMv7-A core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mthumb
+	    - ARMv5TE, little endian, soft-float, glibc
+	      Select ARM926T, ARM10T, XScale or another ARMv5 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv4T, little endian, soft-float, glibc
+	      Select ARM720T, ARM920T, ARM922T or another ARMv4 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+	      Select Cortex-A8, Cortex-A9 or another ARMv7-A core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201103
 	bool "Sourcery CodeBench ARM 2011.03"
@@ -90,16 +90,16 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.5.2, binutils 2.20.51, glibc
 	  2.13 and gdb 7.2.50, kernel headers 2.6.38. It has support
 	  for the following variants:
-            - ARMv5TE, little endian, soft-float, glibc
-              Select ARM926T, ARM10T, XScale or another ARMv5 core
-              Select BR2_SOFT_FLOAT
-            - ARMv4T, little endian, soft-float, glibc
-              Select ARM720T, ARM920T, ARM922T or another ARMv4 core
-              Select BR2_SOFT_FLOAT
-            - ARMv7-A, Thumb 2, little endian, soft-float, glibc
-              Select Cortex-A8, Cortex-A9 or another ARMv7-A core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mthumb
+	    - ARMv5TE, little endian, soft-float, glibc
+	      Select ARM926T, ARM10T, XScale or another ARMv5 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv4T, little endian, soft-float, glibc
+	      Select ARM720T, ARM920T, ARM922T or another ARMv4 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+	      Select Cortex-A8, Cortex-A9 or another ARMv7-A core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201009
 	bool "Sourcery CodeBench ARM 2010.09"
@@ -111,16 +111,16 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.5.1, binutils 2.20, glibc
 	  2.11 and gdb 7.2.50, kernel headers 2.6.35.2. It has support
 	  for the following variants:
-            - ARMv5TE, little endian, soft-float, glibc
+	    - ARMv5TE, little endian, soft-float, glibc
 	      Select ARM926T, ARM10T, XScale or another ARMv5 core
-              Select BR2_SOFT_FLOAT
-            - ARMv4T, little endian, soft-float, glibc
-              Select ARM720T, ARM920T, ARM922T or another ARMv4 core
-              Select BR2_SOFT_FLOAT
-            - ARMv7-A, Thumb 2, little endian, soft-float, glibc
-              Select Cortex-A8, Cortex-A9 or another ARMv7-A core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mthumb
+	      Select BR2_SOFT_FLOAT
+	    - ARMv4T, little endian, soft-float, glibc
+	      Select ARM720T, ARM920T, ARM922T or another ARMv4 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+	      Select Cortex-A8, Cortex-A9 or another ARMv7-A core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2010Q1
 	bool "Sourcery CodeBench ARM 2010q1"
@@ -132,16 +132,16 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.4.1, binutils 2.19, glibc
 	  2.11, gdb 7.0.50 and kernel headers 2.6.32. It has support
 	  for the following variants:
-             - ARMv5T, little endian, soft-float, glibc
-               Select ARM926T, ARM10T, XScale or another ARMv5 core
-               Select BR2_SOFT_FLOAT
-             - ARMv4T, little endian, soft-float, glibc
-               Select ARM720T, ARM920T, ARM922T or another ARMv4 core
-               Select BR2_SOFT_FLOAT
-             - ARMv7-A, Thumb 2, little endian, soft-float, glibc
-               Select Cortex-A8, Cortex-A9 or another ARMv7-A core
-               Select BR2_SOFT_FLOAT
-               Set BR2_TARGET_OPTIMIZATION to -mthumb
+	     - ARMv5T, little endian, soft-float, glibc
+	       Select ARM926T, ARM10T, XScale or another ARMv5 core
+	       Select BR2_SOFT_FLOAT
+	     - ARMv4T, little endian, soft-float, glibc
+	       Select ARM720T, ARM920T, ARM922T or another ARMv4 core
+	       Select BR2_SOFT_FLOAT
+	     - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+	       Select Cortex-A8, Cortex-A9 or another ARMv7-A core
+	       Select BR2_SOFT_FLOAT
+	       Set BR2_TARGET_OPTIMIZATION to -mthumb
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM2009Q3
 	bool "Sourcery CodeBench ARM 2009q3"
@@ -153,16 +153,16 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.4.1, binutils 2.19, glibc
 	  2.10 and gdb 6.8 and kernel headers 2.6.30. It has support
 	  for the following variants:
-            - ARMv5T, little endian, soft-float, glibc
-              Select ARM926T, ARM10T, XScale or another ARMv5 core
-              Select BR2_SOFT_FLOAT
-            - ARMv4T, little endian, soft-float, glibc
-              Select ARM720T, ARM920T, ARM922T or another ARMv4 core
-              Select BR2_SOFT_FLOAT
-            - ARMv7-A, Thumb 2, little endian, soft-float, glibc
-              Select Cortex-A8, Cortex-A9 or another ARMv7-A core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mthumb
+	    - ARMv5T, little endian, soft-float, glibc
+	      Select ARM926T, ARM10T, XScale or another ARMv5 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv4T, little endian, soft-float, glibc
+	      Select ARM720T, ARM920T, ARM922T or another ARMv4 core
+	      Select BR2_SOFT_FLOAT
+	    - ARMv7-A, Thumb 2, little endian, soft-float, glibc
+	      Select Cortex-A8, Cortex-A9 or another ARMv7-A core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201103
 	bool "Sourcery CodeBench MIPS 2011.03"
@@ -174,44 +174,44 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.5.2, binutils 2.20.51, glibc
 	  2.13, uClibc 0.9.30 and gdb 7.2.50, kernel headers
 	  2.6.38. It has support for the following variants:
-            - MIPS32 O32 big endian glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-            - MIPS32 O32 little endian glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL
-            - MIPS32 big endian soft float glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-            - MIPS32 little endian soft float glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL
-            - MIPS32 big endian microMIPS glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mips16
-            - MIPS32 little endian microMIPS glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL -mips16
-            - MIPS32 big endian soft float microMIPS glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mips16
-            - MIPS32 little endian soft float microMIPS glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL -mips16
-            - MIPS32 big endian uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 little endian uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 big endian soft float uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 little endian soft float uclibc
-              Not usable in Buildroot yet.
+	    - MIPS32 O32 big endian glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	    - MIPS32 O32 little endian glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL
+	    - MIPS32 big endian soft float glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	    - MIPS32 little endian soft float glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL
+	    - MIPS32 big endian microMIPS glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mips16
+	    - MIPS32 little endian microMIPS glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL -mips16
+	    - MIPS32 big endian soft float microMIPS glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mips16
+	    - MIPS32 little endian soft float microMIPS glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL -mips16
+	    - MIPS32 big endian uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 little endian uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 big endian soft float uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 little endian soft float uclibc
+	      Not usable in Buildroot yet.
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS44
 	bool "Sourcery CodeBench MIPS 4.4"
@@ -223,44 +223,44 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  Mentor Graphics. It uses gcc 4.4.1, binutils 2.19, glibc
 	  2.11, uClibc 0.9.30 and gdb 7.0, kernel headers 2.6.32. It
 	  has support for the following variants:
-            - MIPS32 O32 big endian glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-            - MIPS32 O32 little endian glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL
-            - MIPS32 big endian soft float glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-            - MIPS32 little endian soft float glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL
-            - MIPS32 big endian microMIPS glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mips16
-            - MIPS32 little endian microMIPS glibc
-              Select a MIPS generic core
-              Disable BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL -mips16
-            - MIPS32 big endian soft float microMIPS glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -mips16
-            - MIPS32 little endian soft float microMIPS glibc
-              Select a MIPS generic core
-              Select BR2_SOFT_FLOAT
-              Set BR2_TARGET_OPTIMIZATION to -EL -mips16
-            - MIPS32 big endian uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 little endian uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 big endian soft float uclibc
-              Not usable in Buildroot yet.
-            - MIPS32 little endian soft float uclibc
-              Not usable in Buildroot yet.
+	    - MIPS32 O32 big endian glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	    - MIPS32 O32 little endian glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL
+	    - MIPS32 big endian soft float glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	    - MIPS32 little endian soft float glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL
+	    - MIPS32 big endian microMIPS glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mips16
+	    - MIPS32 little endian microMIPS glibc
+	      Select a MIPS generic core
+	      Disable BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL -mips16
+	    - MIPS32 big endian soft float microMIPS glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -mips16
+	    - MIPS32 little endian soft float microMIPS glibc
+	      Select a MIPS generic core
+	      Select BR2_SOFT_FLOAT
+	      Set BR2_TARGET_OPTIMIZATION to -EL -mips16
+	    - MIPS32 big endian uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 little endian uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 big endian soft float uclibc
+	      Not usable in Buildroot yet.
+	    - MIPS32 little endian soft float uclibc
+	      Not usable in Buildroot yet.
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201103
 	bool "Sourcery CodeBench PowerPC 2011.03"
@@ -272,22 +272,22 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20.51,
 	  glibc 2.13, gdb 7.2.50 and kernel headers 2.6.38. It has
 	  support for the following variants:
-            - 603 glibc, 32 bits
+	    - 603 glibc, 32 bits
 	      Select a generic PowerPC core
 	      Disable BR2_SOFT_FLOAT
-            - 603 soft float glibc, 32 bits
+	    - 603 soft float glibc, 32 bits
 	      Select a generic PowerPC core
 	      Enable BR2_SOFT_FLOAT
-            - e600 altivec glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te600
-            - e500v1 glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500v1
-            - e500v2 glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500v2
-            - e500mc glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500mc
-            - 970 glibc hard-float, 64 bits
-              Set BR2_TARGET_OPTIMIZATION to -m64
+	    - e600 altivec glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te600
+	    - e500v1 glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500v1
+	    - e500v2 glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500v2
+	    - e500mc glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500mc
+	    - 970 glibc hard-float, 64 bits
+	      Set BR2_TARGET_OPTIMIZATION to -m64
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_POWERPC201009
 	bool "Sourcery CodeBench PowerPC 2010.09"
@@ -299,22 +299,22 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.1, binutils 2.20,
 	  glibc 2.11, gdb 7.2.50 and kernel headers 2.6.35.2. It has
 	  support for the following variants:
-            - 603 glibc, 32 bits
+	    - 603 glibc, 32 bits
 	      Select a generic PowerPC core
 	      Disable BR2_SOFT_FLOAT
-            - 603 soft float glibc, 32 bits
+	    - 603 soft float glibc, 32 bits
 	      Select a generic PowerPC core
 	      Enable BR2_SOFT_FLOAT
-            - e600 altivec glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te600
-            - e500v1 glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500v1
-            - e500v2 glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500v2
-            - e500mc glibc, 32 bits
-              Set BR2_TARGET_OPTIMIZATION to -te500mc
-            - 970 glibc hard-float, 64 bits
-              Set BR2_TARGET_OPTIMIZATION to -m64
+	    - e600 altivec glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te600
+	    - e500v1 glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500v1
+	    - e500v2 glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500v2
+	    - e500mc glibc, 32 bits
+	      Set BR2_TARGET_OPTIMIZATION to -te500mc
+	    - 970 glibc hard-float, 64 bits
+	      Set BR2_TARGET_OPTIMIZATION to -m64
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201103
 	bool "Sourcery CodeBench SH 2011.03"
@@ -326,14 +326,14 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20,
 	  glibc 2.13, uClibc 0.9.30, gdb 7.2.50 and kernel headers
 	  2.6.38. It has support for the following variants:
-            - SH4A, glibc, little endian
-              Default.
-            - SH4A, glibc, big endian
-              Add -mb to BR2_TARGET_OPTIMIZATION
-            - SH4A, uClibc, little endian
-              Not usable in Buildroot yet.
-            - SH4A, uClibc, big endian
-              Not usable in Buildroot yet.
+	    - SH4A, glibc, little endian
+	      Default.
+	    - SH4A, glibc, big endian
+	      Add -mb to BR2_TARGET_OPTIMIZATION
+	    - SH4A, uClibc, little endian
+	      Not usable in Buildroot yet.
+	    - SH4A, uClibc, big endian
+	      Not usable in Buildroot yet.
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH201009
 	bool "Sourcery CodeBench SH 2010.09"
@@ -345,14 +345,14 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.1, binutils 2.20,
 	  glibc 2.11, uClibc 0.9.30, gdb 7.2.50 and kernel headers
 	  2.6.35.2. It has support for the following variants:
-            - SH4A, glibc, little endian
-              Default.
-            - SH4A, glibc, big endian
-              Add -mb to BR2_TARGET_OPTIMIZATION
-            - SH4A, uClibc, little endian
-              Not usable in Buildroot yet.
-            - SH4A, uClibc, big endian
-              Not usable in Buildroot yet.
+	    - SH4A, glibc, little endian
+	      Default.
+	    - SH4A, glibc, big endian
+	      Add -mb to BR2_TARGET_OPTIMIZATION
+	    - SH4A, uClibc, little endian
+	      Not usable in Buildroot yet.
+	    - SH4A, uClibc, big endian
+	      Not usable in Buildroot yet.
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201103
 	bool "Sourcery CodeBench SH 2011.03"
@@ -369,7 +369,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.2, binutils 2.20,
 	  uClibc 0.9.30, gdb 7.2.50 and kernel headers 2.6.38. It has
 	  support for the following variants:
-            - SH2A, uClibc, big endian
+	    - SH2A, uClibc, big endian
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_SH2A_201009
 	bool "Sourcery CodeBench SH 2010.09"
@@ -386,7 +386,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCE
 	  from Mentor Graphics. It uses gcc 4.5.1, binutils 2.20,
 	  uClibc 0.9.30, gdb 7.2.50 and kernel headers 2.6.35.2. It
 	  has support for the following variants:
-            - SH2A, uClibc, big endian
+	    - SH2A, uClibc, big endian
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109
 	bool "Sourcery CodeBench x86/x86_64 2011.09"
@@ -485,10 +485,10 @@ config BR2_TOOLCHAIN_EXTERNAL_XILINX_MIC
 	  http://wiki.xilinx.com/mb-gnu-tools
 
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
-       bool "Custom toolchain"
-       help
-         Use this option to use a custom toolchain pre-installed on
-         your system.
+	bool "Custom toolchain"
+	help
+	  Use this option to use a custom toolchain pre-installed on
+	  your system.
 
 endchoice
 
#7 lore raw

PATCH 1/1 toolchain-external: allow downloading a custom toolchain

In reply to Thomas De Schampheleire

This patch adds the possibility to download a custom external toolchain, in addition to the existing support of preinstalled custom external toolchains.

With the modified configuration, the user is presented with the following options:
- Toolchain type: Buildroot toolchain | External toolchain | Ct-ng toolchain

In case of External toolchain:
- Toolchain: the CodeSourcery toolchains | Custom toolchain
- Toolchain origin: Toolchain to be downloaded and installed | Pre-installed toolchain

In case of Toolchain to be downloaded, the user is presented with:
- Toolchain URL
In case of Pre-installed toolchain, the users sees:
- Toolchain Path

For CodeSourcery toolchains, the toolchain URL field is not used (the URLs are directly coded in ext-tool.mk).

---

This feature was proposed previously [1] with some comments by Thomas Petazzoni. At that time, the proposed split was to have 'custom pre- installed toolchain' and 'custom downloadable toolchain' sit alongside the CodeSourcery ones, as such providing a clear distinction between pre-installed and downloaded custom toolchains. However, during implementation I felt that this structure makes the code more complex than it needs to be and so I choose for an alternative solution that IMO still creates a clear distinction. Any comments are of course welcome.

[1] http://lists.busybox.net/pipermail/buildroot/2011-September/045912.html

 toolchain/toolchain-external/Config.in   |  29 ++++++++++++++++++++++-------
 toolchain/toolchain-external/ext-tool.mk |   6 ++++++
 2 files changed, 28 insertions(+), 7 deletions(-)
toolchain/toolchain-external/Config.in +22 -7
@@ -492,22 +492,37 @@ config BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
 endchoice
 
+choice
+	prompt "Toolchain origin"
+
 config BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
-	bool "Download toolchain automatically"
-	default y
-	depends on !BR2_TOOLCHAIN_EXTERNAL_CUSTOM
+	bool "Toolchain to be downloaded and installed"
 	help
-	  When enabled, Buildroot will automatically download and
-	  install the selected external toolchain. When disabled,
-	  Buildroot will use a pre-installed toolchain.
+	  Select this option if you want Buildroot to download and install the
+	  toolchain. If you have selected a custom toolchain, specify the URL
+	  in BR2_TOOLCHAIN_EXTERNAL_URL.
+
+config BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED
+	bool "Pre-installed toolchain"
+	help
+	  Select this option if you want to use a pre-installed toolchain.
+	  Specify the path to this toolchain in BR2_TOOLCHAIN_EXTERNAL_PATH.
+
+endchoice
 
 config BR2_TOOLCHAIN_EXTERNAL_PATH
 	string "Toolchain path"
 	default "/path/to/toolchain/usr"
-	depends on !BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+	depends on BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED
 	help
 	  Path to where the external toolchain is installed.
 
+config BR2_TOOLCHAIN_EXTERNAL_URL
+	string "Toolchain URL"
+	depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM && BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+	help
+	  URL of the custom toolchain tarball to download and install.
+
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 	string "Toolchain prefix"
 	depends on BR2_TOOLCHAIN_EXTERNAL_CUSTOM
toolchain/toolchain-external/ext-tool.mk +6 -0
@@ -252,11 +252,17 @@ else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_XILI
 TOOLCHAIN_EXTERNAL_SITE=http://git.xilinx.com/?p=xldk/microblaze_v2.0.git;a=blob;h=71e031ae990e063a5718f90d30cf97ad85e2f565;hb=569081301f0f1d8d3b24335a364e8ff1774190d4;f=
 TOOLCHAIN_EXTERNAL_SOURCE=microblaze-unknown-linux-gnu.tgz
 else
+# Custom toolchain
+TOOLCHAIN_EXTERNAL_SITE=$(dir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL)))
+TOOLCHAIN_EXTERNAL_SOURCE=$(notdir $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_URL)))
+
 # A value must be set (even if unused), otherwise the
 # $(DL_DIR)/$(TOOLCHAIN_EXTERNAL_SOURCE) rule would override the main
 # $(DL_DIR) rule
+ifeq (,$(TOOLCHAIN_EXTERNAL_SOURCE))
 TOOLCHAIN_EXTERNAL_SOURCE=none
 endif
+endif
 
 # Special handling for Blackfin toolchain, because of the split in two
 # tarballs, and the organization of tarball contents. The tarballs
#8 lore raw

PATCH 1/1 toolchain-external: line up comments with reality

In reply to Thomas De Schampheleire

Line-up with changes from commit 3367d5ce770ac409e7b3f5bba2c7ed1a819b3ef7 "external-toolchain: run checks even on extracted toolchains"

---
 toolchain/toolchain-external/ext-tool.mk |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
toolchain/toolchain-external/ext-tool.mk +6 -7
@@ -14,11 +14,10 @@
 #
 # The basic principle is the following
 #
-#  1. a. For toolchains downloaded from the Web, Buildroot already
-#  knows their configuration, so it just downloads them and extract
-#  them in $(TOOLCHAIN_EXTERNAL_DIR).
+#  1. If the toolchain is not pre-installed, download and extract it
+#  in $(TOOLCHAIN_EXTERNAL_DIR).
 #
-#  1. b. For pre-installed toolchains, perform some checks on the
+#  2. For all external toolchains, perform some checks on the
 #  conformity between the toolchain configuration described in the
 #  Buildroot menuconfig system, and the real configuration of the
 #  external toolchain. This is for example important to make sure that
@@ -30,19 +29,19 @@
 #  options. And at configuration time, we are not able to retrieve the
 #  external toolchain configuration.
 #
-#  2. Copy the libraries needed at runtime to the target directory,
+#  3. Copy the libraries needed at runtime to the target directory,
 #  $(TARGET_DIR). Obviously, things such as the C library, the dynamic
 #  loader and a few other utility libraries are needed if dynamic
 #  applications are to be executed on the target system.
 #
-#  3. Copy the libraries and headers to the staging directory. This
+#  4. Copy the libraries and headers to the staging directory. This
 #  will allow all further calls to gcc to be made using --sysroot
 #  $(STAGING_DIR), which greatly simplifies the compilation of the
 #  packages when using external toolchains. So in the end, only the
 #  cross-compiler binaries remains external, all libraries and headers
 #  are imported into the Buildroot tree.
 #
-#  4. Build a toolchain wrapper which executes the external toolchain
+#  5. Build a toolchain wrapper which executes the external toolchain
 #  with a number of arguments (sysroot/march/mtune/..) hardcoded,
 #  so we're sure the correct configuration is always used and the
 #  toolchain behaves similar to an internal toolchain.
#2 lore raw

PATCH 1/1 pkg-download.mk: allow using localfiles outside of package infrastructure

In reply to Thomas De Schampheleire

Le Tue, 05 Jun 2012 21:22:12 +0200,
Thomas De Schampheleire <[email protected]> a ?crit :

Quoted 10 lines

The localfiles download method uses $($(PKG)_SITE))) and $($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only be used for package downloads (through gentargets, autotargets, ...) and not for other downloads like external toolchains.

This patch changes localfiles to allow this, just as the wget and scp download methods already did.
For the version control download methods, nothing changes.

I generally agree with this, but for consistency sake, it should probably done similarly for all other download methods, no? Of course, it can be done later as separate patches, the code is already inconsistent, so this patch does not make it worse from that perspective.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/1 pkg-download.mk: allow using localfiles outside of package infrastructure

Op 6 jun. 2012 22:15 schreef "Thomas Petazzoni" < [email protected]> het volgende:

Quoted 14 lines

Le Tue, 05 Jun 2012 21:22:12 +0200,
Thomas De Schampheleire <[email protected]> a ?crit :

Quoted 10 lines

The localfiles download method uses $($(PKG)_SITE))) and $($(PKG)_SOURCE) instead of $(1) and $(2). This means that it can only be used for package downloads (through gentargets, autotargets, ...) and not for other downloads like external toolchains.

This patch changes localfiles to allow this, just as the wget and scp download methods already did.
For the version control download methods, nothing changes.

Signed-off-by Thomas De Schampheleire <

[email protected]>

Quoted 6 lines

I generally agree with this, but for consistency sake, it should probably done similarly for all other download methods, no? Of course, it can be done later as separate patches, the code is already inconsistent, so this patch does not make it worse from that perspective.

Well, for wget and scp it was already ok, and I didn't think it made sense for the git, bzr, hg and svn methods, as you'd only use these for packages, right?

Best regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120606/f7ba63d9/attachment-0001.html>