source: rtems/scripts/gcc3newlib/gccnewlib.add @ 4aba88a1

4.104.114.84.95
Last change on this file since 4aba88a1 was 4aba88a1, checked in by Ralf Corsepius <ralf.corsepius@…>, on Aug 12, 2002 at 10:11:44 AM

2002-08-12 Ralf Corsepius <corsepiu@…>

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