用户工具

站点工具


entware:mips2

这是本文档旧的修订版!


Entware-ng mips2

笔记: 创建 Entware-ng 环境

系统环境准备

ubuntu 16

安装以下软件包

gcc g++ make autoconf automake flex gperf bison texinfo libtool libtool-bin libncurses5-dev
zlib1g-dev unzip libssl-dev gettext

搭建 entware-ng

$ git clone https://github.com/Entware-ng/Entware-ng.git
$ cd Entware-ng
$ make package/symlinks
$ cp ./configs/mipselsf.config .config
$ make tools/install
$ make toolchain/install
$ make target/compile

无法编译golang支持的解决方法

新版本加入了go语言的支持, 但是tools编译的过程中, 可能出错

解决方法是, 编辑 .config

把里面的有关 GCCGO, libgo, 和Go有关的包, 全部注释了

编译自带软件包

编译名叫name的软件

$ make package/name/compile

手动编译软件

设置环境变量

export STAGING_DIR=/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13
export PATH=$PATH:/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/bin

手动编译设置

手动编译软件时configure需要加入以下参数

--target=mipsel-openwrt-linux \
--host=mipsel-openwrt-linux \
--build=x86_64-linux-gnu \
CC=mipsel-openwrt-linux-uclibc-gcc \
CFLAGS='-O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fPIC' \
CPPFLAGS='-I/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/include -I/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/include -I/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/usr/include -I/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/include' \
LDFLAGS='-L/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/lib -L/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-uClibc.so.0 -L/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/usr/lib -L/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/lib'

例子

编译tinc 1.11pre11

先编译依赖库, entware-ng自带

make package/ncurses/compile
make package/lzo/compile
make package/libreadline/compile
make package/zlib/compile

接着编译tinc

./configure \
--target=mipsel-openwrt-linux \
--host=mipsel-openwrt-linux \
--build=x86_64-linux-gnu \
--prefix=/opt \
--without-openssl \
CC=mipsel-openwrt-linux-uclibc-gcc \
CFLAGS='-O2 -pipe -mno-branch-likely -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fPIC' \
CPPFLAGS='-I/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/include -I/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/include -I/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/usr/include -I/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/include' \
LDFLAGS='-L/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/lib -L/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/opt/entware-ng/Entware-ng/staging_dir/target-mipsel_mips32r2_uClibc-1.0.13/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-uClibc.so.0 -L/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/usr/lib -L/opt/entware-ng/Entware-ng/staging_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.13/lib'
make
entware/mips2.1461746471.txt.gz · 最后更改: 2016/04/27 16:41 由 Hshh