source: rtems/scripts/gcc3newlib/gccnewlib.add @ 3549ab0

4.104.114.84.95
Last change on this file since 3549ab0 was 3549ab0, checked in by Joel Sherrill <joel.sherrill@…>, on 08/16/02 at 01:53:11

2002-08-15 Joel Sherrill <joel@…>

  • setup.def: New gcc 3.1 RPMs (-7).
  • gcc3newlib/gccnewlib.add: i386-rtems doesn't build Ada.
  • Property mode set to 100644
File size: 6.8 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.bz2
27Source1:        ftp://sources.redhat.com/pub/newlib/newlib-@newlib_version@.tar.gz
28@PATCH1@
29@PATCH3@
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%define build_cxx       1
47%define build_g77       0
48%define build_objc      0
49%define build_gcj       0
50%define build_gnat      0
51
52%if "@target_alias@"     == "c4x-rtems"
53%define build_cxx       0
54%endif
55
56%if "@target_alias@" == "i960-rtems"
57%define build_cxx       0
58%endif
59
60%if "@target_alias@" == "powerpc-rtems"
61%define build_gnat      1
62%endif
63
64%if "@target_alias@" == "sparc-rtems"
65%define build_gnat      1
66%endif
67
68%description
69RTEMS is an open source operating system for embedded systems.
70
71This is gcc's and newlib C Library's sources with patches for RTEMS.
72
73 The original sources are not included in the source RPM.
74 If we included them, then the source RPMs for each target
75 would duplicate MBs of source unnecessarily.  This is
76 a duplication of over 30 MBs of source for each of
77 the more than 10 targets it is possible to build.
78
79 You can get them yourself from the Internet and copy them to
80 your /usr/src/[redhat|packages]/SOURCES directory ($RPM_SOURCE_DIR).
81 Or you can try the ftp options of rpm :-)
82
83%prep
84# untar the sources inside @target_alias@-gcc-newlib
85%setup -c -T -n %{name} -a0 -a1
86
87@PATCH2@
88@PATCH4@
89
90  # Fix timestamps
91  cd gcc-@gcc_version@
92    contrib/gcc_update --touch
93  cd ..
94
95  # Copy the C library into gcc's source tree
96  ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@
97  test -d build || mkdir build
98
99%build
100  cd build
101
102# HACK: This should be %{target} != %{build}, but SuSE's rpm screws it.
103# %if "%{_target_os}" != "%{_build_os}"
104#    CONFIGURE_ARGS="--build=%{_build} --host=%{_target}"
105# %endif
106
107  languages="c"
108%if %build_cxx
109  languages="$languages,c++"
110%endif
111%if %build_g77
112  languages="$languages,g77"
113%endif
114%if %build_gcj
115  languages="$languages,gcj"
116%endif
117%if %build_objc
118  languages="$languages,objc"
119%endif
120%if %build_gnat
121  languages="$languages,ada"
122%endif
123  ../gcc-@gcc_version@/configure $CONFIGURE_ARGS --target=@target_alias@ \
124    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
125    --with-system-zlib --disable-nls \
126    --enable-version-specific-runtime-libs \
127    --enable-threads=rtems --prefix=%{_prefix} \
128    --enable-languages=$languages
129%if %build_gnat
130  cd ../gcc-@gcc_version@/gcc/ada
131  touch treeprs.ads [es]info.h nmake.ad[bs]
132  cd ../../../build
133%endif
134  make all
135%if %build_gnat
136# This is what is documented, but it doesn't work for me (RC)
137#  make gnatlib_and_tools
138  make -C gcc cross-gnattools
139  make -C gcc ada.all.cross
140  make -C gcc gnatlib
141%endif
142  make info
143
144%install
145  cd build
146#  # Bug in gcc-2.95.1: It doesn't build this installation directory
147#  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
148#  ../gcc-@gcc_version@/mkinstalldirs \
149#    $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin
150#
151
152  make prefix=$RPM_BUILD_ROOT%{_prefix} \
153    bindir=$RPM_BUILD_ROOT%{_bindir} install
154  cd @target_alias@/newlib
155  make prefix=$RPM_BUILD_ROOT%{_prefix} \
156    bindir=$RPM_BUILD_ROOT%{_bindir} install-info
157  # cd back to build/
158  cd ../..
159
160  # Bug in gcc-3.0.x: It puts the build dirs into *.la files
161  files=`find ${RPM_BUILD_ROOT}%{_prefix}/@target_alias@/lib -name '*.la'`
162  test -n "$files" && for i in $files; do
163    rm -f $i
164  done
165
166  # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets.
167  # Rename it to target_alias-cpp
168#  if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@;
169#  then
170#    mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp@exe_ext@ \
171#      $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp@exe_ext@
172#  fi
173
174  # gzip info files
175  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null
176  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null
177  gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null
178
179  rm -f dirs ;
180  echo "%dir %{_prefix}/lib" >> dirs ;
181  echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ;
182  echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ;
183
184  # Collect multilib subdirectories
185  f=`gcc/xgcc -Bgcc/ --print-multi-lib | sed -e 's,;.*$,,'`
186
187  TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@"
188  for i in $f; do
189    case $i in
190    \.) echo "%dir ${TGTDIR}" >> dirs
191      ;;
192    *)  echo "%dir ${TGTDIR}/$i" >> dirs
193      ;;
194    esac
195  done
196
197  TGTDIR="%{_prefix}/@target_alias@/lib"
198  for i in $f; do
199    case $i in
200    \.) echo "%dir ${TGTDIR}" >> dirs
201      ;;
202    *)  echo "%dir ${TGTDIR}/$i" >> dirs
203      ;;
204    esac
205  done
206
207  # Collect files to go into different packages
208  cp dirs files.gcc
209  cp dirs files.g77
210  cp dirs files.objc
211  cp dirs files.gcj
212  cp dirs files.g++
213
214  TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@"
215  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
216  for i in $f; do
217    case $i in
218    *lib*.la);; # ignore: gcc produces bogus libtool libs
219    *f771) ;;
220    *cc1obj) ;;
221    *libobjc*) echo "$i" >> files.objc ;;
222    *include/objc*) ;;
223    *include/g++*);;
224    *include/c++*);;
225    *adainclude*);;
226    *adalib*);;
227    *gnat1);;
228    *jc1) ;;
229    *jvgenmain) ;;
230    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
231    *libstdc++.a) echo "$i" >> files.g++ ;;
232    *libsupc++.a) echo "$i" >> files.g++ ;;
233    *) echo "$i" >> files.gcc ;;
234    esac
235  done
236
237  TGTDIR="%{_prefix}/@target_alias@/lib"
238  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
239  for i in $f; do
240    case $i in
241    *lib*.la);; # ignore - gcc produces bogus libtool libs
242    *libiberty.a) ;; # ignore - GPL'ed
243# all other files belong to gcc
244    *) echo "$i" >> files.gcc ;;
245    esac
246  done
247
248%clean
249# let rpm --clean remove BuildRoot iif using the default BuildRoot
250  test "$RPM_BUILD_ROOT" = "%{_tmppath}/%{name}" && \
251    rm -rf $RPM_BUILD_ROOT
Note: See TracBrowser for help on using the repository browser.