Thu May 27 20:29:24 2021 UTC ()
mips64 only works with gcc-10


(christos)
diff -r1.1252 -r1.1253 src/share/mk/bsd.own.mk

cvs diff -r1.1252 -r1.1253 src/share/mk/bsd.own.mk (switch to unified diff)

--- src/share/mk/bsd.own.mk 2021/05/27 17:41:28 1.1252
+++ src/share/mk/bsd.own.mk 2021/05/27 20:29:24 1.1253
@@ -1,1079 +1,1080 @@ @@ -1,1079 +1,1080 @@
1# $NetBSD: bsd.own.mk,v 1.1252 2021/05/27 17:41:28 christos Exp $ 1# $NetBSD: bsd.own.mk,v 1.1253 2021/05/27 20:29:24 christos Exp $
2 2
3# This needs to be before bsd.init.mk 3# This needs to be before bsd.init.mk
4.if defined(BSD_MK_COMPAT_FILE) 4.if defined(BSD_MK_COMPAT_FILE)
5.include <${BSD_MK_COMPAT_FILE}> 5.include <${BSD_MK_COMPAT_FILE}>
6.endif 6.endif
7 7
8.if !defined(_BSD_OWN_MK_) 8.if !defined(_BSD_OWN_MK_)
9_BSD_OWN_MK_=1 9_BSD_OWN_MK_=1
10 10
11MAKECONF?= /etc/mk.conf 11MAKECONF?= /etc/mk.conf
12.-include "${MAKECONF}" 12.-include "${MAKECONF}"
13 13
14# 14#
15# CPU model, derived from MACHINE_ARCH 15# CPU model, derived from MACHINE_ARCH
16# 16#
17MACHINE_CPU= ${MACHINE_ARCH:C/mips.*e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/e?arm.*/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/} 17MACHINE_CPU= ${MACHINE_ARCH:C/mips.*e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/e?arm.*/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/}
18 18
19.if (${MACHINE_ARCH} == "mips64el" || \ 19.if (${MACHINE_ARCH} == "mips64el" || \
20 ${MACHINE_ARCH} == "mips64eb" || \ 20 ${MACHINE_ARCH} == "mips64eb" || \
21 ${MACHINE_ARCH} == "mipsn64el" || \ 21 ${MACHINE_ARCH} == "mipsn64el" || \
22 ${MACHINE_ARCH} == "mipsn64eb") 22 ${MACHINE_ARCH} == "mipsn64eb")
23MACHINE_MIPS64= 1 23MACHINE_MIPS64= 1
24.else 24.else
25MACHINE_MIPS64= 0 25MACHINE_MIPS64= 0
26.endif 26.endif
27 27
28# 28#
29# Subdirectory used below ${RELEASEDIR} when building a release 29# Subdirectory used below ${RELEASEDIR} when building a release
30# 30#
31.if !empty(MACHINE:Mevbarm) || !empty(MACHINE:Mevbmips) \ 31.if !empty(MACHINE:Mevbarm) || !empty(MACHINE:Mevbmips) \
32 || !empty(MACHINE:Mevbsh3) 32 || !empty(MACHINE:Mevbsh3)
33RELEASEMACHINEDIR?= ${MACHINE}-${MACHINE_ARCH} 33RELEASEMACHINEDIR?= ${MACHINE}-${MACHINE_ARCH}
34.else 34.else
35RELEASEMACHINEDIR?= ${MACHINE} 35RELEASEMACHINEDIR?= ${MACHINE}
36.endif 36.endif
37 37
38# 38#
39# Subdirectory or path component used for the following paths: 39# Subdirectory or path component used for the following paths:
40# distrib/${RELEASEMACHINE} 40# distrib/${RELEASEMACHINE}
41# distrib/notes/${RELEASEMACHINE} 41# distrib/notes/${RELEASEMACHINE}
42# etc/etc.${RELEASEMACHINE} 42# etc/etc.${RELEASEMACHINE}
43# Used when building a release. 43# Used when building a release.
44# 44#
45RELEASEMACHINE?= ${MACHINE} 45RELEASEMACHINE?= ${MACHINE}
46 46
47# 47#
48# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to 48# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
49# ensure that things defined by <bsd.own.mk> (default targets, 49# ensure that things defined by <bsd.own.mk> (default targets,
50# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk. 50# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
51# 51#
52NEED_OWN_INSTALL_TARGET?= yes 52NEED_OWN_INSTALL_TARGET?= yes
53 53
54# 54#
55# This lists the platforms which do not have working in-tree toolchains. For 55# This lists the platforms which do not have working in-tree toolchains. For
56# the in-tree gcc toolchain, this list is empty. 56# the in-tree gcc toolchain, this list is empty.
57# 57#
58# If some future port is not supported by the in-tree toolchain, this should 58# If some future port is not supported by the in-tree toolchain, this should
59# be set to "yes" for that port only. 59# be set to "yes" for that port only.
60# 60#
61# .if ${MACHINE} == "playstation2" 61# .if ${MACHINE} == "playstation2"
62# TOOLCHAIN_MISSING?= yes 62# TOOLCHAIN_MISSING?= yes
63# .endif 63# .endif
64 64
65TOOLCHAIN_MISSING?= no 65TOOLCHAIN_MISSING?= no
66 66
67# 67#
68# GCC Using platforms. 68# GCC Using platforms.
69# 69#
70.if ${MKGCC:Uyes} != "no" 70.if ${MKGCC:Uyes} != "no"
71 71
72# 72#
73# What GCC is used? 73# What GCC is used?
74# 74#
75.if ${MACHINE} == "alpha" || \ 75.if ${MACHINE} == "alpha" || \
76 ${MACHINE} == "hppa" || \ 76 ${MACHINE} == "hppa" || \
77 ${MACHINE} == "ia64" || \ 77 ${MACHINE} == "ia64" || \
78 ${MACHINE} == "sparc" || \ 78 ${MACHINE} == "sparc" || \
79 ${MACHINE} == "sparc64" || \ 79 ${MACHINE} == "sparc64" || \
80 ${MACHINE} == "vax" || \ 80 ${MACHINE} == "vax" || \
 81 ${MACHINE_MIPS64} || \
81 ${MACHINE_ARCH} == "i386" || \ 82 ${MACHINE_ARCH} == "i386" || \
82 ${MACHINE_ARCH} == "x86_64" || \ 83 ${MACHINE_ARCH} == "x86_64" || \
83 ${MACHINE_CPU} == "aarch64" || \ 84 ${MACHINE_CPU} == "aarch64" || \
84 ${MACHINE_CPU} == "mips" || \ 85 ${MACHINE_CPU} == "mips" || \
85 ${MACHINE_CPU} == "powerpc" || \ 86 ${MACHINE_CPU} == "powerpc" || \
86 ${MACHINE_CPU} == "riscv" 87 ${MACHINE_CPU} == "riscv"
87HAVE_GCC?= 10 88HAVE_GCC?= 10
88.else 89.else
89HAVE_GCC?= 9 90HAVE_GCC?= 9
90.endif 91.endif
91 92
92# 93#
93# Platforms that can't run a modern GCC natively 94# Platforms that can't run a modern GCC natively
94.if ${MACHINE_ARCH} == "m68000" 95.if ${MACHINE_ARCH} == "m68000"
95MKGCCCMDS?= no 96MKGCCCMDS?= no
96.endif 97.endif
97 98
98# 99#
99# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is 100# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
100# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC. 101# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
101# 102#
102.if ${HAVE_GCC} == 9 103.if ${HAVE_GCC} == 9
103EXTERNAL_GCC_SUBDIR?= gcc.old 104EXTERNAL_GCC_SUBDIR?= gcc.old
104.elif ${HAVE_GCC} == 10 105.elif ${HAVE_GCC} == 10
105EXTERNAL_GCC_SUBDIR?= gcc 106EXTERNAL_GCC_SUBDIR?= gcc
106.else 107.else
107EXTERNAL_GCC_SUBDIR?= /does/not/exist 108EXTERNAL_GCC_SUBDIR?= /does/not/exist
108.endif 109.endif
109.else 110.else
110MKGCCCMDS?= no 111MKGCCCMDS?= no
111.endif 112.endif
112 113
113# 114#
114# What binutils is used? 115# What binutils is used?
115# 116#
116HAVE_BINUTILS?= 234 117HAVE_BINUTILS?= 234
117 118
118.if ${HAVE_BINUTILS} == 234 119.if ${HAVE_BINUTILS} == 234
119EXTERNAL_BINUTILS_SUBDIR= binutils 120EXTERNAL_BINUTILS_SUBDIR= binutils
120.elif ${HAVE_BINUTILS} == 231 121.elif ${HAVE_BINUTILS} == 231
121EXTERNAL_BINUTILS_SUBDIR= binutils.old 122EXTERNAL_BINUTILS_SUBDIR= binutils.old
122.else 123.else
123EXTERNAL_BINUTILS_SUBDIR= /does/not/exist 124EXTERNAL_BINUTILS_SUBDIR= /does/not/exist
124.endif 125.endif
125 126
126# 127#
127# What GDB is used? 128# What GDB is used?
128# 129#
129HAVE_GDB?= 1100 130HAVE_GDB?= 1100
130 131
131.if ${HAVE_GDB} == 1100 132.if ${HAVE_GDB} == 1100
132EXTERNAL_GDB_SUBDIR= gdb 133EXTERNAL_GDB_SUBDIR= gdb
133.elif ${HAVE_GDB} == 830 134.elif ${HAVE_GDB} == 830
134EXTERNAL_GDB_SUBDIR= gdb.old 135EXTERNAL_GDB_SUBDIR= gdb.old
135.else 136.else
136EXTERNAL_GDB_SUBDIR= /does/not/exist 137EXTERNAL_GDB_SUBDIR= /does/not/exist
137.endif 138.endif
138 139
139# 140#
140# What OpenSSL is used? 141# What OpenSSL is used?
141#  142#
142HAVE_OPENSSL?= 11 143HAVE_OPENSSL?= 11
143 144
144.if ${HAVE_OPENSSL} == 11 145.if ${HAVE_OPENSSL} == 11
145EXTERNAL_OPENSSL_SUBDIR=openssl 146EXTERNAL_OPENSSL_SUBDIR=openssl
146.elif ${HAVE_OPENSSL} == 10 147.elif ${HAVE_OPENSSL} == 10
147EXTERNAL_OPENSSL_SUBDIR=openssl.old 148EXTERNAL_OPENSSL_SUBDIR=openssl.old
148.else 149.else
149EXTERNAL_OPENSSL_SUBDIR=/does/not/exist 150EXTERNAL_OPENSSL_SUBDIR=/does/not/exist
150.endif 151.endif
151 152
152# 153#
153# Does the platform support ACPI? 154# Does the platform support ACPI?
154# 155#
155.if ${MACHINE_ARCH} == "i386" || \ 156.if ${MACHINE_ARCH} == "i386" || \
156 ${MACHINE_ARCH} == "x86_64" || \ 157 ${MACHINE_ARCH} == "x86_64" || \
157 ${MACHINE_ARCH} == "ia64" || \ 158 ${MACHINE_ARCH} == "ia64" || \
158 !empty(MACHINE_ARCH:Maarch64*) 159 !empty(MACHINE_ARCH:Maarch64*)
159HAVE_ACPI= yes 160HAVE_ACPI= yes
160.else 161.else
161HAVE_ACPI= no 162HAVE_ACPI= no
162.endif 163.endif
163 164
164# 165#
165# Does the platform support UEFI? 166# Does the platform support UEFI?
166# 167#
167.if ${MACHINE_ARCH} == "i386" || \ 168.if ${MACHINE_ARCH} == "i386" || \
168 ${MACHINE_ARCH} == "x86_64" || \ 169 ${MACHINE_ARCH} == "x86_64" || \
169 ${MACHINE_ARCH} == "ia64" || \ 170 ${MACHINE_ARCH} == "ia64" || \
170 !empty(MACHINE_ARCH:Mearmv7*) || \ 171 !empty(MACHINE_ARCH:Mearmv7*) || \
171 !empty(MACHINE_ARCH:Maarch64*) 172 !empty(MACHINE_ARCH:Maarch64*)
172HAVE_UEFI= yes 173HAVE_UEFI= yes
173.else 174.else
174HAVE_UEFI= no 175HAVE_UEFI= no
175.endif 176.endif
176 177
177# 178#
178# Does the platform support NVMM? 179# Does the platform support NVMM?
179# 180#
180.if ${MACHINE_ARCH} == "x86_64" 181.if ${MACHINE_ARCH} == "x86_64"
181HAVE_NVMM= yes 182HAVE_NVMM= yes
182.else 183.else
183HAVE_NVMM= no 184HAVE_NVMM= no
184.endif 185.endif
185 186
186 187
187.if !empty(MACHINE_ARCH:Mearm*) 188.if !empty(MACHINE_ARCH:Mearm*)
188_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes 189_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
189.endif 190.endif
190 191
191_LIBC_COMPILER_RT.aarch64= yes 192_LIBC_COMPILER_RT.aarch64= yes
192_LIBC_COMPILER_RT.aarch64eb= yes 193_LIBC_COMPILER_RT.aarch64eb= yes
193_LIBC_COMPILER_RT.i386= yes 194_LIBC_COMPILER_RT.i386= yes
194_LIBC_COMPILER_RT.powerpc= yes 195_LIBC_COMPILER_RT.powerpc= yes
195_LIBC_COMPILER_RT.powerpc64= yes 196_LIBC_COMPILER_RT.powerpc64= yes
196_LIBC_COMPILER_RT.sparc= yes 197_LIBC_COMPILER_RT.sparc= yes
197_LIBC_COMPILER_RT.sparc64= yes 198_LIBC_COMPILER_RT.sparc64= yes
198_LIBC_COMPILER_RT.x86_64= yes 199_LIBC_COMPILER_RT.x86_64= yes
199 200
200.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes" 201.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
201HAVE_LIBGCC?= no 202HAVE_LIBGCC?= no
202.else 203.else
203HAVE_LIBGCC?= yes 204HAVE_LIBGCC?= yes
204.endif 205.endif
205 206
206 207
207# Should libgcc have unwinding code? 208# Should libgcc have unwinding code?
208.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*) 209.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
209HAVE_LIBGCC_EH?= no 210HAVE_LIBGCC_EH?= no
210.else 211.else
211HAVE_LIBGCC_EH?= yes 212HAVE_LIBGCC_EH?= yes
212.endif 213.endif
213 214
214# Coverity does not like SSP 215# Coverity does not like SSP
215.if defined(COVERITY_TOP_CONFIG) || \ 216.if defined(COVERITY_TOP_CONFIG) || \
216 ${MACHINE} == "alpha" || \ 217 ${MACHINE} == "alpha" || \
217 ${MACHINE} == "hppa" || \ 218 ${MACHINE} == "hppa" || \
218 ${MACHINE} == "ia64" || \ 219 ${MACHINE} == "ia64" || \
219 ${MACHINE_CPU} == "mips" 220 ${MACHINE_CPU} == "mips"
220HAVE_SSP?= no 221HAVE_SSP?= no
221.else 222.else
222HAVE_SSP?= yes 223HAVE_SSP?= yes
223.if !defined(NOFORT) && ${USE_FORT:Uno} != "no" 224.if !defined(NOFORT) && ${USE_FORT:Uno} != "no"
224USE_SSP?= yes 225USE_SSP?= yes
225.endif 226.endif
226.endif 227.endif
227 228
228# 229#
229# What version of jemalloc we use (100 is the one 230# What version of jemalloc we use (100 is the one
230# built-in to libc from 2005 (pre version 3). 231# built-in to libc from 2005 (pre version 3).
231# 232#
232.if ${MACHINE_ARCH} == "vax" || ${MACHINE} == "sun2" 233.if ${MACHINE_ARCH} == "vax" || ${MACHINE} == "sun2"
233HAVE_JEMALLOC?= 100 234HAVE_JEMALLOC?= 100
234.else 235.else
235HAVE_JEMALLOC?= 510 236HAVE_JEMALLOC?= 510
236.endif 237.endif
237 238
238.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*) 239.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
239.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR) 240.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
240PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx 241PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
241.else 242.else
242PRINTOBJDIR= ${MAKE} -V .OBJDIR 243PRINTOBJDIR= ${MAKE} -V .OBJDIR
243.endif 244.endif
244.else 245.else
245PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion 246PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
246.endif 247.endif
247 248
248# 249#
249# Determine if running in the NetBSD source tree by checking for the 250# Determine if running in the NetBSD source tree by checking for the
250# existence of build.sh and tools/ in the current or a parent directory, 251# existence of build.sh and tools/ in the current or a parent directory,
251# and setting _SRC_TOP_ to the result. 252# and setting _SRC_TOP_ to the result.
252# 253#
253.if !defined(_SRC_TOP_) # { 254.if !defined(_SRC_TOP_) # {
254_SRC_TOP_!= cd "${.CURDIR}"; while :; do \ 255_SRC_TOP_!= cd "${.CURDIR}"; while :; do \
255 here=`pwd`; \ 256 here=`pwd`; \
256 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \ 257 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
257 case $$here in /) echo ""; break;; esac; \ 258 case $$here in /) echo ""; break;; esac; \
258 cd ..; done 259 cd ..; done
259 260
260.MAKEOVERRIDES+= _SRC_TOP_ 261.MAKEOVERRIDES+= _SRC_TOP_
261 262
262.endif # } 263.endif # }
263 264
264# 265#
265# If _SRC_TOP_ != "", we're within the NetBSD source tree. 266# If _SRC_TOP_ != "", we're within the NetBSD source tree.
266# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_. 267# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
267# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the 268# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
268# NetBSD version, or on variables defined at build time, can 269# NetBSD version, or on variables defined at build time, can
269# declare a dependency on ${_NETBSD_VERSION_DEPENDS}. 270# declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
270# 271#
271.if (${_SRC_TOP_} != "") # { 272.if (${_SRC_TOP_} != "") # {
272 273
273NETBSDSRCDIR?= ${_SRC_TOP_} 274NETBSDSRCDIR?= ${_SRC_TOP_}
274 275
275.if !defined(_SRC_TOP_OBJ_) 276.if !defined(_SRC_TOP_OBJ_)
276_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR} 277_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
277.MAKEOVERRIDES+= _SRC_TOP_OBJ_ 278.MAKEOVERRIDES+= _SRC_TOP_OBJ_
278.endif 279.endif
279 280
280_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params 281_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
281_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h 282_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
282_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh 283_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
283_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh 284_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
284${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build" 285${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
285 286
286.endif # _SRC_TOP_ != "" # } 287.endif # _SRC_TOP_ != "" # }
287 288
288 289
289.if (${_SRC_TOP_} != "") && \ 290.if (${_SRC_TOP_} != "") && \
290 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) 291 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
291USETOOLS?= yes 292USETOOLS?= yes
292.endif 293.endif
293USETOOLS?= no 294USETOOLS?= no
294 295
295 296
296.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \ 297.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
297 ${MACHINE_ARCH} == "sh3" 298 ${MACHINE_ARCH} == "sh3"
298.BEGIN: 299.BEGIN:
299 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el" 300 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
300 @false 301 @false
301.elif defined(REQUIRETOOLS) && \ 302.elif defined(REQUIRETOOLS) && \
302 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \ 303 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
303 ${USETOOLS} == "no" 304 ${USETOOLS} == "no"
304.BEGIN: 305.BEGIN:
305 @echo "USETOOLS=no, but this component requires a version-specific host toolchain" 306 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
306 @false 307 @false
307.endif 308.endif
308 309
309# 310#
310# Host platform information; may be overridden 311# Host platform information; may be overridden
311# 312#
312.include <bsd.host.mk> 313.include <bsd.host.mk>
313 314
314.if ${USETOOLS} == "yes" # { 315.if ${USETOOLS} == "yes" # {
315 316
316# 317#
317# Provide a default for TOOLDIR. 318# Provide a default for TOOLDIR.
318# 319#
319.if !defined(TOOLDIR) 320.if !defined(TOOLDIR)
320TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE} 321TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
321.MAKEOVERRIDES+= TOOLDIR 322.MAKEOVERRIDES+= TOOLDIR
322.endif 323.endif
323 324
324# 325#
325# This is the prefix used for the NetBSD-sourced tools. 326# This is the prefix used for the NetBSD-sourced tools.
326# 327#
327_TOOL_PREFIX?= nb 328_TOOL_PREFIX?= nb
328 329
329# 330#
330# If an external toolchain base is specified, use it. 331# If an external toolchain base is specified, use it.
331# 332#
332.if defined(EXTERNAL_TOOLCHAIN) # { 333.if defined(EXTERNAL_TOOLCHAIN) # {
333AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar 334AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
334AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as 335AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
335LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld 336LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
336NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm 337NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
337OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy 338OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
338OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump 339OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
339RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib 340RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
340READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf 341READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
341SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size 342SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
342STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings 343STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
343STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip 344STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
344 345
345TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 346TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
346TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp 347TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
347TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++ 348TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
348TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran 349TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran
349TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 350TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
350 351
351TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 352TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
352TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 353TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
353TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++ 354TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
354TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 355TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
355.else # } { 356.else # } {
356# Define default locations for common tools. 357# Define default locations for common tools.
357.if ${USETOOLS_BINUTILS:Uyes} == "yes" # { 358.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
358AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar 359AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
359AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as 360AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
360LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld 361LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
361NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm 362NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
362OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy 363OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
363OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump 364OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
364RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib 365RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
365READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf 366READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
366SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size 367SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
367STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings 368STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
368STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip 369STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
369 370
370# GCC supports C, C++, Fortran and Objective C 371# GCC supports C, C++, Fortran and Objective C
371TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 372TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
372TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp 373TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
373TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++ 374TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
374TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran 375TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran
375TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 376TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
376.endif # } 377.endif # }
377 378
378# Clang supports C, C++ and Objective C 379# Clang supports C, C++ and Objective C
379TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 380TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
380TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 381TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
381TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++ 382TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
382TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 383TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
383 384
384# PCC supports C and Fortran 385# PCC supports C and Fortran
385TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc 386TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
386TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp 387TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp
387TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++ 388TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
388.endif # EXTERNAL_TOOLCHAIN # } 389.endif # EXTERNAL_TOOLCHAIN # }
389 390
390# 391#
391# Make sure DESTDIR is set, so that builds with these tools always 392# Make sure DESTDIR is set, so that builds with these tools always
392# get appropriate -nostdinc, -nostdlib, etc. handling. The default is 393# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
393# <empty string>, meaning start from /, the root directory. 394# <empty string>, meaning start from /, the root directory.
394# 395#
395DESTDIR?= 396DESTDIR?=
396 397
397# Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.) 398# Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.)
398# because it confuses Coverity. Still we need to cov-configure specially 399# because it confuses Coverity. Still we need to cov-configure specially
399# for each specific sysroot argument. 400# for each specific sysroot argument.
400# Also don't add a sysroot at all if a rumpkernel build. 401# Also don't add a sysroot at all if a rumpkernel build.
401.if !defined(HOSTPROG) && !defined(HOSTLIB) && !defined(RUMPRUN) 402.if !defined(HOSTPROG) && !defined(HOSTLIB) && !defined(RUMPRUN)
402. if ${DESTDIR} != "" 403. if ${DESTDIR} != ""
403. if empty(CPPFLAGS:M*--sysroot=*) 404. if empty(CPPFLAGS:M*--sysroot=*)
404CPPFLAGS+= --sysroot=${DESTDIR} 405CPPFLAGS+= --sysroot=${DESTDIR}
405. endif 406. endif
406LDFLAGS+= --sysroot=${DESTDIR} 407LDFLAGS+= --sysroot=${DESTDIR}
407. else 408. else
408. if empty(CPPFLAGS:M*--sysroot=*) 409. if empty(CPPFLAGS:M*--sysroot=*)
409CPPFLAGS+= --sysroot=/ 410CPPFLAGS+= --sysroot=/
410. endif 411. endif
411LDFLAGS+= --sysroot=/ 412LDFLAGS+= --sysroot=/
412. endif 413. endif
413.endif 414.endif
414 415
415DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym 416DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
416ARM_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout 417ARM_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
417M68K_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 418M68K_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
418MIPS_ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 419MIPS_ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
419INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install 420INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
420LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex 421LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
421LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint 422LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
422LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder 423LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
423MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 424MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
424MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 425MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
425PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl 426PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
426TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q 427TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
427YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc 428YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
428 429
429TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb 430TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
430TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb 431TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
431TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt 432TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
432TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile 433TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
433TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk 434TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
434TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb 435TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
435TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat 436TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
436TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum 437TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
437TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen 438TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
438TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et 439TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
439TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config 440TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
440TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen 441TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
441TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags 442TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
442TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert 443TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
443TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge 444TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
444TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest 445TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest
445TOOL_DATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}date 446TOOL_DATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}date
446TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db 447TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
447TOOL_DISKLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}disklabel 448TOOL_DISKLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}disklabel
448TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc 449TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc
449TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn 450TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
450TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk 451TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
451TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen 452TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
452TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym 453TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
453TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat 454TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
454TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake 455TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
455TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt 456TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt
456TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep 457TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
457GROFF_SHARE_PATH= ${TOOLDIR}/share/groff 458GROFF_SHARE_PATH= ${TOOLDIR}/share/groff
458TOOL_GROFF_ENV= \ 459TOOL_GROFF_ENV= \
459 GROFF_ENCODING= \ 460 GROFF_ENCODING= \
460 GROFF_BIN_PATH=${TOOLDIR}/lib/groff \ 461 GROFF_BIN_PATH=${TOOLDIR}/lib/groff \
461 GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \ 462 GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \
462 GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac 463 GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac
463TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS} 464TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS}
464 465
465TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump 466TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
466TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot 467TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
467TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot 468TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
468TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib 469TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
469TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot 470TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
470TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info 471TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
471TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join 472TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
472TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen 473TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
473TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4 474TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
474TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff 475TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
475TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs 476TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
476TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo 477TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
477TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys 478TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
478TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs 479TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
479TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis 480TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
480TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii 481TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
481TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml 482TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
482TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint 483TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
483TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage 484TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
484TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc 485TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
485TOOL_ARMELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout 486TOOL_ARMELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
486TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 487TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
487TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 488TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
488TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper 489TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
489TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb 490TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
490TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale 491TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
491TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file 492TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
492TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod 493TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
493TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp 494TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
494TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage 495TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
495TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb 496TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
496TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc 497TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
497TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree 498TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
498TOOL_MVME68KWRTVID= ${TOOLDIR}/bin/${_TOOL_PREFIX}mvme68k-wrtvid 499TOOL_MVME68KWRTVID= ${TOOLDIR}/bin/${_TOOL_PREFIX}mvme68k-wrtvid
499TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf 500TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
500TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs 501TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
501TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax 502TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
502TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic 503TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
503TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz 504TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
504TOOL_XZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}xz 505TOOL_XZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}xz
505TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create 506TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
506TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage 507TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
507TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb 508TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
508TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer 509TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
509TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff 510TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
510TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 511TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
511TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 512TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
512TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} 513TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
513TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 514TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
514TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} 515TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
515TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 516TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
516TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen 517TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
517TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed 518TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
518TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc 519TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
519TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim 520TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
520TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo 521TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo
521TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc 522TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
522TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat 523TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
523TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile 524TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
524TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel 525TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
525TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl 526TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
526TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic 527TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
527TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode 528TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
528TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f 529TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
529TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr 530TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
530TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic 531TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
531 532
532.else # USETOOLS != yes # } { 533.else # USETOOLS != yes # } {
533 534
534# Clang supports C, C++ and Objective C 535# Clang supports C, C++ and Objective C
535TOOL_CC.clang= clang 536TOOL_CC.clang= clang
536TOOL_CPP.clang= clang-cpp 537TOOL_CPP.clang= clang-cpp
537TOOL_CXX.clang= clang++ 538TOOL_CXX.clang= clang++
538TOOL_OBJC.clang= clang 539TOOL_OBJC.clang= clang
539 540
540# GCC supports C, C++, Fortran and Objective C 541# GCC supports C, C++, Fortran and Objective C
541TOOL_CC.gcc= gcc 542TOOL_CC.gcc= gcc
542TOOL_CPP.gcc= cpp 543TOOL_CPP.gcc= cpp
543TOOL_CXX.gcc= c++ 544TOOL_CXX.gcc= c++
544TOOL_FC.gcc= gfortran 545TOOL_FC.gcc= gfortran
545TOOL_OBJC.gcc= gcc 546TOOL_OBJC.gcc= gcc
546 547
547# PCC supports C and Fortran 548# PCC supports C and Fortran
548TOOL_CC.pcc= pcc 549TOOL_CC.pcc= pcc
549TOOL_CPP.pcc= pcpp 550TOOL_CPP.pcc= pcpp
550TOOL_CXX.pcc= p++ 551TOOL_CXX.pcc= p++
551 552
552TOOL_AMIGAAOUT2BB= amiga-aout2bb 553TOOL_AMIGAAOUT2BB= amiga-aout2bb
553TOOL_AMIGAELF2BB= amiga-elf2bb 554TOOL_AMIGAELF2BB= amiga-elf2bb
554TOOL_AMIGATXLT= amiga-txlt 555TOOL_AMIGATXLT= amiga-txlt
555TOOL_ASN1_COMPILE= asn1_compile 556TOOL_ASN1_COMPILE= asn1_compile
556TOOL_AWK= awk 557TOOL_AWK= awk
557TOOL_CAP_MKDB= cap_mkdb 558TOOL_CAP_MKDB= cap_mkdb
558TOOL_CAT= cat 559TOOL_CAT= cat
559TOOL_CKSUM= cksum 560TOOL_CKSUM= cksum
560TOOL_CLANG_TBLGEN= clang-tblgen 561TOOL_CLANG_TBLGEN= clang-tblgen
561TOOL_COMPILE_ET= compile_et 562TOOL_COMPILE_ET= compile_et
562TOOL_CONFIG= config 563TOOL_CONFIG= config
563TOOL_CRUNCHGEN= crunchgen 564TOOL_CRUNCHGEN= crunchgen
564TOOL_CTAGS= ctags 565TOOL_CTAGS= ctags
565TOOL_CTFCONVERT= ctfconvert 566TOOL_CTFCONVERT= ctfconvert
566TOOL_CTFMERGE= ctfmerge 567TOOL_CTFMERGE= ctfmerge
567TOOL_CVSLATEST= cvslatest 568TOOL_CVSLATEST= cvslatest
568TOOL_DATE= date 569TOOL_DATE= date
569TOOL_DB= db 570TOOL_DB= db
570TOOL_DISKLABEL= disklabel 571TOOL_DISKLABEL= disklabel
571TOOL_DTC= dtc 572TOOL_DTC= dtc
572TOOL_EQN= eqn 573TOOL_EQN= eqn
573TOOL_FDISK= fdisk 574TOOL_FDISK= fdisk
574TOOL_FGEN= fgen 575TOOL_FGEN= fgen
575TOOL_GENASSYM= genassym 576TOOL_GENASSYM= genassym
576TOOL_GENCAT= gencat 577TOOL_GENCAT= gencat
577TOOL_GMAKE= gmake 578TOOL_GMAKE= gmake
578TOOL_GPT= gpt 579TOOL_GPT= gpt
579TOOL_GREP= grep 580TOOL_GREP= grep
580TOOL_GROFF= groff 581TOOL_GROFF= groff
581TOOL_HEXDUMP= hexdump 582TOOL_HEXDUMP= hexdump
582TOOL_HP300MKBOOT= hp300-mkboot 583TOOL_HP300MKBOOT= hp300-mkboot
583TOOL_HPPAMKBOOT= hppa-mkboot 584TOOL_HPPAMKBOOT= hppa-mkboot
584TOOL_INDXBIB= indxbib 585TOOL_INDXBIB= indxbib
585TOOL_INSTALLBOOT= installboot 586TOOL_INSTALLBOOT= installboot
586TOOL_INSTALL_INFO= install-info 587TOOL_INSTALL_INFO= install-info
587TOOL_JOIN= join 588TOOL_JOIN= join
588TOOL_LLVM_TBLGEN= llvm-tblgen 589TOOL_LLVM_TBLGEN= llvm-tblgen
589TOOL_M4= m4 590TOOL_M4= m4
590TOOL_MACPPCFIXCOFF= macppc-fixcoff 591TOOL_MACPPCFIXCOFF= macppc-fixcoff
591TOOL_MAKEFS= makefs 592TOOL_MAKEFS= makefs
592TOOL_MAKEINFO= makeinfo 593TOOL_MAKEINFO= makeinfo
593TOOL_MAKEKEYS= makekeys 594TOOL_MAKEKEYS= makekeys
594TOOL_MAKESTRS= makestrs 595TOOL_MAKESTRS= makestrs
595TOOL_MAKEWHATIS= /usr/libexec/makewhatis 596TOOL_MAKEWHATIS= /usr/libexec/makewhatis
596TOOL_MANDOC_ASCII= mandoc -Tascii 597TOOL_MANDOC_ASCII= mandoc -Tascii
597TOOL_MANDOC_HTML= mandoc -Thtml 598TOOL_MANDOC_HTML= mandoc -Thtml
598TOOL_MANDOC_LINT= mandoc -Tlint 599TOOL_MANDOC_LINT= mandoc -Tlint
599TOOL_MDSETIMAGE= mdsetimage 600TOOL_MDSETIMAGE= mdsetimage
600TOOL_MENUC= menuc 601TOOL_MENUC= menuc
601TOOL_ARMELF2AOUT= arm-elf2aout 602TOOL_ARMELF2AOUT= arm-elf2aout
602TOOL_M68KELF2AOUT= m68k-elf2aout 603TOOL_M68KELF2AOUT= m68k-elf2aout
603TOOL_MIPSELF2ECOFF= mips-elf2ecoff 604TOOL_MIPSELF2ECOFF= mips-elf2ecoff
604TOOL_MKCSMAPPER= mkcsmapper 605TOOL_MKCSMAPPER= mkcsmapper
605TOOL_MKESDB= mkesdb 606TOOL_MKESDB= mkesdb
606TOOL_MKLOCALE= mklocale 607TOOL_MKLOCALE= mklocale
607TOOL_MKMAGIC= file 608TOOL_MKMAGIC= file
608TOOL_MKNOD= mknod 609TOOL_MKNOD= mknod
609TOOL_MKTEMP= mktemp 610TOOL_MKTEMP= mktemp
610TOOL_MKUBOOTIMAGE= mkubootimage 611TOOL_MKUBOOTIMAGE= mkubootimage
611TOOL_ELFTOSB= elftosb 612TOOL_ELFTOSB= elftosb
612TOOL_MSGC= msgc 613TOOL_MSGC= msgc
613TOOL_MTREE= mtree 614TOOL_MTREE= mtree
614TOOL_MVME68KWRTVID= wrtvid 615TOOL_MVME68KWRTVID= wrtvid
615TOOL_NBPERF= nbperf 616TOOL_NBPERF= nbperf
616TOOL_NCDCS= ncdcs 617TOOL_NCDCS= ncdcs
617TOOL_PAX= pax 618TOOL_PAX= pax
618TOOL_PIC= pic 619TOOL_PIC= pic
619TOOL_PIGZ= pigz 620TOOL_PIGZ= pigz
620TOOL_XZ= xz 621TOOL_XZ= xz
621TOOL_PKG_CREATE= pkg_create 622TOOL_PKG_CREATE= pkg_create
622TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage 623TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
623TOOL_PWD_MKDB= pwd_mkdb 624TOOL_PWD_MKDB= pwd_mkdb
624TOOL_REFER= refer 625TOOL_REFER= refer
625TOOL_ROFF_ASCII= nroff 626TOOL_ROFF_ASCII= nroff
626TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 627TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
627TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 628TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
628TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} 629TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
629TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 630TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
630TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} 631TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
631TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 632TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
632TOOL_RPCGEN= rpcgen 633TOOL_RPCGEN= rpcgen
633TOOL_SED= sed 634TOOL_SED= sed
634TOOL_SOELIM= soelim 635TOOL_SOELIM= soelim
635TOOL_SORTINFO= sortinfo 636TOOL_SORTINFO= sortinfo
636TOOL_SPARKCRC= sparkcrc 637TOOL_SPARKCRC= sparkcrc
637TOOL_STAT= stat 638TOOL_STAT= stat
638TOOL_STRFILE= strfile 639TOOL_STRFILE= strfile
639TOOL_SUNLABEL= sunlabel 640TOOL_SUNLABEL= sunlabel
640TOOL_TBL= tbl 641TOOL_TBL= tbl
641TOOL_TIC= tic 642TOOL_TIC= tic
642TOOL_UUDECODE= uudecode 643TOOL_UUDECODE= uudecode
643TOOL_VGRIND= vgrind -f 644TOOL_VGRIND= vgrind -f
644TOOL_VFONTEDPR= /usr/libexec/vfontedpr 645TOOL_VFONTEDPR= /usr/libexec/vfontedpr
645TOOL_ZIC= zic 646TOOL_ZIC= zic
646 647
647.endif # USETOOLS != yes # } 648.endif # USETOOLS != yes # }
648 649
649# Standalone code should not be compiled with PIE or CTF 650# Standalone code should not be compiled with PIE or CTF
650# Should create a better test 651# Should create a better test
651.if defined(BINDIR) && ${BINDIR} == "/usr/mdec" 652.if defined(BINDIR) && ${BINDIR} == "/usr/mdec"
652NOPIE= # defined 653NOPIE= # defined
653NOCTF= # defined 654NOCTF= # defined
654.elif ${MACHINE} == "sun2" 655.elif ${MACHINE} == "sun2"
655NOPIE= # we don't have PIC, so no PIE 656NOPIE= # we don't have PIC, so no PIE
656.endif 657.endif
657 658
658# Fallback to ensure that all variables are defined to something 659# Fallback to ensure that all variables are defined to something
659TOOL_CC.false= false 660TOOL_CC.false= false
660TOOL_CPP.false= false 661TOOL_CPP.false= false
661TOOL_CXX.false= false 662TOOL_CXX.false= false
662TOOL_FC.false= false 663TOOL_FC.false= false
663TOOL_OBJC.false= false 664TOOL_OBJC.false= false
664 665
665AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false 666AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
666 667
667.for _t in CC CPP CXX FC OBJC 668.for _t in CC CPP CXX FC OBJC
668ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]} 669ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
669SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@} 670SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
670.endfor 671.endfor
671# make bugs prevent moving this into the .for loop 672# make bugs prevent moving this into the .for loop
672CC= ${TOOL_CC.${ACTIVE_CC}} 673CC= ${TOOL_CC.${ACTIVE_CC}}
673CPP= ${TOOL_CPP.${ACTIVE_CPP}} 674CPP= ${TOOL_CPP.${ACTIVE_CPP}}
674CXX= ${TOOL_CXX.${ACTIVE_CXX}} 675CXX= ${TOOL_CXX.${ACTIVE_CXX}}
675FC= ${TOOL_FC.${ACTIVE_FC}} 676FC= ${TOOL_FC.${ACTIVE_FC}}
676OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}} 677OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
677 678
678# For each ${MACHINE_CPU}, list the ports that use it. 679# For each ${MACHINE_CPU}, list the ports that use it.
679MACHINES.aarch64= evbarm 680MACHINES.aarch64= evbarm
680MACHINES.alpha= alpha 681MACHINES.alpha= alpha
681MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \ 682MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \
682 iyonix netwinder shark zaurus 683 iyonix netwinder shark zaurus
683MACHINES.coldfire= evbcf 684MACHINES.coldfire= evbcf
684MACHINES.i386= i386 685MACHINES.i386= i386
685MACHINES.ia64= ia64 686MACHINES.ia64= ia64
686MACHINES.hppa= hppa 687MACHINES.hppa= hppa
687MACHINES.m68000= sun2 688MACHINES.m68000= sun2
688MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \ 689MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
689 news68k next68k sun3 x68k 690 news68k next68k sun3 x68k
690MACHINES.mips= algor arc cobalt emips evbmips ews4800mips \ 691MACHINES.mips= algor arc cobalt emips evbmips ews4800mips \
691 hpcmips mipsco newsmips pmax sbmips sgimips 692 hpcmips mipsco newsmips pmax sbmips sgimips
692MACHINES.or1k= or1k 693MACHINES.or1k= or1k
693MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \ 694MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
694 ofppc prep rs6000 sandpoint 695 ofppc prep rs6000 sandpoint
695MACHINES.riscv= riscv 696MACHINES.riscv= riscv
696MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye 697MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
697MACHINES.sparc= sparc sparc64 698MACHINES.sparc= sparc sparc64
698MACHINES.sparc64= sparc64 699MACHINES.sparc64= sparc64
699MACHINES.vax= vax 700MACHINES.vax= vax
700MACHINES.x86_64= amd64 701MACHINES.x86_64= amd64
701 702
702# OBJCOPY flags to create a.out binaries for old firmware 703# OBJCOPY flags to create a.out binaries for old firmware
703# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc 704# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
704.if ${MACHINE_CPU} == "arm" 705.if ${MACHINE_CPU} == "arm"
705OBJCOPY_ELF2AOUT_FLAGS?= \ 706OBJCOPY_ELF2AOUT_FLAGS?= \
706 -O a.out-arm-netbsd \ 707 -O a.out-arm-netbsd \
707 -R .ident \ 708 -R .ident \
708 -R .ARM.attributes \ 709 -R .ARM.attributes \
709 -R .ARM.exidx \ 710 -R .ARM.exidx \
710 -R .ARM.extab \ 711 -R .ARM.extab \
711 -R .SUNW_ctf \ 712 -R .SUNW_ctf \
712 -R .arm.atpcs \ 713 -R .arm.atpcs \
713 -R .comment \ 714 -R .comment \
714 -R .debug_abbrev \ 715 -R .debug_abbrev \
715 -R .debug_aranges \ 716 -R .debug_aranges \
716 -R .debug_info \ 717 -R .debug_info \
717 -R .debug_line \ 718 -R .debug_line \
718 -R .debug_frame \ 719 -R .debug_frame \
719 -R .debug_loc \ 720 -R .debug_loc \
720 -R .debug_pubnames \ 721 -R .debug_pubnames \
721 -R .debug_pubtypes \ 722 -R .debug_pubtypes \
722 -R .debug_ranges \ 723 -R .debug_ranges \
723 -R .debug_str \ 724 -R .debug_str \
724 -R .debug_macinfo \ 725 -R .debug_macinfo \
725 -R .eh_frame \ 726 -R .eh_frame \
726 -R .note.netbsd.ident 727 -R .note.netbsd.ident
727.endif 728.endif
728 729
729# 730#
730# Targets to check if DESTDIR or RELEASEDIR is provided 731# Targets to check if DESTDIR or RELEASEDIR is provided
731# 732#
732.if !target(check_DESTDIR) 733.if !target(check_DESTDIR)
733check_DESTDIR: .PHONY .NOTMAIN 734check_DESTDIR: .PHONY .NOTMAIN
734.if !defined(DESTDIR) 735.if !defined(DESTDIR)
735 @echo "setenv DESTDIR before doing that!" 736 @echo "setenv DESTDIR before doing that!"
736 @false 737 @false
737.else 738.else
738 @true 739 @true
739.endif 740.endif
740.endif 741.endif
741 742
742.if !target(check_RELEASEDIR) 743.if !target(check_RELEASEDIR)
743check_RELEASEDIR: .PHONY .NOTMAIN 744check_RELEASEDIR: .PHONY .NOTMAIN
744.if !defined(RELEASEDIR) 745.if !defined(RELEASEDIR)
745 @echo "setenv RELEASEDIR before doing that!" 746 @echo "setenv RELEASEDIR before doing that!"
746 @false 747 @false
747.else 748.else
748 @true 749 @true
749.endif 750.endif
750.endif 751.endif
751 752
752# 753#
753# Where the system object and source trees are kept; can be configurable 754# Where the system object and source trees are kept; can be configurable
754# by the user in case they want them in ~/foosrc and ~/fooobj (for example). 755# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
755# 756#
756BSDSRCDIR?= /usr/src 757BSDSRCDIR?= /usr/src
757BSDOBJDIR?= /usr/obj 758BSDOBJDIR?= /usr/obj
758NETBSDSRCDIR?= ${BSDSRCDIR} 759NETBSDSRCDIR?= ${BSDSRCDIR}
759 760
760BINGRP?= wheel 761BINGRP?= wheel
761BINOWN?= root 762BINOWN?= root
762BINMODE?= 555 763BINMODE?= 555
763NONBINMODE?= 444 764NONBINMODE?= 444
764 765
765# These are here mainly because we don't want suid root in case 766# These are here mainly because we don't want suid root in case
766# a Makefile defines BINMODE. 767# a Makefile defines BINMODE.
767RUMPBINGRP?= wheel 768RUMPBINGRP?= wheel
768RUMPBINOWN?= root 769RUMPBINOWN?= root
769RUMPBINMODE?= 555 770RUMPBINMODE?= 555
770RUMPNONBINMODE?=444 771RUMPNONBINMODE?=444
771 772
772MANDIR?= /usr/share/man 773MANDIR?= /usr/share/man
773MANGRP?= wheel 774MANGRP?= wheel
774MANOWN?= root 775MANOWN?= root
775MANMODE?= ${NONBINMODE} 776MANMODE?= ${NONBINMODE}
776MANINSTALL?= ${_MANINSTALL} 777MANINSTALL?= ${_MANINSTALL}
777 778
778INFODIR?= /usr/share/info 779INFODIR?= /usr/share/info
779INFOGRP?= wheel 780INFOGRP?= wheel
780INFOOWN?= root 781INFOOWN?= root
781INFOMODE?= ${NONBINMODE} 782INFOMODE?= ${NONBINMODE}
782 783
783LIBDIR?= /usr/lib 784LIBDIR?= /usr/lib
784 785
785LINTLIBDIR?= /usr/libdata/lint 786LINTLIBDIR?= /usr/libdata/lint
786LIBGRP?= ${BINGRP} 787LIBGRP?= ${BINGRP}
787LIBOWN?= ${BINOWN} 788LIBOWN?= ${BINOWN}
788LIBMODE?= ${NONBINMODE} 789LIBMODE?= ${NONBINMODE}
789 790
790DOCDIR?= /usr/share/doc 791DOCDIR?= /usr/share/doc
791DOCGRP?= wheel 792DOCGRP?= wheel
792DOCOWN?= root 793DOCOWN?= root
793DOCMODE?= ${NONBINMODE} 794DOCMODE?= ${NONBINMODE}
794 795
795NLSDIR?= /usr/share/nls 796NLSDIR?= /usr/share/nls
796NLSGRP?= wheel 797NLSGRP?= wheel
797NLSOWN?= root 798NLSOWN?= root
798NLSMODE?= ${NONBINMODE} 799NLSMODE?= ${NONBINMODE}
799 800
800KMODULEGRP?= wheel 801KMODULEGRP?= wheel
801KMODULEOWN?= root 802KMODULEOWN?= root
802KMODULEMODE?= ${NONBINMODE} 803KMODULEMODE?= ${NONBINMODE}
803 804
804LOCALEDIR?= /usr/share/locale 805LOCALEDIR?= /usr/share/locale
805LOCALEGRP?= wheel 806LOCALEGRP?= wheel
806LOCALEOWN?= root 807LOCALEOWN?= root
807LOCALEMODE?= ${NONBINMODE} 808LOCALEMODE?= ${NONBINMODE}
808 809
809FIRMWAREDIR?= /libdata/firmware 810FIRMWAREDIR?= /libdata/firmware
810FIRMWAREGRP?= wheel 811FIRMWAREGRP?= wheel
811FIRMWAREOWN?= root 812FIRMWAREOWN?= root
812FIRMWAREMODE?= ${NONBINMODE} 813FIRMWAREMODE?= ${NONBINMODE}
813 814
814DEBUGDIR?= /usr/libdata/debug 815DEBUGDIR?= /usr/libdata/debug
815DEBUGGRP?= wheel 816DEBUGGRP?= wheel
816DEBUGOWN?= root 817DEBUGOWN?= root
817DEBUGMODE?= ${NONBINMODE} 818DEBUGMODE?= ${NONBINMODE}
818 819
819DTBDIR?= /boot/dtb 820DTBDIR?= /boot/dtb
820DTBGRP?= wheel 821DTBGRP?= wheel
821DTBOWN?= root 822DTBOWN?= root
822DTBMODE?= ${NONBINMODE} 823DTBMODE?= ${NONBINMODE}
823 824
824MKDIRMODE?= 0755 825MKDIRMODE?= 0755
825MKDIRPERM?= -m ${MKDIRMODE} 826MKDIRPERM?= -m ${MKDIRMODE}
826 827
827# 828#
828# Data-driven table using make variables to control how 829# Data-driven table using make variables to control how
829# toolchain-dependent targets and shared libraries are built 830# toolchain-dependent targets and shared libraries are built
830# for different platforms and object formats. 831# for different platforms and object formats.
831# 832#
832# OBJECT_FMT: currently either "ELF" or "a.out". 833# OBJECT_FMT: currently either "ELF" or "a.out".
833# 834#
834# All platforms are ELF. 835# All platforms are ELF.
835# 836#
836OBJECT_FMT= ELF 837OBJECT_FMT= ELF
837 838
838# 839#
839# If this platform's toolchain is missing, we obviously cannot build it. 840# If this platform's toolchain is missing, we obviously cannot build it.
840# 841#
841.if ${TOOLCHAIN_MISSING} != "no" 842.if ${TOOLCHAIN_MISSING} != "no"
842MKBINUTILS:= no 843MKBINUTILS:= no
843MKGDB:= no 844MKGDB:= no
844MKGCC:= no 845MKGCC:= no
845.endif 846.endif
846 847
847# 848#
848# If we are using an external toolchain, we can still build the target's 849# If we are using an external toolchain, we can still build the target's
849# binutils, but we cannot build GCC's support libraries, since those are 850# binutils, but we cannot build GCC's support libraries, since those are
850# tightly-coupled to the version of GCC being used. 851# tightly-coupled to the version of GCC being used.
851# 852#
852.if defined(EXTERNAL_TOOLCHAIN) 853.if defined(EXTERNAL_TOOLCHAIN)
853MKGCC:= no 854MKGCC:= no
854.endif 855.endif
855 856
856MKGDB.or1k= no 857MKGDB.or1k= no
857MKGDB.riscv32= no 858MKGDB.riscv32= no
858MKGDB.riscv64= no 859MKGDB.riscv64= no
859 860
860# No kernel modules for or1k, riscv or mips (yet) 861# No kernel modules for or1k, riscv or mips (yet)
861MKKMOD.or1k= no 862MKKMOD.or1k= no
862MKKMOD.riscv32= no 863MKKMOD.riscv32= no
863MKKMOD.riscv64= no 864MKKMOD.riscv64= no
864 865
865# No profiling for or1k (yet) 866# No profiling for or1k (yet)
866MKPROFILE.or1k= no 867MKPROFILE.or1k= no
867MKPROFILE.riscv32=no 868MKPROFILE.riscv32=no
868MKPROFILE.riscv64=no 869MKPROFILE.riscv64=no
869 870
870# 871#
871# The m68000 port is incomplete. 872# The m68000 port is incomplete.
872# 873#
873.if ${MACHINE_ARCH} == "m68000" 874.if ${MACHINE_ARCH} == "m68000"
874NOPIC= # defined 875NOPIC= # defined
875MKISCSI= no 876MKISCSI= no
876# XXX GCC 4 outputs mcount() calling sequences that try to load values 877# XXX GCC 4 outputs mcount() calling sequences that try to load values
877# from over 64KB away and this fails to assemble. 878# from over 64KB away and this fails to assemble.
878.if defined(HAVE_GCC) 879.if defined(HAVE_GCC)
879NOPROFILE= # defined 880NOPROFILE= # defined
880.endif 881.endif
881.endif 882.endif
882 883
883# 884#
884# GCC warnings with simple disables. Use these with eg 885# GCC warnings with simple disables. Use these with eg
885# COPTS.foo.c+= ${GCC_NO_STRINGOP_TRUNCATION}. 886# COPTS.foo.c+= ${GCC_NO_STRINGOP_TRUNCATION}.
886# 887#
887GCC_NO_FORMAT_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :} 888GCC_NO_FORMAT_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-truncation :}
888GCC_NO_FORMAT_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :} 889GCC_NO_FORMAT_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-format-overflow :}
889GCC_NO_STRINGOP_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :} 890GCC_NO_STRINGOP_OVERFLOW= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-stringop-overflow :}
890GCC_NO_IMPLICIT_FALLTHRU= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}  891GCC_NO_IMPLICIT_FALLTHRU= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-implicit-fallthrough :}
891GCC_NO_STRINGOP_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :} 892GCC_NO_STRINGOP_TRUNCATION= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-stringop-truncation :}
892GCC_NO_CAST_FUNCTION_TYPE= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :} 893GCC_NO_CAST_FUNCTION_TYPE= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -Wno-cast-function-type :}
893GCC_NO_ADDR_OF_PACKED_MEMBER= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :} 894GCC_NO_ADDR_OF_PACKED_MEMBER= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-address-of-packed-member :}
894GCC_NO_MAYBE_UNINITIALIZED= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :} 895GCC_NO_MAYBE_UNINITIALIZED= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-maybe-uninitialized :}
895GCC_NO_RETURN_LOCAL_ADDR= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :} 896GCC_NO_RETURN_LOCAL_ADDR= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-return-local-addr :}
896 897
897# 898#
898# Clang warnings 899# Clang warnings
899# 900#
900CLANG_NO_ADDR_OF_PACKED_MEMBER= ${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :} 901CLANG_NO_ADDR_OF_PACKED_MEMBER= ${${ACTIVE_CC} == "clang" :? -Wno-error=address-of-packed-member :}
901 902
902NO_ADDR_OF_PACKED_MEMBER= ${CLANG_NO_ADDR_OF_PACKED_MEMBER} ${GCC_NO_ADDR_OF_PACKED_MEMBER} 903NO_ADDR_OF_PACKED_MEMBER= ${CLANG_NO_ADDR_OF_PACKED_MEMBER} ${GCC_NO_ADDR_OF_PACKED_MEMBER}
903 904
904# 905#
905# The ia64 port is incomplete. 906# The ia64 port is incomplete.
906# 907#
907MKGDB.ia64= no 908MKGDB.ia64= no
908 909
909# 910#
910# On VAX using ELF, all objects are PIC, not just shared libraries, 911# On VAX using ELF, all objects are PIC, not just shared libraries,
911# so don't build the _pic version. VAX has no native TLS support either, 912# so don't build the _pic version. VAX has no native TLS support either,
912# so differences between TLS models are not relevant. 913# so differences between TLS models are not relevant.
913# 914#
914MKPICLIB.vax= no 915MKPICLIB.vax= no
915 916
916# 917#
917# Location of the file that contains the major and minor numbers of the 918# Location of the file that contains the major and minor numbers of the
918# version of a shared library. If this file exists a shared library 919# version of a shared library. If this file exists a shared library
919# will be built by <bsd.lib.mk>. 920# will be built by <bsd.lib.mk>.
920# 921#
921SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version 922SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
922 923
923# 924#
924# GNU sources and packages sometimes see architecture names differently. 925# GNU sources and packages sometimes see architecture names differently.
925# 926#
926GNU_ARCH.aarch64eb=aarch64_be 927GNU_ARCH.aarch64eb=aarch64_be
927GNU_ARCH.coldfire=m5407 928GNU_ARCH.coldfire=m5407
928GNU_ARCH.earm=arm 929GNU_ARCH.earm=arm
929GNU_ARCH.earmhf=arm 930GNU_ARCH.earmhf=arm
930GNU_ARCH.earmeb=armeb 931GNU_ARCH.earmeb=armeb
931GNU_ARCH.earmhfeb=armeb 932GNU_ARCH.earmhfeb=armeb
932GNU_ARCH.earmv4=armv4 933GNU_ARCH.earmv4=armv4
933GNU_ARCH.earmv4eb=armv4eb 934GNU_ARCH.earmv4eb=armv4eb
934GNU_ARCH.earmv5=arm 935GNU_ARCH.earmv5=arm
935GNU_ARCH.earmv5hf=arm 936GNU_ARCH.earmv5hf=arm
936GNU_ARCH.earmv5eb=armeb 937GNU_ARCH.earmv5eb=armeb
937GNU_ARCH.earmv5hfeb=armeb 938GNU_ARCH.earmv5hfeb=armeb
938GNU_ARCH.earmv6=armv6 939GNU_ARCH.earmv6=armv6
939GNU_ARCH.earmv6hf=armv6 940GNU_ARCH.earmv6hf=armv6
940GNU_ARCH.earmv6eb=armv6eb 941GNU_ARCH.earmv6eb=armv6eb
941GNU_ARCH.earmv6hfeb=armv6eb 942GNU_ARCH.earmv6hfeb=armv6eb
942GNU_ARCH.earmv7=armv7 943GNU_ARCH.earmv7=armv7
943GNU_ARCH.earmv7hf=armv7 944GNU_ARCH.earmv7hf=armv7
944GNU_ARCH.earmv7eb=armv7eb 945GNU_ARCH.earmv7eb=armv7eb
945GNU_ARCH.earmv7hfeb=armv7eb 946GNU_ARCH.earmv7hfeb=armv7eb
946GNU_ARCH.i386=i486 947GNU_ARCH.i386=i486
947GCC_CONFIG_ARCH.i386=i486 948GCC_CONFIG_ARCH.i386=i486
948GCC_CONFIG_TUNE.i386=nocona 949GCC_CONFIG_TUNE.i386=nocona
949GCC_CONFIG_TUNE.x86_64=nocona 950GCC_CONFIG_TUNE.x86_64=nocona
950GNU_ARCH.m68000=m68010 951GNU_ARCH.m68000=m68010
951GNU_ARCH.sh3eb=sh 952GNU_ARCH.sh3eb=sh
952GNU_ARCH.sh3el=shle 953GNU_ARCH.sh3el=shle
953GNU_ARCH.mips64eb=mips64 954GNU_ARCH.mips64eb=mips64
954MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} 955MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
955 956
956# 957#
957# In order to identify NetBSD to GNU packages, we sometimes need 958# In order to identify NetBSD to GNU packages, we sometimes need
958# an "elf" tag for historically a.out platforms. 959# an "elf" tag for historically a.out platforms.
959# 960#
960.if (!empty(MACHINE_ARCH:Mearm*)) 961.if (!empty(MACHINE_ARCH:Mearm*))
961MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/} 962MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
962.elif (${MACHINE_GNU_ARCH} == "arm" || \ 963.elif (${MACHINE_GNU_ARCH} == "arm" || \
963 ${MACHINE_GNU_ARCH} == "armeb" || \ 964 ${MACHINE_GNU_ARCH} == "armeb" || \
964 ${MACHINE_ARCH} == "i386" || \ 965 ${MACHINE_ARCH} == "i386" || \
965 ${MACHINE_CPU} == "m68k" || \ 966 ${MACHINE_CPU} == "m68k" || \
966 ${MACHINE_GNU_ARCH} == "sh" || \ 967 ${MACHINE_GNU_ARCH} == "sh" || \
967 ${MACHINE_GNU_ARCH} == "shle" || \ 968 ${MACHINE_GNU_ARCH} == "shle" || \
968 ${MACHINE_ARCH} == "sparc" || \ 969 ${MACHINE_ARCH} == "sparc" || \
969 ${MACHINE_ARCH} == "vax") 970 ${MACHINE_ARCH} == "vax")
970MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf 971MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
971.else 972.else
972MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd 973MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
973.endif 974.endif
974 975
975.if !empty(MACHINE_ARCH:M*arm*) 976.if !empty(MACHINE_ARCH:M*arm*)
976# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand. 977# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
977ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft -marm 978ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft -marm
978ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :} 979ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
979ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :} 980ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
980.endif 981.endif
981 982
982GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :} 983GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
983 984
984TARGETS+= all clean cleandir depend dependall includes \ 985TARGETS+= all clean cleandir depend dependall includes \
985 install lint obj regress tags html analyze describe \ 986 install lint obj regress tags html analyze describe \
986 rumpdescribe 987 rumpdescribe
987PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \ 988PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
988 install lint obj regress beforedepend afterdepend \ 989 install lint obj regress beforedepend afterdepend \
989 beforeinstall afterinstall realinstall realdepend realall \ 990 beforeinstall afterinstall realinstall realdepend realall \
990 html subdir-all subdir-install subdir-depend analyze describe \ 991 html subdir-all subdir-install subdir-depend analyze describe \
991 rumpdescribe 992 rumpdescribe
992.PHONY: ${PHONY_NOTMAIN} 993.PHONY: ${PHONY_NOTMAIN}
993.NOTMAIN: ${PHONY_NOTMAIN} 994.NOTMAIN: ${PHONY_NOTMAIN}
994 995
995.if ${NEED_OWN_INSTALL_TARGET} != "no" 996.if ${NEED_OWN_INSTALL_TARGET} != "no"
996.if !target(install) 997.if !target(install)
997install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall 998install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
998beforeinstall: 999beforeinstall:
999subdir-install: 1000subdir-install:
1000realinstall: 1001realinstall:
1001afterinstall: 1002afterinstall:
1002.endif 1003.endif
1003all: realall subdir-all 1004all: realall subdir-all
1004subdir-all: 1005subdir-all:
1005realall: 1006realall:
1006depend: realdepend subdir-depend 1007depend: realdepend subdir-depend
1007subdir-depend: 1008subdir-depend:
1008realdepend: 1009realdepend:
1009distclean: cleandir 1010distclean: cleandir
1010cleandir: clean 1011cleandir: clean
1011 1012
1012dependall: .NOTMAIN realdepend .MAKE 1013dependall: .NOTMAIN realdepend .MAKE
1013 @cd "${.CURDIR}"; ${MAKE} realall 1014 @cd "${.CURDIR}"; ${MAKE} realall
1014.endif 1015.endif
1015 1016
1016# 1017#
1017# Define MKxxx variables (which are either yes or no) for users 1018# Define MKxxx variables (which are either yes or no) for users
1018# to set in /etc/mk.conf and override in the make environment. 1019# to set in /etc/mk.conf and override in the make environment.
1019# These should be tested with `== "no"' or `!= "no"'. 1020# These should be tested with `== "no"' or `!= "no"'.
1020# The NOxxx variables should only be set by Makefiles. 1021# The NOxxx variables should only be set by Makefiles.
1021# 1022#
1022# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync 1023# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
1023# with changes to the MK* variables here. 1024# with changes to the MK* variables here.
1024# 1025#
1025 1026
1026# 1027#
1027# Supported NO* options (if defined, MK* will be forced to "no", 1028# Supported NO* options (if defined, MK* will be forced to "no",
1028# regardless of user's mk.conf setting). 1029# regardless of user's mk.conf setting).
1029# 1030#
1030# Source makefiles should set NO*, and not MK*, and must do so before 1031# Source makefiles should set NO*, and not MK*, and must do so before
1031# including bsd.own.mk. 1032# including bsd.own.mk.
1032# 1033#
1033.for var in \ 1034.for var in \
1034 NOCOMPAT NOCRYPTO NODOC NOHTML NOINFO NOLIBCSANITIZER NOLINKLIB \ 1035 NOCOMPAT NOCRYPTO NODOC NOHTML NOINFO NOLIBCSANITIZER NOLINKLIB \
1035 NOLINT NOMAN NONLS NOOBJ NOPIC NOPICINSTALL NOPROFILE NOSHARE \ 1036 NOLINT NOMAN NONLS NOOBJ NOPIC NOPICINSTALL NOPROFILE NOSHARE \
1036 NOSTATICLIB NODEBUGLIB NOSANITIZER NORELRO 1037 NOSTATICLIB NODEBUGLIB NOSANITIZER NORELRO
1037.if defined(${var}) 1038.if defined(${var})
1038MK${var:S/^NO//}:= no 1039MK${var:S/^NO//}:= no
1039.endif 1040.endif
1040.endfor 1041.endfor
1041 1042
1042# 1043#
1043# Older-style variables that enabled behaviour when set. 1044# Older-style variables that enabled behaviour when set.
1044# 1045#
1045.for var in MANZ UNPRIVED UPDATE 1046.for var in MANZ UNPRIVED UPDATE
1046.if defined(${var}) 1047.if defined(${var})
1047MK${var}:= yes 1048MK${var}:= yes
1048.endif 1049.endif
1049.endfor 1050.endfor
1050 1051
1051# 1052#
1052# MK* options which have variable defaults. 1053# MK* options which have variable defaults.
1053# 1054#
1054# aarch64eb is not yet supported. 1055# aarch64eb is not yet supported.
1055# 1056#
1056.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \ 1057.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
1057 || ${MACHINE_MIPS64} \ 1058 || ${MACHINE_MIPS64} \
1058 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \ 1059 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \
1059 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*) 1060 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*)
1060MKCOMPAT?= yes 1061MKCOMPAT?= yes
1061.else 1062.else
1062# Don't let this build where it really isn't supported. 1063# Don't let this build where it really isn't supported.
1063MKCOMPAT:= no 1064MKCOMPAT:= no
1064.endif 1065.endif
1065 1066
1066.if ${MKCOMPAT} == "no" 1067.if ${MKCOMPAT} == "no"
1067MKCOMPATTESTS:= no 1068MKCOMPATTESTS:= no
1068MKCOMPATX11:= no 1069MKCOMPATX11:= no
1069.endif 1070.endif
1070 1071
1071.if ${MACHINE_MIPS64} \ 1072.if ${MACHINE_MIPS64} \
1072 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc") 1073 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
1073MKCOMPATMODULES?= yes 1074MKCOMPATMODULES?= yes
1074.else 1075.else
1075MKCOMPATMODULES:= no 1076MKCOMPATMODULES:= no
1076.endif 1077.endif
1077 1078
1078# 1079#
1079# These platforms use softfloat by default. 1080# These platforms use softfloat by default.