source: rtems/contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-gcc.spec @ be0f7669

4.10
Last change on this file since be0f7669 was be0f7669, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/20/11 at 15:39:02

Regenerate.

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