1 # Copyright (C) 2006-2013 OpenWrt.org
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
7 menuconfig TARGET_OPTIONS
8 bool "Target Options" if DEVEL
10 config TARGET_OPTIMIZATION
11 string "Target Optimizations" if TARGET_OPTIONS
12 default DEFAULT_TARGET_OPTIMIZATION
14 Optimizations to use when building for the target host.
17 bool "Use software floating point by default" if TARGET_OPTIONS
19 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
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).
26 Most people will answer N.
29 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
31 depends on !GCC_VERSION_4_6
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
39 Most people will answer N.
42 menuconfig EXTERNAL_TOOLCHAIN
44 prompt "Use external toolchain" if DEVEL
46 If enabled, OpenWrt will compile using an existing toolchain instead of
49 config NATIVE_TOOLCHAIN
51 prompt "Use host's toolchain" if DEVEL
52 depends on EXTERNAL_TOOLCHAIN
55 If enabled, OpenWrt will compile using the native toolchain for your
56 host instead of compiling one.
60 prompt "Target name" if DEVEL
61 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
62 default "aarch64-unknown-linux-gnu" if aarch64
63 default "aarch64_be-unknown-linux-gnu" if aarch64_be
64 default "arm-unknown-linux-gnu" if arm
65 default "armeb-unknown-linux-gnu" if armeb
66 default "i486-unknown-linux-gnu" if i386
67 default "mips-unknown-linux-gnu" if mips
68 default "mipsel-unknown-linux-gnu" if mipsel
69 default "powerpc-unknown-linux-gnu" if powerpc
70 default "x86_64-unknown-linux-gnu" if x86_64
72 config TOOLCHAIN_PREFIX
74 prompt "Toolchain prefix" if DEVEL
75 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
76 default "aarch64-unknown-linux-gnu" if aarch64
77 default "aarch64_be-unknown-linux-gnu" if aarch64_be
78 default "arm-unknown-linux-gnu-" if arm
79 default "armeb-unknown-linux-gnu-" if armeb
80 default "i486-unknown-linux-gnu-" if i386
81 default "mips-unknown-linux-gnu-" if mips
82 default "mipsel-unknown-linux-gnu-" if mipsel
83 default "powerpc-unknown-linux-gnu-" if powerpc
84 default "x86_64-unknown-linux-gnu-" if x86_64
88 prompt "Toolchain root" if DEVEL
89 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
90 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
91 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
92 default "/opt/cross/arm-unknown-linux-gnu" if arm
93 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
94 default "/opt/cross/i486-unknown-linux-gnu" if i386
95 default "/opt/cross/mips-unknown-linux-gnu" if mips
96 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
97 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
98 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
100 config TOOLCHAIN_LIBC
102 prompt "Toolchain libc" if DEVEL
103 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
106 Specify the libc type used by the external toolchain. The given value
107 is passed as -m flag to all gcc and g++ invocations. This is mainly
108 intended for multilib toolchains which support glibc and uclibc at
109 the same time. If no value is specified, no -m flag is passed.
111 config TOOLCHAIN_BIN_PATH
113 prompt "Toolchain program path" if DEVEL
114 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
115 default "./usr/bin ./bin"
117 Specify additional directories searched for toolchain binaries
118 (override PATH). Use ./DIR for directories relative to the root above.
120 config TOOLCHAIN_INC_PATH
122 prompt "Toolchain include path" if DEVEL
123 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
124 default "./usr/include ./include"
126 Specify additional directories searched for header files (override
127 CPPFLAGS). Use ./DIR for directories relative to the root above.
129 config TOOLCHAIN_LIB_PATH
131 prompt "Toolchain library path" if DEVEL
132 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
133 default "./usr/lib ./lib"
135 Specify additional directories searched for libraries (override LDFLAGS).
136 Use ./DIR for directories relative to the root above.
138 config NEED_TOOLCHAIN
141 default y if !EXTERNAL_TOOLCHAIN
143 menuconfig TOOLCHAINOPTS
144 bool "Toolchain Options" if DEVEL
145 depends on NEED_TOOLCHAIN
147 menuconfig EXTRA_TARGET_ARCH
149 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
151 default y if powerpc64
154 Some builds may require a 'biarch' toolchain. This option
155 allows you to specify an additional target arch.
157 Most people will answer N here.
159 config EXTRA_TARGET_ARCH_NAME
161 default "powerpc64" if powerpc64
162 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
164 Specify the cpu name (eg powerpc64 or x86_64) of the
165 additional target architecture.
167 config EXTRA_TARGET_ARCH_OPTS
169 default "-m64" if powerpc64
170 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
172 If you're specifying an addition target architecture,
173 you'll probably need to also provide options to make
174 the compiler use this alternate arch.
176 For example, if you're building a compiler that can build
177 both powerpc and powerpc64 binaries, you'll need to
182 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
183 default MIPS64_ABI_N64
185 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
188 config MIPS64_ABI_N64
191 config MIPS64_ABI_N32
194 config MIPS64_ABI_O32
199 comment "Binary tools"
200 depends on TOOLCHAINOPTS
202 source "toolchain/binutils/Config.in"
205 depends on TOOLCHAINOPTS
207 source "toolchain/gcc/Config.in"
210 depends on TOOLCHAINOPTS
213 prompt "C Library implementation" if TOOLCHAINOPTS
214 default LIBC_USE_UCLIBC if mips64 || mips64el
215 default LIBC_USE_MUSL
217 Select the C library implementation.
219 config LIBC_USE_GLIBC
223 config LIBC_USE_UCLIBC
226 depends on !(aarch64 || aarch64_be)
231 depends on !(mips64 || mips64el)
235 source "toolchain/glibc/Config.in"
236 source "toolchain/uClibc/Config.in"
237 source "toolchain/musl/Config.in"
240 depends on TOOLCHAINOPTS
244 depends on !(aarch64 || aarch64_be)
245 prompt "Build gdb" if TOOLCHAINOPTS
246 default y if !EXTERNAL_TOOLCHAIN
248 Enable if you want to build the gdb.
252 prompt "Build insight-gdb" if TOOLCHAINOPTS
256 Enable if you want to build insight-gdb.
262 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (mips64 || mips64el)
266 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(mips64 || mips64el)
269 config USE_EXTERNAL_LIBC
271 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
273 source "toolchain/gcc/Config.version"
275 source "toolchain/glibc/Config.version"
276 source "toolchain/uClibc/Config.version"
277 source "toolchain/musl/Config.version"
281 default "glibc" if USE_GLIBC
282 default "uClibc" if USE_UCLIBC
283 default "musl" if USE_MUSL
287 default GLIBC_VERSION if USE_GLIBC
288 default UCLIBC_VERSION if USE_UCLIBC
289 default MUSL_VERSION if USE_MUSL
293 default "gnueabi" if USE_GLIBC && (arm || armeb)
294 default "gnu" if USE_GLIBC && !(arm || armeb)
295 default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb)
296 default "uclibc" if USE_UCLIBC && !(arm || armeb)
297 default "muslgnueabi" if USE_MUSL && (arm || armeb)
298 default "musl" if USE_MUSL && !(arm || armeb)
301 depends on mips64 || mips64el
303 default "64" if MIPS64_ABI_N64
304 default "n32" if MIPS64_ABI_N32
305 default "32" if MIPS64_ABI_O32