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