[PATCH] fix cc_ge and cc_le

Rob Landley rob at landley.net
Mon Mar 13 18:06:36 UTC 2006


On Monday 13 March 2006 12:13 pm, Cristian Ionescu-Idbohrn wrote:
> On Mon, 13 Mar 2006, Rob Landley wrote:
> > On Monday 13 March 2006 1:43 am, Denis Vlasenko wrote:
> > > Without this fix, make thinks that
> > >
> > > gcc 3.4.3 <= gcc 4.0.0
> >
> > Um, gcc 3.4 _is_ less than gcc 4.0, isn't it?
> >
> > > is not true.
> >
> > I'm confused.
>
>   # Check if CC version is greater or equal than given MAJOR,MINOR
>   define cc_ge
>   $(shell [ $(CC_MAJOR) -ge $(1) -a $(CC_MINOR) -ge $(2) ] && echo y)
>   endef
>
> The macro wants both CC_MAJOR _and_ CC_MINOR greater-or-equal.

Ah, that makes sense.

> If current gcc is 4.0 and $(call cc_ge,3,4), ...),
> [ $(CC_MAJOR) -ge $(1) ] is true, but [ $(CC_MINOR) -ge $(2) ] is false.
>
> Maybe this is better:
>
> define cc_ge
> $(shell [ `expr $(CC_MAJOR) \* 100 \+ $(CC_MINOR)` -ge \
> 	  `expr $(1) \* 100 \+ $(2)` ] && echo y)
> endef

That dies with:
/bin/sh: line 0: [:         : integer expression expected

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list