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