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