您的位置:首页 > 运维架构

构建 openwrt 交叉编译工具链

2015-08-04 15:15 274 查看
1 首先。make menuconfig 的时候选上工具链:

也就是 Package the OpenWrt-based Toolchain

Target System (Ralink RT288x/RT3xxx)  --->                           x x
x x        Subtarget (RT3x5x/RT5350 based boards)  --->                         x x
x x        Target Profile (HAME MPR-A2)  --->                                   x x
x x        Target Images  --->                                                  x x
x x        Global build settings  --->                                          x x
x x    [ ] Advanced configuration options (for developers)  ----                x x
x x    [ ] Build the OpenWrt Image Builder                                      x x
x x    [ ] Build the OpenWrt SDK                                                x x
x x    [*] Package the OpenWrt-based Toolchain                                  x x
x x    [ ] Image configuration  --->                                            x x


编译完后会在 bin/ramips/ 生成 penWrt-Toolchain-ramips-rt305x_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686.tar.bz2

把这个文件解压到任何一个目录。推荐解压到 /opt/目录下

然后修改 解压后的文件夹里面的文件

OpenWrt-Toolchain-ramips-rt305x_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-wrapper.sh



TOOLCHAIN_SYSROOT="$TOOLCHAIN_BIN_DIR/../.."


这一行后面添加:

export STAGING_DIR="$REALNAME_DIR/../../"


最后一步。把这个

/opt/OpenWrt-Toolchain-ramips-rt305x_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-i686/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin


这个目录添加到 path 这个环境变量中。具体百度
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: