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

4.104.114.84.95
Last change on this file since afe5cac was afe5cac, checked in by Joel Sherrill <joel.sherrill@…>, on 03/28/02 at 18:17:40

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

  • Per PR64 added support for gcc 3.x RPMs
  • Makefile.am, configure.ac, mkspec, setup, setup.def: Modified.
  • mkgcc3newlibspec.in: New file.
  • gcc3newlib: New subdirectory.
  • base-g77.add, base-gcc.add, base-gcj.add, gccnewlib.add, gccnewlib_c_only.spec.in, gccnewlib.spec.in, HISTORY, Makefile.am, README, target-g77.add, target-gcc.add, target-gcj.add, target-objc.add: New files.
  • Property mode set to 100644
File size: 4.6 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
28Patch0:         gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
29Patch1:         newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
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} -a 0 -a 1
64
65%patch0 -p0
66%patch1 -p0
67
68  # Copy the C library into gcc's source tree
69  ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
70  test -d build || mkdir build
71
72%build
73  cd build
74
75# HACK: This should be %{target} != %{build}, but SuSE's rpm screws it.
76# %if "%{target_os}" != "%{build_os}"
77#   CONFIGURE_ARGS="--build=%{_build} --host=%{_target}"
78# %endif
79
80  ../gcc-@gcc_version@/configure $CONFIGURE_ARGS --target=@target_alias@ \
81    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
82    --enable-threads=rtems --prefix=%{_prefix} @GCCLANGS@
83
84  make all
85  make info
86
87%install
88  cd build
89  # Bug in gcc-2.95.1: It doesn't build this installation directory
90  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
91  ../gcc-@gcc_version@/mkinstalldirs \
92    $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin
93
94  make prefix=$RPM_BUILD_ROOT%{_prefix} install
95  cd @target_alias@/newlib
96  make prefix=$RPM_BUILD_ROOT%{_prefix} install-info
97
98  # cd back to build/
99  cd ../..
100
101  # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets.
102  # Rename it to target_alias-cpp
103  if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@;
104  then
105    mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \
106      $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@
107  fi
108
109  # gzip info files
110  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null
111  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null
112  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null
113
114  rm -f dirs ;
115  echo "%dir %{_prefix}/lib" >> dirs ;
116  echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ;
117  echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ;
118
119  # Collect multilib subdirectories
120  TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@"
121  f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'`
122  for i in $f; do
123    case $i in
124    \.) echo "%dir ${TGTDIR}" >> dirs
125      ;;
126    *)  echo "%dir ${TGTDIR}/$i" >> dirs
127      ;;
128    esac
129  done
130
131  # Collect files to go into different packages
132  cp dirs files.gcc
133  cp dirs files.g77
134  cp dirs files.objc
135  cp dirs files.gcj
136
137  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
138  for i in $f; do
139    case $i in
140    *f771) ;;
141    *cc1obj) ;;
142    *libobjc*) echo "$i" >> files.objc ;;
143    *include/objc*) ;;
144    *jc1) ;;
145    *jvgenmain) ;;
146    *) echo "$i" >> files.gcc ;;
147    esac
148  done
149
150%clean
151# let rpm --clean remove BuildRoot iif using the default BuildRoot
152  test "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}" && \
153    rm -rf $RPM_BUILD_ROOT
154
Note: See TracBrowser for help on using the repository browser.