On Mon, 29 Oct 2001 04:30:39 -0600, Peter Samuelson <[EMAIL PROTECTED]> wrote: >[kaos] >> I was hoping to compress the existing three lines to one. >> >> select_cond(CONFIG_SLIP_COMPRESSED CONFIG_SLIP slhc.o) > >Right, and I *still* don't understand why order matters. If either var >is 'n' or '', drop it, else if either var is 'm', compile as module, >else compile as builtin.
Ignoring order does not give the exact same syntax as the code it is replacing. ifsel(config1) select(config2 objects) endif If you assume that config1 is always boolean then order does not matter. If config1 is tristate then order does matter. config1 config2 objects y y y y m m m y y <=== config2 controls m m m select(config1 config2 objects), ignoring order config1 config2 objects y y y y m m m y m <=== different result m m m I know that I raised this question about boolean subsets but there is no guarantee that config1 is always boolean. Someone, somewhere will want to test a tristate config1 when selecting objects. >I think just extending select() to handle a case with more than one >CONFIG_ argument would be the cleanest approach: (a) I doubt the code >to parse this will result in anything significantly harder than just >implementating select_cond(); (b) it's one less function for the end >users to know; (c) you have not yet convinced me that order has to >matter. Ignoring the order question (convinced yet?) I agree that select() should be extended to take multiple config options, with at least one being required. select(config1 config2 config3 ... confign objects) is exactly equivalent to :- ifsel(config2) ifsel(config3) ... ifsel(confign) select(config1 objects) <=== first config controls type endif ... endif endif Since I am extending select() to a variable number of configs, I will do the same to objlink, removing objlink_cond. objlink(config1 config2 config3 ... confign target objects) is exactly equivalent to :- ifsel(config1) ifsel(config2) ifsel(config3) ... ifsel(confign) objlink(target objects) endif ... endif endif endif Configs in select() and objlink() perform an 'and' operation, all must be true for the objects to be selected or linked. Users can get the 'or' operation by listing each config in a separate statement. select(config1 objects) select(config2 objects) _______________________________________________ kbuild-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/kbuild-devel