source: rtems/scripts/gccnewlib/gccnewlib.add @ 7a30efd

4.104.114.84.95
Last change on this file since 7a30efd was df49c60, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 12, 2000 at 3:00:15 PM

Merged from 4.5.0-beta3a

  • Property mode set to 100644
File size: 4.1 KB
Line 
1#
2# spec file for building gcc for rtems
3#
4# Copyright  (c) 1999,2000 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-@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  # gzip info files
92  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null
93  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null
94  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null
95
96  rm -f dirs ;
97  echo "%dir /opt/rtems/lib" >> dirs ;
98  echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ;
99  echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ;
100
101  # Collect multilib subdirectories
102  TGTDIR="/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@"
103  f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'`
104  for i in $f; do
105    case $i in
106    \.) echo "%dir ${TGTDIR}" >> dirs
107      ;;
108    *)  echo "%dir ${TGTDIR}/$i" >> dirs
109      ;;
110    esac
111  done
112
113  # Collect files to go into different packages
114  cp dirs files.chill
115  cp dirs files.gcc
116  cp dirs files.g77
117  cp dirs files.objc
118  cp dirs files.gcj
119
120  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
121  for i in $f; do
122    case $i in
123    *chill*) echo "$i" >> files.chill ;;
124    *f771) ;;
125    *cc1obj) ;;
126    *libobjc*) echo "$i" >> files.objc ;;
127    *include/objc*) ;;
128    *jc1) ;;
129    *jvgenmain) ;;
130    *) echo "$i" >> files.gcc ;;
131    esac
132  done
133
134%clean
135# let rpm --clean remove BuildRoot iif using the default BuildRoot
136  test "$RPM_BUILD_ROOT" = "/tmp/@target_alias@-gcc-newlib" && \
137    rm -rf $RPM_BUILD_ROOT
138
Note: See TracBrowser for help on using the repository browser.