linux-setup-scratch.rst 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. **********************************
  2. Setup Linux Toolchain from Scratch
  3. **********************************
  4. .. note::
  5. Standard process for installing the toolchain is described :doc:`here <linux-setup>`. See :ref:`Customized Setup of Toolchain <get-started-customized-setup>` section for some of the reasons why installing the toolchain from scratch may be necessary.
  6. Install Prerequisites
  7. =====================
  8. To compile with ESP-IDF you need to get the following packages:
  9. - Ubuntu and Debian::
  10. sudo apt-get install git wget make libncurses-dev flex bison gperf python python-pip python-setuptools python-serial
  11. - Arch::
  12. sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial
  13. .. note::
  14. Some older (pre-2014) Linux distributions may use ``pyserial`` version 2.x which is not supported by ESP-IDF.
  15. In this case please install a supported version via ``pip`` as it is described in section
  16. :ref:`get-started-get-packages`.
  17. Compile the Toolchain from Source
  18. =================================
  19. - Install dependencies:
  20. - CentOS 7::
  21. sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool
  22. - Ubuntu pre-16.04::
  23. sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool
  24. - Ubuntu 16.04::
  25. sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin
  26. - Debian 9::
  27. sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool libtool-bin
  28. - Arch::
  29. TODO
  30. Create the working directory and go into it::
  31. mkdir -p ~/esp
  32. cd ~/esp
  33. Download ``crosstool-NG`` and build it:
  34. .. include:: /_build/inc/scratch-build-code.inc
  35. Build the toolchain::
  36. ./ct-ng xtensa-esp32-elf
  37. ./ct-ng build
  38. chmod -R u+w builds/xtensa-esp32-elf
  39. 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``.
  40. Next Steps
  41. ==========
  42. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf`.