static bool compile_only = false;
static bool static_link = false;
static string config_file = null;
+ static string config_dir = null;
static int Main (string [] args)
{
static_link = true;
break;
case "--config":
- if (i+1 == top){
+ if (i+1 == top) {
Help ();
return 1;
}
+
config_file = args [++i];
break;
+ case "--config-dir":
+ if (i+1 == top) {
+ Help ();
+ return 1;
+ }
+
+ config_dir = args [++i];
+ break;
default:
sources.Add (args [i]);
break;
ts.Write ("\t.byte {0}\n", buffer [i]);
}
}
- // null terminator
+ // null terminator
ts.Write ("\t.byte 0\n");
ts.WriteLine ();
}
if (config_file != null)
tc.WriteLine ("\tmono_config_parse_memory (&system_config);\n");
tc.WriteLine ("}\n");
+
+ if (config_dir != null)
+ tc.WriteLine ("static const char *config_dir = \"{0}\";", config_dir);
+ else
+ tc.WriteLine ("static const char *config_dir = NULL;");
StreamReader s = new StreamReader (Assembly.GetAssembly (typeof(MakeBundle)).GetManifestResourceStream ("template.c"));
tc.Write (s.ReadToEnd ());
{
Console.WriteLine ("Usage is: mkbundle [options] assembly1 [assembly2...]\n\n" +
"Options:\n" +
- " -c Produce stub only, do not compile\n" +
- " -o out Specifies output filename\n" +
- " -oo obj Specifies output filename for helper object file" +
- " -L path Adds `path' to the search path for assemblies\n" +
- " --nodeps Turns off automatic dependency embedding (default)\n" +
- " --deps Turns on automatic dependency embedding\n" +
- " --keeptemp Keeps the temporary files\n" +
- " --config F Bundle system config file `F'\n" +
- " --static Statically link to mono libs\n");
+ " -c Produce stub only, do not compile\n" +
+ " -o out Specifies output filename\n" +
+ " -oo obj Specifies output filename for helper object file\n" +
+ " -L path Adds `path' to the search path for assemblies\n" +
+ " --nodeps Turns off automatic dependency embedding (default)\n" +
+ " --deps Turns on automatic dependency embedding\n" +
+ " --keeptemp Keeps the temporary files\n" +
+ " --config F Bundle system config file `F'\n" +
+ " --config-dir D Set MONO_CFG_DIR to `D'\n" +
+ " --static Statically link to mono libs\n");
}
[DllImport ("libc")]
int mono_main (int argc, char* argv[]);
+#include <stdlib.h>
#include <malloc.h>
int main (int argc, char* argv[])
for (i = 1; i < argc; i++)
newargs [i+1] = argv [i];
newargs [++i] = NULL;
+
+ if (config_dir != NULL && getenv ("MONO_CFG_DIR") == NULL)
+ setenv ("MONO_CFG_DIR", config_dir, 1);
install_dll_config_files ();
mono_register_bundled_assemblies(bundled);