[grisbi-devel] [PATCH 11/12] Fixes a compilation error when gofice is not installed

pbiava pierre.biava at nerim.net
Mon Mar 4 21:19:40 CET 2013


add check of libgsf-1 in configure.ac
---
 configure.ac         |  2 +-
 src/go-charmap-sel.c | 12 ++++++++----
 src/go-charmap-sel.h |  3 +++
 src/go-optionmenu.c  |  7 +++++--
 src/go-optionmenu.h  |  3 +++
 5 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index d7b47bd..9637ffa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ dnl ================================================================
 
 LT_LIB_M
 
-PKG_CHECK_MODULES(GRISBI, [gtk+-3.0 >= 3.0.12 glib-2.0 >= 2.28 zlib])
+PKG_CHECK_MODULES(GRISBI, [gtk+-3.0 >= 3.0.12 glib-2.0 >= 2.28 libgsf-1 >= 1.14 zlib])
 # Temporary hack until Mandriva ships zlib.pc
 #PKG_CHECK_MODULES(GRISBI, [gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.18.0 gmodule-2.0 >= 2.18.0])
 GRISBI_LIBS="$LIBM $GRISBI_LIBS"
diff --git a/src/go-charmap-sel.c b/src/go-charmap-sel.c
index c4cad8d..c334dec 100644
--- a/src/go-charmap-sel.c
+++ b/src/go-charmap-sel.c
@@ -26,13 +26,14 @@
 #include <config.h>
 #endif
 
-/*#include <goffice/goffice-config.h>
-*/
+#ifdef HAVE_GOFFICE
+    #include <goffice/goffice.h>
+#else
 #include "go-charmap-sel.h"
 #include "go-optionmenu.h"
-/*#include <goffice/utils/go-glib-extras.h>
-*/#include <glib/gi18n-lib.h>
 #include <gsf/gsf-impl-utils.h>
+
+#include <glib/gi18n-lib.h>
 #include <string.h>
 #include <stdlib.h>
 
@@ -723,3 +724,6 @@ cs_get_property (GObject     *object,
 		break;
 	}
 }
+
+
+#endif /* HAVE_GOFFICE */
diff --git a/src/go-charmap-sel.h b/src/go-charmap-sel.h
index 927919b..d6c9061 100644
--- a/src/go-charmap-sel.h
+++ b/src/go-charmap-sel.h
@@ -1,3 +1,5 @@
+#ifndef HAVE_GOFFICE
+
 /*
  *  Copyright (C) 2003 Andreas J. Guelzow
  *
@@ -50,3 +52,4 @@ const char  *go_charmap_sel_get_encoding_name (GOCharmapSel *cs, const char *enc
 G_END_DECLS
 
 #endif /* _GO_CHARMAP_SEL_H_ */
+#endif /* HAVE_GOFFICE */
diff --git a/src/go-optionmenu.c b/src/go-optionmenu.c
index 29e6630..32ed8a2 100644
--- a/src/go-optionmenu.c
+++ b/src/go-optionmenu.c
@@ -35,8 +35,9 @@
 #include <config.h>
 #endif
 
-/*#include <goffice/goffice-config.h>
-*/
+#ifdef HAVE_GOFFICE
+    #include <goffice/goffice.h>
+#else
 #include "go-optionmenu.h"
 
 #include <gdk/gdkkeysyms.h>
@@ -490,3 +491,5 @@ go_option_menu_get_type (void)
 
 	return option_menu_type;
 }
+
+#endif /* HAVE_GOFFICE */
diff --git a/src/go-optionmenu.h b/src/go-optionmenu.h
index 5dbf376..ce30202 100644
--- a/src/go-optionmenu.h
+++ b/src/go-optionmenu.h
@@ -1,3 +1,5 @@
+#ifndef HAVE_GOFFICE
+
 /*
  * go-optionmenu.h
  *
@@ -84,3 +86,4 @@ GtkWidget *go_option_menu_get_history (GOOptionMenu *option_menu);
 G_END_DECLS
 
 #endif /* _GO_OPTIONMENU_H_ */
+#endif /* HAVE_GOFFICE */
-- 
1.8.1.5



More information about the devel mailing list