-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·55 lines (42 loc) · 1.1 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
#!/bin/bash
if [[ $# < 1 || $# > 3 ]] ; then
echo "Usage: $0 rasppi [ prefix [ aarch ] ]"
echo
echo "rasppi Major revision number of the Raspberry Pi to build for (1, 2, 3 or 4)"
echo "prefix Path and prefix of the toolchain commands (e.g. /path/arm-none-eabi-)"
echo "aarch Bit size of ARM architecture (32 or 64, default 32)"
exit
fi
if [[ $1 != "1" && $1 != "2" && $1 != "3" && $1 != "4" ]] ; 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
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 += -DUSE_USB_FIQ" >> Config.mk
echo "circle/Config.mk successfully created:"
cat Config.mk