]> git.pld-linux.org Git - packages/crossnacl-gcc.git/blob - crossnacl-gcc.spec
use bare git repo
[packages/crossnacl-gcc.git] / crossnacl-gcc.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap               # build without NaCL newlib package dependency (without c++ package)
4
5 %define         gitver  3937565
6 Summary:        Various compilers (C, C++) for NaCl
7 Name:           crossnacl-gcc
8 Version:        4.4.3
9 Release:        6.git%{gitver}
10 License:        GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
11 Group:          Development/Languages
12 Source0:        nacl-gcc-%{version}-git%{gitver}.tar.bz2
13 # Source0-md5:  fcdfdd30b82d8ad8fa6e39e7e32cee64
14 Source1:        get-source.sh
15 URL:            http://sourceware.org/gcc/
16 BuildRequires:  cloog-ppl-devel
17 BuildRequires:  crossnacl-binutils
18 BuildRequires:  elfutils-devel
19 BuildRequires:  gmp-c++-devel
20 BuildRequires:  gmp-devel
21 BuildRequires:  mpfr-devel
22 BuildRequires:  ppl-pwl-devel
23 BuildRequires:  tar >= 1:1.22
24 BuildRequires:  xz
25 %if %{without bootstrap}
26 BuildRequires:  crossnacl-newlib
27 %endif
28 ExclusiveArch:  %{ix86} %{x8664}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %define         target          x86_64-nacl
32 %define         arch            %{_prefix}/%{target}
33 %define         gcc_ver         %{version}
34 %define         gcclib          %{_libdir}/gcc/%{target}/%{gcc_ver}
35 %define         gccnlib         %{_prefix}/lib/gcc/%{target}/%{gcc_ver}
36
37 %define         filterout_cpp   -D_FORTIFY_SOURCE=[0-9]+
38
39 %description
40 The gcc package contains the GNU Compiler Collection version 4.4.3.
41 You'll need this package in order to compile C code.
42
43 This provides support for NaCl targets.
44
45 %package c++
46 Summary:        C++ support for crossnacl-gcc
47 Summary(pl.UTF-8):      Obsługa C++ dla crossnacl-gcc
48 Group:          Development/Languages
49 Requires:       %{name} = %{version}-%{release}
50
51 %description c++
52 This package adds C++ support to the GNU Compiler Collection for NaCl
53 targets.
54
55 %description c++ -l pl.UTF-8
56 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
57
58 %package objc
59 Summary:        NaCL binary utility development utilities - objc
60 Summary(pl.UTF-8):      Zestaw narzędzi NaCL - objc
61 Group:          Development/Languages
62 Requires:       %{name} = %{version}-%{release}
63
64 %description objc
65 This package contains cross targeted objc compiler.
66
67 %description objc -l pl.UTF-8
68 Ten pakiet zawiera kompilator objc generujący kod pod Win32.
69
70 %prep
71 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
72
73 %build
74 rm -rf obj-%{target}
75 install -d obj-%{target}
76 cd obj-%{target}
77
78 OPT_FLAGS="%{rpmcflags}"
79 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
80 %ifarch %{ix86}
81 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
82 %endif
83 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
84
85 case "$OPT_FLAGS" in
86 *-fasynchronous-unwind-tables*)
87         %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
88         ../gcc/Makefile.in
89 ;;
90 esac
91
92 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
93 ../configure \
94         --prefix=%{_prefix} \
95         --mandir=%{_mandir} \
96         --infodir=%{_infodir} \
97         --libexecdir=%{_libdir} \
98         --enable-checking=release \
99         --with-system-zlib \
100         --enable-__cxa_atexit \
101         --disable-libunwind-exceptions \
102         --enable-gnu-unique-object \
103         --disable-decimal-float \
104         --disable-libgomp \
105         --disable-libmudflap \
106         --disable-libssp \
107         --disable-libstdcxx-pch \
108         --disable-shared \
109         --with-ppl --with-cloog \
110         CC="%{__cc}" \
111         CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
112         CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
113         XCFLAGS="$OPT_FLAGS" \
114 %if %{with bootstrap}
115         --disable-threads \
116         --enable-languages="c" \
117         --without-headers \
118         CFLAGS_FOR_TARGET="-O2 -g" \
119         CXXFLAGS_FOR_TARGET="-O2 -g" \
120 %else
121         CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
122         CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
123         --enable-threads=nacl \
124         --enable-languages="c,c++,objc" \
125         --enable-tls \
126         --with-newlib \
127 %endif
128         --target=%{target} \
129         --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
130         --disable-ppl-version-check \
131         --disable-libgcj
132
133 %{__make} \
134         BOOT_CFLAGS="$OPT_FLAGS" \
135 %if %{with bootstrap}
136         all-gcc all-target-libgcc
137 %else
138         all
139 %endif
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 cd obj-%{target}
144 %{__make} \
145 %if %{with bootstrap}
146         install-gcc install-target-libgcc \
147 %else
148         install \
149 %endif
150         DESTDIR=$RPM_BUILD_ROOT
151
152 # move fixed includes to proper place
153 mv $RPM_BUILD_ROOT%{gccnlib}/include-fixed/*.h $RPM_BUILD_ROOT%{gccnlib}/include
154
155 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/include-fixed
156 %{__rm} -r $RPM_BUILD_ROOT%{gccnlib}/install-tools
157
158 # Delete supplemental files that would conflict with the core toolchain
159 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
160 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
161 # I suspect that the core toolchain locale files will work with this reasonably well.
162 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
163
164 # Don't dupe the system libiberty.a
165 %if %{without bootstrap}
166 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
167 %{__rm} $RPM_BUILD_ROOT%{_prefix}/%{target}/lib*/libiberty.a
168 %endif
169
170 %clean
171 rm -rf $RPM_BUILD_ROOT
172
173 %files
174 %defattr(644,root,root,755)
175 %doc gcc/README*
176 %attr(755,root,root) %{_bindir}/%{target}-cpp
177 %attr(755,root,root) %{_bindir}/%{target}-gcc
178 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{gcc_ver}
179 %attr(755,root,root) %{_bindir}/%{target}-gccbug
180 %attr(755,root,root) %{_bindir}/%{target}-gcov
181
182 %if "%{_lib}" != "lib"
183 %dir %{_prefix}/lib/gcc
184 %dir %{_prefix}/lib/gcc/%{target}
185 %dir %{gccnlib}
186 %endif
187
188 %{gccnlib}/*.[ao]
189 %dir %{gccnlib}/include
190 %{gccnlib}/include/*.h
191
192 %dir %{gccnlib}/32
193 %{gccnlib}/32/*.[oa]
194
195 %dir %{_libexecdir}
196 %dir %{_libexecdir}/gcc
197 %dir %{_libexecdir}/gcc/%{target}
198 %dir %{gcclib}
199 %attr(755,root,root) %{gcclib}/cc1
200 %attr(755,root,root) %{gcclib}/collect2
201
202 %if "%{_lib}" != "lib"
203 # not present on ix86, not needed?
204 %dir %{gcclib}/install-tools
205 %attr(755,root,root) %{gcclib}/install-tools/*
206 %endif
207
208 %{_mandir}/man1/%{target}-cpp.*
209 %{_mandir}/man1/%{target}-gcc.*
210 %{_mandir}/man1/%{target}-gcov.*
211
212 %if %{without bootstrap}
213 %files c++
214 %defattr(644,root,root,755)
215 %attr(755,root,root) %{_bindir}/%{target}-c++
216 %attr(755,root,root) %{_bindir}/%{target}-g++
217 %attr(755,root,root) %{gcclib}/cc1plus
218 %{_prefix}/%{target}/include/c++
219 %dir %{_prefix}/%{target}/lib32
220 %dir %{_prefix}/%{target}/lib64
221 %{_prefix}/%{target}/lib*/libstdc++.*a
222 %{_prefix}/%{target}/lib*/libsupc++.*a
223 %{_mandir}/man1/%{target}-g++.*
224
225 %files objc
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{gcclib}/cc1obj
228 %{_prefix}/%{target}/lib*/libobjc.*a
229 %{gccnlib}/include/objc
230 %endif
This page took 0.068919 seconds and 3 git commands to generate.