File change_spec of Package cross-aarch64-gcc7
126
1
#!/bin/bash
2
3
do_crosses=1
4
do_optional_compiler_languages=0
5
rm -f gcc*-testresults.spec gcc*-testresults.changes gcc*.spec cross*.spec cross*.changes
6
7
# Default is to generate the normal gcc package
8
# unless a parameter is given. In case that it is '-*',
9
# that parameter will be used as suffix for the package name
10
# and as suffix for the install path (/opt/gccSUFFIX)
11
# In case that it is '[0-9]*', that parameter will be used
12
# as a suffix for a versioned package name.
13
14
if [ $# -lt 1 ]; then
15
echo No package suffix given
16
outfile=gcc.spec
17
else
18
case $1 in
19
[0-9]*)
20
base_ver=$1
21
outfile=gcc$1.spec
22
;;
23
*)
24
echo Invalid package suffix
25
exit 1
26
;;
27
esac
28
fi
29
30
: > $outfile
31
if test "$do_optional_compiler_languages" = "1"; then
32
echo '%define build_optional_compiler_languages 1' >> $outfile
33
fi
34
sed -e 's%@base_ver@%'$base_ver'%g' \
35
gcc.spec.in \
36
| sed -n -e '{
37
/^# PACKAGE-BEGIN/h
38
/^# PACKAGE-BEGIN/,/^# PACKAGE-END/H
39
/^# PACKAGE-BEGIN/,/^# PACKAGE-END/!p
40
/^# PACKAGE-END/{g
41
s/@variant@//g
42
p
43
g
44
s/@variant@/-32bit/g
45
p
46
g
47
s/@variant@/-64bit/g
48
p
49
}
50
}' >> $outfile
51
52
echo '%define building_testsuite 1' > gcc$base_ver-testresults.spec
53
echo '%define run_tests 1' >> gcc$base_ver-testresults.spec
54
sed -e '/^# GCC-TESTSUITE-DELETE-BEGIN/,/^# GCC-TESTSUITE-DELETE-END/d;s/-n gcc@base_ver@-testresults$//g;s/^Name:[[:space:]]*gcc@base_ver@/Name: gcc@base_ver@-testresults/g' \
55
gcc.spec.in \
56
| sed -e 's%@base_ver@%'$base_ver'%g' \
57
>> gcc$base_ver-testresults.spec
58
59
echo '<multibuild>' > _multibuild
60
echo '<flavor>'gcc$base_ver-testresults'</flavor>' >> _multibuild
61
62
add_cross() {
63
local pkgname="$1"; shift
64
local rpmtarget="$1"; shift
65
local triplet="$1"; shift
66
67
echo "%define pkgname $pkgname" > $pkgname.spec
68
echo "%define cross_arch $rpmtarget" >> $pkgname.spec
69
echo "%define gcc_target_arch $triplet" >> $pkgname.spec
70
echo "$@" >> $pkgname.spec
71
{ sed -n -e '1,/SRC-COMMON-BEGIN/p' cross.spec.in
72
sed -n -e '/SRC-COMMON-BEGIN/,/SRC-COMMON-END/p' $outfile
73
sed -n -e '/SRC-COMMON-END/,/BUILD-COMMON-BEGIN/p' cross.spec.in
74
sed -n -e '/BUILD-COMMON-BEGIN/,/BUILD-COMMON-END/p' $outfile
75
sed -n -e '/BUILD-COMMON-END/,$p' cross.spec.in; } |
76
sed -e "s#@base_ver@#$base_ver#" \
77
-e "s/^\(ExclusiveArch.*\) $rpmtarget[^ \r]*/\1 /" \
78
>> $pkgname.spec
79
80
echo '<flavor>'$pkgname'</flavor>' >> _multibuild
81
}
82
83
add_newlib_cross() {
84
add_cross $1-bootstrap $2 $3 "%define gcc_target_newlib 1
85
%define gcc_libc_bootstrap 1"
86
add_cross $1 $2 $3 "%define gcc_target_newlib 1"
87
}
88
89
# We now support "proper" cross-compilers to suse targets via a
90
# cross-glibc package, enable that via for example
91
#
92
# add_cross cross-aarch64-gcc$base_ver aarch64 aarch64-suse-linux
93
#
94
# For now keep the old way of doing things
95
if test "$do_crosses" = 1 ; then
96
add_cross cross-aarch64-gcc$base_ver aarch64 aarch64-suse-linux %define gcc_icecream 1
97
add_cross cross-arm-gcc$base_ver arm arm-suse-linux-gnueabi %define gcc_icecream 0
98
add_cross cross-avr-gcc$base_ver-bootstrap avr avr "%define gcc_libc_bootstrap 1"
99
add_cross cross-avr-gcc$base_ver avr avr
100
add_cross cross-i386-gcc$base_ver i386 i586-suse-linux %define gcc_icecream 1
101
add_cross cross-x86_64-gcc$base_ver x86_64 x86_64-suse-linux %define gcc_icecream 1
102
add_cross cross-s390x-gcc$base_ver s390x s390x-suse-linux %define gcc_icecream 1
103
add_cross cross-sparc-gcc$base_ver sparcv9 sparc-suse-linux %define gcc_icecream 1
104
add_cross cross-sparc64-gcc$base_ver sparc64 sparc64-suse-linux %define gcc_icecream 1
105
add_cross cross-ppc64-gcc$base_ver ppc64 powerpc64-suse-linux %define gcc_icecream 1
106
add_cross cross-ppc64le-gcc$base_ver ppc64le powerpc64le-suse-linux %define gcc_icecream 1
107
add_cross cross-m68k-gcc$base_ver m68k m68k-suse-linux %define gcc_icecream 1
108
add_cross cross-mips-gcc$base_ver mips mips-suse-linux %define gcc_icecream 1
109
add_cross cross-hppa-gcc$base_ver hppa hppa-suse-linux %define gcc_icecream 1
110
add_newlib_cross cross-arm-none-gcc$base_ver arm-none arm-none-eabi
111
add_newlib_cross cross-epiphany-gcc$base_ver epiphany epiphany-elf
112
add_newlib_cross cross-rx-gcc$base_ver rx rx-elf
113
#add_newlib_cross cross-rl78-gcc$base_ver rl78 rl78-elf
114
#add_newlib_cross cross-nds32le-gcc$base_ver nds32le nds32le-elf
115
fi
116
# the nvptx cross is used for offloading
117
add_cross cross-nvptx-gcc$base_ver nvptx nvptx-none %define gcc_accel 1
118
119
for f in *.spec; do
120
sed -i -e '/^# .*-\(BEGIN\|END\)$/d' $f
121
done
122
123
echo '</multibuild>' >> _multibuild
124
125
osc service localrun format_spec_file
126