Thu Jul 23 07:44:46 2015 UTC ()
add rstart and showfont.


(mrg)
diff -r1.860 -r1.861 src/share/mk/bsd.own.mk

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

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