天天看点

构建 openwrt 交叉编译工具链

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