source: rtems/contrib/crossrpms/rtems4.11/m32r/rtems-4.11-m32r-rtems4.11-gcc.spec @ 7594821

4.115
Last change on this file since 7594821 was 6fb1852, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 31, 2011 at 8:15:47 AM

Regenerate.

  • Property mode set to 100644
File size: 23.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.1
50%define gcc_version 4.6.1
51%define gcc_rpmvers %{expand:%(echo "4.6.1" | tr - _ )}
52
53%define newlib_pkgvers          1.19.0
54%define newlib_version          1.19.0
55
56Name:           rtems-4.11-m32r-rtems4.11-gcc
57Summary:        m32r-rtems4.11 gcc
58
59Group:          Development/Tools
60Version:        %{gcc_rpmvers}
61Release:        7%{?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-m32r-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-m32r-rtems4.11-binutils
239
240Requires:       rtems-4.11-gcc-common
241Requires:       rtems-4.11-m32r-rtems4.11-binutils
242Requires:       rtems-4.11-m32r-rtems4.11-gcc-libgcc = %{gcc_rpmvers}-%{release}
243Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-17%{?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.1"
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.1-rtems4.11-20110715.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-20110426.diff
262%endif
263
264%if "%{newlib_version}" == "1.19.0"
265Source50:       ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
266Patch50:        ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/newlib-1.19.0-rtems4.11-20110724.diff
267%endif
268
269%if 0%{?_build_mpfr}
270Source60:    http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
271%endif
272
273%if 0%{?_build_mpc}
274Source61:    http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
275%endif
276
277%if 0%{?_build_gmp}
278Source62:    ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
279%endif
280
281%if 0%{?_build_libelf}
282Source63:    http://www.mr511.de/software/libelf-%{libelf_version}.tar.gz
283%endif
284
285%description
286Cross gcc for m32r-rtems4.11.
287
288%prep
289%setup -c -T -n %{name}-%{version}
290
291%setup -q -T -D -n %{name}-%{version} -a0
292cd gcc-%{gcc_pkgvers}
293%{?PATCH0:%patch0 -p1}
294cd ..
295
296
297
298
299
300
301%if %{with gcc_stdint}
302sed -i -e '/thread_file=.*rtems/,/use_gcc_stdint=wrap/ { s/use_gcc_stdint=wrap/use_gcc_stdint=provide/}' gcc-%{gcc_pkgvers}/gcc/config.gcc
303%endif
304
305%setup -q -T -D -n %{name}-%{version} -a50
306cd newlib-%{newlib_version}
307%{?PATCH50:%patch50 -p1}
308cd ..
309  # Copy the C library into gcc's source tree
310  ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_pkgvers}
311%if %{with gcc_stdint}
312  rm gcc-%{gcc_pkgvers}/newlib/libc/include/stdint.h
313%endif
314  # Make sure not to be using GPL'ed sources
315  rm -rf gcc-%{gcc_pkgvers}/newlib/libc/sys/linux
316  rm -rf gcc-%{gcc_pkgvers}/newlib/libc/sys/rdos
317
318%if 0%{?_build_mpfr}
319%setup -q -T -D -n %{name}-%{version} -a60
320%{?PATCH60:%patch60 -p1}
321  # Build mpfr one-tree style
322  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
323%endif
324
325%if 0%{?_build_mpc}
326%setup -q -T -D -n %{name}-%{version} -a61
327%{?PATCH61:%patch61 -p1}
328  # Build mpc one-tree style
329  ln -s ../mpc-%{mpc_version} gcc-%{gcc_pkgvers}/mpc
330%endif
331
332%if 0%{?_build_gmp}
333%setup -q -T -D -n %{name}-%{version} -a62
334%{?PATCH62:%patch62 -p1}
335  # Build gmp one-tree style
336  ln -s ../gmp-%{gmp_version} gcc-%{gcc_pkgvers}/gmp
337%endif
338
339%if 0%{?_build_libelf}
340%setup -q -T -D -n %{name}-%{version} -a63
341%{?PATCH63:%patch63 -p1}
342  # Build libelf one-tree style
343  ln -s ../libelf-%{libelf_version} gcc-%{gcc_pkgvers}/libelf
344%endif
345
346echo "RTEMS gcc-%{gcc_version}-7%{?dist}/newlib-%{newlib_version}-17%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE
347
348
349  # Fix timestamps
350  cd gcc-%{gcc_pkgvers}
351  contrib/gcc_update --touch
352  cd ..
353%build
354  mkdir -p build
355
356  cd build
357
358  languages="c"
359  export PATH="%{_bindir}:${PATH}"
360%if "%{_build}" != "%{_host}"
361  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
362  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
363%else
364# gcc is not ready to be compiled with -std=gnu99
365  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
366%endif
367  ../gcc-%{gcc_pkgvers}/configure \
368    --prefix=%{_prefix} \
369    --bindir=%{_bindir} \
370    --exec_prefix=%{_exec_prefix} \
371    --includedir=%{_includedir} \
372    --libdir=%{_gcclibdir} \
373    --libexecdir=%{_libexecdir} \
374    --mandir=%{_mandir} \
375    --infodir=%{_infodir} \
376    --datadir=%{_datadir} \
377    --build=%_build --host=%_host \
378    --target=m32r-rtems4.11 \
379    --disable-libstdcxx-pch \
380    --with-gnu-as --with-gnu-ld --verbose \
381    --with-newlib \
382    --with-system-zlib \
383    --disable-nls --without-included-gettext \
384    --disable-win32-registry \
385    --enable-version-specific-runtime-libs \
386    --enable-threads \
387    %{?with_lto:--enable-lto}%{!?with_lto:--disable-lto} \
388    %{?with_plugin:--enable-plugin}%{!?with_plugin:--disable-plugin} \
389    --enable-newlib-io-c99-formats \
390    %{?with_iconv:--enable-newlib-iconv} \
391    --enable-languages="$languages"
392
393%if "%_host" != "%_build"
394  # Bug in gcc-3.2.1:
395  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
396  mkdir -p gcc/include
397  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
398%endif
399
400  make %{?_smp_mflags} all
401  make info
402  cd ..
403
404%install
405  export PATH="%{_bindir}:${PATH}"
406  rm -rf $RPM_BUILD_ROOT
407
408  cd build
409
410  make DESTDIR=$RPM_BUILD_ROOT install
411  cd ..
412
413  cd build/m32r-rtems4.11/newlib
414  make DESTDIR=$RPM_BUILD_ROOT install-info
415  cd ../../..
416
417%if "%{gcc_version}" <= "4.1.2"
418# Misplaced header file
419  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
420    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
421      $RPM_BUILD_ROOT%{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}/include/
422  fi
423%endif
424
425  # host library
426%if "%{gcc_version}" >= "4.2.0"
427  # libiberty doesn't honor --libdir, but always installs to a
428  # magically guessed _libdir
429  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
430%else
431  # libiberty installs to --libdir=...
432  rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a
433%endif
434
435  # We use the version from binutils
436  rm -f $RPM_BUILD_ROOT%{_bindir}/m32r-rtems4.11-c++filt%{_exeext}
437
438
439  # We don't ship info/dir
440  rm -f $RPM_BUILD_ROOT%{_infodir}/dir
441  touch $RPM_BUILD_ROOT%{_infodir}/dir
442
443  # We don't want libffi's man-pages
444  rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*ffi*
445
446  # Bug in gcc-3.4.0pre
447  rm -f $RPM_BUILD_ROOT%{_bindir}/m32r-rtems4.11-m32r-rtems4.11-gcjh%{_exeext}
448
449  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
450  # the fixinclude-install-tools
451  rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}/install-tools
452  rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}/install-tools
453
454  # Bug in gcc > 4.1.0: Installs an unused, empty directory
455  if test -d ${RPM_BUILD_ROOT}%{_prefix}/m32r-rtems4.11/include/bits; then
456    rmdir ${RPM_BUILD_ROOT}%{_prefix}/m32r-rtems4.11/include/bits
457  fi
458
459%if %{with iconv}
460  # Iconv enabled newlib installs external ccts (target files)
461  if test -d ${RPM_BUILD_ROOT}%{_datadir}/iconv_data; then
462    rm -rf ${RPM_BUILD_ROOT}%{_datadir}/iconv_data
463  fi
464%endif
465
466%if ! %{with pygdb}
467  # gcc >= 4.5.0: installs weird libstdc++ python bindings.
468  if test -d ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python; then
469    rm -rf ${RPM_BUILD_ROOT}%{_datadir}/gcc-%{gcc_version}/python/libstdcxx
470  fi
471
472%endif
473  # Collect multilib subdirectories
474  multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
475
476  echo "%defattr(-,root,root,-)" > build/files.newlib
477  TGTDIR="%{_exec_prefix}/m32r-rtems4.11/lib"
478  for i in $multilibs; do
479    case $i in
480    \.) echo "%dir ${TGTDIR}" >> build/files.newlib
481      ;;
482    *)  echo "%dir ${TGTDIR}/$i" >> build/files.newlib
483      ;;
484    esac
485  done
486
487  rm -f dirs ;
488  echo "%defattr(-,root,root,-)" >> dirs
489  TGTDIR="%{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}"
490  for i in $multilibs; do
491    case $i in
492    \.) ;; # ignore, handled elsewhere
493    *)  echo "%dir ${TGTDIR}/$i" >> dirs
494      ;;
495    esac
496  done
497
498  # Collect files to go into different packages
499  cp dirs build/files.gcc
500  cp dirs build/files.gfortran
501  cp dirs build/files.objc
502  cp dirs build/files.gcj
503  cp dirs build/files.g++
504  cp dirs build/files.go
505
506  TGTDIR="%{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}"
507  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
508  for i in $f; do
509    case $i in
510    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
511    *f771) ;;
512    *f951) ;;
513    *cc1) ;;
514    *cc1obj) ;;
515    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
516    *collect2) ;;
517    *libobjc*) echo "$i" >> build/files.objc ;;
518    *go1) ;; # ignore: explicitly put into rpm elsewhere
519    *include/objc*) ;;
520    *include/g++*);;
521    *include/c++*);;
522    *include-fixed/*);;
523    *finclude/*);;
524    */go/*) ;; # ignore : explicitly put into rpm elsewhere
525    *adainclude*);;
526    *adalib*);;
527    *gnat1);;
528    *jc1) ;;
529    *jvgenmain) ;;
530    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
531    */libgo.*) echo "$i" >> build/files.go ;;
532    %{!?with_pygdb:*/libstdc++*gdb.py*) rm ${RPM_BUILD_ROOT}/$i ;;} # ignore for now
533    %{?with_pygdb:*/libstdc++*gdb.py*) >> build/files.g++ ;;}
534    */libstdc++.*) echo "$i" >> build/files.g++ ;;
535    */libsupc++.*) echo "$i" >> build/files.g++ ;;
536    *) echo "$i" >> build/files.gcc ;;
537    esac
538  done
539
540  TGTDIR="%{_exec_prefix}/m32r-rtems4.11/lib"
541  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
542  for i in $f; do
543    case $i in
544    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
545    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
546# all other files belong to newlib
547    *) echo "$i" >> build/files.newlib ;;
548    esac
549  done
550# Extract %%__os_install_post into os_install_post~
551cat << \EOF > os_install_post~
552%__os_install_post
553EOF
554
555# Generate customized brp-*scripts
556cat os_install_post~ | while read a x y; do
557case $a in
558# Prevent brp-strip* from trying to handle foreign binaries
559*/brp-strip*)
560  b=$(basename $a)
561  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
562  chmod a+x $b
563  ;;
564# Fix up brp-compress to handle %%_prefix != /usr
565*/brp-compress*)
566  b=$(basename $a)
567  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
568  chmod a+x $b
569  ;;
570esac
571done
572
573sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
574  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
575< os_install_post~ > os_install_post
576%define __os_install_post . ./os_install_post
577
578
579cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
580#!/bin/sh
581grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32r-rtems4.11/(lib|include|sys-root)' \
582  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32r-rtems4.11/'} | %__find_provides
583EOF
584chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
585%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
586
587cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
588#!/bin/sh
589grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32r-rtems4.11/(lib|include|sys-root)' \
590  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32r-rtems4.11/'} | %__find_requires
591EOF
592chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
593%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
594
595%ifnarch noarch
596# Extract %%__debug_install_post into debug_install_post~
597cat << \EOF > debug_install_post~
598%__debug_install_post
599EOF
600
601# Generate customized debug_install_post script
602cat debug_install_post~ | while read a x y; do
603case $a in
604# Prevent find-debuginfo.sh* from trying to handle foreign binaries
605*/find-debuginfo.sh)
606  b=$(basename $a)
607  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
608  chmod a+x $b
609  ;;
610esac
611done
612
613sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
614< debug_install_post~ > debug_install_post
615%define __debug_install_post . ./debug_install_post
616
617%endif
618
619%clean
620  rm -rf $RPM_BUILD_ROOT
621
622# ==============================================================
623# rtems-4.11-m32r-rtems4.11-gcc
624# ==============================================================
625# %package -n rtems-4.11-m32r-rtems4.11-gcc
626# Summary:        GNU cc compiler for m32r-rtems4.11
627# Group:          Development/Tools
628# Version:        %{gcc_rpmvers}
629# Requires:       rtems-4.11-m32r-rtems4.11-binutils
630# Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-17%{?dist}
631# License:      GPL
632
633# %if %build_infos
634# Requires:      rtems-4.11-gcc-common
635# %endif
636
637%description -n rtems-4.11-m32r-rtems4.11-gcc
638GNU cc compiler for m32r-rtems4.11.
639
640# ==============================================================
641# rtems-4.11-m32r-rtems4.11-gcc-libgcc
642# ==============================================================
643%package -n rtems-4.11-m32r-rtems4.11-gcc-libgcc
644Summary:        libgcc for m32r-rtems4.11-gcc
645Group:          Development/Tools
646Version:        %{gcc_rpmvers}
647%{?_with_noarch_subpackages:BuildArch: noarch}
648Requires:       rtems-4.11-m32r-rtems4.11-newlib = %{newlib_version}-17%{?dist}
649License:        GPL
650
651%description -n rtems-4.11-m32r-rtems4.11-gcc-libgcc
652libgcc m32r-rtems4.11-gcc.
653
654
655%files -n rtems-4.11-m32r-rtems4.11-gcc
656%defattr(-,root,root)
657%dir %{_prefix}
658
659%dir %{_mandir}
660%dir %{_mandir}/man1
661%{_mandir}/man1/m32r-rtems4.11-gcc.1*
662%{_mandir}/man1/m32r-rtems4.11-cpp.1*
663%{_mandir}/man1/m32r-rtems4.11-gcov.1*
664
665%dir %{_bindir}
666%{_bindir}/m32r-rtems4.11-cpp%{_exeext}
667%{_bindir}/m32r-rtems4.11-gcc%{_exeext}
668%{_bindir}/m32r-rtems4.11-gcc-%{gcc_version}%{_exeext}
669%{_bindir}/m32r-rtems4.11-gcov%{_exeext}
670%if "%{gcc_version}" < "4.6.0"
671%{_bindir}/m32r-rtems4.11-gccbug
672%endif
673
674%dir %{_libexecdir}
675%dir %{_libexecdir}/gcc
676%dir %{_libexecdir}/gcc/m32r-rtems4.11
677%dir %{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}
678%{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}/cc1%{_exeext}
679%{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}/collect2%{_exeext}
680%if "%{gcc_version}" >= "4.5.0"
681%{?with_lto:%{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}/lto%{_exeext}}
682%{_libexecdir}/gcc/m32r-rtems4.11/%{gcc_version}/lto-wrapper%{_exeext}
683%endif
684
685%files -n rtems-4.11-m32r-rtems4.11-gcc-libgcc -f build/files.gcc
686%defattr(-,root,root)
687%dir %{_prefix}
688%dir %{_gcclibdir}
689%dir %{_gcclibdir}/gcc
690%dir %{_gcclibdir}/gcc/m32r-rtems4.11
691%dir %{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}
692%dir %{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}/include
693
694%if "%{gcc_version}" > "4.0.3"
695%dir %{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}/include/ssp
696%endif
697
698%if "%{gcc_version}" >= "4.3.0"
699%{_gcclibdir}/gcc/m32r-rtems4.11/%{gcc_version}/include-fixed
700%endif
701
702# ==============================================================
703# rtems-4.11-gcc-common
704# ==============================================================
705%package -n rtems-4.11-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.11-gcc-common
716GCC files that are shared by all targets.
717
718%files -n rtems-4.11-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%if "%{gcc_version}" >= "4.6.0"
731%{_infodir}/libquadmath.info*
732%endif
733
734%dir %{_mandir}
735%dir %{_mandir}/man7
736%{_mandir}/man7/fsf-funding.7*
737%{_mandir}/man7/gfdl.7*
738%{_mandir}/man7/gpl.7*
739
740%post -n rtems-4.11-gcc-common
741  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
742  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
743  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
744  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
745  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
746
747%preun -n rtems-4.11-gcc-common
748if [ $1 -eq 0 ]; then
749  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || :
750  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || :
751  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || :
752  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || :
753  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || :
754fi
755
756
757
758
759# ==============================================================
760# rtems-4.11-m32r-rtems4.11-newlib
761# ==============================================================
762%package -n rtems-4.11-m32r-rtems4.11-newlib
763Summary:        C Library (newlib) for m32r-rtems4.11
764Group:          Development/Tools
765License:        Distributable
766Version:        %{newlib_version}
767Release:        17%{?dist}
768%{?_with_noarch_subpackages:BuildArch: noarch}
769
770Requires:       rtems-4.11-newlib-common
771
772%description -n rtems-4.11-m32r-rtems4.11-newlib
773Newlib C Library for m32r-rtems4.11.
774
775%files -n rtems-4.11-m32r-rtems4.11-newlib -f build/files.newlib
776%defattr(-,root,root)
777%dir %{_exec_prefix}
778%dir %{_exec_prefix}/m32r-rtems4.11
779%{_exec_prefix}/m32r-rtems4.11/include
780
781# ==============================================================
782# rtems-4.11-newlib-common
783# ==============================================================
784%package -n rtems-4.11-newlib-common
785Summary:        Base package for RTEMS newlib C Library
786Group:          Development/Tools
787Version:        %{newlib_version}
788Release:        17%{?dist}
789%{?_with_noarch_subpackages:BuildArch: noarch}
790License:        Distributable
791
792Requires(post):         /sbin/install-info
793Requires(preun):        /sbin/install-info
794
795%description -n rtems-4.11-newlib-common
796newlib files that are shared by all targets.
797
798%files -n rtems-4.11-newlib-common
799%defattr(-,root,root)
800%dir %{_prefix}
801%dir %{_prefix}/share
802
803%dir %{_infodir}
804%ghost %{_infodir}/dir
805%{_infodir}/libc.info*
806%{_infodir}/libm.info*
807
808%post -n rtems-4.11-newlib-common
809  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
810  /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
811
812%preun -n rtems-4.11-newlib-common
813if [ $1 -eq 0 ]; then
814  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz || :
815  /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libm.info.gz || :
816fi
817
Note: See TracBrowser for help on using the repository browser.