source: rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec @ 4778c6e0

4.115
Last change on this file since 4778c6e0 was dc2cc62, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/28/11 at 13:21:46

Regenerate.

  • Property mode set to 100644
File size: 25.3 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-sh-rtems4.11-gcc
57Summary:        sh-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-sh-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-sh-rtems4.11-binutils
239
240Requires:       rtems-4.11-gcc-common
241Requires:       rtems-4.11-sh-rtems4.11-binutils
242Requires:       rtems-4.11-sh-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
243Requires:       rtems-4.11-sh-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 sh-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=sh-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/sh-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/sh-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}/sh-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}/sh-rtems4.11-sh-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/sh-rtems4.11/%{gcc_version}/install-tools
465  rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/sh-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}/sh-rtems4.11/include/bits; then
469    rmdir ${RPM_BUILD_ROOT}%{_prefix}/sh-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}/sh-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/sh-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/sh-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}/sh-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}/sh-rtems4.11/(lib|include|sys-root)' \
595  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/sh-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}/sh-rtems4.11/(lib|include|sys-root)' \
603  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/sh-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-sh-rtems4.11-gcc
637# ==============================================================
638# %package -n rtems-4.11-sh-rtems4.11-gcc
639# Summary:        GNU cc compiler for sh-rtems4.11
640# Group:          Development/Tools
641# Version:        %{gcc_rpmvers}
642# Requires:       rtems-4.11-sh-rtems4.11-binutils
643# Requires:       rtems-4.11-sh-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-sh-rtems4.11-gcc
651GNU cc compiler for sh-rtems4.11.
652
653# ==============================================================
654# rtems-4.11-sh-rtems4.11-gcc-libgcc
655# ==============================================================
656%package -n rtems-4.11-sh-rtems4.11-gcc-libgcc
657Summary:        libgcc for sh-rtems4.11-gcc
658Group:          Development/Tools
659Version:        %{gcc_rpmvers}
660%{?_with_noarch_subpackages:BuildArch: noarch}
661Requires:       rtems-4.11-sh-rtems4.11-newlib = %{newlib_version}-20%{?dist}
662License:        GPL
663
664%description -n rtems-4.11-sh-rtems4.11-gcc-libgcc
665libgcc sh-rtems4.11-gcc.
666
667
668%files -n rtems-4.11-sh-rtems4.11-gcc
669%defattr(-,root,root)
670%dir %{_prefix}
671
672%dir %{_mandir}
673%dir %{_mandir}/man1
674%{_mandir}/man1/sh-rtems4.11-gcc.1*
675%{_mandir}/man1/sh-rtems4.11-cpp.1*
676%{_mandir}/man1/sh-rtems4.11-gcov.1*
677
678%dir %{_bindir}
679%{_bindir}/sh-rtems4.11-cpp%{_exeext}
680%{_bindir}/sh-rtems4.11-gcc%{_exeext}
681%{_bindir}/sh-rtems4.11-gcc-%{gcc_version}%{_exeext}
682%{_bindir}/sh-rtems4.11-gcov%{_exeext}
683%if "%{gcc_version}" < "4.6.0"
684%{_bindir}/sh-rtems4.11-gccbug
685%endif
686
687%dir %{_libexecdir}
688%dir %{_libexecdir}/gcc
689%dir %{_libexecdir}/gcc/sh-rtems4.11
690%dir %{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}
691%{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}/cc1%{_exeext}
692%{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}/collect2%{_exeext}
693%if "%{gcc_version}" >= "4.5.0"
694%{?with_lto:%{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}/lto%{_exeext}}
695%{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}/lto-wrapper%{_exeext}
696%endif
697
698%files -n rtems-4.11-sh-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/sh-rtems4.11
704%dir %{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}
705%dir %{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}/include
706
707%if "%{gcc_version}" > "4.0.3"
708%dir %{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}/include/ssp
709%endif
710
711%if "%{gcc_version}" >= "4.3.0"
712%{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}/include-fixed
713%endif
714
715# ==============================================================
716# rtems-4.11-gcc-common
717# ==============================================================
718%package -n rtems-4.11-gcc-common
719Summary:        Base package for rtems gcc and newlib C Library
720Group:          Development/Tools
721Version:        %{gcc_rpmvers}
722%{?_with_noarch_subpackages:BuildArch: noarch}
723License:        GPL
724
725Requires(post):         /sbin/install-info
726Requires(preun):        /sbin/install-info
727
728%description -n rtems-4.11-gcc-common
729GCC files that are shared by all targets.
730
731%files -n rtems-4.11-gcc-common
732%defattr(-,root,root)
733%dir %{_prefix}
734%dir %{_prefix}/share
735
736%dir %{_infodir}
737%ghost %{_infodir}/dir
738%{_infodir}/cpp.info*
739%{_infodir}/cppinternals.info*
740%{_infodir}/gcc.info*
741%{_infodir}/gccint.info*
742%{_infodir}/gccinstall.info*
743%if "%{gcc_version}" >= "4.6.0"
744%{_infodir}/libquadmath.info*
745%endif
746
747%dir %{_mandir}
748%dir %{_mandir}/man7
749%{_mandir}/man7/fsf-funding.7*
750%{_mandir}/man7/gfdl.7*
751%{_mandir}/man7/gpl.7*
752
753%post -n rtems-4.11-gcc-common
754  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
755  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
756  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
757  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
758  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
759
760%preun -n rtems-4.11-gcc-common
761if [ $1 -eq 0 ]; then
762  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
763  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
764  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
765  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
766  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
767fi
768
769# ==============================================================
770# rtems-4.11-sh-rtems4.11-gcc-c++
771# ==============================================================
772%package -n rtems-4.11-sh-rtems4.11-gcc-c++
773Summary:        GCC c++ compiler for sh-rtems4.11
774Group:          Development/Tools
775Version:        %{gcc_rpmvers}
776License:        GPL
777Requires:       rtems-4.11-sh-rtems4.11-gcc-libstdc++ = %{gcc_rpmvers}-%{release}
778
779%if "%{_build}" != "%{_host}"
780BuildRequires:  rtems-4.11-sh-rtems4.11-gcc-c++ = %{gcc_rpmvers}
781%endif
782
783Requires:       rtems-4.11-gcc-common
784Requires:       rtems-4.11-sh-rtems4.11-gcc = %{gcc_rpmvers}-%{release}
785
786%description -n rtems-4.11-sh-rtems4.11-gcc-c++
787GCC c++ compiler for sh-rtems4.11.
788
789
790%package -n rtems-4.11-sh-rtems4.11-gcc-libstdc++
791Summary:        libstdc++ for sh-rtems4.11
792Group:          Development/Tools
793Version:        %{gcc_rpmvers}
794%{?_with_noarch_subpackages:BuildArch: noarch}
795License:        GPL
796
797%description -n rtems-4.11-sh-rtems4.11-gcc-libstdc++
798%{summary}
799
800
801%files -n rtems-4.11-sh-rtems4.11-gcc-c++
802%defattr(-,root,root)
803%dir %{_prefix}
804
805%dir %{_mandir}
806%dir %{_mandir}/man1
807%{_mandir}/man1/sh-rtems4.11-g++.1*
808
809%dir %{_bindir}
810%{_bindir}/sh-rtems4.11-c++%{_exeext}
811%{_bindir}/sh-rtems4.11-g++%{_exeext}
812
813%dir %{_libexecdir}
814%dir %{_libexecdir}/gcc
815%dir %{_libexecdir}/gcc/sh-rtems4.11
816%dir %{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}
817%{_libexecdir}/gcc/sh-rtems4.11/%{gcc_version}/cc1plus%{_exeext}
818
819
820%files -n rtems-4.11-sh-rtems4.11-gcc-libstdc++ -f build/files.g++
821%defattr(-,root,root)
822%dir %{_prefix}
823%dir %{_gcclibdir}
824%dir %{_gcclibdir}/gcc
825%dir %{_gcclibdir}/gcc/sh-rtems4.11
826%dir %{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}
827%dir %{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}/include
828%{_gcclibdir}/gcc/sh-rtems4.11/%{gcc_version}/include/c++
829
830
831
832# ==============================================================
833# rtems-4.11-sh-rtems4.11-newlib
834# ==============================================================
835%package -n rtems-4.11-sh-rtems4.11-newlib
836Summary:        C Library (newlib) for sh-rtems4.11
837Group:          Development/Tools
838License:        Distributable
839Version:        %{newlib_version}
840Release:        20%{?dist}
841%{?_with_noarch_subpackages:BuildArch: noarch}
842
843Requires:       rtems-4.11-newlib-common
844
845%description -n rtems-4.11-sh-rtems4.11-newlib
846Newlib C Library for sh-rtems4.11.
847
848%files -n rtems-4.11-sh-rtems4.11-newlib -f build/files.newlib
849%defattr(-,root,root)
850%dir %{_exec_prefix}
851%dir %{_exec_prefix}/sh-rtems4.11
852%{_exec_prefix}/sh-rtems4.11/include
853
854# ==============================================================
855# rtems-4.11-newlib-common
856# ==============================================================
857%package -n rtems-4.11-newlib-common
858Summary:        Base package for RTEMS newlib C Library
859Group:          Development/Tools
860Version:        %{newlib_version}
861Release:        20%{?dist}
862%{?_with_noarch_subpackages:BuildArch: noarch}
863License:        Distributable
864
865Requires(post):         /sbin/install-info
866Requires(preun):        /sbin/install-info
867
868%description -n rtems-4.11-newlib-common
869newlib files that are shared by all targets.
870
871%files -n rtems-4.11-newlib-common
872%defattr(-,root,root)
873%dir %{_prefix}
874%dir %{_prefix}/share
875
876%dir %{_infodir}
877%ghost %{_infodir}/dir
878%{_infodir}/libc.info*
879%{_infodir}/libm.info*
880
881%post -n rtems-4.11-newlib-common
882  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
883  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
884
885%preun -n rtems-4.11-newlib-common
886if [ $1 -eq 0 ]; then
887  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
888  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
889fi
890
Note: See TracBrowser for help on using the repository browser.