b8b4cfeb885f7fc3051ae9fe3a888148c4b73d3b
[openwrt/staging/chunkeey.git] / toolchain / Config.in
1 # Copyright (C) 2006-2013 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 menuconfig TARGET_OPTIONS
8 bool "Target Options" if DEVEL
9
10 config TARGET_OPTIMIZATION
11 string "Target Optimizations" if TARGET_OPTIONS
12 default DEFAULT_TARGET_OPTIMIZATION
13 help
14 Optimizations to use when building for the target host.
15
16 config SOFT_FLOAT
17 bool "Use software floating point by default" if TARGET_OPTIONS
18 default y if !HAS_FPU
19 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
20 help
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).
25
26 Most people will answer N.
27
28 config USE_MIPS16
29 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
30 depends on HAS_MIPS16
31 default y
32 help
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
36 caches and TLB.
37
38 Most people will answer N.
39
40
41 choice BPF_TOOLCHAIN
42 prompt "BPF toolchain" if DEVEL
43 default BPF_TOOLCHAIN_NONE
44
45 config BPF_TOOLCHAIN_NONE
46 bool "None"
47
48 config BPF_TOOLCHAIN_HOST
49 select USE_LLVM_HOST
50 bool "Use host LLVM toolchain"
51
52 config BPF_TOOLCHAIN_BUILD_LLVM
53 select USE_LLVM_BUILD
54 bool "Build LLVM toolchain for eBPF"
55 help
56 If enabled, a LLVM toolchain for building eBPF binaries will be built.
57 If this is not enabled, eBPF packages can only be built if the host
58 has a suitable toolchain
59 endchoice
60
61 config BPF_TOOLCHAIN_HOST_PATH
62 string
63 depends on BPF_TOOLCHAIN_HOST
64 prompt "Host LLVM toolchain path (prefix)" if DEVEL
65 default "/usr/local/opt/llvm" if HOST_OS_MACOS
66 default ""
67
68 menuconfig EXTERNAL_TOOLCHAIN
69 bool
70 prompt "Use external toolchain" if DEVEL
71 help
72 If enabled, the buildroot will compile using an existing toolchain instead of
73 compiling one.
74
75 config NATIVE_TOOLCHAIN
76 bool
77 prompt "Use host's toolchain" if DEVEL
78 depends on EXTERNAL_TOOLCHAIN
79 select NO_STRIP
80 help
81 If enabled, the buildroot will compile using the native toolchain for your
82 host instead of compiling one.
83
84 config TARGET_NAME
85 string
86 prompt "Target name" if DEVEL
87 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
88 default "aarch64-unknown-linux-gnu" if aarch64
89 default "aarch64_be-unknown-linux-gnu" if aarch64_be
90 default "arm-unknown-linux-gnu" if arm
91 default "armeb-unknown-linux-gnu" if armeb
92 default "i486-unknown-linux-gnu" if i386
93 default "mips-unknown-linux-gnu" if mips
94 default "mipsel-unknown-linux-gnu" if mipsel
95 default "powerpc-unknown-linux-gnu" if powerpc
96 default "x86_64-unknown-linux-gnu" if x86_64
97
98 config TOOLCHAIN_PREFIX
99 string
100 prompt "Toolchain prefix" if DEVEL
101 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
102 default "aarch64-unknown-linux-gnu" if aarch64
103 default "aarch64_be-unknown-linux-gnu" if aarch64_be
104 default "arm-unknown-linux-gnu-" if arm
105 default "armeb-unknown-linux-gnu-" if armeb
106 default "i486-unknown-linux-gnu-" if i386
107 default "mips-unknown-linux-gnu-" if mips
108 default "mipsel-unknown-linux-gnu-" if mipsel
109 default "powerpc-unknown-linux-gnu-" if powerpc
110 default "x86_64-unknown-linux-gnu-" if x86_64
111
112 config TOOLCHAIN_ROOT
113 string
114 prompt "Toolchain root" if DEVEL
115 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
116 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
117 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
118 default "/opt/cross/arm-unknown-linux-gnu" if arm
119 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
120 default "/opt/cross/i486-unknown-linux-gnu" if i386
121 default "/opt/cross/mips-unknown-linux-gnu" if mips
122 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
123 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
124 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
125
126 choice TOOLCHAIN_LIBC_TYPE
127 prompt "Toolchain libc" if DEVEL
128 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
129 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
130 help
131 Specify the libc type used by the external toolchain. The given value
132 is passed as -m flag to all gcc and g++ invocations. This is mainly
133 intended for multilib toolchains which support glibc and uclibc at
134 the same time. If no value is specified, no -m flag is passed.
135
136 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
137 bool "glibc"
138 select USE_GLIBC
139
140 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
141 bool "musl"
142 select USE_MUSL
143
144 endchoice
145
146 config TOOLCHAIN_LIBC
147 string
148 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
149 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
150 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
151
152 config TOOLCHAIN_BIN_PATH
153 string
154 prompt "Toolchain program path" if DEVEL
155 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
156 default "./usr/bin ./bin"
157 help
158 Specify additional directories searched for toolchain binaries
159 (override PATH). Use ./DIR for directories relative to the root above.
160
161 config TOOLCHAIN_INC_PATH
162 string
163 prompt "Toolchain include path" if DEVEL
164 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
165 default "./usr/include ./include"
166 help
167 Specify additional directories searched for header files (override
168 CPPFLAGS). Use ./DIR for directories relative to the root above.
169
170 config TOOLCHAIN_LIB_PATH
171 string
172 prompt "Toolchain library path" if DEVEL
173 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
174 default "./usr/lib ./lib"
175 help
176 Specify additional directories searched for libraries (override LDFLAGS).
177 Use ./DIR for directories relative to the root above.
178
179 config NEED_TOOLCHAIN
180 bool
181 depends on DEVEL
182 default y if !EXTERNAL_TOOLCHAIN
183
184 menuconfig TOOLCHAINOPTS
185 bool "Toolchain Options" if DEVEL
186 depends on NEED_TOOLCHAIN
187
188 menuconfig EXTRA_TARGET_ARCH
189 bool
190 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
191 depends on !sparc
192 default n
193 help
194 Some builds may require a 'biarch' toolchain. This option
195 allows you to specify an additional target arch.
196
197 Most people will answer N here.
198
199 config EXTRA_TARGET_ARCH_NAME
200 string
201 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
202 help
203 Specify the cpu name (eg powerpc64 or x86_64) of the
204 additional target architecture.
205
206 config EXTRA_TARGET_ARCH_OPTS
207 string
208 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
209 help
210 If you're specifying an addition target architecture,
211 you'll probably need to also provide options to make
212 the compiler use this alternate arch.
213
214 For example, if you're building a compiler that can build
215 both powerpc and powerpc64 binaries, you'll need to
216 specify -m64 here.
217
218
219 choice
220 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
221 default MIPS64_ABI_N64
222 help
223 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
224 n32 and n64.
225
226 config MIPS64_ABI_N64
227 bool "n64"
228
229 config MIPS64_ABI_N32
230 depends on !LIBC_USE_MUSL
231 bool "n32"
232
233 config MIPS64_ABI_O32
234 bool "o32"
235
236 endchoice
237
238 comment "Binary tools"
239 depends on TOOLCHAINOPTS
240
241 source "toolchain/binutils/Config.in"
242
243 comment "Compiler"
244 depends on TOOLCHAINOPTS
245
246 source "toolchain/gcc/Config.in"
247
248 config NASM
249 bool
250 depends on ( i386 || x86_64 )
251 prompt "Build nasm" if TOOLCHAINOPTS
252 default y
253 help
254 Enable if you want to build nasm
255
256 comment "C Library"
257 depends on TOOLCHAINOPTS
258
259 choice
260 prompt "C Library implementation" if TOOLCHAINOPTS
261 default LIBC_USE_GLIBC if arc
262 default LIBC_USE_MUSL
263 help
264 Select the C library implementation.
265
266 config LIBC_USE_GLIBC
267 bool "Use glibc"
268 select USE_GLIBC
269
270 config LIBC_USE_MUSL
271 select USE_MUSL
272 bool "Use musl"
273 depends on !arc
274
275 endchoice
276
277 source "toolchain/musl/Config.in"
278
279 comment "Debuggers"
280 depends on TOOLCHAINOPTS
281
282 config GDB
283 bool
284 prompt "Build gdb" if TOOLCHAINOPTS
285 default y if !EXTERNAL_TOOLCHAIN
286 help
287 Enable if you want to build the gdb.
288
289 config GDB_PYTHON
290 bool
291 depends on GDB
292 prompt "Build gdb with python binding"
293
294 help
295 Enable the python bindings for GDB to allow using python in the gdb shell.
296
297 config HAS_BPF_TOOLCHAIN
298 bool
299
300 config USE_LLVM_HOST
301 select HAS_BPF_TOOLCHAIN
302 bool
303
304 config USE_LLVM_BUILD
305 select HAS_BPF_TOOLCHAIN
306 bool
307
308 config USE_GLIBC
309 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
310 bool
311
312 config USE_MUSL
313 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
314 bool
315
316 config SSP_SUPPORT
317 default y if !PKG_CC_STACKPROTECTOR_NONE
318 bool
319
320 config USE_EXTERNAL_LIBC
321 bool
322 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
323
324 source "toolchain/binutils/Config.version"
325 source "toolchain/gcc/Config.version"
326
327 config LIBC
328 string
329 default "glibc" if USE_GLIBC
330 default "musl" if USE_MUSL
331
332 config TARGET_SUFFIX
333 string
334 default "gnueabi" if USE_GLIBC && (arm || armeb)
335 default "gnu" if USE_GLIBC && !(arm || armeb)
336 default "muslgnueabi" if USE_MUSL && (arm || armeb)
337 default "musl" if USE_MUSL && !(arm || armeb)
338
339 config MIPS64_ABI
340 depends on mips64 || mips64el
341 string
342 default "64" if MIPS64_ABI_N64
343 default "n32" if MIPS64_ABI_N32
344 default "32" if MIPS64_ABI_O32
345 default "64"