Sat Apr 2 22:08:14 2016 UTC ()
add some comments and prefer MACHINE over MACHINE_ARCH when
they're always the same.  no functional change.


(mrg)
diff -r1.915 -r1.916 src/share/mk/bsd.own.mk

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

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