forked from BPI-SINOVOIP/BPI-M3-bsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·59 lines (47 loc) · 963 Bytes
/
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
#!/bin/sh
set -e
SOC=a83t
MACH=sun8iw6p1
PLATFORM=
BOARD=
CUR_DIR=$PWD
CROSS_COMPILE=$CUR_DIR/allwinner-tools/toolchain/bin
NEW_CROSS_COMPILE=$CUR_DIR/allwinner-tools/gcc-linaro-4.9-2015.05-x86_64_arm-linux-gnueabihf/bin
list_boards() {
ls -1 sunxi-pack/chips/sun8iw6p1/configs/*/*/*.fex |
sed -n -e 's|.*/\([^/]\+\)\.fex$|\1|p' | sort -V |
sed -e 's|.*|\t* \0 \0-android|'
}
# keep the output `sh` friendly
# i.e., no spaces around the '='
generate_board_mk() {
cat <<-EOT
BOARD=$BOARD
SOC=$SOC
MACH=$MACH
COMPILE_TOOL=$CROSS_COMPILE
NEW_COMPILE_TOOL=$NEW_CROSS_COMPILE
UBOOT_CONFIG=$MACH
KERNEL_CONFIG=sun8iw6p1smp_bpi_defconfig
EOT
}
usage() {
cat <<-EOT >&2
Usage: $0 <board>
supported boards:
EOT
#list_boards #DK, update later
}
if [ $# -eq 0 ]; then
usage
exit 1
fi
BOARD=$1
out=chosen_board.mk
if generate_board_mk "$1" > $out~; then
mv $out~ $out
echo "$1 configured. Now run \`make\`"
else
rm $out~
exit 1
fi