Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2009 07:36:20 -0800
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        Andrew Brampton <brampton@gmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: Determine if a kernel is built with a specific option?
Message-ID:  <20090112153620.GA76347@citylink.fud.org.nz>
In-Reply-To: <d41814900901120355h780a3232u14fa1e5da8f280ad@mail.gmail.com>
References:  <d41814900901120355h780a3232u14fa1e5da8f280ad@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 12, 2009 at 11:55:11AM +0000, Andrew Brampton wrote:
> 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.

I believe the correct way is to read kern.features from sysctl and the
appropriate code marks it with FEATURE(name, "description");

Having said that the polling code does not set this so would need to be
added.


Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090112153620.GA76347>