ath79: consolidate common definitions for OpenMesh devices
[openwrt/openwrt.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 menuconfig EXTERNAL_TOOLCHAIN
42 bool
43 prompt "Use external toolchain" if DEVEL
44 help
45 If enabled, the buildroot will compile using an existing toolchain instead of
46 compiling one.
47
48 config NATIVE_TOOLCHAIN
49 bool
50 prompt "Use host's toolchain" if DEVEL
51 depends on EXTERNAL_TOOLCHAIN
52 select NO_STRIP
53 help
54 If enabled, the buildroot will compile using the native toolchain for your
55 host instead of compiling one.
56
57 config TARGET_NAME
58 string
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
70
71 config TOOLCHAIN_PREFIX
72 string
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
84
85 config TOOLCHAIN_ROOT
86 string
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
98
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
103 help
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.
108
109 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
110 bool "glibc"
111 select USE_GLIBC
112
113 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
114 bool "musl"
115 select USE_MUSL
116
117 endchoice
118
119 config TOOLCHAIN_LIBC
120 string
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
124
125 config TOOLCHAIN_BIN_PATH
126 string
127 prompt "Toolchain program path" if DEVEL
128 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
129 default "./usr/bin ./bin"
130 help
131 Specify additional directories searched for toolchain binaries
132 (override PATH). Use ./DIR for directories relative to the root above.
133
134 config TOOLCHAIN_INC_PATH
135 string
136 prompt "Toolchain include path" if DEVEL
137 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
138 default "./usr/include ./include"
139 help
140 Specify additional directories searched for header files (override
141 CPPFLAGS). Use ./DIR for directories relative to the root above.
142
143 config TOOLCHAIN_LIB_PATH
144 string
145 prompt "Toolchain library path" if DEVEL
146 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
147 default "./usr/lib ./lib"
148 help
149 Specify additional directories searched for libraries (override LDFLAGS).
150 Use ./DIR for directories relative to the root above.
151
152 config NEED_TOOLCHAIN
153 bool
154 depends on DEVEL
155 default y if !EXTERNAL_TOOLCHAIN
156
157 menuconfig TOOLCHAINOPTS
158 bool "Toolchain Options" if DEVEL
159 depends on NEED_TOOLCHAIN
160
161 menuconfig EXTRA_TARGET_ARCH
162 bool
163 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
164 depends on !sparc
165 default n
166 help
167 Some builds may require a 'biarch' toolchain. This option
168 allows you to specify an additional target arch.
169
170 Most people will answer N here.
171
172 config EXTRA_TARGET_ARCH_NAME
173 string
174 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
175 help
176 Specify the cpu name (eg powerpc64 or x86_64) of the
177 additional target architecture.
178
179 config EXTRA_TARGET_ARCH_OPTS
180 string
181 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
182 help
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.
186
187 For example, if you're building a compiler that can build
188 both powerpc and powerpc64 binaries, you'll need to
189 specify -m64 here.
190
191
192 choice
193 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
194 default MIPS64_ABI_N64
195 help
196 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
197 n32 and n64.
198
199 config MIPS64_ABI_N64
200 bool "n64"
201
202 config MIPS64_ABI_N32
203 depends on !LIBC_USE_MUSL
204 bool "n32"
205
206 config MIPS64_ABI_O32
207 bool "o32"
208
209 endchoice
210
211 comment "Binary tools"
212 depends on TOOLCHAINOPTS
213
214 source "toolchain/binutils/Config.in"
215
216 comment "Compiler"
217 depends on TOOLCHAINOPTS
218
219 source "toolchain/gcc/Config.in"
220
221 config NASM
222 bool
223 depends on ( i386 || x86_64 )
224 prompt "Build nasm" if TOOLCHAINOPTS
225 default y
226 help
227 Enable if you want to build nasm
228
229 comment "C Library"
230 depends on TOOLCHAINOPTS
231
232 choice
233 prompt "C Library implementation" if TOOLCHAINOPTS
234 default LIBC_USE_GLIBC if arc
235 default LIBC_USE_MUSL
236 help
237 Select the C library implementation.
238
239 config LIBC_USE_GLIBC
240 bool "Use glibc"
241 select USE_GLIBC
242
243 config LIBC_USE_MUSL
244 select USE_MUSL
245 bool "Use musl"
246 depends on !arc
247
248 endchoice
249
250 source "toolchain/musl/Config.in"
251
252 comment "Debuggers"
253 depends on TOOLCHAINOPTS
254
255 config GDB
256 bool
257 prompt "Build gdb" if TOOLCHAINOPTS
258 default y if !EXTERNAL_TOOLCHAIN
259 help
260 Enable if you want to build the gdb.
261
262 config USE_GLIBC
263 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
264 bool
265
266 config USE_MUSL
267 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
268 bool
269
270 config SSP_SUPPORT
271 default y if !PKG_CC_STACKPROTECTOR_NONE
272 bool
273
274 config USE_EXTERNAL_LIBC
275 bool
276 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
277
278 source "toolchain/binutils/Config.version"
279 source "toolchain/gcc/Config.version"
280
281 config LIBC
282 string
283 default "glibc" if USE_GLIBC
284 default "musl" if USE_MUSL
285
286 config TARGET_SUFFIX
287 string
288 default "gnueabi" if USE_GLIBC && (arm || armeb)
289 default "gnu" if USE_GLIBC && !(arm || armeb)
290 default "muslgnueabi" if USE_MUSL && (arm || armeb)
291 default "musl" if USE_MUSL && !(arm || armeb)
292
293 config MIPS64_ABI
294 depends on mips64 || mips64el
295 string
296 default "64" if MIPS64_ABI_N64
297 default "n32" if MIPS64_ABI_N32
298 default "32" if MIPS64_ABI_O32
299 default "64"