Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gcalctool/Makefile.am,v
retrieving revision 1.14
diff -u -r1.14 Makefile.am
--- Makefile.am	26 Jul 2004 21:15:29 -0000	1.14
+++ Makefile.am	23 Mar 2005 16:44:26 -0000
@@ -28,8 +28,17 @@
 
 SUBDIRS = po gcalctool help
 
+SCHEMAS_FILE = gcalctool.schemas
+
+### Install the schemas file in /etc if GNOME support is not compiled in,
+### and do not install the schemas at all
+if DISABLE_GNOME
+schemasdir = $(sysconfdir)/gcalctool
+schemas_DATA = $(SCHEMAS_FILE)
+else
 schemadir = $(GCONF_SCHEMA_FILE_DIR)
-schema_DATA = gcalctool.schemas
+schema_DATA = $(SCHEMAS_FILE)
+endif
 
 EXTRA_DIST = \
 	autogen.sh \
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gcalctool/configure.in,v
retrieving revision 1.300
diff -u -r1.300 configure.in
--- configure.in	22 Mar 2005 13:29:16 -0000	1.300
+++ configure.in	23 Mar 2005 16:44:26 -0000
@@ -38,9 +38,36 @@
 	AC_MSG_ERROR($YACC is not usable as yacc - consider using bison)
 fi
 
+dnl ###########################################################################
+dnl Disable GNOME support
+dnl ###########################################################################
+AC_ARG_ENABLE(gnome,
+        [  --disable-gnome        Remove GNOME support. Don't do this, it removes essential features],
+        disable_gnome=yes, disable_gnome=no)
+
+AC_MSG_CHECKING(whether GNOME support must be compiled in)
+if test x"${disable_gnome}" = xyes; then
+   AC_MSG_RESULT([no])
+else
+   AC_MSG_RESULT([yes])
+fi
+AM_CONDITIONAL(DISABLE_GNOME, test x"${disable_gnome}" = xyes)
+
+
+dnl ###########################################################################
+dnl PKG_CONFIG and required versions
+dnl ###########################################################################
+if test x"${disable_gnome}" = xyes; then
+GNOME_UTIL_CFLAGS="-DDISABLE_GNOME"
+AC_DEFINE(DISABLE_GNOME, 1, [ Remove GNOME support. ])
+else
 PKG_CHECK_MODULES(GNOME_UTILS, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
+GNOME_UTIL_CFLAGS="$GNOME_UTIL_CFLAGS"
+GNOME_UTIL_LIBS="$GNOME_UTIL_LIBS"
+fi
 AC_SUBST(GNOME_UTILS_CFLAGS)
 AC_SUBST(GNOME_UTILS_LIBS)
+
 
 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 1.1.9)
 AC_SUBST(GCONF_CFLAGS)
Index: gcalctool/gtk.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/gtk.c,v
retrieving revision 1.162
diff -u -r1.162 gtk.c
--- gcalctool/gtk.c	10 Mar 2005 17:10:54 -0000	1.162
+++ gcalctool/gtk.c	23 Mar 2005 16:44:26 -0000
@@ -35,7 +35,9 @@
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
+#ifndef DISABLE_GNOME
 #include <gnome.h>
+#endif /*DISABLE_GNOME*/
 #include <gconf/gconf-client.h>
 #include "ce_parser.h"
 
@@ -168,7 +170,9 @@
                         const gchar *, const gchar *, gpointer);
 static void create_con_fun_menu(enum menu_type);
 static void create_menu_item_with_markup(char *, int, int);
+#ifndef DISABLE_GNOME
 static void die_cb(GnomeClient *client, gpointer data);
+#endif /*DISABLE_GNOME*/
 static void disp_cb(GtkToggleButton *, gpointer);
 static void hyp_cb(GtkToggleButton *, gpointer);
 static void inv_cb(GtkToggleButton *, gpointer);
@@ -431,7 +435,9 @@
 int
 main(int argc, char **argv)
 {
+#ifndef DISABLE_GNOME
     GnomeClient  *client;
+#endif /*DISABLE_GNOME*/
 
     v = (Vars)  LINT_CAST(calloc(1, sizeof(struct calcVars)));
     X = (XVars) LINT_CAST(calloc(1, sizeof(struct Xobject)));
@@ -440,14 +446,22 @@
     bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
     textdomain(GETTEXT_PACKAGE);
 
+#ifndef DISABLE_GNOME
     gnome_program_init("gcalctool", VERSION, LIBGNOMEUI_MODULE, argc, argv,
                         NULL, NULL, NULL);
 
-    X->lnp = get_localized_numeric_point();
-
     /* Connect to the die signal. */
     client = gnome_master_client();
     g_signal_connect(client, "die", G_CALLBACK(die_cb), NULL);
+#else
+    gtk_set_locale();
+    gtk_init(&argc, &argv);
+#ifdef WANTED
+    add_pixmap_directory(PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
+#endif /*WANTED*/
+#endif /*DISABLE_GNOME*/
+
+    X->lnp = get_localized_numeric_point();
 
     gtk_rc_get_default_files();
 
@@ -699,6 +713,7 @@
     GArray *entries = (GArray *) g_object_get_data(G_OBJECT(dialog), "entries");
 
     if (id == GTK_RESPONSE_HELP) {
+#ifndef DISABLE_GNOME
         GError *error = NULL;
 
         gnome_help_display_desktop(NULL, "gcalctool", "gcalctool", 
@@ -716,6 +731,7 @@
             g_error_free(error);
             error = NULL;
         }
+#endif /*DISABLE_GNOME*/
         return;
     }
 
@@ -1441,12 +1457,14 @@
 }
 
 
+#ifndef DISABLE_GNOME
 /*ARGSUSED*/
 static void
 die_cb(GnomeClient *client, gpointer data)
 {
     gtk_main_quit();
 }
+#endif /*DISABLE_GNOME*/
 
 
 /*ARGSUSED*/
@@ -1738,6 +1756,7 @@
 static void
 help_cb()
 {
+#ifndef DISABLE_GNOME
     GError *error = NULL;
 
     gnome_help_display_desktop(NULL, "gcalctool", "gcalctool", NULL, &error);
@@ -1746,6 +1765,7 @@
         g_error_free(error);
         error = NULL;
     }
+#endif /*DISABLE_GNOME*/
 }
 
 
