[PATCH] Darwin-related fix for libgnome



Patch for HEAD. Details in ChangeLog. I have commit access.

-- 
Hans Petter Jansson | <hpj novell com>
Evolution Developer | http://hp.cl.no/
? depcomp
? gtk-doc.make
? libgnome-darwin.patch
? stamp-h1
? doc/reference/version.xml
? libgnome/stamp-libgnometypebuiltins.h
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnome/ChangeLog,v
retrieving revision 1.400
diff -u -p -r1.400 ChangeLog
--- ChangeLog	25 Jan 2005 21:51:58 -0000	1.400
+++ ChangeLog	28 Jan 2005 21:31:57 -0000
@@ -1,3 +1,10 @@
+2005-01-28  Hans Petter Jansson  <hpj novell com>
+
+	* configure.in: Detect _NSGetEnviron() and crt_externs.h on Darwin.
+
+	* libgnome/gnome-util.c: Call _NSGetEnviron() to get the environment
+	on Darwin. Prevents build breakage.
+
 ===================== 2.9.1 ==================
 
 2005-01-25  Kjartan Maraas  <kmaraas gnome org>
Index: configure.in
===================================================================
RCS file: /cvs/gnome/libgnome/configure.in,v
retrieving revision 1.203
diff -u -p -r1.203 configure.in
--- configure.in	8 Nov 2004 21:08:17 -0000	1.203
+++ configure.in	28 Jan 2005 21:31:57 -0000
@@ -73,6 +73,17 @@ AC_CHECK_FUNCS([setenv unsetenv clearenv
 AC_CHECK_HEADERS(sys/fsuid.h)
 AC_CHECK_FUNCS(bind_textdomain_codeset)
 
+# Checks for Apple Darwin
+
+AC_CHECK_FUNC(_NSGetEnviron, have_ns_getenviron=yes)
+if test x$have_ns_getenviron = xyes; then
+  AC_DEFINE(HAVE_NSGETENVIRON, 1, [whether we have _NSGetEnviron])
+fi
+AC_CHECK_HEADER(crt_externs.h, have_crt_externs=yes)
+if test x$have_crt_externs = xyes; then
+  AC_DEFINE(HAVE_CRT_EXTERNS_H, 1, [whether we have crt_externs.h])
+fi
+
 GETTEXT_PACKAGE=libgnome-2.0
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package])
Index: libgnome/gnome-util.c
===================================================================
RCS file: /cvs/gnome/libgnome/libgnome/gnome-util.c,v
retrieving revision 1.75
diff -u -p -r1.75 gnome-util.c
--- libgnome/gnome-util.c	15 Aug 2004 17:27:59 -0000	1.75
+++ libgnome/gnome-util.c	28 Jan 2005 21:31:57 -0000
@@ -52,6 +52,11 @@
 #include <libgnome/gnome-program.h>
 #include <libgnome/gnome-util.h>
 
+#if defined(__APPLE__) && defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#endif
+
 /**
  * gnome_util_user_shell:
  *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]