aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Baker <mbm@openwrt.org>2006-08-10 19:25:26 +0000
committerMike Baker <mbm@openwrt.org>2006-08-10 19:25:26 +0000
commit92167e106716c86914b748fd1fa8d3a6ceee0a4c (patch)
treeda39c81e5fe3d3a57dc4741eb59e4756a9f32d0d
parent6edd808cbdc0e32cfa5380525812d8c11d6630d2 (diff)
downloadupstream-92167e106716c86914b748fd1fa8d3a6ceee0a4c.tar.gz
upstream-92167e106716c86914b748fd1fa8d3a6ceee0a4c.tar.bz2
upstream-92167e106716c86914b748fd1fa8d3a6ceee0a4c.zip
add secret option to use host's toolchain when native compiling
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4553 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--Config.in2
-rw-r--r--package/base-files/Makefile3
-rw-r--r--rules.mk9
-rw-r--r--toolchain/Config.in7
-rw-r--r--toolchain/Makefile15
5 files changed, 28 insertions, 8 deletions
diff --git a/Config.in b/Config.in
index caa7944799..d1d66ff0db 100644
--- a/Config.in
+++ b/Config.in
@@ -16,7 +16,7 @@ menuconfig DEVEL
bool "Advanced configuration options (for developers)"
default n
select BUILDOPTS
- select TOOLCHAINOPTS
+ select TOOLCHAINOPTS if !NATIVE_TOOLCHAIN
config BROKEN
bool "Show broken platforms / packages" if DEVEL
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index e41e1fd798..dce07fe507 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -86,6 +86,7 @@ define Package/libgcc
SECTION:=libs
CATEGORY:=Libraries
DEFAULT:=y
+ DEPENDS:=@!NATIVE_TOOLCHAIN
TITLE:=GCC support library
VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
DESCRIPTION:=$(TITLE)
@@ -94,6 +95,7 @@ endef
define Package/libpthread
$(call Package/base-files$(TARGET))
DEFAULT:=n
+ DEPENDS:=@!NATIVE_TOOLCHAIN
VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
TITLE:=POSIX thread library
DESCRIPTION:=POSIX thread library
@@ -103,6 +105,7 @@ endef
define Package/uclibc
$(call Package/base-files$(TARGET))
VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
+ DEPENDS:=@!NATIVE_TOOLCHAIN
TITLE:=C library
DESCRIPTION:=C library for embedded systems
endef
diff --git a/rules.mk b/rules.mk
index a8d3647b6d..3645b064f7 100644
--- a/rules.mk
+++ b/rules.mk
@@ -33,9 +33,12 @@ STAMP_DIR:=$(BUILD_DIR)/stamp
TARGET_DIR:=$(BUILD_DIR)/root
IPKG_STATE_DIR:=$(TARGET_DIR)/usr/lib/ipkg
-REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
-GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
-TARGET_CROSS:=$(OPTIMIZE_FOR_CPU)-linux-uclibc-
+ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
+ REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
+ GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
+ TARGET_CROSS:=$(OPTIMIZE_FOR_CPU)-linux-uclibc-
+endif
+
IMAGE:=$(BUILD_DIR)/root_fs_$(ARCH)
TARGET_PATH:=$(STAGING_DIR)/usr/bin:$(STAGING_DIR)/bin:$(PATH)
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 37af938b3b..b5258ddce9 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -1,7 +1,14 @@
#
+config NATIVE_TOOLCHAIN
+ bool
+ prompt "Use host's toolchain" if DEVEL && BROKEN
+ default n
+ help
+ If enabled, OpenWrt will compile using your existing toolchain instead of compiling one
menuconfig TOOLCHAINOPTS
bool "Toolchain Options" if DEVEL
+ depends !NATIVE_TOOLCHAIN
source "toolchain/binutils/Config.in"
source "toolchain/gcc/Config.in"
diff --git a/toolchain/Makefile b/toolchain/Makefile
index 92069acb98..fb54bddf90 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -7,7 +7,12 @@
# Main makefile for the toolchain
#
include $(TOPDIR)/rules.mk
-TARGETS-y:=sed kernel-headers sstrip binutils gcc uClibc ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma
+TARGETS-y:=sed kernel-headers sstrip
+ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
+ TARGETS-y+=binutils gcc uClibc
+endif
+TARGETS-y+=ipkg-utils libnotimpl ext2fs squashfs jffs2 lzma
+
TARGETS-$(CONFIG_GDB) += gdb
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
@@ -21,9 +26,11 @@ clean: $(TARGETS_CLEAN)
kernel-headers-prepare: sed-install
uClibc-prepare: kernel-headers-prepare sstrip-install
-binutils-prepare: uClibc-prepare
-gcc-prepare: binutils-install
-uClibc-compile: gcc-compile
+ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
+ binutils-prepare: uClibc-prepare
+ gcc-prepare: binutils-install
+ uClibc-compile: gcc-compile
+endif
gcc-install: uClibc-install
squashfs-compile: lzma-install