From c1b8eb23a2fdf0253308adb5e3429e1b6dd6adc1 Mon Sep 17 00:00:00 2001 From: wangyu Date: Fri, 11 Aug 2017 16:30:22 +0800 Subject: [PATCH] english build_guide --- doc/build_guide.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 doc/build_guide.md diff --git a/doc/build_guide.md b/doc/build_guide.md new file mode 100644 index 0000000..13ff495 --- /dev/null +++ b/doc/build_guide.md @@ -0,0 +1,74 @@ +# udp2raw build guide + +the guide on how to build udp2raw to you own platform + +## linux platform which supports local compile +such as PC,raspberry pi + +##### install git +run on debian/ubuntun: +``` +sudo apt-get install git +``` +run on redhat/centos: +``` +sudo yum install git +``` +##### clone git code + +run in any dir: + +``` +git clone https://github.com/wangyu-/udp2raw-tunnel.git +cd udp2raw-tunnel +``` + +##### install compile tool +run on debian/ubuntun: +``` +sudo apt-get install build-essential +``` + +run on redhat/centos: +``` +sudo yum groupinstall 'Development Tools' +``` + +run 'make',compilation done. the udp2raw file is the just compiled binary + +## platform which needs cross-compile +such as openwrt router,run following instructions on your PC + +##### install git +run on debian/ubuntun: +``` +sudo apt-get install git +``` +run on redhat/centos: +``` +sudo yum install git +``` + +##### 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 udp2raw_cross is the binary,compile done. copy it to your router to run.