linux-setup-scratch.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Compile the Toolchain from Source
  13. =================================
  14. - Install dependencies:
  15. - CentOS 7::
  16. sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool
  17. - Ubuntu pre-16.04::
  18. sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool
  19. - Ubuntu 16.04::
  20. sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin
  21. - Debian::
  22. TODO
  23. - Arch::
  24. TODO
  25. Download ``crosstool-NG`` and build it::
  26. cd ~/esp
  27. git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
  28. cd crosstool-NG
  29. ./bootstrap && ./configure --enable-local && make install
  30. Build the toolchain::
  31. ./ct-ng xtensa-esp32-elf
  32. ./ct-ng build
  33. chmod -R u+w builds/xtensa-esp32-elf
  34. 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``.
  35. Next Steps
  36. ==========
  37. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf`.