n2n编译 Alpine & openwrt

采用docker来构造编译环境,比较方便

openwrt编译

sudo docker run --rm -v ~/tmp/:/home/ -it openwrtorg/rootfs:21.02.0 #22好像没有gcc所以没有选latest
cd n2n
opkg update && opkg install autoconf automake  gcc bash make
./autogen.sh
./configure CFLAGS='-static'  #可以静态编译 也可以取消 n2n作者不建议静态编译
make
make install

Alpine编译(alpine编译的可以给openwrt使用 同架构下)

sudo docker run --rm -v ~/tmp/:/home/ -it alpine
apk add --update  autoconf automake  gcc bash make linux-headers  libc-dev
./autogen.sh
./configure CFLAGS='-static'   #可以静态编译 也可以取消 n2n作者不建议静态编译
make
make install

Leave a Reply

Your email address will not be published. Required fields are marked *