150476Speter# $FreeBSD: stable/11/share/mk/bsd.opts.mk 322688 2017-08-19 01:40:30Z ngie $
215903Swosch#
3264661Simp# Option file for src builds.
415903Swosch#
5264661Simp# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
6264661Simp# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
7322104Sngie# with (usually) sensible defaults.
815903Swosch#
9264661Simp# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
10264661Simp# are applicable for that Makefile (typically there are none, but sometimes there
11264661Simp# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
12264661Simp# to omit from that make.
1315903Swosch#
14275731Simp# Makefiles must include bsd.mkopt.mk before they test the value of any MK_FOO
15264661Simp# variable.
1615903Swosch#
17264661Simp# Makefiles may also assume that this file is included by bsd.own.mk should it
18264661Simp# need variables defined there prior to the end of the Makefile where
19264661Simp# bsd.{subdir,lib.bin}.mk is traditionally included.
2015903Swosch#
21264661Simp# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
22264661Simp# should be added. Old instances should be removed since they were just to
23264661Simp# bridge the gap between FreeBSD 4 and FreeBSD 5.
2423546Swosch#
25264661Simp# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
26264661Simp# exception is made for _WITHOUT_SRCONF which turns off this mechanism
27264661Simp# completely).
2823546Swosch#
2915903Swosch
30264661Simp.if !target(__<bsd.opts.mk>__)
31264661Simp__<bsd.opts.mk>__:
3294982Sru
33164411Sru.if !defined(_WITHOUT_SRCCONF)
34245752Sbrooks#
35156813Sru# Define MK_* variables (which are either "yes" or "no") for users
36156813Sru# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
37156813Sru# make(1) environment.
38156813Sru# These should be tested with `== "no"' or `!= "no"' in makefiles.
39264661Simp# The NO_* variables should only be set by makefiles for variables
40264661Simp# that haven't been converted over.
41156813Sru#
42156813Sru
43266756Simp# Only these options are used by bsd.*.mk. KERBEROS and OPENSSH are
44322104Sngie# unfortunately needed to support statically linking the entire
45266756Simp# tree. su(1) wouldn't link since it depends on PAM which depends on
46266756Simp# ssh libraries when building with OPENSSH, and likewise for KERBEROS.
47264931Simp
48266756Simp# All other variables used to build /usr/src live in src.opts.mk
49266756Simp# and variables from both files are documented in src.conf(5).
50266756Simp
51220359Simp__DEFAULT_YES_OPTIONS = \
52264931Simp    ASSERT_DEBUG \
53291955Semaste    DEBUG_FILES \
54265838Simp    DOCCOMPRESS \
55274662Simp    INCLUDES \
56264931Simp    INSTALLLIB \
57264931Simp    KERBEROS \
58264931Simp    MAN \
59264931Simp    MANCOMPRESS \
60264931Simp    NIS \
61265093Simp    NLS \
62264931Simp    OPENSSH \
63264931Simp    PROFILE \
64264931Simp    SSP \
65264931Simp    SYMVER \
66265830Simp    TOOLCHAIN \
67265830Simp    WARNS
68264931Simp
69264931Simp__DEFAULT_NO_OPTIONS = \
70290526Sbdrewery    CCACHE_BUILD \
71264931Simp    CTF \
72284345Ssjg    INSTALL_AS_USER \
73284345Ssjg    STALE_STAGED
74264931Simp
75284345Ssjg__DEFAULT_DEPENDENT_OPTIONS = \
76284345Ssjg    STAGING_MAN/STAGING \
77284345Ssjg    STAGING_PROG/STAGING \
78295987Sbdrewery
79295987Sbdrewery
80264931Simp.include <bsd.mkopt.mk>
81264931Simp
82265580Simp#
83265580Simp# Supported NO_* options (if defined, MK_* will be forced to "no",
84265580Simp# regardless of user's setting).
85265580Simp#
86265580Simp# These are transitional and will disappaer in the FreeBSD 12.
87265580Simp#
88265580Simp.for var in \
89265580Simp    CTF \
90265580Simp    DEBUG_FILES \
91265580Simp    INSTALLLIB \
92265580Simp    MAN \
93265830Simp    PROFILE \
94265830Simp    WARNS
95265580Simp.if defined(NO_${var})
96296217Semaste.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
97265580SimpMK_${var}:=no
98265580Simp.endif
99265580Simp.endfor
100265580Simp
101284345Ssjg.if ${MK_STAGING} == "no"
102284345SsjgMK_STALE_STAGED= no
103284345Ssjg.endif
104284345Ssjg
105292084Simp.include <bsd.cpu.mk>
106292084Simp
107264661Simp.endif # !_WITHOUT_SRCCONF
108228158Sfjoe
109243392Ssjg.endif
110