source: rtems/contrib/crossrpms/rtems4.10/m32r/rtems-4.10-m32r-rtems4.10-gcc.spec @ 7f7a3ca4

4.104.11
Last change on this file since 7f7a3ca4 was 7f7a3ca4, checked in by Ralf Corsepius <ralf.corsepius@…>, on Feb 3, 2009 at 6:40:33 AM

Regenerate.

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