summaryrefslogtreecommitdiffstats
path: root/contrib/crossrpms/gcc/gccnewlib.add
blob: 274b0b0ec4536edb4107e6630f5bb4df7799b281 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

%define gcc_pkgvers @GCC_VERS@
%define gcc_version %{expand:%%(echo "@GCC_VERS@" | sed -e 's,-.*,,')}
%define gcc_rpmvers %{expand:%%(echo "@GCC_VERS@" | tr - _ )}

%define build_newlib 1

%if %build_newlib
%define newlib_version		@NEWLIB_VERS@
%define gccnewlib_version	gcc%{gcc_version}newlib%{newlib_version}
%endif

Name:         	@rpmprefix@@tool_target@-gcc
Summary:      	@tool_target@ gcc

Group:	      	Development/Tools
Version:        %{gcc_rpmvers}
Release:      	@GCC_RPMREL@%{?dist}
License:      	GPL
URL:		http://gcc.gnu.org
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%define _use_internal_dependency_generator 0

# default languages to build
%define _cxx		1
%define _fortran	0
%define _gcj		0
%define _gnat		0
%define _objc		0
%define _libgcj 	0


# custom defaults for specific targets
%if "@tool_target@" == "arm-rtems@osversion@"
# Gnat lacks arm support
%define _gnat		0
%endif

%if "@tool_target@" == "avr-rtems@osversion@"
%define _cxx		0
%define _fortran	0
%define _gcj		0
%define _gnat		0
%endif

%if "@tool_target@" == "h8300-rtems@osversion@"
%define _fortran	0
%define _gcj		0
%define _gnat		0
%endif

%if "@tool_target@" == "sh-rtems@osversion@"
# Triggers an ICE in GCC-4.0.0
%define _gnat		0
%endif

%if "@tool_target@" == "tic4x-rtems@osversion@"
%define _cxx		0
%define _gnat		0
%define _gcj		0
%define _fortran	0
%endif

# Allow the user to build arbitrary languages
%{?_with_cxx:%define _cxx 1}
%{?_with_fortran:%define _fortran 1}
%{?_with_gcj:%define _gcj 1}
%{?_with_gnat:%define _gnat 1}
%{?_with_objc:%define _objc 1}
%{?_with_libgcj:%define _libgcj 1}

# Allow the user to suppress building languages
%{?_without_cxx:%define _cxx 0}
%{?_without_fortran:%define _fortran 0}
%{?_without_gcj:%define _gcj 0}
%{?_without_gnat:%define _gnat 0}
%{?_without_objc:%define _objc 0}
%{?_without_libgcj:%define _libgcj 0}

%define build_cxx	%_cxx
%if "%{gcc_version}" >= "4.0.0"
%define build_f95	%_fortran
%define build_g77	0
%else
%define build_f95	0
%define build_g77	%_fortran
%endif
%define build_gnat	%_gnat
%define build_gcj	%_gcj
%define build_objc	%_objc
%define build_libgcj	%_libgcj


%if %build_gcj
# Building gcj requires bison and zlib
BuildRequires:	bison
%endif

BuildRequires:	texinfo >= 4.2
BuildRequires:	@rpmprefix@@tool_target@-binutils
BuildRequires:	@rpmprefix@@tool_target@-sys-root
BuildRequires:	@rpmprefix@@tool_target@-w32api-sys-root

Requires:	@rpmprefix@@tool_target@-binutils
Requires:	@rpmprefix@@tool_target@-sys-root
Requires:	@rpmprefix@@tool_target@-w32api-sys-root
Requires:	@rpmprefix@@tool_target@-newlib = %{newlib_version}-%{release}

%if "%{_vendor}" == "redhat"
%if %build_gcj
BuildRequires:	zlib-devel
%endif
%if %build_gnat
# Building gnat requires gnat
# This really isn't available until RedHat 8.0.  How to conditionalize this?
BuildRequires:	gcc-gnat
BuildRequires:	@rpmprefix@@tool_target@-newlib < %{newlib_version}-%{release}
%endif
%if %build_f95
BuildRequires: gmp-devel
%endif
%endif

%if "%{gcc_version}" >= "3.4"
%define gcclib %{_libdir}/gcc
%define gccexec %{_libexecdir}/gcc
%else
%define gcclib %{_libdir}/gcc-lib
%define gccexec %{_libdir}/gcc-lib
%endif

@SOURCES@

%description
Cross gcc for @tool_target@.