linux-setup-scratch.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. **********************************
  2. Setup Linux Toolchain from Scratch
  3. **********************************
  4. The following instructions are alternative to downloading binary toolchain from Espressif website. To quickly setup the binary toolchain, instead of compiling it yourself, backup and proceed to section :doc:`linux-setup`.
  5. Install Prerequisites
  6. =====================
  7. To compile with ESP-IDF you need to get the following packages:
  8. - Ubuntu and Debian::
  9. sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial
  10. - Arch::
  11. sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial
  12. .. note::
  13. Some older (pre-2014) Linux distributions may use ``pyserial`` version 2.x which is not supported by ESP-IDF.
  14. In this case please install a supported version via ``pip`` as it is described in section
  15. :ref:`get-started-get-packages`.
  16. Compile the Toolchain from Source
  17. =================================
  18. - Install dependencies:
  19. - CentOS 7::
  20. sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool
  21. - Ubuntu pre-16.04::
  22. sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool
  23. - Ubuntu 16.04::
  24. sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin
  25. - Debian 9::
  26. sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool libtool-bin
  27. - Arch::
  28. TODO
  29. Download ``crosstool-NG`` and build it::
  30. cd ~/esp
  31. git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
  32. cd crosstool-NG
  33. ./bootstrap && ./configure --enable-local && make install
  34. Build the toolchain::
  35. ./ct-ng xtensa-esp32-elf
  36. ./ct-ng build
  37. chmod -R u+w builds/xtensa-esp32-elf
  38. Toolchain will be built in ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``. Follow :ref:`instructions for standard setup <setup-linux-toolchain-add-it-to-path>` to add the toolchain to your ``PATH``.
  39. Next Steps
  40. ==========
  41. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf`.