]> git.pld-linux.org Git - packages/crossnacl-gcc.git/blob - crossnacl-gcc.spec
- new, based on nacl-gcc-4.4.3-2.gitcff9ac88.fc16.src.rpm
[packages/crossnacl-gcc.git] / crossnacl-gcc.spec
1 #
2 # Conditional build:
3 %bcond_with     bootstrap               # build without nacl newlib 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:        0.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:        GPLv3+ and GPLv3+ with exceptions and GPLv2+ 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. This provides
41 support for nacl targets.
42
43 %prep
44 %setup -q -n nacl-gcc-%{version}-git%{?gitver}
45
46 %build
47 rm -rf obj-%{gcc_target_platform}
48 mkdir obj-%{gcc_target_platform}
49 cd obj-%{gcc_target_platform}
50 CC=gcc
51 OPT_FLAGS=`echo %{rpmcflags}|sed -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=[12]//g'`
52 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-m64//g;s/-m32//g;s/-m31//g'`
53 %ifarch %{ix86}
54 OPT_FLAGS=`echo $OPT_FLAGS|sed -e 's/-march=i.86//g'`
55 %endif
56 OPT_FLAGS=`echo "$OPT_FLAGS" | sed -e 's/[[:blank:]]\+/ /g'`
57 case "$OPT_FLAGS" in
58 *-fasynchronous-unwind-tables*)
59         %{__sed} -i -e 's/-fno-exceptions /-fno-exceptions -fno-asynchronous-unwind-tables/' \
60         ../gcc/Makefile.in
61 ;;
62 esac
63
64 GCC_DEFINES="-Dinhibit_libc -D__gthr_posix_h"
65 ../configure \
66         --prefix=%{_prefix} \
67         --mandir=%{_mandir} \
68         --infodir=%{_infodir} \
69         --libexecdir=%{_libdir} \
70         --enable-checking=release \
71         --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
72         --enable-gnu-unique-object \
73         --disable-decimal-float \
74         --disable-libgomp \
75         --disable-libmudflap \
76         --disable-libssp \
77         --disable-libstdcxx-pch \
78         --disable-shared \
79         --with-ppl --with-cloog \
80         CC="$CC" \
81         CFLAGS="$OPT_FLAGS $GCC_DEFINES" \
82         CXXFLAGS="`echo $OPT_FLAGS | sed 's/ -Wall / /g'`" \
83         XCFLAGS="$OPT_FLAGS" \
84 %if %{with bootstrap}
85         --disable-threads \
86         --enable-languages="c" \
87         --without-headers \
88         CFLAGS_FOR_TARGET="-O2 -g" \
89         CXXFLAGS_FOR_TARGET="-O2 -g" \
90 %else
91         CFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
92         CXXFLAGS_FOR_TARGET="-O2 -g -mtls-use-call -I/usr/x86_64-nacl/include/" \
93         --enable-threads=nacl \
94         --enable-languages="c,c++,objc" \
95         --enable-tls \
96         --with-newlib \
97 %endif
98         --target=%{gcc_target_platform} \
99         --with-host-libstdcxx="-lpwl -lstdc++ -lm" \
100         --disable-ppl-version-check \
101         --disable-libgcj
102
103 %{__make} \
104         BOOT_CFLAGS="$OPT_FLAGS" \
105 %if %{with bootstrap}
106         all-gcc all-target-libgcc
107 %else
108         all
109 %endif
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113 cd obj-%{gcc_target_platform}
114 %{__make} \
115 %if %{with bootstrap}
116         install-gcc install-target-libgcc \
117 %else
118         install \
119 %endif
120         DESTDIR=$RPM_BUILD_ROOT
121
122 # Delete supplemental files that would conflict with the core toolchain
123 %{__rm} -r $RPM_BUILD_ROOT%{_infodir}
124 %{__rm} -r $RPM_BUILD_ROOT%{_mandir}/man7/
125 # I suspect that the core toolchain locale files will work with this reasonably well.
126 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/
127
128 # Don't dupe the system libiberty.a
129 #%{__rm} $RPM_BUILD_ROOT%{_libdir}/libiberty.a
130
131 %clean
132 rm -rf $RPM_BUILD_ROOT
133
134 %files
135 %defattr(644,root,root,755)
136 %doc gcc/README* gcc/COPYING*
137 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-cpp
138 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc
139 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcc-%{version}
140 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gccbug
141 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-gcov
142 %{_prefix}/lib/gcc/%{gcc_target_platform}/
143 %{_libexecdir}/gcc/%{gcc_target_platform}/
144 %{_mandir}/man1/%{gcc_target_platform}-cpp.*
145 %{_mandir}/man1/%{gcc_target_platform}-gcc.*
146 %{_mandir}/man1/%{gcc_target_platform}-gcov.*
147
148 %if %{without bootstrap}
149 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-c++
150 %attr(755,root,root) %{_bindir}/%{gcc_target_platform}-g++
151 %{_prefix}/%{gcc_target_platform}/include/c++
152 %{_prefix}/%{gcc_target_platform}/lib*/
153 %{_mandir}/man1/%{gcc_target_platform}-g++.*
154 %endif
This page took 0.102215 seconds and 4 git commands to generate.