toolchain: Simplify libc selection
[openwrt/staging/dedeckeh.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_UCLIBC
114 bool "uClibc"
115 select USE_UCLIBC
116 depends on !(aarch64 || aarch64_be)
117
118 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
119 bool "musl"
120 select USE_MUSL
121
122 endchoice
123
124 config TOOLCHAIN_LIBC
125 string
126 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
127 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
128 default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC
129 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
130
131 config TOOLCHAIN_BIN_PATH
132 string
133 prompt "Toolchain program path" if DEVEL
134 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
135 default "./usr/bin ./bin"
136 help
137 Specify additional directories searched for toolchain binaries
138 (override PATH). Use ./DIR for directories relative to the root above.
139
140 config TOOLCHAIN_INC_PATH
141 string
142 prompt "Toolchain include path" if DEVEL
143 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
144 default "./usr/include ./include"
145 help
146 Specify additional directories searched for header files (override
147 CPPFLAGS). Use ./DIR for directories relative to the root above.
148
149 config TOOLCHAIN_LIB_PATH
150 string
151 prompt "Toolchain library path" if DEVEL
152 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
153 default "./usr/lib ./lib"
154 help
155 Specify additional directories searched for libraries (override LDFLAGS).
156 Use ./DIR for directories relative to the root above.
157
158 config NEED_TOOLCHAIN
159 bool
160 depends on DEVEL
161 default y if !EXTERNAL_TOOLCHAIN
162
163 menuconfig TOOLCHAINOPTS
164 bool "Toolchain Options" if DEVEL
165 depends on NEED_TOOLCHAIN
166
167 menuconfig EXTRA_TARGET_ARCH
168 bool
169 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
170 depends on !sparc
171 default n
172 help
173 Some builds may require a 'biarch' toolchain. This option
174 allows you to specify an additional target arch.
175
176 Most people will answer N here.
177
178 config EXTRA_TARGET_ARCH_NAME
179 string
180 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
181 help
182 Specify the cpu name (eg powerpc64 or x86_64) of the
183 additional target architecture.
184
185 config EXTRA_TARGET_ARCH_OPTS
186 string
187 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
188 help
189 If you're specifying an addition target architecture,
190 you'll probably need to also provide options to make
191 the compiler use this alternate arch.
192
193 For example, if you're building a compiler that can build
194 both powerpc and powerpc64 binaries, you'll need to
195 specify -m64 here.
196
197
198 choice
199 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
200 default MIPS64_ABI_N64
201 help
202 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
203 n32 and n64.
204
205 config MIPS64_ABI_N64
206 bool "n64"
207
208 config MIPS64_ABI_N32
209 depends on !LIBC_USE_MUSL
210 bool "n32"
211
212 config MIPS64_ABI_O32
213 bool "o32"
214
215 endchoice
216
217 comment "Binary tools"
218 depends on TOOLCHAINOPTS
219
220 source "toolchain/binutils/Config.in"
221
222 comment "Compiler"
223 depends on TOOLCHAINOPTS
224
225 source "toolchain/gcc/Config.in"
226
227 config NASM
228 bool
229 depends on ( i386 || x86_64 )
230 prompt "Build nasm" if TOOLCHAINOPTS
231 default y
232 help
233 Enable if you want to build nasm
234
235 comment "C Library"
236 depends on TOOLCHAINOPTS
237
238 choice
239 prompt "C Library implementation" if TOOLCHAINOPTS
240 default LIBC_USE_UCLIBC if arc
241 default LIBC_USE_MUSL
242 help
243 Select the C library implementation.
244
245 config LIBC_USE_GLIBC
246 bool "Use glibc"
247 select USE_GLIBC
248 depends on !arc
249
250 config LIBC_USE_UCLIBC
251 select USE_UCLIBC
252 bool "Use uClibc"
253 depends on BROKEN || arc
254
255 config LIBC_USE_MUSL
256 select USE_MUSL
257 bool "Use musl"
258 depends on !arc
259
260 endchoice
261
262 source "toolchain/uClibc/Config.in"
263 source "toolchain/musl/Config.in"
264
265 comment "Debuggers"
266 depends on TOOLCHAINOPTS
267
268 config GDB
269 bool
270 prompt "Build gdb" if TOOLCHAINOPTS
271 default y if !EXTERNAL_TOOLCHAIN
272 help
273 Enable if you want to build the gdb.
274
275 config USE_GLIBC
276 bool
277
278 config USE_UCLIBC
279 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
280 bool
281
282 config USE_MUSL
283 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
284 bool
285
286 config SSP_SUPPORT
287 default y if USE_MUSL || GCC_LIBSSP
288 bool
289
290 config USE_EXTERNAL_LIBC
291 bool
292 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
293
294 source "toolchain/binutils/Config.version"
295 source "toolchain/gcc/Config.version"
296
297 config LIBC
298 string
299 default "glibc" if USE_GLIBC
300 default "uClibc" if USE_UCLIBC
301 default "musl" if USE_MUSL
302
303 config TARGET_SUFFIX
304 string
305 default "gnueabi" if USE_GLIBC && (arm || armeb)
306 default "gnu" if USE_GLIBC && !(arm || armeb)
307 default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
308 default "uclibc" if USE_UCLIBC && !(arm || armeb)
309 default "muslgnueabi" if USE_MUSL && (arm || armeb)
310 default "musl" if USE_MUSL && !(arm || armeb)
311
312 config MIPS64_ABI
313 depends on mips64 || mips64el
314 string
315 default "64" if MIPS64_ABI_N64
316 default "n32" if MIPS64_ABI_N32
317 default "32" if MIPS64_ABI_O32
318 default "64"