openwrt kcptun mips32le

2016-09-10  本文已影响357人  SHUTUP

build steps

docker run -t -i shutup/docker-go-mips32le /bin/sh

older version using yamux

go get -v github.com/hashicorp/yamux

newer version using smux

go get -v github.com/xtaci/smux
go get -v github.com/golang/snappy
go get -v golang.org/x/net/ipv4
go get -v github.com/xtaci/kcptun/client
VERSION=date -u +%Y%m%d
LDFLAGS="-X main.VERSION=$VERSION -s -w"
go build -ldflags "$LDFLAGS" -o client_linux_mips github.com/xtaci/kcptun/client
</pre>

modify gen.go (/go/src/golang.org/x/net/ipv4/gen.go) add mips32le support

before:
<pre>
case runtime.GOOS == "linux" && (runtime.GOARCH == "arm64" || runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x"):
</pre>
after:
<pre>
case runtime.GOOS == "linux" && (runtime.GOARCH == "arm64" || runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" || || runtime.GOARCH == "mips32le"):
</pre>
copy zsys_linux_mips64le.go to zsys_linux_mips32le.go

before:
<pre>
// +build linux,mips64le
</pre>
after:
<pre>
// +build linux,mips32le
</pre>

上一篇 下一篇

猜你喜欢

热点阅读