Tue Dec 25 00:35:26 2018 UTC ()
back to binutils 227: constructors in ifconfig are broken.


(christos)
diff -r1.1086 -r1.1087 src/share/mk/bsd.own.mk

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

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