From a7951dc07ac4de7d6f19c59120cd58525ffb7900 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Mon, 20 Apr 2009 09:27:37 +0000 Subject: rework mpfr handling. --- contrib/crossrpms/gcc/gccnewlib.add | 70 ++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 21 deletions(-) (limited to 'contrib') diff --git a/contrib/crossrpms/gcc/gccnewlib.add b/contrib/crossrpms/gcc/gccnewlib.add index 652844ae09..d8eb188711 100644 --- a/contrib/crossrpms/gcc/gccnewlib.add +++ b/contrib/crossrpms/gcc/gccnewlib.add @@ -8,8 +8,6 @@ %define newlib_version @NEWLIB_VERS@ %endif -%define mpfr_version 2.3.1 - Name: @rpmprefix@@tool_target@-gcc Summary: @tool_target@ gcc @@ -25,20 +23,59 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{_host_rpmprefix}gcc %if "%{gcc_version}" >= "4.3.0" -BuildRequires: gmp-devel >= 4.1 +%define _gmp_minvers 4.1 +%else +%if "%{gcc_version}" >= "4.2.0" +%if %build_f95 +%define _gmp_minvers 4.1 +%endif +%endif +%endif + +%if %{defined _gmp_minvers} +BuildRequires: gmp-devel >= %{_gmp_minvers} %if "%{_build}" != "%{_host}" -BuildRequires: %{_host_rpmprefix}gmp-devel -BuildRequires: %{_host_rpmprefix}mpfr-devel +BuildRequires: %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers} +%endif +%endif + + +%if "%{gcc_version}" >= "4.4.0" +%define _mpfr_minvers 2.3.2 +%define mpfr_version 2.4.1 +%else +%if "%{gcc_version}" >= "4.3.0" +%define _mpfr_minvers 2.3.1 +%define mpfr_version 2.3.2 +%else +%if "%{gcc_version}" >= "4.2.0" +%if %build_f95 +%define _mpfr_minvers 2.2.1 +%define mpfr_version 2.3.2 +%endif +%endif +%endif +%endif + +%if %{defined _mpfr_minvers} +%{?suse10_3:%global mpfr_provided 2.2.1} +%{?fc9:%global mpfr_provided 2.3.1} +%{?fc10:%global mpfr_provided 2.3.2} +%{?fc11:%global mpfr_provided 2.4.1} + +%if %{defined mpfr_provided} +%if "%{mpfr_provided}" < "%{_mpfr_minvers}" +%define _build_mpfr 1 +%else +BuildRequires: mpfr-devel >= %{_mpfr_minvers} %endif -%if 0%{?fedora} >= 8 -BuildRequires: mpfr-devel >= 2.3.0 +%else +%define _build_mpfr 1 %endif -%if "%{?suse}" > "10.3" -BuildRequires: mpfr-devel >= 2.3.0 + +%if "%{_build}" != "%{_host}" +BuildRequires: %{_host_rpmprefix}mpfr-devel >= %{_mpfr_minvers} %endif -# These distros ship an insufficient mpfr -%{?el4:%define _build_mpfr 1} -%{?suse10_3:%define _build_mpfr 1} %endif %if "%{_build}" != "%{_host}" @@ -47,12 +84,6 @@ BuildRequires: @rpmprefix@@tool_target@-gcc = %{gcc_rpmvers} %if "%{gcc_version}" >= "4.2.0" BuildRequires: flex bison -%if %build_f95 -BuildRequires: gmp-devel >= 4.1 -%if 0%{?fedora} >= 8 -BuildRequires: mpfr-devel >= 2.2.1 -%endif -%endif %endif %if %build_gcj @@ -84,9 +115,6 @@ BuildRequires: zlib-devel BuildRequires: gcc-gnat BuildRequires: @rpmprefix@@tool_target@-newlib < %{newlib_version}-@NEWLIB_RPMREL@ %endif -%if %build_f95 -BuildRequires: gmp-devel -%endif %if "%{gcc_version}" >= "3.4" %define gcclib %{_libdir}/gcc -- cgit v1.2.3