Subject: dumb config(5) question
To: None <tech-kern@netbsd.org>
From: Bucky Katz <bucky@picovex.com>
List: tech-kern
Date: 09/06/2007 16:26:06
I have a device driver I'm trying to use in two different sorts of
system configurations.  In the first, it exports an interface to a
machine independent layer. In the second, it doesn't export the
interface.

This is embedded stuff, and space is tight, so I thought about using

#ifdef EXPORT_MI_IF
#endif

pairs around the code in the driver that's only in use when the MI
layer is configured.

It would be easy to do this if I made the configuration file writer
remember to set an option in the config whenever they want to use the
MI layer. But that's error prone, and besides, the presence of the mi
device in the config file already tells whether they're using the
layer or not.

So I decided that I'd set EXPORT_MI_IF "automatically" in the device
driver whenever the mi device is configured.  I *thought* I could do
this by using something like

defflag opt_mumble.h EXPORT_MI_IF : mi_device

but if I try that I get 'option `EXPORT_MI_IF' dependency `mi_device'
is an interface attribute' error messages

I'm not having any luck understanding from man 5 config just what I'm
allowed to do here.

Anyone have advice on how to accomplish what I intend?

Thanks