Skip to content

How to build

wangyu- edited this page Jun 21, 2018 · 8 revisions

Native build

install build tools

for linux (debian)
sudo apt-get install build-essential
for linux (centos)
sudo yum groupinstall 'Development Tools'
for mac
brew install gcc
for bsd
pkg install lang/gcc49
ln -s /usr/local/bin/g++49 /usr/local/g++
for windows

install cygwin + gcc or msys2+mingw-w32/mingw-w64 .

It cant be done in a single command, so you have to use google for help.

clone the code

git clone https://github.com/wangyu-/UDPspeeder.git
cd UDPspeeder

build

for linux
make
for mac
make mac
for freebsd
make freebsd
for windows (cygwin)
make cygwin
for windows (mingw + msys2)
make mingw

cross build

Currently, only targets for linux cross build are provided. If you want to cross build for windows/mac/bsd, you have to take a look at the makefile and help yourself.

download cross compile tool chain

find it on downloads.openwrt.org according to your openwrt version and cpu model.

for example, my tplink wdr4310 runs chaos_calmer 15.05,its with ar71xx cpu,download the following package.

http://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-SDK-15.05-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2

unzip it to any dir,such as :/home/wangyu/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2

cd into staging_dir ,toolchain-xxxxx ,bin .find the soft link with g++ suffix. in my case ,its mips-openwrt-linux-g++ ,check for its full path:

/home/wangyu/Desktop/OpenWrt-SDK-15.05-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++
compile

modify first line of makefile to:

cc_cross=/home/wangyu/Desktop/OpenWrt-SDK-15.05-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++

run make cross,the just generated speederv2_cross is the binary,compile done. copy it to your router to run.

make cross generates non-static binary. If you have any problem on running it,try to compile a static binary by using make cross2 or make cross3.If your toolchain supports static compiling, usually one of them will succeed. The generated file is still named speederv2_cross.