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

4.104.11
Last change on this file since 79e55c5 was 79e55c5, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 27, 2009 at 8:14:23 AM

Modernize.

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