]> granicus.if.org Git - esp-idf/commitdiff
Doc/translation linux setup scratch wangfang
authorWang Fang <wangfang@espressif.com>
Mon, 19 Nov 2018 04:14:45 +0000 (12:14 +0800)
committerAngus Gratton <angus@espressif.com>
Mon, 19 Nov 2018 04:14:45 +0000 (12:14 +0800)
docs/en/get-started-cmake/linux-setup-scratch.rst
docs/zh_CN/get-started-cmake/linux-setup-scratch.rst

index 7a1582ee7ac98bd86730687142b80d40c53e0f4d..ea66ccb3529ac11a4e4fff59cc742f4ad164aa08 100644 (file)
@@ -2,6 +2,8 @@
 Setup Linux Toolchain from Scratch (CMake)
 ******************************************
 
+:link_to_translation:`zh_CN:[中文]`
+
 .. include:: ../cmake-warning.rst
 
 The following instructions are alternative to downloading binary toolchain from Espressif website. To quickly setup the binary toolchain, instead of compiling it yourself, backup and proceed to section :doc:`linux-setup`.
index 1bc3dfab72eadaddda86d91e4d505d484c28b409..52e4f3664944552e765db66a49d45bb908cc209f 100644 (file)
@@ -1 +1,78 @@
-.. include:: ../../en/get-started-cmake/linux-setup-scratch.rst
+******************************************
+从零开始设置 Linux 环境下的工具链 (CMake)
+******************************************
+
+:link_to_translation:`en:[English]`
+
+.. include:: ../cmake-warning.rst
+
+除了从乐鑫官网直接下载已编译好的二进制工具链外,你还可以按照本文介绍,从头开始设置你自己的工具链。如需快速使用已编译好的二进制工具链,可回到 :doc:`linux-setup` 章节。
+
+安装准备
+=====================
+
+编译 ESP-IDF 需要以下软件包:
+
+- CentOS 7::
+
+    sudo yum install git wget ncurses-devel flex bison gperf python pyserial cmake ninja-build ccache
+
+- Ubuntu 和 Debian::
+
+    sudo apt-get install git wget libncurses-dev flex bison gperf python python-pip python-setuptools python-serial cmake ninja-build ccache
+
+- Arch::
+
+    sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial cmake ninja ccache
+
+.. note::
+    使用 ESP-IDF 需要 CMake 3.5 或以上版本。较早版本的 Linux 可能需要升级才能向后移植仓库,或安装 "cmake3" 软件包,而不是安装 "cmake"。
+
+从源代码编译工具链
+=================================
+
+- 安装依赖:
+
+  - CentOS 7::
+
+        sudo yum install gawk gperf grep gettext ncurses-devel python python-devel automake bison flex texinfo help2man libtool make
+
+  - Ubuntu pre-16.04::
+
+        sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool make
+
+  - Ubuntu 16.04::
+
+        sudo apt-get install gawk gperf grep gettext python python-dev automake bison flex texinfo help2man libtool libtool-bin make
+
+  - Debian 9::
+
+        sudo apt-get install gawk gperf grep gettext libncurses-dev python python-dev automake bison flex texinfo help2man libtool libtool-bin make
+
+  - Arch::
+
+        TODO
+
+创建工作目录,并进入该目录::
+
+  mkdir -p ~/esp
+  cd ~/esp
+
+下载并编译 ``crosstool-NG`` :
+
+.. include:: /_build/inc/scratch-build-code.inc
+
+编译工具链::
+
+    ./ct-ng xtensa-esp32-elf
+    ./ct-ng build
+    chmod -R u+w builds/xtensa-esp32-elf
+
+编译得到的工具链会被保存到 ``~/esp/crosstool-NG/builds/xtensa-esp32-elf``。请按照 :ref:`标准设置指南 <setup-linux-toolchain-add-it-to-path-cmake>` 的介绍,将工具链添加到 ``PATH``。
+
+
+后续步骤
+==========
+
+继续设置开发环境,请前往 :ref:`get-started-get-esp-idf-cmake` 章节。
+