From owner-freebsd-arch@FreeBSD.ORG Tue Jan 3 23:38:17 2012 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97C11065672; Tue, 3 Jan 2012 23:38:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 383308FC08; Tue, 3 Jan 2012 23:38:17 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id q03NVhZo012969 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 3 Jan 2012 16:31:44 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 3 Jan 2012 16:31:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <15285562-E9BA-431B-A2C1-D0547DFB2663@bsdimp.com> <201201030924.44493.jhb@freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 03 Jan 2012 16:31:45 -0700 (MST) Cc: John Baldwin , freebsd-arch@FreeBSD.org Subject: Re: Request for help: how do teach module building about kernel options? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 23:38:17 -0000 On Jan 3, 2012, at 12:06 PM, Adrian Chadd wrote: > On 3 January 2012 10:56, Warner Losh wrote: >=20 >>> So how about we do up say, the KERNOPTS field first, which would be = a >>> big win. Then KERNDEVICES too, if that's possible? >>=20 >> I'd only planned on doing KERNOPTS :) >=20 > KERNOPTS would be fine for now. That at least gets me out of my > initial issues with wlan/ath building and the fun in handling options. Please find enclosed a proposed patch. This will not build, of course, = since there's no file in the tree mesh_baby.c, so if you have = IEEE80211_SUPPORT_MESH defined, it won't work. It keys off the actual = define. It even works with devices (which define DEV_xxx), but only if you have = it in the options file like isa (eg, you need to tell config to generate = it). Comments? Warner Index: conf/kmod.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- conf/kmod.mk (revision 229436) +++ conf/kmod.mk (working copy) @@ -324,7 +324,16 @@ ${_src}: ln -sf ${KERNBUILDDIR}/${_src} ${.TARGET} .endif +.if exists(${KERNBUILDDIR}/${_src}) +_opts!=3Dcut -d' ' -f 2 ${KERNBUILDDIR}/${_src} +.for _o in ${_opts} +KERNOPT_${_o}=3D1 +.if defined(SRCS_${_o}) +SRCS+=3D${SRCS_${_o}} +.endif .endfor +.endif +.endfor .else .for _src in ${SRCS:Mopt_*.h} CLEANFILES+=3D ${_src} Index: modules/ath/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/ath/Makefile (revision 229436) +++ modules/ath/Makefile (working copy) @@ -41,6 +41,7 @@ SRCS+=3D ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+=3D device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h = opt_wlan.h =20 +SRCS_IEEE80211_SUPPORT_MESH=3Dmesh_baby.c # # AR5210 support; these are first generation 11a-only devices. #