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