[3f6e3fa] | 1 | # |
---|
| 2 | # Please send bugfixes or comments to |
---|
| 3 | # http://www.rtems.org/bugzilla |
---|
| 4 | # |
---|
| 5 | |
---|
[05c66cf] | 6 | %define _prefix /opt/rtems-4.10 |
---|
| 7 | %define _exec_prefix %{_prefix} |
---|
| 8 | %define _bindir %{_exec_prefix}/bin |
---|
| 9 | %define _sbindir %{_exec_prefix}/sbin |
---|
| 10 | %define _libexecdir %{_exec_prefix}/libexec |
---|
| 11 | %define _datarootdir %{_prefix}/share |
---|
| 12 | %define _datadir %{_datarootdir} |
---|
| 13 | %define _sysconfdir %{_prefix}/etc |
---|
| 14 | %define _sharedstatedir %{_prefix}/com |
---|
| 15 | %define _localstatedir %{_prefix}/var |
---|
| 16 | %define _includedir %{_prefix}/include |
---|
| 17 | %define _libdir %{_exec_prefix}/%{_lib} |
---|
| 18 | %define _mandir %{_datarootdir}/man |
---|
| 19 | %define _infodir %{_datarootdir}/info |
---|
| 20 | %define _localedir %{_datarootdir}/locale |
---|
[3f6e3fa] | 21 | |
---|
| 22 | %ifos cygwin cygwin32 mingw mingw32 |
---|
| 23 | %define _exeext .exe |
---|
[35381baa] | 24 | %define debug_package %{nil} |
---|
| 25 | %define _libdir %{_exec_prefix}/lib |
---|
[3f6e3fa] | 26 | %else |
---|
| 27 | %define _exeext %{nil} |
---|
| 28 | %endif |
---|
| 29 | |
---|
| 30 | %ifos cygwin cygwin32 |
---|
| 31 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
[35381baa] | 32 | %endif |
---|
| 33 | |
---|
| 34 | %ifos mingw mingw32 |
---|
| 35 | %if %{defined _mingw32_cflags} |
---|
| 36 | %define optflags %{_mingw32_cflags} |
---|
| 37 | %else |
---|
| 38 | %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields |
---|
| 39 | %endif |
---|
[3f6e3fa] | 40 | %endif |
---|
| 41 | |
---|
| 42 | %if "%{_build}" != "%{_host}" |
---|
| 43 | %define _host_rpmprefix rtems-4.10-%{_host}- |
---|
| 44 | %else |
---|
| 45 | %define _host_rpmprefix %{nil} |
---|
| 46 | %endif |
---|
| 47 | |
---|
| 48 | |
---|
[1dc2a94] | 49 | %define gcc_pkgvers 4.4.0 |
---|
[9937a7a] | 50 | %define gcc_version 4.4.0 |
---|
| 51 | %define gcc_rpmvers %{expand:%(echo "4.4.0" | tr - _ )} |
---|
[3f6e3fa] | 52 | |
---|
[8ffd16bb] | 53 | %define newlib_pkgvers 1.17.0 |
---|
| 54 | %define newlib_version 1.17.0 |
---|
[3f6e3fa] | 55 | |
---|
| 56 | Name: rtems-4.10-mips-rtems4.10-gcc |
---|
| 57 | Summary: mips-rtems4.10 gcc |
---|
| 58 | |
---|
| 59 | Group: Development/Tools |
---|
| 60 | Version: %{gcc_rpmvers} |
---|
[1dc2a94] | 61 | Release: 5%{?dist} |
---|
[3f6e3fa] | 62 | License: GPL |
---|
| 63 | URL: http://gcc.gnu.org |
---|
| 64 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 65 | |
---|
| 66 | %define _use_internal_dependency_generator 0 |
---|
| 67 | |
---|
| 68 | BuildRequires: %{_host_rpmprefix}gcc |
---|
| 69 | |
---|
| 70 | %if "%{gcc_version}" >= "4.3.0" |
---|
[5faedff] | 71 | %define _gmp_minvers 4.1 |
---|
| 72 | %else |
---|
| 73 | %if "%{gcc_version}" >= "4.2.0" |
---|
| 74 | %endif |
---|
| 75 | %endif |
---|
| 76 | |
---|
| 77 | %if %{defined _gmp_minvers} |
---|
| 78 | BuildRequires: gmp-devel >= %{_gmp_minvers} |
---|
[3f6e3fa] | 79 | %if "%{_build}" != "%{_host}" |
---|
[5faedff] | 80 | BuildRequires: %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers} |
---|
[3f6e3fa] | 81 | %endif |
---|
| 82 | %endif |
---|
[5faedff] | 83 | |
---|
| 84 | |
---|
| 85 | %if "%{gcc_version}" >= "4.4.0" |
---|
| 86 | %define _mpfr_minvers 2.3.2 |
---|
| 87 | %define mpfr_version 2.4.1 |
---|
| 88 | %else |
---|
| 89 | %if "%{gcc_version}" >= "4.3.0" |
---|
| 90 | %define _mpfr_minvers 2.3.1 |
---|
| 91 | %define mpfr_version 2.3.2 |
---|
| 92 | %else |
---|
| 93 | %if "%{gcc_version}" >= "4.2.0" |
---|
| 94 | %endif |
---|
| 95 | %endif |
---|
| 96 | %endif |
---|
| 97 | |
---|
| 98 | %if %{defined _mpfr_minvers} |
---|
[3521985b] | 99 | # FIXME: This is an ugly cludge |
---|
[5faedff] | 100 | %{?fc9:%global mpfr_provided 2.3.1} |
---|
| 101 | %{?fc10:%global mpfr_provided 2.3.2} |
---|
| 102 | %{?fc11:%global mpfr_provided 2.4.1} |
---|
[3521985b] | 103 | %{?suse10_3:%global mpfr_provided 2.2.1} |
---|
| 104 | %{?cygwin:%global mpfr_provided 2.4.1} |
---|
| 105 | %{?mingw32:%global mpfr_provided %{nil}} |
---|
[5faedff] | 106 | |
---|
| 107 | %if %{defined mpfr_provided} |
---|
| 108 | %if "%{mpfr_provided}" < "%{_mpfr_minvers}" |
---|
| 109 | %define _build_mpfr 1 |
---|
| 110 | %else |
---|
[3521985b] | 111 | %if "%{_build}" != "%{_host}" |
---|
| 112 | BuildRequires: %{_host_rpmprefix}mpfr-devel >= %{_mpfr_minvers} |
---|
| 113 | %else |
---|
[5faedff] | 114 | BuildRequires: mpfr-devel >= %{_mpfr_minvers} |
---|
| 115 | %endif |
---|
[3521985b] | 116 | %endif |
---|
[5faedff] | 117 | %else |
---|
| 118 | %define _build_mpfr 1 |
---|
| 119 | %endif |
---|
| 120 | |
---|
[3f6e3fa] | 121 | %endif |
---|
| 122 | |
---|
| 123 | %if "%{_build}" != "%{_host}" |
---|
[35381baa] | 124 | BuildRequires: rtems-4.10-mips-rtems4.10-gcc = %{gcc_rpmvers} |
---|
[3f6e3fa] | 125 | %endif |
---|
| 126 | |
---|
| 127 | %if "%{gcc_version}" >= "4.2.0" |
---|
| 128 | BuildRequires: flex bison |
---|
| 129 | %endif |
---|
| 130 | |
---|
| 131 | |
---|
| 132 | BuildRequires: texinfo >= 4.2 |
---|
| 133 | BuildRequires: rtems-4.10-mips-rtems4.10-binutils |
---|
| 134 | |
---|
| 135 | Requires: rtems-4.10-gcc-common |
---|
| 136 | Requires: rtems-4.10-mips-rtems4.10-binutils |
---|
[1dc2a94] | 137 | Requires: rtems-4.10-mips-rtems4.10-newlib = %{newlib_version}-38%{?dist} |
---|
[3f6e3fa] | 138 | |
---|
| 139 | |
---|
| 140 | %if "%{gcc_version}" >= "3.4" |
---|
| 141 | %define gcclib %{_libdir}/gcc |
---|
| 142 | %define gccexec %{_libexecdir}/gcc |
---|
| 143 | %else |
---|
| 144 | %define gcclib %{_libdir}/gcc-lib |
---|
| 145 | %define gccexec %{_libdir}/gcc-lib |
---|
| 146 | %endif |
---|
| 147 | |
---|
[11feece9] | 148 | %if "%{gcc_version}" == "4.3.3" |
---|
[d8a213b2] | 149 | Source0: ftp://ftp.gnu.org/pub/gnu/gcc/%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2 |
---|
[11feece9] | 150 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.3.3-rtems4.10-20090125.diff |
---|
[d8a213b2] | 151 | %endif |
---|
[9937a7a] | 152 | %if "%{gcc_version}" == "4.4.0" |
---|
[3bbe1b1] | 153 | Source0: ftp://ftp.gnu.org/pub/gnu/gcc/%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2 |
---|
[1dc2a94] | 154 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-%{gcc_pkgvers}-rtems4.10-20090421.diff |
---|
[9937a7a] | 155 | %endif |
---|
[3f6e3fa] | 156 | %{?_without_sources:NoSource: 0} |
---|
| 157 | |
---|
[11feece9] | 158 | %if "%{gcc_version}" == "4.3.3" |
---|
[d8a213b2] | 159 | Source1: ftp://ftp.gnu.org/pub/gnu/gcc/%{gcc_pkgvers}/gcc-g++-%{gcc_pkgvers}.tar.bz2 |
---|
| 160 | %endif |
---|
[9937a7a] | 161 | %if "%{gcc_version}" == "4.4.0" |
---|
[3bbe1b1] | 162 | Source1: ftp://ftp.gnu.org/pub/gnu/gcc/%{gcc_pkgvers}/gcc-g++-%{gcc_pkgvers}.tar.bz2 |
---|
[9937a7a] | 163 | %endif |
---|
[3f6e3fa] | 164 | %{?_without_sources:NoSource: 1} |
---|
| 165 | |
---|
[c51f900b] | 166 | %if "%{newlib_version}" == "1.17.0" |
---|
[8429438] | 167 | Source50: ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz |
---|
[c033221] | 168 | Patch50: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.17.0-rtems4.10-20090311.diff |
---|
[3f6e3fa] | 169 | %endif |
---|
| 170 | %{?_without_sources:NoSource: 50} |
---|
| 171 | |
---|
| 172 | %if "%{gcc_version}" >= "4.3.0" |
---|
| 173 | Source60: http://www.mpfr.org/mpfr-current/mpfr-%{mpfr_version}.tar.bz2 |
---|
| 174 | %endif |
---|
| 175 | |
---|
| 176 | %description |
---|
| 177 | Cross gcc for mips-rtems4.10. |
---|
| 178 | |
---|
| 179 | %prep |
---|
| 180 | %setup -c -T -n %{name}-%{version} |
---|
| 181 | |
---|
| 182 | %setup -q -T -D -n %{name}-%{version} -a0 |
---|
| 183 | %{?PATCH0:%patch0 -p0} |
---|
| 184 | |
---|
| 185 | %setup -q -T -D -n %{name}-%{version} -a1 |
---|
| 186 | %{?PATCH1:%patch1 -p0} |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | |
---|
| 192 | %setup -q -T -D -n %{name}-%{version} -a50 |
---|
| 193 | cd newlib-%{newlib_version} |
---|
| 194 | %{?PATCH50:%patch50 -p1} |
---|
| 195 | cd .. |
---|
| 196 | # Copy the C library into gcc's source tree |
---|
| 197 | ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_pkgvers} |
---|
| 198 | |
---|
| 199 | %if 0%{?_build_mpfr} |
---|
| 200 | %setup -q -T -D -n %{name}-%{version} -a60 |
---|
| 201 | %{?PATCH60:%patch60 -p1} |
---|
| 202 | # Build mpfr one-tree style |
---|
| 203 | ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr |
---|
| 204 | %endif |
---|
| 205 | |
---|
| 206 | %if "%{gcc_version}" < "4.1.0" |
---|
| 207 | sed -e 's/\(version_string.* = \"[^\"]*\)/\1 (RTEMS gcc-%{gcc_version}\/newlib-%{newlib_version}-%release)/' \ |
---|
| 208 | gcc-%{gcc_pkgvers}/gcc/version.c > gcc-%{gcc_pkgvers}/gcc/version.c~ |
---|
| 209 | %else |
---|
| 210 | sed -e 's/^#define VERSUFFIX.*$/#define VERSUFFIX \" (RTEMS gcc-%{gcc_version}\/newlib-%{newlib_version}-%{release})\"/' \ |
---|
| 211 | gcc-%{gcc_pkgvers}/gcc/version.c > gcc-%{gcc_pkgvers}/gcc/version.c~ |
---|
| 212 | %endif |
---|
| 213 | mv gcc-%{gcc_pkgvers}/gcc/version.c~ gcc-%{gcc_pkgvers}/gcc/version.c |
---|
| 214 | |
---|
| 215 | |
---|
| 216 | # Fix timestamps |
---|
| 217 | cd gcc-%{gcc_pkgvers} |
---|
| 218 | contrib/gcc_update --touch |
---|
| 219 | cd .. |
---|
| 220 | %build |
---|
| 221 | mkdir -p build |
---|
| 222 | |
---|
| 223 | cd build |
---|
| 224 | |
---|
| 225 | languages="c" |
---|
| 226 | languages="$languages,c++" |
---|
| 227 | export PATH="%{_bindir}:${PATH}" |
---|
| 228 | %if "%{_build}" != "%{_host}" |
---|
| 229 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
| 230 | CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \ |
---|
| 231 | %else |
---|
[05c66cf] | 232 | # gcc is not ready to be compiled with -std=gnu99 |
---|
| 233 | CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \ |
---|
[3f6e3fa] | 234 | %endif |
---|
| 235 | ../gcc-%{gcc_pkgvers}/configure \ |
---|
| 236 | --prefix=%{_prefix} \ |
---|
| 237 | --bindir=%{_bindir} \ |
---|
| 238 | --exec_prefix=%{_exec_prefix} \ |
---|
| 239 | --includedir=%{_includedir} \ |
---|
| 240 | --libdir=%{_libdir} \ |
---|
| 241 | --libexecdir=%{_libexecdir} \ |
---|
| 242 | --mandir=%{_mandir} \ |
---|
| 243 | --infodir=%{_infodir} \ |
---|
| 244 | --datadir=%{_datadir} \ |
---|
| 245 | --build=%_build --host=%_host \ |
---|
| 246 | --target=mips-rtems4.10 \ |
---|
| 247 | --disable-libstdcxx-pch \ |
---|
| 248 | --with-gnu-as --with-gnu-ld --verbose \ |
---|
| 249 | --with-newlib \ |
---|
| 250 | --with-system-zlib \ |
---|
| 251 | --disable-nls --without-included-gettext \ |
---|
| 252 | --disable-win32-registry \ |
---|
| 253 | --enable-version-specific-runtime-libs \ |
---|
| 254 | --enable-threads \ |
---|
[d8a213b2] | 255 | --enable-newlib-io-c99-formats \ |
---|
[3f6e3fa] | 256 | --enable-languages="$languages" $optargs |
---|
| 257 | |
---|
| 258 | %if "%_host" != "%_build" |
---|
| 259 | # Bug in gcc-3.2.1: |
---|
| 260 | # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs |
---|
| 261 | mkdir -p gcc/include |
---|
| 262 | cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h |
---|
| 263 | %endif |
---|
| 264 | |
---|
| 265 | make %{?_smp_mflags} all |
---|
| 266 | make info |
---|
| 267 | cd .. |
---|
| 268 | |
---|
| 269 | %install |
---|
| 270 | export PATH="%{_bindir}:${PATH}" |
---|
| 271 | rm -rf $RPM_BUILD_ROOT |
---|
| 272 | |
---|
| 273 | cd build |
---|
| 274 | |
---|
| 275 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
| 276 | cd .. |
---|
| 277 | |
---|
| 278 | cd build/mips-rtems4.10/newlib |
---|
| 279 | make DESTDIR=$RPM_BUILD_ROOT install-info |
---|
| 280 | cd ../../.. |
---|
| 281 | |
---|
| 282 | %if "%{gcc_version}" <= "4.1.2" |
---|
| 283 | # Misplaced header file |
---|
| 284 | if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then |
---|
| 285 | mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \ |
---|
| 286 | $RPM_BUILD_ROOT%{gcclib}/mips-rtems4.10/%{gcc_version}/include/ |
---|
| 287 | fi |
---|
| 288 | %endif |
---|
| 289 | |
---|
| 290 | # host library |
---|
| 291 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a |
---|
| 292 | |
---|
| 293 | # We use the version from binutils |
---|
| 294 | rm -f $RPM_BUILD_ROOT%{_bindir}/mips-rtems4.10-c++filt%{_exeext} |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | # We don't ship info/dir |
---|
| 298 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 299 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 300 | |
---|
| 301 | |
---|
| 302 | %if "%{gcc_version}" >= "3.4" |
---|
| 303 | # Bug in gcc-3.4.0pre |
---|
| 304 | rm -f $RPM_BUILD_ROOT%{_bindir}/mips-rtems4.10-mips-rtems4.10-gcjh%{_exeext} |
---|
| 305 | %endif |
---|
| 306 | |
---|
| 307 | %if "%{gcc_version}" >= "3.3" |
---|
| 308 | # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs |
---|
| 309 | # the fixinclude-install-tools |
---|
| 310 | rm -rf ${RPM_BUILD_ROOT}%{gcclib}/mips-rtems4.10/%{gcc_version}/install-tools |
---|
| 311 | rm -rf ${RPM_BUILD_ROOT}%{gccexec}/mips-rtems4.10/%{gcc_version}/install-tools |
---|
| 312 | %endif |
---|
| 313 | |
---|
[49a5e79] | 314 | # Bug in gcc > 4.1.0: Installs an unused, empty directory |
---|
| 315 | if test -d ${RPM_BUILD_ROOT}%{_prefix}/mips-rtems4.10/include/bits; then |
---|
| 316 | rmdir ${RPM_BUILD_ROOT}%{_prefix}/mips-rtems4.10/include/bits |
---|
| 317 | fi |
---|
| 318 | |
---|
[3f6e3fa] | 319 | # Collect multilib subdirectories |
---|
| 320 | f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
| 321 | |
---|
| 322 | echo "%defattr(-,root,root,-)" > build/files.newlib |
---|
| 323 | TGTDIR="%{_exec_prefix}/mips-rtems4.10/lib" |
---|
| 324 | for i in $f; do |
---|
| 325 | case $i in |
---|
| 326 | \.) echo "%dir ${TGTDIR}" >> build/files.newlib |
---|
| 327 | ;; |
---|
| 328 | *) echo "%dir ${TGTDIR}/$i" >> build/files.newlib |
---|
| 329 | ;; |
---|
| 330 | esac |
---|
| 331 | done |
---|
| 332 | |
---|
| 333 | rm -f dirs ; |
---|
| 334 | echo "%defattr(-,root,root,-)" >> dirs |
---|
| 335 | echo "%dir %{_prefix}" >> dirs |
---|
| 336 | echo "%dir %{_libdir}" >> dirs |
---|
| 337 | %if "%{gcc_version}" >= "3.4" |
---|
| 338 | echo "%dir %{_libexecdir}" >> dirs |
---|
| 339 | %endif |
---|
| 340 | echo "%dir %{gcclib}" >> dirs |
---|
| 341 | echo "%dir %{gcclib}/mips-rtems4.10" >> dirs |
---|
| 342 | |
---|
| 343 | TGTDIR="%{gcclib}/mips-rtems4.10/%{gcc_version}" |
---|
| 344 | for i in $f; do |
---|
| 345 | case $i in |
---|
| 346 | \.) echo "%dir ${TGTDIR}" >> dirs |
---|
| 347 | ;; |
---|
| 348 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
| 349 | ;; |
---|
| 350 | esac |
---|
| 351 | done |
---|
| 352 | |
---|
| 353 | # Collect files to go into different packages |
---|
| 354 | cp dirs build/files.gcc |
---|
| 355 | cp dirs build/files.g77 |
---|
| 356 | cp dirs build/files.gfortran |
---|
| 357 | cp dirs build/files.objc |
---|
| 358 | cp dirs build/files.gcj |
---|
| 359 | cp dirs build/files.g++ |
---|
| 360 | |
---|
| 361 | TGTDIR="%{gcclib}/mips-rtems4.10/%{gcc_version}" |
---|
| 362 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 363 | for i in $f; do |
---|
| 364 | case $i in |
---|
| 365 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
| 366 | *f771) ;; |
---|
| 367 | *f951) ;; |
---|
| 368 | *cc1) ;; |
---|
| 369 | *cc1obj) ;; |
---|
| 370 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
| 371 | *collect2) ;; |
---|
| 372 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
| 373 | *include/objc*) ;; |
---|
| 374 | *include/g++*);; |
---|
| 375 | *include/c++*);; |
---|
| 376 | *adainclude*);; |
---|
| 377 | *adalib*);; |
---|
| 378 | *gnat1);; |
---|
| 379 | *jc1) ;; |
---|
| 380 | *jvgenmain) ;; |
---|
| 381 | */libgfortran*.*) echo "$i" >> build/files.gfortran ;; |
---|
| 382 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 383 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 384 | *) echo "$i" >> build/files.gcc ;; |
---|
| 385 | esac |
---|
| 386 | done |
---|
| 387 | |
---|
| 388 | TGTDIR="%{_exec_prefix}/mips-rtems4.10/lib" |
---|
| 389 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 390 | for i in $f; do |
---|
| 391 | case $i in |
---|
| 392 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
| 393 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
| 394 | # all other files belong to newlib |
---|
| 395 | *) echo "$i" >> build/files.newlib ;; |
---|
| 396 | esac |
---|
| 397 | done |
---|
| 398 | # Extract %%__os_install_post into os_install_post~ |
---|
| 399 | cat << \EOF > os_install_post~ |
---|
| 400 | %__os_install_post |
---|
| 401 | EOF |
---|
| 402 | |
---|
| 403 | # Generate customized brp-*scripts |
---|
| 404 | cat os_install_post~ | while read a x y; do |
---|
| 405 | case $a in |
---|
| 406 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 407 | */brp-strip*) |
---|
| 408 | b=$(basename $a) |
---|
| 409 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 410 | chmod a+x $b |
---|
| 411 | ;; |
---|
| 412 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 413 | */brp-compress*) |
---|
| 414 | b=$(basename $a) |
---|
| 415 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 416 | chmod a+x $b |
---|
| 417 | ;; |
---|
| 418 | esac |
---|
| 419 | done |
---|
| 420 | |
---|
| 421 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 422 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 423 | < os_install_post~ > os_install_post |
---|
| 424 | %define __os_install_post . ./os_install_post |
---|
| 425 | |
---|
| 426 | |
---|
| 427 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 428 | #!/bin/sh |
---|
| 429 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/mips-rtems4.10/(lib|include|sys-root)' \ |
---|
| 430 | | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/mips-rtems4.10/' | %__find_provides |
---|
| 431 | EOF |
---|
| 432 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 433 | %define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 434 | |
---|
| 435 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 436 | #!/bin/sh |
---|
| 437 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/mips-rtems4.10/(lib|include|sys-root)' \ |
---|
| 438 | | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/mips-rtems4.10/' | %__find_requires |
---|
| 439 | EOF |
---|
| 440 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 441 | %define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 442 | |
---|
[f1322b47] | 443 | %ifnarch noarch |
---|
[05c66cf] | 444 | # Extract %%__debug_install_post into debug_install_post~ |
---|
| 445 | cat << \EOF > debug_install_post~ |
---|
| 446 | %__debug_install_post |
---|
| 447 | EOF |
---|
| 448 | |
---|
| 449 | # Generate customized debug_install_post script |
---|
| 450 | cat debug_install_post~ | while read a x y; do |
---|
| 451 | case $a in |
---|
| 452 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
| 453 | */find-debuginfo.sh) |
---|
| 454 | b=$(basename $a) |
---|
| 455 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
| 456 | chmod a+x $b |
---|
| 457 | ;; |
---|
| 458 | esac |
---|
| 459 | done |
---|
| 460 | |
---|
| 461 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
| 462 | < debug_install_post~ > debug_install_post |
---|
| 463 | %define __debug_install_post . ./debug_install_post |
---|
| 464 | |
---|
[f1322b47] | 465 | %endif |
---|
[05c66cf] | 466 | |
---|
[3f6e3fa] | 467 | %clean |
---|
| 468 | rm -rf $RPM_BUILD_ROOT |
---|
| 469 | |
---|
| 470 | # ============================================================== |
---|
| 471 | # rtems-4.10-mips-rtems4.10-gcc |
---|
| 472 | # ============================================================== |
---|
| 473 | # %package -n rtems-4.10-mips-rtems4.10-gcc |
---|
| 474 | # Summary: GNU cc compiler for mips-rtems4.10 |
---|
| 475 | # Group: Development/Tools |
---|
| 476 | # Version: %{gcc_rpmvers} |
---|
| 477 | # Requires: rtems-4.10-mips-rtems4.10-binutils |
---|
[1dc2a94] | 478 | # Requires: rtems-4.10-mips-rtems4.10-newlib = %{newlib_version}-38%{?dist} |
---|
[3f6e3fa] | 479 | # License: GPL |
---|
| 480 | |
---|
| 481 | # %if %build_infos |
---|
| 482 | # Requires: rtems-4.10-gcc-common |
---|
| 483 | # %endif |
---|
| 484 | |
---|
| 485 | %description -n rtems-4.10-mips-rtems4.10-gcc |
---|
| 486 | GNU cc compiler for mips-rtems4.10. |
---|
| 487 | |
---|
| 488 | %files -n rtems-4.10-mips-rtems4.10-gcc -f build/files.gcc |
---|
| 489 | %defattr(-,root,root) |
---|
| 490 | %dir %{_mandir} |
---|
| 491 | %dir %{_mandir}/man1 |
---|
| 492 | %{_mandir}/man1/mips-rtems4.10-gcc.1* |
---|
| 493 | %if "%{gcc_version}" >= "3.4" |
---|
| 494 | %{_mandir}/man1/mips-rtems4.10-cpp.1* |
---|
| 495 | %{_mandir}/man1/mips-rtems4.10-gcov.1* |
---|
| 496 | %endif |
---|
| 497 | |
---|
| 498 | %dir %{_bindir} |
---|
| 499 | %{_bindir}/mips-rtems4.10-cpp%{_exeext} |
---|
| 500 | %{_bindir}/mips-rtems4.10-gcc%{_exeext} |
---|
| 501 | %if "%{gcc_version}" >= "3.3" |
---|
| 502 | %{_bindir}/mips-rtems4.10-gcc-%{gcc_version}%{_exeext} |
---|
| 503 | %endif |
---|
| 504 | %{_bindir}/mips-rtems4.10-gcov%{_exeext} |
---|
| 505 | %{_bindir}/mips-rtems4.10-gccbug |
---|
| 506 | |
---|
| 507 | %dir %{gcclib}/mips-rtems4.10/%{gcc_version}/include |
---|
| 508 | %if "%{gcc_version}" > "4.0.3" |
---|
| 509 | %if "mips-rtems4.10" != "bfin-rtems4.10" |
---|
| 510 | %if "mips-rtems4.10" != "avr-rtems4.10" |
---|
| 511 | %dir %{gcclib}/mips-rtems4.10/%{gcc_version}/include/ssp |
---|
| 512 | %endif |
---|
| 513 | %endif |
---|
| 514 | %endif |
---|
| 515 | |
---|
[719a5c7] | 516 | %if "%{gcc_version}" >= "4.3.0" |
---|
| 517 | %dir %{gcclib}/mips-rtems4.10/%{gcc_version}/include-fixed |
---|
| 518 | %endif |
---|
| 519 | |
---|
[3f6e3fa] | 520 | %dir %{gccexec} |
---|
| 521 | %dir %{gccexec}/mips-rtems4.10 |
---|
| 522 | %dir %{gccexec}/mips-rtems4.10/%{gcc_version} |
---|
| 523 | %{gccexec}/mips-rtems4.10/%{gcc_version}/cc1%{_exeext} |
---|
| 524 | %{gccexec}/mips-rtems4.10/%{gcc_version}/collect2%{_exeext} |
---|
| 525 | |
---|
| 526 | # ============================================================== |
---|
| 527 | # rtems-4.10-gcc-common |
---|
| 528 | # ============================================================== |
---|
| 529 | %package -n rtems-4.10-gcc-common |
---|
| 530 | Summary: Base package for rtems gcc and newlib C Library |
---|
| 531 | Group: Development/Tools |
---|
| 532 | Version: %{gcc_rpmvers} |
---|
| 533 | License: GPL |
---|
| 534 | |
---|
| 535 | Requires(post): /sbin/install-info |
---|
| 536 | Requires(preun): /sbin/install-info |
---|
| 537 | |
---|
| 538 | %description -n rtems-4.10-gcc-common |
---|
| 539 | GCC files that are shared by all targets. |
---|
| 540 | |
---|
| 541 | %files -n rtems-4.10-gcc-common |
---|
| 542 | %defattr(-,root,root) |
---|
| 543 | %dir %{_infodir} |
---|
| 544 | %ghost %{_infodir}/dir |
---|
| 545 | %{_infodir}/cpp.info* |
---|
| 546 | %{_infodir}/cppinternals.info* |
---|
| 547 | %{_infodir}/gcc.info* |
---|
| 548 | %{_infodir}/gccint.info* |
---|
| 549 | %if "%{gcc_version}" >= "3.4" |
---|
| 550 | %{_infodir}/gccinstall.info* |
---|
| 551 | %endif |
---|
| 552 | |
---|
| 553 | %dir %{_mandir} |
---|
| 554 | %if "%{gcc_version}" < "3.4" |
---|
| 555 | %dir %{_mandir}/man1 |
---|
| 556 | %{_mandir}/man1/cpp.1* |
---|
| 557 | %{_mandir}/man1/gcov.1* |
---|
| 558 | %endif |
---|
| 559 | %dir %{_mandir}/man7 |
---|
| 560 | %{_mandir}/man7/fsf-funding.7* |
---|
| 561 | %{_mandir}/man7/gfdl.7* |
---|
| 562 | %{_mandir}/man7/gpl.7* |
---|
| 563 | |
---|
| 564 | %post -n rtems-4.10-gcc-common |
---|
| 565 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || : |
---|
| 566 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || : |
---|
| 567 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || : |
---|
| 568 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || : |
---|
| 569 | %if "%{gcc_version}" >= "3.4" |
---|
| 570 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || : |
---|
| 571 | %endif |
---|
| 572 | |
---|
| 573 | %preun -n rtems-4.10-gcc-common |
---|
| 574 | if [ $1 -eq 0 ]; then |
---|
| 575 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || : |
---|
| 576 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || : |
---|
| 577 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || : |
---|
| 578 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || : |
---|
| 579 | %if "%{gcc_version}" >= "3.4" |
---|
| 580 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || : |
---|
| 581 | %endif |
---|
| 582 | fi |
---|
| 583 | |
---|
| 584 | # ============================================================== |
---|
| 585 | # rtems-4.10-mips-rtems4.10-gcc-c++ |
---|
| 586 | # ============================================================== |
---|
| 587 | %package -n rtems-4.10-mips-rtems4.10-gcc-c++ |
---|
| 588 | Summary: GCC c++ compiler for mips-rtems4.10 |
---|
| 589 | Group: Development/Tools |
---|
| 590 | Version: %{gcc_rpmvers} |
---|
| 591 | License: GPL |
---|
| 592 | |
---|
| 593 | %if "%{_build}" != "%{_host}" |
---|
[35381baa] | 594 | BuildRequires: rtems-4.10-mips-rtems4.10-gcc-c++ = %{gcc_rpmvers} |
---|
[3f6e3fa] | 595 | %endif |
---|
| 596 | Provides: rtems-4.10-mips-rtems4.10-c++ = %{gcc_rpmvers}-%{release} |
---|
| 597 | Obsoletes: rtems-4.10-mips-rtems4.10-c++ < %{gcc_rpmvers}-%{release} |
---|
| 598 | |
---|
| 599 | Requires: rtems-4.10-gcc-common |
---|
| 600 | Requires: rtems-4.10-mips-rtems4.10-gcc = %{gcc_rpmvers}-%{release} |
---|
| 601 | |
---|
| 602 | %description -n rtems-4.10-mips-rtems4.10-gcc-c++ |
---|
| 603 | GCC c++ compiler for mips-rtems4.10. |
---|
| 604 | |
---|
| 605 | %files -n rtems-4.10-mips-rtems4.10-gcc-c++ -f build/files.g++ |
---|
| 606 | %defattr(-,root,root) |
---|
| 607 | %{_mandir}/man1/mips-rtems4.10-g++.1* |
---|
| 608 | |
---|
| 609 | %{_bindir}/mips-rtems4.10-c++%{_exeext} |
---|
| 610 | %{_bindir}/mips-rtems4.10-g++%{_exeext} |
---|
| 611 | |
---|
| 612 | %dir %{gccexec} |
---|
| 613 | %dir %{gccexec}/mips-rtems4.10 |
---|
| 614 | %dir %{gccexec}/mips-rtems4.10/%{gcc_version} |
---|
| 615 | %{gccexec}/mips-rtems4.10/%{gcc_version}/cc1plus%{_exeext} |
---|
| 616 | |
---|
| 617 | %dir %{gcclib}/mips-rtems4.10/%{gcc_version}/include |
---|
| 618 | %{gcclib}/mips-rtems4.10/%{gcc_version}/include/c++ |
---|
| 619 | |
---|
| 620 | |
---|
| 621 | |
---|
| 622 | # ============================================================== |
---|
| 623 | # rtems-4.10-mips-rtems4.10-newlib |
---|
| 624 | # ============================================================== |
---|
| 625 | %package -n rtems-4.10-mips-rtems4.10-newlib |
---|
| 626 | Summary: C Library (newlib) for mips-rtems4.10 |
---|
| 627 | Group: Development/Tools |
---|
| 628 | License: Distributable |
---|
| 629 | Version: %{newlib_version} |
---|
[1dc2a94] | 630 | Release: 38%{?dist} |
---|
[3f6e3fa] | 631 | |
---|
| 632 | Requires: rtems-4.10-newlib-common |
---|
| 633 | |
---|
| 634 | %description -n rtems-4.10-mips-rtems4.10-newlib |
---|
| 635 | Newlib C Library for mips-rtems4.10. |
---|
| 636 | |
---|
| 637 | %files -n rtems-4.10-mips-rtems4.10-newlib -f build/files.newlib |
---|
| 638 | %defattr(-,root,root) |
---|
| 639 | %dir %{_prefix} |
---|
| 640 | %dir %{_exec_prefix}/mips-rtems4.10 |
---|
| 641 | %{_exec_prefix}/mips-rtems4.10/include |
---|
| 642 | |
---|
| 643 | # ============================================================== |
---|
| 644 | # rtems-4.10-newlib-common |
---|
| 645 | # ============================================================== |
---|
| 646 | %package -n rtems-4.10-newlib-common |
---|
| 647 | Summary: Base package for RTEMS newlib C Library |
---|
| 648 | Group: Development/Tools |
---|
| 649 | Version: %{newlib_version} |
---|
[1dc2a94] | 650 | Release: 38%{?dist} |
---|
[3f6e3fa] | 651 | License: Distributable |
---|
| 652 | |
---|
| 653 | Requires(post): /sbin/install-info |
---|
| 654 | Requires(preun): /sbin/install-info |
---|
| 655 | |
---|
| 656 | %description -n rtems-4.10-newlib-common |
---|
| 657 | newlib files that are shared by all targets. |
---|
| 658 | |
---|
| 659 | %files -n rtems-4.10-newlib-common |
---|
| 660 | %defattr(-,root,root) |
---|
| 661 | %dir %{_infodir} |
---|
| 662 | %ghost %{_infodir}/dir |
---|
| 663 | %{_infodir}/libc.info* |
---|
| 664 | %{_infodir}/libm.info* |
---|
| 665 | |
---|
| 666 | %post -n rtems-4.10-newlib-common |
---|
| 667 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libc.info.gz || : |
---|
| 668 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libm.info.gz || : |
---|
| 669 | |
---|
| 670 | %preun -n rtems-4.10-newlib-common |
---|
| 671 | if [ $1 -eq 0 ]; then |
---|
| 672 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz || : |
---|
| 673 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libm.info.gz || : |
---|
| 674 | fi |
---|
| 675 | |
---|