1 # Copyright (C) 2006-2013 OpenWrt.org
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
7 menuconfig TARGET_OPTIONS
8 bool "Target Options" if DEVEL
10 config TARGET_OPTIMIZATION
11 string "Target Optimizations" if TARGET_OPTIONS
12 default DEFAULT_TARGET_OPTIMIZATION
14 Optimizations to use when building for the target host.
17 bool "Use software floating point by default" if TARGET_OPTIONS
19 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
21 If your target CPU does not have a Floating Point Unit (FPU) or a
22 kernel FPU emulator, but you still wish to support floating point
23 functions, then everything will need to be compiled with soft floating
24 point support (-msoft-float).
26 Most people will answer N.
29 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
31 depends on !GCC_VERSION_4_6
34 If your target CPU does support the MIPS16 instruction set
35 and you want to use it for packages, enable this option.
36 MIPS16 produces smaller binaries thus reducing pressure on
39 Most people will answer N.
42 menuconfig EXTERNAL_TOOLCHAIN
44 prompt "Use external toolchain" if DEVEL
46 If enabled, OpenWrt will compile using an existing toolchain instead of compiling one
48 config NATIVE_TOOLCHAIN
50 prompt "Use host's toolchain" if DEVEL
51 depends on EXTERNAL_TOOLCHAIN
54 If enabled, OpenWrt will compile using the native toolchain for your host instead of compiling one
58 prompt "Target name" if DEVEL
59 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
60 default "arm-unknown-linux-gnu" if arm
61 default "armeb-unknown-linux-gnu" if armeb
62 default "i486-unknown-linux-gnu" if i386
63 default "mips-unknown-linux-gnu" if mips
64 default "mipsel-unknown-linux-gnu" if mipsel
65 default "powerpc-unknown-linux-gnu" if powerpc
66 default "x86_64-unknown-linux-gnu" if x86_64
68 config TOOLCHAIN_PREFIX
70 prompt "Toolchain prefix" if DEVEL
71 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
72 default "arm-unknown-linux-gnu-" if arm
73 default "armeb-unknown-linux-gnu-" if armeb
74 default "i486-unknown-linux-gnu-" if i386
75 default "mips-unknown-linux-gnu-" if mips
76 default "mipsel-unknown-linux-gnu-" if mipsel
77 default "powerpc-unknown-linux-gnu-" if powerpc
78 default "x86_64-unknown-linux-gnu-" if x86_64
82 prompt "Toolchain root" if DEVEL
83 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
84 default "/opt/cross/arm-unknown-linux-gnu" if arm
85 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
86 default "/opt/cross/i486-unknown-linux-gnu" if i386
87 default "/opt/cross/mips-unknown-linux-gnu" if mips
88 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
89 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
90 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
94 prompt "Toolchain libc" if DEVEL
95 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
98 Specify the libc type used by the external toolchain. The given value us passed as -m
99 flag to all gcc and g++ invocations. This is mainly intended for multilib toolchains
100 which support glibc and uclibc at the same time. If no value is specified, no -m flag
103 config TOOLCHAIN_BIN_PATH
105 prompt "Toolchain program path" if DEVEL
106 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
107 default "./usr/bin ./bin"
109 Specify additional directories searched for toolchain binaries (override PATH)
110 Use ./DIR for directories relative to the root above
112 config TOOLCHAIN_INC_PATH
114 prompt "Toolchain include path" if DEVEL
115 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
116 default "./usr/include ./include"
118 Specify additional directories searched for header files (override CPPFLAGS)
119 Use ./DIR for directories relative to the root above
121 config TOOLCHAIN_LIB_PATH
123 prompt "Toolchain library path" if DEVEL
124 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
125 default "./usr/lib ./lib"
127 Specify additional directories searched for libraries (override LDFLAGS)
128 Use ./DIR for directories relative to the root above
130 config NEED_TOOLCHAIN
133 default y if !EXTERNAL_TOOLCHAIN
135 menuconfig TOOLCHAINOPTS
136 bool "Toolchain Options" if DEVEL
137 depends on NEED_TOOLCHAIN
139 menuconfig EXTRA_TARGET_ARCH
141 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
143 default y if powerpc64
146 Some builds may require a 'biarch' toolchain. This option
147 allows you to specify an additional target arch.
149 Most people will answer N here.
151 config EXTRA_TARGET_ARCH_NAME
153 default "powerpc64" if powerpc64
154 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
156 Specify the cpu name (eg powerpc64 or x86_64) of the
157 additional target architecture.
159 config EXTRA_TARGET_ARCH_OPTS
161 default "-m64" if powerpc64
162 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
164 If you're specifying an addition target architecture,
165 you'll probably need to also provide options to make
166 the compiler use this alternate arch.
168 For example, if you're building a compiler that can build
169 both powerpc and powerpc64 binaries, you'll need to
174 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
175 default MIPS64_ABI_N64
177 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
180 config MIPS64_ABI_N64
183 config MIPS64_ABI_N32
186 config MIPS64_ABI_O32
191 comment "Binary tools"
192 depends on TOOLCHAINOPTS
194 source "toolchain/binutils/Config.in"
197 depends on TOOLCHAINOPTS
199 source "toolchain/gcc/Config.in"
202 depends on TOOLCHAINOPTS
205 prompt "C Library implementation" if TOOLCHAINOPTS
206 default LIBC_USE_UCLIBC
208 Select the C library implementation.
210 config LIBC_USE_EGLIBC
215 config LIBC_USE_UCLIBC
223 depends on !(mips64 || mips64el)
227 source "toolchain/eglibc/Config.in"
228 source "toolchain/uClibc/Config.in"
229 source "toolchain/musl/Config.in"
232 depends on TOOLCHAINOPTS
237 prompt "Build gdb" if TOOLCHAINOPTS
238 default y if !EXTERNAL_TOOLCHAIN
240 Enable if you want to build the gdb
244 prompt "Build insight-gdb" if TOOLCHAINOPTS
248 Enable if you want to build insight-gdb
255 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
260 config USE_EXTERNAL_LIBC
262 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
264 source "toolchain/gcc/Config.version"
266 source "toolchain/eglibc/Config.version"
267 source "toolchain/uClibc/Config.version"
268 source "toolchain/musl/Config.version"
272 default "eglibc" if USE_EGLIBC
273 default "uClibc" if USE_UCLIBC
274 default "musl" if USE_MUSL
278 default EGLIBC_VERSION if USE_EGLIBC
279 default UCLIBC_VERSION if USE_UCLIBC
280 default MUSL_VERSION if USE_MUSL
284 default "gnueabi" if USE_EGLIBC && (arm || armeb)
285 default "gnu" if USE_EGLIBC && !(arm || armeb)
286 default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
287 default "uclibc" if USE_UCLIBC && !(arm || armeb)
288 default "muslgnueabi" if USE_MUSL && (arm || armeb)
289 default "musl" if USE_MUSL && !(arm || armeb)
292 depends on mips64 || mips64el
294 default "64" if MIPS64_ABI_N64
295 default "n32" if MIPS64_ABI_N32
296 default "32" if MIPS64_ABI_O32