[evolution-patches] Make libgnome segv handler optional



Hi,

Attached is a patch which adds a new option to the configure script,
--without-libgnome.  When called with --with-libgnome (the default)
WITH_LIBGNOME is defined, otherwise it is undefined.

This currently makes the check for gnome_segv in configure.in optional,
and follows through that change into src/server.c, so when libgnome is
disabled a segfault is just a segfault.

The patch also removes gnome_program_init() as I believe the side
effects of calling it are not used: libgnome is not used in the rest of
the servers code, and the segfault handler is registered manually.

Coming shortly are other patches to remove the last few traces of
libgnome[ui] from libedataserverui.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution-data-server/configure.in,v
retrieving revision 1.97
diff -u -r1.97 configure.in
--- configure.in	11 Apr 2005 12:21:26 -0000	1.97
+++ configure.in	18 Apr 2005 11:51:30 -0000
@@ -1005,6 +1005,16 @@
 	;;
 esac
 
+dnl Should we use libgnome functions or not
+AC_MSG_CHECKING(if we should use libgnome)
+AC_ARG_WITH(libgnome, [  --with-libgnome=[yes,no]        Disable the use of libgnome.],
+	with_libgnome="$withval", with_libgnome="yes")
+if test "x${with_libgnome}" != "xno"; then
+        AC_DEFINE(WITH_LIBGNOME, 1, [Define if libgnome should be used])
+fi
+AC_MSG_RESULT($with_libgnome)
+
+
 AM_PATH_ORBIT2(2.9.8)
 
 AC_MSG_CHECKING(for CORBA include paths)
@@ -1012,10 +1022,12 @@
 AC_MSG_RESULT($IDL_INCLUDES)
 AC_SUBST(IDL_INCLUDES)
 
-AC_MSG_CHECKING(for libgnomeui server directory)
-GNOMEUI_SERVERDIR="`$PKG_CONFIG --variable=libgnomeui_serverdir libgnomeui-2.0`"
-AC_MSG_RESULT($GNOMEUI_SERVERDIR)
-AC_DEFINE_UNQUOTED(GNOMEUI_SERVERDIR, "$GNOMEUI_SERVERDIR", [Path where we can find gnome_segv2])
+if test "x${with_libgnome}" != "xno"; then
+        AC_MSG_CHECKING(for libgnomeui server directory)
+        GNOMEUI_SERVERDIR="`$PKG_CONFIG --variable=libgnomeui_serverdir libgnomeui-2.0`"
+        AC_MSG_RESULT($GNOMEUI_SERVERDIR)
+        AC_DEFINE_UNQUOTED(GNOMEUI_SERVERDIR, "$GNOMEUI_SERVERDIR", [Path where we can find gnome_segv2])
+fi
 
 dnl Utility macro to set compiler flags for a specific lib.
 AC_DEFUN(EVO_SET_COMPILE_FLAGS, [
Index: src/server.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/src/server.c,v
retrieving revision 1.25
diff -u -r1.25 server.c
--- src/server.c	3 Feb 2005 16:35:03 -0000	1.25
+++ src/server.c	18 Apr 2005 11:51:31 -0000
@@ -76,6 +76,7 @@
 
 static GStaticMutex termination_lock = G_STATIC_MUTEX_INIT;
 
+#if WITH_LIBGNOME
 static pthread_mutex_t segv_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_t main_thread;
 
@@ -127,6 +128,7 @@
 	main_thread = pthread_self();
 	pthread_mutex_lock(&segv_mutex);
 }
+#endif
 
 
 /* Termination */
@@ -298,17 +300,14 @@
 	signal (SIGUSR2, dump_backends);
 #endif
 
-       	gnome_program_init (PACKAGE, VERSION,
-			    LIBGNOME_MODULE,
-			    argc, argv,
-			    GNOME_PROGRAM_STANDARD_PROPERTIES, NULL);
-
 	bonobo_init_full (&argc, argv,
 			  bonobo_activation_orb_get(),
 			  CORBA_OBJECT_NIL,
 			  CORBA_OBJECT_NIL);
 	
+#if WITH_LIBGNOME	
 	setup_segv_handler ();
+#endif
 
 	e_data_server_module_init ();
 

Attachment: signature.asc
Description: This is a digitally signed message part



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