From owner-freebsd-arch@FreeBSD.ORG Mon Jul 21 01:08:39 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3AC8037B401 for ; Mon, 21 Jul 2003 01:08:39 -0700 (PDT) Received: from mail.cyberonic.com (mail.cyberonic.com [4.17.179.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D20C43F3F for ; Mon, 21 Jul 2003 01:08:38 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (node-40244c0a.sfo.onnet.us.uu.net [64.36.76.10]) by mail.cyberonic.com (8.12.8/8.12.5) with ESMTP id h6L8bu6d012496 for ; Mon, 21 Jul 2003 04:37:57 -0400 Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.9/8.11.6) id h6L88aU4026723 for arch@FreeBSD.org; Mon, 21 Jul 2003 01:08:36 -0700 (PDT) (envelope-from jmg) Date: Mon, 21 Jul 2003 01:08:36 -0700 From: John-Mark Gurney To: arch@FreeBSD.org Message-ID: <20030721080836.GF917@funkthat.com> Mail-Followup-To: arch@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Subject: module opt_* building X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2003 08:08:39 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I recently realized that for kernel module building, we can simply create a symlink pointing to the opt_*.h file created by config. (See attached patch.) This only is part of the work. The problem is that the modules/Makefile's define a target, which needs to be overriden in the case of being built as part of the kernel, and left intact when building standalone. The only thing I can think of is to add a opt_xxx.h_def or something similar to the target in the modules/Makefile, and then add a dependancy on that target in the standalone case. I have thought about a way to automate building of these options. It'd require setting up a file with defaults to build from. Extending options files? Yet another place to list options doesn't seem like a good idea. Comments? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="conf.diff" Index: kern.pre.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v retrieving revision 1.27 diff -u -r1.27 kern.pre.mk --- kern.pre.mk 2003/07/11 07:13:42 1.27 +++ kern.pre.mk 2003/07/21 08:01:25 @@ -87,7 +87,8 @@ # MKMODULESENV is set here so that port makefiles can augment # them. -MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} +MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules MAKEOBJDIR=${.OBJDIR} \ + KMODDIR=${KODIR} .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.137 diff -u -r1.137 kmod.mk --- kmod.mk 2003/03/03 22:51:22 1.137 +++ kmod.mk 2003/07/21 08:01:25 @@ -240,9 +240,15 @@ .for _src in ${SRCS:Mopt_*.h} CLEANFILES+= ${_src} +.if defined(MAKEOBJDIR) +${_src}: + rm ${.TARGET} && ln -s ${MAKEOBJDIR}/${.TARGET} +.else .if !target(${_src}) +# add code to generate opt_ file from conf. ${_src}: touch ${.TARGET} +.endif .endif .endfor --dDRMvlgZJXvWKvBx--