bsd.own.mk revision 255321
150476Speter# $FreeBSD: head/share/mk/bsd.own.mk 255321 2013-09-06 20:08:03Z theraven $
215903Swosch#
315903Swosch# The include file <bsd.own.mk> set common variables for owner,
415903Swosch# group, mode, and directories. Defaults are in brackets.
515903Swosch#
615903Swosch#
715903Swosch# +++ variables +++
815903Swosch#
915903Swosch# DESTDIR	Change the tree where the file gets installed. [not set]
1015903Swosch#
1115903Swosch# DISTDIR	Change the tree where the file for a distribution
1215903Swosch# 		gets installed (see /usr/src/release/Makefile). [not set]
1315903Swosch#
14139761Skrion# COMPRESS_CMD	Program to compress documents.
1534678Sbde#		Output is to stdout. [gzip -cn]
1623546Swosch#
1723546Swosch# COMPRESS_EXT	File name extension of ${COMPRESS_CMD} command. [.gz]
1823546Swosch#
1939161Sobrien# BINOWN	Binary owner. [root]
2015903Swosch#
2139161Sobrien# BINGRP	Binary group. [wheel]
2215903Swosch#
2315903Swosch# BINMODE	Binary mode. [555]
2415903Swosch#
2515903Swosch# NOBINMODE	Mode for non-executable files. [444]
2615903Swosch#
2715903Swosch# LIBDIR	Base path for libraries. [/usr/lib]
2815903Swosch#
2932216Swosch# LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
3032216Swosch#
3132216Swosch# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
3232216Swosch#
33218525Skeramida# LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
34218525Skeramida#
3515903Swosch# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
3615903Swosch#
3715903Swosch# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
3815903Swosch#
39119057Sobrien# LIBOWN	Library owner. [${BINOWN}]
4015903Swosch#
4115903Swosch# LIBGRP	Library group. [${BINGRP}]
4215903Swosch#
4315903Swosch# LIBMODE	Library mode. [${NOBINMODE}]
4415903Swosch#
4515903Swosch#
46251512Semaste# DEBUGDIR	Base path for standalone debug files. [/usr/lib/debug]
47251512Semaste#
48251512Semaste# DEBUGMODE	Mode for debug files. [${NOBINMODE}]
49251512Semaste#
50251512Semaste#
5115903Swosch# KMODDIR	Base path for loadable kernel modules
5265501Sobrien#		(see kld(4)). [/boot/kernel]
5315903Swosch#
54186894Sbz# KMODOWN	Kernel and KLD owner. [${BINOWN}]
5515903Swosch#
56186894Sbz# KMODGRP	Kernel and KLD group. [${BINGRP}]
5715903Swosch#
5853033Sphantom# KMODMODE	KLD mode. [${BINMODE}]
5915903Swosch#
6015903Swosch#
6115903Swosch# SHAREDIR	Base path for architecture-independent ascii
6215903Swosch#		text files. [/usr/share]
6315903Swosch#
6439161Sobrien# SHAREOWN	ASCII text file owner. [root]
6515903Swosch#
6639161Sobrien# SHAREGRP	ASCII text file group. [wheel]
6715903Swosch#
6815903Swosch# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
6915903Swosch#
7015903Swosch#
71223596Sse# CONFDIR	Base path for configuration files. [/etc]
72223596Sse#
73223596Sse# CONFOWN	Configuration file owner. [root]
74223596Sse#
75223596Sse# CONFGRP	Configuration file group. [wheel]
76223596Sse#
77223596Sse# CONFMODE	Configuration file mode. [644]
78223596Sse#
79223596Sse#
8015903Swosch# DOCDIR	Base path for system documentation (e.g. PSD, USD,
8115903Swosch#		handbook, FAQ etc.). [${SHAREDIR}/doc]
8215903Swosch#
8315903Swosch# DOCOWN	Documentation owner. [${SHAREOWN}]
8415903Swosch#
8515903Swosch# DOCGRP	Documentation group. [${SHAREGRP}]
8615903Swosch#
8715903Swosch# DOCMODE	Documentation mode. [${NOBINMODE}]
8815903Swosch#
8915903Swosch#
9015903Swosch# INFODIR	Base path for GNU's hypertext system
9115903Swosch#		called Info (see info(1)). [${SHAREDIR}/info]
9215903Swosch#
9315903Swosch# INFOOWN	Info owner. [${SHAREOWN}]
9415903Swosch#
9515903Swosch# INFOGRP	Info group. [${SHAREGRP}]
9615903Swosch#
9715903Swosch# INFOMODE	Info mode. [${NOBINMODE}]
9815903Swosch#
9915903Swosch#
10015903Swosch# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
10115903Swosch#
10215903Swosch# MANOWN	Manual owner. [${SHAREOWN}]
10315903Swosch#
10415903Swosch# MANGRP	Manual group. [${SHAREGRP}]
10515903Swosch#
10615903Swosch# MANMODE	Manual mode. [${NOBINMODE}]
10715903Swosch#
10815903Swosch#
10915903Swosch# NLSDIR	Base path for National Language Support files
11090627Sphantom#		installation. [${SHAREDIR}/nls]
11115903Swosch#
11290626Sphantom# NLSOWN	National Language Support files owner. [${SHAREOWN}]
11315903Swosch#
11490626Sphantom# NLSGRP	National Language Support files group. [${SHAREGRP}]
11515903Swosch#
11661462Sghelmer# NLSMODE	National Language Support files mode. [${NOBINMODE}]
11715903Swosch#
11832216Swosch# INCLUDEDIR	Base path for standard C include files [/usr/include]
11915903Swosch
12094982Sru.if !target(__<bsd.own.mk>__)
12194982Sru__<bsd.own.mk>__:
12294982Sru
123164411Sru.if !defined(_WITHOUT_SRCCONF)
124156813SruSRCCONF?=	/etc/src.conf
125248751Semaste.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
126156836Sru.include "${SRCCONF}"
127156836Sru.endif
128164411Sru.endif
129156813Sru
13014968Swosch# Binaries
13139161SobrienBINOWN?=	root
13239161SobrienBINGRP?=	wheel
13314573SwoschBINMODE?=	555
13414968SwoschNOBINMODE?=	444
13514573Swosch
136111853Sru.if defined(MODULES_WITH_WORLD)
137111853SruKMODDIR?=	/boot/modules
138111853Sru.else
13965501SobrienKMODDIR?=	/boot/kernel
140111853Sru.endif
14148204SjmgKMODOWN?=	${BINOWN}
14248204SjmgKMODGRP?=	${BINGRP}
14348204SjmgKMODMODE?=	${BINMODE}
14448204Sjmg
14514573SwoschLIBDIR?=	/usr/lib
14632226SsteveLIBCOMPATDIR?=	/usr/lib/compat
14732226SsteveLIBDATADIR?=	/usr/libdata
148218525SkeramidaLIBEXECDIR?=	/usr/libexec
14914573SwoschLINTLIBDIR?=	/usr/libdata/lint
15014573SwoschSHLIBDIR?=	${LIBDIR}
15114968SwoschLIBOWN?=	${BINOWN}
15214968SwoschLIBGRP?=	${BINGRP}
15314968SwoschLIBMODE?=	${NOBINMODE}
15414573Swosch
155251512SemasteDEBUGDIR?=	/usr/lib/debug
156251512SemasteDEBUGMODE?=	${NOBINMODE}
15714968Swosch
158251512Semaste
15914968Swosch# Share files
16014968SwoschSHAREDIR?=	/usr/share
16139161SobrienSHAREOWN?=	root
16239161SobrienSHAREGRP?=	wheel
16314968SwoschSHAREMODE?=	${NOBINMODE}
16414968Swosch
165223596SseCONFDIR?=	/etc
166223596SseCONFOWN?=	root
167223596SseCONFGRP?=	wheel
168223596SseCONFMODE?=	644
169223596Sse
17014968SwoschMANDIR?=	${SHAREDIR}/man/man
17114968SwoschMANOWN?=	${SHAREOWN}
17214968SwoschMANGRP?=	${SHAREGRP}
17314968SwoschMANMODE?=	${NOBINMODE}
17414968Swosch
17514968SwoschDOCDIR?=	${SHAREDIR}/doc
17614968SwoschDOCOWN?=	${SHAREOWN}
17714968SwoschDOCGRP?=	${SHAREGRP}
17814968SwoschDOCMODE?=	${NOBINMODE}
17914968Swosch
18014968SwoschINFODIR?=	${SHAREDIR}/info
18114968SwoschINFOOWN?=	${SHAREOWN}
18214968SwoschINFOGRP?=	${SHAREGRP}
18314968SwoschINFOMODE?=	${NOBINMODE}
18414968Swosch
18514968SwoschNLSDIR?=	${SHAREDIR}/nls
18690626SphantomNLSOWN?=	${SHAREOWN}
18790626SphantomNLSGRP?=	${SHAREGRP}
18861462SghelmerNLSMODE?=	${NOBINMODE}
18914968Swosch
19032216SwoschINCLUDEDIR?=	/usr/include
19132216Swosch
192245752Sbrooks#
193245752Sbrooks# install(1) parameters.
194245752Sbrooks#
195245752SbrooksHRDLINK?=	-l h
196245752SbrooksSYMLINK?=	-l s
197245752Sbrooks
198245752SbrooksINSTALL_LINK?=		${INSTALL} ${HRDLINK}
199245752SbrooksINSTALL_SYMLINK?=	${INSTALL} ${SYMLINK}
200245752Sbrooks
20114968Swosch# Common variables
202125494Sru.if !defined(DEBUG_FLAGS)
203125494SruSTRIP?=		-s
204125494Sru.endif
205125494Sru
20634678SbdeCOMPRESS_CMD?=	gzip -cn
20723546SwoschCOMPRESS_EXT?=	.gz
20894982Sru
209164411Sru.if !defined(_WITHOUT_SRCCONF)
210156813Sru#
211156813Sru# Define MK_* variables (which are either "yes" or "no") for users
212156813Sru# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
213156813Sru# make(1) environment.
214156813Sru# These should be tested with `== "no"' or `!= "no"' in makefiles.
215156813Sru# The NO_* variables should only be set by makefiles.
216156813Sru#
217156813Sru
218156813Sru#
219156813Sru# Supported NO_* options (if defined, MK_* will be forced to "no",
220156813Sru# regardless of user's setting).
221156813Sru#
222156813Sru.for var in \
223228158Sfjoe    CTF \
224251512Semaste    DEBUG_FILES \
225172832Sru    INSTALLLIB \
226156869Sru    MAN \
227156869Sru    PROFILE
228156813Sru.if defined(NO_${var})
229228120Sfjoe.if defined(WITH_${var})
230228120Sfjoe.undef WITH_${var}
231228120Sfjoe.endif
232156813SruWITHOUT_${var}=
233156813Sru.endif
234156813Sru.endfor
235156813Sru
236156813Sru#
237156813Sru# Older-style variables that enabled behaviour when set.
238156813Sru#
239156813Sru.if defined(YES_HESIOD)
240156813SruWITH_HESIOD=
241156813Sru.endif
242156813Sru
243220359Simp__DEFAULT_YES_OPTIONS = \
244183242Ssam    ACCT \
245156813Sru    ACPI \
246183242Ssam    AMD \
247183242Ssam    APM \
248253396Sandrew    ARM_EABI \
249162210Simp    ASSERT_DEBUG \
250183242Ssam    AT \
251241823Smarcel    ATF \
252156813Sru    ATM \
253156813Sru    AUDIT \
254156813Sru    AUTHPF \
255156813Sru    BIND \
256156813Sru    BIND_DNSSEC \
257156813Sru    BIND_ETC \
258156813Sru    BIND_LIBS_LWRES \
259156813Sru    BIND_MTREE \
260156813Sru    BIND_NAMED \
261156813Sru    BIND_UTILS \
262222090Simp    BINUTILS \
263156813Sru    BLUETOOTH \
264250699Ssjg    BMAKE \
265156813Sru    BOOT \
266179815Sdougb    BSD_CPIO \
267183242Ssam    BSNMP \
268166255Sdelphij    BZIP2 \
269156813Sru    CALENDAR \
270229319Srwatson    CAPSICUM \
271163861Sjb    CDDL \
272156813Sru    CPP \
273250659Sbrooks    CROSS_COMPILER \
274156813Sru    CRYPT \
275183242Ssam    CTM \
276156813Sru    CXX \
277156813Sru    DICT \
278156813Sru    DYNAMICROOT \
279235654Smarcel    ED_CRYPTO \
280156813Sru    EXAMPLES \
281183242Ssam    FLOPPY \
282250658Sbrooks    FORMAT_EXTENSIONS \
283156813Sru    FORTH \
284156813Sru    FP_LIBC \
285183242Ssam    FREEBSD_UPDATE \
286156813Sru    GAMES \
287156813Sru    GCOV \
288156813Sru    GDB \
289156813Sru    GNU \
290156813Sru    GPIB \
291220359Simp    GPIO \
292156813Sru    GROFF \
293156813Sru    HTML \
294254273Speter    ICONV \
295221266Sbz    INET \
296156813Sru    INET6 \
297156813Sru    INFO \
298172832Sru    INSTALLLIB \
299156813Sru    IPFILTER \
300183242Ssam    IPFW \
301156813Sru    IPX \
302183242Ssam    JAIL \
303240404Sobrien    KDUMP \
304156813Sru    KERBEROS \
305222185Simp    KERNEL_SYMBOLS \
306170644Ssepotvin    KVM \
307246827Sdes    LDNS \
308183242Ssam    LEGACY_CONSOLE \
309157115Sru    LIB32 \
310156813Sru    LIBPTHREAD \
311156813Sru    LIBTHR \
312156813Sru    LOCALES \
313183242Ssam    LOCATE \
314156813Sru    LPR \
315235655Smarcel    LS_COLORS \
316183242Ssam    MAIL \
317156813Sru    MAILWRAPPER \
318183242Ssam    MAKE \
319156813Sru    MAN \
320183242Ssam    NDIS \
321156813Sru    NETCAT \
322183242Ssam    NETGRAPH \
323156813Sru    NIS \
324156813Sru    NLS \
325156813Sru    NLS_CATALOGS \
326158115Sume    NS_CACHING \
327183242Ssam    NTP \
328156813Sru    OPENSSH \
329156813Sru    OPENSSL \
330156813Sru    PAM \
331245606Seadler    PC_SYSINSTALL \
332156813Sru    PF \
333238010Sglebius    PKGBOOTSTRAP \
334183242Ssam    PMC \
335183242Ssam    PORTSNAP \
336183242Ssam    PPP \
337228196Sfjoe    PROFILE \
338183242Ssam    QUOTAS \
339156813Sru    RCMDS \
340156813Sru    RCS \
341156813Sru    RESCUE \
342183242Ssam    ROUTED \
343156813Sru    SENDMAIL \
344156813Sru    SETUID_LOGIN \
345156813Sru    SHAREDOCS \
346244527Semaste    SOURCELESS \
347244527Semaste    SOURCELESS_HOST \
348244527Semaste    SOURCELESS_UCODE \
349169724Skan    SSP \
350251886Speter    SVNLITE \
351169524Sdeischen    SYMVER \
352156813Sru    SYSCONS \
353244527Semaste    SYSINSTALL \
354156813Sru    TCSH \
355183242Ssam    TELNET \
356183242Ssam    TEXTPROC \
357156813Sru    TOOLCHAIN \
358156813Sru    USB \
359223209Sed    UTMPX \
360183242Ssam    WIRELESS \
361168409Spjd    WPA_SUPPLICANT_EAPOL \
362175617Sru    ZFS \
363175617Sru    ZONEINFO
364220359Simp
365220359Simp__DEFAULT_NO_OPTIONS = \
366220359Simp    BIND_IDN \
367220359Simp    BIND_LARGE_FILE \
368220359Simp    BIND_LIBS \
369220359Simp    BIND_SIGCHASE \
370220359Simp    BIND_XML \
371244527Semaste    BSD_GREP \
372231057Sdim    CLANG_EXTRAS \
373228158Sfjoe    CTF \
374251512Semaste    DEBUG_FILES \
375245803Stheraven    GPL_DTC \
376220359Simp    HESIOD \
377254273Speter    LIBICONV_COMPAT \
378237612Sobrien    INSTALL_AS_USER \
379246827Sdes    LDNS_UTILS \
380245241Sbrooks    NMTREE \
381235537Sgber    NAND \
382234782Skib    OFED \
383245527Sbz    OPENSSH_NONE_CIPHER \
384254654Sae    PKGTOOLS \
385251886Speter    SHARED_TOOLCHAIN \
386253546Sglebius    SVN \
387253546Sglebius    USB_GADGET_EXAMPLES
388220359Simp
389220359Simp#
390220359Simp# Default behaviour of some options depends on the architecture.  Unfortunately
391220359Simp# this means that we have to test TARGET_ARCH (the buildworld case) as well
392220359Simp# as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
393220359Simp# used at all in bsd.*.mk, but we have to make an exception here if we want
394221726Sru# to allow defaults for some things like clang and fdt to vary by target
395220359Simp# architecture.
396220359Simp#
397220359Simp.if defined(TARGET_ARCH)
398220359Simp__T=${TARGET_ARCH}
399220359Simp.else
400220359Simp__T=${MACHINE_ARCH}
401220359Simp.endif
402255321Stheraven.if defined(TARGET)
403255321Stheraven__TT=${TARGET}
404255321Stheraven.else
405255321Stheraven__TT=${MACHINE_ARCH}
406255321Stheraven.endif
407246354Sandrew# Clang is only for x86, powerpc and little-endian arm right now, by default.
408235133Sdim.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
409246259Sdim__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
410246354Sandrew.elif ${__T} == "arm" || ${__T} == "armv6"
411246354Sandrew__DEFAULT_YES_OPTIONS+=CLANG
412246354Sandrew# GCC is unable to build the full clang on arm, disable it by default.
413246354Sandrew__DEFAULT_NO_OPTIONS+=CLANG_FULL
414220359Simp.else
415246259Sdim__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
416220359Simp.endif
417248856Sandrew# Clang the default system compiler only on little-endian arm and x86.
418248856Sandrew.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
419248856Sandrew    ${__T} == "i386"
420242624Sbrooks__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
421255321Stheraven# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
422255321Stheraven# for pc98 for now.
423255321Stheraven.if ${__TT} == "pc98"
424255321Stheraven__DEFAULT_NO_OPTIONS+=GNUCXX
425255321Stheraven__DEFAULT_YES_OPTIONS+=GCC
426242624Sbrooks.else
427255321Stheraven__DEFAULT_NO_OPTIONS+=GCC GNUCXX
428255321Stheraven.endif
429255321Stheraven# The libc++ headers use c++11 extensions.  These are normally silenced because
430255321Stheraven# they are treated as system headers, but we explicitly disable that warning
431255321Stheraven# suppression when building the base system to catch bugs in our headers.
432255321Stheraven# Eventually we'll want to start building the base system C++ code as C++11,
433255321Stheraven# but not yet.
434255321StheravenCXXFLAGS+=	-Wno-c++11-extensions
435255321Stheraven.else
436255321Stheraven# If clang is not cc, then build gcc by default
437242624Sbrooks__DEFAULT_NO_OPTIONS+=CLANG_IS_CC
438255321Stheraven__DEFAULT_YES_OPTIONS+=GCC
439255321Stheraven# And if g++ is c++, build the rest of the GNU C++ stack
440255321Stheraven.if defined(WITHOUT_CXX)
441255321Stheraven__DEFAULT_NO_OPTIONS+=GNUCXX
442255321Stheraven.else
443255321Stheraven__DEFAULT_YES_OPTIONS+=GNUCXX
444242624Sbrooks.endif
445255321Stheraven.endif
446227775Snwhitehorn# FDT is needed only for arm, mips and powerpc
447227775Snwhitehorn.if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
448220359Simp__DEFAULT_YES_OPTIONS+=FDT
449220359Simp.else
450220359Simp__DEFAULT_NO_OPTIONS+=FDT
451220359Simp.endif
452220359Simp.undef __T
453220359Simp
454220359Simp#
455220359Simp# MK_* options which default to "yes".
456220359Simp#
457220359Simp.for var in ${__DEFAULT_YES_OPTIONS}
458156813Sru.if defined(WITH_${var}) && defined(WITHOUT_${var})
459156813Sru.error WITH_${var} and WITHOUT_${var} can't both be set.
460156813Sru.endif
461156813Sru.if defined(MK_${var})
462156813Sru.error MK_${var} can't be set by a user.
463156813Sru.endif
464156813Sru.if defined(WITHOUT_${var})
465156813SruMK_${var}:=	no
466156813Sru.else
467156813SruMK_${var}:=	yes
468156813Sru.endif
469156813Sru.endfor
470220359Simp.undef __DEFAULT_YES_OPTIONS
471156813Sru
472156813Sru#
473156813Sru# MK_* options which default to "no".
474156813Sru#
475220359Simp.for var in ${__DEFAULT_NO_OPTIONS}
476156813Sru.if defined(WITH_${var}) && defined(WITHOUT_${var})
477156813Sru.error WITH_${var} and WITHOUT_${var} can't both be set.
478156813Sru.endif
479156813Sru.if defined(MK_${var})
480156813Sru.error MK_${var} can't be set by a user.
481156813Sru.endif
482156813Sru.if defined(WITH_${var})
483156813SruMK_${var}:=	yes
484156813Sru.else
485156813SruMK_${var}:=	no
486156813Sru.endif
487156813Sru.endfor
488220359Simp.undef __DEFAULT_NO_OPTIONS
489156813Sru
490156813Sru#
491156813Sru# Force some options off if their dependencies are off.
492172571Sru# Order is somewhat important.
493156813Sru#
494172571Sru.if ${MK_LIBPTHREAD} == "no"
495172571SruMK_LIBTHR:=	no
496172571Sru.endif
497172571Sru
498177714Sru.if ${MK_LIBTHR} == "no"
499172571SruMK_BIND:=	no
500172571Sru.endif
501172571Sru
502156813Sru.if ${MK_BIND} == "no"
503156813SruMK_BIND_DNSSEC:= no
504156813SruMK_BIND_ETC:=	no
505156813SruMK_BIND_LIBS:=	no
506156813SruMK_BIND_LIBS_LWRES:= no
507156813SruMK_BIND_MTREE:=	no
508156813SruMK_BIND_NAMED:=	no
509156813SruMK_BIND_UTILS:=	no
510156813Sru.endif
511156813Sru
512254273Speter.if ${MK_ICONV} == "no"
513254273SpeterMK_LIBICONV_COMPAT:=	no
514254273Speter.endif
515254273Speter
516246827Sdes.if ${MK_LDNS} == "no"
517246827SdesMK_LDNS_UTILS:=	no
518246827Sdes.endif
519246827Sdes
520246833Sdes.if ${MK_LDNS_UTILS} != "no"
521246827SdesMK_BIND_UTILS:=	no
522246827Sdes.endif
523246827Sdes
524157378Sphk.if ${MK_BIND_MTREE} == "no"
525157378SphkMK_BIND_ETC:=	no
526157378Sphk.endif
527157378Sphk
528230972Srmh.if ${MK_SOURCELESS} == "no"
529230972SrmhMK_SOURCELESS_HOST:=	no
530230972SrmhMK_SOURCELESS_UCODE:= no
531230972Srmh.endif
532230972Srmh
533168409Spjd.if ${MK_CDDL} == "no"
534168409SpjdMK_ZFS:=	no
535228158SfjoeMK_CTF:=	no
536168409Spjd.endif
537168409Spjd
538156813Sru.if ${MK_CRYPT} == "no"
539156813SruMK_OPENSSL:=	no
540156813SruMK_OPENSSH:=	no
541156813SruMK_KERBEROS:=	no
542156813Sru.endif
543156813Sru
544220401Suqs.if ${MK_CXX} == "no"
545220401SuqsMK_CLANG:=	no
546220401SuqsMK_GROFF:=	no
547220401Suqs.endif
548220401Suqs
549183242Ssam.if ${MK_MAIL} == "no"
550183242SsamMK_MAILWRAPPER:= no
551183242SsamMK_SENDMAIL:=	no
552183242Ssam.endif
553183242Ssam
554202440Santoine.if ${MK_NETGRAPH} == "no"
555202440SantoineMK_ATM:=	no
556202440SantoineMK_BLUETOOTH:=	no
557202440Santoine.endif
558202440Santoine
559156813Sru.if ${MK_OPENSSL} == "no"
560156813SruMK_OPENSSH:=	no
561156813SruMK_KERBEROS:=	no
562156813Sru.endif
563156813Sru
564156813Sru.if ${MK_PF} == "no"
565156813SruMK_AUTHPF:=	no
566156813Sru.endif
567156813Sru
568183242Ssam.if ${MK_TEXTPROC} == "no"
569183242SsamMK_GROFF:=	no
570183242Ssam.endif
571183242Ssam
572156813Sru.if ${MK_TOOLCHAIN} == "no"
573222090SimpMK_BINUTILS:=	no
574208964SrdivackyMK_CLANG:=	no
575222090SimpMK_GCC:=	no
576156813SruMK_GDB:=	no
577156813Sru.endif
578156813Sru
579232322Sdim.if ${MK_CLANG} == "no"
580246131SdimMK_CLANG_EXTRAS:= no
581246259SdimMK_CLANG_FULL:= no
582232322SdimMK_CLANG_IS_CC:= no
583232322Sdim.endif
584232322Sdim
585156813Sru#
586156813Sru# Set defaults for the MK_*_SUPPORT variables.
587156813Sru#
588156813Sru
589156813Sru#
590156813Sru# MK_*_SUPPORT options which default to "yes" unless their corresponding
591156813Sru# MK_* variable is set to "no".
592156813Sru#
593156813Sru.for var in \
594166255Sdelphij    BZIP2 \
595156813Sru    GNU \
596221266Sbz    INET \
597156813Sru    INET6 \
598156813Sru    IPX \
599156813Sru    KERBEROS \
600170644Ssepotvin    KVM \
601183242Ssam    NETGRAPH \
602183242Ssam    PAM \
603183242Ssam    WIRELESS
604156813Sru.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
605156813Sru.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
606156813Sru.endif
607156813Sru.if defined(MK_${var}_SUPPORT)
608156813Sru.error MK_${var}_SUPPORT can't be set by a user.
609156813Sru.endif
610156813Sru.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
611156813SruMK_${var}_SUPPORT:= no
612156813Sru.else
613156813SruMK_${var}_SUPPORT:= yes
614156813Sru.endif
615156813Sru.endfor
616174548Sru
617174548Sru#
618174548Sru# MK_* options whose default value depends on another option.
619174548Sru#
620174548Sru.for vv in \
621208320Sjkim    GSSAPI/KERBEROS \
622208320Sjkim    MAN_UTILS/MAN
623174548Sru.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
624174548Sru.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
625174548Sru.endif
626174548Sru.if defined(MK_${vv:H})
627174548Sru.error MK_${vv:H} can't be set by a user.
628174548Sru.endif
629174548Sru.if defined(WITH_${vv:H})
630174548SruMK_${vv:H}:=	yes
631174548Sru.elif defined(WITHOUT_${vv:H})
632174548SruMK_${vv:H}:=	no
633174548Sru.else
634174548SruMK_${vv:H}:=	${MK_${vv:T}}
635174548Sru.endif
636174548Sru.endfor
637174548Sru
638240966Sbrooks#
639240966Sbrooks# MK_* options that default to "yes" if the compiler is a C++11 compiler.
640240966Sbrooks#
641240966Sbrooks.include <bsd.compiler.mk>
642240966Sbrooks.for var in \
643240966Sbrooks    LIBCPLUSPLUS
644240966Sbrooks.if defined(WITH_${var}) && defined(WITHOUT_${var})
645240966Sbrooks.error WITH_${var} and WITHOUT_${var} can't both be set.
646240966Sbrooks.endif
647240966Sbrooks.if defined(MK_${var})
648240966Sbrooks.error MK_${var} can't be set by a user.
649240966Sbrooks.endif
650240966Sbrooks.if ${COMPILER_FEATURES:Mc++11}
651240966Sbrooks.if defined(WITHOUT_${var})
652240966SbrooksMK_${var}:=	no
653240966Sbrooks.else
654240966SbrooksMK_${var}:=	yes
655240966Sbrooks.endif
656240966Sbrooks.else
657240966Sbrooks.if defined(WITH_${var})
658240966SbrooksMK_${var}:=	yes
659240966Sbrooks.else
660240966SbrooksMK_${var}:=	no
661240966Sbrooks.endif
662240966Sbrooks.endif
663240966Sbrooks.endfor
664240966Sbrooks
665228158Sfjoe.if ${MK_CTF} != "no"
666228158SfjoeCTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
667243393Ssjg.elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300)
668228158SfjoeCTFCONVERT_CMD=
669228158Sfjoe.else
670228158SfjoeCTFCONVERT_CMD=	@:
671228158Sfjoe.endif 
672228158Sfjoe
673237612Sobrien.if ${MK_INSTALL_AS_USER} != "no"
674243392Ssjg_uid!=	id -u
675237612Sobrien.if ${_uid} != 0
676243392Ssjg.if !defined(USER)
677243392SsjgUSER!=	id -un
678243392Ssjg.endif
679237612Sobrien_gid!=	id -gn
680237612Sobrien.for x in BIN CONF DOC INFO KMOD LIB MAN NLS SHARE
681243392Ssjg$xOWN=	${USER}
682237612Sobrien$xGRP=	${_gid}
683237612Sobrien.endfor
684237612Sobrien.endif
685237612Sobrien.endif
686237612Sobrien
687164411Sru.endif # !_WITHOUT_SRCCONF
688156813Sru
689144893Sharti.endif	# !target(__<bsd.own.mk>__)
690