Introduce kern.opts.mk to hold all the options for kernel module

builds. Include this in the right places. Make src.opts.mk optional so
that modules can be built outside of the tree in the ports system.

PR: 189520
This commit is contained in:
Warner Losh 2014-05-09 21:11:27 +00:00
parent dfd03689d7
commit 22cac7546c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=265785
4 changed files with 33 additions and 4 deletions

View File

@ -24,7 +24,7 @@
#
# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
# exception is made for _WITHOUT_SRCONF which turns off this mechanism
# completely).
# completely inside bsd.*.mk files).
#
.if !target(__<src.opts.mk>__)
@ -84,7 +84,6 @@ __DEFAULT_YES_OPTIONS = \
FDT \
FLOPPY \
FMTREE \
FORMAT_EXTENSIONS \
FORTH \
FP_LIBC \
FREEBSD_UPDATE \
@ -105,7 +104,6 @@ __DEFAULT_YES_OPTIONS = \
IPFW \
JAIL \
KDUMP \
KERNEL_SYMBOLS \
KVM \
LDNS \
LDNS_UTILS \

24
sys/conf/kern.opts.mk Normal file
View File

@ -0,0 +1,24 @@
# $FreeBSD$
# Options set in the build system that affect the kernel somehow.
#
# Define MK_* variables (which are either "yes" or "no") for users
# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
# make(1) environment.
# These should be tested with `== "no"' or `!= "no"' in makefiles.
# The NO_* variables should only be set by makefiles for variables
# that haven't been converted over.
#
# These options are used by the kernel build process (kern.mk and kmod.mk)
# They have to be listed here so we can build modules outside of the
# src tree.
__DEFAULT_YES_OPTIONS = \
FORMAT_EXTENTIONS \
KERNEL_SYMBOLS
__DEFAULT_NO_OPTIONS = \
.include "../../share/mk/bsd.mkopt.mk"

View File

@ -5,6 +5,7 @@
.include <src.opts.mk>
.include <bsd.compiler.mk>
.include "kern.opts.mk"
# backwards compat option for older systems.
MACHINE_CPUARCH?=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/}

View File

@ -72,9 +72,15 @@ OBJCOPY?= objcopy
.error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
.endif
.include <src.opts.mk>
# Note: we're really bsd.kmod.mk, so we have to allow src.opts.mk to be
# optional. Include it if we can so we can get /etc/src.conf changes,
# if we're in the tree. If we can't include it that's OK. kern.opts.mk
# has all the kernel options in it, and should be included after src.opts.mk
# so it picks everything up.
.sinclude <src.opts.mk>
.include <bsd.init.mk>
.include <bsd.compiler.mk>
.include "kern.opts.mk"
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S