-
Notifications
You must be signed in to change notification settings - Fork 21
/
configure
executable file
·65 lines (52 loc) · 1.37 KB
/
configure
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
61
62
63
64
65
#!/bin/bash
# Check parameters
if [[ $# != 1 && $# != 2 && $# != 3 ]] ; then
echo "Usage: $0 rasppi [ prefix [ aarch ] ]"
echo
echo "rasppi Major revision number of the Raspberry Pi to build for (1, 2, 3, 4 or 5)"
echo "prefix Path and prefix of the toolchain commands (e.g. /path/arm-eabi-)"
echo "aarch Bit size of ARM architecture (32 or 64, default 32)"
exit
fi
if [[ $1 != "1" && $1 != "2" && $1 != "3" && $1 != "4" && $1 != "5" ]] ; then
echo "Invalid revision number ($1)"
exit
fi
prefix=
if [[ $# == 2 || $# == 3 ]] ; then
prefix=$2
fi
$prefix"gcc" --version > /dev/null 2> /dev/null
if [[ $? != 0 ]] ; then
echo "Invalid toolchain prefix ($prefix)"
exit
fi
aarch=32
if [[ $# == 3 ]] ; then
aarch=$3
else
if [[ $1 == "5" ]] ; then
aarch=64
fi
fi
if [[ $aarch != "32" && $aarch != "64" ]] ; then
echo "Invalid ARM architecture ($aarch)"
exit
fi
# Write circle/Config.mk
cd circle || exit
echo "RASPPI = $1" > Config.mk
if [[ $aarch == "32" ]] ; then
echo "PREFIX = $prefix" >> Config.mk
else
echo "PREFIX64 = $prefix" >> Config.mk
fi
echo "AARCH = $aarch" >> Config.mk
echo "DEFINE += -DSAVE_VFP_REGS_ON_IRQ" >> Config.mk
if [[ $1 != "1" ]] ; then
echo "DEFINE += -DARM_ALLOW_MULTI_CORE" >> Config.mk
fi
echo "DEFINE += -DREALTIME" >> Config.mk
echo "DEFINE += -DUSE_PWM_AUDIO_ON_ZERO" >> Config.mk
echo "circle/Config.mk successfully created:"
cat Config.mk