-
Notifications
You must be signed in to change notification settings - Fork 0
/
installtoolchain.sh
executable file
·42 lines (29 loc) · 1.3 KB
/
installtoolchain.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
#!/bin/bash
cd `dirname $0`
spath=`pwd`
sudo apt-get install -y git wget make libncurses-dev flex bison gperf python python-serial gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool
#if [ $? -ne 0 ] ; then echo "error apt install" ; exit 1; fi
if [ ! -d "xtensa-esp32-elf" ] ; then
#file="xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz"
file="xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz"
wget "https://dl.espressif.com/dl/$file"
tar -xzf "$file"
if [ $? -ne 0 ] ; then echo "error untar xtensa-esp32 compiler" ; exit 1; fi
if [ ! -d "xtensa-esp32-elf" ] ; then echo "error xtensa-esp32-elf download untar failed" ; exit 1; fi
fi
export PATH=$PATH:$spath/xtensa-esp32-elf/bin
cd $spath
git submodule update --init
cd esp-idf
if [ $? -ne 0 ] ; then echo "error apt install" ; exit 1; fi
git checkout "release/v3.2"
cd "$spath"
if [ $? -ne 0 ] ; then echo "error apt install" ; exit 1; fi
python -m pip install --user -r esp-idf/requirements.txt
echo "----------------------"
echo "installtoolchain done"
echo "----------------------"
echo " "
echo "--------------------------------------------------------------"
echo "source the toolchain by running . ./initpath.sh"
echo "--------------------------------------------------------------"