source: rtems/contrib/crossrpms/rtems4.8/tic4x/rtems-4.8-tic4x-rtems4.8-gcc.spec @ 55e9fca

4.104.114.84.95
Last change on this file since 55e9fca was 55e9fca, checked in by Ralf Corsepius <ralf.corsepius@…>, on Jun 18, 2007 at 10:32:03 AM

Preps for next spin.

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