I have some Go source files: one.go, two.go,main.go
I build them to C static library for using in my cross-platform application compilation.
There are 4 types of application compilation:
- Compilation on Windows
- Compilation on Ubuntu
- Compilation on Mac
- Cross-compilation for Windows from Ubuntu
For 1,2,3 I use:
go build -buildmode c-archive -o libxyz.a .
For 4, I use:
GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CXX="x86_64-w64-mingw32-g++" CC="x86_64-w64-mingw32-gcc" go build -buildmode c-archive -o libxyz.a .
Is it somehow possible to do that by the configure-make-make install procedure? (There is no configure.ac file in the xyz Go source package)
Also, it possible to use pkg-config in that?