export PATH=/opt/gnutools/mipsisa32-elf/bin:/opt/gnutools/mipsisa32-elf/lib:$PATH 什么意思这个
时间: 2023-07-22 17:10:50 浏览: 48
这个命令是用来设置环境变量 PATH 的。环境变量 PATH 用来存储一系列目录路径,操作系统会在这些路径中查找可执行文件。在这个命令中,路径 "/opt/gnutools/mipsisa32-elf/bin" 和 "/opt/gnutools/mipsisa32-elf/lib" 被添加到了 PATH 变量的开头,而 "$PATH" 表示将原先的 PATH 变量的值追加在新添加的路径之后。这样做的目的是让操作系统能够找到并执行这些路径下的可执行文件。
相关问题
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 解释这个文档在做是什么
这段文档提供了构建工具链的说明。它建议使用 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
这些命令将帮助您验证环境变量设置是否正确。
export LD_LIBRARY_PATH=/opt/gtk/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/gtk/lib:$LD_LIBRARY_PATH 是一个用于设置环境变量 LD_LIBRARY_PATH 的命令。这个命令将 /opt/gtk/lib 添加到 LD_LIBRARY_PATH 变量中,并将原来的 LD_LIBRARY_PATH 的值保留。这样设置 LD_LIBRARY_PATH 可以指定程序在运行时搜索动态链接库的路径。它可以确保程序可以找到所需的库文件。该命令通常在 Linux 系统中使用,并通过将其添加到配置文件中(如 .bashrc 或 .bash_profile)实现持久性。这样,每次打开终端时,都会自动将 /opt/gtk/lib 加入到 LD_LIBRARY_PATH 中。
所以,以上引用的命令 export LD_LIBRARY_PATH=/opt/gtk/lib:$LD_LIBRARY_PATH 表示将 /opt/gtk/lib 添加到 LD_LIBRARY_PATH 变量中,以确保程序可以找到所需的库文件。