-
Notifications
You must be signed in to change notification settings - Fork 19
/
install
executable file
·102 lines (77 loc) · 2.42 KB
/
install
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/sh
set -e
BUILD_DIR=$(pwd)
PREFIX=${BUILD_DIR}"/usr/"
#check if compiler exists
clear
printf "Checking if compiler is found... "
if [ ! -f compiler.tar.gz ]; then
if [ ! -f compiler/bin/mipsel-unknown-linux-gnu-gcc ]; then
printf "Not found!, Downloading compiler...\n"
wget http://www.enigmalight.net/tools/compiler.tar.gz
tar xzf compiler.tar.gz
else
printf "Ok!\n"
fi
else
printf "Ok!\n"
#compiler found, chck if it unpacked
if [ ! -f compiler/bin/mipsel-unknown-linux-gnu-gcc ]; then
printf "Unpacking compiler...\n"
tar xzf compiler.tar.gz
fi
fi
OE_PATH=${BUILD_DIR}"/compiler/bin"
printf "Set Compiler Path... '"${OE_PATH}"'\n\n"
export PATH=$PATH:$OE_PATH
HOST=mipsel-unknown-linux-gnu
GCC=${HOST}"-gcc"
GPP=${HOST}"-g++"
CC=${GCC}
CXX=${GPP}
CPPFLAGS="-mhard-float"
cd build
echo
echo "###############################################################"
echo "# #"
echo "# Build Hard-FPU #"
echo "# #"
echo "###############################################################"
echo ""
echo ""
sleep 1
echo "[Hardfloat] Clean directory..."
make clean -i
echo "[Hardfloat] Configure..."
./configure CC=${CC} CXX=${CXX} --host=${HOST} CPPFLAGS="${CPPFLAGS}" --prefix=${PREFIX}
echo "[Hardfloat] Make..."
make -j2
make install
echo "[Hardfloat] >>>> Build Hard-FPU Finisched <<<<"
mv $PREFIX/bin/enigmalight $PREFIX/bin/enigmalight_oe20_hf
echo
echo
echo "###############################################################"
echo "# #"
echo "# Build Soft-FPU #"
echo "# #"
echo "###############################################################"
echo ""
echo ""
sleep 1
CPPFLAGS="-msoft-float"
echo "[Softfloat] Clean directory..."
make clean -i
echo "[Softfloat] Configure..."
./configure CC=${CC} CXX=${CXX} --host=${HOST} CPPFLAGS="${CPPFLAGS}" --prefix=${PREFIX}
echo "[Softfloat] Make..."
make -j2
make install
echo "[Softfloat] >>>> Build Soft-FPU Finisched <<<<"
make clean -i -s
mv $PREFIX/bin/enigmalight $PREFIX/bin/enigmalight_oe20_sf
cd ..
printf "Build finisched!!\n"
printf "Files are found in build/usr/bin, SF means softfloat for dm800 etc.. and HF for the devices with FPU support\n"
printf "Exit.."
exit 0;