Mon Dec 24 21:51:57 2018 UTC ()
Switch x86 to binutils 2.31.1


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

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

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