[PATCH] fix cc_ge and cc_le
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Mon Mar 13 17:13:45 UTC 2006
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.
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
Cheers,
Cristian
More information about the busybox
mailing list