Peter Samuelson wrote: > > I've come up with syntax I think I'm happy with. It supports most of > the current [ ] based if statement semantics, can be implemented in > shell, and (most importantly for me) drops those $ signs. This lays > the groundwork for stuff like better error checking and auto > (EXPERIMENTAL) tags. > > I've reused the syntax for a dependency line (the tail end of a > dep_bool / dep_mbool / dep_tristate), like so: > > if_dep <i>dependency line</i> > ... > endif > > If the dependency line evaluates to 'm' or 'y', the body is executed.
Hmm. Perhaps (I haven't completely thought this through) by analogy with dep_bool/dep_mbool, you would want two new if statements which differ in the way they treat 'm'? If the conditional syntax is the same people may expect that. Also you will want to define the behaviour when the line evaluates to "0". ./arch/sparc64/config.in:180: if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then ./drivers/scsi/Config.in:166: if [ "$CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS" = "0" ]; then > [*] "almost enough" because I haven't implemented an 'else' > directive. It would be trivial, but I'm not sure what to call it. > 'else' itself is a shell primitive, so the shell-based parsers > (Configure, Menuconfig) wouldn't like it. You will need to implement it. You could call it elsedep. > * 'or' placed between dependencies functions as a logical OR, and > takes very low precedence. This complements the implicit AND > performed between every pair of dependencies. > > x or x -> x, for any x > n or m == m or n -> m > n or y == y or n -> y > m or y == y or m -> y How about an 'and' operator too, which is redundant but more readable. > --- 2.5.31/scripts/Menuconfig 2002-06-09 00:27:32.000000000 -0500 > +++ 2.5.31w/scripts/Menuconfig 2002-08-14 21:00:27.000000000 -0500 > @@ -112,6 +115,67 @@ > eval info="\$INFO_$1" > } > > + > +# Reduce a dependency line down to a single char [ymn]. > +# Terms are implicitly ANDed together: 'y m' = 'm y' = m, '... n' = 'n ...' = n Also 'y y' = y I'll look at the rest when there's an "else". Greg. -- the price of civilisation today is a courageous willingness to prevail, with force, if necessary, against whatever vicious and uncomprehending enemies try to strike it down. - Roger Sandall, The Age, 28Sep2001. ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel