]> git.pld-linux.org Git - packages/crossnacl-gcc.git/blob - crossnacl-gcc.spec
- c++ to 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:        1.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-devel
28 BuildRequires:  mpfr-devel
29 BuildRequires:  ppl-pwl-devel
30 %if %{without bootstrap}
31 BuildRequires:  nacl-newlib
32 %endif
33 ExclusiveArch:  %{ix86} %{x8664}
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         gcc_target_platform     x86_64-nacl
37
38 %description
39 The gcc package contains the GNU Compiler Collection version 4.4.3.
40 You'll need this package in order to compile C code.
41
42 This provides support for NaCl targets.
43
44 %package c++
45 Summary:        C++ support for crossnacl-gcc
46 Summary(pl.UTF-8):      Obsługa C++ dla crossnacl-gcc
47 Group:          Development/Languages
48 Requires:       %{name} = %{version}-%{release}
49
50 %description c++
51 This package adds C++ support to the GNU Compiler Collection for NaCl
52 targets.
53
54 %description c++ -l pl.UTF-8
55 Ten pakiet dodaje obsługę C++ do kompilatora gcc dla NaCL.
56
57 %prep
58 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
59
60 %build
61 rm -rf obj-%{gcc_target_platform}
62 mkdir obj-%{gcc_target_platform}
63 cd obj-%{gcc_target_platform}
64 CC=gcc
65 OPT_FLAGS=`echo %{rpmcflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
66 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
67 %ifarch %{ix86}
68 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
69 %endif
70 OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
71 case "$OPT_FLAGS" in
72 *-fasynchronous-unwind-tables*)
73         %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
74         ../gcc/Makefile.in
75 ;;
76 esac
77
78 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
79 ../configure \
80         --prefix=%{_prefix} \
81         --mandir=%{_mandir} \
82         --infodir=%{_infodir} \
83         --libexecdir=%{_libdir} \
84         --enable-checking=release \
85         --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
86         --enable-gnu-unique-object \
87         --disable-decimal-float \
88         --disable-libgomp \
89         --disable-libmudflap \
90         --disable-libssp \
91         --disable-libstdcxx-pch \
92         --disable-shared \
93         --with-ppl --with-cloog \
94         CC="$CC" \
95         CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
96         CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`" \
97         XCFLAGS="$OPT_FLAGS" \
98 %if %{with bootstrap}
99         --disable-threads \
100         --enable-languages="c" \
101         --without-headers \
102         CFLAGS_FOR_TARGET="-O2 -g" \
103         CXXFLAGS_FOR_TARGET="-O2 -g" \
104 %else
105         CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
106         CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
107         --enable-threads=nacl \
108         --enable-languages="c,c++,objc" \
109         --enable-tls \
110         --with-newlib \
111 %endif
112         --target=%{gcc_target_platform} \
113         --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
114         --disable-ppl-version-check \
115         --disable-libgcj
116
117 %{__make} \
118         BOOT_CFLAGS="$OPT_FLAGS" \
119 %if %{with bootstrap}
120         all-gcc all-target-libgcc
121 %else
122         all
123 %endif
124
125 %install
126 rm -rf $RPM_BUILD_ROOT
127 cd obj-%{gcc_target_platform}
128 %{__make} \
129 %if %{with bootstrap}
130         install-gcc install-target-libgcc \
131 %else
132         install \
133 %endif
134         DESTDIR=$RPM_BUILD_ROOT
135
136 # Delete supplemental files that would conflict with the core toolchain
137 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
138 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7/
139 # I suspect that the core toolchain locale files will work with this reasonably well.
140 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/
141
142 # Don't dupe the system libiberty.a
143 #%{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
144
145 %clean
146 rm -rf $RPM_BUILD_ROOT
147
148 %files
149 %defattr(644,root,root,755)
150 %doc gcc/README* gcc/COPYING*
151 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-cpp
152 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc
153 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc-%{version}
154 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gccbug
155 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcov
156 %dir %{_prefix}/lib/gcc
157 %{_prefix}/lib/gcc/%{gcc_target_platform}/
158 %{_libexecdir}/gcc/%{gcc_target_platform}/
159 %{_mandir}/man1/%{gcc_target_platform}-cpp.*
160 %{_mandir}/man1/%{gcc_target_platform}-gcc.*
161 %{_mandir}/man1/%{gcc_target_platform}-gcov.*
162
163 %if %{without bootstrap}
164 %files c++
165 %defattr(644,root,root,755)
166 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-c++
167 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-g++
168 %{_prefix}/%{gcc_target_platform}/include/c++
169 %{_prefix}/%{gcc_target_platform}/lib*/
170 %{_mandir}/man1/%{gcc_target_platform}-g++.*
171 %endif
This page took 0.037403 seconds and 4 git commands to generate.