Defining build options based on available compiler version

Jussi Lehtola jussilehtola at fedoraproject.org
Sat Jul 30 17:40:58 UTC 2011


On Sat, 30 Jul 2011 11:50:51 -0500
Richard Shaw <hobbes1069 at gmail.com> wrote:
> I'm just guessing here, but I think because of the dots it's returning
> a string instead of a number which makes the >= comparison invalid. Is
> there another gcc option that will give you a "dotless" version
> number?
> 
> I would try something like:
> 
> %global gccver %(gcc -dumpversion | sed "s/\.//g")
> %if %{gccver} >= 460
> foo here
> %endif

I'm guessing, too, that the issue has to do with strings vs numbers.
The above version also fails with "parseExpressionBoolean returns -1".
-- 
Jussi Lehtola
Fedora Project Contributor
jussilehtola at fedoraproject.org


More information about the devel mailing list