Patch for RH 6.2 support, add --disable-guppi configure option
Derek Atkins
warlord@MIT.EDU
18 Jan 2001 10:06:05 -0500
Hi,
This patch adds a configure option --disable-guppi which allows you to
build without guppi support. This adds a USE_GUPPI definition which
gets set when guppi is being used (the default). When USE_GUPPI is
not set, GnuCash will just ignore embedded guppi objects within HTML.
This patch also fixes the problem on RH 6.2 where libghttp exists but
is unknown to gnome-config. The problem is that the AC_CHECK_LIB
succeeds, but GHTTP_LIBS are empty.
Last, this fixes gnc.gwp to allow more stackspace when it's being
g-wrapped.
-derek
Index: acconfig.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/acconfig.h,v
retrieving revision 1.14
diff -u -r1.14 acconfig.h
--- acconfig.h 2001/01/17 23:12:25 1.14
+++ acconfig.h 2001/01/18 14:58:43
@@ -59,6 +59,9 @@
/* The db1 database library */
#undef PREFER_DB1
+/* Should we add guppi support? */
+#undef USE_GUPPI
+
/* Use the new gtkhtml widget instead of the old xmhtml widget */
#undef HAVE_LIBGTKHTML
Index: configure.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/configure.in,v
retrieving revision 1.157
diff -u -r1.157 configure.in
--- configure.in 2001/01/17 23:12:25 1.157
+++ configure.in 2001/01/18 14:58:43
@@ -283,9 +283,13 @@
GHTTP_LIBS=`$GNOME_CONFIG --libs ghttp`
GHTTP_CFLAGS=`$GNOME_CONFIG --cflags ghttp`
+# Note: this doesn't croak if GHTTP_LIBS is empty! (e.g. on RH6.2)
AC_CHECK_LIB(ghttp, ghttp_request_new,
GNOMEBUILDLIBS="${GNOMEBUILDLIBS} ghttp"
- AC_DEFINE(HAVE_LIBGHTTP),
+ AC_DEFINE(HAVE_LIBGHTTP)
+ if test "x$GHTTP_LIBS" = "x" ; then
+ GHTTP_LIBS=-lghttp
+ fi,
AC_MSG_ERROR([Cannot find ghttp. See the README for more info.]),
$GHTTP_LIBS)
@@ -299,6 +303,20 @@
### --------------------------------------------------------------------------
### guppi
+AC_ARG_ENABLE( guppi,
+ [ --disable-guppi compile without guppi support],
+ if test $enableval = no; then
+ USE_GUPPI=0
+ else
+ USE_GUPPI=1
+ fi,
+ USE_GUPPI=1 )
+
+if test $USE_GUPPI = 0; then
+ AC_MSG_WARN([Compiling without guppi support])
+else
+ AC_DEFINE(USE_GUPPI)
+
## Things guppi needs (actually are these guppi dependencies or gtkhtml's?)
# LAME: if you ask gnome-config for the zvt libs, it doesn't include
@@ -329,6 +347,7 @@
AC_SUBST(GUPPI_LIBS)
AC_SUBST(GUPPI_CFLAGS)
+fi
### --------------------------------------------------------------------------
### XIM
Index: src/gnome/gnc-html-embedded.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/gnc-html-embedded.c,v
retrieving revision 1.2
diff -u -r1.2 gnc-html-embedded.c
--- src/gnome/gnc-html-embedded.c 2001/01/12 23:07:04 1.2
+++ src/gnome/gnc-html-embedded.c 2001/01/18 14:58:45
@@ -24,7 +24,9 @@
#include <gnome.h>
#include <glib.h>
+#ifdef USE_GUPPI
#include <libguppitank/guppi-tank.h>
+#endif
#include "gnc-html-embedded.h"
#include "mainwindow-account-tree.h"
@@ -98,6 +100,7 @@
}
+#ifdef USE_GUPPI
/********************************************************************
* gnc_html_embedded_piechart
* create a Guppi piechart from an HTML <object> block
@@ -392,6 +395,7 @@
return rv;
}
+#endif /* USE_GUPPI */
/********************************************************************
* gnc_html_embedded_account_tree
Index: src/gnome/gnc-html.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/gnc-html.c,v
retrieving revision 1.7
diff -u -r1.7 gnc-html.c
--- src/gnome/gnc-html.c 2001/01/17 23:21:30 1.7
+++ src/gnome/gnc-html.c 2001/01/18 14:58:45
@@ -28,7 +28,9 @@
#include <unistd.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
+#ifdef USE_GUPPI
#include <libguppitank/guppi-tank.h>
+#endif
#include <gnome.h>
#include <regex.h>
#include <glib.h>
@@ -549,6 +551,7 @@
}
+#ifdef USE_GUPPI
static void
gnc_html_guppi_print_cb(GtkHTMLEmbedded * eb, GnomePrintContext * pc,
gpointer data) {
@@ -567,6 +570,7 @@
gpointer data) {
/* nothing special to do */
}
+#endif /* USE_GUPPI */
/********************************************************************
* gnc_html_object_requested_cb - called when an applet needs to be
@@ -580,8 +584,10 @@
int retval = FALSE;
if(!strcmp(eb->classid, "gnc-guppi-pie")) {
+#ifdef USE_GUPPI
widg = gnc_html_embedded_piechart(eb->width, eb->height,
eb->params);
+#endif /* USE_GUPPI */
if(widg) {
gtk_widget_show_all(widg);
gtk_container_add(GTK_CONTAINER(eb), widg);
@@ -590,8 +596,10 @@
retval = TRUE;
}
else if(!strcmp(eb->classid, "gnc-guppi-bar")) {
+#ifdef USE_GUPPI
widg = gnc_html_embedded_barchart(eb->width, eb->height,
eb->params);
+#endif /* USE_GUPPI */
if(widg) {
gtk_widget_show_all(widg);
gtk_container_add(GTK_CONTAINER(eb), widg);
@@ -600,8 +608,10 @@
retval = TRUE;
}
else if(!strcmp(eb->classid, "gnc-guppi-scatter")) {
+#ifdef USE_GUPPI
widg = gnc_html_embedded_scatter(eb->width, eb->height,
eb->params);
+#endif /* USE_GUPPI */
if(widg) {
gtk_widget_show_all(widg);
gtk_container_add(GTK_CONTAINER(eb), widg);
@@ -620,7 +630,7 @@
retval = TRUE;
}
-#if 0
+#if 0 && defined(USE_GUPPI)
if(widg) {
gtk_signal_connect(GTK_OBJECT(eb), "draw_gdk",
GTK_SIGNAL_FUNC(gnc_html_guppi_redraw_cb),
Index: src/gnome/top-level.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/top-level.c,v
retrieving revision 1.68
diff -u -r1.68 top-level.c
--- src/gnome/top-level.c 2001/01/15 22:13:19 1.68
+++ src/gnome/top-level.c 2001/01/18 14:58:45
@@ -27,7 +27,9 @@
#include <gnome.h>
#include <gtkhtml/gtkhtml.h>
#include <guile/gh.h>
+#ifdef USE_GUPPI
#include <libguppitank/guppi-tank.h>
+#endif
#include <popt.h>
#include <stdlib.h>
@@ -208,8 +210,10 @@
gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
gtk_widget_set_default_visual (gdk_rgb_get_visual ());
+#ifdef USE_GUPPI
/* initialize guppi */
guppi_tank_init();
+#endif
app = gnome_app_new("GnuCash", "GnuCash");
Index: src/guile/gnc.gwp
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/guile/gnc.gwp,v
retrieving revision 1.53
diff -u -r1.53 gnc.gwp
--- src/guile/gnc.gwp 2001/01/17 23:21:32 1.53
+++ src/guile/gnc.gwp 2001/01/18 14:58:46
@@ -2,6 +2,9 @@
(use-modules (g-wrap))
+(debug-set! maxdepth 100000)
+(debug-set! stack 2000000)
+
(let ((mod (gw:new-module "gnc")))
;; (define current-gnc-compile-flavor #f)
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available