3 # Note: This file is also duplicated in the sys/conf/kern.pre.mk so
4 # it will always grab SRCCONF, even if it isn't being built in-tree
5 # to preserve historical (and useful) behavior. Changes here need to
6 # be reflected there so SRCCONF isn't included multiple times.
8 .if !defined(_WITHOUT_SRCCONF)
9 # Allow user to configure things that only effect src tree builds.
10 SRCCONF?= /etc/src.conf
11 .if !empty(SRCCONF) && \
12 (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && \
13 !target(_srcconf_included_)
15 # Validate that the user didn't try setting an env-only variable in
16 # their src.conf. This benefits from already including bsd.mkopt.mk.
17 .for var in ${__ENV_ONLY_OPTIONS:O:u}
18 __presrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
21 .sinclude "${SRCCONF}"
22 _srcconf_included_: .NOTMAIN
24 # Validate the env-only variables.
25 .for var in ${__ENV_ONLY_OPTIONS:O:u}
26 __postrcconf_${var}:= ${MK_${var}:U-}${WITHOUT_${var}:Uno:Dyes}${WITH_${var}:Uno:Dyes}
27 .if ${__presrcconf_${var}} != ${__postrcconf_${var}}
28 .error Option ${var} may only be defined in ${SRC_ENV_CONF}, environment, or make argument, not ${SRCCONF}.
30 .undef __presrcconf_${var}
31 .undef __postrcconf_${var}
37 # The following should be removed no earlier than LLVM11 being imported into the
38 # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the
39 # default over to -fno-common, making this redundant.
40 CFCOMMONFLAG?= -fno-common
41 CFLAGS+= ${CFCOMMONFLAG}
45 # tempting, but bsd.compiler.mk causes problems this early
46 # probably need to remove dependence on bsd.own.mk
47 #.include "src.opts.mk"