add secret option to use host's toolchain when native compiling
authorMike Baker <mbm@openwrt.org>
Thu, 10 Aug 2006 19:25:26 +0000 (19:25 +0000)
committerMike Baker <mbm@openwrt.org>
Thu, 10 Aug 2006 19:25:26 +0000 (19:25 +0000)
SVN-Revision: 4553

openwrt/Config.in
openwrt/package/base-files/Makefile
openwrt/rules.mk
openwrt/toolchain/Config.in
openwrt/toolchain/Makefile

index caa79447993336a95d72b372fcf7ecc2be769ecd..d1d66ff0db2a6611910e4170a3606da73e784794 100644 (file)
@@ -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
index e41e1fd7987af8fb00ab9eabc9ff12452cee3ea7..dce07fe5074e315d40a5a3372f47c642542025ef 100644 (file)
@@ -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
index a8d3647b6dd480e17b259870417637cded526bdc..3645b064f7b50b7e93a99f23fab45c7ab565e32a 100644 (file)
@@ -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)
index 37af938b3b7ad819831085f28b1b96ad6f2ae5f0..b5258ddce9892efd68d4b77ec4b9ea42dcc16b82 100644 (file)
@@ -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"
index 92069acb9850c954169f27c0c559b89c5b8ce02a..fb54bddf908db6b91ba711e5a71720a61ae42fa6 100644 (file)
@@ -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