#define CONFIG_OS "netbsd"
#elif defined(__OpenBSD__)
#define CONFIG_OS "openbsd"
-#elif defined(__WIN32__)
+#elif defined(__WIN32__) || defined(TARGET_WIN32)
#define CONFIG_OS "windows"
#elif defined(_IBMR2)
#define CONFIG_OS "aix"
#endif
#ifndef CONFIG_CPU
-#if defined(__i386__)
+#if defined(__i386__) || defined(TARGET_X86)
#define CONFIG_CPU "x86"
#define CONFIG_WORDSIZE "32"
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) || defined(TARGET_AMD64)
#define CONFIG_CPU "x86-64"
#define CONFIG_WORDSIZE "64"
#elif defined(sparc) || defined(__sparc__)
#elif defined(__arm__)
#define CONFIG_CPU "arm"
#define CONFIG_WORDSIZE "32"
+#elif defined(__aarch64__)
+#define CONFIG_CPU "armv8"
+#define CONFIG_WORDSIZE "64"
#elif defined(__ia64__)
#define CONFIG_CPU "ia64"
#define CONFIG_WORDSIZE "64"
-#elif defined(__alpha__)
-#define CONFIG_CPU "alpha"
-#define CONFIG_WORDSIZE "64"
-#elif defined(hppa) || defined(__hppa__)
-#define CONFIG_CPU "hppa"
-#define CONFIG_WORDSIZE "32"
#elif defined(mips) || defined(__mips) || defined(_mips)
#define CONFIG_CPU "mips"
#define CONFIG_WORDSIZE "32"
static GHashTable *config_handlers;
+static const char *mono_cfg_dir = NULL;
+static char *mono_cfg_dir_allocated = NULL;
+
/* when this interface is stable, export it. */
typedef struct MonoParseHandler MonoParseHandler;
g_hash_table_insert (config_handlers, (gpointer) legacyUEP_handler.element_name, (gpointer) &legacyUEP_handler);
}
+void
+mono_config_cleanup (void)
+{
+ if (config_handlers)
+ g_hash_table_destroy (config_handlers);
+ g_free (mono_cfg_dir_allocated);
+}
+
/* FIXME: error handling */
static void
mono_config_parse_file (mono_cfg);
g_free (mono_cfg);
-#ifndef TARGET_WIN32
+#if !defined(TARGET_WIN32) && !defined(__native_client__)
home = g_get_home_dir ();
user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, ".mono/config", NULL);
mono_config_parse_file (user_cfg);
#endif
}
-static const char *mono_cfg_dir = NULL;
-
/* Invoked during startup */
void
mono_set_config_dir (const char *dir)
/* If this variable is set, overrides the directory computed */
mono_cfg_dir = g_getenv ("MONO_CFG_DIR");
if (mono_cfg_dir == NULL)
- mono_cfg_dir = g_strdup (dir);
+ mono_cfg_dir = mono_cfg_dir_allocated = g_strdup (dir);
}
const char*
mono_config_parse_file_with_context (&state, filename);
}
+static mono_bool mono_server_mode = FALSE;
+
+void
+mono_config_set_server_mode (mono_bool server_mode)
+{
+ mono_server_mode = server_mode;
+}
+
+mono_bool
+mono_config_is_server_mode (void)
+{
+ return mono_server_mode;
+}
+