aboutsummaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorGravatar Ulf Samuelsson <ulf.samuelsson@atmel.com>2007-07-31 14:59:58 +0000
committerGravatar Ulf Samuelsson <ulf.samuelsson@atmel.com>2007-07-31 14:59:58 +0000
commit840325e17001c82cbe1538e8dcacf1467c5ac683 (patch)
treee4762c1bff9898aca5097c082796645c01ece60d /toolchain
parent87111a1935be1c06879bb3accc9d3f28def4df20 (diff)
downloadbuildroot-840325e17001c82cbe1538e8dcacf1467c5ac683.tar.gz
buildroot-840325e17001c82cbe1538e8dcacf1467c5ac683.tar.bz2
Add support for prepatched toolchains
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/Config.in7
-rw-r--r--toolchain/Makefile.in16
-rw-r--r--toolchain/binutils/binutils.mk20
-rw-r--r--toolchain/gcc/Config.in2
-rw-r--r--toolchain/gcc/gcc-uclibc-3.x.mk36
-rw-r--r--toolchain/gcc/gcc-uclibc-4.x.mk34
-rw-r--r--toolchain/gdb/gdb.mk21
-rw-r--r--toolchain/uClibc/uclibc.mk24
8 files changed, 121 insertions, 39 deletions
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 9e16bb8466..a4b1af32fa 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -1,5 +1,4 @@
-#
-
+menu "Toolchain type"
choice
prompt "Toolchain type"
default BR2_TOOLCHAIN_BUILDROOT
@@ -16,5 +15,9 @@ config BR2_TOOLCHAIN_EXTERNAL
prompt "External toolchain"
endchoice
+source "target/device/Toolchain.in"
+
+endmenu
+
source "toolchain/Config.in.2"
source "toolchain/external-toolchain/Config.in"
diff --git a/toolchain/Makefile.in b/toolchain/Makefile.in
index a3dff49d42..e313df3c2e 100644
--- a/toolchain/Makefile.in
+++ b/toolchain/Makefile.in
@@ -45,5 +45,21 @@ CFLAGS_WHOLE_PROGRAM = $(call cc-option,-fwhole-program,)
# gcc-3.4 would need -combine, I only support 4.2, which correctly uses '--'
CFLAGS_COMBINE = $(call cc-option,--combine,)
+# define values for prepatched source trees for toolchains
+VENDOR_SITE:=$(strip $(subst ",,$(BR2_VENDOR_SITE)))
+#"))
+VENDOR_SUFFIX:=$(strip $(subst ",,$(BR2_VENDOR_SUFFIX)))
+#"))
+VENDOR_BINUTILS_RELEASE:=$(strip $(subst ",,$(BR2_VENDOR_BINUTILS_RELEASE)))
+#"))
+VENDOR_GCC_RELEASE:=$(strip $(subst ",,$(BR2_VENDOR_GCC_RELEASE)))
+#"))
+VENDOR_UCLIBC_RELEASE:=$(strip $(subst ",,$(BR2_VENDOR_UCLIBC_RELEASE)))
+#"))
+VENDOR_GDB_RELEASE:=$(strip $(subst ",,$(BR2_VENDOR_GDB_RELEASE)))
+#"))
+VENDOR_PATCH_DIR:=$(strip $(subst ",,$(BR2_VENDOR_PATCH_DIR)))
+#"))
+
# gcc has a bunch of needed stuff....
include toolchain/gcc/Makefile.in
diff --git a/toolchain/binutils/binutils.mk b/toolchain/binutils/binutils.mk
index 1932360726..32b23727fd 100644
--- a/toolchain/binutils/binutils.mk
+++ b/toolchain/binutils/binutils.mk
@@ -62,8 +62,20 @@ BINUTILS_TARGET_CONFIG_OPTIONS=--with-gmp="$(GMP_TARGET_DIR)"
BINUTILS_TARGET_CONFIG_OPTIONS+=--with-mpfr="$(MPFR_TARGET_DIR)"
endif
-BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
-BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+BINUTILS_SITE:=$(VENDOR_SITE)
+endif
+
+BINUTILS_OFFICIAL_VERSION:=$(BINUTILS_VERSION)$(VENDOR_SUFFIX)$(VENDOR_BINUTILS_RELEASE)
+
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
+BINUTILS_PATCH_DIR:=toolchain/binutils/$(BINUTILS_VERSION)
+else
+BINUTILS_PATCH_DIR:=$(VENDOR_PATCH_DIR)/binutils-$(BINUTILS_OFFICIAL_VERSION)
+endif
+
+BINUTILS_SOURCE:=binutils-$(BINUTILS_OFFICIAL_VERSION).tar.bz2
+BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_OFFICIAL_VERSION)
BINUTILS_CAT:=$(BZCAT)
BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
@@ -72,7 +84,7 @@ $(DL_DIR)/$(BINUTILS_SOURCE):
mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
-binutils-unpacked: $(BINUTILS_DIR)/.unpacked
+binutils-unpacked: $(BINUTILS_DIR)/.patched
$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
rm -rf $(BINUTILS_DIR)
@@ -82,7 +94,7 @@ $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
# Apply appropriate binutils patches.
- toolchain/patch-kernel.sh $(BINUTILS_DIR) toolchain/binutils/$(BINUTILS_VERSION) \*.patch
+ toolchain/patch-kernel.sh $(BINUTILS_DIR) $(BINUTILS_PATCH_DIR) \*.patch
touch $@
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index c7b258095a..51934d9d96 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -119,7 +119,7 @@ config BR2_GCC_VERSION
config BR2_TOOLCHAIN_SYSROOT
bool "Enable toolchain with --sysroot support"
- depends on !BR2_GCC_VERSION_3_3_5 && !BR2_GCC_VERSION_3_3_6 && !BR2_GCC_VERSION_3_4_2 && !BR2_GCC_VERSION_3_4_3 && !BR2_GCC_VERSION_3_4_4 && !BR2_GCC_VERSION_3_4_5 && !BR2_GCC_VERSION_3_4_6
+ depends on !BR2_GCC_VERSION_3_3_5 && !BR2_GCC_VERSION_3_3_6 && !BR2_GCC_VERSION_3_4_2 && !BR2_GCC_VERSION_3_4_3 && !BR2_GCC_VERSION_3_4_4 && !BR2_GCC_VERSION_3_4_5 && !BR2_GCC_VERSION_3_4_6 && !BR2_GCC_VERSION_4_1_2
default y
help
Enables --sysroot=dir for binutils and gcc.
diff --git a/toolchain/gcc/gcc-uclibc-3.x.mk b/toolchain/gcc/gcc-uclibc-3.x.mk
index cd736371ff..798ba25b92 100644
--- a/toolchain/gcc/gcc-uclibc-3.x.mk
+++ b/toolchain/gcc/gcc-uclibc-3.x.mk
@@ -31,8 +31,31 @@ GCC_OFFICIAL_VER:=$(GCC_VERSION)-$(GCC_SNAP_DATE)
GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_OFFICIAL_VER)
endif
+
+# redefine if using an external prepatched gcc source
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+GCC_SITE:=$(VENDOR_SITE)
+GCC_OFFICIAL_VER:=$(GCC_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GCC_RELEASE)
+endif
+
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
+
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
+ifeq ($(GCC_SNAP_DATE),)
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+else
+ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_OFFICIAL_VER)
+else
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+endif
+endif
+else
+GCC_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gcc-$(GCC_OFFICIAL_VER)
+endif
+
+
GCC_CAT:=$(BZCAT)
GCC_STRIP_HOST_BINARIES:=true
@@ -109,7 +132,7 @@ $(DL_DIR)/$(GCC_SOURCE):
mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-gcc-unpacked: $(GCC_DIR)/.unpacked
+gcc-unpacked: $(GCC_DIR)/.patched
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
@@ -119,16 +142,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
gcc-patched: $(GCC_DIR)/.patched
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
-ifeq ($(GCC_SNAP_DATE),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-else
-ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_OFFICIAL_VER) \*.patch
-else
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-endif
-endif
-
+ toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch
# Note: The soft float situation has improved considerably with gcc 3.4.x.
# We can dispense with the custom spec files, as well as libfloat for the arm case.
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 2274811b33..fb8cb6908c 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -29,6 +29,28 @@ GCC_OFFICIAL_VER:=$(GCC_VERSION)-$(GCC_SNAP_DATE)
GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_OFFICIAL_VER)
endif
+# redefine if using an external prepatched gcc source
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+GCC_SITE:=$(VENDOR_SITE)
+GCC_OFFICIAL_VER:=$(GCC_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GCC_RELEASE)
+endif
+
+# define patch location
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y) # Normal toolchain
+ifeq ($(GCC_SNAP_DATE),) # Not a snapshot
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+else # Is a snapshot
+ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),) # Snapshot patch?
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_OFFICIAL_VER)
+else # Normal patch to snapshot
+# Use the normal location, if the dedicated location does not exist
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+endif # Snapshot patch
+endif # Not a snapshot
+else # Prepatched toolchain
+GCC_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gcc-$(GCC_OFFICIAL_VER)
+endif # Normal toolchain
+
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
GCC_CAT:=$(BZCAT)
@@ -97,7 +119,7 @@ $(DL_DIR)/$(GCC_SOURCE):
mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-gcc-unpacked: $(GCC_DIR)/.unpacked
+gcc-unpacked: $(GCC_DIR)/.patched
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
rm -rf $(GCC_DIR)
@@ -108,15 +130,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
gcc-patched: $(GCC_DIR)/.patched
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
-ifeq ($(GCC_SNAP_DATE),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-else
-ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_OFFICIAL_VER) \*.patch
-else
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-endif
-endif
+ toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch
# Note: The soft float situation has improved considerably with gcc 3.4.x.
# We can dispense with the custom spec files, as well as libfloat for the arm case.
diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk
index 80d66f24c3..847a7ec064 100644
--- a/toolchain/gdb/gdb.mk
+++ b/toolchain/gdb/gdb.mk
@@ -18,11 +18,25 @@ GDB_SOURCE:=gdb.tar.bz2
GDB_CAT:=$(BZCAT)
GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
else
+
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
GDB_SITE:=http://ftp.gnu.org/gnu/gdb
-GDB_SOURCE:=gdb-$(GDB_VERSION).tar.bz2
+else
+GDB_SITE:=$(VENDOR_SITE)
+endif
+
+GDB_OFFICIAL_VERSION:=$(GDB_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GDB_RELEASE)
+
+GDB_SOURCE:=gdb-$(GDB_OFFICIAL_VERSION).tar.bz2
GDB_CAT:=$(BZCAT)
-GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_VERSION)
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
+GDB_PATCH_DIR:=toolchain/gdb/$(GDB_OFFICIAL_VERSION)
+else
+GDB_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gdb-$(GDB_OFFICIAL_VERSION)
+endif
+
+GDB_DIR:=$(TOOL_BUILD_DIR)/gdb-$(GDB_OFFICIAL_VERSION)
# NOTE: This option should not be used with gdb versions 6.4 and above.
ifeq ($(GDB_VERSION),6.2.1)
@@ -39,13 +53,14 @@ $(DL_DIR)/$(GDB_SOURCE):
gdb-unpacked: $(GDB_DIR)/.unpacked
$(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE)
+ mkdir -p $(TOOL_BUILD_DIR)
$(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
ifeq ($(GDB_VERSION),snapshot)
GDB_REAL_DIR=$(shell \
tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1)
ln -sf $(TOOL_BUILD_DIR)/$(shell tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) $(GDB_DIR)
endif
- toolchain/patch-kernel.sh $(GDB_DIR) toolchain/gdb/$(GDB_VERSION) \*.patch
+ toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch
$(CONFIG_UPDATE) $(GDB_DIR)
touch $@
diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index af13bf2801..f860d50174 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -33,13 +33,21 @@ UCLIBC_VER:=0.9.28
endif
UCLIBC_SITE:=http://www.uclibc.org/downloads
-ifeq ($(BR2_avr32),y)
-VENDOR_SUFFIX:=-avr32
-UCLIBC_SITE:=$(BR2_ATMEL_MIRROR)/Source
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+UCLIBC_SITE:=$(VENDOR_SITE)
endif
-UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-$(UCLIBC_VER)$(VENDOR_SUFFIX)
-UCLIBC_SOURCE:=uClibc-$(UCLIBC_VER)$(VENDOR_SUFFIX).tar.bz2
+UCLIBC_OFFICIAL_VERSION:=$(UCLIBC_VER)$(VENDOR_SUFFIX)$(VENDOR_UCLIBC_RELEASE)
+
+
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
+UCLIBC_PATCH_DIR:=toolchain/uClibc/
+else
+UCLIBC_PATCH_DIR:=$(VENDOR_PATCH_DIR)/uClibc-$(UCLIBC_OFFICIAL_VERSION)
+endif
+
+UCLIBC_DIR:=$(TOOL_BUILD_DIR)/uClibc-$(UCLIBC_OFFICIAL_VERSION)
+UCLIBC_SOURCE:=uClibc-$(UCLIBC_OFFICIAL_VERSION).tar.bz2
endif
UCLIBC_CAT:=$(BZCAT)
@@ -93,13 +101,13 @@ endif
uclibc-unpacked: $(UCLIBC_DIR)/.unpacked
$(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE) $(UCLIBC_LOCALE_DATA)
- [ -d $(TOOL_BUILD_DIR) ] || $(INSTALL) -d $(TOOL_BUILD_DIR)
+ mkdir -p $(TOOL_BUILD_DIR)
rm -rf $(UCLIBC_DIR)
$(UCLIBC_CAT) $(DL_DIR)/$(UCLIBC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
ifneq ($(BR2_UCLIBC_VERSION_SNAPSHOT),y)
- toolchain/patch-kernel.sh $(UCLIBC_DIR) toolchain/uClibc/ uClibc-$(UCLIBC_VER)$(VENDOR_SUFFIX)-\*.patch
+ toolchain/patch-kernel.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) uClibc-$(UCLIBC_OFFICIAL_VERSION)-\*.patch
else
- toolchain/patch-kernel.sh $(UCLIBC_DIR) toolchain/uClibc/ uClibc.\*.patch
+ toolchain/patch-kernel.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) uClibc.\*.patch
endif
ifneq ($(BR2_ENABLE_LOCALE),)
cp -dpf $(DL_DIR)/$(UCLIBC_SOURCE_LOCALE) $(UCLIBC_DIR)/extra/locale/