- default_value = xbt_strdup("ucontext");
- xbt_cfg_register(&_sg_cfg_set, "contexts/factory",
- "Context factory to use in SIMIX (ucontext, thread or raw)",
- xbt_cfgelm_string, &default_value, 1, 1, _sg_cfg_cb_context_factory, NULL);
+ sprintf(description,
+ "Context factory to use in SIMIX. Possible values: thread");
+ const char *dflt_ctx_fact = "thread";
+#ifdef CONTEXT_UCONTEXT
+ strcat(description, ", ucontext");
+ dflt_ctx_fact = "ucontext";
+#endif
+#ifdef HAVE_RAWCTX
+ strcat(description, ", raw");
+ dflt_ctx_fact = "raw";
+#endif
+ strcat(description, ".");
+ xbt_cfg_register(&_sg_cfg_set, "contexts/factory", description,
+ xbt_cfgelm_string, 1, 1, _sg_cfg_cb_context_factory, NULL);
+ xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", dflt_ctx_fact);