ArrayList files = new ArrayList ();
foreach (Assembly a in assemblies)
QueueAssembly (files, a.CodeBase);
+
+ // Special casing mscorlib.dll: any specified mscorlib.dll cannot be loaded
+ // by Assembly.ReflectionFromLoadFrom(). Instead the fx assembly which runs
+ // mkbundle.exe is loaded, which is not what we want.
+ // So, replace it with whatever actually specified.
+ foreach (string srcfile in sources) {
+ if (Path.GetFileName (srcfile) == "mscorlib.dll") {
+ foreach (string file in files) {
+ if (Path.GetFileName (new Uri (file).LocalPath) == "mscorlib.dll") {
+ files.Remove (file);
+ files.Add (new Uri (Path.GetFullPath (srcfile)).LocalPath);
+ break;
+ }
+ }
+ break;
+ }
+ }
GenerateBundles (files);
//GenerateJitWrapper ();
string prog = null;
tc.WriteLine ("/* This source code was produced by mkbundle, do not edit */");
+ tc.WriteLine ("#include <mono/metadata/mono-config.h>");
tc.WriteLine ("#include <mono/metadata/assembly.h>\n");
if (compress) {
return;
}
Console.WriteLine ("System config from: " + config_file);
- tc.WriteLine ("extern const unsigned char system_config;");
+ tc.WriteLine ("extern const char system_config;");
WriteSymbol (ts, "system_config", config_file.Length);
int n;
return;
}
Console.WriteLine ("Machine config from: " + machine_config_file);
- tc.WriteLine ("extern const unsigned char machine_config;");
+ tc.WriteLine ("extern const char machine_config;");
WriteSymbol (ts, "machine_config", machine_config_file.Length);
int n;
" --machine-config F Use the given file as the machine.config for the application.\n" +
" --static Statically link to mono libs\n" +
" --nomain Don't include a main() function, for libraries\n" +
- " -z Compress the assemblies before embedding.\n");
+ " -z Compress the assemblies before embedding.\n" +
+ " You need zlib development headers and libraries.\n");
}
[DllImport ("libc")]
IntPtr buf = UnixMarshal.AllocHeap(8192);
if (uname (buf) != 0){
Console.WriteLine ("Warning: Unable to detect OS");
+ UnixMarshal.FreeHeap(buf);
return;
}
string os = Marshal.PtrToStringAnsi (buf);