Re: Defining build options based on available compiler version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-07-30 9:44, Jussi Lehtola wrote:
> I tried using
>   %global gccver %(gcc -dumpversion)
>   %if %{gccver}>= 4.6.0
>    foo here
>   %endif
>
> to conditionalize usage of quadruple precision support in a spec file
> that ships on multiple distros, but the comparison gives the error
>
>   parseExpressionBoolean returns -1
>
> Is there a way to check if the gcc version is sufficient with some rpm
> macro?

RPM 4.7 and later let you use a bit of inline Lua to do this:

%if %{lua:rpm.vercmp('%{gccver}', '4.6.0')} > 0

This has the benefit of neither comparing lexically nor dragging in 
extra build dependencies.
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux