linux-setup-scratch.rst 2.6 KB

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