--- src/polkit-dbus/polkit-simple.c.orig	2009-05-04 10:03:24.000000000 -0700
+++ src/polkit-dbus/polkit-simple.c	2009-05-04 10:10:06.000000000 -0700
@@ -55,6 +55,9 @@
 #include "polkit-simple.h"
 #include "polkit-dbus.h"
 
+#ifdef __APPLE__
+#include <crt_externs.h>
+#endif
 
 /**
  * polkit_check_auth:
@@ -253,7 +256,11 @@
         return ret;
 }
 
+#ifdef __APPLE__
+static char **environ;
+#else
 extern char **environ;
+#endif
 
 static polkit_bool_t
 _auth_show_dialog_text (const char *action_id, pid_t pid, DBusError *error)
@@ -275,6 +282,10 @@
                 goto out;
         }
 
+#ifdef __APPLE__
+        environ = _NSGetEnviron();
+#endif
+
         envsize = kit_strv_length (environ);
         envp = kit_new0 (char *, envsize + 3);
         if (envp == NULL)

