source: rtems/scripts/gccnewlib/gccnewlib.add @ 6c5e3215

4.104.114.84.95
Last change on this file since 6c5e3215 was 6c5e3215, checked in by Joel Sherrill <joel.sherrill@…>, on 07/03/01 at 17:01:56

2001-07-03 Joel Sherrill <joel@…>

  • setup.def, binutils.add, gccnewlib.add: Updated to build binutils 2.11.2 (rtems patch 20010622), gcc 2.95.3 (rtems patch a20010622), and newlib 1.9.0 (rtems patch 10020622).
  • Property mode set to 100644
File size: 4.4 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
9Vendor:       OAR Corporation
10Distribution: Linux
11Name:         @target_alias@-gcc-newlib
12Summary:      gcc and newlib C Library for @target_alias@.
13Group:        rtems
14Release:      @Release@
15License:      gcc is GPL/LGPL ; newlib no has restrictions on run-time usage
16
17Autoreqprov:    on
18Packager:       corsepiu@faw.uni-ulm.de and joel@OARcorp.com
19
20Version:        gcc@gcc_version@newlib@newlib_version@
21Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/gcc-everything-@gcc_version@.tar.gz
22Source1:        ftp://sourceware.cygnus.com/pub/newlib/newlib-@newlib_version@.tar.gz
23Patch0:         gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
24Patch1:         newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
25Buildroot:      /tmp/@target_alias@-gcc-newlib
26
27#
28# The original sources are not included in the source RPM.
29# If we included them, then the source RPMs for each target
30# would duplicate MBs of source unnecessarily.  This is
31# a duplication of over 30 MBs of source for each of
32# the more than 10 targets it is possible to build.
33#
34# You can get them yourself from the Internet and copy them to
35# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
36# Or you can try the ftp options of rpm :-)
37#
38NoSource:       0
39NoSource:       1
40
41%description
42RTEMS is an open source operating system for embedded systems.
43
44This is gcc's and newlib C Library's sources with patches for RTEMS.
45
46 The original sources are not included in the source RPM.
47 If we included them, then the source RPMs for each target
48 would duplicate MBs of source unnecessarily.  This is
49 a duplication of over 30 MBs of source for each of
50 the more than 10 targets it is possible to build.
51
52 You can get them yourself from the Internet and copy them to
53 your /usr/src/[redhat|packages]/SOURCES directory ($RPM_SOURCE_DIR).
54 Or you can try the ftp options of rpm :-)
55
56%prep
57# untar the sources inside @target_alias@-gcc-newlib
58%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1
59
60%patch0 -p0
61%patch1 -p0
62
63  # Copy the C library into gcc's source tree
64  ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
65  test -d build || mkdir build
66
67%build
68  cd build
69
70  ../gcc-@gcc_version@/configure --target=@target_alias@ \
71    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
72    --enable-threads --prefix=/opt/rtems @GCCLANGS@
73
74  make all
75  make info
76
77%install
78  cd build
79  # Bug in gcc-2.95.1: It doesn't build this installation directory
80  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
81  ../gcc-@gcc_version@/mkinstalldirs \
82    $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin
83
84  make prefix=$RPM_BUILD_ROOT/opt/rtems install
85  cd @target_alias@/newlib
86  make prefix=$RPM_BUILD_ROOT/opt/rtems install-info
87
88  # cd back to build/
89  cd ../..
90
91  # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets.
92  # Rename it to target_alias-cpp
93  if test -f $RPM_BUILD_ROOT/opt/rtems/bin/cpp@exe_ext@;
94  then
95    mv $RPM_BUILD_ROOT/opt/rtems/bin/cpp@exe_ext@ \
96      $RPM_BUILD_ROOT/opt/rtems/bin/@target_alias@-cpp@exe_ext@
97  fi
98
99  # gzip info files
100  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null
101  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null
102  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null
103
104  rm -f dirs ;
105  echo "%dir /opt/rtems/lib" >> dirs ;
106  echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ;
107  echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ;
108
109  # Collect multilib subdirectories
110  TGTDIR="/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@"
111  f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'`
112  for i in $f; do
113    case $i in
114    \.) echo "%dir ${TGTDIR}" >> dirs
115      ;;
116    *)  echo "%dir ${TGTDIR}/$i" >> dirs
117      ;;
118    esac
119  done
120
121  # Collect files to go into different packages
122  cp dirs files.chill
123  cp dirs files.gcc
124  cp dirs files.g77
125  cp dirs files.objc
126  cp dirs files.gcj
127
128  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
129  for i in $f; do
130    case $i in
131    *chill*) echo "$i" >> files.chill ;;
132    *f771) ;;
133    *cc1obj) ;;
134    *libobjc*) echo "$i" >> files.objc ;;
135    *include/objc*) ;;
136    *jc1) ;;
137    *jvgenmain) ;;
138    *) echo "$i" >> files.gcc ;;
139    esac
140  done
141
142%clean
143# let rpm --clean remove BuildRoot iif using the default BuildRoot
144  test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gcc-newlib" && \
145    rm -rf $RPM_BUILD_ROOT
146
Note: See TracBrowser for help on using the repository browser.