Date: Tue, 3 Jan 2012 16:31:37 -0700 From: Warner Losh <imp@bsdimp.com> To: Adrian Chadd <adrian@FreeBSD.org> Cc: John Baldwin <jhb@FreeBSD.org>, freebsd-arch@FreeBSD.org Subject: Re: Request for help: how do teach module building about kernel options? Message-ID: <EBBFC2E5-034E-42EA-9D95-69454832470D@bsdimp.com> In-Reply-To: <CAJ-VmonfMnMMmK=zzmaE=u8uRT_yxK06WP4%2BcVzGfBdSaXAtqQ@mail.gmail.com> References: <CAJ-Vmomk4JTnZ0avRqdte9Th5F7G7x9eWTcwcd%2BT4HrcE0Mgxw@mail.gmail.com> <15285562-E9BA-431B-A2C1-D0547DFB2663@bsdimp.com> <201201030924.44493.jhb@freebsd.org> <CAJ-VmondtfzqRhD5nFZuHYJOc91sKM4BKhkVZsq0w4bgtDTFvw@mail.gmail.com> <B25F6CF4-6FBF-4E47-8832-AD4830E61728@bsdimp.com> <CAJ-VmonfMnMMmK=zzmaE=u8uRT_yxK06WP4%2BcVzGfBdSaXAtqQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 3, 2012, at 12:06 PM, Adrian Chadd wrote: > On 3 January 2012 10:56, Warner Losh <imp@bsdimp.com> 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. #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EBBFC2E5-034E-42EA-9D95-69454832470D>