macos-setup-scratch.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ***************************************
  2. Setup Toolchain for Mac OS from Scratch
  3. ***************************************
  4. Install Prerequisites
  5. =====================
  6. - install pip::
  7. sudo easy_install pip
  8. - install pyserial::
  9. sudo pip install pyserial
  10. Compile the Toolchain from Source
  11. =================================
  12. - Install dependencies:
  13. - Install either MacPorts_ or homebrew_ package manager. MacPorts needs a full XCode installation, while homebrew only needs XCode command line tools.
  14. .. _homebrew: https://brew.sh/
  15. .. _MacPorts: https://www.macports.org/install.php
  16. - with MacPorts::
  17. sudo port install gsed gawk binutils gperf grep gettext wget libtool autoconf automake
  18. - with homebrew::
  19. brew install gnu-sed gawk binutils gperftools gettext wget help2man libtool autoconf automake
  20. Create a case-sensitive filesystem image::
  21. hdiutil create ~/esp/crosstool.dmg -volname "ctng" -size 10g -fs "Case-sensitive HFS+"
  22. Mount it::
  23. hdiutil mount ~/esp/crosstool.dmg
  24. Create a symlink to your work directory::
  25. cd ~/esp
  26. ln -s /Volumes/ctng crosstool-NG
  27. Download ``crosstool-NG`` and build it::
  28. cd ~/esp
  29. git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
  30. cd crosstool-NG
  31. ./bootstrap && ./configure --enable-local && make install
  32. Build the toolchain::
  33. ./ct-ng xtensa-esp32-elf
  34. ./ct-ng build
  35. chmod -R u+w builds/xtensa-esp32-elf
  36. Toolchain will be built in ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``. Follow :ref:`instructions for standard setup <setup-macos-toolchain-add-it-to-path>` to add the toolchain to your ``PATH``.
  37. Next Steps
  38. ==========
  39. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf`.