Thu Apr 18 16:12:31 2024 UTC (45d)
Pull up following revision(s) (requested by riastradh in ticket #1834):

	share/mk/bsd.own.mk: revision 1.1177

ZFS works fine on my v210, so let's enable it for sparc64


(martin)
diff -r1.1149.2.7 -r1.1149.2.8 src/share/mk/bsd.own.mk

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

--- src/share/mk/bsd.own.mk 2024/04/18 15:24:20 1.1149.2.7
+++ src/share/mk/bsd.own.mk 2024/04/18 16:12:31 1.1149.2.8
@@ -1,1679 +1,1680 @@ @@ -1,1679 +1,1680 @@
1# $NetBSD: bsd.own.mk,v 1.1149.2.7 2024/04/18 15:24:20 martin Exp $ 1# $NetBSD: bsd.own.mk,v 1.1149.2.8 2024/04/18 16:12:31 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"
48# TOOLCHAIN_MISSING?= yes 48# TOOLCHAIN_MISSING?= yes
49# .endif 49# .endif
50 50
51TOOLCHAIN_MISSING?= no 51TOOLCHAIN_MISSING?= no
52 52
53# 53#
54# GCC Using platforms. 54# GCC Using platforms.
55# 55#
56.if ${MKGCC:Uyes} != "no" 56.if ${MKGCC:Uyes} != "no"
57 57
58# 58#
59# What GCC is used? 59# What GCC is used?
60# 60#
61HAVE_GCC?= 7 61HAVE_GCC?= 7
62 62
63# 63#
64# Platforms that can't run a modern GCC natively 64# Platforms that can't run a modern GCC natively
65.if ${MACHINE_ARCH} == "m68000" 65.if ${MACHINE_ARCH} == "m68000"
66MKGCCCMDS?= no 66MKGCCCMDS?= no
67.endif 67.endif
68 68
69# 69#
70# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is 70# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
71# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC. 71# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
72# 72#
73.if ${HAVE_GCC} == 6 73.if ${HAVE_GCC} == 6
74EXTERNAL_GCC_SUBDIR?= gcc.old 74EXTERNAL_GCC_SUBDIR?= gcc.old
75.elif ${HAVE_GCC} == 7 75.elif ${HAVE_GCC} == 7
76EXTERNAL_GCC_SUBDIR?= gcc 76EXTERNAL_GCC_SUBDIR?= gcc
77.else 77.else
78EXTERNAL_GCC_SUBDIR?= /does/not/exist 78EXTERNAL_GCC_SUBDIR?= /does/not/exist
79.endif 79.endif
80.else 80.else
81MKGCCCMDS?= no 81MKGCCCMDS?= no
82.endif 82.endif
83 83
84# 84#
85# What OpenSSL is used? 85# What OpenSSL is used?
86#  86#
87HAVE_OPENSSL?= 11 87HAVE_OPENSSL?= 11
88 88
89.if ${HAVE_OPENSSL} == 11 89.if ${HAVE_OPENSSL} == 11
90EXTERNAL_OPENSSL_SUBDIR=openssl 90EXTERNAL_OPENSSL_SUBDIR=openssl
91.elif ${HAVE_OPENSSL} == 10 91.elif ${HAVE_OPENSSL} == 10
92EXTERNAL_OPENSSL_SUBDIR=openssl.old 92EXTERNAL_OPENSSL_SUBDIR=openssl.old
93.else 93.else
94EXTERNAL_OPENSSL_SUBDIR=/does/not/exist 94EXTERNAL_OPENSSL_SUBDIR=/does/not/exist
95.endif 95.endif
96 96
97.if !empty(MACHINE_ARCH:Mearm*) 97.if !empty(MACHINE_ARCH:Mearm*)
98_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes 98_LIBC_COMPILER_RT.${MACHINE_ARCH}= yes
99.endif 99.endif
100 100
101_LIBC_COMPILER_RT.aarch64= yes 101_LIBC_COMPILER_RT.aarch64= yes
102_LIBC_COMPILER_RT.aarch64eb= yes 102_LIBC_COMPILER_RT.aarch64eb= yes
103_LIBC_COMPILER_RT.i386= yes 103_LIBC_COMPILER_RT.i386= yes
104_LIBC_COMPILER_RT.powerpc= yes 104_LIBC_COMPILER_RT.powerpc= yes
105_LIBC_COMPILER_RT.powerpc64= yes 105_LIBC_COMPILER_RT.powerpc64= yes
106_LIBC_COMPILER_RT.sparc= yes 106_LIBC_COMPILER_RT.sparc= yes
107_LIBC_COMPILER_RT.sparc64= yes 107_LIBC_COMPILER_RT.sparc64= yes
108_LIBC_COMPILER_RT.x86_64= yes 108_LIBC_COMPILER_RT.x86_64= yes
109 109
110.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes" 110.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
111HAVE_LIBGCC?= no 111HAVE_LIBGCC?= no
112.else 112.else
113HAVE_LIBGCC?= yes 113HAVE_LIBGCC?= yes
114.endif 114.endif
115 115
116 116
117# Should libgcc have unwinding code? 117# Should libgcc have unwinding code?
118.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*) 118.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
119HAVE_LIBGCC_EH?= no 119HAVE_LIBGCC_EH?= no
120.else 120.else
121HAVE_LIBGCC_EH?= yes 121HAVE_LIBGCC_EH?= yes
122.endif 122.endif
123 123
124# Coverity does not like SSP 124# Coverity does not like SSP
125.if defined(COVERITY_TOP_CONFIG) || \ 125.if defined(COVERITY_TOP_CONFIG) || \
126 ${MACHINE} == "alpha" || \ 126 ${MACHINE} == "alpha" || \
127 ${MACHINE} == "hppa" || \ 127 ${MACHINE} == "hppa" || \
128 ${MACHINE} == "ia64" || \ 128 ${MACHINE} == "ia64" || \
129 ${MACHINE_CPU} == "mips" 129 ${MACHINE_CPU} == "mips"
130HAVE_SSP?= no 130HAVE_SSP?= no
131.else 131.else
132HAVE_SSP?= yes 132HAVE_SSP?= yes
133.if !defined(NOFORT) && ${USE_FORT:Uno} != "no" 133.if !defined(NOFORT) && ${USE_FORT:Uno} != "no"
134USE_SSP?= yes 134USE_SSP?= yes
135.endif 135.endif
136.endif 136.endif
137 137
138# 138#
139# What GDB is used? 139# What GDB is used?
140# 140#
141HAVE_GDB?= 830 141HAVE_GDB?= 830
142 142
143.if ${HAVE_GDB} == 830 143.if ${HAVE_GDB} == 830
144EXTERNAL_GDB_SUBDIR= gdb 144EXTERNAL_GDB_SUBDIR= gdb
145.elif ${HAVE_GDB} == 801 145.elif ${HAVE_GDB} == 801
146EXTERNAL_GDB_SUBDIR= gdb.old 146EXTERNAL_GDB_SUBDIR= gdb.old
147.else 147.else
148EXTERNAL_GDB_SUBDIR= /does/not/exist 148EXTERNAL_GDB_SUBDIR= /does/not/exist
149.endif 149.endif
150 150
151# 151#
152# What binutils is used? 152# What binutils is used?
153# 153#
154HAVE_BINUTILS?= 231 154HAVE_BINUTILS?= 231
155 155
156.if ${HAVE_BINUTILS} == 231 156.if ${HAVE_BINUTILS} == 231
157EXTERNAL_BINUTILS_SUBDIR= binutils 157EXTERNAL_BINUTILS_SUBDIR= binutils
158.elif ${HAVE_BINUTILS} == 227 158.elif ${HAVE_BINUTILS} == 227
159EXTERNAL_BINUTILS_SUBDIR= binutils.old 159EXTERNAL_BINUTILS_SUBDIR= binutils.old
160.else 160.else
161EXTERNAL_BINUTILS_SUBDIR= /does/not/exist 161EXTERNAL_BINUTILS_SUBDIR= /does/not/exist
162.endif 162.endif
163 163
164# 164#
165# What version of jemalloc we use (100 is the one 165# What version of jemalloc we use (100 is the one
166# built-in to libc from 2005 (pre version 3). 166# built-in to libc from 2005 (pre version 3).
167# 167#
168HAVE_JEMALLOC?= 510 168HAVE_JEMALLOC?= 510
169 169
170.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*) 170.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
171.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR) 171.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
172PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx 172PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
173.else 173.else
174PRINTOBJDIR= ${MAKE} -V .OBJDIR 174PRINTOBJDIR= ${MAKE} -V .OBJDIR
175.endif 175.endif
176.else 176.else
177PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion 177PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
178.endif 178.endif
179 179
180# 180#
181# 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
182# 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,
183# and setting _SRC_TOP_ to the result. 183# and setting _SRC_TOP_ to the result.
184# 184#
185.if !defined(_SRC_TOP_) # { 185.if !defined(_SRC_TOP_) # {
186_SRC_TOP_!= cd "${.CURDIR}"; while :; do \ 186_SRC_TOP_!= cd "${.CURDIR}"; while :; do \
187 here=`pwd`; \ 187 here=`pwd`; \
188 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \ 188 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
189 case $$here in /) echo ""; break;; esac; \ 189 case $$here in /) echo ""; break;; esac; \
190 cd ..; done 190 cd ..; done
191 191
192.MAKEOVERRIDES+= _SRC_TOP_ 192.MAKEOVERRIDES+= _SRC_TOP_
193 193
194.endif # } 194.endif # }
195 195
196# 196#
197# If _SRC_TOP_ != "", we're within the NetBSD source tree. 197# If _SRC_TOP_ != "", we're within the NetBSD source tree.
198# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_. 198# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
199# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the 199# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
200# NetBSD version, or on variables defined at build time, can 200# NetBSD version, or on variables defined at build time, can
201# declare a dependency on ${_NETBSD_VERSION_DEPENDS}. 201# declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
202# 202#
203.if (${_SRC_TOP_} != "") # { 203.if (${_SRC_TOP_} != "") # {
204 204
205NETBSDSRCDIR?= ${_SRC_TOP_} 205NETBSDSRCDIR?= ${_SRC_TOP_}
206 206
207.if !defined(_SRC_TOP_OBJ_) 207.if !defined(_SRC_TOP_OBJ_)
208_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR} 208_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
209.MAKEOVERRIDES+= _SRC_TOP_OBJ_ 209.MAKEOVERRIDES+= _SRC_TOP_OBJ_
210.endif 210.endif
211 211
212_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params 212_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
213_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h 213_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
214_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh 214_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
215_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh 215_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
216${_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"
217 217
218.endif # _SRC_TOP_ != "" # } 218.endif # _SRC_TOP_ != "" # }
219 219
220 220
221.if (${_SRC_TOP_} != "") && \ 221.if (${_SRC_TOP_} != "") && \
222 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) 222 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
223USETOOLS?= yes 223USETOOLS?= yes
224.endif 224.endif
225USETOOLS?= no 225USETOOLS?= no
226 226
227 227
228.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \ 228.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
229 ${MACHINE_ARCH} == "sh3" 229 ${MACHINE_ARCH} == "sh3"
230.BEGIN: 230.BEGIN:
231 @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"
232 @false 232 @false
233.elif defined(REQUIRETOOLS) && \ 233.elif defined(REQUIRETOOLS) && \
234 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \ 234 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
235 ${USETOOLS} == "no" 235 ${USETOOLS} == "no"
236.BEGIN: 236.BEGIN:
237 @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"
238 @false 238 @false
239.endif 239.endif
240 240
241# 241#
242# Host platform information; may be overridden 242# Host platform information; may be overridden
243# 243#
244.include <bsd.host.mk> 244.include <bsd.host.mk>
245 245
246.if ${USETOOLS} == "yes" # { 246.if ${USETOOLS} == "yes" # {
247 247
248# 248#
249# Provide a default for TOOLDIR. 249# Provide a default for TOOLDIR.
250# 250#
251.if !defined(TOOLDIR) 251.if !defined(TOOLDIR)
252TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE} 252TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
253.MAKEOVERRIDES+= TOOLDIR 253.MAKEOVERRIDES+= TOOLDIR
254.endif 254.endif
255 255
256# 256#
257# This is the prefix used for the NetBSD-sourced tools. 257# This is the prefix used for the NetBSD-sourced tools.
258# 258#
259_TOOL_PREFIX?= nb 259_TOOL_PREFIX?= nb
260 260
261# 261#
262# If an external toolchain base is specified, use it. 262# If an external toolchain base is specified, use it.
263# 263#
264.if defined(EXTERNAL_TOOLCHAIN) # { 264.if defined(EXTERNAL_TOOLCHAIN) # {
265AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar 265AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
266AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as 266AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
267LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld 267LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
268NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm 268NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
269OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy 269OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
270OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump 270OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
271RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib 271RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
272READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf 272READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
273SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size 273SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
274STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings 274STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
275STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip 275STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
276 276
277TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 277TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
278TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp 278TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
279TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++ 279TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
280TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran 280TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gfortran
281TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 281TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
282 282
283TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 283TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
284TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 284TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
285TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++ 285TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
286TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 286TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
287.else # } { 287.else # } {
288# Define default locations for common tools. 288# Define default locations for common tools.
289.if ${USETOOLS_BINUTILS:Uyes} == "yes" # { 289.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
290AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar 290AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
291AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as 291AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
292LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld 292LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
293NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm 293NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
294OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy 294OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
295OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump 295OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
296RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib 296RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
297READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf 297READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
298SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size 298SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
299STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings 299STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
300STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip 300STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
301 301
302# GCC supports C, C++, Fortran and Objective C 302# GCC supports C, C++, Fortran and Objective C
303TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 303TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
304TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp 304TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
305TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++ 305TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
306TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran 306TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gfortran
307TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 307TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
308.endif # } 308.endif # }
309 309
310# Clang supports C, C++ and Objective C 310# Clang supports C, C++ and Objective C
311TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 311TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
312TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 312TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
313TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++ 313TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
314TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 314TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
315 315
316# PCC supports C and Fortran 316# PCC supports C and Fortran
317TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc 317TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
318TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp 318TOOL_CPP.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp
319TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++ 319TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
320.endif # EXTERNAL_TOOLCHAIN # } 320.endif # EXTERNAL_TOOLCHAIN # }
321 321
322# 322#
323# Make sure DESTDIR is set, so that builds with these tools always 323# Make sure DESTDIR is set, so that builds with these tools always
324# get appropriate -nostdinc, -nostdlib, etc. handling. The default is 324# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
325# <empty string>, meaning start from /, the root directory. 325# <empty string>, meaning start from /, the root directory.
326# 326#
327DESTDIR?= 327DESTDIR?=
328 328
329# Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.) 329# Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.)
330# because it confuses Coverity. Still we need to cov-configure specially 330# because it confuses Coverity. Still we need to cov-configure specially
331# for each specific sysroot argument. 331# for each specific sysroot argument.
332.if !defined(HOSTPROG) && !defined(HOSTLIB) 332.if !defined(HOSTPROG) && !defined(HOSTLIB)
333. if ${DESTDIR} != "" 333. if ${DESTDIR} != ""
334. if empty(CPPFLAGS:M*--sysroot=*) 334. if empty(CPPFLAGS:M*--sysroot=*)
335CPPFLAGS+= --sysroot=${DESTDIR} 335CPPFLAGS+= --sysroot=${DESTDIR}
336. endif 336. endif
337LDFLAGS+= --sysroot=${DESTDIR} 337LDFLAGS+= --sysroot=${DESTDIR}
338. else 338. else
339. if empty(CPPFLAGS:M*--sysroot=*) 339. if empty(CPPFLAGS:M*--sysroot=*)
340CPPFLAGS+= --sysroot=/ 340CPPFLAGS+= --sysroot=/
341. endif 341. endif
342LDFLAGS+= --sysroot=/ 342LDFLAGS+= --sysroot=/
343. endif 343. endif
344.endif 344.endif
345 345
346DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym 346DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
347ARM_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout 347ARM_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
348M68K_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 348M68K_ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
349MIPS_ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 349MIPS_ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
350INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install 350INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
351LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex 351LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
352LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint 352LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
353LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder 353LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
354MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 354MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
355MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 355MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
356PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl 356PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
357TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q 357TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
358YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc 358YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
359 359
360TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb 360TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
361TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb 361TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
362TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt 362TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
363TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile 363TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
364TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk 364TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
365TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb 365TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
366TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat 366TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
367TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum 367TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
368TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen 368TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
369TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et 369TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
370TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config 370TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
371TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen 371TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
372TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags 372TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
373TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert 373TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
374TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge 374TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
375TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest 375TOOL_CVSLATEST= ${TOOLDIR}/bin/${_TOOL_PREFIX}cvslatest
376TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db 376TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
377TOOL_DISKLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}disklabel 377TOOL_DISKLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}disklabel
378TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc 378TOOL_DTC= ${TOOLDIR}/bin/${_TOOL_PREFIX}dtc
379TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn 379TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
380TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk 380TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
381TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen 381TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
382TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym 382TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
383TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat 383TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
384TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake 384TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
385TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt 385TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gpt
386TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep 386TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
387GROFF_SHARE_PATH= ${TOOLDIR}/share/groff 387GROFF_SHARE_PATH= ${TOOLDIR}/share/groff
388TOOL_GROFF_ENV= \ 388TOOL_GROFF_ENV= \
389 GROFF_ENCODING= \ 389 GROFF_ENCODING= \
390 GROFF_BIN_PATH=${TOOLDIR}/lib/groff \ 390 GROFF_BIN_PATH=${TOOLDIR}/lib/groff \
391 GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \ 391 GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \
392 GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac 392 GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac
393TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS} 393TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS}
394 394
395TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump 395TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
396TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot 396TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
397TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot 397TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
398TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib 398TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
399TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot 399TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
400TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info 400TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
401TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join 401TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
402TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen 402TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
403TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4 403TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
404TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff 404TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
405TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs 405TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
406TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo 406TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
407TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys 407TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
408TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs 408TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
409TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis 409TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
410TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii 410TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
411TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml 411TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
412TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint 412TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
413TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage 413TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
414TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc 414TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
415TOOL_ARMELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout 415TOOL_ARMELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}arm-elf2aout
416TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 416TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
417TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 417TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
418TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper 418TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
419TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb 419TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
420TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale 420TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
421TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file 421TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
422TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod 422TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
423TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp 423TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
424TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage 424TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
425TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb 425TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
426TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc 426TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
427TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree 427TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
428TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf 428TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
429TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs 429TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
430TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax 430TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
431TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic 431TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
432TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz 432TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
433TOOL_XZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}xz 433TOOL_XZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}xz
434TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create 434TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
435TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage 435TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
436TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb 436TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
437TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer 437TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
438TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff 438TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
439TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 439TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
440TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 440TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
441TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} 441TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
442TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 442TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
443TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} 443TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
444TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 444TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
445TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen 445TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
446TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed 446TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
447TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc 447TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
448TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim 448TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
449TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo 449TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo
450TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc 450TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
451TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat 451TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
452TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile 452TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
453TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel 453TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
454TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl 454TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
455TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic 455TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
456TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode 456TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
457TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f 457TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
458TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr 458TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
459TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic 459TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
460 460
461.else # USETOOLS != yes # } { 461.else # USETOOLS != yes # } {
462 462
463# Clang supports C, C++ and Objective C 463# Clang supports C, C++ and Objective C
464TOOL_CC.clang= clang 464TOOL_CC.clang= clang
465TOOL_CPP.clang= clang-cpp 465TOOL_CPP.clang= clang-cpp
466TOOL_CXX.clang= clang++ 466TOOL_CXX.clang= clang++
467TOOL_OBJC.clang= clang 467TOOL_OBJC.clang= clang
468 468
469# GCC supports C, C++, Fortran and Objective C 469# GCC supports C, C++, Fortran and Objective C
470TOOL_CC.gcc= gcc 470TOOL_CC.gcc= gcc
471TOOL_CPP.gcc= cpp 471TOOL_CPP.gcc= cpp
472TOOL_CXX.gcc= c++ 472TOOL_CXX.gcc= c++
473TOOL_FC.gcc= gfortran 473TOOL_FC.gcc= gfortran
474TOOL_OBJC.gcc= gcc 474TOOL_OBJC.gcc= gcc
475 475
476# PCC supports C and Fortran 476# PCC supports C and Fortran
477TOOL_CC.pcc= pcc 477TOOL_CC.pcc= pcc
478TOOL_CPP.pcc= pcpp 478TOOL_CPP.pcc= pcpp
479TOOL_CXX.pcc= p++ 479TOOL_CXX.pcc= p++
480 480
481TOOL_AMIGAAOUT2BB= amiga-aout2bb 481TOOL_AMIGAAOUT2BB= amiga-aout2bb
482TOOL_AMIGAELF2BB= amiga-elf2bb 482TOOL_AMIGAELF2BB= amiga-elf2bb
483TOOL_AMIGATXLT= amiga-txlt 483TOOL_AMIGATXLT= amiga-txlt
484TOOL_ASN1_COMPILE= asn1_compile 484TOOL_ASN1_COMPILE= asn1_compile
485TOOL_AWK= awk 485TOOL_AWK= awk
486TOOL_CAP_MKDB= cap_mkdb 486TOOL_CAP_MKDB= cap_mkdb
487TOOL_CAT= cat 487TOOL_CAT= cat
488TOOL_CKSUM= cksum 488TOOL_CKSUM= cksum
489TOOL_CLANG_TBLGEN= clang-tblgen 489TOOL_CLANG_TBLGEN= clang-tblgen
490TOOL_COMPILE_ET= compile_et 490TOOL_COMPILE_ET= compile_et
491TOOL_CONFIG= config 491TOOL_CONFIG= config
492TOOL_CRUNCHGEN= crunchgen 492TOOL_CRUNCHGEN= crunchgen
493TOOL_CTAGS= ctags 493TOOL_CTAGS= ctags
494TOOL_CTFCONVERT= ctfconvert 494TOOL_CTFCONVERT= ctfconvert
495TOOL_CTFMERGE= ctfmerge 495TOOL_CTFMERGE= ctfmerge
496TOOL_CVSLATEST= cvslatest 496TOOL_CVSLATEST= cvslatest
497TOOL_DB= db 497TOOL_DB= db
498TOOL_DISKLABEL= disklabel 498TOOL_DISKLABEL= disklabel
499TOOL_DTC= dtc 499TOOL_DTC= dtc
500TOOL_EQN= eqn 500TOOL_EQN= eqn
501TOOL_FDISK= fdisk 501TOOL_FDISK= fdisk
502TOOL_FGEN= fgen 502TOOL_FGEN= fgen
503TOOL_GENASSYM= genassym 503TOOL_GENASSYM= genassym
504TOOL_GENCAT= gencat 504TOOL_GENCAT= gencat
505TOOL_GMAKE= gmake 505TOOL_GMAKE= gmake
506TOOL_GPT= gpt 506TOOL_GPT= gpt
507TOOL_GREP= grep 507TOOL_GREP= grep
508TOOL_GROFF= groff 508TOOL_GROFF= groff
509TOOL_HEXDUMP= hexdump 509TOOL_HEXDUMP= hexdump
510TOOL_HP300MKBOOT= hp300-mkboot 510TOOL_HP300MKBOOT= hp300-mkboot
511TOOL_HPPAMKBOOT= hppa-mkboot 511TOOL_HPPAMKBOOT= hppa-mkboot
512TOOL_INDXBIB= indxbib 512TOOL_INDXBIB= indxbib
513TOOL_INSTALLBOOT= installboot 513TOOL_INSTALLBOOT= installboot
514TOOL_INSTALL_INFO= install-info 514TOOL_INSTALL_INFO= install-info
515TOOL_JOIN= join 515TOOL_JOIN= join
516TOOL_LLVM_TBLGEN= llvm-tblgen 516TOOL_LLVM_TBLGEN= llvm-tblgen
517TOOL_M4= m4 517TOOL_M4= m4
518TOOL_MACPPCFIXCOFF= macppc-fixcoff 518TOOL_MACPPCFIXCOFF= macppc-fixcoff
519TOOL_MAKEFS= makefs 519TOOL_MAKEFS= makefs
520TOOL_MAKEINFO= makeinfo 520TOOL_MAKEINFO= makeinfo
521TOOL_MAKEKEYS= makekeys 521TOOL_MAKEKEYS= makekeys
522TOOL_MAKESTRS= makestrs 522TOOL_MAKESTRS= makestrs
523TOOL_MAKEWHATIS= /usr/libexec/makewhatis 523TOOL_MAKEWHATIS= /usr/libexec/makewhatis
524TOOL_MANDOC_ASCII= mandoc -Tascii 524TOOL_MANDOC_ASCII= mandoc -Tascii
525TOOL_MANDOC_HTML= mandoc -Thtml 525TOOL_MANDOC_HTML= mandoc -Thtml
526TOOL_MANDOC_LINT= mandoc -Tlint 526TOOL_MANDOC_LINT= mandoc -Tlint
527TOOL_MDSETIMAGE= mdsetimage 527TOOL_MDSETIMAGE= mdsetimage
528TOOL_MENUC= menuc 528TOOL_MENUC= menuc
529TOOL_ARMELF2AOUT= arm-elf2aout 529TOOL_ARMELF2AOUT= arm-elf2aout
530TOOL_M68KELF2AOUT= m68k-elf2aout 530TOOL_M68KELF2AOUT= m68k-elf2aout
531TOOL_MIPSELF2ECOFF= mips-elf2ecoff 531TOOL_MIPSELF2ECOFF= mips-elf2ecoff
532TOOL_MKCSMAPPER= mkcsmapper 532TOOL_MKCSMAPPER= mkcsmapper
533TOOL_MKESDB= mkesdb 533TOOL_MKESDB= mkesdb
534TOOL_MKLOCALE= mklocale 534TOOL_MKLOCALE= mklocale
535TOOL_MKMAGIC= file 535TOOL_MKMAGIC= file
536TOOL_MKNOD= mknod 536TOOL_MKNOD= mknod
537TOOL_MKTEMP= mktemp 537TOOL_MKTEMP= mktemp
538TOOL_MKUBOOTIMAGE= mkubootimage 538TOOL_MKUBOOTIMAGE= mkubootimage
539TOOL_ELFTOSB= elftosb 539TOOL_ELFTOSB= elftosb
540TOOL_MSGC= msgc 540TOOL_MSGC= msgc
541TOOL_MTREE= mtree 541TOOL_MTREE= mtree
542TOOL_NBPERF= nbperf 542TOOL_NBPERF= nbperf
543TOOL_NCDCS= ncdcs 543TOOL_NCDCS= ncdcs
544TOOL_PAX= pax 544TOOL_PAX= pax
545TOOL_PIC= pic 545TOOL_PIC= pic
546TOOL_PIGZ= pigz 546TOOL_PIGZ= pigz
547TOOL_XZ= xz 547TOOL_XZ= xz
548TOOL_PKG_CREATE= pkg_create 548TOOL_PKG_CREATE= pkg_create
549TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage 549TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
550TOOL_PWD_MKDB= pwd_mkdb 550TOOL_PWD_MKDB= pwd_mkdb
551TOOL_REFER= refer 551TOOL_REFER= refer
552TOOL_ROFF_ASCII= nroff 552TOOL_ROFF_ASCII= nroff
553TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 553TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
554TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 554TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
555TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} 555TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE}
556TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 556TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
557TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} 557TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE}
558TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 558TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
559TOOL_RPCGEN= rpcgen 559TOOL_RPCGEN= rpcgen
560TOOL_SED= sed 560TOOL_SED= sed
561TOOL_SOELIM= soelim 561TOOL_SOELIM= soelim
562TOOL_SORTINFO= sortinfo 562TOOL_SORTINFO= sortinfo
563TOOL_SPARKCRC= sparkcrc 563TOOL_SPARKCRC= sparkcrc
564TOOL_STAT= stat 564TOOL_STAT= stat
565TOOL_STRFILE= strfile 565TOOL_STRFILE= strfile
566TOOL_SUNLABEL= sunlabel 566TOOL_SUNLABEL= sunlabel
567TOOL_TBL= tbl 567TOOL_TBL= tbl
568TOOL_TIC= tic 568TOOL_TIC= tic
569TOOL_UUDECODE= uudecode 569TOOL_UUDECODE= uudecode
570TOOL_VGRIND= vgrind -f 570TOOL_VGRIND= vgrind -f
571TOOL_VFONTEDPR= /usr/libexec/vfontedpr 571TOOL_VFONTEDPR= /usr/libexec/vfontedpr
572TOOL_ZIC= zic 572TOOL_ZIC= zic
573 573
574.endif # USETOOLS != yes # } 574.endif # USETOOLS != yes # }
575 575
576# Standalone code should not be compiled with PIE or CTF 576# Standalone code should not be compiled with PIE or CTF
577# Should create a better test 577# Should create a better test
578.if defined(BINDIR) && ${BINDIR} == "/usr/mdec" 578.if defined(BINDIR) && ${BINDIR} == "/usr/mdec"
579NOPIE= # defined 579NOPIE= # defined
580NOCTF= # defined 580NOCTF= # defined
581.elif ${MACHINE} == "sun2" 581.elif ${MACHINE} == "sun2"
582NOPIE= # we don't have PIC, so no PIE 582NOPIE= # we don't have PIC, so no PIE
583.endif 583.endif
584 584
585# Fallback to ensure that all variables are defined to something 585# Fallback to ensure that all variables are defined to something
586TOOL_CC.false= false 586TOOL_CC.false= false
587TOOL_CPP.false= false 587TOOL_CPP.false= false
588TOOL_CXX.false= false 588TOOL_CXX.false= false
589TOOL_FC.false= false 589TOOL_FC.false= false
590TOOL_OBJC.false= false 590TOOL_OBJC.false= false
591 591
592AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false 592AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
593 593
594.for _t in CC CPP CXX FC OBJC 594.for _t in CC CPP CXX FC OBJC
595ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]} 595ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
596SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@} 596SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
597.endfor 597.endfor
598# make bugs prevent moving this into the .for loop 598# make bugs prevent moving this into the .for loop
599CC= ${TOOL_CC.${ACTIVE_CC}} 599CC= ${TOOL_CC.${ACTIVE_CC}}
600CPP= ${TOOL_CPP.${ACTIVE_CPP}} 600CPP= ${TOOL_CPP.${ACTIVE_CPP}}
601CXX= ${TOOL_CXX.${ACTIVE_CXX}} 601CXX= ${TOOL_CXX.${ACTIVE_CXX}}
602FC= ${TOOL_FC.${ACTIVE_FC}} 602FC= ${TOOL_FC.${ACTIVE_FC}}
603OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}} 603OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
604 604
605# For each ${MACHINE_CPU}, list the ports that use it. 605# For each ${MACHINE_CPU}, list the ports that use it.
606MACHINES.aarch64= evbarm 606MACHINES.aarch64= evbarm
607MACHINES.alpha= alpha 607MACHINES.alpha= alpha
608MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \ 608MACHINES.arm= acorn32 cats epoc32 evbarm hpcarm \
609 iyonix netwinder shark zaurus 609 iyonix netwinder shark zaurus
610MACHINES.coldfire= evbcf 610MACHINES.coldfire= evbcf
611MACHINES.i386= i386 611MACHINES.i386= i386
612MACHINES.ia64= ia64 612MACHINES.ia64= ia64
613MACHINES.hppa= hppa 613MACHINES.hppa= hppa
614MACHINES.m68000= sun2 614MACHINES.m68000= sun2
615MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \ 615MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
616 news68k next68k sun3 x68k 616 news68k next68k sun3 x68k
617MACHINES.mips= algor arc cobalt emips evbmips ews4800mips \ 617MACHINES.mips= algor arc cobalt emips evbmips ews4800mips \
618 hpcmips mipsco newsmips pmax sbmips sgimips 618 hpcmips mipsco newsmips pmax sbmips sgimips
619MACHINES.or1k= or1k 619MACHINES.or1k= or1k
620MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \ 620MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
621 ofppc prep rs6000 sandpoint 621 ofppc prep rs6000 sandpoint
622MACHINES.riscv= riscv 622MACHINES.riscv= riscv
623MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye 623MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
624MACHINES.sparc= sparc sparc64 624MACHINES.sparc= sparc sparc64
625MACHINES.sparc64= sparc64 625MACHINES.sparc64= sparc64
626MACHINES.vax= vax 626MACHINES.vax= vax
627MACHINES.x86_64= amd64 627MACHINES.x86_64= amd64
628 628
629# OBJCOPY flags to create a.out binaries for old firmware 629# OBJCOPY flags to create a.out binaries for old firmware
630# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc 630# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
631.if ${MACHINE_CPU} == "arm" 631.if ${MACHINE_CPU} == "arm"
632OBJCOPY_ELF2AOUT_FLAGS?= \ 632OBJCOPY_ELF2AOUT_FLAGS?= \
633 -O a.out-arm-netbsd \ 633 -O a.out-arm-netbsd \
634 -R .ident \ 634 -R .ident \
635 -R .ARM.attributes \ 635 -R .ARM.attributes \
636 -R .ARM.exidx \ 636 -R .ARM.exidx \
637 -R .ARM.extab \ 637 -R .ARM.extab \
638 -R .SUNW_ctf \ 638 -R .SUNW_ctf \
639 -R .arm.atpcs \ 639 -R .arm.atpcs \
640 -R .comment \ 640 -R .comment \
641 -R .debug_abbrev \ 641 -R .debug_abbrev \
642 -R .debug_aranges \ 642 -R .debug_aranges \
643 -R .debug_info \ 643 -R .debug_info \
644 -R .debug_line \ 644 -R .debug_line \
645 -R .debug_frame \ 645 -R .debug_frame \
646 -R .debug_loc \ 646 -R .debug_loc \
647 -R .debug_pubnames \ 647 -R .debug_pubnames \
648 -R .debug_pubtypes \ 648 -R .debug_pubtypes \
649 -R .debug_ranges \ 649 -R .debug_ranges \
650 -R .debug_str \ 650 -R .debug_str \
651 -R .debug_macinfo \ 651 -R .debug_macinfo \
652 -R .eh_frame \ 652 -R .eh_frame \
653 -R .note.netbsd.ident 653 -R .note.netbsd.ident
654.endif 654.endif
655 655
656# 656#
657# Targets to check if DESTDIR or RELEASEDIR is provided 657# Targets to check if DESTDIR or RELEASEDIR is provided
658# 658#
659.if !target(check_DESTDIR) 659.if !target(check_DESTDIR)
660check_DESTDIR: .PHONY .NOTMAIN 660check_DESTDIR: .PHONY .NOTMAIN
661.if !defined(DESTDIR) 661.if !defined(DESTDIR)
662 @echo "setenv DESTDIR before doing that!" 662 @echo "setenv DESTDIR before doing that!"
663 @false 663 @false
664.else 664.else
665 @true 665 @true
666.endif 666.endif
667.endif 667.endif
668 668
669.if !target(check_RELEASEDIR) 669.if !target(check_RELEASEDIR)
670check_RELEASEDIR: .PHONY .NOTMAIN 670check_RELEASEDIR: .PHONY .NOTMAIN
671.if !defined(RELEASEDIR) 671.if !defined(RELEASEDIR)
672 @echo "setenv RELEASEDIR before doing that!" 672 @echo "setenv RELEASEDIR before doing that!"
673 @false 673 @false
674.else 674.else
675 @true 675 @true
676.endif 676.endif
677.endif 677.endif
678 678
679# 679#
680# Where the system object and source trees are kept; can be configurable 680# Where the system object and source trees are kept; can be configurable
681# by the user in case they want them in ~/foosrc and ~/fooobj (for example). 681# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
682# 682#
683BSDSRCDIR?= /usr/src 683BSDSRCDIR?= /usr/src
684BSDOBJDIR?= /usr/obj 684BSDOBJDIR?= /usr/obj
685NETBSDSRCDIR?= ${BSDSRCDIR} 685NETBSDSRCDIR?= ${BSDSRCDIR}
686 686
687BINGRP?= wheel 687BINGRP?= wheel
688BINOWN?= root 688BINOWN?= root
689BINMODE?= 555 689BINMODE?= 555
690NONBINMODE?= 444 690NONBINMODE?= 444
691 691
692# These are here mainly because we don't want suid root in case 692# These are here mainly because we don't want suid root in case
693# a Makefile defines BINMODE. 693# a Makefile defines BINMODE.
694RUMPBINGRP?= wheel 694RUMPBINGRP?= wheel
695RUMPBINOWN?= root 695RUMPBINOWN?= root
696RUMPBINMODE?= 555 696RUMPBINMODE?= 555
697RUMPNONBINMODE?=444 697RUMPNONBINMODE?=444
698 698
699MANDIR?= /usr/share/man 699MANDIR?= /usr/share/man
700MANGRP?= wheel 700MANGRP?= wheel
701MANOWN?= root 701MANOWN?= root
702MANMODE?= ${NONBINMODE} 702MANMODE?= ${NONBINMODE}
703MANINSTALL?= ${_MANINSTALL} 703MANINSTALL?= ${_MANINSTALL}
704 704
705INFODIR?= /usr/share/info 705INFODIR?= /usr/share/info
706INFOGRP?= wheel 706INFOGRP?= wheel
707INFOOWN?= root 707INFOOWN?= root
708INFOMODE?= ${NONBINMODE} 708INFOMODE?= ${NONBINMODE}
709 709
710LIBDIR?= /usr/lib 710LIBDIR?= /usr/lib
711 711
712LINTLIBDIR?= /usr/libdata/lint 712LINTLIBDIR?= /usr/libdata/lint
713LIBGRP?= ${BINGRP} 713LIBGRP?= ${BINGRP}
714LIBOWN?= ${BINOWN} 714LIBOWN?= ${BINOWN}
715LIBMODE?= ${NONBINMODE} 715LIBMODE?= ${NONBINMODE}
716 716
717DOCDIR?= /usr/share/doc 717DOCDIR?= /usr/share/doc
718DOCGRP?= wheel 718DOCGRP?= wheel
719DOCOWN?= root 719DOCOWN?= root
720DOCMODE?= ${NONBINMODE} 720DOCMODE?= ${NONBINMODE}
721 721
722NLSDIR?= /usr/share/nls 722NLSDIR?= /usr/share/nls
723NLSGRP?= wheel 723NLSGRP?= wheel
724NLSOWN?= root 724NLSOWN?= root
725NLSMODE?= ${NONBINMODE} 725NLSMODE?= ${NONBINMODE}
726 726
727KMODULEGRP?= wheel 727KMODULEGRP?= wheel
728KMODULEOWN?= root 728KMODULEOWN?= root
729KMODULEMODE?= ${NONBINMODE} 729KMODULEMODE?= ${NONBINMODE}
730 730
731LOCALEDIR?= /usr/share/locale 731LOCALEDIR?= /usr/share/locale
732LOCALEGRP?= wheel 732LOCALEGRP?= wheel
733LOCALEOWN?= root 733LOCALEOWN?= root
734LOCALEMODE?= ${NONBINMODE} 734LOCALEMODE?= ${NONBINMODE}
735 735
736FIRMWAREDIR?= /libdata/firmware 736FIRMWAREDIR?= /libdata/firmware
737FIRMWAREGRP?= wheel 737FIRMWAREGRP?= wheel
738FIRMWAREOWN?= root 738FIRMWAREOWN?= root
739FIRMWAREMODE?= ${NONBINMODE} 739FIRMWAREMODE?= ${NONBINMODE}
740 740
741DEBUGDIR?= /usr/libdata/debug 741DEBUGDIR?= /usr/libdata/debug
742DEBUGGRP?= wheel 742DEBUGGRP?= wheel
743DEBUGOWN?= root 743DEBUGOWN?= root
744DEBUGMODE?= ${NONBINMODE} 744DEBUGMODE?= ${NONBINMODE}
745 745
746MKDIRMODE?= 0755 746MKDIRMODE?= 0755
747MKDIRPERM?= -m ${MKDIRMODE} 747MKDIRPERM?= -m ${MKDIRMODE}
748 748
749# 749#
750# Data-driven table using make variables to control how 750# Data-driven table using make variables to control how
751# toolchain-dependent targets and shared libraries are built 751# toolchain-dependent targets and shared libraries are built
752# for different platforms and object formats. 752# for different platforms and object formats.
753# 753#
754# OBJECT_FMT: currently either "ELF" or "a.out". 754# OBJECT_FMT: currently either "ELF" or "a.out".
755# 755#
756# All platforms are ELF. 756# All platforms are ELF.
757# 757#
758OBJECT_FMT= ELF 758OBJECT_FMT= ELF
759 759
760# 760#
761# If this platform's toolchain is missing, we obviously cannot build it. 761# If this platform's toolchain is missing, we obviously cannot build it.
762# 762#
763.if ${TOOLCHAIN_MISSING} != "no" 763.if ${TOOLCHAIN_MISSING} != "no"
764MKBINUTILS:= no 764MKBINUTILS:= no
765MKGDB:= no 765MKGDB:= no
766MKGCC:= no 766MKGCC:= no
767.endif 767.endif
768 768
769# 769#
770# If we are using an external toolchain, we can still build the target's 770# If we are using an external toolchain, we can still build the target's
771# binutils, but we cannot build GCC's support libraries, since those are 771# binutils, but we cannot build GCC's support libraries, since those are
772# tightly-coupled to the version of GCC being used. 772# tightly-coupled to the version of GCC being used.
773# 773#
774.if defined(EXTERNAL_TOOLCHAIN) 774.if defined(EXTERNAL_TOOLCHAIN)
775MKGCC:= no 775MKGCC:= no
776.endif 776.endif
777 777
778# No GDB support for aarch64eb 778# No GDB support for aarch64eb
779MKGDB.aarch64eb=no 779MKGDB.aarch64eb=no
780MKGDB.or1k= no 780MKGDB.or1k= no
781MKGDB.riscv32= no 781MKGDB.riscv32= no
782MKGDB.riscv64= no 782MKGDB.riscv64= no
783 783
784# No kernel modules for or1k (yet) 784# No kernel modules for or1k (yet)
785MKKMOD.or1k= no 785MKKMOD.or1k= no
786MKKMOD.riscv32= no 786MKKMOD.riscv32= no
787MKKMOD.riscv64= no 787MKKMOD.riscv64= no
788 788
789# No profiling for or1k (yet) 789# No profiling for or1k (yet)
790MKPROFILE.or1k= no 790MKPROFILE.or1k= no
791MKPROFILE.riscv32=no 791MKPROFILE.riscv32=no
792MKPROFILE.riscv64=no 792MKPROFILE.riscv64=no
793 793
794# 794#
795# The m68000 port is incomplete. 795# The m68000 port is incomplete.
796# 796#
797.if ${MACHINE_ARCH} == "m68000" 797.if ${MACHINE_ARCH} == "m68000"
798NOPIC= # defined 798NOPIC= # defined
799MKISCSI= no 799MKISCSI= no
800# XXX GCC 4 outputs mcount() calling sequences that try to load values 800# XXX GCC 4 outputs mcount() calling sequences that try to load values
801# from over 64KB away and this fails to assemble. 801# from over 64KB away and this fails to assemble.
802.if defined(HAVE_GCC) 802.if defined(HAVE_GCC)
803NOPROFILE= # defined 803NOPROFILE= # defined
804.endif 804.endif
805.endif 805.endif
806 806
807# 807#
808# The ia64 port is incomplete. 808# The ia64 port is incomplete.
809# 809#
810MKGDB.ia64= no 810MKGDB.ia64= no
811 811
812# 812#
813# On VAX using ELF, all objects are PIC, not just shared libraries, 813# On VAX using ELF, all objects are PIC, not just shared libraries,
814# so don't build the _pic version. VAX has no native TLS support either, 814# so don't build the _pic version. VAX has no native TLS support either,
815# so differences between TLS models are not relevant. 815# so differences between TLS models are not relevant.
816# 816#
817MKPICLIB.vax= no 817MKPICLIB.vax= no
818 818
819# 819#
820# Location of the file that contains the major and minor numbers of the 820# Location of the file that contains the major and minor numbers of the
821# version of a shared library. If this file exists a shared library 821# version of a shared library. If this file exists a shared library
822# will be built by <bsd.lib.mk>. 822# will be built by <bsd.lib.mk>.
823# 823#
824SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version 824SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
825 825
826# 826#
827# GNU sources and packages sometimes see architecture names differently. 827# GNU sources and packages sometimes see architecture names differently.
828# 828#
829GNU_ARCH.aarch64eb=aarch64_be 829GNU_ARCH.aarch64eb=aarch64_be
830GNU_ARCH.coldfire=m5407 830GNU_ARCH.coldfire=m5407
831GNU_ARCH.earm=arm 831GNU_ARCH.earm=arm
832GNU_ARCH.earmhf=arm 832GNU_ARCH.earmhf=arm
833GNU_ARCH.earmeb=armeb 833GNU_ARCH.earmeb=armeb
834GNU_ARCH.earmhfeb=armeb 834GNU_ARCH.earmhfeb=armeb
835GNU_ARCH.earmv4=armv4 835GNU_ARCH.earmv4=armv4
836GNU_ARCH.earmv4eb=armv4eb 836GNU_ARCH.earmv4eb=armv4eb
837GNU_ARCH.earmv5=arm 837GNU_ARCH.earmv5=arm
838GNU_ARCH.earmv5eb=armeb 838GNU_ARCH.earmv5eb=armeb
839GNU_ARCH.earmv6=armv6 839GNU_ARCH.earmv6=armv6
840GNU_ARCH.earmv6hf=armv6 840GNU_ARCH.earmv6hf=armv6
841GNU_ARCH.earmv6eb=armv6eb 841GNU_ARCH.earmv6eb=armv6eb
842GNU_ARCH.earmv6hfeb=armv6eb 842GNU_ARCH.earmv6hfeb=armv6eb
843GNU_ARCH.earmv7=armv7 843GNU_ARCH.earmv7=armv7
844GNU_ARCH.earmv7hf=armv7 844GNU_ARCH.earmv7hf=armv7
845GNU_ARCH.earmv7eb=armv7eb 845GNU_ARCH.earmv7eb=armv7eb
846GNU_ARCH.earmv7hfeb=armv7eb 846GNU_ARCH.earmv7hfeb=armv7eb
847GNU_ARCH.i386=i486 847GNU_ARCH.i386=i486
848GCC_CONFIG_ARCH.i386=i486 848GCC_CONFIG_ARCH.i386=i486
849GCC_CONFIG_TUNE.i386=nocona 849GCC_CONFIG_TUNE.i386=nocona
850GCC_CONFIG_TUNE.x86_64=nocona 850GCC_CONFIG_TUNE.x86_64=nocona
851GNU_ARCH.m68000=m68010 851GNU_ARCH.m68000=m68010
852GNU_ARCH.sh3eb=sh 852GNU_ARCH.sh3eb=sh
853GNU_ARCH.sh3el=shle 853GNU_ARCH.sh3el=shle
854GNU_ARCH.mips64eb=mips64 854GNU_ARCH.mips64eb=mips64
855MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} 855MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
856 856
857# 857#
858# In order to identify NetBSD to GNU packages, we sometimes need 858# In order to identify NetBSD to GNU packages, we sometimes need
859# an "elf" tag for historically a.out platforms. 859# an "elf" tag for historically a.out platforms.
860# 860#
861.if (!empty(MACHINE_ARCH:Mearm*)) 861.if (!empty(MACHINE_ARCH:Mearm*))
862MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/} 862MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
863.elif (${MACHINE_GNU_ARCH} == "arm" || \ 863.elif (${MACHINE_GNU_ARCH} == "arm" || \
864 ${MACHINE_GNU_ARCH} == "armeb" || \ 864 ${MACHINE_GNU_ARCH} == "armeb" || \
865 ${MACHINE_ARCH} == "i386" || \ 865 ${MACHINE_ARCH} == "i386" || \
866 ${MACHINE_CPU} == "m68k" || \ 866 ${MACHINE_CPU} == "m68k" || \
867 ${MACHINE_GNU_ARCH} == "sh" || \ 867 ${MACHINE_GNU_ARCH} == "sh" || \
868 ${MACHINE_GNU_ARCH} == "shle" || \ 868 ${MACHINE_GNU_ARCH} == "shle" || \
869 ${MACHINE_ARCH} == "sparc" || \ 869 ${MACHINE_ARCH} == "sparc" || \
870 ${MACHINE_ARCH} == "vax") 870 ${MACHINE_ARCH} == "vax")
871MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf 871MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
872.else 872.else
873MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd 873MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
874.endif 874.endif
875 875
876.if !empty(MACHINE_ARCH:M*arm*) 876.if !empty(MACHINE_ARCH:M*arm*)
877# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand. 877# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
878ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft 878ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
879ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :} 879ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
880ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :} 880ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
881.endif 881.endif
882 882
883GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :} 883GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
884 884
885TARGETS+= all clean cleandir depend dependall includes \ 885TARGETS+= all clean cleandir depend dependall includes \
886 install lint obj regress tags html analyze describe \ 886 install lint obj regress tags html analyze describe \
887 rumpdescribe 887 rumpdescribe
888PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \ 888PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
889 install lint obj regress beforedepend afterdepend \ 889 install lint obj regress beforedepend afterdepend \
890 beforeinstall afterinstall realinstall realdepend realall \ 890 beforeinstall afterinstall realinstall realdepend realall \
891 html subdir-all subdir-install subdir-depend analyze describe \ 891 html subdir-all subdir-install subdir-depend analyze describe \
892 rumpdescribe 892 rumpdescribe
893.PHONY: ${PHONY_NOTMAIN} 893.PHONY: ${PHONY_NOTMAIN}
894.NOTMAIN: ${PHONY_NOTMAIN} 894.NOTMAIN: ${PHONY_NOTMAIN}
895 895
896.if ${NEED_OWN_INSTALL_TARGET} != "no" 896.if ${NEED_OWN_INSTALL_TARGET} != "no"
897.if !target(install) 897.if !target(install)
898install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall 898install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
899beforeinstall: 899beforeinstall:
900subdir-install: 900subdir-install:
901realinstall: 901realinstall:
902afterinstall: 902afterinstall:
903.endif 903.endif
904all: realall subdir-all 904all: realall subdir-all
905subdir-all: 905subdir-all:
906realall: 906realall:
907depend: realdepend subdir-depend 907depend: realdepend subdir-depend
908subdir-depend: 908subdir-depend:
909realdepend: 909realdepend:
910distclean: cleandir 910distclean: cleandir
911cleandir: clean 911cleandir: clean
912 912
913dependall: .NOTMAIN realdepend .MAKE 913dependall: .NOTMAIN realdepend .MAKE
914 @cd "${.CURDIR}"; ${MAKE} realall 914 @cd "${.CURDIR}"; ${MAKE} realall
915.endif 915.endif
916 916
917# 917#
918# Define MKxxx variables (which are either yes or no) for users 918# Define MKxxx variables (which are either yes or no) for users
919# to set in /etc/mk.conf and override in the make environment. 919# to set in /etc/mk.conf and override in the make environment.
920# These should be tested with `== "no"' or `!= "no"'. 920# These should be tested with `== "no"' or `!= "no"'.
921# The NOxxx variables should only be set by Makefiles. 921# The NOxxx variables should only be set by Makefiles.
922# 922#
923# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync 923# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
924# with changes to the MK* variables here. 924# with changes to the MK* variables here.
925# 925#
926 926
927# 927#
928# Supported NO* options (if defined, MK* will be forced to "no", 928# Supported NO* options (if defined, MK* will be forced to "no",
929# regardless of user's mk.conf setting). 929# regardless of user's mk.conf setting).
930# 930#
931# Source makefiles should set NO*, and not MK*, and must do so before 931# Source makefiles should set NO*, and not MK*, and must do so before
932# including bsd.own.mk. 932# including bsd.own.mk.
933# 933#
934.for var in \ 934.for var in \
935 NOCRYPTO NODOC NOHTML NOINFO NOLIBCSANITIZER NOLINKLIB NOLINT NOMAN \ 935 NOCRYPTO NODOC NOHTML NOINFO NOLIBCSANITIZER NOLINKLIB NOLINT NOMAN \
936 NONLS NOOBJ NOPIC NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB \ 936 NONLS NOOBJ NOPIC NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB \
937 NODEBUGLIB NOSANITIZER NORELRO 937 NODEBUGLIB NOSANITIZER NORELRO
938.if defined(${var}) 938.if defined(${var})
939MK${var:S/^NO//}:= no 939MK${var:S/^NO//}:= no
940.endif 940.endif
941.endfor 941.endfor
942 942
943# 943#
944# Older-style variables that enabled behaviour when set. 944# Older-style variables that enabled behaviour when set.
945# 945#
946.for var in MANZ UNPRIVED UPDATE 946.for var in MANZ UNPRIVED UPDATE
947.if defined(${var}) 947.if defined(${var})
948MK${var}:= yes 948MK${var}:= yes
949.endif 949.endif
950.endfor 950.endfor
951 951
952# 952#
953# MK* options which have variable defaults. 953# MK* options which have variable defaults.
954# 954#
955# aarch64eb is not yet supported. 955# aarch64eb is not yet supported.
956# 956#
957.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \ 957.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
958 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \ 958 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
959 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \ 959 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \
960 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*) 960 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*)
961MKCOMPAT?= yes 961MKCOMPAT?= yes
962.else 962.else
963# Don't let this build where it really isn't supported. 963# Don't let this build where it really isn't supported.
964MKCOMPAT:= no 964MKCOMPAT:= no
965.endif 965.endif
966 966
967.if ${MKCOMPAT} == "no" 967.if ${MKCOMPAT} == "no"
968MKCOMPATTESTS:= no 968MKCOMPATTESTS:= no
969MKCOMPATX11:= no 969MKCOMPATX11:= no
970.endif 970.endif
971 971
972.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \ 972.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \
973 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \ 973 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
974 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc") 974 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
975MKCOMPATMODULES?= yes 975MKCOMPATMODULES?= yes
976.else 976.else
977MKCOMPATMODULES:= no 977MKCOMPATMODULES:= no
978.endif 978.endif
979 979
980# 980#
981# These platforms use softfloat by default. 981# These platforms use softfloat by default.
982# 982#
983.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 983.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
984MKSOFTFLOAT?= yes 984MKSOFTFLOAT?= yes
985.endif 985.endif
986 986
987# 987#
988# These platforms always use softfloat. 988# These platforms always use softfloat.
989# 989#
990.if (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \ 990.if (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
991 ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \ 991 ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
992 ${MACHINE} == "emips" || ${MACHINE_CPU} == "sh3" 992 ${MACHINE} == "emips" || ${MACHINE_CPU} == "sh3"
993MKSOFTFLOAT= yes 993MKSOFTFLOAT= yes
994.endif 994.endif
995 995
996.if ${MACHINE} == "emips" 996.if ${MACHINE} == "emips"
997SOFTFLOAT_BITS= 32 997SOFTFLOAT_BITS= 32
998.endif 998.endif
999 999
1000# 1000#
1001# We want to build zfs only for amd64 and aarch64 by default for now. 1001# We want to build zfs only for amd64, aarch64 and sparc64 by default for now.
1002# 1002#
1003.if ${MACHINE} == "amd64" || ${MACHINE_ARCH} == "aarch64" 1003.if ${MACHINE} == "amd64" || ${MACHINE_ARCH} == "aarch64" || \
 1004 ${MACHINE} == "sparc64"
1004MKZFS?= yes 1005MKZFS?= yes
1005.endif 1006.endif
1006 1007
1007# 1008#
1008# DTrace works on amd64, i386 and earm* 1009# DTrace works on amd64, i386 and earm*
1009# 1010#
1010.if ${MACHINE_ARCH} == "i386" || \ 1011.if ${MACHINE_ARCH} == "i386" || \
1011 ${MACHINE_ARCH} == "x86_64" || \ 1012 ${MACHINE_ARCH} == "x86_64" || \
1012 ${MACHINE_ARCH} == "aarch64" || \ 1013 ${MACHINE_ARCH} == "aarch64" || \
1013 !empty(MACHINE_ARCH:Mearm*) 1014 !empty(MACHINE_ARCH:Mearm*)
1014MKDTRACE?= yes 1015MKDTRACE?= yes
1015MKCTF?= yes 1016MKCTF?= yes
1016.endif 1017.endif
1017 1018
1018# 1019#
1019# PIE is enabled on many platforms by default. 1020# PIE is enabled on many platforms by default.
1020# 1021#
1021# Coverity does not like PIE 1022# Coverity does not like PIE
1022.if !defined(COVERITY_TOP_CONFIG) && \ 1023.if !defined(COVERITY_TOP_CONFIG) && \
1023 (${MACHINE_ARCH} == "i386" || \ 1024 (${MACHINE_ARCH} == "i386" || \
1024 ${MACHINE_ARCH} == "x86_64" || \ 1025 ${MACHINE_ARCH} == "x86_64" || \
1025 ${MACHINE_CPU} == "arm" || \ 1026 ${MACHINE_CPU} == "arm" || \
1026 ${MACHINE_CPU} == "m68k" || \ 1027 ${MACHINE_CPU} == "m68k" || \
1027 ${MACHINE_CPU} == "mips" || \ 1028 ${MACHINE_CPU} == "mips" || \
1028 ${MACHINE_CPU} == "sh3" || \ 1029 ${MACHINE_CPU} == "sh3" || \
1029 ${MACHINE} == "sparc64") 1030 ${MACHINE} == "sparc64")
1030MKPIE?= yes 1031MKPIE?= yes
1031.else 1032.else
1032MKPIE?= no 1033MKPIE?= no
1033.endif 1034.endif
1034 1035
1035# 1036#
1036# RELRO is enabled on i386 and amd64 by default 1037# RELRO is enabled on i386 and amd64 by default
1037# 1038#
1038.if ${MACHINE_ARCH} == "i386" || \ 1039.if ${MACHINE_ARCH} == "i386" || \
1039 ${MACHINE_ARCH} == "x86_64" 1040 ${MACHINE_ARCH} == "x86_64"
1040MKRELRO?= partial 1041MKRELRO?= partial
1041.else 1042.else
1042MKRELRO?= no 1043MKRELRO?= no
1043.endif 1044.endif
1044 1045
1045.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" 1046.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
1046MKSTATICPIE?= yes 1047MKSTATICPIE?= yes
1047.else 1048.else
1048MKSTATICPIE?= no 1049MKSTATICPIE?= no
1049.endif 1050.endif
1050 1051
1051# 1052#
1052# MK* options which default to "yes". 1053# MK* options which default to "yes".
1053# 1054#
1054_MKVARS.yes= \ 1055_MKVARS.yes= \
1055 MKATF \ 1056 MKATF \
1056 MKBINUTILS \ 1057 MKBINUTILS \
1057 MKBSDTAR \ 1058 MKBSDTAR \
1058 MKCOMPLEX MKCVS MKCXX \ 1059 MKCOMPLEX MKCVS MKCXX \
1059 MKDOC MKDTC \ 1060 MKDOC MKDTC \
1060 MKDYNAMICROOT \ 1061 MKDYNAMICROOT \
1061 MKGCC MKGDB MKGROFF \ 1062 MKGCC MKGDB MKGROFF \
1062 MKHESIOD MKHTML \ 1063 MKHESIOD MKHTML \
1063 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \ 1064 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
1064 MKKERBEROS \ 1065 MKKERBEROS \
1065 MKKMOD \ 1066 MKKMOD \
1066 MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \ 1067 MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \
1067 MKMAN MKMANDOC \ 1068 MKMAN MKMANDOC \
1068 MKMDNS \ 1069 MKMDNS \
1069 MKMAKEMANDB \ 1070 MKMAKEMANDB \
1070 MKNLS \ 1071 MKNLS \
1071 MKNPF \ 1072 MKNPF \
1072 MKOBJ \ 1073 MKOBJ \
1073 MKPAM MKPERFUSE \ 1074 MKPAM MKPERFUSE \
1074 MKPF MKPIC MKPICLIB MKPOSTFIX MKPROFILE \ 1075 MKPF MKPIC MKPICLIB MKPOSTFIX MKPROFILE \
1075 MKRUMP \ 1076 MKRUMP \
1076 MKSHARE MKSKEY MKSTATICLIB \ 1077 MKSHARE MKSKEY MKSTATICLIB \
1077 MKUNBOUND \ 1078 MKUNBOUND \
1078 MKX11FONTS \ 1079 MKX11FONTS \
1079 MKYP 1080 MKYP
1080.for var in ${_MKVARS.yes} 1081.for var in ${_MKVARS.yes}
1081${var}?= ${${var}.${MACHINE_ARCH}:Uyes} 1082${var}?= ${${var}.${MACHINE_ARCH}:Uyes}
1082.endfor 1083.endfor
1083 1084
1084# 1085#
1085# MKGCCCMDS is only valid if we are building GCC so make it dependent on that. 1086# MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
1086# 1087#
1087_MKVARS.yes += MKGCCCMDS 1088_MKVARS.yes += MKGCCCMDS
1088MKGCCCMDS?= ${MKGCC} 1089MKGCCCMDS?= ${MKGCC}
1089 1090
1090# 1091#
1091# Sanitizers, only "address" and "undefined" are supported by gcc 1092# Sanitizers, only "address" and "undefined" are supported by gcc
1092# 1093#
1093MKSANITIZER?= no 1094MKSANITIZER?= no
1094USE_SANITIZER?= address 1095USE_SANITIZER?= address
1095 1096
1096# 1097#
1097# Sanitizers implemented in libc, only "undefined" is supported 1098# Sanitizers implemented in libc, only "undefined" is supported
1098# 1099#
1099MKLIBCSANITIZER?= no 1100MKLIBCSANITIZER?= no
1100USE_LIBCSANITIZER?= undefined 1101USE_LIBCSANITIZER?= undefined
1101 1102
1102# 1103#
1103# Exceptions to the above: 1104# Exceptions to the above:
1104# 1105#
1105 1106
1106# RUMP uses -nostdinc which coverity does not like 1107# RUMP uses -nostdinc which coverity does not like
1107# It also does not use many new files, so disable it 1108# It also does not use many new files, so disable it
1108.if defined(COVERITY_TOP_CONFIG) 1109.if defined(COVERITY_TOP_CONFIG)
1109MKRUMP= no 1110MKRUMP= no
1110.endif 1111.endif
1111 1112
1112# 1113#
1113# Build a dynamically linked /bin and /sbin, with the necessary shared 1114# Build a dynamically linked /bin and /sbin, with the necessary shared
1114# libraries moved from /usr/lib to /lib and the shared linker moved 1115# libraries moved from /usr/lib to /lib and the shared linker moved
1115# from /usr/libexec to /lib 1116# from /usr/libexec to /lib
1116# 1117#
1117# Note that if the BINDIR is not /bin or /sbin, then we always use the 1118# Note that if the BINDIR is not /bin or /sbin, then we always use the
1118# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin 1119# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
1119# and /sbin). See <bsd.shlib.mk>. 1120# and /sbin). See <bsd.shlib.mk>.
1120# 1121#
1121# For ia64, ld.elf_so not yet implemented 1122# For ia64, ld.elf_so not yet implemented
1122.if ${MACHINE_ARCH} == "ia64" 1123.if ${MACHINE_ARCH} == "ia64"
1123MKDYNAMICROOT= no 1124MKDYNAMICROOT= no
1124.endif 1125.endif
1125 1126
1126.if defined(MKREPRO) 1127.if defined(MKREPRO)
1127MKARZERO ?= ${MKREPRO} 1128MKARZERO ?= ${MKREPRO}
1128GROFF_FLAGS ?= -dpaper=letter 1129GROFF_FLAGS ?= -dpaper=letter
1129ROFF_PAGESIZE ?= -P-pletter 1130ROFF_PAGESIZE ?= -P-pletter
1130.endif 1131.endif
1131 1132
1132# Only install the general firmware on some systems 1133# Only install the general firmware on some systems
1133MKFIRMWARE.amd64= yes 1134MKFIRMWARE.amd64= yes
1134MKFIRMWARE.cobalt= yes 1135MKFIRMWARE.cobalt= yes
1135MKFIRMWARE.evbarm= yes 1136MKFIRMWARE.evbarm= yes
1136MKFIRMWARE.evbmips= yes 1137MKFIRMWARE.evbmips= yes
1137MKFIRMWARE.evbppc= yes 1138MKFIRMWARE.evbppc= yes
1138MKFIRMWARE.hpcarm= yes 1139MKFIRMWARE.hpcarm= yes
1139MKFIRMWARE.hppa= yes 1140MKFIRMWARE.hppa= yes
1140MKFIRMWARE.i386= yes 1141MKFIRMWARE.i386= yes
1141MKFIRMWARE.mac68k= yes 1142MKFIRMWARE.mac68k= yes
1142MKFIRMWARE.macppc= yes 1143MKFIRMWARE.macppc= yes
1143MKFIRMWARE.sandpoint= yes 1144MKFIRMWARE.sandpoint= yes
1144MKFIRMWARE.sparc64= yes 1145MKFIRMWARE.sparc64= yes
1145 1146
1146# Only install the nouveau and radeon firmwares on DRM-happy systems. 1147# Only install the nouveau and radeon firmwares on DRM-happy systems.
1147MKNOUVEAUFIRMWARE.x86_64= yes 1148MKNOUVEAUFIRMWARE.x86_64= yes
1148MKNOUVEAUFIRMWARE.i386= yes 1149MKNOUVEAUFIRMWARE.i386= yes
1149MKRADEONFIRMWARE.x86_64= yes 1150MKRADEONFIRMWARE.x86_64= yes
1150MKRADEONFIRMWARE.i386= yes 1151MKRADEONFIRMWARE.i386= yes
1151 1152
1152# Only install the tegra firmware on evbarm. 1153# Only install the tegra firmware on evbarm.
1153MKTEGRAFIRMWARE.evbarm= yes 1154MKTEGRAFIRMWARE.evbarm= yes
1154 1155
1155# MesaLib.old and MesaLib7 go together, and MesaLib is alone. 1156# MesaLib.old and MesaLib7 go together, and MesaLib is alone.
1156HAVE_MESA_VER?= 18 1157HAVE_MESA_VER?= 18
1157.if ${HAVE_MESA_VER} == "10" 1158.if ${HAVE_MESA_VER} == "10"
1158EXTERNAL_MESALIB_DIR?= MesaLib.old 1159EXTERNAL_MESALIB_DIR?= MesaLib.old
1159.elif ${HAVE_MESA_VER} == "18" 1160.elif ${HAVE_MESA_VER} == "18"
1160EXTERNAL_MESALIB_DIR?= MesaLib 1161EXTERNAL_MESALIB_DIR?= MesaLib
1161.endif 1162.endif
1162 1163
1163# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18 1164# Default to LLVM run-time if x86 or aarch64 and X11 and Mesa 18
1164# XXX This knows that MKX11=no is default below, but would 1165# XXX This knows that MKX11=no is default below, but would
1165# require splitting the below loop in two parts. 1166# require splitting the below loop in two parts.
1166.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} == "18" 1167.if ${MKX11:Uno} != "no" && ${HAVE_MESA_VER} == "18"
1167MKLLVMRT.amd64= yes 1168MKLLVMRT.amd64= yes
1168MKLLVMRT.i386= yes 1169MKLLVMRT.i386= yes
1169MKLLVMRT.aarch64= yes 1170MKLLVMRT.aarch64= yes
1170.endif 1171.endif
1171 1172
1172# Just-in-time compiler for bpf, npf acceleration 1173# Just-in-time compiler for bpf, npf acceleration
1173MKSLJIT.aarch64= yes 1174MKSLJIT.aarch64= yes
1174MKSLJIT.i386= yes 1175MKSLJIT.i386= yes
1175MKSLJIT.sparc= yes 1176MKSLJIT.sparc= yes
1176#MKSLJIT.sparc64= yes # not suppored in sljit (yet?) 1177#MKSLJIT.sparc64= yes # not suppored in sljit (yet?)
1177MKSLJIT.x86_64= yes 1178MKSLJIT.x86_64= yes
1178#MKSLJIT.powerpc= yes # XXX 1179#MKSLJIT.powerpc= yes # XXX
1179#MKSLJIT.powerpc64= yes # XXX 1180#MKSLJIT.powerpc64= yes # XXX
1180#MKSLJIT.mipsel= yes # XXX 1181#MKSLJIT.mipsel= yes # XXX
1181#MKSLJIT.mipseb= yes # XXX 1182#MKSLJIT.mipseb= yes # XXX
1182#MKSLJIT.mips64el= yes # XXX 1183#MKSLJIT.mips64el= yes # XXX
1183#MKSLJIT.mips64eb= yes # XXX 1184#MKSLJIT.mips64eb= yes # XXX
1184#MKSLJIT.riscv32= yes # not until we update sljit 1185#MKSLJIT.riscv32= yes # not until we update sljit
1185#MKSLJIT.riscv64= yes # not until we update sljit 1186#MKSLJIT.riscv64= yes # not until we update sljit
1186 1187
1187# compat with old names 1188# compat with old names
1188MKDEBUGKERNEL?=${MKKDEBUG:Uno} 1189MKDEBUGKERNEL?=${MKKDEBUG:Uno}
1189MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno} 1190MKDEBUGTOOLS?=${MKTOOLSDEBUG:Uno}
1190 1191
1191# 1192#
1192# MK* options which default to "no". Note that MKZFS has a different 1193# MK* options which default to "no". Note that MKZFS has a different
1193# default for some platforms, see above. Please keep alphabetically 1194# default for some platforms, see above. Please keep alphabetically
1194# sorted with at most one letter per line. 1195# sorted with at most one letter per line.
1195# 1196#
1196_MKVARS.no= \ 1197_MKVARS.no= \
1197 MKARZERO \ 1198 MKARZERO \
1198 MKBSDGREP \ 1199 MKBSDGREP \
1199 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \ 1200 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \
1200 MKDEBUG MKDEBUGLIB MKDTRACE \ 1201 MKDEBUG MKDEBUGLIB MKDTRACE \
1201 MKEXTSRC \ 1202 MKEXTSRC \
1202 MKFIRMWARE \ 1203 MKFIRMWARE \
1203 MKGROFFHTMLDOC \ 1204 MKGROFFHTMLDOC \
1204 MKKYUA \ 1205 MKKYUA \
1205 MKLIBCXX MKLLD MKLLDB MKLLVM MKLLVMRT MKLINT \ 1206 MKLIBCXX MKLLD MKLLDB MKLLVM MKLLVMRT MKLINT \
1206 MKMANZ MKMCLINKER \ 1207 MKMANZ MKMCLINKER \
1207 MKNOUVEAUFIRMWARE MKNSD \ 1208 MKNOUVEAUFIRMWARE MKNSD \
1208 MKOBJDIRS \ 1209 MKOBJDIRS \
1209 MKPCC MKPICINSTALL MKPIGZGZIP \ 1210 MKPCC MKPICINSTALL MKPIGZGZIP \
1210 MKRADEONFIRMWARE MKREPRO \ 1211 MKRADEONFIRMWARE MKREPRO \
1211 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \ 1212 MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
1212 MKTEGRAFIRMWARE MKTPM \ 1213 MKTEGRAFIRMWARE MKTPM \
1213 MKUNPRIVED MKUPDATE \ 1214 MKUNPRIVED MKUPDATE \
1214 MKX11 MKX11MOTIF MKXORG_SERVER \ 1215 MKX11 MKX11MOTIF MKXORG_SERVER \
1215 MKZFS 1216 MKZFS
1216.for var in ${_MKVARS.no} 1217.for var in ${_MKVARS.no}
1217${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}} 1218${var}?= ${${var}.${MACHINE_ARCH}:U${${var}.${MACHINE}:Uno}}
1218.endfor 1219.endfor
1219 1220
1220# 1221#
1221# Which platforms build the xorg-server drivers (as opposed 1222# Which platforms build the xorg-server drivers (as opposed
1222# to just Xnest and Xvfb.) 1223# to just Xnest and Xvfb.)
1223# 1224#
1224.if ${MACHINE} == "alpha" || \ 1225.if ${MACHINE} == "alpha" || \
1225 ${MACHINE} == "amd64" || \ 1226 ${MACHINE} == "amd64" || \
1226 ${MACHINE} == "amiga" || \ 1227 ${MACHINE} == "amiga" || \
1227 ${MACHINE} == "bebox" || \ 1228 ${MACHINE} == "bebox" || \
1228 ${MACHINE} == "cats" || \ 1229 ${MACHINE} == "cats" || \
1229 ${MACHINE} == "dreamcast" || \ 1230 ${MACHINE} == "dreamcast" || \
1230 ${MACHINE} == "ews4800mips" || \ 1231 ${MACHINE} == "ews4800mips" || \
1231 ${MACHINE} == "evbarm" || \ 1232 ${MACHINE} == "evbarm" || \
1232 ${MACHINE} == "evbmips" || \ 1233 ${MACHINE} == "evbmips" || \
1233 ${MACHINE} == "hp300" || \ 1234 ${MACHINE} == "hp300" || \
1234 ${MACHINE} == "hpcarm" || \ 1235 ${MACHINE} == "hpcarm" || \
1235 ${MACHINE} == "hpcmips" || \ 1236 ${MACHINE} == "hpcmips" || \
1236 ${MACHINE} == "hpcsh" || \ 1237 ${MACHINE} == "hpcsh" || \
1237 ${MACHINE} == "i386" || \ 1238 ${MACHINE} == "i386" || \
1238 ${MACHINE} == "ibmnws" || \ 1239 ${MACHINE} == "ibmnws" || \
1239 ${MACHINE} == "iyonix" || \ 1240 ${MACHINE} == "iyonix" || \
1240 ${MACHINE} == "luna68k" || \ 1241 ${MACHINE} == "luna68k" || \
1241 ${MACHINE} == "mac68k" || \ 1242 ${MACHINE} == "mac68k" || \
1242 ${MACHINE} == "macppc" || \ 1243 ${MACHINE} == "macppc" || \
1243 ${MACHINE} == "netwinder" || \ 1244 ${MACHINE} == "netwinder" || \
1244 ${MACHINE} == "newsmips" || \ 1245 ${MACHINE} == "newsmips" || \
1245 ${MACHINE} == "prep" || \ 1246 ${MACHINE} == "prep" || \
1246 ${MACHINE} == "ofppc" || \ 1247 ${MACHINE} == "ofppc" || \
1247 ${MACHINE} == "sgimips" || \ 1248 ${MACHINE} == "sgimips" || \
1248 ${MACHINE} == "shark" || \ 1249 ${MACHINE} == "shark" || \
1249 ${MACHINE} == "sparc" || \ 1250 ${MACHINE} == "sparc" || \
1250 ${MACHINE} == "sparc64" || \ 1251 ${MACHINE} == "sparc64" || \
1251 ${MACHINE} == "vax" || \ 1252 ${MACHINE} == "vax" || \
1252 ${MACHINE} == "zaurus" 1253 ${MACHINE} == "zaurus"
1253MKXORG_SERVER=yes 1254MKXORG_SERVER=yes
1254.endif 1255.endif
1255 1256
1256# 1257#
1257# Force some options off if their dependencies are off. 1258# Force some options off if their dependencies are off.
1258# 1259#
1259 1260
1260.if ${MKCXX} == "no" 1261.if ${MKCXX} == "no"
1261MKATF:= no 1262MKATF:= no
1262MKGROFF:= no 1263MKGROFF:= no
1263MKKYUA:= no 1264MKKYUA:= no
1264.endif 1265.endif
1265 1266
1266.if ${MKMAN} == "no" 1267.if ${MKMAN} == "no"
1267MKCATPAGES:= no 1268MKCATPAGES:= no
1268MKHTML:= no 1269MKHTML:= no
1269.endif 1270.endif
1270 1271
1271_MANINSTALL= maninstall 1272_MANINSTALL= maninstall
1272.if ${MKCATPAGES} != "no" 1273.if ${MKCATPAGES} != "no"
1273_MANINSTALL+= catinstall 1274_MANINSTALL+= catinstall
1274.endif 1275.endif
1275.if ${MKHTML} != "no" 1276.if ${MKHTML} != "no"
1276_MANINSTALL+= htmlinstall 1277_MANINSTALL+= htmlinstall
1277.endif 1278.endif
1278 1279
1279.if ${MKLINKLIB} == "no" 1280.if ${MKLINKLIB} == "no"
1280MKLINT:= no 1281MKLINT:= no
1281MKPICINSTALL:= no 1282MKPICINSTALL:= no
1282MKPROFILE:= no 1283MKPROFILE:= no
1283.endif 1284.endif
1284 1285
1285.if ${MKPIC} == "no" 1286.if ${MKPIC} == "no"
1286MKPICLIB:= no 1287MKPICLIB:= no
1287.endif 1288.endif
1288 1289
1289.if ${MKOBJ} == "no" 1290.if ${MKOBJ} == "no"
1290MKOBJDIRS:= no 1291MKOBJDIRS:= no
1291.endif 1292.endif
1292 1293
1293.if ${MKSHARE} == "no" 1294.if ${MKSHARE} == "no"
1294MKCATPAGES:= no 1295MKCATPAGES:= no
1295MKDOC:= no 1296MKDOC:= no
1296MKINFO:= no 1297MKINFO:= no
1297MKHTML:= no 1298MKHTML:= no
1298MKMAN:= no 1299MKMAN:= no
1299MKNLS:= no 1300MKNLS:= no
1300.endif 1301.endif
1301 1302
1302.if !empty(MACHINE_ARCH:Mearm*) 1303.if !empty(MACHINE_ARCH:Mearm*)
1303_NEEDS_LIBCXX.${MACHINE_ARCH}= yes 1304_NEEDS_LIBCXX.${MACHINE_ARCH}= yes
1304.endif 1305.endif
1305_NEEDS_LIBCXX.aarch64= yes 1306_NEEDS_LIBCXX.aarch64= yes
1306_NEEDS_LIBCXX.aarch64eb= yes 1307_NEEDS_LIBCXX.aarch64eb= yes
1307_NEEDS_LIBCXX.i386= yes 1308_NEEDS_LIBCXX.i386= yes
1308_NEEDS_LIBCXX.powerpc= yes 1309_NEEDS_LIBCXX.powerpc= yes
1309_NEEDS_LIBCXX.powerpc64= yes 1310_NEEDS_LIBCXX.powerpc64= yes
1310_NEEDS_LIBCXX.sparc= yes 1311_NEEDS_LIBCXX.sparc= yes
1311_NEEDS_LIBCXX.sparc64= yes 1312_NEEDS_LIBCXX.sparc64= yes
1312_NEEDS_LIBCXX.x86_64= yes 1313_NEEDS_LIBCXX.x86_64= yes
1313 1314
1314.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes" 1315.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
1315MKLIBCXX:= yes 1316MKLIBCXX:= yes
1316.endif 1317.endif
1317 1318
1318# 1319#
1319# install(1) parameters. 1320# install(1) parameters.
1320# 1321#
1321COPY?= -c 1322COPY?= -c
1322.if ${MKUPDATE} == "no" 1323.if ${MKUPDATE} == "no"
1323PRESERVE?=  1324PRESERVE?=
1324.else 1325.else
1325PRESERVE?= -p 1326PRESERVE?= -p
1326.endif 1327.endif
1327RENAME?= -r 1328RENAME?= -r
1328HRDLINK?= -l h 1329HRDLINK?= -l h
1329SYMLINK?= -l s 1330SYMLINK?= -l s
1330 1331
1331METALOG?= ${DESTDIR}/METALOG 1332METALOG?= ${DESTDIR}/METALOG
1332METALOG.add?= ${TOOL_CAT} -l >> ${METALOG} 1333METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1333.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR} 1334.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1334.if ${MKUNPRIVED} != "no" 1335.if ${MKUNPRIVED} != "no"
1335INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256 1336INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1336.else 1337.else
1337INSTPRIV.unpriv= 1338INSTPRIV.unpriv=
1338.endif 1339.endif
1339INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc 1340INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1340.endif 1341.endif
1341STRIPFLAG?=  1342STRIPFLAG?=
1342 1343
1343.if ${NEED_OWN_INSTALL_TARGET} != "no" 1344.if ${NEED_OWN_INSTALL_TARGET} != "no"
1344INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d 1345INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1345INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME} 1346INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1346INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME} 1347INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1347INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME} 1348INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1348.endif 1349.endif
1349 1350
1350# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH 1351# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
1351# 1352#
1352OBJECT_FMTS= 1353OBJECT_FMTS=
1353.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64" 1354.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "ia64"
1354OBJECT_FMTS+= elf32 1355OBJECT_FMTS+= elf32
1355.endif 1356.endif
1356.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != "" 1357.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
1357. if !(${MKCOMPAT:Uyes} == "no" && ${MACHINE_CPU} == "mips") 1358. if !(${MKCOMPAT:Uyes} == "no" && ${MACHINE_CPU} == "mips")
1358OBJECT_FMTS+= elf64 1359OBJECT_FMTS+= elf64
1359. endif 1360. endif
1360.endif 1361.endif
1361 1362
1362# 1363#
1363# Set defaults for the USE_xxx variables. 1364# Set defaults for the USE_xxx variables.
1364# 1365#
1365 1366
1366# 1367#
1367# USE_* options which default to "no" and will be forced to "no" if their 1368# USE_* options which default to "no" and will be forced to "no" if their
1368# corresponding MK* variable is set to "no". 1369# corresponding MK* variable is set to "no".
1369# 1370#
1370.for var in USE_SKEY 1371.for var in USE_SKEY
1371.if (${${var:S/USE_/MK/}} == "no") 1372.if (${${var:S/USE_/MK/}} == "no")
1372${var}:= no 1373${var}:= no
1373.else 1374.else
1374${var}?= no 1375${var}?= no
1375.endif 1376.endif
1376.endfor 1377.endfor
1377 1378
1378# 1379#
1379# USE_* options which default to "yes" unless their corresponding MK* 1380# USE_* options which default to "yes" unless their corresponding MK*
1380# variable is set to "no". 1381# variable is set to "no".
1381# 1382#
1382.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP 1383.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1383.if (${${var:S/USE_/MK/}} == "no") 1384.if (${${var:S/USE_/MK/}} == "no")
1384${var}:= no 1385${var}:= no
1385.else 1386.else
1386${var}?= yes 1387${var}?= yes
1387.endif 1388.endif
1388.endfor 1389.endfor
1389 1390
1390# 1391#
1391# USE_* options which default to "yes". 1392# USE_* options which default to "yes".
1392# 1393#
1393.for var in USE_JEMALLOC 1394.for var in USE_JEMALLOC
1394${var}?= yes 1395${var}?= yes
1395.endfor 1396.endfor
1396 1397
1397# 1398#
1398# USE_* options which default to "no". 1399# USE_* options which default to "no".
1399# 1400#
1400# For now, disable pigz as compressor by default 1401# For now, disable pigz as compressor by default
1401.for var in USE_PIGZGZIP 1402.for var in USE_PIGZGZIP
1402${var}?= no 1403${var}?= no
1403.endfor 1404.endfor
1404 1405
1405# Default to USE_XZ_SETS on some 64bit architectures where decompressor 1406# Default to USE_XZ_SETS on some 64bit architectures where decompressor
1406# memory will likely not be in short supply. 1407# memory will likely not be in short supply.
1407# Since pigz can not create .xz format files currently, disable .xz 1408# Since pigz can not create .xz format files currently, disable .xz
1408# format if USE_PIGZGZIP is enabled. 1409# format if USE_PIGZGZIP is enabled.
1409.if ${USE_PIGZGZIP} == "no" && \ 1410.if ${USE_PIGZGZIP} == "no" && \
1410 (${MACHINE} == "amd64" || \ 1411 (${MACHINE} == "amd64" || \
1411 ${MACHINE} == "sparc64") 1412 ${MACHINE} == "sparc64")
1412USE_XZ_SETS?= yes 1413USE_XZ_SETS?= yes
1413.else 1414.else
1414USE_XZ_SETS?= no 1415USE_XZ_SETS?= no
1415.endif  1416.endif
1416 1417
1417# 1418#
1418# TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip. 1419# TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
1419# 1420#
1420.if ${USE_PIGZGZIP} != "no" 1421.if ${USE_PIGZGZIP} != "no"
1421TOOL_GZIP= ${TOOL_PIGZ} 1422TOOL_GZIP= ${TOOL_PIGZ}
1422GZIP_N_FLAG?= -nT 1423GZIP_N_FLAG?= -nT
1423.else 1424.else
1424TOOL_GZIP= gzip 1425TOOL_GZIP= gzip
1425GZIP_N_FLAG?= -n 1426GZIP_N_FLAG?= -n
1426.endif 1427.endif
1427TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG} 1428TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
1428 1429
1429# 1430#
1430# Where X11 sources are and where it is installed to. 1431# Where X11 sources are and where it is installed to.
1431# 1432#
1432.if !defined(X11SRCDIR) 1433.if !defined(X11SRCDIR)
1433.if exists(${NETBSDSRCDIR}/../xsrc) 1434.if exists(${NETBSDSRCDIR}/../xsrc)
1434X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd 1435X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1435.else 1436.else
1436X11SRCDIR= /usr/xsrc 1437X11SRCDIR= /usr/xsrc
1437.endif 1438.endif
1438.endif # !defined(X11SRCDIR) 1439.endif # !defined(X11SRCDIR)
1439 1440
1440X11SRCDIR.local?= ${X11SRCDIR}/local 1441X11SRCDIR.local?= ${X11SRCDIR}/local
1441X11ROOTDIR?= /usr/X11R7 1442X11ROOTDIR?= /usr/X11R7
1442X11BINDIR?= ${X11ROOTDIR}/bin 1443X11BINDIR?= ${X11ROOTDIR}/bin
1443X11ETCDIR?= /etc/X11 1444X11ETCDIR?= /etc/X11
1444X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts 1445X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1445X11INCDIR?= ${X11ROOTDIR}/include 1446X11INCDIR?= ${X11ROOTDIR}/include
1446X11LIBDIR?= ${X11ROOTDIR}/lib/X11 1447X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1447X11MANDIR?= ${X11ROOTDIR}/man 1448X11MANDIR?= ${X11ROOTDIR}/man
1448X11SHAREDIR?= ${X11ROOTDIR}/share 1449X11SHAREDIR?= ${X11ROOTDIR}/share
1449X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}} 1450X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
1450 1451
1451# 1452#
1452# New modular-xorg based builds 1453# New modular-xorg based builds
1453# 1454#
1454X11SRCDIRMIT?= ${X11SRCDIR}/external/mit 1455X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1455.for _lib in \ 1456.for _lib in \
1456 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \ 1457 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1457 Xdmcp Xevie Xext Xfixes Xfont Xfont2 Xft Xi Xinerama Xmu Xpresent Xpm \ 1458 Xdmcp Xevie Xext Xfixes Xfont Xfont2 Xft Xi Xinerama Xmu Xpresent Xpm \
1458 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \ 1459 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1459 epoxy fontenc vdpau xkbfile xkbui Xaw pciaccess xcb xshmfence \ 1460 epoxy fontenc vdpau xkbfile xkbui Xaw pciaccess xcb xshmfence \
1460 pthread-stubs 1461 pthread-stubs
1461X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist 1462X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1462.endfor 1463.endfor
1463 1464
1464.for _proto in \ 1465.for _proto in \
1465 xcb- xorg 1466 xcb- xorg
1466X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist 1467X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1467.endfor 1468.endfor
1468 1469
1469# During transition from xorg-server 1.10 to 1.20 1470# During transition from xorg-server 1.10 to 1.20
1470.if \ 1471.if \
1471 ${MACHINE} == "alpha" || \ 1472 ${MACHINE} == "alpha" || \
1472 ${MACHINE} == "amiga" || \ 1473 ${MACHINE} == "amiga" || \
1473 ${MACHINE} == "ews4800mips" || \ 1474 ${MACHINE} == "ews4800mips" || \
1474 ${MACHINE} == "hpcarm" || \ 1475 ${MACHINE} == "hpcarm" || \
1475 ${MACHINE} == "hpcmips" || \ 1476 ${MACHINE} == "hpcmips" || \
1476 ${MACHINE} == "hpcsh" || \ 1477 ${MACHINE} == "hpcsh" || \
1477 ${MACHINE} == "mac68k" || \ 1478 ${MACHINE} == "mac68k" || \
1478 ${MACHINE} == "netwinder" || \ 1479 ${MACHINE} == "netwinder" || \
1479 ${MACHINE} == "newsmips" || \ 1480 ${MACHINE} == "newsmips" || \
1480 ${MACHINE} == "sgimips" || \ 1481 ${MACHINE} == "sgimips" || \
1481 ${MACHINE} == "vax" || \ 1482 ${MACHINE} == "vax" || \
1482 ${MACHINE} == "x68k" || \ 1483 ${MACHINE} == "x68k" || \
1483 ${MACHINE} == "zaurus" 1484 ${MACHINE} == "zaurus"
1484HAVE_XORG_SERVER_VER?=110 1485HAVE_XORG_SERVER_VER?=110
1485.else 1486.else
1486HAVE_XORG_SERVER_VER?=120 1487HAVE_XORG_SERVER_VER?=120
1487.endif 1488.endif
1488 1489
1489.if ${HAVE_XORG_SERVER_VER} == "120" 1490.if ${HAVE_XORG_SERVER_VER} == "120"
1490XORG_SERVER_SUBDIR?=xorg-server 1491XORG_SERVER_SUBDIR?=xorg-server
1491. if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "evbarm" 1492. if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "evbarm"
1492HAVE_XORG_GLAMOR?= yes 1493HAVE_XORG_GLAMOR?= yes
1493. endif 1494. endif
1494.else 1495.else
1495XORG_SERVER_SUBDIR?=xorg-server.old 1496XORG_SERVER_SUBDIR?=xorg-server.old
1496.endif 1497.endif
1497 1498
1498X11SRCDIR.xorg-server?= ${X11SRCDIRMIT}/${XORG_SERVER_SUBDIR}/dist 1499X11SRCDIR.xorg-server?= ${X11SRCDIRMIT}/${XORG_SERVER_SUBDIR}/dist
1499HAVE_XORG_GLAMOR?= no 1500HAVE_XORG_GLAMOR?= no
1500 1501
1501# Build glamor extension? 1502# Build glamor extension?
1502 1503
1503.for _dir in \ 1504.for _dir in \
1504 xtrans fontconfig freetype evieext mkfontscale bdftopcf \ 1505 xtrans fontconfig freetype evieext mkfontscale bdftopcf \
1505 xorg-cf-files imake xbiff xkeyboard-config \ 1506 xorg-cf-files imake xbiff xkeyboard-config \
1506 xbitmaps appres xeyes xev xedit sessreg pixman \ 1507 xbitmaps appres xeyes xev xedit sessreg pixman \
1507 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \ 1508 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
1508 glu glw mesa-demos MesaGLUT MesaLib MesaLib.old MesaLib7 \ 1509 glu glw mesa-demos MesaGLUT MesaLib MesaLib.old MesaLib7 \
1509 ico iceauth listres lndir \ 1510 ico iceauth listres lndir \
1510 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \ 1511 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1511 rstart setxkbmap showfont smproxy transset twm viewres \ 1512 rstart setxkbmap showfont smproxy transset twm viewres \
1512 util-macros \ 1513 util-macros \
1513 x11perf xauth xcalc xclipboard \ 1514 x11perf xauth xcalc xclipboard \
1514 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \ 1515 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
1515 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \ 1516 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
1516 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \ 1517 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1517 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \ 1518 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1518 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \ 1519 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1519 xwininfo xwud xkbprint xkbevd \ 1520 xwininfo xwud xkbprint xkbevd \
1520 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \ 1521 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
1521 xinput xcb-util xorg-docs \ 1522 xinput xcb-util xorg-docs \
1522 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \ 1523 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1523 font-adobe-utopia-75dpi font-adobe-utopia-type1 \ 1524 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1524 font-alias \ 1525 font-alias \
1525 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \ 1526 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1526 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \ 1527 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1527 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \ 1528 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1528 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \ 1529 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1529 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \ 1530 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1530 font-sony-misc font-util ttf-bitstream-vera encodings 1531 font-sony-misc font-util ttf-bitstream-vera encodings
1531X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist 1532X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1532.endfor 1533.endfor
1533 1534
1534# X11SRCDIR.Mesa points to the currently used Mesa sources 1535# X11SRCDIR.Mesa points to the currently used Mesa sources
1535X11SRCDIR.Mesa?= ${X11SRCDIRMIT}/${EXTERNAL_MESALIB_DIR}/dist 1536X11SRCDIR.Mesa?= ${X11SRCDIRMIT}/${EXTERNAL_MESALIB_DIR}/dist
1536 1537
1537.for _i in \ 1538.for _i in \
1538 elographics keyboard mouse synaptics vmmouse void ws 1539 elographics keyboard mouse synaptics vmmouse void ws
1539X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist 1540X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1540.endfor 1541.endfor
1541 1542
1542# xf86-video-modesetting move into the server build. 1543# xf86-video-modesetting move into the server build.
1543EXTRA_DRIVERS= 1544EXTRA_DRIVERS=
1544.if ${HAVE_XORG_SERVER_VER} == "120" 1545.if ${HAVE_XORG_SERVER_VER} == "120"
1545X11SRCDIR.xf86-video-modesetting=${X11SRCDIR.xorg-server}/hw/xfree86/drivers/modesetting 1546X11SRCDIR.xf86-video-modesetting=${X11SRCDIR.xorg-server}/hw/xfree86/drivers/modesetting
1546.else 1547.else
1547EXTRA_DRIVERS= modesetting  1548EXTRA_DRIVERS= modesetting
1548.endif 1549.endif
1549 1550
1550.for _v in \ 1551.for _v in \
1551 ag10e amdgpu apm ark ast ati ati-kms chips cirrus crime \ 1552 ag10e amdgpu apm ark ast ati ati-kms chips cirrus crime \
1552 geode glint i128 i740 igs imstt intel intel-old intel-2014 \ 1553 geode glint i128 i740 igs imstt intel intel-old intel-2014 \
1553 ${EXTRA_DRIVERS} mach64 mga \ 1554 ${EXTRA_DRIVERS} mach64 mga \
1554 neomagic newport nouveau nsc nv openchrome pnozz \ 1555 neomagic newport nouveau nsc nv openchrome pnozz \
1555 r128 rendition \ 1556 r128 rendition \
1556 s3 s3virge savage siliconmotion sis suncg14 \ 1557 s3 s3virge savage siliconmotion sis suncg14 \
1557 suncg6 sunffb sunleo suntcx \ 1558 suncg6 sunffb sunleo suntcx \
1558 tdfx tga trident tseng vboxvideo vesa vga vmware wsfb xgi 1559 tdfx tga trident tseng vboxvideo vesa vga vmware wsfb xgi
1559X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist 1560X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1560.endfor 1561.endfor
1561 1562
1562 1563
1563X11DRI?= yes 1564X11DRI?= yes
1564X11LOADABLE?= yes 1565X11LOADABLE?= yes
1565 1566
1566 1567
1567# 1568#
1568# Where extsrc sources are and where it is installed to. 1569# Where extsrc sources are and where it is installed to.
1569# 1570#
1570.if !defined(EXTSRCSRCDIR) 1571.if !defined(EXTSRCSRCDIR)
1571.if exists(${NETBSDSRCDIR}/../extsrc) 1572.if exists(${NETBSDSRCDIR}/../extsrc)
1572EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd 1573EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1573.else 1574.else
1574EXTSRCSRCDIR= /usr/extsrc 1575EXTSRCSRCDIR= /usr/extsrc
1575.endif 1576.endif
1576.endif # !defined(EXTSRCSRCDIR) 1577.endif # !defined(EXTSRCSRCDIR)
1577 1578
1578EXTSRCROOTDIR?= /usr/ext 1579EXTSRCROOTDIR?= /usr/ext
1579EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin 1580EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1580EXTSRCETCDIR?= /etc/ext 1581EXTSRCETCDIR?= /etc/ext
1581EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include 1582EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1582EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext 1583EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1583EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man 1584EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1584EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib 1585EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1585 1586
1586# 1587#
1587# MAKEDIRTARGET dir target [extra make(1) params] 1588# MAKEDIRTARGET dir target [extra make(1) params]
1588# run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message 1589# run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1589# 1590#
1590MAKEDIRTARGETENV?= 1591MAKEDIRTARGETENV?=
1591MAKEDIRTARGET=\ 1592MAKEDIRTARGET=\
1592 @_makedirtarget() { \ 1593 @_makedirtarget() { \
1593 dir="$$1"; shift; \ 1594 dir="$$1"; shift; \
1594 target="$$1"; shift; \ 1595 target="$$1"; shift; \
1595 case "$${dir}" in \ 1596 case "$${dir}" in \
1596 /*) this="$${dir}/"; \ 1597 /*) this="$${dir}/"; \
1597 real="$${dir}" ;; \ 1598 real="$${dir}" ;; \
1598 .) this="${_THISDIR_}"; \ 1599 .) this="${_THISDIR_}"; \
1599 real="${.CURDIR}" ;; \ 1600 real="${.CURDIR}" ;; \
1600 *) this="${_THISDIR_}$${dir}/"; \ 1601 *) this="${_THISDIR_}$${dir}/"; \
1601 real="${.CURDIR}/$${dir}" ;; \ 1602 real="${.CURDIR}/$${dir}" ;; \
1602 esac; \ 1603 esac; \
1603 show=$${this:-.}; \ 1604 show=$${this:-.}; \
1604 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \ 1605 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1605 cd "$${real}" \ 1606 cd "$${real}" \
1606 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \ 1607 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1607 }; \ 1608 }; \
1608 _makedirtarget 1609 _makedirtarget
1609 1610
1610# 1611#
1611# MAKEVERBOSE support. Levels are: 1612# MAKEVERBOSE support. Levels are:
1612# 0 Minimal output ("quiet") 1613# 0 Minimal output ("quiet")
1613# 1 Describe what is occurring 1614# 1 Describe what is occurring
1614# 2 Describe what is occurring and echo the actual command 1615# 2 Describe what is occurring and echo the actual command
1615# 3 Ignore the effect of the "@" prefix in make commands 1616# 3 Ignore the effect of the "@" prefix in make commands
1616# 4 Trace shell commands using the shell's -x flag 1617# 4 Trace shell commands using the shell's -x flag
1617#  1618#
1618MAKEVERBOSE?= 2 1619MAKEVERBOSE?= 2
1619 1620
1620.if ${MAKEVERBOSE} == 0 1621.if ${MAKEVERBOSE} == 0
1621_MKMSG?= @\# 1622_MKMSG?= @\#
1622_MKSHMSG?= : echo 1623_MKSHMSG?= : echo
1623_MKSHECHO?= : echo 1624_MKSHECHO?= : echo
1624.SILENT: 1625.SILENT:
1625.elif ${MAKEVERBOSE} == 1 1626.elif ${MAKEVERBOSE} == 1
1626_MKMSG?= @echo ' ' 1627_MKMSG?= @echo ' '
1627_MKSHMSG?= echo ' ' 1628_MKSHMSG?= echo ' '
1628_MKSHECHO?= : echo 1629_MKSHECHO?= : echo
1629.SILENT: 1630.SILENT:
1630.else # MAKEVERBOSE >= 2 1631.else # MAKEVERBOSE >= 2
1631_MKMSG?= @echo '\# ' 1632_MKMSG?= @echo '\# '
1632_MKSHMSG?= echo '\# ' 1633_MKSHMSG?= echo '\# '
1633_MKSHECHO?= echo 1634_MKSHECHO?= echo
1634.SILENT: __makeverbose_dummy_target__ 1635.SILENT: __makeverbose_dummy_target__
1635.endif # MAKEVERBOSE >= 2 1636.endif # MAKEVERBOSE >= 2
1636.if ${MAKEVERBOSE} >= 3 1637.if ${MAKEVERBOSE} >= 3
1637.MAKEFLAGS: -dl 1638.MAKEFLAGS: -dl
1638.endif # ${MAKEVERBOSE} >= 3 1639.endif # ${MAKEVERBOSE} >= 3
1639.if ${MAKEVERBOSE} >= 4 1640.if ${MAKEVERBOSE} >= 4
1640.MAKEFLAGS: -dx 1641.MAKEFLAGS: -dx
1641.endif # ${MAKEVERBOSE} >= 4 1642.endif # ${MAKEVERBOSE} >= 4
1642 1643
1643_MKMSG_BUILD?= ${_MKMSG} " build " 1644_MKMSG_BUILD?= ${_MKMSG} " build "
1644_MKMSG_CREATE?= ${_MKMSG} " create " 1645_MKMSG_CREATE?= ${_MKMSG} " create "
1645_MKMSG_COMPILE?= ${_MKMSG} "compile " 1646_MKMSG_COMPILE?= ${_MKMSG} "compile "
1646_MKMSG_FORMAT?= ${_MKMSG} " format " 1647_MKMSG_FORMAT?= ${_MKMSG} " format "
1647_MKMSG_INSTALL?= ${_MKMSG} "install " 1648_MKMSG_INSTALL?= ${_MKMSG} "install "
1648_MKMSG_LINK?= ${_MKMSG} " link " 1649_MKMSG_LINK?= ${_MKMSG} " link "
1649_MKMSG_LEX?= ${_MKMSG} " lex " 1650_MKMSG_LEX?= ${_MKMSG} " lex "
1650_MKMSG_REMOVE?= ${_MKMSG} " remove " 1651_MKMSG_REMOVE?= ${_MKMSG} " remove "
1651_MKMSG_YACC?= ${_MKMSG} " yacc " 1652_MKMSG_YACC?= ${_MKMSG} " yacc "
1652 1653
1653_MKSHMSG_CREATE?= ${_MKSHMSG} " create " 1654_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1654_MKSHMSG_INSTALL?= ${_MKSHMSG} "install " 1655_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1655 1656
1656_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET} 1657_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1657_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET} 1658_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1658_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET} 1659_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1659_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET} 1660_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1660_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET} 1661_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1661_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET} 1662_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1662_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET} 1663_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1663_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET} 1664_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1664_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET} 1665_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1665 1666
1666.if ${MKMANDOC} == "yes" 1667.if ${MKMANDOC} == "yes"
1667TARGETS+= lintmanpages 1668TARGETS+= lintmanpages
1668.endif 1669.endif
1669 1670
1670TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}} 1671TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
1671 1672
1672# Override with tools versions if needed 1673# Override with tools versions if needed
1673.if ${MKCTF:Uno} != "no" && !defined(NOCTF) && \ 1674.if ${MKCTF:Uno} != "no" && !defined(NOCTF) && \
1674 (exists(${TOOL_CTFCONVERT}) || exists(/usr/bin/${TOOL_CTFCONVERT})) 1675 (exists(${TOOL_CTFCONVERT}) || exists(/usr/bin/${TOOL_CTFCONVERT}))
1675CTFCONVERT= ${TOOL_CTFCONVERT} 1676CTFCONVERT= ${TOOL_CTFCONVERT}
1676CTFMERGE= ${TOOL_CTFMERGE} 1677CTFMERGE= ${TOOL_CTFMERGE}
1677.endif 1678.endif
1678 1679
1679.endif # !defined(_BSD_OWN_MK_) 1680.endif # !defined(_BSD_OWN_MK_)