[2abe16dd] | 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 |
---|
[2abe16dd] | 21 | |
---|
| 22 | %ifos cygwin cygwin32 mingw mingw32 |
---|
| 23 | %define _exeext .exe |
---|
[35381baa] | 24 | %define debug_package %{nil} |
---|
| 25 | %define _libdir %{_exec_prefix}/lib |
---|
[2abe16dd] | 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 |
---|
[2abe16dd] | 40 | %endif |
---|
| 41 | |
---|
| 42 | %if "%{_build}" != "%{_host}" |
---|
[6d3f0321] | 43 | %define _host_rpmprefix %{_host}- |
---|
[2abe16dd] | 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 - _ )} |
---|
[2abe16dd] | 52 | |
---|
[86bde6f] | 53 | %define newlib_pkgvers 1.18.0 |
---|
| 54 | %define newlib_version 1.18.0 |
---|
[2abe16dd] | 55 | |
---|
| 56 | Name: rtems-4.10-m32c-rtems4.10-gcc |
---|
| 57 | Summary: m32c-rtems4.10 gcc |
---|
| 58 | |
---|
| 59 | Group: Development/Tools |
---|
| 60 | Version: %{gcc_rpmvers} |
---|
[a2f4fc1] | 61 | Release: 6%{?dist} |
---|
[2abe16dd] | 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} |
---|
[2abe16dd] | 79 | %if "%{_build}" != "%{_host}" |
---|
[5faedff] | 80 | BuildRequires: %{_host_rpmprefix}gmp-devel >= %{_gmp_minvers} |
---|
[2abe16dd] | 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 | |
---|
[2abe16dd] | 134 | %endif |
---|
| 135 | |
---|
| 136 | %if "%{_build}" != "%{_host}" |
---|
[35381baa] | 137 | BuildRequires: rtems-4.10-m32c-rtems4.10-gcc = %{gcc_rpmvers} |
---|
[2abe16dd] | 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-m32c-rtems4.10-binutils |
---|
| 147 | |
---|
[e1b4795] | 148 | Requires: rtems-4.10-gcc-common |
---|
[2abe16dd] | 149 | Requires: rtems-4.10-m32c-rtems4.10-binutils |
---|
[016c9ea] | 150 | Requires: rtems-4.10-m32c-rtems4.10-gcc-libgcc = %{gcc_rpmvers}-%{release} |
---|
[a2f4fc1] | 151 | Requires: rtems-4.10-m32c-rtems4.10-newlib = %{newlib_version}-7%{?dist} |
---|
[2abe16dd] | 152 | |
---|
| 153 | |
---|
[cdc1b123] | 154 | %define _gcclibdir %{_prefix}/lib |
---|
[2abe16dd] | 155 | |
---|
[d40d7cd4] | 156 | %if "%{gcc_version}" == "4.4.3" |
---|
[dc94d043] | 157 | Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_pkgvers}/gcc-core-%{gcc_pkgvers}.tar.bz2 |
---|
| 158 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.4.3-rtems4.10-20100210.diff |
---|
[d40d7cd4] | 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 |
---|
[dc94d043] | 162 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gcc-core-4.4.2-rtems4.10-20091104.diff |
---|
[c5575c9] | 163 | %endif |
---|
[2abe16dd] | 164 | %{?_without_sources:NoSource: 0} |
---|
| 165 | |
---|
[86bde6f] | 166 | %if "%{newlib_version}" == "1.18.0" |
---|
| 167 | Source50: ftp://sources.redhat.com/pub/newlib/newlib-%{newlib_pkgvers}.tar.gz |
---|
[a2f4fc1] | 168 | Patch50: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/newlib-1.18.0-rtems4.10-20100310.diff |
---|
[86bde6f] | 169 | %endif |
---|
[2abe16dd] | 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 m32c-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 | |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | %setup -q -T -D -n %{name}-%{version} -a50 |
---|
| 191 | cd newlib-%{newlib_version} |
---|
| 192 | %{?PATCH50:%patch50 -p1} |
---|
| 193 | cd .. |
---|
| 194 | # Copy the C library into gcc's source tree |
---|
| 195 | ln -s ../newlib-%{newlib_version}/newlib gcc-%{gcc_pkgvers} |
---|
| 196 | |
---|
| 197 | %if 0%{?_build_mpfr} |
---|
| 198 | %setup -q -T -D -n %{name}-%{version} -a60 |
---|
| 199 | %{?PATCH60:%patch60 -p1} |
---|
| 200 | # Build mpfr one-tree style |
---|
| 201 | ln -s ../mpfr-%{mpfr_version} gcc-%{gcc_pkgvers}/mpfr |
---|
| 202 | %endif |
---|
| 203 | |
---|
[a2f4fc1] | 204 | echo "RTEMS gcc-%{gcc_version}-6%{?dist}/newlib-%{newlib_version}-7%{?dist}" > gcc-%{gcc_pkgvers}/gcc/DEV-PHASE |
---|
[2abe16dd] | 205 | |
---|
| 206 | |
---|
| 207 | # Fix timestamps |
---|
| 208 | cd gcc-%{gcc_pkgvers} |
---|
| 209 | contrib/gcc_update --touch |
---|
| 210 | cd .. |
---|
| 211 | %build |
---|
| 212 | mkdir -p build |
---|
| 213 | |
---|
| 214 | cd build |
---|
| 215 | |
---|
| 216 | languages="c" |
---|
| 217 | export PATH="%{_bindir}:${PATH}" |
---|
| 218 | %if "%{_build}" != "%{_host}" |
---|
| 219 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
| 220 | CC="%{_host}-gcc ${RPM_OPT_FLAGS}" \ |
---|
| 221 | %else |
---|
[05c66cf] | 222 | # gcc is not ready to be compiled with -std=gnu99 |
---|
| 223 | CC=$(echo "%{__cc} ${RPM_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \ |
---|
[2abe16dd] | 224 | %endif |
---|
| 225 | ../gcc-%{gcc_pkgvers}/configure \ |
---|
| 226 | --prefix=%{_prefix} \ |
---|
| 227 | --bindir=%{_bindir} \ |
---|
| 228 | --exec_prefix=%{_exec_prefix} \ |
---|
| 229 | --includedir=%{_includedir} \ |
---|
[cdc1b123] | 230 | --libdir=%{_gcclibdir} \ |
---|
[2abe16dd] | 231 | --libexecdir=%{_libexecdir} \ |
---|
| 232 | --mandir=%{_mandir} \ |
---|
| 233 | --infodir=%{_infodir} \ |
---|
| 234 | --datadir=%{_datadir} \ |
---|
| 235 | --build=%_build --host=%_host \ |
---|
| 236 | --target=m32c-rtems4.10 \ |
---|
| 237 | --disable-libstdcxx-pch \ |
---|
| 238 | --with-gnu-as --with-gnu-ld --verbose \ |
---|
| 239 | --with-newlib \ |
---|
| 240 | --with-system-zlib \ |
---|
| 241 | --disable-nls --without-included-gettext \ |
---|
| 242 | --disable-win32-registry \ |
---|
| 243 | --enable-version-specific-runtime-libs \ |
---|
| 244 | --enable-threads \ |
---|
| 245 | --enable-newlib-io-c99-formats \ |
---|
| 246 | --enable-languages="$languages" $optargs |
---|
| 247 | |
---|
| 248 | %if "%_host" != "%_build" |
---|
| 249 | # Bug in gcc-3.2.1: |
---|
| 250 | # Somehow, gcc doesn't get syslimits.h right for Cdn-Xs |
---|
| 251 | mkdir -p gcc/include |
---|
| 252 | cp ../gcc-%{gcc_pkgvers}/gcc/gsyslimits.h gcc/include/syslimits.h |
---|
| 253 | %endif |
---|
| 254 | |
---|
| 255 | make %{?_smp_mflags} all |
---|
[e1b4795] | 256 | make info |
---|
[2abe16dd] | 257 | cd .. |
---|
| 258 | |
---|
| 259 | %install |
---|
| 260 | export PATH="%{_bindir}:${PATH}" |
---|
| 261 | rm -rf $RPM_BUILD_ROOT |
---|
| 262 | |
---|
| 263 | cd build |
---|
| 264 | |
---|
| 265 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
| 266 | cd .. |
---|
| 267 | |
---|
| 268 | cd build/m32c-rtems4.10/newlib |
---|
| 269 | make DESTDIR=$RPM_BUILD_ROOT install-info |
---|
| 270 | cd ../../.. |
---|
| 271 | |
---|
| 272 | %if "%{gcc_version}" <= "4.1.2" |
---|
| 273 | # Misplaced header file |
---|
| 274 | if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then |
---|
| 275 | mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \ |
---|
[cdc1b123] | 276 | $RPM_BUILD_ROOT%{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}/include/ |
---|
[2abe16dd] | 277 | fi |
---|
| 278 | %endif |
---|
| 279 | |
---|
| 280 | # host library |
---|
[cdc1b123] | 281 | %if "%{gcc_version}" >= "4.2.0" |
---|
| 282 | # libiberty doesn't honor --libdir, but always installs to a |
---|
| 283 | # magically guessed _libdir |
---|
[2abe16dd] | 284 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a |
---|
[cdc1b123] | 285 | %else |
---|
| 286 | # libiberty installs to --libdir=... |
---|
| 287 | rm -f ${RPM_BUILD_ROOT}%{_gcclibdir}/libiberty.a |
---|
| 288 | %endif |
---|
[2abe16dd] | 289 | |
---|
| 290 | # We use the version from binutils |
---|
| 291 | rm -f $RPM_BUILD_ROOT%{_bindir}/m32c-rtems4.10-c++filt%{_exeext} |
---|
| 292 | |
---|
| 293 | |
---|
[e1b4795] | 294 | # We don't ship info/dir |
---|
| 295 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 296 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
[2abe16dd] | 297 | |
---|
| 298 | # Bug in gcc-3.4.0pre |
---|
| 299 | rm -f $RPM_BUILD_ROOT%{_bindir}/m32c-rtems4.10-m32c-rtems4.10-gcjh%{_exeext} |
---|
| 300 | |
---|
| 301 | # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs |
---|
| 302 | # the fixinclude-install-tools |
---|
[cdc1b123] | 303 | rm -rf ${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}/install-tools |
---|
| 304 | rm -rf ${RPM_BUILD_ROOT}%{_libexecdir}/gcc/m32c-rtems4.10/%{gcc_version}/install-tools |
---|
[2abe16dd] | 305 | |
---|
[241a259d] | 306 | # Bug in gcc > 4.1.0: Installs an unused, empty directory |
---|
| 307 | if test -d ${RPM_BUILD_ROOT}%{_prefix}/m32c-rtems4.10/include/bits; then |
---|
| 308 | rmdir ${RPM_BUILD_ROOT}%{_prefix}/m32c-rtems4.10/include/bits |
---|
| 309 | fi |
---|
[49a5e79] | 310 | |
---|
[2abe16dd] | 311 | # Collect multilib subdirectories |
---|
[016c9ea] | 312 | multilibs=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
[2abe16dd] | 313 | |
---|
| 314 | echo "%defattr(-,root,root,-)" > build/files.newlib |
---|
| 315 | TGTDIR="%{_exec_prefix}/m32c-rtems4.10/lib" |
---|
[016c9ea] | 316 | for i in $multilibs; do |
---|
[2abe16dd] | 317 | case $i in |
---|
| 318 | \.) echo "%dir ${TGTDIR}" >> build/files.newlib |
---|
| 319 | ;; |
---|
| 320 | *) echo "%dir ${TGTDIR}/$i" >> build/files.newlib |
---|
| 321 | ;; |
---|
| 322 | esac |
---|
| 323 | done |
---|
| 324 | |
---|
| 325 | rm -f dirs ; |
---|
| 326 | echo "%defattr(-,root,root,-)" >> dirs |
---|
[cdc1b123] | 327 | TGTDIR="%{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}" |
---|
[016c9ea] | 328 | for i in $multilibs; do |
---|
[2abe16dd] | 329 | case $i in |
---|
[86c6f95b] | 330 | \.) ;; # ignore, handled elsewhere |
---|
[2abe16dd] | 331 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
| 332 | ;; |
---|
| 333 | esac |
---|
| 334 | done |
---|
| 335 | |
---|
| 336 | # Collect files to go into different packages |
---|
| 337 | cp dirs build/files.gcc |
---|
| 338 | cp dirs build/files.gfortran |
---|
| 339 | cp dirs build/files.objc |
---|
| 340 | cp dirs build/files.gcj |
---|
| 341 | cp dirs build/files.g++ |
---|
| 342 | |
---|
[cdc1b123] | 343 | TGTDIR="%{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}" |
---|
[2abe16dd] | 344 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 345 | for i in $f; do |
---|
| 346 | case $i in |
---|
| 347 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
| 348 | *f771) ;; |
---|
| 349 | *f951) ;; |
---|
| 350 | *cc1) ;; |
---|
| 351 | *cc1obj) ;; |
---|
| 352 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
| 353 | *collect2) ;; |
---|
| 354 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
| 355 | *include/objc*) ;; |
---|
| 356 | *include/g++*);; |
---|
| 357 | *include/c++*);; |
---|
[016c9ea] | 358 | *include-fixed/*);; |
---|
[cdc1b123] | 359 | *finclude/*);; |
---|
[2abe16dd] | 360 | *adainclude*);; |
---|
| 361 | *adalib*);; |
---|
| 362 | *gnat1);; |
---|
| 363 | *jc1) ;; |
---|
| 364 | *jvgenmain) ;; |
---|
| 365 | */libgfortran*.*) echo "$i" >> build/files.gfortran ;; |
---|
| 366 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 367 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 368 | *) echo "$i" >> build/files.gcc ;; |
---|
| 369 | esac |
---|
| 370 | done |
---|
| 371 | |
---|
| 372 | TGTDIR="%{_exec_prefix}/m32c-rtems4.10/lib" |
---|
| 373 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 374 | for i in $f; do |
---|
| 375 | case $i in |
---|
| 376 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
| 377 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
| 378 | # all other files belong to newlib |
---|
| 379 | *) echo "$i" >> build/files.newlib ;; |
---|
| 380 | esac |
---|
| 381 | done |
---|
| 382 | # Extract %%__os_install_post into os_install_post~ |
---|
| 383 | cat << \EOF > os_install_post~ |
---|
| 384 | %__os_install_post |
---|
| 385 | EOF |
---|
| 386 | |
---|
| 387 | # Generate customized brp-*scripts |
---|
| 388 | cat os_install_post~ | while read a x y; do |
---|
| 389 | case $a in |
---|
| 390 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 391 | */brp-strip*) |
---|
| 392 | b=$(basename $a) |
---|
| 393 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 394 | chmod a+x $b |
---|
| 395 | ;; |
---|
| 396 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 397 | */brp-compress*) |
---|
| 398 | b=$(basename $a) |
---|
| 399 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 400 | chmod a+x $b |
---|
| 401 | ;; |
---|
| 402 | esac |
---|
| 403 | done |
---|
| 404 | |
---|
| 405 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 406 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 407 | < os_install_post~ > os_install_post |
---|
| 408 | %define __os_install_post . ./os_install_post |
---|
| 409 | |
---|
| 410 | |
---|
| 411 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 412 | #!/bin/sh |
---|
| 413 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32c-rtems4.10/(lib|include|sys-root)' \ |
---|
[cdc1b123] | 414 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32c-rtems4.10/'} | %__find_provides |
---|
[2abe16dd] | 415 | EOF |
---|
| 416 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 417 | %define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 418 | |
---|
| 419 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 420 | #!/bin/sh |
---|
| 421 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/m32c-rtems4.10/(lib|include|sys-root)' \ |
---|
[cdc1b123] | 422 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/m32c-rtems4.10/'} | %__find_requires |
---|
[2abe16dd] | 423 | EOF |
---|
| 424 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 425 | %define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 426 | |
---|
[f1322b47] | 427 | %ifnarch noarch |
---|
[05c66cf] | 428 | # Extract %%__debug_install_post into debug_install_post~ |
---|
| 429 | cat << \EOF > debug_install_post~ |
---|
| 430 | %__debug_install_post |
---|
| 431 | EOF |
---|
| 432 | |
---|
| 433 | # Generate customized debug_install_post script |
---|
| 434 | cat debug_install_post~ | while read a x y; do |
---|
| 435 | case $a in |
---|
| 436 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
| 437 | */find-debuginfo.sh) |
---|
| 438 | b=$(basename $a) |
---|
| 439 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
| 440 | chmod a+x $b |
---|
| 441 | ;; |
---|
| 442 | esac |
---|
| 443 | done |
---|
| 444 | |
---|
| 445 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
| 446 | < debug_install_post~ > debug_install_post |
---|
| 447 | %define __debug_install_post . ./debug_install_post |
---|
| 448 | |
---|
[f1322b47] | 449 | %endif |
---|
[05c66cf] | 450 | |
---|
[2abe16dd] | 451 | %clean |
---|
| 452 | rm -rf $RPM_BUILD_ROOT |
---|
| 453 | |
---|
| 454 | # ============================================================== |
---|
| 455 | # rtems-4.10-m32c-rtems4.10-gcc |
---|
| 456 | # ============================================================== |
---|
| 457 | # %package -n rtems-4.10-m32c-rtems4.10-gcc |
---|
| 458 | # Summary: GNU cc compiler for m32c-rtems4.10 |
---|
| 459 | # Group: Development/Tools |
---|
| 460 | # Version: %{gcc_rpmvers} |
---|
| 461 | # Requires: rtems-4.10-m32c-rtems4.10-binutils |
---|
[a2f4fc1] | 462 | # Requires: rtems-4.10-m32c-rtems4.10-newlib = %{newlib_version}-7%{?dist} |
---|
[2abe16dd] | 463 | # License: GPL |
---|
| 464 | |
---|
| 465 | # %if %build_infos |
---|
| 466 | # Requires: rtems-4.10-gcc-common |
---|
| 467 | # %endif |
---|
| 468 | |
---|
| 469 | %description -n rtems-4.10-m32c-rtems4.10-gcc |
---|
| 470 | GNU cc compiler for m32c-rtems4.10. |
---|
| 471 | |
---|
[016c9ea] | 472 | # ============================================================== |
---|
| 473 | # rtems-4.10-m32c-rtems4.10-gcc-libgcc |
---|
| 474 | # ============================================================== |
---|
| 475 | %package -n rtems-4.10-m32c-rtems4.10-gcc-libgcc |
---|
| 476 | Summary: libgcc for m32c-rtems4.10-gcc |
---|
| 477 | Group: Development/Tools |
---|
| 478 | Version: %{gcc_rpmvers} |
---|
| 479 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
[a2f4fc1] | 480 | Requires: rtems-4.10-m32c-rtems4.10-newlib = %{newlib_version}-7%{?dist} |
---|
[016c9ea] | 481 | License: GPL |
---|
| 482 | |
---|
| 483 | %description -n rtems-4.10-m32c-rtems4.10-gcc-libgcc |
---|
| 484 | libgcc m32c-rtems4.10-gcc. |
---|
| 485 | |
---|
| 486 | |
---|
| 487 | %files -n rtems-4.10-m32c-rtems4.10-gcc |
---|
[2abe16dd] | 488 | %defattr(-,root,root) |
---|
[016c9ea] | 489 | %dir %{_prefix} |
---|
| 490 | |
---|
[2abe16dd] | 491 | %dir %{_mandir} |
---|
| 492 | %dir %{_mandir}/man1 |
---|
| 493 | %{_mandir}/man1/m32c-rtems4.10-gcc.1* |
---|
| 494 | %{_mandir}/man1/m32c-rtems4.10-cpp.1* |
---|
| 495 | %{_mandir}/man1/m32c-rtems4.10-gcov.1* |
---|
| 496 | |
---|
| 497 | %dir %{_bindir} |
---|
| 498 | %{_bindir}/m32c-rtems4.10-cpp%{_exeext} |
---|
| 499 | %{_bindir}/m32c-rtems4.10-gcc%{_exeext} |
---|
| 500 | %{_bindir}/m32c-rtems4.10-gcc-%{gcc_version}%{_exeext} |
---|
| 501 | %{_bindir}/m32c-rtems4.10-gcov%{_exeext} |
---|
| 502 | %{_bindir}/m32c-rtems4.10-gccbug |
---|
| 503 | |
---|
[016c9ea] | 504 | %dir %{_libexecdir} |
---|
| 505 | %dir %{_libexecdir}/gcc |
---|
| 506 | %dir %{_libexecdir}/gcc/m32c-rtems4.10 |
---|
| 507 | %dir %{_libexecdir}/gcc/m32c-rtems4.10/%{gcc_version} |
---|
| 508 | %{_libexecdir}/gcc/m32c-rtems4.10/%{gcc_version}/cc1%{_exeext} |
---|
| 509 | %{_libexecdir}/gcc/m32c-rtems4.10/%{gcc_version}/collect2%{_exeext} |
---|
| 510 | |
---|
| 511 | |
---|
| 512 | %files -n rtems-4.10-m32c-rtems4.10-gcc-libgcc -f build/files.gcc |
---|
| 513 | %defattr(-,root,root) |
---|
| 514 | %dir %{_prefix} |
---|
| 515 | %dir %{_gcclibdir} |
---|
| 516 | %dir %{_gcclibdir}/gcc |
---|
| 517 | %dir %{_gcclibdir}/gcc/m32c-rtems4.10 |
---|
| 518 | %dir %{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version} |
---|
[cdc1b123] | 519 | %dir %{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}/include |
---|
[016c9ea] | 520 | |
---|
[2abe16dd] | 521 | %if "%{gcc_version}" > "4.0.3" |
---|
| 522 | %if "m32c-rtems4.10" != "bfin-rtems4.10" |
---|
| 523 | %if "m32c-rtems4.10" != "avr-rtems4.10" |
---|
[cdc1b123] | 524 | %dir %{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}/include/ssp |
---|
[2abe16dd] | 525 | %endif |
---|
| 526 | %endif |
---|
| 527 | %endif |
---|
| 528 | |
---|
[719a5c7] | 529 | %if "%{gcc_version}" >= "4.3.0" |
---|
[016c9ea] | 530 | %{_gcclibdir}/gcc/m32c-rtems4.10/%{gcc_version}/include-fixed |
---|
[719a5c7] | 531 | %endif |
---|
| 532 | |
---|
[e1b4795] | 533 | # ============================================================== |
---|
| 534 | # rtems-4.10-gcc-common |
---|
| 535 | # ============================================================== |
---|
| 536 | %package -n rtems-4.10-gcc-common |
---|
| 537 | Summary: Base package for rtems gcc and newlib C Library |
---|
| 538 | Group: Development/Tools |
---|
| 539 | Version: %{gcc_rpmvers} |
---|
| 540 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
| 541 | License: GPL |
---|
| 542 | |
---|
| 543 | Requires(post): /sbin/install-info |
---|
| 544 | Requires(preun): /sbin/install-info |
---|
| 545 | |
---|
| 546 | %description -n rtems-4.10-gcc-common |
---|
| 547 | GCC files that are shared by all targets. |
---|
| 548 | |
---|
| 549 | %files -n rtems-4.10-gcc-common |
---|
| 550 | %defattr(-,root,root) |
---|
| 551 | %dir %{_prefix} |
---|
| 552 | %dir %{_prefix}/share |
---|
| 553 | |
---|
| 554 | %dir %{_infodir} |
---|
| 555 | %ghost %{_infodir}/dir |
---|
| 556 | %{_infodir}/cpp.info* |
---|
| 557 | %{_infodir}/cppinternals.info* |
---|
| 558 | %{_infodir}/gcc.info* |
---|
| 559 | %{_infodir}/gccint.info* |
---|
| 560 | %{_infodir}/gccinstall.info* |
---|
| 561 | |
---|
| 562 | %dir %{_mandir} |
---|
| 563 | %dir %{_mandir}/man7 |
---|
| 564 | %{_mandir}/man7/fsf-funding.7* |
---|
| 565 | %{_mandir}/man7/gfdl.7* |
---|
| 566 | %{_mandir}/man7/gpl.7* |
---|
| 567 | |
---|
| 568 | %post -n rtems-4.10-gcc-common |
---|
| 569 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || : |
---|
| 570 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || : |
---|
| 571 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || : |
---|
| 572 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || : |
---|
| 573 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || : |
---|
| 574 | |
---|
| 575 | %preun -n rtems-4.10-gcc-common |
---|
| 576 | if [ $1 -eq 0 ]; then |
---|
| 577 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cpp.info.gz || : |
---|
| 578 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/cppinternals.info.gz || : |
---|
| 579 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gcc.info.gz || : |
---|
| 580 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccint.info.gz || : |
---|
| 581 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gccinstall.info.gz || : |
---|
| 582 | fi |
---|
| 583 | |
---|
[2abe16dd] | 584 | |
---|
| 585 | |
---|
| 586 | |
---|
| 587 | # ============================================================== |
---|
| 588 | # rtems-4.10-m32c-rtems4.10-newlib |
---|
| 589 | # ============================================================== |
---|
| 590 | %package -n rtems-4.10-m32c-rtems4.10-newlib |
---|
| 591 | Summary: C Library (newlib) for m32c-rtems4.10 |
---|
| 592 | Group: Development/Tools |
---|
| 593 | License: Distributable |
---|
| 594 | Version: %{newlib_version} |
---|
[a2f4fc1] | 595 | Release: 7%{?dist} |
---|
[016c9ea] | 596 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
[2abe16dd] | 597 | |
---|
[e1b4795] | 598 | Requires: rtems-4.10-newlib-common |
---|
[2abe16dd] | 599 | |
---|
| 600 | %description -n rtems-4.10-m32c-rtems4.10-newlib |
---|
| 601 | Newlib C Library for m32c-rtems4.10. |
---|
| 602 | |
---|
| 603 | %files -n rtems-4.10-m32c-rtems4.10-newlib -f build/files.newlib |
---|
| 604 | %defattr(-,root,root) |
---|
[016c9ea] | 605 | %dir %{_exec_prefix} |
---|
[2abe16dd] | 606 | %dir %{_exec_prefix}/m32c-rtems4.10 |
---|
| 607 | %{_exec_prefix}/m32c-rtems4.10/include |
---|
| 608 | |
---|
[e1b4795] | 609 | # ============================================================== |
---|
| 610 | # rtems-4.10-newlib-common |
---|
| 611 | # ============================================================== |
---|
| 612 | %package -n rtems-4.10-newlib-common |
---|
| 613 | Summary: Base package for RTEMS newlib C Library |
---|
| 614 | Group: Development/Tools |
---|
| 615 | Version: %{newlib_version} |
---|
[a2f4fc1] | 616 | Release: 7%{?dist} |
---|
[e1b4795] | 617 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
| 618 | License: Distributable |
---|
| 619 | |
---|
| 620 | Requires(post): /sbin/install-info |
---|
| 621 | Requires(preun): /sbin/install-info |
---|
| 622 | |
---|
| 623 | %description -n rtems-4.10-newlib-common |
---|
| 624 | newlib files that are shared by all targets. |
---|
| 625 | |
---|
| 626 | %files -n rtems-4.10-newlib-common |
---|
| 627 | %defattr(-,root,root) |
---|
| 628 | %dir %{_prefix} |
---|
| 629 | %dir %{_prefix}/share |
---|
| 630 | |
---|
| 631 | %dir %{_infodir} |
---|
| 632 | %ghost %{_infodir}/dir |
---|
| 633 | %{_infodir}/libc.info* |
---|
| 634 | %{_infodir}/libm.info* |
---|
| 635 | |
---|
| 636 | %post -n rtems-4.10-newlib-common |
---|
| 637 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libc.info.gz || : |
---|
| 638 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/libm.info.gz || : |
---|
| 639 | |
---|
| 640 | %preun -n rtems-4.10-newlib-common |
---|
| 641 | if [ $1 -eq 0 ]; then |
---|
| 642 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libc.info.gz || : |
---|
| 643 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/libm.info.gz || : |
---|
| 644 | fi |
---|
| 645 | |
---|