Wed Apr 15 21:28:08 2020 UTC ()
switch ppc to the new binutils


(christos)
diff -r1.1180 -r1.1181 src/share/mk/bsd.own.mk

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

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