New: cross-compiling with mkbundle

Miguel de Icaza miguel at microsoft.com
Tue Aug 9 21:19:04 UTC 2016


Hello folks,

The new mkbundle tool in Mono no longer requires an installed compiler, and you can use it to cross compile.

Would love to get some feedback from you guys.

First, get a list of all cross-platform targets available, like this:

mkbundle –list-targets

Then, find out which version of Mono you have on your system:

mono –version

Use this to pick the right version and fetch it, for example, to cross compile to Linux/64 from a Mac do:

mkbundle –fetch-target 4.4.2-linux-libc2.13-amd64

Repeat for as many cross-platform targets as wanted.

Now take your executable that you want to bundle and bundle it up for this platform:

mkbundle –cross 4.4.2-linux-libc2.13-amd64 demo.exe demo-native

Now, you can copy that “demo-native” executable to your Linux machine and run it.

I have done very minimal testing on this, and some features are missing, things that I want to add:
·         Ship native libraries
·         Add support for shipping the LLVM runtime as an option
·         Add support to target different Mono versions, not just the same you have installed

Miguel.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20160809/64325306/attachment-0001.html>


More information about the Mono-list mailing list