File of Package gcc41

# 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

# norootforbuild

%define build_ada 0
%define build_java 0
%define build_libjava 0
%define build_fortran 0
%define build_objcp 0
%define build_nof 0
%define gcc_for_opt 0
%define gcc_target_arch @cross_arch@-linux
%define gcc_icecream 1

Name:         cross-@cross_arch@-gcc-icecream-backend
BuildRequires: bison cross-@cross_arch@-binutils flex gettext-devel glibc-devel-32bit texinfo zlib-devel
ExclusiveArch: ppc ppc64 %ix86 x86_64 ia64
%define _prefix /opt/cross
%define _binary_payload w.ufdio


make %{?jobs:-j%jobs} all-gcc TARGET-gcc="cc1 cc1plus gcc-cross g++ native"

cd obj-%{GCCDIST}
# We play funny tricks with the ppc compiler.  We want to have it biarch,
# which the powerpc compiler itself doesn't support.  So we actually
# configure it as powerpc64 target compiler (i.e. a native cross compiler
# even on ppc), with the default code generation to be powerpc32.
# But this doesn't hide the fact that it's still a cross compiler which
# shows also in various paths
# This shows in the difference of %{CONFIGURE_TARGET}, which is powerpc64-linux
# vs %{TARGET_ARCH}, which is powerpc in this case.
make -C gcc DESTDIR=$RPM_BUILD_ROOT/inst install-driver install-common
# But the assembler comes from the cross-binutils, and hence is _not_
# named funnily, not even on ppc, so there we need the original target
install -s -D %{_prefix}/bin/%{TARGET_ARCH}-linux-as $RPM_BUILD_ROOT/env/usr/bin/as
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/%{CONFIGURE_TARGET}-g++ $RPM_BUILD_ROOT/env/usr/bin/g++
install -s $RPM_BUILD_ROOT/inst%{_prefix}/bin/%{CONFIGURE_TARGET}-gcc $RPM_BUILD_ROOT/env/usr/bin/gcc

for back in cc1 cc1plus; do 
	install -s -D $RPM_BUILD_ROOT/inst%{_libdir}/gcc/%{CONFIGURE_TARGET}/%gcc_version/$back \

libs=`for bin in $RPM_BUILD_ROOT/env/usr/bin/*; do \
  ldd $bin | sed -n '\,^[^/]*\(/[^ ]*\).*,{ s//\1/; p; }'  ;\
done | sort -u `
for lib in $libs; do
   # Check wether the same library also exists in the parent directory,
   # and prefer that on the assumption that it is a more generic one.
   baselib=`echo "$lib" | sed 's,/[^/]*\(/[^/]*\)$,\1,'`
   test -f "$baselib" && lib=$baselib
   install -s -D $lib $RPM_BUILD_ROOT/env$lib
rm -rf $RPM_BUILD_ROOT/inst
tar cvzf ../%{name}_%{_arch}.tar.gz *
cd ..
mkdir -p usr/share/icecream-envs
mv %{name}_%{_arch}.tar.gz usr/share/icecream-envs
rpm -q --changelog glibc >  usr/share/icecream-envs/%{name}_%{_arch}.glibc
rpm -q --changelog binutils >  usr/share/icecream-envs/%{name}_%{_arch}.binutils
rm -r env



%changelog -n cross-@cross_arch@-gcc-icecream-backend
openSUSE Build Service is sponsored by