Add armv7l support.
[platform/upstream/gcc47.git] / packaging / cross.spec.in
1 #! /bin/sh
2
3 #
4 # call this via pre_checkin.sh
5 #
6 # 2005-05-09, jw@suse.de
7
8 test -z "$cross_arch" && echo 1>&2 "Error: $0 needs environment variable 'cross_arch'"
9 test -z "$outfile" && echo 1>&2 "Error: $0 needs environment variable 'outfile'"
10 cross_arch_cpu=`echo $cross_arch | sed -e 's/\([^-]*\)-\?.*/\1/'`
11
12 cat << EOF
13 #
14 # spec file for package gcc (Version 4.0.1)
15 #
16 # Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
17 # This file and all modifications and additions to the pristine
18 # package are under the same license as the package itself.
19 #
20 # Please submit bugfixes or comments via http://www.suse.de/feedback/
21 #
22
23 # norootforbuild
24
25 %define build_cp 1
26 %define build_ada 0
27 %define build_java 0
28 %define build_libjava 0
29 %define build_fortran 0
30 %define build_objc 0
31 %define build_objcp 0
32 %define build_nof 0
33 %define build_with_mudflap 0
34 %define gcc_target_arch $cross_arch
35
36 %if "$cross_arch" == "spu"
37 %define build_fortran 1
38 %endif
39
40 %if 0%{?build_static:1}
41 %define build_fortran 0
42 %endif
43
44 Name: cross-$cross_arch-gcc$base_ver$name_suffix
45 BuildRequires: bison
46 BuildRequires: flex
47 BuildRequires: gettext-devel
48 BuildRequires: glibc-devel-32bit
49 BuildRequires: mpc-devel
50 BuildRequires: mpfr-devel
51 BuildRequires: perl
52 BuildRequires: zlib-devel
53 %ifarch %ix86 x86_64 ppc ppc64 s390 s390x ia64 %sparc hppa %arm
54 BuildRequires: cloog-devel
55 BuildRequires: ppl-devel
56 %endif
57 BuildRequires: cross-$cross_arch_cpu-binutils
58 %if "$cross_arch" == "spu"
59 %if 0%{?build_static:1}
60 BuildRequires: cross-$cross_arch_cpu-newlib-headers
61 %else
62 BuildRequires: cross-$cross_arch_cpu-newlib
63 %endif
64 Requires: cross-$cross_arch_cpu-newlib
65 %endif
66 Requires: cross-$cross_arch_cpu-binutils
67 # Suffixed gcc conflicts with unsuffixed gcc
68 %if "$name_suffix" == ""
69 %else
70 Conflicts: cross-$cross_arch_cpu-gcc$base_ver
71 %endif
72
73 %define _prefix /opt/cross
74
75 EOF
76 sed -n -e '/COMMON-BEGIN/,/COMMON-END/p' $outfile | sed -n -e '1,/%description/p' 
77 cat << EOF
78 This compiler supports the C language on $cross_arch microprocessors.
79 Also install cross-$cross_arch-binutils and $cross_arch-libc.
80
81
82 EOF
83 sed -n -e '/%description/,$p' $outfile | sed -n -e '/COMMON-BEGIN/,/COMMON-END/p'
84
85 cat << EOF
86
87 make %{?jobs:-j%jobs} 
88
89 %install
90 cd obj-%{GCCDIST}
91 make install DESTDIR=\$RPM_BUILD_ROOT
92 rm -rf \$RPM_BUILD_ROOT%{_prefix}/share
93 rm -f \$RPM_BUILD_ROOT%{_prefix}/bin/*-gccbug
94 find \$RPM_BUILD_ROOT -name libiberty.a | xargs rm
95
96 %clean
97 rm -rf \$RPM_BUILD_ROOT
98
99 %files
100 %defattr(-,root,root)
101 %{_prefix}
102
103 EOF