source: rtems/contrib/crossrpms/rtems4.11/powerpc/rtems-4.11-powerpc-rtems4.11-gcc.spec @ 2e352c4

4.115
Last change on this file since 2e352c4 was 2e352c4, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/21/11 at 07:08:30

Regenerate.

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