]> Pileus Git - ~andy/gtk/commitdiff
Check for crt_extern.h and _NSGetEnviron. Fix compilation on Darwin where
authorMatthias Clasen <mclasen@redhat.com>
Sun, 10 Dec 2006 06:31:53 +0000 (06:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 10 Dec 2006 06:31:53 +0000 (06:31 +0000)
2006-12-10  Matthias Clasen  <mclasen@redhat.com>

        * configure.in: Check for crt_extern.h and _NSGetEnviron.
        * gdk/x11/gdkspawn-x11.c: Fix compilation on Darwin where
        environ is not available.  (#384168, Min Sik Kim)

ChangeLog
configure.in
gdk/x11/gdkspawn-x11.c

index 76ebf663ad0fb51abd22373d3ce74a78d1245cf9..f9a95f079b5dcfd32c3bfd34165518b812c363f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-10  Matthias Clasen  <mclasen@redhat.com>
+
+       * configure.in: Check for crt_extern.h and _NSGetEnviron.
+       * gdk/x11/gdkspawn-x11.c: Fix compilation on Darwin where
+       environ is not available.  (#384168, Min Sik Kim)
+
 2006-12-07  Paolo Maggi  <paolo@gnome.org>
 
        Fixes bug #383407
index 5a55b06f2680d40dd2a5381fd4c9e3ca75d749d6..b005dfa49d54f0435d1261666b9f9305787761ec 100644 (file)
@@ -728,6 +728,10 @@ else
         pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
         pixbuf_deplibs_check=`$pixbuf_libtool_config | \
             grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+# Checks for gdkspawn
+AC_CHECK_HEADERS(crt_externs.h)
+AC_CHECK_FUNCS(_NSGetEnviron)
+
             sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
         if test "x$pixbuf_deplibs_check" = "xnone" || \
            test "x$pixbuf_deplibs_check" = "xunknown" || \
index ced2b93e8b180dc07477697f65b6c75b499eeb73..f29021349041d82606a8be42266875219c8bf2da 100644 (file)
 #include <config.h>
 #include <string.h>
 
+#ifdef HAVE_CRT_EXTERNS_H 
+#include <crt_externs.h> /* for _NSGetEnviron */
+#endif
+
 #include "gdkspawn.h"
 
 #include <glib.h>
 #include <gdk/gdk.h>
 #include "gdkalias.h"
+  
+#ifdef HAVE__NSGETENVIRON
+#define environ (*_NSGetEnviron())
+#else
 
+/* According to the Single Unix Specification, environ is not in 
+ * any system header, although unistd.h often declares it.
+ */
 extern char **environ;
+#endif
 
 /**
  * gdk_make_spawn_environment_for_screen: