[df49c60] | 1 | Name: @target_alias@-gcc-newlib |
---|
| 2 | Summary: gcc and newlib C Library for @target_alias@. |
---|
| 3 | Group: rtems |
---|
| 4 | Release: @Release@ |
---|
| 5 | License: gcc is GPL/LGPL ; newlib no has restrictions on run-time usage |
---|
| 6 | |
---|
| 7 | Autoreqprov: on |
---|
| 8 | Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com |
---|
| 9 | |
---|
| 10 | Version: gcc@gcc_version@newlib@newlib_version@ |
---|
[1cd0db4] | 11 | # gcc 3.x and gcc 2.9 |
---|
| 12 | # Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.bz2 |
---|
[a8bd1de] | 13 | # gcc 2.95.x |
---|
[1cd0db4] | 14 | Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-everything-@gcc_version@.tar.gz |
---|
[4b3af7a4] | 15 | Source1: ftp://sources.redhat.com/pub/newlib/newlib-@newlib_version@.tar.gz |
---|
[df49c60] | 16 | Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff |
---|
| 17 | Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff |
---|
| 18 | |
---|
| 19 | # |
---|
| 20 | # The original sources are not included in the source RPM. |
---|
| 21 | # If we included them, then the source RPMs for each target |
---|
| 22 | # would duplicate MBs of source unnecessarily. This is |
---|
| 23 | # a duplication of over 30 MBs of source for each of |
---|
| 24 | # the more than 10 targets it is possible to build. |
---|
| 25 | # |
---|
| 26 | # You can get them yourself from the Internet and copy them to |
---|
| 27 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
| 28 | # Or you can try the ftp options of rpm :-) |
---|
| 29 | # |
---|
| 30 | NoSource: 0 |
---|
| 31 | NoSource: 1 |
---|
| 32 | |
---|
| 33 | %description |
---|
| 34 | RTEMS is an open source operating system for embedded systems. |
---|
| 35 | |
---|
| 36 | This is gcc's and newlib C Library's sources with patches for RTEMS. |
---|
| 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|packages]/SOURCES directory ($RPM_SOURCE_DIR). |
---|
| 46 | Or you can try the ftp options of rpm :-) |
---|
| 47 | |
---|
| 48 | %prep |
---|
| 49 | # untar the sources inside @target_alias@-gcc-newlib |
---|
[cdf5ff65] | 50 | %setup -c -n %{name}-%{version} -a 0 -a 1 |
---|
[df49c60] | 51 | |
---|
| 52 | %patch0 -p0 |
---|
| 53 | %patch1 -p0 |
---|
| 54 | |
---|
| 55 | # Copy the C library into gcc's source tree |
---|
| 56 | ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@ |
---|
| 57 | test -d build || mkdir build |
---|
| 58 | |
---|
| 59 | %build |
---|
| 60 | cd build |
---|
| 61 | |
---|
[59292fe9] | 62 | ../gcc-@gcc_version@/configure \ |
---|
| 63 | --target=@target_alias@ \ |
---|
[df49c60] | 64 | --with-gnu-as --with-gnu-ld --with-newlib --verbose \ |
---|
[4b3af7a4] | 65 | --enable-threads --prefix=%{_prefix} @GCCLANGS@ |
---|
[df49c60] | 66 | |
---|
| 67 | make all |
---|
| 68 | make info |
---|
| 69 | |
---|
| 70 | %install |
---|
| 71 | cd build |
---|
| 72 | # Bug in gcc-2.95.1: It doesn't build this installation directory |
---|
| 73 | # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc |
---|
| 74 | ../gcc-@gcc_version@/mkinstalldirs \ |
---|
[4b3af7a4] | 75 | $RPM_BUILD_ROOT%{_prefix}/@target_alias@/bin |
---|
[df49c60] | 76 | |
---|
[4b3af7a4] | 77 | make prefix=$RPM_BUILD_ROOT%{_prefix} install |
---|
[df49c60] | 78 | cd @target_alias@/newlib |
---|
[4b3af7a4] | 79 | make prefix=$RPM_BUILD_ROOT%{_prefix} install-info |
---|
[df49c60] | 80 | |
---|
| 81 | # cd back to build/ |
---|
| 82 | cd ../.. |
---|
| 83 | |
---|
[01ec6c0] | 84 | # Bug in gcc-2.95.x: It bogusly tries to share cpp for all targets. |
---|
| 85 | # Rename it to target_alias-cpp |
---|
[59292fe9] | 86 | if test -f $RPM_BUILD_ROOT%{_prefix}/bin/cpp%{_exeext}; |
---|
[01ec6c0] | 87 | then |
---|
[59292fe9] | 88 | mv $RPM_BUILD_ROOT%{_prefix}/bin/cpp%{_exeext} \ |
---|
| 89 | $RPM_BUILD_ROOT%{_prefix}/bin/@target_alias@-cpp%{_exeext} |
---|
[01ec6c0] | 90 | fi |
---|
| 91 | |
---|
[df49c60] | 92 | # gzip info files |
---|
[4b3af7a4] | 93 | gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info 2>/dev/null |
---|
| 94 | gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-? 2>/dev/null |
---|
| 95 | gzip -f $RPM_BUILD_ROOT%{_prefix}/info/*.info-?? 2>/dev/null |
---|
[df49c60] | 96 | |
---|
| 97 | rm -f dirs ; |
---|
[4b3af7a4] | 98 | echo "%dir %{_prefix}/lib" >> dirs ; |
---|
| 99 | echo "%dir %{_prefix}/lib/gcc-lib" >> dirs ; |
---|
| 100 | echo "%dir %{_prefix}/lib/gcc-lib/@target_alias@" >> dirs ; |
---|
[df49c60] | 101 | |
---|
| 102 | # Collect multilib subdirectories |
---|
[4b3af7a4] | 103 | TGTDIR="%{_prefix}/lib/gcc-lib/@target_alias@/@gcc_version@" |
---|
[df49c60] | 104 | f=`gcc/xgcc --print-multi-lib | sed -e 's,;.*$,,'` |
---|
| 105 | for i in $f; do |
---|
| 106 | case $i in |
---|
| 107 | \.) echo "%dir ${TGTDIR}" >> dirs |
---|
| 108 | ;; |
---|
| 109 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
| 110 | ;; |
---|
| 111 | esac |
---|
| 112 | done |
---|
| 113 | |
---|
| 114 | # Collect files to go into different packages |
---|
| 115 | cp dirs files.chill |
---|
| 116 | cp dirs files.gcc |
---|
| 117 | cp dirs files.g77 |
---|
| 118 | cp dirs files.objc |
---|
| 119 | cp dirs files.gcj |
---|
| 120 | |
---|
| 121 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 122 | for i in $f; do |
---|
| 123 | case $i in |
---|
| 124 | *chill*) echo "$i" >> files.chill ;; |
---|
| 125 | *f771) ;; |
---|
| 126 | *cc1obj) ;; |
---|
| 127 | *libobjc*) echo "$i" >> files.objc ;; |
---|
| 128 | *include/objc*) ;; |
---|
| 129 | *jc1) ;; |
---|
| 130 | *jvgenmain) ;; |
---|
| 131 | *) echo "$i" >> files.gcc ;; |
---|
| 132 | esac |
---|
| 133 | done |
---|
| 134 | |
---|