File cross-sh4-gcc-bootstrap.spec of Package cross-sh4-gcc-bootstrap

#
# spec file for package gcc41 (Version 4.1.3_20070413)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define HOST %(echo %{_target_cpu}|sed -e "s/parisc/hppa/" -e "s/i.86/i586/" -e "s/ppc/powerpc/")-suse-linux
%define TARGET %(echo %{name}|sed -e "s/cross-\\(.*\\)-gcc-bootstrap/\\1/;s/-/_/g;s/parisc/hppa/;s/i.86/i586/;s/ppc/powerpc/")

%define gcc_target_arch %{TARGET}-linux
%define _prefix /opt/cross

Name:           cross-sh4-gcc-bootstrap
BuildRequires:  cross-sh4-binutils cross-sh4-kernel-headers cross-sh4-glibc-headers
BuildRequires:  libgcc libstdc++
BuildRequires:  bison flex gettext-devel glibc-devel texinfo zlib-devel
BuildRequires:  dejagnu expect
Requires:       cross-sh4-binutils
Autoreqprov:    off
URL:            http://gcc.gnu.org/
License:        GNU General Public License (GPL)
Version:        4.1.3_20070430
Release:        1
%define gcc_version %(echo %version | sed 's/_.*//')
%define snapshot_date %(echo %version | sed 's/[34]\.[0-4]\.[0-6]//' | sed 's/_/-/')
Autoprov:       no
Provides:       cross-sh4-gcc-bootstrap
Group:          Development/Languages/C and C++
Summary:        The GNU C Compiler and Support Files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source:         gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1:        change_spec
Patch1:         bug-reporting.patch
Patch2:         gcc-noalias-warn.diff
Patch5:         boehm-gc-strict-aliasing.patch
Patch7:         acats-timeout.patch
Patch10:        program-transform-name.diff
Patch12:        gcc4-ppc64-m32-m64-multilib-only.patch
Patch23:        libjava-no-multilib.diff
Patch24:        tls-no-direct.diff
Patch37:        pr20425.patch
Patch38:        large-gcc.diff
Patch43:        generic-cpu-model-1.patch
Patch44:        generic-cpu-model-2.patch
Patch45:        generic-cpu-model-3.patch
Patch47:        partial-flag-regstall.patch
Patch39:        tree_expr_nonzero.patch
Patch40:        vrp.patch
Patch46:        force_fit_type.patch
Patch48:        pr24879.patch
Patch82:        pr13212.patch
Patch93:        nvl161673.patch
Patch95:        pr26399.patch
Patch96:        nov189571.diff
Patch97:        nov189571-2.diff
Patch98:        nvl199137.patch
Patch100:       pr28755.patch
Patch101:       pr30113.patch
Patch105:       pr29166.diff
Patch106:       fix-ada-build.diff
Patch107:       pr20218.patch
Patch108:       pr29558.patch
Patch110:       pr29512.patch
# A set of patches from the RH srpm
Patch51:        gcc41-ia64-stack-protector.patch
Patch55:        gcc41-java-slow_pthread_self.patch
Patch57:        gcc41-ppc32-retaddr.patch
Patch54:        gcc41-ldbl-default.patch
Patch50:        gcc41-ldbl-default-libstdc++.patch
Patch53:        gcc41-strncat-chk.patch
# general improvement patches
Patch60:        pr25626.patch
Patch61:        fortran-matmul.patch
Patch62:        gcc41-fortran-where-opt.patch
Patch63:        emmintr.patch
Patch64:        libstdcxx-bitset.patch
Patch65:        stack-protect-kernel.patch
Patch66:        pr26208.patch
Patch67:        dwarf3-constants.patch
Patch68:        dwarf3-unwind.patch
Patch69:        gcc41-ssse3.patch
Patch70:        pr27880.diff
Patch72:        Wprofile-mismatch.patch
Patch73:        parentheses-mathematical-5.diff
Patch74:        Wuninitialized.patch
# Greyhound (aka AMD Family 10h) support
Patch200:       gcc-amdfam10-suse-1.patch
Patch201:       gcc-amdfam10-suse-2.patch
Patch202:       gcc-amdfam10-suse-3.patch
Patch203:       gcc-amdfam10-suse-4.patch
Patch204:       gcc-amdfam10-suse-5.patch
Patch205:       gcc-amdfam10-suse-6.patch
Patch206:       gcc-amdfam10-suse-7.patch
Patch207:       gcc-amdfam10-suse-8.patch
Patch208:       gcc-amdfam10-suse-9.patch
Patch209:       gcc-amdfam10-suse-10.patch
Patch210:       gcc-amdfam10-suse-11.patch
Patch211:       gcc-amdfam10-suse-12.patch
Patch212:       gcc-amdfam10-suse-20.patch
# POWER6 support
Patch300:       gcc-4.1.0-power6.diff
%if "%{gcc_target_arch}" == "avr"
# Joerg Wunsch places his cross-avr-gcc-patches there:
# http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/avr-gcc/files
# grab what has not yet made it into upstream
Patch1000:      cross-avr-patch-0b-constants.patch
Patch1001:      cross-avr-patch-attribute_alias.patch
Patch1002:      cross-avr-patch-bug25672.patch
Patch1003:      cross-avr-patch-dwarf.patch
Patch1004:      cross-avr-patch-newdevices.patch
Patch1005:      cross-avr-patch-zz-atmega256x.patch
%endif



%description
This compiler supports the C language on sh4 microprocessors.
Also install cross-sh4-binutils.

%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
%patch1
%patch2
%patch5
%patch7
%patch10
%patch12
%patch23
%patch24
%patch37
%patch38
%patch43
%patch44
%patch45
%patch47
%patch39
%patch40
%patch46
%patch48
%patch82
%patch93
%patch95
%patch96
%patch97
%patch98 -p1
%patch100
%patch101
%patch105
%patch106
%patch107
%patch108
%patch110
%patch51
%patch55
%patch57
%patch54
%patch50
%patch53
cd libstdc++-v3
%patch60
%patch64
cd ..
%patch61
%patch62 -p1
%patch63
%patch65
%patch66
%patch67
%patch68
%patch69
%patch70
%patch72
%patch73
%patch74
%patch200
%patch201
%patch202
%patch203
%patch204
%patch205
%patch206
%patch207
%patch208
%patch209
%patch210
%patch211
%patch212
%patch300
%if "%{gcc_target_arch}" == "avr"
%patch1000
%patch1001
%patch1002
%patch1003
%patch1004
%patch1005
%endif


%build
# Avoid rebuilding of generated files
contrib/gcc_update --touch

rm -rf obj
mkdir obj
cd obj

J=%{?jobs:%jobs}
if test -z "$J"; then
  J=$(getconf _NPROCESSORS_CONF)
  JL=$(($J * 2))
else
  test 1 -gt "$J" && J=1
  JL=$(($(getconf _NPROCESSORS_CONF)*2))
fi
if test "$J" == "0"; then
  J=1
fi
if test "$JL" == "0"; then
  JL=1
fi
PARALLEL="-j$J -l$JL"

export PATH=/opt/cross/bin:$PATH

# Work around tail/head -1 changes
export _POSIX2_VERSION=199209

# configure tries to parse include/features.h to detect
# if glibc supports SSP.  When cross compiling we would need
# to install a cross glibc, which we don't, or make the whole
# thing point to the native glibc, which is in /, hence the
# --with-sysroot=/

../configure \
	--prefix=%{_prefix} \
	--infodir=%{_infodir} --mandir=%{_mandir} \
	--libdir=%{_libdir} --libexecdir=%{_libdir} \
	--enable-languages=c \
	--disable-nls --disable-shared \
	--enable-version-specific-runtime-libs \
	--with-sysroot=%{_prefix}/%{gcc_target_arch}/sys-root \
	--target=%{gcc_target_arch} \
        --without-system-libunwind --enable-ssp --disable-libssp --disable-libmudflap \
        --disable-__cxa_atexit --disable-checking --enable-threads=posix --without-newlib --enable-fp

# COMMON-END

make %{?jobs:-j%jobs} all-gcc

%install
cd obj
make -C gcc install DESTDIR=$RPM_BUILD_ROOT
rm -Rf $RPM_BUILD_ROOT%{_infodir}
rm -Rf $RPM_BUILD_ROOT%{_mandir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_prefix}

%changelog -n bootstrap-gcc
* Tue May  8 2007 - martin.mohring@5etech.eu
- upstream Factory update
* Thu Apr  5 2007 - martin.mohring@5etech.eu
- upstream Factory update
- added flex bison required by post openSUSE 10.2 releases
* Tue Feb 20 2007 - martin.mohring@5etech.eu
- readded package with new naming convention
- upstream update from Feb 19 and 20
- try to fix glibc build errors reporting no ini/fini support in ld
* Sun Feb 11 2007 - martin.mohring@5etech.eu
- copied specfile from openSUSE:Factory
- changed non descending changelogs
openSUSE Build Service is sponsored by