John Cowan <[EMAIL PROTECTED]>: > >Keith Owens <[EMAIL PROTECTED]>: > >>I need a variable out of both CML1 and CML2 that contains a list. That > >>list will vary from one architecture to another and possibly from one > >>kernel to another (old HIGHMEM would have been in the list, new HIGHMEM > >>is not). The simplest way of defining a list is a string variable > >>containing white space separated names. I just want CML2 to let me > >>derive a variable from a string expression. > > > > OK. I can do that. How are you going to condition the value on an > > architecture, though? Is your derivation going to look something like > > this? > > > > derive MYVAR from (X86 ? "a" : (PPC ? "b" : (ARM ? "c" : "x"))) > > A little syntactic sugar would serve: > > derive MYVAR from "a" if X86 > derive MYVAR from "b" if PPC > derive MYVAR from "c" if ARM > derive MYVAR from "x" > > Multiple derive statmeents with the same var are merged thus; it is > still an error to have more than one unconditional derivation, which > in the presence of conditional derivations is made the "else" clause. > All this can be compiled away, leaving cmlconfigure unchanges. > > The default statement could get the same treatment.
After some thought and coding and staring at examples, I have decided that supporting split derivations is not a good idea. The compilation part is ugly and fragile; but more importantly, the feature would have rulebase-maintainance implications strictly analogous to that of GO TO in an imperative language (actually it's arguably more like the even more hideous COME FROM, which I've already implemented once, thank you). Keith, you can derive string symbols with expressions like derive MYVAR from (X86 ? "a" : (PPC ? "b" : (ARM ? "c" : "x"))) now. Yes, this will lead to large ugly expressions, but those large ugly expressions will be in *one place*. In the kernel rulebase, the correct "one place" is with the other cross-architecture stuff in the toplevel rules.cml file. -- <a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a> A man with a gun is a citizen. A man without a gun is a subject. _______________________________________________ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel