主页 > 路由器 > Ubuntu下华硕工具链交叉编译SSR的ARM版本

Ubuntu下华硕工具链交叉编译SSR的ARM版本

1、下载源码
先新建一个目录ss:
mkdir ss
全路径为/home/yushi/ss/

然后进入ss目录,下载源码
cd ss
wget https://tls.mbed.org/download/mbedtls-2.4.0-apache.tgz
tar zxvf mbedtls-2.4.0-apache.tgz
mkdir mbedtls

wget https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
tar zxvf zlib-1.2.11.tar.gz
mkdir zlib

wget http://ftp.cs.stanford.edu/pub/exim/pcre/pcre-8.39.tar.gz
tar zxvf pcre-8.39.tar.gz
mkdir pcre

git clone https://github.com/shadowsocksr/shadowsocksr-libev.git
mkdir ss

2、设置环境变量
export PATH=$PATH:/opt/ac1200g/asuswrt/release/src-rt-9.x/src/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/bin
export STAGING_DIR=/opt/ac1200g/asuswrt/release/src-rt-9.x/src/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/ac1200g/asuswrt/release/src-rt-9.x/src/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/lib
export CC=arm-uclibc-linux-2.6.36-gcc
export CXX=arm-uclibc-linux-2.6.36-g++
export AR=arm-uclibc-linux-2.6.36-ar
export RANLIB=arm-uclibc-linux-2.6.36-ranlib

3、编译
先安装Ubuntu依赖包
sudo apt-get install asciidoc
asciidoc包比较大

cd mbedtls-2.4.0
vi Makefile#修改第二行为DESTDIR=/home/yushi/ss/mbedtls
make && make install

cd ../
cd zlib-1.2.11
./configure --prefix=/home/yushi/ss/zlib
make && make install

cd ../
cd pcre-8.39
./configure --prefix=/home/yushi/ss/pcre --host=arm-uclibc-linux
make && make install

cd ../
cd shadowsocksr-libev
./configure --prefix=/home/yushi/ss/ss --with-mbedtls=/home/yushi/ss/mbedtls --with-zlib=/home/yushi/ss/zlib --with-pcre=/home/yushi/ss/pcre --host=arm-uclibc-linux --with-crypto-library=mbedtls --disable-ssp
make && make install

生成的文件在/home/yushi/ss/ss/bin目录
2017-05-19 15-19-15
可以压缩一下
cd /home/yushi/ss/ss/bin
arm-uclibc-strip ss-local ss-redir

编译基于openssl的版本:
新建/home/yushi/ssr目录
wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_1t.zip
unzip OpenSSL_1_0_1t.zip
mkdir openssl

cd openssl-OpenSSL_1_0_1t
./config --prefix=/home/yushi/ssr/openssl no-asm no-shared os/compiler:arm-uclibc-linux-2.6.36-gcc
make && make instal

cd ..
git clone https://github.com/ywb94/shadowsocks-libev.git
mkdir ssr
cd shadowsocks-libev
./configure --prefix=/home/yushi/ssr/ssr --with-pcre=/home/yushi/ss/pcre --with-openssl=/home/yushi/ssr/openssl --with-zlib=/home/yushi/ss/zlib -host=arm-uclibc-linux --disable-ssp
make && make install

cd /home/yushi/ssr/ssr/bin
arm-uclibc-strip ss-local ss-manager ss-redir ss-server ss-tunnel

如果本文对你有帮助,请打赏作者,鼓励我们继续写作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注