Thu Mar 24 09:15:38 2016 UTC ()
Switch mips64 over to new gdb - old one doesn't work there either, better
to debug in the newer version.


(martin)
diff -r1.909 -r1.910 src/share/mk/bsd.own.mk

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

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