kmod build: start generating opt_global.h, include it
For untied module builds, we'll generate opt_foo headers if they're included in SRCS. However, options that would normally be represented in opt_global.h aren't properly represented. Start generating opt_global.h with #define VIMAGE for !mips since it's almost universally a project default and right now kmods must hack it in themselves in order to be properly compiled for the default kernel. For example, ^/sys/modules/pf/Makefile Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23345
This commit is contained in:
parent
fbd46fe94a
commit
0c4c594841
@ -8,6 +8,10 @@
|
||||
# the code here when they all produce identical results
|
||||
# (or should)
|
||||
.if !defined(KERNBUILDDIR)
|
||||
opt_global.h:
|
||||
.if ${MACHINE} != "mips"
|
||||
@echo "#define VIMAGE 1" > ${.TARGET}
|
||||
.endif
|
||||
opt_bpf.h:
|
||||
echo "#define DEV_BPF 1" > ${.TARGET}
|
||||
.if ${MK_INET_SUPPORT} != "no"
|
||||
|
@ -106,6 +106,9 @@ NOSTDINC= -nostdinc
|
||||
CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} ${INCLMAGIC} ${CFLAGS:M-I*}
|
||||
.if defined(KERNBUILDDIR)
|
||||
CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h
|
||||
.else
|
||||
SRCS+= opt_global.h
|
||||
CFLAGS+= -include ${.OBJDIR}/opt_global.h
|
||||
.endif
|
||||
|
||||
# Add -I paths for system headers. Individual module makefiles don't
|
||||
|
Loading…
x
Reference in New Issue
Block a user