Determine if a kernel is built with a specific option?

pluknet pluknet at gmail.com
Mon Jan 12 05:00:31 PST 2009


2009/1/12 Andrew Brampton <brampton at gmail.com>:
> Hi,
> I was wondering how a autoconf configure script can determine if the
> kernel is built with a particular option. In this case the code I have
> can make use of the FreeBSD polling driver, which by default isn't
> built into a kernel. So I want my configure script to determine if the
> kernel supports it, if so sets a #define, otherwise doesn't.
>
> In the past I have basically hacked my way though these configure
> scripts by looking at other examples. One such example I found was for
> Linux, which does something like this:
>
> AC_CACHE_CHECK(for device polling kernel extension, ac_cv_linux_poll_extension,
> [if grep polling `find_linuxpath include/linux/netdevice.h` >/dev/null
> 2>&1; then
>  ac_cv_linux_poll_extension=yes
> else ac_cv_linux_poll_extension=no; fi])
> if test $ac_cv_linux_poll_extension = yes; then
>    AC_DEFINE(HAVE_LINUX_POLLING)
> fi
>
> So I simply want to figure out an equalavant check I can do on FreeBSD.
>

Hi.

You may look at sysctl kern.polling presence.

-- 
wbr,
pluknet


More information about the freebsd-hackers mailing list