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

4.115
Last change on this file since d76de26 was 0d10d566, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/25/10 at 12:46:46

Regenerate.

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