Fri Jan 22 21:55:51 2016 UTC ()
Build DTrace userland by default on i386, amd64 and earm*


(riz)
diff -r1.883 -r1.884 src/share/mk/bsd.own.mk

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

--- src/share/mk/bsd.own.mk 2015/12/19 00:25:50 1.883
+++ src/share/mk/bsd.own.mk 2016/01/22 21:55:51 1.884
@@ -1,1433 +1,1443 @@ @@ -1,1433 +1,1443 @@
1# $NetBSD: bsd.own.mk,v 1.883 2015/12/19 00:25:50 wiz Exp $ 1# $NetBSD: bsd.own.mk,v 1.884 2016/01/22 21:55:51 riz Exp $
2 2
3# This needs to be before bsd.init.mk 3# This needs to be before bsd.init.mk
4.if defined(BSD_MK_COMPAT_FILE) 4.if defined(BSD_MK_COMPAT_FILE)
5.include <${BSD_MK_COMPAT_FILE}> 5.include <${BSD_MK_COMPAT_FILE}>
6.endif 6.endif
7 7
8.if !defined(_BSD_OWN_MK_) 8.if !defined(_BSD_OWN_MK_)
9_BSD_OWN_MK_=1 9_BSD_OWN_MK_=1
10 10
11MAKECONF?= /etc/mk.conf 11MAKECONF?= /etc/mk.conf
12.-include "${MAKECONF}" 12.-include "${MAKECONF}"
13 13
14# 14#
15# CPU model, derived from MACHINE_ARCH 15# CPU model, derived from MACHINE_ARCH
16# 16#
17MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/} 17MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/coldfire/m68k/:S/m68000/m68k/:C/arm.*/arm/:C/earm.*/arm/:S/earm/arm/:S/powerpc64/powerpc/:S/aarch64eb/aarch64/:S/or1knd/or1k/:C/riscv../riscv/}
18 18
19# 19#
20# Subdirectory used below ${RELEASEDIR} when building a release 20# Subdirectory used below ${RELEASEDIR} when building a release
21# 21#
22RELEASEMACHINEDIR?= ${MACHINE} 22RELEASEMACHINEDIR?= ${MACHINE}
23 23
24# 24#
25# Subdirectory or path component used for the following paths: 25# Subdirectory or path component used for the following paths:
26# distrib/${RELEASEMACHINE} 26# distrib/${RELEASEMACHINE}
27# distrib/notes/${RELEASEMACHINE} 27# distrib/notes/${RELEASEMACHINE}
28# etc/etc.${RELEASEMACHINE} 28# etc/etc.${RELEASEMACHINE}
29# Used when building a release. 29# Used when building a release.
30# 30#
31RELEASEMACHINE?= ${MACHINE} 31RELEASEMACHINE?= ${MACHINE}
32 32
33# 33#
34# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to 34# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
35# ensure that things defined by <bsd.own.mk> (default targets, 35# ensure that things defined by <bsd.own.mk> (default targets,
36# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk. 36# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
37# 37#
38NEED_OWN_INSTALL_TARGET?= yes 38NEED_OWN_INSTALL_TARGET?= yes
39 39
40# 40#
41# This lists the platforms which do not have working in-tree toolchains. For 41# This lists the platforms which do not have working in-tree toolchains. For
42# the in-tree gcc toolchain, this list is empty. 42# the in-tree gcc toolchain, this list is empty.
43# 43#
44# If some future port is not supported by the in-tree toolchain, this should 44# If some future port is not supported by the in-tree toolchain, this should
45# be set to "yes" for that port only. 45# be set to "yes" for that port only.
46# 46#
47.if ${MACHINE} == "playstation2" 47.if ${MACHINE} == "playstation2"
48TOOLCHAIN_MISSING?= yes 48TOOLCHAIN_MISSING?= yes
49.endif 49.endif
50 50
51TOOLCHAIN_MISSING?= no 51TOOLCHAIN_MISSING?= no
52 52
53.if ${MACHINE_CPU} == "aarch64" && !defined(EXTERNAL_TOOLCHAIN) && ${MKLLVM:Uyes} != "no" 53.if ${MACHINE_CPU} == "aarch64" && !defined(EXTERNAL_TOOLCHAIN) && ${MKLLVM:Uyes} != "no"
54MKLLVM?= yes 54MKLLVM?= yes
55HAVE_LLVM?= yes 55HAVE_LLVM?= yes
56MKGCC?= no 56MKGCC?= no
57.endif 57.endif
58 58
59# 59#
60# GCC Using platforms. 60# GCC Using platforms.
61# 61#
62.if ${MKGCC:Uyes} != "no" 62.if ${MKGCC:Uyes} != "no"
63 63
64.if ${MACHINE} == "playstation2" || ${MACHINE_CPU} == "aarch64" 64.if ${MACHINE} == "playstation2" || ${MACHINE_CPU} == "aarch64"
65HAVE_GCC?= 0 65HAVE_GCC?= 0
66.else 66.else
67# Otherwise, default to GCC4.8 67# Otherwise, default to GCC4.8
68HAVE_GCC?= 48 68HAVE_GCC?= 48
69.endif 69.endif
70 70
71# 71#
72# Platforms that can't run a modern GCC natively 72# Platforms that can't run a modern GCC natively
73.if ${MACHINE_ARCH} == "m68000" 73.if ${MACHINE_ARCH} == "m68000"
74MKGCCCMDS?= no 74MKGCCCMDS?= no
75.endif 75.endif
76 76
77# 77#
78# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is 78# We import the old gcc as "gcc.old" when upgrading. EXTERNAL_GCC_SUBDIR is
79# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC. 79# set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
80# 80#
81.if ${HAVE_GCC} == 5 81.if ${HAVE_GCC} == 5
82EXTERNAL_GCC_SUBDIR= gcc 82EXTERNAL_GCC_SUBDIR= gcc
83.elif ${HAVE_GCC} == 48 83.elif ${HAVE_GCC} == 48
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.i386= yes 97_LIBC_COMPILER_RT.i386= yes
98_LIBC_COMPILER_RT.powerpc= yes 98_LIBC_COMPILER_RT.powerpc= yes
99_LIBC_COMPILER_RT.powerpc64= yes 99_LIBC_COMPILER_RT.powerpc64= yes
100_LIBC_COMPILER_RT.x86_64= yes 100_LIBC_COMPILER_RT.x86_64= yes
101 101
102.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes" 102.if ${HAVE_LLVM:Uno} == "yes" && ${_LIBC_COMPILER_RT.${MACHINE_ARCH}:Uno} == "yes"
103HAVE_LIBGCC?= no 103HAVE_LIBGCC?= no
104.else 104.else
105HAVE_LIBGCC?= yes 105HAVE_LIBGCC?= yes
106.endif 106.endif
107 107
108 108
109# ia64 is not support 109# ia64 is not support
110.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*) 110.if ${HAVE_LLVM:Uno} == "yes" || !empty(MACHINE_ARCH:Mearm*)
111HAVE_LIBGCC_EH?= no 111HAVE_LIBGCC_EH?= no
112.else 112.else
113HAVE_LIBGCC_EH?= yes 113HAVE_LIBGCC_EH?= yes
114.endif 114.endif
115 115
116HAVE_GDB?= 79 116HAVE_GDB?= 79
117 117
118.if (${MACHINE_ARCH} == "alpha") || \ 118.if (${MACHINE_ARCH} == "alpha") || \
119 (${MACHINE_ARCH} == "hppa") || \ 119 (${MACHINE_ARCH} == "hppa") || \
120 (${MACHINE_ARCH} == "ia64") || \ 120 (${MACHINE_ARCH} == "ia64") || \
121 (${MACHINE_CPU} == "mips") 121 (${MACHINE_CPU} == "mips")
122HAVE_SSP?= no 122HAVE_SSP?= no
123.else 123.else
124HAVE_SSP?= yes 124HAVE_SSP?= yes
125.if ${USE_FORT:Uno} != "no" 125.if ${USE_FORT:Uno} != "no"
126USE_SSP?= yes 126USE_SSP?= yes
127.endif 127.endif
128.endif 128.endif
129 129
130.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*) 130.if empty(.MAKEFLAGS:tW:M*-V .OBJDIR*)
131.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR) 131.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
132PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx 132PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
133.else 133.else
134PRINTOBJDIR= ${MAKE} -V .OBJDIR 134PRINTOBJDIR= ${MAKE} -V .OBJDIR
135.endif 135.endif
136.else 136.else
137PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion 137PRINTOBJDIR= echo /error/bsd.own.mk/PRINTOBJDIR # avoid infinite recursion
138.endif 138.endif
139 139
140# 140#
141# Determine if running in the NetBSD source tree by checking for the 141# Determine if running in the NetBSD source tree by checking for the
142# existence of build.sh and tools/ in the current or a parent directory, 142# existence of build.sh and tools/ in the current or a parent directory,
143# and setting _SRC_TOP_ to the result. 143# and setting _SRC_TOP_ to the result.
144# 144#
145.if !defined(_SRC_TOP_) # { 145.if !defined(_SRC_TOP_) # {
146_SRC_TOP_!= cd "${.CURDIR}"; while :; do \ 146_SRC_TOP_!= cd "${.CURDIR}"; while :; do \
147 here=`pwd`; \ 147 here=`pwd`; \
148 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \ 148 [ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
149 case $$here in /) echo ""; break;; esac; \ 149 case $$here in /) echo ""; break;; esac; \
150 cd ..; done 150 cd ..; done
151 151
152.MAKEOVERRIDES+= _SRC_TOP_ 152.MAKEOVERRIDES+= _SRC_TOP_
153 153
154.endif # } 154.endif # }
155 155
156# 156#
157# If _SRC_TOP_ != "", we're within the NetBSD source tree. 157# If _SRC_TOP_ != "", we're within the NetBSD source tree.
158# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_. 158# * Set defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
159# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the 159# * Define _NETBSD_VERSION_DEPENDS. Targets that depend on the
160# NetBSD version, or on variables defined at build time, can 160# NetBSD version, or on variables defined at build time, can
161# declare a dependency on ${_NETBSD_VERSION_DEPENDS}. 161# declare a dependency on ${_NETBSD_VERSION_DEPENDS}.
162# 162#
163.if (${_SRC_TOP_} != "") # { 163.if (${_SRC_TOP_} != "") # {
164 164
165NETBSDSRCDIR?= ${_SRC_TOP_} 165NETBSDSRCDIR?= ${_SRC_TOP_}
166 166
167.if !defined(_SRC_TOP_OBJ_) 167.if !defined(_SRC_TOP_OBJ_)
168_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR} 168_SRC_TOP_OBJ_!= cd "${_SRC_TOP_}" && ${PRINTOBJDIR}
169.MAKEOVERRIDES+= _SRC_TOP_OBJ_ 169.MAKEOVERRIDES+= _SRC_TOP_OBJ_
170.endif 170.endif
171 171
172_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params 172_NETBSD_VERSION_DEPENDS= ${_SRC_TOP_OBJ_}/params
173_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h 173_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/sys/param.h
174_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh 174_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/newvers.sh
175_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh 175_NETBSD_VERSION_DEPENDS+= ${NETBSDSRCDIR}/sys/conf/osrelease.sh
176${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build" 176${_SRC_TOP_OBJ_}/params: .NOTMAIN .OPTIONAL # created by top level "make build"
177 177
178.endif # _SRC_TOP_ != "" # } 178.endif # _SRC_TOP_ != "" # }
179 179
180 180
181.if (${_SRC_TOP_} != "") && \ 181.if (${_SRC_TOP_} != "") && \
182 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) 182 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
183USETOOLS?= yes 183USETOOLS?= yes
184.endif 184.endif
185USETOOLS?= no 185USETOOLS?= no
186 186
187 187
188.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \ 188.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
189 ${MACHINE_ARCH} == "sh3" 189 ${MACHINE_ARCH} == "sh3"
190.BEGIN: 190.BEGIN:
191 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el" 191 @echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
192 @false 192 @false
193.elif defined(REQUIRETOOLS) && \ 193.elif defined(REQUIRETOOLS) && \
194 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \ 194 (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
195 ${USETOOLS} == "no" 195 ${USETOOLS} == "no"
196.BEGIN: 196.BEGIN:
197 @echo "USETOOLS=no, but this component requires a version-specific host toolchain" 197 @echo "USETOOLS=no, but this component requires a version-specific host toolchain"
198 @false 198 @false
199.endif 199.endif
200 200
201# 201#
202# Host platform information; may be overridden 202# Host platform information; may be overridden
203# 203#
204.include <bsd.host.mk> 204.include <bsd.host.mk>
205 205
206.if ${USETOOLS} == "yes" # { 206.if ${USETOOLS} == "yes" # {
207 207
208# 208#
209# Provide a default for TOOLDIR. 209# Provide a default for TOOLDIR.
210# 210#
211.if !defined(TOOLDIR) 211.if !defined(TOOLDIR)
212TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE} 212TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
213.MAKEOVERRIDES+= TOOLDIR 213.MAKEOVERRIDES+= TOOLDIR
214.endif 214.endif
215 215
216# 216#
217# This is the prefix used for the NetBSD-sourced tools. 217# This is the prefix used for the NetBSD-sourced tools.
218# 218#
219_TOOL_PREFIX?= nb 219_TOOL_PREFIX?= nb
220 220
221# 221#
222# If an external toolchain base is specified, use it. 222# If an external toolchain base is specified, use it.
223# 223#
224.if defined(EXTERNAL_TOOLCHAIN) # { 224.if defined(EXTERNAL_TOOLCHAIN) # {
225AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar 225AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
226AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as 226AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
227LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld 227LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
228NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm 228NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
229OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy 229OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
230OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump 230OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
231RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib 231RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
232READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf 232READELF= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-readelf
233SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size 233SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
234STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings 234STRINGS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strings
235STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip 235STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
236 236
237TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 237TOOL_CC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
238TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp 238TOOL_CPP.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
239TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++ 239TOOL_CXX.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
240TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77 240TOOL_FC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
241TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc 241TOOL_OBJC.gcc= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
242 242
243TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 243TOOL_CC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
244TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 244TOOL_CPP.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
245TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++ 245TOOL_CXX.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang++
246TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang 246TOOL_OBJC.clang= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-clang
247.else # } { 247.else # } {
248# Define default locations for common tools. 248# Define default locations for common tools.
249.if ${USETOOLS_BINUTILS:Uyes} == "yes" # { 249.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
250AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar 250AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
251AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as 251AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
252LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld 252LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
253NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm 253NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
254OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy 254OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
255OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump 255OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
256RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib 256RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
257READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf 257READELF= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-readelf
258SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size 258SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
259STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings 259STRINGS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strings
260STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip 260STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
261 261
262# GCC supports C, C++, Fortran and Objective C 262# GCC supports C, C++, Fortran and Objective C
263TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 263TOOL_CC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
264TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp 264TOOL_CPP.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
265TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++ 265TOOL_CXX.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
266TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77 266TOOL_FC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
267TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc 267TOOL_OBJC.gcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
268.endif # } 268.endif # }
269 269
270# Clang supports C, C++ and Objective C 270# Clang supports C, C++ and Objective C
271TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 271TOOL_CC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
272TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp 272TOOL_CPP.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang-cpp
273TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++ 273TOOL_CXX.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang++
274TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang 274TOOL_OBJC.clang= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-clang
275 275
276# PCC supports C and Fortran 276# PCC supports C and Fortran
277TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc 277TOOL_CC.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
278TOOL_CPP.pcc= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp 278TOOL_CPP.pcc= ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-cpp
279TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++ 279TOOL_CXX.pcc= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
280 280
281# 281#
282# Make sure DESTDIR is set, so that builds with these tools always 282# Make sure DESTDIR is set, so that builds with these tools always
283# get appropriate -nostdinc, -nostdlib, etc. handling. The default is 283# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
284# <empty string>, meaning start from /, the root directory. 284# <empty string>, meaning start from /, the root directory.
285# 285#
286DESTDIR?= 286DESTDIR?=
287 287
288.if !defined(HOSTPROG) && !defined(HOSTLIB) 288.if !defined(HOSTPROG) && !defined(HOSTLIB)
289. if ${DESTDIR} != "" 289. if ${DESTDIR} != ""
290CPPFLAGS+= --sysroot=${DESTDIR} 290CPPFLAGS+= --sysroot=${DESTDIR}
291LDFLAGS+= --sysroot=${DESTDIR} 291LDFLAGS+= --sysroot=${DESTDIR}
292. else 292. else
293CPPFLAGS+= --sysroot=/ 293CPPFLAGS+= --sysroot=/
294LDFLAGS+= --sysroot=/ 294LDFLAGS+= --sysroot=/
295. endif 295. endif
296.endif 296.endif
297.endif # EXTERNAL_TOOLCHAIN # } 297.endif # EXTERNAL_TOOLCHAIN # }
298 298
299DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym 299DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
300ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 300ELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
301ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 301ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
302INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install 302INSTALL= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
303LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex 303LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
304LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint 304LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
305LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder 305LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
306MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 306MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
307MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep 307MKDEPCXX= CC=${CXX:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
308PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl 308PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
309TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q 309TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
310YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc 310YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
311 311
312TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb 312TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
313TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb 313TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
314TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt 314TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
315TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile 315TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
316TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk 316TOOL_AWK= ${TOOLDIR}/bin/${_TOOL_PREFIX}awk
317TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb 317TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
318TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat 318TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
319TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum 319TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
320TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen 320TOOL_CLANG_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}clang-tblgen
321TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et 321TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
322TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config 322TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
323TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen 323TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
324TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags 324TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
325TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert 325TOOL_CTFCONVERT= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfconvert
326TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge 326TOOL_CTFMERGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctfmerge
327TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db 327TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
328TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel 328TOOL_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel
329TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn 329TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
330TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk 330TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
331TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen 331TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
332TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym 332TOOL_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
333TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat 333TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
334TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake 334TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
335# grep exists in src/tools, but is not hooked up into the build. 335# grep exists in src/tools, but is not hooked up into the build.
336#TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep 336#TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep
337TOOL_GREP= grep 337TOOL_GREP= grep
338TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff 338TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
339TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump 339TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
340TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot 340TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
341TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot 341TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot
342TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib 342TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
343TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot 343TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
344TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info 344TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
345TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join 345TOOL_JOIN= ${TOOLDIR}/bin/${_TOOL_PREFIX}join
346TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen 346TOOL_LLVM_TBLGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}llvm-tblgen
347TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4 347TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
348TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff 348TOOL_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
349TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs 349TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
350TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo 350TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
351TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys 351TOOL_MAKEKEYS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makekeys
352TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs 352TOOL_MAKESTRS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makestrs
353TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis 353TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
354TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii 354TOOL_MANDOC_ASCII= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tascii
355TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml 355TOOL_MANDOC_HTML= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Thtml
356TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint 356TOOL_MANDOC_LINT= ${TOOLDIR}/bin/${_TOOL_PREFIX}mandoc -Tlint
357TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage 357TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
358TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc 358TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
359TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout 359TOOL_M68KELF2AOUT= ${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout
360TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff 360TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
361TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper 361TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
362TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb 362TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
363TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale 363TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
364TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file 364TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
365TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod 365TOOL_MKNOD= ${TOOLDIR}/bin/${_TOOL_PREFIX}mknod
366TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp 366TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
367TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage 367TOOL_MKUBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkubootimage
368TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb 368TOOL_ELFTOSB= ${TOOLDIR}/bin/${_TOOL_PREFIX}elftosb
369TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc 369TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
370TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree 370TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
371TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf 371TOOL_NBPERF= ${TOOLDIR}/bin/${_TOOL_PREFIX}perf
372TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs 372TOOL_NCDCS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ibmnws-ncdcs
373TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax 373TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
374TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic 374TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
375TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz 375TOOL_PIGZ= ${TOOLDIR}/bin/${_TOOL_PREFIX}pigz
376TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create 376TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_PREFIX}pkg_create
377TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage 377TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage
378TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb 378TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
379TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer 379TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
380TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff 380TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
381TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 381TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
382TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 382TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
383TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi 383TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
384TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 384TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
385TOOL_ROFF_PS= ${TOOL_GROFF} -Tps 385TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
386TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 386TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
387TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen 387TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
388TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed 388TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
389TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc 389TOOL_SLC= ${TOOLDIR}/bin/${_TOOL_PREFIX}slc
390TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim 390TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
391TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo 391TOOL_SORTINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}sortinfo
392TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc 392TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
393TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat 393TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
394TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile 394TOOL_STRFILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}strfile
395TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel 395TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
396TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl 396TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
397TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic 397TOOL_TIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}tic
398TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode 398TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
399TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f 399TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
400TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr 400TOOL_VFONTEDPR= ${TOOLDIR}/libexec/${_TOOL_PREFIX}vfontedpr
401TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic 401TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
402 402
403.else # USETOOLS != yes # } { 403.else # USETOOLS != yes # } {
404 404
405# Clang supports C, C++ and Objective C 405# Clang supports C, C++ and Objective C
406TOOL_CC.clang= clang 406TOOL_CC.clang= clang
407TOOL_CPP.clang= clang-cpp 407TOOL_CPP.clang= clang-cpp
408TOOL_CXX.clang= clang++ 408TOOL_CXX.clang= clang++
409TOOL_OBJC.clang= clang 409TOOL_OBJC.clang= clang
410 410
411# GCC supports C, C++, Fortran and Objective C 411# GCC supports C, C++, Fortran and Objective C
412TOOL_CC.gcc= gcc 412TOOL_CC.gcc= gcc
413TOOL_CPP.gcc= cpp 413TOOL_CPP.gcc= cpp
414TOOL_CXX.gcc= c++ 414TOOL_CXX.gcc= c++
415TOOL_FC.gcc= g77 415TOOL_FC.gcc= g77
416TOOL_OBJC.gcc= gcc 416TOOL_OBJC.gcc= gcc
417 417
418# PCC supports C and Fortran 418# PCC supports C and Fortran
419TOOL_CC.pcc= pcc 419TOOL_CC.pcc= pcc
420TOOL_CPP.pcc= /usr/libexec/pcpp 420TOOL_CPP.pcc= /usr/libexec/pcpp
421TOOL_CXX.pcc= p++ 421TOOL_CXX.pcc= p++
422 422
423TOOL_AMIGAAOUT2BB= amiga-aout2bb 423TOOL_AMIGAAOUT2BB= amiga-aout2bb
424TOOL_AMIGAELF2BB= amiga-elf2bb 424TOOL_AMIGAELF2BB= amiga-elf2bb
425TOOL_AMIGATXLT= amiga-txlt 425TOOL_AMIGATXLT= amiga-txlt
426TOOL_ASN1_COMPILE= asn1_compile 426TOOL_ASN1_COMPILE= asn1_compile
427TOOL_AWK= awk 427TOOL_AWK= awk
428TOOL_CAP_MKDB= cap_mkdb 428TOOL_CAP_MKDB= cap_mkdb
429TOOL_CAT= cat 429TOOL_CAT= cat
430TOOL_CKSUM= cksum 430TOOL_CKSUM= cksum
431TOOL_CLANG_TBLGEN= clang-tblgen 431TOOL_CLANG_TBLGEN= clang-tblgen
432TOOL_COMPILE_ET= compile_et 432TOOL_COMPILE_ET= compile_et
433TOOL_CONFIG= config 433TOOL_CONFIG= config
434TOOL_CRUNCHGEN= crunchgen 434TOOL_CRUNCHGEN= crunchgen
435TOOL_CTAGS= ctags 435TOOL_CTAGS= ctags
436TOOL_CTFCONVERT= ctfconvert 436TOOL_CTFCONVERT= ctfconvert
437TOOL_CTFMERGE= ctfmerge 437TOOL_CTFMERGE= ctfmerge
438TOOL_DB= db 438TOOL_DB= db
439TOOL_DISKLABEL= disklabel 439TOOL_DISKLABEL= disklabel
440TOOL_EQN= eqn 440TOOL_EQN= eqn
441TOOL_FDISK= fdisk 441TOOL_FDISK= fdisk
442TOOL_FGEN= fgen 442TOOL_FGEN= fgen
443TOOL_GENASSYM= genassym 443TOOL_GENASSYM= genassym
444TOOL_GENCAT= gencat 444TOOL_GENCAT= gencat
445TOOL_GMAKE= gmake 445TOOL_GMAKE= gmake
446TOOL_GREP= grep 446TOOL_GREP= grep
447TOOL_GROFF= groff 447TOOL_GROFF= groff
448TOOL_HEXDUMP= hexdump 448TOOL_HEXDUMP= hexdump
449TOOL_HP300MKBOOT= hp300-mkboot 449TOOL_HP300MKBOOT= hp300-mkboot
450TOOL_HPPAMKBOOT= hppa-mkboot 450TOOL_HPPAMKBOOT= hppa-mkboot
451TOOL_INDXBIB= indxbib 451TOOL_INDXBIB= indxbib
452TOOL_INSTALLBOOT= installboot 452TOOL_INSTALLBOOT= installboot
453TOOL_INSTALL_INFO= install-info 453TOOL_INSTALL_INFO= install-info
454TOOL_JOIN= join 454TOOL_JOIN= join
455TOOL_LLVM_TBLGEN= llvm-tblgen 455TOOL_LLVM_TBLGEN= llvm-tblgen
456TOOL_M4= m4 456TOOL_M4= m4
457TOOL_MACPPCFIXCOFF= macppc-fixcoff 457TOOL_MACPPCFIXCOFF= macppc-fixcoff
458TOOL_MAKEFS= makefs 458TOOL_MAKEFS= makefs
459TOOL_MAKEINFO= makeinfo 459TOOL_MAKEINFO= makeinfo
460TOOL_MAKEKEYS= makekeys 460TOOL_MAKEKEYS= makekeys
461TOOL_MAKESTRS= makestrs 461TOOL_MAKESTRS= makestrs
462TOOL_MAKEWHATIS= /usr/libexec/makewhatis 462TOOL_MAKEWHATIS= /usr/libexec/makewhatis
463TOOL_MANDOC_ASCII= mandoc -Tascii 463TOOL_MANDOC_ASCII= mandoc -Tascii
464TOOL_MANDOC_HTML= mandoc -Thtml 464TOOL_MANDOC_HTML= mandoc -Thtml
465TOOL_MANDOC_LINT= mandoc -Tlint 465TOOL_MANDOC_LINT= mandoc -Tlint
466TOOL_MDSETIMAGE= mdsetimage 466TOOL_MDSETIMAGE= mdsetimage
467TOOL_MENUC= menuc 467TOOL_MENUC= menuc
468TOOL_M68KELF2AOUT= m68k-elf2aout 468TOOL_M68KELF2AOUT= m68k-elf2aout
469TOOL_MIPSELF2ECOFF= mips-elf2ecoff 469TOOL_MIPSELF2ECOFF= mips-elf2ecoff
470TOOL_MKCSMAPPER= mkcsmapper 470TOOL_MKCSMAPPER= mkcsmapper
471TOOL_MKESDB= mkesdb 471TOOL_MKESDB= mkesdb
472TOOL_MKLOCALE= mklocale 472TOOL_MKLOCALE= mklocale
473TOOL_MKMAGIC= file 473TOOL_MKMAGIC= file
474TOOL_MKNOD= mknod 474TOOL_MKNOD= mknod
475TOOL_MKTEMP= mktemp 475TOOL_MKTEMP= mktemp
476TOOL_MKUBOOTIMAGE= mkubootimage 476TOOL_MKUBOOTIMAGE= mkubootimage
477TOOL_ELFTOSB= elftosb 477TOOL_ELFTOSB= elftosb
478TOOL_MSGC= msgc 478TOOL_MSGC= msgc
479TOOL_MTREE= mtree 479TOOL_MTREE= mtree
480TOOL_NBPERF= nbperf 480TOOL_NBPERF= nbperf
481TOOL_NCDCS= ncdcs 481TOOL_NCDCS= ncdcs
482TOOL_PAX= pax 482TOOL_PAX= pax
483TOOL_PIC= pic 483TOOL_PIC= pic
484TOOL_PIGZ= pigz 484TOOL_PIGZ= pigz
485TOOL_PKG_CREATE= pkg_create 485TOOL_PKG_CREATE= pkg_create
486TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage 486TOOL_POWERPCMKBOOTIMAGE= powerpc-mkbootimage
487TOOL_PWD_MKDB= pwd_mkdb 487TOOL_PWD_MKDB= pwd_mkdb
488TOOL_REFER= refer 488TOOL_REFER= refer
489TOOL_ROFF_ASCII= nroff 489TOOL_ROFF_ASCII= nroff
490TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii 490TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii
491TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml 491TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml
492TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi 492TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
493TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html 493TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
494TOOL_ROFF_PS= ${TOOL_GROFF} -Tps 494TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
495TOOL_ROFF_RAW= ${TOOL_GROFF} -Z 495TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
496TOOL_RPCGEN= rpcgen 496TOOL_RPCGEN= rpcgen
497TOOL_SED= sed 497TOOL_SED= sed
498TOOL_SOELIM= soelim 498TOOL_SOELIM= soelim
499TOOL_SORTINFO= sortinfo 499TOOL_SORTINFO= sortinfo
500TOOL_SPARKCRC= sparkcrc 500TOOL_SPARKCRC= sparkcrc
501TOOL_STAT= stat 501TOOL_STAT= stat
502TOOL_STRFILE= strfile 502TOOL_STRFILE= strfile
503TOOL_SUNLABEL= sunlabel 503TOOL_SUNLABEL= sunlabel
504TOOL_TBL= tbl 504TOOL_TBL= tbl
505TOOL_TIC= tic 505TOOL_TIC= tic
506TOOL_UUDECODE= uudecode 506TOOL_UUDECODE= uudecode
507TOOL_VGRIND= vgrind -f 507TOOL_VGRIND= vgrind -f
508TOOL_VFONTEDPR= /usr/libexec/vfontedpr 508TOOL_VFONTEDPR= /usr/libexec/vfontedpr
509TOOL_ZIC= zic 509TOOL_ZIC= zic
510 510
511.endif # USETOOLS != yes # } 511.endif # USETOOLS != yes # }
512 512
513# Fallback to ensure that all variables are defined to something 513# Fallback to ensure that all variables are defined to something
514TOOL_CC.false= false 514TOOL_CC.false= false
515TOOL_CPP.false= false 515TOOL_CPP.false= false
516TOOL_CXX.false= false 516TOOL_CXX.false= false
517TOOL_FC.false= false 517TOOL_FC.false= false
518TOOL_OBJC.false= false 518TOOL_OBJC.false= false
519 519
520AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false 520AVAILABLE_COMPILER?= ${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
521 521
522.for _t in CC CPP CXX FC OBJC 522.for _t in CC CPP CXX FC OBJC
523ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]} 523ACTIVE_${_t}= ${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}
524SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@} 524SUPPORTED_${_t}=${AVAILABLE_COMPILER:Nfalse:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@}
525.endfor 525.endfor
526# make bugs prevent moving this into the .for loop 526# make bugs prevent moving this into the .for loop
527CC= ${TOOL_CC.${ACTIVE_CC}} 527CC= ${TOOL_CC.${ACTIVE_CC}}
528CPP= ${TOOL_CPP.${ACTIVE_CPP}} 528CPP= ${TOOL_CPP.${ACTIVE_CPP}}
529CXX= ${TOOL_CXX.${ACTIVE_CXX}} 529CXX= ${TOOL_CXX.${ACTIVE_CXX}}
530FC= ${TOOL_FC.${ACTIVE_FC}} 530FC= ${TOOL_FC.${ACTIVE_FC}}
531OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}} 531OBJC= ${TOOL_OBJC.${ACTIVE_OBJC}}
532 532
533# Override with tools versions if needed 533# Override with tools versions if needed
534.if ${MKCTF:Uno} != "no" && !defined(NOCTF) 534.if ${MKCTF:Uno} != "no" && !defined(NOCTF)
535CTFCONVERT= ${TOOL_CTFCONVERT} 535CTFCONVERT= ${TOOL_CTFCONVERT}
536CTFMERGE= ${TOOL_CTFMERGE} 536CTFMERGE= ${TOOL_CTFMERGE}
537.endif 537.endif
538 538
539# For each ${MACHINE_CPU}, list the ports that use it. 539# For each ${MACHINE_CPU}, list the ports that use it.
540MACHINES.aarch64= evbarm64 540MACHINES.aarch64= evbarm64
541MACHINES.alpha= alpha 541MACHINES.alpha= alpha
542MACHINES.arm= acorn26 acorn32 cats epoc32 evbarm hpcarm \ 542MACHINES.arm= acorn26 acorn32 cats epoc32 evbarm hpcarm \
543 iyonix netwinder shark zaurus 543 iyonix netwinder shark zaurus
544MACHINES.coldfire= evbcf 544MACHINES.coldfire= evbcf
545MACHINES.i386= i386 545MACHINES.i386= i386
546MACHINES.ia64= ia64 546MACHINES.ia64= ia64
547MACHINES.hppa= hppa 547MACHINES.hppa= hppa
548MACHINES.m68000= sun2 548MACHINES.m68000= sun2
549MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \ 549MACHINES.m68k= amiga atari cesfic hp300 luna68k mac68k \
550 news68k next68k sun3 x68k 550 news68k next68k sun3 x68k
551MACHINES.mips= arc cobalt algor cobalt emips evbmips ews4800mips \ 551MACHINES.mips= arc cobalt algor cobalt emips evbmips ews4800mips \
552 hpcmips mipsco newsmips pmax sbmips sgimips 552 hpcmips mipsco newsmips pmax sbmips sgimips
553MACHINES.or1k= or1k 553MACHINES.or1k= or1k
554MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \ 554MACHINES.powerpc= amigappc bebox evbppc ibmnws macppc mvmeppc \
555 ofppc prep rs6000 sandpoint 555 ofppc prep rs6000 sandpoint
556MACHINES.riscv= riscv 556MACHINES.riscv= riscv
557MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye 557MACHINES.sh3= dreamcast evbsh3 hpcsh landisk mmeye
558MACHINES.sparc= sparc sparc64 558MACHINES.sparc= sparc sparc64
559MACHINES.sparc64= sparc64 559MACHINES.sparc64= sparc64
560MACHINES.vax= vax 560MACHINES.vax= vax
561MACHINES.x86_64= amd64 561MACHINES.x86_64= amd64
562 562
563# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH 563# for crunchide & ldd, define the OBJECT_FMTS used by a MACHINE_ARCH
564# 564#
565OBJECT_FMTS= 565OBJECT_FMTS=
566.if ${MACHINE_ARCH} != "alpha"  566.if ${MACHINE_ARCH} != "alpha"
567OBJECT_FMTS+= elf32 567OBJECT_FMTS+= elf32
568.endif 568.endif
569.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != "" 569.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH:M*64*} != ""
570OBJECT_FMTS+= elf64 570OBJECT_FMTS+= elf64
571.endif 571.endif
572 572
573# OBJCOPY flags to create a.out binaries for old firmware 573# OBJCOPY flags to create a.out binaries for old firmware
574# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc 574# shared among src/distrib and ${MACHINE}/conf/Makefile.${MACHINE}.inc
575.if ${MACHINE_CPU} == "arm" 575.if ${MACHINE_CPU} == "arm"
576OBJCOPY_ELF2AOUT_FLAGS?= \ 576OBJCOPY_ELF2AOUT_FLAGS?= \
577 -O a.out-arm-netbsd \ 577 -O a.out-arm-netbsd \
578 -R .ident \ 578 -R .ident \
579 -R .ARM.attributes \ 579 -R .ARM.attributes \
580 -R .ARM.exidx \ 580 -R .ARM.exidx \
581 -R .ARM.extab \ 581 -R .ARM.extab \
582 -R .arm.atpcs \ 582 -R .arm.atpcs \
583 -R .comment \ 583 -R .comment \
584 -R .debug_abbrev \ 584 -R .debug_abbrev \
585 -R .debug_aranges \ 585 -R .debug_aranges \
586 -R .debug_info \ 586 -R .debug_info \
587 -R .debug_line \ 587 -R .debug_line \
588 -R .debug_frame \ 588 -R .debug_frame \
589 -R .debug_loc \ 589 -R .debug_loc \
590 -R .debug_pubnames \ 590 -R .debug_pubnames \
591 -R .debug_pubtypes \ 591 -R .debug_pubtypes \
592 -R .debug_ranges \ 592 -R .debug_ranges \
593 -R .debug_str \ 593 -R .debug_str \
594 -R .eh_frame \ 594 -R .eh_frame \
595 -R .note.netbsd.ident 595 -R .note.netbsd.ident
596.endif 596.endif
597 597
598# 598#
599# Targets to check if DESTDIR or RELEASEDIR is provided 599# Targets to check if DESTDIR or RELEASEDIR is provided
600# 600#
601.if !target(check_DESTDIR) 601.if !target(check_DESTDIR)
602check_DESTDIR: .PHONY .NOTMAIN 602check_DESTDIR: .PHONY .NOTMAIN
603.if !defined(DESTDIR) 603.if !defined(DESTDIR)
604 @echo "setenv DESTDIR before doing that!" 604 @echo "setenv DESTDIR before doing that!"
605 @false 605 @false
606.else 606.else
607 @true 607 @true
608.endif 608.endif
609.endif 609.endif
610 610
611.if !target(check_RELEASEDIR) 611.if !target(check_RELEASEDIR)
612check_RELEASEDIR: .PHONY .NOTMAIN 612check_RELEASEDIR: .PHONY .NOTMAIN
613.if !defined(RELEASEDIR) 613.if !defined(RELEASEDIR)
614 @echo "setenv RELEASEDIR before doing that!" 614 @echo "setenv RELEASEDIR before doing that!"
615 @false 615 @false
616.else 616.else
617 @true 617 @true
618.endif 618.endif
619.endif 619.endif
620 620
621# 621#
622# Build a dynamically linked /bin and /sbin, with the necessary shared 622# Build a dynamically linked /bin and /sbin, with the necessary shared
623# libraries moved from /usr/lib to /lib and the shared linker moved 623# libraries moved from /usr/lib to /lib and the shared linker moved
624# from /usr/libexec to /lib 624# from /usr/libexec to /lib
625# 625#
626# Note that if the BINDIR is not /bin or /sbin, then we always use the 626# Note that if the BINDIR is not /bin or /sbin, then we always use the
627# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin 627# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
628# and /sbin). See <bsd.shlib.mk>. 628# and /sbin). See <bsd.shlib.mk>.
629# 629#
630MKDYNAMICROOT?= yes 630MKDYNAMICROOT?= yes
631 631
632# 632#
633# Where the system object and source trees are kept; can be configurable 633# Where the system object and source trees are kept; can be configurable
634# by the user in case they want them in ~/foosrc and ~/fooobj (for example). 634# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
635# 635#
636BSDSRCDIR?= /usr/src 636BSDSRCDIR?= /usr/src
637BSDOBJDIR?= /usr/obj 637BSDOBJDIR?= /usr/obj
638NETBSDSRCDIR?= ${BSDSRCDIR} 638NETBSDSRCDIR?= ${BSDSRCDIR}
639 639
640BINGRP?= wheel 640BINGRP?= wheel
641BINOWN?= root 641BINOWN?= root
642BINMODE?= 555 642BINMODE?= 555
643NONBINMODE?= 444 643NONBINMODE?= 444
644 644
645# These are here mainly because we don't want suid root in case 645# These are here mainly because we don't want suid root in case
646# a Makefile defines BINMODE. 646# a Makefile defines BINMODE.
647RUMPBINGRP?= wheel 647RUMPBINGRP?= wheel
648RUMPBINOWN?= root 648RUMPBINOWN?= root
649RUMPBINMODE?= 555 649RUMPBINMODE?= 555
650RUMPNONBINMODE?=444 650RUMPNONBINMODE?=444
651 651
652MANDIR?= /usr/share/man 652MANDIR?= /usr/share/man
653MANGRP?= wheel 653MANGRP?= wheel
654MANOWN?= root 654MANOWN?= root
655MANMODE?= ${NONBINMODE} 655MANMODE?= ${NONBINMODE}
656MANINSTALL?= ${_MANINSTALL} 656MANINSTALL?= ${_MANINSTALL}
657 657
658INFODIR?= /usr/share/info 658INFODIR?= /usr/share/info
659INFOGRP?= wheel 659INFOGRP?= wheel
660INFOOWN?= root 660INFOOWN?= root
661INFOMODE?= ${NONBINMODE} 661INFOMODE?= ${NONBINMODE}
662 662
663LIBDIR?= /usr/lib 663LIBDIR?= /usr/lib
664 664
665LINTLIBDIR?= /usr/libdata/lint 665LINTLIBDIR?= /usr/libdata/lint
666LIBGRP?= ${BINGRP} 666LIBGRP?= ${BINGRP}
667LIBOWN?= ${BINOWN} 667LIBOWN?= ${BINOWN}
668LIBMODE?= ${NONBINMODE} 668LIBMODE?= ${NONBINMODE}
669 669
670DOCDIR?= /usr/share/doc 670DOCDIR?= /usr/share/doc
671DOCGRP?= wheel 671DOCGRP?= wheel
672DOCOWN?= root 672DOCOWN?= root
673DOCMODE?= ${NONBINMODE} 673DOCMODE?= ${NONBINMODE}
674 674
675NLSDIR?= /usr/share/nls 675NLSDIR?= /usr/share/nls
676NLSGRP?= wheel 676NLSGRP?= wheel
677NLSOWN?= root 677NLSOWN?= root
678NLSMODE?= ${NONBINMODE} 678NLSMODE?= ${NONBINMODE}
679 679
680KMODULEGRP?= wheel 680KMODULEGRP?= wheel
681KMODULEOWN?= root 681KMODULEOWN?= root
682KMODULEMODE?= ${NONBINMODE} 682KMODULEMODE?= ${NONBINMODE}
683 683
684LOCALEDIR?= /usr/share/locale 684LOCALEDIR?= /usr/share/locale
685LOCALEGRP?= wheel 685LOCALEGRP?= wheel
686LOCALEOWN?= root 686LOCALEOWN?= root
687LOCALEMODE?= ${NONBINMODE} 687LOCALEMODE?= ${NONBINMODE}
688 688
689FIRMWAREDIR?= /libdata/firmware 689FIRMWAREDIR?= /libdata/firmware
690FIRMWAREGRP?= wheel 690FIRMWAREGRP?= wheel
691FIRMWAREOWN?= root 691FIRMWAREOWN?= root
692FIRMWAREMODE?= ${NONBINMODE} 692FIRMWAREMODE?= ${NONBINMODE}
693 693
694DEBUGDIR?= /usr/libdata/debug 694DEBUGDIR?= /usr/libdata/debug
695DEBUGGRP?= wheel 695DEBUGGRP?= wheel
696DEBUGOWN?= root 696DEBUGOWN?= root
697DEBUGMODE?= ${NONBINMODE} 697DEBUGMODE?= ${NONBINMODE}
698 698
699# 699#
700# Data-driven table using make variables to control how 700# Data-driven table using make variables to control how
701# toolchain-dependent targets and shared libraries are built 701# toolchain-dependent targets and shared libraries are built
702# for different platforms and object formats. 702# for different platforms and object formats.
703# 703#
704# OBJECT_FMT: currently either "ELF" or "a.out". 704# OBJECT_FMT: currently either "ELF" or "a.out".
705# 705#
706# All platforms are ELF. 706# All platforms are ELF.
707# 707#
708OBJECT_FMT= ELF 708OBJECT_FMT= ELF
709 709
710# 710#
711# If this platform's toolchain is missing, we obviously cannot build it. 711# If this platform's toolchain is missing, we obviously cannot build it.
712# 712#
713.if ${TOOLCHAIN_MISSING} != "no" 713.if ${TOOLCHAIN_MISSING} != "no"
714MKBINUTILS:= no 714MKBINUTILS:= no
715MKGDB:= no 715MKGDB:= no
716MKGCC:= no 716MKGCC:= no
717.endif 717.endif
718 718
719# 719#
720# If we are using an external toolchain, we can still build the target's 720# If we are using an external toolchain, we can still build the target's
721# binutils, but we cannot build GCC's support libraries, since those are 721# binutils, but we cannot build GCC's support libraries, since those are
722# tightly-coupled to the version of GCC being used. 722# tightly-coupled to the version of GCC being used.
723# 723#
724.if defined(EXTERNAL_TOOLCHAIN) 724.if defined(EXTERNAL_TOOLCHAIN)
725MKGCC:= no 725MKGCC:= no
726.endif 726.endif
727 727
728# No GDB support for aarch64 728# No GDB support for aarch64
729MKGDB.aarch64= no 729MKGDB.aarch64= no
730MKGDB.or1k= no 730MKGDB.or1k= no
731MKGDB.riscv32= no 731MKGDB.riscv32= no
732MKGDB.riscv64= no 732MKGDB.riscv64= no
733 733
734# No kernel modules for or1k (yet) 734# No kernel modules for or1k (yet)
735MKKMOD.or1k= no 735MKKMOD.or1k= no
736MKKMOD.riscv32= no 736MKKMOD.riscv32= no
737MKKMOD.riscv64= no 737MKKMOD.riscv64= no
738 738
739# No profiling for or1k (yet) 739# No profiling for or1k (yet)
740MKPROFILE.or1k= no 740MKPROFILE.or1k= no
741MKPROFILE.riscv32=no 741MKPROFILE.riscv32=no
742MKPROFILE.riscv64=no 742MKPROFILE.riscv64=no
743 743
744# 744#
745# The m68000 port is incomplete. 745# The m68000 port is incomplete.
746# 746#
747.if ${MACHINE_ARCH} == "m68000" 747.if ${MACHINE_ARCH} == "m68000"
748NOPIC= # defined 748NOPIC= # defined
749MKISCSI= no 749MKISCSI= no
750# XXX GCC 4 outputs mcount() calling sequences that try to load values 750# XXX GCC 4 outputs mcount() calling sequences that try to load values
751# from over 64KB away and this fails to assemble. 751# from over 64KB away and this fails to assemble.
752.if defined(HAVE_GCC) 752.if defined(HAVE_GCC)
753NOPROFILE= # defined 753NOPROFILE= # defined
754.endif 754.endif
755.endif 755.endif
756 756
757# 757#
758# The ia64 port is incomplete. 758# The ia64 port is incomplete.
759# 759#
760MKLINT.ia64= no 760MKLINT.ia64= no
761MKGDB.ia64= no 761MKGDB.ia64= no
762 762
763# 763#
764# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC), 764# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
765# not just shared libraries, so don't build the _pic version. 765# not just shared libraries, so don't build the _pic version.
766# 766#
767.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \ 767.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
768 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb" 768 ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
769MKPICLIB:= no 769MKPICLIB:= no
770.endif 770.endif
771 771
772# PowerPC64 and AArch64 ABI's are PIC 772# PowerPC64 and AArch64 ABI's are PIC
773MKPICLIB.powerpc64= no 773MKPICLIB.powerpc64= no
774#MKPICLIB.aarch64= no 774#MKPICLIB.aarch64= no
775 775
776# 776#
777# On VAX using ELF, all objects are PIC, not just shared libraries, 777# On VAX using ELF, all objects are PIC, not just shared libraries,
778# so don't build the _pic version. 778# so don't build the _pic version.
779# 779#
780MKPICLIB.vax= no 780MKPICLIB.vax= no
781 781
782# 782#
783# Location of the file that contains the major and minor numbers of the 783# Location of the file that contains the major and minor numbers of the
784# version of a shared library. If this file exists a shared library 784# version of a shared library. If this file exists a shared library
785# will be built by <bsd.lib.mk>. 785# will be built by <bsd.lib.mk>.
786# 786#
787SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version 787SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
788 788
789# 789#
790# GNU sources and packages sometimes see architecture names differently. 790# GNU sources and packages sometimes see architecture names differently.
791# 791#
792GNU_ARCH.aarch64eb=aarch64_be 792GNU_ARCH.aarch64eb=aarch64_be
793GNU_ARCH.coldfire=m5407 793GNU_ARCH.coldfire=m5407
794GNU_ARCH.earm=arm 794GNU_ARCH.earm=arm
795GNU_ARCH.earmhf=arm 795GNU_ARCH.earmhf=arm
796GNU_ARCH.earmeb=armeb 796GNU_ARCH.earmeb=armeb
797GNU_ARCH.earmhfeb=armeb 797GNU_ARCH.earmhfeb=armeb
798GNU_ARCH.earmv4=armv4 798GNU_ARCH.earmv4=armv4
799GNU_ARCH.earmv4eb=armv4eb 799GNU_ARCH.earmv4eb=armv4eb
800GNU_ARCH.earmv5=arm 800GNU_ARCH.earmv5=arm
801GNU_ARCH.earmv5eb=armeb 801GNU_ARCH.earmv5eb=armeb
802GNU_ARCH.earmv6=armv6 802GNU_ARCH.earmv6=armv6
803GNU_ARCH.earmv6hf=armv6 803GNU_ARCH.earmv6hf=armv6
804GNU_ARCH.earmv6eb=armv6eb 804GNU_ARCH.earmv6eb=armv6eb
805GNU_ARCH.earmv6hfeb=armv6eb 805GNU_ARCH.earmv6hfeb=armv6eb
806GNU_ARCH.earmv7=armv7 806GNU_ARCH.earmv7=armv7
807GNU_ARCH.earmv7hf=armv7 807GNU_ARCH.earmv7hf=armv7
808GNU_ARCH.earmv7eb=armv7eb 808GNU_ARCH.earmv7eb=armv7eb
809GNU_ARCH.earmv7hfeb=armv7eb 809GNU_ARCH.earmv7hfeb=armv7eb
810GNU_ARCH.i386=i486 810GNU_ARCH.i386=i486
811GCC_CONFIG_ARCH.i386=i486 811GCC_CONFIG_ARCH.i386=i486
812GCC_CONFIG_TUNE.i386=nocona 812GCC_CONFIG_TUNE.i386=nocona
813GCC_CONFIG_TUNE.x86_64=nocona 813GCC_CONFIG_TUNE.x86_64=nocona
814GNU_ARCH.m68000=m68010 814GNU_ARCH.m68000=m68010
815GNU_ARCH.sh3eb=sh 815GNU_ARCH.sh3eb=sh
816GNU_ARCH.sh3el=shle 816GNU_ARCH.sh3el=shle
817GNU_ARCH.mips64eb=mips64 817GNU_ARCH.mips64eb=mips64
818MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}} 818MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
819 819
820# 820#
821# In order to identify NetBSD to GNU packages, we sometimes need 821# In order to identify NetBSD to GNU packages, we sometimes need
822# an "elf" tag for historically a.out platforms. 822# an "elf" tag for historically a.out platforms.
823# 823#
824.if (!empty(MACHINE_ARCH:Mearm*)) 824.if (!empty(MACHINE_ARCH:Mearm*))
825MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/} 825MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf-${MACHINE_ARCH:C/eb//:C/v[4-7]//:S/earm/eabi/}
826.elif (${MACHINE_GNU_ARCH} == "arm" || \ 826.elif (${MACHINE_GNU_ARCH} == "arm" || \
827 ${MACHINE_GNU_ARCH} == "armeb" || \ 827 ${MACHINE_GNU_ARCH} == "armeb" || \
828 ${MACHINE_ARCH} == "i386" || \ 828 ${MACHINE_ARCH} == "i386" || \
829 ${MACHINE_CPU} == "m68k" || \ 829 ${MACHINE_CPU} == "m68k" || \
830 ${MACHINE_GNU_ARCH} == "sh" || \ 830 ${MACHINE_GNU_ARCH} == "sh" || \
831 ${MACHINE_GNU_ARCH} == "shle" || \ 831 ${MACHINE_GNU_ARCH} == "shle" || \
832 ${MACHINE_ARCH} == "sparc" || \ 832 ${MACHINE_ARCH} == "sparc" || \
833 ${MACHINE_ARCH} == "vax") 833 ${MACHINE_ARCH} == "vax")
834MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf 834MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
835.else 835.else
836MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd 836MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
837.endif 837.endif
838 838
839.if !empty(MACHINE_ARCH:M*arm*) 839.if !empty(MACHINE_ARCH:M*arm*)
840# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand. 840# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
841ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft 841ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
842ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :} 842ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
843ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :} 843ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
844.endif 844.endif
845 845
846GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :} 846GENASSYM_CPPFLAGS+= ${${ACTIVE_CC} == "clang":? -no-integrated-as :}
847 847
848TARGETS+= all clean cleandir depend dependall includes \ 848TARGETS+= all clean cleandir depend dependall includes \
849 install lint obj regress tags html analyze describe \ 849 install lint obj regress tags html analyze describe \
850 rumpdescribe 850 rumpdescribe
851PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \ 851PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
852 install lint obj regress beforedepend afterdepend \ 852 install lint obj regress beforedepend afterdepend \
853 beforeinstall afterinstall realinstall realdepend realall \ 853 beforeinstall afterinstall realinstall realdepend realall \
854 html subdir-all subdir-install subdir-depend analyze describe \ 854 html subdir-all subdir-install subdir-depend analyze describe \
855 rumpdescribe 855 rumpdescribe
856.PHONY: ${PHONY_NOTMAIN} 856.PHONY: ${PHONY_NOTMAIN}
857.NOTMAIN: ${PHONY_NOTMAIN} 857.NOTMAIN: ${PHONY_NOTMAIN}
858 858
859.if ${NEED_OWN_INSTALL_TARGET} != "no" 859.if ${NEED_OWN_INSTALL_TARGET} != "no"
860.if !target(install) 860.if !target(install)
861install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall 861install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
862beforeinstall: 862beforeinstall:
863subdir-install: 863subdir-install:
864realinstall: 864realinstall:
865afterinstall: 865afterinstall:
866.endif 866.endif
867all: realall subdir-all 867all: realall subdir-all
868subdir-all: 868subdir-all:
869realall: 869realall:
870depend: realdepend subdir-depend 870depend: realdepend subdir-depend
871subdir-depend: 871subdir-depend:
872realdepend: 872realdepend:
873distclean: cleandir 873distclean: cleandir
874cleandir: clean 874cleandir: clean
875 875
876dependall: .NOTMAIN realdepend .MAKE 876dependall: .NOTMAIN realdepend .MAKE
877 @cd "${.CURDIR}"; ${MAKE} realall 877 @cd "${.CURDIR}"; ${MAKE} realall
878.endif 878.endif
879 879
880# 880#
881# Define MKxxx variables (which are either yes or no) for users 881# Define MKxxx variables (which are either yes or no) for users
882# to set in /etc/mk.conf and override in the make environment. 882# to set in /etc/mk.conf and override in the make environment.
883# These should be tested with `== "no"' or `!= "no"'. 883# These should be tested with `== "no"' or `!= "no"'.
884# The NOxxx variables should only be set by Makefiles. 884# The NOxxx variables should only be set by Makefiles.
885# 885#
886# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync 886# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
887# with changes to the MK* variables here. 887# with changes to the MK* variables here.
888# 888#
889 889
890# 890#
891# Supported NO* options (if defined, MK* will be forced to "no", 891# Supported NO* options (if defined, MK* will be forced to "no",
892# regardless of user's mk.conf setting). 892# regardless of user's mk.conf setting).
893# 893#
894# Source makefiles should set NO*, and not MK*, and must do so before 894# Source makefiles should set NO*, and not MK*, and must do so before
895# including bsd.own.mk. 895# including bsd.own.mk.
896# 896#
897.for var in \ 897.for var in \
898 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \ 898 NOCRYPTO NODOC NOHTML NOINFO NOLINKLIB NOLINT NOMAN NONLS NOOBJ NOPIC \
899 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB 899 NOPICINSTALL NOPROFILE NOSHARE NOSTATICLIB
900.if defined(${var}) 900.if defined(${var})
901MK${var:S/^NO//}:= no 901MK${var:S/^NO//}:= no
902.endif 902.endif
903.endfor 903.endfor
904 904
905# 905#
906# Older-style variables that enabled behaviour when set. 906# Older-style variables that enabled behaviour when set.
907# 907#
908.for var in MANZ UNPRIVED UPDATE 908.for var in MANZ UNPRIVED UPDATE
909.if defined(${var}) 909.if defined(${var})
910MK${var}:= yes 910MK${var}:= yes
911.endif 911.endif
912.endfor 912.endfor
913 913
914# 914#
915# MK* options which have variable defaults. 915# MK* options which have variable defaults.
916# 916#
917.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \ 917.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" \
918 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \ 918 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
919 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_CPU} == "aarch64" \ 919 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_CPU} == "aarch64" \
920 || ${MACHINE_ARCH} == "riscv64" \ 920 || ${MACHINE_ARCH} == "riscv64" \
921 || !empty(MACHINE_ARCH:Mearm*) 921 || !empty(MACHINE_ARCH:Mearm*)
922MKCOMPAT?= yes 922MKCOMPAT?= yes
923.else 923.else
924# Don't let this build where it really isn't supported. 924# Don't let this build where it really isn't supported.
925MKCOMPAT:= no 925MKCOMPAT:= no
926MKCOMPATTESTS:= no 926MKCOMPATTESTS:= no
927MKCOMPATX11:= no 927MKCOMPATX11:= no
928.endif 928.endif
929 929
930.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \ 930.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \
931 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \ 931 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
932 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc") 932 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
933MKCOMPATMODULES?= yes 933MKCOMPATMODULES?= yes
934.else 934.else
935MKCOMPATMODULES:= no 935MKCOMPATMODULES:= no
936.endif 936.endif
937 937
938# 938#
939# Default mips64 to softfloat now. 939# Default mips64 to softfloat now.
940# arm is always softfloat unless it isn't 940# arm is always softfloat unless it isn't
941# emips is always softfloat. 941# emips is always softfloat.
942# coldfire is always softfloat 942# coldfire is always softfloat
943# or1k is always softfloat 943# or1k is always softfloat
944# 944#
945.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \ 945.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" || \
946 (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \ 946 (${MACHINE_CPU} == "arm" && ${MACHINE_ARCH:M*hf*} == "") || \
947 ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \ 947 ${MACHINE_ARCH} == "coldfire" || ${MACHINE_CPU} == "or1k" || \
948 ${MACHINE} == "emips" 948 ${MACHINE} == "emips"
949MKSOFTFLOAT?= yes 949MKSOFTFLOAT?= yes
950.endif 950.endif
951 951
952.if ${MACHINE} == "emips" 952.if ${MACHINE} == "emips"
953SOFTFLOAT_BITS= 32 953SOFTFLOAT_BITS= 32
954.endif 954.endif
955 955
956.if ${MACHINE_ARCH} == "i386" || \ 956.if ${MACHINE_ARCH} == "i386" || \
957 ${MACHINE_ARCH} == "x86_64" || \ 957 ${MACHINE_ARCH} == "x86_64" || \
958 ${MACHINE_ARCH} == "sparc"  958 ${MACHINE_ARCH} == "sparc"
959MKSLJIT?= yes 959MKSLJIT?= yes
960.else 960.else
961MKSLJIT?= no 961MKSLJIT?= no
962.endif 962.endif
963 963
964# 964#
965# MK* backward compatibility. 965# MK* backward compatibility.
966# 966#
967.if defined(MKBFD) 967.if defined(MKBFD)
968MKBINUTILS?= ${MKBFD} 968MKBINUTILS?= ${MKBFD}
969.endif 969.endif
970 970
971# 971#
972# We want to build zfs only for amd64 by default for now. 972# We want to build zfs only for amd64 by default for now.
973# 973#
974.if ${MACHINE} == "amd64" 974.if ${MACHINE} == "amd64"
975MKZFS?= yes 975MKZFS?= yes
976.endif 976.endif
977 977
978# 978#
 979# DTrace works on amd64, i386 and earm*
 980#
 981
 982.if ${MACHINE_ARCH} == "i386" || \
 983 ${MACHINE_ARCH} == "x86_64" || \
 984 !empty(MACHINE_ARCH:Mearm*)
 985MKDTRACE?= yes
 986MKCTF?= yes
 987.endif
 988#
979# MK* options which default to "yes". 989# MK* options which default to "yes".
980# 990#
981_MKVARS.yes= \ 991_MKVARS.yes= \
982 MKATF \ 992 MKATF \
983 MKBINUTILS \ 993 MKBINUTILS \
984 MKCRYPTO MKCOMPLEX MKCVS MKCXX \ 994 MKCRYPTO MKCOMPLEX MKCVS MKCXX \
985 MKDOC \ 995 MKDOC \
986 MKGCC MKGDB MKGROFF \ 996 MKGCC MKGDB MKGROFF \
987 MKHESIOD MKHTML \ 997 MKHESIOD MKHTML \
988 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \ 998 MKIEEEFP MKINET6 MKINFO MKIPFILTER MKISCSI \
989 MKKERBEROS \ 999 MKKERBEROS \
990 MKKMOD \ 1000 MKKMOD \
991 MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \ 1001 MKLDAP MKLIBSTDCXX MKLINKLIB MKLVM \
992 MKMAN MKMANDOC \ 1002 MKMAN MKMANDOC \
993 MKMDNS \ 1003 MKMDNS \
994 MKMAKEMANDB \ 1004 MKMAKEMANDB \
995 MKNLS \ 1005 MKNLS \
996 MKNPF \ 1006 MKNPF \
997 MKOBJ \ 1007 MKOBJ \
998 MKPAM MKPERFUSE \ 1008 MKPAM MKPERFUSE \
999 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \ 1009 MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
1000 MKRUMP \ 1010 MKRUMP \
1001 MKSHARE MKSKEY MKSTATICLIB \ 1011 MKSHARE MKSKEY MKSTATICLIB \
1002 MKX11FONTS \ 1012 MKX11FONTS \
1003 MKYP 1013 MKYP
1004.for var in ${_MKVARS.yes} 1014.for var in ${_MKVARS.yes}
1005${var}?= ${${var}.${MACHINE_ARCH}:Uyes} 1015${var}?= ${${var}.${MACHINE_ARCH}:Uyes}
1006.endfor 1016.endfor
1007 1017
1008# 1018#
1009# MKGCCCMDS is only valid if we are building GCC so make it dependent on that. 1019# MKGCCCMDS is only valid if we are building GCC so make it dependent on that.
1010# 1020#
1011_MKVARS.yes += MKGCCCMDS 1021_MKVARS.yes += MKGCCCMDS
1012MKGCCCMDS?= ${MKGCC} 1022MKGCCCMDS?= ${MKGCC}
1013 1023
1014# 1024#
1015# Exceptions to the above: 1025# Exceptions to the above:
1016# 1026#
1017.if ${MACHINE} == "acorn26" # page size is prohibitive 1027.if ${MACHINE} == "acorn26" # page size is prohibitive
1018MKKMOD= no 1028MKKMOD= no
1019.endif 1029.endif
1020 1030
1021# 1031#
1022# MK* options which default to "no". Note that MKZFS has a different 1032# MK* options which default to "no". Note that MKZFS has a different
1023# default for some platforms, see above. 1033# default for some platforms, see above.
1024# 1034#
1025_MKVARS.no= \ 1035_MKVARS.no= \
1026 MKBSDGREP MKBSDTAR \ 1036 MKBSDGREP MKBSDTAR \
1027 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF MKDEBUG \ 1037 MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCRYPTO_RC5 MKCTF MKDEBUG \
1028 MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \ 1038 MKDEBUGLIB MKDTRACE MKEXTSRC MKGROFFHTMLDOC \
1029 MKKYUA MKLLD MKLLDB MKLINT \ 1039 MKKYUA MKLLD MKLLDB MKLINT \
1030 MKMANZ MKMCLINKER MKOBJDIRS \ 1040 MKMANZ MKMCLINKER MKOBJDIRS \
1031 MKLIBCXX MKLLVM MKPCC \ 1041 MKLIBCXX MKLLVM MKPCC \
1032 MKPIGZGZIP \ 1042 MKPIGZGZIP \
1033 MKREPRO \ 1043 MKREPRO \
1034 MKSOFTFLOAT MKSTRIPIDENT MKTPM \ 1044 MKSOFTFLOAT MKSTRIPIDENT MKTPM \
1035 MKUNPRIVED MKUPDATE MKX11 MKX11MOTIF MKZFS 1045 MKUNPRIVED MKUPDATE MKX11 MKX11MOTIF MKZFS
1036.for var in ${_MKVARS.no} 1046.for var in ${_MKVARS.no}
1037${var}?= ${${var}.${MACHINE_ARCH}:Uno} 1047${var}?= ${${var}.${MACHINE_ARCH}:Uno}
1038.endfor 1048.endfor
1039 1049
1040# 1050#
1041# Which platforms build the xorg-server drivers (as opposed 1051# Which platforms build the xorg-server drivers (as opposed
1042# to just Xnest and Xvfb.) 1052# to just Xnest and Xvfb.)
1043# 1053#
1044.if ${MACHINE} == "alpha" || \ 1054.if ${MACHINE} == "alpha" || \
1045 ${MACHINE} == "amd64" || \ 1055 ${MACHINE} == "amd64" || \
1046 ${MACHINE} == "amiga" || \ 1056 ${MACHINE} == "amiga" || \
1047 ${MACHINE} == "bebox" || \ 1057 ${MACHINE} == "bebox" || \
1048 ${MACHINE} == "cats" || \ 1058 ${MACHINE} == "cats" || \
1049 ${MACHINE} == "dreamcast" || \ 1059 ${MACHINE} == "dreamcast" || \
1050 ${MACHINE} == "ews4800mips" || \ 1060 ${MACHINE} == "ews4800mips" || \
1051 ${MACHINE} == "evbarm" || \ 1061 ${MACHINE} == "evbarm" || \
1052 ${MACHINE} == "evbmips" || \ 1062 ${MACHINE} == "evbmips" || \
1053 ${MACHINE} == "hp300" || \ 1063 ${MACHINE} == "hp300" || \
1054 ${MACHINE} == "hpcarm" || \ 1064 ${MACHINE} == "hpcarm" || \
1055 ${MACHINE} == "hpcmips" || \ 1065 ${MACHINE} == "hpcmips" || \
1056 ${MACHINE} == "hpcsh" || \ 1066 ${MACHINE} == "hpcsh" || \
1057 ${MACHINE} == "i386" || \ 1067 ${MACHINE} == "i386" || \
1058 ${MACHINE} == "ibmnws" || \ 1068 ${MACHINE} == "ibmnws" || \
1059 ${MACHINE} == "luna68k" || \ 1069 ${MACHINE} == "luna68k" || \
1060 ${MACHINE} == "mac68k" || \ 1070 ${MACHINE} == "mac68k" || \
1061 ${MACHINE} == "macppc" || \ 1071 ${MACHINE} == "macppc" || \
1062 ${MACHINE} == "netwinder" || \ 1072 ${MACHINE} == "netwinder" || \
1063 ${MACHINE} == "newsmips" || \ 1073 ${MACHINE} == "newsmips" || \
1064 ${MACHINE} == "prep" || \ 1074 ${MACHINE} == "prep" || \
1065 ${MACHINE} == "ofppc" || \ 1075 ${MACHINE} == "ofppc" || \
1066 ${MACHINE} == "sgimips" || \ 1076 ${MACHINE} == "sgimips" || \
1067 ${MACHINE} == "shark" || \ 1077 ${MACHINE} == "shark" || \
1068 ${MACHINE} == "sparc" || \ 1078 ${MACHINE} == "sparc" || \
1069 ${MACHINE} == "sparc64" || \ 1079 ${MACHINE} == "sparc64" || \
1070 ${MACHINE} == "vax" || \ 1080 ${MACHINE} == "vax" || \
1071 ${MACHINE} == "zaurus" 1081 ${MACHINE} == "zaurus"
1072MKXORG_SERVER?=yes 1082MKXORG_SERVER?=yes
1073.else 1083.else
1074MKXORG_SERVER?=no 1084MKXORG_SERVER?=no
1075.endif 1085.endif
1076 1086
1077# 1087#
1078# Force some options off if their dependencies are off. 1088# Force some options off if their dependencies are off.
1079# 1089#
1080 1090
1081.if ${MKCXX} == "no" 1091.if ${MKCXX} == "no"
1082MKATF:= no 1092MKATF:= no
1083MKGROFF:= no 1093MKGROFF:= no
1084MKKYUA:= no 1094MKKYUA:= no
1085.endif 1095.endif
1086 1096
1087.if ${MKCRYPTO} == "no" 1097.if ${MKCRYPTO} == "no"
1088MKKERBEROS:= no 1098MKKERBEROS:= no
1089MKLDAP:= no 1099MKLDAP:= no
1090.endif 1100.endif
1091 1101
1092.if ${MKMAN} == "no" 1102.if ${MKMAN} == "no"
1093MKCATPAGES:= no 1103MKCATPAGES:= no
1094MKHTML:= no 1104MKHTML:= no
1095.endif 1105.endif
1096 1106
1097_MANINSTALL= maninstall 1107_MANINSTALL= maninstall
1098.if ${MKCATPAGES} != "no" 1108.if ${MKCATPAGES} != "no"
1099_MANINSTALL+= catinstall 1109_MANINSTALL+= catinstall
1100.endif 1110.endif
1101.if ${MKHTML} != "no" 1111.if ${MKHTML} != "no"
1102_MANINSTALL+= htmlinstall 1112_MANINSTALL+= htmlinstall
1103.endif 1113.endif
1104 1114
1105.if ${MKLINKLIB} == "no" 1115.if ${MKLINKLIB} == "no"
1106MKLINT:= no 1116MKLINT:= no
1107MKPICINSTALL:= no 1117MKPICINSTALL:= no
1108MKPROFILE:= no 1118MKPROFILE:= no
1109.endif 1119.endif
1110 1120
1111.if ${MKPIC} == "no" 1121.if ${MKPIC} == "no"
1112MKPICLIB:= no 1122MKPICLIB:= no
1113.endif 1123.endif
1114 1124
1115.if ${MKOBJ} == "no" 1125.if ${MKOBJ} == "no"
1116MKOBJDIRS:= no 1126MKOBJDIRS:= no
1117.endif 1127.endif
1118 1128
1119.if ${MKSHARE} == "no" 1129.if ${MKSHARE} == "no"
1120MKCATPAGES:= no 1130MKCATPAGES:= no
1121MKDOC:= no 1131MKDOC:= no
1122MKINFO:= no 1132MKINFO:= no
1123MKHTML:= no 1133MKHTML:= no
1124MKMAN:= no 1134MKMAN:= no
1125MKNLS:= no 1135MKNLS:= no
1126.endif 1136.endif
1127 1137
1128.if !empty(MACHINE_ARCH:Mearm*) 1138.if !empty(MACHINE_ARCH:Mearm*)
1129_NEEDS_LIBCXX.${MACHINE_ARCH}= yes 1139_NEEDS_LIBCXX.${MACHINE_ARCH}= yes
1130.endif 1140.endif
1131_NEEDS_LIBCXX.i386= yes 1141_NEEDS_LIBCXX.i386= yes
1132_NEEDS_LIBCXX.powerpc= yes 1142_NEEDS_LIBCXX.powerpc= yes
1133_NEEDS_LIBCXX.powerpc64= yes 1143_NEEDS_LIBCXX.powerpc64= yes
1134_NEEDS_LIBCXX.x86_64= yes 1144_NEEDS_LIBCXX.x86_64= yes
1135_NEEDS_LIBCXX.aarch64= yes 1145_NEEDS_LIBCXX.aarch64= yes
1136 1146
1137.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes" 1147.if ${MKLLVM} == "yes" && ${_NEEDS_LIBCXX.${MACHINE_ARCH}:Uno} == "yes"
1138MKLIBCXX:= yes 1148MKLIBCXX:= yes
1139.endif 1149.endif
1140 1150
1141# 1151#
1142# install(1) parameters. 1152# install(1) parameters.
1143# 1153#
1144COPY?= -c 1154COPY?= -c
1145.if ${MKUPDATE} == "no" 1155.if ${MKUPDATE} == "no"
1146PRESERVE?=  1156PRESERVE?=
1147.else 1157.else
1148PRESERVE?= -p 1158PRESERVE?= -p
1149.endif 1159.endif
1150RENAME?= -r 1160RENAME?= -r
1151HRDLINK?= -l h 1161HRDLINK?= -l h
1152SYMLINK?= -l s 1162SYMLINK?= -l s
1153 1163
1154METALOG?= ${DESTDIR}/METALOG 1164METALOG?= ${DESTDIR}/METALOG
1155METALOG.add?= ${TOOL_CAT} -l >> ${METALOG} 1165METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
1156.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR} 1166.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
1157.if ${MKUNPRIVED} != "no" 1167.if ${MKUNPRIVED} != "no"
1158INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256 1168INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR} -h sha256
1159.else 1169.else
1160INSTPRIV.unpriv= 1170INSTPRIV.unpriv=
1161.endif 1171.endif
1162INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc 1172INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
1163.endif 1173.endif
1164STRIPFLAG?=  1174STRIPFLAG?=
1165 1175
1166.if ${NEED_OWN_INSTALL_TARGET} != "no" 1176.if ${NEED_OWN_INSTALL_TARGET} != "no"
1167INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d 1177INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
1168INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME} 1178INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
1169INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME} 1179INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
1170INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME} 1180INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
1171.endif 1181.endif
1172 1182
1173# 1183#
1174# Set defaults for the USE_xxx variables. 1184# Set defaults for the USE_xxx variables.
1175# 1185#
1176 1186
1177# 1187#
1178# USE_* options which default to "no" and will be forced to "no" if their 1188# USE_* options which default to "no" and will be forced to "no" if their
1179# corresponding MK* variable is set to "no". 1189# corresponding MK* variable is set to "no".
1180# 1190#
1181.for var in USE_SKEY 1191.for var in USE_SKEY
1182.if (${${var:S/USE_/MK/}} == "no") 1192.if (${${var:S/USE_/MK/}} == "no")
1183${var}:= no 1193${var}:= no
1184.else 1194.else
1185${var}?= no 1195${var}?= no
1186.endif 1196.endif
1187.endfor 1197.endfor
1188 1198
1189# 1199#
1190# USE_* options which default to "yes" unless their corresponding MK* 1200# USE_* options which default to "yes" unless their corresponding MK*
1191# variable is set to "no". 1201# variable is set to "no".
1192# 1202#
1193.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP 1203.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP
1194.if (${${var:S/USE_/MK/}} == "no") 1204.if (${${var:S/USE_/MK/}} == "no")
1195${var}:= no 1205${var}:= no
1196.else 1206.else
1197${var}?= yes 1207${var}?= yes
1198.endif 1208.endif
1199.endfor 1209.endfor
1200 1210
1201# 1211#
1202# USE_* options which default to "yes". 1212# USE_* options which default to "yes".
1203# 1213#
1204.for var in USE_JEMALLOC 1214.for var in USE_JEMALLOC
1205${var}?= yes 1215${var}?= yes
1206.endfor 1216.endfor
1207 1217
1208# 1218#
1209# USE_* options which default to "no". 1219# USE_* options which default to "no".
1210# 1220#
1211# For now, disable pigz as compressor by default 1221# For now, disable pigz as compressor by default
1212.for var in USE_PIGZGZIP USE_LIBTRE 1222.for var in USE_PIGZGZIP USE_LIBTRE
1213${var}?= no 1223${var}?= no
1214.endfor 1224.endfor
1215 1225
1216# 1226#
1217# TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip. 1227# TOOL_GZIP and friends. These might refer to TOOL_PIGZ or to the host gzip.
1218# 1228#
1219.if ${USE_PIGZGZIP} != "no" 1229.if ${USE_PIGZGZIP} != "no"
1220TOOL_GZIP= ${TOOL_PIGZ} 1230TOOL_GZIP= ${TOOL_PIGZ}
1221GZIP_N_FLAG?= -nT 1231GZIP_N_FLAG?= -nT
1222.else 1232.else
1223TOOL_GZIP= gzip 1233TOOL_GZIP= gzip
1224GZIP_N_FLAG?= -n 1234GZIP_N_FLAG?= -n
1225.endif 1235.endif
1226TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG} 1236TOOL_GZIP_N= ${TOOL_GZIP} ${GZIP_N_FLAG}
1227 1237
1228# 1238#
1229# Where X11 sources are and where it is installed to. 1239# Where X11 sources are and where it is installed to.
1230# 1240#
1231.if !defined(X11SRCDIR) 1241.if !defined(X11SRCDIR)
1232.if exists(${NETBSDSRCDIR}/../xsrc) 1242.if exists(${NETBSDSRCDIR}/../xsrc)
1233X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd 1243X11SRCDIR!= cd "${NETBSDSRCDIR}/../xsrc" && pwd
1234.else 1244.else
1235X11SRCDIR= /usr/xsrc 1245X11SRCDIR= /usr/xsrc
1236.endif 1246.endif
1237.endif # !defined(X11SRCDIR) 1247.endif # !defined(X11SRCDIR)
1238 1248
1239X11SRCDIR.local?= ${X11SRCDIR}/local 1249X11SRCDIR.local?= ${X11SRCDIR}/local
1240X11ROOTDIR?= /usr/X11R7 1250X11ROOTDIR?= /usr/X11R7
1241X11BINDIR?= ${X11ROOTDIR}/bin 1251X11BINDIR?= ${X11ROOTDIR}/bin
1242X11ETCDIR?= /etc/X11 1252X11ETCDIR?= /etc/X11
1243X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts 1253X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
1244X11INCDIR?= ${X11ROOTDIR}/include 1254X11INCDIR?= ${X11ROOTDIR}/include
1245X11LIBDIR?= ${X11ROOTDIR}/lib/X11 1255X11LIBDIR?= ${X11ROOTDIR}/lib/X11
1246X11MANDIR?= ${X11ROOTDIR}/man 1256X11MANDIR?= ${X11ROOTDIR}/man
1247X11SHAREDIR?= ${X11ROOTDIR}/share 1257X11SHAREDIR?= ${X11ROOTDIR}/share
1248X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}} 1258X11USRLIBDIR?= ${X11ROOTDIR}/lib${MLIBDIR:D/${MLIBDIR}}
1249 1259
1250# 1260#
1251# New modular-xorg based builds 1261# New modular-xorg based builds
1252# 1262#
1253X11SRCDIRMIT?= ${X11SRCDIR}/external/mit 1263X11SRCDIRMIT?= ${X11SRCDIR}/external/mit
1254.for _lib in \ 1264.for _lib in \
1255 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \ 1265 FS ICE SM X11 XScrnSaver XTrap Xau Xcomposite Xcursor Xdamage \
1256 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpresent Xpm \ 1266 Xdmcp Xevie Xext Xfixes Xfont Xft Xi Xinerama Xmu Xpresent Xpm \
1257 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \ 1267 Xrandr Xrender Xres Xt Xtst Xv XvMC Xxf86dga Xxf86misc Xxf86vm drm \
1258 fontenc xkbfile xkbui Xaw Xfontcache pciaccess xcb \ 1268 fontenc xkbfile xkbui Xaw Xfontcache pciaccess xcb \
1259 pthread-stubs 1269 pthread-stubs
1260X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist 1270X11SRCDIR.${_lib}?= ${X11SRCDIRMIT}/lib${_lib}/dist
1261.endfor 1271.endfor
1262 1272
1263.for _proto in \ 1273.for _proto in \
1264 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \ 1274 xcmisc xext xf86bigfont bigreqs input kb x fonts fixes scrnsaver \
1265 xinerama dri2 dri3 render resource record video xf86dga xf86misc \ 1275 xinerama dri2 dri3 render resource record video xf86dga xf86misc \
1266 xf86vidmode composite damage trap gl randr fontcache xf86dri \ 1276 xf86vidmode composite damage trap gl randr fontcache xf86dri \
1267 present xcb- 1277 present xcb-
1268X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist 1278X11SRCDIR.${_proto}proto?= ${X11SRCDIRMIT}/${_proto}proto/dist
1269.endfor 1279.endfor
1270 1280
1271.for _dir in \ 1281.for _dir in \
1272 xtrans fontconfig freetype evieext mkfontscale bdftopcf \ 1282 xtrans fontconfig freetype evieext mkfontscale bdftopcf \
1273 xkbcomp xorg-cf-files imake xorg-server xbiff xkeyboard-config \ 1283 xkbcomp xorg-cf-files imake xorg-server xbiff xkeyboard-config \
1274 xbitmaps appres xeyes xev xedit sessreg pixman \ 1284 xbitmaps appres xeyes xev xedit sessreg pixman \
1275 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \ 1285 beforelight bitmap editres makedepend fonttosfnt fslsfonts fstobdf \
1276 glu glw mesa-demos MesaGLUT MesaLib MesaLib7 \ 1286 glu glw mesa-demos MesaGLUT MesaLib MesaLib7 \
1277 ico iceauth listres lndir \ 1287 ico iceauth listres lndir \
1278 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \ 1288 luit xproxymanagementprotocol mkfontdir oclock proxymngr rgb \
1279 rstart setxkbmap showfont smproxy twm viewres \ 1289 rstart setxkbmap showfont smproxy twm viewres \
1280 x11perf xauth xcalc xclipboard \ 1290 x11perf xauth xcalc xclipboard \
1281 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \ 1291 xclock xcmsdb xconsole xditview xdpyinfo xdriinfo xdm \
1282 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \ 1292 xfd xf86dga xfindproxy xfontsel xfwp xgamma xgc xhost xinit \
1283 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \ 1293 xkill xload xlogo xlsatoms xlsclients xlsfonts xmag xmessage \
1284 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \ 1294 xmh xmodmap xmore xman xprop xrandr xrdb xrefresh xset \
1285 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \ 1295 xsetmode xsetpointer xsetroot xsm xstdcmap xvidtune xvinfo \
1286 xwininfo xwud xkbprint xkbevd \ 1296 xwininfo xwud xkbprint xkbevd \
1287 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \ 1297 xterm xwd xfs xfsinfo xtrap xkbutils xkbcomp \
1288 xkeyboard-config xinput xcb-util xorg-docs \ 1298 xkeyboard-config xinput xcb-util xorg-docs \
1289 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \ 1299 font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
1290 font-adobe-utopia-75dpi font-adobe-utopia-type1 \ 1300 font-adobe-utopia-75dpi font-adobe-utopia-type1 \
1291 font-alias \ 1301 font-alias \
1292 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \ 1302 font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi \
1293 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \ 1303 font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 \
1294 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \ 1304 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 \
1295 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \ 1305 font-cursor-misc font-daewoo-misc font-dec-misc font-ibm-type1 \
1296 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \ 1306 font-isas-misc font-jis-misc font-misc-misc font-mutt-misc \
1297 font-sony-misc font-util ttf-bitstream-vera encodings 1307 font-sony-misc font-util ttf-bitstream-vera encodings
1298X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist 1308X11SRCDIR.${_dir}?= ${X11SRCDIRMIT}/${_dir}/dist
1299.endfor 1309.endfor
1300 1310
1301.for _i in \ 1311.for _i in \
1302 elographics keyboard mouse synaptics vmmouse void ws 1312 elographics keyboard mouse synaptics vmmouse void ws
1303X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist 1313X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist
1304.endfor 1314.endfor
1305 1315
1306.for _v in \ 1316.for _v in \
1307 ag10e apm ark ast ati ati-kms chips cirrus crime \ 1317 ag10e apm ark ast ati ati-kms chips cirrus crime \
1308 geode glint i128 i740 igs imstt intel intel-old \ 1318 geode glint i128 i740 igs imstt intel intel-old \
1309 modesetting mach64 mga \ 1319 modesetting mach64 mga \
1310 neomagic newport nouveau nsc nv nvxbox openchrome pnozz \ 1320 neomagic newport nouveau nsc nv nvxbox openchrome pnozz \
1311 r128 radeonhd rendition \ 1321 r128 radeonhd rendition \
1312 s3 s3virge savage siliconmotion sis suncg14 \ 1322 s3 s3virge savage siliconmotion sis suncg14 \
1313 suncg6 sunffb sunleo suntcx \ 1323 suncg6 sunffb sunleo suntcx \
1314 tdfx tga trident tseng vesa vga vmware wsfb xgi 1324 tdfx tga trident tseng vesa vga vmware wsfb xgi
1315X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist 1325X11SRCDIR.xf86-video-${_v}?= ${X11SRCDIRMIT}/xf86-video-${_v}/dist
1316.endfor 1326.endfor
1317 1327
1318# Only install the radeon firmware on DRM-happy systems. 1328# Only install the radeon firmware on DRM-happy systems.
1319.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" 1329.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
1320MKRADEONFIRMWARE?= yes 1330MKRADEONFIRMWARE?= yes
1321.endif 1331.endif
1322MKRADEONFIRMWARE?= no 1332MKRADEONFIRMWARE?= no
1323 1333
1324X11DRI?= yes 1334X11DRI?= yes
1325X11LOADABLE?= yes 1335X11LOADABLE?= yes
1326 1336
1327 1337
1328# 1338#
1329# Where extsrc sources are and where it is installed to. 1339# Where extsrc sources are and where it is installed to.
1330# 1340#
1331.if !defined(EXTSRCSRCDIR) 1341.if !defined(EXTSRCSRCDIR)
1332.if exists(${NETBSDSRCDIR}/../extsrc) 1342.if exists(${NETBSDSRCDIR}/../extsrc)
1333EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd 1343EXTSRCSRCDIR!= cd "${NETBSDSRCDIR}/../extsrc" && pwd
1334.else 1344.else
1335EXTSRCSRCDIR= /usr/extsrc 1345EXTSRCSRCDIR= /usr/extsrc
1336.endif 1346.endif
1337.endif # !defined(EXTSRCSRCDIR) 1347.endif # !defined(EXTSRCSRCDIR)
1338 1348
1339EXTSRCROOTDIR?= /usr/ext 1349EXTSRCROOTDIR?= /usr/ext
1340EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin 1350EXTSRCBINDIR?= ${EXTSRCROOTDIR}/bin
1341EXTSRCETCDIR?= /etc/ext 1351EXTSRCETCDIR?= /etc/ext
1342EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include 1352EXTSRCINCDIR?= ${EXTSRCROOTDIR}/include
1343EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext 1353EXTSRCLIBDIR?= ${EXTSRCROOTDIR}/lib/ext
1344EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man 1354EXTSRCMANDIR?= ${EXTSRCROOTDIR}/man
1345EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib 1355EXTSRCUSRLIBDIR?= ${EXTSRCROOTDIR}/lib
1346 1356
1347# 1357#
1348# MAKEDIRTARGET dir target [extra make(1) params] 1358# MAKEDIRTARGET dir target [extra make(1) params]
1349# run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message 1359# run "cd $${dir} && ${MAKEDIRTARGETENV} ${MAKE} [params] $${target}", with a pretty message
1350# 1360#
1351MAKEDIRTARGETENV?= 1361MAKEDIRTARGETENV?=
1352MAKEDIRTARGET=\ 1362MAKEDIRTARGET=\
1353 @_makedirtarget() { \ 1363 @_makedirtarget() { \
1354 dir="$$1"; shift; \ 1364 dir="$$1"; shift; \
1355 target="$$1"; shift; \ 1365 target="$$1"; shift; \
1356 case "$${dir}" in \ 1366 case "$${dir}" in \
1357 /*) this="$${dir}/"; \ 1367 /*) this="$${dir}/"; \
1358 real="$${dir}" ;; \ 1368 real="$${dir}" ;; \
1359 .) this="${_THISDIR_}"; \ 1369 .) this="${_THISDIR_}"; \
1360 real="${.CURDIR}" ;; \ 1370 real="${.CURDIR}" ;; \
1361 *) this="${_THISDIR_}$${dir}/"; \ 1371 *) this="${_THISDIR_}$${dir}/"; \
1362 real="${.CURDIR}/$${dir}" ;; \ 1372 real="${.CURDIR}/$${dir}" ;; \
1363 esac; \ 1373 esac; \
1364 show=$${this:-.}; \ 1374 show=$${this:-.}; \
1365 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \ 1375 echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
1366 cd "$${real}" \ 1376 cd "$${real}" \
1367 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \ 1377 && ${MAKEDIRTARGETENV} ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
1368 }; \ 1378 }; \
1369 _makedirtarget 1379 _makedirtarget
1370 1380
1371# 1381#
1372# MAKEVERBOSE support. Levels are: 1382# MAKEVERBOSE support. Levels are:
1373# 0 Minimal output ("quiet") 1383# 0 Minimal output ("quiet")
1374# 1 Describe what is occurring 1384# 1 Describe what is occurring
1375# 2 Describe what is occurring and echo the actual command 1385# 2 Describe what is occurring and echo the actual command
1376# 3 Ignore the effect of the "@" prefix in make commands 1386# 3 Ignore the effect of the "@" prefix in make commands
1377# 4 Trace shell commands using the shell's -x flag 1387# 4 Trace shell commands using the shell's -x flag
1378#  1388#
1379MAKEVERBOSE?= 2 1389MAKEVERBOSE?= 2
1380 1390
1381.if ${MAKEVERBOSE} == 0 1391.if ${MAKEVERBOSE} == 0
1382_MKMSG?= @\# 1392_MKMSG?= @\#
1383_MKSHMSG?= : echo 1393_MKSHMSG?= : echo
1384_MKSHECHO?= : echo 1394_MKSHECHO?= : echo
1385.SILENT: 1395.SILENT:
1386.elif ${MAKEVERBOSE} == 1 1396.elif ${MAKEVERBOSE} == 1
1387_MKMSG?= @echo ' ' 1397_MKMSG?= @echo ' '
1388_MKSHMSG?= echo ' ' 1398_MKSHMSG?= echo ' '
1389_MKSHECHO?= : echo 1399_MKSHECHO?= : echo
1390.SILENT: 1400.SILENT:
1391.else # MAKEVERBOSE >= 2 1401.else # MAKEVERBOSE >= 2
1392_MKMSG?= @echo '\# ' 1402_MKMSG?= @echo '\# '
1393_MKSHMSG?= echo '\# ' 1403_MKSHMSG?= echo '\# '
1394_MKSHECHO?= echo 1404_MKSHECHO?= echo
1395.SILENT: __makeverbose_dummy_target__ 1405.SILENT: __makeverbose_dummy_target__
1396.endif # MAKEVERBOSE >= 2 1406.endif # MAKEVERBOSE >= 2
1397.if ${MAKEVERBOSE} >= 3 1407.if ${MAKEVERBOSE} >= 3
1398.MAKEFLAGS: -dl 1408.MAKEFLAGS: -dl
1399.endif # ${MAKEVERBOSE} >= 3 1409.endif # ${MAKEVERBOSE} >= 3
1400.if ${MAKEVERBOSE} >= 4 1410.if ${MAKEVERBOSE} >= 4
1401.MAKEFLAGS: -dx 1411.MAKEFLAGS: -dx
1402.endif # ${MAKEVERBOSE} >= 4 1412.endif # ${MAKEVERBOSE} >= 4
1403 1413
1404_MKMSG_BUILD?= ${_MKMSG} " build " 1414_MKMSG_BUILD?= ${_MKMSG} " build "
1405_MKMSG_CREATE?= ${_MKMSG} " create " 1415_MKMSG_CREATE?= ${_MKMSG} " create "
1406_MKMSG_COMPILE?= ${_MKMSG} "compile " 1416_MKMSG_COMPILE?= ${_MKMSG} "compile "
1407_MKMSG_FORMAT?= ${_MKMSG} " format " 1417_MKMSG_FORMAT?= ${_MKMSG} " format "
1408_MKMSG_INSTALL?= ${_MKMSG} "install " 1418_MKMSG_INSTALL?= ${_MKMSG} "install "
1409_MKMSG_LINK?= ${_MKMSG} " link " 1419_MKMSG_LINK?= ${_MKMSG} " link "
1410_MKMSG_LEX?= ${_MKMSG} " lex " 1420_MKMSG_LEX?= ${_MKMSG} " lex "
1411_MKMSG_REMOVE?= ${_MKMSG} " remove " 1421_MKMSG_REMOVE?= ${_MKMSG} " remove "
1412_MKMSG_YACC?= ${_MKMSG} " yacc " 1422_MKMSG_YACC?= ${_MKMSG} " yacc "
1413 1423
1414_MKSHMSG_CREATE?= ${_MKSHMSG} " create " 1424_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
1415_MKSHMSG_INSTALL?= ${_MKSHMSG} "install " 1425_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
1416 1426
1417_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET} 1427_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
1418_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET} 1428_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
1419_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET} 1429_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
1420_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET} 1430_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
1421_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET} 1431_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
1422_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET} 1432_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
1423_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET} 1433_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
1424_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET} 1434_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
1425_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET} 1435_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
1426 1436
1427.if ${MKMANDOC} == "yes" 1437.if ${MKMANDOC} == "yes"
1428TARGETS+= lintmanpages 1438TARGETS+= lintmanpages
1429.endif 1439.endif
1430 1440
1431TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}} 1441TESTSBASE= /usr/tests${MLIBDIR:D/${MLIBDIR}}
1432 1442
1433.endif # !defined(_BSD_OWN_MK_) 1443.endif # !defined(_BSD_OWN_MK_)