1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#! /bin/bash
# Call using:
#../microblaze/sysroots/x86_64-oesdk-linux/usr/bin/microblaze-xilinx-elf/microblaze-xilinx-elf-gcc -print-multi-lib | mb-convert.sh
# Then copy the output into the special microblaze-tc BSP
mlib_to_feature() {
feature_base="microblaze"
feature_endian=" bigendian"
feature_barrel=""
feature_pattern=""
feature_multiply=""
feature_multiplyhigh=""
feature_sixtyfour=""
feature_math=""
while read feature ; do
case $feature in
le) feature_endian="";;
bs) feature_barrel=" barrel-shift";;
p) feature_pattern=" pattern-compare";;
m) if [ -z ${feature_multiplyhigh} ]; then feature_multiply=" multiply-low" ; fi ;;
mh) feature_multiply="" ; feature_multiplyhigh=" multiply-high";;
m64) feature_sixtyfour=" 64-bit";;
fpd) feature_math=" fpu-hard";;
*) echo "UNKNOWN $feature";;
esac
done
echo "${feature_base}${feature_sixtyfour}${feature_endian}${feature_barrel}${feature_pattern}${feature_multiply}${feature_multiplyhigh}${feature_math}"
}
sed -e 's,;, ,' |
while read mlib args ; do
if [ $mlib = '.' ]; then
echo '# Base configuration'
echo '# CFLAGS:'
echo 'DEFAULTTUNE = "microblaze"'
echo
echo 'AVAILTUNES += "microblaze"'
echo 'BASE_LIB:tune-microblaze = "lib"'
echo 'TUNE_FEATURES:tune-microblaze = "microblaze bigendian"'
echo 'PACKAGE_EXTRA_ARCHS:tune-microblaze = "${TUNE_PKGARCH}"'
continue
fi
cflags=$(echo $args | sed -e 's,@, -,g')
multilib="libmb$(echo $mlib | sed -e 's,/,,g')"
tune="microblaze$(echo $mlib | sed -e 's,m64,64,' -e 's,/,,g')"
features=$(echo $mlib | sed -e 's,/, ,g' | xargs -n 1 echo | mlib_to_feature)
echo
echo
echo "# $mlib"
echo "# CFLAGS:${cflags}"
echo "DEFAULTTUNE:virtclass-multilib-$multilib = \"$tune\""
echo
echo "AVAILTUNES += \"$tune\""
echo "BASE_LIB:tune-$tune = \"lib/$mlib\""
echo "TUNE_FEATURES:tune-$tune = \"${features}\""
echo "PACKAGE_EXTRA_ARCHS:tune-$tune = \"\${TUNE_PKGARCH}\""
done
|