LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File cross-armv5tel-gcc44.spec of Package orig-gcc44 (Project Ports:ARM:Base:build:cross)

#
# spec file for package gcc (Version 4.0.1)
#
# Copyright (c) 2005 SUSE Linux AG, 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://www.suse.de/feedback/
#

# norootforbuild

%define build_cp 1
%define build_ada 0
%define build_java 0
%define build_libjava 0
%define build_fortran 0
%define build_objc 0
%define build_objcp 0
%define build_nof 0
%define gcc_for_opt 0
%define gcc_target_arch armv5tel

Name:         cross-armv5tel-gcc
BuildRequires: cross-armv5tel-linux-kernel-headers
BuildRequires: cross-armv5tel-binutils
BuildRequires: glibc-cross_armv5
BuildRequires: glibc-devel-cross_armv5
BuildRequires: bison flex gettext-devel glibc-devel texinfo zlib-devel
BuildRequires: dejagnu expect perl mpfr-devel gmp-devel libstdc++44 
ExclusiveArch: i586 x86_64
Provides:     cross-armv5tel-8-gcc
# cloog-devel ppl-devel ppl-devel-static
Requires:     cross-armv5tel-binutils
Requires:     glibc-cross_armv5
Source990:    cross-gcc.rpmlintrc
# COMMON-BEGIN
%define biarch_targets x86_64 s390x powerpc64 powerpc

URL:          http://gcc.gnu.org/
Version: 4.4.1_20090817
Release:      1
%define gcc_version %(echo %version | sed 's/_.*//')
%define gcc_dir_version %(echo %gcc_version | cut -d '.' -f 1-2)
%define snapshot_date %(echo %version | sed 's/[34]\.[0-4]\.[0-6]//' | sed 's/_/-/')
%define binsuffix -4.4
# COMMON-END
# COMMON-BEGIN
Autoreqprov:    off
BuildRoot:	%{_tmppath}/%{name}-%{version}-build
Source:		gcc-%{gcc_version}%{snapshot_date}.tar.bz2
Source1:	change_spec
Source2:	libgcj44-rpmlintrc
Source3:	gcc44-rpmlintrc
Source4:	ecj.jar
Source5:	README.First-for.SuSE.packagers
Source6:	classpath-fixes.tar
Patch1:		gcc-dir-version.patch
Patch2:		gcc-sles-version.patch
Patch3:		gcc-noalias-warn.diff
Patch5:		boehm-gc-strict-aliasing.patch
Patch6:		suse-record-gcc-opts.diff
Patch7:		acats-timeout.patch
Patch8:		Wunprototyped-calls.diff
Patch9:		gcc44-lfs.diff
Patch10:	program-transform-name.diff
Patch12:	gcc4-ppc64-m32-m64-multilib-only.patch
Patch23:	libjava-no-multilib.diff
Patch24:	tls-no-direct.diff
Patch25:	pr27880.diff
Patch28:	pr33763.diff
Patch29:	build-id.diff
Patch30:	gcc43-no-unwind-tables.diff
Patch31:	gcc44-arm-boehm.patch
Patch32:	nvl544794.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
# Some patches taken from Debian
Patch60:	gcc44-textdomain.patch
Patch61:	gcc44-rename-info-files.patch
# Patches for SAP features
Patch130:	sap303956-uchar.diff

# LIBJAVA-DELETE-BEGIN
Group:		Development/Languages/C and C++
Summary:	The GNU C Compiler and Support Files
License:        GPL v3 or later

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


%prep
%setup -q -n gcc-%{gcc_version}%{snapshot_date}
tar xf %{SOURCE6}
%patch1
%patch2
%patch3
%patch5
%patch6
%patch7
%patch8
%patch9
%patch10
%if !%{build_nof}
%patch12
%endif
%patch23
%patch24
%patch25
%patch28
%if 0%{suse_version} > 1100
%patch29
%endif
%patch30
%patch31
%patch32
%patch51
%patch55
%patch57
%patch60
%patch61
%patch130

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

# Split version file into version used for directories (X.Y) and
# version to report with --version (X.Y.Z).
# See also gcc-dir-version.patch.
# Also decrement the patchlevel version by one
if test `cat gcc/DEV-PHASE` == "prerelease"; then
  ( cat gcc/BASE-VER | cut -d '.' -f 1-2 | tr -d '\n'; echo -n .; cat gcc/BASE-VER | cut -d '.' -f 3 | tr '0123456789' '0012345678' ) > gcc/FULL-VER
else
  mv gcc/BASE-VER gcc/FULL-VER
fi
cat gcc/FULL-VER | cut -d '.' -f 1-2 > gcc/BASE-VER

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

#
# TARGET-TUPLE
#
%if "%{TARGET}" == "avr" || "%{TARGET}" == "spu"
%define TARGET_OS %{TARGET}
%else
%define TARGET_OS %{TARGET}-suse-linux-gnu
%endif
%if "%{TARGET}" == "armv5tel"
%define TARGET_OS %{TARGET}-suse-linux-gnueabi
%endif
%if "%{TARGET}" == "armv7l"
%define TARGET_OS %{TARGET}-suse-linux-gnueabi
%endif
%if "%{TARGET}" == "mips"
%define TARGET_OS %{TARGET}-suse-linux-gnueabi
%endif

#
# HOST TUPLE
#
%define HOST_OS %{HOST}-gnu

%if "%{HOST}" == "arm-suse-linux"
%define HOST_OS %{HOST}-gnueabi
%endif
%if "%{HOST}" == "mips-suse-linux"
%define HOST_OS %{HOST}-gnueabi
%endif


%if "%{name}" != "gcc"
%define _prefix /opt/cross/%{TARGET_OS}
%define TARGET_SYSROOT %{_prefix}/sys-root
%define TARGET_HEADERS %{_prefix}/sys-root/usr/include
%else
%define _prefix /usr
%endif

export PATH=%{_prefix}/bin:$PATH

J=%{?jobs:%jobs}
if test -z "$J"; then
  J=8
  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"


#%#if "%{TARGET}" == "i586"
# force cross-compilation even on i586 host/target !
for i in `find . -type f -executable -name configure` ; do sed -i $i -e 's/cross_compiling=no/cross_compiling=yes/' ; sed -i $i -e 's/is_cross_compiler=no/is_cross_compiler=yes/'; done
sed -i libgcc/configure -e 's/gcc_no_link=no/gcc_no_link=yes/'
#%#define HOST i686-suse-linux
#%#endif

mkdir gcc-build
export CFLAGS="-O2 -fPIC -DPIC"
export CFLAGS_FOR_TARGET=" -fPIC -DPIC -isystem %{TARGET_SYSROOT} -isystem %{TARGET_HEADERS}"
cd gcc-build
    CC="gcc" \
    ../configure \
        --prefix=%{_prefix} \
        --libdir=%{_prefix}/lib \
        --libexecdir=%{_prefix}/lib \
        --build=%{HOST} \
        --host=%{HOST} \
        --target=%{TARGET_OS} \
        --disable-bootstrap \
        --disable-newlib \
        --disable-multilib \
        --disable-libssp \
        --disable-nls \
        --enable-shared \
        --enable-static \
        --enable-__cxa_atexit \
        --enable-c99 \
        --enable-long-long \
        --enable-threads=posix \
        --enable-languages=c,c++ \
        --with-sysroot=%{TARGET_SYSROOT}

export LDFLAGS_FOR_TARGET="--sysroot=%{TARGET_SYSROOT}"
export CPPFLAGS_FOR_TARGET="--sysroot=%{TARGET_SYSROOT}"

make RANLIB_FOR_TARGET="%{_prefix}/bin/%{TARGET_OS}-ranlib" AS_FOR_TARGET="%{_prefix}/bin/%{TARGET_OS}-as" LD_FOR_TARGET="%{_prefix}/bin/%{TARGET_OS}-ld" $PARALLEL

%install
export PATH=%{_prefix}/bin:$PATH
cd gcc-build
export LDFLAGS_FOR_TARGET="--sysroot=%{TARGET_SYSROOT}"
export CPPFLAGS_FOR_TARGET="--sysroot=%{TARGET_SYSROOT}"
make DESTDIR=%buildroot install
rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty.a || true


%clean
rm -rf $RPM_BUILD_ROOT


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

%changelog -n cross-armv5tel-gcc