From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 12 12:15:42 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100821065670 for ; Mon, 12 Jan 2009 12:15:42 +0000 (UTC) (envelope-from brampton@gmail.com) Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4A48FC1D for ; Mon, 12 Jan 2009 12:15:41 +0000 (UTC) (envelope-from brampton@gmail.com) Received: by bwz13 with SMTP id 13so6042045bwz.19 for ; Mon, 12 Jan 2009 04:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=HJKQ8EBuGHVYdRYRq/N/Or05V+VU6rja3eDiPNGFh1o=; b=POq4xTr8u1Bi2AYv9LX6KOz4vTmdV5jbTOtUkVYfv+qm/ofphkst5TOkLHaZggPwLd tSqVJd7jNaWG5fST2EmHKoz3AR62Nl2/XVQdrggDbSXu1yPmgqHyrb5CunQVeWgwnMNK FplmZnRbvAr9xbdLdVSwTe53bHtGPWXyrsTGU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=MpCZXVhgBMAqmHCGKnsX+W2+kZoDMQeceWs+vix2Z3AHbLTbpUGK8uVzVjNzEPjtN1 YnNECWwks7mJKFivk0i7LHdfF8BEZZdiyrjmkZLUkvToKl1Wn64dp7l0+KBl+FgEQqgb PhG1PZQsRGQHFBFNvssE/3d5uvn9PqlISyEfA= Received: by 10.223.115.16 with SMTP id g16mr20964234faq.93.1231761311405; Mon, 12 Jan 2009 03:55:11 -0800 (PST) Received: by 10.223.110.209 with HTTP; Mon, 12 Jan 2009 03:55:11 -0800 (PST) Message-ID: Date: Mon, 12 Jan 2009 11:55:11 +0000 From: "Andrew Brampton" To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mailman-Approved-At: Mon, 12 Jan 2009 12:28:05 +0000 Cc: Subject: Determine if a kernel is built with a specific option? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2009 12:15:42 -0000 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. thanks Andrew