musl: fix getopt optional argument processing
[openwrt/svn-archive/archive.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 depends on !GCC_VERSION_4_6
32 default y
33 help
34 If your target CPU does support the MIPS16 instruction set
35 and you want to use it for packages, enable this option.
36 MIPS16 produces smaller binaries thus reducing pressure on
37 caches and TLB.
38
39 Most people will answer N.
40
41
42 menuconfig EXTERNAL_TOOLCHAIN
43 bool
44 prompt "Use external toolchain" if DEVEL
45 help
46 If enabled, OpenWrt will compile using an existing toolchain instead of
47 compiling one.
48
49 config NATIVE_TOOLCHAIN
50 bool
51 prompt "Use host's toolchain" if DEVEL
52 depends on EXTERNAL_TOOLCHAIN
53 select NO_STRIP
54 help
55 If enabled, OpenWrt will compile using the native toolchain for your
56 host instead of compiling one.
57
58 config TARGET_NAME
59 string
60 prompt "Target name" if DEVEL
61 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
62 default "arm-unknown-linux-gnu" if arm
63 default "armeb-unknown-linux-gnu" if armeb
64 default "i486-unknown-linux-gnu" if i386
65 default "mips-unknown-linux-gnu" if mips
66 default "mipsel-unknown-linux-gnu" if mipsel
67 default "powerpc-unknown-linux-gnu" if powerpc
68 default "x86_64-unknown-linux-gnu" if x86_64
69
70 config TOOLCHAIN_PREFIX
71 string
72 prompt "Toolchain prefix" if DEVEL
73 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
74 default "arm-unknown-linux-gnu-" if arm
75 default "armeb-unknown-linux-gnu-" if armeb
76 default "i486-unknown-linux-gnu-" if i386
77 default "mips-unknown-linux-gnu-" if mips
78 default "mipsel-unknown-linux-gnu-" if mipsel
79 default "powerpc-unknown-linux-gnu-" if powerpc
80 default "x86_64-unknown-linux-gnu-" if x86_64
81
82 config TOOLCHAIN_ROOT
83 string
84 prompt "Toolchain root" if DEVEL
85 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
86 default "/opt/cross/arm-unknown-linux-gnu" if arm
87 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
88 default "/opt/cross/i486-unknown-linux-gnu" if i386
89 default "/opt/cross/mips-unknown-linux-gnu" if mips
90 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
91 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
92 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
93
94 config TOOLCHAIN_LIBC
95 string
96 prompt "Toolchain libc" if DEVEL
97 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
98 default "uclibc"
99 help
100 Specify the libc type used by the external toolchain. The given value
101 is passed as -m flag to all gcc and g++ invocations. This is mainly
102 intended for multilib toolchains which support glibc and uclibc at
103 the same time. If no value is specified, no -m flag is passed.
104
105 config TOOLCHAIN_BIN_PATH
106 string
107 prompt "Toolchain program path" if DEVEL
108 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
109 default "./usr/bin ./bin"
110 help
111 Specify additional directories searched for toolchain binaries
112 (override PATH). Use ./DIR for directories relative to the root above.
113
114 config TOOLCHAIN_INC_PATH
115 string
116 prompt "Toolchain include path" if DEVEL
117 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
118 default "./usr/include ./include"
119 help
120 Specify additional directories searched for header files (override
121 CPPFLAGS). Use ./DIR for directories relative to the root above.
122
123 config TOOLCHAIN_LIB_PATH
124 string
125 prompt "Toolchain library path" if DEVEL
126 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
127 default "./usr/lib ./lib"
128 help
129 Specify additional directories searched for libraries (override LDFLAGS).
130 Use ./DIR for directories relative to the root above.
131
132 config NEED_TOOLCHAIN
133 bool
134 depends on DEVEL
135 default y if !EXTERNAL_TOOLCHAIN
136
137 menuconfig TOOLCHAINOPTS
138 bool "Toolchain Options" if DEVEL
139 depends on NEED_TOOLCHAIN
140
141 menuconfig EXTRA_TARGET_ARCH
142 bool
143 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
144 depends on !sparc
145 default y if powerpc64
146 default n
147 help
148 Some builds may require a 'biarch' toolchain. This option
149 allows you to specify an additional target arch.
150
151 Most people will answer N here.
152
153 config EXTRA_TARGET_ARCH_NAME
154 string
155 default "powerpc64" if powerpc64
156 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
157 help
158 Specify the cpu name (eg powerpc64 or x86_64) of the
159 additional target architecture.
160
161 config EXTRA_TARGET_ARCH_OPTS
162 string
163 default "-m64" if powerpc64
164 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
165 help
166 If you're specifying an addition target architecture,
167 you'll probably need to also provide options to make
168 the compiler use this alternate arch.
169
170 For example, if you're building a compiler that can build
171 both powerpc and powerpc64 binaries, you'll need to
172 specify -m64 here.
173
174
175 choice
176 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
177 default MIPS64_ABI_N64
178 help
179 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
180 n32 and n64.
181
182 config MIPS64_ABI_N64
183 bool "n64"
184
185 config MIPS64_ABI_N32
186 bool "n32"
187
188 config MIPS64_ABI_O32
189 bool "o32"
190
191 endchoice
192
193 comment "Binary tools"
194 depends on TOOLCHAINOPTS
195
196 source "toolchain/binutils/Config.in"
197
198 comment "Compiler"
199 depends on TOOLCHAINOPTS
200
201 source "toolchain/gcc/Config.in"
202
203 comment "C Library"
204 depends on TOOLCHAINOPTS
205
206 choice
207 prompt "C Library implementation" if TOOLCHAINOPTS
208 default LIBC_USE_UCLIBC
209 help
210 Select the C library implementation.
211
212 config LIBC_USE_EGLIBC
213 bool "Use eglibc"
214 select USE_EGLIBC
215 depends on !avr32
216
217 config LIBC_USE_UCLIBC
218 select USE_UCLIBC
219 bool "Use uClibc"
220
221 config LIBC_USE_MUSL
222 bool "Use musl"
223 select USE_MUSL
224 depends on !(mips64 || mips64el)
225
226 endchoice
227
228 source "toolchain/eglibc/Config.in"
229 source "toolchain/uClibc/Config.in"
230 source "toolchain/musl/Config.in"
231
232 comment "Debuggers"
233 depends on TOOLCHAINOPTS
234
235 config GDB
236 bool
237 depends on !avr32
238 prompt "Build gdb" if TOOLCHAINOPTS
239 default y if !EXTERNAL_TOOLCHAIN
240 help
241 Enable if you want to build the gdb.
242
243 config INSIGHT
244 bool
245 prompt "Build insight-gdb" if TOOLCHAINOPTS
246 select GDB
247 default n
248 help
249 Enable if you want to build insight-gdb.
250
251 config USE_EGLIBC
252 bool
253 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && octeon
254
255 config USE_UCLIBC
256 bool
257 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !octeon
258
259 config USE_MUSL
260 bool
261
262 config USE_EXTERNAL_LIBC
263 bool
264 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
265
266 source "toolchain/gcc/Config.version"
267
268 source "toolchain/eglibc/Config.version"
269 source "toolchain/uClibc/Config.version"
270 source "toolchain/musl/Config.version"
271
272 config LIBC
273 string
274 default "eglibc" if USE_EGLIBC
275 default "uClibc" if USE_UCLIBC
276 default "musl" if USE_MUSL
277
278 config LIBC_VERSION
279 string
280 default EGLIBC_VERSION if USE_EGLIBC
281 default UCLIBC_VERSION if USE_UCLIBC
282 default MUSL_VERSION if USE_MUSL
283
284 config TARGET_SUFFIX
285 string
286 default "gnueabi" if USE_EGLIBC && (arm || armeb)
287 default "gnu" if USE_EGLIBC && !(arm || armeb)
288 default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
289 default "uclibc" if USE_UCLIBC && !(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"