Sun Mar 27 10:46:41 2016 UTC ()
Switch hppa to gcc 5.3


(skrll)
diff -r1.912 -r1.913 src/share/mk/bsd.own.mk

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

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