xref: /freebsd/share/mk/bsd.opts.mk (revision 76b28ad6ab6dc8d4a62cb7de7f143595be535813)
1# $FreeBSD$
2#
3# Option file for src builds.
4#
5# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
6# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
7# with sensible (usually) defaults.
8#
9# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
10# are applicable for that Makefile (typically there are none, but sometimes there
11# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
12# to omit from that make.
13#
14# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO
15# variable.
16#
17# Makefiles may also assume that this file is included by bsd.own.mk should it
18# need variables defined there prior to the end of the Makefile where
19# bsd.{subdir,lib.bin}.mk is traditionally included.
20#
21# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
22# should be added. Old instances should be removed since they were just to
23# bridge the gap between FreeBSD 4 and FreeBSD 5.
24#
25# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
26# exception is made for _WITHOUT_SRCONF which turns off this mechanism
27# completely).
28#
29
30.if !target(__<bsd.opts.mk>__)
31__<bsd.opts.mk>__:
32
33.if !defined(_WITHOUT_SRCCONF)
34#
35# Define MK_* variables (which are either "yes" or "no") for users
36# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
37# make(1) environment.
38# These should be tested with `== "no"' or `!= "no"' in makefiles.
39# The NO_* variables should only be set by makefiles for variables
40# that haven't been converted over.
41#
42
43# Only these options are used by bsd.*.mk. Most seem legit, except maybe
44# OPENSSH.
45
46__DEFAULT_YES_OPTIONS = \
47    ASSERT_DEBUG \
48    INFO \
49    INSTALLLIB \
50    KERBEROS \
51    MAN \
52    MANCOMPRESS \
53    NIS \
54    NLS \
55    OPENSSH \
56    PROFILE \
57    SSP \
58    SYMVER \
59    TOOLCHAIN
60
61__DEFAULT_NO_OPTIONS = \
62    CTF \
63    DEBUG_FILES \
64    INSTALL_AS_USER
65
66
67# meta mode related
68__DEFAULT_NO_OPTIONS += \
69    AUTO_OBJ \
70    META_MODE \
71    STAGING \
72    STAGING_PROG
73
74.include <bsd.mkopt.mk>
75
76#
77# Supported NO_* options (if defined, MK_* will be forced to "no",
78# regardless of user's setting).
79#
80# These are transitional and will disappaer in the FreeBSD 12.
81#
82.for var in \
83    CTF \
84    DEBUG_FILES \
85    INSTALLLIB \
86    MAN \
87    PROFILE
88.if defined(NO_${var})
89# This warning may be premature...
90#.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
91MK_${var}:=no
92.endif
93.endfor
94
95.endif # !_WITHOUT_SRCCONF
96
97.endif
98