From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 12 13:00:30 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 98B5510656FA for ; Mon, 12 Jan 2009 13:00:30 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 927F78FC18 for ; Mon, 12 Jan 2009 13:00:29 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so3672783fgb.35 for ; Mon, 12 Jan 2009 05:00:28 -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:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=VKtK+CF8CEwODsm8A+/mfreraJf2lfOrxAdTWFeQMlU=; b=lpqm1lZY3r2YH7PHalYoqeb+tQz+RQcsgcC1SgiHiGTryr7GkHk6pUXsTLWNvbfIIN JNA8mp+1q1n+5HmsbIFJVC6UL7MHT3Om9jKaqYjQb7JjKyY/JlIla7vgDVXnSp74vPO0 8EjOLNAv03X8WoiP9MjFbm2FXH2N5R+A3V/SU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=wbpT8ML78P6/Bb8V/r1zrEJBR60jQWcXQeVZ3iN4qBza86MA7vUo4ADSi5jr6nWcRh 7e965AALRXtY838riioTDDY65V/KfBN6QGdcEMdxr1u/Wp711aqX72EVLBfOo7RSFhFh BpU1LS8UFmHVipegs8JmNA9kmxx4D+JJiCqnw= Received: by 10.86.51.10 with SMTP id y10mr16730310fgy.51.1231765228453; Mon, 12 Jan 2009 05:00:28 -0800 (PST) Received: by 10.86.72.19 with HTTP; Mon, 12 Jan 2009 05:00:28 -0800 (PST) Message-ID: Date: Mon, 12 Jan 2009 16:00:28 +0300 From: pluknet To: "Andrew Brampton" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: hackers@freebsd.org Subject: Re: 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 13:00:31 -0000 2009/1/12 Andrew Brampton : > 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