RFC: spec preprocessor

Michal Moskal malekith at pld-linux.org
Wed May 21 10:26:10 CEST 2003


On Wed, May 21, 2003 at 08:57:20AM +0200, Artur Frysiak wrote:
> > Maybe define with_foo for --with foo or lack of --without foo?
> 
> Whats about default value ?
> Maybe:
> %define bcond() %{expand:%%{?_with_%{1}:%%{?_without_%{1}:%%{error:Bcond colision} exit1}%%global %{1} %%{!?_without_%{1}:%%{?_with_%{1}:1}%%{!?_with_%{1}:%{2}}}0}
> 
> And usage:
> %bcond foo 1 # foo support
> 
> %if %{foo}
> %if %{bar}
> with foo and bar
> %else
> with foo and without bar
> %endif
> %endif

Default depends on whatever you specify %bcond_with or %bcond_without.
But you may be right, that additional argument would be better. But:

1. foo=1 or foo=0 (as opposed to defined/undefined) makes %{?foo:...}
   impossible (or I don't know something)
2. foo for --with foo isn't best idea because of --with setup or
   similar.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h



More information about the pld-devel-en mailing list