source: rtems/contrib/crossrpms/rtems4.11/bfin/rtems-4.11-bfin-rtems4.11-gcc.spec @ dc2cc62

4.115
Last change on this file since dc2cc62 was dc2cc62, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 28, 2011 at 1:21:46 PM

Regenerate.

  • Property mode set to 100644
File size: 25.5 KB
Line 
1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
6%define _prefix                 /opt/rtems-4.11
7%define _exec_prefix            %{_prefix}
8%define _bindir                 %{_exec_prefix}/bin
9%define _sbindir                %{_exec_prefix}/sbin
10%define _libexecdir             %{_exec_prefix}/libexec
11%define _datarootdir            %{_prefix}/share
12%define _datadir                %{_datarootdir}
13%define _sysconfdir             %{_prefix}/etc
14%define _sharedstatedir         %{_prefix}/com
15%define _localstatedir          %{_prefix}/var
16%define _includedir             %{_prefix}/include
17%define _libdir                 %{_exec_prefix}/%{_lib}
18%define _mandir                 %{_datarootdir}/man
19%define _infodir                %{_datarootdir}/info
20%define _localedir              %{_datarootdir}/locale
21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
32%endif
33
34%ifos mingw mingw32
35%if %{defined _mingw32_cflags}
36%define optflags %{_mingw32_cflags}
37%else
38%define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
39%endif
40%endif
41
42%if "%{_build}" != "%{_host}"
43%define _host_rpmprefix %{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48
49%define gcc_pkgvers 4.6.2
50%define gcc_version 4.6.2
51%define gcc_rpmvers %{expand:%(echo "4.6.2" | tr - _ )}
52
53%define newlib_pkgvers          1.19.0
54%define newlib_version          1.19.0
55
56Name:           rtems-4.11-bfin-rtems4.11-gcc
57Summary:        bfin-rtems4.11 gcc
58
59Group:          Development/Tools
60Version:        %{gcc_rpmvers}
61Release:        1%{?dist}
62License:        GPL
63URL:            http://gcc.gnu.org
64BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
65
66%define _use_internal_dependency_generator 0
67
68BuildRequires:  %{_host_rpmprefix}gcc
69
70# FIXME: Disable lto for now, to avoid dependencies on libelf
71%bcond_with lto
72
73# FIXME: Disable python gdb scripts
74# ATM, no idea how to package them
75%bcond_with pygdb
76
77# FIXME: Disable GCC-plugin
78# Bug in gcc-4.5-20100318, doesn't build them on x86_84 hosts.
79%bcond_with plugin
80
81# EXPERIMENTAL: Use gcc's stdint.h instead of newlib's
82# Should be applicable to gcc >= 4.5.0
83%bcond_with gcc_stdint
84
85# EXPERIMENTAL: Enable newlib's iconv
86%bcond_without iconv
87
88# versions of libraries, we conditionally bundle if necessary
89%global mpc_version     0.8.1
90%global mpfr_version    2.4.2
91%global gmp_version     4.3.2
92%global libelf_version  0.8.13
93
94# versions of libraries these distros are known to ship
95%if 0%{?fc16}
96%global mpc_provided 0.8.3
97%global mpfr_provided 3.0.0
98%global gmp_provided 4.3.2
99%endif
100
101%if 0%{?fc15}
102%global mpc_provided 0.8.3
103%global mpfr_provided 3.0.0
104%global gmp_provided 4.3.2
105%endif
106
107%if 0%{?fc14}
108%global mpc_provided 0.8.1
109%global mpfr_provided 2.4.2
110%global gmp_provided 4.3.1
111%endif
112
113%if 0%{?el6}
114%global mpc_provided %{nil}
115%global mpfr_provided 2.4.1
116%global gmp_provided 4.3.1
117%endif
118
119%if 0%{?el5}
120%global mpc_provided %{nil}
121%global mpfr_provided %{nil}
122%global gmp_provided 4.1.4
123%endif
124
125%if 0%{?suse11_3}
126%global mpc_provided 0.8.1
127%global mpfr_provided 2.4.2
128%global gmp_provided 4.3.2
129%endif
130
131%if 0%{?suse11_4}
132%global mpc_provided 0.8.2
133%global mpfr_provided 3.0.0
134%global gmp_provided 5.0.1
135%endif
136
137%if 0%{?cygwin}
138%global mpc_provided 0.8
139%global mpfr_provided 2.4.1
140%global gmp_provided 4.3.1
141%endif
142
143%if 0%{?mingw32}
144%global mpc_provided 0.8.1
145%global mpfr_provided 2.4.1
146%global gmp_provided 4.3.2
147%endif
148
149%if "%{gcc_version}" >= "4.2.0"
150%endif
151
152%if "%{gcc_version}" >= "4.3.0"
153%define gmp_required            4.1
154%define mpfr_required           2.3.1
155%endif
156
157%if "%{gcc_version}" >= "4.3.3"
158%define cloog_required          0.15
159%endif
160
161%if "%{gcc_version}" >= "4.4.0"
162%define mpfr_required           2.3.2
163%endif
164
165%if "%{gcc_version}" >= "4.5.0"
166%define mpc_required            0.8
167%if %{with lto}
168%define libelf_required         0.8.12
169%endif
170%endif
171
172%if %{defined mpc_required}
173%if "%{mpc_provided}" >= "%{mpc_required}"
174%{?fedora:BuildRequires: libmpc-devel >= %{mpc_required}}
175%{?suse:BuildRequires: mpc-devel >= %{mpc_required}}
176%if "%{_build}" != "%{_host}"
177BuildRequires:  %{_host_rpmprefix}mpc-devel >= %{mpc_required}
178%endif
179%else
180%define _build_mpc 1
181%define gmp_required            4.2
182%endif
183%endif
184
185%if %{defined gmp_required}
186%if "%{gmp_provided}" >= "%{gmp_required}"
187BuildRequires: gmp-devel >= %{gmp_required}
188%if "%{_build}" != "%{_host}"
189BuildRequires:  %{_host_rpmprefix}gmp-devel >= %{gmp_required}
190%endif
191%else
192%define _build_gmp 1
193%endif
194%endif
195
196%if %{defined libelf_required}
197%if "%{libelf_provided}" >= "%{libelf_required}"
198BuildRequires: libelf-devel >= %{libelf_required}
199%if "%{_build}" != "%{_host}"
200BuildRequires:  %{_host_rpmprefix}libelf-devel >= %{libelf_required}
201%endif
202%else
203%define _build_libelf 1
204%endif
205%endif
206
207
208%if %{defined cloog_required}
209%{?fc14:BuildRequires: cloog-ppl-devel >= %cloog_required}
210%{?fc15:BuildRequires: cloog-ppl-devel >= %cloog_required}
211%{?fc16:BuildRequires: cloog-ppl-devel >= %cloog_required}
212%{?el6:BuildRequires: cloog-ppl-devel >= %cloog_required}
213%{?suse11_4:BuildRequires: cloog-devel >= %cloog_required, ppl-devel}
214%{?suse11_3:BuildRequires: cloog-devel >= %cloog_required, ppl-devel}
215%endif
216
217
218%if %{defined mpfr_required}
219%if "%{mpfr_provided}" >= "%{mpfr_required}"
220BuildRequires: mpfr-devel >= %{mpfr_required}
221%if "%{_build}" != "%{_host}"
222BuildRequires:  %{_host_rpmprefix}mpfr-devel >= %{mpfr_required}
223%endif
224%else
225%define _build_mpfr 1
226%endif
227%endif
228
229%if "%{_build}" != "%{_host}"
230BuildRequires:  rtems-4.11-bfin-rtems4.11-gcc = %{gcc_rpmvers}
231%endif
232
233# Not strictly required, but patches may introduce a need to use them.
234# For reasons of simplicity, always require them.
235BuildRequires:  flex bison
236
237BuildRequires:  texinfo >= 4.2
238BuildRequires:  rtems-4.11-bfin-rtems4.11-binutils
239
240Requires:       rtems-4.11-gcc-common
241Requires:       rtems-4.11-bfin-rtems4.11-binutils
242Requires:       rtems-4.11-bfin-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
243Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-20%{?dist}
244
245%if "%{gcc_version}" >= "4.5.0"
246BuildRequires:  zlib-devel
247%if "%{_build}" != "%{_host}"
248BuildRequires:  %{_host_rpmprefix}zlib-devel
249%endif
250%else
251%endif
252
253%global _gcclibdir %{_prefix}/lib
254
255%if "%{gcc_version}" == "4.6.2"
256Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2
257Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.6.2-rtems4.11-20111028.diff
258%endif
259%if "%{gcc_version}" == "4.5.3"
260Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2
261Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-core-4.5.3-rtems4.11-20110905.diff
262%endif
263
264%if "%{gcc_version}" == "4.6.2"
265Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/%{gcc_pkgvers}/gcc-g++-%{gcc_pkgvers}.tar.bz2
266%endif
267%if "%{gcc_version}" == "4.5.3"
268Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/gcc-g++-%{gcc_pkgvers}.tar.bz2
269Patch1:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gcc-g++-4.5.3-rtems4.11-20110905.diff
270%endif
271
272%if "%{newlib_version}" == "1.19.0"
273Source50:       ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
274Patch50:        ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/newlib-1.19.0-rtems4.11-20111006.diff
275%endif
276
277%if 0%{?_build_mpfr}
278Source60:    http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
279%endif
280
281%if 0%{?_build_mpc}
282Source61:    http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
283%endif
284
285%if 0%{?_build_gmp}
286Source62:    ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
287%endif
288
289%if 0%{?_build_libelf}
290Source63:    http://www.mr511.de/software/libelf-%{libelf_version}.tar.gz
291%endif
292
293%description
294Cross gcc for bfin-rtems4.11.
295
296%prep
297%setup -c -T -n %{name}-%{version}
298
299%setup -q -T -D -n %{name}-%{version} -a0
300cd gcc-%{gcc_pkgvers}
301%{?PATCH0:%patch0 -p1}
302cd ..
303
304%{?SOURCE1:%setup -q -T -D -n %{name}-%{version} -a1}
305cd gcc-%{gcc_pkgvers}
306%{?PATCH1:%patch1 -p1}
307cd ..
308
309
310
311
312
313%if %{with gcc_stdint}
314sed -i -e '/thread_file=.*rtems/,/use_gcc_stdint=wrap/ { s/use_gcc_stdint=wrap/use_gcc_stdint=provide/}' gcc-%{gcc_pkgvers}/gcc/config.gcc
315%endif
316
317%setup -q -T -D -n %{name}-%{version} -a50
318cd newlib-%{newlib_version}
319%{?PATCH50:%patch50 -p1}
320cd ..
321  # Copy the C library into gcc's source tree
322  ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_pkgvers}
323%if %{with gcc_stdint}
324  rm gcc-%{gcc_pkgvers}/newlib/libc/include/stdint.h
325%endif
326  # Make sure not to be using GPL'ed sources
327  rm -rf gcc-%{gcc_pkgvers}/newlib/libc/sys/linux
328  rm -rf gcc-%{gcc_pkgvers}/newlib/libc/sys/rdos
329
330%if 0%{?_build_mpfr}
331%setup -q -T -D -n %{name}-%{version} -a60
332%{?PATCH60:%patch60 -p1}
333  # Build mpfr one-tree style
334  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
335%endif
336
337%if 0%{?_build_mpc}
338%setup -q -T -D -n %{name}-%{version} -a61
339%{?PATCH61:%patch61 -p1}
340  # Build mpc one-tree style
341  ln -s ../mpc-%{mpc_version} gcc-%{gcc_pkgvers}/mpc
342%endif
343
344%if 0%{?_build_gmp}
345%setup -q -T -D -n %{name}-%{version} -a62
346%{?PATCH62:%patch62 -p1}
347  # Build gmp one-tree style
348  ln -s ../gmp-%{gmp_version} gcc-%{gcc_pkgvers}/gmp
349%endif
350
351%if 0%{?_build_libelf}
352%setup -q -T -D -n %{name}-%{version} -a63
353%{?PATCH63:%patch63 -p1}
354  # Build libelf one-tree style
355  ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
356%endif
357
358echo "RTEMS gcc-%{gcc_version}-1%{?dist}/newlib-%{newlib_version}-20%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
359
360
361  # Fix timestamps
362  cd gcc-%{gcc_pkgvers}
363  contrib/gcc_update --touch
364  cd ..
365%build
366  mkdir -p build
367
368  cd build
369
370  languages="c"
371  languages="$languages,c++"
372  export PATH="%{_bindir}:${PATH}"
373%if "%{_build}" != "%{_host}"
374  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
375  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
376%else
377# gcc is not ready to be compiled with -std=gnu99
378  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
379%endif
380  ../gcc-%{gcc_pkgvers}/configure \
381    --prefix=%{_prefix} \
382    --bindir=%{_bindir} \
383    --exec_prefix=%{_exec_prefix} \
384    --includedir=%{_includedir} \
385    --libdir=%{_gcclibdir} \
386    --libexecdir=%{_libexecdir} \
387    --mandir=%{_mandir} \
388    --infodir=%{_infodir} \
389    --datadir=%{_datadir} \
390    --build=%_build --host=%_host \
391    --target=bfin-rtems4.11 \
392    --disable-libstdcxx-pch \
393    --with-gnu-as --with-gnu-ld --verbose \
394    --with-newlib \
395    --with-system-zlib \
396    --disable-nls --without-included-gettext \
397    --disable-win32-registry \
398    --enable-version-specific-runtime-libs \
399    --enable-threads \
400    %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \
401    %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \
402    --enable-newlib-io-c99-formats \
403    %{?with_iconv:--enable-newlib-iconv} \
404    --enable-languages="$languages"
405
406%if "%_host" != "%_build"
407  # Bug in gcc-3.2.1:
408  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
409  mkdir -p gcc/include
410  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
411%endif
412
413  make %{?_smp_mflags} all
414  make info
415  cd ..
416
417%install
418  export PATH="%{_bindir}:${PATH}"
419  rm -rf $RPM_BUILD_ROOT
420
421  cd build
422
423  make DESTDIR=$RPM_BUILD_ROOT install
424  cd ..
425
426  cd build/bfin-rtems4.11/newlib
427  make DESTDIR=$RPM_BUILD_ROOT install-info
428  cd ../../..
429
430%if "%{gcc_version}" <= "4.1.2"
431# Misplaced header file
432  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
433    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
434      $RPM_BUILD_ROOT%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/include/
435  fi
436%endif
437
438  # host library
439%if "%{gcc_version}" >= "4.2.0"
440  # libiberty doesn't honor --libdir, but always installs to a
441  # magically guessed _libdir
442  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
443%else
444  # libiberty installs to --libdir=...
445  rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a
446%endif
447
448  # We use the version from binutils
449  rm -f $RPM_BUILD_ROOT%{_bindir}/bfin-rtems4.11-c++filt%{_exeext}
450
451
452  # We don't ship info/dir
453  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
454  touch $RPM_BUILD_ROOT%{_infodir}/dir
455
456  # We don't want libffi's man-pages
457  rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*ffi*
458
459  # Bug in gcc-3.4.0pre
460  rm -f $RPM_BUILD_ROOT%{_bindir}/bfin-rtems4.11-bfin-rtems4.11-gcjh%{_exeext}
461
462  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
463  # the fixinclude-install-tools
464  rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/install-tools
465  rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/install-tools
466
467  # Bug in gcc > 4.1.0: Installs an unused, empty directory
468  if test -d ${RPM_BUILD_ROOT}%{_prefix}/bfin-rtems4.11/include/bits; then
469    rmdir ${RPM_BUILD_ROOT}%{_prefix}/bfin-rtems4.11/include/bits
470  fi
471
472%if %{with iconv}
473  # Iconv enabled newlib installs external ccts (target files)
474  if test -d ${RPM_BUILD_ROOT}%{_datadir}/iconv_data; then
475    rm -rf ${RPM_BUILD_ROOT}%{_datadir}/iconv_data
476  fi
477%endif
478
479%if ! %{with pygdb}
480  # gcc >= 4.5.0: installs weird libstdc++ python bindings.
481  if test -d ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python; then
482    rm -rf ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python/libstdcxx
483  fi
484
485%endif
486  # Collect multilib subdirectories
487  multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
488
489  echo "%defattr(-,root,root,-)" > build/files.newlib
490  TGTDIR="%{_exec_prefix}/bfin-rtems4.11/lib"
491  for i in $multilibs; do
492    case $i in
493    \.) echo "%dir ${TGTDIR}" >> build/files.newlib
494      ;;
495    *)  echo "%dir ${TGTDIR}/$i" >> build/files.newlib
496      ;;
497    esac
498  done
499
500  rm -f dirs ;
501  echo "%defattr(-,root,root,-)" >> dirs
502  TGTDIR="%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}"
503  for i in $multilibs; do
504    case $i in
505    \.) ;; # ignore, handled elsewhere
506    *)  echo "%dir ${TGTDIR}/$i" >> dirs
507      ;;
508    esac
509  done
510
511  # Collect files to go into different packages
512  cp dirs build/files.gcc
513  cp dirs build/files.gfortran
514  cp dirs build/files.objc
515  cp dirs build/files.gcj
516  cp dirs build/files.g++
517  cp dirs build/files.go
518
519  TGTDIR="%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}"
520  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
521  for i in $f; do
522    case $i in
523    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
524    *f771) ;;
525    *f951) ;;
526    *cc1) ;;
527    *cc1obj) ;;
528    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
529    *collect2) ;;
530    *libobjc*) echo "$i" >> build/files.objc ;;
531    *go1) ;; # ignore: explicitly put into rpm elsewhere
532    *include/objc*) ;;
533    *include/g++*);;
534    *include/c++*);;
535    *include-fixed/*);;
536    *finclude/*);;
537    */go/*) ;; # ignore : explicitly put into rpm elsewhere
538    *adainclude*);;
539    *adalib*);;
540    *gnat1);;
541    *jc1) ;;
542    *jvgenmain) ;;
543    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
544    */libgo.*) echo "$i" >> build/files.go ;;
545    %{!?with_pygdb:*/libstdc++*gdb.py*) rm ${RPM_BUILD_ROOT}/$i ;;} # ignore for now
546    %{?with_pygdb:*/libstdc++*gdb.py*) >> build/files.g++ ;;}
547    */libstdc++.*) echo "$i" >> build/files.g++ ;;
548    */libsupc++.*) echo "$i" >> build/files.g++ ;;
549    *) echo "$i" >> build/files.gcc ;;
550    esac
551  done
552
553  TGTDIR="%{_exec_prefix}/bfin-rtems4.11/lib"
554  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
555  for i in $f; do
556    case $i in
557    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
558    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
559# all other files belong to newlib
560    *) echo "$i" >> build/files.newlib ;;
561    esac
562  done
563# Extract %%__os_install_post into os_install_post~
564cat << \EOF > os_install_post~
565%__os_install_post
566EOF
567
568# Generate customized brp-*scripts
569cat os_install_post~ | while read a x y; do
570case $a in
571# Prevent brp-strip* from trying to handle foreign binaries
572*/brp-strip*)
573  b=$(basename $a)
574  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
575  chmod a+x $b
576  ;;
577# Fix up brp-compress to handle %%_prefix != /usr
578*/brp-compress*)
579  b=$(basename $a)
580  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
581  chmod a+x $b
582  ;;
583esac
584done
585
586sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
587  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
588< os_install_post~ > os_install_post
589%define __os_install_post . ./os_install_post
590
591
592cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
593#!/bin/sh
594grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/bfin-rtems4.11/(lib|include|sys-root)' \
595  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/bfin-rtems4.11/'} | %__find_provides
596EOF
597chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
598%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
599
600cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
601#!/bin/sh
602grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/bfin-rtems4.11/(lib|include|sys-root)' \
603  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/bfin-rtems4.11/'} | %__find_requires
604EOF
605chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
606%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
607
608%ifnarch noarch
609# Extract %%__debug_install_post into debug_install_post~
610cat << \EOF > debug_install_post~
611%__debug_install_post
612EOF
613
614# Generate customized debug_install_post script
615cat debug_install_post~ | while read a x y; do
616case $a in
617# Prevent find-debuginfo.sh* from trying to handle foreign binaries
618*/find-debuginfo.sh)
619  b=$(basename $a)
620  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
621  chmod a+x $b
622  ;;
623esac
624done
625
626sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
627< debug_install_post~ > debug_install_post
628%define __debug_install_post . ./debug_install_post
629
630%endif
631
632%clean
633  rm -rf $RPM_BUILD_ROOT
634
635# ==============================================================
636# rtems-4.11-bfin-rtems4.11-gcc
637# ==============================================================
638# %package -n rtems-4.11-bfin-rtems4.11-gcc
639# Summary:        GNU cc compiler for bfin-rtems4.11
640# Group:          Development/Tools
641# Version:        %{gcc_rpmvers}
642# Requires:       rtems-4.11-bfin-rtems4.11-binutils
643# Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-20%{?dist}
644# License:      GPL
645
646# %if %build_infos
647# Requires:      rtems-4.11-gcc-common
648# %endif
649
650%description -n rtems-4.11-bfin-rtems4.11-gcc
651GNU cc compiler for bfin-rtems4.11.
652
653# ==============================================================
654# rtems-4.11-bfin-rtems4.11-gcc-libgcc
655# ==============================================================
656%package -n rtems-4.11-bfin-rtems4.11-gcc-libgcc
657Summary:        libgcc for bfin-rtems4.11-gcc
658Group:          Development/Tools
659Version:        %{gcc_rpmvers}
660%{?_with_noarch_subpackages:BuildArch: noarch}
661Requires:       rtems-4.11-bfin-rtems4.11-newlib = %{newlib_version}-20%{?dist}
662License:        GPL
663
664%description -n rtems-4.11-bfin-rtems4.11-gcc-libgcc
665libgcc bfin-rtems4.11-gcc.
666
667
668%files -n rtems-4.11-bfin-rtems4.11-gcc
669%defattr(-,root,root)
670%dir %{_prefix}
671
672%dir %{_mandir}
673%dir %{_mandir}/man1
674%{_mandir}/man1/bfin-rtems4.11-gcc.1*
675%{_mandir}/man1/bfin-rtems4.11-cpp.1*
676%{_mandir}/man1/bfin-rtems4.11-gcov.1*
677
678%dir %{_bindir}
679%{_bindir}/bfin-rtems4.11-cpp%{_exeext}
680%{_bindir}/bfin-rtems4.11-gcc%{_exeext}
681%{_bindir}/bfin-rtems4.11-gcc-%{gcc_version}%{_exeext}
682%{_bindir}/bfin-rtems4.11-gcov%{_exeext}
683%if "%{gcc_version}" < "4.6.0"
684%{_bindir}/bfin-rtems4.11-gccbug
685%endif
686
687%dir %{_libexecdir}
688%dir %{_libexecdir}/gcc
689%dir %{_libexecdir}/gcc/bfin-rtems4.11
690%dir %{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}
691%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/cc1%{_exeext}
692%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/collect2%{_exeext}
693%if "%{gcc_version}" >= "4.5.0"
694%{?with_lto:%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/lto%{_exeext}}
695%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/lto-wrapper%{_exeext}
696%endif
697
698%files -n rtems-4.11-bfin-rtems4.11-gcc-libgcc -f build/files.gcc
699%defattr(-,root,root)
700%dir %{_prefix}
701%dir %{_gcclibdir}
702%dir %{_gcclibdir}/gcc
703%dir %{_gcclibdir}/gcc/bfin-rtems4.11
704%dir %{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}
705%dir %{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/include
706
707%if "%{gcc_version}" > "4.0.3"
708%endif
709
710%if "%{gcc_version}" >= "4.3.0"
711%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/include-fixed
712%endif
713
714# ==============================================================
715# rtems-4.11-gcc-common
716# ==============================================================
717%package -n rtems-4.11-gcc-common
718Summary:        Base package for rtems gcc and newlib C Library
719Group:          Development/Tools
720Version:        %{gcc_rpmvers}
721%{?_with_noarch_subpackages:BuildArch: noarch}
722License:        GPL
723
724Requires(post):         /sbin/install-info
725Requires(preun):        /sbin/install-info
726
727%description -n rtems-4.11-gcc-common
728GCC files that are shared by all targets.
729
730%files -n rtems-4.11-gcc-common
731%defattr(-,root,root)
732%dir %{_prefix}
733%dir %{_prefix}/share
734
735%dir %{_infodir}
736%ghost %{_infodir}/dir
737%{_infodir}/cpp.info*
738%{_infodir}/cppinternals.info*
739%{_infodir}/gcc.info*
740%{_infodir}/gccint.info*
741%{_infodir}/gccinstall.info*
742%if "%{gcc_version}" >= "4.6.0"
743%{_infodir}/libquadmath.info*
744%endif
745
746%dir %{_mandir}
747%dir %{_mandir}/man7
748%{_mandir}/man7/fsf-funding.7*
749%{_mandir}/man7/gfdl.7*
750%{_mandir}/man7/gpl.7*
751
752%post -n rtems-4.11-gcc-common
753  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
754  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
755  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
756  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
757  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
758
759%preun -n rtems-4.11-gcc-common
760if [ $1 -eq 0 ]; then
761  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
762  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
763  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
764  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
765  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
766fi
767
768# ==============================================================
769# rtems-4.11-bfin-rtems4.11-gcc-c++
770# ==============================================================
771%package -n rtems-4.11-bfin-rtems4.11-gcc-c++
772Summary:        GCC c++ compiler for bfin-rtems4.11
773Group:          Development/Tools
774Version:        %{gcc_rpmvers}
775License:        GPL
776Requires:       rtems-4.11-bfin-rtems4.11-gcc-libstdc++ = %{gcc_rpmvers}-%{release}
777
778%if "%{_build}" != "%{_host}"
779BuildRequires:  rtems-4.11-bfin-rtems4.11-gcc-c++ = %{gcc_rpmvers}
780%endif
781
782Requires:       rtems-4.11-gcc-common
783Requires:       rtems-4.11-bfin-rtems4.11-gcc = %{gcc_rpmvers}-%{release}
784
785%description -n rtems-4.11-bfin-rtems4.11-gcc-c++
786GCC c++ compiler for bfin-rtems4.11.
787
788
789%package -n rtems-4.11-bfin-rtems4.11-gcc-libstdc++
790Summary:        libstdc++ for bfin-rtems4.11
791Group:          Development/Tools
792Version:        %{gcc_rpmvers}
793%{?_with_noarch_subpackages:BuildArch: noarch}
794License:        GPL
795
796%description -n rtems-4.11-bfin-rtems4.11-gcc-libstdc++
797%{summary}
798
799
800%files -n rtems-4.11-bfin-rtems4.11-gcc-c++
801%defattr(-,root,root)
802%dir %{_prefix}
803
804%dir %{_mandir}
805%dir %{_mandir}/man1
806%{_mandir}/man1/bfin-rtems4.11-g++.1*
807
808%dir %{_bindir}
809%{_bindir}/bfin-rtems4.11-c++%{_exeext}
810%{_bindir}/bfin-rtems4.11-g++%{_exeext}
811
812%dir %{_libexecdir}
813%dir %{_libexecdir}/gcc
814%dir %{_libexecdir}/gcc/bfin-rtems4.11
815%dir %{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}
816%{_libexecdir}/gcc/bfin-rtems4.11/%{gcc_version}/cc1plus%{_exeext}
817
818
819%files -n rtems-4.11-bfin-rtems4.11-gcc-libstdc++ -f build/files.g++
820%defattr(-,root,root)
821%dir %{_prefix}
822%dir %{_gcclibdir}
823%dir %{_gcclibdir}/gcc
824%dir %{_gcclibdir}/gcc/bfin-rtems4.11
825%dir %{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}
826%dir %{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/include
827%{_gcclibdir}/gcc/bfin-rtems4.11/%{gcc_version}/include/c++
828
829
830
831# ==============================================================
832# rtems-4.11-bfin-rtems4.11-newlib
833# ==============================================================
834%package -n rtems-4.11-bfin-rtems4.11-newlib
835Summary:        C Library (newlib) for bfin-rtems4.11
836Group:          Development/Tools
837License:        Distributable
838Version:        %{newlib_version}
839Release:        20%{?dist}
840%{?_with_noarch_subpackages:BuildArch: noarch}
841
842Requires:       rtems-4.11-newlib-common
843
844%description -n rtems-4.11-bfin-rtems4.11-newlib
845Newlib C Library for bfin-rtems4.11.
846
847%files -n rtems-4.11-bfin-rtems4.11-newlib -f build/files.newlib
848%defattr(-,root,root)
849%dir %{_exec_prefix}
850%dir %{_exec_prefix}/bfin-rtems4.11
851%{_exec_prefix}/bfin-rtems4.11/include
852
853# ==============================================================
854# rtems-4.11-newlib-common
855# ==============================================================
856%package -n rtems-4.11-newlib-common
857Summary:        Base package for RTEMS newlib C Library
858Group:          Development/Tools
859Version:        %{newlib_version}
860Release:        20%{?dist}
861%{?_with_noarch_subpackages:BuildArch: noarch}
862License:        Distributable
863
864Requires(post):         /sbin/install-info
865Requires(preun):        /sbin/install-info
866
867%description -n rtems-4.11-newlib-common
868newlib files that are shared by all targets.
869
870%files -n rtems-4.11-newlib-common
871%defattr(-,root,root)
872%dir %{_prefix}
873%dir %{_prefix}/share
874
875%dir %{_infodir}
876%ghost %{_infodir}/dir
877%{_infodir}/libc.info*
878%{_infodir}/libm.info*
879
880%post -n rtems-4.11-newlib-common
881  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
882  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
883
884%preun -n rtems-4.11-newlib-common
885if [ $1 -eq 0 ]; then
886  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
887  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
888fi
889
Note: See TracBrowser for help on using the repository browser.