source: rtems/scripts-ada/gnatnewlib/gnatnewlib.spec.in @ 71506054

4.104.114.84.95
Last change on this file since 71506054 was 71506054, checked in by Joel Sherrill <joel.sherrill@…>, on 01/27/00 at 23:48:28

GNAT/RTEMS RPMs have built for the binutils/gnat/gcc combination
and appear to be close for gdb.

  • Property mode set to 100644
File size: 12.5 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@-gnat-newlib
12Summary:      gnat, gcc, and newlib C Library for @target_alias@.
13Group:        gnatrtems
14Release:      @Release@
15Copyright:    1999 OARCorp
16
17Provides:       rtems-base-gnat @target_alias@-gnat
18Provides:       rtems-base-gnat-binutils @target_alias@-gnat-binutils
19# Requires:             @target_alias@-binutils
20
21Autoreqprov:    on
22Packager:       corsepiu@faw.uni-ulm.de and joel@OARcorp.com
23
24Version:        gnat@gnat_version@
25Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
26Source1:        ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz
27Source2:        ftp://cs.nyu.edu/pub/gnat/gnat-@gnat_version@-src.tar.gz
28Source3:        ftp://ftp.gnu.org/pub/gnu/binutils/binutils-@binutils_version@.tar.gz
29Patch0:         gcc-@gcc_version@-rtems-@gcc_patch_version@.diff
30Patch1:         newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
31Patch2:         gnat-@gnat_version@-src-rtems-@gnat_patch_version@.diff
32Patch3:         binutils-@binutils_version@-rtems-@binutils_patch_version@.diff
33#
34Buildroot:      /tmp
35
36#
37# The original sources are not included in the source RPM.
38# If we included them, then the source RPMs for each target
39# would duplicate MBs of source unnecessarily.  This is
40# a duplication of over 30 MBs of source for each of
41# the more than 10 targets it is possible to build.
42#
43# You can get them yourself from the Internet and copy them to
44# your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
45# Or you can try the ftp options of rpm :-)
46#
47NoSource:      0, 1, 2, 3
48
49%description
50RTEMS is an open source operating system for embedded systems.
51
52This is gcc's and newlib C Library's sources with patches for RTEMS.
53
54 The original sources are not included in the source RPM.
55 If we included them, then the source RPMs for each target
56 would duplicate MBs of source unnecessarily.  This is
57 a duplication of over 30 MBs of source for each of
58 the more than 10 targets it is possible to build.
59
60 You can get them yourself from the Internet and copy them to
61 your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR).
62 Or you can try the ftp options of rpm :-)
63
64This version of GNAT/RTEMS RPMs is based on the following:
65
66  + gnat-@gnat_version@-src
67  + gcc-@gcc_version@
68  + newlib-@newlib_version@
69  + binutils-@binutils_version@
70
71with appropriate patches.
72
73%package -n rtems-base-gnat
74Summary:      base package for rtems gnat, gcc, and newlib C Library
75Group: rtems
76
77%description -n rtems-base-gnat
78
79RTEMS is an open source operating system for embedded systems.
80
81This is the files for gnat, gcc, and newlib that are shared by all targets.
82
83%package -n rtems-base-gnat-binutils
84Summary:      base package for rtems binutils
85Group: rtems
86
87%description -n rtems-base-gnat-binutils
88
89RTEMS is an open source operating system for embedded systems.
90
91This is the base for binutils regardless of target CPU.
92
93%package -n @target_alias@-gnat-binutils
94Summary:      rtems binutils for @target_alias@
95Group: rtems
96Requires: rtems-base-gnat-binutils
97
98%description -n @target_alias@-gnat-binutils
99
100RTEMS is an open source operating system for embedded systems.
101
102This is the GNU binutils for RTEMS targetting @target_alias@.
103
104%package -n @target_alias@-gnat
105Summary:      rtems gnat, gcc, and newlib C Library for @target_alias@
106Group: rtems
107Requires: @target_alias@-gnat-binutils rtems-base-gnat
108
109%description -n @target_alias@-gnat
110RTEMS is an open source operating system for embedded systems.
111
112This is gnat, gcc, and newlib C Library for @target_alias@.
113
114%prep
115# untar the sources inside @target_alias@-gnat-newlib
116%setup -c -n @target_alias@-gnat-newlib -a 0 -a 1 -a 2 -a 3
117
118%patch0 -p0
119%patch1 -p0
120%patch2 -p0
121%patch3 -p0
122
123  # this 281 needs to be a variable. :(
124  cd gcc-@gcc_version@
125  patch -p0 <../gnat-@gnat_version@-src/src/gcc-281.dif
126 
127  mv ../gnat-@gnat_version@-src/src/ada .
128
129  cd ada
130  touch treeprs.ads a-[es]info.h nmake.ad[bs]
131  cd ../..    # now back at top
132
133  # Now we should be done patching everything.. build up a source tree
134
135  # this sequence is VERY dependent on the versions involved
136  #  When the gcc gets updated to 2.95.x or newer, this HAS to change.
137
138  mkdir src
139  cd src
140  # configure scripts
141  for f in config config.guess config.sub configure configure.in \
142        config-ml.in include install-sh ltconfig ltmain.sh Makefile.in \
143        move-if-change mkinstalldirs libiberty
144  do
145        # some packages have more configure scripts than others
146        # our list is inclusive
147        test -r ../binutils-@binutils_version@/$f && \
148          mv ../binutils-@binutils_version@/$f .
149  done
150
151  # link in gcc
152  mv ../gcc-@gcc_version@ gcc
153 
154  # link in binutils
155  for f in bfd binutils gas gprof ld opcodes etc
156  do
157    mv ../binutils-@binutils_version@/$f .
158  done
159
160  # link in newlib
161  mv ../newlib-@newlib_version@/newlib .
162  cd ..
163
164  # now we have a linked together source tree
165  test -d build || mkdir build
166
167
168%build
169  cd build
170  # after we switch off gcc 2.8.1, configure using gcc not a src directory
171  # and build binutils separately.
172  ../src/configure --target=@target_alias@ \
173    --with-gnu-as --with-gnu-ld --with-newlib --verbose \
174    --prefix=/opt/gnatrtems
175
176  # for now we are building all the languages
177  #  '--enable-languages=c,c++'
178
179#  #  This is a hack that is only because gnat still uses gcc 2.8.1
180#  test -d ${RPM_BUILD_ROOT}/opt/gnatrtems/@target_alias@ ||
181#    mkdir -p ${RPM_BUILD_ROOT}/opt/gnatrtems/@target_alias@
182#  for dir in ${RPM_BUILD_ROOT}/opt/gnatrtems/@target_alias@/include \
183#             ${RPM_BUILD_ROOT}/opt/gnatrtems/@target_alias@/sys-include
184#  do
185#    test -d ${dir} || mkdir -p ${dir}
186#    cp ../newlib-@newlib_version@/newlib/libc/sys/rtems/include/limits.h ${dir}
187#  done
188
189  make CC=gcc CFLAGS="-O2" LANGUAGES="c" all
190  make CC=gcc CFLAGS="-O2" LANGUAGES="c" info
191  # must be installed in the real place to allow gnat to continue to build
192  make CC=gcc CFLAGS="-O2" LANGUAGES="c" install
193
194#  When GNAT uses a gcc that finds the RTEMS limits.h, this will not
195#  be needed.  This should not be needed if the limits.h trick above works.
196#   cd gcc
197#   rm -f stmp-multilib
198#   find . -name "*.a" -print | xargs -e rm -f
199#
200#   make all
201#   cd ..
202
203####################     Ada from here down      ###################
204
205    # Just so the log shows what directory we are in.
206    pwd
207    cd gcc
208    echo "Starting build of GNAT proper."
209    make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
210     CC=gcc CFLAGS="-O2" LANGUAGES="c ada"
211
212    echo "Starting build of cross GNAT tools"
213    make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
214     CC=gcc CFLAGS="-O2 -g" LANGUAGES="c ada" cross-gnattools
215
216    echo "Starting build of ada.all.cross"
217    make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
218     CC=gcc CFLAGS="-O2" LANGUAGES="c ada" ada.all.cross
219
220    # must have -gnato to pass validation
221    # may want CC=gcc GNATLIBCFLAGS="-O3" GNATLIBFLAGS="-gnatpgn" gnatliy
222    # NOTE:  gnatlib is not multilib'ed -- serious embedded flaw
223    echo "Starting build of gnatlib"
224    make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
225     CC=gcc GNATLIBCFLAGS="-O2 -g" gnatlib
226
227%install
228  cd build
229  # Bug in gcc-2.95.1: It doesn't build this installation directory
230  # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc
231  # ../gcc-@gcc_version@/mkinstalldirs \
232  #   $RPM_BUILD_ROOT/opt/gnatrtems/@target_alias@/bin
233
234  cd gcc
235  echo "Starting install of gnat"
236  make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
237     CC=gcc CFLAGS="-O2 -g -gnata -gnatp" LANGUAGES="c ada" install
238  # GNAT has to be mostly installed to even build itself
239
240  make prefix=$RPM_BUILD_ROOT/opt/gnatrtems install-info
241
242  # cd go back to build/
243  pwd
244  cd ..
245
246  # gzip info files
247  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info 2>/dev/null
248  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info-? 2>/dev/null
249  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info-?? 2>/dev/null
250
251  rm -f dirs ;
252  echo "%dir /opt/gnatrtems/lib" >> dirs ;
253  echo "%dir /opt/gnatrtems/lib/gcc-lib" >> dirs ;
254  echo "%dir /opt/gnatrtems/lib/gcc-lib/@target_alias@" >> dirs ;
255
256  if test -f $RPM_BUILD_ROOT/opt/gnatrtems/info/configure.info.gz;
257  then
258# These common files are only present in binutils >= 2.9.5
259    find $RPM_BUILD_ROOT/opt/gnatrtems/info -name 'configure.*' | \
260      sed -e "s,^$RPM_BUILD_ROOT,,g" > ../files
261  else
262    touch ../files
263  fi
264# These target specific files are only present in binutils >= 2.9.5
265  if test -f /opt/gnatrtems/bin/@target_alias@-readelf@exe_ext@;
266  then
267    echo /opt/gnatrtems/bin/@target_alias@-readelf@exe_ext@ > ../files.target
268  else
269    touch ../files.target
270  fi
271
272  # Collect multilib subdirectories
273  TGTDIR="$RPM_BUILD_ROOT/opt/gnatrtems/lib/gcc-lib/@target_alias@/@gcc_version@"
274  find $TGTDIR \
275    \( -type d -a ! -path "$TGTDIR/include*" \) -print | \
276    sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs
277
278  # Collect files to go into different packages
279  # NOTE: This is left in as a place holder to move the 2.95.x code into.
280  cp dirs ../files.gcc
281
282  f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
283  for i in $f; do
284    case $i in
285    *) echo "$i" >> ../files.gcc ;;
286    esac
287  done
288
289%files -n rtems-base-gnat-binutils -f files
290%dir /opt/gnatrtems/info
291%doc /opt/gnatrtems/info/dir
292%doc /opt/gnatrtems/info/as.info.gz
293%doc /opt/gnatrtems/info/as.info-?.gz
294%doc /opt/gnatrtems/info/bfd.info.gz
295%doc /opt/gnatrtems/info/bfd.info-?.gz
296%doc /opt/gnatrtems/info/binutils.info.gz
297%doc /opt/gnatrtems/info/binutils.info-?.gz
298%doc /opt/gnatrtems/info/ld.info.gz
299%doc /opt/gnatrtems/info/ld.info-?.gz
300%doc /opt/gnatrtems/info/gasp.info.gz
301%doc /opt/gnatrtems/info/standards.info.gz
302
303%dir /opt/gnatrtems/man
304%dir /opt/gnatrtems/man/man1
305
306%dir /opt/gnatrtems/include
307/opt/gnatrtems/include/bfd.h
308/opt/gnatrtems/include/ansidecl.h
309/opt/gnatrtems/include/bfdlink.h
310
311%dir /opt/gnatrtems/lib
312/opt/gnatrtems/lib/libbfd*
313/opt/gnatrtems/lib/libiberty*
314/opt/gnatrtems/lib/libopcodes*
315
316# %dir /opt/gnatrtems/share
317# %dir /opt/gnatrtems/share/locale
318
319%files -n @target_alias@-gnat-binutils -f files.target
320%doc /opt/gnatrtems/man/man1/@target_alias@-*.1
321
322%dir /opt/gnatrtems/bin
323/opt/gnatrtems/bin/@target_alias@-addr2line@exe_ext@
324/opt/gnatrtems/bin/@target_alias@-ar@exe_ext@
325/opt/gnatrtems/bin/@target_alias@-as@exe_ext@
326/opt/gnatrtems/bin/@target_alias@-c++filt@exe_ext@
327/opt/gnatrtems/bin/@target_alias@-gasp@exe_ext@
328/opt/gnatrtems/bin/@target_alias@-ld@exe_ext@
329/opt/gnatrtems/bin/@target_alias@-nm@exe_ext@
330/opt/gnatrtems/bin/@target_alias@-objcopy@exe_ext@
331/opt/gnatrtems/bin/@target_alias@-objdump@exe_ext@
332/opt/gnatrtems/bin/@target_alias@-ranlib@exe_ext@
333# readelf is not in older binutils so get it from file list
334# /opt/gnatrtems/bin/@target_alias@-readelf@exe_ext@
335/opt/gnatrtems/bin/@target_alias@-size@exe_ext@
336/opt/gnatrtems/bin/@target_alias@-strings@exe_ext@
337/opt/gnatrtems/bin/@target_alias@-strip@exe_ext@
338
339%dir /opt/gnatrtems/@target_alias@
340%dir /opt/gnatrtems/@target_alias@/bin
341/opt/gnatrtems/@target_alias@/bin/ar@exe_ext@
342/opt/gnatrtems/@target_alias@/bin/as@exe_ext@
343/opt/gnatrtems/@target_alias@/bin/ld@exe_ext@
344/opt/gnatrtems/@target_alias@/bin/nm@exe_ext@
345/opt/gnatrtems/@target_alias@/bin/ranlib@exe_ext@
346/opt/gnatrtems/@target_alias@/bin/strip@exe_ext@
347
348%dir /opt/gnatrtems/@target_alias@/lib
349/opt/gnatrtems/@target_alias@/lib/ldscripts
350%files -n rtems-base-gnat
351%dir /opt/gnatrtems/info
352# %doc /opt/gnatrtems/info/dir
353%doc /opt/gnatrtems/info/cpp.info*
354%doc /opt/gnatrtems/info/gcc.info*
355%doc /opt/gnatrtems/info/libc.info*
356%doc /opt/gnatrtems/info/libm.info*
357
358# %dir /opt/gnatrtems/man
359# %dir /opt/gnatrtems/man/man1
360%doc /opt/gnatrtems/man/man1/cccp.1
361%doc /opt/gnatrtems/man/man1/@target_alias@-gcc.1
362
363%dir /opt/gnatrtems/bin
364# /opt/gnatrtems/bin/cpp@exe_ext@
365/opt/gnatrtems/bin/gcov@exe_ext@
366%dir /opt/gnatrtems/include
367# /opt/gnatrtems/include/g++-3
368
369%files -n @target_alias@-gnat -f files.gcc
370/opt/gnatrtems/bin/@target_alias@-gcc@exe_ext@
371
372%dir /opt/gnatrtems/lib/gcc-lib/@target_alias@/@gcc_version@/include
373
374/opt/gnatrtems/@target_alias@
375
376%post -n @target_alias@-gnat
377  if test -d $RPM_INSTALL_PREFIX/rtems/info;
378  then
379    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
380    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
381    test -n "$f" && for i in $f; do
382      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
383    done
384  fi
385
386%postun -n @target_alias@-gnat
387  if test -d $RPM_INSTALL_PREFIX/rtems/info;
388  then
389    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
390    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
391    test -n "$f" && for i in $f; do
392      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
393    done
394  fi
395
Note: See TracBrowser for help on using the repository browser.