Build from Source To build the tool chain yourself, follow the instructions at http://ecos.sourceware.org/build-toolchain.html. Install a GCC 3.x compiler because the tool chain can not be compiled with GCC 4.x due to its strict syntax checking. To build the tool chain from source use the script, build/tools/toolchain/gcc-4.9.1/build.sh. Use the binary instead of attempting the challenging task of building the tool chain from source. Get eCos source code files from ftp://ecos.sourceware.org/pub/ecos/releases/ecos- 3.0/ecos-3.0.i386linux.tar.bz2. Getting the other tools is optional, but the eCos source code is necessary. Assuming that the retrieved files are in Downloads, enter the following. $ cd Downloads $ sudo tar xf <file> -C /opt where <file> is the name of the file you want to untar. Add the following lines to your .bashrc export ECOS_TOOLS=/opt/ecos-3.0/tools/bin export PATH=/opt/gnutools/mipsisa32-elf/bin:/opt/gnutools/mipsisa32- elf/lib:$PATH Source your bashrc file or close the shell and start a new one so that your environment variable changes take effect. The ECOS_TOOLS and PATH paths may be changed, but the SDK tools must be located in /opt. Use the following commands to check your environment variables. • For a 32-bit install, run mipsisa32-elf-gcc –version • For the ECOS_TOOLS path, enter $ECOS_TOOLS/ecosconfig –version 解释这个文档在做是什么
时间: 2024-04-16 16:26:06 浏览: 136
这段文档提供了构建工具链的说明。它建议使用 GCC 3.x 编译器来构建工具链,因为该工具链无法使用严格语法检查的 GCC 4.x 进行编译。
首先,您可以按照 http://ecos.sourceware.org/build-toolchain.html 上的说明,从源代码构建工具链。如果您觉得这个任务太具有挑战性,也可以使用预编译好的二进制文件。
您可以从 ftp://ecos.sourceware.org/pub/ecos/releases/ecos-3.0/ecos-3.0.i386linux.tar.bz2 获取 eCos 的源代码文件。其他工具是可选的,但是 eCos 的源代码是必需的。
假设您将下载的文件保存在 Downloads 文件夹中,您可以执行以下命令:
$ cd Downloads
$ sudo tar xf <file> -C /opt
其中 <file> 是您要解压的文件的名称。
然后,将以下行添加到您的 .bashrc 文件中:
export ECOS_TOOLS=/opt/ecos-3.0/tools/bin
export PATH=/opt/gnutools/mipsisa32-elf/bin:/opt/gnutools/mipsisa32-elf/lib:$PATH
接下来,您需要重新加载 .bashrc 文件或关闭当前终端并打开一个新终端,以使环境变量的更改生效。ECOS_TOOLS 和 PATH 变量的路径可以更改,但是 SDK 工具必须位于 /opt 目录下。
最后,您可以使用以下命令检查您的环境变量:
- 对于 32 位安装,请运行 mipsisa32-elf-gcc –version
- 对于 ECOS_TOOLS 路径,请输入 $ECOS_TOOLS/ecosconfig –version
这些命令将帮助您验证环境变量设置是否正确。
阅读全文