source: rtems/contrib/crossrpms/netbsd5.0.1/i386/i386-pc-netbsdelf5.0.1-gcc.spec @ 4ec3165

4.104.11
Last change on this file since 4ec3165 was 4ec3165, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 31, 2009 at 2:17:53 PM

Bump GCC_RPMREL.

  • Property mode set to 100644
File size: 12.4 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6
7%ifos cygwin cygwin32 mingw mingw32
8%define _exeext .exe
9%define debug_package           %{nil}
10%define _libdir                 %{_exec_prefix}/lib
11%else
12%define _exeext %{nil}
13%endif
14
15%ifos cygwin cygwin32
16%define optflags -O3 -pipe -march=i486 -funroll-loops
17%endif
18
19%ifos mingw mingw32
20%if %{defined _mingw32_cflags}
21%define optflags %{_mingw32_cflags}
22%else
23%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
24%endif
25%endif
26
27%if "%{_build}" != "%{_host}"
28%define _host_rpmprefix %{_host}-
29%else
30%define _host_rpmprefix %{nil}
31%endif
32
33
34%define gcc_pkgvers 4.3.4
35%define gcc_version 4.3.4
36%define gcc_rpmvers %{expand:%(echo "4.3.4" | tr - _ )}
37
38
39Name:           i386-pc-netbsdelf5.0.1-gcc
40Summary:        i386-pc-netbsdelf5.0.1 gcc
41
42Group:          Development/Tools
43Version:        %{gcc_rpmvers}
44Release:        0.20090831.1%{?dist}
45License:        GPL
46URL:            http://gcc.gnu.org
47BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
48
49%define _use_internal_dependency_generator 0
50
51BuildRequires:  %{_host_rpmprefix}gcc
52
53%if "%{gcc_version}" >= "4.3.0"
54%define _gmp_minvers            4.1
55%else
56%if "%{gcc_version}" >= "4.2.0"
57%endif
58%endif
59
60%if %{defined _gmp_minvers}
61BuildRequires: gmp-devel >= %{_gmp_minvers}
62%if "%{_build}" != "%{_host}"
63BuildRequires:  %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers}
64%endif
65%endif
66
67
68%if "%{gcc_version}" >= "4.4.0"
69%define _mpfr_minvers   2.3.2
70%define mpfr_version    2.4.1
71%else
72%if "%{gcc_version}" >= "4.3.0"
73%define _mpfr_minvers   2.3.1
74%define mpfr_version    2.3.2
75%else
76%if "%{gcc_version}" >= "4.2.0"
77%endif
78%endif
79%endif
80
81%if %{defined _mpfr_minvers}
82# FIXME: This is an ugly cludge
83%{?fc10:%global mpfr_provided 2.3.2}
84%{?fc11:%global mpfr_provided 2.4.1}
85%{?suse10_3:%global mpfr_provided 2.2.1}
86%{?suse11_0:%global mpfr_provided 2.3.1}
87%{?suse11_1:%global mpfr_provided 2.3.2}
88%{?cygwin:%global mpfr_provided 2.4.1}
89%{?mingw32:%global mpfr_provided %{nil}}
90
91%if %{defined mpfr_provided}
92%if "%{mpfr_provided}" < "%{_mpfr_minvers}"
93%define _build_mpfr 1
94%else
95%if "%{_build}" != "%{_host}"
96BuildRequires:  %{_host_rpmprefix}mpfr-devel >= %{_mpfr_minvers}
97%else
98BuildRequires: mpfr-devel >= %{_mpfr_minvers}
99%endif
100%endif
101%else
102%define _build_mpfr 1
103%endif
104
105%endif
106
107%if "%{_build}" != "%{_host}"
108BuildRequires:  i386-pc-netbsdelf5.0.1-gcc = %{gcc_rpmvers}
109%endif
110
111%if "%{gcc_version}" >= "4.2.0"
112BuildRequires:  flex bison
113%endif
114
115
116BuildRequires:  texinfo >= 4.2
117BuildRequires:  i386-pc-netbsdelf5.0.1-binutils
118BuildRequires:  i386-pc-netbsdelf5.0.1-sys-root
119
120Requires:       i386-pc-netbsdelf5.0.1-binutils
121Requires:       i386-pc-netbsdelf5.0.1-sys-root
122Requires:       i386-pc-netbsdelf5.0.1-gcc-libgcc = %{gcc_rpmvers}-%{release}
123
124
125%define _gcclibdir %{_prefix}/lib
126
127Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
128%{?_without_sources:NoSource:   0}
129
130
131%if "%{gcc_version}" >= "4.3.0"
132Source60:    http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2
133%endif
134
135%description
136Cross gcc for i386-pc-netbsdelf5.0.1.
137
138%prep
139%setup -c -T -n %{name}-%{version}
140
141%setup -q -T -D -n %{name}-%{version} -a0
142%{?PATCH0:%patch0 -p0}
143
144
145
146
147
148
149
150%if 0%{?_build_mpfr}
151%setup -q -T -D -n %{name}-%{version} -a60
152%{?PATCH60:%patch60 -p1}
153  # Build mpfr one-tree style
154  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
155%endif
156
157
158  # Fix timestamps
159  cd gcc-%{gcc_pkgvers}
160  contrib/gcc_update --touch
161  cd ..
162%build
163  mkdir -p build
164
165  cd build
166
167  languages="c"
168%if "%{_build}" != "%{_host}"
169  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
170  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
171%else
172# gcc is not ready to be compiled with -std=gnu99
173  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
174%endif
175  ../gcc-%{gcc_pkgvers}/configure \
176    --prefix=%{_prefix} \
177    --bindir=%{_bindir} \
178    --exec_prefix=%{_exec_prefix} \
179    --includedir=%{_includedir} \
180    --libdir=%{_gcclibdir} \
181    --libexecdir=%{_libexecdir} \
182    --mandir=%{_mandir} \
183    --infodir=%{_infodir} \
184    --datadir=%{_datadir} \
185    --build=%_build --host=%_host \
186    --target=i386-pc-netbsdelf5.0.1 \
187    --disable-libstdcxx-pch \
188    --with-gnu-as --with-gnu-ld --verbose \
189    --with-system-zlib \
190    --disable-nls --without-included-gettext \
191    --disable-win32-registry \
192    --enable-version-specific-runtime-libs \
193    --enable-threads \
194    --with-sysroot=%{_exec_prefix}/i386-pc-netbsdelf5.0.1/sys-root \
195    --enable-languages="$languages" $optargs
196
197%if "%_host" != "%_build"
198  # Bug in gcc-3.2.1:
199  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
200  mkdir -p gcc/include
201  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
202%endif
203
204  make %{?_smp_mflags} all
205  cd ..
206
207%install
208  rm -rf $RPM_BUILD_ROOT
209
210  cd build
211
212  make DESTDIR=$RPM_BUILD_ROOT install
213  cd ..
214
215
216%if "%{gcc_version}" <= "4.1.2"
217# Misplaced header file
218  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
219    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
220      $RPM_BUILD_ROOT%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include/
221  fi
222%endif
223
224  # host library
225%if "%{gcc_version}" >= "4.2.0"
226  # libiberty doesn't honor --libdir, but always installs to a
227  # magically guessed _libdir
228  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
229%else
230  # libiberty installs to --libdir=...
231  rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a
232%endif
233
234  # We use the version from binutils
235  rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.0.1-c++filt%{_exeext}
236
237
238# Conflict with a native GCC's infos
239  rm -rf $RPM_BUILD_ROOT%{_infodir}
240
241# Conflict with a native GCC's man pages
242  rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
243
244  # Bug in gcc-3.4.0pre
245  rm -f $RPM_BUILD_ROOT%{_bindir}/i386-pc-netbsdelf5.0.1-i386-pc-netbsdelf5.0.1-gcjh%{_exeext}
246
247  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
248  # the fixinclude-install-tools
249  rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/install-tools
250  rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/install-tools
251
252  # Bug in gcc > 4.1.0: Installs an unused, empty directory
253  if test -d ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.0.1/include/bits; then
254    rmdir ${RPM_BUILD_ROOT}%{_prefix}/i386-pc-netbsdelf5.0.1/include/bits
255  fi
256
257  # Collect multilib subdirectories
258  multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
259
260
261  rm -f dirs ;
262  echo "%defattr(-,root,root,-)" >> dirs
263  TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}"
264  for i in $multilibs; do
265    case $i in
266    \.) echo "%dir ${TGTDIR}" >> dirs
267      ;;
268    *)  echo "%dir ${TGTDIR}/$i" >> dirs
269      ;;
270    esac
271  done
272
273  # Collect files to go into different packages
274  cp dirs build/files.gcc
275  cp dirs build/files.gfortran
276  cp dirs build/files.objc
277  cp dirs build/files.gcj
278  cp dirs build/files.g++
279
280  TGTDIR="%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}"
281  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
282  for i in $f; do
283    case $i in
284    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
285    *f771) ;;
286    *f951) ;;
287    *cc1) ;;
288    *cc1obj) ;;
289    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
290    *collect2) ;;
291    *libobjc*) echo "$i" >> build/files.objc ;;
292    *include/objc*) ;;
293    *include/g++*);;
294    *include/c++*);;
295    *include-fixed/*);;
296    *finclude/*);;
297    *adainclude*);;
298    *adalib*);;
299    *gnat1);;
300    *jc1) ;;
301    *jvgenmain) ;;
302    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
303    */libstdc++.*) echo "$i" >> build/files.g++ ;;
304    */libsupc++.*) echo "$i" >> build/files.g++ ;;
305    *) echo "$i" >> build/files.gcc ;;
306    esac
307  done
308
309  TGTDIR="%{_exec_prefix}/i386-pc-netbsdelf5.0.1/lib"
310  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
311  for i in $f; do
312    case $i in
313    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
314    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
315# all other files belong to newlib
316    *) echo "$i" >> build/files.newlib ;;
317    esac
318  done
319# Extract %%__os_install_post into os_install_post~
320cat << \EOF > os_install_post~
321%__os_install_post
322EOF
323
324# Generate customized brp-*scripts
325cat os_install_post~ | while read a x y; do
326case $a in
327# Prevent brp-strip* from trying to handle foreign binaries
328*/brp-strip*)
329  b=$(basename $a)
330  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
331  chmod a+x $b
332  ;;
333esac
334done
335
336sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
337< os_install_post~ > os_install_post
338%define __os_install_post . ./os_install_post
339
340
341cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
342#!/bin/sh
343grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.1/(lib|include|sys-root)' \
344  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/'} | %__find_provides
345EOF
346chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
347%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
348
349cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
350#!/bin/sh
351grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.1/(lib|include|sys-root)' \
352  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/'} | %__find_requires
353EOF
354chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
355%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
356
357%ifnarch noarch
358# Extract %%__debug_install_post into debug_install_post~
359cat << \EOF > debug_install_post~
360%__debug_install_post
361EOF
362
363# Generate customized debug_install_post script
364cat debug_install_post~ | while read a x y; do
365case $a in
366# Prevent find-debuginfo.sh* from trying to handle foreign binaries
367*/find-debuginfo.sh)
368  b=$(basename $a)
369  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
370  chmod a+x $b
371  ;;
372esac
373done
374
375sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
376< debug_install_post~ > debug_install_post
377%define __debug_install_post . ./debug_install_post
378
379%endif
380
381%clean
382  rm -rf $RPM_BUILD_ROOT
383
384# ==============================================================
385# i386-pc-netbsdelf5.0.1-gcc
386# ==============================================================
387# %package -n i386-pc-netbsdelf5.0.1-gcc
388# Summary:        GNU cc compiler for i386-pc-netbsdelf5.0.1
389# Group:          Development/Tools
390# Version:        %{gcc_rpmvers}
391# Requires:       i386-pc-netbsdelf5.0.1-binutils
392# License:      GPL
393
394# %if %build_infos
395# Requires:      gcc-common
396# %endif
397
398%description -n i386-pc-netbsdelf5.0.1-gcc
399GNU cc compiler for i386-pc-netbsdelf5.0.1.
400
401# ==============================================================
402# i386-pc-netbsdelf5.0.1-gcc-libgcc
403# ==============================================================
404%package -n i386-pc-netbsdelf5.0.1-gcc-libgcc
405Summary:        libgcc for i386-pc-netbsdelf5.0.1-gcc
406Group:          Development/Tools
407Version:        %{gcc_rpmvers}
408%{?_with_noarch_subpackages:BuildArch: noarch}
409License:        GPL
410
411%description -n i386-pc-netbsdelf5.0.1-gcc-libgcc
412libgcc i386-pc-netbsdelf5.0.1-gcc.
413
414
415%files -n i386-pc-netbsdelf5.0.1-gcc
416%defattr(-,root,root)
417
418%{_mandir}/man1/i386-pc-netbsdelf5.0.1-gcc.1*
419%{_mandir}/man1/i386-pc-netbsdelf5.0.1-cpp.1*
420%{_mandir}/man1/i386-pc-netbsdelf5.0.1-gcov.1*
421
422%{_bindir}/i386-pc-netbsdelf5.0.1-cpp%{_exeext}
423%{_bindir}/i386-pc-netbsdelf5.0.1-gcc%{_exeext}
424%{_bindir}/i386-pc-netbsdelf5.0.1-gcc-%{gcc_version}%{_exeext}
425%{_bindir}/i386-pc-netbsdelf5.0.1-gcov%{_exeext}
426%{_bindir}/i386-pc-netbsdelf5.0.1-gccbug
427
428%dir %{_libexecdir}/gcc
429%dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1
430%dir %{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}
431%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/cc1%{_exeext}
432%{_libexecdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/collect2%{_exeext}
433
434
435%files -n i386-pc-netbsdelf5.0.1-gcc-libgcc -f build/files.gcc
436%defattr(-,root,root)
437%dir %{_gcclibdir}/gcc
438%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1
439%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}
440%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include
441
442%if "%{gcc_version}" > "4.0.3"
443%if "i386-pc-netbsdelf5.0.1" != "bfin-rtems4.10"
444%if "i386-pc-netbsdelf5.0.1" != "avr-rtems4.10"
445%dir %{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include/ssp
446%endif
447%endif
448%endif
449
450%if "%{gcc_version}" >= "4.3.0"
451%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.1/%{gcc_version}/include-fixed
452%endif
453
454
455
456
Note: See TracBrowser for help on using the repository browser.