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
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
38 Most people will answer N.
41 menuconfig EXTERNAL_TOOLCHAIN
43 prompt "Use external toolchain" if DEVEL
45 If enabled, LEDE will compile using an existing toolchain instead of
48 config NATIVE_TOOLCHAIN
50 prompt "Use host's toolchain" if DEVEL
51 depends on EXTERNAL_TOOLCHAIN
54 If enabled, LEDE will compile using the native toolchain for your
55 host instead of compiling one.
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
71 config TOOLCHAIN_PREFIX
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
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
101 prompt "Toolchain libc" if DEVEL
102 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
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.
110 config TOOLCHAIN_BIN_PATH
112 prompt "Toolchain program path" if DEVEL
113 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
114 default "./usr/bin ./bin"
116 Specify additional directories searched for toolchain binaries
117 (override PATH). Use ./DIR for directories relative to the root above.
119 config TOOLCHAIN_INC_PATH
121 prompt "Toolchain include path" if DEVEL
122 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
123 default "./usr/include ./include"
125 Specify additional directories searched for header files (override
126 CPPFLAGS). Use ./DIR for directories relative to the root above.
128 config TOOLCHAIN_LIB_PATH
130 prompt "Toolchain library path" if DEVEL
131 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
132 default "./usr/lib ./lib"
134 Specify additional directories searched for libraries (override LDFLAGS).
135 Use ./DIR for directories relative to the root above.
137 config NEED_TOOLCHAIN
140 default y if !EXTERNAL_TOOLCHAIN
142 menuconfig TOOLCHAINOPTS
143 bool "Toolchain Options" if DEVEL
144 depends on NEED_TOOLCHAIN
146 menuconfig EXTRA_TARGET_ARCH
148 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
150 default y if powerpc64
153 Some builds may require a 'biarch' toolchain. This option
154 allows you to specify an additional target arch.
156 Most people will answer N here.
158 config EXTRA_TARGET_ARCH_NAME
160 default "powerpc64" if powerpc64
161 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
163 Specify the cpu name (eg powerpc64 or x86_64) of the
164 additional target architecture.
166 config EXTRA_TARGET_ARCH_OPTS
168 default "-m64" if powerpc64
169 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
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.
175 For example, if you're building a compiler that can build
176 both powerpc and powerpc64 binaries, you'll need to
181 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
182 default MIPS64_ABI_N64
184 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
187 config MIPS64_ABI_N64
190 config MIPS64_ABI_N32
191 depends on !LIBC_USE_MUSL
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 arc
215 default LIBC_USE_MUSL
217 Select the C library implementation.
219 config LIBC_USE_GLIBC
224 config LIBC_USE_UCLIBC
227 depends on !(aarch64 || aarch64_be)
228 depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc)
237 source "toolchain/glibc/Config.in"
238 source "toolchain/uClibc/Config.in"
241 depends on TOOLCHAINOPTS
245 depends on !(aarch64 || aarch64_be)
246 prompt "Build gdb" if TOOLCHAINOPTS
247 default y if !EXTERNAL_TOOLCHAIN
249 Enable if you want to build the gdb.
253 prompt "Build insight-gdb" if TOOLCHAINOPTS
257 Enable if you want to build insight-gdb.
263 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
267 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
270 config USE_EXTERNAL_LIBC
272 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
274 source "toolchain/binutils/Config.version"
275 source "toolchain/gcc/Config.version"
277 source "toolchain/glibc/Config.version"
278 source "toolchain/uClibc/Config.version"
279 source "toolchain/musl/Config.version"
283 default "glibc" if USE_GLIBC
284 default "uClibc" if USE_UCLIBC
285 default "musl" if USE_MUSL
289 default GLIBC_VERSION if USE_GLIBC
290 default UCLIBC_VERSION if USE_UCLIBC
291 default MUSL_VERSION if USE_MUSL
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)
303 depends on mips64 || mips64el
305 default "64" if MIPS64_ABI_N64
306 default "n32" if MIPS64_ABI_N32
307 default "32" if MIPS64_ABI_O32