Sat Mar 26 10:35:14 2016 UTC ()
Switch playstation2 over to gcc 5.3, binutils 2.26 and gdb 7.10


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

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

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