kernel: Define HAVE_KERNEL_OPTION_HEADERS when building kernel/modules.
authorSascha Wildner <saw@online.de>
Fri, 16 Jan 2015 08:54:35 +0000 (09:54 +0100)
committerSascha Wildner <saw@online.de>
Fri, 16 Jan 2015 08:56:16 +0000 (09:56 +0100)
It gets defined when building the kernel and when building modules
along with the kernel.

FreeBSD wraps some of their #include "opt_blah.h" in it and it should
ease porting $stuff from them.

It also makes the kernel options of the sound stack actually work.

sys/conf/kern.pre.mk
sys/conf/kmod.mk

index 776639d..31de669 100644 (file)
@@ -55,7 +55,7 @@ INCLUDES+= -I$S/dev/netif/ath/ath_hal -I$S/contrib/dev/ath/ath_hal
 # Same thing for drm includes
 INCLUDES+= -I$S/dev/drm/include
 
-COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -include opt_global.h
+COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
 CFLAGS=        ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
 
 # XXX LOCORE means "don't declare C stuff" not "for locore.s".
index 9c1ca90..b18a81b 100644 (file)
@@ -136,7 +136,7 @@ CFLAGS+=    -I@/../include -I${DESTDIR}/usr/include
 
 .if defined(BUILDING_WITH_KERNEL) && \
     exists(${BUILDING_WITH_KERNEL}/opt_global.h)
-CFLAGS+=       -include ${BUILDING_WITH_KERNEL}/opt_global.h
+CFLAGS+=       -DHAVE_KERNEL_OPTION_HEADERS -include ${BUILDING_WITH_KERNEL}/opt_global.h
 .endif
 
 CFLAGS+=       ${DEBUG_FLAGS}