This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: calculated value for "compile" attribute of CDL component?


>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:

    Grant> I'm trying to figure out how to change the value of the
    Grant> "compile" attribute based on the value of a CDL
    Grant> configuration variable. Is that field interpreted as a TCL
    Grant> expression, or is it just transferred litereally into the
    Grant> makefile?

I am afraid it is just a literal list, not an expression. Originally I
had planned to make the compile property accept a list expression,
but that would have meant quoting all the file names e.g.

    compile { "tom.c" (CYGSEM_whatever ? "dick.c" : "harry.c") }

Otherwise the parser has no easy way of knowing whether tom.c is
a constant string or a strange name for a configuration option. In
theory heuristics can be used for this, but there would have been
ambiguities. Although expressions for compile properties are
occasionally useful, requiring quotes around the filenames seemed too
inconvenient a price.

Most of the time people can achieve what they need simply by putting
compile properties into components or options, rather than putting
them all in the cdl_package definition. For example:

    cdl_package ABC {
        compile always.c

        cdl_option ABC_DEF {
            compile sometimes.c
        }

        cdl_component ABC_GHI {
            compile occasional.c
        }
    }

This does not handle complicated situations, nor the situation where
you want to compile a file unless a particular option is enabled. Such
cases can be handled by inventing dummy calculated options, but that
is not ideal.

I have considered adding a new property

    compile_if { expr } file1.c file2.c ...

where the specified files only get built if the expression evaluates
to true, but there has been little demand for such a property.

Bart

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]