2019-10-22 09:57:37 +00:00
|
|
|
|
****************************************************
|
|
|
|
|
从零开始设置 Linux 环境下的工具链(传统 GNU Make)
|
|
|
|
|
****************************************************
|
2019-06-25 01:26:53 +00:00
|
|
|
|
:link_to_translation:`en:[English]`
|
|
|
|
|
|
|
|
|
|
.. include:: ../gnu-make-legacy.rst
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
安装工具链的标准方法请见 :doc:`这里 <linux-setup>`。请参考 :ref:`工具链自定义设置 <get-started-customized-setup-legacy>` 章节,查看可能需要从头开始设置工具链的情况。
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
安装准备
|
|
|
|
|
========
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
编译 ESP-IDF 需要以下软件包:
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- Ubuntu and Debian::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-12-16 10:41:28 +00:00
|
|
|
|
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
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
- Arch::
|
|
|
|
|
|
2020-02-20 15:00:53 +00:00
|
|
|
|
sudo pacman -S --needed gcc git make ncurses flex bison gperf python-pyserial python-cryptography python-future python-pyparsing python-pyelftools
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
一些旧的(2014年之前)Linux 发行版中使用的 ``pyserial`` 版本可能是 2.x ,ESP-IDF 并不支持。这种情况下,请按照 :ref:`get-started-get-packages-legacy` 章节的介绍,使用 ``pip`` 安装软件包。
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
从源代码编译工具链
|
|
|
|
|
==================
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- 安装依赖项:
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- CentOS 7::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- Ubuntu pre-16.04::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- Ubuntu 16.04 或以上 ::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- Debian 9::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool libtool-bin
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- Arch::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- 创建工作目录,并进入该目录::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
mkdir -p ~/esp
|
|
|
|
|
cd ~/esp
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- 下载并编译 ``crosstool-NG`` :
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-11-13 03:46:16 +00:00
|
|
|
|
.. include-build-file:: inc/scratch-build-code.inc
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
- 编译工具链::
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
|
|
|
|
./ct-ng xtensa-esp32-elf
|
|
|
|
|
./ct-ng build
|
|
|
|
|
chmod -R u+w builds/xtensa-esp32-elf
|
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
编译得到的工具链会被保存到 ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``。请按照 :ref:`标准设置指南 <setup-linux-toolchain-add-it-to-path-legacy>` 的介绍,将工具链添加到 ``PATH``。
|
|
|
|
|
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
后续步骤
|
|
|
|
|
========
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|
2019-10-22 09:57:37 +00:00
|
|
|
|
继续设置开发环境,请前往 :ref:`get-started-get-esp-idf-legacy` 章节。
|
2019-06-25 01:26:53 +00:00
|
|
|
|
|