RFC: spec preprocessor

Michal Moskal malekith at pld-linux.org
Tue May 20 15:44:35 CEST 2003


On Tue, May 20, 2003 at 02:59:32PM +0200, Artur Frysiak wrote:
> Sorry, its members only.
> >From archive:
> 
> %define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
> %define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
> 
> %define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
> %define ifndef() %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
> 
> And additionaly (by me, not tested yet):
> %define ifwith() %if %{expand:%%{?_with_%{1}:1}0}
> %define ifwithout() %if %{expand:%%{?_without_%{1}:1}0}

Maybe something like:

%define bcond_with()	%{expand:%%{?_with_%{1}:%%define %{1} 1}}
%define bcond_without()	%{expand:%%{!?_without_%{1}:%%define %{1} 1}}

And then:

%bcond_with	foo	# foo inc. support
%bcond_without	bar	# bar fonts support

%ifdef foo
...
%endif

%ifdef bar
...
%endif

%{?foo: ... }
%{?bar: ... }

Would be nice?

But it doesn't seem to work...

-- 
: 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