source: rtems/contrib/crossrpms/rtems4.8/m68k/rtems-4.8-m68k-rtems4.8-gcc.spec @ cf148c7

4.8
Last change on this file since cf148c7 was cf148c7, checked in by Ralf Corsepius <ralf.corsepius@…>, on Nov 30, 2007 at 6:02:22 AM

Regnerate.

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