Conditional compilation

Gary Thomas gary@mlbassoc.com
Mon Oct 20 12:10:00 GMT 2003


I have a device which can be configured one of two ways.  I need a
separate driver file (this is for MicroWindows, trying to decide
between a mouse and a touch screen).  Is there a better way to handle
this than how I've done it?

        cdl_component CYGBLD_MICROWINDOWS_PROT732_MOUSE_DRIVER {
            display        "Mouse selection"
            legal_values   { "pc" "ms" "logi" "ps2" "ts" }
            default_value  { "logi" }
            cdl_option CYGBLD_MICROWINDOWS_PROT732_MOUSE_DRIVER_MOUSE {
               description   "Use mouse on PS/2 port"
               calculated    { CYGBLD_MICROWINDOWS_PROT732_MOUSE_DRIVER != "ts" }
               no_define
               compile       drivers/mou_ser.c
            }
            cdl_option CYGBLD_MICROWINDOWS_PROT732_MOUSE_DRIVER_TOUCH {
               description   "Use touch screen for mouse"
               calculated    { CYGBLD_MICROWINDOWS_PROT732_MOUSE_DRIVER == "ts" }
               no_define
               compile       drivers/mou_prot732ts.c
            }
        }

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates



More information about the Ecos-devel mailing list