diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2016-06-25 17:27:24 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2016-07-05 09:25:23 (GMT) |
commit | ed68885143b335bebc789fa86fb6dc381bfea9ea (patch) | |
tree | 18b7f46fb454d00c96e5a9cec7153b433e84828c /plugins/go/README.md | |
parent | b27725c753dacc8ff53a526dd67427a6984b8175 (diff) | |
download | mxe-ed68885143b335bebc789fa86fb6dc381bfea9ea.zip mxe-ed68885143b335bebc789fa86fb6dc381bfea9ea.tar.gz mxe-ed68885143b335bebc789fa86fb6dc381bfea9ea.tar.bz2 |
add Go plugin
Diffstat (limited to 'plugins/go/README.md')
-rw-r--r-- | plugins/go/README.md | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/go/README.md b/plugins/go/README.md new file mode 100644 index 0000000..60c3bfd --- /dev/null +++ b/plugins/go/README.md @@ -0,0 +1,34 @@ +# Go plugin for MXE + +See also article [cross-compile go code, including cgo][1] +by Dimitri John Ledkov. + +[1]: http://blog.surgut.co.uk/2014/06/cross-compile-go-code-including-cgo.html + +Package `go-native` installs native Go 1.4. This version of Go +doesn't depend on Go installation. + +Package `go` uses native Go 1.4 as a bootstrap and installs Go 1.6 +as a cross-compiler to windows/386 or windows/amd64. Versions of +Go starting with 1.5 need Go installation to build. + +To build Go packages for windows/386 or windows/amd64, you have to set +the [GOPATH](https://golang.org/doc/code.html#GOPATH) environment variable +and call `usr/bin/$(TARGET)-go` wrapper script. + +## Example + +Building [gohs](https://github.com/flier/gohs), GoLang Binding of +[HyperScan](https://01.org/hyperscan). + +``` +$ MXE_PLUGIN_DIRS=plugins/go make hyperscan go +$ mkdir gopath +$ GOPATH=`pwd`/gopath ./usr/bin/i686-w64-mingw32.static-go get \ + github.com/flier/gohs/examples/simplegrep +$ ./gopath/bin/windows_386/simplegrep.exe root /etc/passwd +Scanning 42 bytes with Hyperscan +root:x:0:0:root:/root:/bin/bash +root:x:0:0:root:/root:/bin/bash +root:x:0:0:root:/root:/bin/bash +``` |