File of Package gcc41

#! /bin/sh

# call this via change_spec and like this:
# outfile=gcc41.spec cross_arch=avr sh > cross-avr-gcc.spec
# 2005-05-09,

test -z "$cross_arch" && echo 1>&2 "Error: $0 needs environment variable 'cross_arch'"
test -z "$outfile" && echo 1>&2 "Error: $0 needs environment variable 'outfile'"
cross_arch_cpu=`echo $cross_arch | sed -e 's/\([^-]*\)-\?.*/\1/'`

cat << EOF
# spec file for package gcc (Version 4.1.2)
# Copyright (c) 2006 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

Name:         cross-$cross_arch-gcc
BuildRequires: bison cross-$cross_arch_cpu-binutils flex gettext-devel glibc-devel texinfo zlib-devel
Requires:     cross-$cross_arch_cpu-binutils
%define _prefix /opt/cross

sed -n -e '/COMMON-BEGIN/,/COMMON-END/p' $outfile | sed -n -e '1,/%description/p' 
cat << EOF
This compiler supports the C language on $cross_arch microprocessors.
Also install cross-$cross_arch-binutils and $cross_arch-libc.

sed -n -e '/%description/,$p' $outfile | sed -n -e '/COMMON-BEGIN/,/COMMON-END/p'

cat << EOF

make %{?jobs:-j%jobs} 

cd obj-%{GCCDIST}
# ln -s $cross_arch-elf-gcc \$RPM_BUILD_ROOT/%{_prefix}/bin/$cross_arch-gcc
rm -rf \$RPM_BUILD_ROOT/%{_prefix}/share
rm \$RPM_BUILD_ROOT/%{_libdir}/libiberty.a
# The libgcc.a that is not inside an avr* subdirectory is for avr2. 
# rm \$RPM_BUILD_ROOT/%{_libdir}/gcc/*/*/{libgcc.a,libgcov.a}
rmdir \$RPM_BUILD_ROOT/%{_prefix}/include



%changelog -n cross-$cross_arch-gcc
openSUSE Build Service is sponsored by