source: rtems/contrib/crossrpms/freebsd7.2/i586/i586-pc-freebsd7.2-gcc.spec @ ac39e0f

4.104.11
Last change on this file since ac39e0f was ac39e0f, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 6, 2009 at 12:23:13 PM

Update.

  • Property mode set to 100644
File size: 15.3 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.3
35%define gcc_version 4.3.3
36%define gcc_rpmvers %{expand:%(echo "4.3.3" | tr - _ )}
37
38
39Name:           i586-pc-freebsd7.2-gcc
40Summary:        i586-pc-freebsd7.2 gcc
41
42Group:          Development/Tools
43Version:        %{gcc_rpmvers}
44Release:        0.20090506.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%define _gmp_minvers            4.1
58%endif
59%endif
60
61%if %{defined _gmp_minvers}
62BuildRequires: gmp-devel >= %{_gmp_minvers}
63%if "%{_build}" != "%{_host}"
64BuildRequires:  %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers}
65%endif
66%endif
67
68
69%if "%{gcc_version}" >= "4.4.0"
70%define _mpfr_minvers   2.3.2
71%define mpfr_version    2.4.1
72%else
73%if "%{gcc_version}" >= "4.3.0"
74%define _mpfr_minvers   2.3.1
75%define mpfr_version    2.3.2
76%else
77%if "%{gcc_version}" >= "4.2.0"
78%define _mpfr_minvers   2.2.1
79%define mpfr_version    2.3.2
80%endif
81%endif
82%endif
83
84%if %{defined _mpfr_minvers}
85# FIXME: This is an ugly cludge
86%{?fc9:%global mpfr_provided 2.3.1}
87%{?fc10:%global mpfr_provided 2.3.2}
88%{?fc11:%global mpfr_provided 2.4.1}
89%{?suse10_3:%global mpfr_provided 2.2.1}
90%{?cygwin:%global mpfr_provided 2.4.1}
91%{?mingw32:%global mpfr_provided %{nil}}
92
93%if %{defined mpfr_provided}
94%if "%{mpfr_provided}" < "%{_mpfr_minvers}"
95%define _build_mpfr 1
96%else
97%if "%{_build}" != "%{_host}"
98BuildRequires:  %{_host_rpmprefix}mpfr-devel >= %{_mpfr_minvers}
99%else
100BuildRequires: mpfr-devel >= %{_mpfr_minvers}
101%endif
102%endif
103%else
104%define _build_mpfr 1
105%endif
106
107%endif
108
109%if "%{_build}" != "%{_host}"
110BuildRequires:  i586-pc-freebsd7.2-gcc = %{gcc_rpmvers}
111%endif
112
113%if "%{gcc_version}" >= "4.2.0"
114BuildRequires:  flex bison
115%endif
116
117
118BuildRequires:  texinfo >= 4.2
119BuildRequires:  i586-pc-freebsd7.2-binutils
120BuildRequires:  i586-pc-freebsd7.2-sys-root
121
122Requires:       i586-pc-freebsd7.2-binutils
123Requires:       i586-pc-freebsd7.2-sys-root
124
125
126%if "%{gcc_version}" >= "3.4"
127%define gcclib %{_libdir}/gcc
128%define gccexec %{_libexecdir}/gcc
129%else
130%define gcclib %{_libdir}/gcc-lib
131%define gccexec %{_libdir}/gcc-lib
132%endif
133
134Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_pkgvers}.tar.bz2
135%{?_without_sources:NoSource:   0}
136
137Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_pkgvers}.tar.bz2
138%{?_without_sources:NoSource:   1}
139
140Source2:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-fortran-%{gcc_pkgvers}.tar.bz2
141%{?_without_sources:NoSource:   2}
142
143Source5:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-objc-%{gcc_pkgvers}.tar.bz2
144%{?_without_sources:NoSource:   5}
145
146%if "%{gcc_version}" >= "4.3.0"
147Source60:    http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2
148%endif
149
150%description
151Cross gcc for i586-pc-freebsd7.2.
152
153%prep
154%setup -c -T -n %{name}-%{version}
155
156%setup -q -T -D -n %{name}-%{version} -a0
157%{?PATCH0:%patch0 -p0}
158
159%setup -q -T -D -n %{name}-%{version} -a1
160%{?PATCH1:%patch1 -p0}
161
162%setup -q -T -D -n %{name}-%{version} -a2
163%{?PATCH2:%patch2 -p0}
164
165
166
167%setup -q -T -D -n %{name}-%{version} -a5
168%{?PATCH5:%patch5 -p0}
169
170
171%if 0%{?_build_mpfr}
172%setup -q -T -D -n %{name}-%{version} -a60
173%{?PATCH60:%patch60 -p1}
174  # Build mpfr one-tree style
175  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
176%endif
177
178
179  # Fix timestamps
180  cd gcc-%{gcc_pkgvers}
181  contrib/gcc_update --touch
182  cd ..
183%build
184  mkdir -p build
185
186  cd build
187
188  languages="c"
189  languages="$languages,c++"
190  languages="$languages,f95"
191  languages="$languages,objc"
192%if "%{_build}" != "%{_host}"
193  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
194  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
195%else
196# gcc is not ready to be compiled with -std=gnu99
197  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
198%endif
199  ../gcc-%{gcc_pkgvers}/configure \
200    --prefix=%{_prefix} \
201    --bindir=%{_bindir} \
202    --exec_prefix=%{_exec_prefix} \
203    --includedir=%{_includedir} \
204    --libdir=%{_libdir} \
205    --libexecdir=%{_libexecdir} \
206    --mandir=%{_mandir} \
207    --infodir=%{_infodir} \
208    --datadir=%{_datadir} \
209    --build=%_build --host=%_host \
210    --target=i586-pc-freebsd7.2 \
211    --disable-libstdcxx-pch \
212    --with-gnu-as --with-gnu-ld --verbose \
213    --with-system-zlib \
214    --disable-nls --without-included-gettext \
215    --disable-win32-registry \
216    --enable-version-specific-runtime-libs \
217    --enable-threads \
218    --with-sysroot=%{_exec_prefix}/i586-pc-freebsd7.2/sys-root \
219    --enable-languages="$languages" $optargs
220
221%if "%_host" != "%_build"
222  # Bug in gcc-3.2.1:
223  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
224  mkdir -p gcc/include
225  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
226%endif
227
228  make %{?_smp_mflags} all
229  cd ..
230
231%install
232  rm -rf $RPM_BUILD_ROOT
233
234  cd build
235
236  make DESTDIR=$RPM_BUILD_ROOT install
237  cd ..
238
239
240%if "%{gcc_version}" <= "4.1.2"
241# Misplaced header file
242  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
243    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
244      $RPM_BUILD_ROOT%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include/
245  fi
246%endif
247
248  # host library
249  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
250
251  # We use the version from binutils
252  rm -f $RPM_BUILD_ROOT%{_bindir}/i586-pc-freebsd7.2-c++filt%{_exeext}
253
254
255# Conflict with a native GCC's infos
256  rm -rf $RPM_BUILD_ROOT%{_infodir}
257
258# Conflict with a native GCC's man pages
259  rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
260
261#  # Bug in gcc-4.0.0pre
262#  mv $RPM_BUILD_ROOT%{_bindir}/gfortran $RPM_BUILD_ROOT%{_bindir}/i586-pc-freebsd7.2-gfortran
263
264%if "%{gcc_version}" >= "3.4"
265  # Bug in gcc-3.4.0pre
266  rm -f $RPM_BUILD_ROOT%{_bindir}/i586-pc-freebsd7.2-i586-pc-freebsd7.2-gcjh%{_exeext}
267%endif
268
269%if "%{gcc_version}" >= "3.3"
270  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
271  # the fixinclude-install-tools
272  rm -rf ${RPM_BUILD_ROOT}%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/install-tools
273  rm -rf ${RPM_BUILD_ROOT}%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/install-tools
274%endif
275
276  # Bug in gcc > 4.1.0: Installs an unused, empty directory
277  if test -d ${RPM_BUILD_ROOT}%{_prefix}/i586-pc-freebsd7.2/include/bits; then
278    rmdir ${RPM_BUILD_ROOT}%{_prefix}/i586-pc-freebsd7.2/include/bits
279  fi
280
281  # Collect multilib subdirectories
282  f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
283
284
285  rm -f dirs ;
286  echo "%defattr(-,root,root,-)" >> dirs
287  echo "%dir %{gcclib}" >> dirs
288  echo "%dir %{gcclib}/i586-pc-freebsd7.2" >> dirs
289
290  TGTDIR="%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}"
291  for i in $f; do
292    case $i in
293    \.) echo "%dir ${TGTDIR}" >> dirs
294      ;;
295    *)  echo "%dir ${TGTDIR}/$i" >> dirs
296      ;;
297    esac
298  done
299
300  # Collect files to go into different packages
301  cp dirs build/files.gcc
302  cp dirs build/files.g77
303  cp dirs build/files.gfortran
304  cp dirs build/files.objc
305  cp dirs build/files.gcj
306  cp dirs build/files.g++
307
308  TGTDIR="%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}"
309  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
310  for i in $f; do
311    case $i in
312    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
313    *f771) ;;
314    *f951) ;;
315    *cc1) ;;
316    *cc1obj) ;;
317    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
318    *collect2) ;;
319    *libobjc*) echo "$i" >> build/files.objc ;;
320    *include/objc*) ;;
321    *include/g++*);;
322    *include/c++*);;
323    *adainclude*);;
324    *adalib*);;
325    *gnat1);;
326    *jc1) ;;
327    *jvgenmain) ;;
328    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
329    */libstdc++.*) echo "$i" >> build/files.g++ ;;
330    */libsupc++.*) echo "$i" >> build/files.g++ ;;
331    *) echo "$i" >> build/files.gcc ;;
332    esac
333  done
334
335  TGTDIR="%{_exec_prefix}/i586-pc-freebsd7.2/lib"
336  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
337  for i in $f; do
338    case $i in
339    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
340    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
341# all other files belong to newlib
342    *) echo "$i" >> build/files.newlib ;;
343    esac
344  done
345# Extract %%__os_install_post into os_install_post~
346cat << \EOF > os_install_post~
347%__os_install_post
348EOF
349
350# Generate customized brp-*scripts
351cat os_install_post~ | while read a x y; do
352case $a in
353# Prevent brp-strip* from trying to handle foreign binaries
354*/brp-strip*)
355  b=$(basename $a)
356  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
357  chmod a+x $b
358  ;;
359esac
360done
361
362sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
363< os_install_post~ > os_install_post
364%define __os_install_post . ./os_install_post
365
366
367cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
368#!/bin/sh
369grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i586-pc-freebsd7.2/(lib|include|sys-root)' \
370  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i586-pc-freebsd7.2/' | %__find_provides
371EOF
372chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
373%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
374
375cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
376#!/bin/sh
377grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i586-pc-freebsd7.2/(lib|include|sys-root)' \
378  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i586-pc-freebsd7.2/' | %__find_requires
379EOF
380chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
381%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
382
383%ifnarch noarch
384# Extract %%__debug_install_post into debug_install_post~
385cat << \EOF > debug_install_post~
386%__debug_install_post
387EOF
388
389# Generate customized debug_install_post script
390cat debug_install_post~ | while read a x y; do
391case $a in
392# Prevent find-debuginfo.sh* from trying to handle foreign binaries
393*/find-debuginfo.sh)
394  b=$(basename $a)
395  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
396  chmod a+x $b
397  ;;
398esac
399done
400
401sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
402< debug_install_post~ > debug_install_post
403%define __debug_install_post . ./debug_install_post
404
405%endif
406
407%clean
408  rm -rf $RPM_BUILD_ROOT
409
410# ==============================================================
411# i586-pc-freebsd7.2-gcc
412# ==============================================================
413# %package -n i586-pc-freebsd7.2-gcc
414# Summary:        GNU cc compiler for i586-pc-freebsd7.2
415# Group:          Development/Tools
416# Version:        %{gcc_rpmvers}
417# Requires:       i586-pc-freebsd7.2-binutils
418# License:      GPL
419
420# %if %build_infos
421# Requires:      gcc-common
422# %endif
423
424%description -n i586-pc-freebsd7.2-gcc
425GNU cc compiler for i586-pc-freebsd7.2.
426
427%files -n i586-pc-freebsd7.2-gcc -f build/files.gcc
428%defattr(-,root,root)
429%{_mandir}/man1/i586-pc-freebsd7.2-gcc.1*
430%if "%{gcc_version}" >= "3.4"
431%{_mandir}/man1/i586-pc-freebsd7.2-cpp.1*
432%{_mandir}/man1/i586-pc-freebsd7.2-gcov.1*
433%endif
434
435%{_bindir}/i586-pc-freebsd7.2-cpp%{_exeext}
436%{_bindir}/i586-pc-freebsd7.2-gcc%{_exeext}
437%if "%{gcc_version}" >= "3.3"
438%{_bindir}/i586-pc-freebsd7.2-gcc-%{gcc_version}%{_exeext}
439%endif
440%{_bindir}/i586-pc-freebsd7.2-gcov%{_exeext}
441%{_bindir}/i586-pc-freebsd7.2-gccbug
442
443%dir %{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include
444%if "%{gcc_version}" > "4.0.3"
445%if "i586-pc-freebsd7.2" != "bfin-rtems4.10"
446%if "i586-pc-freebsd7.2" != "avr-rtems4.10"
447%dir %{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include/ssp
448%endif
449%endif
450%endif
451
452%if "%{gcc_version}" >= "4.3.0"
453%dir %{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include-fixed
454%endif
455
456%dir %{gccexec}
457%dir %{gccexec}/i586-pc-freebsd7.2
458%dir %{gccexec}/i586-pc-freebsd7.2/%{gcc_version}
459%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/cc1%{_exeext}
460%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/collect2%{_exeext}
461
462# ==============================================================
463# i586-pc-freebsd7.2-gcc-c++
464# ==============================================================
465%package -n i586-pc-freebsd7.2-gcc-c++
466Summary:        GCC c++ compiler for i586-pc-freebsd7.2
467Group:          Development/Tools
468Version:        %{gcc_rpmvers}
469License:        GPL
470
471%if "%{_build}" != "%{_host}"
472BuildRequires:  i586-pc-freebsd7.2-gcc-c++ = %{gcc_rpmvers}
473%endif
474Provides:       i586-pc-freebsd7.2-c++ = %{gcc_rpmvers}-%{release}
475Obsoletes:      i586-pc-freebsd7.2-c++ < %{gcc_rpmvers}-%{release}
476
477Requires:       i586-pc-freebsd7.2-gcc = %{gcc_rpmvers}-%{release}
478
479%description -n i586-pc-freebsd7.2-gcc-c++
480GCC c++ compiler for i586-pc-freebsd7.2.
481
482%files -n i586-pc-freebsd7.2-gcc-c++ -f build/files.g++
483%defattr(-,root,root)
484%{_mandir}/man1/i586-pc-freebsd7.2-g++.1*
485
486%{_bindir}/i586-pc-freebsd7.2-c++%{_exeext}
487%{_bindir}/i586-pc-freebsd7.2-g++%{_exeext}
488
489%dir %{gccexec}
490%dir %{gccexec}/i586-pc-freebsd7.2
491%dir %{gccexec}/i586-pc-freebsd7.2/%{gcc_version}
492%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/cc1plus%{_exeext}
493
494%dir %{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include
495%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include/c++
496
497# ==============================================================
498# i586-pc-freebsd7.2-gcc-gfortran
499# ==============================================================
500%package -n i586-pc-freebsd7.2-gcc-gfortran
501Summary:        Fortran 95 support for i586-pc-freebsd7.2-gcc
502Group:          Development/Tools
503Version:        %{gcc_rpmvers}
504License:        GPL
505
506Provides:       i586-pc-freebsd7.2-gfortran = %{gcc_rpmvers}-%{release}
507Obsoletes:      i586-pc-freebsd7.2-gfortran < %{gcc_rpmvers}-%{release}
508
509Requires:       i586-pc-freebsd7.2-gcc = %{gcc_rpmvers}-%{release}
510Obsoletes:      i586-pc-freebsd7.2-g77 < %{gcc_rpmvers}-%{release}
511
512%description -n i586-pc-freebsd7.2-gcc-gfortran
513GCC fortran compiler for i586-pc-freebsd7.2.
514
515%files -n i586-pc-freebsd7.2-gcc-gfortran -f build/files.gfortran
516%defattr(-,root,root)
517%{_bindir}/i586-pc-freebsd7.2-gfortran%{_exeext}
518
519%{_mandir}/man1/i586-pc-freebsd7.2-gfortran.1*
520
521%dir %{gccexec}
522%dir %{gccexec}/i586-pc-freebsd7.2
523%dir %{gccexec}/i586-pc-freebsd7.2/%{gcc_version}
524%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/f951%{_exeext}
525
526# ==============================================================
527# i586-pc-freebsd7.2-gcc-objc
528# ==============================================================
529%package -n i586-pc-freebsd7.2-gcc-objc
530Summary:        Objective C support for i586-pc-freebsd7.2-gcc
531Group:          Development/Tools
532Version:        %{gcc_rpmvers}
533License:        GPL
534Provides:       i586-pc-freebsd7.2-objc = %{gcc_rpmvers}-%{release}
535Obsoletes:      i586-pc-freebsd7.2-objc < %{gcc_rpmvers}-%{release}
536
537Requires:       i586-pc-freebsd7.2-gcc = %{gcc_rpmvers}-%{release}
538
539%description -n i586-pc-freebsd7.2-gcc-objc
540GCC objc compiler for i586-pc-freebsd7.2.
541
542%files -n i586-pc-freebsd7.2-gcc-objc -f build/files.objc
543%defattr(-,root,root)
544
545%dir %{gccexec}
546%dir %{gccexec}/i586-pc-freebsd7.2
547%dir %{gccexec}/i586-pc-freebsd7.2/%{gcc_version}
548%{gccexec}/i586-pc-freebsd7.2/%{gcc_version}/cc1obj%{_exeext}
549
550%{gcclib}/i586-pc-freebsd7.2/%{gcc_version}/include/objc
551
Note: See TracBrowser for help on using the repository browser.