macos-setup-scratch.rst 2.1 KB

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