Page 1 of 1
Embedding Mono
Posted: Mon Jun 01, 2009 9:35 pm
by Bloody_Grunt
Hi, I was looking at this:
http://www.mono-project.com/Embedding_Mono
as far as I can tell this makes it so that an independent runtime is not required to run IL produced from .net languages, so I thought about the possibility of using this on the wii. Has anybody tried this already? Would it be a waste of time, etc...?
It would be great to be able to use C# on the wii.
Thanks in advance.
Re: Embedding Mono
Posted: Sun Jun 07, 2009 3:32 am
by Bloody_Grunt
Well, I've been attempting to do this myself, but am a complete linux noob (I didn't want to mess around with Cygwin.), and I'm having some issues with the make file.
In the link I posted above, it says you can just use the following macros in your makefile:
CFLAGS=`pkg-config --cflags mono`
LDFLAGS=`pkg-config --libs mono`
when I try to compile it gives me the following errors:
powerpc-gekko-gcc: pkg-config: No such file or directory
powerpc-gekko-gcc: mono: No such file or directory
I'm guessing this is something related to my Path variables, can anybody give me some help on what to do here?
Re: Embedding Mono
Posted: Sun Jun 07, 2009 10:57 pm
by WinterMute
You need to port the mono runtime to Wii before you can use it. This is unlikely to be done any time soon.
Re: Embedding Mono
Posted: Sun Jun 07, 2009 11:38 pm
by Bloody_Grunt
The idea of embedding mono is to remove the need for the runtime altogether. It's actually bundled with the program, which adds some overhead and bloats the program, but I'd say the trade off is worth it.
Besides which, there actually is a mono implementation for the wii, but it's available for only for commercial wii developers.
Re: Embedding Mono
Posted: Mon Jun 08, 2009 11:25 am
by WinterMute
The embedded runtime is the runtime. It's simply a static library which needs to be ported to the Wii. The version available to commercial developers is irrelevant unless someone can obtain the mono patches.
Re: Embedding Mono
Posted: Mon Jun 08, 2009 5:19 pm
by Bloody_Grunt
You are correct, the mono that gets embedded would have to be able to run on the wii. Thanks for your reply and help.
Re: Embedding Mono
Posted: Tue Jun 09, 2009 4:15 am
by migueldeicaza
To be honest, I do not know much about devkitPro or what it does, I just found this on a Google's group search while searching for Mono.
What I can say is the following: although Mono's port to the Wii is only available for licensed Wii developers, Mono's code has been properly isolated so that porting it to other environments is relatively easy (porting it to embedded operating systems, and non-Unix systems). This is achieved by excluding parts from Mono's build and writing replacements for some routines.
For example consider the file mono/mini/mini-posix.c. That file is used in POSIX systems, but if you do not have a POSIX system, you would replace this during build time with a different mini-FOO.c
Mono's trunk code has been ported to a few non-POSIX operating systems, so the code is known to work in this mode, it is just going to take some work.
Although you can use mkbundle, this is mostly a Unix wrapper around the actual embedding API (run mkbundle --keemtemp to see the temporary files generated).
Re: Embedding Mono
Posted: Wed Jun 10, 2009 2:55 am
by Bloody_Grunt
Wow, thanks for the reply. It's nice to see the creator of mono taking interest in the "little people"
devkitPro, specifically devkitPPC lets you target the wii for use in homebrew.
I'm not too sure whether the Wii is a POSIX system, it might even be proprietary Nintendo. Still, the fact that there is an a official mono for the wii gives me hope. I'll try compiling the Mono sources using devkit when I get some time.
As far as mkbundle goes, is it possible to bundle a program from a different platform/architecture to another. For example if I was on Linux but wanted to bundle a program for Windows, could I do that without compiling myself?
Re: Embedding Mono
Posted: Wed Jun 10, 2009 6:02 am
by migueldeicaza
Sadly, no.
mkbundle merely does the equivalent of embedding your application in a sample C program and then links that with the libmono library. So the result is a self-contained piece of software, but it will only run on the same system that it was compiled on.
The portability layer comes at the ECMA CIL level, that is the bytecodes that are encoded in the DLL/EXE file.