You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxe/plugins/go
Viktor Szakats 42cf496ae2
secure URLs
5 years ago
..
src/mxe-test add Go plugin 8 years ago
README.md secure URLs 5 years ago
go-native-1-fixes.patch various packages: run `make refresh-patches` with numbering 7 years ago
go-native.mk native pkgs: use explicit cross-target deps and remove empty rules 6 years ago
go.mk native pkgs: use explicit cross-target deps and remove empty rules 6 years ago

README.md

Go plugin for MXE

See also article cross-compile go code, including cgo by Dimitri John Ledkov.

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 environment variable and call usr/bin/$(TARGET)-go wrapper script.

Example

Building gohs, GoLang Binding of HyperScan.

$ make hyperscan go MXE_PLUGIN_DIRS=plugins/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