source: rtems/contrib/crossrpms/rtems4.11/sh/rtems-4.11-sh-rtems4.11-gcc.spec @ 49df63a

4.115
Last change on this file since 49df63a was afb875e4, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/15/11 at 16:31:52

Regenerate.

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