OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rtems-20020807/] [scripts-ada/] [gnatnewlib/] [gnatnewlib.spec.in] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
#
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
 
9
Vendor:       OAR Corporation
10
Distribution: Linux
11
Name:         @Target_alias@-gnat-newlib
12
Summary:      gnat, gcc, and newlib C Library for @Target_alias@.
13
Group:        gnatrtems
14
Release:      @Release@
15
License:      gcc is GPL/LGPL ; newlib no has restrictions on run-time usage
16
 
17
Provides:       rtems-base-gnat @Target_alias@-gnat
18
Provides:       rtems-base-gnat-binutils @Target_alias@-gnat-binutils
19
# Requires:             @Target_alias@-binutils
20
 
21
Autoreqprov:    on
22
Packager:       corsepiu@faw.uni-ulm.de and joel@OARcorp.com
23
 
24
Version:        gnat@gnat_version@
25
Source0:        ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz
26
Source1:        ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz
27
Source2:        ftp://cs.nyu.edu/pub/gnat/gnat-@gnat_version@-src.tar.gz
28
Source3:        ftp://ftp.gnu.org/pub/gnu/binutils/binutils-@binutils_version@.tar.gz
29
Patch0:         gcc-@gcc_version@-rtems-gnat-@gnat_version@-@gcc_patch_version@.diff
30
Patch1:         newlib-@newlib_version@-rtems-@newlib_patch_version@.diff
31
Patch2:         gnat-@gnat_version@-rtems-@gnat_patch_version@.diff
32
Patch3:         binutils-@binutils_version@-rtems-gnat-@gnat_version@-@binutils_patch_version@.diff
33
Patch4:         newlib-@newlib_version@-rtems-gnat-@gnat_version@-@gnat_newlib_patch_version@.diff
34
#
35
Buildroot:      /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
#
48
NoSource:       0
49
NoSource:       1
50
NoSource:       2
51
NoSource:       3
52
 
53
%description
54
RTEMS is an open source operating system for embedded systems.
55
 
56
This 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
 
68
This 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
 
75
with appropriate patches.
76
 
77
%package -n rtems-base-gnat
78
Summary:      base package for rtems gnat, gcc, and newlib C Library
79
Group: gnatrtems
80
 
81
%description -n rtems-base-gnat
82
 
83
RTEMS is an open source operating system for embedded systems.
84
 
85
This is the files for gnat, gcc, and newlib that are shared by all targets.
86
 
87
%package -n rtems-base-gnat-binutils
88
Summary:      base package for rtems binutils
89
Group: gnatrtems
90
 
91
%description -n rtems-base-gnat-binutils
92
 
93
RTEMS is an open source operating system for embedded systems.
94
 
95
This is the base for binutils regardless of target CPU.
96
 
97
%package -n @Target_alias@-gnat-binutils
98
Summary:      rtems binutils for @Target_alias@
99
Group: gnatrtems
100
Requires: rtems-base-gnat-binutils
101
 
102
%description -n @Target_alias@-gnat-binutils
103
 
104
RTEMS is an open source operating system for embedded systems.
105
 
106
This is the GNU binutils for RTEMS targetting @Target_alias@.
107
 
108
%package -n @Target_alias@-gnat
109
Summary:      rtems gnat, gcc, and newlib C Library for @Target_alias@
110
Group: gnatrtems
111
Requires: @Target_alias@-gnat-binutils rtems-base-gnat
112
 
113
%description -n @Target_alias@-gnat
114
RTEMS is an open source operating system for embedded systems.
115
 
116
This 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
127
cd newlib-@newlib_version@
128
%patch1 -p1
129
%patch4 -p1
130
cd ..
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 CC=gcc CFLAGS="-O2" LANGUAGES="c ada gcov"
221
 
222
    echo "Starting build of cross GNAT tools"
223
    make CC=gcc CFLAGS="-O2 -g" LANGUAGES="c ada gcov" cross-gnattools
224
 
225
    echo "Starting build of ada.all.cross"
226
    make CC=gcc CFLAGS="-O2" LANGUAGES="c ada gcov" ada.all.cross
227
 
228
    # must have -gnato to pass validation
229
    # may want CC=gcc GNATLIBCFLAGS="-O3" GNATLIBFLAGS="-gnatpgn" gnatliy
230
    # NOTE:  gnatlib is not multilib'ed -- serious embedded flaw
231
    echo "Starting build of gnatlib"
232
    make CC=gcc GNATLIBCFLAGS="-O2 -g" gnatlib
233
 
234
%install
235
  cd build
236
  # Bug in gcc-2.95.1: It doesn't build this installation directory
237
  # If it doesn't find it, gcc doesn't install @Target_alias@/bin/gcc
238
  # ../gcc-@gcc_version@/mkinstalldirs \
239
  #   $RPM_BUILD_ROOT/opt/gnatrtems/@Target_alias@/bin
240
 
241
  cd gcc
242
  echo "Starting install of gnat"
243
  make prefix=$RPM_BUILD_ROOT/opt/gnatrtems \
244
     CC=gcc CFLAGS="-O2 -g -gnata -gnatp" LANGUAGES="c ada" install
245
  # GNAT has to be mostly installed to even build itself
246
 
247
#  hack to get rid of symlinks to dynamic libraries that don't exist
248
  find $RPM_BUILD_ROOT/opt/gnatrtems -name "*.so" | xargs -e rm -f
249
 
250
  make prefix=$RPM_BUILD_ROOT/opt/gnatrtems install-info
251
 
252
  # cd go back to build/
253
  pwd
254
  cd ..
255
 
256
  # gzip info files
257
  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info 2>/dev/null
258
  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info-? 2>/dev/null
259
  gzip -f $RPM_BUILD_ROOT/opt/gnatrtems/info/*.info-?? 2>/dev/null
260
 
261
  rm -f dirs ;
262
  echo "%dir /opt/gnatrtems/lib" >> dirs ;
263
  echo "%dir /opt/gnatrtems/lib/gcc-lib" >> dirs ;
264
  echo "%dir /opt/gnatrtems/lib/gcc-lib/@Target_alias@" >> dirs ;
265
 
266
  touch ../files
267
  # if test -f $RPM_BUILD_ROOT/opt/gnatrtems/info/configure.info.gz;
268
  # then
269
# These common files are only present in binutils >= 2.9.5
270
  #   find $RPM_BUILD_ROOT/opt/gnatrtems/info -name 'configure.*' | \
271
  #     sed -e "s,^$RPM_BUILD_ROOT,,g" > ../files
272
  # else
273
  #   touch ../files
274
  # fi
275
# These target specific files are only present in binutils >= 2.9.5
276
  if test -f /opt/gnatrtems/bin/@Target_alias@-readelf@exe_ext@;
277
  then
278
    echo /opt/gnatrtems/bin/@Target_alias@-readelf@exe_ext@ > ../files.target
279
  else
280
    touch ../files.target
281
  fi
282
 
283
  # Collect multilib subdirectories
284
  TGTDIR="$RPM_BUILD_ROOT/opt/gnatrtems/lib/gcc-lib/@Target_alias@/@gcc_version@"
285
  find $TGTDIR \
286
    \( -type d -a ! -path "$TGTDIR/include*" \) -print | \
287
    sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs
288
 
289
  # Collect files to go into different packages
290
  # NOTE: This is left in as a place holder to move the 2.95.x code into.
291
  cp dirs ../files.gcc
292
 
293
  f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
294
  for i in $f; do
295
    case $i in
296
    *) echo "$i" >> ../files.gcc ;;
297
    esac
298
  done
299
 
300
%files -n rtems-base-gnat-binutils -f files
301
%dir /opt/gnatrtems/info
302
# %doc /opt/gnatrtems/info/dir
303
# %doc /opt/gnatrtems/info/as.info.gz
304
# %doc /opt/gnatrtems/info/as.info-?.gz
305
# %doc /opt/gnatrtems/info/bfd.info.gz
306
# %doc /opt/gnatrtems/info/bfd.info-?.gz
307
# %doc /opt/gnatrtems/info/binutils.info.gz
308
# %doc /opt/gnatrtems/info/binutils.info-?.gz
309
# %doc /opt/gnatrtems/info/ld.info.gz
310
# %doc /opt/gnatrtems/info/ld.info-?.gz
311
# %doc /opt/gnatrtems/info/gasp.info.gz
312
# %doc /opt/gnatrtems/info/standards.info.gz
313
 
314
%dir /opt/gnatrtems/man
315
%dir /opt/gnatrtems/man/man1
316
 
317
%dir /opt/gnatrtems/include
318
/opt/gnatrtems/include/bfd.h
319
/opt/gnatrtems/include/ansidecl.h
320
/opt/gnatrtems/include/bfdlink.h
321
 
322
%dir /opt/gnatrtems/lib
323
/opt/gnatrtems/lib/libbfd*
324
/opt/gnatrtems/lib/libiberty*
325
/opt/gnatrtems/lib/libopcodes*
326
 
327
# %dir /opt/gnatrtems/share
328
# %dir /opt/gnatrtems/share/locale
329
 
330
%files -n @Target_alias@-gnat-binutils -f files.target
331
%doc /opt/gnatrtems/man/man1/@Target_alias@-*.1
332
 
333
%dir /opt/gnatrtems/bin
334
/opt/gnatrtems/bin/@Target_alias@-addr2line@exe_ext@
335
/opt/gnatrtems/bin/@Target_alias@-ar@exe_ext@
336
/opt/gnatrtems/bin/@Target_alias@-as@exe_ext@
337
/opt/gnatrtems/bin/@Target_alias@-c++filt@exe_ext@
338
/opt/gnatrtems/bin/@Target_alias@-gasp@exe_ext@
339
/opt/gnatrtems/bin/@Target_alias@-ld@exe_ext@
340
/opt/gnatrtems/bin/@Target_alias@-nm@exe_ext@
341
/opt/gnatrtems/bin/@Target_alias@-objcopy@exe_ext@
342
/opt/gnatrtems/bin/@Target_alias@-objdump@exe_ext@
343
/opt/gnatrtems/bin/@Target_alias@-ranlib@exe_ext@
344
# readelf is not in older binutils so get it from file list
345
# /opt/gnatrtems/bin/@Target_alias@-readelf@exe_ext@
346
/opt/gnatrtems/bin/@Target_alias@-size@exe_ext@
347
/opt/gnatrtems/bin/@Target_alias@-strings@exe_ext@
348
/opt/gnatrtems/bin/@Target_alias@-strip@exe_ext@
349
 
350
%dir /opt/gnatrtems/@Target_alias@
351
%dir /opt/gnatrtems/@Target_alias@/bin
352
/opt/gnatrtems/@Target_alias@/bin/ar@exe_ext@
353
/opt/gnatrtems/@Target_alias@/bin/as@exe_ext@
354
/opt/gnatrtems/@Target_alias@/bin/ld@exe_ext@
355
/opt/gnatrtems/@Target_alias@/bin/nm@exe_ext@
356
/opt/gnatrtems/@Target_alias@/bin/ranlib@exe_ext@
357
/opt/gnatrtems/@Target_alias@/bin/strip@exe_ext@
358
 
359
%dir /opt/gnatrtems/@Target_alias@/lib
360
/opt/gnatrtems/@Target_alias@/lib/ldscripts
361
%files -n rtems-base-gnat
362
%dir /opt/gnatrtems/info
363
# %doc /opt/gnatrtems/info/dir
364
%doc /opt/gnatrtems/info/cpp.info*
365
%doc /opt/gnatrtems/info/gcc.info*
366
%doc /opt/gnatrtems/info/libc.info*
367
%doc /opt/gnatrtems/info/libm.info*
368
 
369
# %dir /opt/gnatrtems/man
370
# %dir /opt/gnatrtems/man/man1
371
%doc /opt/gnatrtems/man/man1/cccp.1
372
%doc /opt/gnatrtems/man/man1/@Target_alias@-gcc.1
373
 
374
%dir /opt/gnatrtems/bin
375
# /opt/gnatrtems/bin/cpp@exe_ext@
376
# /opt/gnatrtems/bin/gcov@exe_ext@
377
%dir /opt/gnatrtems/include
378
# /opt/gnatrtems/include/g++-3
379
 
380
%files -n @Target_alias@-gnat -f files.gcc
381
/opt/gnatrtems/bin/@Target_alias@-gcc@exe_ext@
382
/opt/gnatrtems/bin/@Target_alias@-gnatbind
383
/opt/gnatrtems/bin/@Target_alias@-gnatbl
384
/opt/gnatrtems/bin/@Target_alias@-gnatchop
385
/opt/gnatrtems/bin/@Target_alias@-gnatfind
386
/opt/gnatrtems/bin/@Target_alias@-gnatkr
387
/opt/gnatrtems/bin/@Target_alias@-gnatlink
388
/opt/gnatrtems/bin/@Target_alias@-gnatls
389
/opt/gnatrtems/bin/@Target_alias@-gnatmake
390
/opt/gnatrtems/bin/@Target_alias@-gnatmem
391
/opt/gnatrtems/bin/@Target_alias@-gnatprep
392
/opt/gnatrtems/bin/@Target_alias@-gnatpsta
393
/opt/gnatrtems/bin/@Target_alias@-gnatpsys
394
/opt/gnatrtems/bin/@Target_alias@-gnatxref
395
 
396
 
397
%dir /opt/gnatrtems/lib/gcc-lib/@Target_alias@/@gcc_version@/include
398
 
399
/opt/gnatrtems/@Target_alias@
400
 
401
%post -n @Target_alias@-gnat
402
  if test -d $RPM_INSTALL_PREFIX/rtems/info;
403
  then
404
    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
405
    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
406
    test -n "$f" && for i in $f; do
407
      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
408
    done
409
  fi
410
 
411
%postun -n @Target_alias@-gnat
412
  if test -d $RPM_INSTALL_PREFIX/rtems/info;
413
  then
414
    rm -f $RPM_INSTALL_PREFIX/rtems/info/dir
415
    f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'`
416
    test -n "$f" && for i in $f; do
417
      install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir
418
    done
419
  fi
420
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.