macos-setup-scratch.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ***************************************
  2. Setup Toolchain for Mac OS from Scratch
  3. ***************************************
  4. .. note::
  5. Standard process for installing the toolchain is described :doc:`here <macos-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. - install pip::
  9. sudo easy_install pip
  10. .. note::
  11. ``pip`` will be used later for installing :ref:`the required Python packages <get-started-get-packages>`.
  12. Compile the Toolchain from Source
  13. =================================
  14. - Install dependencies:
  15. - Install either MacPorts_ or homebrew_ package manager. MacPorts needs a full XCode installation, while homebrew only needs XCode command line tools.
  16. .. _homebrew: https://brew.sh/
  17. .. _MacPorts: https://www.macports.org/install.php
  18. - with MacPorts::
  19. sudo port install gsed gawk binutils gperf grep gettext wget libtool autoconf automake
  20. - with homebrew::
  21. brew install gnu-sed gawk binutils gperftools gettext wget help2man libtool autoconf automake
  22. Create a case-sensitive filesystem image::
  23. hdiutil create ~/esp/crosstool.dmg -volname "ctng" -size 10g -fs "Case-sensitive HFS+"
  24. Mount it::
  25. hdiutil mount ~/esp/crosstool.dmg
  26. Create a symlink to your work directory::
  27. mkdir -p ~/esp
  28. ln -s /Volumes/ctng ~/esp/ctng-volume
  29. Go into the newly created directory::
  30. cd ~/esp/ctng-volume
  31. Download ``crosstool-NG`` and build it:
  32. .. include:: /_build/inc/scratch-build-code.inc
  33. Build the toolchain::
  34. ./ct-ng xtensa-esp32-elf
  35. ./ct-ng build
  36. chmod -R u+w builds/xtensa-esp32-elf
  37. Toolchain will be built in ``~/esp/ctng-volume/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``.
  38. Next Steps
  39. ==========
  40. To carry on with development environment setup, proceed to section :ref:`get-started-get-esp-idf`.