Date: Tue, 3 Jan 2012 18:31:11 -0700 From: Warner Losh <imp@bsdimp.com> To: Adrian Chadd <adrian@freebsd.org> Cc: freebsd-arch@freebsd.org Subject: Re: Request for help: how do teach module building about kernel options? Message-ID: <5B845928-5DDC-4DB8-BFD5-1A0599D261EC@bsdimp.com> In-Reply-To: <CAJ-Vmo=quF5oDs7WFx01BDXy2nUHhEWvsWncLxYyzKxq36K5JQ@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> <EBBFC2E5-034E-42EA-9D95-69454832470D@bsdimp.com> <CAJ-Vmo=quF5oDs7WFx01BDXy2nUHhEWvsWncLxYyzKxq36K5JQ@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
On Jan 3, 2012, at 5:12 PM, Adrian Chadd wrote: > On 3 January 2012 15:31, Warner Losh <imp@bsdimp.com> wrote: > >> 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? > > I don't strictly need the SRCS line just yet - I can wrap it up in an > if: (not correct make fu, but you get the idea): > > .if (KERNOPT_IEEE80211_SUPPORT_MESH == 1) > SRCS+= ieee80211_mesh.c > .endif > > .if (KERNOPT_IEEE80211_SUPPORT_TDMA == 1) > SRCS+= ieee80211_tdma.c > .endif The problem with this method is the chicken/egg problem. These defines aren't defined until after kmod.mk has been included. But the kmod.mk files depend, in some places, on having a full list. The SRCS_IEE80211_SUPPORT_MESH solves this problem nicely. > What do you mean about DEV_xxx? Can you give me an example to look at > in the sys directory? isa. Look at sys/conf/options* to see what I'm talking about. Warnerhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5B845928-5DDC-4DB8-BFD5-1A0599D261EC>
