Tue Nov 28 18:14:37 2017 UTC ()
switch everyone to gdb.old


(christos)
diff -r1.1019 -r1.1020 src/share/mk/bsd.own.mk

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

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