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