source: rtems/scripts/gccnewlib/gccnewlib_c_only.spec.in @ e639b998

4.104.114.84.95
Last change on this file since e639b998 was e639b998, checked in by Joel Sherrill <joel.sherrill@…>, on 11/05/99 at 19:40:42

Added this file as a way to build RPMs for CPUs that would only
successfully build C/C++ and not all of the other languages
included in late model egcs/gcc releases.

  • Property mode set to 100644
File size: 5.1 KB
Line 
1#
2# spec file for building gcc for rtems
3#
4# Copyright  (c)  1999  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@
15Copyright:    1999 OARCorp
16
17Provides:       @target_alias@-gcc
18Requires:       @target_alias@-binutils
19
20Autoreqprov:    on
21Packager:       corsepiu@faw.uni-ulm.de and joel@OARcorp.com
22
23Version:        gcc@gcc_version@newlib@newlib_version@
24Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
25Source1:        ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz
26Patch0:         gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
27Patch1:         newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
28Buildroot:      /tmp
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, 1
42
43%description
44RTEMS is an open source operating system for embedded systems.
45
46This is gcc's and newlib C Library's sources with patches for RTEMS.
47
48 The original sources are not included in the source RPM.
49 If we included them, then the source RPMs for each target
50 would duplicate MBs of source unnecessarily.  This is
51 a duplication of over 30 MBs of source for each of
52 the more than 10 targets it is possible to build.
53
54 You can get them yourself from the Internet and copy them to
55 your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
56 Or you can try the ftp options of rpm :-)
57
58%prep
59# untar the sources inside @target_alias@-gcc-newlib
60%setup -c -n @target_alias@-gcc-newlib -a 0 -a 1
61
62%patch0 -p0
63%patch1 -p0
64
65  # Copy the C library into gcc's source tree
66  ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
67  test -d build || mkdir build
68
69%build
70  cd build
71  ../gcc-@gcc_version@/configure --target=@target_alias@ \
72    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
73    --prefix=/opt/rtems '--enable-languages=c,c++'
74
75  make all
76  make info
77
78%install
79  cd build
80  # Bug in gcc-2.95.1: It doesn't build this installation directory
81  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
82  ../gcc-@gcc_version@/mkinstalldirs \
83    $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin
84
85  make prefix=$RPM_BUILD_ROOT/opt/rtems install
86  cd @target_alias@/newlib
87  make prefix=$RPM_BUILD_ROOT/opt/rtems install-info
88
89  # cd back to build/
90  cd ../..
91
92  # gzip info files
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  gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null
96
97  rm -f dirs ;
98  echo "%dir /opt/rtems/lib" >> dirs ;
99  echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ;
100  echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ;
101
102  # Collect multilib subdirectories
103  TGTDIR="$RPM_BUILD_ROOT/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@"
104  find $TGTDIR \
105    \( -type d -a ! -path "$TGTDIR/include*" \) -print | \
106    sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs
107
108  # Collect files to go into different packages
109  cp dirs files.gcc
110
111  f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
112  for i in $f; do
113    case $i in
114    # *chill*) echo "$i" >> files.chill ;;
115    # *f771) ;;
116    # *cc1obj) ;;
117    # *libobjc*) echo "$i" >> files.objc ;;
118    # *include/objc*) ;;
119    # *jc1) ;;
120    # *jvgenmain) ;;
121    *) echo "$i" >> files.gcc ;;
122    esac
123  done
124
125%files -f build/files.gcc
126%dir /opt/rtems/info
127%doc /opt/rtems/info/dir
128%doc /opt/rtems/info/cpp.info*
129%doc /opt/rtems/info/gcc.info*
130%doc /opt/rtems/info/libc.info*
131%doc /opt/rtems/info/libm.info*
132
133%dir /opt/rtems/man
134%dir /opt/rtems/man/man1
135%doc /opt/rtems/man/man1/cccp.1
136%doc /opt/rtems/man/man1/@target_alias@-gcc.1
137%doc /opt/rtems/man/man1/@target_alias@-g++.1
138
139%dir /opt/rtems/bin
140/opt/rtems/bin/cpp
141/opt/rtems/bin/gcov
142/opt/rtems/bin/@target_alias@-c++
143/opt/rtems/bin/@target_alias@-g++
144/opt/rtems/bin/@target_alias@-gcc
145/opt/rtems/bin/@target_alias@-protoize
146/opt/rtems/bin/@target_alias@-unprotoize
147
148%dir /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include
149
150%dir /opt/rtems/include
151/opt/rtems/include/g++-3
152/opt/rtems/@target_alias@
153
154%post -n @target_alias@-gcc
155  if test -d $RPM_INSTALL_PREFIX/rtems/info;
156  then
157    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
158    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
159    test -n "$f" && for i in $f; do
160      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
161    done
162  fi
163
164%postun -n @target_alias@-gcc
165  if test -d $RPM_INSTALL_PREFIX/rtems/info;
166  then
167    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
168    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
169    test -n "$f" && for i in $f; do
170      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
171    done
172  fi
173
174
Note: See TracBrowser for help on using the repository browser.