Change to kernel+modules build approach

Ruslan Ermilov ru at freebsd.org
Thu Aug 14 03:04:00 PDT 2003


On Thu, Aug 14, 2003 at 02:10:19AM -0600, Scott Long wrote:
> Luoqi Chen wrote:
[...]
> >On the other hand, all modules should create all the opt_*.h files
> >it needs when built individually. Add opt_ddb.h to nullfs's Makefile
> >should fix the breakage.
> >
> Our kernel build system isn't set up to handle passing config options
> to modules.  Various solutions to this have been proposed, but nothing
> has appeared yet.  In 5.x, we document that modules will not work with
> PAE.
> 
How does the below look?  This is basically a more generic implementation
of Luoqi's idea, but for -CURRENT:

%%%
Index: kern.pre.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v
retrieving revision 1.33
diff -u -r1.33 kern.pre.mk
--- kern.pre.mk	30 Jul 2003 22:11:36 -0000	1.33
+++ kern.pre.mk	14 Aug 2003 09:39:30 -0000
@@ -91,6 +91,7 @@
 # them.
 
 MKMODULESENV=	MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
+MKMODULESENV+=	KERNOBJDIR=${.OBJDIR}
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+=	ALL_MODULES=LINT
 .endif
Index: kmod.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kmod.mk,v
retrieving revision 1.139
diff -u -r1.139 kmod.mk
--- kmod.mk	26 Jul 2003 02:27:50 -0000	1.139
+++ kmod.mk	14 Aug 2003 09:42:52 -0000
@@ -241,6 +241,10 @@
 	${KMODUNLOAD} -v ${KMOD}
 .endif
 
+.if defined(KERNOBJDIR) && !empty(KERNOBJDIR) && exists(${KERNOBJDIR})
+.PATH: ${KERNOBJDIR}
+CFLAGS+=	-I${KERNOBJDIR}
+.else
 .for _src in ${SRCS:Mopt_*.h}
 CLEANFILES+=	${_src}
 .if !target(${_src})
@@ -248,6 +252,7 @@
 	touch ${.TARGET}
 .endif
 .endfor
+.endif
 
 MFILES?= kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \
     dev/iicbus/iicbus_if.m isa/isa_if.m \
%%%


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru at sunbay.com		Sunbay Software Ltd,
ru at FreeBSD.org		FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20030814/f8f6c557/attachment.bin


More information about the freebsd-current mailing list