OSDN Git Service

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