From owner-freebsd-arch@FreeBSD.ORG Sat Dec 31 23:39:43 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C07106564A for ; Sat, 31 Dec 2011 23:39:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 67DF18FC0C for ; Sat, 31 Dec 2011 23:39:43 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so20130087vcb.13 for ; Sat, 31 Dec 2011 15:39:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=t4yAQ5itg2kcphdNAfKpPCL9g+DN+Mon7n3GEIN5R4M=; b=aD2KZ2YRJun6NE8rhIvdRD0sJNHSsDVpsm9zsoqmGKhJGL0FaWeZUP5jYw7yquP7Kp lE7hBHT03biQDn/CzltmU0kv00V5S8a4R+vItKF1tnNdYIcn8qAnPqskV7LcgZyTdaAh XOlkYAPO9PyaqHIfh5ygeZi4KX6d8Sxwqy5Zk= MIME-Version: 1.0 Received: by 10.220.213.137 with SMTP id gw9mr25285061vcb.3.1325374782629; Sat, 31 Dec 2011 15:39:42 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Sat, 31 Dec 2011 15:39:42 -0800 (PST) Date: Sat, 31 Dec 2011 15:39:42 -0800 X-Google-Sender-Auth: AbFrr9DGqyqpOsPlGi6JzC-IXc8 Message-ID: From: Adrian Chadd To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Request for help: how do teach module building about kernel options? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2011 23:39:43 -0000 Hi, I need a bit of a hand with this. I'd like to be able to make the wlan and ath modules aware of kernel configuration options. For example, a kernel configuration with IEEE80211_SUPPORT_TDMA won't build a wlan module that'll run successfully, as wlan/Makefile doesn't know to suck in ieee80211_tdma.c . I could just wrap the whole file up in an #ifdef, but I'd like to try and instead only build / link that object in if it's needed. Similarly, the ath module currently builds everything, regardless of what options are currently enabled in the kernel configuration file. So it'll always build ar5210, ar5211, ar5212, ar5416, ar9001, ar9002 support, along with ath_rate_sample. Instead, I'd like to be able to specify which HAL objects to link in, much like how you can do this with "device ath_rfX" for the RF backends and "device ath_arX" for the chipset support. For the integrated SoC stuff, it'd be nice to only build a HAL which supports the relevant hardware, rather than having to suck it _all_ in. So, what kinds of evil ways can people dream up to achieve this? :) Adrian