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