Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2003 13:02:48 +0300
From:      Ruslan Ermilov <ru@freebsd.org>
To:        Scott Long <scottl@freebsd.org>, Luoqi Chen <lchen@briontech.com>
Cc:        current@freebsd.org
Subject:   Change to kernel+modules build approach
Message-ID:  <20030814100248.GB88037@sunbay.com>
In-Reply-To: <3F3B43EB.8040900@freebsd.org>
References:  <AHEKICEOIHLOGINAFIINIEDLCBAA.lchen@briontech.com> <3F3B43EB.8040900@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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@sunbay.com		Sunbay Software Ltd,
ru@FreeBSD.org		FreeBSD committer

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE/O15IUkv4P6juNwoRAs8/AJ9u5HQTBuC/dap/p//YnhXaoMhB7ACgg6p7
4uimBzsGKmU9kkhFd0WKyOM=
=IX+B
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030814100248.GB88037>