Deleted Added
full compact
src.opts.mk (250699) src.opts.mk (251512)
1# $FreeBSD: head/share/mk/bsd.own.mk 250699 2013-05-16 15:28:38Z sjg $
1# $FreeBSD: head/share/mk/bsd.own.mk 251512 2013-06-07 21:40:02Z emaste $
2#
3# The include file <bsd.own.mk> set common variables for owner,
4# group, mode, and directories. Defaults are in brackets.
5#
6#
7# +++ variables +++
8#
9# DESTDIR Change the tree where the file gets installed. [not set]
10#
11# DISTDIR Change the tree where the file for a distribution
12# gets installed (see /usr/src/release/Makefile). [not set]
13#
14# COMPRESS_CMD Program to compress documents.
15# Output is to stdout. [gzip -cn]
16#
17# COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz]
18#
19# BINOWN Binary owner. [root]
20#
21# BINGRP Binary group. [wheel]
22#
23# BINMODE Binary mode. [555]
24#
25# NOBINMODE Mode for non-executable files. [444]
26#
27# LIBDIR Base path for libraries. [/usr/lib]
28#
29# LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat]
30#
31# LIBDATADIR Base path for misc. utility data files. [/usr/libdata]
32#
33# LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec]
34#
35# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint]
36#
37# SHLIBDIR Base path for shared libraries. [${LIBDIR}]
38#
39# LIBOWN Library owner. [${BINOWN}]
40#
41# LIBGRP Library group. [${BINGRP}]
42#
43# LIBMODE Library mode. [${NOBINMODE}]
44#
45#
2#
3# The include file <bsd.own.mk> set common variables for owner,
4# group, mode, and directories. Defaults are in brackets.
5#
6#
7# +++ variables +++
8#
9# DESTDIR Change the tree where the file gets installed. [not set]
10#
11# DISTDIR Change the tree where the file for a distribution
12# gets installed (see /usr/src/release/Makefile). [not set]
13#
14# COMPRESS_CMD Program to compress documents.
15# Output is to stdout. [gzip -cn]
16#
17# COMPRESS_EXT File name extension of ${COMPRESS_CMD} command. [.gz]
18#
19# BINOWN Binary owner. [root]
20#
21# BINGRP Binary group. [wheel]
22#
23# BINMODE Binary mode. [555]
24#
25# NOBINMODE Mode for non-executable files. [444]
26#
27# LIBDIR Base path for libraries. [/usr/lib]
28#
29# LIBCOMPATDIR Base path for compat libraries. [/usr/lib/compat]
30#
31# LIBDATADIR Base path for misc. utility data files. [/usr/libdata]
32#
33# LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec]
34#
35# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint]
36#
37# SHLIBDIR Base path for shared libraries. [${LIBDIR}]
38#
39# LIBOWN Library owner. [${BINOWN}]
40#
41# LIBGRP Library group. [${BINGRP}]
42#
43# LIBMODE Library mode. [${NOBINMODE}]
44#
45#
46# DEBUGDIR Base path for standalone debug files. [/usr/lib/debug]
47#
48# DEBUGMODE Mode for debug files. [${NOBINMODE}]
49#
50#
46# KMODDIR Base path for loadable kernel modules
47# (see kld(4)). [/boot/kernel]
48#
49# KMODOWN Kernel and KLD owner. [${BINOWN}]
50#
51# KMODGRP Kernel and KLD group. [${BINGRP}]
52#
53# KMODMODE KLD mode. [${BINMODE}]
54#
55#
56# SHAREDIR Base path for architecture-independent ascii
57# text files. [/usr/share]
58#
59# SHAREOWN ASCII text file owner. [root]
60#
61# SHAREGRP ASCII text file group. [wheel]
62#
63# SHAREMODE ASCII text file mode. [${NOBINMODE}]
64#
65#
66# CONFDIR Base path for configuration files. [/etc]
67#
68# CONFOWN Configuration file owner. [root]
69#
70# CONFGRP Configuration file group. [wheel]
71#
72# CONFMODE Configuration file mode. [644]
73#
74#
75# DOCDIR Base path for system documentation (e.g. PSD, USD,
76# handbook, FAQ etc.). [${SHAREDIR}/doc]
77#
78# DOCOWN Documentation owner. [${SHAREOWN}]
79#
80# DOCGRP Documentation group. [${SHAREGRP}]
81#
82# DOCMODE Documentation mode. [${NOBINMODE}]
83#
84#
85# INFODIR Base path for GNU's hypertext system
86# called Info (see info(1)). [${SHAREDIR}/info]
87#
88# INFOOWN Info owner. [${SHAREOWN}]
89#
90# INFOGRP Info group. [${SHAREGRP}]
91#
92# INFOMODE Info mode. [${NOBINMODE}]
93#
94#
95# MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
96#
97# MANOWN Manual owner. [${SHAREOWN}]
98#
99# MANGRP Manual group. [${SHAREGRP}]
100#
101# MANMODE Manual mode. [${NOBINMODE}]
102#
103#
104# NLSDIR Base path for National Language Support files
105# installation. [${SHAREDIR}/nls]
106#
107# NLSOWN National Language Support files owner. [${SHAREOWN}]
108#
109# NLSGRP National Language Support files group. [${SHAREGRP}]
110#
111# NLSMODE National Language Support files mode. [${NOBINMODE}]
112#
113# INCLUDEDIR Base path for standard C include files [/usr/include]
114
115.if !target(__<bsd.own.mk>__)
116__<bsd.own.mk>__:
117
118.if !defined(_WITHOUT_SRCCONF)
119SRCCONF?= /etc/src.conf
120.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
121.include "${SRCCONF}"
122.endif
123.endif
124
125# Binaries
126BINOWN?= root
127BINGRP?= wheel
128BINMODE?= 555
129NOBINMODE?= 444
130
131.if defined(MODULES_WITH_WORLD)
132KMODDIR?= /boot/modules
133.else
134KMODDIR?= /boot/kernel
135.endif
136KMODOWN?= ${BINOWN}
137KMODGRP?= ${BINGRP}
138KMODMODE?= ${BINMODE}
139
140LIBDIR?= /usr/lib
141LIBCOMPATDIR?= /usr/lib/compat
142LIBDATADIR?= /usr/libdata
143LIBEXECDIR?= /usr/libexec
144LINTLIBDIR?= /usr/libdata/lint
145SHLIBDIR?= ${LIBDIR}
146LIBOWN?= ${BINOWN}
147LIBGRP?= ${BINGRP}
148LIBMODE?= ${NOBINMODE}
149
51# KMODDIR Base path for loadable kernel modules
52# (see kld(4)). [/boot/kernel]
53#
54# KMODOWN Kernel and KLD owner. [${BINOWN}]
55#
56# KMODGRP Kernel and KLD group. [${BINGRP}]
57#
58# KMODMODE KLD mode. [${BINMODE}]
59#
60#
61# SHAREDIR Base path for architecture-independent ascii
62# text files. [/usr/share]
63#
64# SHAREOWN ASCII text file owner. [root]
65#
66# SHAREGRP ASCII text file group. [wheel]
67#
68# SHAREMODE ASCII text file mode. [${NOBINMODE}]
69#
70#
71# CONFDIR Base path for configuration files. [/etc]
72#
73# CONFOWN Configuration file owner. [root]
74#
75# CONFGRP Configuration file group. [wheel]
76#
77# CONFMODE Configuration file mode. [644]
78#
79#
80# DOCDIR Base path for system documentation (e.g. PSD, USD,
81# handbook, FAQ etc.). [${SHAREDIR}/doc]
82#
83# DOCOWN Documentation owner. [${SHAREOWN}]
84#
85# DOCGRP Documentation group. [${SHAREGRP}]
86#
87# DOCMODE Documentation mode. [${NOBINMODE}]
88#
89#
90# INFODIR Base path for GNU's hypertext system
91# called Info (see info(1)). [${SHAREDIR}/info]
92#
93# INFOOWN Info owner. [${SHAREOWN}]
94#
95# INFOGRP Info group. [${SHAREGRP}]
96#
97# INFOMODE Info mode. [${NOBINMODE}]
98#
99#
100# MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
101#
102# MANOWN Manual owner. [${SHAREOWN}]
103#
104# MANGRP Manual group. [${SHAREGRP}]
105#
106# MANMODE Manual mode. [${NOBINMODE}]
107#
108#
109# NLSDIR Base path for National Language Support files
110# installation. [${SHAREDIR}/nls]
111#
112# NLSOWN National Language Support files owner. [${SHAREOWN}]
113#
114# NLSGRP National Language Support files group. [${SHAREGRP}]
115#
116# NLSMODE National Language Support files mode. [${NOBINMODE}]
117#
118# INCLUDEDIR Base path for standard C include files [/usr/include]
119
120.if !target(__<bsd.own.mk>__)
121__<bsd.own.mk>__:
122
123.if !defined(_WITHOUT_SRCCONF)
124SRCCONF?= /etc/src.conf
125.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
126.include "${SRCCONF}"
127.endif
128.endif
129
130# Binaries
131BINOWN?= root
132BINGRP?= wheel
133BINMODE?= 555
134NOBINMODE?= 444
135
136.if defined(MODULES_WITH_WORLD)
137KMODDIR?= /boot/modules
138.else
139KMODDIR?= /boot/kernel
140.endif
141KMODOWN?= ${BINOWN}
142KMODGRP?= ${BINGRP}
143KMODMODE?= ${BINMODE}
144
145LIBDIR?= /usr/lib
146LIBCOMPATDIR?= /usr/lib/compat
147LIBDATADIR?= /usr/libdata
148LIBEXECDIR?= /usr/libexec
149LINTLIBDIR?= /usr/libdata/lint
150SHLIBDIR?= ${LIBDIR}
151LIBOWN?= ${BINOWN}
152LIBGRP?= ${BINGRP}
153LIBMODE?= ${NOBINMODE}
154
155DEBUGDIR?= /usr/lib/debug
156DEBUGMODE?= ${NOBINMODE}
150
157
158
151# Share files
152SHAREDIR?= /usr/share
153SHAREOWN?= root
154SHAREGRP?= wheel
155SHAREMODE?= ${NOBINMODE}
156
157CONFDIR?= /etc
158CONFOWN?= root
159CONFGRP?= wheel
160CONFMODE?= 644
161
162MANDIR?= ${SHAREDIR}/man/man
163MANOWN?= ${SHAREOWN}
164MANGRP?= ${SHAREGRP}
165MANMODE?= ${NOBINMODE}
166
167DOCDIR?= ${SHAREDIR}/doc
168DOCOWN?= ${SHAREOWN}
169DOCGRP?= ${SHAREGRP}
170DOCMODE?= ${NOBINMODE}
171
172INFODIR?= ${SHAREDIR}/info
173INFOOWN?= ${SHAREOWN}
174INFOGRP?= ${SHAREGRP}
175INFOMODE?= ${NOBINMODE}
176
177NLSDIR?= ${SHAREDIR}/nls
178NLSOWN?= ${SHAREOWN}
179NLSGRP?= ${SHAREGRP}
180NLSMODE?= ${NOBINMODE}
181
182INCLUDEDIR?= /usr/include
183
184#
185# install(1) parameters.
186#
187HRDLINK?= -l h
188SYMLINK?= -l s
189
190INSTALL_LINK?= ${INSTALL} ${HRDLINK}
191INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
192
193# Common variables
194.if !defined(DEBUG_FLAGS)
195STRIP?= -s
196.endif
197
198COMPRESS_CMD?= gzip -cn
199COMPRESS_EXT?= .gz
200
201.if !defined(_WITHOUT_SRCCONF)
202#
203# Define MK_* variables (which are either "yes" or "no") for users
204# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
205# make(1) environment.
206# These should be tested with `== "no"' or `!= "no"' in makefiles.
207# The NO_* variables should only be set by makefiles.
208#
209
210#
211# Supported NO_* options (if defined, MK_* will be forced to "no",
212# regardless of user's setting).
213#
214.for var in \
215 CTF \
159# Share files
160SHAREDIR?= /usr/share
161SHAREOWN?= root
162SHAREGRP?= wheel
163SHAREMODE?= ${NOBINMODE}
164
165CONFDIR?= /etc
166CONFOWN?= root
167CONFGRP?= wheel
168CONFMODE?= 644
169
170MANDIR?= ${SHAREDIR}/man/man
171MANOWN?= ${SHAREOWN}
172MANGRP?= ${SHAREGRP}
173MANMODE?= ${NOBINMODE}
174
175DOCDIR?= ${SHAREDIR}/doc
176DOCOWN?= ${SHAREOWN}
177DOCGRP?= ${SHAREGRP}
178DOCMODE?= ${NOBINMODE}
179
180INFODIR?= ${SHAREDIR}/info
181INFOOWN?= ${SHAREOWN}
182INFOGRP?= ${SHAREGRP}
183INFOMODE?= ${NOBINMODE}
184
185NLSDIR?= ${SHAREDIR}/nls
186NLSOWN?= ${SHAREOWN}
187NLSGRP?= ${SHAREGRP}
188NLSMODE?= ${NOBINMODE}
189
190INCLUDEDIR?= /usr/include
191
192#
193# install(1) parameters.
194#
195HRDLINK?= -l h
196SYMLINK?= -l s
197
198INSTALL_LINK?= ${INSTALL} ${HRDLINK}
199INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK}
200
201# Common variables
202.if !defined(DEBUG_FLAGS)
203STRIP?= -s
204.endif
205
206COMPRESS_CMD?= gzip -cn
207COMPRESS_EXT?= .gz
208
209.if !defined(_WITHOUT_SRCCONF)
210#
211# Define MK_* variables (which are either "yes" or "no") for users
212# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
213# make(1) environment.
214# These should be tested with `== "no"' or `!= "no"' in makefiles.
215# The NO_* variables should only be set by makefiles.
216#
217
218#
219# Supported NO_* options (if defined, MK_* will be forced to "no",
220# regardless of user's setting).
221#
222.for var in \
223 CTF \
224 DEBUG_FILES \
216 INSTALLLIB \
217 MAN \
218 PROFILE
219.if defined(NO_${var})
220.if defined(WITH_${var})
221.undef WITH_${var}
222.endif
223WITHOUT_${var}=
224.endif
225.endfor
226
227#
228# Older-style variables that enabled behaviour when set.
229#
230.if defined(YES_HESIOD)
231WITH_HESIOD=
232.endif
233
234__DEFAULT_YES_OPTIONS = \
235 ACCT \
236 ACPI \
237 AMD \
238 APM \
239 ASSERT_DEBUG \
240 AT \
241 ATF \
242 ATM \
243 AUDIT \
244 AUTHPF \
245 BIND \
246 BIND_DNSSEC \
247 BIND_ETC \
248 BIND_LIBS_LWRES \
249 BIND_MTREE \
250 BIND_NAMED \
251 BIND_UTILS \
252 BINUTILS \
253 BLUETOOTH \
254 BMAKE \
255 BOOT \
256 BSD_CPIO \
257 BSNMP \
258 BZIP2 \
259 CALENDAR \
260 CAPSICUM \
261 CDDL \
262 CPP \
263 CROSS_COMPILER \
264 CRYPT \
265 CTM \
266 CVS \
267 CXX \
268 DICT \
269 DYNAMICROOT \
270 ED_CRYPTO \
271 EXAMPLES \
272 FLOPPY \
273 FORMAT_EXTENSIONS \
274 FORTH \
275 FP_LIBC \
276 FREEBSD_UPDATE \
277 GAMES \
278 GCC \
279 GCOV \
280 GDB \
281 GNU \
282 GPIB \
283 GPIO \
284 GROFF \
285 HTML \
286 INET \
287 INET6 \
288 INFO \
289 INSTALLLIB \
290 IPFILTER \
291 IPFW \
292 IPX \
293 JAIL \
294 KDUMP \
295 KERBEROS \
296 KERNEL_SYMBOLS \
297 KVM \
298 LDNS \
299 LEGACY_CONSOLE \
300 LIB32 \
301 LIBPTHREAD \
302 LIBTHR \
303 LOCALES \
304 LOCATE \
305 LPR \
306 LS_COLORS \
307 MAIL \
308 MAILWRAPPER \
309 MAKE \
310 MAN \
311 NDIS \
312 NETCAT \
313 NETGRAPH \
314 NIS \
315 NLS \
316 NLS_CATALOGS \
317 NS_CACHING \
318 NTP \
319 OPENSSH \
320 OPENSSL \
321 PAM \
322 PC_SYSINSTALL \
323 PF \
324 PKGBOOTSTRAP \
325 PKGTOOLS \
326 PMC \
327 PORTSNAP \
328 PPP \
329 PROFILE \
330 QUOTAS \
331 RCMDS \
332 RCS \
333 RESCUE \
334 ROUTED \
335 SENDMAIL \
336 SETUID_LOGIN \
337 SHAREDOCS \
338 SOURCELESS \
339 SOURCELESS_HOST \
340 SOURCELESS_UCODE \
341 SSP \
342 SYMVER \
343 SYSCONS \
344 SYSINSTALL \
345 TCSH \
346 TELNET \
347 TEXTPROC \
348 TOOLCHAIN \
349 USB \
350 UTMPX \
351 WIRELESS \
352 WPA_SUPPLICANT_EAPOL \
353 ZFS \
354 ZONEINFO
355
356__DEFAULT_NO_OPTIONS = \
357 ARM_EABI \
358 BSD_PATCH \
359 BIND_IDN \
360 BIND_LARGE_FILE \
361 BIND_LIBS \
362 BIND_SIGCHASE \
363 BIND_XML \
364 BSDCONFIG \
365 BSD_GREP \
366 CLANG_EXTRAS \
367 CTF \
225 INSTALLLIB \
226 MAN \
227 PROFILE
228.if defined(NO_${var})
229.if defined(WITH_${var})
230.undef WITH_${var}
231.endif
232WITHOUT_${var}=
233.endif
234.endfor
235
236#
237# Older-style variables that enabled behaviour when set.
238#
239.if defined(YES_HESIOD)
240WITH_HESIOD=
241.endif
242
243__DEFAULT_YES_OPTIONS = \
244 ACCT \
245 ACPI \
246 AMD \
247 APM \
248 ASSERT_DEBUG \
249 AT \
250 ATF \
251 ATM \
252 AUDIT \
253 AUTHPF \
254 BIND \
255 BIND_DNSSEC \
256 BIND_ETC \
257 BIND_LIBS_LWRES \
258 BIND_MTREE \
259 BIND_NAMED \
260 BIND_UTILS \
261 BINUTILS \
262 BLUETOOTH \
263 BMAKE \
264 BOOT \
265 BSD_CPIO \
266 BSNMP \
267 BZIP2 \
268 CALENDAR \
269 CAPSICUM \
270 CDDL \
271 CPP \
272 CROSS_COMPILER \
273 CRYPT \
274 CTM \
275 CVS \
276 CXX \
277 DICT \
278 DYNAMICROOT \
279 ED_CRYPTO \
280 EXAMPLES \
281 FLOPPY \
282 FORMAT_EXTENSIONS \
283 FORTH \
284 FP_LIBC \
285 FREEBSD_UPDATE \
286 GAMES \
287 GCC \
288 GCOV \
289 GDB \
290 GNU \
291 GPIB \
292 GPIO \
293 GROFF \
294 HTML \
295 INET \
296 INET6 \
297 INFO \
298 INSTALLLIB \
299 IPFILTER \
300 IPFW \
301 IPX \
302 JAIL \
303 KDUMP \
304 KERBEROS \
305 KERNEL_SYMBOLS \
306 KVM \
307 LDNS \
308 LEGACY_CONSOLE \
309 LIB32 \
310 LIBPTHREAD \
311 LIBTHR \
312 LOCALES \
313 LOCATE \
314 LPR \
315 LS_COLORS \
316 MAIL \
317 MAILWRAPPER \
318 MAKE \
319 MAN \
320 NDIS \
321 NETCAT \
322 NETGRAPH \
323 NIS \
324 NLS \
325 NLS_CATALOGS \
326 NS_CACHING \
327 NTP \
328 OPENSSH \
329 OPENSSL \
330 PAM \
331 PC_SYSINSTALL \
332 PF \
333 PKGBOOTSTRAP \
334 PKGTOOLS \
335 PMC \
336 PORTSNAP \
337 PPP \
338 PROFILE \
339 QUOTAS \
340 RCMDS \
341 RCS \
342 RESCUE \
343 ROUTED \
344 SENDMAIL \
345 SETUID_LOGIN \
346 SHAREDOCS \
347 SOURCELESS \
348 SOURCELESS_HOST \
349 SOURCELESS_UCODE \
350 SSP \
351 SYMVER \
352 SYSCONS \
353 SYSINSTALL \
354 TCSH \
355 TELNET \
356 TEXTPROC \
357 TOOLCHAIN \
358 USB \
359 UTMPX \
360 WIRELESS \
361 WPA_SUPPLICANT_EAPOL \
362 ZFS \
363 ZONEINFO
364
365__DEFAULT_NO_OPTIONS = \
366 ARM_EABI \
367 BSD_PATCH \
368 BIND_IDN \
369 BIND_LARGE_FILE \
370 BIND_LIBS \
371 BIND_SIGCHASE \
372 BIND_XML \
373 BSDCONFIG \
374 BSD_GREP \
375 CLANG_EXTRAS \
376 CTF \
377 DEBUG_FILES \
368 GPL_DTC \
369 HESIOD \
370 ICONV \
371 INSTALL_AS_USER \
372 LDNS_UTILS \
373 NMTREE \
374 NAND \
375 OFED \
376 OPENSSH_NONE_CIPHER \
377 SHARED_TOOLCHAIN
378
379#
380# Default behaviour of some options depends on the architecture. Unfortunately
381# this means that we have to test TARGET_ARCH (the buildworld case) as well
382# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
383# used at all in bsd.*.mk, but we have to make an exception here if we want
384# to allow defaults for some things like clang and fdt to vary by target
385# architecture.
386#
387.if defined(TARGET_ARCH)
388__T=${TARGET_ARCH}
389.else
390__T=${MACHINE_ARCH}
391.endif
392# Clang is only for x86, powerpc and little-endian arm right now, by default.
393.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
394__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
395.elif ${__T} == "arm" || ${__T} == "armv6"
396__DEFAULT_YES_OPTIONS+=CLANG
397# GCC is unable to build the full clang on arm, disable it by default.
398__DEFAULT_NO_OPTIONS+=CLANG_FULL
399.else
400__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
401.endif
402# Clang the default system compiler only on little-endian arm and x86.
403.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
404 ${__T} == "i386"
405__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
406.else
407__DEFAULT_NO_OPTIONS+=CLANG_IS_CC
408.endif
409# FDT is needed only for arm, mips and powerpc
410.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
411__DEFAULT_YES_OPTIONS+=FDT
412.else
413__DEFAULT_NO_OPTIONS+=FDT
414.endif
415.undef __T
416
417#
418# MK_* options which default to "yes".
419#
420.for var in ${__DEFAULT_YES_OPTIONS}
421.if defined(WITH_${var}) && defined(WITHOUT_${var})
422.error WITH_${var} and WITHOUT_${var} can't both be set.
423.endif
424.if defined(MK_${var})
425.error MK_${var} can't be set by a user.
426.endif
427.if defined(WITHOUT_${var})
428MK_${var}:= no
429.else
430MK_${var}:= yes
431.endif
432.endfor
433.undef __DEFAULT_YES_OPTIONS
434
435#
436# MK_* options which default to "no".
437#
438.for var in ${__DEFAULT_NO_OPTIONS}
439.if defined(WITH_${var}) && defined(WITHOUT_${var})
440.error WITH_${var} and WITHOUT_${var} can't both be set.
441.endif
442.if defined(MK_${var})
443.error MK_${var} can't be set by a user.
444.endif
445.if defined(WITH_${var})
446MK_${var}:= yes
447.else
448MK_${var}:= no
449.endif
450.endfor
451.undef __DEFAULT_NO_OPTIONS
452
453#
454# Force some options off if their dependencies are off.
455# Order is somewhat important.
456#
457.if ${MK_LIBPTHREAD} == "no"
458MK_LIBTHR:= no
459.endif
460
461.if ${MK_LIBTHR} == "no"
462MK_BIND:= no
463.endif
464
465.if ${MK_BIND} == "no"
466MK_BIND_DNSSEC:= no
467MK_BIND_ETC:= no
468MK_BIND_LIBS:= no
469MK_BIND_LIBS_LWRES:= no
470MK_BIND_MTREE:= no
471MK_BIND_NAMED:= no
472MK_BIND_UTILS:= no
473.endif
474
475.if ${MK_LDNS} == "no"
476MK_LDNS_UTILS:= no
477.endif
478
479.if ${MK_LDNS_UTILS} != "no"
480MK_BIND_UTILS:= no
481.endif
482
483.if ${MK_BIND_MTREE} == "no"
484MK_BIND_ETC:= no
485.endif
486
487.if ${MK_SOURCELESS} == "no"
488MK_SOURCELESS_HOST:= no
489MK_SOURCELESS_UCODE:= no
490.endif
491
492.if ${MK_CDDL} == "no"
493MK_ZFS:= no
494MK_CTF:= no
495.endif
496
497.if ${MK_CRYPT} == "no"
498MK_OPENSSL:= no
499MK_OPENSSH:= no
500MK_KERBEROS:= no
501.endif
502
503.if ${MK_CXX} == "no"
504MK_CLANG:= no
505MK_GROFF:= no
506.endif
507
508.if ${MK_MAIL} == "no"
509MK_MAILWRAPPER:= no
510MK_SENDMAIL:= no
511.endif
512
513.if ${MK_NETGRAPH} == "no"
514MK_ATM:= no
515MK_BLUETOOTH:= no
516.endif
517
518.if ${MK_OPENSSL} == "no"
519MK_OPENSSH:= no
520MK_KERBEROS:= no
521.endif
522
523.if ${MK_PF} == "no"
524MK_AUTHPF:= no
525.endif
526
527.if ${MK_TEXTPROC} == "no"
528MK_GROFF:= no
529.endif
530
531.if ${MK_TOOLCHAIN} == "no"
532MK_BINUTILS:= no
533MK_CLANG:= no
534MK_GCC:= no
535MK_GDB:= no
536.endif
537
538.if ${MK_CLANG} == "no"
539MK_CLANG_EXTRAS:= no
540MK_CLANG_FULL:= no
541MK_CLANG_IS_CC:= no
542.endif
543
544#
545# Set defaults for the MK_*_SUPPORT variables.
546#
547
548#
549# MK_*_SUPPORT options which default to "yes" unless their corresponding
550# MK_* variable is set to "no".
551#
552.for var in \
553 BZIP2 \
554 GNU \
555 INET \
556 INET6 \
557 IPX \
558 KERBEROS \
559 KVM \
560 NETGRAPH \
561 PAM \
562 WIRELESS
563.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
564.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
565.endif
566.if defined(MK_${var}_SUPPORT)
567.error MK_${var}_SUPPORT can't be set by a user.
568.endif
569.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
570MK_${var}_SUPPORT:= no
571.else
572MK_${var}_SUPPORT:= yes
573.endif
574.endfor
575
576#
577# MK_* options whose default value depends on another option.
578#
579.for vv in \
580 GSSAPI/KERBEROS \
581 MAN_UTILS/MAN
582.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
583.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
584.endif
585.if defined(MK_${vv:H})
586.error MK_${vv:H} can't be set by a user.
587.endif
588.if defined(WITH_${vv:H})
589MK_${vv:H}:= yes
590.elif defined(WITHOUT_${vv:H})
591MK_${vv:H}:= no
592.else
593MK_${vv:H}:= ${MK_${vv:T}}
594.endif
595.endfor
596
597#
598# MK_* options that default to "yes" if the compiler is a C++11 compiler.
599#
600.include <bsd.compiler.mk>
601.for var in \
602 LIBCPLUSPLUS
603.if defined(WITH_${var}) && defined(WITHOUT_${var})
604.error WITH_${var} and WITHOUT_${var} can't both be set.
605.endif
606.if defined(MK_${var})
607.error MK_${var} can't be set by a user.
608.endif
609.if ${COMPILER_FEATURES:Mc++11}
610.if defined(WITHOUT_${var})
611MK_${var}:= no
612.else
613MK_${var}:= yes
614.endif
615.else
616.if defined(WITH_${var})
617MK_${var}:= yes
618.else
619MK_${var}:= no
620.endif
621.endif
622.endfor
623
624.if ${MK_CTF} != "no"
625CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
626.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
627CTFCONVERT_CMD=
628.else
629CTFCONVERT_CMD= @:
630.endif
631
632.if ${MK_INSTALL_AS_USER} != "no"
633_uid!= id -u
634.if ${_uid} != 0
635.if !defined(USER)
636USER!= id -un
637.endif
638_gid!= id -gn
639.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
640$xOWN= ${USER}
641$xGRP= ${_gid}
642.endfor
643.endif
644.endif
645
646.endif # !_WITHOUT_SRCCONF
647
648.endif # !target(__<bsd.own.mk>__)
378 GPL_DTC \
379 HESIOD \
380 ICONV \
381 INSTALL_AS_USER \
382 LDNS_UTILS \
383 NMTREE \
384 NAND \
385 OFED \
386 OPENSSH_NONE_CIPHER \
387 SHARED_TOOLCHAIN
388
389#
390# Default behaviour of some options depends on the architecture. Unfortunately
391# this means that we have to test TARGET_ARCH (the buildworld case) as well
392# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
393# used at all in bsd.*.mk, but we have to make an exception here if we want
394# to allow defaults for some things like clang and fdt to vary by target
395# architecture.
396#
397.if defined(TARGET_ARCH)
398__T=${TARGET_ARCH}
399.else
400__T=${MACHINE_ARCH}
401.endif
402# Clang is only for x86, powerpc and little-endian arm right now, by default.
403.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
404__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
405.elif ${__T} == "arm" || ${__T} == "armv6"
406__DEFAULT_YES_OPTIONS+=CLANG
407# GCC is unable to build the full clang on arm, disable it by default.
408__DEFAULT_NO_OPTIONS+=CLANG_FULL
409.else
410__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
411.endif
412# Clang the default system compiler only on little-endian arm and x86.
413.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
414 ${__T} == "i386"
415__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
416.else
417__DEFAULT_NO_OPTIONS+=CLANG_IS_CC
418.endif
419# FDT is needed only for arm, mips and powerpc
420.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
421__DEFAULT_YES_OPTIONS+=FDT
422.else
423__DEFAULT_NO_OPTIONS+=FDT
424.endif
425.undef __T
426
427#
428# MK_* options which default to "yes".
429#
430.for var in ${__DEFAULT_YES_OPTIONS}
431.if defined(WITH_${var}) && defined(WITHOUT_${var})
432.error WITH_${var} and WITHOUT_${var} can't both be set.
433.endif
434.if defined(MK_${var})
435.error MK_${var} can't be set by a user.
436.endif
437.if defined(WITHOUT_${var})
438MK_${var}:= no
439.else
440MK_${var}:= yes
441.endif
442.endfor
443.undef __DEFAULT_YES_OPTIONS
444
445#
446# MK_* options which default to "no".
447#
448.for var in ${__DEFAULT_NO_OPTIONS}
449.if defined(WITH_${var}) && defined(WITHOUT_${var})
450.error WITH_${var} and WITHOUT_${var} can't both be set.
451.endif
452.if defined(MK_${var})
453.error MK_${var} can't be set by a user.
454.endif
455.if defined(WITH_${var})
456MK_${var}:= yes
457.else
458MK_${var}:= no
459.endif
460.endfor
461.undef __DEFAULT_NO_OPTIONS
462
463#
464# Force some options off if their dependencies are off.
465# Order is somewhat important.
466#
467.if ${MK_LIBPTHREAD} == "no"
468MK_LIBTHR:= no
469.endif
470
471.if ${MK_LIBTHR} == "no"
472MK_BIND:= no
473.endif
474
475.if ${MK_BIND} == "no"
476MK_BIND_DNSSEC:= no
477MK_BIND_ETC:= no
478MK_BIND_LIBS:= no
479MK_BIND_LIBS_LWRES:= no
480MK_BIND_MTREE:= no
481MK_BIND_NAMED:= no
482MK_BIND_UTILS:= no
483.endif
484
485.if ${MK_LDNS} == "no"
486MK_LDNS_UTILS:= no
487.endif
488
489.if ${MK_LDNS_UTILS} != "no"
490MK_BIND_UTILS:= no
491.endif
492
493.if ${MK_BIND_MTREE} == "no"
494MK_BIND_ETC:= no
495.endif
496
497.if ${MK_SOURCELESS} == "no"
498MK_SOURCELESS_HOST:= no
499MK_SOURCELESS_UCODE:= no
500.endif
501
502.if ${MK_CDDL} == "no"
503MK_ZFS:= no
504MK_CTF:= no
505.endif
506
507.if ${MK_CRYPT} == "no"
508MK_OPENSSL:= no
509MK_OPENSSH:= no
510MK_KERBEROS:= no
511.endif
512
513.if ${MK_CXX} == "no"
514MK_CLANG:= no
515MK_GROFF:= no
516.endif
517
518.if ${MK_MAIL} == "no"
519MK_MAILWRAPPER:= no
520MK_SENDMAIL:= no
521.endif
522
523.if ${MK_NETGRAPH} == "no"
524MK_ATM:= no
525MK_BLUETOOTH:= no
526.endif
527
528.if ${MK_OPENSSL} == "no"
529MK_OPENSSH:= no
530MK_KERBEROS:= no
531.endif
532
533.if ${MK_PF} == "no"
534MK_AUTHPF:= no
535.endif
536
537.if ${MK_TEXTPROC} == "no"
538MK_GROFF:= no
539.endif
540
541.if ${MK_TOOLCHAIN} == "no"
542MK_BINUTILS:= no
543MK_CLANG:= no
544MK_GCC:= no
545MK_GDB:= no
546.endif
547
548.if ${MK_CLANG} == "no"
549MK_CLANG_EXTRAS:= no
550MK_CLANG_FULL:= no
551MK_CLANG_IS_CC:= no
552.endif
553
554#
555# Set defaults for the MK_*_SUPPORT variables.
556#
557
558#
559# MK_*_SUPPORT options which default to "yes" unless their corresponding
560# MK_* variable is set to "no".
561#
562.for var in \
563 BZIP2 \
564 GNU \
565 INET \
566 INET6 \
567 IPX \
568 KERBEROS \
569 KVM \
570 NETGRAPH \
571 PAM \
572 WIRELESS
573.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
574.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
575.endif
576.if defined(MK_${var}_SUPPORT)
577.error MK_${var}_SUPPORT can't be set by a user.
578.endif
579.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
580MK_${var}_SUPPORT:= no
581.else
582MK_${var}_SUPPORT:= yes
583.endif
584.endfor
585
586#
587# MK_* options whose default value depends on another option.
588#
589.for vv in \
590 GSSAPI/KERBEROS \
591 MAN_UTILS/MAN
592.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
593.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
594.endif
595.if defined(MK_${vv:H})
596.error MK_${vv:H} can't be set by a user.
597.endif
598.if defined(WITH_${vv:H})
599MK_${vv:H}:= yes
600.elif defined(WITHOUT_${vv:H})
601MK_${vv:H}:= no
602.else
603MK_${vv:H}:= ${MK_${vv:T}}
604.endif
605.endfor
606
607#
608# MK_* options that default to "yes" if the compiler is a C++11 compiler.
609#
610.include <bsd.compiler.mk>
611.for var in \
612 LIBCPLUSPLUS
613.if defined(WITH_${var}) && defined(WITHOUT_${var})
614.error WITH_${var} and WITHOUT_${var} can't both be set.
615.endif
616.if defined(MK_${var})
617.error MK_${var} can't be set by a user.
618.endif
619.if ${COMPILER_FEATURES:Mc++11}
620.if defined(WITHOUT_${var})
621MK_${var}:= no
622.else
623MK_${var}:= yes
624.endif
625.else
626.if defined(WITH_${var})
627MK_${var}:= yes
628.else
629MK_${var}:= no
630.endif
631.endif
632.endfor
633
634.if ${MK_CTF} != "no"
635CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
636.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
637CTFCONVERT_CMD=
638.else
639CTFCONVERT_CMD= @:
640.endif
641
642.if ${MK_INSTALL_AS_USER} != "no"
643_uid!= id -u
644.if ${_uid} != 0
645.if !defined(USER)
646USER!= id -un
647.endif
648_gid!= id -gn
649.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
650$xOWN= ${USER}
651$xGRP= ${_gid}
652.endfor
653.endif
654.endif
655
656.endif # !_WITHOUT_SRCCONF
657
658.endif # !target(__<bsd.own.mk>__)