From 85c7bde99ee2db7ea865032ef497f3b78ced9e75 Mon Sep 17 00:00:00 2001 From: Ulf Samuelsson Date: Sun, 21 Dec 2008 17:11:33 +0000 Subject: [PATCH] Allow creating a script for external use of Buildroot toolchain --- toolchain/Config.in | 2 ++ toolchain/Makefile.in | 2 ++ toolchain/export-toolchain/Config.in | 8 ++++++++ toolchain/export-toolchain/Makefile.in | 28 ++++++++++++++++++++++++++ toolchain/uClibc/Config.in | 6 ++++++ 5 files changed, 46 insertions(+) create mode 100644 toolchain/export-toolchain/Config.in create mode 100644 toolchain/export-toolchain/Makefile.in diff --git a/toolchain/Config.in b/toolchain/Config.in index d66ce1d38a..b0eb85daca 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -26,6 +26,8 @@ config BR2_TOOLCHAIN_SOURCE default y if BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_EXTERNAL_SOURCE default n if BR2_TOOLCHAIN_EXTERNAL +source "toolchain/export-toolchain/Config.in" + source "target/device/Config.in.toolchain" source "toolchain/Config.in.1" diff --git a/toolchain/Makefile.in b/toolchain/Makefile.in index bdabde9adb..16f33f6bc4 100644 --- a/toolchain/Makefile.in +++ b/toolchain/Makefile.in @@ -47,3 +47,5 @@ CFLAGS_COMBINE = $(call cc-option,-combine,) # gcc has a bunch of needed stuff.... include toolchain/gcc/Makefile.in +include toolchain/export-toolchain/Makefile.in + diff --git a/toolchain/export-toolchain/Config.in b/toolchain/export-toolchain/Config.in new file mode 100644 index 0000000000..1de8dcb5bc --- /dev/null +++ b/toolchain/export-toolchain/Config.in @@ -0,0 +1,8 @@ +config BR2_EXPORT_TOOLCHAIN + bool "Create script exporting toolchain to home directory" + default n + help + This will generate a batchfile which, if run + will add the Buildroot toolchain to the user PATH + The file is called "$(ARCH)-uclibc-gcc-$(GCC_VERSION).sh" + diff --git a/toolchain/export-toolchain/Makefile.in b/toolchain/export-toolchain/Makefile.in new file mode 100644 index 0000000000..94ea134918 --- /dev/null +++ b/toolchain/export-toolchain/Makefile.in @@ -0,0 +1,28 @@ +# This generates a script which exports the toolchain +# using a shell script + +GCC_SCRIPT:=$(ARCH)-uclibc-gcc-$(GCC_VERSION).sh +GCC_SCRIPT_TEMP:=$(BINARIES_DIR)/$(GCC_SCRIPT) + +~/$(GCC_SCRIPT): cross_compiler + @echo "#!/bin/sh" > $(GCC_SCRIPT_TEMP) + @echo "# $(ARCH) cross compiler toolchain created $(DATE)" >> $(GCC_SCRIPT_TEMP) + @echo "# gcc-$(GCC_VERSION)" >> $(GCC_SCRIPT_TEMP) + @echo "# binutils-$(BINUTILS_VERSION)" >> $(GCC_SCRIPT_TEMP) + @echo "# uClibc-$(UCLIBC_VERSION)" >> $(GCC_SCRIPT_TEMP) + @echo "export GCCROOT=$(STAGING_DIR)/usr" >> $(GCC_SCRIPT_TEMP) + @echo "export PATH=\$$PATH:\$$GCCROOT/bin" >> $(GCC_SCRIPT_TEMP) + @echo "export CROSS_COMPILE=$(REAL_GNU_TARGET_NAME)-" >> $(GCC_SCRIPT_TEMP) + @cp $(GCC_SCRIPT_TEMP) ~/$(GCC_SCRIPT) + @cat ~/$(GCC_SCRIPT) + +export-toolchain: ~/$(GCC_SCRIPT) + +export-toolchain-clean: + rm -f ~/$(GCC_SCRIPT) + rm -f $(GCC_SCRIPT_TEMP) + +ifeq ($(BR2_EXPORT_TOOLCHAIN),y) +TARGETS+=export-toolchain +endif + diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in index dbb961cff0..3c809c1081 100644 --- a/toolchain/uClibc/Config.in +++ b/toolchain/uClibc/Config.in @@ -27,6 +27,12 @@ choice endchoice +config UCLIBC_VERSION + string + default "0.9.28.3" if BR2_UCLIBC_VERSION_0_9_28_3 + default "0.9.29" if BR2_UCLIBC_VERSION_0_9_29 + default "0.9.30" if BR2_UCLIBC_VERSION_0_9_30 + default "snapshot" if BR2_UCLIBC_VERSION_SNAPSHOT config BR2_USE_UCLIBC_SNAPSHOT string "Date (yyyymmdd) of snapshot or 'snapshot' for latest" -- 2.30.2