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_MUSL
119 config TOOLCHAIN_LIBC
121 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
122 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
123 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
125 config TOOLCHAIN_BIN_PATH
127 prompt "Toolchain program path" if DEVEL
128 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
129 default "./usr/bin ./bin"
131 Specify additional directories searched for toolchain binaries
132 (override PATH). Use ./DIR for directories relative to the root above.
134 config TOOLCHAIN_INC_PATH
136 prompt "Toolchain include path" if DEVEL
137 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
138 default "./usr/include ./include"
140 Specify additional directories searched for header files (override
141 CPPFLAGS). Use ./DIR for directories relative to the root above.
143 config TOOLCHAIN_LIB_PATH
145 prompt "Toolchain library path" if DEVEL
146 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
147 default "./usr/lib ./lib"
149 Specify additional directories searched for libraries (override LDFLAGS).
150 Use ./DIR for directories relative to the root above.
152 config NEED_TOOLCHAIN
155 default y if !EXTERNAL_TOOLCHAIN
157 menuconfig TOOLCHAINOPTS
158 bool "Toolchain Options" if DEVEL
159 depends on NEED_TOOLCHAIN
161 menuconfig EXTRA_TARGET_ARCH
163 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
167 Some builds may require a 'biarch' toolchain. This option
168 allows you to specify an additional target arch.
170 Most people will answer N here.
172 config EXTRA_TARGET_ARCH_NAME
174 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
176 Specify the cpu name (eg powerpc64 or x86_64) of the
177 additional target architecture.
179 config EXTRA_TARGET_ARCH_OPTS
181 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
183 If you're specifying an addition target architecture,
184 you'll probably need to also provide options to make
185 the compiler use this alternate arch.
187 For example, if you're building a compiler that can build
188 both powerpc and powerpc64 binaries, you'll need to
193 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
194 default MIPS64_ABI_N64
196 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
199 config MIPS64_ABI_N64
202 config MIPS64_ABI_N32
203 depends on !LIBC_USE_MUSL
206 config MIPS64_ABI_O32
211 comment "Binary tools"
212 depends on TOOLCHAINOPTS
214 source "toolchain/binutils/Config.in"
217 depends on TOOLCHAINOPTS
219 source "toolchain/gcc/Config.in"
223 depends on ( i386 || x86_64 )
224 prompt "Build nasm" if TOOLCHAINOPTS
227 Enable if you want to build nasm
230 depends on TOOLCHAINOPTS
233 prompt "C Library implementation" if TOOLCHAINOPTS
234 default LIBC_USE_GLIBC if arc
235 default LIBC_USE_MUSL
237 Select the C library implementation.
239 config LIBC_USE_GLIBC
250 source "toolchain/musl/Config.in"
253 depends on TOOLCHAINOPTS
257 prompt "Build gdb" if TOOLCHAINOPTS
258 default y if !EXTERNAL_TOOLCHAIN
260 Enable if you want to build the gdb.
265 prompt "Build gdb with python binding"
268 Enable the python bindings for GDB to allow using python in the gdb shell.
271 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
275 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
279 default y if !PKG_CC_STACKPROTECTOR_NONE
282 config USE_EXTERNAL_LIBC
284 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
286 source "toolchain/binutils/Config.version"
287 source "toolchain/gcc/Config.version"
291 default "glibc" if USE_GLIBC
292 default "musl" if USE_MUSL
296 default "gnueabi" if USE_GLIBC && (arm || armeb)
297 default "gnu" if USE_GLIBC && !(arm || armeb)
298 default "muslgnueabi" if USE_MUSL && (arm || armeb)
299 default "musl" if USE_MUSL && !(arm || armeb)
302 depends on mips64 || mips64el
304 default "64" if MIPS64_ABI_N64
305 default "n32" if MIPS64_ABI_N32
306 default "32" if MIPS64_ABI_O32