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
33 If your target CPU does support the MIPS16 instruction set
34 and you want to use it for packages, enable this option.
35 MIPS16 produces smaller binaries thus reducing pressure on
38 Most people will answer N.
41 menuconfig EXTERNAL_TOOLCHAIN
43 prompt "Use external toolchain" if DEVEL
45 If enabled, the buildroot will compile using an existing toolchain instead of
48 config NATIVE_TOOLCHAIN
50 prompt "Use host's toolchain" if DEVEL
51 depends on EXTERNAL_TOOLCHAIN
54 If enabled, the buildroot will compile using the native toolchain for your
55 host instead of compiling one.
59 prompt "Target name" if DEVEL
60 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
61 default "aarch64-unknown-linux-gnu" if aarch64
62 default "aarch64_be-unknown-linux-gnu" if aarch64_be
63 default "arm-unknown-linux-gnu" if arm
64 default "armeb-unknown-linux-gnu" if armeb
65 default "i486-unknown-linux-gnu" if i386
66 default "mips-unknown-linux-gnu" if mips
67 default "mipsel-unknown-linux-gnu" if mipsel
68 default "powerpc-unknown-linux-gnu" if powerpc
69 default "x86_64-unknown-linux-gnu" if x86_64
71 config TOOLCHAIN_PREFIX
73 prompt "Toolchain prefix" if DEVEL
74 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
75 default "aarch64-unknown-linux-gnu" if aarch64
76 default "aarch64_be-unknown-linux-gnu" if aarch64_be
77 default "arm-unknown-linux-gnu-" if arm
78 default "armeb-unknown-linux-gnu-" if armeb
79 default "i486-unknown-linux-gnu-" if i386
80 default "mips-unknown-linux-gnu-" if mips
81 default "mipsel-unknown-linux-gnu-" if mipsel
82 default "powerpc-unknown-linux-gnu-" if powerpc
83 default "x86_64-unknown-linux-gnu-" if x86_64
87 prompt "Toolchain root" if DEVEL
88 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
89 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
90 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
91 default "/opt/cross/arm-unknown-linux-gnu" if arm
92 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
93 default "/opt/cross/i486-unknown-linux-gnu" if i386
94 default "/opt/cross/mips-unknown-linux-gnu" if mips
95 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
96 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
97 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
99 choice TOOLCHAIN_LIBC_TYPE
100 prompt "Toolchain libc" if DEVEL
101 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
102 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
104 Specify the libc type used by the external toolchain. The given value
105 is passed as -m flag to all gcc and g++ invocations. This is mainly
106 intended for multilib toolchains which support glibc and uclibc at
107 the same time. If no value is specified, no -m flag is passed.
109 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
113 config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC
116 depends on !(aarch64 || aarch64_be)
118 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
124 config TOOLCHAIN_LIBC
126 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
127 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
128 default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC
129 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
131 config TOOLCHAIN_BIN_PATH
133 prompt "Toolchain program path" if DEVEL
134 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
135 default "./usr/bin ./bin"
137 Specify additional directories searched for toolchain binaries
138 (override PATH). Use ./DIR for directories relative to the root above.
140 config TOOLCHAIN_INC_PATH
142 prompt "Toolchain include path" if DEVEL
143 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
144 default "./usr/include ./include"
146 Specify additional directories searched for header files (override
147 CPPFLAGS). Use ./DIR for directories relative to the root above.
149 config TOOLCHAIN_LIB_PATH
151 prompt "Toolchain library path" if DEVEL
152 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
153 default "./usr/lib ./lib"
155 Specify additional directories searched for libraries (override LDFLAGS).
156 Use ./DIR for directories relative to the root above.
158 config NEED_TOOLCHAIN
161 default y if !EXTERNAL_TOOLCHAIN
163 menuconfig TOOLCHAINOPTS
164 bool "Toolchain Options" if DEVEL
165 depends on NEED_TOOLCHAIN
167 menuconfig EXTRA_TARGET_ARCH
169 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
173 Some builds may require a 'biarch' toolchain. This option
174 allows you to specify an additional target arch.
176 Most people will answer N here.
178 config EXTRA_TARGET_ARCH_NAME
180 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
182 Specify the cpu name (eg powerpc64 or x86_64) of the
183 additional target architecture.
185 config EXTRA_TARGET_ARCH_OPTS
187 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
189 If you're specifying an addition target architecture,
190 you'll probably need to also provide options to make
191 the compiler use this alternate arch.
193 For example, if you're building a compiler that can build
194 both powerpc and powerpc64 binaries, you'll need to
199 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
200 default MIPS64_ABI_N64
202 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
205 config MIPS64_ABI_N64
208 config MIPS64_ABI_N32
209 depends on !LIBC_USE_MUSL
212 config MIPS64_ABI_O32
217 comment "Binary tools"
218 depends on TOOLCHAINOPTS
220 source "toolchain/binutils/Config.in"
223 depends on TOOLCHAINOPTS
225 source "toolchain/gcc/Config.in"
229 depends on ( i386 || x86_64 )
230 prompt "Build nasm" if TOOLCHAINOPTS
233 Enable if you want to build nasm
236 depends on TOOLCHAINOPTS
239 prompt "C Library implementation" if TOOLCHAINOPTS
240 default LIBC_USE_UCLIBC if arc
241 default LIBC_USE_GLIBC if powerpc64
242 default LIBC_USE_MUSL
244 Select the C library implementation.
246 config LIBC_USE_GLIBC
251 config LIBC_USE_UCLIBC
254 depends on !(aarch64 || aarch64_be || powerpc64)
255 depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc)
260 depends on !(arc || powerpc64)
264 source "toolchain/uClibc/Config.in"
265 source "toolchain/musl/Config.in"
268 depends on TOOLCHAINOPTS
272 prompt "Build gdb" if TOOLCHAINOPTS
273 default y if !EXTERNAL_TOOLCHAIN
275 Enable if you want to build the gdb.
278 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64)
282 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
286 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64)
290 default y if USE_MUSL || GCC_LIBSSP
293 config USE_EXTERNAL_LIBC
295 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
297 source "toolchain/binutils/Config.version"
298 source "toolchain/gcc/Config.version"
302 default "glibc" if USE_GLIBC
303 default "uClibc" if USE_UCLIBC
304 default "musl" if USE_MUSL
308 default "gnueabi" if USE_GLIBC && (arm || armeb)
309 default "gnu" if USE_GLIBC && !(arm || armeb)
310 default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
311 default "uclibc" if USE_UCLIBC && !(arm || armeb)
312 default "muslgnueabi" if USE_MUSL && (arm || armeb)
313 default "musl" if USE_MUSL && !(arm || armeb)
316 depends on mips64 || mips64el
318 default "64" if MIPS64_ABI_N64
319 default "n32" if MIPS64_ABI_N32
320 default "32" if MIPS64_ABI_O32