source: rtems/contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gcc.spec @ 92862e81

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