]> git.pld-linux.org Git - packages/crossnacl-gcc.git/blob - crossnacl-gcc.spec
- cleaned up directory mess, rel .1
[packages/crossnacl-gcc.git] / crossnacl-gcc.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap       # build without NaCl newlib package dependency (without c++,objc packages)
4
5 %define         gitver  3960379
6 %define         rel     1
7 Summary:        Various compilers (C, C++) for NaCl
8 Summary(pl.UTF-8):      Różne kompilatory (C, C++) dla NaCl
9 Name:           crossnacl-gcc
10 Version:        4.4.3
11 Release:        13.git%{gitver}.%{rel}
12 License:        GPL v3+ and GPL v3+ with exceptions and GPL v2+ with exceptions
13 Group:          Development/Languages
14 Source0:        nacl-gcc-%{version}-git%{gitver}.tar.xz
15 # Source0-md5:  e72fed38d5b93e4505c1a05c69ab0796
16 Source1:        get-source.sh
17 Patch0:         gnu_inline-mismatch.patch
18 URL:            http://sourceware.org/gcc/
19 BuildRequires:  cloog-ppl-devel >= 0.15
20 BuildRequires:  crossnacl-binutils
21 BuildRequires:  elfutils-devel
22 BuildRequires:  gmp-c++-devel >= 4.1
23 BuildRequires:  gmp-devel >= 4.1
24 BuildRequires:  libstdc++-devel
25 BuildRequires:  mpfr-devel >= 2.3.2
26 BuildRequires:  perl-tools-pod
27 BuildRequires:  ppl-devel >= 0.10
28 BuildRequires:  tar >= 1:1.22
29 BuildRequires:  xz
30 BuildConflicts: cloog-isl-devel
31 %if %{without bootstrap}
32 BuildRequires:  crossnacl-newlib
33 %endif
34 ExclusiveArch:  %{ix86} %{x8664}
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %define         target          x86_64-nacl
38 %define         archprefix      %{_prefix}/%{target}
39 %define         archbindir      %{archprefix}/bin
40 %define         archincludedir  %{archprefix}/include
41 %define         archlib32dir    %{archprefix}/lib32
42 %define         archlib64dir    %{archprefix}/lib64
43 %define         gccarchdir      %{_libdir}/gcc/%{target}
44 %define         gcclibdir       %{gccarchdir}/%{version}
45
46 %define         filterout_cpp   -D_FORTIFY_SOURCE=[0-9]+
47 %define         filterout_c     -Werror=format-security
48
49 %description
50 The gcc package contains the GNU Compiler Collection.
51
52 This package provides support for NaCl targets.
53
54 %description -l pl.UTF-8
55 Pakiet gcc zawiera zestaw kompilatorów GNU Compiler Collection.
56
57 Ten pakiet zapewnia obsługę platformy docelowej NaCl.
58
59 %package c++
60 Summary:        C++ support for crossnacl-gcc
61 Summary(pl.UTF-8):      Obsługa C++ dla crossnacl-gcc
62 Group:          Development/Languages
63 Requires:       %{name} = %{version}-%{release}
64
65 %description c++
66 This package adds C++ support to the GNU Compiler Collection for NaCl
67 targets.
68
69 %description c++ -l pl.UTF-8
70 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCl.
71
72 %package objc
73 Summary:        NaCl binary utility development utilities - objc
74 Summary(pl.UTF-8):      Zestaw narzędzi programistycznych NaCl - objc
75 Group:          Development/Languages
76 Requires:       %{name} = %{version}-%{release}
77
78 %description objc
79 This package contains objc compiler cross targeted to NaCl.
80
81 %description objc -l pl.UTF-8
82 Ten pakiet zawiera kompilator objc generujący kod dla NaCl.
83
84 %prep
85 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
86 %patch0 -p1
87
88 %build
89 rm -rf obj-%{target}
90 install -d obj-%{target}
91 cd obj-%{target}
92
93 OPT_FLAGS="%{rpmcflags} -D_FILE_OFFSET_BITS=64 -fgnu89-inline"
94 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-m64//g;s/-m32//g;s/-m31//g')
95 %ifarch %{ix86}
96 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/-march=i.86//g')
97 %endif
98 OPT_FLAGS=$(echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g')
99
100 case "$OPT_FLAGS" in
101 *-fasynchronous-unwind-tables*)
102         %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
103         ../gcc/Makefile.in
104 ;;
105 esac
106
107 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
108 ../configure \
109         CC="%{__cc}" \
110         CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
111         CXXFLAGS="$(echo $OPT_FLAGS | sed 's/ -Wall / /g')" \
112         XCFLAGS="$OPT_FLAGS" \
113         MAKEINFO=/bin/true \
114         --prefix=%{_prefix} \
115         --mandir=%{_mandir} \
116         --infodir=%{_infodir} \
117         --libdir=%{_libdir} \
118         --libexecdir=%{_libdir} \
119         --enable-__cxa_atexit \
120         --enable-checking=release \
121         --disable-decimal-float \
122         --enable-gnu-unique-object \
123         --disable-libgcj \
124         --disable-libgomp \
125         --disable-libmudflap \
126         --disable-libssp \
127         --disable-libstdcxx-pch \
128         --disable-libunwind-exceptions \
129         --disable-ppl-version-check \
130         --disable-shared \
131         --with-cloog \
132         --with-host-libstdcxx="-lstdc++ -lm" \
133         --with-ppl \
134         --with-system-zlib \
135 %if %{with bootstrap}
136         CFLAGS_FOR_TARGET="-O2 -g" \
137         CXXFLAGS_FOR_TARGET="-O2 -g" \
138         --enable-languages="c" \
139         --disable-threads \
140         --without-headers \
141 %else
142         CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
143         CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
144         --enable-languages="c,c++,objc" \
145         --enable-threads=nacl \
146         --enable-tls \
147         --with-newlib \
148 %endif
149         --target=%{target}
150
151 %{__make} \
152         BOOT_CFLAGS="$OPT_FLAGS" \
153 %if %{with bootstrap}
154         all-gcc all-target-libgcc
155 %else
156         all
157 %endif
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 %{__make} -C obj-%{target} \
163 %if %{with bootstrap}
164         install-gcc install-target-libgcc \
165 %else
166         install \
167 %endif
168         DESTDIR=$RPM_BUILD_ROOT
169
170 # move fixed includes to proper place
171 %{__mv} $RPM_BUILD_ROOT%{gcclibdir}/include-fixed/{limits,syslimits}.h $RPM_BUILD_ROOT%{gcclibdir}/include
172 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/include-fixed
173 %{__rm} -r $RPM_BUILD_ROOT%{gcclibdir}/install-tools
174
175 # Delete supplemental files that would conflict with the core toolchain
176 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
177 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7
178 # I suspect that the core toolchain locale files will work with this reasonably well.
179 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}
180
181 # Don't dupe the system libiberty.a
182 %if %{without bootstrap}
183 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
184 %{__rm} $RPM_BUILD_ROOT%{archlib32dir}/libiberty.a
185 %{__rm} $RPM_BUILD_ROOT%{archlib64dir}/libiberty.a
186 %endif
187
188 %if %{with bootstrap}
189 # always create lib directories (place for newlib when bootstrapping)
190 install -d $RPM_BUILD_ROOT{%{archlib32dir},%{archlib64dir}}
191 %endif
192
193 %clean
194 rm -rf $RPM_BUILD_ROOT
195
196 %files
197 %defattr(644,root,root,755)
198 %doc README NEWS gcc/README.Portability
199 %attr(755,root,root) %{_bindir}/%{target}-cpp
200 %attr(755,root,root) %{_bindir}/%{target}-gcc
201 %attr(755,root,root) %{_bindir}/%{target}-gcc-%{version}
202 %attr(755,root,root) %{_bindir}/%{target}-gccbug
203 %attr(755,root,root) %{_bindir}/%{target}-gcov
204 %dir %{archlib32dir}
205 %dir %{archlib64dir}
206 %dir %{gccarchdir}
207 %dir %{gcclibdir}
208 %attr(755,root,root) %{gcclibdir}/cc1
209 %attr(755,root,root) %{gcclibdir}/collect2
210 %{gcclibdir}/crt*.o
211 %{gcclibdir}/libgcc.a
212 %{gcclibdir}/libgcov.a
213 %dir %{gcclibdir}/32
214 %{gcclibdir}/32/crt*.o
215 %{gcclibdir}/32/libgcc.a
216 %{gcclibdir}/32/libgcov.a
217 %dir %{gcclibdir}/include
218 %{gcclibdir}/include/ammintrin.h
219 %{gcclibdir}/include/avxintrin.h
220 %{gcclibdir}/include/bmmintrin.h
221 %{gcclibdir}/include/cpuid.h
222 %{gcclibdir}/include/cross-stdarg.h
223 %{gcclibdir}/include/emmintrin.h
224 %{gcclibdir}/include/float.h
225 %{gcclibdir}/include/immintrin.h
226 %{gcclibdir}/include/iso646.h
227 %{gcclibdir}/include/limits.h
228 %{gcclibdir}/include/mm3dnow.h
229 %{gcclibdir}/include/mm_malloc.h
230 %{gcclibdir}/include/mmintrin-common.h
231 %{gcclibdir}/include/mmintrin.h
232 %{gcclibdir}/include/nmmintrin.h
233 %{gcclibdir}/include/pmmintrin.h
234 %{gcclibdir}/include/smmintrin.h
235 %{gcclibdir}/include/stdarg.h
236 %{gcclibdir}/include/stdbool.h
237 %{gcclibdir}/include/stddef.h
238 %{gcclibdir}/include/stdfix.h
239 %{gcclibdir}/include/syslimits.h
240 %{gcclibdir}/include/tmmintrin.h
241 %{gcclibdir}/include/unwind.h
242 %{gcclibdir}/include/varargs.h
243 %{gcclibdir}/include/wmmintrin.h
244 %{gcclibdir}/include/x86intrin.h
245 %{gcclibdir}/include/xmmintrin.h
246 %{_mandir}/man1/%{target}-cpp.1*
247 %{_mandir}/man1/%{target}-gcc.1*
248 %{_mandir}/man1/%{target}-gcov.1*
249
250 %if %{without bootstrap}
251 %files c++
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/%{target}-c++
254 %attr(755,root,root) %{_bindir}/%{target}-g++
255 %attr(755,root,root) %{gcclibdir}/cc1plus
256 %{archincludedir}/c++
257 %{archlib32dir}/libstdc++.a
258 %{archlib32dir}/libstdc++.la
259 %{archlib32dir}/libsupc++.a
260 %{archlib32dir}/libsupc++.la
261 %{archlib64dir}/libstdc++.a
262 %{archlib64dir}/libstdc++.la
263 %{archlib64dir}/libsupc++.a
264 %{archlib64dir}/libsupc++.la
265 %{_mandir}/man1/%{target}-g++.1*
266
267 %files objc
268 %defattr(644,root,root,755)
269 %attr(755,root,root) %{gcclibdir}/cc1obj
270 %{gcclibdir}/include/objc
271 %{archlib32dir}/libobjc.a
272 %{archlib32dir}/libobjc.la
273 %{archlib64dir}/libobjc.a
274 %{archlib64dir}/libobjc.la
275 %endif
This page took 0.095101 seconds and 3 git commands to generate.