source: rtems/scripts/gccnewlib/gccnewlib.add @ 1cd0db4

4.104.114.84.95
Last change on this file since 1cd0db4 was 1cd0db4, checked in by Joel Sherrill <joel.sherrill@…>, on 09/13/01 at 16:37:03

2001-09-13 Joel Sherrill <joel@…>

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