-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathinstall_toolchain.sh
executable file
·35 lines (26 loc) · 1.04 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
#!/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/pfalcon/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
# will dump log on failure
echo "Building toolchain without live progress, as progress spinner fills up log..."
if !( make toolchain esptool libhal STANDALONE=n 2>&1 > make.log ); then
cat make.log
echo "Exiting due to failed toolchain build"
exit 3
fi
echo "Toolchain build completed in ${CROSS_ROOT}."