[distcc] 2.11 needs gnome for GUI monitor?

Martin Pool mbp at samba.org
Mon Sep 29 06:22:59 GMT 2003


On 25 Sep 2003, distcc at rgm.nu wrote:
> Well Martin,
> 
> To be fair, it doesn't personally affect me, because I happen to
> have gnome installed.  I was just looking out for my fellow Gentoo
> linux users who do not, and trying to save them from compiling a
> large set of gnome libraries for a relatively small piece of
> functionality if they have "-gnome" in their USE flag settings (how
> a Gentooer customizes his/her builds).  I just wanted to speak up
> before this got swept under the rug.

Can you please try this patch, which adds a Gentoo-stylee choice
of either --with-gtk or --with-gnome?  

In particular will somebody please test on the important case of
having libgtk but not libgnome?

The differences are pretty small; you will basically just miss
standard Gnome features like session management and a crash dialog.
The program is called distccmon-gnome either way.

After applying the patch you must run

  make distclean
  ./autogen.sh


Index: configure.ac
===================================================================
RCS file: /data/cvs/distcc/configure.ac,v
retrieving revision 1.181
retrieving revision 1.185
diff -u -u -r1.181 -r1.185
--- configure.ac	23 Sep 2003 05:58:22 -0000	1.181
+++ configure.ac	29 Sep 2003 06:16:41 -0000	1.185
@@ -11,7 +11,7 @@
 
 # As of 0.6cvs, distcc no longer uses automake, only autoconf.
 AC_PREREQ(2.53)
-AC_INIT(distcc, 2.11, [distcc at lists.samba.org])
+AC_INIT(distcc, 2.11.1cvs, [distcc at lists.samba.org])
 AC_CONFIG_HEADERS(src/config.h)
 AC_CANONICAL_HOST
 
@@ -52,27 +52,39 @@
 
 AC_ARG_WITH(gnome,
         AC_HELP_STRING([--with-gnome], [build GNOME-based monitor]),
-        GNOME_BIN=distccmon-gnome)
+        [GNOME_BIN=distccmon-gnome
+         AC_DEFINE(WITH_GNOME,1,[Use GNOME])])
+
+AC_ARG_WITH(gtk,
+        AC_HELP_STRING([--with-gtk], [build GTK+-based monitor]),
+        [GNOME_BIN=distccmon-gnome
+         AC_DEFINE(WITH_GTK,1,[Use GTK+])])
 
 AC_ARG_ENABLE(profile,
         AC_HELP_STRING([--enable-profile], [turn on gprof]),
         CFLAGS="$CFLAGS -pg -g")
 
-GNOME_PACKAGES="gtk+-2.0 libglade-2.0 libgnome-2.0 libgnomeui-2.0 pango"
-AC_SUBST(GNOME_PACKAGES)
 if test "${with_gnome+set}" = set
 then 
-    for pkg in $GNOME_PACKAGES
-    do
-        AC_MSG_CHECKING([version of $pkg])
-        if gnomevers=`pkg-config --modversion $pkg`
-        then
-            AC_MSG_RESULT($gnomevers)
-        else
-            AC_MSG_ERROR([$pkg was not found by pkg-config])        
-        fi
-    done
+    GNOME_PACKAGES="gtk+-2.0 libglade-2.0 libgnome-2.0 libgnomeui-2.0 pango"
+elif test "${with_gtk+set}" = set
+then
+    GNOME_PACKAGES="gtk+-2.0 libglade-2.0"
+else
+    GNOME_PACKAGES=""
 fi
+
+for pkg in $GNOME_PACKAGES
+do
+    AC_MSG_CHECKING([version of $pkg])
+    if gnomevers=`pkg-config --modversion $pkg`
+    then
+        AC_MSG_RESULT($gnomevers)
+    else
+        AC_MSG_ERROR([$pkg was not found by pkg-config])        
+    fi
+done
+AC_SUBST(GNOME_PACKAGES)
 
 dnl Checks for programs
 AC_PROG_CC
Index: src/mon-gnome.c
===================================================================
RCS file: /data/cvs/distcc/src/mon-gnome.c,v
retrieving revision 1.44
retrieving revision 1.46
diff -u -u -r1.44 -r1.46
--- src/mon-gnome.c	23 Sep 2003 04:23:05 -0000	1.44
+++ src/mon-gnome.c	29 Sep 2003 06:08:19 -0000	1.46
@@ -56,9 +56,12 @@
 #include <pwd.h>
 #include <unistd.h>
 
-#include <gnome.h>
+#ifdef WITH_GNOME
+#  include <gnome.h>
+#endif
+
+#include <gtk/gtk.h>
 #include <glade/glade.h>
-#include <pango/pango.h>
 
 #include "types.h"
 #include "distcc.h"
@@ -564,9 +567,15 @@
    * compilation */
   nice(5);
 
+#if defined(WITH_GNOME)
   gnome_program_init ("distccmon-gnome", PACKAGE_VERSION,
 		      LIBGNOMEUI_MODULE,
 		      argc, argv, NULL);
+#elif defined(WITH_GTK)
+  gtk_init (&argc, &argv);
+#else
+#  error This program must be built with either WITH_GTK or WITH_GNOME
+#endif
 
   if (access(glade_file = "distccmon-gnome.glade", R_OK) == -1 &&
       access(glade_file = "gnome/distccmon-gnome.glade", R_OK) == -1 &&
Index: src/renderer.c
===================================================================
RCS file: /data/cvs/distcc/src/renderer.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- src/renderer.c	23 Sep 2003 04:23:05 -0000	1.2
+++ src/renderer.c	29 Sep 2003 06:06:44 -0000	1.3
@@ -53,9 +53,8 @@
 #include <pwd.h>
 #include <unistd.h>
 
-#include <gnome.h>
-#include <glade/glade.h>
-#include <pango/pango.h>
+#include <glib.h>
+#include <gtk/gtk.h>
 
 #include "types.h"
 #include "distcc.h"
@@ -282,7 +281,7 @@
   cell_class->get_size = dcc_cell_renderer_chart_get_size;
 
   spec = g_param_spec_pointer ("history",
-                               _("Slot history"),
+                               "Slot history",
                                "",
                                G_PARAM_READABLE | G_PARAM_WRITABLE);
     
Index: src/state.h
===================================================================
RCS file: /data/cvs/distcc/src/state.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- src/state.h	23 Sep 2003 04:23:05 -0000	1.9
+++ src/state.h	27 Sep 2003 13:13:48 -0000	1.10
@@ -20,8 +20,15 @@
  * USA
  */
 
+#ifndef _DISTCC_STATE_H
+#define _DISTCC_STATE_H
+
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int dcc_get_state_dir (char **p);
 int dcc_open_state_file (int *p_fd);
 
@@ -78,3 +85,9 @@
 const char *dcc_get_state_name(enum dcc_state state);
 
 void dcc_note_state_slot(int slot);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _DISTCC_STATE_H */




-- 
Martin 



More information about the distcc mailing list