This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Mode conditional CDL
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos development <ecos-devel at ecos dot sourceware dot org>
- Date: 22 Oct 2003 15:16:27 -0600
- Subject: Mode conditional CDL
- Organization: MLB Associates
I've found another thing I'd like to do with CDL that is cumbersome.
We have the RedBoot "model" string HAL_PLATFORM_BOARD. When there
is a package which supports more than one board type, I'd like to
have this reflect the model chosen. Sadly, I've not figured out
how to do this in the define_proc at the top of the package. I
ended up adding something like this:
Index: hal/powerpc/rattler/current/cdl/hal_powerpc_rattler.cdl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/powerpc/rattler/current/cdl/hal_powerpc_rattler.cdl,v
retrieving revision 1.2
diff -u -5 -p -r1.2 hal_powerpc_rattler.cdl
--- hal/powerpc/rattler/current/cdl/hal_powerpc_rattler.cdl 28 Aug 2003 15:55:54 -0000 1.2
+++ hal/powerpc/rattler/current/cdl/hal_powerpc_rattler.cdl 22 Oct 2003 21:00:22 -0000
@@ -138,10 +138,14 @@ cdl_package CYGPKG_HAL_POWERPC_RATTLER {
flavor bool
default_value 0
description "
The Rattler comes in two variants - one with PCI
and another without."
+ define_proc {
+ puts $::cdl_header "#undef HAL_PLATFORM_BOARD"
+ puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Rattler-PCI\""
+ }
}
# Real-time clock/counter specifics
cdl_component CYGNUM_HAL_RTC_CONSTANTS {
display "Real-time clock constants."
I also couldn't put C style #ifdefs to handle this because the CDL
option which it depends on is not defined (has not yet been emitted
in the platform.h file) until later on.
If there's a better way to handle this, I'd be happy to hear about
it. I'd also like to figure a way to do things like define a string
which is the board clock speed, etc. Ideas?
Thanks
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates