This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: CDL question
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Grant Edwards <grante at visi dot com>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 1 Aug 2006 18:27:47 +0200
- Subject: Re: [ECOS] CDL question
- References: <20060801023656.GA28316@grante.dsl.visi.com>
On Mon, Jul 31, 2006 at 09:36:58PM -0500, Grant Edwards wrote:
> I've read through the CDL sections of the component developer's
> guide, but I can't figure out what the command is to set a data
> flavored option to an expression involving it's default value
> or it's current value.
>
> Assume I've got an ecos.ecc file that I generated via an
> "ecosconfig new whatever" command. Now I want to change the
> value of CYGBLD_GLOBAL_CFLAGS (which has its default value) to
> add "-DFooBar". This needs to be done in a shell script so
> that I can automate the entire build process. Usually when I
> need to make automated changes to ecos.ecc I create a .cdl file
> and import it like this:
>
> cat >.tmp$$.cdl <<EOF
> cdl_option CYGBLD_BUILD_REDBOOT_WITH_GDB {user_value 0}
> cdl_option CYGBLD_BUILD_REDBOOT_WITH_ZLIB {user_value 0}
> EOF
> ecosconfig import .tmp$$.cdl
>
> However, I can't figure out what the TCL expression is for "the
> current value of option CYG_WHATEVER". I thought perhaps something like
>
> option CYGBLD_GLOBAL_CFLAGS {user_value "$CYGBLD_GLOBAL_CFLAGS -DFooBar"}
>
> But that doesn't work. I'm sure it's something obvious, but
> I've never been able to grok TCL no matter how hard I try...
This method will not work. tcl has no access to CDL
variables. $CYGBLD_GLOBAL_CFLAGS means nothing to tcl.
You could use the cdl_option CYGPKG_KERNEL_CFLAGS_REMOVE,
CYGPKG_KERNEL_LDFLAGS_ADD etc to add FooBar to specific packages, in
this example the kernel.
Another idea would be something like adding a custom package with CDL
something like:
cdl_option CYGBLD_DIDDLE_THE_FLAGS {
flavor data
default_value ""
requires { is_substr(CYGBLD_GLOBAL_CFLAGS, CYGBLD_DIDDLE_THE_FLAGS) }
}
Then you can set CYGBLD_DIDDLE_THE_FLAGS from your import file and the
inference engine will do the rest.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss