source: rtems/contrib/crossrpms/rtems4.10/m32r/rtems-4.10-m32r-rtems4.10-gcc.spec @ 11feece9

4.104.11
Last change on this file since 11feece9 was 11feece9, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jan 26, 2009 at 7:26:01 AM

Regenerate.

  • Property mode set to 100644
File size: 13.9 KB
RevLine 
[2abe16dd]1#
2# Please send bugfixes or comments to
3#       http://www.rtems.org/bugzilla
4#
5
[05c66cf]6%define _prefix                 /opt/rtems-4.10
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
[2abe16dd]21
22%ifos cygwin cygwin32 mingw mingw32
23%define _exeext .exe
[35381baa]24%define debug_package           %{nil}
25%define _libdir                 %{_exec_prefix}/lib
[2abe16dd]26%else
27%define _exeext %{nil}
28%endif
29
30%ifos cygwin cygwin32
31%define optflags -O3 -pipe -march=i486 -funroll-loops
[35381baa]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
[2abe16dd]40%endif
41
42%if "%{_build}" != "%{_host}"
43%define _host_rpmprefix rtems-4.10-%{_host}-
44%else
45%define _host_rpmprefix %{nil}
46%endif
47
48
[11feece9]49%define gcc_pkgvers 4.3.3
50%define gcc_version 4.3.3
51%define gcc_rpmvers %{expand:%(echo "4.3.3" | tr - _ )}
[2abe16dd]52
[8ffd16bb]53%define newlib_pkgvers          1.17.0
54%define newlib_version          1.17.0
[11feece9]55%define newlib_release          22%{?dist}
[2abe16dd]56
57%define mpfr_version    2.3.1
58
59Name:           rtems-4.10-m32r-rtems4.10-gcc
60Summary:        m32r-rtems4.10 gcc
61
62Group:          Development/Tools
63Version:        %{gcc_rpmvers}
[11feece9]64Release:        1%{?dist}
[2abe16dd]65License:        GPL
66URL:            http://gcc.gnu.org
67BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
68
69%define _use_internal_dependency_generator 0
70
71BuildRequires:  %{_host_rpmprefix}gcc
72
73%if "%{gcc_version}" >= "4.3.0"
74BuildRequires:  gmp-devel >= 4.1
75%if "%{_build}" != "%{_host}"
76BuildRequires:  %{_host_rpmprefix}gmp-devel
77BuildRequires:  %{_host_rpmprefix}mpfr-devel
78%endif
79%if 0%{?fedora} >= 8
80BuildRequires:  mpfr-devel >= 2.3.0
81%endif
82%if "%{?suse}" > "10.3"
83BuildRequires:  mpfr-devel >= 2.3.0
84%endif
85# These distros ship an insufficient mpfr
86%{?el4:%define  _build_mpfr     1}
87%{?suse10_3:%define     _build_mpfr     1}
88%endif
89
90%if "%{_build}" != "%{_host}"
[35381baa]91BuildRequires:  rtems-4.10-m32r-rtems4.10-gcc = %{gcc_rpmvers}
[2abe16dd]92%endif
93
94%if "%{gcc_version}" >= "4.2.0"
95BuildRequires:  flex bison
96%endif
97
98
99BuildRequires:  texinfo >= 4.2
100BuildRequires:  rtems-4.10-m32r-rtems4.10-binutils
101
102Requires:       rtems-4.10-m32r-rtems4.10-binutils
[35381baa]103Requires:       rtems-4.10-m32r-rtems4.10-newlib = %{newlib_version}-%{newlib_release}
[2abe16dd]104
105
106%if "%{gcc_version}" >= "3.4"
107%define gcclib %{_libdir}/gcc
108%define gccexec %{_libexecdir}/gcc
109%else
110%define gcclib %{_libdir}/gcc-lib
111%define gccexec %{_libdir}/gcc-lib
112%endif
113
[11feece9]114%if "%{gcc_version}" == "4.3.3"
[2abe16dd]115Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2
[11feece9]116Patch0:         ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.3.3-rtems4.10-20090125.diff
[2abe16dd]117%endif
118%{?_without_sources:NoSource:   0}
119
[c51f900b]120%if "%{newlib_version}" == "1.17.0"
[8429438]121Source50:       ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz
[8ffd16bb]122Patch50:        ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-%{newlib_pkgvers}-rtems4.10-20081223.diff
[2abe16dd]123%endif
124%{?_without_sources:NoSource:   50}
125
126%if "%{gcc_version}" >= "4.3.0"
127Source60:    http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2
128%endif
129
130%description
131Cross gcc for m32r-rtems4.10.
132
133%prep
134%setup -c -T -n %{name}-%{version}
135
136%setup -q -T -D -n %{name}-%{version} -a0
137%{?PATCH0:%patch0 -p0}
138
139
140
141
142
143
144%setup -q -T -D -n %{name}-%{version} -a50
145cd newlib-%{newlib_version}
146%{?PATCH50:%patch50 -p1}
147cd ..
148  # Copy the C library into gcc's source tree
149  ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_pkgvers}
150
151%if 0%{?_build_mpfr}
152%setup -q -T -D -n %{name}-%{version} -a60
153%{?PATCH60:%patch60 -p1}
154  # Build mpfr one-tree style
155  ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr
156%endif
157
158%if "%{gcc_version}" < "4.1.0"
159  sed -e 's/\(version_string.* = \"[^\"]*\)/\1 (RTEMS gcc-%{gcc_version}\/newlib-%{newlib_version}-%release)/' \
160  gcc-%{gcc_pkgvers}/gcc/version.c > gcc-%{gcc_pkgvers}/gcc/version.c~
161%else
162  sed -e 's/^#define VERSUFFIX.*$/#define VERSUFFIX \" (RTEMS gcc-%{gcc_version}\/newlib-%{newlib_version}-%{release})\"/' \
163    gcc-%{gcc_pkgvers}/gcc/version.c > gcc-%{gcc_pkgvers}/gcc/version.c~
164%endif
165  mv gcc-%{gcc_pkgvers}/gcc/version.c~ gcc-%{gcc_pkgvers}/gcc/version.c
166
167
168  # Fix timestamps
169  cd gcc-%{gcc_pkgvers}
170  contrib/gcc_update --touch
171  cd ..
172%build
173  mkdir -p build
174
175  cd build
176
177  languages="c"
178  export PATH="%{_bindir}:${PATH}"
179%if "%{_build}" != "%{_host}"
180  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
181  CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \
182%else
[05c66cf]183# gcc is not ready to be compiled with -std=gnu99
184  CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
[2abe16dd]185%endif
186  ../gcc-%{gcc_pkgvers}/configure \
187    --prefix=%{_prefix} \
188    --bindir=%{_bindir} \
189    --exec_prefix=%{_exec_prefix} \
190    --includedir=%{_includedir} \
191    --libdir=%{_libdir} \
192    --libexecdir=%{_libexecdir} \
193    --mandir=%{_mandir} \
194    --infodir=%{_infodir} \
195    --datadir=%{_datadir} \
196    --build=%_build --host=%_host \
197    --target=m32r-rtems4.10 \
198    --disable-libstdcxx-pch \
199    --with-gnu-as --with-gnu-ld --verbose \
200    --with-newlib \
201    --with-system-zlib \
202    --disable-nls --without-included-gettext \
203    --disable-win32-registry \
204    --enable-version-specific-runtime-libs \
205    --enable-threads \
206    --enable-newlib-io-c99-formats \
207    --enable-languages="$languages" $optargs
208
209%if "%_host" != "%_build"
210  # Bug in gcc-3.2.1:
211  # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
212  mkdir -p gcc/include
213  cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h
214%endif
215
216  make %{?_smp_mflags} all
217  cd ..
218
219%install
220  export PATH="%{_bindir}:${PATH}"
221  rm -rf $RPM_BUILD_ROOT
222
223  cd build
224
225  make DESTDIR=$RPM_BUILD_ROOT install
226  cd ..
227
228  cd build/m32r-rtems4.10/newlib
229  make DESTDIR=$RPM_BUILD_ROOT install-info
230  cd ../../..
231
232%if "%{gcc_version}" <= "4.1.2"
233# Misplaced header file
234  if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then
235    mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \
236      $RPM_BUILD_ROOT%{gcclib}/m32r-rtems4.10/%{gcc_version}/include/
237  fi
238%endif
239
240  # host library
241  rm -f  ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a
242
243  # We use the version from binutils
244  rm -f $RPM_BUILD_ROOT%{_bindir}/m32r-rtems4.10-c++filt%{_exeext}
245
246
247# Conflict with a native GCC's infos
248  rm -rf $RPM_BUILD_ROOT%{_infodir}
249
250# Conflict with a native GCC's man pages
251  rm -rf $RPM_BUILD_ROOT%{_mandir}/man7
252
253
254%if "%{gcc_version}" >= "3.4"
255  # Bug in gcc-3.4.0pre
256  rm -f $RPM_BUILD_ROOT%{_bindir}/m32r-rtems4.10-m32r-rtems4.10-gcjh%{_exeext}
257%endif
258
259%if "%{gcc_version}" >= "3.3"
260  # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs
261  # the fixinclude-install-tools
262  rm -rf ${RPM_BUILD_ROOT}%{gcclib}/m32r-rtems4.10/%{gcc_version}/install-tools
263  rm -rf ${RPM_BUILD_ROOT}%{gccexec}/m32r-rtems4.10/%{gcc_version}/install-tools
264%endif
265
266  # Collect multilib subdirectories
267  f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
268
269  echo "%defattr(-,root,root,-)" > build/files.newlib
270  TGTDIR="%{_exec_prefix}/m32r-rtems4.10/lib"
271  for i in $f; do
272    case $i in
273    \.) echo "%dir ${TGTDIR}" >> build/files.newlib
274      ;;
275    *)  echo "%dir ${TGTDIR}/$i" >> build/files.newlib
276      ;;
277    esac
278  done
279
280  rm -f dirs ;
281  echo "%defattr(-,root,root,-)" >> dirs
282  echo "%dir %{_prefix}" >> dirs
283  echo "%dir %{_libdir}" >> dirs
284%if "%{gcc_version}" >= "3.4"
285  echo "%dir %{_libexecdir}" >> dirs
286%endif
287  echo "%dir %{gcclib}" >> dirs
288  echo "%dir %{gcclib}/m32r-rtems4.10" >> dirs
289
290  TGTDIR="%{gcclib}/m32r-rtems4.10/%{gcc_version}"
291  for i in $f; do
292    case $i in
293    \.) echo "%dir ${TGTDIR}" >> dirs
294      ;;
295    *)  echo "%dir ${TGTDIR}/$i" >> dirs
296      ;;
297    esac
298  done
299
300  # Collect files to go into different packages
301  cp dirs build/files.gcc
302  cp dirs build/files.g77
303  cp dirs build/files.gfortran
304  cp dirs build/files.objc
305  cp dirs build/files.gcj
306  cp dirs build/files.g++
307
308  TGTDIR="%{gcclib}/m32r-rtems4.10/%{gcc_version}"
309  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
310  for i in $f; do
311    case $i in
312    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
313    *f771) ;;
314    *f951) ;;
315    *cc1) ;;
316    *cc1obj) ;;
317    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
318    *collect2) ;;
319    *libobjc*) echo "$i" >> build/files.objc ;;
320    *include/objc*) ;;
321    *include/g++*);;
322    *include/c++*);;
323    *adainclude*);;
324    *adalib*);;
325    *gnat1);;
326    *jc1) ;;
327    *jvgenmain) ;;
328    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
329    */libstdc++.*) echo "$i" >> build/files.g++ ;;
330    */libsupc++.*) echo "$i" >> build/files.g++ ;;
331    *) echo "$i" >> build/files.gcc ;;
332    esac
333  done
334
335  TGTDIR="%{_exec_prefix}/m32r-rtems4.10/lib"
336  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
337  for i in $f; do
338    case $i in
339    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
340    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
341# all other files belong to newlib
342    *) echo "$i" >> build/files.newlib ;;
343    esac
344  done
345# Extract %%__os_install_post into os_install_post~
346cat << \EOF > os_install_post~
347%__os_install_post
348EOF
349
350# Generate customized brp-*scripts
351cat os_install_post~ | while read a x y; do
352case $a in
353# Prevent brp-strip* from trying to handle foreign binaries
354*/brp-strip*)
355  b=$(basename $a)
356  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
357  chmod a+x $b
358  ;;
359# Fix up brp-compress to handle %%_prefix != /usr
360*/brp-compress*)
361  b=$(basename $a)
362  sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b
363  chmod a+x $b
364  ;;
365esac
366done
367
368sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
369  -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \
370< os_install_post~ > os_install_post
371%define __os_install_post . ./os_install_post
372
373
374cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
375#!/bin/sh
376grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32r-rtems4.10/(lib|include|sys-root)' \
377  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/m32r-rtems4.10/' | %__find_provides
378EOF
379chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
380%define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides
381
382cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
383#!/bin/sh
384grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32r-rtems4.10/(lib|include|sys-root)' \
385  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/m32r-rtems4.10/' | %__find_requires
386EOF
387chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
388%define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires
389
[f1322b47]390%ifnarch noarch
[05c66cf]391# Extract %%__debug_install_post into debug_install_post~
392cat << \EOF > debug_install_post~
393%__debug_install_post
394EOF
395
396# Generate customized debug_install_post script
397cat debug_install_post~ | while read a x y; do
398case $a in
399# Prevent find-debuginfo.sh* from trying to handle foreign binaries
400*/find-debuginfo.sh)
401  b=$(basename $a)
402  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
403  chmod a+x $b
404  ;;
405esac
406done
407
408sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
409< debug_install_post~ > debug_install_post
410%define __debug_install_post . ./debug_install_post
411
[f1322b47]412%endif
[05c66cf]413
[2abe16dd]414%clean
415  rm -rf $RPM_BUILD_ROOT
416
417# ==============================================================
418# rtems-4.10-m32r-rtems4.10-gcc
419# ==============================================================
420# %package -n rtems-4.10-m32r-rtems4.10-gcc
421# Summary:        GNU cc compiler for m32r-rtems4.10
422# Group:          Development/Tools
423# Version:        %{gcc_rpmvers}
424# Requires:       rtems-4.10-m32r-rtems4.10-binutils
[35381baa]425# Requires:       rtems-4.10-m32r-rtems4.10-newlib = %{newlib_version}-%{newlib_release}
[2abe16dd]426# License:      GPL
427
428# %if %build_infos
429# Requires:      rtems-4.10-gcc-common
430# %endif
431
432%description -n rtems-4.10-m32r-rtems4.10-gcc
433GNU cc compiler for m32r-rtems4.10.
434
435%files -n rtems-4.10-m32r-rtems4.10-gcc -f build/files.gcc
436%defattr(-,root,root)
437%dir %{_mandir}
438%dir %{_mandir}/man1
439%{_mandir}/man1/m32r-rtems4.10-gcc.1*
440%if "%{gcc_version}" >= "3.4"
441%{_mandir}/man1/m32r-rtems4.10-cpp.1*
442%{_mandir}/man1/m32r-rtems4.10-gcov.1*
443%endif
444
445%dir %{_bindir}
446%{_bindir}/m32r-rtems4.10-cpp%{_exeext}
447%{_bindir}/m32r-rtems4.10-gcc%{_exeext}
448%if "%{gcc_version}" >= "3.3"
449%{_bindir}/m32r-rtems4.10-gcc-%{gcc_version}%{_exeext}
450%endif
451%{_bindir}/m32r-rtems4.10-gcov%{_exeext}
452%{_bindir}/m32r-rtems4.10-gccbug
453
454%dir %{gcclib}/m32r-rtems4.10/%{gcc_version}/include
455%if "%{gcc_version}" > "4.0.3"
456%if "m32r-rtems4.10" != "bfin-rtems4.10"
457%if "m32r-rtems4.10" != "avr-rtems4.10"
458%dir %{gcclib}/m32r-rtems4.10/%{gcc_version}/include/ssp
459%endif
460%endif
461%endif
462
[719a5c7]463%if "%{gcc_version}" >= "4.3.0"
464%dir %{gcclib}/m32r-rtems4.10/%{gcc_version}/include-fixed
465%endif
466
[2abe16dd]467%dir %{gccexec}
468%dir %{gccexec}/m32r-rtems4.10
469%dir %{gccexec}/m32r-rtems4.10/%{gcc_version}
470%{gccexec}/m32r-rtems4.10/%{gcc_version}/cc1%{_exeext}
471%{gccexec}/m32r-rtems4.10/%{gcc_version}/collect2%{_exeext}
472
473
474
475
476# ==============================================================
477# rtems-4.10-m32r-rtems4.10-newlib
478# ==============================================================
479%package -n rtems-4.10-m32r-rtems4.10-newlib
480Summary:        C Library (newlib) for m32r-rtems4.10
481Group:          Development/Tools
482License:        Distributable
483Version:        %{newlib_version}
[35381baa]484Release:        %{newlib_release}
[2abe16dd]485
486
487%description -n rtems-4.10-m32r-rtems4.10-newlib
488Newlib C Library for m32r-rtems4.10.
489
490%files -n rtems-4.10-m32r-rtems4.10-newlib -f build/files.newlib
491%defattr(-,root,root)
492%dir %{_prefix}
493%dir %{_exec_prefix}/m32r-rtems4.10
494%{_exec_prefix}/m32r-rtems4.10/include
495
Note: See TracBrowser for help on using the repository browser.