-static xbt_dict_t _process_properties = NULL;
-static xbt_dict_t _host_properties = NULL;
-
-/* the environment, as specified by the opengroup, used to initialize the process properties */
-extern char **environ;
-
-void gras_process_init() {
+ static xbt_dict_t _process_properties = NULL;
+ static xbt_dict_t _host_properties = NULL;
+
+# ifdef __APPLE__
+/* under darwin, the environment gets added to the process at startup time. So, it's not defined at library link time, forcing us to extra tricks */
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+# else
+ /* the environment, as specified by the opengroup, used to initialize the process properties */
+ extern char **environ;
+# endif
+
+ void gras_process_init()
+{