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

4.104.114.84.95
Last change on this file since cd240018 was cd240018, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 8, 2000 at 10:08:21 PM

2000-12-08 Joel Sherrill <joel@…>

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