forked from HomeACcessoryKid/ESP8266-HomeKit-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_toolchain.sh
executable file
·46 lines (38 loc) · 1.27 KB
/
install_toolchain.sh
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
#!/bin/bash
set -euv
# Called by Travis to install a toolchain using esp-open-sdk (parts we
# ne for esp-open-rtos are the GNU toolchain, libhal, and esptool.py.)
if test -d ${CROSS_BINDIR}; then
echo "Using cached toolchain in ${CROSS_BINDIR}"
exit 0
fi
# Travis sets this due to "language: c", but it confuses autotools configure when cross-building
unset CC
git clone --recursive https://github.com/beckmx/esp-open-sdk.git
cd esp-open-sdk
git reset --hard ${OPENSDK_COMMIT}
git submodule update --init
# this is a nasty hack as Ubuntu Precise only has autoconf 2.68 not 2.69...
sed -i "s/2.69/2.68/" lx106-hal/configure.ac
# build the toolchain relative to the CROSS_ROOT directory
sed -r -i 's%TOOLCHAIN ?=.*%TOOLCHAIN=${CROSS_ROOT}%' Makefile
cd crosstool-NG
mkdir .build
cd .build
mkdir tarballs
cd tarballs
wget https://ftp.gnu.org/gnu/mpc/mpc-1.0.2.tar.gz
cd ../../..
# will dump log on failure
echo "Building toolchain without live progress, as progress spinner fills up log..."
if !( make toolchain STANDALONE=n 2>&1 > make.log ); then
cat make.log
echo "Exiting due to failed toolchain build"
exit 3
fi
if !( make libhal STANDALONE=n 2>&1 > make.log ); then
cat make.log
echo "Exiting due to failed libhal build"
exit 3
fi
echo "Toolchain build completed in ${CROSS_ROOT}."