macos-setup-scratch.rst 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. *********************************************************
  2. Setup Toolchain for Mac OS 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 <macos-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. - install pip::
  11. sudo easy_install pip
  12. .. note::
  13. ``pip`` will be used later for installing :ref:`the required Python packages <get-started-get-packages-legacy>`.
  14. Compile the Toolchain from Source
  15. =================================
  16. - Install dependencies:
  17. - Install either MacPorts_ or homebrew_ package manager. MacPorts needs a full XCode installation, while homebrew only needs XCode command line tools.
  18. .. _homebrew: https://brew.sh/
  19. .. _MacPorts: https://www.macports.org/install.php
  20. - with MacPorts::
  21. sudo port install gsed gawk binutils gperf grep gettext wget libtool autoconf automake
  22. - with homebrew::
  23. brew install gnu-sed gawk binutils gperftools gettext wget help2man libtool autoconf automake
  24. Create a case-sensitive filesystem image::
  25. hdiutil create ~/esp/crosstool.dmg -volname "ctng" -size 10g -fs "Case-sensitive HFS+"
  26. Mount it::
  27. hdiutil mount ~/esp/crosstool.dmg
  28. Create a symlink to your work directory::
  29. mkdir -p ~/esp
  30. ln -s /Volumes/ctng ~/esp/ctng-volume
  31. Go into the newly created directory::
  32. cd ~/esp/ctng-volume
  33. Download ``crosstool-NG`` and build it:
  34. .. include-build-file:: 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/ctng-volume/crosstool-NG/builds/xtensa-esp32-elf``. Follow :ref:`instructions for standard setup <setup-macos-toolchain-add-it-to-path-legacy>` 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-legacy`.