source: rtems/scripts/gcc3newlib/gccnewlib.add @ a923a82

4.104.114.84.95
Last change on this file since a923a82 was 383e974, checked in by Joel Sherrill <joel.sherrill@…>, on 04/18/02 at 13:07:59

2002-04-20 Ralf Corsepius <corsepiu@…>

  • gcc3newlib/gccnewlib.add: Add gcc_update --touch to fix timestamps.
  • Property mode set to 100644
File size: 4.7 KB
Line 
1#
2# spec file for building gcc for rtems
3#
4# Copyright  (c) 1999,2000,2001 OARCorp, Huntsville, AL
5#
6# please send bugfixes or comments to joel@OARcorp.com
7#
8
9%define _prefix @prefix@
10
11Vendor:       OAR Corporation
12Distribution: Linux
13Name:         @target_alias@-gcc-newlib
14Summary:      gcc and newlib C Library for @target_alias@.
15Group:        rtems
16Release:      @Release@
17License:      gcc is GPL/LGPL ; newlib no has restrictions on run-time usage
18
19Autoreqprov:    on
20Packager:       corsepiu@faw.uni-ulm.de and joel@OARcorp.com
21
22Version:        gcc@gcc_version@newlib@newlib_version@
23# gcc 3.x and gcc 2.9
24# Source0:      ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.bz2
25# gcc 2.95.x
26Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
27Source1:        ftp://sources.redhat.com/pub/newlib/newlib-@newlib_version@.tar.gz
28@PATCH1@
29@PATCH3@
30Buildroot:      %{_tmppath}/%{name}
31
32#
33# The original sources are not included in the source RPM.
34# If we included them, then the source RPMs for each target
35# would duplicate MBs of source unnecessarily.  This is
36# a duplication of over 30 MBs of source for each of
37# the more than 10 targets it is possible to build.
38#
39# You can get them yourself from the Internet and copy them to
40# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
41# Or you can try the ftp options of rpm :-)
42#
43NoSource:       0
44NoSource:       1
45
46%description
47RTEMS is an open source operating system for embedded systems.
48
49This is gcc's and newlib C Library's sources with patches for RTEMS.
50
51 The original sources are not included in the source RPM.
52 If we included them, then the source RPMs for each target
53 would duplicate MBs of source unnecessarily.  This is
54 a duplication of over 30 MBs of source for each of
55 the more than 10 targets it is possible to build.
56
57 You can get them yourself from the Internet and copy them to
58 your /usr/src/[redhat|packages]/SOURCES directory ($RPM_SOURCE_DIR).
59 Or you can try the ftp options of rpm :-)
60
61%prep
62# untar the sources inside @target_alias@-gcc-newlib
63%setup -c -n %{name} @SETUP@
64
65@PATCH2@
66@PATCH4@
67
68  # Fix timestamps
69  gcc-@gcc_version@/contrib/gcc_update --touch
70  # Copy the C library into gcc's source tree
71  ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
72  test -d build || mkdir build
73
74%build
75  cd build
76
77# HACK: This should be %{target} != %{build}, but SuSE's rpm screws it.
78# %if "%{_target_os}" != "%{_build_os}"
79#    CONFIGURE_ARGS="--build=%{_build} --host=%{_target}"
80# %endif
81
82  ../gcc-@gcc_version@/configure $CONFIGURE_ARGS --target=@target_alias@ \
83    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
84    --enable-threads=rtems --prefix=%{_prefix} @GCCLANGS@
85
86  make all
87  make info
88
89%install
90  cd build
91#  # Bug in gcc-2.95.1: It doesn't build this installation directory
92#  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
93#  ../gcc-@gcc_version@/mkinstalldirs \
94#    $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin
95#
96 
97  make prefix=$RPM_BUILD_ROOT%{_prefix} install
98  cd @target_alias@/newlib
99  make prefix=$RPM_BUILD_ROOT%{_prefix} install-info
100
101  # Bug in gcc-3.0.x: It puts the build dirs into *.la files
102  files=`find ${RPM_BUILD_ROOT}%{_prefix}/@target_alias@/lib -name '*.la'`
103  for i in $files; do
104    rm -f $i
105  done
106
107  # cd back to build/
108  cd ../..
109
110  # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets.
111  # Rename it to target_alias-cpp
112#  if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@;
113#  then
114#    mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \
115#      $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@
116#  fi
117
118  # gzip info files
119  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null
120  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null
121  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null
122
123  rm -f dirs ;
124  echo "%dir %{_prefix}/lib" >> dirs ;
125  echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ;
126  echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ;
127
128  # Collect multilib subdirectories
129  TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@"
130  f=`gcc/xgcc -Bgcc/ --print-multi-lib | sed -e 's,;.*$,,'`
131  for i in $f; do
132    case $i in
133    \.) echo "%dir ${TGTDIR}" >> dirs
134      ;;
135    *)  echo "%dir ${TGTDIR}/$i" >> dirs
136      ;;
137    esac
138  done
139
140  # Collect files to go into different packages
141  cp dirs files.gcc
142  cp dirs files.g77
143  cp dirs files.objc
144  cp dirs files.gcj
145
146  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
147  for i in $f; do
148    case $i in
149    *f771) ;;
150    *cc1obj) ;;
151    *libobjc*) echo "$i" >> files.objc ;;
152    *include/objc*) ;;
153    *jc1) ;;
154    *jvgenmain) ;;
155    *) echo "$i" >> files.gcc ;;
156    esac
157  done
158
159%clean
160# let rpm --clean remove BuildRoot iif using the default BuildRoot
161  test "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}" && \
162    rm -rf $RPM_BUILD_ROOT
163
Note: See TracBrowser for help on using the repository browser.